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"),N=require("next/image"),a=require("../../ui/PortableTextRenderer/index.cjs");require("react-dom");const R=require("../../contexts/ThemeContext.cjs"),q=require("../../utils/portableTextToPlainText.cjs"),S="_layout_59elj_1",U="_container_59elj_7",w="_heading_59elj_19",P="_title_59elj_24",$="_text_59elj_24",A="_scroll_59elj_39",B="_sidebar_59elj_44",C="_number_59elj_69",E="_link_59elj_84",M="_active_59elj_98",O="_content_59elj_110",V="_item_59elj_114",z="_image_59elj_138",s={layout:S,container:U,heading:w,title:P,text:$,scroll:A,sidebar:B,number:C,link:E,active:M,content:O,item:V,image:z};function D({heading:o,items:_,showNumbers:f,id:y}){const[T,u]=r.useState(null),{mode:d}=R.useTheme(),p=r.useRef(null),m=r.useRef([]);return r.useEffect(()=>{const e=new IntersectionObserver(c=>{const i=c.filter(n=>n.isIntersecting).sort((n,l)=>l.intersectionRatio-n.intersectionRatio);if(i.length>0){const n=i[0].target.getAttribute("id");n&&u(n)}},{rootMargin:"-45% 0px -45% 0px",threshold:.1});return m.current.forEach(c=>{c&&e.observe(c)}),p.current=e,()=>{e.disconnect()}},[]),t.jsx("section",{id:y,className: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} ${T===e._key?s.active:""}`,onClick:()=>{u(e._key);const i=document.getElementById(e._key);i==null||i.scrollIntoView({behavior:"smooth",block:"start"})},children:[f&&t.jsx("div",{className:s.number,children:c+1}),e.title&&q.portableTextToPlainText(e.title)]})},e._key))})}),t.jsx("div",{className:s.content,children:_.map((e,c)=>{var l,x,g,j,h,b,k,v;let i;(l=e.image)!=null&&l.imageUrls&&(i=d==="dark"&&((x=e.image.imageUrls.dark)==null?void 0:x.medium)||e.image.imageUrls.default.medium);let n=((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:I=>{m.current[c]=I},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(N,{src:i,alt:n,width:600,height:400,priority:!0})})]},e._key)})})]})]})})}exports.StickyScrollBlock=D;
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 R, useRef as j, useEffect as U } from "react";
3
- import w from "next/image";
4
- import { RichText as a } from "../../ui/PortableTextRenderer/index.mjs";
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 E } from "../../utils/portableTextToPlainText.mjs";
8
- import '../../../assets/index5.css';const S = "_layout_59elj_1", B = "_container_59elj_7", C = "_heading_59elj_19", $ = "_title_59elj_24", M = "_text_59elj_24", O = "_scroll_59elj_39", P = "_sidebar_59elj_44", V = "_number_59elj_69", q = "_link_59elj_84", z = "_active_59elj_98", D = "_content_59elj_110", F = "_item_59elj_114", G = "_image_59elj_138", t = {
9
- layout: S,
10
- container: B,
11
- heading: C,
12
- title: $,
13
- text: M,
14
- scroll: O,
15
- sidebar: P,
16
- number: V,
17
- link: q,
18
- active: z,
19
- content: D,
20
- item: F,
21
- image: G
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 Y({
24
+ function ie({
24
25
  heading: o,
25
26
  items: m,
26
- showNumbers: y,
27
- id: x
27
+ showNumbers: j,
28
+ styleOptions: x,
29
+ id: N
28
30
  }) {
29
- const [I, _] = R(null), { mode: d } = A(), N = j(null), u = j([]);
30
- return U(() => {
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
- (s) => {
33
- const l = s.filter((c) => c.isIntersecting).sort((c, n) => n.intersectionRatio - c.intersectionRatio);
34
- if (l.length > 0) {
35
- const c = l[0].target.getAttribute("id");
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((s) => {
45
- s && e.observe(s);
46
- }), N.current = e, () => {
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: x, className: t.layout, children: /* @__PURE__ */ r("article", { className: t.container, children: [
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(a, { className: t.title, blocks: o.title }),
52
- o.description && /* @__PURE__ */ i(a, { blocks: o.description })
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, s) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ r(
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 l = document.getElementById(e._key);
63
- l == null || l.scrollIntoView({
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
- y && /* @__PURE__ */ i("div", { className: t.number, children: s + 1 }),
70
- e.title && E(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, s) => {
75
- var n, g, h, k, b, f, v, p;
76
- let l;
77
- (n = e.image) != null && n.imageUrls && (l = d === "dark" && ((g = e.image.imageUrls.dark) == null ? void 0 : g.medium) || e.image.imageUrls.default.medium);
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) || ((p = (v = (f = e.image) == null ? void 0 : f[d === "dark" ? "darkImage" : "defaultImage"]) == null ? void 0 : v.asset) == null ? void 0 : p.description) || "Card image";
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: (T) => {
83
- u.current[s] = T;
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(a, { className: t.title, blocks: e.title }),
90
- e.description && /* @__PURE__ */ i(a, { blocks: e.description })
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 && l && /* @__PURE__ */ i("div", { className: t.image, children: /* @__PURE__ */ i(
93
- w,
94
+ e.image && s && /* @__PURE__ */ i("div", { className: t.image, children: /* @__PURE__ */ i(
95
+ $,
94
96
  {
95
- src: l,
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
- Y as StickyScrollBlock
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
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quirk-ui",
3
3
  "private": false,
4
- "version": "0.0.605",
4
+ "version": "0.0.606",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {