@stainless-api/docs-ui 0.1.0-beta.25 → 0.1.0-beta.27

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 (131) hide show
  1. package/dist/breadcrumbs-D5viAm7a.d.ts +20 -0
  2. package/dist/chunk-Bp6m_JJh.js +13 -0
  3. package/dist/component-generics-BnrVqdQj.d.ts +29 -0
  4. package/dist/component-generics-Df4EDvxk.js +41 -0
  5. package/dist/components/breadcrumbs.d.ts +2 -0
  6. package/dist/components/breadcrumbs.js +16 -0
  7. package/dist/components/chat.d.ts +14 -0
  8. package/dist/components/chat.js +128 -0
  9. package/dist/components/dropdown.d.ts +2 -0
  10. package/dist/components/dropdown.js +4 -0
  11. package/dist/components/icons.d.ts +50 -0
  12. package/dist/components/icons.js +3 -0
  13. package/dist/components/index.d.ts +12 -0
  14. package/dist/components/index.js +16 -0
  15. package/dist/components/method.d.ts +2 -0
  16. package/dist/components/method.js +16 -0
  17. package/dist/components/overview.d.ts +2 -0
  18. package/dist/components/overview.js +16 -0
  19. package/dist/components/primitives.d.ts +2 -0
  20. package/dist/components/primitives.js +16 -0
  21. package/dist/components/properties.d.ts +2 -0
  22. package/dist/components/properties.js +16 -0
  23. package/dist/components/scripts/dropdown.d.ts +12 -0
  24. package/dist/components/scripts/dropdown.js +50 -0
  25. package/dist/components/sdk.d.ts +3 -0
  26. package/dist/components/sdk.js +16 -0
  27. package/dist/components/sidebar.d.ts +2 -0
  28. package/dist/components/sidebar.js +16 -0
  29. package/dist/components/snippets.d.ts +4 -0
  30. package/dist/components/snippets.js +16 -0
  31. package/dist/contexts/component-generics.d.ts +2 -0
  32. package/dist/contexts/component-generics.js +3 -0
  33. package/dist/contexts/component-types.d.ts +18 -0
  34. package/dist/contexts/component-types.js +1 -0
  35. package/dist/contexts/component.d.ts +30 -0
  36. package/dist/contexts/component.js +16 -0
  37. package/dist/contexts/docs.d.ts +2 -0
  38. package/dist/contexts/docs.js +3 -0
  39. package/dist/contexts/index.d.ts +20 -0
  40. package/dist/contexts/index.js +16 -0
  41. package/dist/contexts/markdown.d.ts +2 -0
  42. package/dist/contexts/markdown.js +4 -0
  43. package/dist/contexts/navigation.d.ts +3 -0
  44. package/dist/contexts/navigation.js +3 -0
  45. package/dist/contexts/search.d.ts +4 -0
  46. package/dist/contexts/search.js +16 -0
  47. package/dist/contexts/use-components.d.ts +16 -0
  48. package/dist/contexts/use-components.js +4 -0
  49. package/dist/contexts-DO0sMzym.js +2581 -0
  50. package/dist/docs-Cj25B-Sh.js +50 -0
  51. package/dist/docs-DhNaW0DE.d.ts +45 -0
  52. package/dist/dropdown-Dv9VAYCW.d.ts +42 -0
  53. package/dist/dropdown-kUhwBigR.js +38 -0
  54. package/dist/icons--8QR-PrL.js +222 -0
  55. package/dist/index-BW6OPqAo.d.ts +16 -0
  56. package/dist/index-BXO3gZup.d.ts +239 -0
  57. package/dist/index-d8_VR8Z5.d.ts +14 -0
  58. package/dist/index.d.ts +22 -0
  59. package/dist/index.js +653 -683
  60. package/dist/languages/go.d.ts +13 -0
  61. package/dist/languages/go.js +16 -0
  62. package/dist/languages/http.d.ts +13 -0
  63. package/dist/languages/http.js +16 -0
  64. package/dist/languages/index.d.ts +13 -0
  65. package/dist/languages/index.js +16 -0
  66. package/dist/languages/java.d.ts +13 -0
  67. package/dist/languages/java.js +16 -0
  68. package/dist/languages/python.d.ts +13 -0
  69. package/dist/languages/python.js +16 -0
  70. package/dist/languages/ruby.d.ts +13 -0
  71. package/dist/languages/ruby.js +16 -0
  72. package/dist/languages/typescript.d.ts +13 -0
  73. package/dist/languages/typescript.js +16 -0
  74. package/dist/markdown/index.d.ts +12 -0
  75. package/dist/markdown/index.js +16 -0
  76. package/dist/markdown/md.d.ts +15 -0
  77. package/dist/markdown/md.js +3 -0
  78. package/dist/markdown/utils.d.ts +4 -0
  79. package/dist/markdown/utils.js +3 -0
  80. package/dist/markdown-DN8KaRR2.d.ts +21 -0
  81. package/dist/markdown-DunIdqFE.js +39 -0
  82. package/dist/mcp.cjs +326 -351
  83. package/dist/md-Dg8aOyMA.js +41 -0
  84. package/dist/method-c3XDArUn.d.ts +70 -0
  85. package/dist/navigation-BSn6PX-7.d.ts +28 -0
  86. package/dist/navigation-CuCg3le8.js +20 -0
  87. package/dist/overview-D21weqVJ.d.ts +39 -0
  88. package/dist/pagefind-ChrPfuVv.js +15 -0
  89. package/dist/primitives-iB9fIrMF.d.ts +98 -0
  90. package/dist/properties-Ba6F_GGj.d.ts +46 -0
  91. package/dist/routing-BE6Vrs-z.d.ts +54 -0
  92. package/dist/routing-C8oZYLsf.js +189 -0
  93. package/dist/routing.d.ts +2 -0
  94. package/dist/sdk-D2x2l6JH.d.ts +118 -0
  95. package/dist/search/index.d.ts +26 -0
  96. package/dist/search/index.js +211 -0
  97. package/dist/search/providers/algolia.d.ts +24 -0
  98. package/dist/search/providers/algolia.js +16 -0
  99. package/dist/search/providers/fuse.d.ts +18 -0
  100. package/dist/search/providers/fuse.js +31 -0
  101. package/dist/search/providers/pagefind.d.ts +7 -0
  102. package/dist/search/providers/pagefind.js +3 -0
  103. package/dist/search/providers/walker.d.ts +9 -0
  104. package/dist/search/providers/walker.js +35 -0
  105. package/dist/search/types.d.ts +3 -0
  106. package/dist/search/types.js +3 -0
  107. package/dist/search-KMqOU2tz.d.ts +20 -0
  108. package/dist/sidebar-B1X4gmY2.d.ts +35 -0
  109. package/dist/snippets-BApdMOXp.d.ts +45 -0
  110. package/dist/style-BWu-Pqcm.d.ts +182 -0
  111. package/dist/style-CkbsakoF.js +183 -0
  112. package/dist/style.d.ts +2 -0
  113. package/dist/style.js +3 -0
  114. package/dist/styles/primitives.css +0 -198
  115. package/dist/types-BLgvxY4i.d.ts +83 -0
  116. package/dist/types-DFN4M1Sp.js +34 -0
  117. package/dist/use-components-DI-AbT-D.js +7 -0
  118. package/dist/utils-B9JL_XWH.d.ts +21 -0
  119. package/dist/utils-BhYTrLot.js +32 -0
  120. package/dist/utils-ByZH9QWT.js +30 -0
  121. package/dist/utils-DlayebL1.d.ts +14 -0
  122. package/dist/utils.d.ts +2 -0
  123. package/dist/utils.js +4 -0
  124. package/package.json +2 -2
  125. package/src/components/index.ts +0 -1
  126. package/src/search/mcp.ts +1 -1
  127. package/src/style.ts +0 -12
  128. package/src/styles/primitives.css +0 -198
  129. package/dist/mcp.js +0 -15967
  130. package/src/components/dropdown.tsx +0 -91
  131. package/src/components/scripts/dropdown.ts +0 -78
