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, mobileOrientation, items, className, }: RenderCallToActionProps_3): default_2.ReactElement | null;
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 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
+ "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 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("");
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 h({
8
- blocks: r,
9
- className: n,
10
- textOverride: e,
11
- animateText: t
8
+ function y({
9
+ blocks: n,
10
+ className: e,
11
+ textOverride: r,
12
+ animateText: o
12
13
  }) {
13
- return r != null && r.length ? /* @__PURE__ */ o(
14
- f,
14
+ return n != null && n.length ? /* @__PURE__ */ a(
15
+ d,
15
16
  {
16
- blocks: r,
17
- className: n,
18
- textOverride: e,
19
- animateText: t
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: r,
25
- spacing: n,
26
- mobileOrientation: e,
27
- items: t,
28
- className: u
25
+ alignment: n,
26
+ spacing: e,
27
+ items: r,
28
+ className: o
29
29
  }) {
30
- return t != null && t.length ? /* @__PURE__ */ o(
31
- i,
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
- alignment: r,
34
- items: t,
35
- className: u,
36
- spacing: n,
37
- mobileOrientation: e
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
- p as extractText,
64
+ R as extractText,
43
65
  T as renderCallToAction,
44
- h as renderRichText
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, mobileOrientation, items, className, }: RenderCallToActionProps_2): default_2.ReactElement | null;
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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.1.153",
4
+ "version": "0.1.154",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {