quirk-ui 0.1.153 → 0.1.154
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/main.d.ts
CHANGED
|
@@ -1569,7 +1569,7 @@ declare type RangeSize = "sm" | "md" | "lg";
|
|
|
1569
1569
|
* <HeroBlock {...section} renderCallToAction={renderCallToAction} />
|
|
1570
1570
|
* <ContentBlock {...section} renderCallToAction={renderCallToAction} />
|
|
1571
1571
|
*/
|
|
1572
|
-
export declare function renderCallToAction({ alignment, spacing,
|
|
1572
|
+
export declare function renderCallToAction({ alignment, spacing, items, className, }: RenderCallToActionProps_3): default_2.ReactElement | null;
|
|
1573
1573
|
|
|
1574
1574
|
export { RenderCallToActionProps }
|
|
1575
1575
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),i=require("../ui/PortableTextRenderer/index.cjs"),u=require("../ui/CallToAction/index.cjs"),d=require("../../index-0SVQqhAg.cjs");function f(n){return n.flatMap(t=>t.children??[]).map(t=>t.text??"").join("")}function x({blocks:n,className:t,textOverride:e,animateText:o}){return n!=null&&n.length?l.jsx(i.RichText,{blocks:n,className:t,textOverride:e,animateText:o}):null}function h({alignment:n,spacing:t,items:e,className:o}){if(!(e!=null&&e.length))return null;const c=e.filter(r=>r.type==="modal"),a=e.filter(r=>r.type!=="modal");return l.jsxs(l.Fragment,{children:[a.length>0&&l.jsx(u.CallToAction,{alignment:n,items:a,className:o,spacing:t}),c.map(r=>l.jsx(g,{item:r},r._key??r.label))]})}function g({item:n}){var e,o;return n.formReference||((e=n.modalContent)==null?void 0:e.length)?l.jsx(d.Button,{as:"modal",variant:n.variant??"primary",icon:n.icon,iconAlignment:n.iconAlignment??"right",modalPayload:{heading:(o=n.formReference)==null?void 0:o.heading,formReference:n.formReference,modalContent:n.modalContent},children:n.label??"Open"}):null}exports.extractText=f;exports.renderCallToAction=h;exports.renderRichText=x;
|
|
@@ -1,45 +1,67 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { RichText as
|
|
3
|
-
import { CallToAction as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as a, jsxs as c, Fragment as i } from "react/jsx-runtime";
|
|
2
|
+
import { RichText as d } from "../ui/PortableTextRenderer/index.mjs";
|
|
3
|
+
import { CallToAction as u } from "../ui/CallToAction/index.mjs";
|
|
4
|
+
import { B as h } from "../../index-aWdsapYP.js";
|
|
5
|
+
function R(n) {
|
|
6
|
+
return n.flatMap((e) => e.children ?? []).map((e) => e.text ?? "").join("");
|
|
6
7
|
}
|
|
7
|
-
function
|
|
8
|
-
blocks:
|
|
9
|
-
className:
|
|
10
|
-
textOverride:
|
|
11
|
-
animateText:
|
|
8
|
+
function y({
|
|
9
|
+
blocks: n,
|
|
10
|
+
className: e,
|
|
11
|
+
textOverride: r,
|
|
12
|
+
animateText: o
|
|
12
13
|
}) {
|
|
13
|
-
return
|
|
14
|
-
|
|
14
|
+
return n != null && n.length ? /* @__PURE__ */ a(
|
|
15
|
+
d,
|
|
15
16
|
{
|
|
16
|
-
blocks:
|
|
17
|
-
className:
|
|
18
|
-
textOverride:
|
|
19
|
-
animateText:
|
|
17
|
+
blocks: n,
|
|
18
|
+
className: e,
|
|
19
|
+
textOverride: r,
|
|
20
|
+
animateText: o
|
|
20
21
|
}
|
|
21
22
|
) : null;
|
|
22
23
|
}
|
|
23
24
|
function T({
|
|
24
|
-
alignment:
|
|
25
|
-
spacing:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
className: u
|
|
25
|
+
alignment: n,
|
|
26
|
+
spacing: e,
|
|
27
|
+
items: r,
|
|
28
|
+
className: o
|
|
29
29
|
}) {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
if (!(r != null && r.length)) return null;
|
|
31
|
+
const f = r.filter((t) => t.type === "modal"), l = r.filter((t) => t.type !== "modal");
|
|
32
|
+
return /* @__PURE__ */ c(i, { children: [
|
|
33
|
+
l.length > 0 && /* @__PURE__ */ a(
|
|
34
|
+
u,
|
|
35
|
+
{
|
|
36
|
+
alignment: n,
|
|
37
|
+
items: l,
|
|
38
|
+
className: o,
|
|
39
|
+
spacing: e
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
f.map((t) => /* @__PURE__ */ a(m, { item: t }, t._key ?? t.label))
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
function m({ item: n }) {
|
|
46
|
+
var r, o;
|
|
47
|
+
return n.formReference || ((r = n.modalContent) == null ? void 0 : r.length) ? /* @__PURE__ */ a(
|
|
48
|
+
h,
|
|
32
49
|
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
50
|
+
as: "modal",
|
|
51
|
+
variant: n.variant ?? "primary",
|
|
52
|
+
icon: n.icon,
|
|
53
|
+
iconAlignment: n.iconAlignment ?? "right",
|
|
54
|
+
modalPayload: {
|
|
55
|
+
heading: (o = n.formReference) == null ? void 0 : o.heading,
|
|
56
|
+
formReference: n.formReference,
|
|
57
|
+
modalContent: n.modalContent
|
|
58
|
+
},
|
|
59
|
+
children: n.label ?? "Open"
|
|
38
60
|
}
|
|
39
61
|
) : null;
|
|
40
62
|
}
|
|
41
63
|
export {
|
|
42
|
-
|
|
64
|
+
R as extractText,
|
|
43
65
|
T as renderCallToAction,
|
|
44
|
-
|
|
66
|
+
y as renderRichText
|
|
45
67
|
};
|
package/dist/next.d.ts
CHANGED
|
@@ -266,7 +266,7 @@ export { QuoteBlockProps }
|
|
|
266
266
|
* <HeroBlock {...section} renderCallToAction={renderCallToAction} />
|
|
267
267
|
* <ContentBlock {...section} renderCallToAction={renderCallToAction} />
|
|
268
268
|
*/
|
|
269
|
-
export declare function renderCallToAction({ alignment, spacing,
|
|
269
|
+
export declare function renderCallToAction({ alignment, spacing, items, className, }: RenderCallToActionProps_2): default_2.ReactElement | null;
|
|
270
270
|
|
|
271
271
|
/**
|
|
272
272
|
* Drop-in `renderRichText` prop for all QuirkUI blocks.
|