@mintlify/components 1.0.6 → 1.0.8
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/components/code-group/code-snippet.js +26 -0
- package/dist/components/code-group/index.d.ts +2 -0
- package/dist/components/code-group/index.d.ts.map +1 -1
- package/dist/components/expandable/expandable.d.ts.map +1 -1
- package/dist/components/expandable/expandable.js +41 -39
- package/dist/index.js +47 -45
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { memo as p } from "react";
|
|
3
|
+
import { useGetShikiHighlightedHtml as m } from "../../hooks/use-get-shiki-highlighted-html.js";
|
|
4
|
+
import { SHIKI_CLASSNAME as s } from "../../utils/shiki/constants.js";
|
|
5
|
+
const a = p(
|
|
6
|
+
({ language: r, children: t, codeBlockThemeObject: i }) => {
|
|
7
|
+
const n = typeof t == "string" ? t : "";
|
|
8
|
+
r = r ?? "text";
|
|
9
|
+
const o = m({
|
|
10
|
+
codeString: n,
|
|
11
|
+
codeBlockTheme: i,
|
|
12
|
+
language: r,
|
|
13
|
+
opts: { structure: "inline" }
|
|
14
|
+
});
|
|
15
|
+
return typeof t == "string" && r && o ? /* @__PURE__ */ e("pre", { className: s, suppressHydrationWarning: !0, children: /* @__PURE__ */ e(
|
|
16
|
+
"code",
|
|
17
|
+
{
|
|
18
|
+
dangerouslySetInnerHTML: { __html: o },
|
|
19
|
+
suppressHydrationWarning: !0
|
|
20
|
+
}
|
|
21
|
+
) }) : /* @__PURE__ */ e("pre", { className: s, suppressHydrationWarning: !0, children: /* @__PURE__ */ e("code", { suppressHydrationWarning: !0, children: t }) });
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
export {
|
|
25
|
+
a as CodeSnippet
|
|
26
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/code-group/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/code-group/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandable.d.ts","sourceRoot":"","sources":["../../../src/components/expandable/expandable.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAWf,KAAK,eAAe,GAAG;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sBAAsB,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,6KAejB,eAAe,
|
|
1
|
+
{"version":3,"file":"expandable.d.ts","sourceRoot":"","sources":["../../../src/components/expandable/expandable.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAWf,KAAK,eAAe,GAAG;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sBAAsB,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,QAAA,MAAM,UAAU,GAAI,6KAejB,eAAe,4CAgIjB,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
import { jsxs as p, jsx as x } from "react/jsx-runtime";
|
|
2
|
-
import { useState as u, useLayoutEffect as j, useEffect as
|
|
2
|
+
import { useState as u, useLayoutEffect as j, useEffect as z, useId as B } from "react";
|
|
3
3
|
import { Classes as H } from "../../constants/selectors.js";
|
|
4
4
|
import { useExpandableMemory as I } from "../../hooks/use-expandable-memory.js";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as s } from "../../utils/cn.js";
|
|
6
6
|
import { Icon as G } from "../icon/icon.js";
|
|
7
|
-
const
|
|
8
|
-
title:
|
|
9
|
-
defaultOpen:
|
|
7
|
+
const v = "expandable-content", J = "Hide", K = "Show", Q = "child attributes", P = ({
|
|
8
|
+
title: o = Q,
|
|
9
|
+
defaultOpen: n = !1,
|
|
10
10
|
onChange: b,
|
|
11
|
-
lazy:
|
|
12
|
-
className:
|
|
13
|
-
children:
|
|
14
|
-
uniqueParamId:
|
|
11
|
+
lazy: N,
|
|
12
|
+
className: T,
|
|
13
|
+
children: L,
|
|
14
|
+
uniqueParamId: r,
|
|
15
15
|
onMount: a,
|
|
16
16
|
onOpen: d,
|
|
17
|
-
onClose:
|
|
18
|
-
openedText:
|
|
19
|
-
closedText:
|
|
20
|
-
hasScrolledToAnchorRef:
|
|
17
|
+
onClose: i,
|
|
18
|
+
openedText: S = J,
|
|
19
|
+
closedText: _ = K,
|
|
20
|
+
hasScrolledToAnchorRef: c,
|
|
21
21
|
anchor: l
|
|
22
22
|
}) => {
|
|
23
|
-
const f = !!
|
|
24
|
-
ref:
|
|
25
|
-
isExpanded:
|
|
23
|
+
const f = !!r, {
|
|
24
|
+
ref: k,
|
|
25
|
+
isExpanded: D,
|
|
26
26
|
onManualToggle: w,
|
|
27
27
|
isInSessionStorage: A
|
|
28
|
-
} = I(
|
|
28
|
+
} = I(r || "", n), [y, C] = u(n), F = !!(r && (l != null && l.includes(r))) && !(c != null && c.current), e = f ? (
|
|
29
29
|
// biome-ignore lint/style/noNestedTernary: TODO
|
|
30
|
-
|
|
30
|
+
F ? !0 : (
|
|
31
31
|
// biome-ignore lint/style/noNestedTernary: TODO
|
|
32
|
-
A ?
|
|
32
|
+
A ? D : n
|
|
33
33
|
)
|
|
34
34
|
) : y, [m, E] = u(
|
|
35
|
-
e || !
|
|
35
|
+
e || !N
|
|
36
36
|
);
|
|
37
37
|
j(() => {
|
|
38
38
|
e && !m && E(!0);
|
|
39
|
-
}, [e, m]),
|
|
39
|
+
}, [e, m]), z(() => {
|
|
40
40
|
a == null || a();
|
|
41
41
|
}, []);
|
|
42
|
-
const
|
|
43
|
-
E(!0), b && b(t), t ? d == null || d() :
|
|
42
|
+
const U = (t) => {
|
|
43
|
+
E(!0), b && b(t), t ? d == null || d() : i == null || i();
|
|
44
44
|
}, X = (t) => {
|
|
45
|
-
f ? w(t) :
|
|
46
|
-
}, $ =
|
|
45
|
+
f ? w(t) : C(t), U(t);
|
|
46
|
+
}, $ = B(), g = `${o}-${$}-content`.replace(/\s+/g, "-");
|
|
47
47
|
return /* @__PURE__ */ p(
|
|
48
48
|
"details",
|
|
49
49
|
{
|
|
50
|
-
className:
|
|
50
|
+
className: s(
|
|
51
51
|
H.Expandable,
|
|
52
52
|
"mt-4 rounded-xl border-standard",
|
|
53
|
-
|
|
53
|
+
T
|
|
54
54
|
),
|
|
55
55
|
"data-component-part": "expandable",
|
|
56
|
-
"data-testid":
|
|
56
|
+
"data-testid": r ? `${r}-children` : void 0,
|
|
57
57
|
onToggle: (t) => {
|
|
58
58
|
const h = t.currentTarget.open;
|
|
59
59
|
h !== e && X(h);
|
|
60
60
|
},
|
|
61
61
|
open: e,
|
|
62
|
-
ref:
|
|
62
|
+
ref: k,
|
|
63
63
|
children: [
|
|
64
64
|
/* @__PURE__ */ p(
|
|
65
65
|
"summary",
|
|
66
66
|
{
|
|
67
67
|
"aria-controls": g,
|
|
68
68
|
"aria-expanded": e,
|
|
69
|
-
className:
|
|
69
|
+
className: s(
|
|
70
70
|
"not-prose flex w-full cursor-pointer flex-row content-center items-center text-sm",
|
|
71
71
|
"rounded-t-xl px-3.5 py-3 text-stone-600 hover:bg-stone-50/50 hover:text-stone-900 dark:text-stone-300 dark:hover:bg-white/5 dark:hover:text-stone-200",
|
|
72
72
|
"list-none [&::-webkit-details-marker]:hidden",
|
|
@@ -77,18 +77,20 @@ const N = "expandable-content", J = "Hide", K = "Show", Q = "child attributes",
|
|
|
77
77
|
/* @__PURE__ */ x(
|
|
78
78
|
G,
|
|
79
79
|
{
|
|
80
|
-
className:
|
|
80
|
+
className: s(
|
|
81
81
|
"size-2.5 bg-stone-400 transition-transform",
|
|
82
82
|
e && "rotate-90"
|
|
83
83
|
),
|
|
84
84
|
"data-component-part": "expandable-icon",
|
|
85
|
-
icon: "angle-right"
|
|
85
|
+
icon: "angle-right",
|
|
86
|
+
overrideColor: !0,
|
|
87
|
+
overrideSize: !0
|
|
86
88
|
}
|
|
87
89
|
),
|
|
88
90
|
/* @__PURE__ */ x("div", { className: "ml-3 text-left leading-tight", children: /* @__PURE__ */ p("p", { className: "m-0", contentEditable: !1, children: [
|
|
89
|
-
e ?
|
|
91
|
+
e ? S : _,
|
|
90
92
|
" ",
|
|
91
|
-
|
|
93
|
+
o
|
|
92
94
|
] }) })
|
|
93
95
|
]
|
|
94
96
|
}
|
|
@@ -96,18 +98,18 @@ const N = "expandable-content", J = "Hide", K = "Show", Q = "child attributes",
|
|
|
96
98
|
/* @__PURE__ */ x(
|
|
97
99
|
"div",
|
|
98
100
|
{
|
|
99
|
-
className:
|
|
100
|
-
|
|
101
|
+
className: s(
|
|
102
|
+
v,
|
|
101
103
|
"mx-3 border-stone-100 border-t px-2 dark:border-white/10"
|
|
102
104
|
),
|
|
103
|
-
"data-component-part":
|
|
105
|
+
"data-component-part": v,
|
|
104
106
|
id: g,
|
|
105
|
-
children: m &&
|
|
107
|
+
children: m && L
|
|
106
108
|
}
|
|
107
109
|
)
|
|
108
110
|
]
|
|
109
111
|
},
|
|
110
|
-
|
|
112
|
+
o
|
|
111
113
|
);
|
|
112
114
|
};
|
|
113
115
|
export {
|
package/dist/index.js
CHANGED
|
@@ -7,28 +7,29 @@ import { Card as P } from "./components/card/card.js";
|
|
|
7
7
|
import { BaseCodeBlock as B } from "./components/code-block/base-code-block.js";
|
|
8
8
|
import { CodeBlock as g } from "./components/code-block/code-block.js";
|
|
9
9
|
import { CodeGroup as k } from "./components/code-group/code-group.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
10
|
+
import { CodeSnippet as b } from "./components/code-group/code-snippet.js";
|
|
11
|
+
import { Color as A } from "./components/color/color.js";
|
|
12
|
+
import { Columns as _ } from "./components/columns/columns.js";
|
|
13
|
+
import { Expandable as w } from "./components/expandable/expandable.js";
|
|
14
|
+
import { Frame as F } from "./components/frame/frame.js";
|
|
15
|
+
import { Icon as H } from "./components/icon/icon.js";
|
|
16
|
+
import { Mermaid as M } from "./components/mermaid/mermaid.js";
|
|
17
|
+
import { usePanZoom as O } from "./components/mermaid/use-pan-zoom.js";
|
|
18
|
+
import { ZoomControls as W } from "./components/mermaid/zoom-controls.js";
|
|
19
|
+
import { Panel as q } from "./components/panel/panel.js";
|
|
20
|
+
import { ParamHead as J } from "./components/property/param-head.js";
|
|
21
|
+
import { Property as Q } from "./components/property/property.js";
|
|
22
|
+
import { SearchButton as X } from "./components/search/button.js";
|
|
23
|
+
import { SearchProvider as $, useSearch as oo } from "./components/search/provider.js";
|
|
24
|
+
import { Search as eo } from "./components/search/search.js";
|
|
25
|
+
import { STEP_TITLE_SIZES as po } from "./components/steps/constants.js";
|
|
26
|
+
import { Steps as fo } from "./components/steps/steps.js";
|
|
27
|
+
import { Tabs as ao } from "./components/tabs/tabs.js";
|
|
28
|
+
import { Tile as lo } from "./components/tile/tile.js";
|
|
29
|
+
import { Tooltip as io } from "./components/tooltip/tooltip.js";
|
|
30
|
+
import { Tree as So } from "./components/tree/index.js";
|
|
31
|
+
import { Update as so } from "./components/update/update.js";
|
|
32
|
+
import { View as Po } from "./components/view/view.js";
|
|
32
33
|
export {
|
|
33
34
|
x as Accordion,
|
|
34
35
|
n as Badge,
|
|
@@ -38,35 +39,36 @@ export {
|
|
|
38
39
|
c as Check,
|
|
39
40
|
g as CodeBlock,
|
|
40
41
|
k as CodeGroup,
|
|
41
|
-
b as
|
|
42
|
-
A as
|
|
42
|
+
b as CodeSnippet,
|
|
43
|
+
A as Color,
|
|
44
|
+
_ as Columns,
|
|
43
45
|
i as Danger,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
w as Expandable,
|
|
47
|
+
F as Frame,
|
|
48
|
+
H as Icon,
|
|
47
49
|
C as Info,
|
|
48
|
-
|
|
50
|
+
M as Mermaid,
|
|
49
51
|
S as Note,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
q as Panel,
|
|
53
|
+
J as ParamHead,
|
|
54
|
+
Q as Property,
|
|
55
|
+
po as STEP_TITLE_SIZES,
|
|
56
|
+
eo as Search,
|
|
57
|
+
X as SearchButton,
|
|
58
|
+
$ as SearchProvider,
|
|
59
|
+
fo as Steps,
|
|
60
|
+
ao as Tabs,
|
|
61
|
+
lo as Tile,
|
|
60
62
|
T as Tip,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
io as Tooltip,
|
|
64
|
+
So as Tree,
|
|
65
|
+
so as Update,
|
|
66
|
+
Po as View,
|
|
65
67
|
s as Warning,
|
|
66
|
-
|
|
68
|
+
W as ZoomControls,
|
|
67
69
|
e as cn,
|
|
68
70
|
p as getInitialOpenState,
|
|
69
71
|
m as updateAndCopyUrl,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
O as usePanZoom,
|
|
73
|
+
oo as useSearch
|
|
72
74
|
};
|