quirk-ui 0.1.68 → 0.1.70
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/core/components/ButtonGroup/ButtonGroup.test.cjs +1 -1
- package/dist/core/components/ButtonGroup/ButtonGroup.test.mjs +4 -4
- package/dist/core/components/ButtonGroup/index.cjs +1 -1
- package/dist/core/components/ButtonGroup/index.mjs +30 -20
- package/dist/core.d.ts +18 -17
- package/dist/index33.css +1 -1
- package/dist/main.d.ts +19 -18
- package/dist/next/ui/CallToAction/index.cjs +1 -1
- package/dist/next/ui/CallToAction/index.mjs +135 -124
- package/dist/next/utils/blockRenderers.cjs +1 -1
- package/dist/next/utils/blockRenderers.mjs +35 -24
- package/dist/next.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),e=require("../../../index-DITXfOUM.cjs"),o=require("./index.cjs");e.describe("ButtonGroup",()=>{e.describe("Rendering",()=>{e.it("renders children",()=>{e.render(t.jsxs(o.ButtonGroup,{children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]})),e.globalExpect(e.screen.getByText("One")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Two")).toBeInTheDocument()}),e.it("renders multiple button types",()=>{e.render(t.jsxs(o.ButtonGroup,{children:[t.jsx("button",{children:"Button"}),t.jsx("a",{href:"#",children:"Link"}),t.jsx("span",{children:"Text"})]})),e.globalExpect(e.screen.getByText("Button")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Link")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Text")).toBeInTheDocument()})}),e.describe("Orientation",()=>{e.it("applies horizontal orientation by default",()=>{const{container:n}=e.render(t.jsxs(o.ButtonGroup,{children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]}));e.globalExpect(n.firstChild).toHaveClass("horizontal")}),e.it("applies vertical orientation when specified",()=>{const{container:n}=e.render(t.jsxs(o.ButtonGroup,{orientation:"vertical",children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]}));e.globalExpect(n.firstChild).toHaveClass("vertical")})}),e.describe("Alignment",()=>{e.it("applies left alignment by default",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("left")}),e.it("applies center alignment when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{alignment:"center",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("center")}),e.it("applies right alignment when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{alignment:"right",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("right")})}),e.describe("Size",()=>{e.it("applies md size by default",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("md")}),e.it("applies sm size when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),e=require("../../../index-DITXfOUM.cjs"),o=require("./index.cjs");e.describe("ButtonGroup",()=>{e.describe("Rendering",()=>{e.it("renders children",()=>{e.render(t.jsxs(o.ButtonGroup,{children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]})),e.globalExpect(e.screen.getByText("One")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Two")).toBeInTheDocument()}),e.it("renders multiple button types",()=>{e.render(t.jsxs(o.ButtonGroup,{children:[t.jsx("button",{children:"Button"}),t.jsx("a",{href:"#",children:"Link"}),t.jsx("span",{children:"Text"})]})),e.globalExpect(e.screen.getByText("Button")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Link")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Text")).toBeInTheDocument()})}),e.describe("Orientation",()=>{e.it("applies horizontal orientation by default",()=>{const{container:n}=e.render(t.jsxs(o.ButtonGroup,{children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]}));e.globalExpect(n.firstChild).toHaveClass("horizontal")}),e.it("applies vertical orientation when specified",()=>{const{container:n}=e.render(t.jsxs(o.ButtonGroup,{orientation:"vertical",children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]}));e.globalExpect(n.firstChild).toHaveClass("vertical")})}),e.describe("Alignment",()=>{e.it("applies left alignment by default",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("left")}),e.it("applies center alignment when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{alignment:"center",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("center")}),e.it("applies right alignment when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{alignment:"right",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("right")})}),e.describe("Size",()=>{e.it("applies md size by default",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("md")}),e.it("applies sm size when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{spacing:"sm",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("sm")}),e.it("applies lg size when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{spacing:"lg",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("lg")})}),e.describe("Full width",()=>{e.it("does not apply fullWidth by default",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).not.toHaveClass("fullWidth")}),e.it("applies fullWidth when specified",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{fullWidth:!0,children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("fullWidth")})}),e.describe("Custom className",()=>{e.it("accepts a custom className",()=>{const{container:n}=e.render(t.jsxs(o.ButtonGroup,{className:"custom-class",children:[t.jsx("button",{children:"One"}),t.jsx("button",{children:"Two"})]}));e.globalExpect(n.firstChild).toHaveClass("custom-class"),e.globalExpect(n.firstChild).toHaveClass("buttonGroup")})}),e.describe("ARIA and accessibility",()=>{e.it("has role='group' by default",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveAttribute("role","group")}),e.it("accepts custom role",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{role:"toolbar",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveAttribute("role","toolbar")}),e.it("supports aria-label",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{"aria-label":"Actions",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveAttribute("aria-label","Actions")})}),e.describe("HTML attributes",()=>{e.it("supports data attributes",()=>{e.render(t.jsx(o.ButtonGroup,{"data-testid":"my-group",children:t.jsx("button",{children:"One"})})),e.globalExpect(e.screen.getByTestId("my-group")).toBeInTheDocument()}),e.it("supports id attribute",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{id:"button-group-1",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.querySelector("#button-group-1")).toBeInTheDocument()}),e.it("supports onClick on container",()=>{const n=e.vi.fn(),{container:i}=e.render(t.jsx(o.ButtonGroup,{onClick:n,children:t.jsx("button",{children:"One"})}));e.fireEvent.click(i.firstChild),e.globalExpect(n).toHaveBeenCalledTimes(1)})}),e.describe("Combined props",()=>{e.it("combines orientation, alignment, and size",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{orientation:"vertical",alignment:"center",spacing:"lg",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("vertical"),e.globalExpect(n.firstChild).toHaveClass("center"),e.globalExpect(n.firstChild).toHaveClass("lg")}),e.it("combines all props",()=>{const{container:n}=e.render(t.jsx(o.ButtonGroup,{orientation:"horizontal",alignment:"right",spacing:"sm",fullWidth:!0,className:"custom",children:t.jsx("button",{children:"One"})}));e.globalExpect(n.firstChild).toHaveClass("horizontal"),e.globalExpect(n.firstChild).toHaveClass("right"),e.globalExpect(n.firstChild).toHaveClass("sm"),e.globalExpect(n.firstChild).toHaveClass("fullWidth"),e.globalExpect(n.firstChild).toHaveClass("custom")})}),e.describe("Edge cases",()=>{e.it("handles single child",()=>{e.render(t.jsx(o.ButtonGroup,{children:t.jsx("button",{children:"Only One"})})),e.globalExpect(e.screen.getByText("Only One")).toBeInTheDocument()}),e.it("handles many children",()=>{e.render(t.jsx(o.ButtonGroup,{children:Array.from({length:10},(n,i)=>t.jsxs("button",{children:["Button ",i+1]},i))})),e.globalExpect(e.screen.getByText("Button 1")).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Button 10")).toBeInTheDocument()})})});
|
|
@@ -62,12 +62,12 @@ r("ButtonGroup", () => {
|
|
|
62
62
|
n(e.firstChild).toHaveClass("md");
|
|
63
63
|
}), i("applies sm size when specified", () => {
|
|
64
64
|
const { container: e } = o(
|
|
65
|
-
/* @__PURE__ */ t(l, {
|
|
65
|
+
/* @__PURE__ */ t(l, { spacing: "sm", children: /* @__PURE__ */ t("button", { children: "One" }) })
|
|
66
66
|
);
|
|
67
67
|
n(e.firstChild).toHaveClass("sm");
|
|
68
68
|
}), i("applies lg size when specified", () => {
|
|
69
69
|
const { container: e } = o(
|
|
70
|
-
/* @__PURE__ */ t(l, {
|
|
70
|
+
/* @__PURE__ */ t(l, { spacing: "lg", children: /* @__PURE__ */ t("button", { children: "One" }) })
|
|
71
71
|
);
|
|
72
72
|
n(e.firstChild).toHaveClass("lg");
|
|
73
73
|
});
|
|
@@ -129,7 +129,7 @@ r("ButtonGroup", () => {
|
|
|
129
129
|
}), r("Combined props", () => {
|
|
130
130
|
i("combines orientation, alignment, and size", () => {
|
|
131
131
|
const { container: e } = o(
|
|
132
|
-
/* @__PURE__ */ t(l, { orientation: "vertical", alignment: "center",
|
|
132
|
+
/* @__PURE__ */ t(l, { orientation: "vertical", alignment: "center", spacing: "lg", children: /* @__PURE__ */ t("button", { children: "One" }) })
|
|
133
133
|
);
|
|
134
134
|
n(e.firstChild).toHaveClass("vertical"), n(e.firstChild).toHaveClass("center"), n(e.firstChild).toHaveClass("lg");
|
|
135
135
|
}), i("combines all props", () => {
|
|
@@ -139,7 +139,7 @@ r("ButtonGroup", () => {
|
|
|
139
139
|
{
|
|
140
140
|
orientation: "horizontal",
|
|
141
141
|
alignment: "right",
|
|
142
|
-
|
|
142
|
+
spacing: "sm",
|
|
143
143
|
fullWidth: !0,
|
|
144
144
|
className: "custom",
|
|
145
145
|
children: /* @__PURE__ */ t("button", { children: "One" })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index33.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index33.css');const u=require("react/jsx-runtime"),m="_buttonGroup_eawyr_1",w="_horizontal_eawyr_9",g="_vertical_eawyr_14",f="_left_eawyr_20",h="_center_eawyr_24",y="_right_eawyr_28",d="_sm_eawyr_33",p="_md_eawyr_37",b="_lg_eawyr_41",v="_fullWidth_eawyr_46",G="_mobileRow_eawyr_65",t={buttonGroup:m,horizontal:w,vertical:g,left:f,center:h,right:y,sm:d,md:p,lg:b,fullWidth:v,mobileRow:G},z={left:t.left,center:t.center,right:t.right},R={sm:t.sm,md:t.md,lg:t.lg};function W({children:o,className:e,alignment:r="left",orientation:l="horizontal",mobileOrientation:n="column",spacing:i="md",role:s="group",fullWidth:a=!1,..._}){const c=l==="vertical"?t.vertical:t.horizontal;return u.jsx("div",{className:[t.buttonGroup,c,z[r],R[i],a?t.fullWidth:"",n==="row"?t.mobileRow:"",e??""].filter(Boolean).join(" "),role:s,..._,children:o})}exports.ButtonGroup=W;
|
|
@@ -1,45 +1,55 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import '../../../index33.css';const
|
|
3
|
-
buttonGroup:
|
|
4
|
-
horizontal:
|
|
5
|
-
vertical:
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import '../../../index33.css';const u = "_buttonGroup_eawyr_1", w = "_horizontal_eawyr_9", f = "_vertical_eawyr_14", h = "_left_eawyr_20", g = "_center_eawyr_24", y = "_right_eawyr_28", d = "_sm_eawyr_33", p = "_md_eawyr_37", b = "_lg_eawyr_41", v = "_fullWidth_eawyr_46", z = "_mobileRow_eawyr_65", t = {
|
|
3
|
+
buttonGroup: u,
|
|
4
|
+
horizontal: w,
|
|
5
|
+
vertical: f,
|
|
6
6
|
left: h,
|
|
7
|
-
center:
|
|
8
|
-
right:
|
|
7
|
+
center: g,
|
|
8
|
+
right: y,
|
|
9
9
|
sm: d,
|
|
10
10
|
md: p,
|
|
11
|
-
lg:
|
|
12
|
-
fullWidth:
|
|
13
|
-
|
|
11
|
+
lg: b,
|
|
12
|
+
fullWidth: v,
|
|
13
|
+
mobileRow: z
|
|
14
|
+
}, G = {
|
|
14
15
|
left: t.left,
|
|
15
16
|
center: t.center,
|
|
16
17
|
right: t.right
|
|
17
|
-
},
|
|
18
|
+
}, R = {
|
|
18
19
|
sm: t.sm,
|
|
19
20
|
md: t.md,
|
|
20
21
|
lg: t.lg
|
|
21
22
|
};
|
|
22
|
-
function
|
|
23
|
+
function C({
|
|
23
24
|
children: o,
|
|
24
|
-
className:
|
|
25
|
-
alignment:
|
|
25
|
+
className: e,
|
|
26
|
+
alignment: r = "left",
|
|
26
27
|
orientation: l = "horizontal",
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
mobileOrientation: n = "column",
|
|
29
|
+
spacing: a = "md",
|
|
30
|
+
role: s = "group",
|
|
29
31
|
fullWidth: _ = !1,
|
|
30
32
|
...i
|
|
31
33
|
}) {
|
|
32
34
|
const c = l === "vertical" ? t.vertical : t.horizontal;
|
|
33
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ m(
|
|
34
36
|
"div",
|
|
35
37
|
{
|
|
36
|
-
className:
|
|
37
|
-
|
|
38
|
+
className: [
|
|
39
|
+
t.buttonGroup,
|
|
40
|
+
c,
|
|
41
|
+
G[r],
|
|
42
|
+
R[a],
|
|
43
|
+
_ ? t.fullWidth : "",
|
|
44
|
+
n === "row" ? t.mobileRow : "",
|
|
45
|
+
e ?? ""
|
|
46
|
+
].filter(Boolean).join(" "),
|
|
47
|
+
role: s,
|
|
38
48
|
...i,
|
|
39
49
|
children: o
|
|
40
50
|
}
|
|
41
51
|
);
|
|
42
52
|
}
|
|
43
53
|
export {
|
|
44
|
-
|
|
54
|
+
C as ButtonGroup
|
|
45
55
|
};
|
package/dist/core.d.ts
CHANGED
|
@@ -175,23 +175,24 @@ declare type BreakpointColumns = {
|
|
|
175
175
|
|
|
176
176
|
export declare function Button({ variant, size, displayType, imageSrc, imageAlt, ImageComponent, icon, iconAlignment, className, children, disabled, ...restProps }: ButtonProps): JSX.Element;
|
|
177
177
|
|
|
178
|
-
export declare function ButtonGroup({ children, className, alignment, orientation,
|
|
178
|
+
export declare function ButtonGroup({ children, className, alignment, orientation, mobileOrientation, spacing, role, fullWidth, ...restProps }: ButtonGroupProps): JSX.Element;
|
|
179
179
|
|
|
180
180
|
declare type ButtonGroupProps = {
|
|
181
181
|
children: default_2.ReactNode;
|
|
182
182
|
className?: string;
|
|
183
183
|
alignment?: Alignment;
|
|
184
184
|
orientation?: Orientation;
|
|
185
|
-
|
|
185
|
+
mobileOrientation?: "row" | "column";
|
|
186
|
+
spacing?: ButtonGroupSpacing;
|
|
186
187
|
role?: string;
|
|
187
188
|
fullWidth?: boolean;
|
|
188
189
|
} & default_2.HTMLAttributes<HTMLDivElement>;
|
|
189
190
|
|
|
190
|
-
declare type
|
|
191
|
+
declare type ButtonGroupSpacing = keyof typeof spacingClassMap;
|
|
191
192
|
|
|
192
193
|
export declare type ButtonProps = BaseProps & (AnchorTypeProps | ButtonTypeProps | ScrollTypeProps);
|
|
193
194
|
|
|
194
|
-
declare type ButtonSize = keyof typeof
|
|
195
|
+
declare type ButtonSize = keyof typeof sizeClassMap;
|
|
195
196
|
|
|
196
197
|
declare type ButtonTypeProps = {
|
|
197
198
|
as?: "button";
|
|
@@ -380,7 +381,7 @@ export declare type DrawerProps = {
|
|
|
380
381
|
className?: string;
|
|
381
382
|
};
|
|
382
383
|
|
|
383
|
-
export declare type DrawerSize = keyof typeof
|
|
384
|
+
export declare type DrawerSize = keyof typeof sizeClassMap_2;
|
|
384
385
|
|
|
385
386
|
declare type FABPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
386
387
|
|
|
@@ -1161,7 +1162,7 @@ declare type ProgressBarProps = {
|
|
|
1161
1162
|
style?: CSSProperties;
|
|
1162
1163
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
1163
1164
|
|
|
1164
|
-
declare type ProgressBarSize = keyof typeof
|
|
1165
|
+
declare type ProgressBarSize = keyof typeof sizeClassMap_4;
|
|
1165
1166
|
|
|
1166
1167
|
declare type ProgressBarVariant = keyof typeof variantClassMap_6;
|
|
1167
1168
|
|
|
@@ -1297,7 +1298,7 @@ declare type SidebarProps = {
|
|
|
1297
1298
|
style?: CSSProperties;
|
|
1298
1299
|
} & Omit<default_2.HTMLAttributes<HTMLElement>, "style">;
|
|
1299
1300
|
|
|
1300
|
-
declare type Size = keyof typeof
|
|
1301
|
+
declare type Size = keyof typeof sizeClassMap_3;
|
|
1301
1302
|
|
|
1302
1303
|
declare const sizeClassMap: {
|
|
1303
1304
|
readonly sm: string;
|
|
@@ -1309,13 +1310,13 @@ declare const sizeClassMap_2: {
|
|
|
1309
1310
|
readonly sm: string;
|
|
1310
1311
|
readonly md: string;
|
|
1311
1312
|
readonly lg: string;
|
|
1313
|
+
readonly full: string;
|
|
1312
1314
|
};
|
|
1313
1315
|
|
|
1314
1316
|
declare const sizeClassMap_3: {
|
|
1315
1317
|
readonly sm: string;
|
|
1316
1318
|
readonly md: string;
|
|
1317
1319
|
readonly lg: string;
|
|
1318
|
-
readonly full: string;
|
|
1319
1320
|
};
|
|
1320
1321
|
|
|
1321
1322
|
declare const sizeClassMap_4: {
|
|
@@ -1325,12 +1326,6 @@ declare const sizeClassMap_4: {
|
|
|
1325
1326
|
};
|
|
1326
1327
|
|
|
1327
1328
|
declare const sizeClassMap_5: {
|
|
1328
|
-
readonly sm: string;
|
|
1329
|
-
readonly md: string;
|
|
1330
|
-
readonly lg: string;
|
|
1331
|
-
};
|
|
1332
|
-
|
|
1333
|
-
declare const sizeClassMap_6: {
|
|
1334
1329
|
readonly xs: string;
|
|
1335
1330
|
readonly sm: string;
|
|
1336
1331
|
readonly md: string;
|
|
@@ -1339,7 +1334,7 @@ declare const sizeClassMap_6: {
|
|
|
1339
1334
|
readonly "2xl": string;
|
|
1340
1335
|
};
|
|
1341
1336
|
|
|
1342
|
-
declare const
|
|
1337
|
+
declare const sizeClassMap_6: {
|
|
1343
1338
|
readonly xs: string;
|
|
1344
1339
|
readonly sm: string;
|
|
1345
1340
|
readonly md: string;
|
|
@@ -1374,7 +1369,13 @@ declare type SpacerProps = {
|
|
|
1374
1369
|
style?: CSSProperties;
|
|
1375
1370
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
1376
1371
|
|
|
1377
|
-
declare type SpacerSize = keyof typeof
|
|
1372
|
+
declare type SpacerSize = keyof typeof sizeClassMap_5;
|
|
1373
|
+
|
|
1374
|
+
declare const spacingClassMap: {
|
|
1375
|
+
readonly sm: string;
|
|
1376
|
+
readonly md: string;
|
|
1377
|
+
readonly lg: string;
|
|
1378
|
+
};
|
|
1378
1379
|
|
|
1379
1380
|
export declare function Spinner({ size, variant, label, fullScreen, className, style, ...restProps }: SpinnerProps): JSX.Element;
|
|
1380
1381
|
|
|
@@ -1387,7 +1388,7 @@ declare type SpinnerProps = {
|
|
|
1387
1388
|
style?: CSSProperties;
|
|
1388
1389
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
1389
1390
|
|
|
1390
|
-
declare type SpinnerSize = keyof typeof
|
|
1391
|
+
declare type SpinnerSize = keyof typeof sizeClassMap_6;
|
|
1391
1392
|
|
|
1392
1393
|
declare type SpinnerVariant = keyof typeof variantClassMap_8;
|
|
1393
1394
|
|
package/dist/index33.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._buttonGroup_eawyr_1{display:flex;gap:var(--spacing-sm);align-items:center;width:fit-content}._horizontal_eawyr_9{flex-direction:row;flex-wrap:wrap}._vertical_eawyr_14{flex-direction:column;align-items:stretch}._left_eawyr_20{justify-content:flex-start}._center_eawyr_24{justify-content:center}._right_eawyr_28{justify-content:flex-end}._sm_eawyr_33{gap:var(--spacing-sm)}._md_eawyr_37{gap:var(--spacing-md)}._lg_eawyr_41{gap:var(--spacing-lg)}._fullWidth_eawyr_46{width:100%}._fullWidth_eawyr_46._horizontal_eawyr_9>*{flex:1}._fullWidth_eawyr_46._vertical_eawyr_14{align-items:stretch}@media (max-width: 480px){._buttonGroup_eawyr_1{width:100%}._horizontal_eawyr_9:not(._mobileRow_eawyr_65){flex-direction:column;align-items:stretch}._mobileRow_eawyr_65{flex-direction:row;flex-wrap:wrap;width:fit-content}}
|
package/dist/main.d.ts
CHANGED
|
@@ -282,23 +282,24 @@ declare type BreakpointColumns = {
|
|
|
282
282
|
|
|
283
283
|
export declare function Button({ variant, size, displayType, imageSrc, imageAlt, ImageComponent, icon, iconAlignment, className, children, disabled, ...restProps }: ButtonProps): JSX.Element;
|
|
284
284
|
|
|
285
|
-
export declare function ButtonGroup({ children, className, alignment, orientation,
|
|
285
|
+
export declare function ButtonGroup({ children, className, alignment, orientation, mobileOrientation, spacing, role, fullWidth, ...restProps }: ButtonGroupProps): JSX.Element;
|
|
286
286
|
|
|
287
287
|
declare type ButtonGroupProps = {
|
|
288
288
|
children: default_2.ReactNode;
|
|
289
289
|
className?: string;
|
|
290
290
|
alignment?: Alignment;
|
|
291
291
|
orientation?: Orientation;
|
|
292
|
-
|
|
292
|
+
mobileOrientation?: "row" | "column";
|
|
293
|
+
spacing?: ButtonGroupSpacing;
|
|
293
294
|
role?: string;
|
|
294
295
|
fullWidth?: boolean;
|
|
295
296
|
} & default_2.HTMLAttributes<HTMLDivElement>;
|
|
296
297
|
|
|
297
|
-
declare type
|
|
298
|
+
declare type ButtonGroupSpacing = keyof typeof spacingClassMap;
|
|
298
299
|
|
|
299
300
|
export declare type ButtonProps = BaseProps & (AnchorTypeProps | ButtonTypeProps | ScrollTypeProps);
|
|
300
301
|
|
|
301
|
-
declare type ButtonSize = keyof typeof
|
|
302
|
+
declare type ButtonSize = keyof typeof sizeClassMap;
|
|
302
303
|
|
|
303
304
|
declare type ButtonTypeProps = {
|
|
304
305
|
as?: "button";
|
|
@@ -544,7 +545,7 @@ export declare type DrawerProps = {
|
|
|
544
545
|
className?: string;
|
|
545
546
|
};
|
|
546
547
|
|
|
547
|
-
export declare type DrawerSize = keyof typeof
|
|
548
|
+
export declare type DrawerSize = keyof typeof sizeClassMap_2;
|
|
548
549
|
|
|
549
550
|
/**
|
|
550
551
|
* Extracts plain text from a PortableText block array.
|
|
@@ -1411,7 +1412,7 @@ declare type ProgressBarProps = {
|
|
|
1411
1412
|
style?: CSSProperties;
|
|
1412
1413
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
1413
1414
|
|
|
1414
|
-
declare type ProgressBarSize = keyof typeof
|
|
1415
|
+
declare type ProgressBarSize = keyof typeof sizeClassMap_4;
|
|
1415
1416
|
|
|
1416
1417
|
declare type ProgressBarVariant = keyof typeof variantClassMap_6;
|
|
1417
1418
|
|
|
@@ -1498,7 +1499,7 @@ declare type RangeSize = "sm" | "md" | "lg";
|
|
|
1498
1499
|
* <HeroBlock {...section} renderCallToAction={renderCallToAction} />
|
|
1499
1500
|
* <ContentBlock {...section} renderCallToAction={renderCallToAction} />
|
|
1500
1501
|
*/
|
|
1501
|
-
export declare function renderCallToAction({ alignment, items, className, }: RenderCallToActionProps_3): default_2.ReactElement | null;
|
|
1502
|
+
export declare function renderCallToAction({ alignment, spacing, mobileOrientation, items, className, }: RenderCallToActionProps_3): default_2.ReactElement | null;
|
|
1502
1503
|
|
|
1503
1504
|
export { RenderCallToActionProps }
|
|
1504
1505
|
|
|
@@ -1659,7 +1660,7 @@ export { SingletonBlockProps }
|
|
|
1659
1660
|
|
|
1660
1661
|
export { SiteSettings }
|
|
1661
1662
|
|
|
1662
|
-
declare type Size = keyof typeof
|
|
1663
|
+
declare type Size = keyof typeof sizeClassMap_3;
|
|
1663
1664
|
|
|
1664
1665
|
declare const sizeClassMap: {
|
|
1665
1666
|
readonly sm: string;
|
|
@@ -1671,13 +1672,13 @@ declare const sizeClassMap_2: {
|
|
|
1671
1672
|
readonly sm: string;
|
|
1672
1673
|
readonly md: string;
|
|
1673
1674
|
readonly lg: string;
|
|
1675
|
+
readonly full: string;
|
|
1674
1676
|
};
|
|
1675
1677
|
|
|
1676
1678
|
declare const sizeClassMap_3: {
|
|
1677
1679
|
readonly sm: string;
|
|
1678
1680
|
readonly md: string;
|
|
1679
1681
|
readonly lg: string;
|
|
1680
|
-
readonly full: string;
|
|
1681
1682
|
};
|
|
1682
1683
|
|
|
1683
1684
|
declare const sizeClassMap_4: {
|
|
@@ -1687,12 +1688,6 @@ declare const sizeClassMap_4: {
|
|
|
1687
1688
|
};
|
|
1688
1689
|
|
|
1689
1690
|
declare const sizeClassMap_5: {
|
|
1690
|
-
readonly sm: string;
|
|
1691
|
-
readonly md: string;
|
|
1692
|
-
readonly lg: string;
|
|
1693
|
-
};
|
|
1694
|
-
|
|
1695
|
-
declare const sizeClassMap_6: {
|
|
1696
1691
|
readonly xs: string;
|
|
1697
1692
|
readonly sm: string;
|
|
1698
1693
|
readonly md: string;
|
|
@@ -1701,7 +1696,7 @@ declare const sizeClassMap_6: {
|
|
|
1701
1696
|
readonly "2xl": string;
|
|
1702
1697
|
};
|
|
1703
1698
|
|
|
1704
|
-
declare const
|
|
1699
|
+
declare const sizeClassMap_6: {
|
|
1705
1700
|
readonly xs: string;
|
|
1706
1701
|
readonly sm: string;
|
|
1707
1702
|
readonly md: string;
|
|
@@ -1736,7 +1731,13 @@ declare type SpacerProps = {
|
|
|
1736
1731
|
style?: CSSProperties;
|
|
1737
1732
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
1738
1733
|
|
|
1739
|
-
declare type SpacerSize = keyof typeof
|
|
1734
|
+
declare type SpacerSize = keyof typeof sizeClassMap_5;
|
|
1735
|
+
|
|
1736
|
+
declare const spacingClassMap: {
|
|
1737
|
+
readonly sm: string;
|
|
1738
|
+
readonly md: string;
|
|
1739
|
+
readonly lg: string;
|
|
1740
|
+
};
|
|
1740
1741
|
|
|
1741
1742
|
export declare function Spinner({ size, variant, label, fullScreen, className, style, ...restProps }: SpinnerProps): JSX.Element;
|
|
1742
1743
|
|
|
@@ -1749,7 +1750,7 @@ declare type SpinnerProps = {
|
|
|
1749
1750
|
style?: CSSProperties;
|
|
1750
1751
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
1751
1752
|
|
|
1752
|
-
declare type SpinnerSize = keyof typeof
|
|
1753
|
+
declare type SpinnerSize = keyof typeof sizeClassMap_6;
|
|
1753
1754
|
|
|
1754
1755
|
declare type SpinnerVariant = keyof typeof variantClassMap_8;
|
|
1755
1756
|
|
|
@@ -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"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),U=require("react"),B=require("next/image"),G=require("../../../core/components/ButtonGroup/index.cjs"),l=require("../../../index-D0ylyll7.cjs"),I=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:M,spacing:R,mobileOrientation:P="column",className:S}){const[$,F]=U.useState([]),{mode:t}=H.useTheme(),g=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)));F(o)}e()},[r]),r!=null&&r.length?n.jsx(G.ButtonGroup,{className:S,alignment:M,spacing:R,mobileOrientation:P,children:r.slice(0,3).map((e,o)=>{var m,d,p,c,h,b,f,y,v,x,_,k,j,T,A,w,q,L;const a=$[o]??"#",i={};if(i.height="auto",((m=e.image)==null?void 0:m.layout)==="cover")i.objectFit="cover",(d=e.image)!=null&&d.position&&(i.objectPosition=g?"top":(p=e.image)==null?void 0:p.position);else if(((c=e.image)==null?void 0:c.layout)==="contain"){if(i.objectFit="contain",((h=e.image)==null?void 0:h.sizing)==="half"?i.width=g?"100%":"50%":((b=e.image)==null?void 0:b.sizing)==="inset"?(i.width="100%",i.maxWidth=e.image.maxWidth??"unset"):i.width="100%",(f=e.image)!=null&&f.aspectRatio){const[O,z]=(y=e.image)==null?void 0:y.aspectRatio.split(":").map(Number);i.aspectRatio=`${O}/${z}`}}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,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(I.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:e.modalContent},o);case"video":return n.jsx(I.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;
|
|
@@ -1,155 +1,166 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as W, useEffect as $ } from "react";
|
|
3
3
|
import C from "next/image";
|
|
4
|
-
import { ButtonGroup as
|
|
4
|
+
import { ButtonGroup as E } from "../../../core/components/ButtonGroup/index.mjs";
|
|
5
5
|
import { B as a } from "../../../index-CnlJ2RgH.js";
|
|
6
6
|
import { Modal as R } from "../../../core/components/Modal/index.mjs";
|
|
7
7
|
import { resolveLinkURL as B } from "../../utils/resolveLinkUrl.mjs";
|
|
8
|
-
import { useTheme as
|
|
9
|
-
import { useMediaQuery as
|
|
10
|
-
function
|
|
8
|
+
import { useTheme as G } from "../../../core/context/ThemeContext.mjs";
|
|
9
|
+
import { useMediaQuery as N } from "../../hooks/useMediaQuery.mjs";
|
|
10
|
+
function ee({
|
|
11
11
|
items: n,
|
|
12
12
|
alignment: F,
|
|
13
|
-
|
|
13
|
+
spacing: M,
|
|
14
|
+
mobileOrientation: P = "column",
|
|
15
|
+
className: _
|
|
14
16
|
}) {
|
|
15
|
-
const [
|
|
16
|
-
return
|
|
17
|
+
const [z, H] = W([]), { mode: t } = G(), s = N("(max-width: 767px)");
|
|
18
|
+
return $(() => {
|
|
17
19
|
if (!(n != null && n.length) || !B) return;
|
|
18
20
|
async function e() {
|
|
19
21
|
const l = await Promise.all(
|
|
20
22
|
n.map((o) => B(o))
|
|
21
23
|
);
|
|
22
|
-
|
|
24
|
+
H(l);
|
|
23
25
|
}
|
|
24
26
|
e();
|
|
25
|
-
}, [n]), n != null && n.length ? /* @__PURE__ */ r(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"aria-label": e.ariaLabel || e.label,
|
|
51
|
-
icon: e.icon,
|
|
52
|
-
iconAlignment: e.iconAlignment ?? "right",
|
|
53
|
-
displayType: e.displayType,
|
|
54
|
-
ImageComponent: /* @__PURE__ */ r(
|
|
55
|
-
C,
|
|
56
|
-
{
|
|
57
|
-
src: m ?? "",
|
|
58
|
-
alt: g,
|
|
59
|
-
width: 600,
|
|
60
|
-
height: 658,
|
|
61
|
-
priority: !1,
|
|
62
|
-
style: i
|
|
63
|
-
}
|
|
64
|
-
),
|
|
65
|
-
children: e.label
|
|
66
|
-
},
|
|
67
|
-
l
|
|
68
|
-
);
|
|
69
|
-
case "scroll":
|
|
70
|
-
return /* @__PURE__ */ r(
|
|
71
|
-
a,
|
|
72
|
-
{
|
|
73
|
-
as: "scroll",
|
|
74
|
-
variant: e.variant,
|
|
75
|
-
scrollTarget: e.scrollTarget ?? "",
|
|
76
|
-
"aria-label": e.ariaLabel || e.label,
|
|
77
|
-
icon: e.icon,
|
|
78
|
-
iconAlignment: e.iconAlignment ?? "right",
|
|
79
|
-
displayType: e.displayType,
|
|
80
|
-
ImageComponent: /* @__PURE__ */ r(
|
|
81
|
-
C,
|
|
82
|
-
{
|
|
83
|
-
src: m ?? "",
|
|
84
|
-
alt: g,
|
|
85
|
-
width: 600,
|
|
86
|
-
height: 658,
|
|
87
|
-
priority: !1,
|
|
88
|
-
style: i
|
|
89
|
-
}
|
|
90
|
-
),
|
|
91
|
-
children: e.label
|
|
92
|
-
},
|
|
93
|
-
l
|
|
94
|
-
);
|
|
95
|
-
case "modal":
|
|
96
|
-
return /* @__PURE__ */ r(
|
|
97
|
-
R,
|
|
98
|
-
{
|
|
99
|
-
trigger: /* @__PURE__ */ r(
|
|
27
|
+
}, [n]), n != null && n.length ? /* @__PURE__ */ r(
|
|
28
|
+
E,
|
|
29
|
+
{
|
|
30
|
+
className: _,
|
|
31
|
+
alignment: F,
|
|
32
|
+
spacing: M,
|
|
33
|
+
mobileOrientation: P,
|
|
34
|
+
children: n.slice(0, 3).map((e, l) => {
|
|
35
|
+
var p, d, u, f, h, b, y, c, v, k, A, T, w, I, L, U, j, x;
|
|
36
|
+
const o = z[l] ?? "#", i = {};
|
|
37
|
+
if (i.height = "auto", ((p = e.image) == null ? void 0 : p.layout) === "cover")
|
|
38
|
+
i.objectFit = "cover", (d = e.image) != null && d.position && (i.objectPosition = s ? "top" : (u = e.image) == null ? void 0 : u.position);
|
|
39
|
+
else if (((f = e.image) == null ? void 0 : f.layout) === "contain") {
|
|
40
|
+
if (i.objectFit = "contain", ((h = e.image) == null ? void 0 : h.sizing) === "half" ? i.width = s ? "100%" : "50%" : ((b = e.image) == null ? void 0 : b.sizing) === "inset" ? (i.width = "100%", i.maxWidth = e.image.maxWidth ?? "unset") : i.width = "100%", (y = e.image) != null && y.aspectRatio) {
|
|
41
|
+
const [O, S] = (c = e.image) == null ? void 0 : c.aspectRatio.split(":").map(Number);
|
|
42
|
+
i.aspectRatio = `${O}/${S}`;
|
|
43
|
+
}
|
|
44
|
+
} else
|
|
45
|
+
i.objectFit = "none";
|
|
46
|
+
let m;
|
|
47
|
+
(v = e.image) != null && v.imageUrls && (m = t === "dark" && ((k = e.image.imageUrls.dark) == null ? void 0 : k.medium) || e.image.imageUrls.default.medium);
|
|
48
|
+
let g = ((w = (T = (A = e.image) == null ? void 0 : A[t === "dark" ? "darkImage" : "defaultImage"]) == null ? void 0 : T.asset) == null ? void 0 : w.altText) || ((U = (L = (I = e.image) == null ? void 0 : I[t === "dark" ? "darkImage" : "defaultImage"]) == null ? void 0 : L.asset) == null ? void 0 : U.description) || "Card image";
|
|
49
|
+
switch (e.type) {
|
|
50
|
+
case "link":
|
|
51
|
+
return /* @__PURE__ */ r(
|
|
100
52
|
a,
|
|
101
53
|
{
|
|
102
|
-
as: "
|
|
103
|
-
variant: e.variant
|
|
54
|
+
as: "a",
|
|
55
|
+
variant: e.variant,
|
|
56
|
+
href: o,
|
|
57
|
+
target: ((j = e.linkOptions) == null ? void 0 : j.linkType) === "external" ? "_blank" : "_self",
|
|
58
|
+
rel: ((x = e.linkOptions) == null ? void 0 : x.linkType) === "external" ? "noopener noreferrer" : "",
|
|
59
|
+
"aria-label": e.ariaLabel || e.label,
|
|
104
60
|
icon: e.icon,
|
|
105
61
|
iconAlignment: e.iconAlignment ?? "right",
|
|
62
|
+
displayType: e.displayType,
|
|
63
|
+
ImageComponent: /* @__PURE__ */ r(
|
|
64
|
+
C,
|
|
65
|
+
{
|
|
66
|
+
src: m ?? "",
|
|
67
|
+
alt: g,
|
|
68
|
+
width: 600,
|
|
69
|
+
height: 658,
|
|
70
|
+
priority: !1,
|
|
71
|
+
style: i
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
children: e.label
|
|
75
|
+
},
|
|
76
|
+
l
|
|
77
|
+
);
|
|
78
|
+
case "scroll":
|
|
79
|
+
return /* @__PURE__ */ r(
|
|
80
|
+
a,
|
|
81
|
+
{
|
|
82
|
+
as: "scroll",
|
|
83
|
+
variant: e.variant,
|
|
84
|
+
scrollTarget: e.scrollTarget ?? "",
|
|
106
85
|
"aria-label": e.ariaLabel || e.label,
|
|
86
|
+
icon: e.icon,
|
|
87
|
+
iconAlignment: e.iconAlignment ?? "right",
|
|
88
|
+
displayType: e.displayType,
|
|
89
|
+
ImageComponent: /* @__PURE__ */ r(
|
|
90
|
+
C,
|
|
91
|
+
{
|
|
92
|
+
src: m ?? "",
|
|
93
|
+
alt: g,
|
|
94
|
+
width: 600,
|
|
95
|
+
height: 658,
|
|
96
|
+
priority: !1,
|
|
97
|
+
style: i
|
|
98
|
+
}
|
|
99
|
+
),
|
|
107
100
|
children: e.label
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
101
|
+
},
|
|
102
|
+
l
|
|
103
|
+
);
|
|
104
|
+
case "modal":
|
|
105
|
+
return /* @__PURE__ */ r(
|
|
106
|
+
R,
|
|
107
|
+
{
|
|
108
|
+
trigger: /* @__PURE__ */ r(
|
|
109
|
+
a,
|
|
110
|
+
{
|
|
111
|
+
as: "button",
|
|
112
|
+
variant: e.variant ?? "primary",
|
|
113
|
+
icon: e.icon,
|
|
114
|
+
iconAlignment: e.iconAlignment ?? "right",
|
|
115
|
+
"aria-label": e.ariaLabel || e.label,
|
|
116
|
+
children: e.label
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
content: e.modalContent
|
|
120
|
+
},
|
|
121
|
+
l
|
|
122
|
+
);
|
|
123
|
+
case "video":
|
|
124
|
+
return /* @__PURE__ */ r(
|
|
125
|
+
R,
|
|
126
|
+
{
|
|
127
|
+
trigger: /* @__PURE__ */ r(
|
|
128
|
+
a,
|
|
129
|
+
{
|
|
130
|
+
as: "button",
|
|
131
|
+
variant: e.variant ?? "primary",
|
|
132
|
+
icon: e.icon,
|
|
133
|
+
iconAlignment: e.iconAlignment ?? "right",
|
|
134
|
+
"aria-label": e.ariaLabel || e.label,
|
|
135
|
+
children: e.label
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
content: /* @__PURE__ */ r("video", { src: e.videoUrl, controls: !0, autoPlay: !0 })
|
|
139
|
+
},
|
|
140
|
+
l
|
|
141
|
+
);
|
|
142
|
+
case "download":
|
|
143
|
+
return /* @__PURE__ */ r(
|
|
119
144
|
a,
|
|
120
145
|
{
|
|
121
|
-
as: "
|
|
146
|
+
as: "a",
|
|
122
147
|
variant: e.variant ?? "primary",
|
|
148
|
+
href: o,
|
|
149
|
+
download: !0,
|
|
150
|
+
target: "_blank",
|
|
151
|
+
rel: "noopener noreferrer",
|
|
152
|
+
"aria-label": e.ariaLabel || e.label,
|
|
123
153
|
icon: e.icon,
|
|
124
154
|
iconAlignment: e.iconAlignment ?? "right",
|
|
125
|
-
"aria-label": e.ariaLabel || e.label,
|
|
126
155
|
children: e.label
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
);
|
|
133
|
-
case "download":
|
|
134
|
-
return /* @__PURE__ */ r(
|
|
135
|
-
a,
|
|
136
|
-
{
|
|
137
|
-
as: "a",
|
|
138
|
-
variant: e.variant ?? "primary",
|
|
139
|
-
href: o,
|
|
140
|
-
download: !0,
|
|
141
|
-
target: "_blank",
|
|
142
|
-
rel: "noopener noreferrer",
|
|
143
|
-
"aria-label": e.ariaLabel || e.label,
|
|
144
|
-
icon: e.icon,
|
|
145
|
-
iconAlignment: e.iconAlignment ?? "right",
|
|
146
|
-
children: e.label
|
|
147
|
-
},
|
|
148
|
-
l
|
|
149
|
-
);
|
|
156
|
+
},
|
|
157
|
+
l
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
})
|
|
150
161
|
}
|
|
151
|
-
|
|
162
|
+
) : null;
|
|
152
163
|
}
|
|
153
164
|
export {
|
|
154
|
-
|
|
165
|
+
ee as CallToAction
|
|
155
166
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("../ui/PortableTextRenderer/index.cjs"),o=require("../ui/CallToAction/index.cjs");function x(e){return e.flatMap(r=>r.children??[]).map(r=>r.text??"").join("")}function c({blocks:e,className:r,textOverride:t,animateText:n}){return e!=null&&e.length?i.jsx(l.RichText,{blocks:e,className:r,textOverride:t,animateText:n}):null}function a({alignment:e,spacing:r,mobileOrientation:t,items:n,className:u}){return n!=null&&n.length?i.jsx(o.CallToAction,{alignment:e,items:n,className:u,spacing:r,mobileOrientation:t}):null}exports.extractText=x;exports.renderCallToAction=a;exports.renderRichText=c;
|
|
@@ -1,34 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { RichText as
|
|
3
|
-
import { CallToAction as
|
|
4
|
-
function
|
|
5
|
-
return
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { RichText as f } from "../ui/PortableTextRenderer/index.mjs";
|
|
3
|
+
import { CallToAction as i } from "../ui/CallToAction/index.mjs";
|
|
4
|
+
function p(r) {
|
|
5
|
+
return r.flatMap((n) => n.children ?? []).map((n) => n.text ?? "").join("");
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
blocks:
|
|
9
|
-
className:
|
|
10
|
-
textOverride:
|
|
11
|
-
animateText:
|
|
7
|
+
function h({
|
|
8
|
+
blocks: r,
|
|
9
|
+
className: n,
|
|
10
|
+
textOverride: e,
|
|
11
|
+
animateText: t
|
|
12
12
|
}) {
|
|
13
|
-
return
|
|
14
|
-
|
|
13
|
+
return r != null && r.length ? /* @__PURE__ */ o(
|
|
14
|
+
f,
|
|
15
15
|
{
|
|
16
|
-
blocks:
|
|
17
|
-
className:
|
|
18
|
-
textOverride:
|
|
19
|
-
animateText:
|
|
16
|
+
blocks: r,
|
|
17
|
+
className: n,
|
|
18
|
+
textOverride: e,
|
|
19
|
+
animateText: t
|
|
20
20
|
}
|
|
21
21
|
) : null;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
alignment:
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
function T({
|
|
24
|
+
alignment: r,
|
|
25
|
+
spacing: n,
|
|
26
|
+
mobileOrientation: e,
|
|
27
|
+
items: t,
|
|
28
|
+
className: u
|
|
27
29
|
}) {
|
|
28
|
-
return
|
|
30
|
+
return t != null && t.length ? /* @__PURE__ */ o(
|
|
31
|
+
i,
|
|
32
|
+
{
|
|
33
|
+
alignment: r,
|
|
34
|
+
items: t,
|
|
35
|
+
className: u,
|
|
36
|
+
spacing: n,
|
|
37
|
+
mobileOrientation: e
|
|
38
|
+
}
|
|
39
|
+
) : null;
|
|
29
40
|
}
|
|
30
41
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
42
|
+
p as extractText,
|
|
43
|
+
T as renderCallToAction,
|
|
44
|
+
h as renderRichText
|
|
34
45
|
};
|
package/dist/next.d.ts
CHANGED
|
@@ -244,7 +244,7 @@ export { QuoteBlockProps }
|
|
|
244
244
|
* <HeroBlock {...section} renderCallToAction={renderCallToAction} />
|
|
245
245
|
* <ContentBlock {...section} renderCallToAction={renderCallToAction} />
|
|
246
246
|
*/
|
|
247
|
-
export declare function renderCallToAction({ alignment, items, className, }: RenderCallToActionProps_2): default_2.ReactElement | null;
|
|
247
|
+
export declare function renderCallToAction({ alignment, spacing, mobileOrientation, items, className, }: RenderCallToActionProps_2): default_2.ReactElement | null;
|
|
248
248
|
|
|
249
249
|
/**
|
|
250
250
|
* Drop-in `renderRichText` prop for all QuirkUI blocks.
|