neatkit 0.10.0 → 0.12.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/Boundary.cjs +1 -1
- package/dist/Boundary.js +191 -120
- package/dist/{Button-CVe9T_Zw.cjs → Button-6oWs-pyF.cjs} +1 -1
- package/dist/{Button-D6rXvcqq.js → Button-B0E-M8mp.js} +1 -1
- package/dist/Button.cjs +1 -1
- package/dist/Button.js +1 -1
- package/dist/Card.cjs +1 -1
- package/dist/Card.js +75 -2
- package/dist/Checkbox.cjs +1 -1
- package/dist/Checkbox.js +2 -2
- package/dist/Code-f0GWveGp.cjs +4 -0
- package/dist/{Code-Bp2X1k-g.js → Code-pROJjsiG.js} +57 -58
- package/dist/Code.cjs +1 -1
- package/dist/Code.js +1 -1
- package/dist/Field.cjs +1 -1
- package/dist/Field.js +57 -62
- package/dist/Icon-BFaHVAoQ.cjs +1 -0
- package/dist/{Icon-CxK1wlGk.js → Icon-Cj1s40xn.js} +308 -96
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +1 -1
- package/dist/Input.cjs +1 -1
- package/dist/Input.js +2 -2
- package/dist/Markdown.cjs +1 -1
- package/dist/Markdown.js +76 -75
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +4 -4
- package/dist/PinInput.cjs +1 -1
- package/dist/PinInput.js +228 -192
- package/dist/Popover.cjs +1 -1
- package/dist/Popover.js +117 -119
- package/dist/Radio.cjs +1 -1
- package/dist/Radio.js +1 -1
- package/dist/Select.cjs +1 -1
- package/dist/Select.js +12 -11
- package/dist/Sidebar.cjs +1 -1
- package/dist/Sidebar.js +441 -309
- package/dist/Switch.cjs +1 -1
- package/dist/Switch.js +1 -1
- package/dist/{Table-DutHfiXR.js → Table-B2G8CHJ9.js} +111 -108
- package/dist/Table-Z8Q6XRkc.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-CpyROf6x.js +225 -0
- package/dist/Tooltip-DDPh_YFO.cjs +1 -0
- package/dist/Tooltip.cjs +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/aria-Bv-xVREf.js +17 -0
- package/dist/aria-DM-xYEHQ.cjs +1 -0
- package/dist/components/Boundary/hooks/useDocumentBackground.d.ts +28 -0
- package/dist/components/Card/Card.d.ts +22 -23
- package/dist/components/Card/components/CardBody.d.ts +24 -0
- package/dist/components/Card/components/CardFooter.d.ts +24 -0
- package/dist/components/Card/components/CardHeader.d.ts +24 -0
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Code/Code.d.ts +9 -7
- package/dist/components/Code/index.d.ts +1 -1
- package/dist/components/Icon/icons/AppleIcon.d.ts +11 -0
- package/dist/components/Icon/icons/BingIcon.d.ts +11 -0
- package/dist/components/Icon/icons/ChainIcon.d.ts +11 -0
- package/dist/components/Icon/icons/FacebookIcon.d.ts +11 -0
- package/dist/components/Icon/icons/GoogleIcon.d.ts +11 -0
- package/dist/components/Icon/icons/InstagramIcon.d.ts +11 -0
- package/dist/components/Icon/icons/MicrosoftIcon.d.ts +11 -0
- package/dist/components/Icon/icons/TwitterIcon.d.ts +11 -0
- package/dist/components/Icon/utils/registry.d.ts +8 -0
- package/dist/components/PinInput/PinInput.d.ts +1 -1
- package/dist/components/PinInput/hooks/usePinInput.d.ts +1 -1
- package/dist/components/Radio/Radio.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.d.ts +5 -0
- package/dist/components/Sidebar/components/SidebarFallbackTrigger.d.ts +32 -0
- package/dist/components/Sidebar/components/SidebarFooter.d.ts +5 -0
- package/dist/components/Sidebar/components/SidebarPanel.d.ts +1 -1
- package/dist/components/Sidebar/components/SidebarTrigger.d.ts +4 -0
- package/dist/components/Sidebar/hooks/useContentBelow.d.ts +23 -0
- package/dist/components/Sidebar/utils/children.d.ts +16 -0
- package/dist/components/Table/Table.d.ts +8 -2
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/effects-D98vUn6N.cjs +1 -0
- package/dist/effects-DGbA6Q2O.js +18 -0
- package/dist/style.css +1 -1
- package/dist/useFloatingPosition-DQgw-w_Z.cjs +1 -0
- package/dist/useFloatingPosition-MGoyautY.js +57 -0
- package/dist/{useFocusTrap-C0IcCdNf.js → useFocusTrap-BxPazAL6.js} +1 -1
- package/dist/{useFocusTrap-gAK_402D.cjs → useFocusTrap-CrMcAu8s.cjs} +1 -1
- package/dist/{usePresence-CqegYqy4.js → usePresence-BTRY1_l-.js} +47 -56
- package/dist/usePresence-Dm0mls5p.cjs +1 -0
- package/dist/utils/aria.d.ts +4 -5
- package/dist/utils/trigger.d.ts +46 -0
- package/package.json +1 -1
- package/dist/Card-CPq6dsut.js +0 -34
- package/dist/Card-CQ-8_1tO.cjs +0 -1
- package/dist/Code-B7s_rN0G.cjs +0 -4
- package/dist/Icon-BIBzgznI.cjs +0 -1
- package/dist/Table-BqWBgMTU.cjs +0 -1
- package/dist/Tooltip-CCuE-hfp.cjs +0 -1
- package/dist/Tooltip-CeyRKNv4.js +0 -231
- package/dist/aria-Bntn6ad_.cjs +0 -1
- package/dist/aria-CeA9QfD1.js +0 -15
- package/dist/effects-D5CWf-Pl.js +0 -8
- package/dist/effects-D85L_7zM.cjs +0 -1
- package/dist/useFloatingPosition-Dq8xpr3E.js +0 -27
- package/dist/useFloatingPosition-g5kXywoB.cjs +0 -1
- package/dist/usePresence-B5RYv4e1.cjs +0 -1
package/dist/Boundary.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react"),W=require("./effects-D98vUn6N.cjs"),v=require("./units-PzuiQNnw.cjs"),I=[{minWidth:v.breakpoint("xl"),marginPercent:32,preferredWidth:1200},{minWidth:v.breakpoint("lg"),marginPercent:20,preferredWidth:1100},{minWidth:v.breakpoint("md"),marginPercent:14,preferredWidth:v.breakpoint("md")},{minWidth:v.breakpoint("sm"),marginPercent:8,preferredWidth:650}],F=16;function L(e){for(const n of I)if(e>=n.minWidth)return n}function O(e,n){if(!Number.isFinite(e)||!Number.isFinite(n)||e<v.breakpoint("sm")||n<=0)return;const t=L(e);if(!t)return;const r=e*t.marginPercent/100,o=e-r*2,l=Math.min(t.preferredWidth,e-F),u=Math.max(o,l);let a=Math.floor(u/n);if(a%2===0&&(a-=1),!(a<3))return Math.min((a-1)*n,e)}function V(e,n){if(typeof e=="function"){e(n);return}e&&(e.current=n)}function _(){const e=new Set;let n;return{publish(t){n!==t&&(n=t,e.forEach(r=>r()))},read(){return n},subscribe(t){return e.add(t),()=>{e.delete(t)}}}}function T(e){if(e.clientWidth===0)return;const n=window.getComputedStyle(e),t=(Number.parseFloat(n.paddingLeft)||0)+(Number.parseFloat(n.paddingRight)||0);return Math.max(e.clientWidth-t,0)}function z(e){const t=window.getComputedStyle(e).getPropertyValue("--nk-cell").trim().match(/^([+]?(?:\d+\.?\d*|\.\d+))px$/i);if(!t)return;const r=Number.parseFloat(t[1]);return Number.isFinite(r)&&r>0?r:void 0}function A(e,n){const t=c.useRef(null),r=c.useRef(null),o=c.useRef(void 0),l=c.useRef(null),[u,a]=c.useState(void 0),[y,p]=c.useState(null);l.current||(l.current=_());const h=l.current,m=c.useCallback(i=>{const s=T(i);if(h.publish(s),!n||s===void 0){if(o.current===void 0)return;o.current=void 0,a(void 0);return}const g=z(i),b=g===void 0?void 0:O(s,g);o.current!==b&&(o.current=b,a(b))},[h,n]),d=c.useCallback(i=>{var g;if((g=r.current)==null||g.disconnect(),r.current=null,typeof ResizeObserver>"u")return;const s=new ResizeObserver(()=>m(i));s.observe(i),r.current=s},[m]),f=c.useCallback(i=>{var s;(s=r.current)==null||s.disconnect(),r.current=null,t.current=i,p(i),V(e,i),!(!i||typeof window>"u")&&(m(i),d(i))},[d,e,m]);return W.useIsomorphicLayoutEffect(()=>{t.current&&m(t.current)}),c.useEffect(()=>(t.current&&d(t.current),()=>{var i;(i=r.current)==null||i.disconnect(),r.current=null}),[d]),{contentWidth:u,rootElement:y,rootReference:f,width:h}}const q=1,w=new WeakMap;function S(e,n){const t=n.painters[n.painters.length-1],r=t?t():n.original,{style:o}=e;o.backgroundColor!==r.backgroundColor&&(o.backgroundColor=r.backgroundColor),o.colorScheme!==r.colorScheme&&(o.colorScheme=r.colorScheme)}function x(e,n){let t=w.get(e);if(!t){const{style:r}=e.documentElement;t={original:{backgroundColor:r.backgroundColor,colorScheme:r.colorScheme},painters:[]},w.set(e,t)}t.painters.push(n),S(e.documentElement,t)}function k(e,n){const t=w.get(e);if(!t)return;const r=t.painters.lastIndexOf(n);r!==-1&&t.painters.splice(r,1),S(e.documentElement,t),t.painters.length===0&&w.delete(e)}function C(e){const n=w.get(e);n&&S(e.documentElement,n)}function D(e){const{nested:n,rootElement:t,width:r}=e,o=c.useRef(!1);W.useIsomorphicLayoutEffect(()=>{if(!t)return;const l=t,{ownerDocument:u}=l;if(!u.defaultView)return;const a=u.defaultView;function y(){return l.clientWidth===0?!1:Math.abs(l.clientWidth-u.documentElement.clientWidth)<=q}function p(){const f=a.getComputedStyle(l);return{backgroundColor:f.backgroundColor,colorScheme:f.colorScheme}}function h(){const f=!n&&y();if(f===o.current){f&&C(u);return}f?x(u,p):k(u,p),o.current=f}h();const m=r.subscribe(h),d=typeof a.matchMedia=="function"?a.matchMedia("(prefers-color-scheme: dark)"):null;return d==null||d.addEventListener("change",h),()=>{m(),d==null||d.removeEventListener("change",h),o.current&&(k(u,p),o.current=!1)}},[n,t,r]),W.useIsomorphicLayoutEffect(()=>{!o.current||!t||C(t.ownerDocument)})}const j=c.forwardRef(function(n,t){const{as:r,children:o,className:l,style:u,theme:a="auto",accent:y,decoration:p="grid",width:h="narrow",height:m="content",spacing:d="standard",...f}=n,{contentWidth:i,rootElement:s,rootReference:g,width:b}=A(t,h==="narrow"),M=W.useBoundary();D({nested:M!==void 0,rootElement:s,width:b});const E=c.useMemo(()=>({boundaryElement:s,portalElement:s,width:b}),[s,b]),P=r??"div",R=y!==void 0?{...u,"--nk-accent":y}:u,B=i===void 0?void 0:{width:`${i}px`},N=c.createElement(P,{...f,ref:g,className:["nk-boundary",l].filter(Boolean).join(" "),"data-theme":a,"data-decoration":p,"data-width":h,"data-height":m,"data-spacing":d,style:R},c.createElement("div",{className:"nk-boundary__content",style:B},o));return c.createElement(W.BoundaryContext.Provider,{value:E},N)});exports.default=j;
|
package/dist/Boundary.js
CHANGED
|
@@ -1,176 +1,247 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { u as
|
|
4
|
-
import { b
|
|
5
|
-
const
|
|
2
|
+
import { useRef as v, useState as M, useCallback as w, useEffect as O, forwardRef as z, useMemo as L, createElement as C } from "react";
|
|
3
|
+
import { a as S, u as T, B as _ } from "./effects-DGbA6Q2O.js";
|
|
4
|
+
import { b } from "./units-BmjPCccF.js";
|
|
5
|
+
const x = [
|
|
6
6
|
{
|
|
7
|
-
minWidth:
|
|
7
|
+
minWidth: b("xl"),
|
|
8
8
|
marginPercent: 32,
|
|
9
9
|
preferredWidth: 1200
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
minWidth:
|
|
12
|
+
minWidth: b("lg"),
|
|
13
13
|
marginPercent: 20,
|
|
14
14
|
preferredWidth: 1100
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
minWidth:
|
|
17
|
+
minWidth: b("md"),
|
|
18
18
|
marginPercent: 14,
|
|
19
|
-
preferredWidth:
|
|
19
|
+
preferredWidth: b("md")
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
minWidth:
|
|
22
|
+
minWidth: b("sm"),
|
|
23
23
|
marginPercent: 8,
|
|
24
24
|
preferredWidth: 650
|
|
25
25
|
}
|
|
26
|
-
],
|
|
27
|
-
function
|
|
28
|
-
for (const
|
|
29
|
-
if (
|
|
26
|
+
], A = 16;
|
|
27
|
+
function D(e) {
|
|
28
|
+
for (const n of x)
|
|
29
|
+
if (e >= n.minWidth) return n;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
if (!Number.isFinite(
|
|
31
|
+
function $(e, n) {
|
|
32
|
+
if (!Number.isFinite(e) || !Number.isFinite(n) || e < b("sm") || n <= 0)
|
|
33
33
|
return;
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
),
|
|
40
|
-
let
|
|
41
|
-
if (
|
|
42
|
-
return Math.min((
|
|
34
|
+
const t = D(e);
|
|
35
|
+
if (!t) return;
|
|
36
|
+
const r = e * t.marginPercent / 100, o = e - r * 2, a = Math.min(
|
|
37
|
+
t.preferredWidth,
|
|
38
|
+
e - A
|
|
39
|
+
), c = Math.max(o, a);
|
|
40
|
+
let s = Math.floor(c / n);
|
|
41
|
+
if (s % 2 === 0 && (s -= 1), !(s < 3))
|
|
42
|
+
return Math.min((s - 1) * n, e);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
if (typeof
|
|
46
|
-
|
|
44
|
+
function j(e, n) {
|
|
45
|
+
if (typeof e == "function") {
|
|
46
|
+
e(n);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
e && (e.current = n);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const
|
|
53
|
-
let
|
|
51
|
+
function q() {
|
|
52
|
+
const e = /* @__PURE__ */ new Set();
|
|
53
|
+
let n;
|
|
54
54
|
return {
|
|
55
|
-
publish(
|
|
56
|
-
|
|
55
|
+
publish(t) {
|
|
56
|
+
n !== t && (n = t, e.forEach((r) => r()));
|
|
57
57
|
},
|
|
58
58
|
read() {
|
|
59
|
-
return
|
|
59
|
+
return n;
|
|
60
60
|
},
|
|
61
|
-
subscribe(
|
|
62
|
-
return
|
|
63
|
-
|
|
61
|
+
subscribe(t) {
|
|
62
|
+
return e.add(t), () => {
|
|
63
|
+
e.delete(t);
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
if (
|
|
70
|
-
const
|
|
71
|
-
return Math.max(
|
|
68
|
+
function G(e) {
|
|
69
|
+
if (e.clientWidth === 0) return;
|
|
70
|
+
const n = window.getComputedStyle(e), t = (Number.parseFloat(n.paddingLeft) || 0) + (Number.parseFloat(n.paddingRight) || 0);
|
|
71
|
+
return Math.max(e.clientWidth - t, 0);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
74
|
-
const
|
|
73
|
+
function H(e) {
|
|
74
|
+
const t = window.getComputedStyle(e).getPropertyValue("--nk-cell").trim().match(
|
|
75
75
|
/^([+]?(?:\d+\.?\d*|\.\d+))px$/i
|
|
76
76
|
);
|
|
77
|
-
if (!
|
|
78
|
-
const
|
|
79
|
-
return Number.isFinite(
|
|
77
|
+
if (!t) return;
|
|
78
|
+
const r = Number.parseFloat(t[1]);
|
|
79
|
+
return Number.isFinite(r) && r > 0 ? r : void 0;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
if (
|
|
88
|
-
|
|
81
|
+
function U(e, n) {
|
|
82
|
+
const t = v(null), r = v(null), o = v(void 0), a = v(null), [c, s] = M(void 0), [y, m] = M(null);
|
|
83
|
+
a.current || (a.current = q());
|
|
84
|
+
const f = a.current, h = w((i) => {
|
|
85
|
+
const u = G(i);
|
|
86
|
+
if (f.publish(u), !n || u === void 0) {
|
|
87
|
+
if (o.current === void 0) return;
|
|
88
|
+
o.current = void 0, s(void 0);
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
}, [
|
|
94
|
-
(
|
|
95
|
-
var
|
|
96
|
-
if ((
|
|
97
|
-
const
|
|
98
|
-
() =>
|
|
91
|
+
const p = H(i), g = p === void 0 ? void 0 : $(u, p);
|
|
92
|
+
o.current !== g && (o.current = g, s(g));
|
|
93
|
+
}, [f, n]), d = w(
|
|
94
|
+
(i) => {
|
|
95
|
+
var p;
|
|
96
|
+
if ((p = r.current) == null || p.disconnect(), r.current = null, typeof ResizeObserver > "u") return;
|
|
97
|
+
const u = new ResizeObserver(
|
|
98
|
+
() => h(i)
|
|
99
99
|
);
|
|
100
|
-
|
|
100
|
+
u.observe(i), r.current = u;
|
|
101
101
|
},
|
|
102
|
-
[
|
|
103
|
-
),
|
|
104
|
-
(
|
|
105
|
-
var
|
|
106
|
-
(
|
|
102
|
+
[h]
|
|
103
|
+
), l = w(
|
|
104
|
+
(i) => {
|
|
105
|
+
var u;
|
|
106
|
+
(u = r.current) == null || u.disconnect(), r.current = null, t.current = i, m(i), j(e, i), !(!i || typeof window > "u") && (h(i), d(i));
|
|
107
107
|
},
|
|
108
|
-
[
|
|
108
|
+
[d, e, h]
|
|
109
109
|
);
|
|
110
|
-
return
|
|
111
|
-
|
|
112
|
-
}),
|
|
113
|
-
var
|
|
114
|
-
(
|
|
115
|
-
}), [
|
|
116
|
-
contentWidth:
|
|
117
|
-
rootElement:
|
|
118
|
-
rootReference:
|
|
119
|
-
width:
|
|
110
|
+
return S(() => {
|
|
111
|
+
t.current && h(t.current);
|
|
112
|
+
}), O(() => (t.current && d(t.current), () => {
|
|
113
|
+
var i;
|
|
114
|
+
(i = r.current) == null || i.disconnect(), r.current = null;
|
|
115
|
+
}), [d]), {
|
|
116
|
+
contentWidth: c,
|
|
117
|
+
rootElement: y,
|
|
118
|
+
rootReference: l,
|
|
119
|
+
width: f
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
const
|
|
123
|
-
|
|
122
|
+
const J = 1, W = /* @__PURE__ */ new WeakMap();
|
|
123
|
+
function k(e, n) {
|
|
124
|
+
const t = n.painters[n.painters.length - 1], r = t ? t() : n.original, { style: o } = e;
|
|
125
|
+
o.backgroundColor !== r.backgroundColor && (o.backgroundColor = r.backgroundColor), o.colorScheme !== r.colorScheme && (o.colorScheme = r.colorScheme);
|
|
126
|
+
}
|
|
127
|
+
function K(e, n) {
|
|
128
|
+
let t = W.get(e);
|
|
129
|
+
if (!t) {
|
|
130
|
+
const { style: r } = e.documentElement;
|
|
131
|
+
t = {
|
|
132
|
+
original: {
|
|
133
|
+
backgroundColor: r.backgroundColor,
|
|
134
|
+
colorScheme: r.colorScheme
|
|
135
|
+
},
|
|
136
|
+
painters: []
|
|
137
|
+
}, W.set(e, t);
|
|
138
|
+
}
|
|
139
|
+
t.painters.push(n), k(e.documentElement, t);
|
|
140
|
+
}
|
|
141
|
+
function B(e, n) {
|
|
142
|
+
const t = W.get(e);
|
|
143
|
+
if (!t) return;
|
|
144
|
+
const r = t.painters.lastIndexOf(n);
|
|
145
|
+
r !== -1 && t.painters.splice(r, 1), k(e.documentElement, t), t.painters.length === 0 && W.delete(e);
|
|
146
|
+
}
|
|
147
|
+
function P(e) {
|
|
148
|
+
const n = W.get(e);
|
|
149
|
+
n && k(e.documentElement, n);
|
|
150
|
+
}
|
|
151
|
+
function Q(e) {
|
|
152
|
+
const { nested: n, rootElement: t, width: r } = e, o = v(!1);
|
|
153
|
+
S(() => {
|
|
154
|
+
if (!t) return;
|
|
155
|
+
const a = t, { ownerDocument: c } = a;
|
|
156
|
+
if (!c.defaultView) return;
|
|
157
|
+
const s = c.defaultView;
|
|
158
|
+
function y() {
|
|
159
|
+
return a.clientWidth === 0 ? !1 : Math.abs(
|
|
160
|
+
a.clientWidth - c.documentElement.clientWidth
|
|
161
|
+
) <= J;
|
|
162
|
+
}
|
|
163
|
+
function m() {
|
|
164
|
+
const l = s.getComputedStyle(a);
|
|
165
|
+
return {
|
|
166
|
+
backgroundColor: l.backgroundColor,
|
|
167
|
+
colorScheme: l.colorScheme
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function f() {
|
|
171
|
+
const l = !n && y();
|
|
172
|
+
if (l === o.current) {
|
|
173
|
+
l && P(c);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
l ? K(c, m) : B(c, m), o.current = l;
|
|
177
|
+
}
|
|
178
|
+
f();
|
|
179
|
+
const h = r.subscribe(f), d = typeof s.matchMedia == "function" ? s.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
180
|
+
return d == null || d.addEventListener("change", f), () => {
|
|
181
|
+
h(), d == null || d.removeEventListener("change", f), o.current && (B(c, m), o.current = !1);
|
|
182
|
+
};
|
|
183
|
+
}, [n, t, r]), S(() => {
|
|
184
|
+
!o.current || !t || P(t.ownerDocument);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
const ee = z(
|
|
188
|
+
function(n, t) {
|
|
124
189
|
const {
|
|
125
|
-
as:
|
|
126
|
-
children:
|
|
127
|
-
className:
|
|
128
|
-
style:
|
|
129
|
-
theme:
|
|
130
|
-
accent:
|
|
131
|
-
decoration:
|
|
132
|
-
width:
|
|
133
|
-
height:
|
|
134
|
-
spacing:
|
|
135
|
-
...
|
|
136
|
-
} =
|
|
137
|
-
contentWidth:
|
|
138
|
-
rootElement:
|
|
139
|
-
rootReference:
|
|
140
|
-
width:
|
|
141
|
-
} =
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
190
|
+
as: r,
|
|
191
|
+
children: o,
|
|
192
|
+
className: a,
|
|
193
|
+
style: c,
|
|
194
|
+
theme: s = "auto",
|
|
195
|
+
accent: y,
|
|
196
|
+
decoration: m = "grid",
|
|
197
|
+
width: f = "narrow",
|
|
198
|
+
height: h = "content",
|
|
199
|
+
spacing: d = "standard",
|
|
200
|
+
...l
|
|
201
|
+
} = n, {
|
|
202
|
+
contentWidth: i,
|
|
203
|
+
rootElement: u,
|
|
204
|
+
rootReference: p,
|
|
205
|
+
width: g
|
|
206
|
+
} = U(t, f === "narrow"), E = T();
|
|
207
|
+
Q({
|
|
208
|
+
nested: E !== void 0,
|
|
209
|
+
rootElement: u,
|
|
210
|
+
width: g
|
|
211
|
+
});
|
|
212
|
+
const N = L(() => ({
|
|
213
|
+
boundaryElement: u,
|
|
214
|
+
portalElement: u,
|
|
215
|
+
width: g
|
|
216
|
+
}), [u, g]), R = r ?? "div", F = y !== void 0 ? { ...c, "--nk-accent": y } : c, V = i === void 0 ? void 0 : { width: `${i}px` }, I = C(
|
|
217
|
+
R,
|
|
147
218
|
{
|
|
148
|
-
...
|
|
149
|
-
ref:
|
|
150
|
-
className: ["nk-boundary",
|
|
151
|
-
"data-theme":
|
|
152
|
-
"data-decoration":
|
|
153
|
-
"data-width":
|
|
154
|
-
"data-height":
|
|
155
|
-
"data-spacing":
|
|
156
|
-
style:
|
|
219
|
+
...l,
|
|
220
|
+
ref: p,
|
|
221
|
+
className: ["nk-boundary", a].filter(Boolean).join(" "),
|
|
222
|
+
"data-theme": s,
|
|
223
|
+
"data-decoration": m,
|
|
224
|
+
"data-width": f,
|
|
225
|
+
"data-height": h,
|
|
226
|
+
"data-spacing": d,
|
|
227
|
+
style: F
|
|
157
228
|
},
|
|
158
|
-
|
|
229
|
+
C(
|
|
159
230
|
"div",
|
|
160
231
|
{
|
|
161
232
|
className: "nk-boundary__content",
|
|
162
|
-
style:
|
|
233
|
+
style: V
|
|
163
234
|
},
|
|
164
|
-
|
|
235
|
+
o
|
|
165
236
|
)
|
|
166
237
|
);
|
|
167
|
-
return
|
|
168
|
-
|
|
169
|
-
{ value:
|
|
170
|
-
|
|
238
|
+
return C(
|
|
239
|
+
_.Provider,
|
|
240
|
+
{ value: N },
|
|
241
|
+
I
|
|
171
242
|
);
|
|
172
243
|
}
|
|
173
244
|
);
|
|
174
245
|
export {
|
|
175
|
-
|
|
246
|
+
ee as default
|
|
176
247
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const r=require("react/jsx-runtime"),y=require("react"),B=require("./Icon-
|
|
1
|
+
"use client";"use strict";const r=require("react/jsx-runtime"),y=require("react"),B=require("./Icon-BFaHVAoQ.cjs"),F=require("./Spinner-BE0F4y2S.cjs");function x(t){return t==null||typeof t=="boolean"||typeof t=="string"&&!t.trim()?!1:Array.isArray(t)?t.some(x):y.isValidElement(t)&&t.type===y.Fragment?x(t.props.children):!0}function K(t,l){const a=t.getBoundingClientRect(),b=l.clientX-a.left,u=l.clientY-a.top;t.style.setProperty("--nk-button-glow-x",`${b}px`),t.style.setProperty("--nk-button-glow-y",`${u}px`)}const $=y.forwardRef(function(l,a){const{as:b,children:u,className:w,disabled:I,fullWidth:A=!1,icon:s,iconAlignment:k="left",loading:h=!1,onClick:q,onKeyDown:v,onMouseMove:D,role:g,shape:R="capsule",tabIndex:P,textAlignment:E="center",tone:M,variant:N="primary",...c}=l,i=b??"button",o=I||h,S=!!s&&!x(u),d=i==="a"&&"href"in c&&typeof c.href=="string",f=typeof i=="string"&&i!=="button"&&!d,_=e=>{if(o){e.preventDefault(),e.stopPropagation();return}const n=q;n==null||n(e)},T=e=>{K(e.currentTarget,e);const n=D;n==null||n(e)},z=e=>{const n=v;n==null||n(e),!(e.defaultPrevented||o||!f||e.key!=="Enter"&&e.key!==" ")&&(e.preventDefault(),e.currentTarget.click())},j={"aria-disabled":o||void 0};i==="button"&&(j.type=c.type??"button");const C=d&&o?{href:void 0}:void 0;let m=g;d&&o?m=g??"link":f&&(m=g??"button");let p=P;return i!=="button"&&(d&&o?p=void 0:o?p=-1:f&&(p=P??0)),y.createElement(i,{...c,...j,...C,ref:a,"aria-busy":h||void 0,className:["nk-button",w].filter(Boolean).join(" "),"data-full-width":A||void 0,"data-icon-only":S||void 0,"data-shape":R,"data-tone":M,"data-variant":N,onClick:_,onKeyDown:f?z:v,onMouseMove:T,role:m,tabIndex:p},r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"nk-button__content",style:{justifyContent:E},children:[s&&k==="left"?r.jsx(B.Icon,{type:s}):null,u,s&&k==="right"?r.jsx(B.Icon,{type:s}):null]}),h?r.jsx(F.Spinner,{"aria-hidden":"true","aria-label":void 0,className:"nk-button__spinner",role:void 0,size:16}):null]}))});exports.Button=$;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as B, Fragment as C, jsx as g } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef as K, createElement as q, isValidElement as G, Fragment as O } from "react";
|
|
4
|
-
import { I as w } from "./Icon-
|
|
4
|
+
import { I as w } from "./Icon-Cj1s40xn.js";
|
|
5
5
|
import { S as V } from "./Spinner-CmxlDlOk.js";
|
|
6
6
|
function h(t) {
|
|
7
7
|
return t == null || typeof t == "boolean" || typeof t == "string" && !t.trim() ? !1 : Array.isArray(t) ? t.some(h) : G(t) && t.type === O ? h(t.props.children) : !0;
|
package/dist/Button.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Button-
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Button-6oWs-pyF.cjs");exports.default=e.Button;
|
package/dist/Button.js
CHANGED
package/dist/Card.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),d=require("react"),i=require("./Surface-BttJYSDt.cjs"),l=d.forwardRef(function(e,r){const{children:a,className:n,spacing:o="standard",...s}=e;return t.jsx("div",{...s,ref:r,className:["nk-card__body",n].filter(Boolean).join(" "),"data-spacing":o,children:a})}),f=d.forwardRef(function(e,r){const{children:a,className:n,spacing:o="standard",...s}=e;return t.jsx("div",{...s,ref:r,className:["nk-card__footer",n].filter(Boolean).join(" "),"data-spacing":o,children:a})}),u=d.forwardRef(function(e,r){const{children:a,className:n,spacing:o="standard",...s}=e;return t.jsx("div",{...s,ref:r,className:["nk-card__header",n].filter(Boolean).join(" "),"data-spacing":o,children:a})}),m=d.forwardRef(function(e,r){const{children:a,className:n,...o}=e;return t.jsx(i.Surface,{...o,ref:r,className:["nk-card",n].filter(Boolean).join(" "),children:a})}),j=Object.assign(m,{Body:l,Footer:f,Header:u});exports.default=j;
|
package/dist/Card.js
CHANGED
|
@@ -1,4 +1,77 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { S as i } from "./Surface-vEFsZC12.js";
|
|
4
|
+
const l = d(function(a, r) {
|
|
5
|
+
const {
|
|
6
|
+
children: e,
|
|
7
|
+
className: o,
|
|
8
|
+
spacing: n = "standard",
|
|
9
|
+
...s
|
|
10
|
+
} = a;
|
|
11
|
+
return /* @__PURE__ */ t(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
...s,
|
|
15
|
+
ref: r,
|
|
16
|
+
className: ["nk-card__body", o].filter(Boolean).join(" "),
|
|
17
|
+
"data-spacing": n,
|
|
18
|
+
children: e
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}), f = d(
|
|
22
|
+
function(a, r) {
|
|
23
|
+
const {
|
|
24
|
+
children: e,
|
|
25
|
+
className: o,
|
|
26
|
+
spacing: n = "standard",
|
|
27
|
+
...s
|
|
28
|
+
} = a;
|
|
29
|
+
return /* @__PURE__ */ t(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
...s,
|
|
33
|
+
ref: r,
|
|
34
|
+
className: ["nk-card__footer", o].filter(Boolean).join(" "),
|
|
35
|
+
"data-spacing": n,
|
|
36
|
+
children: e
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
), m = d(
|
|
41
|
+
function(a, r) {
|
|
42
|
+
const {
|
|
43
|
+
children: e,
|
|
44
|
+
className: o,
|
|
45
|
+
spacing: n = "standard",
|
|
46
|
+
...s
|
|
47
|
+
} = a;
|
|
48
|
+
return /* @__PURE__ */ t(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
...s,
|
|
52
|
+
ref: r,
|
|
53
|
+
className: ["nk-card__header", o].filter(Boolean).join(" "),
|
|
54
|
+
"data-spacing": n,
|
|
55
|
+
children: e
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
), p = d(function(a, r) {
|
|
60
|
+
const { children: e, className: o, ...n } = a;
|
|
61
|
+
return /* @__PURE__ */ t(
|
|
62
|
+
i,
|
|
63
|
+
{
|
|
64
|
+
...n,
|
|
65
|
+
ref: r,
|
|
66
|
+
className: ["nk-card", o].filter(Boolean).join(" "),
|
|
67
|
+
children: e
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}), g = Object.assign(p, {
|
|
71
|
+
Body: l,
|
|
72
|
+
Footer: f,
|
|
73
|
+
Header: m
|
|
74
|
+
});
|
|
2
75
|
export {
|
|
3
|
-
|
|
76
|
+
g as default
|
|
4
77
|
};
|
package/dist/Checkbox.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),i=require("react"),I=require("./aria-
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),i=require("react"),I=require("./aria-DM-xYEHQ.cjs"),Q=require("./reference-C2guRuR0.cjs"),W=require("./field-control-NfLwcPj6.cjs"),Z=require("./Icon-BFaHVAoQ.cjs"),$=require("./Text-DWYlIcPj.cjs"),T=Symbol("nk-checkbox-option");function ee(a){Object.assign(a,{[T]:!0})}function F(a){if(typeof a!="function"&&typeof a!="object"||a===null)return!1;const o=a;return o[T]?!0:o.type!==void 0&&o.type!==a?F(o.type):!1}const z=i.createContext(void 0),ne=Object.freeze([]);function K(a,o){i.Children.forEach(a,t=>{if(t==null||typeof t=="boolean")return;if(!i.isValidElement(t))throw new Error("Checkbox.Group children must be direct Checkbox elements or fragments");if(t.type===i.Fragment){K(t.props.children,o);return}if(!F(t.type))throw new Error("Checkbox.Group children must be direct Checkbox elements or fragments");const r=t;o.push({disabled:!!r.props.disabled,required:!!r.props.required,value:String(r.props.value??"on")})})}function te(a){const o=[];K(a,o);const t=new Set;return o.forEach(r=>{if(t.has(r.value))throw new Error("Checkbox.Group Checkbox values must be unique");t.add(r.value)}),o}function oe(a,o,t){o.current=a,Q.assignElementReference(t,a)}const U=i.forwardRef(function(o,t){const{"aria-invalid":r,children:u,className:E,defaultValue:s=ne,disabled:d=!1,invalid:S=!1,name:j,onChange:v,orientation:k="vertical",required:f=!1,value:x,...g}=o,p=i.useRef(null),[e,h]=i.useState(s),c=x!==void 0,O=c?x:e,N=S||I.hasInvalidState(r),_=te(u),y=d?[]:_.filter(n=>!n.disabled).map(n=>n.value),m=new Set(y),C=O.some(n=>m.has(n)),V=y[0],w=_.find(n=>!n.disabled&&n.value===V),B=s.some(n=>m.has(n)),P=!!(w!=null&&w.required),D=i.useCallback(n=>oe(n,p,t),[t]);i.useEffect(()=>{var G;if(c)return;const n=(G=p.current)==null?void 0:G.querySelector('input[type="checkbox"]'),b=n instanceof HTMLInputElement?n.form:null;if(!b)return;const R=b.getRootNode();function q(A){var L;if(A.target!==b||A.defaultPrevented)return;const H=Array.from(((L=p.current)==null?void 0:L.querySelectorAll('input[type="checkbox"]'))??[]).find(M=>!M.disabled&&M.value===V);H&&(H.required=!!(P||f&&!B)),h(s)}return R.addEventListener("reset",q),()=>R.removeEventListener("reset",q)},[u,s,B,c,f,P,V]);function Y(n){if(!c){const b=n.currentTarget.value,R=n.currentTarget.checked;h(q=>R?[...new Set([...q,b])]:q.filter(G=>G!==b))}v==null||v(n)}const J={defaultValue:s,disabled:d,handleChange:Y,hasSelection:C,name:j,required:f,value:x,validationValue:V};return l.jsx(z.Provider,{value:J,children:l.jsx("div",{...g,ref:D,"aria-disabled":d||void 0,"aria-invalid":I.resolveAriaInvalid(S,r),className:["nk-checkbox-group",E].filter(Boolean).join(" "),"data-disabled":d||void 0,"data-invalid":N||void 0,"data-orientation":k,role:"group",children:u})})});W.markFieldGroupControl(U,"label");function ae(){return i.useContext(z)}const X=i.forwardRef(function(o,t){var m;const{"aria-invalid":r,checked:u,children:E,className:s,defaultChecked:d,disabled:S=!1,invalid:j=!1,name:v,onChange:k,required:f=!1,style:x,value:g="on",...p}=o,e=ae(),h=String(g),c=(e==null?void 0:e.value)!==void 0,O=S||!!(e!=null&&e.disabled),N=!!(e!=null&&e.required&&!e.hasSelection&&e.validationValue===h),_=j||I.hasInvalidState(r);function y(C){k==null||k(C),C.defaultPrevented||e==null||e.handleChange(C)}return l.jsxs("label",{className:["nk-checkbox",s].filter(Boolean).join(" "),"data-disabled":O||void 0,"data-invalid":_||void 0,style:x,children:[l.jsx("input",{...p,ref:t,"aria-invalid":I.resolveAriaInvalid(j,r),checked:e?c?(m=e.value)==null?void 0:m.includes(h):void 0:u,className:"nk-checkbox__control",defaultChecked:e&&!c?e.defaultValue.includes(h):d,disabled:O,name:(e==null?void 0:e.name)??v,onChange:y,required:f||N,type:"checkbox",value:g}),l.jsx("span",{"aria-hidden":"true",className:"nk-checkbox__visual",children:l.jsx(Z.Icon,{className:"nk-checkbox__icon",size:12,type:"checkmark"})}),E!==void 0?l.jsxs($.Text,{as:"span",className:"nk-checkbox__label",children:[E,f?l.jsx("span",{"aria-hidden":"true",className:"nk-checkbox__required",children:"*"}):null]}):null]})});ee(X);const re=Object.assign(X,{Group:U});exports.default=re;
|
package/dist/Checkbox.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as h, jsxs as L } from "react/jsx-runtime";
|
|
3
3
|
import { createContext as Z, forwardRef as F, useRef as $, useState as ee, useCallback as ne, useEffect as oe, Children as te, isValidElement as ae, Fragment as re, useContext as ie } from "react";
|
|
4
|
-
import { r as T, h as z } from "./aria-
|
|
4
|
+
import { r as T, h as z } from "./aria-Bv-xVREf.js";
|
|
5
5
|
import { a as le } from "./reference-CXMr27nM.js";
|
|
6
6
|
import { m as se } from "./field-control-XAn_FKks.js";
|
|
7
|
-
import { I as ce } from "./Icon-
|
|
7
|
+
import { I as ce } from "./Icon-Cj1s40xn.js";
|
|
8
8
|
import { T as de } from "./Text-rN6iDo0V.js";
|
|
9
9
|
const K = Symbol("nk-checkbox-option");
|
|
10
10
|
function ue(a) {
|
|
@@ -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("./Surface-BttJYSDt.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"),re=require("highlight.js/lib/languages/xml"),te=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:re,yaml:te}),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 ae(e){const r=[[]];function t(n,g){if(n.type==="text"){n.value.split(`
|
|
2
|
+
`).forEach((m,p)=>{p>0&&r.push([]),m&&r[r.length-1].push({className:g,text:m})});return}if(n.type==="element"){const u=n,m=Array.isArray(u.properties.className)?u.properties.className.join(" "):"",p=[g,m].filter(Boolean).join(" ")||void 0;u.children.forEach(y=>{t(y,p)})}}return e.children.forEach(n=>t(n)),r}function le(e,r){try{const t=oe.highlight(ce[r],e);return ae(t)}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 fe(e,r){if(r===null)return!1;let t=1;for(let n=0;n<e.length;n+=1)if(e.charCodeAt(n)===10&&(t+=1),t>r)return!0;return t>r}const pe=o.forwardRef(function(r,t){const{"aria-label":n,className:g,code:u,codeProps:m,containerClassName:p,dangerouslySetInnerHTML:y,frame:v="outline",language:L,maxHighlightLength:E=ie,maxLineCount:k=ue,preProps:R,...T}=r,{className:z,dangerouslySetInnerHTML:ge,...I}=m??{},{className:A,dangerouslySetInnerHTML:Le,...P}=R??{},b=o.useRef(null),x=o.useRef(null),[N,B]=o.useState(!1),a=o.useMemo(()=>de(u),[u]),S=he(E),j=me(k),C=o.useMemo(()=>!fe(a,j),[a,j]),H=C&&(S===null||a.length<=S),_=o.useMemo(()=>C?a.split(`
|
|
4
|
+
`):null,[C,a]),q=o.useMemo(()=>!L||!H?null:le(a,L),[H,L,a]),F=n?`${n} scroll area`:"Scrollable source code",G=o.useCallback(l=>{O.assignElementReference(t,l)},[t]);return o.useEffect(()=>{const l=x.current,f=b.current;if(!l||!f)return;const d=l;function h(){B(d.scrollWidth>d.clientWidth)}h();const s=l.ownerDocument.defaultView;s==null||s.addEventListener("resize",h);const M=s==null?void 0:s.ResizeObserver,c=M?new M(h):void 0;return c==null||c.observe(l),c==null||c.observe(f),()=>{s==null||s.removeEventListener("resize",h),c==null||c.disconnect()}},[]),i.jsx(D.Surface,{...T,ref:G,"aria-label":n,className:["nk-code",g].filter(Boolean).join(" "),"data-frame":v,children:i.jsx("div",{ref:x,"aria-label":N?F:void 0,className:["nk-code__container",p].filter(Boolean).join(" "),role:N?"region":void 0,tabIndex:N?0:void 0,children:i.jsx("pre",{...P,className:["nk-code__pre",A].filter(Boolean).join(" "),children:i.jsx("code",{...I,ref:b,className:["nk-code__content",_===null?"nk-code__content--plain":void 0,z].filter(Boolean).join(" "),"data-language":L,children:_===null?a:_.map((l,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)):l||" "})]},f)})})})})})});exports.Code=pe;
|