@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.
- package/dist/breadcrumbs-D5viAm7a.d.ts +20 -0
- package/dist/chunk-Bp6m_JJh.js +13 -0
- package/dist/component-generics-BnrVqdQj.d.ts +29 -0
- package/dist/component-generics-Df4EDvxk.js +41 -0
- package/dist/components/breadcrumbs.d.ts +2 -0
- package/dist/components/breadcrumbs.js +16 -0
- package/dist/components/chat.d.ts +14 -0
- package/dist/components/chat.js +128 -0
- package/dist/components/dropdown.d.ts +2 -0
- package/dist/components/dropdown.js +4 -0
- package/dist/components/icons.d.ts +50 -0
- package/dist/components/icons.js +3 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.js +16 -0
- package/dist/components/method.d.ts +2 -0
- package/dist/components/method.js +16 -0
- package/dist/components/overview.d.ts +2 -0
- package/dist/components/overview.js +16 -0
- package/dist/components/primitives.d.ts +2 -0
- package/dist/components/primitives.js +16 -0
- package/dist/components/properties.d.ts +2 -0
- package/dist/components/properties.js +16 -0
- package/dist/components/scripts/dropdown.d.ts +12 -0
- package/dist/components/scripts/dropdown.js +50 -0
- package/dist/components/sdk.d.ts +3 -0
- package/dist/components/sdk.js +16 -0
- package/dist/components/sidebar.d.ts +2 -0
- package/dist/components/sidebar.js +16 -0
- package/dist/components/snippets.d.ts +4 -0
- package/dist/components/snippets.js +16 -0
- package/dist/contexts/component-generics.d.ts +2 -0
- package/dist/contexts/component-generics.js +3 -0
- package/dist/contexts/component-types.d.ts +18 -0
- package/dist/contexts/component-types.js +1 -0
- package/dist/contexts/component.d.ts +30 -0
- package/dist/contexts/component.js +16 -0
- package/dist/contexts/docs.d.ts +2 -0
- package/dist/contexts/docs.js +3 -0
- package/dist/contexts/index.d.ts +20 -0
- package/dist/contexts/index.js +16 -0
- package/dist/contexts/markdown.d.ts +2 -0
- package/dist/contexts/markdown.js +4 -0
- package/dist/contexts/navigation.d.ts +3 -0
- package/dist/contexts/navigation.js +3 -0
- package/dist/contexts/search.d.ts +4 -0
- package/dist/contexts/search.js +16 -0
- package/dist/contexts/use-components.d.ts +16 -0
- package/dist/contexts/use-components.js +4 -0
- package/dist/contexts-DO0sMzym.js +2581 -0
- package/dist/docs-Cj25B-Sh.js +50 -0
- package/dist/docs-DhNaW0DE.d.ts +45 -0
- package/dist/dropdown-Dv9VAYCW.d.ts +42 -0
- package/dist/dropdown-kUhwBigR.js +38 -0
- package/dist/icons--8QR-PrL.js +222 -0
- package/dist/index-BW6OPqAo.d.ts +16 -0
- package/dist/index-BXO3gZup.d.ts +239 -0
- package/dist/index-d8_VR8Z5.d.ts +14 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +653 -683
- package/dist/languages/go.d.ts +13 -0
- package/dist/languages/go.js +16 -0
- package/dist/languages/http.d.ts +13 -0
- package/dist/languages/http.js +16 -0
- package/dist/languages/index.d.ts +13 -0
- package/dist/languages/index.js +16 -0
- package/dist/languages/java.d.ts +13 -0
- package/dist/languages/java.js +16 -0
- package/dist/languages/python.d.ts +13 -0
- package/dist/languages/python.js +16 -0
- package/dist/languages/ruby.d.ts +13 -0
- package/dist/languages/ruby.js +16 -0
- package/dist/languages/typescript.d.ts +13 -0
- package/dist/languages/typescript.js +16 -0
- package/dist/markdown/index.d.ts +12 -0
- package/dist/markdown/index.js +16 -0
- package/dist/markdown/md.d.ts +15 -0
- package/dist/markdown/md.js +3 -0
- package/dist/markdown/utils.d.ts +4 -0
- package/dist/markdown/utils.js +3 -0
- package/dist/markdown-DN8KaRR2.d.ts +21 -0
- package/dist/markdown-DunIdqFE.js +39 -0
- package/dist/mcp.cjs +326 -351
- package/dist/md-Dg8aOyMA.js +41 -0
- package/dist/method-c3XDArUn.d.ts +70 -0
- package/dist/navigation-BSn6PX-7.d.ts +28 -0
- package/dist/navigation-CuCg3le8.js +20 -0
- package/dist/overview-D21weqVJ.d.ts +39 -0
- package/dist/pagefind-ChrPfuVv.js +15 -0
- package/dist/primitives-iB9fIrMF.d.ts +98 -0
- package/dist/properties-Ba6F_GGj.d.ts +46 -0
- package/dist/routing-BE6Vrs-z.d.ts +54 -0
- package/dist/routing-C8oZYLsf.js +189 -0
- package/dist/routing.d.ts +2 -0
- package/dist/sdk-D2x2l6JH.d.ts +118 -0
- package/dist/search/index.d.ts +26 -0
- package/dist/search/index.js +211 -0
- package/dist/search/providers/algolia.d.ts +24 -0
- package/dist/search/providers/algolia.js +16 -0
- package/dist/search/providers/fuse.d.ts +18 -0
- package/dist/search/providers/fuse.js +31 -0
- package/dist/search/providers/pagefind.d.ts +7 -0
- package/dist/search/providers/pagefind.js +3 -0
- package/dist/search/providers/walker.d.ts +9 -0
- package/dist/search/providers/walker.js +35 -0
- package/dist/search/types.d.ts +3 -0
- package/dist/search/types.js +3 -0
- package/dist/search-KMqOU2tz.d.ts +20 -0
- package/dist/sidebar-B1X4gmY2.d.ts +35 -0
- package/dist/snippets-BApdMOXp.d.ts +45 -0
- package/dist/style-BWu-Pqcm.d.ts +182 -0
- package/dist/style-CkbsakoF.js +183 -0
- package/dist/style.d.ts +2 -0
- package/dist/style.js +3 -0
- package/dist/styles/primitives.css +0 -198
- package/dist/types-BLgvxY4i.d.ts +83 -0
- package/dist/types-DFN4M1Sp.js +34 -0
- package/dist/use-components-DI-AbT-D.js +7 -0
- package/dist/utils-B9JL_XWH.d.ts +21 -0
- package/dist/utils-BhYTrLot.js +32 -0
- package/dist/utils-ByZH9QWT.js +30 -0
- package/dist/utils-DlayebL1.d.ts +14 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +4 -0
- package/package.json +2 -2
- package/src/components/index.ts +0 -1
- package/src/search/mcp.ts +1 -1
- package/src/style.ts +0 -12
- package/src/styles/primitives.css +0 -198
- package/dist/mcp.js +0 -15967
- package/src/components/dropdown.tsx +0 -91
- 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
|
-
}
|