neatkit 0.11.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/{Button-DtrX4X-s.cjs → Button-6oWs-pyF.cjs} +1 -1
- package/dist/{Button-LmEHdRkW.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 +1 -1
- 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/Icon-BFaHVAoQ.cjs +1 -0
- package/dist/{Icon-NT3kRJYz.js → Icon-Cj1s40xn.js} +122 -91
- package/dist/Icon.cjs +1 -1
- package/dist/Icon.js +1 -1
- package/dist/Input.cjs +1 -1
- package/dist/Input.js +1 -1
- package/dist/Markdown.cjs +1 -1
- package/dist/Markdown.js +76 -75
- package/dist/Modal.cjs +1 -1
- package/dist/Modal.js +1 -1
- package/dist/PinInput.cjs +1 -1
- package/dist/PinInput.js +228 -192
- package/dist/Select.cjs +1 -1
- package/dist/Select.js +1 -1
- package/dist/Sidebar.cjs +1 -1
- package/dist/Sidebar.js +427 -344
- package/dist/{Table-GeoE4h-u.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/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/ChainIcon.d.ts +11 -0
- package/dist/components/Icon/utils/registry.d.ts +1 -0
- package/dist/components/PinInput/hooks/usePinInput.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.d.ts +5 -0
- package/dist/components/Sidebar/components/SidebarFooter.d.ts +5 -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/style.css +1 -1
- 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-CMSHMSDJ.cjs +0 -1
- package/dist/Table-Bjw9lUKS.cjs +0 -1
package/dist/Markdown.js
CHANGED
|
@@ -7,9 +7,9 @@ import Q, { defaultSchema as P } from "rehype-sanitize";
|
|
|
7
7
|
import Z from "rehype-slug";
|
|
8
8
|
import ee from "remark-gfm";
|
|
9
9
|
import { A as ne } from "./Alert-DQ5CCE0N.js";
|
|
10
|
-
import { C as re } from "./Code-
|
|
10
|
+
import { C as re } from "./Code-pROJjsiG.js";
|
|
11
11
|
import { D as te } from "./Divider-DZgpYpr-.js";
|
|
12
|
-
import { T as _ } from "./Table-
|
|
12
|
+
import { T as _ } from "./Table-B2G8CHJ9.js";
|
|
13
13
|
import { T as k } from "./Text-rN6iDo0V.js";
|
|
14
14
|
const oe = {
|
|
15
15
|
bash: "Shell",
|
|
@@ -149,7 +149,7 @@ function E(e, o, a) {
|
|
|
149
149
|
if (f ? n = new URL(e) : t && (n = new URL(e, t)), !n || n.protocol !== "http:" && n.protocol !== "https:" || n.username || n.password)
|
|
150
150
|
return;
|
|
151
151
|
const r = n.href;
|
|
152
|
-
return i.some((
|
|
152
|
+
return i.some((c) => ae(r, c)) ? r : void 0;
|
|
153
153
|
} catch {
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
@@ -160,12 +160,12 @@ function C(e, o, a) {
|
|
|
160
160
|
const t = i.trim().split(/\s+/), [n, r] = t, d = r === void 0 || /^(?:\d+w|(?:\d+(?:\.\d+)?|\.\d+)x)$/.test(r);
|
|
161
161
|
if (t.length > 2 || !d || n === void 0 || n.length === 0)
|
|
162
162
|
return null;
|
|
163
|
-
const
|
|
163
|
+
const c = E(
|
|
164
164
|
n,
|
|
165
165
|
o,
|
|
166
166
|
a
|
|
167
167
|
);
|
|
168
|
-
return
|
|
168
|
+
return c ? `${c}${r ? ` ${r}` : ""}` : null;
|
|
169
169
|
});
|
|
170
170
|
if (!m.some((i) => i === null))
|
|
171
171
|
return m.join(", ");
|
|
@@ -230,7 +230,7 @@ function me(e, o, a, f, m) {
|
|
|
230
230
|
children: n,
|
|
231
231
|
className: r,
|
|
232
232
|
dangerouslySetInnerHTML: d,
|
|
233
|
-
node:
|
|
233
|
+
node: c,
|
|
234
234
|
...s
|
|
235
235
|
} = t;
|
|
236
236
|
return /* @__PURE__ */ u(
|
|
@@ -248,16 +248,16 @@ function me(e, o, a, f, m) {
|
|
|
248
248
|
children: n,
|
|
249
249
|
dangerouslySetInnerHTML: r,
|
|
250
250
|
node: d,
|
|
251
|
-
...
|
|
251
|
+
...c
|
|
252
252
|
} = t;
|
|
253
|
-
return /* @__PURE__ */ u("blockquote", { ...
|
|
253
|
+
return /* @__PURE__ */ u("blockquote", { ...c, className: "nk-markdown__blockquote", children: n });
|
|
254
254
|
},
|
|
255
255
|
code: function(t) {
|
|
256
256
|
const {
|
|
257
257
|
children: n,
|
|
258
258
|
className: r,
|
|
259
259
|
dangerouslySetInnerHTML: d,
|
|
260
|
-
node:
|
|
260
|
+
node: c,
|
|
261
261
|
...s
|
|
262
262
|
} = t;
|
|
263
263
|
return /* @__PURE__ */ u(
|
|
@@ -274,14 +274,14 @@ function me(e, o, a, f, m) {
|
|
|
274
274
|
children: n,
|
|
275
275
|
className: r,
|
|
276
276
|
dangerouslySetInnerHTML: d,
|
|
277
|
-
node:
|
|
277
|
+
node: c,
|
|
278
278
|
ref: s,
|
|
279
|
-
...
|
|
279
|
+
...l
|
|
280
280
|
} = t;
|
|
281
281
|
return /* @__PURE__ */ u(
|
|
282
282
|
k,
|
|
283
283
|
{
|
|
284
|
-
...
|
|
284
|
+
...l,
|
|
285
285
|
as: "h1",
|
|
286
286
|
className: ["nk-markdown__heading", r].filter(Boolean).join(" "),
|
|
287
287
|
size: "heading",
|
|
@@ -295,14 +295,14 @@ function me(e, o, a, f, m) {
|
|
|
295
295
|
children: n,
|
|
296
296
|
className: r,
|
|
297
297
|
dangerouslySetInnerHTML: d,
|
|
298
|
-
node:
|
|
298
|
+
node: c,
|
|
299
299
|
ref: s,
|
|
300
|
-
...
|
|
300
|
+
...l
|
|
301
301
|
} = t;
|
|
302
302
|
return /* @__PURE__ */ u(
|
|
303
303
|
k,
|
|
304
304
|
{
|
|
305
|
-
...
|
|
305
|
+
...l,
|
|
306
306
|
as: "h2",
|
|
307
307
|
className: [
|
|
308
308
|
"nk-markdown__heading",
|
|
@@ -319,14 +319,14 @@ function me(e, o, a, f, m) {
|
|
|
319
319
|
children: n,
|
|
320
320
|
className: r,
|
|
321
321
|
dangerouslySetInnerHTML: d,
|
|
322
|
-
node:
|
|
322
|
+
node: c,
|
|
323
323
|
ref: s,
|
|
324
|
-
...
|
|
324
|
+
...l
|
|
325
325
|
} = t;
|
|
326
326
|
return /* @__PURE__ */ u(
|
|
327
327
|
k,
|
|
328
328
|
{
|
|
329
|
-
...
|
|
329
|
+
...l,
|
|
330
330
|
as: "h3",
|
|
331
331
|
className: ["nk-markdown__heading", r].filter(Boolean).join(" "),
|
|
332
332
|
size: "subtitle",
|
|
@@ -340,14 +340,14 @@ function me(e, o, a, f, m) {
|
|
|
340
340
|
children: n,
|
|
341
341
|
className: r,
|
|
342
342
|
dangerouslySetInnerHTML: d,
|
|
343
|
-
node:
|
|
343
|
+
node: c,
|
|
344
344
|
ref: s,
|
|
345
|
-
...
|
|
345
|
+
...l
|
|
346
346
|
} = t;
|
|
347
347
|
return /* @__PURE__ */ u(
|
|
348
348
|
k,
|
|
349
349
|
{
|
|
350
|
-
...
|
|
350
|
+
...l,
|
|
351
351
|
as: "h4",
|
|
352
352
|
className: ["nk-markdown__heading", r].filter(Boolean).join(" "),
|
|
353
353
|
weight: "semibold",
|
|
@@ -360,14 +360,14 @@ function me(e, o, a, f, m) {
|
|
|
360
360
|
children: n,
|
|
361
361
|
className: r,
|
|
362
362
|
dangerouslySetInnerHTML: d,
|
|
363
|
-
node:
|
|
363
|
+
node: c,
|
|
364
364
|
ref: s,
|
|
365
|
-
...
|
|
365
|
+
...l
|
|
366
366
|
} = t;
|
|
367
367
|
return /* @__PURE__ */ u(
|
|
368
368
|
k,
|
|
369
369
|
{
|
|
370
|
-
...
|
|
370
|
+
...l,
|
|
371
371
|
as: "h5",
|
|
372
372
|
className: ["nk-markdown__heading", r].filter(Boolean).join(" "),
|
|
373
373
|
weight: "semibold",
|
|
@@ -380,14 +380,14 @@ function me(e, o, a, f, m) {
|
|
|
380
380
|
children: n,
|
|
381
381
|
className: r,
|
|
382
382
|
dangerouslySetInnerHTML: d,
|
|
383
|
-
node:
|
|
383
|
+
node: c,
|
|
384
384
|
ref: s,
|
|
385
|
-
...
|
|
385
|
+
...l
|
|
386
386
|
} = t;
|
|
387
387
|
return /* @__PURE__ */ u(
|
|
388
388
|
k,
|
|
389
389
|
{
|
|
390
|
-
...
|
|
390
|
+
...l,
|
|
391
391
|
as: "h6",
|
|
392
392
|
className: ["nk-markdown__heading", r].filter(Boolean).join(" "),
|
|
393
393
|
weight: "medium",
|
|
@@ -408,16 +408,16 @@ function me(e, o, a, f, m) {
|
|
|
408
408
|
alt: n,
|
|
409
409
|
className: r,
|
|
410
410
|
dangerouslySetInnerHTML: d,
|
|
411
|
-
node:
|
|
411
|
+
node: c,
|
|
412
412
|
src: s,
|
|
413
|
-
srcSet:
|
|
413
|
+
srcSet: l,
|
|
414
414
|
...M
|
|
415
415
|
} = t, b = E(
|
|
416
416
|
typeof s == "string" ? s : "",
|
|
417
417
|
e,
|
|
418
418
|
o
|
|
419
419
|
), L = C(
|
|
420
|
-
|
|
420
|
+
l,
|
|
421
421
|
e,
|
|
422
422
|
o
|
|
423
423
|
);
|
|
@@ -439,7 +439,7 @@ function me(e, o, a, f, m) {
|
|
|
439
439
|
checked: n,
|
|
440
440
|
className: r,
|
|
441
441
|
dangerouslySetInnerHTML: d,
|
|
442
|
-
node:
|
|
442
|
+
node: c,
|
|
443
443
|
...s
|
|
444
444
|
} = t;
|
|
445
445
|
return /* @__PURE__ */ W(q, { children: [
|
|
@@ -467,16 +467,16 @@ function me(e, o, a, f, m) {
|
|
|
467
467
|
children: n,
|
|
468
468
|
className: r,
|
|
469
469
|
dangerouslySetInnerHTML: d,
|
|
470
|
-
node:
|
|
470
|
+
node: c,
|
|
471
471
|
...s
|
|
472
|
-
} = t,
|
|
472
|
+
} = t, l = (r == null ? void 0 : r.split(/\s+/).includes("task-list-item")) ?? !1;
|
|
473
473
|
return /* @__PURE__ */ u(
|
|
474
474
|
"li",
|
|
475
475
|
{
|
|
476
476
|
...s,
|
|
477
477
|
className: [
|
|
478
478
|
"nk-markdown__list-item",
|
|
479
|
-
|
|
479
|
+
l ? "nk-markdown__list-item--task" : void 0
|
|
480
480
|
].filter(Boolean).join(" "),
|
|
481
481
|
children: n
|
|
482
482
|
}
|
|
@@ -487,9 +487,9 @@ function me(e, o, a, f, m) {
|
|
|
487
487
|
children: n,
|
|
488
488
|
className: r,
|
|
489
489
|
dangerouslySetInnerHTML: d,
|
|
490
|
-
node:
|
|
490
|
+
node: c,
|
|
491
491
|
...s
|
|
492
|
-
} = t,
|
|
492
|
+
} = t, l = (r == null ? void 0 : r.split(/\s+/).includes("contains-task-list")) ?? !1;
|
|
493
493
|
return /* @__PURE__ */ u(
|
|
494
494
|
"ol",
|
|
495
495
|
{
|
|
@@ -497,7 +497,7 @@ function me(e, o, a, f, m) {
|
|
|
497
497
|
className: [
|
|
498
498
|
"nk-markdown__list",
|
|
499
499
|
"nk-markdown__list--ordered",
|
|
500
|
-
|
|
500
|
+
l ? "nk-markdown__list--tasks" : void 0
|
|
501
501
|
].filter(Boolean).join(" "),
|
|
502
502
|
children: n
|
|
503
503
|
}
|
|
@@ -508,14 +508,14 @@ function me(e, o, a, f, m) {
|
|
|
508
508
|
children: n,
|
|
509
509
|
className: r,
|
|
510
510
|
dangerouslySetInnerHTML: d,
|
|
511
|
-
node:
|
|
511
|
+
node: c,
|
|
512
512
|
ref: s,
|
|
513
|
-
...
|
|
513
|
+
...l
|
|
514
514
|
} = t;
|
|
515
515
|
return /* @__PURE__ */ u(
|
|
516
516
|
k,
|
|
517
517
|
{
|
|
518
|
-
...
|
|
518
|
+
...l,
|
|
519
519
|
className: ["nk-markdown__paragraph", r].filter(Boolean).join(" "),
|
|
520
520
|
children: n
|
|
521
521
|
}
|
|
@@ -526,7 +526,7 @@ function me(e, o, a, f, m) {
|
|
|
526
526
|
children: n,
|
|
527
527
|
className: r,
|
|
528
528
|
dangerouslySetInnerHTML: d,
|
|
529
|
-
node:
|
|
529
|
+
node: c,
|
|
530
530
|
...s
|
|
531
531
|
} = t;
|
|
532
532
|
return /* @__PURE__ */ u(
|
|
@@ -543,15 +543,15 @@ function me(e, o, a, f, m) {
|
|
|
543
543
|
children: n,
|
|
544
544
|
dangerouslySetInnerHTML: r,
|
|
545
545
|
node: d,
|
|
546
|
-
ref:
|
|
546
|
+
ref: c,
|
|
547
547
|
...s
|
|
548
|
-
} = t,
|
|
549
|
-
return
|
|
548
|
+
} = t, l = ue(d);
|
|
549
|
+
return l ? /* @__PURE__ */ u(
|
|
550
550
|
re,
|
|
551
551
|
{
|
|
552
|
-
code:
|
|
553
|
-
codeProps:
|
|
554
|
-
language: ie(
|
|
552
|
+
code: l.content,
|
|
553
|
+
codeProps: l.codeProps,
|
|
554
|
+
language: ie(l.codeProps.className),
|
|
555
555
|
maxHighlightLength: a,
|
|
556
556
|
maxLineCount: f,
|
|
557
557
|
preProps: s
|
|
@@ -563,18 +563,18 @@ function me(e, o, a, f, m) {
|
|
|
563
563
|
children: n,
|
|
564
564
|
dangerouslySetInnerHTML: r,
|
|
565
565
|
node: d,
|
|
566
|
-
srcSet:
|
|
566
|
+
srcSet: c,
|
|
567
567
|
...s
|
|
568
|
-
} = t,
|
|
569
|
-
|
|
568
|
+
} = t, l = C(
|
|
569
|
+
c,
|
|
570
570
|
e,
|
|
571
571
|
o
|
|
572
572
|
);
|
|
573
|
-
return
|
|
573
|
+
return l ? /* @__PURE__ */ u(
|
|
574
574
|
"source",
|
|
575
575
|
{
|
|
576
576
|
...s,
|
|
577
|
-
srcSet:
|
|
577
|
+
srcSet: l
|
|
578
578
|
}
|
|
579
579
|
) : null;
|
|
580
580
|
},
|
|
@@ -582,33 +582,34 @@ function me(e, o, a, f, m) {
|
|
|
582
582
|
const {
|
|
583
583
|
children: n,
|
|
584
584
|
dangerouslySetInnerHTML: r,
|
|
585
|
-
|
|
586
|
-
|
|
585
|
+
frame: d,
|
|
586
|
+
node: c,
|
|
587
|
+
...s
|
|
587
588
|
} = t;
|
|
588
|
-
return /* @__PURE__ */ u(_, { ...
|
|
589
|
+
return /* @__PURE__ */ u(_, { ...s, children: n });
|
|
589
590
|
},
|
|
590
591
|
tbody: function(t) {
|
|
591
592
|
const {
|
|
592
593
|
children: n,
|
|
593
594
|
dangerouslySetInnerHTML: r,
|
|
594
595
|
node: d,
|
|
595
|
-
...
|
|
596
|
+
...c
|
|
596
597
|
} = t;
|
|
597
|
-
return /* @__PURE__ */ u(_.Body, { ...
|
|
598
|
+
return /* @__PURE__ */ u(_.Body, { ...c, children: n });
|
|
598
599
|
},
|
|
599
600
|
td: function(t) {
|
|
600
601
|
const {
|
|
601
602
|
align: n,
|
|
602
603
|
children: r,
|
|
603
604
|
dangerouslySetInnerHTML: d,
|
|
604
|
-
node:
|
|
605
|
+
node: c,
|
|
605
606
|
style: s,
|
|
606
|
-
...
|
|
607
|
+
...l
|
|
607
608
|
} = t;
|
|
608
609
|
return /* @__PURE__ */ u(
|
|
609
610
|
_.Cell,
|
|
610
611
|
{
|
|
611
|
-
...
|
|
612
|
+
...l,
|
|
612
613
|
align: A((s == null ? void 0 : s.textAlign) ?? n),
|
|
613
614
|
children: r
|
|
614
615
|
}
|
|
@@ -619,14 +620,14 @@ function me(e, o, a, f, m) {
|
|
|
619
620
|
align: n,
|
|
620
621
|
children: r,
|
|
621
622
|
dangerouslySetInnerHTML: d,
|
|
622
|
-
node:
|
|
623
|
+
node: c,
|
|
623
624
|
style: s,
|
|
624
|
-
...
|
|
625
|
+
...l
|
|
625
626
|
} = t;
|
|
626
627
|
return /* @__PURE__ */ u(
|
|
627
628
|
_.HeaderCell,
|
|
628
629
|
{
|
|
629
|
-
...
|
|
630
|
+
...l,
|
|
630
631
|
align: A((s == null ? void 0 : s.textAlign) ?? n),
|
|
631
632
|
children: r
|
|
632
633
|
}
|
|
@@ -637,16 +638,16 @@ function me(e, o, a, f, m) {
|
|
|
637
638
|
children: n,
|
|
638
639
|
dangerouslySetInnerHTML: r,
|
|
639
640
|
node: d,
|
|
640
|
-
...
|
|
641
|
+
...c
|
|
641
642
|
} = t;
|
|
642
|
-
return /* @__PURE__ */ u(_.Head, { ...
|
|
643
|
+
return /* @__PURE__ */ u(_.Head, { ...c, children: n });
|
|
643
644
|
},
|
|
644
645
|
tr: function(t) {
|
|
645
646
|
const {
|
|
646
647
|
children: n,
|
|
647
648
|
dangerouslySetInnerHTML: r,
|
|
648
649
|
node: d,
|
|
649
|
-
onClick:
|
|
650
|
+
onClick: c,
|
|
650
651
|
...s
|
|
651
652
|
} = t;
|
|
652
653
|
return /* @__PURE__ */ u(_.Row, { ...s, children: n });
|
|
@@ -656,9 +657,9 @@ function me(e, o, a, f, m) {
|
|
|
656
657
|
children: n,
|
|
657
658
|
className: r,
|
|
658
659
|
dangerouslySetInnerHTML: d,
|
|
659
|
-
node:
|
|
660
|
+
node: c,
|
|
660
661
|
...s
|
|
661
|
-
} = t,
|
|
662
|
+
} = t, l = (r == null ? void 0 : r.split(/\s+/).includes("contains-task-list")) ?? !1;
|
|
662
663
|
return /* @__PURE__ */ u(
|
|
663
664
|
"ul",
|
|
664
665
|
{
|
|
@@ -666,7 +667,7 @@ function me(e, o, a, f, m) {
|
|
|
666
667
|
className: [
|
|
667
668
|
"nk-markdown__list",
|
|
668
669
|
"nk-markdown__list--unordered",
|
|
669
|
-
|
|
670
|
+
l ? "nk-markdown__list--tasks" : void 0
|
|
670
671
|
].filter(Boolean).join(" "),
|
|
671
672
|
children: n
|
|
672
673
|
}
|
|
@@ -718,9 +719,9 @@ const Ce = V(function(o, a) {
|
|
|
718
719
|
dangerouslySetInnerHTML: n,
|
|
719
720
|
imageBaseUrl: r,
|
|
720
721
|
maxCodeHighlightLength: d,
|
|
721
|
-
maxCodeLineCount:
|
|
722
|
+
maxCodeLineCount: c,
|
|
722
723
|
maxContentLength: s = he,
|
|
723
|
-
rehypePlugins:
|
|
724
|
+
rehypePlugins: l,
|
|
724
725
|
remarkPlugins: M,
|
|
725
726
|
scrollOffset: g = 128,
|
|
726
727
|
style: b,
|
|
@@ -757,7 +758,7 @@ const Ce = V(function(o, a) {
|
|
|
757
758
|
f,
|
|
758
759
|
r,
|
|
759
760
|
d,
|
|
760
|
-
|
|
761
|
+
c,
|
|
761
762
|
N
|
|
762
763
|
),
|
|
763
764
|
[
|
|
@@ -765,7 +766,7 @@ const Ce = V(function(o, a) {
|
|
|
765
766
|
N,
|
|
766
767
|
r,
|
|
767
768
|
d,
|
|
768
|
-
|
|
769
|
+
c
|
|
769
770
|
]
|
|
770
771
|
), $ = T(
|
|
771
772
|
() => [ee, ...M ?? []],
|
|
@@ -773,7 +774,7 @@ const Ce = V(function(o, a) {
|
|
|
773
774
|
), z = T(
|
|
774
775
|
() => [
|
|
775
776
|
X,
|
|
776
|
-
...
|
|
777
|
+
...l ?? [],
|
|
777
778
|
ce,
|
|
778
779
|
Z,
|
|
779
780
|
[de, {
|
|
@@ -782,7 +783,7 @@ const Ce = V(function(o, a) {
|
|
|
782
783
|
}],
|
|
783
784
|
[Q, se]
|
|
784
785
|
],
|
|
785
|
-
[m,
|
|
786
|
+
[m, l]
|
|
786
787
|
), x = { ...b };
|
|
787
788
|
if (g !== null) {
|
|
788
789
|
const h = Number.isFinite(g) ? Math.max(0, g) : 0;
|
package/dist/Modal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),s=require("react"),g=require("./effects-D98vUn6N.cjs"),$=require("./reference-C2guRuR0.cjs"),G=require("./Button-
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),s=require("react"),g=require("./effects-D98vUn6N.cjs"),$=require("./reference-C2guRuR0.cjs"),G=require("./Button-6oWs-pyF.cjs"),r=require("./usePresence-Dm0mls5p.cjs"),H=require("./useFocusTrap-CrMcAu8s.cjs"),J=require("./useScrollLock-Dy8MZaSn.cjs"),K=require("./Surface-BttJYSDt.cjs"),Q=require("./Text-DWYlIcPj.cjs");function U(c,n,l){n.current=c,$.assignElementReference(l,c)}function V(c){const{"aria-label":n,"aria-labelledby":l,children:a,className:v,closeButtonLabel:f="Close modal",exitable:i=!0,forwardedReference:u,initialFocusReference:d,lockScroll:m=!0,onClose:e,open:o,ownerDocument:R,presenceState:k,restoreFocus:q=!0,role:F="dialog",style:I,title:b,trapFocus:S=!0,...P}=c,j=s.useRef(null),_=s.useRef(null),w=s.useContext(r.FocusScopeContext),B=`${s.useId()}-title`,[y,E]=s.useState(null),p=g.useBoundary("Modal").boundaryElement,x=r.useOverlayLayer(!0,p),M=s.useMemo(()=>[j],[]),h=!!(b!=null&&b.trim()),N=d??(h?_:void 0),O=l??(n===void 0&&h?B:void 0),T=s.useCallback(L=>{U(L,j,u),E(L)},[u]);g.useIsomorphicLayoutEffect(()=>{y&&(y.inert=!o)},[y,o]);const C=s.useCallback(()=>{e==null||e("escape")},[e]),z=s.useCallback(()=>{e==null||e("outside")},[e]);r.useDismissableLayer({boundary:p,active:o,boundaries:M,dismissOnEscape:i,dismissOnPointerDownOutside:i,layerId:x.id,onEscapeDismiss:C,onPointerDownOutsideDismiss:z,ownerDocument:R});const A=H.useFocusTrap({boundary:p,active:o&&S,container:y,initialFocusReference:N,layerId:x.id,restoreFocus:q});J.useScrollLock(m,R,p);const D=i?t.jsx(G.Button,{"aria-label":f,className:"nk-modal__close",icon:"cross",onClick:()=>e==null?void 0:e("close-button"),shape:"rectangle",type:"button",variant:"ghost"}):null;return t.jsx(r.FocusScopeContext.Provider,{value:o&&S?A:w,children:t.jsx("div",{className:"nk-modal__overlay","data-state":k,role:"presentation",style:{zIndex:x.zIndex},children:t.jsx("div",{className:"nk-modal__viewport",children:t.jsxs(K.Surface,{...P,ref:T,"aria-hidden":o?void 0:!0,"aria-label":o?n:void 0,"aria-labelledby":o?O:void 0,"aria-modal":o?"true":void 0,className:["nk-modal",v].filter(Boolean).join(" "),"data-state":k,role:o?F:void 0,style:I,tabIndex:-1,children:[h?t.jsxs("div",{className:"nk-modal__header",children:[t.jsx(Q.Text,{as:"h2",className:"nk-modal__title",id:B,ref:_,size:"subtitle",tabIndex:-1,weight:"semibold",children:b}),D]}):D,a]})})})})}const W=s.forwardRef(function(n,l){const{open:a}=n,v=g.useBoundary("Modal"),f=s.useRef(n);a&&(f.current=n);const i=a?n:f.current,u=r.usePresence(a),d=v.boundaryElement,m=(d==null?void 0:d.ownerDocument)??(typeof document>"u"?null:document);return!u.present||!m?null:t.jsx(r.Portal,{children:t.jsx(V,{...i,forwardedReference:l,open:a,ownerDocument:m,presenceState:u.state==="closing"?"closing":"open"})})});exports.default=W;
|
package/dist/Modal.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx as s, jsxs as _ } from "react/jsx-runtime";
|
|
|
3
3
|
import { forwardRef as H, useRef as g, useContext as J, useId as K, useState as Q, useMemo as U, useCallback as h } from "react";
|
|
4
4
|
import { u as E, a as V } from "./effects-DGbA6Q2O.js";
|
|
5
5
|
import { a as W } from "./reference-CXMr27nM.js";
|
|
6
|
-
import { B as X } from "./Button-
|
|
6
|
+
import { B as X } from "./Button-B0E-M8mp.js";
|
|
7
7
|
import { b as Y, P as Z, F as w, c as ee, d as oe } from "./usePresence-BTRY1_l-.js";
|
|
8
8
|
import { u as ae } from "./useFocusTrap-BxPazAL6.js";
|
|
9
9
|
import { u as se } from "./useScrollLock-Drd7OZRC.js";
|
package/dist/PinInput.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 I=require("react/jsx-runtime"),f=require("react"),K=require("./aria-DM-xYEHQ.cjs"),Z=require("./reference-C2guRuR0.cjs"),J=3,Q=10,$=4;function Y(r){return Number.isFinite(r)?Math.min(Q,Math.max(J,Math.trunc(r))):$}function y(r,c,i){return(c==="numeric"?r.replace(/[^0-9]/g,""):r.replace(/[^0-9a-z]/gi,"").toUpperCase()).slice(0,i)}function ee(r,c,i){c.current=r,Z.assignElementReference(i,r)}function B(r){return r.getRootNode().activeElement===r}function te(r,c,i){const l=r.getRootNode();function m(){l.removeEventListener("pointercancel",u),l.removeEventListener("pointerup",u)}function u(h){const x=h.type==="pointerup"&&h.target instanceof Node&&c.contains(h.target);m(),x||i()}return l.addEventListener("pointercancel",u),l.addEventListener("pointerup",u),m}function ne(r,c){var l;const i=(l=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),"value"))==null?void 0:l.set;i?i.call(r,c):r.value=c}function H(r,c,i){const l=Math.min(i-1,Math.max(0,c)),m=Math.min(l+1,r.value.length);B(r)||r.focus(),r.setSelectionRange(l,m)}function re(r){const{defaultValue:c,disabled:i,forwardedReference:l,length:m,mode:u,onChange:h,onComplete:x,onFocus:L,onKeyDown:S,onPaste:b,onSelect:E,readOnly:T,value:P}=r,o=Y(m),R=y(c,u,o),k=f.useRef(null),s=f.useRef(null),M=f.useRef(null),[D,N]=f.useState(R),[A,p]=f.useState(0),g=P!==void 0,d=y(g?P:D,u,o),F=f.useCallback(e=>ee(e,k,l),[l]);f.useEffect(()=>{!g&&D!==d&&N(d)},[g,d,D]),f.useEffect(()=>()=>{var e;return(e=s.current)==null?void 0:e.call(s)},[]),f.useEffect(()=>{var a;if(g)return;const e=(a=k.current)==null?void 0:a.form;if(!e)return;const n=e.getRootNode();function t(v){v.target!==e||v.defaultPrevented||(N(R),p(0))}return n.addEventListener("reset",t),()=>n.removeEventListener("reset",t)},[g,R]);function V(e){const n=e.selectionStart??d.length;return Math.min(o-1,Math.max(0,n))}function O(e){const n=e.currentTarget,t=n.selectionStart??n.value.length,a=y(n.value,u,o),v=y(n.value.slice(0,t),u,o).length;n.value=a,g||N(a),h==null||h(e),a.length===o&&a!==d&&(x==null||x(a));const _=Math.min(o-1,v);p(_),n.setSelectionRange(_,Math.min(_+1,a.length))}function z(e){if(b==null||b(e),e.defaultPrevented||i||T)return;const n=y(e.clipboardData.getData("text"),u,o);if(e.preventDefault(),n.length===0)return;const t=e.currentTarget,a=t.selectionStart??d.length,v=t.selectionEnd??a,_=n.length===o?n:y(d.slice(0,a)+n+d.slice(v),u,o),j=n.length===o?o:Math.min(o,a+n.length);ne(t,_),t.setSelectionRange(j,j),t.dispatchEvent(new Event("input",{bubbles:!0}))}function C(e){if(S==null||S(e),e.defaultPrevented||e.key!=="ArrowLeft"&&e.key!=="ArrowRight")return;e.preventDefault();const n=e.key==="ArrowLeft"?-1:1,t=Math.min(o-1,Math.max(0,V(e.currentTarget)+n));p(t),H(e.currentTarget,t,o)}function q(e){var a;L==null||L(e),(a=s.current)==null||a.call(s),s.current=null;const n=M.current;M.current=null;const t=n??Math.min(o-1,d.length);p(t),H(e.currentTarget,t,o)}function U(e){E==null||E(e),p(V(e.currentTarget))}function G(e,n){var a;if(i)return;const t=k.current;if(t){if(!B(t)){(a=s.current)==null||a.call(s),M.current=n,p(n),s.current=te(t,e.currentTarget,()=>{M.current=null,s.current=null});return}e.preventDefault(),M.current=null,p(n),H(t,n,o)}}return{activeIndex:A,handleChange:O,handleFocus:q,handleKeyDown:C,handlePaste:z,handleSelect:U,handleSlotPointerDown:G,inputCallbackReference:F,length:o,renderedValue:d}}const ae=f.forwardRef(function(c,i){const{"aria-invalid":l,autoCapitalize:m,autoComplete:u="one-time-code",className:h,censored:x=!1,defaultValue:L="",disabled:S=!1,id:b,invalid:E=!1,length:T=$,mode:P="numeric",onChange:o,onComplete:R,onFocus:k,onKeyDown:s,onPaste:M,onSelect:D,readOnly:N=!1,style:A,value:p,wrap:g=!1,...d}=c,F=f.useId(),V=b??`${F}-control`,{activeIndex:O,handleChange:z,handleFocus:C,handleKeyDown:q,handlePaste:U,handleSelect:G,handleSlotPointerDown:e,inputCallbackReference:n,length:t,renderedValue:a}=re({defaultValue:L,disabled:S,forwardedReference:i,length:T,mode:P,onChange:o,onComplete:R,onFocus:k,onKeyDown:s,onPaste:M,onSelect:D,readOnly:N,value:p}),v=E||K.hasInvalidState(l),_=!g&&t>=6&&t%2===0,j=t/2,W={...A,"--nk-pin-input-columns":Math.ceil(t/2)};return I.jsxs("span",{className:["nk-pin-input",h].filter(Boolean).join(" "),"data-disabled":S||void 0,"data-invalid":v||void 0,"data-read-only":N||void 0,"data-wrap":g||void 0,style:W,children:[I.jsx("input",{...d,ref:n,"aria-invalid":K.resolveAriaInvalid(E,l),autoCapitalize:m??(P==="alphanumeric"?"characters":"off"),autoComplete:u,className:"nk-pin-input__control",disabled:S,id:V,inputMode:P==="numeric"?"numeric":"text",maxLength:t,minLength:t,onChange:z,onFocus:C,onKeyDown:q,onPaste:U,onSelect:G,pattern:P==="numeric"?`[0-9]{${t}}`:`[0-9A-Za-z]{${t}}`,readOnly:N,spellCheck:!1,type:"text",value:a}),I.jsx("span",{"aria-hidden":"true",className:"nk-pin-input__slots",children:Array.from({length:t},(oe,w)=>I.jsxs("span",{className:"nk-pin-input__slot-group",children:[_&&w===j?I.jsx("span",{className:"nk-pin-input__separator",children:"-"}):null,I.jsx("label",{className:"nk-pin-input__slot","data-active":O===w||void 0,htmlFor:V,onPointerDown:X=>e(X,w),children:I.jsx("span",{"aria-hidden":"true",children:x&&a[w]?I.jsx("span",{className:"nk-pin-input__censor"}):a[w]??""})})]},w))})]})});exports.default=ae;
|