quirk-ui 0.0.605 → 0.0.606
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
|
@@ -1260,7 +1260,7 @@ declare const statusClassMap: {
|
|
|
1260
1260
|
readonly busy: string;
|
|
1261
1261
|
};
|
|
1262
1262
|
|
|
1263
|
-
export declare function StickyScrollBlock({ heading, items, showNumbers, id, }: StickyScrollBlockProps_2): JSX.Element;
|
|
1263
|
+
export declare function StickyScrollBlock({ heading, items, showNumbers, styleOptions, id, }: StickyScrollBlockProps_2): JSX.Element;
|
|
1264
1264
|
|
|
1265
1265
|
export { StickyScrollBlockProps }
|
|
1266
1266
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index5.css');const t=require("react/jsx-runtime"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../../assets/index5.css');const t=require("react/jsx-runtime"),r=require("react"),q=require("next/image"),a=require("../../ui/PortableTextRenderer/index.cjs");require("react-dom");const S=require("../../contexts/ThemeContext.cjs"),$=require("../../utils/portableTextToPlainText.cjs"),C=require("../../hooks/useStyleClasses.cjs"),U="_layout_59elj_1",w="_container_59elj_7",P="_heading_59elj_19",A="_title_59elj_24",B="_text_59elj_24",E="_scroll_59elj_39",M="_sidebar_59elj_44",O="_number_59elj_69",V="_link_59elj_84",z="_active_59elj_98",D="_content_59elj_110",F="_item_59elj_114",G="_image_59elj_138",s={layout:U,container:w,heading:P,title:A,text:B,scroll:E,sidebar:M,number:O,link:V,active:z,content:D,item:F,image:G};function H({heading:o,items:_,showNumbers:y,styleOptions:f,id:T}){const[p,u]=r.useState(null),{mode:d}=S.useTheme(),N=C.useStyleClasses(f),I=r.useRef(null),m=r.useRef([]);return r.useEffect(()=>{const e=new IntersectionObserver(c=>{const i=c.filter(l=>l.isIntersecting).sort((l,n)=>n.intersectionRatio-l.intersectionRatio);if(i.length>0){const l=i[0].target.getAttribute("id");l&&u(l)}},{rootMargin:"-45% 0px -45% 0px",threshold:.1});return m.current.forEach(c=>{c&&e.observe(c)}),I.current=e,()=>{e.disconnect()}},[]),t.jsx("section",{id:T,className:`${N} ${s.layout}`,children:t.jsxs("article",{className:s.container,children:[t.jsxs("div",{className:s.heading,children:[t.jsx(a.RichText,{className:s.title,blocks:o.title}),o.description&&t.jsx(a.RichText,{blocks:o.description})]}),t.jsxs("div",{className:s.scroll,children:[t.jsx("nav",{className:s.sidebar,children:t.jsx("ul",{children:_.map((e,c)=>t.jsx("li",{children:t.jsxs("button",{type:"button",className:`${s.link} ${p===e._key?s.active:""}`,onClick:()=>{u(e._key);const i=document.getElementById(e._key);i==null||i.scrollIntoView({behavior:"smooth",block:"start"})},children:[y&&t.jsx("div",{className:s.number,children:c+1}),e.title&&$.portableTextToPlainText(e.title)]})},e._key))})}),t.jsx("div",{className:s.content,children:_.map((e,c)=>{var n,x,g,j,h,b,k,v;let i;(n=e.image)!=null&&n.imageUrls&&(i=d==="dark"&&((x=e.image.imageUrls.dark)==null?void 0:x.medium)||e.image.imageUrls.default.medium);let l=((h=(j=(g=e.image)==null?void 0:g[d==="dark"?"darkImage":"defaultImage"])==null?void 0:j.asset)==null?void 0:h.altText)||((v=(k=(b=e.image)==null?void 0:b[d==="dark"?"darkImage":"defaultImage"])==null?void 0:k.asset)==null?void 0:v.description)||"Card image";return t.jsxs("section",{ref:R=>{m.current[c]=R},id:e._key,className:s.item,children:[t.jsxs("div",{className:s.text,children:[e.title&&t.jsx(a.RichText,{className:s.title,blocks:e.title}),e.description&&t.jsx(a.RichText,{blocks:e.description})]}),e.image&&i&&t.jsx("div",{className:s.image,children:t.jsx(q,{src:i,alt:l,width:600,height:400,priority:!0})})]},e._key)})})]})]})})}exports.StickyScrollBlock=H;
|
|
@@ -1,38 +1,40 @@
|
|
|
1
1
|
import { jsx as i, jsxs as r } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { RichText as
|
|
2
|
+
import { useState as w, useRef as y, useEffect as S } from "react";
|
|
3
|
+
import $ from "next/image";
|
|
4
|
+
import { RichText as n } from "../../ui/PortableTextRenderer/index.mjs";
|
|
5
5
|
import "react-dom";
|
|
6
6
|
import { useTheme as A } from "../../contexts/ThemeContext.mjs";
|
|
7
|
-
import { portableTextToPlainText as
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
7
|
+
import { portableTextToPlainText as C } from "../../utils/portableTextToPlainText.mjs";
|
|
8
|
+
import { useStyleClasses as E } from "../../hooks/useStyleClasses.mjs";
|
|
9
|
+
import '../../../assets/index5.css';const B = "_layout_59elj_1", M = "_container_59elj_7", O = "_heading_59elj_19", P = "_title_59elj_24", V = "_text_59elj_24", q = "_scroll_59elj_39", z = "_sidebar_59elj_44", D = "_number_59elj_69", F = "_link_59elj_84", G = "_active_59elj_98", H = "_content_59elj_110", J = "_item_59elj_114", K = "_image_59elj_138", t = {
|
|
10
|
+
layout: B,
|
|
11
|
+
container: M,
|
|
12
|
+
heading: O,
|
|
13
|
+
title: P,
|
|
14
|
+
text: V,
|
|
15
|
+
scroll: q,
|
|
16
|
+
sidebar: z,
|
|
17
|
+
number: D,
|
|
18
|
+
link: F,
|
|
19
|
+
active: G,
|
|
20
|
+
content: H,
|
|
21
|
+
item: J,
|
|
22
|
+
image: K
|
|
22
23
|
};
|
|
23
|
-
function
|
|
24
|
+
function ie({
|
|
24
25
|
heading: o,
|
|
25
26
|
items: m,
|
|
26
|
-
showNumbers:
|
|
27
|
-
|
|
27
|
+
showNumbers: j,
|
|
28
|
+
styleOptions: x,
|
|
29
|
+
id: N
|
|
28
30
|
}) {
|
|
29
|
-
const [I, _] =
|
|
30
|
-
return
|
|
31
|
+
const [I, _] = w(null), { mode: d } = A(), T = E(x), R = y(null), u = y([]);
|
|
32
|
+
return S(() => {
|
|
31
33
|
const e = new IntersectionObserver(
|
|
32
|
-
(
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
const c =
|
|
34
|
+
(l) => {
|
|
35
|
+
const s = l.filter((c) => c.isIntersecting).sort((c, a) => a.intersectionRatio - c.intersectionRatio);
|
|
36
|
+
if (s.length > 0) {
|
|
37
|
+
const c = s[0].target.getAttribute("id");
|
|
36
38
|
c && _(c);
|
|
37
39
|
}
|
|
38
40
|
},
|
|
@@ -41,58 +43,58 @@ function Y({
|
|
|
41
43
|
threshold: 0.1
|
|
42
44
|
}
|
|
43
45
|
);
|
|
44
|
-
return u.current.forEach((
|
|
45
|
-
|
|
46
|
-
}),
|
|
46
|
+
return u.current.forEach((l) => {
|
|
47
|
+
l && e.observe(l);
|
|
48
|
+
}), R.current = e, () => {
|
|
47
49
|
e.disconnect();
|
|
48
50
|
};
|
|
49
|
-
}, []), /* @__PURE__ */ i("section", { id:
|
|
51
|
+
}, []), /* @__PURE__ */ i("section", { id: N, className: `${T} ${t.layout}`, children: /* @__PURE__ */ r("article", { className: t.container, children: [
|
|
50
52
|
/* @__PURE__ */ r("div", { className: t.heading, children: [
|
|
51
|
-
/* @__PURE__ */ i(
|
|
52
|
-
o.description && /* @__PURE__ */ i(
|
|
53
|
+
/* @__PURE__ */ i(n, { className: t.title, blocks: o.title }),
|
|
54
|
+
o.description && /* @__PURE__ */ i(n, { blocks: o.description })
|
|
53
55
|
] }),
|
|
54
56
|
/* @__PURE__ */ r("div", { className: t.scroll, children: [
|
|
55
|
-
/* @__PURE__ */ i("nav", { className: t.sidebar, children: /* @__PURE__ */ i("ul", { children: m.map((e,
|
|
57
|
+
/* @__PURE__ */ i("nav", { className: t.sidebar, children: /* @__PURE__ */ i("ul", { children: m.map((e, l) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ r(
|
|
56
58
|
"button",
|
|
57
59
|
{
|
|
58
60
|
type: "button",
|
|
59
61
|
className: `${t.link} ${I === e._key ? t.active : ""}`,
|
|
60
62
|
onClick: () => {
|
|
61
63
|
_(e._key);
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
+
const s = document.getElementById(e._key);
|
|
65
|
+
s == null || s.scrollIntoView({
|
|
64
66
|
behavior: "smooth",
|
|
65
67
|
block: "start"
|
|
66
68
|
});
|
|
67
69
|
},
|
|
68
70
|
children: [
|
|
69
|
-
|
|
70
|
-
e.title &&
|
|
71
|
+
j && /* @__PURE__ */ i("div", { className: t.number, children: l + 1 }),
|
|
72
|
+
e.title && C(e.title)
|
|
71
73
|
]
|
|
72
74
|
}
|
|
73
75
|
) }, e._key)) }) }),
|
|
74
|
-
/* @__PURE__ */ i("div", { className: t.content, children: m.map((e,
|
|
75
|
-
var
|
|
76
|
-
let
|
|
77
|
-
(
|
|
78
|
-
let c = ((b = (k = (h = e.image) == null ? void 0 : h[d === "dark" ? "darkImage" : "defaultImage"]) == null ? void 0 : k.asset) == null ? void 0 : b.altText) || ((
|
|
76
|
+
/* @__PURE__ */ i("div", { className: t.content, children: m.map((e, l) => {
|
|
77
|
+
var a, g, h, k, b, f, p, v;
|
|
78
|
+
let s;
|
|
79
|
+
(a = e.image) != null && a.imageUrls && (s = d === "dark" && ((g = e.image.imageUrls.dark) == null ? void 0 : g.medium) || e.image.imageUrls.default.medium);
|
|
80
|
+
let c = ((b = (k = (h = e.image) == null ? void 0 : h[d === "dark" ? "darkImage" : "defaultImage"]) == null ? void 0 : k.asset) == null ? void 0 : b.altText) || ((v = (p = (f = e.image) == null ? void 0 : f[d === "dark" ? "darkImage" : "defaultImage"]) == null ? void 0 : p.asset) == null ? void 0 : v.description) || "Card image";
|
|
79
81
|
return /* @__PURE__ */ r(
|
|
80
82
|
"section",
|
|
81
83
|
{
|
|
82
|
-
ref: (
|
|
83
|
-
u.current[
|
|
84
|
+
ref: (U) => {
|
|
85
|
+
u.current[l] = U;
|
|
84
86
|
},
|
|
85
87
|
id: e._key,
|
|
86
88
|
className: t.item,
|
|
87
89
|
children: [
|
|
88
90
|
/* @__PURE__ */ r("div", { className: t.text, children: [
|
|
89
|
-
e.title && /* @__PURE__ */ i(
|
|
90
|
-
e.description && /* @__PURE__ */ i(
|
|
91
|
+
e.title && /* @__PURE__ */ i(n, { className: t.title, blocks: e.title }),
|
|
92
|
+
e.description && /* @__PURE__ */ i(n, { blocks: e.description })
|
|
91
93
|
] }),
|
|
92
|
-
e.image &&
|
|
93
|
-
|
|
94
|
+
e.image && s && /* @__PURE__ */ i("div", { className: t.image, children: /* @__PURE__ */ i(
|
|
95
|
+
$,
|
|
94
96
|
{
|
|
95
|
-
src:
|
|
97
|
+
src: s,
|
|
96
98
|
alt: c,
|
|
97
99
|
width: 600,
|
|
98
100
|
height: 400,
|
|
@@ -108,5 +110,5 @@ function Y({
|
|
|
108
110
|
] }) });
|
|
109
111
|
}
|
|
110
112
|
export {
|
|
111
|
-
|
|
113
|
+
ie as StickyScrollBlock
|
|
112
114
|
};
|
package/dist/next.d.ts
CHANGED
|
@@ -151,7 +151,7 @@ declare interface SpotlightCardProps {
|
|
|
151
151
|
|
|
152
152
|
export { SpotlightProps }
|
|
153
153
|
|
|
154
|
-
export declare function StickyScrollBlock({ heading, items, showNumbers, id, }: StickyScrollBlockProps_2): JSX.Element;
|
|
154
|
+
export declare function StickyScrollBlock({ heading, items, showNumbers, styleOptions, id, }: StickyScrollBlockProps_2): JSX.Element;
|
|
155
155
|
|
|
156
156
|
export { StickyScrollBlockProps }
|
|
157
157
|
|