boltdocs 1.7.0 → 1.7.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.
Files changed (38) hide show
  1. package/dist/{SearchDialog-YOXMFGH6.mjs → SearchDialog-6Z7CUAYJ.mjs} +8 -1
  2. package/dist/{SearchDialog-UOAW6IR3.css → SearchDialog-GOZ6X53X.css} +129 -14
  3. package/dist/{chunk-MULKZFVN.mjs → chunk-SFVOGJ2W.mjs} +269 -165
  4. package/dist/client/index.css +129 -14
  5. package/dist/client/index.d.mts +5 -7
  6. package/dist/client/index.d.ts +5 -7
  7. package/dist/client/index.js +586 -337
  8. package/dist/client/index.mjs +106 -5
  9. package/dist/client/ssr.css +129 -14
  10. package/dist/client/ssr.d.mts +1 -1
  11. package/dist/client/ssr.d.ts +1 -1
  12. package/dist/client/ssr.js +378 -230
  13. package/dist/client/ssr.mjs +1 -1
  14. package/dist/node/index.d.mts +2 -0
  15. package/dist/node/index.d.ts +2 -0
  16. package/dist/node/index.js +4 -1
  17. package/dist/node/index.mjs +4 -1
  18. package/dist/{types-CviV0GbX.d.ts → types-BbceAHA0.d.mts} +2 -0
  19. package/dist/{types-CviV0GbX.d.mts → types-BbceAHA0.d.ts} +2 -0
  20. package/package.json +1 -1
  21. package/src/client/app/index.tsx +8 -7
  22. package/src/client/theme/components/mdx/Table.tsx +108 -10
  23. package/src/client/theme/components/mdx/mdx-components.css +79 -0
  24. package/src/client/theme/styles/variables.css +24 -0
  25. package/src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx +46 -0
  26. package/src/client/theme/ui/ErrorBoundary/index.ts +1 -0
  27. package/src/client/theme/ui/Layout/Layout.tsx +8 -1
  28. package/src/client/theme/ui/Navbar/Tabs.tsx +37 -12
  29. package/src/client/theme/ui/Navbar/navbar.css +26 -18
  30. package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +1 -8
  31. package/src/client/theme/ui/ProgressBar/ProgressBar.css +17 -0
  32. package/src/client/theme/ui/ProgressBar/ProgressBar.tsx +51 -0
  33. package/src/client/theme/ui/ProgressBar/index.ts +1 -0
  34. package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +11 -1
  35. package/src/client/types.ts +2 -0
  36. package/src/node/routes/index.ts +1 -0
  37. package/src/node/routes/parser.ts +11 -0
  38. package/src/node/routes/types.ts +2 -0
@@ -10,7 +10,7 @@ import {
10
10
  Sidebar,
11
11
  ThemeLayout,
12
12
  createBoltdocsApp
13
- } from "../chunk-MULKZFVN.mjs";
13
+ } from "../chunk-SFVOGJ2W.mjs";
14
14
  import {
15
15
  Video
16
16
  } from "../chunk-Z7JHYNAS.mjs";
@@ -484,18 +484,119 @@ function FileTree({ children }) {
484
484
  }
485
485
 
486
486
  // src/client/theme/components/mdx/Table.tsx
487
+ import { useState as useState4, useMemo } from "react";
488
+ import { ChevronUp, ChevronDown, ChevronLeft, ChevronRight as ChevronRight3, ChevronsLeft, ChevronsRight } from "lucide-react";
487
489
  import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
