quirk-ui 0.1.115 → 0.1.116
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/Announcement/Announcement.test.cjs +1 -1
- package/dist/core/components/Announcement/Announcement.test.mjs +86 -84
- package/dist/core/components/Announcement/index.cjs +1 -1
- package/dist/core/components/Announcement/index.mjs +16 -16
- package/dist/core.d.ts +7 -11
- package/dist/main.d.ts +19 -24
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),e=require("../../../react.esm-C_9Ma9mj.cjs"),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),e=require("../../../react.esm-C_9Ma9mj.cjs"),c=require("./index.cjs");require("../../../index-CW_Ehh1q.cjs");e.vi.mock("./styles.module.css",()=>({default:new Proxy({},{get:(n,s)=>s})}));e.vi.mock("lucide-react",()=>({X:({size:n,...s})=>t.jsx("svg",{"data-testid":"x-icon","data-size":n,...s})}));const r=[{_type:"block",_key:"a",children:[{_type:"span",_key:"b",text:"Free shipping this weekend"}],markDefs:[],style:"normal"}];e.describe("Announcement",()=>{e.describe("rendering",()=>{e.it("renders the announcement region when blocks and renderRichText are provided",()=>{const n=e.vi.fn().mockReturnValue(t.jsx("span",{children:"Free shipping this weekend"}));e.render(t.jsx(c.Announcement,{blocks:r,renderRichText:n})),e.globalExpect(e.screen.getByRole("region",{name:"Announcement"})).toBeInTheDocument(),e.globalExpect(e.screen.getByText("Free shipping this weekend")).toBeInTheDocument()}),e.it("renders nothing when blocks is empty",()=>{const n=e.vi.fn().mockReturnValue(t.jsx("span",{children:"text"})),{container:s}=e.render(t.jsx(c.Announcement,{blocks:[],renderRichText:n}));e.globalExpect(s).toBeEmptyDOMElement()}),e.it("renders nothing when renderRichText returns null",()=>{const n=e.vi.fn().mockReturnValue(null),{container:s}=e.render(t.jsx(c.Announcement,{blocks:r,renderRichText:n}));e.globalExpect(s).toBeEmptyDOMElement()}),e.it("renders nothing when renderRichText is not provided",()=>{const{container:n}=e.render(t.jsx(c.Announcement,{blocks:r}));e.globalExpect(n).toBeEmptyDOMElement()}),e.it("calls renderRichText with blocks and a className",()=>{const n=e.vi.fn().mockReturnValue(t.jsx("span",{children:"content"}));e.render(t.jsx(c.Announcement,{blocks:r,renderRichText:n})),e.globalExpect(n).toHaveBeenCalledWith({blocks:r,className:e.globalExpect.any(String)})}),e.it("applies a custom className to the announcement wrapper",()=>{const n=e.vi.fn().mockReturnValue(t.jsx("span",{children:"content"})),{container:s}=e.render(t.jsx(c.Announcement,{blocks:r,renderRichText:n,className:"custom-class"}));e.globalExpect(s.firstChild).toHaveClass("custom-class")})}),e.describe("accessibility",()=>{e.it("has role=region on the outer wrapper",()=>{const n=e.vi.fn().mockReturnValue(t.jsx("span",{children:"content"}));e.render(t.jsx(c.Announcement,{blocks:r,renderRichText:n})),e.globalExpect(e.screen.getByRole("region")).toBeInTheDocument()}),e.it("has aria-label='Announcement' on the region",()=>{const n=e.vi.fn().mockReturnValue(t.jsx("span",{children:"content"}));e.render(t.jsx(c.Announcement,{blocks:r,renderRichText:n})),e.globalExpect(e.screen.getByRole("region",{name:"Announcement"})).toBeInTheDocument()}),e.it("renders a dismiss button with aria-label='Dismiss announcement'",()=>{const n=e.vi.fn().mockReturnValue(t.jsx("span",{children:"content"}));e.render(t.jsx(c.Announcement,{blocks:r,renderRichText:n})),e.globalExpect(e.screen.getByRole("button",{name:"Dismiss announcement"})).toBeInTheDocument()}),e.it("renders the X icon with aria-hidden=true so screen readers skip it",()=>{const n=e.vi.fn().mockReturnValue(t.jsx("span",{children:"content"}));e.render(t.jsx(c.Announcement,{blocks:r,renderRichText:n})),e.globalExpect(e.screen.getByTestId("x-icon")).toHaveAttribute("aria-hidden","true")})}),e.describe("dismiss behaviour",()=>{e.it("hides the announcement when the dismiss button is clicked",()=>{const n=e.vi.fn().mockReturnValue(t.jsx("span",{children:"content"}));e.render(t.jsx(c.Announcement,{blocks:r,renderRichText:n})),e.fireEvent.click(e.screen.getByRole("button",{name:"Dismiss announcement"})),e.globalExpect(e.screen.queryByRole("region",{name:"Announcement"})).not.toBeInTheDocument()}),e.it("removes rendered content from the DOM after dismissal",()=>{const n=e.vi.fn().mockReturnValue(t.jsx("span",{children:"I will disappear"}));e.render(t.jsx(c.Announcement,{blocks:r,renderRichText:n})),e.fireEvent.click(e.screen.getByRole("button",{name:"Dismiss announcement"})),e.globalExpect(e.screen.queryByText("I will disappear")).not.toBeInTheDocument()}),e.it("is visible before the dismiss button is clicked",()=>{const n=e.vi.fn().mockReturnValue(t.jsx("span",{children:"Still here"}));e.render(t.jsx(c.Announcement,{blocks:r,renderRichText:n})),e.globalExpect(e.screen.getByRole("region",{name:"Announcement"})).toBeInTheDocument()}),e.it("does not dismiss when content area is clicked — only the button dismisses",()=>{const n=e.vi.fn().mockReturnValue(t.jsx("span",{children:"Click me"}));e.render(t.jsx(c.Announcement,{blocks:r,renderRichText:n})),e.fireEvent.click(e.screen.getByText("Click me")),e.globalExpect(e.screen.getByRole("region",{name:"Announcement"})).toBeInTheDocument()})})});
|
|
@@ -1,106 +1,108 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { v as
|
|
3
|
-
import { Announcement as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { v as o, d as m, i as s, r, g as t, s as a, f as d } from "../../../react.esm-DjxyacK8.js";
|
|
3
|
+
import { Announcement as c } from "./index.mjs";
|
|
4
4
|
import "../../../index-DPGXWTtt.js";
|
|
5
|
-
|
|
6
|
-
default: new Proxy({}, { get: (e,
|
|
5
|
+
o.mock("./styles.module.css", () => ({
|
|
6
|
+
default: new Proxy({}, { get: (e, l) => l })
|
|
7
7
|
}));
|
|
8
|
-
|
|
9
|
-
X: ({ size: e, ...
|
|
8
|
+
o.mock("lucide-react", () => ({
|
|
9
|
+
X: ({ size: e, ...l }) => /* @__PURE__ */ n("svg", { "data-testid": "x-icon", "data-size": e, ...l })
|
|
10
10
|
}));
|
|
11
|
+
const i = [
|
|
12
|
+
{
|
|
13
|
+
_type: "block",
|
|
14
|
+
_key: "a",
|
|
15
|
+
children: [
|
|
16
|
+
{ _type: "span", _key: "b", text: "Free shipping this weekend" }
|
|
17
|
+
],
|
|
18
|
+
markDefs: [],
|
|
19
|
+
style: "normal"
|
|
20
|
+
}
|
|
21
|
+
];
|
|
11
22
|
m("Announcement", () => {
|
|
12
23
|
m("rendering", () => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
s("renders the announcement region when blocks and renderRichText are provided", () => {
|
|
25
|
+
const e = o.fn().mockReturnValue(/* @__PURE__ */ n("span", { children: "Free shipping this weekend" }));
|
|
26
|
+
r(/* @__PURE__ */ n(c, { blocks: i, renderRichText: e })), t(
|
|
27
|
+
a.getByRole("region", { name: "Announcement" })
|
|
28
|
+
).toBeInTheDocument(), t(
|
|
29
|
+
a.getByText("Free shipping this weekend")
|
|
18
30
|
).toBeInTheDocument();
|
|
19
|
-
}),
|
|
20
|
-
const e =
|
|
21
|
-
/* @__PURE__ */
|
|
31
|
+
}), s("renders nothing when blocks is empty", () => {
|
|
32
|
+
const e = o.fn().mockReturnValue(/* @__PURE__ */ n("span", { children: "text" })), { container: l } = r(
|
|
33
|
+
/* @__PURE__ */ n(c, { blocks: [], renderRichText: e })
|
|
22
34
|
);
|
|
23
|
-
|
|
24
|
-
}),
|
|
25
|
-
const e = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/* @__PURE__ */ t(s, { content: r, renderRichText: e })
|
|
43
|
-
), n(e).toHaveBeenCalledWith(r, n.any(String)), n(c.getByText("Rendered content")).toBeInTheDocument();
|
|
44
|
-
}), o("renders the output of renderRichText when it returns a node", () => {
|
|
45
|
-
const e = a.fn().mockReturnValue(/* @__PURE__ */ t("span", { children: "Free shipping this weekend" }));
|
|
46
|
-
i(
|
|
47
|
-
/* @__PURE__ */ t(
|
|
48
|
-
s,
|
|
35
|
+
t(l).toBeEmptyDOMElement();
|
|
36
|
+
}), s("renders nothing when renderRichText returns null", () => {
|
|
37
|
+
const e = o.fn().mockReturnValue(null), { container: l } = r(
|
|
38
|
+
/* @__PURE__ */ n(c, { blocks: i, renderRichText: e })
|
|
39
|
+
);
|
|
40
|
+
t(l).toBeEmptyDOMElement();
|
|
41
|
+
}), s("renders nothing when renderRichText is not provided", () => {
|
|
42
|
+
const { container: e } = r(/* @__PURE__ */ n(c, { blocks: i }));
|
|
43
|
+
t(e).toBeEmptyDOMElement();
|
|
44
|
+
}), s("calls renderRichText with blocks and a className", () => {
|
|
45
|
+
const e = o.fn().mockReturnValue(/* @__PURE__ */ n("span", { children: "content" }));
|
|
46
|
+
r(/* @__PURE__ */ n(c, { blocks: i, renderRichText: e })), t(e).toHaveBeenCalledWith({
|
|
47
|
+
blocks: i,
|
|
48
|
+
className: t.any(String)
|
|
49
|
+
});
|
|
50
|
+
}), s("applies a custom className to the announcement wrapper", () => {
|
|
51
|
+
const e = o.fn().mockReturnValue(/* @__PURE__ */ n("span", { children: "content" })), { container: l } = r(
|
|
52
|
+
/* @__PURE__ */ n(
|
|
53
|
+
c,
|
|
49
54
|
{
|
|
50
|
-
|
|
51
|
-
renderRichText: e
|
|
55
|
+
blocks: i,
|
|
56
|
+
renderRichText: e,
|
|
57
|
+
className: "custom-class"
|
|
52
58
|
}
|
|
53
59
|
)
|
|
54
|
-
), n(
|
|
55
|
-
c.getByText("Free shipping this weekend")
|
|
56
|
-
).toBeInTheDocument();
|
|
57
|
-
}), o("wraps plain string content in a span", () => {
|
|
58
|
-
const { container: e } = i(
|
|
59
|
-
/* @__PURE__ */ t(s, { content: "Plain text announcement" })
|
|
60
|
-
), r = e.querySelector("span");
|
|
61
|
-
n(r).toHaveTextContent("Plain text announcement");
|
|
62
|
-
}), o("applies a custom className to the announcement wrapper", () => {
|
|
63
|
-
const { container: e } = i(
|
|
64
|
-
/* @__PURE__ */ t(s, { content: "Hello", className: "custom-class" })
|
|
65
60
|
);
|
|
66
|
-
|
|
61
|
+
t(l.firstChild).toHaveClass("custom-class");
|
|
67
62
|
});
|
|
68
63
|
}), m("accessibility", () => {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
s("has role=region on the outer wrapper", () => {
|
|
65
|
+
const e = o.fn().mockReturnValue(/* @__PURE__ */ n("span", { children: "content" }));
|
|
66
|
+
r(/* @__PURE__ */ n(c, { blocks: i, renderRichText: e })), t(a.getByRole("region")).toBeInTheDocument();
|
|
67
|
+
}), s("has aria-label='Announcement' on the region", () => {
|
|
68
|
+
const e = o.fn().mockReturnValue(/* @__PURE__ */ n("span", { children: "content" }));
|
|
69
|
+
r(/* @__PURE__ */ n(c, { blocks: i, renderRichText: e })), t(
|
|
70
|
+
a.getByRole("region", { name: "Announcement" })
|
|
74
71
|
).toBeInTheDocument();
|
|
75
|
-
}),
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
}), s("renders a dismiss button with aria-label='Dismiss announcement'", () => {
|
|
73
|
+
const e = o.fn().mockReturnValue(/* @__PURE__ */ n("span", { children: "content" }));
|
|
74
|
+
r(/* @__PURE__ */ n(c, { blocks: i, renderRichText: e })), t(
|
|
75
|
+
a.getByRole("button", { name: "Dismiss announcement" })
|
|
78
76
|
).toBeInTheDocument();
|
|
79
|
-
}),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
}), s("renders the X icon with aria-hidden=true so screen readers skip it", () => {
|
|
78
|
+
const e = o.fn().mockReturnValue(/* @__PURE__ */ n("span", { children: "content" }));
|
|
79
|
+
r(/* @__PURE__ */ n(c, { blocks: i, renderRichText: e })), t(a.getByTestId("x-icon")).toHaveAttribute(
|
|
80
|
+
"aria-hidden",
|
|
81
|
+
"true"
|
|
82
|
+
);
|
|
83
83
|
});
|
|
84
84
|
}), m("dismiss behaviour", () => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
name: "Dismiss announcement"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
c.queryByRole("region", { name: "Announcement" })
|
|
85
|
+
s("hides the announcement when the dismiss button is clicked", () => {
|
|
86
|
+
const e = o.fn().mockReturnValue(/* @__PURE__ */ n("span", { children: "content" }));
|
|
87
|
+
r(/* @__PURE__ */ n(c, { blocks: i, renderRichText: e })), d.click(
|
|
88
|
+
a.getByRole("button", { name: "Dismiss announcement" })
|
|
89
|
+
), t(
|
|
90
|
+
a.queryByRole("region", { name: "Announcement" })
|
|
92
91
|
).not.toBeInTheDocument();
|
|
93
|
-
}),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
}), s("removes rendered content from the DOM after dismissal", () => {
|
|
93
|
+
const e = o.fn().mockReturnValue(/* @__PURE__ */ n("span", { children: "I will disappear" }));
|
|
94
|
+
r(/* @__PURE__ */ n(c, { blocks: i, renderRichText: e })), d.click(
|
|
95
|
+
a.getByRole("button", { name: "Dismiss announcement" })
|
|
96
|
+
), t(a.queryByText("I will disappear")).not.toBeInTheDocument();
|
|
97
|
+
}), s("is visible before the dismiss button is clicked", () => {
|
|
98
|
+
const e = o.fn().mockReturnValue(/* @__PURE__ */ n("span", { children: "Still here" }));
|
|
99
|
+
r(/* @__PURE__ */ n(c, { blocks: i, renderRichText: e })), t(
|
|
100
|
+
a.getByRole("region", { name: "Announcement" })
|
|
100
101
|
).toBeInTheDocument();
|
|
101
|
-
}),
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
}), s("does not dismiss when content area is clicked — only the button dismisses", () => {
|
|
103
|
+
const e = o.fn().mockReturnValue(/* @__PURE__ */ n("span", { children: "Click me" }));
|
|
104
|
+
r(/* @__PURE__ */ n(c, { blocks: i, renderRichText: e })), d.click(a.getByText("Click me")), t(
|
|
105
|
+
a.getByRole("region", { name: "Announcement" })
|
|
104
106
|
).toBeInTheDocument();
|
|
105
107
|
});
|
|
106
108
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index44.css');const n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../index44.css');const n=require("react/jsx-runtime"),a=require("react"),l=require("../../../x-Dft9NVe_.cjs"),u="_announcement_1t134_1",m="_inner_1t134_9",d="_content_1t134_22",_="_close_1t134_48",e={announcement:u,inner:m,content:d,close:_};function j({blocks:t,renderRichText:s,className:i}){const[r,o]=a.useState(!1);if(r||!(t!=null&&t.length))return null;const c=s?s({blocks:t,className:e.content}):null;return c?n.jsx("div",{role:"region","aria-label":"Announcement",className:`${e.announcement} ${i??""}`.trim(),children:n.jsxs("div",{className:e.inner,children:[n.jsx("div",{className:e.content,children:c}),n.jsx("button",{className:e.close,onClick:()=>o(!0),"aria-label":"Dismiss announcement",children:n.jsx(l.X,{size:16,"aria-hidden":"true"})})]})}):null}exports.Announcement=j;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as t, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l } from "react";
|
|
3
3
|
import { X as m } from "../../../x-CnsEH4Ox.js";
|
|
4
4
|
import '../../../index44.css';const u = "_announcement_1t134_1", d = "_inner_1t134_9", _ = "_content_1t134_22", f = "_close_1t134_48", n = {
|
|
5
5
|
announcement: u,
|
|
@@ -7,29 +7,29 @@ import '../../../index44.css';const u = "_announcement_1t134_1", d = "_inner_1t1
|
|
|
7
7
|
content: _,
|
|
8
8
|
close: f
|
|
9
9
|
};
|
|
10
|
-
function
|
|
11
|
-
|
|
10
|
+
function v({
|
|
11
|
+
blocks: e,
|
|
12
12
|
renderRichText: s,
|
|
13
|
-
className:
|
|
13
|
+
className: o
|
|
14
14
|
}) {
|
|
15
|
-
const [
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
return
|
|
15
|
+
const [r, c] = l(!1);
|
|
16
|
+
if (r || !(e != null && e.length)) return null;
|
|
17
|
+
const i = s ? s({ blocks: e, className: n.content }) : null;
|
|
18
|
+
return i ? /* @__PURE__ */ t(
|
|
19
19
|
"div",
|
|
20
20
|
{
|
|
21
21
|
role: "region",
|
|
22
22
|
"aria-label": "Announcement",
|
|
23
|
-
className: `${n.announcement} ${
|
|
24
|
-
children: /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
23
|
+
className: `${n.announcement} ${o ?? ""}`.trim(),
|
|
24
|
+
children: /* @__PURE__ */ a("div", { className: n.inner, children: [
|
|
25
|
+
/* @__PURE__ */ t("div", { className: n.content, children: i }),
|
|
26
|
+
/* @__PURE__ */ t(
|
|
27
27
|
"button",
|
|
28
28
|
{
|
|
29
29
|
className: n.close,
|
|
30
|
-
onClick: () =>
|
|
30
|
+
onClick: () => c(!0),
|
|
31
31
|
"aria-label": "Dismiss announcement",
|
|
32
|
-
children: /* @__PURE__ */
|
|
32
|
+
children: /* @__PURE__ */ t(m, { size: 16, "aria-hidden": "true" })
|
|
33
33
|
}
|
|
34
34
|
)
|
|
35
35
|
] })
|
|
@@ -37,5 +37,5 @@ function b({
|
|
|
37
37
|
) : null;
|
|
38
38
|
}
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
v as Announcement
|
|
41
41
|
};
|
package/dist/core.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { FormEvent } from 'react';
|
|
|
4
4
|
import { ImageAdapter } from './core/types/adapters';
|
|
5
5
|
import { JSX } from 'react/jsx-runtime';
|
|
6
6
|
import { LinkAdapter } from './core/types/adapters';
|
|
7
|
+
import { PortableTextBlock } from '@portabletext/types';
|
|
7
8
|
import { ReactNode } from 'react';
|
|
8
9
|
import { RenderCallToActionProps } from './core/types/renderers';
|
|
9
10
|
import { RenderImageProps } from './core/types/renderers';
|
|
@@ -70,19 +71,14 @@ declare type AnchorTypeProps = {
|
|
|
70
71
|
rel?: string;
|
|
71
72
|
} & Omit<default_2.AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "target" | "rel">;
|
|
72
73
|
|
|
73
|
-
export declare function Announcement({
|
|
74
|
-
|
|
75
|
-
export declare type AnnouncementContent = {
|
|
76
|
-
type: "portableText";
|
|
77
|
-
content: unknown[];
|
|
78
|
-
} | {
|
|
79
|
-
type: "markdown";
|
|
80
|
-
content: string;
|
|
81
|
-
} | string;
|
|
74
|
+
export declare function Announcement({ blocks, renderRichText, className, }: AnnouncementProps): JSX.Element | null;
|
|
82
75
|
|
|
83
76
|
export declare type AnnouncementProps = {
|
|
84
|
-
|
|
85
|
-
renderRichText?: (
|
|
77
|
+
blocks: PortableTextBlock[];
|
|
78
|
+
renderRichText?: (props: {
|
|
79
|
+
blocks: PortableTextBlock[];
|
|
80
|
+
className?: string;
|
|
81
|
+
}) => React.ReactNode;
|
|
86
82
|
className?: string;
|
|
87
83
|
};
|
|
88
84
|
|
package/dist/main.d.ts
CHANGED
|
@@ -38,8 +38,8 @@ import { MetricType } from './sanity/types/metric';
|
|
|
38
38
|
import { NavigationData } from './sanity/types/navigation';
|
|
39
39
|
import { PageProps } from './sanity/types/page';
|
|
40
40
|
import { PageSection } from './sanity/types/pageSection';
|
|
41
|
-
import { PortableTextBlock } from '@portabletext/
|
|
42
|
-
import { PortableTextBlock as PortableTextBlock_2 } from '@portabletext/
|
|
41
|
+
import { PortableTextBlock } from '@portabletext/types';
|
|
42
|
+
import { PortableTextBlock as PortableTextBlock_2 } from '@portabletext/react';
|
|
43
43
|
import { QuoteBlockProps } from './next/blocks/QuoteBlock/QuoteBlock.types';
|
|
44
44
|
import { QuoteBlockProps as QuoteBlockProps_2 } from './QuoteBlock.types';
|
|
45
45
|
import { ReactNode } from 'react';
|
|
@@ -136,19 +136,14 @@ declare type AnchorTypeProps = {
|
|
|
136
136
|
rel?: string;
|
|
137
137
|
} & Omit<default_2.AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "target" | "rel">;
|
|
138
138
|
|
|
139
|
-
export declare function Announcement({
|
|
140
|
-
|
|
141
|
-
export declare type AnnouncementContent = {
|
|
142
|
-
type: "portableText";
|
|
143
|
-
content: unknown[];
|
|
144
|
-
} | {
|
|
145
|
-
type: "markdown";
|
|
146
|
-
content: string;
|
|
147
|
-
} | string;
|
|
139
|
+
export declare function Announcement({ blocks, renderRichText, className, }: AnnouncementProps): JSX.Element | null;
|
|
148
140
|
|
|
149
141
|
export declare type AnnouncementProps = {
|
|
150
|
-
|
|
151
|
-
renderRichText?: (
|
|
142
|
+
blocks: PortableTextBlock[];
|
|
143
|
+
renderRichText?: (props: {
|
|
144
|
+
blocks: PortableTextBlock[];
|
|
145
|
+
className?: string;
|
|
146
|
+
}) => React.ReactNode;
|
|
152
147
|
className?: string;
|
|
153
148
|
};
|
|
154
149
|
|
|
@@ -234,7 +229,7 @@ declare type BioCardProps = ItemType_3 & {
|
|
|
234
229
|
className?: string;
|
|
235
230
|
}) => default_2.ReactElement | null;
|
|
236
231
|
renderRichText?: (props: {
|
|
237
|
-
blocks:
|
|
232
|
+
blocks: PortableTextBlock[];
|
|
238
233
|
className?: string;
|
|
239
234
|
}) => default_2.ReactElement | null;
|
|
240
235
|
};
|
|
@@ -363,7 +358,7 @@ export { CardGridBlockProps }
|
|
|
363
358
|
*/
|
|
364
359
|
export declare type CardProps = ItemType_2 & {
|
|
365
360
|
renderRichText?: (props: {
|
|
366
|
-
blocks:
|
|
361
|
+
blocks: PortableTextBlock[];
|
|
367
362
|
className?: string;
|
|
368
363
|
}) => default_2.ReactElement | null;
|
|
369
364
|
renderImage?: (props: {
|
|
@@ -576,7 +571,7 @@ export declare type DrawerSize = keyof typeof sizeClassMap_2;
|
|
|
576
571
|
* Flattens all span children into a single string — suitable for Badge labels,
|
|
577
572
|
* aria attributes, and any context that needs a plain string from rich text.
|
|
578
573
|
*/
|
|
579
|
-
export declare function extractText(blocks:
|
|
574
|
+
export declare function extractText(blocks: PortableTextBlock[]): string;
|
|
580
575
|
|
|
581
576
|
declare type FABPosition = "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
582
577
|
|
|
@@ -741,7 +736,7 @@ declare type GridCardProps = ItemType_3 & {
|
|
|
741
736
|
style?: default_2.CSSProperties;
|
|
742
737
|
}) => default_2.ReactElement | null;
|
|
743
738
|
renderRichText?: (props: {
|
|
744
|
-
blocks:
|
|
739
|
+
blocks: PortableTextBlock[];
|
|
745
740
|
className?: string;
|
|
746
741
|
}) => default_2.ReactElement | null;
|
|
747
742
|
};
|
|
@@ -1404,7 +1399,7 @@ declare type ProductCardProps = ItemType_3 & {
|
|
|
1404
1399
|
style?: default_2.CSSProperties;
|
|
1405
1400
|
}) => default_2.ReactElement | null;
|
|
1406
1401
|
renderRichText?: (props: {
|
|
1407
|
-
blocks:
|
|
1402
|
+
blocks: PortableTextBlock[];
|
|
1408
1403
|
className?: string;
|
|
1409
1404
|
}) => default_2.ReactElement | null;
|
|
1410
1405
|
};
|
|
@@ -1556,7 +1551,7 @@ declare type ReviewCardProps = ItemType_3 & {
|
|
|
1556
1551
|
priority?: boolean;
|
|
1557
1552
|
}) => default_2.ReactElement | null;
|
|
1558
1553
|
renderRichText?: (props: {
|
|
1559
|
-
blocks:
|
|
1554
|
+
blocks: PortableTextBlock[];
|
|
1560
1555
|
className?: string;
|
|
1561
1556
|
}) => default_2.ReactElement | null;
|
|
1562
1557
|
};
|
|
@@ -1576,7 +1571,7 @@ export declare function RichTextBlock({ text, styleOptions, id, renderRichText,
|
|
|
1576
1571
|
export { RichTextBlockProps }
|
|
1577
1572
|
|
|
1578
1573
|
declare interface RichTextProps {
|
|
1579
|
-
blocks:
|
|
1574
|
+
blocks: PortableTextBlock_2[] | string;
|
|
1580
1575
|
className?: string;
|
|
1581
1576
|
textOverride?: string;
|
|
1582
1577
|
animateText?: boolean;
|
|
@@ -1607,7 +1602,7 @@ declare type SegmentCardProps = ItemType_3 & {
|
|
|
1607
1602
|
style?: default_2.CSSProperties;
|
|
1608
1603
|
}) => default_2.ReactElement | null;
|
|
1609
1604
|
renderRichText?: (props: {
|
|
1610
|
-
blocks:
|
|
1605
|
+
blocks: PortableTextBlock[];
|
|
1611
1606
|
className?: string;
|
|
1612
1607
|
}) => default_2.ReactElement | null;
|
|
1613
1608
|
};
|
|
@@ -1654,7 +1649,7 @@ declare type ServiceCardProps = ItemType_3 & {
|
|
|
1654
1649
|
onHover?: () => void;
|
|
1655
1650
|
onLeave?: () => void;
|
|
1656
1651
|
renderRichText?: (props: {
|
|
1657
|
-
blocks:
|
|
1652
|
+
blocks: PortableTextBlock[];
|
|
1658
1653
|
className?: string;
|
|
1659
1654
|
}) => default_2.ReactElement | null;
|
|
1660
1655
|
};
|
|
@@ -1824,7 +1819,7 @@ declare interface SpotlightCardProps {
|
|
|
1824
1819
|
priority?: boolean;
|
|
1825
1820
|
}) => default_2.ReactElement | null;
|
|
1826
1821
|
renderRichText?: (props: {
|
|
1827
|
-
blocks:
|
|
1822
|
+
blocks: PortableTextBlock[];
|
|
1828
1823
|
className?: string;
|
|
1829
1824
|
}) => default_2.ReactElement | null;
|
|
1830
1825
|
}
|
|
@@ -1952,7 +1947,7 @@ declare type TestimonialCardProps = ItemType_3 & {
|
|
|
1952
1947
|
draggable?: boolean;
|
|
1953
1948
|
}) => default_2.ReactElement | null;
|
|
1954
1949
|
renderRichText?: (props: {
|
|
1955
|
-
blocks:
|
|
1950
|
+
blocks: PortableTextBlock[];
|
|
1956
1951
|
className?: string;
|
|
1957
1952
|
}) => default_2.ReactElement | null;
|
|
1958
1953
|
};
|