quirk-ui 0.1.20 → 0.1.21

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.
@@ -1,11 +1,11 @@
1
- import { jsx as o, jsxs as c } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as c } from "react/jsx-runtime";
2
2
  import { useState as $, useRef as u, useCallback as k, useEffect as C } from "react";
3
3
  import { resolveImageUrl as A, resolveAltText as E } from "../../utils/mediaUtils.mjs";
4
4
  import { extractText as M } from "../../utils/blockRenderers.mjs";
5
5
  import { useTheme as j } from "../../../core/context/ThemeContext.mjs";
6
6
  import { useMediaQuery as z } from "../../hooks/useMediaQuery.mjs";
7
7
  import { useStyleClasses as B } from "../../hooks/useStyleClasses.mjs";
8
- import '../../../assets/index12.css';const U = "_layout_1a34q_1", O = "_container_1a34q_7", Q = "_heading_1a34q_23", V = "_title_1a34q_28", D = "_text_1a34q_28", F = "_scroll_1a34q_43", G = "_sidebar_1a34q_48", H = "_number_1a34q_73", J = "_link_1a34q_90", L = "_active_1a34q_104", P = "_content_1a34q_116", W = "_flex_1a34q_127", X = "_item_1a34q_152", Y = "_image_1a34q_171", Z = "_eyebrow_1a34q_197", a = {
8
+ import '../../../assets/index12.css';const U = "_layout_11dq8_1", O = "_container_11dq8_7", Q = "_heading_11dq8_23", V = "_title_11dq8_28", D = "_text_11dq8_28", F = "_scroll_11dq8_43", G = "_sidebar_11dq8_48", H = "_number_11dq8_73", J = "_link_11dq8_91", L = "_active_11dq8_106", P = "_content_11dq8_118", W = "_flex_11dq8_129", X = "_item_11dq8_154", Y = "_image_11dq8_173", Z = "_eyebrow_11dq8_199", e = {
9
9
  layout: U,
10
10
  container: O,
11
11
  heading: Q,
@@ -22,14 +22,14 @@ import '../../../assets/index12.css';const U = "_layout_1a34q_1", O = "_containe
22
22
  image: Y,
23
23
  eyebrow: Z
24
24
  };
25
- function et({
25
+ function lt({
26
26
  heading: n,
27
27
  items: r,
28
- showNumbers: b,
28
+ showNumbers: d,
29
29
  styleOptions: p,
30
30
  id: N,
31
- renderImage: d,
32
- renderRichText: e
31
+ renderImage: b,
32
+ renderRichText: l
33
33
  }) {
34
34
  const [f, v] = $(null), { mode: y } = j(), q = z("(max-width: 768px)"), w = B(p), _ = u(!1), m = u(null), g = u([]), h = k(
35
35
  (t) => (s) => {
@@ -41,10 +41,10 @@ function et({
41
41
  const t = new IntersectionObserver(
42
42
  (s) => {
43
43
  if (_.current) return;
44
- const i = s.filter((l) => l.isIntersecting).sort((l, S) => S.intersectionRatio - l.intersectionRatio);
44
+ const i = s.filter((o) => o.isIntersecting).sort((o, S) => S.intersectionRatio - o.intersectionRatio);
45
45
  if (i.length > 0) {
46
- const l = i[0].target.getAttribute("id");
47
- l && v(l);
46
+ const o = i[0].target.getAttribute("id");
47
+ o && v(o);
48
48
  }
49
49
  },
50
50
  {
@@ -64,67 +64,67 @@ function et({
64
64
  _.current = !1;
65
65
  }, 600), (s = document.getElementById(t)) == null || s.scrollIntoView({ behavior: "smooth", block: "start" });
66
66
  }, []);
67
- return /* @__PURE__ */ o("section", { id: N, className: `${w} ${a.layout}`, children: /* @__PURE__ */ c("article", { className: a.container, children: [
68
- /* @__PURE__ */ c("div", { className: a.heading, children: [
67
+ return /* @__PURE__ */ a("section", { id: N, className: `${w} ${e.layout}`, children: /* @__PURE__ */ c("article", { className: e.container, children: [
68
+ /* @__PURE__ */ c("div", { className: e.heading, children: [
69
69
  /* @__PURE__ */ c("div", { children: [
70
- n.eyebrow && (e == null ? void 0 : e({
70
+ n.eyebrow && (l == null ? void 0 : l({
71
71
  blocks: n.eyebrow,
72
- className: a.eyebrow
72
+ className: e.eyebrow
73
73
  })),
74
- e == null ? void 0 : e({
74
+ l == null ? void 0 : l({
75
75
  blocks: n.title,
76
- className: a.title
76
+ className: e.title
77
77
  })
78
78
  ] }),
79
- n.description && (e == null ? void 0 : e({ blocks: n.description }))
79
+ n.description && (l == null ? void 0 : l({ blocks: n.description }))
80
80
  ] }),
81
- /* @__PURE__ */ c("div", { className: a.scroll, children: [
82
- /* @__PURE__ */ o("nav", { className: a.sidebar, "aria-label": "Section navigation", children: /* @__PURE__ */ o("ul", { children: r.map((t, s) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ c(
81
+ /* @__PURE__ */ c("div", { className: e.scroll, children: [
82
+ /* @__PURE__ */ a("nav", { className: e.sidebar, "aria-label": "Section navigation", children: /* @__PURE__ */ a("ul", { children: r.map((t, s) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ c(
83
83
  "button",
84
84
  {
85
85
  type: "button",
86
- className: `${a.link} ${f === t._key ? a.active : ""}`,
86
+ className: `${e.link} ${f === t._key ? e.active : ""}`,
87
87
  "aria-current": f === t._key ? "true" : void 0,
88
88
  onClick: () => I(t._key),
89
89
  children: [
90
- b && /* @__PURE__ */ o("div", { className: a.number, "aria-hidden": "true", children: s + 1 }),
90
+ d && /* @__PURE__ */ a("div", { className: e.number, "aria-hidden": "true", children: s + 1 }),
91
91
  t.title && M(t.title)
92
92
  ]
93
93
  }
94
94
  ) }, t._key)) }) }),
95
- /* @__PURE__ */ o("div", { className: a.content, children: r.map((t, s) => {
96
- const i = A(t.image, y), l = E(t.image, y);
95
+ /* @__PURE__ */ a("div", { className: e.content, children: r.map((t, s) => {
96
+ const i = A(t.image, y), o = E(t.image, y);
97
97
  return /* @__PURE__ */ c(
98
98
  "section",
99
99
  {
100
100
  ref: h(s),
101
101
  id: t._key,
102
- className: a.item,
102
+ className: e.item,
103
103
  "aria-labelledby": `${t._key}-heading`,
104
104
  children: [
105
- /* @__PURE__ */ c("div", { className: a.text, children: [
106
- /* @__PURE__ */ c("div", { className: a.flex, children: [
107
- q && b && /* @__PURE__ */ o("div", { className: a.number, "aria-hidden": "true", children: s + 1 }),
108
- t.title && (e == null ? void 0 : e({
105
+ /* @__PURE__ */ c("div", { className: e.text, children: [
106
+ /* @__PURE__ */ c("div", { className: e.flex, children: [
107
+ q && d && /* @__PURE__ */ a("div", { className: e.number, "aria-hidden": "true", children: s + 1 }),
108
+ t.title && (l == null ? void 0 : l({
109
109
  blocks: t.title,
110
- className: a.title
110
+ className: e.title
111
111
  }))
112
112
  ] }),
113
- t.description && (e == null ? void 0 : e({ blocks: t.description }))
113
+ t.description && (l == null ? void 0 : l({ blocks: t.description }))
114
114
  ] }),
115
- t.image && i && /* @__PURE__ */ o("div", { className: a.image, children: d ? d({
115
+ t.image && i && /* @__PURE__ */ a("div", { className: e.image, children: b ? b({
116
116
  src: i,
117
- alt: l,
117
+ alt: o,
118
118
  width: 600,
119
119
  height: 400,
120
120
  // Only the first image is above-the-fold.
121
121
  priority: s === 0,
122
122
  loading: s === 0 ? "eager" : "lazy"
123
- }) : /* @__PURE__ */ o(
123
+ }) : /* @__PURE__ */ a(
124
124
  "img",
125
125
  {
126
126
  src: i,
127
- alt: l,
127
+ alt: o,
128
128
  width: 600,
129
129
  height: 400,
130
130
  loading: s === 0 ? "eager" : "lazy"
@@ -139,5 +139,5 @@ function et({
139
139
  ] }) });
140
140
  }
141
141
  export {
142
- et as StickyScrollBlock
142
+ lt as StickyScrollBlock
143
143
  };