neatkit 0.7.0 → 0.8.0
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/Avatar-Belo7qAY.cjs +1 -0
- package/dist/Avatar-DjDCFqNG.js +55 -0
- package/dist/Avatar.cjs +1 -1
- package/dist/Avatar.js +2 -52
- package/dist/Boundary.cjs +1 -0
- package/dist/Boundary.js +176 -0
- package/dist/{Button-BAsLfA0D.js → Button-Chv4O66e.js} +35 -35
- package/dist/Button-DCKtFvSo.cjs +1 -0
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +1 -1
- package/dist/Checkbox.cjs +1 -1
- package/dist/Checkbox.js +213 -2
- package/dist/Code-ClkozPlv.js +227 -0
- package/dist/Code-JDb4VFl7.cjs +4 -0
- package/dist/Code.cjs +1 -1
- package/dist/Code.js +1 -1
- package/dist/{Icon-uQmpr5P2.js → Icon-BoEUoOk7.js} +144 -177
- package/dist/Icon-DJ4BigRz.cjs +1 -0
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +2 -35
- package/dist/Input.cjs +1 -1
- package/dist/Input.js +70 -79
- package/dist/Markdown.cjs +1 -31
- package/dist/Markdown.js +461 -18062
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +100 -122
- package/dist/PinInput.cjs +1 -1
- package/dist/PinInput.js +1 -1
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.js +106 -106
- package/dist/Radio.cjs +1 -1
- package/dist/Radio.js +86 -41
- package/dist/Select.cjs +1 -1
- package/dist/Select.js +326 -315
- package/dist/Sidebar.cjs +1 -0
- package/dist/Sidebar.js +475 -0
- package/dist/Skeleton.cjs +1 -1
- package/dist/Skeleton.js +20 -16
- package/dist/Switch.cjs +1 -1
- package/dist/Switch.js +1 -1
- package/dist/Table-B30TBckZ.js +402 -0
- package/dist/Table-DceR12X9.cjs +1 -0
- package/dist/Table.cjs +1 -1
- package/dist/Table.js +1 -1
- package/dist/TextArea.cjs +1 -1
- package/dist/TextArea.js +1 -1
- package/dist/Tooltip-B4bajPtk.cjs +1 -0
- package/dist/Tooltip-BVqdnKK_.js +231 -0
- package/dist/Tooltip.cjs +1 -1
- package/dist/Tooltip.js +2 -3
- package/dist/aria-Bntn6ad_.cjs +1 -0
- package/dist/aria-CeA9QfD1.js +15 -0
- package/dist/components/Boundary/Boundary.d.ts +65 -0
- package/dist/components/Boundary/contexts/BoundaryContext.d.ts +28 -0
- package/dist/components/Boundary/hooks/useBoundary.d.ts +19 -0
- package/dist/components/Boundary/hooks/useBoundaryWidth.d.ts +23 -0
- package/dist/components/Boundary/index.d.ts +2 -0
- package/dist/components/Boundary/utils/width.d.ts +11 -0
- package/dist/components/Checkbox/Checkbox.d.ts +9 -1
- package/dist/components/{CheckboxGroup → Checkbox/components}/CheckboxGroup.d.ts +2 -2
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/utils/checkbox-option.d.ts +17 -0
- package/dist/components/Icon/Icon.d.ts +1 -0
- package/dist/components/Icon/index.d.ts +0 -33
- package/dist/components/Input/Input.d.ts +1 -9
- package/dist/components/Modal/Modal.d.ts +0 -4
- package/dist/components/PinInput/PinInput.d.ts +1 -1
- package/dist/components/Popover/Popover.d.ts +2 -6
- package/dist/components/Portal/Portal.d.ts +11 -8
- package/dist/components/Portal/hooks/useDismissableLayer.d.ts +2 -0
- package/dist/components/Portal/hooks/useFloatingPosition.d.ts +4 -3
- package/dist/components/Portal/hooks/useFocusTrap.d.ts +2 -0
- package/dist/components/Portal/hooks/useScrollLock.d.ts +9 -3
- package/dist/components/Portal/utils/boundary-focus.d.ts +23 -0
- package/dist/components/Portal/utils/floating-position.d.ts +43 -9
- package/dist/components/Portal/utils/overlay-stack.d.ts +22 -10
- package/dist/components/Portal/utils/scroll-container.d.ts +13 -0
- package/dist/components/Radio/Radio.d.ts +9 -1
- package/dist/components/{RadioGroup → Radio/components}/RadioGroup.d.ts +9 -2
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Select/Select.d.ts +0 -2
- package/dist/components/Select/utils/listbox-position.d.ts +28 -0
- package/dist/components/Sidebar/Sidebar.d.ts +108 -0
- package/dist/components/Sidebar/components/SidebarFooter.d.ts +19 -0
- package/dist/components/Sidebar/components/SidebarGroup.d.ts +42 -0
- package/dist/components/Sidebar/components/SidebarItem.d.ts +43 -0
- package/dist/components/Sidebar/components/SidebarOverlay.d.ts +38 -0
- package/dist/components/Sidebar/components/SidebarPanel.d.ts +47 -0
- package/dist/components/Sidebar/components/SidebarTrigger.d.ts +47 -0
- package/dist/components/Sidebar/components/SidebarUser.d.ts +59 -0
- package/dist/components/Sidebar/hooks/usePresentation.d.ts +14 -0
- package/dist/components/Sidebar/hooks/useSidebar.d.ts +9 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/Sidebar/utils/state.d.ts +62 -0
- package/dist/components/Skeleton/Skeleton.d.ts +21 -5
- package/dist/components/Table/Table.d.ts +9 -49
- package/dist/components/Table/contexts/TableContext.d.ts +4 -0
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +10 -4
- package/dist/components/Tooltip/TooltipProvider.d.ts +1 -1
- package/dist/components/Tooltip/index.d.ts +0 -1
- package/dist/effects-D5CWf-Pl.js +8 -0
- package/dist/effects-D85L_7zM.cjs +1 -0
- package/dist/floating-position-5wJ5G5IT.js +48 -0
- package/dist/floating-position-Cy9xxdH4.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/tokens.d.ts +1 -0
- package/dist/useFloatingPosition-BBEUHPqy.cjs +1 -0
- package/dist/useFloatingPosition-CMirP2-2.js +43 -0
- package/dist/useFocusTrap-BrFZdMqQ.cjs +1 -0
- package/dist/useFocusTrap-DhVnlboe.js +136 -0
- package/dist/usePresence-B5RYv4e1.cjs +1 -0
- package/dist/usePresence-CqegYqy4.js +221 -0
- package/dist/useScrollLock-Drd7OZRC.js +62 -0
- package/dist/useScrollLock-Dy8MZaSn.cjs +1 -0
- package/dist/utils/aria.d.ts +9 -0
- package/dist/utils/effects.d.ts +12 -0
- package/package.json +11 -16
- package/dist/Button-D7JUO6Fs.cjs +0 -1
- package/dist/Checkbox-BvXM9VyY.js +0 -68
- package/dist/Checkbox-VQifZrZZ.cjs +0 -1
- package/dist/CheckboxGroup.cjs +0 -1
- package/dist/CheckboxGroup.js +0 -144
- package/dist/Code-BP2ZCmUf.js +0 -7446
- package/dist/Code-eispVOW3.cjs +0 -6
- package/dist/Content.cjs +0 -1
- package/dist/Content.js +0 -144
- package/dist/Icon-D8IZceys.cjs +0 -1
- package/dist/RadioGroup.cjs +0 -1
- package/dist/RadioGroup.js +0 -51
- package/dist/RadioGroupContext-BX9KnDek.cjs +0 -1
- package/dist/RadioGroupContext-DbKM4zPZ.js +0 -5
- package/dist/Table-83unQQOi.cjs +0 -1
- package/dist/Table-Cw8u-pEW.js +0 -403
- package/dist/Tooltip-BB82wNOE.cjs +0 -1
- package/dist/Tooltip-CqWK_GRD.js +0 -236
- package/dist/aria-DHnOMyYp.js +0 -10
- package/dist/aria-DKxpE8cA.cjs +0 -1
- package/dist/components/CheckboxGroup/index.d.ts +0 -2
- package/dist/components/Content/Content.d.ts +0 -60
- package/dist/components/Content/hooks/useContentLayout.d.ts +0 -18
- package/dist/components/Content/index.d.ts +0 -2
- package/dist/components/Content/utils/layout.d.ts +0 -11
- package/dist/components/RadioGroup/index.d.ts +0 -2
- package/dist/useFloatingPosition-CxzhAvy8.js +0 -73
- package/dist/useFloatingPosition-D1FqYy0l.cjs +0 -1
- package/dist/useFocusTrap--cgjy78G.cjs +0 -1
- package/dist/useFocusTrap-Da4nEash.js +0 -134
- package/dist/usePresence-DSPt6aKi.js +0 -210
- package/dist/usePresence-qe92UTvK.cjs +0 -1
- /package/dist/components/{CheckboxGroup → Checkbox}/contexts/CheckboxGroupContext.d.ts +0 -0
- /package/dist/components/{CheckboxGroup → Checkbox}/hooks/useCheckboxGroup.d.ts +0 -0
- /package/dist/components/{RadioGroup → Radio}/contexts/RadioGroupContext.d.ts +0 -0
- /package/dist/components/{RadioGroup → Radio}/hooks/useRadioGroup.d.ts +0 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as u, jsxs as U } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as q, useRef as k, useState as J, useMemo as L, useCallback as X, useEffect as $ } from "react";
|
|
4
|
+
import { a as Q } from "./reference-CXMr27nM.js";
|
|
5
|
+
import { C as V } from "./Card-CPq6dsut.js";
|
|
6
|
+
import Y from "highlight.js/lib/languages/bash";
|
|
7
|
+
import K from "highlight.js/lib/languages/c";
|
|
8
|
+
import Z from "highlight.js/lib/languages/cpp";
|
|
9
|
+
import w from "highlight.js/lib/languages/css";
|
|
10
|
+
import W from "highlight.js/lib/languages/go";
|
|
11
|
+
import ee from "highlight.js/lib/languages/javascript";
|
|
12
|
+
import ne from "highlight.js/lib/languages/json";
|
|
13
|
+
import te from "highlight.js/lib/languages/markdown";
|
|
14
|
+
import re from "highlight.js/lib/languages/python";
|
|
15
|
+
import oe from "highlight.js/lib/languages/ruby";
|
|
16
|
+
import ae from "highlight.js/lib/languages/rust";
|
|
17
|
+
import le from "highlight.js/lib/languages/sql";
|
|
18
|
+
import se from "highlight.js/lib/languages/typescript";
|
|
19
|
+
import ie from "highlight.js/lib/languages/xml";
|
|
20
|
+
import ce from "highlight.js/lib/languages/yaml";
|
|
21
|
+
import { createLowlight as me } from "lowlight";
|
|
22
|
+
const ue = me({
|
|
23
|
+
bash: Y,
|
|
24
|
+
c: K,
|
|
25
|
+
cpp: Z,
|
|
26
|
+
css: w,
|
|
27
|
+
go: W,
|
|
28
|
+
javascript: ee,
|
|
29
|
+
json: ne,
|
|
30
|
+
markdown: te,
|
|
31
|
+
python: re,
|
|
32
|
+
ruby: oe,
|
|
33
|
+
rust: ae,
|
|
34
|
+
sql: le,
|
|
35
|
+
typescript: se,
|
|
36
|
+
xml: ie,
|
|
37
|
+
yaml: ce
|
|
38
|
+
}), pe = {
|
|
39
|
+
C: "c",
|
|
40
|
+
"C++": "cpp",
|
|
41
|
+
CSS: "css",
|
|
42
|
+
Go: "go",
|
|
43
|
+
HTML: "xml",
|
|
44
|
+
JSON: "json",
|
|
45
|
+
JavaScript: "javascript",
|
|
46
|
+
Markdown: "markdown",
|
|
47
|
+
Python: "python",
|
|
48
|
+
Ruby: "ruby",
|
|
49
|
+
Rust: "rust",
|
|
50
|
+
SQL: "sql",
|
|
51
|
+
Shell: "bash",
|
|
52
|
+
TypeScript: "typescript",
|
|
53
|
+
YAML: "yaml"
|
|
54
|
+
};
|
|
55
|
+
function fe(e) {
|
|
56
|
+
const t = [[]];
|
|
57
|
+
function r(n, g) {
|
|
58
|
+
if (n.type === "text") {
|
|
59
|
+
n.value.split(`
|
|
60
|
+
`).forEach((p, h) => {
|
|
61
|
+
h > 0 && t.push([]), p && t[t.length - 1].push({
|
|
62
|
+
className: g,
|
|
63
|
+
text: p
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (n.type === "element") {
|
|
69
|
+
const i = n, p = Array.isArray(i.properties.className) ? i.properties.className.join(" ") : "", h = [g, p].filter(Boolean).join(" ") || void 0;
|
|
70
|
+
i.children.forEach((b) => {
|
|
71
|
+
r(b, h);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return e.children.forEach((n) => r(n)), t;
|
|
76
|
+
}
|
|
77
|
+
function de(e, t) {
|
|
78
|
+
try {
|
|
79
|
+
const r = ue.highlight(
|
|
80
|
+
pe[t],
|
|
81
|
+
e
|
|
82
|
+
);
|
|
83
|
+
return fe(r);
|
|
84
|
+
} catch {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const he = 2e4, ge = 1e3;
|
|
89
|
+
function Le(e) {
|
|
90
|
+
return e.replace(/\r\n?/g, `
|
|
91
|
+
`).replace(/\n$/, "");
|
|
92
|
+
}
|
|
93
|
+
function Ce(e) {
|
|
94
|
+
return e === null ? null : Number.isFinite(e) ? Math.max(0, Math.floor(e)) : 0;
|
|
95
|
+
}
|
|
96
|
+
function Ne(e) {
|
|
97
|
+
return e === null ? null : Number.isFinite(e) ? Math.max(0, Math.floor(e)) : 0;
|
|
98
|
+
}
|
|
99
|
+
function _e(e, t) {
|
|
100
|
+
if (t === null) return !1;
|
|
101
|
+
let r = 1;
|
|
102
|
+
for (let n = 0; n < e.length; n += 1)
|
|
103
|
+
if (e.charCodeAt(n) === 10 && (r += 1), r > t) return !0;
|
|
104
|
+
return r > t;
|
|
105
|
+
}
|
|
106
|
+
const qe = q(function(t, r) {
|
|
107
|
+
const {
|
|
108
|
+
"aria-label": n,
|
|
109
|
+
className: g,
|
|
110
|
+
code: i,
|
|
111
|
+
codeProps: p,
|
|
112
|
+
containerClassName: h,
|
|
113
|
+
dangerouslySetInnerHTML: b,
|
|
114
|
+
language: f,
|
|
115
|
+
maxHighlightLength: T = he,
|
|
116
|
+
maxLineCount: z = ge,
|
|
117
|
+
preProps: I,
|
|
118
|
+
title: H,
|
|
119
|
+
...R
|
|
120
|
+
} = t, {
|
|
121
|
+
className: A,
|
|
122
|
+
dangerouslySetInnerHTML: ye,
|
|
123
|
+
...P
|
|
124
|
+
} = p ?? {}, {
|
|
125
|
+
className: B,
|
|
126
|
+
dangerouslySetInnerHTML: be,
|
|
127
|
+
...F
|
|
128
|
+
} = I ?? {}, S = k(null), v = k(null), [C, G] = J(!1), l = L(() => Le(i), [i]), x = Ce(
|
|
129
|
+
T
|
|
130
|
+
), M = Ne(z), N = L(
|
|
131
|
+
() => !_e(l, M),
|
|
132
|
+
[l, M]
|
|
133
|
+
), E = N && (x === null || l.length <= x), _ = L(
|
|
134
|
+
() => N ? l.split(`
|
|
135
|
+
`) : null,
|
|
136
|
+
[N, l]
|
|
137
|
+
), y = L(
|
|
138
|
+
() => f && E ? de(l, f) : null,
|
|
139
|
+
[E, f, l]
|
|
140
|
+
), O = n ? `${n} scroll area` : "Scrollable source code", D = X(
|
|
141
|
+
(s) => {
|
|
142
|
+
Q(r, s);
|
|
143
|
+
},
|
|
144
|
+
[r]
|
|
145
|
+
);
|
|
146
|
+
return $(() => {
|
|
147
|
+
const s = v.current, d = S.current;
|
|
148
|
+
if (!s || !d) return;
|
|
149
|
+
const c = s;
|
|
150
|
+
function m() {
|
|
151
|
+
G(
|
|
152
|
+
c.scrollWidth > c.clientWidth
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
m();
|
|
156
|
+
const o = s.ownerDocument.defaultView;
|
|
157
|
+
o == null || o.addEventListener("resize", m);
|
|
158
|
+
const j = o == null ? void 0 : o.ResizeObserver, a = j ? new j(m) : void 0;
|
|
159
|
+
return a == null || a.observe(s), a == null || a.observe(d), () => {
|
|
160
|
+
o == null || o.removeEventListener("resize", m), a == null || a.disconnect();
|
|
161
|
+
};
|
|
162
|
+
}, []), /* @__PURE__ */ u(
|
|
163
|
+
V,
|
|
164
|
+
{
|
|
165
|
+
...R,
|
|
166
|
+
ref: D,
|
|
167
|
+
"aria-label": n,
|
|
168
|
+
className: ["nk-code", g].filter(Boolean).join(" "),
|
|
169
|
+
header: H || f ? { title: H ?? "", subtitle: f } : void 0,
|
|
170
|
+
spacing: "none",
|
|
171
|
+
children: /* @__PURE__ */ u(
|
|
172
|
+
"div",
|
|
173
|
+
{
|
|
174
|
+
ref: v,
|
|
175
|
+
"aria-label": C ? O : void 0,
|
|
176
|
+
className: ["nk-code__container", h].filter(Boolean).join(" "),
|
|
177
|
+
role: C ? "region" : void 0,
|
|
178
|
+
tabIndex: C ? 0 : void 0,
|
|
179
|
+
children: /* @__PURE__ */ u(
|
|
180
|
+
"pre",
|
|
181
|
+
{
|
|
182
|
+
...F,
|
|
183
|
+
className: ["nk-code__pre", B].filter(Boolean).join(" "),
|
|
184
|
+
children: /* @__PURE__ */ u(
|
|
185
|
+
"code",
|
|
186
|
+
{
|
|
187
|
+
...P,
|
|
188
|
+
ref: S,
|
|
189
|
+
className: [
|
|
190
|
+
"nk-code__content",
|
|
191
|
+
_ === null ? "nk-code__content--plain" : void 0,
|
|
192
|
+
A
|
|
193
|
+
].filter(Boolean).join(" "),
|
|
194
|
+
"data-language": f,
|
|
195
|
+
children: _ === null ? l : _.map((s, d) => {
|
|
196
|
+
const c = y == null ? void 0 : y[d];
|
|
197
|
+
return /* @__PURE__ */ U("span", { className: "nk-code__line", children: [
|
|
198
|
+
/* @__PURE__ */ u(
|
|
199
|
+
"span",
|
|
200
|
+
{
|
|
201
|
+
"aria-hidden": "true",
|
|
202
|
+
className: "nk-code__line-number",
|
|
203
|
+
children: d + 1
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
/* @__PURE__ */ u("span", { className: "nk-code__line-content", children: c != null && c.length ? c.map((m, o) => /* @__PURE__ */ u(
|
|
207
|
+
"span",
|
|
208
|
+
{
|
|
209
|
+
className: m.className,
|
|
210
|
+
children: m.text
|
|
211
|
+
},
|
|
212
|
+
o
|
|
213
|
+
)) : s || " " })
|
|
214
|
+
] }, d);
|
|
215
|
+
})
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
}
|
|
221
|
+
)
|
|
222
|
+
}
|
|
223
|
+
);
|
|
224
|
+
});
|
|
225
|
+
export {
|
|
226
|
+
qe as C
|
|
227
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";"use strict";const i=require("react/jsx-runtime"),o=require("react"),O=require("./reference-C2guRuR0.cjs"),D=require("./Card-CQ-8_1tO.cjs"),U=require("highlight.js/lib/languages/bash"),J=require("highlight.js/lib/languages/c"),X=require("highlight.js/lib/languages/cpp"),$=require("highlight.js/lib/languages/css"),Q=require("highlight.js/lib/languages/go"),V=require("highlight.js/lib/languages/javascript"),Y=require("highlight.js/lib/languages/json"),K=require("highlight.js/lib/languages/markdown"),Z=require("highlight.js/lib/languages/python"),w=require("highlight.js/lib/languages/ruby"),W=require("highlight.js/lib/languages/rust"),ee=require("highlight.js/lib/languages/sql"),ne=require("highlight.js/lib/languages/typescript"),te=require("highlight.js/lib/languages/xml"),re=require("highlight.js/lib/languages/yaml"),se=require("lowlight"),oe=se.createLowlight({bash:U,c:J,cpp:X,css:$,go:Q,javascript:V,json:Y,markdown:K,python:Z,ruby:w,rust:W,sql:ee,typescript:ne,xml:te,yaml:re}),ce={C:"c","C++":"cpp",CSS:"css",Go:"go",HTML:"xml",JSON:"json",JavaScript:"javascript",Markdown:"markdown",Python:"python",Ruby:"ruby",Rust:"rust",SQL:"sql",Shell:"bash",TypeScript:"typescript",YAML:"yaml"};function le(e){const t=[[]];function r(n,L){if(n.type==="text"){n.value.split(`
|
|
2
|
+
`).forEach((m,g)=>{g>0&&t.push([]),m&&t[t.length-1].push({className:L,text:m})});return}if(n.type==="element"){const u=n,m=Array.isArray(u.properties.className)?u.properties.className.join(" "):"",g=[L,m].filter(Boolean).join(" ")||void 0;u.children.forEach(y=>{r(y,g)})}}return e.children.forEach(n=>r(n)),t}function ae(e,t){try{const r=oe.highlight(ce[t],e);return le(r)}catch{return null}}const ie=2e4,ue=1e3;function de(e){return e.replace(/\r\n?/g,`
|
|
3
|
+
`).replace(/\n$/,"")}function he(e){return e===null?null:Number.isFinite(e)?Math.max(0,Math.floor(e)):0}function me(e){return e===null?null:Number.isFinite(e)?Math.max(0,Math.floor(e)):0}function pe(e,t){if(t===null)return!1;let r=1;for(let n=0;n<e.length;n+=1)if(e.charCodeAt(n)===10&&(r+=1),r>t)return!0;return r>t}const fe=o.forwardRef(function(t,r){const{"aria-label":n,className:L,code:u,codeProps:m,containerClassName:g,dangerouslySetInnerHTML:y,language:p,maxHighlightLength:E=ie,maxLineCount:k=ue,preProps:R,title:b,...T}=t,{className:z,dangerouslySetInnerHTML:ge,...I}=m??{},{className:A,dangerouslySetInnerHTML:Le,...P}=R??{},x=o.useRef(null),j=o.useRef(null),[C,B]=o.useState(!1),l=o.useMemo(()=>de(u),[u]),H=he(E),M=me(k),N=o.useMemo(()=>!pe(l,M),[l,M]),S=N&&(H===null||l.length<=H),_=o.useMemo(()=>N?l.split(`
|
|
4
|
+
`):null,[N,l]),q=o.useMemo(()=>p&&S?ae(l,p):null,[S,p,l]),F=n?`${n} scroll area`:"Scrollable source code",G=o.useCallback(a=>{O.assignElementReference(r,a)},[r]);return o.useEffect(()=>{const a=j.current,f=x.current;if(!a||!f)return;const d=a;function h(){B(d.scrollWidth>d.clientWidth)}h();const s=a.ownerDocument.defaultView;s==null||s.addEventListener("resize",h);const v=s==null?void 0:s.ResizeObserver,c=v?new v(h):void 0;return c==null||c.observe(a),c==null||c.observe(f),()=>{s==null||s.removeEventListener("resize",h),c==null||c.disconnect()}},[]),i.jsx(D.Card,{...T,ref:G,"aria-label":n,className:["nk-code",L].filter(Boolean).join(" "),header:b||p?{title:b??"",subtitle:p}:void 0,spacing:"none",children:i.jsx("div",{ref:j,"aria-label":C?F:void 0,className:["nk-code__container",g].filter(Boolean).join(" "),role:C?"region":void 0,tabIndex:C?0:void 0,children:i.jsx("pre",{...P,className:["nk-code__pre",A].filter(Boolean).join(" "),children:i.jsx("code",{...I,ref:x,className:["nk-code__content",_===null?"nk-code__content--plain":void 0,z].filter(Boolean).join(" "),"data-language":p,children:_===null?l:_.map((a,f)=>{const d=q==null?void 0:q[f];return i.jsxs("span",{className:"nk-code__line",children:[i.jsx("span",{"aria-hidden":"true",className:"nk-code__line-number",children:f+1}),i.jsx("span",{className:"nk-code__line-content",children:d!=null&&d.length?d.map((h,s)=>i.jsx("span",{className:h.className,children:h.text},s)):a||" "})]},f)})})})})})});exports.Code=fe;
|
package/dist/Code.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Code-
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Code-JDb4VFl7.cjs");exports.default=e.Code;
|
package/dist/Code.js
CHANGED