@fumadocs/base-ui 16.5.4 → 16.6.1
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/css/generated/shared.css +51 -11
- package/dist/components/dialog/search.d.ts +4 -3
- package/dist/components/dialog/search.d.ts.map +1 -1
- package/dist/components/dialog/search.js +121 -40
- package/dist/components/dialog/search.js.map +1 -1
- package/dist/components/type-table.d.ts +6 -3
- package/dist/components/type-table.d.ts.map +1 -1
- package/dist/components/type-table.js +21 -12
- package/dist/components/type-table.js.map +1 -1
- package/dist/components/ui/navigation-menu.d.ts +2 -2
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/layouts/home/client.d.ts +1 -1
- package/dist/layouts/home/navbar.d.ts +1 -1
- package/dist/layouts/home/navbar.d.ts.map +1 -1
- package/dist/layouts/shared/search-toggle.js +1 -1
- package/dist/layouts/shared/search-toggle.js.map +1 -1
- package/dist/style.css +65 -33
- package/package.json +11 -7
package/css/generated/shared.css
CHANGED
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
@source inline("-translate-y-1/2");
|
|
40
40
|
@source inline("@container");
|
|
41
41
|
@source inline("@defaultValue");
|
|
42
|
+
@source inline("@deprecated");
|
|
42
43
|
@source inline("@example");
|
|
43
44
|
@source inline("@keyframes");
|
|
44
45
|
@source inline("@max-lg:col-span-full");
|
|
@@ -62,6 +63,7 @@
|
|
|
62
63
|
@source inline("active");
|
|
63
64
|
@source inline("activeType");
|
|
64
65
|
@source inline("add");
|
|
66
|
+
@source inline("addEventListener");
|
|
65
67
|
@source inline("advanced");
|
|
66
68
|
@source inline("after");
|
|
67
69
|
@source inline("algolia");
|
|
@@ -70,6 +72,7 @@
|
|
|
70
72
|
@source inline("all");
|
|
71
73
|
@source inline("allowClear");
|
|
72
74
|
@source inline("allowCopy");
|
|
75
|
+
@source inline("allowDangerousHtml");
|
|
73
76
|
@source inline("allowing");
|
|
74
77
|
@source inline("always");
|
|
75
78
|
@source inline("an");
|
|
@@ -124,12 +127,14 @@
|
|
|
124
127
|
@source inline("bg-transparent");
|
|
125
128
|
@source inline("black");
|
|
126
129
|
@source inline("block");
|
|
130
|
+
@source inline("blocks");
|
|
127
131
|
@source inline("body");
|
|
128
132
|
@source inline("boolean");
|
|
129
133
|
@source inline("border");
|
|
130
134
|
@source inline("border-b");
|
|
131
135
|
@source inline("border-fd-foreground/10");
|
|
132
136
|
@source inline("border-l");
|
|
137
|
+
@source inline("border-none");
|
|
133
138
|
@source inline("border-s");
|
|
134
139
|
@source inline("border-t");
|
|
135
140
|
@source inline("border-transparent");
|
|
@@ -187,13 +192,13 @@
|
|
|
187
192
|
@source inline("container");
|
|
188
193
|
@source inline("containerRef");
|
|
189
194
|
@source inline("content");
|
|
190
|
-
@source inline("contentWithHighlights");
|
|
191
195
|
@source inline("context");
|
|
192
196
|
@source inline("controlled/uncontrolled");
|
|
193
197
|
@source inline("copy");
|
|
194
198
|
@source inline("core");
|
|
195
199
|
@source inline("counterSet");
|
|
196
200
|
@source inline("createContext");
|
|
201
|
+
@source inline("createMarkdownRenderer");
|
|
197
202
|
@source inline("createRelativeLink");
|
|
198
203
|
@source inline("css");
|
|
199
204
|
@source inline("ctx");
|
|
@@ -209,16 +214,12 @@
|
|
|
209
214
|
@source inline("data-[active=true]:text-fd-primary");
|
|
210
215
|
@source inline("data-[active]:border-fd-primary");
|
|
211
216
|
@source inline("data-[active]:text-fd-primary");
|
|
212
|
-
@source inline("data-[closed]:animate-fd-dialog-out");
|
|
213
|
-
@source inline("data-[closed]:animate-fd-fade-out");
|
|
214
217
|
@source inline("data-[closed]:animate-fd-popover-out");
|
|
215
218
|
@source inline("data-[ending-style]:data-[activation-direction=left]:translate-x-1/2");
|
|
216
219
|
@source inline("data-[ending-style]:data-[activation-direction=right]:-translate-x-1/2");
|
|
217
220
|
@source inline("data-[ending-style]:h-0");
|
|
218
221
|
@source inline("data-[ending-style]:opacity-0");
|
|
219
222
|
@source inline("data-[inactive]:hidden");
|
|
220
|
-
@source inline("data-[open]:animate-fd-dialog-in");
|
|
221
|
-
@source inline("data-[open]:animate-fd-fade-in");
|
|
222
223
|
@source inline("data-[open]:animate-fd-popover-in");
|
|
223
224
|
@source inline("data-[starting-style]:data-[activation-direction=left]:-translate-x-1/2");
|
|
224
225
|
@source inline("data-[starting-style]:data-[activation-direction=right]:translate-x-1/2");
|
|
@@ -229,12 +230,16 @@
|
|
|
229
230
|
@source inline("data-card");
|
|
230
231
|
@source inline("data-checked");
|
|
231
232
|
@source inline("data-checked:text-fd-accent-foreground");
|
|
233
|
+
@source inline("data-closed:animate-fd-dialog-out");
|
|
234
|
+
@source inline("data-closed:animate-fd-fade-out");
|
|
232
235
|
@source inline("data-collapsed");
|
|
233
236
|
@source inline("data-empty");
|
|
234
237
|
@source inline("data-hidden");
|
|
235
238
|
@source inline("data-icon");
|
|
236
239
|
@source inline("data-line-numbers");
|
|
237
240
|
@source inline("data-line-numbers-start");
|
|
241
|
+
@source inline("data-open:animate-fd-dialog-in");
|
|
242
|
+
@source inline("data-open:animate-fd-fade-in");
|
|
238
243
|
@source inline("data-open:bg-fd-accent");
|
|
239
244
|
@source inline("data-open:text-fd-accent-foreground");
|
|
240
245
|
@source inline("data-search");
|
|
@@ -277,6 +282,7 @@
|
|
|
277
282
|
@source inline("displayed");
|
|
278
283
|
@source inline("div");
|
|
279
284
|
@source inline("divide-fd-border");
|
|
285
|
+
@source inline("divide-x");
|
|
280
286
|
@source inline("divide-y");
|
|
281
287
|
@source inline("docsLayoutCtx");
|
|
282
288
|
@source inline("documented");
|
|
@@ -313,6 +319,7 @@
|
|
|
313
319
|
@source inline("false");
|
|
314
320
|
@source inline("fd-moving-banner");
|
|
315
321
|
@source inline("fd-scroll-container");
|
|
322
|
+
@source inline("fd-search-dialog-content");
|
|
316
323
|
@source inline("fd-step");
|
|
317
324
|
@source inline("fd-steps");
|
|
318
325
|
@source inline("fetch");
|
|
@@ -350,6 +357,7 @@
|
|
|
350
357
|
@source inline("formattedValue");
|
|
351
358
|
@source inline("forwardRef");
|
|
352
359
|
@source inline("found");
|
|
360
|
+
@source inline("fragment");
|
|
353
361
|
@source inline("framework");
|
|
354
362
|
@source inline("free");
|
|
355
363
|
@source inline("from");
|
|
@@ -404,9 +412,11 @@
|
|
|
404
412
|
@source inline("h4");
|
|
405
413
|
@source inline("h5");
|
|
406
414
|
@source inline("h6");
|
|
415
|
+
@source inline("handle");
|
|
407
416
|
@source inline("happens");
|
|
408
417
|
@source inline("has-focus-visible:bg-fd-accent");
|
|
409
418
|
@source inline("hash");
|
|
419
|
+
@source inline("hast");
|
|
410
420
|
@source inline("have");
|
|
411
421
|
@source inline("headers");
|
|
412
422
|
@source inline("heading");
|
|
@@ -414,7 +424,7 @@
|
|
|
414
424
|
@source inline("hence");
|
|
415
425
|
@source inline("here");
|
|
416
426
|
@source inline("hidden");
|
|
417
|
-
@source inline("
|
|
427
|
+
@source inline("highlight");
|
|
418
428
|
@source inline("hooks");
|
|
419
429
|
@source inline("horizontal");
|
|
420
430
|
@source inline("hotKey");
|
|
@@ -441,11 +451,11 @@
|
|
|
441
451
|
@source inline("img");
|
|
442
452
|
@source inline("import");
|
|
443
453
|
@source inline("in");
|
|
454
|
+
@source inline("inPre");
|
|
444
455
|
@source inline("inTab");
|
|
445
456
|
@source inline("index");
|
|
446
457
|
@source inline("infinite");
|
|
447
458
|
@source inline("info");
|
|
448
|
-
@source inline("inline");
|
|
449
459
|
@source inline("inline-flex");
|
|
450
460
|
@source inline("input");
|
|
451
461
|
@source inline("inputType");
|
|
@@ -477,7 +487,6 @@
|
|
|
477
487
|
@source inline("keepBackground");
|
|
478
488
|
@source inline("keepMounted");
|
|
479
489
|
@source inline("key");
|
|
480
|
-
@source inline("keyVariants");
|
|
481
490
|
@source inline("keydown");
|
|
482
491
|
@source inline("keyof");
|
|
483
492
|
@source inline("label");
|
|
@@ -523,12 +532,15 @@
|
|
|
523
532
|
@source inline("make");
|
|
524
533
|
@source inline("mapped");
|
|
525
534
|
@source inline("marginBottom");
|
|
535
|
+
@source inline("mark");
|
|
526
536
|
@source inline("marked");
|
|
527
537
|
@source inline("mask-[linear-gradient(to_bottom,transparent,white_16px,white_calc(100%-16px),transparent)]");
|
|
538
|
+
@source inline("mask-[linear-gradient(to_bottom,white,white_30px,transparent_80px)]");
|
|
528
539
|
@source inline("maskComposite");
|
|
529
540
|
@source inline("maskImage");
|
|
530
541
|
@source inline("matching");
|
|
531
542
|
@source inline("max-h-(--available-height)");
|
|
543
|
+
@source inline("max-h-20");
|
|
532
544
|
@source inline("max-h-[460px]");
|
|
533
545
|
@source inline("max-h-[600px]");
|
|
534
546
|
@source inline("max-md:bg-fd-secondary");
|
|
@@ -537,6 +549,7 @@
|
|
|
537
549
|
@source inline("max-md:rounded-md");
|
|
538
550
|
@source inline("max-w-[1400px]");
|
|
539
551
|
@source inline("max-w-[98vw]");
|
|
552
|
+
@source inline("max-w-full");
|
|
540
553
|
@source inline("max-w-screen-sm");
|
|
541
554
|
@source inline("max-width");
|
|
542
555
|
@source inline("mb-1");
|
|
@@ -546,6 +559,8 @@
|
|
|
546
559
|
@source inline("md:mb-auto");
|
|
547
560
|
@source inline("md:size-5");
|
|
548
561
|
@source inline("md:top-[calc(50%-250px)]");
|
|
562
|
+
@source inline("mdComponents");
|
|
563
|
+
@source inline("mdRenderer");
|
|
549
564
|
@source inline("me-1");
|
|
550
565
|
@source inline("me-2");
|
|
551
566
|
@source inline("me-auto");
|
|
@@ -571,6 +586,7 @@
|
|
|
571
586
|
@source inline("mx-auto");
|
|
572
587
|
@source inline("my-0");
|
|
573
588
|
@source inline("my-0!");
|
|
589
|
+
@source inline("my-0.5");
|
|
574
590
|
@source inline("my-4");
|
|
575
591
|
@source inline("my-6");
|
|
576
592
|
@source inline("my-auto");
|
|
@@ -603,6 +619,7 @@
|
|
|
603
619
|
@source inline("not");
|
|
604
620
|
@source inline("not-last:mb-2");
|
|
605
621
|
@source inline("not-prose");
|
|
622
|
+
@source inline("now");
|
|
606
623
|
@source inline("null");
|
|
607
624
|
@source inline("num");
|
|
608
625
|
@source inline("number");
|
|
@@ -624,13 +641,17 @@
|
|
|
624
641
|
@source inline("onKey");
|
|
625
642
|
@source inline("onKeyDown");
|
|
626
643
|
@source inline("onOpenChange");
|
|
644
|
+
@source inline("onOpenChangeCallback");
|
|
627
645
|
@source inline("onPointerEnter");
|
|
628
646
|
@source inline("onPointerLeave");
|
|
629
647
|
@source inline("onPointerMove");
|
|
630
648
|
@source inline("onPrint");
|
|
631
649
|
@source inline("onSearchChange");
|
|
650
|
+
@source inline("onSearchChangeCallback");
|
|
632
651
|
@source inline("onSelect");
|
|
652
|
+
@source inline("onSelectCallback");
|
|
633
653
|
@source inline("onTagChange");
|
|
654
|
+
@source inline("onTagChangeCallback");
|
|
634
655
|
@source inline("onValueChange");
|
|
635
656
|
@source inline("one");
|
|
636
657
|
@source inline("only");
|
|
@@ -660,6 +681,7 @@
|
|
|
660
681
|
@source inline("owner");
|
|
661
682
|
@source inline("p");
|
|
662
683
|
@source inline("p-0");
|
|
684
|
+
@source inline("p-0.5");
|
|
663
685
|
@source inline("p-1");
|
|
664
686
|
@source inline("p-1.5");
|
|
665
687
|
@source inline("p-2");
|
|
@@ -670,6 +692,7 @@
|
|
|
670
692
|
@source inline("page");
|
|
671
693
|
@source inline("parameters");
|
|
672
694
|
@source inline("params");
|
|
695
|
+
@source inline("parentId");
|
|
673
696
|
@source inline("pass");
|
|
674
697
|
@source inline("passed");
|
|
675
698
|
@source inline("path");
|
|
@@ -714,11 +737,14 @@
|
|
|
714
737
|
@source inline("pt-0");
|
|
715
738
|
@source inline("pure");
|
|
716
739
|
@source inline("px");
|
|
740
|
+
@source inline("px-0.5");
|
|
741
|
+
@source inline("px-1");
|
|
717
742
|
@source inline("px-1.5");
|
|
718
743
|
@source inline("px-2");
|
|
719
744
|
@source inline("px-2.5");
|
|
720
745
|
@source inline("px-3");
|
|
721
746
|
@source inline("px-4");
|
|
747
|
+
@source inline("px-px");
|
|
722
748
|
@source inline("py-0.5");
|
|
723
749
|
@source inline("py-1");
|
|
724
750
|
@source inline("py-1.5");
|
|
@@ -744,11 +770,18 @@
|
|
|
744
770
|
@source inline("refs");
|
|
745
771
|
@source inline("region");
|
|
746
772
|
@source inline("registering");
|
|
773
|
+
@source inline("rehype-raw");
|
|
774
|
+
@source inline("rehypeCustomElements");
|
|
775
|
+
@source inline("rehypePlugins");
|
|
776
|
+
@source inline("rehypeRaw");
|
|
747
777
|
@source inline("rel");
|
|
748
778
|
@source inline("relative");
|
|
779
|
+
@source inline("remarkRehypeOptions");
|
|
749
780
|
@source inline("remove");
|
|
781
|
+
@source inline("removeEventListener");
|
|
750
782
|
@source inline("render");
|
|
751
783
|
@source inline("renderHighlights");
|
|
784
|
+
@source inline("renderMarkdown");
|
|
752
785
|
@source inline("repo");
|
|
753
786
|
@source inline("repository");
|
|
754
787
|
@source inline("required");
|
|
@@ -782,6 +815,7 @@
|
|
|
782
815
|
@source inline("s");
|
|
783
816
|
@source inline("scroll");
|
|
784
817
|
@source inline("scroll-into-view-if-needed");
|
|
818
|
+
@source inline("scroll-m-20");
|
|
785
819
|
@source inline("scroll-m-24");
|
|
786
820
|
@source inline("scroll-m-28");
|
|
787
821
|
@source inline("scrollIntoView");
|
|
@@ -814,7 +848,6 @@
|
|
|
814
848
|
@source inline("setTag");
|
|
815
849
|
@source inline("setValue");
|
|
816
850
|
@source inline("shadow-2xl");
|
|
817
|
-
@source inline("shadow-black/50");
|
|
818
851
|
@source inline("shadow-lg");
|
|
819
852
|
@source inline("shadow-md");
|
|
820
853
|
@source inline("shadow-sm");
|
|
@@ -851,6 +884,7 @@
|
|
|
851
884
|
@source inline("stars");
|
|
852
885
|
@source inline("start-0");
|
|
853
886
|
@source inline("start-3");
|
|
887
|
+
@source inline("start-6");
|
|
854
888
|
@source inline("state");
|
|
855
889
|
@source inline("static");
|
|
856
890
|
@source inline("sticky");
|
|
@@ -859,6 +893,7 @@
|
|
|
859
893
|
@source inline("stroke-fd-foreground/10");
|
|
860
894
|
@source inline("stroke-width");
|
|
861
895
|
@source inline("strokeWidth");
|
|
896
|
+
@source inline("strong");
|
|
862
897
|
@source inline("style");
|
|
863
898
|
@source inline("styles");
|
|
864
899
|
@source inline("success");
|
|
@@ -877,6 +912,7 @@
|
|
|
877
912
|
@source inline("tabs");
|
|
878
913
|
@source inline("tabsRef");
|
|
879
914
|
@source inline("tag");
|
|
915
|
+
@source inline("tagName");
|
|
880
916
|
@source inline("tags");
|
|
881
917
|
@source inline("tailwind-merge");
|
|
882
918
|
@source inline("target");
|
|
@@ -926,6 +962,7 @@
|
|
|
926
962
|
@source inline("top-1.5");
|
|
927
963
|
@source inline("top-1/2");
|
|
928
964
|
@source inline("top-2");
|
|
965
|
+
@source inline("top-2.5");
|
|
929
966
|
@source inline("top-4");
|
|
930
967
|
@source inline("touch");
|
|
931
968
|
@source inline("trailing");
|
|
@@ -950,6 +987,8 @@
|
|
|
950
987
|
@source inline("under");
|
|
951
988
|
@source inline("underline");
|
|
952
989
|
@source inline("underlying");
|
|
990
|
+
@source inline("unified");
|
|
991
|
+
@source inline("unist-util-visit");
|
|
953
992
|
@source inline("unknown");
|
|
954
993
|
@source inline("unmounted");
|
|
955
994
|
@source inline("updateAnchor");
|
|
@@ -978,12 +1017,12 @@
|
|
|
978
1017
|
@source inline("useTheme");
|
|
979
1018
|
@source inline("useTreeContext");
|
|
980
1019
|
@source inline("useTreePath");
|
|
981
|
-
@source inline("used");
|
|
982
1020
|
@source inline("useful");
|
|
983
1021
|
@source inline("user");
|
|
984
1022
|
@source inline("users");
|
|
985
1023
|
@source inline("using");
|
|
986
1024
|
@source inline("usually");
|
|
1025
|
+
@source inline("v");
|
|
987
1026
|
@source inline("v17");
|
|
988
1027
|
@source inline("value");
|
|
989
1028
|
@source inline("valueToIdMap");
|
|
@@ -996,13 +1035,14 @@
|
|
|
996
1035
|
@source inline("viewRef");
|
|
997
1036
|
@source inline("viewport");
|
|
998
1037
|
@source inline("viewportProps");
|
|
1038
|
+
@source inline("visit");
|
|
999
1039
|
@source inline("void");
|
|
1000
1040
|
@source inline("w");
|
|
1001
1041
|
@source inline("w-(--anchor-width)");
|
|
1002
1042
|
@source inline("w-0");
|
|
1003
1043
|
@source inline("w-0.5");
|
|
1004
1044
|
@source inline("w-1.5");
|
|
1005
|
-
@source inline("w-
|
|
1045
|
+
@source inline("w-1/4");
|
|
1006
1046
|
@source inline("w-[calc(100%-1rem)]");
|
|
1007
1047
|
@source inline("w-fit");
|
|
1008
1048
|
@source inline("w-full");
|
|
@@ -69,10 +69,12 @@ declare function SearchDialogListItem({
|
|
|
69
69
|
item,
|
|
70
70
|
className,
|
|
71
71
|
children,
|
|
72
|
-
|
|
72
|
+
renderMarkdown,
|
|
73
|
+
renderHighlights: _,
|
|
73
74
|
...props
|
|
74
75
|
}: ComponentProps<'button'> & {
|
|
75
|
-
|
|
76
|
+
renderMarkdown?: (v: string) => ReactNode; /** @deprecated highlight blocks is now wrapped in `<mark />`, use `renderMarkdown` to handle instead. */
|
|
77
|
+
renderHighlights?: (blocks: HighlightedText<ReactNode>[]) => ReactNode;
|
|
76
78
|
item: SearchItemType;
|
|
77
79
|
}): react_jsx_runtime0.JSX.Element;
|
|
78
80
|
declare function SearchDialogIcon(props: ComponentProps<'svg'>): react_jsx_runtime0.JSX.Element;
|
|
@@ -94,7 +96,6 @@ declare function TagsListItem({
|
|
|
94
96
|
}: ComponentProps<'button'> & {
|
|
95
97
|
value: string;
|
|
96
98
|
}): react_jsx_runtime0.JSX.Element;
|
|
97
|
-
declare function renderHighlights(highlights: HighlightedText<ReactNode>[]): ReactNode;
|
|
98
99
|
declare function useSearch(): {
|
|
99
100
|
open: boolean;
|
|
100
101
|
onOpenChange: (open: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","names":[],"sources":["../../../src/components/dialog/search.tsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"search.d.ts","names":[],"sources":["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,KAAA,SAAc,SAAA;EAnRI;;;EAuRlB,IAAA,IAAQ,KAAA;IAAS,IAAA,EAAM,cAAA;IAAgB,OAAA;EAAA,MAA0B,SAAA;AAAA,IAClE,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAyFe,oBAAA,CAAA;EACd,IAAA;EACA,SAAA;EACA,QAAA;EACA,cAAA;EACA,gBAAA,EAAkB,CAAA;EAAA,GACf;AAAA,GACF,cAAA;EACD,cAAA,IAAkB,CAAA,aAAc,SAAA,EAnQhC;EAqQA,gBAAA,IAAoB,MAAA,EAAQ,eAAA,CAAgB,SAAA,QAAiB,SAAA;EAC7D,IAAA,EAAM,cAAA;AAAA,IACP,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAoEe,gBAAA,CAAiB,KAAA,EAAO,cAAA,UAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,UAe5C,aAAA,SAAsB,cAAA;EACrC,GAAA;EACA,WAAA,GAAc,GAAA;EACd,UAAA;AAAA;AAAA,iBAac,QAAA,CAAA;EAAW,GAAA;EAAK,WAAA;EAAa,UAAA;EAAA,GAAuB;AAAA,GAAS,aAAA,GAAa,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAqB1E,YAAA,CAAA;EACd,KAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,cAAA;EACD,KAAA;AAAA,IACD,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAkBe,SAAA,CAAA;;iBArgBC,IAAA;;mBAEE,CAAA;aACN,IAAA,EAAM,cAAA;;;iBAwgBH,WAAA,CAAA;;kBA7fE,KAAA;;;iBAmgBF,aAAA,CAAA;;cAxgBF,CAAA;AAAA"}
|
|
@@ -11,35 +11,123 @@ import { cva } from "class-variance-authority";
|
|
|
11
11
|
import { useOnChange } from "fumadocs-core/utils/use-on-change";
|
|
12
12
|
import scrollIntoView from "scroll-into-view-if-needed";
|
|
13
13
|
import { Dialog } from "@base-ui/react/dialog";
|
|
14
|
+
import { createMarkdownRenderer } from "fumadocs-core/content/md";
|
|
15
|
+
import rehypeRaw from "rehype-raw";
|
|
16
|
+
import { visit } from "unist-util-visit";
|
|
14
17
|
|
|
15
18
|
//#region src/components/dialog/search.tsx
|
|
16
|
-
const
|
|
19
|
+
const RootContext = createContext(null);
|
|
17
20
|
const ListContext = createContext(null);
|
|
18
21
|
const TagsListContext = createContext(null);
|
|
22
|
+
const PreContext = createContext(false);
|
|
23
|
+
const mdRenderer = createMarkdownRenderer({
|
|
24
|
+
remarkRehypeOptions: { allowDangerousHtml: true },
|
|
25
|
+
rehypePlugins: [rehypeRaw, rehypeCustomElements]
|
|
26
|
+
});
|
|
27
|
+
const mdComponents = {
|
|
28
|
+
mark(props) {
|
|
29
|
+
return /* @__PURE__ */ jsx("span", {
|
|
30
|
+
...props,
|
|
31
|
+
className: "text-fd-primary underline"
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
a: "span",
|
|
35
|
+
p(props) {
|
|
36
|
+
return /* @__PURE__ */ jsx("p", {
|
|
37
|
+
...props,
|
|
38
|
+
className: "min-w-0"
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
strong(props) {
|
|
42
|
+
return /* @__PURE__ */ jsx("strong", {
|
|
43
|
+
...props,
|
|
44
|
+
className: "text-fd-accent-foreground font-medium"
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
code(props) {
|
|
48
|
+
if (use(PreContext)) return /* @__PURE__ */ jsx("code", {
|
|
49
|
+
...props,
|
|
50
|
+
className: "mask-[linear-gradient(to_bottom,white,white_30px,transparent_80px)]"
|
|
51
|
+
});
|
|
52
|
+
return /* @__PURE__ */ jsx("code", {
|
|
53
|
+
...props,
|
|
54
|
+
className: "border rounded-md px-px bg-fd-secondary text-fd-secondary-foreground"
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
custom({ _tagName = "fragment", children, ...rest }) {
|
|
58
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
59
|
+
className: "inline-flex max-w-full items-center border p-0.5 rounded-md bg-fd-card text-fd-card-foreground divide-x divide-fd-border",
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx("code", {
|
|
62
|
+
className: "rounded-sm px-0.5 me-1 bg-fd-primary font-medium text-xs text-fd-primary-foreground border-none",
|
|
63
|
+
children: _tagName
|
|
64
|
+
}),
|
|
65
|
+
Object.entries(rest).map(([k, v]) => {
|
|
66
|
+
if (typeof v !== "string") return;
|
|
67
|
+
return /* @__PURE__ */ jsxs("code", {
|
|
68
|
+
className: "truncate text-xs text-fd-muted-foreground px-1",
|
|
69
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
70
|
+
className: "text-fd-card-foreground",
|
|
71
|
+
children: [k, ": "]
|
|
72
|
+
}), v]
|
|
73
|
+
}, k);
|
|
74
|
+
}),
|
|
75
|
+
children && /* @__PURE__ */ jsx("span", {
|
|
76
|
+
className: "ps-1",
|
|
77
|
+
children
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
pre(props) {
|
|
83
|
+
return /* @__PURE__ */ jsx("pre", {
|
|
84
|
+
...props,
|
|
85
|
+
className: cn("flex flex-col border rounded-md my-0.5 p-2 bg-fd-secondary text-fd-secondary-foreground max-h-20 overflow-hidden", props.className),
|
|
86
|
+
children: /* @__PURE__ */ jsx(PreContext, {
|
|
87
|
+
value: true,
|
|
88
|
+
children: props.children
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
function rehypeCustomElements() {
|
|
94
|
+
return (tree) => {
|
|
95
|
+
visit(tree, (node) => {
|
|
96
|
+
if (node.type === "element" && document.createElement(node.tagName) instanceof HTMLUnknownElement) {
|
|
97
|
+
node.properties._tagName = node.tagName;
|
|
98
|
+
node.tagName = "custom";
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
}
|
|
19
103
|
function SearchDialog({ open, onOpenChange, search, onSearchChange, isLoading = false, onSelect: onSelectProp, children }) {
|
|
20
104
|
const router = useRouter();
|
|
21
|
-
const
|
|
105
|
+
const onOpenChangeCallback = useRef(onOpenChange);
|
|
106
|
+
onOpenChangeCallback.current = onOpenChange;
|
|
107
|
+
const onSearchChangeCallback = useRef(onSearchChange);
|
|
108
|
+
onSearchChangeCallback.current = onSearchChange;
|
|
109
|
+
const onSelect = (item) => {
|
|
22
110
|
if (item.type === "action") item.onSelect();
|
|
23
111
|
else if (item.external) window.open(item.url, "_blank")?.focus();
|
|
24
112
|
else router.push(item.url);
|
|
25
113
|
onOpenChange(false);
|
|
26
114
|
onSelectProp?.(item);
|
|
27
|
-
}
|
|
115
|
+
};
|
|
116
|
+
const onSelectCallback = useRef(onSelect);
|
|
117
|
+
onSelectCallback.current = onSelect;
|
|
28
118
|
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
29
119
|
open,
|
|
30
120
|
onOpenChange,
|
|
31
|
-
children: /* @__PURE__ */ jsx(
|
|
121
|
+
children: /* @__PURE__ */ jsx(RootContext, {
|
|
32
122
|
value: useMemo(() => ({
|
|
33
123
|
open,
|
|
34
|
-
onOpenChange,
|
|
35
124
|
search,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
125
|
+
isLoading,
|
|
126
|
+
onOpenChange: (v) => onOpenChangeCallback.current(v),
|
|
127
|
+
onSearchChange: (v) => onSearchChangeCallback.current(v),
|
|
128
|
+
onSelect: (v) => onSelectCallback.current(v)
|
|
39
129
|
}), [
|
|
40
130
|
isLoading,
|
|
41
|
-
onOpenChange,
|
|
42
|
-
onSearchChange,
|
|
43
131
|
open,
|
|
44
132
|
search
|
|
45
133
|
]),
|
|
@@ -87,15 +175,16 @@ function SearchDialogFooter(props) {
|
|
|
87
175
|
function SearchDialogOverlay({ className, ...props }) {
|
|
88
176
|
return /* @__PURE__ */ jsx(Dialog.Backdrop, {
|
|
89
177
|
...props,
|
|
90
|
-
className: (s) => cn("fixed inset-0 z-50 backdrop-blur-xs bg-fd-overlay data-
|
|
178
|
+
className: (s) => cn("fixed inset-0 z-50 backdrop-blur-xs bg-fd-overlay data-open:animate-fd-fade-in data-closed:animate-fd-fade-out", typeof className === "function" ? className(s) : className)
|
|
91
179
|
});
|
|
92
180
|
}
|
|
93
181
|
function SearchDialogContent({ children, className, ...props }) {
|
|
94
182
|
const { text } = useI18n();
|
|
95
183
|
return /* @__PURE__ */ jsx(Dialog.Portal, { children: /* @__PURE__ */ jsxs(Dialog.Popup, {
|
|
184
|
+
id: "fd-search-dialog-content",
|
|
96
185
|
"aria-describedby": void 0,
|
|
97
186
|
...props,
|
|
98
|
-
className: (s) => cn("fixed left-1/2 top-4 md:top-[calc(50%-250px)] z-50 w-[calc(100%-1rem)] max-w-screen-sm -translate-x-1/2 rounded-xl border bg-fd-popover text-fd-popover-foreground shadow-2xl
|
|
187
|
+
className: (s) => cn("fixed left-1/2 top-4 md:top-[calc(50%-250px)] z-50 w-[calc(100%-1rem)] max-w-screen-sm -translate-x-1/2 rounded-xl border bg-fd-popover text-fd-popover-foreground shadow-2xl overflow-hidden data-closed:animate-fd-dialog-out data-open:animate-fd-dialog-in focus-visible:outline-none", "*:border-b *:has-[+:last-child[data-empty=true]]:border-b-0 *:data-[empty=true]:border-b-0 *:last:border-b-0", typeof className === "function" ? className(s) : className),
|
|
99
188
|
children: [/* @__PURE__ */ jsx(Dialog.Title, {
|
|
100
189
|
className: "hidden",
|
|
101
190
|
children: text.search
|
|
@@ -134,10 +223,11 @@ function SearchDialogList({ items = null, Empty = () => /* @__PURE__ */ jsx("div
|
|
|
134
223
|
});
|
|
135
224
|
const viewport = element.firstElementChild;
|
|
136
225
|
if (viewport) observer.observe(viewport);
|
|
137
|
-
|
|
226
|
+
const content = document.getElementById("fd-search-dialog-content") ?? window;
|
|
227
|
+
content.addEventListener("keydown", onKey);
|
|
138
228
|
return () => {
|
|
139
229
|
observer.disconnect();
|
|
140
|
-
|
|
230
|
+
content.removeEventListener("keydown", onKey);
|
|
141
231
|
};
|
|
142
232
|
}, []);
|
|
143
233
|
useOnChange(items, () => {
|
|
@@ -150,7 +240,7 @@ function SearchDialogList({ items = null, Empty = () => /* @__PURE__ */ jsx("div
|
|
|
150
240
|
className: cn("overflow-hidden h-(--fd-animated-height) transition-[height]", props.className),
|
|
151
241
|
children: /* @__PURE__ */ jsx("div", {
|
|
152
242
|
className: cn("w-full flex flex-col overflow-y-auto max-h-[460px] p-1", !items && "hidden"),
|
|
153
|
-
children: /* @__PURE__ */ jsxs(ListContext
|
|
243
|
+
children: /* @__PURE__ */ jsxs(ListContext, {
|
|
154
244
|
value: useMemo(() => ({
|
|
155
245
|
active,
|
|
156
246
|
setActive
|
|
@@ -163,7 +253,10 @@ function SearchDialogList({ items = null, Empty = () => /* @__PURE__ */ jsx("div
|
|
|
163
253
|
})
|
|
164
254
|
});
|
|
165
255
|
}
|
|
166
|
-
function SearchDialogListItem({ item, className, children,
|
|
256
|
+
function SearchDialogListItem({ item, className, children, renderMarkdown = (s) => /* @__PURE__ */ jsx(mdRenderer.Markdown, {
|
|
257
|
+
components: mdComponents,
|
|
258
|
+
children: s
|
|
259
|
+
}), renderHighlights: _, ...props }) {
|
|
167
260
|
const { active: activeId, setActive } = useSearchList();
|
|
168
261
|
const active = item.id === activeId;
|
|
169
262
|
if (item.type === "action") children ??= item.node;
|
|
@@ -176,9 +269,10 @@ function SearchDialogListItem({ item, className, children, renderHighlights: ren
|
|
|
176
269
|
role: "none",
|
|
177
270
|
className: "absolute start-3 inset-y-0 w-px bg-fd-border"
|
|
178
271
|
}),
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
|
|
181
|
-
|
|
272
|
+
item.type === "heading" && /* @__PURE__ */ jsx(Hash, { className: "absolute start-6 top-2.5 size-4 text-fd-muted-foreground" }),
|
|
273
|
+
/* @__PURE__ */ jsx("div", {
|
|
274
|
+
className: cn("min-w-0", item.type === "text" && "ps-4", item.type === "heading" && "ps-8", item.type === "page" || item.type === "heading" ? "font-medium" : "text-fd-popover-foreground/80"),
|
|
275
|
+
children: typeof item.content === "string" ? renderMarkdown(item.content) : item.content
|
|
182
276
|
})
|
|
183
277
|
] });
|
|
184
278
|
return /* @__PURE__ */ jsx("button", {
|
|
@@ -191,7 +285,7 @@ function SearchDialogListItem({ item, className, children, renderHighlights: ren
|
|
|
191
285
|
});
|
|
192
286
|
}, [active]),
|
|
193
287
|
"aria-selected": active,
|
|
194
|
-
className: cn("relative select-none px-2.5 py-2 text-start text-sm rounded-lg", active && "bg-fd-accent text-fd-accent-foreground", className),
|
|
288
|
+
className: cn("relative select-none shrink-0 px-2.5 py-2 text-start text-sm overflow-hidden rounded-lg", active && "bg-fd-accent text-fd-accent-foreground", className),
|
|
195
289
|
onPointerMove: () => setActive(item.id),
|
|
196
290
|
...props,
|
|
197
291
|
children
|
|
@@ -206,19 +300,17 @@ function SearchDialogIcon(props) {
|
|
|
206
300
|
}
|
|
207
301
|
const itemVariants = cva("rounded-md border px-2 py-0.5 text-xs font-medium text-fd-muted-foreground transition-colors", { variants: { active: { true: "bg-fd-accent text-fd-accent-foreground" } } });
|
|
208
302
|
function TagsList({ tag, onTagChange, allowClear = false, ...props }) {
|
|
303
|
+
const onTagChangeCallback = useRef(onTagChange);
|
|
304
|
+
onTagChangeCallback.current = onTagChange;
|
|
209
305
|
return /* @__PURE__ */ jsx("div", {
|
|
210
306
|
...props,
|
|
211
307
|
className: cn("flex items-center gap-1 flex-wrap", props.className),
|
|
212
|
-
children: /* @__PURE__ */ jsx(TagsListContext
|
|
308
|
+
children: /* @__PURE__ */ jsx(TagsListContext, {
|
|
213
309
|
value: useMemo(() => ({
|
|
214
310
|
value: tag,
|
|
215
|
-
onValueChange:
|
|
311
|
+
onValueChange: (v) => onTagChangeCallback.current(v),
|
|
216
312
|
allowClear
|
|
217
|
-
}), [
|
|
218
|
-
allowClear,
|
|
219
|
-
onTagChange,
|
|
220
|
-
tag
|
|
221
|
-
]),
|
|
313
|
+
}), [allowClear, tag]),
|
|
222
314
|
children: props.children
|
|
223
315
|
})
|
|
224
316
|
});
|
|
@@ -233,25 +325,14 @@ function TagsListItem({ value, className, ...props }) {
|
|
|
233
325
|
active: selected,
|
|
234
326
|
className
|
|
235
327
|
})),
|
|
236
|
-
onClick: () =>
|
|
237
|
-
onValueChange(selected && allowClear ? void 0 : value);
|
|
238
|
-
},
|
|
328
|
+
onClick: () => onValueChange(selected && allowClear ? void 0 : value),
|
|
239
329
|
tabIndex: -1,
|
|
240
330
|
...props,
|
|
241
331
|
children: props.children
|
|
242
332
|
});
|
|
243
333
|
}
|
|
244
|
-
function renderHighlights(highlights) {
|
|
245
|
-
return highlights.map((node, i) => {
|
|
246
|
-
if (node.styles?.highlight) return /* @__PURE__ */ jsx("span", {
|
|
247
|
-
className: "text-fd-primary underline",
|
|
248
|
-
children: node.content
|
|
249
|
-
}, i);
|
|
250
|
-
return /* @__PURE__ */ jsx(Fragment, { children: node.content }, i);
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
334
|
function useSearch() {
|
|
254
|
-
const ctx = use(
|
|
335
|
+
const ctx = use(RootContext);
|
|
255
336
|
if (!ctx) throw new Error("Missing <SearchDialog />");
|
|
256
337
|
return ctx;
|
|
257
338
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","names":["SearchIcon"],"sources":["../../../src/components/dialog/search.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronRight, Hash, Search as SearchIcon } from 'lucide-react';\nimport {\n type ComponentProps,\n createContext,\n Fragment,\n type ReactNode,\n use,\n useCallback,\n useEffect,\n useEffectEvent,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { I18nLabel, useI18n } from '@/contexts/i18n';\nimport { cn } from '@/utils/cn';\nimport { Dialog } from '@base-ui/react/dialog';\nimport type { HighlightedText, ReactSortedResult as BaseResultType } from 'fumadocs-core/search';\nimport { cva } from 'class-variance-authority';\nimport { useRouter } from 'fumadocs-core/framework';\nimport type { SharedProps } from '@/contexts/search';\nimport { useOnChange } from 'fumadocs-core/utils/use-on-change';\nimport scrollIntoView from 'scroll-into-view-if-needed';\nimport { buttonVariants } from '@/components/ui/button';\n\nexport type SearchItemType =\n | (BaseResultType & {\n external?: boolean;\n })\n | {\n id: string;\n type: 'action';\n node: ReactNode;\n onSelect: () => void;\n };\n\n// needed for backward compatible since some previous guides referenced it\nexport type { SharedProps };\n\nexport interface SearchDialogProps extends SharedProps {\n search: string;\n onSearchChange: (v: string) => void;\n onSelect?: (item: SearchItemType) => void;\n isLoading?: boolean;\n\n children: ReactNode;\n}\n\nconst Context = createContext<{\n open: boolean;\n onOpenChange: (open: boolean) => void;\n search: string;\n onSearchChange: (v: string) => void;\n onSelect: (item: SearchItemType) => void;\n isLoading: boolean;\n} | null>(null);\n\nconst ListContext = createContext<{\n active: string | null;\n setActive: (v: string | null) => void;\n} | null>(null);\n\nconst TagsListContext = createContext<{\n value?: string;\n onValueChange: (value: string | undefined) => void;\n allowClear: boolean;\n} | null>(null);\n\nexport function SearchDialog({\n open,\n onOpenChange,\n search,\n onSearchChange,\n isLoading = false,\n onSelect: onSelectProp,\n children,\n}: SearchDialogProps) {\n const router = useRouter();\n const onSelect = useEffectEvent((item: SearchItemType) => {\n if (item.type === 'action') {\n item.onSelect();\n } else if (item.external) {\n window.open(item.url, '_blank')?.focus();\n } else {\n router.push(item.url);\n }\n\n onOpenChange(false);\n onSelectProp?.(item);\n });\n\n return (\n <Dialog.Root open={open} onOpenChange={onOpenChange}>\n <Context.Provider\n value={useMemo(\n () => ({\n open,\n onOpenChange,\n search,\n onSearchChange,\n // eslint-disable-next-line react-hooks/rules-of-hooks -- used in child components\n onSelect,\n isLoading,\n }),\n [isLoading, onOpenChange, onSearchChange, open, search],\n )}\n >\n {children}\n </Context.Provider>\n </Dialog.Root>\n );\n}\n\nexport function SearchDialogHeader(props: ComponentProps<'div'>) {\n return <div {...props} className={cn('flex flex-row items-center gap-2 p-3', props.className)} />;\n}\n\nexport function SearchDialogInput(props: ComponentProps<'input'>) {\n const { text } = useI18n();\n const { search, onSearchChange } = useSearch();\n\n return (\n <input\n {...props}\n value={search}\n onChange={(e) => onSearchChange(e.target.value)}\n placeholder={text.search}\n className=\"w-0 flex-1 bg-transparent text-lg placeholder:text-fd-muted-foreground focus-visible:outline-none\"\n />\n );\n}\n\nexport function SearchDialogClose({\n children = 'ESC',\n className,\n ...props\n}: ComponentProps<'button'>) {\n const { onOpenChange } = useSearch();\n\n return (\n <button\n type=\"button\"\n onClick={() => onOpenChange(false)}\n className={cn(\n buttonVariants({\n color: 'outline',\n size: 'sm',\n className: 'font-mono text-fd-muted-foreground',\n }),\n className,\n )}\n {...props}\n >\n {children}\n </button>\n );\n}\n\nexport function SearchDialogFooter(props: ComponentProps<'div'>) {\n return <div {...props} className={cn('bg-fd-secondary/50 p-3 empty:hidden', props.className)} />;\n}\n\nexport function SearchDialogOverlay({\n className,\n ...props\n}: ComponentProps<typeof Dialog.Backdrop>) {\n return (\n <Dialog.Backdrop\n {...props}\n className={(s) =>\n cn(\n 'fixed inset-0 z-50 backdrop-blur-xs bg-fd-overlay data-[open]:animate-fd-fade-in data-[closed]:animate-fd-fade-out',\n typeof className === 'function' ? className(s) : className,\n )\n }\n />\n );\n}\n\nexport function SearchDialogContent({\n children,\n className,\n ...props\n}: ComponentProps<typeof Dialog.Popup>) {\n const { text } = useI18n();\n\n return (\n <Dialog.Portal>\n <Dialog.Popup\n aria-describedby={undefined}\n {...props}\n className={(s) =>\n cn(\n 'fixed left-1/2 top-4 md:top-[calc(50%-250px)] z-50 w-[calc(100%-1rem)] max-w-screen-sm -translate-x-1/2 rounded-xl border bg-fd-popover text-fd-popover-foreground shadow-2xl shadow-black/50 overflow-hidden data-[closed]:animate-fd-dialog-out data-[open]:animate-fd-dialog-in',\n '*:border-b *:has-[+:last-child[data-empty=true]]:border-b-0 *:data-[empty=true]:border-b-0 *:last:border-b-0',\n typeof className === 'function' ? className(s) : className,\n )\n }\n >\n <Dialog.Title className=\"hidden\">{text.search}</Dialog.Title>\n {children}\n </Dialog.Popup>\n </Dialog.Portal>\n );\n}\n\nexport function SearchDialogList({\n items = null,\n Empty = () => (\n <div className=\"py-12 text-center text-sm text-fd-muted-foreground\">\n <I18nLabel label=\"searchNoResult\" />\n </div>\n ),\n Item = (props) => <SearchDialogListItem {...props} />,\n ...props\n}: Omit<ComponentProps<'div'>, 'children'> & {\n items: SearchItemType[] | null | undefined;\n /**\n * Renderer for empty list UI\n */\n Empty?: () => ReactNode;\n /**\n * Renderer for items\n */\n Item?: (props: { item: SearchItemType; onClick: () => void }) => ReactNode;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n const { onSelect } = useSearch();\n const [active, setActive] = useState<string | null>(() =>\n items && items.length > 0 ? items[0].id : null,\n );\n\n const onKey = useEffectEvent((e: KeyboardEvent) => {\n if (!items || e.isComposing) return;\n\n if (e.key === 'ArrowDown' || e.key == 'ArrowUp') {\n let idx = items.findIndex((item) => item.id === active);\n if (idx === -1) idx = 0;\n else if (e.key === 'ArrowDown') idx++;\n else idx--;\n\n setActive(items.at(idx % items.length)?.id ?? null);\n e.preventDefault();\n }\n\n if (e.key === 'Enter') {\n const selected = items.find((item) => item.id === active);\n\n if (selected) onSelect(selected);\n e.preventDefault();\n }\n });\n\n useEffect(() => {\n const element = ref.current;\n if (!element) return;\n\n const observer = new ResizeObserver(() => {\n const viewport = element.firstElementChild!;\n\n element.style.setProperty('--fd-animated-height', `${viewport.clientHeight}px`);\n });\n\n const viewport = element.firstElementChild;\n if (viewport) observer.observe(viewport);\n\n window.addEventListener('keydown', onKey);\n return () => {\n observer.disconnect();\n window.removeEventListener('keydown', onKey);\n };\n }, []);\n\n useOnChange(items, () => {\n if (items && items.length > 0) {\n setActive(items[0].id);\n }\n });\n\n return (\n <div\n {...props}\n ref={ref}\n data-empty={items === null}\n className={cn(\n 'overflow-hidden h-(--fd-animated-height) transition-[height]',\n props.className,\n )}\n >\n <div\n className={cn('w-full flex flex-col overflow-y-auto max-h-[460px] p-1', !items && 'hidden')}\n >\n <ListContext.Provider\n value={useMemo(\n () => ({\n active,\n setActive,\n }),\n [active],\n )}\n >\n {items?.length === 0 && Empty()}\n\n {items?.map((item) => (\n <Fragment key={item.id}>{Item({ item, onClick: () => onSelect(item) })}</Fragment>\n ))}\n </ListContext.Provider>\n </div>\n </div>\n );\n}\n\nexport function SearchDialogListItem({\n item,\n className,\n children,\n renderHighlights: render = renderHighlights,\n ...props\n}: ComponentProps<'button'> & {\n renderHighlights?: typeof renderHighlights;\n item: SearchItemType;\n}) {\n const { active: activeId, setActive } = useSearchList();\n const active = item.id === activeId;\n\n if (item.type === 'action') {\n children ??= item.node;\n } else {\n children ??= (\n <>\n <div className=\"inline-flex items-center text-fd-muted-foreground text-xs empty:hidden\">\n {item.breadcrumbs?.map((item, i) => (\n <Fragment key={i}>\n {i > 0 && <ChevronRight className=\"size-4 rtl:rotate-180\" />}\n {item}\n </Fragment>\n ))}\n </div>\n\n {item.type !== 'page' && (\n <div role=\"none\" className=\"absolute start-3 inset-y-0 w-px bg-fd-border\" />\n )}\n <p\n className={cn(\n 'min-w-0 truncate',\n item.type !== 'page' && 'ps-4',\n item.type === 'page' || item.type === 'heading'\n ? 'font-medium'\n : 'text-fd-popover-foreground/80',\n )}\n >\n {item.type === 'heading' && (\n <Hash className=\"inline me-1 size-4 text-fd-muted-foreground\" />\n )}\n {item.contentWithHighlights ? render(item.contentWithHighlights) : item.content}\n </p>\n </>\n );\n }\n\n return (\n <button\n type=\"button\"\n ref={useCallback(\n (element: HTMLButtonElement | null) => {\n if (active && element) {\n scrollIntoView(element, {\n scrollMode: 'if-needed',\n block: 'nearest',\n boundary: element.parentElement,\n });\n }\n },\n [active],\n )}\n aria-selected={active}\n className={cn(\n 'relative select-none px-2.5 py-2 text-start text-sm rounded-lg',\n active && 'bg-fd-accent text-fd-accent-foreground',\n className,\n )}\n onPointerMove={() => setActive(item.id)}\n {...props}\n >\n {children}\n </button>\n );\n}\n\nexport function SearchDialogIcon(props: ComponentProps<'svg'>) {\n const { isLoading } = useSearch();\n\n return (\n <SearchIcon\n {...props}\n className={cn(\n 'size-5 text-fd-muted-foreground',\n isLoading && 'animate-pulse duration-400',\n props.className,\n )}\n />\n );\n}\n\nexport interface TagsListProps extends ComponentProps<'div'> {\n tag?: string;\n onTagChange: (tag: string | undefined) => void;\n allowClear?: boolean;\n}\n\nconst itemVariants = cva(\n 'rounded-md border px-2 py-0.5 text-xs font-medium text-fd-muted-foreground transition-colors',\n {\n variants: {\n active: {\n true: 'bg-fd-accent text-fd-accent-foreground',\n },\n },\n },\n);\n\nexport function TagsList({ tag, onTagChange, allowClear = false, ...props }: TagsListProps) {\n return (\n <div {...props} className={cn('flex items-center gap-1 flex-wrap', props.className)}>\n <TagsListContext.Provider\n value={useMemo(\n () => ({\n value: tag,\n onValueChange: onTagChange,\n allowClear,\n }),\n [allowClear, onTagChange, tag],\n )}\n >\n {props.children}\n </TagsListContext.Provider>\n </div>\n );\n}\n\nexport function TagsListItem({\n value,\n className,\n ...props\n}: ComponentProps<'button'> & {\n value: string;\n}) {\n const { onValueChange, value: selectedValue, allowClear } = useTagsList();\n const selected = value === selectedValue;\n\n return (\n <button\n type=\"button\"\n data-active={selected}\n className={cn(itemVariants({ active: selected, className }))}\n onClick={() => {\n onValueChange(selected && allowClear ? undefined : value);\n }}\n tabIndex={-1}\n {...props}\n >\n {props.children}\n </button>\n );\n}\n\nfunction renderHighlights(highlights: HighlightedText<ReactNode>[]): ReactNode {\n return highlights.map((node, i) => {\n if (node.styles?.highlight) {\n return (\n <span key={i} className=\"text-fd-primary underline\">\n {node.content}\n </span>\n );\n }\n\n return <Fragment key={i}>{node.content}</Fragment>;\n });\n}\n\nexport function useSearch() {\n const ctx = use(Context);\n if (!ctx) throw new Error('Missing <SearchDialog />');\n return ctx;\n}\n\nexport function useTagsList() {\n const ctx = use(TagsListContext);\n if (!ctx) throw new Error('Missing <TagsList />');\n return ctx;\n}\n\nexport function useSearchList() {\n const ctx = use(ListContext);\n if (!ctx) throw new Error('Missing <SearchDialogList />');\n return ctx;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkDA,MAAM,UAAU,cAON,KAAK;AAEf,MAAM,cAAc,cAGV,KAAK;AAEf,MAAM,kBAAkB,cAId,KAAK;AAEf,SAAgB,aAAa,EAC3B,MACA,cACA,QACA,gBACA,YAAY,OACZ,UAAU,cACV,YACoB;CACpB,MAAM,SAAS,WAAW;CAC1B,MAAM,WAAW,gBAAgB,SAAyB;AACxD,MAAI,KAAK,SAAS,SAChB,MAAK,UAAU;WACN,KAAK,SACd,QAAO,KAAK,KAAK,KAAK,SAAS,EAAE,OAAO;MAExC,QAAO,KAAK,KAAK,IAAI;AAGvB,eAAa,MAAM;AACnB,iBAAe,KAAK;GACpB;AAEF,QACE,oBAAC,OAAO;EAAW;EAAoB;YACrC,oBAAC,QAAQ;GACP,OAAO,eACE;IACL;IACA;IACA;IACA;IAEA;IACA;IACD,GACD;IAAC;IAAW;IAAc;IAAgB;IAAM;IAAO,CACxD;GAEA;IACgB;GACP;;AAIlB,SAAgB,mBAAmB,OAA8B;AAC/D,QAAO,oBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,wCAAwC,MAAM,UAAU;GAAI;;AAGnG,SAAgB,kBAAkB,OAAgC;CAChE,MAAM,EAAE,SAAS,SAAS;CAC1B,MAAM,EAAE,QAAQ,mBAAmB,WAAW;AAE9C,QACE,oBAAC;EACC,GAAI;EACJ,OAAO;EACP,WAAW,MAAM,eAAe,EAAE,OAAO,MAAM;EAC/C,aAAa,KAAK;EAClB,WAAU;GACV;;AAIN,SAAgB,kBAAkB,EAChC,WAAW,OACX,WACA,GAAG,SACwB;CAC3B,MAAM,EAAE,iBAAiB,WAAW;AAEpC,QACE,oBAAC;EACC,MAAK;EACL,eAAe,aAAa,MAAM;EAClC,WAAW,GACT,eAAe;GACb,OAAO;GACP,MAAM;GACN,WAAW;GACZ,CAAC,EACF,UACD;EACD,GAAI;EAEH;GACM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;EACC,MAAK;EACL,eAAa;EACb,WAAW,GAAG,aAAa;GAAE,QAAQ;GAAU;GAAW,CAAC,CAAC;EAC5D,eAAe;AACb,iBAAc,YAAY,aAAa,SAAY,MAAM;;EAE3D,UAAU;EACV,GAAI;YAEH,MAAM;GACA;;AAIb,SAAS,iBAAiB,YAAqD;AAC7E,QAAO,WAAW,KAAK,MAAM,MAAM;AACjC,MAAI,KAAK,QAAQ,UACf,QACE,oBAAC;GAAa,WAAU;aACrB,KAAK;KADG,EAEJ;AAIX,SAAO,oBAAC,sBAAkB,KAAK,WAAT,EAA4B;GAClD;;AAGJ,SAAgB,YAAY;CAC1B,MAAM,MAAM,IAAI,QAAQ;AACxB,KAAI,CAAC,IAAK,OAAM,IAAI,MAAM,2BAA2B;AACrD,QAAO;;AAGT,SAAgB,cAAc;CAC5B,MAAM,MAAM,IAAI,gBAAgB;AAChC,KAAI,CAAC,IAAK,OAAM,IAAI,MAAM,uBAAuB;AACjD,QAAO;;AAGT,SAAgB,gBAAgB;CAC9B,MAAM,MAAM,IAAI,YAAY;AAC5B,KAAI,CAAC,IAAK,OAAM,IAAI,MAAM,+BAA+B;AACzD,QAAO"}
|
|
1
|
+
{"version":3,"file":"search.js","names":["SearchIcon"],"sources":["../../../src/components/dialog/search.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronRight, Hash, Search as SearchIcon } from 'lucide-react';\nimport {\n type ComponentProps,\n createContext,\n Fragment,\n type ReactNode,\n use,\n useCallback,\n useEffect,\n useEffectEvent,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { I18nLabel, useI18n } from '@/contexts/i18n';\nimport { cn } from '@/utils/cn';\nimport { Dialog } from '@base-ui/react/dialog';\nimport type { HighlightedText, ReactSortedResult } from 'fumadocs-core/search';\nimport { cva } from 'class-variance-authority';\nimport { useRouter } from 'fumadocs-core/framework';\nimport type { SharedProps } from '@/contexts/search';\nimport { useOnChange } from 'fumadocs-core/utils/use-on-change';\nimport scrollIntoView from 'scroll-into-view-if-needed';\nimport { buttonVariants } from '@/components/ui/button';\nimport { createMarkdownRenderer } from 'fumadocs-core/content/md';\nimport rehypeRaw from 'rehype-raw';\nimport { visit } from 'unist-util-visit';\nimport type { Transformer } from 'unified';\nimport type { Root } from 'hast';\n\nexport type SearchItemType =\n | (ReactSortedResult & {\n external?: boolean;\n })\n | {\n id: string;\n type: 'action';\n node: ReactNode;\n onSelect: () => void;\n };\n\n// needed for backward compatible since some previous guides referenced it\nexport type { SharedProps };\n\nexport interface SearchDialogProps extends SharedProps {\n search: string;\n onSearchChange: (v: string) => void;\n onSelect?: (item: SearchItemType) => void;\n isLoading?: boolean;\n\n children: ReactNode;\n}\n\nconst RootContext = createContext<{\n open: boolean;\n onOpenChange: (open: boolean) => void;\n search: string;\n onSearchChange: (v: string) => void;\n onSelect: (item: SearchItemType) => void;\n isLoading: boolean;\n} | null>(null);\n\nconst ListContext = createContext<{\n active: string | null;\n setActive: (v: string | null) => void;\n} | null>(null);\n\nconst TagsListContext = createContext<{\n value?: string;\n onValueChange: (value: string | undefined) => void;\n allowClear: boolean;\n} | null>(null);\n\nconst PreContext = createContext(false);\n\nconst mdRenderer = createMarkdownRenderer({\n remarkRehypeOptions: {\n allowDangerousHtml: true,\n },\n rehypePlugins: [rehypeRaw, rehypeCustomElements],\n});\n\nconst mdComponents = {\n mark(props: ComponentProps<'mark'>) {\n return <span {...props} className=\"text-fd-primary underline\" />;\n },\n a: 'span',\n p(props: ComponentProps<'p'>) {\n return <p {...props} className=\"min-w-0\" />;\n },\n strong(props: ComponentProps<'strong'>) {\n return <strong {...props} className=\"text-fd-accent-foreground font-medium\" />;\n },\n code(props: ComponentProps<'pre'>) {\n // eslint-disable-next-line react-hooks/rules-of-hooks -- this is a component\n const inPre = use(PreContext);\n if (inPre)\n return (\n <code\n {...props}\n className=\"mask-[linear-gradient(to_bottom,white,white_30px,transparent_80px)]\"\n />\n );\n\n return (\n <code\n {...props}\n className=\"border rounded-md px-px bg-fd-secondary text-fd-secondary-foreground\"\n />\n );\n },\n custom({\n _tagName = 'fragment',\n children,\n ...rest\n }: Record<string, unknown> & { _tagName: string; children: ReactNode }) {\n return (\n <span className=\"inline-flex max-w-full items-center border p-0.5 rounded-md bg-fd-card text-fd-card-foreground divide-x divide-fd-border\">\n <code className=\"rounded-sm px-0.5 me-1 bg-fd-primary font-medium text-xs text-fd-primary-foreground border-none\">\n {_tagName}\n </code>\n {Object.entries(rest).map(([k, v]) => {\n if (typeof v !== 'string') return;\n\n return (\n <code key={k} className=\"truncate text-xs text-fd-muted-foreground px-1\">\n <span className=\"text-fd-card-foreground\">{k}: </span>\n {v}\n </code>\n );\n })}\n {children && <span className=\"ps-1\">{children}</span>}\n </span>\n );\n },\n pre(props: ComponentProps<'pre'>) {\n return (\n <pre\n {...props}\n className={cn(\n 'flex flex-col border rounded-md my-0.5 p-2 bg-fd-secondary text-fd-secondary-foreground max-h-20 overflow-hidden',\n props.className,\n )}\n >\n <PreContext value={true}>{props.children}</PreContext>\n </pre>\n );\n },\n};\n\nfunction rehypeCustomElements(): Transformer<Root, Root> {\n return (tree) => {\n visit(tree, (node) => {\n if (\n node.type === 'element' &&\n document.createElement(node.tagName) instanceof HTMLUnknownElement\n ) {\n node.properties._tagName = node.tagName;\n node.tagName = 'custom';\n }\n });\n };\n}\n\nexport function SearchDialog({\n open,\n onOpenChange,\n search,\n onSearchChange,\n isLoading = false,\n onSelect: onSelectProp,\n children,\n}: SearchDialogProps) {\n const router = useRouter();\n const onOpenChangeCallback = useRef(onOpenChange);\n onOpenChangeCallback.current = onOpenChange;\n const onSearchChangeCallback = useRef(onSearchChange);\n onSearchChangeCallback.current = onSearchChange;\n const onSelect = (item: SearchItemType) => {\n if (item.type === 'action') {\n item.onSelect();\n } else if (item.external) {\n window.open(item.url, '_blank')?.focus();\n } else {\n router.push(item.url);\n }\n\n onOpenChange(false);\n onSelectProp?.(item);\n };\n const onSelectCallback = useRef(onSelect);\n onSelectCallback.current = onSelect;\n\n return (\n <Dialog.Root open={open} onOpenChange={onOpenChange}>\n <RootContext\n value={useMemo(\n () => ({\n open,\n search,\n isLoading,\n onOpenChange: (v) => onOpenChangeCallback.current(v),\n onSearchChange: (v) => onSearchChangeCallback.current(v),\n onSelect: (v) => onSelectCallback.current(v),\n }),\n [isLoading, open, search],\n )}\n >\n {children}\n </RootContext>\n </Dialog.Root>\n );\n}\n\nexport function SearchDialogHeader(props: ComponentProps<'div'>) {\n return <div {...props} className={cn('flex flex-row items-center gap-2 p-3', props.className)} />;\n}\n\nexport function SearchDialogInput(props: ComponentProps<'input'>) {\n const { text } = useI18n();\n const { search, onSearchChange } = useSearch();\n\n return (\n <input\n {...props}\n value={search}\n onChange={(e) => onSearchChange(e.target.value)}\n placeholder={text.search}\n className=\"w-0 flex-1 bg-transparent text-lg placeholder:text-fd-muted-foreground focus-visible:outline-none\"\n />\n );\n}\n\nexport function SearchDialogClose({\n children = 'ESC',\n className,\n ...props\n}: ComponentProps<'button'>) {\n const { onOpenChange } = useSearch();\n\n return (\n <button\n type=\"button\"\n onClick={() => onOpenChange(false)}\n className={cn(\n buttonVariants({\n color: 'outline',\n size: 'sm',\n className: 'font-mono text-fd-muted-foreground',\n }),\n className,\n )}\n {...props}\n >\n {children}\n </button>\n );\n}\n\nexport function SearchDialogFooter(props: ComponentProps<'div'>) {\n return <div {...props} className={cn('bg-fd-secondary/50 p-3 empty:hidden', props.className)} />;\n}\n\nexport function SearchDialogOverlay({\n className,\n ...props\n}: ComponentProps<typeof Dialog.Backdrop>) {\n return (\n <Dialog.Backdrop\n {...props}\n className={(s) =>\n cn(\n 'fixed inset-0 z-50 backdrop-blur-xs bg-fd-overlay data-open:animate-fd-fade-in data-closed:animate-fd-fade-out',\n typeof className === 'function' ? className(s) : className,\n )\n }\n />\n );\n}\n\nexport function SearchDialogContent({\n children,\n className,\n ...props\n}: ComponentProps<typeof Dialog.Popup>) {\n const { text } = useI18n();\n\n return (\n <Dialog.Portal>\n <Dialog.Popup\n id=\"fd-search-dialog-content\"\n aria-describedby={undefined}\n {...props}\n className={(s) =>\n cn(\n 'fixed left-1/2 top-4 md:top-[calc(50%-250px)] z-50 w-[calc(100%-1rem)] max-w-screen-sm -translate-x-1/2 rounded-xl border bg-fd-popover text-fd-popover-foreground shadow-2xl overflow-hidden data-closed:animate-fd-dialog-out data-open:animate-fd-dialog-in focus-visible:outline-none',\n '*:border-b *:has-[+:last-child[data-empty=true]]:border-b-0 *:data-[empty=true]:border-b-0 *:last:border-b-0',\n typeof className === 'function' ? className(s) : className,\n )\n }\n >\n <Dialog.Title className=\"hidden\">{text.search}</Dialog.Title>\n {children}\n </Dialog.Popup>\n </Dialog.Portal>\n );\n}\n\nexport function SearchDialogList({\n items = null,\n Empty = () => (\n <div className=\"py-12 text-center text-sm text-fd-muted-foreground\">\n <I18nLabel label=\"searchNoResult\" />\n </div>\n ),\n Item = (props) => <SearchDialogListItem {...props} />,\n ...props\n}: Omit<ComponentProps<'div'>, 'children'> & {\n items: SearchItemType[] | null | undefined;\n /**\n * Renderer for empty list UI\n */\n Empty?: () => ReactNode;\n /**\n * Renderer for items\n */\n Item?: (props: { item: SearchItemType; onClick: () => void }) => ReactNode;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n const { onSelect } = useSearch();\n const [active, setActive] = useState<string | null>(() =>\n items && items.length > 0 ? items[0].id : null,\n );\n\n const onKey = useEffectEvent((e: KeyboardEvent) => {\n if (!items || e.isComposing) return;\n\n if (e.key === 'ArrowDown' || e.key == 'ArrowUp') {\n let idx = items.findIndex((item) => item.id === active);\n if (idx === -1) idx = 0;\n else if (e.key === 'ArrowDown') idx++;\n else idx--;\n\n setActive(items.at(idx % items.length)?.id ?? null);\n e.preventDefault();\n }\n\n if (e.key === 'Enter') {\n const selected = items.find((item) => item.id === active);\n\n if (selected) onSelect(selected);\n e.preventDefault();\n }\n });\n\n useEffect(() => {\n const element = ref.current;\n if (!element) return;\n\n const observer = new ResizeObserver(() => {\n const viewport = element.firstElementChild!;\n\n element.style.setProperty('--fd-animated-height', `${viewport.clientHeight}px`);\n });\n\n const viewport = element.firstElementChild;\n if (viewport) observer.observe(viewport);\n\n const content: Pick<Window, 'addEventListener' | 'removeEventListener'> =\n document.getElementById('fd-search-dialog-content') ?? window;\n content.addEventListener('keydown', onKey);\n return () => {\n observer.disconnect();\n content.removeEventListener('keydown', onKey);\n };\n }, []);\n\n useOnChange(items, () => {\n if (items && items.length > 0) {\n setActive(items[0].id);\n }\n });\n\n return (\n <div\n {...props}\n ref={ref}\n data-empty={items === null}\n className={cn(\n 'overflow-hidden h-(--fd-animated-height) transition-[height]',\n props.className,\n )}\n >\n <div\n className={cn('w-full flex flex-col overflow-y-auto max-h-[460px] p-1', !items && 'hidden')}\n >\n <ListContext\n value={useMemo(\n () => ({\n active,\n setActive,\n }),\n [active],\n )}\n >\n {items?.length === 0 && Empty()}\n\n {items?.map((item) => (\n <Fragment key={item.id}>{Item({ item, onClick: () => onSelect(item) })}</Fragment>\n ))}\n </ListContext>\n </div>\n </div>\n );\n}\n\nexport function SearchDialogListItem({\n item,\n className,\n children,\n renderMarkdown = (s) => <mdRenderer.Markdown components={mdComponents}>{s}</mdRenderer.Markdown>,\n renderHighlights: _,\n ...props\n}: ComponentProps<'button'> & {\n renderMarkdown?: (v: string) => ReactNode;\n /** @deprecated highlight blocks is now wrapped in `<mark />`, use `renderMarkdown` to handle instead. */\n renderHighlights?: (blocks: HighlightedText<ReactNode>[]) => ReactNode;\n item: SearchItemType;\n}) {\n const { active: activeId, setActive } = useSearchList();\n const active = item.id === activeId;\n\n if (item.type === 'action') {\n children ??= item.node;\n } else {\n children ??= (\n <>\n <div className=\"inline-flex items-center text-fd-muted-foreground text-xs empty:hidden\">\n {item.breadcrumbs?.map((item, i) => (\n <Fragment key={i}>\n {i > 0 && <ChevronRight className=\"size-4 rtl:rotate-180\" />}\n {item}\n </Fragment>\n ))}\n </div>\n\n {item.type !== 'page' && (\n <div role=\"none\" className=\"absolute start-3 inset-y-0 w-px bg-fd-border\" />\n )}\n {item.type === 'heading' && (\n <Hash className=\"absolute start-6 top-2.5 size-4 text-fd-muted-foreground\" />\n )}\n <div\n className={cn(\n 'min-w-0',\n item.type === 'text' && 'ps-4',\n item.type === 'heading' && 'ps-8',\n item.type === 'page' || item.type === 'heading'\n ? 'font-medium'\n : 'text-fd-popover-foreground/80',\n )}\n >\n {typeof item.content === 'string' ? renderMarkdown(item.content) : item.content}\n </div>\n </>\n );\n }\n\n return (\n <button\n type=\"button\"\n ref={useCallback(\n (element: HTMLButtonElement | null) => {\n if (active && element) {\n scrollIntoView(element, {\n scrollMode: 'if-needed',\n block: 'nearest',\n boundary: element.parentElement,\n });\n }\n },\n [active],\n )}\n aria-selected={active}\n className={cn(\n 'relative select-none shrink-0 px-2.5 py-2 text-start text-sm overflow-hidden rounded-lg',\n active && 'bg-fd-accent text-fd-accent-foreground',\n className,\n )}\n onPointerMove={() => setActive(item.id)}\n {...props}\n >\n {children}\n </button>\n );\n}\nexport function SearchDialogIcon(props: ComponentProps<'svg'>) {\n const { isLoading } = useSearch();\n\n return (\n <SearchIcon\n {...props}\n className={cn(\n 'size-5 text-fd-muted-foreground',\n isLoading && 'animate-pulse duration-400',\n props.className,\n )}\n />\n );\n}\n\nexport interface TagsListProps extends ComponentProps<'div'> {\n tag?: string;\n onTagChange: (tag: string | undefined) => void;\n allowClear?: boolean;\n}\n\nconst itemVariants = cva(\n 'rounded-md border px-2 py-0.5 text-xs font-medium text-fd-muted-foreground transition-colors',\n {\n variants: {\n active: {\n true: 'bg-fd-accent text-fd-accent-foreground',\n },\n },\n },\n);\nexport function TagsList({ tag, onTagChange, allowClear = false, ...props }: TagsListProps) {\n const onTagChangeCallback = useRef(onTagChange);\n onTagChangeCallback.current = onTagChange;\n return (\n <div {...props} className={cn('flex items-center gap-1 flex-wrap', props.className)}>\n <TagsListContext\n value={useMemo(\n () => ({\n value: tag,\n onValueChange: (v) => onTagChangeCallback.current(v),\n allowClear,\n }),\n [allowClear, tag],\n )}\n >\n {props.children}\n </TagsListContext>\n </div>\n );\n}\n\nexport function TagsListItem({\n value,\n className,\n ...props\n}: ComponentProps<'button'> & {\n value: string;\n}) {\n const { onValueChange, value: selectedValue, allowClear } = useTagsList();\n const selected = value === selectedValue;\n\n return (\n <button\n type=\"button\"\n data-active={selected}\n className={cn(itemVariants({ active: selected, className }))}\n onClick={() => onValueChange(selected && allowClear ? undefined : value)}\n tabIndex={-1}\n {...props}\n >\n {props.children}\n </button>\n );\n}\n\nexport function useSearch() {\n const ctx = use(RootContext);\n if (!ctx) throw new Error('Missing <SearchDialog />');\n return ctx;\n}\n\nexport function useTagsList() {\n const ctx = use(TagsListContext);\n if (!ctx) throw new Error('Missing <TagsList />');\n return ctx;\n}\n\nexport function useSearchList() {\n const ctx = use(ListContext);\n if (!ctx) throw new Error('Missing <SearchDialogList />');\n return ctx;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuDA,MAAM,cAAc,cAOV,KAAK;AAEf,MAAM,cAAc,cAGV,KAAK;AAEf,MAAM,kBAAkB,cAId,KAAK;AAEf,MAAM,aAAa,cAAc,MAAM;AAEvC,MAAM,aAAa,uBAAuB;CACxC,qBAAqB,EACnB,oBAAoB,MACrB;CACD,eAAe,CAAC,WAAW,qBAAqB;CACjD,CAAC;AAEF,MAAM,eAAe;CACnB,KAAK,OAA+B;AAClC,SAAO,oBAAC;GAAK,GAAI;GAAO,WAAU;IAA8B;;CAElE,GAAG;CACH,EAAE,OAA4B;AAC5B,SAAO,oBAAC;GAAE,GAAI;GAAO,WAAU;IAAY;;CAE7C,OAAO,OAAiC;AACtC,SAAO,oBAAC;GAAO,GAAI;GAAO,WAAU;IAA0C;;CAEhF,KAAK,OAA8B;AAGjC,MADc,IAAI,WAAW,CAE3B,QACE,oBAAC;GACC,GAAI;GACJ,WAAU;IACV;AAGN,SACE,oBAAC;GACC,GAAI;GACJ,WAAU;IACV;;CAGN,OAAO,EACL,WAAW,YACX,UACA,GAAG,QACmE;AACtE,SACE,qBAAC;GAA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IAAI,MAAM,uBAAuB;AACjD,QAAO;;AAGT,SAAgB,gBAAgB;CAC9B,MAAM,MAAM,IAAI,YAAY;AAC5B,KAAI,CAAC,IAAK,OAAM,IAAI,MAAM,+BAA+B;AACzD,QAAO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/type-table.d.ts
|
|
@@ -30,10 +30,13 @@ interface TypeNode {
|
|
|
30
30
|
returns?: ReactNode;
|
|
31
31
|
}
|
|
32
32
|
declare function TypeTable({
|
|
33
|
-
|
|
33
|
+
id,
|
|
34
|
+
type,
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
34
37
|
}: {
|
|
35
38
|
type: Record<string, TypeNode>;
|
|
36
|
-
}): react_jsx_runtime0.JSX.Element;
|
|
39
|
+
} & ComponentProps<'div'>): react_jsx_runtime0.JSX.Element;
|
|
37
40
|
//#endregion
|
|
38
41
|
export { ParameterNode, TypeNode, TypeTable };
|
|
39
42
|
//# sourceMappingURL=type-table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-table.d.ts","names":[],"sources":["../../src/components/type-table.tsx"],"mappings":";;;;UASiB,aAAA;EACf,IAAA;EACA,WAAA,EAAa,SAAA;AAAA;AAAA,UAGE,QAAA;;;;EAIf,WAAA,GAAc,SAAA;EAPD;;;EAYb,IAAA,EAAM,SAAA;EATiB;;;EAcvB,eAAA,GAAkB,SAAA;EAAA;;;EAKlB,mBAAA;EAEA,OAAA,GAAU,SAAA;EAEV,QAAA;EACA,UAAA;EAEA,UAAA,GAAa,aAAA;EAEb,OAAA,GAAU,SAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"type-table.d.ts","names":[],"sources":["../../src/components/type-table.tsx"],"mappings":";;;;UASiB,aAAA;EACf,IAAA;EACA,WAAA,EAAa,SAAA;AAAA;AAAA,UAGE,QAAA;;;;EAIf,WAAA,GAAc,SAAA;EAPD;;;EAYb,IAAA,EAAM,SAAA;EATiB;;;EAcvB,eAAA,GAAkB,SAAA;EAAA;;;EAKlB,mBAAA;EAEA,OAAA,GAAU,SAAA;EAEV,QAAA;EACA,UAAA;EAEA,UAAA,GAAa,aAAA;EAEb,OAAA,GAAU,SAAA;AAAA;AAAA,iBAKI,SAAA,CAAA;EACd,EAAA;EACA,IAAA;EACA,SAAA;EAAA,GACG;AAAA;EACA,IAAA,EAAM,MAAA,SAAe,QAAA;AAAA,IAAc,cAAA,UAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -2,47 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "../utils/cn.js";
|
|
4
4
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./ui/collapsible.js";
|
|
5
|
-
import { useState } from "react";
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
6
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import Link from "fumadocs-core/link";
|
|
8
8
|
import { ChevronDown } from "lucide-react";
|
|
9
9
|
import { cva } from "class-variance-authority";
|
|
10
10
|
|
|
11
11
|
//#region src/components/type-table.tsx
|
|
12
|
-
const keyVariants = cva("text-fd-primary", { variants: { deprecated: { true: "line-through text-fd-primary/50" } } });
|
|
13
12
|
const fieldVariants = cva("text-fd-muted-foreground not-prose pe-2");
|
|
14
|
-
function TypeTable({ type }) {
|
|
13
|
+
function TypeTable({ id, type, className, ...props }) {
|
|
15
14
|
return /* @__PURE__ */ jsxs("div", {
|
|
16
|
-
|
|
15
|
+
id,
|
|
16
|
+
className: cn("@container flex flex-col p-1 bg-fd-card text-fd-card-foreground rounded-2xl border my-6 text-sm overflow-hidden", className),
|
|
17
|
+
...props,
|
|
17
18
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
18
19
|
className: "flex font-medium items-center px-3 py-1 not-prose text-fd-muted-foreground",
|
|
19
20
|
children: [/* @__PURE__ */ jsx("p", {
|
|
20
|
-
className: "w-
|
|
21
|
+
className: "w-1/4",
|
|
21
22
|
children: "Prop"
|
|
22
23
|
}), /* @__PURE__ */ jsx("p", {
|
|
23
24
|
className: "@max-xl:hidden",
|
|
24
25
|
children: "Type"
|
|
25
26
|
})]
|
|
26
27
|
}), Object.entries(type).map(([key, value]) => /* @__PURE__ */ jsx(Item, {
|
|
28
|
+
parentId: id,
|
|
27
29
|
name: key,
|
|
28
30
|
item: value
|
|
29
31
|
}, key))]
|
|
30
32
|
});
|
|
31
33
|
}
|
|
32
|
-
function Item({ name, item: { parameters = [], description, required = false, deprecated, typeDescription, default: defaultValue, type, typeDescriptionLink, returns } }) {
|
|
34
|
+
function Item({ parentId, name, item: { parameters = [], description, required = false, deprecated, typeDescription, default: defaultValue, type, typeDescriptionLink, returns } }) {
|
|
33
35
|
const [open, setOpen] = useState(false);
|
|
36
|
+
const id = parentId ? `${parentId}-${name}` : void 0;
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
const hash = window.location.hash;
|
|
39
|
+
if (!id || !hash) return;
|
|
40
|
+
if (`#${id}` === hash) setOpen(true);
|
|
41
|
+
}, [id]);
|
|
34
42
|
return /* @__PURE__ */ jsxs(Collapsible, {
|
|
43
|
+
id,
|
|
35
44
|
open,
|
|
36
|
-
onOpenChange:
|
|
37
|
-
|
|
45
|
+
onOpenChange: (v) => {
|
|
46
|
+
if (v && id) window.history.replaceState(null, "", `#${id}`);
|
|
47
|
+
setOpen(v);
|
|
48
|
+
},
|
|
49
|
+
className: cn("rounded-xl border overflow-hidden scroll-m-20 transition-all", open ? "shadow-sm bg-fd-background not-last:mb-2" : "border-transparent"),
|
|
38
50
|
children: [/* @__PURE__ */ jsxs(CollapsibleTrigger, {
|
|
39
51
|
className: "relative flex flex-row items-center w-full group text-start px-3 py-2 not-prose hover:bg-fd-accent",
|
|
40
52
|
children: [
|
|
41
53
|
/* @__PURE__ */ jsxs("code", {
|
|
42
|
-
className: cn(
|
|
43
|
-
deprecated,
|
|
44
|
-
className: "min-w-fit w-[25%] font-medium pe-2"
|
|
45
|
-
})),
|
|
54
|
+
className: cn("text-fd-primary min-w-fit w-1/4 font-mono font-medium pe-2", deprecated && "line-through text-fd-primary/50"),
|
|
46
55
|
children: [name, !required && "?"]
|
|
47
56
|
}),
|
|
48
57
|
typeDescriptionLink ? /* @__PURE__ */ jsx(Link, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-table.js","names":[],"sources":["../../src/components/type-table.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronDown } from 'lucide-react';\nimport Link from 'fumadocs-core/link';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '@/utils/cn';\nimport { type ReactNode, useState } from 'react';\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';\n\nexport interface ParameterNode {\n name: string;\n description: ReactNode;\n}\n\nexport interface TypeNode {\n /**\n * Additional description of the field\n */\n description?: ReactNode;\n\n /**\n * type signature (short)\n */\n type: ReactNode;\n\n /**\n * type signature (full)\n */\n typeDescription?: ReactNode;\n\n /**\n * Optional `href` for the type\n */\n typeDescriptionLink?: string;\n\n default?: ReactNode;\n\n required?: boolean;\n deprecated?: boolean;\n\n parameters?: ParameterNode[];\n\n returns?: ReactNode;\n}\n\nconst
|
|
1
|
+
{"version":3,"file":"type-table.js","names":[],"sources":["../../src/components/type-table.tsx"],"sourcesContent":["'use client';\n\nimport { ChevronDown } from 'lucide-react';\nimport Link from 'fumadocs-core/link';\nimport { cva } from 'class-variance-authority';\nimport { cn } from '@/utils/cn';\nimport { type ComponentProps, type ReactNode, useEffect, useState } from 'react';\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';\n\nexport interface ParameterNode {\n name: string;\n description: ReactNode;\n}\n\nexport interface TypeNode {\n /**\n * Additional description of the field\n */\n description?: ReactNode;\n\n /**\n * type signature (short)\n */\n type: ReactNode;\n\n /**\n * type signature (full)\n */\n typeDescription?: ReactNode;\n\n /**\n * Optional `href` for the type\n */\n typeDescriptionLink?: string;\n\n default?: ReactNode;\n\n required?: boolean;\n deprecated?: boolean;\n\n parameters?: ParameterNode[];\n\n returns?: ReactNode;\n}\n\nconst fieldVariants = cva('text-fd-muted-foreground not-prose pe-2');\n\nexport function TypeTable({\n id,\n type,\n className,\n ...props\n}: { type: Record<string, TypeNode> } & ComponentProps<'div'>) {\n return (\n <div\n id={id}\n className={cn(\n '@container flex flex-col p-1 bg-fd-card text-fd-card-foreground rounded-2xl border my-6 text-sm overflow-hidden',\n className,\n )}\n {...props}\n >\n <div className=\"flex font-medium items-center px-3 py-1 not-prose text-fd-muted-foreground\">\n <p className=\"w-1/4\">Prop</p>\n <p className=\"@max-xl:hidden\">Type</p>\n </div>\n {Object.entries(type).map(([key, value]) => (\n <Item key={key} parentId={id} name={key} item={value} />\n ))}\n </div>\n );\n}\n\nfunction Item({\n parentId,\n name,\n item: {\n parameters = [],\n description,\n required = false,\n deprecated,\n typeDescription,\n default: defaultValue,\n type,\n typeDescriptionLink,\n returns,\n },\n}: {\n parentId?: string;\n name: string;\n item: TypeNode;\n}) {\n const [open, setOpen] = useState(false);\n const id = parentId ? `${parentId}-${name}` : undefined;\n\n useEffect(() => {\n const hash = window.location.hash;\n if (!id || !hash) return;\n if (`#${id}` === hash) setOpen(true);\n }, [id]);\n\n return (\n <Collapsible\n id={id}\n open={open}\n onOpenChange={(v) => {\n if (v && id) {\n window.history.replaceState(null, '', `#${id}`);\n }\n setOpen(v);\n }}\n className={cn(\n 'rounded-xl border overflow-hidden scroll-m-20 transition-all',\n open ? 'shadow-sm bg-fd-background not-last:mb-2' : 'border-transparent',\n )}\n >\n <CollapsibleTrigger className=\"relative flex flex-row items-center w-full group text-start px-3 py-2 not-prose hover:bg-fd-accent\">\n <code\n className={cn(\n 'text-fd-primary min-w-fit w-1/4 font-mono font-medium pe-2',\n deprecated && 'line-through text-fd-primary/50',\n )}\n >\n {name}\n {!required && '?'}\n </code>\n {typeDescriptionLink ? (\n <Link href={typeDescriptionLink} className=\"underline @max-xl:hidden\">\n {type}\n </Link>\n ) : (\n <span className=\"@max-xl:hidden\">{type}</span>\n )}\n <ChevronDown className=\"absolute end-2 size-4 text-fd-muted-foreground transition-transform group-data-[open]:rotate-180\" />\n </CollapsibleTrigger>\n <CollapsibleContent>\n <div className=\"grid grid-cols-[1fr_3fr] gap-y-4 text-sm p-3 overflow-auto fd-scroll-container border-t\">\n <div className=\"text-sm prose col-span-full prose-no-margin empty:hidden\">\n {description}\n </div>\n {typeDescription && (\n <>\n <p className={cn(fieldVariants())}>Type</p>\n <p className=\"my-auto not-prose\">{typeDescription}</p>\n </>\n )}\n {defaultValue && (\n <>\n <p className={cn(fieldVariants())}>Default</p>\n <p className=\"my-auto not-prose\">{defaultValue}</p>\n </>\n )}\n {parameters.length > 0 && (\n <>\n <p className={cn(fieldVariants())}>Parameters</p>\n <div className=\"flex flex-col gap-2\">\n {parameters.map((param) => (\n <div key={param.name} className=\"inline-flex items-center flex-wrap gap-1\">\n <p className=\"font-medium not-prose text-nowrap\">{param.name} -</p>\n <div className=\"text-sm prose prose-no-margin\">{param.description}</div>\n </div>\n ))}\n </div>\n </>\n )}\n {returns && (\n <>\n <p className={cn(fieldVariants())}>Returns</p>\n <div className=\"my-auto text-sm prose prose-no-margin\">{returns}</div>\n </>\n )}\n </div>\n </CollapsibleContent>\n </Collapsible>\n );\n}\n"],"mappings":";;;;;;;;;;;AA6CA,MAAM,gBAAgB,IAAI,0CAA0C;AAEpE,SAAgB,UAAU,EACxB,IACA,MACA,WACA,GAAG,SAC0D;AAC7D,QACE,qBAAC;EACK;EACJ,WAAW,GACT,mHACA,UACD;EACD,GAAI;aAEJ,qBAAC;GAAI,WAAU;cACb,oBAAC;IAAE,WAAU;cAAQ;KAAQ,EAC7B,oBAAC;IAAE,WAAU;cAAiB;KAAQ;IAClC,EACL,OAA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E,WAAW,GAAG,eAAe,CAAC;eAAE;MAAc,EACjD,oBAAC;KAAI,WAAU;eACZ,WAAW,KAAK,UACf,qBAAC;MAAqB,WAAU;iBAC9B,qBAAC;OAAE,WAAU;kBAAqC,MAAM,MAAK;QAAM,EACnE,oBAAC;OAAI,WAAU;iBAAiC,MAAM;QAAkB;QAFhE,MAAM,KAGV,CACN;MACE,IACL;IAEJ,WACC,8CACE,oBAAC;KAAE,WAAW,GAAG,eAAe,CAAC;eAAE;MAAW,EAC9C,oBAAC;KAAI,WAAU;eAAyC;MAAc,IACrE;;IAED,GACa;GACT"}
|
|
@@ -6,8 +6,8 @@ import * as _base_ui_react0 from "@base-ui/react";
|
|
|
6
6
|
type NavigationMenuContentProps = NavigationMenu.Content.Props;
|
|
7
7
|
type NavigationMenuTriggerProps = NavigationMenu.Trigger.Props;
|
|
8
8
|
declare const NavigationMenuRoot: React.ForwardRefExoticComponent<Omit<_base_ui_react0.NavigationMenuRootProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
9
|
-
declare const NavigationMenuList: React.ForwardRefExoticComponent<Omit<_base_ui_react0.NavigationMenuListProps, "ref"> & React.RefAttributes<
|
|
10
|
-
declare const NavigationMenuItem: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.NavigationMenuItemProps, "ref"> & React.RefAttributes<
|
|
9
|
+
declare const NavigationMenuList: React.ForwardRefExoticComponent<Omit<_base_ui_react0.NavigationMenuListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
10
|
+
declare const NavigationMenuItem: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.NavigationMenuItemProps, "ref"> & React.RefAttributes<HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
11
11
|
declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.NavigationMenuTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
12
|
declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.NavigationMenuContentProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
declare const NavigationMenuLink: React.ForwardRefExoticComponent<Omit<_base_ui_react0.NavigationMenuLinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu.d.ts","names":[],"sources":["../../../src/components/ui/navigation-menu.tsx"],"mappings":";;;;;KAKY,0BAAA,GAA6B,cAAA,CAAU,OAAA,CAAQ,KAAA;AAAA,KAC/C,0BAAA,GAA6B,cAAA,CAAU,OAAA,CAAQ,KAAA;AAAA,cAErD,kBAAA,EAAkB,KAAA,CAAA,yBAAA,CAAA,IAAA,CAAiB,eAAA,CAAjB,uBAAA,WAAA,KAAA,CAAA,aAAA,CAAA,WAAA;AAAA,cAElB,kBAAA,EAAkB,KAAA,CAAA,yBAAA,CAAA,IAAA,CAAiB,eAAA,CAAjB,uBAAA,WAAA,KAAA,CAAA,aAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"navigation-menu.d.ts","names":[],"sources":["../../../src/components/ui/navigation-menu.tsx"],"mappings":";;;;;KAKY,0BAAA,GAA6B,cAAA,CAAU,OAAA,CAAQ,KAAA;AAAA,KAC/C,0BAAA,GAA6B,cAAA,CAAU,OAAA,CAAQ,KAAA;AAAA,cAErD,kBAAA,EAAkB,KAAA,CAAA,yBAAA,CAAA,IAAA,CAAiB,eAAA,CAAjB,uBAAA,WAAA,KAAA,CAAA,aAAA,CAAA,WAAA;AAAA,cAElB,kBAAA,EAAkB,KAAA,CAAA,yBAAA,CAAA,IAAA,CAAiB,eAAA,CAAjB,uBAAA,WAAA,KAAA,CAAA,aAAA,CAAA,gBAAA;AAAA,cAElB,kBAAA,EAAkB,KAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAWtB,eAAA,CAXsB,uBAAA,WAAA,KAAA,CAAA,aAAA,CAAA,aAAA,YAAA,KAAA,CAAA,aAAA,CAAA,aAAA;AAAA,cAelB,qBAAA,EAAqB,KAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAOzB,eAAA,CAPyB,0BAAA,WAAA,KAAA,CAAA,aAAA,CAAA,iBAAA,YAAA,KAAA,CAAA,aAAA,CAAA,iBAAA;AAAA,cAUrB,qBAAA,EAAqB,KAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAoBzB,eAAA,CApByB,0BAAA,WAAA,KAAA,CAAA,aAAA,CAAA,cAAA,YAAA,KAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAuBrB,kBAAA,EAAkB,KAAA,CAAA,yBAAA,CAAA,IAAA,CAAiB,eAAA,CAAjB,uBAAA,WAAA,KAAA,CAAA,aAAA,CAAA,iBAAA"}
|
|
@@ -4,7 +4,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
4
4
|
|
|
5
5
|
//#region src/layouts/home/client.d.ts
|
|
6
6
|
declare const navItemVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "button" | "main" | "icon" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
9
9
|
declare function Header({
|
|
10
10
|
nav,
|
|
@@ -5,7 +5,7 @@ import { LinkProps } from "fumadocs-core/link";
|
|
|
5
5
|
import * as _base_ui_react0 from "@base-ui/react";
|
|
6
6
|
|
|
7
7
|
//#region src/layouts/home/navbar.d.ts
|
|
8
|
-
declare const NavbarMenu: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.NavigationMenuItemProps, "ref"> & react.RefAttributes<
|
|
8
|
+
declare const NavbarMenu: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.NavigationMenuItemProps, "ref"> & react.RefAttributes<HTMLLIElement>, "ref"> & react.RefAttributes<HTMLLIElement>>;
|
|
9
9
|
declare function NavbarMenuContent({
|
|
10
10
|
className,
|
|
11
11
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar.d.ts","names":[],"sources":["../../../src/layouts/home/navbar.tsx"],"mappings":";;;;;;;cAaa,UAAA,EAAU,KAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAAqB,eAAA,CAArB,uBAAA,WAAA,KAAA,CAAA,aAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"navbar.d.ts","names":[],"sources":["../../../src/layouts/home/navbar.tsx"],"mappings":";;;;;;;cAaa,UAAA,EAAU,KAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAAqB,eAAA,CAArB,uBAAA,WAAA,KAAA,CAAA,aAAA,CAAA,aAAA,YAAA,KAAA,CAAA,aAAA,CAAA,aAAA;AAAA,iBAEP,iBAAA,CAAA;EAAoB,SAAA;EAAA,GAAc;AAAA,GAAS,0BAAA,GAA0B,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAgBrE,iBAAA,CAAA;EAAoB,SAAA;EAAA,GAAc;AAAA,GAAS,0BAAA,GAA0B,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAiBrE,cAAA,CAAe,KAAA,EAAO,SAAA,GAAS,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -33,7 +33,7 @@ function LargeSearchToggle({ hideIfDisabled, ...props }) {
|
|
|
33
33
|
type: "button",
|
|
34
34
|
"data-search-full": "",
|
|
35
35
|
...props,
|
|
36
|
-
className: cn("inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground", props.className),
|
|
36
|
+
className: cn("inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring", props.className),
|
|
37
37
|
onClick: () => {
|
|
38
38
|
setOpenSearch(true);
|
|
39
39
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-toggle.js","names":[],"sources":["../../../src/layouts/shared/search-toggle.tsx"],"sourcesContent":["'use client';\nimport type { ComponentProps } from 'react';\nimport { Search } from 'lucide-react';\nimport { useSearchContext } from '@/contexts/search';\nimport { useI18n } from '@/contexts/i18n';\nimport { cn } from '@/utils/cn';\nimport { type ButtonProps, buttonVariants } from '@/components/ui/button';\n\ninterface SearchToggleProps extends Omit<ComponentProps<'button'>, 'color'>, ButtonProps {\n hideIfDisabled?: boolean;\n}\n\nexport function SearchToggle({\n hideIfDisabled,\n size = 'icon-sm',\n color = 'ghost',\n ...props\n}: SearchToggleProps) {\n const { setOpenSearch, enabled } = useSearchContext();\n if (hideIfDisabled && !enabled) return null;\n\n return (\n <button\n type=\"button\"\n className={cn(\n buttonVariants({\n size,\n color,\n }),\n props.className,\n )}\n data-search=\"\"\n aria-label=\"Open Search\"\n onClick={() => {\n setOpenSearch(true);\n }}\n >\n <Search />\n </button>\n );\n}\n\nexport function LargeSearchToggle({\n hideIfDisabled,\n ...props\n}: ComponentProps<'button'> & {\n hideIfDisabled?: boolean;\n}) {\n const { enabled, hotKey, setOpenSearch } = useSearchContext();\n const { text } = useI18n();\n if (hideIfDisabled && !enabled) return null;\n\n return (\n <button\n type=\"button\"\n data-search-full=\"\"\n {...props}\n className={cn(\n 'inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground',\n props.className,\n )}\n onClick={() => {\n setOpenSearch(true);\n }}\n >\n <Search className=\"size-4\" />\n {text.search}\n <div className=\"ms-auto inline-flex gap-0.5\">\n {hotKey.map((k, i) => (\n <kbd key={i} className=\"rounded-md border bg-fd-background px-1.5\">\n {k.display}\n </kbd>\n ))}\n </div>\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;AAYA,SAAgB,aAAa,EAC3B,gBACA,OAAO,WACP,QAAQ,SACR,GAAG,SACiB;CACpB,MAAM,EAAE,eAAe,YAAY,kBAAkB;AACrD,KAAI,kBAAkB,CAAC,QAAS,QAAO;AAEvC,QACE,oBAAC;EACC,MAAK;EACL,WAAW,GACT,eAAe;GACb;GACA;GACD,CAAC,EACF,MAAM,UACP;EACD,eAAY;EACZ,cAAW;EACX,eAAe;AACb,iBAAc,KAAK;;YAGrB,oBAAC,WAAS;GACH;;AAIb,SAAgB,kBAAkB,EAChC,gBACA,GAAG,SAGF;CACD,MAAM,EAAE,SAAS,QAAQ,kBAAkB,kBAAkB;CAC7D,MAAM,EAAE,SAAS,SAAS;AAC1B,KAAI,kBAAkB,CAAC,QAAS,QAAO;AAEvC,QACE,qBAAC;EACC,MAAK;EACL,oBAAiB;EACjB,GAAI;EACJ,WAAW,GACT,
|
|
1
|
+
{"version":3,"file":"search-toggle.js","names":[],"sources":["../../../src/layouts/shared/search-toggle.tsx"],"sourcesContent":["'use client';\nimport type { ComponentProps } from 'react';\nimport { Search } from 'lucide-react';\nimport { useSearchContext } from '@/contexts/search';\nimport { useI18n } from '@/contexts/i18n';\nimport { cn } from '@/utils/cn';\nimport { type ButtonProps, buttonVariants } from '@/components/ui/button';\n\ninterface SearchToggleProps extends Omit<ComponentProps<'button'>, 'color'>, ButtonProps {\n hideIfDisabled?: boolean;\n}\n\nexport function SearchToggle({\n hideIfDisabled,\n size = 'icon-sm',\n color = 'ghost',\n ...props\n}: SearchToggleProps) {\n const { setOpenSearch, enabled } = useSearchContext();\n if (hideIfDisabled && !enabled) return null;\n\n return (\n <button\n type=\"button\"\n className={cn(\n buttonVariants({\n size,\n color,\n }),\n props.className,\n )}\n data-search=\"\"\n aria-label=\"Open Search\"\n onClick={() => {\n setOpenSearch(true);\n }}\n >\n <Search />\n </button>\n );\n}\n\nexport function LargeSearchToggle({\n hideIfDisabled,\n ...props\n}: ComponentProps<'button'> & {\n hideIfDisabled?: boolean;\n}) {\n const { enabled, hotKey, setOpenSearch } = useSearchContext();\n const { text } = useI18n();\n if (hideIfDisabled && !enabled) return null;\n\n return (\n <button\n type=\"button\"\n data-search-full=\"\"\n {...props}\n className={cn(\n 'inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring',\n props.className,\n )}\n onClick={() => {\n setOpenSearch(true);\n }}\n >\n <Search className=\"size-4\" />\n {text.search}\n <div className=\"ms-auto inline-flex gap-0.5\">\n {hotKey.map((k, i) => (\n <kbd key={i} className=\"rounded-md border bg-fd-background px-1.5\">\n {k.display}\n </kbd>\n ))}\n </div>\n </button>\n );\n}\n"],"mappings":";;;;;;;;;;AAYA,SAAgB,aAAa,EAC3B,gBACA,OAAO,WACP,QAAQ,SACR,GAAG,SACiB;CACpB,MAAM,EAAE,eAAe,YAAY,kBAAkB;AACrD,KAAI,kBAAkB,CAAC,QAAS,QAAO;AAEvC,QACE,oBAAC;EACC,MAAK;EACL,WAAW,GACT,eAAe;GACb;GACA;GACD,CAAC,EACF,MAAM,UACP;EACD,eAAY;EACZ,cAAW;EACX,eAAe;AACb,iBAAc,KAAK;;YAGrB,oBAAC,WAAS;GACH;;AAIb,SAAgB,kBAAkB,EAChC,gBACA,GAAG,SAGF;CACD,MAAM,EAAE,SAAS,QAAQ,kBAAkB,kBAAkB;CAC7D,MAAM,EAAE,SAAS,SAAS;AAC1B,KAAI,kBAAkB,CAAC,QAAS,QAAO;AAEvC,QACE,qBAAC;EACC,MAAK;EACL,oBAAiB;EACjB,GAAI;EACJ,WAAW,GACT,mQACA,MAAM,UACP;EACD,eAAe;AACb,iBAAc,KAAK;;;GAGrB,oBAAC,UAAO,WAAU,WAAW;GAC5B,KAAK;GACN,oBAAC;IAAI,WAAU;cACZ,OAAO,KAAK,GAAG,MACd,oBAAC;KAAY,WAAU;eACpB,EAAE;OADK,EAEJ,CACN;KACE;;GACC"}
|
package/dist/style.css
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
"Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
8
8
|
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
|
9
9
|
"Courier New", monospace;
|
|
10
|
-
--color-black: #000;
|
|
11
10
|
--spacing: 0.25rem;
|
|
12
11
|
--breakpoint-sm: 40rem;
|
|
13
12
|
--container-sm: 24rem;
|
|
@@ -300,6 +299,9 @@
|
|
|
300
299
|
.start-4 {
|
|
301
300
|
inset-inline-start: calc(var(--spacing) * 4);
|
|
302
301
|
}
|
|
302
|
+
.start-6 {
|
|
303
|
+
inset-inline-start: calc(var(--spacing) * 6);
|
|
304
|
+
}
|
|
303
305
|
.end-0 {
|
|
304
306
|
inset-inline-end: calc(var(--spacing) * 0);
|
|
305
307
|
}
|
|
@@ -333,6 +335,9 @@
|
|
|
333
335
|
.top-2 {
|
|
334
336
|
top: calc(var(--spacing) * 2);
|
|
335
337
|
}
|
|
338
|
+
.top-2\.5 {
|
|
339
|
+
top: calc(var(--spacing) * 2.5);
|
|
340
|
+
}
|
|
336
341
|
.top-4 {
|
|
337
342
|
top: calc(var(--spacing) * 4);
|
|
338
343
|
}
|
|
@@ -414,6 +419,9 @@
|
|
|
414
419
|
.my-0\! {
|
|
415
420
|
margin-block: calc(var(--spacing) * 0) !important;
|
|
416
421
|
}
|
|
422
|
+
.my-0\.5 {
|
|
423
|
+
margin-block: calc(var(--spacing) * 0.5);
|
|
424
|
+
}
|
|
417
425
|
.my-4 {
|
|
418
426
|
margin-block: calc(var(--spacing) * 4);
|
|
419
427
|
}
|
|
@@ -886,9 +894,6 @@
|
|
|
886
894
|
.hidden {
|
|
887
895
|
display: none;
|
|
888
896
|
}
|
|
889
|
-
.inline {
|
|
890
|
-
display: inline;
|
|
891
|
-
}
|
|
892
897
|
.inline-flex {
|
|
893
898
|
display: inline-flex;
|
|
894
899
|
}
|
|
@@ -987,6 +992,9 @@
|
|
|
987
992
|
.max-h-\(--available-height\) {
|
|
988
993
|
max-height: var(--available-height);
|
|
989
994
|
}
|
|
995
|
+
.max-h-20 {
|
|
996
|
+
max-height: calc(var(--spacing) * 20);
|
|
997
|
+
}
|
|
990
998
|
.max-h-\[50vh\] {
|
|
991
999
|
max-height: 50vh;
|
|
992
1000
|
}
|
|
@@ -1029,12 +1037,12 @@
|
|
|
1029
1037
|
.w-1\.5 {
|
|
1030
1038
|
width: calc(var(--spacing) * 1.5);
|
|
1031
1039
|
}
|
|
1040
|
+
.w-1\/4 {
|
|
1041
|
+
width: calc(1/4 * 100%);
|
|
1042
|
+
}
|
|
1032
1043
|
.w-4 {
|
|
1033
1044
|
width: calc(var(--spacing) * 4);
|
|
1034
1045
|
}
|
|
1035
|
-
.w-\[25\%\] {
|
|
1036
|
-
width: 25%;
|
|
1037
|
-
}
|
|
1038
1046
|
.w-\[85\%\] {
|
|
1039
1047
|
width: 85%;
|
|
1040
1048
|
}
|
|
@@ -1083,6 +1091,9 @@
|
|
|
1083
1091
|
.max-w-\[1400px\] {
|
|
1084
1092
|
max-width: 1400px;
|
|
1085
1093
|
}
|
|
1094
|
+
.max-w-full {
|
|
1095
|
+
max-width: 100%;
|
|
1096
|
+
}
|
|
1086
1097
|
.max-w-screen-sm {
|
|
1087
1098
|
max-width: var(--breakpoint-sm);
|
|
1088
1099
|
}
|
|
@@ -1156,6 +1167,9 @@
|
|
|
1156
1167
|
.animate-pulse {
|
|
1157
1168
|
animation: var(--animate-pulse);
|
|
1158
1169
|
}
|
|
1170
|
+
.scroll-m-20 {
|
|
1171
|
+
scroll-margin: calc(var(--spacing) * 20);
|
|
1172
|
+
}
|
|
1159
1173
|
.scroll-m-24 {
|
|
1160
1174
|
scroll-margin: calc(var(--spacing) * 24);
|
|
1161
1175
|
}
|
|
@@ -1237,6 +1251,14 @@
|
|
|
1237
1251
|
.gap-y-4 {
|
|
1238
1252
|
row-gap: calc(var(--spacing) * 4);
|
|
1239
1253
|
}
|
|
1254
|
+
.divide-x {
|
|
1255
|
+
:where(& > :not(:last-child)) {
|
|
1256
|
+
--tw-divide-x-reverse: 0;
|
|
1257
|
+
border-inline-style: var(--tw-border-style);
|
|
1258
|
+
border-inline-start-width: calc(1px * var(--tw-divide-x-reverse));
|
|
1259
|
+
border-inline-end-width: calc(1px * calc(1 - var(--tw-divide-x-reverse)));
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1240
1262
|
.divide-y {
|
|
1241
1263
|
:where(& > :not(:last-child)) {
|
|
1242
1264
|
--tw-divide-y-reverse: 0;
|
|
@@ -1341,6 +1363,10 @@
|
|
|
1341
1363
|
border-left-style: var(--tw-border-style);
|
|
1342
1364
|
border-left-width: 1px;
|
|
1343
1365
|
}
|
|
1366
|
+
.border-none {
|
|
1367
|
+
--tw-border-style: none;
|
|
1368
|
+
border-style: none;
|
|
1369
|
+
}
|
|
1344
1370
|
.border-fd-foreground\/10 {
|
|
1345
1371
|
border-color: color-mix(in srgb, hsl(0, 0%, 3.9%) 10%, transparent);
|
|
1346
1372
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -1440,6 +1466,9 @@
|
|
|
1440
1466
|
.mask-\[linear-gradient\(to_bottom\,transparent\,white_calc\(var\(--spacing\)\*14\)\,white_calc\(100\%-var\(--spacing\)\*14\)\,transparent\)\] {
|
|
1441
1467
|
mask-image: linear-gradient(to bottom,transparent,white calc(var(--spacing) * 14),white calc(100% - var(--spacing) * 14),transparent);
|
|
1442
1468
|
}
|
|
1469
|
+
.mask-\[linear-gradient\(to_bottom\,white\,white_30px\,transparent_80px\)\] {
|
|
1470
|
+
mask-image: linear-gradient(to bottom,white,white 30px,transparent 80px);
|
|
1471
|
+
}
|
|
1443
1472
|
.fill-\(--callout-color\) {
|
|
1444
1473
|
fill: var(--callout-color);
|
|
1445
1474
|
}
|
|
@@ -1500,6 +1529,9 @@
|
|
|
1500
1529
|
.px-6 {
|
|
1501
1530
|
padding-inline: calc(var(--spacing) * 6);
|
|
1502
1531
|
}
|
|
1532
|
+
.px-px {
|
|
1533
|
+
padding-inline: 1px;
|
|
1534
|
+
}
|
|
1503
1535
|
.py-0 {
|
|
1504
1536
|
padding-block: calc(var(--spacing) * 0);
|
|
1505
1537
|
}
|
|
@@ -1730,12 +1762,6 @@
|
|
|
1730
1762
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
1731
1763
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
1732
1764
|
}
|
|
1733
|
-
.shadow-black\/50 {
|
|
1734
|
-
--tw-shadow-color: color-mix(in srgb, #000 50%, transparent);
|
|
1735
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
1736
|
-
--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-black) 50%, transparent) var(--tw-shadow-alpha), transparent);
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
1765
|
.outline {
|
|
1740
1766
|
outline-style: var(--tw-outline-style);
|
|
1741
1767
|
outline-width: 1px;
|
|
@@ -2224,6 +2250,16 @@
|
|
|
2224
2250
|
color: var(--color-fd-accent-foreground);
|
|
2225
2251
|
}
|
|
2226
2252
|
}
|
|
2253
|
+
.data-closed\:animate-fd-dialog-out {
|
|
2254
|
+
&[data-closed] {
|
|
2255
|
+
animation: var(--animate-fd-dialog-out);
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
.data-closed\:animate-fd-fade-out {
|
|
2259
|
+
&[data-closed] {
|
|
2260
|
+
animation: var(--animate-fd-fade-out);
|
|
2261
|
+
}
|
|
2262
|
+
}
|
|
2227
2263
|
.data-ending-style\:scale-90 {
|
|
2228
2264
|
&[data-ending-style] {
|
|
2229
2265
|
--tw-scale-x: 90%;
|
|
@@ -2248,6 +2284,16 @@
|
|
|
2248
2284
|
transition-property: none;
|
|
2249
2285
|
}
|
|
2250
2286
|
}
|
|
2287
|
+
.data-open\:animate-fd-dialog-in {
|
|
2288
|
+
&[data-open] {
|
|
2289
|
+
animation: var(--animate-fd-dialog-in);
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
.data-open\:animate-fd-fade-in {
|
|
2293
|
+
&[data-open] {
|
|
2294
|
+
animation: var(--animate-fd-fade-in);
|
|
2295
|
+
}
|
|
2296
|
+
}
|
|
2251
2297
|
.data-open\:bg-fd-accent {
|
|
2252
2298
|
&[data-open] {
|
|
2253
2299
|
background-color: var(--color-fd-accent);
|
|
@@ -2364,16 +2410,6 @@
|
|
|
2364
2410
|
}
|
|
2365
2411
|
}
|
|
2366
2412
|
}
|
|
2367
|
-
.data-\[closed\]\:animate-fd-dialog-out {
|
|
2368
|
-
&[data-closed] {
|
|
2369
|
-
animation: var(--animate-fd-dialog-out);
|
|
2370
|
-
}
|
|
2371
|
-
}
|
|
2372
|
-
.data-\[closed\]\:animate-fd-fade-out {
|
|
2373
|
-
&[data-closed] {
|
|
2374
|
-
animation: var(--animate-fd-fade-out);
|
|
2375
|
-
}
|
|
2376
|
-
}
|
|
2377
2413
|
.data-\[closed\]\:animate-fd-popover-out {
|
|
2378
2414
|
&[data-closed] {
|
|
2379
2415
|
animation: var(--animate-fd-popover-out);
|
|
@@ -2423,16 +2459,6 @@
|
|
|
2423
2459
|
display: none;
|
|
2424
2460
|
}
|
|
2425
2461
|
}
|
|
2426
|
-
.data-\[open\]\:animate-fd-dialog-in {
|
|
2427
|
-
&[data-open] {
|
|
2428
|
-
animation: var(--animate-fd-dialog-in);
|
|
2429
|
-
}
|
|
2430
|
-
}
|
|
2431
|
-
.data-\[open\]\:animate-fd-fade-in {
|
|
2432
|
-
&[data-open] {
|
|
2433
|
-
animation: var(--animate-fd-fade-in);
|
|
2434
|
-
}
|
|
2435
|
-
}
|
|
2436
2462
|
.data-\[open\]\:animate-fd-popover-in {
|
|
2437
2463
|
&[data-open] {
|
|
2438
2464
|
animation: var(--animate-fd-popover-in);
|
|
@@ -2991,6 +3017,11 @@
|
|
|
2991
3017
|
syntax: "*";
|
|
2992
3018
|
inherits: false;
|
|
2993
3019
|
}
|
|
3020
|
+
@property --tw-divide-x-reverse {
|
|
3021
|
+
syntax: "*";
|
|
3022
|
+
inherits: false;
|
|
3023
|
+
initial-value: 0;
|
|
3024
|
+
}
|
|
2994
3025
|
@property --tw-divide-y-reverse {
|
|
2995
3026
|
syntax: "*";
|
|
2996
3027
|
inherits: false;
|
|
@@ -3264,6 +3295,7 @@
|
|
|
3264
3295
|
--tw-rotate-z: initial;
|
|
3265
3296
|
--tw-skew-x: initial;
|
|
3266
3297
|
--tw-skew-y: initial;
|
|
3298
|
+
--tw-divide-x-reverse: 0;
|
|
3267
3299
|
--tw-divide-y-reverse: 0;
|
|
3268
3300
|
--tw-leading: initial;
|
|
3269
3301
|
--tw-font-weight: initial;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fumadocs/base-ui",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.6.1",
|
|
4
4
|
"description": "The Base UI version of Fumadocs UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -94,27 +94,31 @@
|
|
|
94
94
|
"access": "public"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@base-ui/react": "^1.
|
|
97
|
+
"@base-ui/react": "^1.2.0",
|
|
98
98
|
"class-variance-authority": "^0.7.1",
|
|
99
99
|
"lucide-react": "^0.563.0",
|
|
100
|
-
"motion": "^12.
|
|
100
|
+
"motion": "^12.34.0",
|
|
101
101
|
"next-themes": "^0.4.6",
|
|
102
102
|
"react-medium-image-zoom": "^5.4.0",
|
|
103
103
|
"react-remove-scroll": "^2.7.2",
|
|
104
|
+
"rehype-raw": "^7.0.0",
|
|
104
105
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
105
106
|
"tailwind-merge": "^3.4.0",
|
|
107
|
+
"unist-util-visit": "^5.1.0",
|
|
106
108
|
"@fumadocs/tailwind": "0.0.2"
|
|
107
109
|
},
|
|
108
110
|
"devDependencies": {
|
|
109
111
|
"@tailwindcss/cli": "^4.1.18",
|
|
110
|
-
"@types/
|
|
111
|
-
"@types/
|
|
112
|
+
"@types/hast": "^3.0.4",
|
|
113
|
+
"@types/node": "^25.2.3",
|
|
114
|
+
"@types/react": "^19.2.14",
|
|
112
115
|
"@types/react-dom": "^19.2.3",
|
|
113
116
|
"tailwindcss": "^4.1.18",
|
|
114
117
|
"tsdown": "^0.20.3",
|
|
118
|
+
"unified": "^11.0.5",
|
|
115
119
|
"@fumadocs/cli": "1.2.4",
|
|
116
120
|
"eslint-config-custom": "0.0.0",
|
|
117
|
-
"fumadocs-core": "16.
|
|
121
|
+
"fumadocs-core": "16.6.1",
|
|
118
122
|
"tsconfig": "0.0.0"
|
|
119
123
|
},
|
|
120
124
|
"peerDependencies": {
|
|
@@ -123,7 +127,7 @@
|
|
|
123
127
|
"react": "^19.2.0",
|
|
124
128
|
"react-dom": "^19.2.0",
|
|
125
129
|
"tailwindcss": "^4.0.0",
|
|
126
|
-
"fumadocs-core": "16.
|
|
130
|
+
"fumadocs-core": "16.6.1"
|
|
127
131
|
},
|
|
128
132
|
"peerDependenciesMeta": {
|
|
129
133
|
"next": {
|