488
490
  function Table({
489
491
  headers,
490
492
  data,
491
493
  children,
492
- className = ""
494
+ className = "",
495
+ sortable = false,
496
+ paginated = false,
497
+ pageSize = 10
493
498
  }) {
499
+ const [sortConfig, setSortConfig] = useState4(null);
500
+ const [currentPage, setCurrentPage] = useState4(1);
501
+ const processedData = useMemo(() => {
502
+ if (!data) return [];
503
+ let items = [...data];
504
+ if (sortable && sortConfig !== null) {
505
+ items.sort((a, b) => {
506
+ const aVal = a[sortConfig.key];
507
+ const bVal = b[sortConfig.key];
508
+ const aStr = typeof aVal === "string" ? aVal : "";
509
+ const bStr = typeof bVal === "string" ? bVal : "";
510
+ if (aStr < bStr) return sortConfig.direction === "asc" ? -1 : 1;
511
+ if (aStr > bStr) return sortConfig.direction === "asc" ? 1 : -1;
512
+ return 0;
513
+ });
514
+ }
515
+ return items;
516
+ }, [data, sortConfig, sortable]);
517
+ const totalPages = Math.ceil(processedData.length / pageSize);
518
+ const paginatedData = useMemo(() => {
519
+ if (!paginated) return processedData;
520
+ const start = (currentPage - 1) * pageSize;
521
+ return processedData.slice(start, start + pageSize);
522
+ }, [processedData, paginated, currentPage, pageSize]);
523
+ const requestSort = (index) => {
524
+ if (!sortable) return;
525
+ let direction = "asc";
526
+ if (sortConfig && sortConfig.key === index && sortConfig.direction === "asc") {
527
+ direction = "desc";
528
+ }
529
+ setSortConfig({ key: index, direction });
530
+ };
531
+ const renderSortIcon = (index) => {
532
+ if (!sortable) return null;
533
+ if (sortConfig?.key !== index) return /* @__PURE__ */ jsx9(ChevronDown, { size: 14, className: "ld-table-sort-icon ld-table-sort-icon--hidden" });
534
+ return sortConfig.direction === "asc" ? /* @__PURE__ */ jsx9(ChevronUp, { size: 14, className: "ld-table-sort-icon" }) : /* @__PURE__ */ jsx9(ChevronDown, { size: 14, className: "ld-table-sort-icon" });
535
+ };
494
536
  const tableContent = children ? children : /* @__PURE__ */ jsxs7(Fragment2, { children: [
495
- headers && /* @__PURE__ */ jsx9("thead", { children: /* @__PURE__ */ jsx9("tr", { children: headers.map((header, i) => /* @__PURE__ */ jsx9("th", { children: header }, i)) }) }),
496
- data && /* @__PURE__ */ jsx9("tbody", { children: data.map((row, i) => /* @__PURE__ */ jsx9("tr", { children: row.map((cell, j) => /* @__PURE__ */ jsx9("td", { children: cell }, j)) }, i)) })
537
+ headers && /* @__PURE__ */ jsx9("thead", { children: /* @__PURE__ */ jsx9("tr", { children: headers.map((header, i) => /* @__PURE__ */ jsx9(
538
+ "th",
539
+ {
540
+ onClick: () => requestSort(i),
541
+ className: sortable ? "ld-table-header--sortable" : "",
542
+ children: /* @__PURE__ */ jsxs7("div", { className: "ld-table-header-content", children: [
543
+ header,
544
+ renderSortIcon(i)
545
+ ] })
546
+ },
547
+ i
548
+ )) }) }),
549
+ paginatedData && /* @__PURE__ */ jsx9("tbody", { children: paginatedData.map((row, i) => /* @__PURE__ */ jsx9("tr", { children: row.map((cell, j) => /* @__PURE__ */ jsx9("td", { children: cell }, j)) }, i)) })
550
+ ] });
551
+ return /* @__PURE__ */ jsxs7("div", { className: `ld-table-container ${className}`.trim(), children: [
552
+ /* @__PURE__ */ jsx9("div", { className: "ld-table-wrapper", children: /* @__PURE__ */ jsx9("table", { className: "ld-table", children: tableContent }) }),
553
+ paginated && totalPages > 1 && /* @__PURE__ */ jsxs7("div", { className: "ld-table-pagination", children: [
554
+ /* @__PURE__ */ jsxs7("div", { className: "ld-table-pagination-info", children: [
555
+ "Page ",
556
+ currentPage,
557
+ " of ",
558
+ totalPages
559
+ ] }),
560
+ /* @__PURE__ */ jsxs7("div", { className: "ld-table-pagination-controls", children: [
561
+ /* @__PURE__ */ jsx9(
562
+ "button",
563
+ {
564
+ onClick: () => setCurrentPage(1),
565
+ disabled: currentPage === 1,
566
+ className: "ld-table-pagination-btn",
567
+ children: /* @__PURE__ */ jsx9(ChevronsLeft, { size: 16 })
568
+ }
569
+ ),
570
+ /* @__PURE__ */ jsx9(
571
+ "button",
572
+ {
573
+ onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)),
574
+ disabled: currentPage === 1,
575
+ className: "ld-table-pagination-btn",
576
+ children: /* @__PURE__ */ jsx9(ChevronLeft, { size: 16 })
577
+ }
578
+ ),
579
+ /* @__PURE__ */ jsx9(
580
+ "button",
581
+ {
582
+ onClick: () => setCurrentPage((prev) => Math.min(prev + 1, totalPages)),
583
+ disabled: currentPage === totalPages,
584
+ className: "ld-table-pagination-btn",
585
+ children: /* @__PURE__ */ jsx9(ChevronRight3, { size: 16 })
586
+ }
587
+ ),
588
+ /* @__PURE__ */ jsx9(
589
+ "button",
590
+ {
591
+ onClick: () => setCurrentPage(totalPages),
592
+ disabled: currentPage === totalPages,
593
+ className: "ld-table-pagination-btn",
594
+ children: /* @__PURE__ */ jsx9(ChevronsRight, { size: 16 })
595
+ }
596
+ )
597
+ ] })
598
+ ] })
497
599
  ] });