@@ -1,91 +0,0 @@
1
- import * as React from 'react';
2
- import style from '../style';
3
- import { ChevronsUpDown } from 'lucide-react';
4
- import clsx from 'clsx';
5
-
6
- export const Dropdown = ({ className, children, ...rest }: React.HTMLProps<HTMLDivElement>) => {
7
- return (
8
- <div {...rest} className={`${style.Dropdown} ${className ?? ''}`}>
9
- {children}
10
- </div>
11
- );
12
- };
13
-
14
- export const DropdownTrigger = ({
15
- children,
16
- withChevron,
17
- className,
18
- isIcon,
19
- ...rest
20
- }: {
21
- children: React.ReactNode;
22
- withChevron?: boolean;
23
- isIcon?: boolean;
24
- } & (React.HTMLProps<HTMLButtonElement> & {
25
- type?: 'submit' | 'reset' | 'button';
26
- })) => {
27
- return (
28
- <button
29
- className={`${style.Button} ${style.ButtonSecondary} ${style.DropdownTrigger} ${isIcon ? style.ButtonIcon : ''} ${className ?? ''}`}
30
- aria-haspopup="listbox"
31
- {...rest}
32
- >
33
- <div className={style.DropdownTriggerContent}>{children}</div>
34
- {withChevron && (
35
- <span className={style.DropdownChevron}>
36
- <ChevronsUpDown size={16} />
37
- </span>
38
- )}
39
- </button>
40
- );
41
- };
42
-
43
- export const DropdownMenu = ({
44
- position,
45
- className,
46
- children,
47
- ...rest
48
- }: { position?: 'below' } & React.HTMLProps<HTMLUListElement>) => {
49
- return (
50
- <ul className={`${style.DropdownMenu} ${position ?? ''} ${className ?? ''}`} {...rest}>
51
- {children}
52
- </ul>
53
- );
54
- };
55
-
56
- export const DropdownItem = ({
57
- children,
58
- className,
59
- value,
60
- selected,
61
- href,
62
- }: React.HTMLProps<HTMLLIElement> & { value?: string; selected?: boolean; href?: string }) => {
63
- const inner = (
64
- <>
65
- {children}
66
- <svg
67
- xmlns="http://www.w3.org/2000/svg"
68
- width="24"
69
- height="24"
70
- viewBox="0 0 24 24"
71
- fill="none"
72
- stroke="currentColor"
73
- strokeWidth="2"
74
- strokeLinecap="round"
75
- strokeLinejoin="round"
76
- className="lucide lucide-check-icon lucide-check"
77
- >
78
- <path d="M20 6 9 17l-5-5" />
79
- </svg>
80
- </>
81
- );
82
- return (
83
- <li
84
- className={clsx(style.DropdownItem, className, selected && 'selected', href && style.DropdownItemLink)}
85
- role="option"
86
- data-dropdown-value={value}
87
- >
88
- {href ? <a href={href}>{inner}</a> : inner}
89
- </li>
90
- );
91
- };
@@ -1,78 +0,0 @@
1
- export function initDropdown({
2
- dropdownId,
3
- onSelect,
4
- isFixed,
5
- }: {
6
- dropdownId: string;
7
- onSelect?: (value: string) => void;
8
- isFixed?: boolean;
9
- }) {
10
- const dropdown = document.getElementById(dropdownId);
11
- if (!dropdown) return;
12
-
13
- const button = dropdown.querySelector('button');
14
- const menu = dropdown.querySelector('.stldocs-dropdown-menu');
15
-
16
- if (!button || !menu) return;
17
-
18
- let isOpen = false;
19
-
20
- function toggleDropdown() {
21
- if (!button || !menu) return;
22
-
23
- isOpen = !isOpen;
24
-
25
- if (isOpen) {
26
- if (isFixed) {
27
- // Calculate position for fixed dropdown
28
- const buttonRect = button.getBoundingClientRect();
29
- (menu as HTMLElement).style.top = `${buttonRect.bottom}px`;
30
- (menu as HTMLElement).style.left = `${buttonRect.left}px`;
31
- }
32
- menu.classList.add('open');
33
- button.setAttribute('aria-expanded', 'true');
34
- } else {
35
- menu.classList.remove('open');
36
- button.setAttribute('aria-expanded', 'false');
37
- }
38
- }
39
-
40
- function closeDropdown() {
41
- if (!button || !menu) return;
42
-
43
- isOpen = false;
44
- menu.classList.remove('open');
45
- button.setAttribute('aria-expanded', 'false');
46
- }
47
-
48
- // Toggle dropdown on button click
49
- button.addEventListener('click', () => {
50
- toggleDropdown();
51
- });
52
-
53
- // Close dropdown when clicking outside
54
- document.addEventListener('click', (e) => {
55
- if (!dropdown.contains(e.target as Node)) {
56
- closeDropdown();
57
- }
58
- });
59
-
60
- // Close dropdown when pressing Escape
61
- document.addEventListener('keydown', (e) => {
62
- if (e.key === 'Escape' && isOpen) {
63
- closeDropdown();
64
- }
65
- });
66
-
67
- // Close dropdown when clicking on dropdown items
68
- const dropdownItems = menu.querySelectorAll('.stldocs-dropdown-item');
69
- dropdownItems.forEach((item) => {
70
- item.addEventListener('click', () => {
71
- closeDropdown();
72
- const selectedValue = item.getAttribute('data-dropdown-value');
73
- if (selectedValue && onSelect) {
74
- onSelect(selectedValue);
75
- }
76
- });
77
- });
78
- }