quirk-ui 0.1.191 → 0.1.192
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/{CategoryFilters-Cey2Cd-d.js → CategoryFilters-4LrS4mcW.js} +1 -1
- package/dist/{CategoryFilters-D8NAFy1t.cjs → CategoryFilters-D2Hq3RjK.cjs} +1 -1
- package/dist/core/components/Button/Button.test.cjs +1 -1
- package/dist/core/components/Button/Button.test.mjs +1 -1
- package/dist/core/components/Button/index.cjs +1 -1
- package/dist/core/components/Button/index.mjs +1 -1
- package/dist/core/components/Footer/index.cjs +1 -1
- package/dist/core/components/Footer/index.mjs +1 -1
- package/dist/core/components/NavBar/index.cjs +2 -2
- package/dist/core/components/NavBar/index.mjs +21 -21
- package/dist/core.cjs +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{index-aWdsapYP.js → index--KCTRJKr.js} +24 -24
- package/dist/{index-0SVQqhAg.cjs → index-CUjZDv40.cjs} +1 -1
- package/dist/index66.css +1 -1
- package/dist/index66.css.d.ts +22 -22
- package/dist/main.cjs +1 -1
- package/dist/main.mjs +1 -1
- package/dist/next/blocks/DocumentListBlock/CategoryFilters.cjs +1 -1
- package/dist/next/blocks/DocumentListBlock/CategoryFilters.mjs +2 -2
- package/dist/next/blocks/DocumentListBlock/CategoryFilters.test.cjs +1 -1
- package/dist/next/blocks/DocumentListBlock/CategoryFilters.test.mjs +1 -1
- package/dist/next/blocks/DocumentListBlock/index.cjs +1 -1
- package/dist/next/blocks/DocumentListBlock/index.mjs +2 -2
- package/dist/next/blocks/FormBlock/index.cjs +1 -1
- package/dist/next/blocks/FormBlock/index.mjs +1 -1
- package/dist/next/blocks/TabsBlock/index.cjs +1 -1
- package/dist/next/blocks/TabsBlock/index.mjs +1 -1
- package/dist/next/blocks/WasHelpfulBlock/index.cjs +1 -1
- package/dist/next/blocks/WasHelpfulBlock/index.mjs +1 -1
- package/dist/next/cards/SpotlightCard/index.cjs +1 -1
- package/dist/next/cards/SpotlightCard/index.mjs +1 -1
- package/dist/next/ui/CallToAction/index.cjs +1 -1
- package/dist/next/ui/CallToAction/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/core/utils/RenderAsRichtext.tsx/index.cjs +0 -1
- package/dist/core/utils/RenderAsRichtext.tsx/index.mjs +0 -5
- /package/dist/core/utils/{RenderAsRichtext.cjs → RenderAsRichtext/index.cjs} +0 -0
- /package/dist/core/utils/{RenderAsRichtext.mjs → RenderAsRichtext/index.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as _, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { B as k } from "./index
|
|
2
|
+
import { B as k } from "./index--KCTRJKr.js";
|
|
3
3
|
import { X as x } from "./x-CnsEH4Ox.js";
|
|
4
4
|
import './CategoryFilters.css';const p = "_documentList_x1tkl_1", u = "_container_x1tkl_9", m = "_heading_x1tkl_20", b = "_title_x1tkl_25", f = "_eyebrow_x1tkl_30", H = "_listContainer_x1tkl_34", L = "_listWrapper_x1tkl_45", S = "_list_x1tkl_34", F = "_listHeader_x1tkl_66", w = "_listSearch_x1tkl_79", y = "_clearSearch_x1tkl_106", g = "_listHeaderFilters_x1tkl_125", C = "_listResults_x1tkl_136", v = "_listSort_x1tkl_140", N = "_filterToggle_x1tkl_163", I = "_filterHeader_x1tkl_178", M = "_loadMore_x1tkl_199", R = "_filterList_x1tkl_203", T = "_listFilters_x1tkl_210", W = "_applyFilters_x1tkl_218", j = "_show_x1tkl_247", B = "_hide_x1tkl_256", $ = "_buttonIsLoading_x1tkl_307", e = {
|
|
5
5
|
documentList: p,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require('./CategoryFilters.css');const t=require("react/jsx-runtime"),x=require("./index-
|
|
1
|
+
"use strict";require('./CategoryFilters.css');const t=require("react/jsx-runtime"),x=require("./index-CUjZDv40.cjs"),h=require("./x-Dft9NVe_.cjs"),k="_documentList_x1tkl_1",u="_container_x1tkl_9",p="_heading_x1tkl_20",b="_title_x1tkl_25",y="_eyebrow_x1tkl_30",F="_listContainer_x1tkl_34",H="_listWrapper_x1tkl_45",L="_list_x1tkl_34",S="_listHeader_x1tkl_66",j="_listSearch_x1tkl_79",m="_clearSearch_x1tkl_106",f="_listHeaderFilters_x1tkl_125",g="_listResults_x1tkl_136",w="_listSort_x1tkl_140",C="_filterToggle_x1tkl_163",v="_filterHeader_x1tkl_178",q="_loadMore_x1tkl_199",N="_filterList_x1tkl_203",$="_listFilters_x1tkl_210",I="_applyFilters_x1tkl_218",M="_show_x1tkl_247",R="_hide_x1tkl_256",T="_buttonIsLoading_x1tkl_307",e={documentList:k,container:u,heading:p,title:b,eyebrow:y,listContainer:F,listWrapper:H,list:L,listHeader:S,listSearch:j,clearSearch:m,listHeaderFilters:f,listResults:g,listSort:w,filterToggle:C,filterHeader:v,loadMore:q,filterList:N,listFilters:$,applyFilters:I,show:M,hide:R,buttonIsLoading:T};function W({categoryFilters:l,selectedCategories:i,onSelectionChange:_,showFilters:r,toggleFilters:n,isLoading:o}){return t.jsxs("div",{className:`${e.listFilters} ${r?e.show:e.hide}`,children:[t.jsxs("div",{className:e.filterHeader,children:[t.jsx("h5",{children:"Filters"}),t.jsx("button",{onClick:n,children:t.jsx(h.X,{size:24})})]}),t.jsx("div",{className:e.filterList,children:l==null?void 0:l.map(s=>t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",value:s._id,checked:i.includes(s._id),onChange:c=>{const a=c.target.checked?[...i,s._id]:i.filter(d=>d!==s._id);_(a)}}),s.title]},s._id))}),t.jsx(x.Button,{as:"button",variant:"secondary",onClick:n,disabled:o,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-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:{formReference:{_id:"form-modal",heading:{title:[{_type:"block",_key:"a",children:[{_type:"span",_key:"b",text:"Contact Us",marks:[]}],markDefs:[],style:"normal"}]}}},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={formReference:{_id:"form-123",heading:{title:[{_type:"block",_key:"c",children:[{_type:"span",_key:"d",text:"Contact",marks:[]}],markDefs:[],style:"normal"}]}}};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:{formReference:{_id:"form-disabled"}},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:{formReference:{_id:"form-disabled"}},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
|
+
"use strict";const n=require("react/jsx-runtime"),e=require("../../../react.esm-C_9Ma9mj.cjs"),r=require("../../../index-CUjZDv40.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:{formReference:{_id:"form-modal",heading:{title:[{_type:"block",_key:"a",children:[{_type:"span",_key:"b",text:"Contact Us",marks:[]}],markDefs:[],style:"normal"}]}}},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={formReference:{_id:"form-123",heading:{title:[{_type:"block",_key:"c",children:[{_type:"span",_key:"d",text:"Contact",marks:[]}],markDefs:[],style:"normal"}]}}};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:{formReference:{_id:"form-disabled"}},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:{formReference:{_id:"form-disabled"}},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,6 +1,6 @@
|
|
|
1
1
|
import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
2
2
|
import { v as d, d as l, i as a, r as n, s as i, g as e, f as c } from "../../../react.esm-DjxyacK8.js";
|
|
3
|
-
import { B as r } from "../../../index
|
|
3
|
+
import { B as r } from "../../../index--KCTRJKr.js";
|
|
4
4
|
import "../../../index-DPGXWTtt.js";
|
|
5
5
|
const m = d.fn();
|
|
6
6
|
d.mock("../../context/ModalContext", () => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");require("../../context/ModalContext.cjs");const e=require("../../../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");require("../../context/ModalContext.cjs");const e=require("../../../index-CUjZDv40.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,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../context/ModalContext.mjs";
|
|
4
|
-
import { B as u } from "../../../index
|
|
4
|
+
import { B as u } from "../../../index--KCTRJKr.js";
|
|
5
5
|
import "../../../index-CeBA0PT0.js";
|
|
6
6
|
import "../../../external-link-BOPobeQJ.js";
|
|
7
7
|
import "../../../play-DYgKiSaf.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index52.css');const e=require("react/jsx-runtime"),k=require("../../../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index52.css');const e=require("react/jsx-runtime"),k=require("../../../index-CUjZDv40.cjs"),$=require("../ButtonGroup/index.cjs"),o=require("../../../index-CBK5rp6X.cjs"),F=require("../../../external-link-DDShu-48.cjs"),I="_footer_u2xhg_1",S="_container_u2xhg_9",q="_primaryNav_u2xhg_24",w="_secondaryNav_u2xhg_35",L="_details_u2xhg_72",A="_nav_u2xhg_86",B="_logo_u2xhg_94",E="_socialItems_u2xhg_109",C="_group_u2xhg_116",M="_groups_u2xhg_126",z="_groupTitle_u2xhg_137",G="_sublinks_u2xhg_146",Y="_link_u2xhg_154",O="_newTabIcon_u2xhg_172",P="_bottom_u2xhg_186",U="_left_u2xhg_197",D="_center_u2xhg_217",H="_right_u2xhg_247",n={footer:I,container:S,primaryNav:q,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:o.FaFacebook,Twitter:o.FaTwitter,LinkedIn:o.FaLinkedin,Instagram:o.FaInstagram,YouTube:o.FaYoutube},K={left:n.left,center:n.center,right:n.right};function Q({logo:u,items:d,primaryInfo:g,secondaryInfo:h,utilityItems:t,socialItems:i,alignment:m="left",copyright:x,className:v,style:j,...N}){const l=(s,r=!1)=>s.map((a,f)=>{var p;const y=a._key??`${a.label}-${f}`,c=!!((p=a.sublinks)!=null&&p.length),T=!!a.href,_=a.icon?J[a.icon]:void 0,b=e.jsxs(e.Fragment,{children:[!r&&a.label,_&&e.jsx(_,{"aria-hidden":"true"}),!_&&a.isExternal&&e.jsx(F.ExternalLink,{className:n.newTabIcon,size:14,"aria-hidden":"true"})]});return e.jsxs("div",{className:n.group,children:[T?e.jsx("a",{href:a.href,className:`${n.link}${c?` ${n.groupTitle}`:""}`,target:a.isExternal?"_blank":"_self",rel:a.isExternal?"noopener noreferrer":void 0,"aria-label":r?a.label:void 0,onClick:a.onClick,children:b}):e.jsx("span",{className:c?n.groupTitle:void 0,children:b}),c&&e.jsx("div",{className:n.sublinks,"aria-label":`${a.label} links`,children:l(a.sublinks)})]},y)});return e.jsx("footer",{className:`${n.footer} ${K[m]}${v?` ${v}`:""}`,style:j,...N,children:e.jsxs("div",{className:n.container,children:[e.jsxs("div",{className:n.primaryNav,children:[e.jsxs("div",{className:n.details,children:[u&&e.jsx("div",{className:n.logo,children:u}),i&&i.length>0&&e.jsx("div",{className:n.socialItems,"aria-label":"Social media links",children:l(i,!0)}),g&&e.jsx("div",{children:g}),h&&e.jsx("div",{children:h})]}),d.length>0&&e.jsx("nav",{className:n.nav,id:"footer-nav","aria-label":"Footer navigation",children:e.jsx("div",{className:n.groups,children:l(d)})})]}),e.jsxs("div",{className:n.secondaryNav,children:[x&&e.jsx("div",{className:n.bottom,children:e.jsx("span",{children:x})}),t&&t.length>0&&e.jsx("nav",{"aria-label":"Utility links",children:e.jsx($.ButtonGroup,{orientation:"horizontal",children:t.map((s,r)=>e.jsx(k.Button,{as:"a",href:s.href??"/",variant:s.variant??"primary",displayType:s.displayType??"text",imageSrc:s.imageSrc,imageAlt:s.imageAlt,"aria-label":s.ariaLabel??(typeof s.label=="string"?s.label:""),icon:s.icon,iconAlignment:s.iconAlignment,children:s.label},s._key??r))})})]})]})})}exports.Footer=Q;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as F } from "react/jsx-runtime";
|
|
2
|
-
import { B as $ } from "../../../index
|
|
2
|
+
import { B as $ } from "../../../index--KCTRJKr.js";
|
|
3
3
|
import { ButtonGroup as I } from "../ButtonGroup/index.mjs";
|
|
4
4
|
import { a as w, b as E, c as S, d as A, e as L } from "../../../index-CeBA0PT0.js";
|
|
5
5
|
import { E as B } from "../../../external-link-BOPobeQJ.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),ie=require("../Modal/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("react"),ie=require("../Modal/index.cjs"),D=require("../../../index-CUjZDv40.cjs"),Se=require("../ButtonGroup/index.cjs"),e=require("../../../NavLink-Cb-1fHPY.cjs"),A=require("../../../chevron-right-motlyADs.cjs"),Le=require("../../../x-Dft9NVe_.cjs"),re=require("../../../createLucideIcon-DpotSgUx.cjs"),oe=require("../../../external-link-DDShu-48.cjs"),_e=require("../../../chevron-down-DfK1XBl3.cjs");/**
|
|
2
2
|
* @license lucide-react v0.488.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Be=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],ze=re.createLucideIcon("search",Be),Re={standard:e.styles.standard,transparent:e.styles.transparent},qe={left:e.styles.left,center:e.styles.center,right:e.styles.right},De=({spotlight:n,renderText:h})=>{var x,w,f,k,N,z;const c=n.callToAction;if(!c)return null;const b=((x=c.linkOptions)==null?void 0:x.linkType)==="external";let d="#";return b&&((w=c.linkOptions)!=null&&w.externalUrl)?d=c.linkOptions.externalUrl:((f=c.linkOptions)==null?void 0:f.linkType)==="internal"&&((N=(k=c.linkOptions)==null?void 0:k.internalUrl)!=null&&N.slug.current)&&(d=`/${c.linkOptions.internalUrl.slug.current}`),s.jsxs("div",{className:e.styles.spotlight,children:[n.image&&s.jsx("div",{className:e.styles.imageWrapper,children:s.jsx("img",{src:((z=n.image.imageUrls)==null?void 0:z.medium)??"",alt:n.image.asset.altText||n.image.asset.description||"Content image",width:600,height:400})}),s.jsxs("div",{className:e.styles.content,children:[n.title&&s.jsx("div",{className:e.styles.title,children:h==null?void 0:h(n.title,e.styles.title)}),n.description&&s.jsx("div",{className:e.styles.description,children:h==null?void 0:h(n.description,e.styles.description)})]}),c.linkOptions&&s.jsx("div",{className:e.styles.actions,children:s.jsx(O.Button,{as:"a",variant:c.variant??"primary",href:d,target:b?"_blank":"_self",rel:b?"noopener noreferrer":void 0,"aria-label":c.ariaLabel||c.label,children:c.label})})]})};function D({item:n,animationDirection:h,onNavigate:c,onClose:b,isTopLevel:d=!1}){var f;const x=(((f=n.sublinks)==null?void 0:f.length)??0)>0,w=h==="forward"?e.styles.slideIn:e.styles.slideInBack;return s.jsx("div",{className:`${e.styles.mobileItem} ${w} ${d?e.styles.parentItem:""}`,role:"menuitem",children:x?s.jsxs("button",{className:e.styles.mobileTrigger,onClick:()=>c(n),children:[s.jsxs("span",{className:e.styles.mobileItemLabel,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.mobileItemSubtitle,children:n.subtitle})]}),s.jsx(A.ChevronRight,{size:16,className:e.styles.mobileChevron,"aria-hidden":"true"})]}):s.jsxs("a",{href:n.href??"#",className:e.styles.mobileLink,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,onClick:b,children:[s.jsxs("span",{className:e.styles.mobileItemLabel,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.mobileItemSubtitle,children:n.subtitle})]}),n.isExternal&&s.jsx(oe.ExternalLink,{size:14,className:e.styles.newTabIcon,"aria-hidden":"true"})]})})}function Oe({renderText:n,title:h,logo:c,items:b,groups:d,utilityItems:x,isSticky:w=!1,showSearch:f=!0,showLocaleSelect:k=!0,showThemeToggle:N=!0,themeToggleComponent:z,alignment:H="right",variant:X="standard",navigationType:$="default",searchComponent:ce,localeSelectComponent:de,className:ue,style:ye,...me}){const[u,C]=a.useState(!1),[F,j]=a.useState(null),[he,be]=a.useState(!1),[T,fe]=a.useState(!1),[pe,xe]=a.useState(null),[y,_]=a.useState([]),[g,P]=a.useState([]),[R,G]=a.useState(0),[ve,J]=a.useState(null),[v,je]=a.useState(!1),[E,I]=a.useState("forward"),W=a.useRef(null),S=a.useRef(null),Q=a.useRef(null),U=a.useRef(new Map),Z=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,role:"presentation",children:s.jsx("div",{className:`${e.styles.linkItem} ${e.styles.themeToggle}`,role:"presentation",children:z})}),Y=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} ${e.styles.searchWrapper}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(ie.Modal,{size:"lg",className:e.styles.searchModal,trigger:s.jsx("button",{title:"Search","aria-label":"Search",className:e.styles.search,children:s.jsx(ze,{size:16,"aria-hidden":"true"})}),content:ce})})}),ee=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(ie.Modal,{className:e.styles.localeModal,trigger:s.jsx("button",{title:"Locale Select","aria-label":"Locale Select",className:e.styles.locale,children:s.jsx(Me,{size:16,"aria-hidden":"true"})}),content:de})})}),se=()=>{C(l=>{const t=!l;return t||(_([]),P([]),I("forward"),j(null)),t})},le=a.useCallback(l=>{const t=U.current.get(l);if(t&&S.current){const o=t.getBoundingClientRect(),i=S.current.getBoundingClientRect();xe(o.left-i.left+o.width/2)}},[]),ke=a.useCallback(l=>{j(t=>t===l?null:l)},[]),K=a.useCallback(l=>{W.current&&!W.current.contains(l.target)&&j(null)},[]),V=a.useCallback(()=>{typeof window<"u"&&window.innerWidth>768&&(C(!1),j(null))},[]),Ne=()=>_([]),te=l=>{I("forward"),P(t=>[...t,{title:l.label,primary:l.sublinks??[],secondary:[],description:l.description}])},ge=()=>{I("backward"),P(l=>l.slice(0,-1))},we=l=>{I("forward"),_([{title:l.title,primary:l.primaryItems??[],secondary:l.secondaryItems??[],description:""}])},ne=l=>{I("forward"),_(t=>[...t,{title:l.label,primary:l.sublinks??[],secondary:[],description:l.description}])},$e=()=>{I("backward"),_(l=>l.slice(0,-1))};a.useEffect(()=>{if(typeof window>"u")return;const l=()=>je(window.innerWidth<768);return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]),a.useEffect(()=>{if(typeof window>"u")return;const l=()=>fe(window.scrollY>10);return l(),window.addEventListener("scroll",l,{passive:!0}),()=>window.removeEventListener("scroll",l)},[]),a.useEffect(()=>{const l=typeof window<"u",t=typeof document<"u";return l&&window.addEventListener("resize",V),t&&document.addEventListener("click",K),be(!0),()=>{l&&window.removeEventListener("resize",V),t&&document.removeEventListener("click",K)}},[V,K]),a.useEffect(()=>{if(!(typeof document>"u")){if(u){const l=window.scrollY;document.body.style.position="fixed",document.body.style.top=`-${l}px`,document.body.style.width="100%",document.body.style.overflowY="scroll"}else{const l=Math.abs(parseInt(document.body.style.top||"0",10));document.body.style.position="",document.body.style.top="",document.body.style.width="",document.body.style.overflowY="",window.scrollTo(0,l)}return()=>{const l=Math.abs(parseInt(document.body.style.top||"0",10));document.body.style.position="",document.body.style.top="",document.body.style.width="",document.body.style.overflowY="",l&&window.scrollTo(0,l)}}},[u]),a.useEffect(()=>{var o;if(!u)return;if(typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(pointer: fine)").matches){const i=(o=S.current)==null?void 0:o.querySelector('a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex="-1"])');i==null||i.focus()}const t=i=>{var B;if(i.key==="Escape"){se(),(B=Q.current)==null||B.focus();return}if(i.key!=="Tab"||!S.current)return;const p=Array.from(S.current.querySelectorAll('a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(r=>!r.closest("[aria-hidden=true]"));if(p.length===0)return;const m=p[0],M=p[p.length-1];i.shiftKey?document.activeElement===m&&(i.preventDefault(),M.focus()):document.activeElement===M&&(i.preventDefault(),m.focus())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[u]);const q=(l,t="")=>l.map((o,i)=>{const p=`${t}/${o._key??o.label}-${i}`;return s.jsx(e.NavLink,{link:o,path:p,parentPath:t,openPath:F,togglePath:ke,updateTriangleIndicator:le,setOpenPath:j,renderLinks:q,buttonRefs:U},p)}),Ce=l=>l.map((t,o)=>{var M,B;const i=`group-${o}`,p=ve===o,m=(M=t.primaryItems)==null?void 0:M[R??0];return s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{J(o),j(i),le(i)},children:[s.jsx("div",{className:e.styles.linkItem,children:s.jsxs("button",{ref:r=>{U.current.set(i,r)},"aria-haspopup":!0,"aria-expanded":p,"aria-controls":`submenu-${o}`,className:`${e.styles.sublinkToggle} ${p?e.styles.open:""}`,children:[t.title,s.jsx(_e.ChevronDown,{size:18,className:e.styles.chevron,"aria-hidden":"true"})]})}),s.jsx("div",{id:`submenu-${o}`,className:`${e.styles.sublinks} ${p?e.styles.show:""}`,role:"menu","aria-label":`${t.title} submenu`,onMouseLeave:()=>{J(null),G(0),j(null)},children:s.jsx("div",{children:s.jsxs("div",{className:`${e.styles.sublinksInner} ${t.spotlight?e.styles.withSpotlight:e.styles.withoutSpotlight}`,children:[s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.primaryColumn}`,children:[s.jsx("div",{className:e.styles.linkItem}),(B=t.primaryItems)==null?void 0:B.map((r,L)=>r.href?s.jsx("div",{role:"menuitem",children:s.jsxs("a",{href:r.href,className:`${e.styles.link} ${R===L?e.styles.open:""}`,target:r.isExternal?"_blank":"_self",rel:r.isExternal?"noopener noreferrer":void 0,onClick:()=>{var ae;j(null),(ae=r.onClick)==null||ae.call(r)},onMouseEnter:()=>G(L),children:[s.jsxs("span",{className:e.styles.linkContent,children:[r.label,r.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:r.subtitle})]}),r.isExternal&&s.jsx(oe.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]})},r._key??L):s.jsx("div",{role:"menuitem",children:s.jsx("button",{className:`${e.styles.sublinkToggle} ${R===L?e.styles.open:""}`,onMouseEnter:()=>G(L),children:s.jsxs("span",{className:e.styles.linkContent,children:[r.label,r.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:r.subtitle})]})})},r._key??L))]}),(m==null?void 0:m.sublinks)&&m.sublinks.length>0&&s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.fadeInFromLeft}`,children:[m.description&&s.jsx("div",{className:e.styles.sublinksDescription,children:n==null?void 0:n(m.description)}),q(m.sublinks,`${i}-${R}`)]},`${m.label}-${m.sublinks.length}`),t.secondaryItems&&t.secondaryItems.length>0&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.secondaryColumn}`,children:q(t.secondaryItems,`${i}-secondary`)}),t.spotlight&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.spotlightColumn}`,children:s.jsx(De,{spotlight:t.spotlight,renderText:n})})]})})})]},t._key??`group-${o}`)}),Ie=[e.styles.navbar,qe[H],Re[X],w?e.styles.sticky:"",d!=null&&d.length?e.styles.advanced:e.styles.default,ue??""].filter(Boolean).join(" ");return s.jsx("header",{ref:W,className:Ie,style:ye,"aria-label":"Site header",...me,children:s.jsxs("div",{className:`${e.styles.container} ${(!x||x.length===0)&&H!=="center"?e.styles.twoColumn:""}`,children:[c?s.jsx("div",{className:e.styles.logo,children:c}):h?s.jsx("div",{className:e.styles.title,children:h}):null,s.jsx("nav",{ref:S,"aria-modal":u?"true":void 0,className:`${e.styles.nav} ${u?e.styles.open:""} ${he?e.styles.visible:e.styles.hidden}`,id:"main-menu","aria-label":"Primary navigation",children:s.jsxs("div",{className:e.styles.navInner,children:[s.jsx("svg",{style:{left:`${pe}px`},className:`${e.styles.triangle} ${F?e.styles.show:""}`,width:16,height:12,viewBox:"0 0 100 75",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:s.jsx("polygon",{points:"50,5 95,70 5,70",strokeLinejoin:"round",fill:"white",stroke:"white"})}),$==="default"&&b&&!v&&s.jsxs("div",{className:e.styles.grid,children:[b.length>0&&s.jsx("div",{role:"menubar",className:e.styles.menubar,children:q(b)}),(f||k||N)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator,"aria-hidden":"true"}),s.jsxs("div",{role:"toolbar","aria-label":"Site controls",className:e.styles.toolbar,children:[N&&s.jsx(Z,{}),f&&s.jsx(Y,{}),k&&s.jsx(ee,{})]})]})]}),$==="default"&&b&&v&&u&&g.length===0&&s.jsx("div",{className:e.styles.mobileMenu,children:b.map((l,t)=>s.jsx(D,{item:l,animationDirection:E,onNavigate:te,onClose:()=>C(!1),isTopLevel:!0},l._key??t))}),$==="default"&&v&&u&&g.length>0&&s.jsxs("div",{className:e.styles.mobilePanel,children:[s.jsxs("button",{className:e.styles.mobileBack,"aria-label":"Go back",onClick:ge,children:[s.jsx(A.ChevronLeft,{size:18,"aria-hidden":"true"}),s.jsx("span",{children:g[g.length-1].title})]}),g[g.length-1].primary.map((l,t)=>s.jsx(D,{item:l,animationDirection:E,onNavigate:te,onClose:()=>C(!1)},l._key??t))]},`dstack-${g.length}`),!v&&$==="advanced"&&d&&s.jsxs("div",{className:e.styles.grid,children:[d.length>0&&s.jsx("div",{role:"menubar",className:e.styles.menubar,children:Ce(d)}),(f||k||N)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator,"aria-hidden":"true"}),s.jsxs("div",{role:"toolbar","aria-label":"Site controls",className:e.styles.toolbar,children:[N&&s.jsx(Z,{}),f&&s.jsx(Y,{}),k&&s.jsx(ee,{})]})]})]}),v&&$==="advanced"&&u&&y.length===0&&d&&s.jsx("div",{className:e.styles.mobileMenu,children:d.map((l,t)=>s.jsx("div",{className:`${e.styles.mobileItem} ${E==="forward"?e.styles.slideIn:e.styles.slideInBack} ${e.styles.parentItem}`,children:s.jsxs("button",{className:e.styles.mobileTrigger,onClick:()=>we(l),children:[s.jsx("span",{className:e.styles.mobileItemLabel,children:l.title}),s.jsx(A.ChevronRight,{size:16,className:e.styles.mobileChevron,"aria-hidden":"true"})]})},l._key??t))}),v&&$==="advanced"&&u&&y.length>0&&s.jsxs("div",{className:e.styles.mobilePanel,children:[s.jsxs("button",{className:e.styles.mobileBack,"aria-label":"Go back",onClick:y.length===1?Ne:$e,children:[s.jsx(A.ChevronLeft,{size:18,"aria-hidden":"true"}),s.jsx("span",{children:y[y.length-1].title})]}),y[y.length-1].primary.map((l,t)=>s.jsx(D,{item:l,animationDirection:E,onNavigate:ne,onClose:()=>C(!1)},l._key??`primary-${t}`)),y[y.length-1].secondary.length>0&&s.jsx("hr",{className:e.styles.mobileDivider}),y[y.length-1].secondary.map((l,t)=>s.jsx(D,{item:l,animationDirection:E,onNavigate:ne,onClose:()=>C(!1)},l._key??`secondary-${t}`))]},`astack-${y.length}`)]})}),x&&x.length>0&&s.jsx("nav",{className:`${e.styles.utility} ${u?e.styles.open:""}`,"data-scrolled":T,"aria-label":"Utility navigation",children:s.jsx(Se.ButtonGroup,{spacing:"sm",className:"utilityGroup",children:x.map((l,t)=>{const o=X=="transparent"&&l.variant==="link"&&T?e.styles.utilityScrolled:e.styles.utilityDefault,i=l.imageSrc?s.jsx("img",{src:l.imageSrc,alt:l.imageAlt??l.ariaLabel}):l.label;return l.modalPayload?s.jsx(O.Button,{as:"modal",size:v?"md":"sm",modalPayload:l.modalPayload,variant:l.variant??"primary","aria-label":l.ariaLabel,icon:l.icon,iconAlignment:l.iconAlignment,className:o,children:i},l._key??t):s.jsx(O.Button,{as:"a",size:v?"md":"sm",href:l.href??"/",variant:l.variant??"primary",displayType:l.displayType??"text",imageSrc:l.imageSrc,imageAlt:l.imageAlt,"aria-label":l.ariaLabel,icon:l.icon,iconAlignment:l.iconAlignment,className:o,children:i},l._key??t)})})}),s.jsxs("div",{className:e.styles.mobileButtons,children:[v&&f&&s.jsx(Y,{}),s.jsx("button",{ref:Q,className:e.styles.menuToggle,onClick:se,"aria-label":u?"Close menu":"Open menu","aria-expanded":u,"aria-controls":"main-menu",children:u?s.jsx(Le.X,{size:24,"aria-hidden":"true"}):s.jsx(O.Menu,{size:24,"aria-hidden":"true"})})]})]})})}exports.Navbar=Oe;
|
|
11
|
+
*/const Be=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],ze=re.createLucideIcon("search",Be),Re={standard:e.styles.standard,transparent:e.styles.transparent},qe={left:e.styles.left,center:e.styles.center,right:e.styles.right},Oe=({spotlight:n,renderText:h})=>{var x,w,f,k,N,z;const c=n.callToAction;if(!c)return null;const b=((x=c.linkOptions)==null?void 0:x.linkType)==="external";let d="#";return b&&((w=c.linkOptions)!=null&&w.externalUrl)?d=c.linkOptions.externalUrl:((f=c.linkOptions)==null?void 0:f.linkType)==="internal"&&((N=(k=c.linkOptions)==null?void 0:k.internalUrl)!=null&&N.slug.current)&&(d=`/${c.linkOptions.internalUrl.slug.current}`),s.jsxs("div",{className:e.styles.spotlight,children:[n.image&&s.jsx("div",{className:e.styles.imageWrapper,children:s.jsx("img",{src:((z=n.image.imageUrls)==null?void 0:z.medium)??"",alt:n.image.asset.altText||n.image.asset.description||"Content image",width:600,height:400})}),s.jsxs("div",{className:e.styles.content,children:[n.title&&s.jsx("div",{className:e.styles.title,children:h==null?void 0:h(n.title,e.styles.title)}),n.description&&s.jsx("div",{className:e.styles.description,children:h==null?void 0:h(n.description,e.styles.description)})]}),c.linkOptions&&s.jsx("div",{className:e.styles.actions,children:s.jsx(D.Button,{as:"a",variant:c.variant??"primary",href:d,target:b?"_blank":"_self",rel:b?"noopener noreferrer":void 0,"aria-label":c.ariaLabel||c.label,children:c.label})})]})};function O({item:n,animationDirection:h,onNavigate:c,onClose:b,isTopLevel:d=!1}){var f;const x=(((f=n.sublinks)==null?void 0:f.length)??0)>0,w=h==="forward"?e.styles.slideIn:e.styles.slideInBack;return s.jsx("div",{className:`${e.styles.mobileItem} ${w} ${d?e.styles.parentItem:""}`,role:"menuitem",children:x?s.jsxs("button",{className:e.styles.mobileTrigger,onClick:()=>c(n),children:[s.jsxs("span",{className:e.styles.mobileItemLabel,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.mobileItemSubtitle,children:n.subtitle})]}),s.jsx(A.ChevronRight,{size:16,className:e.styles.mobileChevron,"aria-hidden":"true"})]}):s.jsxs("a",{href:n.href??"#",className:e.styles.mobileLink,target:n.isExternal?"_blank":"_self",rel:n.isExternal?"noopener noreferrer":void 0,onClick:b,children:[s.jsxs("span",{className:e.styles.mobileItemLabel,children:[n.label,n.subtitle&&s.jsx("span",{className:e.styles.mobileItemSubtitle,children:n.subtitle})]}),n.isExternal&&s.jsx(oe.ExternalLink,{size:14,className:e.styles.newTabIcon,"aria-hidden":"true"})]})})}function De({renderText:n,title:h,logo:c,items:b,groups:d,utilityItems:x,isSticky:w=!1,showSearch:f=!0,showLocaleSelect:k=!0,showThemeToggle:N=!0,themeToggleComponent:z,alignment:H="right",variant:X="standard",navigationType:$="default",searchComponent:ce,localeSelectComponent:de,className:ue,style:ye,...me}){const[u,C]=a.useState(!1),[F,j]=a.useState(null),[he,be]=a.useState(!1),[T,fe]=a.useState(!1),[pe,xe]=a.useState(null),[y,_]=a.useState([]),[g,P]=a.useState([]),[R,G]=a.useState(0),[ve,J]=a.useState(null),[v,je]=a.useState(!1),[E,I]=a.useState("forward"),W=a.useRef(null),S=a.useRef(null),Q=a.useRef(null),U=a.useRef(new Map),Z=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,role:"presentation",children:s.jsx("div",{className:`${e.styles.linkItem} ${e.styles.themeToggle}`,role:"presentation",children:z})}),Y=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent} ${e.styles.searchWrapper}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(ie.Modal,{size:"lg",className:e.styles.searchModal,trigger:s.jsx("button",{title:"Search","aria-label":"Search",className:e.styles.search,children:s.jsx(ze,{size:16,"aria-hidden":"true"})}),content:ce})})}),ee=()=>s.jsx("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,children:s.jsx("div",{className:e.styles.linkItem,children:s.jsx(ie.Modal,{className:e.styles.localeModal,trigger:s.jsx("button",{title:"Locale Select","aria-label":"Locale Select",className:e.styles.locale,children:s.jsx(Me,{size:16,"aria-hidden":"true"})}),content:de})})}),se=()=>{C(l=>{const t=!l;return t||(_([]),P([]),I("forward"),j(null)),t})},le=a.useCallback(l=>{const t=U.current.get(l);if(t&&S.current){const o=t.getBoundingClientRect(),i=S.current.getBoundingClientRect();xe(o.left-i.left+o.width/2)}},[]),ke=a.useCallback(l=>{j(t=>t===l?null:l)},[]),K=a.useCallback(l=>{W.current&&!W.current.contains(l.target)&&j(null)},[]),V=a.useCallback(()=>{typeof window<"u"&&window.innerWidth>768&&(C(!1),j(null))},[]),Ne=()=>_([]),te=l=>{I("forward"),P(t=>[...t,{title:l.label,primary:l.sublinks??[],secondary:[],description:l.description}])},ge=()=>{I("backward"),P(l=>l.slice(0,-1))},we=l=>{I("forward"),_([{title:l.title,primary:l.primaryItems??[],secondary:l.secondaryItems??[],description:""}])},ne=l=>{I("forward"),_(t=>[...t,{title:l.label,primary:l.sublinks??[],secondary:[],description:l.description}])},$e=()=>{I("backward"),_(l=>l.slice(0,-1))};a.useEffect(()=>{if(typeof window>"u")return;const l=()=>je(window.innerWidth<768);return l(),window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]),a.useEffect(()=>{if(typeof window>"u")return;const l=()=>fe(window.scrollY>10);return l(),window.addEventListener("scroll",l,{passive:!0}),()=>window.removeEventListener("scroll",l)},[]),a.useEffect(()=>{const l=typeof window<"u",t=typeof document<"u";return l&&window.addEventListener("resize",V),t&&document.addEventListener("click",K),be(!0),()=>{l&&window.removeEventListener("resize",V),t&&document.removeEventListener("click",K)}},[V,K]),a.useEffect(()=>{if(!(typeof document>"u")){if(u){const l=window.scrollY;document.body.style.position="fixed",document.body.style.top=`-${l}px`,document.body.style.width="100%",document.body.style.overflowY="scroll"}else{const l=Math.abs(parseInt(document.body.style.top||"0",10));document.body.style.position="",document.body.style.top="",document.body.style.width="",document.body.style.overflowY="",window.scrollTo(0,l)}return()=>{const l=Math.abs(parseInt(document.body.style.top||"0",10));document.body.style.position="",document.body.style.top="",document.body.style.width="",document.body.style.overflowY="",l&&window.scrollTo(0,l)}}},[u]),a.useEffect(()=>{var o;if(!u)return;if(typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(pointer: fine)").matches){const i=(o=S.current)==null?void 0:o.querySelector('a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex="-1"])');i==null||i.focus()}const t=i=>{var B;if(i.key==="Escape"){se(),(B=Q.current)==null||B.focus();return}if(i.key!=="Tab"||!S.current)return;const p=Array.from(S.current.querySelectorAll('a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(r=>!r.closest("[aria-hidden=true]"));if(p.length===0)return;const m=p[0],M=p[p.length-1];i.shiftKey?document.activeElement===m&&(i.preventDefault(),M.focus()):document.activeElement===M&&(i.preventDefault(),m.focus())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[u]);const q=(l,t="")=>l.map((o,i)=>{const p=`${t}/${o._key??o.label}-${i}`;return s.jsx(e.NavLink,{link:o,path:p,parentPath:t,openPath:F,togglePath:ke,updateTriangleIndicator:le,setOpenPath:j,renderLinks:q,buttonRefs:U},p)}),Ce=l=>l.map((t,o)=>{var M,B;const i=`group-${o}`,p=ve===o,m=(M=t.primaryItems)==null?void 0:M[R??0];return s.jsxs("div",{className:`${e.styles.linkWrapper} ${e.styles.parent}`,onMouseEnter:()=>{J(o),j(i),le(i)},children:[s.jsx("div",{className:e.styles.linkItem,children:s.jsxs("button",{ref:r=>{U.current.set(i,r)},"aria-haspopup":!0,"aria-expanded":p,"aria-controls":`submenu-${o}`,className:`${e.styles.sublinkToggle} ${p?e.styles.open:""}`,children:[t.title,s.jsx(_e.ChevronDown,{size:18,className:e.styles.chevron,"aria-hidden":"true"})]})}),s.jsx("div",{id:`submenu-${o}`,className:`${e.styles.sublinks} ${p?e.styles.show:""}`,role:"menu","aria-label":`${t.title} submenu`,onMouseLeave:()=>{J(null),G(0),j(null)},children:s.jsx("div",{children:s.jsxs("div",{className:`${e.styles.sublinksInner} ${t.spotlight?e.styles.withSpotlight:e.styles.withoutSpotlight}`,children:[s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.primaryColumn}`,children:[s.jsx("div",{className:e.styles.linkItem}),(B=t.primaryItems)==null?void 0:B.map((r,L)=>r.href?s.jsx("div",{role:"menuitem",children:s.jsxs("a",{href:r.href,className:`${e.styles.link} ${R===L?e.styles.open:""}`,target:r.isExternal?"_blank":"_self",rel:r.isExternal?"noopener noreferrer":void 0,onClick:()=>{var ae;j(null),(ae=r.onClick)==null||ae.call(r)},onMouseEnter:()=>G(L),children:[s.jsxs("span",{className:e.styles.linkContent,children:[r.label,r.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:r.subtitle})]}),r.isExternal&&s.jsx(oe.ExternalLink,{className:e.styles.newTabIcon,size:16,"aria-hidden":"true"})]})},r._key??L):s.jsx("div",{role:"menuitem",children:s.jsx("button",{className:`${e.styles.sublinkToggle} ${R===L?e.styles.open:""}`,onMouseEnter:()=>G(L),children:s.jsxs("span",{className:e.styles.linkContent,children:[r.label,r.subtitle&&s.jsx("span",{className:e.styles.subtitle,children:r.subtitle})]})})},r._key??L))]}),(m==null?void 0:m.sublinks)&&m.sublinks.length>0&&s.jsxs("div",{className:`${e.styles.sublinksColumn} ${e.styles.fadeInFromLeft}`,children:[m.description&&s.jsx("div",{className:e.styles.sublinksDescription,children:n==null?void 0:n(m.description)}),q(m.sublinks,`${i}-${R}`)]},`${m.label}-${m.sublinks.length}`),t.secondaryItems&&t.secondaryItems.length>0&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.secondaryColumn}`,children:q(t.secondaryItems,`${i}-secondary`)}),t.spotlight&&s.jsx("div",{className:`${e.styles.sublinksColumn} ${e.styles.spotlightColumn}`,children:s.jsx(Oe,{spotlight:t.spotlight,renderText:n})})]})})})]},t._key??`group-${o}`)}),Ie=[e.styles.navbar,qe[H],Re[X],w?e.styles.sticky:"",d!=null&&d.length?e.styles.advanced:e.styles.default,ue??""].filter(Boolean).join(" ");return s.jsx("header",{ref:W,className:Ie,style:ye,"aria-label":"Site header",...me,children:s.jsxs("div",{className:`${e.styles.container} ${(!x||x.length===0)&&H!=="center"?e.styles.twoColumn:""}`,children:[c?s.jsx("div",{className:e.styles.logo,children:c}):h?s.jsx("div",{className:e.styles.title,children:h}):null,s.jsx("nav",{ref:S,"aria-modal":u?"true":void 0,className:`${e.styles.nav} ${u?e.styles.open:""} ${he?e.styles.visible:e.styles.hidden}`,id:"main-menu","aria-label":"Primary navigation",children:s.jsxs("div",{className:e.styles.navInner,children:[s.jsx("svg",{style:{left:`${pe}px`},className:`${e.styles.triangle} ${F?e.styles.show:""}`,width:16,height:12,viewBox:"0 0 100 75",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:s.jsx("polygon",{points:"50,5 95,70 5,70",strokeLinejoin:"round",fill:"white",stroke:"white"})}),$==="default"&&b&&!v&&s.jsxs("div",{className:e.styles.grid,children:[b.length>0&&s.jsx("div",{role:"menubar",className:e.styles.menubar,children:q(b)}),(f||k||N)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator,"aria-hidden":"true"}),s.jsxs("div",{role:"toolbar","aria-label":"Site controls",className:e.styles.toolbar,children:[N&&s.jsx(Z,{}),f&&s.jsx(Y,{}),k&&s.jsx(ee,{})]})]})]}),$==="default"&&b&&v&&u&&g.length===0&&s.jsx("div",{className:e.styles.mobileMenu,children:b.map((l,t)=>s.jsx(O,{item:l,animationDirection:E,onNavigate:te,onClose:()=>C(!1),isTopLevel:!0},l._key??t))}),$==="default"&&v&&u&&g.length>0&&s.jsxs("div",{className:e.styles.mobilePanel,children:[s.jsxs("button",{className:e.styles.mobileBack,"aria-label":"Go back",onClick:ge,children:[s.jsx(A.ChevronLeft,{size:18,"aria-hidden":"true"}),s.jsx("span",{children:g[g.length-1].title})]}),g[g.length-1].primary.map((l,t)=>s.jsx(O,{item:l,animationDirection:E,onNavigate:te,onClose:()=>C(!1)},l._key??t))]},`dstack-${g.length}`),!v&&$==="advanced"&&d&&s.jsxs("div",{className:e.styles.grid,children:[d.length>0&&s.jsx("div",{role:"menubar",className:e.styles.menubar,children:Ce(d)}),(f||k||N)&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:e.styles.separator,"aria-hidden":"true"}),s.jsxs("div",{role:"toolbar","aria-label":"Site controls",className:e.styles.toolbar,children:[N&&s.jsx(Z,{}),f&&s.jsx(Y,{}),k&&s.jsx(ee,{})]})]})]}),v&&$==="advanced"&&u&&y.length===0&&d&&s.jsx("div",{className:e.styles.mobileMenu,children:d.map((l,t)=>s.jsx("div",{className:`${e.styles.mobileItem} ${E==="forward"?e.styles.slideIn:e.styles.slideInBack} ${e.styles.parentItem}`,children:s.jsxs("button",{className:e.styles.mobileTrigger,onClick:()=>we(l),children:[s.jsx("span",{className:e.styles.mobileItemLabel,children:l.title}),s.jsx(A.ChevronRight,{size:16,className:e.styles.mobileChevron,"aria-hidden":"true"})]})},l._key??t))}),v&&$==="advanced"&&u&&y.length>0&&s.jsxs("div",{className:e.styles.mobilePanel,children:[s.jsxs("button",{className:e.styles.mobileBack,"aria-label":"Go back",onClick:y.length===1?Ne:$e,children:[s.jsx(A.ChevronLeft,{size:18,"aria-hidden":"true"}),s.jsx("span",{children:y[y.length-1].title})]}),y[y.length-1].primary.map((l,t)=>s.jsx(O,{item:l,animationDirection:E,onNavigate:ne,onClose:()=>C(!1)},l._key??`primary-${t}`)),y[y.length-1].secondary.length>0&&s.jsx("hr",{className:e.styles.mobileDivider}),y[y.length-1].secondary.map((l,t)=>s.jsx(O,{item:l,animationDirection:E,onNavigate:ne,onClose:()=>C(!1)},l._key??`secondary-${t}`))]},`astack-${y.length}`)]})}),x&&x.length>0&&s.jsx("nav",{className:`${e.styles.utility} ${u?e.styles.open:""}`,"data-scrolled":T,"aria-label":"Utility navigation",children:s.jsx(Se.ButtonGroup,{spacing:"sm",className:"utilityGroup",children:x.map((l,t)=>{const o=X=="transparent"&&l.variant==="link"&&T?e.styles.utilityScrolled:"",i=l.imageSrc?s.jsx("img",{src:l.imageSrc,alt:l.imageAlt??l.ariaLabel}):l.label;return l.modalPayload?s.jsx(D.Button,{as:"modal",size:v?"md":"sm",modalPayload:l.modalPayload,variant:l.variant??"primary","aria-label":l.ariaLabel,icon:l.icon,iconAlignment:l.iconAlignment,className:o,children:i},l._key??t):s.jsx(D.Button,{as:"a",size:v?"md":"sm",href:l.href??"/",variant:l.variant??"primary",displayType:l.displayType??"text",imageSrc:l.imageSrc,imageAlt:l.imageAlt,"aria-label":l.ariaLabel,icon:l.icon,iconAlignment:l.iconAlignment,className:o,children:i},l._key??t)})})}),s.jsxs("div",{className:e.styles.mobileButtons,children:[v&&f&&s.jsx(Y,{}),s.jsx("button",{ref:Q,className:e.styles.menuToggle,onClick:se,"aria-label":u?"Close menu":"Open menu","aria-expanded":u,"aria-controls":"main-menu",children:u?s.jsx(Le.X,{size:24,"aria-hidden":"true"}):s.jsx(D.Menu,{size:24,"aria-hidden":"true"})})]})]})})}exports.Navbar=De;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as a, jsxs as t, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
-
import { useState as y, useRef as G, useCallback as W, useEffect as
|
|
2
|
+
import { useState as y, useRef as G, useCallback as W, useEffect as A } from "react";
|
|
3
3
|
import { Modal as de } from "../Modal/index.mjs";
|
|
4
|
-
import { B as F, M as
|
|
5
|
-
import { ButtonGroup as
|
|
6
|
-
import { s as e, N as
|
|
4
|
+
import { B as F, M as Oe } from "../../../index--KCTRJKr.js";
|
|
5
|
+
import { ButtonGroup as Ae } from "../ButtonGroup/index.mjs";
|
|
6
|
+
import { s as e, N as De } from "../../../NavLink-CpzAfPLK.js";
|
|
7
7
|
import { C as ue, a as me } from "../../../chevron-right-Cim1KPuL.js";
|
|
8
8
|
import { X as Re } from "../../../x-CnsEH4Ox.js";
|
|
9
9
|
import { c as he } from "../../../createLucideIcon-C8GTh_Qx.js";
|
|
@@ -47,7 +47,7 @@ const Ue = [
|
|
|
47
47
|
spotlight: i,
|
|
48
48
|
renderText: b
|
|
49
49
|
}) => {
|
|
50
|
-
var k, I, f, w, $,
|
|
50
|
+
var k, I, f, w, $, D;
|
|
51
51
|
const c = i.callToAction;
|
|
52
52
|
if (!c) return null;
|
|
53
53
|
const p = ((k = c.linkOptions) == null ? void 0 : k.linkType) === "external";
|
|
@@ -56,7 +56,7 @@ const Ue = [
|
|
|
56
56
|
i.image && /* @__PURE__ */ a("div", { className: e.imageWrapper, children: /* @__PURE__ */ a(
|
|
57
57
|
"img",
|
|
58
58
|
{
|
|
59
|
-
src: ((
|
|
59
|
+
src: ((D = i.image.imageUrls) == null ? void 0 : D.medium) ?? "",
|
|
60
60
|
alt: i.image.asset.altText || i.image.asset.description || "Content image",
|
|
61
61
|
width: 600,
|
|
62
62
|
height: 400
|
|
@@ -152,7 +152,7 @@ function ln({
|
|
|
152
152
|
showSearch: f = !0,
|
|
153
153
|
showLocaleSelect: w = !0,
|
|
154
154
|
showThemeToggle: $ = !0,
|
|
155
|
-
themeToggleComponent:
|
|
155
|
+
themeToggleComponent: D,
|
|
156
156
|
alignment: J = "right",
|
|
157
157
|
variant: Q = "standard",
|
|
158
158
|
navigationType: M = "default",
|
|
@@ -174,7 +174,7 @@ function ln({
|
|
|
174
174
|
{
|
|
175
175
|
className: `${e.linkItem} ${e.themeToggle}`,
|
|
176
176
|
role: "presentation",
|
|
177
|
-
children:
|
|
177
|
+
children: D
|
|
178
178
|
}
|
|
179
179
|
)
|
|
180
180
|
}
|
|
@@ -266,20 +266,20 @@ function ln({
|
|
|
266
266
|
}, ze = () => {
|
|
267
267
|
L("backward"), z((n) => n.slice(0, -1));
|
|
268
268
|
};
|
|
269
|
-
|
|
269
|
+
A(() => {
|
|
270
270
|
if (typeof window > "u") return;
|
|
271
271
|
const n = () => Me(window.innerWidth < 768);
|
|
272
272
|
return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
273
|
-
}, []),
|
|
273
|
+
}, []), A(() => {
|
|
274
274
|
if (typeof window > "u") return;
|
|
275
275
|
const n = () => we(window.scrollY > 10);
|
|
276
276
|
return n(), window.addEventListener("scroll", n, { passive: !0 }), () => window.removeEventListener("scroll", n);
|
|
277
|
-
}, []),
|
|
277
|
+
}, []), A(() => {
|
|
278
278
|
const n = typeof window < "u", l = typeof document < "u";
|
|
279
279
|
return n && window.addEventListener("resize", X), l && document.addEventListener("click", H), ge(!0), () => {
|
|
280
280
|
n && window.removeEventListener("resize", X), l && document.removeEventListener("click", H);
|
|
281
281
|
};
|
|
282
|
-
}, [X, H]),
|
|
282
|
+
}, [X, H]), A(() => {
|
|
283
283
|
if (!(typeof document > "u")) {
|
|
284
284
|
if (u) {
|
|
285
285
|
const n = window.scrollY;
|
|
@@ -293,7 +293,7 @@ function ln({
|
|
|
293
293
|
document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", document.body.style.overflowY = "", n && window.scrollTo(0, n);
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
|
-
}, [u]),
|
|
296
|
+
}, [u]), A(() => {
|
|
297
297
|
var o;
|
|
298
298
|
if (!u) return;
|
|
299
299
|
if (typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(pointer: fine)").matches) {
|
|
@@ -303,9 +303,9 @@ function ln({
|
|
|
303
303
|
s == null || s.focus();
|
|
304
304
|
}
|
|
305
305
|
const l = (s) => {
|
|
306
|
-
var
|
|
306
|
+
var O;
|
|
307
307
|
if (s.key === "Escape") {
|
|
308
|
-
te(), (
|
|
308
|
+
te(), (O = ne.current) == null || O.focus();
|
|
309
309
|
return;
|
|
310
310
|
}
|
|
311
311
|
if (s.key !== "Tab" || !S.current) return;
|
|
@@ -323,7 +323,7 @@ function ln({
|
|
|
323
323
|
const P = (n, l = "") => n.map((o, s) => {
|
|
324
324
|
const v = `${l}/${o._key ?? o.label}-${s}`;
|
|
325
325
|
return /* @__PURE__ */ a(
|
|
326
|
-
|
|
326
|
+
De,
|
|
327
327
|
{
|
|
328
328
|
link: o,
|
|
329
329
|
path: v,
|
|
@@ -338,7 +338,7 @@ function ln({
|
|
|
338
338
|
v
|
|
339
339
|
);
|
|
340
340
|
}), Be = (n) => n.map((l, o) => {
|
|
341
|
-
var x,
|
|
341
|
+
var x, O;
|
|
342
342
|
const s = `group-${o}`, v = Ie === o, h = (x = l.primaryItems) == null ? void 0 : x[R ?? 0];
|
|
343
343
|
return /* @__PURE__ */ t(
|
|
344
344
|
"div",
|
|
@@ -392,7 +392,7 @@ function ln({
|
|
|
392
392
|
className: `${e.sublinksColumn} ${e.primaryColumn}`,
|
|
393
393
|
children: [
|
|
394
394
|
/* @__PURE__ */ a("div", { className: e.linkItem }),
|
|
395
|
-
(
|
|
395
|
+
(O = l.primaryItems) == null ? void 0 : O.map(
|
|
396
396
|
(r, _) => r.href ? /* @__PURE__ */ a("div", { role: "menuitem", children: /* @__PURE__ */ t(
|
|
397
397
|
"a",
|
|
398
398
|
{
|
|
@@ -691,8 +691,8 @@ function ln({
|
|
|
691
691
|
className: `${e.utility} ${u ? e.open : ""}`,
|
|
692
692
|
"data-scrolled": Z,
|
|
693
693
|
"aria-label": "Utility navigation",
|
|
694
|
-
children: /* @__PURE__ */ a(
|
|
695
|
-
const o = Q == "transparent" && n.variant === "link" && Z ? e.utilityScrolled :
|
|
694
|
+
children: /* @__PURE__ */ a(Ae, { spacing: "sm", className: "utilityGroup", children: k.map((n, l) => {
|
|
695
|
+
const o = Q == "transparent" && n.variant === "link" && Z ? e.utilityScrolled : "", s = n.imageSrc ? /* @__PURE__ */ a(
|
|
696
696
|
"img",
|
|
697
697
|
{
|
|
698
698
|
src: n.imageSrc,
|
|
@@ -745,7 +745,7 @@ function ln({
|
|
|
745
745
|
"aria-label": u ? "Close menu" : "Open menu",
|
|
746
746
|
"aria-expanded": u,
|
|
747
747
|
"aria-controls": "main-menu",
|
|
748
|
-
children: u ? /* @__PURE__ */ a(Re, { size: 24, "aria-hidden": "true" }) : /* @__PURE__ */ a(
|
|
748
|
+
children: u ? /* @__PURE__ */ a(Re, { size: 24, "aria-hidden": "true" }) : /* @__PURE__ */ a(Oe, { size: 24, "aria-hidden": "true" })
|
|
749
749
|
}
|
|
750
750
|
)
|
|
751
751
|
] })
|
package/dist/core.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');;/* empty css */const o=require("./core/components/Announcement/index.cjs"),n=require("./core/components/Accordion/index.cjs"),r=require("./AccordionItem-DulgZilf.cjs"),c=require("./core/components/Avatar/index.cjs"),t=require("./core/components/Badge/index.cjs"),i=require("./core/components/Box/index.cjs"),_=require("./core/components/Breadcrumbs/index.cjs"),s=require("./core/components/ButtonGroup/index.cjs"),d=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');;/* empty css */const o=require("./core/components/Announcement/index.cjs"),n=require("./core/components/Accordion/index.cjs"),r=require("./AccordionItem-DulgZilf.cjs"),c=require("./core/components/Avatar/index.cjs"),t=require("./core/components/Badge/index.cjs"),i=require("./core/components/Box/index.cjs"),_=require("./core/components/Breadcrumbs/index.cjs"),s=require("./core/components/ButtonGroup/index.cjs"),d=require("./index-CUjZDv40.cjs"),a=require("./core/components/Card/index.cjs"),u=require("./core/components/Carousel/index.cjs"),p=require("./core/components/Checkbox/index.cjs"),m=require("./core/components/Container/index.cjs"),x=require("./core/components/DatePicker/index.cjs"),q=require("./core/components/Divider/index.cjs"),l=require("./core/components/Drawer/index.cjs"),S=require("./core/components/Fieldset/index.cjs"),b=require("./core/components/FileUpload/index.cjs"),B=require("./core/components/FloatingActionButton/index.cjs"),T=require("./core/components/Footer/index.cjs"),g=require("./core/components/Form/index.cjs"),A=require("./core/components/Grid/index.cjs"),C=require("./core/components/Heading/index.cjs"),v=require("./core/components/Input/index.cjs"),F=require("./core/components/Label/index.cjs"),k=require("./core/components/List/index.cjs"),M=require("./core/components/Modal/index.cjs"),P=require("./core/components/NavBar/index.cjs"),h=require("./core/components/Notification/index.cjs"),D=require("./core/components/NotificationContainer/index.cjs"),N=require("./core/components/ProgressBar/index.cjs"),f=require("./core/components/Radio/index.cjs"),w=require("./core/components/Range/index.cjs"),G=require("./core/components/Select/index.cjs"),I=require("./core/components/Sidebar/index.cjs"),L=require("./core/components/Skeleton/index.cjs"),R=require("./core/components/Spacer/index.cjs"),y=require("./core/components/Spinner/index.cjs"),H=require("./core/components/Stack/index.cjs"),Q=require("./core/components/Switch/index.cjs"),U=require("./core/components/Table/index.cjs"),j=require("./core/components/Tabs/index.cjs"),O=require("./core/components/Text/index.cjs"),z=require("./core/components/Textarea/index.cjs"),E=require("./core/components/Tooltip/index.cjs"),J=require("./core/utils/ThemeProvider/index.cjs"),e=require("./core/context/ModalContext.cjs"),K=require("./core/hooks/useMediaQuery.cjs");exports.Announcement=o.Announcement;exports.Accordion=n.Accordion;exports.AccordionItem=r.AccordionItem;exports.Avatar=c.Avatar;exports.Badge=t.Badge;exports.Box=i.Box;exports.Breadcrumbs=_.Breadcrumbs;exports.ButtonGroup=s.ButtonGroup;exports.Button=d.Button;exports.Card=a.Card;exports.Carousel=u.Carousel;exports.Checkbox=p.Checkbox;exports.Container=m.Container;exports.DatePicker=x.DatePicker;exports.Divider=q.Divider;exports.Drawer=l.Drawer;exports.Fieldset=S.Fieldset;exports.FileUpload=b.FileUpload;exports.FloatingActionButton=B.FloatingActionButton;exports.Footer=T.Footer;exports.Form=g.Form;exports.Grid=A.Grid;exports.Heading=C.Heading;exports.Input=v.Input;exports.Label=F.Label;exports.List=k.List;exports.Modal=M.Modal;exports.Navbar=P.Navbar;exports.Notification=h.Notification;exports.NotificationContainer=D.NotificationContainer;exports.ProgressBar=N.ProgressBar;exports.Radio=f.Radio;exports.Range=w.Range;exports.Select=G.Select;exports.Sidebar=I.Sidebar;exports.Skeleton=L.Skeleton;exports.Spacer=R.Spacer;exports.Spinner=y.Spinner;exports.Stack=H.Stack;exports.Switch=Q.Switch;exports.Table=U.Table;exports.Tabs=j.Tabs;exports.Text=O.Text;exports.Textarea=z.Textarea;exports.Tooltip=E.Tooltip;exports.ThemeProvider=J.ThemeProvider;exports.ModalProvider=e.ModalProvider;exports.useModal=e.useModal;exports.useMediaQuery=K.useMediaQuery;
|
package/dist/core.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { Badge as d } from "./core/components/Badge/index.mjs";
|
|
|
7
7
|
import { Box as l } from "./core/components/Box/index.mjs";
|
|
8
8
|
import { Breadcrumbs as u } from "./core/components/Breadcrumbs/index.mjs";
|
|
9
9
|
import { ButtonGroup as b } from "./core/components/ButtonGroup/index.mjs";
|
|
10
|
-
import { B as A } from "./index
|
|
10
|
+
import { B as A } from "./index--KCTRJKr.js";
|
|
11
11
|
import { Card as g } from "./core/components/Card/index.mjs";
|
|
12
12
|
import { Carousel as C } from "./core/components/Carousel/index.mjs";
|
|
13
13
|
import { Checkbox as k } from "./core/components/Checkbox/index.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as k, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import b from "react";
|
|
3
3
|
import { useModal as C } from "./core/context/ModalContext.mjs";
|
|
4
4
|
import { f as R, g as P, h as A } from "./index-CeBA0PT0.js";
|
|
5
5
|
import { c as a } from "./createLucideIcon-C8GTh_Qx.js";
|
|
@@ -80,7 +80,7 @@ const Q = [
|
|
|
80
80
|
}
|
|
81
81
|
],
|
|
82
82
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
83
|
-
], W = a("settings", Q), X = "
|
|
83
|
+
], W = a("settings", Q), X = "_button_1g0n7_1", Z = "_sm_1g0n7_30", ee = "_content_1g0n7_34", ne = "_icon_1g0n7_38", te = "_md_1g0n7_43", re = "_lg_1g0n7_48", oe = "_image_1g0n7_61", se = "_blurred_1g0n7_68", ae = "_primary_1g0n7_69", ce = "_secondary_1g0n7_70", le = "_destructive_1g0n7_71", ie = "_primaryInverted_1g0n7_72", de = "_secondaryInverted_1g0n7_73", _e = "_blurredInverted_1g0n7_75", me = "_link_1g0n7_89", he = "_linkInverted_1g0n7_90", ue = "_underline_1g0n7_91", pe = "_underlineInverted_1g0n7_92", ve = "_children_1g0n7_286", ye = "_iconLeft_1g0n7_293", ge = "_iconRight_1g0n7_297", n = {
|
|
84
84
|
button: X,
|
|
85
85
|
sm: Z,
|
|
86
86
|
content: ee,
|
|
@@ -98,12 +98,12 @@ const Q = [
|
|
|
98
98
|
link: me,
|
|
99
99
|
linkInverted: he,
|
|
100
100
|
underline: ue,
|
|
101
|
-
underlineInverted:
|
|
102
|
-
children:
|
|
103
|
-
iconLeft:
|
|
104
|
-
iconRight:
|
|
101
|
+
underlineInverted: pe,
|
|
102
|
+
children: ve,
|
|
103
|
+
iconLeft: ye,
|
|
104
|
+
iconRight: ge
|
|
105
105
|
}, fe = {
|
|
106
|
-
apps: /* @__PURE__ */
|
|
106
|
+
apps: /* @__PURE__ */ k(L, { children: [
|
|
107
107
|
/* @__PURE__ */ e(P, {}),
|
|
108
108
|
" ",
|
|
109
109
|
/* @__PURE__ */ e(A, {})
|
|
@@ -122,7 +122,7 @@ const Q = [
|
|
|
122
122
|
refresh: /* @__PURE__ */ e(K, {}),
|
|
123
123
|
settings: /* @__PURE__ */ e(W, {}),
|
|
124
124
|
"sign-in": /* @__PURE__ */ e(O, {})
|
|
125
|
-
},
|
|
125
|
+
}, be = {
|
|
126
126
|
primary: n.primary,
|
|
127
127
|
primaryInverted: n.primaryInverted,
|
|
128
128
|
secondary: n.secondary,
|
|
@@ -134,22 +134,22 @@ const Q = [
|
|
|
134
134
|
blurred: n.blurred,
|
|
135
135
|
blurredInverted: n.blurredInverted,
|
|
136
136
|
destructive: n.destructive
|
|
137
|
-
},
|
|
137
|
+
}, ke = {
|
|
138
138
|
left: n.iconLeft,
|
|
139
139
|
right: n.iconRight
|
|
140
|
-
},
|
|
140
|
+
}, Ie = {
|
|
141
141
|
sm: n.sm,
|
|
142
142
|
md: n.md,
|
|
143
143
|
lg: n.lg
|
|
144
144
|
};
|
|
145
145
|
function ze({
|
|
146
|
-
variant:
|
|
147
|
-
size:
|
|
148
|
-
displayType:
|
|
149
|
-
imageSrc:
|
|
146
|
+
variant: I = "primary",
|
|
147
|
+
size: x = "md",
|
|
148
|
+
displayType: v = "text",
|
|
149
|
+
imageSrc: y,
|
|
150
150
|
imageAlt: w = "",
|
|
151
151
|
ImageComponent: s,
|
|
152
|
-
icon:
|
|
152
|
+
icon: g,
|
|
153
153
|
iconAlignment: N = "right",
|
|
154
154
|
className: M,
|
|
155
155
|
children: h,
|
|
@@ -157,19 +157,19 @@ function ze({
|
|
|
157
157
|
...$
|
|
158
158
|
}) {
|
|
159
159
|
let l = null;
|
|
160
|
-
s && (
|
|
161
|
-
const i =
|
|
160
|
+
s && (b.isValidElement(s) ? l = s : (typeof s == "function" || typeof s == "object") && (l = /* @__PURE__ */ e(s, {})));
|
|
161
|
+
const i = v === "image" ? l || (y ? /* @__PURE__ */ e("img", { src: y, alt: w, className: n.image }) : b.isValidElement(h) ? h : null) : /* @__PURE__ */ k("span", { className: `${n.content} ${ke[N]}`, children: [
|
|
162
162
|
/* @__PURE__ */ e("span", { className: n.children, children: h }),
|
|
163
|
-
|
|
164
|
-
] }), d = `${M ?? ""} ${n.button} ${
|
|
163
|
+
g && /* @__PURE__ */ e("span", { className: n.icon, "aria-hidden": "true", children: fe[g] })
|
|
164
|
+
] }), d = `${M ?? ""} ${n.button} ${Ie[x]} ${v === "text" ? be[I] : n.image}`.trim(), { as: u = "button", ..._ } = $;
|
|
165
165
|
if (u === "a") {
|
|
166
|
-
const { href: t, target: r, rel: o, ...f } = _,
|
|
166
|
+
const { href: t, target: r, rel: o, ...f } = _, p = r === "_blank" ? o ? `${o} noopener noreferrer` : "noopener noreferrer" : o;
|
|
167
167
|
return /* @__PURE__ */ e(
|
|
168
168
|
"a",
|
|
169
169
|
{
|
|
170
170
|
href: t,
|
|
171
171
|
target: r,
|
|
172
|
-
rel:
|
|
172
|
+
rel: p,
|
|
173
173
|
className: d,
|
|
174
174
|
"aria-disabled": c ? "true" : void 0,
|
|
175
175
|
...f,
|
|
@@ -191,8 +191,8 @@ function ze({
|
|
|
191
191
|
const m = document.getElementById(t);
|
|
192
192
|
if (m)
|
|
193
193
|
if (r) {
|
|
194
|
-
const
|
|
195
|
-
window.scrollTo({ top:
|
|
194
|
+
const p = m.getBoundingClientRect().top + window.scrollY - r;
|
|
195
|
+
window.scrollTo({ top: p, behavior: "smooth" });
|
|
196
196
|
} else
|
|
197
197
|
m.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
198
198
|
},
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const U=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Y=c.createLucideIcon("settings",U),H="
|
|
31
|
+
*/const U=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Y=c.createLucideIcon("settings",U),H="_button_1g0n7_1",J="_sm_1g0n7_30",K="_content_1g0n7_34",Q="_icon_1g0n7_38",W="_md_1g0n7_43",X="_lg_1g0n7_48",Z="_image_1g0n7_61",ee="_blurred_1g0n7_68",ne="_primary_1g0n7_69",te="_secondary_1g0n7_70",re="_destructive_1g0n7_71",oe="_primaryInverted_1g0n7_72",se="_secondaryInverted_1g0n7_73",ce="_blurredInverted_1g0n7_75",ie="_link_1g0n7_89",ae="_linkInverted_1g0n7_90",le="_underline_1g0n7_91",de="_underlineInverted_1g0n7_92",ue="_children_1g0n7_286",_e="_iconLeft_1g0n7_293",he="_iconRight_1g0n7_297",n={button:H,sm:J,content:K,icon:Q,md:W,lg:X,image:Z,blurred:ee,primary:ne,secondary:te,destructive:re,primaryInverted:oe,secondaryInverted:se,blurredInverted:ce,link:ie,linkInverted:ae,underline:le,underlineInverted:de,children:ue,iconLeft:_e,iconRight:he},ve={apps:e.jsxs(e.Fragment,{children:[e.jsx(p.FaApple,{})," ",e.jsx(p.FaGooglePlay,{})]}),"arrow-left":e.jsx(z.ArrowLeft,{}),"arrow-right":e.jsx(E.ArrowRight,{}),"chevron-up":e.jsx(V,{}),"chevron-down":e.jsx(P.ChevronDown,{}),"chevron-left":e.jsx(k.ChevronLeft,{}),"chevron-right":e.jsx(k.ChevronRight,{}),envelope:e.jsx(p.FaEnvelope,{}),phone:e.jsx(G,{}),play:e.jsx(C.Play,{}),"new-tab":e.jsx(R.ExternalLink,{}),menu:e.jsx(I,{}),refresh:e.jsx(T,{}),settings:e.jsx(Y,{}),"sign-in":e.jsx(F,{})},ye={primary:n.primary,primaryInverted:n.primaryInverted,secondary:n.secondary,secondaryInverted:n.secondaryInverted,link:n.link,linkInverted:n.linkInverted,underline:n.underline,underlineInverted:n.underlineInverted,blurred:n.blurred,blurredInverted:n.blurredInverted,destructive:n.destructive},ge={left:n.iconLeft,right:n.iconRight},pe={sm:n.sm,md:n.md,lg:n.lg};function xe({variant:j="primary",size:L="md",displayType:x="text",imageSrc:m,imageAlt:w="",ImageComponent:s,icon:f,iconAlignment:q="right",className:M,children:h,disabled:i=!1,...N}){let a=null;if(s){if(b.isValidElement(s))a=s;else if(typeof s=="function"||typeof s=="object"){const t=s;a=e.jsx(t,{})}}const l=x==="image"?a||(m?e.jsx("img",{src:m,alt:w,className:n.image}):b.isValidElement(h)?h:null):e.jsxs("span",{className:`${n.content} ${ge[q]}`,children:[e.jsx("span",{className:n.children,children:h}),f&&e.jsx("span",{className:n.icon,"aria-hidden":"true",children:ve[f]})]}),d=`${M??""} ${n.button} ${pe[L]} ${x==="text"?ye[j]:n.image}`.trim(),{as:v="button",...u}=N;if(v==="a"){const{href:t,target:r,rel:o,...y}=u,g=r==="_blank"?o?`${o} noopener noreferrer`:"noopener noreferrer":o;return e.jsx("a",{href:t,target:r,rel:g,className:d,"aria-disabled":i?"true":void 0,...y,children:l})}if(v==="scroll"){const{scrollTarget:t,scrollOffset:r=0,...o}=u,y=()=>{const _=document.getElementById(t);if(_)if(r){const g=_.getBoundingClientRect().top+window.scrollY-r;window.scrollTo({top:g,behavior:"smooth"})}else _.scrollIntoView({behavior:"smooth",block:"start"})};return e.jsx("button",{type:"button",onClick:y,className:d,disabled:i,"aria-label":`Scroll to ${t}`,...o,children:l})}if(v==="modal"){const{modalPayload:t,...r}=u,{open:o}=$.useModal();return e.jsx("button",{type:"button",className:d,disabled:i,onClick:()=>o(t),...r,children:l})}return e.jsx("button",{type:"button",className:d,disabled:i,...u,children:l})}exports.Button=xe;exports.Menu=I;
|
package/dist/index66.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._button_1g0n7_1{display:inline-flex;justify-content:center;text-decoration:none;border-radius:var(--radius-md);border:none;font-size:var(--font-size-md);font-weight:var(--font-weight-bold);font-family:inherit;background-color:var(--color-button-primary-base-bg);cursor:pointer;transition:background-color .25s,border-color .25s,opacity .25s;height:40px;max-width:450px}@media (max-width: 480px){._button_1g0n7_1{width:100%}}._button_1g0n7_1:focus,._button_1g0n7_1:focus-visible{outline:4px auto -webkit-focus-ring-color}._sm_1g0n7_30{height:32px;font-size:var(--font-size-sm)}._sm_1g0n7_30 ._content_1g0n7_34{padding:var(--spacing-xs) var(--spacing-sm)}._sm_1g0n7_30 ._icon_1g0n7_38 svg{width:var(--font-size-md)}._md_1g0n7_43{height:40px;font-size:var(--font-size-md)}._lg_1g0n7_48{height:48px;font-size:var(--font-size-lg)}._lg_1g0n7_48 ._content_1g0n7_34{padding:var(--spacing-md) var(--spacing-lg)}._lg_1g0n7_48 ._icon_1g0n7_38 svg{width:var(--font-size-xl)}._image_1g0n7_61{background-color:transparent;border-radius:none;height:unset;width:auto}._blurred_1g0n7_68:disabled,._primary_1g0n7_69:disabled,._secondary_1g0n7_70:disabled,._destructive_1g0n7_71:disabled,._primaryInverted_1g0n7_72:disabled,._secondaryInverted_1g0n7_73:disabled,._blurredInverted_1g0n7_75:disabled{border-color:var(--color-button-primary-disabled);background-color:var(--color-button-primary-disabled);color:var(--color-secondary-50);cursor:not-allowed}._blurred_1g0n7_68:disabled:hover,._primary_1g0n7_69:disabled:hover,._secondary_1g0n7_70:disabled:hover,._destructive_1g0n7_71:disabled:hover,._primaryInverted_1g0n7_72:disabled:hover,._secondaryInverted_1g0n7_73:disabled:hover,._blurredInverted_1g0n7_75:disabled:hover{border-color:var(--color-button-primary-disabled);background-color:var(--color-button-primary-disabled);color:var(--color-secondary-50);cursor:not-allowed}._link_1g0n7_89:disabled,._linkInverted_1g0n7_90:disabled,._underline_1g0n7_91:disabled,._underlineInverted_1g0n7_92:disabled{background-color:transparent;color:var(--color-secondary-50);cursor:not-allowed}._blurred_1g0n7_68{-webkit-backdrop-filter:saturate(1.1) blur(1rem);backdrop-filter:saturate(1.1) blur(1rem);background-color:transparent}._blurred_1g0n7_68 ._content_1g0n7_34{background-color:var(--color-button-blurred-base-bg);color:var(--color-button-blurred-base-text);width:100%}._blurred_1g0n7_68:hover ._content_1g0n7_34{background-color:var(--color-button-blurred-base-hover-bg)}._blurredInverted_1g0n7_75{-webkit-backdrop-filter:saturate(1.1) blur(1rem);backdrop-filter:saturate(1.1) blur(1rem);background-color:transparent}._blurredInverted_1g0n7_75 ._content_1g0n7_34{background-color:#ffffff80;color:var(--color-button-blurred-inverted-text)}._blurredInverted_1g0n7_75:hover ._content_1g0n7_34{background-color:var(--color-button-blurred-inverted-hover-bg);color:var(--color-button-blurred-inverted-hover-text)}._primary_1g0n7_69{background-color:var(--color-button-primary-base-bg);color:var(--color-button-primary-base-text)}._primary_1g0n7_69:hover{background-color:var(--color-button-primary-base-hover-bg);color:var(--color-button-primary-base-hover-text)}._primaryInverted_1g0n7_72{border-color:var(--color-button-primary-inverted-bg);background-color:var(--color-button-primary-inverted-bg);color:var(--color-button-primary-inverted-text)}._primaryInverted_1g0n7_72:hover{border-color:var(--color-button-primary-inverted-hover-bg);background-color:var(--color-button-primary-inverted-hover-bg);color:var(--color-button-primary-inverted-hover-text)}._secondary_1g0n7_70{background-color:transparent;border-color:var(--color-button-secondary-base-bg);border-width:2px;border-style:solid;color:var(--color-button-secondary-base-text)}._secondary_1g0n7_70:hover{border-color:var(--color-button-secondary-base-hover-bg);background-color:var(--color-button-secondary-base-hover-bg);color:var(--color-button-secondary-base-hover-text)}._secondaryInverted_1g0n7_73{background-color:transparent;border:2px solid;border-color:var(--color-button-secondary-inverted-bg);border-width:2px;color:var(--color-button-secondary-inverted-text)}._secondaryInverted_1g0n7_73:hover{border-color:var(--color-button-secondary-inverted-hover-bg);background-color:var(--color-button-secondary-inverted-hover-bg);color:var(--color-button-secondary-inverted-hover-text)}._destructive_1g0n7_71{background-color:var(--color-states-error-bg);color:var(--color-states-error-text)}._destructive_1g0n7_71:hover{background-color:var(--color-states-error-hover);color:var(--color-primary-foreground)}._link_1g0n7_89 ._content_1g0n7_34,._linkInverted_1g0n7_90 ._content_1g0n7_34,._underline_1g0n7_91 ._content_1g0n7_34,._underlineInverted_1g0n7_92 ._content_1g0n7_34{padding:0}._link_1g0n7_89{color:var(--color-link-base);background-color:transparent;border:none;padding:0;text-decoration:none;height:unset}._link_1g0n7_89:hover{color:var(--color-link-hover)}._linkInverted_1g0n7_90{color:var(--color-link-inverted);background-color:transparent;border:none;padding:0;text-decoration:none;height:unset;transition:opacity .3s ease-in-out}._linkInverted_1g0n7_90:hover{opacity:.8}._underline_1g0n7_91{color:var(--color-link-base);background-color:transparent;border:none;padding:0;text-decoration:underline;height:unset;transition:opacity .3s ease-in-out}._underline_1g0n7_91:hover{color:var(--color-link-hover)}._underlineInverted_1g0n7_92{color:var(--color-link-inverted);background-color:transparent;border:none;padding:0;text-decoration:underline;height:unset}._underlineInverted_1g0n7_92:hover{opacity:.8}._muted_1g0n7_255{color:var(--color-secondary-50);background-color:transparent;border:none;padding:0;text-decoration:none;height:unset}._icon_1g0n7_38{display:inline-flex}._icon_1g0n7_38 svg{width:var(--font-size-lg)}._content_1g0n7_34{display:inline-flex;align-items:center;justify-content:center;flex-direction:row;gap:var(--spacing-xs);text-wrap:nowrap;border-radius:var(--radius-md);padding:var(--spacing-sm) var(--spacing-md);transition:background-color .3s ease-in-out,color .3s ease-in-out}._children_1g0n7_286{display:flex;align-items:center;justify-content:center;gap:var(--spacing-sm)}._iconLeft_1g0n7_293{flex-direction:row-reverse}._iconRight_1g0n7_297{flex-direction:row}
|
package/dist/index66.css.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
declare const styles: {
|
|
2
|
-
readonly "
|
|
3
|
-
readonly "
|
|
4
|
-
readonly "
|
|
5
|
-
readonly "
|
|
6
|
-
readonly "
|
|
7
|
-
readonly "
|
|
8
|
-
readonly "
|
|
9
|
-
readonly "
|
|
10
|
-
readonly "
|
|
11
|
-
readonly "
|
|
12
|
-
readonly "
|
|
13
|
-
readonly "
|
|
14
|
-
readonly "
|
|
15
|
-
readonly "
|
|
16
|
-
readonly "
|
|
17
|
-
readonly "
|
|
18
|
-
readonly "
|
|
19
|
-
readonly "
|
|
20
|
-
readonly "
|
|
21
|
-
readonly "
|
|
22
|
-
readonly "
|
|
23
|
-
readonly "
|
|
2
|
+
readonly "_blurredInverted_1g0n7_75": string;
|
|
3
|
+
readonly "_blurred_1g0n7_68": string;
|
|
4
|
+
readonly "_button_1g0n7_1": string;
|
|
5
|
+
readonly "_children_1g0n7_286": string;
|
|
6
|
+
readonly "_content_1g0n7_34": string;
|
|
7
|
+
readonly "_destructive_1g0n7_71": string;
|
|
8
|
+
readonly "_iconLeft_1g0n7_293": string;
|
|
9
|
+
readonly "_iconRight_1g0n7_297": string;
|
|
10
|
+
readonly "_icon_1g0n7_38": string;
|
|
11
|
+
readonly "_image_1g0n7_61": string;
|
|
12
|
+
readonly "_lg_1g0n7_48": string;
|
|
13
|
+
readonly "_linkInverted_1g0n7_90": string;
|
|
14
|
+
readonly "_link_1g0n7_89": string;
|
|
15
|
+
readonly "_md_1g0n7_43": string;
|
|
16
|
+
readonly "_muted_1g0n7_255": string;
|
|
17
|
+
readonly "_primaryInverted_1g0n7_72": string;
|
|
18
|
+
readonly "_primary_1g0n7_69": string;
|
|
19
|
+
readonly "_secondaryInverted_1g0n7_73": string;
|
|
20
|
+
readonly "_secondary_1g0n7_70": string;
|
|
21
|
+
readonly "_sm_1g0n7_30": string;
|
|
22
|
+
readonly "_underlineInverted_1g0n7_92": string;
|
|
23
|
+
readonly "_underline_1g0n7_91": string;
|
|
24
24
|
};
|
|
25
25
|
export = styles;
|
|
26
26
|
|
package/dist/main.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');;/* empty css */const i=require("./core/components/Announcement/index.cjs"),_=require("./core/components/Accordion/index.cjs"),d=require("./AccordionItem-DulgZilf.cjs"),s=require("./core/components/Avatar/index.cjs"),a=require("./core/components/Badge/index.cjs"),l=require("./core/components/Box/index.cjs"),u=require("./core/components/Breadcrumbs/index.cjs"),x=require("./core/components/ButtonGroup/index.cjs"),k=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');;/* empty css */const i=require("./core/components/Announcement/index.cjs"),_=require("./core/components/Accordion/index.cjs"),d=require("./AccordionItem-DulgZilf.cjs"),s=require("./core/components/Avatar/index.cjs"),a=require("./core/components/Badge/index.cjs"),l=require("./core/components/Box/index.cjs"),u=require("./core/components/Breadcrumbs/index.cjs"),x=require("./core/components/ButtonGroup/index.cjs"),k=require("./index-CUjZDv40.cjs"),p=require("./core/components/Card/index.cjs"),q=require("./core/components/Carousel/index.cjs"),B=require("./core/components/Checkbox/index.cjs"),m=require("./core/components/Container/index.cjs"),C=require("./core/components/DatePicker/index.cjs"),T=require("./core/components/Divider/index.cjs"),b=require("./core/components/Drawer/index.cjs"),S=require("./core/components/Fieldset/index.cjs"),g=require("./core/components/FileUpload/index.cjs"),A=require("./core/components/FloatingActionButton/index.cjs"),v=require("./core/components/Footer/index.cjs"),h=require("./core/components/Form/index.cjs"),R=require("./core/components/Grid/index.cjs"),P=require("./core/components/Heading/index.cjs"),F=require("./core/components/Input/index.cjs"),L=require("./core/components/Label/index.cjs"),D=require("./core/components/List/index.cjs"),H=require("./core/components/Modal/index.cjs"),M=require("./core/components/NavBar/index.cjs"),G=require("./core/components/Notification/index.cjs"),w=require("./core/components/NotificationContainer/index.cjs"),f=require("./core/components/ProgressBar/index.cjs"),y=require("./core/components/Radio/index.cjs"),N=require("./core/components/Range/index.cjs"),I=require("./core/components/Select/index.cjs"),Q=require("./core/components/Sidebar/index.cjs"),U=require("./core/components/Skeleton/index.cjs"),W=require("./core/components/Spacer/index.cjs"),E=require("./core/components/Spinner/index.cjs"),Y=require("./core/components/Stack/index.cjs"),j=require("./core/components/Switch/index.cjs"),O=require("./core/components/Table/index.cjs"),z=require("./core/components/Tabs/index.cjs"),J=require("./core/components/Text/index.cjs"),K=require("./core/components/Textarea/index.cjs"),V=require("./core/components/Tooltip/index.cjs"),X=require("./core/utils/ThemeProvider/index.cjs"),o=require("./core/context/ModalContext.cjs"),Z=require("./core/hooks/useMediaQuery.cjs"),$=require("./next/blocks/AccordionBlock/index.cjs"),ee=require("./next/blocks/AdditionalCategoriesBlock/index.cjs"),oe=require("./next/blocks/CardGridBlock/index.cjs"),re=require("./next/blocks/CarouselBlock/index.cjs"),ne=require("./next/blocks/ContentBlock/index.cjs"),ce=require("./next/blocks/DocumentListBlock/index.cjs"),te=require("./next/blocks/FeaturedDocumentsBlock/index.cjs"),ie=require("./next/blocks/HeroBlock/index.cjs"),r=require("./next/blocks/HeroBlock/HeroContext.cjs"),_e=require("./next/ui/LocaleLink/index.cjs"),de=require("./next/blocks/QuoteBlock/index.cjs"),se=require("./next/blocks/RichTextBlock/index.cjs"),ae=require("./next/blocks/MarkdownBlock/index.cjs"),le=require("./next/ui/PortableTextRenderer/index.cjs"),ue=require("./next/blocks/StickyScrollBlock/index.cjs"),xe=require("./next/blocks/TabsBlock/index.cjs"),ke=require("./next/blocks/WasHelpfulBlock/index.cjs"),pe=require("./next/blocks/FormBlock/index.cjs"),qe=require("./next/cards/SpotlightCard/index.cjs"),Be=require("./next/cards/BlogArticleCard/index.cjs"),me=require("./next/cards/SpotlightCardAdapter.cjs"),Ce=require("./next/cards/BlogArticleCardAdapter.cjs"),n=require("./next/cards/cardRegistry.cjs"),Te=require("./next/cards/BioCard/index.cjs"),be=require("./next/cards/GridCard/index.cjs"),Se=require("./next/cards/ProductCard/index.cjs"),ge=require("./next/cards/ReviewCard/index.cjs"),Ae=require("./next/cards/SegmentCard/index.cjs"),ve=require("./next/cards/ServiceCard/index.cjs"),he=require("./next/cards/TestimonialCard/index.cjs"),c=require("./next/context/LocaleBridge.cjs"),t=require("./core/context/ThemeContext.cjs"),e=require("./next/utils/blockRenderers.cjs");exports.Announcement=i.Announcement;exports.Accordion=_.Accordion;exports.AccordionItem=d.AccordionItem;exports.Avatar=s.Avatar;exports.Badge=a.Badge;exports.Box=l.Box;exports.Breadcrumbs=u.Breadcrumbs;exports.ButtonGroup=x.ButtonGroup;exports.Button=k.Button;exports.Card=p.Card;exports.Carousel=q.Carousel;exports.Checkbox=B.Checkbox;exports.Container=m.Container;exports.DatePicker=C.DatePicker;exports.Divider=T.Divider;exports.Drawer=b.Drawer;exports.Fieldset=S.Fieldset;exports.FileUpload=g.FileUpload;exports.FloatingActionButton=A.FloatingActionButton;exports.Footer=v.Footer;exports.Form=h.Form;exports.Grid=R.Grid;exports.Heading=P.Heading;exports.Input=F.Input;exports.Label=L.Label;exports.List=D.List;exports.Modal=H.Modal;exports.Navbar=M.Navbar;exports.Notification=G.Notification;exports.NotificationContainer=w.NotificationContainer;exports.ProgressBar=f.ProgressBar;exports.Radio=y.Radio;exports.Range=N.Range;exports.Select=I.Select;exports.Sidebar=Q.Sidebar;exports.Skeleton=U.Skeleton;exports.Spacer=W.Spacer;exports.Spinner=E.Spinner;exports.Stack=Y.Stack;exports.Switch=j.Switch;exports.Table=O.Table;exports.Tabs=z.Tabs;exports.Text=J.Text;exports.Textarea=K.Textarea;exports.Tooltip=V.Tooltip;exports.ThemeProvider=X.ThemeProvider;exports.ModalProvider=o.ModalProvider;exports.useModal=o.useModal;exports.useMediaQuery=Z.useMediaQuery;exports.AccordionBlock=$.AccordionBlock;exports.AdditionalCategoriesBlock=ee.AdditionalCategoriesBlock;exports.CardGridBlock=oe.CardGridBlock;exports.CarouselBlock=re.CarouselBlock;exports.ContentBlock=ne.ContentBlock;exports.DocumentListBlock=ce.DocumentListBlock;exports.FeaturedDocumentsBlock=te.FeaturedDocumentsBlock;exports.HeroBlock=ie.HeroBlock;exports.HeroProvider=r.HeroProvider;exports.useHeroContext=r.useHeroContext;exports.LocaleLink=_e.LocaleLink;exports.QuoteBlock=de.QuoteBlock;exports.RichTextBlock=se.RichTextBlock;exports.MarkdownBlock=ae.MarkdownBlock;exports.RichText=le.RichText;exports.StickyScrollBlock=ue.StickyScrollBlock;exports.TabsBlock=xe.TabsBlock;exports.WasHelpfulBlock=ke.WasHelpfulBlock;exports.FormBlock=pe.FormBlock;exports.SpotlightCard=qe.SpotlightCard;exports.BlogArticleCard=Be.BlogArticleCard;exports.SpotlightCardAdapter=me.SpotlightCardAdapter;exports.BlogArticleCardAdapter=Ce.BlogArticleCardAdapter;exports.CARD_REGISTRY=n.CARD_REGISTRY;exports.resolveCard=n.resolveCard;exports.BioCard=Te.BioCard;exports.GridCard=be.GridCard;exports.ProductCard=Se.ProductCard;exports.ReviewCard=ge.ReviewCard;exports.SegmentCard=Ae.SegmentCard;exports.ServiceCard=ve.ServiceCard;exports.TestimonialCard=he.TestimonialCard;exports.LocaleBridgeProvider=c.LocaleBridgeProvider;exports.useLocaleBridge=c.useLocaleBridge;exports.AppThemeProvider=t.AppThemeProvider;exports.useTheme=t.useTheme;exports.extractText=e.extractText;exports.renderCallToAction=e.renderCallToAction;exports.renderRichText=e.renderRichText;
|
package/dist/main.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { Badge as d } from "./core/components/Badge/index.mjs";
|
|
|
7
7
|
import { Box as n } from "./core/components/Box/index.mjs";
|
|
8
8
|
import { Breadcrumbs as C } from "./core/components/Breadcrumbs/index.mjs";
|
|
9
9
|
import { ButtonGroup as s } from "./core/components/ButtonGroup/index.mjs";
|
|
10
|
-
import { B as T } from "./index
|
|
10
|
+
import { B as T } from "./index--KCTRJKr.js";
|
|
11
11
|
import { Card as S } from "./core/components/Card/index.mjs";
|
|
12
12
|
import { Carousel as v } from "./core/components/Carousel/index.mjs";
|
|
13
13
|
import { Checkbox as R } from "./core/components/Checkbox/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");const e=require("../../../CategoryFilters-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");const e=require("../../../CategoryFilters-D2Hq3RjK.cjs");require("../../../index-CUjZDv40.cjs");require("../../../x-Dft9NVe_.cjs");exports.CategoryFilters=e.CategoryFilters;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import { C as p } from "../../../CategoryFilters-
|
|
3
|
-
import "../../../index
|
|
2
|
+
import { C as p } from "../../../CategoryFilters-4LrS4mcW.js";
|
|
3
|
+
import "../../../index--KCTRJKr.js";
|
|
4
4
|
import "../../../x-CnsEH4Ox.js";
|
|
5
5
|
export {
|
|
6
6
|
p as CategoryFilters
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const l=require("react/jsx-runtime"),e=require("../../../react.esm-C_9Ma9mj.cjs"),c=require("../../../CategoryFilters-
|
|
1
|
+
"use strict";const l=require("react/jsx-runtime"),e=require("../../../react.esm-C_9Ma9mj.cjs"),c=require("../../../CategoryFilters-D2Hq3RjK.cjs");e.vi.mock("./styles.module.css",()=>({default:new Proxy({},{get:(i,o)=>o})}));e.vi.mock("../../../core/components/Button",()=>({Button:({children:t,onClick:i,disabled:o})=>l.jsx("button",{onClick:i,disabled:o,"data-testid":"button",children:t})}));e.vi.mock("lucide-react",()=>({XIcon:()=>l.jsx("span",{"data-testid":"x-icon"})}));const n=[{_id:"cat-1",title:"AI"},{_id:"cat-2",title:"Design"},{_id:"cat-3",title:"Engineering"}];function s(t={}){return{categoryFilters:n,selectedCategories:[],onSelectionChange:e.vi.fn(),showFilters:!0,toggleFilters:e.vi.fn(),isLoading:!1,...t}}e.describe("1. show/hide class",()=>{e.it("applies the 'show' class when showFilters is true",()=>{var i;const{container:t}=e.render(l.jsx(c.CategoryFilters,{...s({showFilters:!0})}));e.globalExpect((i=t.firstElementChild)==null?void 0:i.className).toContain("show")}),e.it("applies the 'hide' class when showFilters is false",()=>{var i;const{container:t}=e.render(l.jsx(c.CategoryFilters,{...s({showFilters:!1})}));e.globalExpect((i=t.firstElementChild)==null?void 0:i.className).toContain("hide")})});e.describe("2. Filter list — one checkbox per category",()=>{e.it("renders a checkbox for each filter",()=>{e.render(l.jsx(c.CategoryFilters,{...s()})),e.globalExpect(e.screen.getAllByRole("checkbox")).toHaveLength(3)}),e.it("renders each filter's title as its label",()=>{e.render(l.jsx(c.CategoryFilters,{...s()})),e.globalExpect(e.screen.getByText("AI")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Design")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Engineering")).toBeInTheDocument()})});e.describe("3. Checked state — checkbox reflects selectedCategories",()=>{e.it("checks the checkbox whose _id is in selectedCategories",()=>{e.render(l.jsx(c.CategoryFilters,{...s({selectedCategories:["cat-2"]})}));const t=e.screen.getAllByRole("checkbox");e.globalExpect(t[1].checked).toBe(!0)}),e.it("leaves unchecked boxes unchecked",()=>{e.render(l.jsx(c.CategoryFilters,{...s({selectedCategories:["cat-2"]})}));const t=e.screen.getAllByRole("checkbox");e.globalExpect(t[0].checked).toBe(!1),e.globalExpect(t[2].checked).toBe(!1)}),e.it("checks all boxes when all are selected",()=>{e.render(l.jsx(c.CategoryFilters,{...s({selectedCategories:["cat-1","cat-2","cat-3"]})}));const t=e.screen.getAllByRole("checkbox");e.globalExpect(t.every(i=>i.checked)).toBe(!0)})});e.describe("4. Checking a filter — onSelectionChange called with filter added",()=>{e.it("calls onSelectionChange with the new filter appended",()=>{const t=e.vi.fn();e.render(l.jsx(c.CategoryFilters,{...s({selectedCategories:["cat-1"],onSelectionChange:t})})),e.fireEvent.click(e.screen.getAllByRole("checkbox")[1]),e.globalExpect(t).toHaveBeenCalledWith(["cat-1","cat-2"])}),e.it("calls onSelectionChange with just the new filter when none were selected",()=>{const t=e.vi.fn();e.render(l.jsx(c.CategoryFilters,{...s({onSelectionChange:t})})),e.fireEvent.click(e.screen.getAllByRole("checkbox")[0]),e.globalExpect(t).toHaveBeenCalledWith(["cat-1"])})});e.describe("5. Unchecking a filter — onSelectionChange called with filter removed",()=>{e.it("calls onSelectionChange without the unchecked filter",()=>{const t=e.vi.fn();e.render(l.jsx(c.CategoryFilters,{...s({selectedCategories:["cat-1","cat-2"],onSelectionChange:t})})),e.fireEvent.click(e.screen.getAllByRole("checkbox")[0]),e.globalExpect(t).toHaveBeenCalledWith(["cat-2"])}),e.it("calls onSelectionChange with an empty array when the last filter is unchecked",()=>{const t=e.vi.fn();e.render(l.jsx(c.CategoryFilters,{...s({selectedCategories:["cat-1"],onSelectionChange:t})})),e.fireEvent.click(e.screen.getAllByRole("checkbox")[0]),e.globalExpect(t).toHaveBeenCalledWith([])})});e.describe("6. Close button — toggleFilters called when X is clicked",()=>{e.it("calls toggleFilters when the X icon button is clicked",()=>{const t=e.vi.fn();e.render(l.jsx(c.CategoryFilters,{...s({toggleFilters:t})})),e.fireEvent.click(e.screen.getByTestId("x-icon").closest("button")),e.globalExpect(t).toHaveBeenCalledOnce()})});e.describe("7. Apply Filters button — toggleFilters called when clicked",()=>{e.it("calls toggleFilters when Apply Filters is clicked",()=>{const t=e.vi.fn();e.render(l.jsx(c.CategoryFilters,{...s({toggleFilters:t})})),e.fireEvent.click(e.screen.getByText("Apply Filters")),e.globalExpect(t).toHaveBeenCalledOnce()})});e.describe("8. Apply Filters disabled — button disabled when isLoading=true",()=>{e.it("disables the Apply Filters button when isLoading is true",()=>{e.render(l.jsx(c.CategoryFilters,{...s({isLoading:!0})})),e.globalExpect(e.screen.getByText("Apply Filters").closest("button")).toBeDisabled()}),e.it("enables the Apply Filters button when isLoading is false",()=>{e.render(l.jsx(c.CategoryFilters,{...s({isLoading:!1})})),e.globalExpect(e.screen.getByText("Apply Filters").closest("button")).not.toBeDisabled()})});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { v as a, d as h, i as o, r as s, g as t, s as c, f as d } from "../../../react.esm-DjxyacK8.js";
|
|
3
|
-
import { C as n } from "../../../CategoryFilters-
|
|
3
|
+
import { C as n } from "../../../CategoryFilters-4LrS4mcW.js";
|
|
4
4
|
a.mock("./styles.module.css", () => ({ default: new Proxy({}, { get: (r, g) => g }) }));
|
|
5
5
|
a.mock("../../../core/components/Button", () => ({
|
|
6
6
|
Button: ({ children: e, onClick: r, disabled: g }) => /* @__PURE__ */ l("button", { onClick: r, disabled: g, "data-testid": "button", children: e })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),oe=require("../../hooks/useStyleClasses.cjs"),ne=require("../../context/LocaleBridge.cjs"),w=require("../../../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),oe=require("../../hooks/useStyleClasses.cjs"),ne=require("../../context/LocaleBridge.cjs"),w=require("../../../index-CUjZDv40.cjs"),ce=require("../../../core/components/Input/index.cjs"),re=require("../../../core/components/Select/index.cjs"),t=require("../../../CategoryFilters-D2Hq3RjK.cjs"),ie=require("../../../x-Dft9NVe_.cjs"),ue=[{label:"Newest",value:"date-desc"},{label:"Oldest",value:"date-asc"},{label:"Title A-Z",value:"title-asc"},{label:"Title Z-A",value:"title-desc"},{label:"Most Popular",value:"popular-desc"}];function de({heading:r,layout:X="grid",includeFilters:L,excludeFilters:q,limit:B=3,categoryFilters:h,documentType:E,styleOptions:G,initialDocuments:v=[],initialTotalCount:M=0,initialIncludeCategories:J=[],parentPage:$,id:K,renderRichText:o,renderCard:g}){const[Q,u]=s.useState(v),[V,Y]=s.useState(M),[b,R]=s.useState("date-desc"),[d,P]=s.useState(J),[z,m]=s.useState(v.length),[n,A]=s.useState(!1),[j,C]=s.useState(!1),[_,i]=s.useState(v.length<M),[y,x]=s.useState(""),[p,T]=s.useState(""),{locale:D}=ne.useLocaleBridge(),ee=oe.useStyleClasses(G),I=s.useRef(!1),F=s.useRef({sort:b,debouncedSearch:p,selectedCategories:d,start:z,isLoading:n,hasMore:_,limit:B,documentType:E,locale:D,includeFilters:L,excludeFilters:q,parentPage:$});F.current={sort:b,debouncedSearch:p,selectedCategories:d,start:z,isLoading:n,hasMore:_,limit:B,documentType:E,locale:D,includeFilters:L,excludeFilters:q,parentPage:$};const se=X==="list"?t.styles.list:void 0,H=s.useCallback(()=>{C(l=>!l)},[]),te=s.useCallback(l=>{R(l.target.value),u([]),m(0),i(!0)},[]),le=s.useCallback(()=>{u([]),m(0),i(!0),P([]),x(""),C(!1)},[]),ae=s.useCallback(l=>{u([]),m(0),i(!0),P(l)},[]),O=s.useRef(async(l=!1)=>{var W,Z,U;const a=F.current;if(!l&&(a.isLoading||!a.hasMore))return;A(!0);const f=new URLSearchParams({start:l?"0":String(a.start),limit:String(a.limit),sort:a.sort,documentType:a.documentType,locale:a.locale});a.debouncedSearch&&f.append("search",a.debouncedSearch),a.selectedCategories.forEach(c=>f.append("categories",c)),(W=a.includeFilters)==null||W.forEach(c=>f.append("include",c._id)),(Z=a.excludeFilters)==null||Z.forEach(c=>f.append("exclude",c._id)),(U=a.parentPage)!=null&&U._ref&&f.append("parentRef",a.parentPage._ref);try{const S=await(await fetch(`/api/documents?${f.toString()}`)).json();u(k=>l?S.documents:[...k,...S.documents]),m(k=>l?a.limit:k+a.limit),Y(S.totalCount),i((l?0:a.start)+S.documents.length<S.totalCount)}catch(c){console.error("Failed to load documents:",c),i(!1)}finally{A(!1)}}).current,N=s.useCallback(()=>{window.innerWidth>768&&(C(!1),document.body.style.overflow="")},[]);return s.useEffect(()=>(window.addEventListener("resize",N),()=>window.removeEventListener("resize",N)),[N]),s.useEffect(()=>(document.body.style.overflow=j?"hidden":"",()=>{document.body.style.overflow=""}),[j]),s.useEffect(()=>{const l=setTimeout(()=>T(y),500);return()=>clearTimeout(l)},[y]),s.useEffect(()=>{if(!I.current){I.current=!0;return}(p||b!=="date-desc"||d.length>0)&&O(!0)},[p,b,d.join(",")]),e.jsx("section",{id:K,className:`${t.styles.documentList} ${ee}`,children:e.jsxs("article",{className:t.styles.container,children:[e.jsxs("div",{className:t.styles.heading,children:[e.jsxs("div",{children:[r.eyebrow&&(o==null?void 0:o({blocks:r.eyebrow,className:t.styles.eyebrow})),o==null?void 0:o({blocks:r.title,className:t.styles.title})]})," ",(r==null?void 0:r.description)&&(o==null?void 0:o({blocks:r.description}))]}),e.jsxs("div",{className:t.styles.listContainer,children:[h!=null&&h.length?e.jsxs("div",{className:t.styles.filterToggle,children:[e.jsx(w.Button,{as:"button",variant:"secondary",onClick:H,disabled:n,icon:"settings",iconAlignment:"left",children:"Filters"}),e.jsx(w.Button,{as:"button",variant:"link",onClick:le,disabled:n||d.length===0&&y.length===0,children:"Reset"})]}):null,h&&e.jsx(t.CategoryFilters,{categoryFilters:h,selectedCategories:d,onSelectionChange:ae,showFilters:j,toggleFilters:H,isLoading:n}),e.jsxs("div",{className:t.styles.listWrapper,children:[e.jsxs("div",{className:t.styles.listHeader,children:[e.jsxs("div",{className:t.styles.listResults,children:["Results: ",e.jsx("span",{children:V})]}),e.jsxs("div",{className:t.styles.listHeaderFilters,children:[e.jsxs("div",{className:t.styles.listSearch,children:[e.jsx(ce.Input,{type:"text",name:"list-search",placeholder:"Search",value:y,onChange:l=>{x(l.target.value),u([]),m(0),i(!0)}}),y&&e.jsx("button",{className:t.styles.clearSearch,onClick:()=>{x(""),u([]),m(0),i(!0)},children:e.jsx(ie.X,{size:21})})]}),e.jsx("div",{className:t.styles.listSort,children:e.jsx(re.Select,{id:"list-sort",name:"list-sort","aria-label":"Sort by",options:ue,onChange:te})})]})]}),e.jsx("div",{className:`${t.styles.list} ${se??""}`,children:Q.map(l=>g==null?void 0:g(l))}),_&&e.jsx("div",{className:t.styles.loadMore,children:e.jsx(w.Button,{as:"button",variant:"primary",onClick:()=>O(!1),disabled:n,icon:"refresh",iconAlignment:"left",className:n?t.styles.buttonIsLoading:"",children:n?"Loading...":"Load more"})})]})]})]})})}exports.DocumentListBlock=de;
|
|
@@ -2,10 +2,10 @@ import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as l, useRef as j, useCallback as g, useEffect as w } from "react";
|
|
3
3
|
import { useStyleClasses as ie } from "../../hooks/useStyleClasses.mjs";
|
|
4
4
|
import { useLocaleBridge as de } from "../../context/LocaleBridge.mjs";
|
|
5
|
-
import { B as z } from "../../../index
|
|
5
|
+
import { B as z } from "../../../index--KCTRJKr.js";
|
|
6
6
|
import { Input as ue } from "../../../core/components/Input/index.mjs";
|
|
7
7
|
import { Select as me } from "../../../core/components/Select/index.mjs";
|
|
8
|
-
import { s as e, C as fe } from "../../../CategoryFilters-
|
|
8
|
+
import { s as e, C as fe } from "../../../CategoryFilters-4LrS4mcW.js";
|
|
9
9
|
import { X as he } from "../../../x-CnsEH4Ox.js";
|
|
10
10
|
const pe = [
|
|
11
11
|
{ label: "Newest", value: "date-desc" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),W=require("../../../core/components/Form/index.cjs"),E=require("../../../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("react"),W=require("../../../core/components/Form/index.cjs"),E=require("../../../index-CUjZDv40.cjs"),M=require("../../../core/components/ProgressBar/index.cjs"),A=require("../../hooks/useStyleClasses.cjs"),e=require("../../../FormField-CrjRuF3o.cjs"),_=require("./validate.cjs");function D(r,s){switch(s.type){case"SET_VALUE":return{...r,values:{...r.values,[s.name]:s.value},errors:{...r.errors,[s.name]:""}};case"SET_ERRORS":return{...r,errors:s.errors};case"CLEAR_ERROR":return{...r,errors:{...r.errors,[s.name]:""}};case"NEXT_STEP":return{...r,currentStep:r.currentStep+1,errors:{}};case"PREV_STEP":return{...r,currentStep:r.currentStep-1,errors:{}};case"SET_SUBMITTING":return{...r,isSubmitting:s.value};case"SET_RESULT":return{...r,submitResult:s.result,isSubmitting:!1};case"RESET":return{...r,currentStep:0,errors:{},submitResult:null,isSubmitting:!1};default:return r}}function G({id:r,heading:s,layout:B="vertical",maxWidth:x="md",steps:S,submitLabel:C="Submit",nextLabel:F="Next",backLabel:L="Back",successMessage:P="Thank you! Your submission has been received.",errorMessage:p="Something went wrong. Please try again.",styleOptions:$,renderRichText:c,onSubmit:v}){const N=A.useStyleClasses($??{}),j={sm:e.styles.maxWidthSm,md:e.styles.maxWidthMd,lg:e.styles.maxWidthLg,full:e.styles.maxWidthFull}[x],q=i.useMemo(()=>_.buildInitialValues(S),[]),[w,o]=i.useReducer(D,{values:q,errors:{},currentStep:0,isSubmitting:!1,submitResult:null}),{values:u,errors:T,currentStep:m,isSubmitting:b,submitResult:n}=w,y=S.length,k=y>1,f=m===y-1,I=(m+1)/y*100,a=S[m],O=i.useCallback((l,d)=>{o({type:"SET_VALUE",name:l,value:d})},[]),U=i.useCallback(()=>{const l=_.validateStep(a.fields,u);if(Object.keys(l).length>0){o({type:"SET_ERRORS",errors:l});return}o({type:"NEXT_STEP"})},[a.fields,u]),V=i.useCallback(()=>{o({type:"PREV_STEP"})},[]),R=i.useCallback(async()=>{const l=_.validateStep(a.fields,u);if(Object.keys(l).length>0){o({type:"SET_ERRORS",errors:l});return}o({type:"SET_SUBMITTING",value:!0});try{const d=await v(u);o({type:"SET_RESULT",result:d})}catch{o({type:"SET_RESULT",result:{success:!1,message:p}})}},[a.fields,u,v,p]);return n!=null&&n.success?t.jsx("section",{id:r,className:`${e.styles.formBlock} ${N}`,children:t.jsx("div",{className:`${e.styles.formInner} ${j}`,children:t.jsx("div",{className:e.styles.container,children:t.jsxs("div",{className:e.styles.success,children:[t.jsx("p",{children:n.message??P}),t.jsx(E.Button,{as:"button",variant:"secondary",onClick:()=>o({type:"RESET"}),children:"Submit another response"})]})})})}):t.jsx("section",{id:r,className:`${e.styles.formBlock} ${N}`,children:t.jsx("div",{className:`${e.styles.formInner} ${j}`,children:t.jsxs("div",{className:e.styles.container,children:[((s==null?void 0:s.title)||(s==null?void 0:s.description))&&t.jsxs("div",{className:e.styles.heading,children:[s.eyebrow&&(c==null?void 0:c({blocks:s.eyebrow,className:e.styles.eyebrow})),s.title&&(c==null?void 0:c({blocks:s.title,className:e.styles.title})),s.description&&(c==null?void 0:c({blocks:s.description}))]}),k&&t.jsxs("div",{className:e.styles.progress,children:[t.jsxs("div",{className:e.styles.progressHeader,children:[t.jsx("span",{className:e.styles.stepLabel,children:a.title}),t.jsxs("span",{className:e.styles.stepCount,children:[m+1," / ",y]})]}),t.jsx(M.ProgressBar,{progress:I,variant:"primary",size:"sm",showLabel:!1})]}),a.description&&t.jsx("p",{className:e.styles.stepDescription,children:a.description}),n&&!n.success&&t.jsx("div",{className:e.styles.errorBanner,role:"alert",children:n.message??p}),t.jsxs(W.Form,{layout:B,noValidate:!0,onSubmit:l=>{l.preventDefault(),f?R():U()},children:[t.jsx("div",{className:e.styles.fields,children:a.fields.map(l=>t.jsx(e.FormField,{field:l,value:u[l.name.current],error:T[l.name.current],onChange:O},l._key))}),(s==null?void 0:s.disclaimer)&&(c==null?void 0:c({blocks:s==null?void 0:s.disclaimer,className:e.styles.disclaimer})),t.jsxs("div",{className:e.styles.actions,children:[k&&m>0&&t.jsx(E.Button,{as:"button",type:"button",variant:"secondary",onClick:V,disabled:b,children:L}),t.jsx(E.Button,{as:"button",type:"submit",variant:"primary",disabled:b,className:e.styles.submitButton,children:b?"Submitting…":f?C:F})]})]})]})})})}exports.FormBlock=G;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as M, useReducer as G, useCallback as S } from "react";
|
|
3
3
|
import { Form as X } from "../../../core/components/Form/index.mjs";
|
|
4
|
-
import { B as d } from "../../../index
|
|
4
|
+
import { B as d } from "../../../index--KCTRJKr.js";
|
|
5
5
|
import { ProgressBar as z } from "../../../core/components/ProgressBar/index.mjs";
|
|
6
6
|
import { useStyleClasses as H } from "../../hooks/useStyleClasses.mjs";
|
|
7
7
|
import { s as r, F as Y } from "../../../FormField-CC54vtkW.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index13.css');const a=require("react/jsx-runtime"),G=require("../../hooks/useStyleClasses.cjs"),g=require("../../../core/components/Tabs/index.cjs"),Y=require("../../../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index13.css');const a=require("react/jsx-runtime"),G=require("../../hooks/useStyleClasses.cjs"),g=require("../../../core/components/Tabs/index.cjs"),Y=require("../../../index-CUjZDv40.cjs"),J=require("../../utils/resolveLinkUrl.cjs"),K=require("../../../core/context/ThemeContext.cjs"),_=require("../../utils/mediaUtils.cjs"),O=require("../../hooks/useMediaQuery.cjs"),W="_tabs_heqdj_1",X="_container_heqdj_7",Z="_heading_heqdj_25",A="_text_heqdj_32",T="_headingHorizontal_heqdj_46",R="_title_heqdj_54",tt="_headingVertical_heqdj_64",at="_tabContent_heqdj_74",st="_tabImage_heqdj_98",et="_vertical_heqdj_103",lt="_tabsContainer_heqdj_69",ot="_tabText_heqdj_126",it="_gridItems_heqdj_146",nt="_gridItem_heqdj_146",ct="_fullBleed_heqdj_186",bt="_overlay_heqdj_213",mt="_eyebrow_heqdj_319",s={tabs:W,container:X,heading:Z,text:A,headingHorizontal:T,title:R,headingVertical:tt,tabContent:at,tabImage:st,vertical:et,tabsContainer:lt,tabText:ot,gridItems:it,gridItem:nt,default:"_default_heqdj_171",fullBleed:ct,overlay:bt,eyebrow:mt},_t={orientationHorizontal:"horizontal",orientationVertical:"vertical"},rt={themeDefault:"default",themeLight:"light",themeDark:"dark",themeTransparent:"transparent"},ut={horizontal:s.headingHorizontal,vertical:s.headingVertical},gt={horizontal:"",vertical:s.vertical};function jt({src:e,alt:c,renderImage:m}){return m?m({src:e,alt:c,width:600,height:658,priority:!0}):a.jsx("img",{src:e,alt:c,width:600,height:658})}function vt({items:e,mode:c,renderImage:m,renderRichText:i}){return a.jsx("div",{className:s.gridItems,children:e.map((o,t)=>{const n=_.resolveImageUrl(o.itemImage,c,"medium"),b=_.resolveAltText(o.itemImage,c,"Grid image");return a.jsxs("div",{className:s.gridItem,children:[n&&m?m({src:n,alt:b,width:200,height:200}):n?a.jsx("img",{src:n,alt:b,width:200,height:200}):null,o.itemText&&(i==null?void 0:i({blocks:o.itemText}))]},t)})})}function dt({heading:e,image:c,items:m,callToAction:i,styleOptions:o,renderRichText:t,renderCallToAction:n,renderImage:b}){const{mode:u}=K.useTheme(),f=G.useStyleClasses(o),P=O.useMediaQuery("(max-width: 768px)")??!1,q=(o==null?void 0:o.layout)??"default",y=ut[e.headingLayout??"vertical"],N=_t[(o==null?void 0:o.orientation)??"orientationHorizontal"],F=rt[(o==null?void 0:o.theme)??"themeDefault"],I=_.resolveImageUrl(c,u,"medium"),j=_.resolveImageUrl(c,u,"large"),v=_.resolveAltText(c,u,"Block image"),w=a.jsxs(g.Tabs,{defaultIndex:0,orientation:N,theme:F,children:[a.jsx(g.Tabs.List,{children:m.map((l,d)=>a.jsx(g.Tabs.Trigger,{index:d,children:l.title},l.title))}),m.map((l,d)=>{var S,U,B,z,x,C,H,E,M,V,D;const h=_.resolveImageUrl((S=l.content)==null?void 0:S.tabImage,u,"medium"),p=_.resolveAltText((U=l.content)==null?void 0:U.tabImage,u,"Tab image"),k=(B=l.content)!=null&&B.tabLink?J.resolveLinkURL(l.content.tabLink):void 0,r=(z=l.content)==null?void 0:z.tabLink,L=Array.isArray((x=l.content)==null?void 0:x.tabGridItem)?l.content.tabGridItem:null,Q=(C=l.content)!=null&&C.tabStyleOptions?G.useStyleClasses((H=l.content)==null?void 0:H.tabStyleOptions):void 0,$=_.resolveImageStyle(c,P);return a.jsx(g.Tabs.Panel,{index:d,children:a.jsxs("div",{className:`${s.tabContent} ${gt[N]} ${Q}`,children:[h&&a.jsx("div",{className:s.tabImage,children:b?b({src:h,alt:p,width:250,height:250,style:$}):a.jsx("img",{src:h,alt:p,width:250,height:250,style:{width:"100%",height:"auto",...$}})}),a.jsxs("div",{className:s.tabText,children:[((E=l.content)==null?void 0:E.tabText)&&(t==null?void 0:t({blocks:l.content.tabText})),L&&a.jsx(vt,{items:L,mode:u,renderImage:b,renderRichText:t}),k&&k!=="#"&&r&&a.jsx(Y.Button,{as:"a",variant:r.variant??"primary",href:k,target:((M=r.linkOptions)==null?void 0:M.linkType)==="external"?"_blank":"_self",rel:((V=r.linkOptions)==null?void 0:V.linkType)==="external"?"noopener noreferrer":"","aria-label":r.ariaLabel||r.label,children:r.label}),((D=l.content)==null?void 0:D.tabDisclaimer)&&(t==null?void 0:t({blocks:l.content.tabDisclaimer}))]})]})},l.title)})]});return q==="default"?a.jsx("section",{className:`${s.tabs} ${s.default} ${f}`,children:a.jsxs("article",{className:s.container,children:[I&&a.jsx(jt,{src:I,alt:v,renderImage:b}),a.jsxs("div",{className:`${s.heading} ${y}`,children:[a.jsxs("div",{children:[e.eyebrow&&(t==null?void 0:t({blocks:e.eyebrow,className:s.eyebrow})),t==null?void 0:t({blocks:e.title,className:s.title})]}),e.description&&a.jsx("div",{className:s.text,children:t==null?void 0:t({blocks:e.description})})]}),a.jsx("div",{className:s.tabsContainer,children:w}),i&&(n==null?void 0:n({items:i.items,alignment:i.alignment,spacing:i.spacing,mobileOrientation:i.mobileOrientation})),e.disclaimer&&(t==null?void 0:t({blocks:e.disclaimer}))]})}):q==="full-bleed"?a.jsx("section",{"data-overlay":"true",className:`${s.tabs} ${s.fullBleed} ${f} tabsFullBleed`,children:a.jsxs("article",{className:s.container,children:[j&&(b?b({src:j,alt:v,fill:!0,priority:!0,sizes:"(max-width: 767px) 600px, 1200px",style:{objectFit:"cover"},draggable:!1}):a.jsx("img",{src:j,alt:v,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}})),a.jsx("div",{className:s.overlay,children:a.jsxs("div",{className:`${s.heading} ${y}`,children:[a.jsxs("div",{children:[e.eyebrow&&(t==null?void 0:t({blocks:e.eyebrow,className:s.eyebrow})),t==null?void 0:t({blocks:e.title,className:s.title})]}),e.description&&(t==null?void 0:t({blocks:e.description})),a.jsx("div",{className:s.tabsContainer,children:w}),i&&(n==null?void 0:n({items:i.items,alignment:i.alignment,spacing:i.spacing,mobileOrientation:i.mobileOrientation})),e.disclaimer&&(t==null?void 0:t({blocks:e.disclaimer}))]})})]})}):null}exports.TabsBlock=dt;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as b, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useStyleClasses as Q } from "../../hooks/useStyleClasses.mjs";
|
|
3
3
|
import { Tabs as g } from "../../../core/components/Tabs/index.mjs";
|
|
4
|
-
import { B as W } from "../../../index
|
|
4
|
+
import { B as W } from "../../../index--KCTRJKr.js";
|
|
5
5
|
import { resolveLinkURL as X } from "../../utils/resolveLinkUrl.mjs";
|
|
6
6
|
import { useTheme as Z } from "../../../core/context/ThemeContext.mjs";
|
|
7
7
|
import { resolveImageUrl as v, resolveAltText as I, resolveImageStyle as O } from "../../utils/mediaUtils.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index14.css');const e=require("react/jsx-runtime"),n=require("react"),f=require("../../../core/components/ButtonGroup/index.cjs"),u=require("../../../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index14.css');const e=require("react/jsx-runtime"),n=require("react"),f=require("../../../core/components/ButtonGroup/index.cjs"),u=require("../../../index-CUjZDv40.cjs"),p="_wasHelpful_1g4ig_1",_="_container_1g4ig_5",g="_buttons_1g4ig_34",m="_heading_1g4ig_49",o={wasHelpful:p,container:_,buttons:g,heading:m};function b({page:t,type:d}){const[h,l]=n.useState(!1),[i,c]=n.useState(!1),a=n.useMemo(()=>`wasHelpful:${t._id}`,[t._id]);n.useEffect(()=>{const s=localStorage.getItem(a);(s==="yes"||s==="no")&&l(!0)},[a]);const r=n.useCallback(async s=>{c(!0);try{await fetch("/api/helpful",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({postId:t._id,isHelpful:s})}),localStorage.setItem(a,s?"yes":"no"),l(!0)}catch{}finally{c(!1)}},[t._id,a]);return e.jsx("section",{className:`${o.wasHelpful} ${d==="article"?"narrow":""}`,children:e.jsxs("article",{className:o.container,children:[e.jsx("hr",{}),h?e.jsx("p",{className:o.heading,children:"Thanks for your feedback!"}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:o.heading,children:"Was this article helpful?"}),e.jsxs(f.ButtonGroup,{className:o.buttons,orientation:"horizontal",alignment:"center",children:[e.jsx(u.Button,{as:"button",variant:"primary",onClick:()=>r(!0),disabled:i,children:"Yes"}),e.jsx(u.Button,{as:"button",variant:"secondary",onClick:()=>r(!1),disabled:i,children:"No"})]})]}),t.helpfulYesCount>0&&e.jsxs("p",{children:[t.helpfulYesCount.toLocaleString(),t.helpfulYesCount===1?" person":" people"," found this article helpful"]}),e.jsx("hr",{})]})})}exports.WasHelpfulBlock=b;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, jsxs as a, Fragment as p } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u, useMemo as m, useEffect as g, useCallback as _ } from "react";
|
|
3
3
|
import { ButtonGroup as b } from "../../../core/components/ButtonGroup/index.mjs";
|
|
4
|
-
import { B as d } from "../../../index
|
|
4
|
+
import { B as d } from "../../../index--KCTRJKr.js";
|
|
5
5
|
import '../../../index14.css';const y = "_wasHelpful_1g4ig_1", C = "_container_1g4ig_5", S = "_buttons_1g4ig_34", k = "_heading_1g4ig_49", s = {
|
|
6
6
|
wasHelpful: y,
|
|
7
7
|
container: C,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index15.css');const t=require("react/jsx-runtime"),v=require("../../../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index15.css');const t=require("react/jsx-runtime"),v=require("../../../index-CUjZDv40.cjs"),d=require("../../utils/resolveLinkUrl.cjs"),y=require("../../../core/context/ThemeContext.cjs"),m=require("../../utils/mediaUtils.cjs"),b="_spotlight_u9yqn_1",p="_imageWrapper_u9yqn_7",q="_content_u9yqn_29",j="_title_u9yqn_35",g="_actions_u9yqn_45",a={spotlight:b,imageWrapper:p,content:q,title:j,actions:g};function A({spotlight:e,renderImage:l,renderRichText:n}){var r,_;const{mode:o}=y.useTheme(),i=m.resolveImageUrl(e.image,o),c=m.resolveAltText(e.image,o),u=d.resolveLinkURL(e.callToAction)??"#",s=((r=e.callToAction.linkOptions)==null?void 0:r.linkType)==="external";return t.jsxs("div",{className:a.spotlight,children:[e.image&&i&&t.jsx("div",{className:a.imageWrapper,children:l?l({src:i,alt:c,width:600,height:400,priority:!1}):t.jsx("img",{src:i,alt:c,width:600,height:400,style:{width:"100%",height:"100%",objectFit:"cover"}})}),t.jsxs("div",{className:a.content,children:[t.jsx("div",{children:n==null?void 0:n({blocks:e.title,className:a.title})}),e.description&&t.jsx("div",{children:n==null?void 0:n({blocks:e.description})})]}),((_=e.callToAction)==null?void 0:_.label)&&t.jsx("div",{className:a.actions,children:t.jsx(v.Button,{as:"a",variant:e.callToAction.variant??"primary",href:u,target:s?"_blank":"_self",rel:s?"noopener noreferrer":"","aria-label":e.callToAction.ariaLabel||e.callToAction.label,children:e.callToAction.label})})]})}exports.SpotlightCard=A;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as _, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { B as v } from "../../../index
|
|
2
|
+
import { B as v } from "../../../index--KCTRJKr.js";
|
|
3
3
|
import { resolveLinkURL as d } from "../../utils/resolveLinkUrl.mjs";
|
|
4
4
|
import { useTheme as f } from "../../../core/context/ThemeContext.mjs";
|
|
5
5
|
import { resolveImageUrl as y, resolveAltText as b } from "../../utils/mediaUtils.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),U=require("react"),B=require("next/image"),z=require("../../../core/components/ButtonGroup/index.cjs"),l=require("../../../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),U=require("react"),B=require("next/image"),z=require("../../../core/components/ButtonGroup/index.cjs"),l=require("../../../index-CUjZDv40.cjs"),G=require("../../../core/components/Modal/index.cjs"),C=require("../../utils/resolveLinkUrl.cjs"),H=require("../../../core/context/ThemeContext.cjs"),Q=require("../../hooks/useMediaQuery.cjs");function W({items:r,alignment:I,spacing:R,mobileOrientation:M="column",className:O}){const[P,S]=U.useState([]),{mode:t}=H.useTheme(),m=Q.useMediaQuery("(max-width: 767px)");return U.useEffect(()=>{if(!(r!=null&&r.length)||!C.resolveLinkURL)return;async function e(){const o=await Promise.all(r.map(a=>C.resolveLinkURL(a)));S(o)}e()},[r]),r!=null&&r.length?n.jsx(z.ButtonGroup,{className:O,alignment:I,spacing:R,mobileOrientation:M,children:r.slice(0,3).map((e,o)=>{var g,d,p,c,f,h,b,y,v,x,_,k,j,T,A,w,q,L;const a=P[o]??"#",i={};if(i.height="auto",((g=e.image)==null?void 0:g.layout)==="cover")i.objectFit="cover",(d=e.image)!=null&&d.position&&(i.objectPosition=m?"top":(p=e.image)==null?void 0:p.position);else if(((c=e.image)==null?void 0:c.layout)==="contain"){if(i.objectFit="contain",((f=e.image)==null?void 0:f.sizing)==="half"?i.width=m?"100%":"50%":((h=e.image)==null?void 0:h.sizing)==="inset"?(i.width="100%",i.maxWidth=e.image.maxWidth??"unset"):i.width="100%",(b=e.image)!=null&&b.aspectRatio){const[$,F]=(y=e.image)==null?void 0:y.aspectRatio.split(":").map(Number);i.aspectRatio=`${$}/${F}`}}else i.objectFit="none";let s;(v=e.image)!=null&&v.imageUrls&&(s=t==="dark"&&((x=e.image.imageUrls.dark)==null?void 0:x.medium)||e.image.imageUrls.default.medium);let u=((j=(k=(_=e.image)==null?void 0:_[t==="dark"?"darkImage":"defaultImage"])==null?void 0:k.asset)==null?void 0:j.altText)||((w=(A=(T=e.image)==null?void 0:T[t==="dark"?"darkImage":"defaultImage"])==null?void 0:A.asset)==null?void 0:w.description)||"Card image";switch(e.type){case"link":return n.jsx(l.Button,{as:"a",variant:e.variant,href:a,target:((q=e.linkOptions)==null?void 0:q.linkType)==="external"?"_blank":"_self",rel:((L=e.linkOptions)==null?void 0:L.linkType)==="external"?"noopener noreferrer":"","aria-label":e.ariaLabel||e.label,icon:e.icon,iconAlignment:e.iconAlignment??"right",displayType:e.displayType,ImageComponent:n.jsx(B,{src:s??"",alt:u,width:600,height:658,priority:!1,style:i}),children:e.label},o);case"scroll":return n.jsx(l.Button,{as:"scroll",variant:e.variant,scrollTarget:e.scrollTarget??"","aria-label":e.ariaLabel||e.label,icon:e.icon,iconAlignment:e.iconAlignment??"right",displayType:e.displayType,scrollOffset:e.scrollOffset,ImageComponent:n.jsx(B,{src:s??"",alt:u,width:600,height:658,priority:!1,style:i}),children:e.label},o);case"modal":return n.jsx(l.Button,{as:"modal",variant:e.variant??"primary",icon:e.icon,iconAlignment:e.iconAlignment??"right","aria-label":e.ariaLabel||e.label,modalPayload:{formReference:e.formReference,modalContent:e.modalContent},children:e.label??"Open"},o);case"video":return n.jsx(G.Modal,{trigger:n.jsx(l.Button,{as:"button",variant:e.variant??"primary",icon:e.icon,iconAlignment:e.iconAlignment??"right","aria-label":e.ariaLabel||e.label,children:e.label}),content:n.jsx("video",{src:e.videoUrl,controls:!0,autoPlay:!0})},o);case"download":return n.jsx(l.Button,{as:"a",variant:e.variant??"primary",href:a,download:!0,target:"_blank",rel:"noopener noreferrer","aria-label":e.ariaLabel||e.label,icon:e.icon,iconAlignment:e.iconAlignment??"right",children:e.label},o)}})}):null}exports.CallToAction=W;
|
|
@@ -2,7 +2,7 @@ import { jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as S, useEffect as W } from "react";
|
|
3
3
|
import j from "next/image";
|
|
4
4
|
import { ButtonGroup as $ } from "../../../core/components/ButtonGroup/index.mjs";
|
|
5
|
-
import { B as o } from "../../../index
|
|
5
|
+
import { B as o } from "../../../index--KCTRJKr.js";
|
|
6
6
|
import { Modal as E } from "../../../core/components/Modal/index.mjs";
|
|
7
7
|
import { resolveLinkURL as x } from "../../utils/resolveLinkUrl.mjs";
|
|
8
8
|
import { useTheme as G } from "../../../core/context/ThemeContext.mjs";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");const e=require("../RenderAsRichtext.cjs");exports.renderRichText=e.renderRichText;
|
|
File without changes
|
|
File without changes
|