498
- return /* @__PURE__ */ jsx9("div", { className: `ld-table-container ${className}`.trim(), children: /* @__PURE__ */ jsx9("table", { className: "ld-table", children: tableContent }) });
499
600
  }
500
601
  export {
501
602
  Admonition,
@@ -55,6 +55,28 @@
55
55
  color: #94a3b8;
56
56
  }
57
57
 
58
+ /* src/client/theme/ui/ProgressBar/ProgressBar.css */
59
+ .boltdocs-progress-container {
60
+ position: fixed;
61
+ top: 0;
62
+ left: 0;
63
+ width: 100%;
64
+ height: 2px;
65
+ z-index: 1000;
66
+ pointer-events: none;
67
+ background: transparent;
68
+ }
69
+ .boltdocs-progress-bar {
70
+ height: 100%;
71
+ background:
72
+ linear-gradient(
73
+ 90deg,
74
+ var(--ld-color-primary),
75
+ var(--ld-gradient-to, var(--ld-color-primary)));
76
+ box-shadow: 0 0 8px var(--ld-color-primary-glow);
77
+ transition: width 0.1s ease-out;
78
+ }
79
+
58
80
  /* src/client/theme/styles/variables.css */
59
81
  :root[data-theme=light],
60
82
  :root.theme-light {
@@ -185,6 +207,23 @@
185
207
  --ld-radius-md: 8px;
186
208
  --ld-radius-lg: 12px;
187
209
  --ld-radius-full: 9999px;
210
+ scrollbar-width: thin;
211
+ scrollbar-color: var(--ld-border-strong) transparent;
212
+ }
213
+ *::-webkit-scrollbar {
214
+ width: 6px;
215
+ height: 6px;
216
+ }
217
+ *::-webkit-scrollbar-track {
218
+ background: transparent;
219
+ }
220
+ *::-webkit-scrollbar-thumb {
221
+ background-color: var(--ld-border-strong);
222
+ border-radius: 20px;
223
+ border: transparent;
224
+ }
225
+ *::-webkit-scrollbar-thumb:hover {
226
+ background-color: var(--ld-text-dim);
188
227
  }
189
228
 
190
229
  /* src/client/theme/ui/Layout/base.css */
@@ -476,11 +515,21 @@ a {
476
515
  height: 18px;
477
516
  }
478
517
  .boltdocs-tabs-container {
479
- border-bottom: 1px solid var(--ld-border-subtle);
518
+ position: relative;
480
519
  background: var(--ld-navbar-bg);
481
520
  padding: 0;
482
521
  height: 46px;
483
522
  }
523
+ .boltdocs-tabs-container::after {
524
+ content: "";
525
+ position: absolute;
526
+ bottom: 0px;
527
+ left: 0;
528
+ right: 0;
529
+ height: 1px;
530
+ background: var(--ld-border-subtle);
531
+ z-index: 10;
532
+ }
484
533
  .boltdocs-tabs {
485
534
  max-width: 1440px;
486
535
  margin: 0 auto;
@@ -489,6 +538,8 @@ a {
489
538
  overflow-x: auto;
490
539
  scrollbar-width: none;
491
540
  padding: 0 1.5rem;
541
+ position: relative;
542
+ height: 100%;
492
543
  }
493
544
  .boltdocs-tabs::-webkit-scrollbar {
494
545
  display: none;
@@ -507,6 +558,7 @@ a {
507
558
  align-items: center;
508
559
  gap: 0.6rem;
509
560
  opacity: 0.7;
561
+ z-index: 20;
510
562
  }
511
563
  .boltdocs-tab-item:hover {
512
564
  color: var(--ld-text-main);
@@ -534,24 +586,21 @@ a {
534
586
  opacity: 1;
535
587
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
536
588
  }
537
- .boltdocs-tab-item::after {
538
- content: "";
589
+ .boltdocs-tab-indicator {
539
590
  position: absolute;
540
591
  bottom: 0px;
541
592
  left: 0;
542
- right: 0;
543
593
  height: 3px;
544
- background: var(--ld-primary);
594
+ background: var(--ld-color-primary);
545
595
  border-radius: 2px 2px 0 0;
546
- box-shadow: 0 0 12px rgba(var(--ld-primary-rgb), 0.6);
547
- opacity: 0;
548
- transform: scaleX(0);
549
- transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
550
- z-index: 10;
551
- }
552
- .boltdocs-tab-item.active::after {
553
- opacity: 1;
554
- transform: scaleX(1);
596
+ box-shadow: 0 -2px 15px var(--ld-color-primary-glow);
597
+ transition:
598
+ transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
599
+ width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
600
+ opacity 0.3s ease;
601
+ z-index: 100;
602
+ pointer-events: none;
603
+ transform-origin: left;
555
604
  }
556
605
 
557
606
  /* src/client/theme/ui/Sidebar/sidebar.css */
@@ -1837,7 +1886,12 @@ a {
1837
1886
  border-radius: var(--ld-radius-lg);
1838
1887
  overflow: hidden;
1839
1888
  background: var(--ld-bg-soft);
1889
+ display: flex;
1890
+ flex-direction: column;
1891
+ }
1892
+ .ld-table-wrapper {
1840
1893
  overflow-x: auto;
1894
+ scrollbar-width: thin;
1841
1895
  }
1842
1896
  .ld-table {
1843
1897
  width: 100%;
@@ -1857,6 +1911,30 @@ a {
1857
1911
  font-size: 0.8125rem;
1858
1912
  text-transform: uppercase;
1859
1913
  letter-spacing: 0.04em;
1914
+ white-space: nowrap;
1915
+ }
1916
+ .ld-table-header--sortable {
1917
+ cursor: pointer;
1918
+ transition: background-color 0.2s;
1919
+ }
1920
+ .ld-table-header--sortable:hover {
1921
+ background-color: var(--ld-bg-soft);
1922
+ }
1923
+ .ld-table-header-content {
1924
+ display: flex;
1925
+ align-items: center;
1926
+ gap: 0.5rem;
1927
+ }
1928
+ .ld-table-sort-icon {
1929
+ opacity: 0.8;
1930
+ color: var(--ld-color-primary);
1931
+ transition: opacity 0.2s;
1932
+ }
1933
+ .ld-table-sort-icon--hidden {
1934
+ opacity: 0;
1935
+ }
1936
+ .ld-table-header--sortable:hover .ld-table-sort-icon--hidden {
1937
+ opacity: 0.3;
1860
1938
  }
1861
1939
  .ld-table td {
1862
1940
  padding: 0.875rem 1rem;
@@ -1872,6 +1950,43 @@ a {
1872
1950
  background: rgba(255, 255, 255, 0.05);
1873
1951
  border-radius: 4px;
1874
1952
  }
1953
+ .ld-table-pagination {
1954
+ display: flex;
1955
+ align-items: center;
1956
+ justify-content: space-between;
1957
+ padding: 0.75rem 1rem;
1958
+ background: var(--ld-bg-mute);
1959
+ border-top: 1px solid var(--ld-border-subtle);
1960
+ font-size: 0.75rem;
1961
+ color: var(--ld-text-dim);
1962
+ }
1963
+ .ld-table-pagination-controls {
1964
+ display: flex;
1965
+ align-items: center;
1966
+ gap: 0.25rem;
1967
+ }
1968
+ .ld-table-pagination-btn {
1969
+ display: flex;
1970
+ align-items: center;
1971
+ justify-content: center;
1972
+ width: 1.75rem;
1973
+ height: 1.75rem;
1974
+ border-radius: var(--ld-radius-md);
1975
+ border: 1px solid var(--ld-border-subtle);
1976
+ background: var(--ld-bg-soft);
1977
+ color: var(--ld-text-muted);
1978
+ cursor: pointer;
1979
+ transition: all 0.2s;
1980
+ }
1981
+ .ld-table-pagination-btn:hover:not(:disabled) {
1982
+ background: var(--ld-bg-mute);
1983
+ color: var(--ld-text-main);
1984
+ border-color: var(--ld-border-strong);
1985
+ }
1986
+ .ld-table-pagination-btn:disabled {
1987
+ opacity: 0.4;
1988
+ cursor: not-allowed;
1989
+ }
1875
1990
 
1876
1991
  /* src/client/theme/components/PackageManagerTabs/pkg-tabs.css */
1877
1992
  .pkg-tabs-wrapper {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { a as ComponentRoute } from '../types-CviV0GbX.mjs';
2
+ import { a as ComponentRoute } from '../types-BbceAHA0.mjs';
3
3
 
4
4
  /**
5
5
  * Options for rendering the Boltdocs application on the server (SSG).
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { a as ComponentRoute } from '../types-CviV0GbX.js';
2
+ import { a as ComponentRoute } from '../types-BbceAHA0.js';
3
3
 
4
4
  /**
5
5
  * Options for rendering the Boltdocs application on the server (SSG).