@mintlify/components 1.0.4 → 1.0.6
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/callout/callout.js +4 -4
- package/dist/components/icon/icon.d.ts.map +1 -1
- package/dist/components/icon/icon.js +14 -14
- package/dist/components/property/index.d.ts +2 -0
- package/dist/components/property/index.d.ts.map +1 -1
- package/dist/components/property/param-head.d.ts +1 -1
- package/dist/components/property/param-head.d.ts.map +1 -1
- package/dist/components/search/button.d.ts.map +1 -1
- package/dist/components/search/button.js +15 -13
- package/dist/components/search/search.d.ts +4 -1
- package/dist/components/search/search.d.ts.map +1 -1
- package/dist/components/search/search.js +120 -110
- package/dist/index.js +41 -39
- package/dist/styles.css +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r, jsxs as w } from "react/jsx-runtime";
|
|
2
2
|
import I from "../../_virtual/index.js";
|
|
3
3
|
import { Classes as v } from "../../constants/selectors.js";
|
|
4
|
-
import { DangerIcon as $, CheckIcon as A, TipIcon as
|
|
4
|
+
import { DangerIcon as $, CheckIcon as A, TipIcon as _, NoteIcon as T, WarningIcon as D, InfoIcon as L } from "../../icons/index.js";
|
|
5
5
|
import { cn as x } from "../../utils/cn.js";
|
|
6
6
|
import { Icon as W } from "../icon/icon.js";
|
|
7
7
|
const j = {
|
|
@@ -18,13 +18,13 @@ const j = {
|
|
|
18
18
|
childrenClassName: "text-yellow-800 dark:text-yellow-300"
|
|
19
19
|
},
|
|
20
20
|
note: {
|
|
21
|
-
icon:
|
|
21
|
+
icon: T,
|
|
22
22
|
defaultAriaLabel: "Note",
|
|
23
23
|
className: "border border-blue-200 bg-blue-50 dark:border-blue-900 dark:bg-blue-600/20",
|
|
24
24
|
childrenClassName: "text-blue-800 dark:text-blue-300"
|
|
25
25
|
},
|
|
26
26
|
tip: {
|
|
27
|
-
icon:
|
|
27
|
+
icon: _,
|
|
28
28
|
defaultAriaLabel: "Tip",
|
|
29
29
|
className: 'border border-green-200 bg-green-50 dark:border-green-900 dark:bg-green-600/20 **:data-[component-part="callout-icon"]:mt-px',
|
|
30
30
|
childrenClassName: "text-green-800 dark:text-green-300"
|
|
@@ -109,7 +109,7 @@ const j = {
|
|
|
109
109
|
"div",
|
|
110
110
|
{
|
|
111
111
|
className: x(
|
|
112
|
-
"prose dark:prose-invert w-full min-w-0 text-sm [&_a]:border-current [&_a]:text-current! [&_code]:text-current! [&_kbd]:bg-stone-100 [&_kbd]:text-current! dark:[&_kbd]:bg-stone-800",
|
|
112
|
+
"prose dark:prose-invert w-full min-w-0 text-sm [&_a]:border-current [&_a]:text-current! [&_code]:text-current! [&_kbd]:bg-stone-100 [&_kbd]:text-current! dark:[&_kbd]:bg-stone-800 [&_strong]:text-current!",
|
|
113
113
|
d
|
|
114
114
|
),
|
|
115
115
|
"data-component-part": "callout-content",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/icon/icon.tsx"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/icon/icon.tsx"],"names":[],"mappings":"AAMA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,QAAQ,EAEb,KAAK,QAAQ,EACd,MAAM,oBAAoB,CAAC;AAG5B,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,IAAI,GAAI,kIAaX,SAAS,mDAyHX,CAAC;AAEF,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -2,12 +2,12 @@ import { jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { MINTLIFY_ICONS_CDN_URL as C } from "../../constants/index.js";
|
|
3
3
|
import { Classes as N } from "../../constants/selectors.js";
|
|
4
4
|
import { cn as i } from "../../utils/cn.js";
|
|
5
|
-
import { getIconUrl as y, ICON_TYPES as M } from "../../utils/icon-utils.js";
|
|
6
|
-
import { isAbsoluteUrl as
|
|
7
|
-
const
|
|
5
|
+
import { getIconUrl as y, ICON_TYPES as M, isBrandsIcon as $ } from "../../utils/icon-utils.js";
|
|
6
|
+
import { isAbsoluteUrl as v } from "../../utils/is-absolute-url.js";
|
|
7
|
+
const x = ({
|
|
8
8
|
icon: t,
|
|
9
9
|
iconType: a,
|
|
10
|
-
color:
|
|
10
|
+
color: e,
|
|
11
11
|
colorLight: g,
|
|
12
12
|
colorDark: p,
|
|
13
13
|
size: k,
|
|
@@ -22,22 +22,22 @@ const w = ({
|
|
|
22
22
|
...!I && { width: k || 16, height: k || 16 },
|
|
23
23
|
display: "inline-block",
|
|
24
24
|
verticalAlign: "middle"
|
|
25
|
-
},
|
|
25
|
+
}, s = g && p, r = s ? {
|
|
26
26
|
...b,
|
|
27
27
|
"--color-light": g,
|
|
28
28
|
"--color-dark": p
|
|
29
29
|
} : b, o = i(
|
|
30
30
|
N.Icon,
|
|
31
31
|
"inline",
|
|
32
|
-
!(
|
|
33
|
-
|
|
32
|
+
!(e || s || l) && "bg-primary dark:bg-primary-light",
|
|
33
|
+
s && "bg-(--color-light) dark:bg-(--color-dark)",
|
|
34
34
|
f
|
|
35
35
|
), W = h === "pdf", m = y(t.toLowerCase(), a, d);
|
|
36
36
|
if (a && !M.includes(a))
|
|
37
37
|
return console.log(
|
|
38
38
|
`Invalid iconType ${a} expected a string equal to one of: brands, duotone, light, regular, sharp-solid, solid, thin`
|
|
39
39
|
), null;
|
|
40
|
-
if (typeof t == "string" && (
|
|
40
|
+
if (typeof t == "string" && (v(t) || t.startsWith("/"))) {
|
|
41
41
|
if (t.startsWith(C) || t.startsWith("https://mintlify.b-cdn.net"))
|
|
42
42
|
return /* @__PURE__ */ n(
|
|
43
43
|
"svg",
|
|
@@ -52,7 +52,7 @@ const w = ({
|
|
|
52
52
|
maskRepeat: "no-repeat",
|
|
53
53
|
maskPosition: "center",
|
|
54
54
|
maskSize: "100%",
|
|
55
|
-
...!
|
|
55
|
+
...!s && { backgroundColor: "currentColor" },
|
|
56
56
|
...r
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -78,7 +78,7 @@ const w = ({
|
|
|
78
78
|
alt: t,
|
|
79
79
|
className: i(
|
|
80
80
|
o,
|
|
81
|
-
!(
|
|
81
|
+
!(e || l || s) && "bg-stone-800 dark:bg-stone-100"
|
|
82
82
|
),
|
|
83
83
|
"data-component-part": "icon-image",
|
|
84
84
|
src: m,
|
|
@@ -93,7 +93,7 @@ const w = ({
|
|
|
93
93
|
{
|
|
94
94
|
className: i(
|
|
95
95
|
o,
|
|
96
|
-
!(
|
|
96
|
+
!(e || l || s) && "bg-stone-800 dark:bg-stone-100"
|
|
97
97
|
),
|
|
98
98
|
"data-component-part": "icon-svg",
|
|
99
99
|
style: {
|
|
@@ -103,13 +103,13 @@ const w = ({
|
|
|
103
103
|
maskImage: `url(${m})`,
|
|
104
104
|
maskRepeat: "no-repeat",
|
|
105
105
|
maskPosition: "center",
|
|
106
|
-
maskSize: d === "lucide" ? "100%" : void 0,
|
|
107
|
-
backgroundColor:
|
|
106
|
+
maskSize: d === "lucide" && !$(t) ? "100%" : void 0,
|
|
107
|
+
backgroundColor: e,
|
|
108
108
|
...r
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
);
|
|
112
112
|
};
|
|
113
113
|
export {
|
|
114
|
-
|
|
114
|
+
x as Icon
|
|
115
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/property/index.tsx"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/property/index.tsx"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropertyProps } from './property';
|
|
2
2
|
type ParamHeadProps = Omit<PropertyProps, "children">;
|
|
3
3
|
declare const ParamHead: ({ name, type, location, required, deprecated, default: defaultValue, id, pre, post, onMount, navigateToHeaderAriaLabel, defaultLabel, requiredLabel, deprecatedLabel, }: ParamHeadProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
4
|
-
export { ParamHead };
|
|
4
|
+
export { ParamHead, type ParamHeadProps };
|
|
5
5
|
//# sourceMappingURL=param-head.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"param-head.d.ts","sourceRoot":"","sources":["../../../src/components/property/param-head.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,KAAK,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;AAEtD,QAAA,MAAM,SAAS,GAAI,yKAehB,cAAc,mDA4HhB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"param-head.d.ts","sourceRoot":"","sources":["../../../src/components/property/param-head.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,KAAK,cAAc,GAAG,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;AAEtD,QAAA,MAAM,SAAS,GAAI,yKAehB,cAAc,mDA4HhB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/search/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,oBAAoB,EAAc,MAAM,OAAO,CAAC;AAI9D,KAAK,iBAAiB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACjE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,QAAA,MAAM,YAAY;mBAJD,OAAO;mBACP,MAAM;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/search/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,oBAAoB,EAAc,MAAM,OAAO,CAAC;AAI9D,KAAK,iBAAiB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IACjE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,QAAA,MAAM,YAAY;mBAJD,OAAO;mBACP,MAAM;qDAwDtB,CAAC;AAIF,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as x } from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { useSearch as
|
|
3
|
+
import { cn as p } from "../../utils/cn.js";
|
|
4
|
+
import { useSearch as l } from "./provider.js";
|
|
5
5
|
import u from "../../node_modules/.pnpm/lucide-react@0.453.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/search.js";
|
|
6
|
-
const
|
|
6
|
+
const h = x(
|
|
7
7
|
({
|
|
8
8
|
showShortcut: o = !0,
|
|
9
9
|
shortcutText: s = "⌘K",
|
|
@@ -12,20 +12,22 @@ const b = x(
|
|
|
12
12
|
onClick: e,
|
|
13
13
|
...d
|
|
14
14
|
}, i) => {
|
|
15
|
-
const t =
|
|
15
|
+
const t = l(), m = (c) => {
|
|
16
16
|
t == null || t.open(), e == null || e(c);
|
|
17
17
|
};
|
|
18
18
|
return /* @__PURE__ */ f(
|
|
19
19
|
"button",
|
|
20
20
|
{
|
|
21
|
-
className:
|
|
21
|
+
className: p(
|
|
22
22
|
"flex w-full items-center gap-2 px-3 py-2 text-left text-sm",
|
|
23
|
-
"bg-
|
|
24
|
-
"border border-stone-200 dark:border-
|
|
23
|
+
"bg-transparent",
|
|
24
|
+
"border border-stone-200 dark:border-white/10",
|
|
25
25
|
"rounded-xl",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
26
|
+
"text-stone-500",
|
|
27
|
+
"hover:border-stone-300 dark:hover:border-white/20",
|
|
28
|
+
"focus:outline-none focus:ring-0 focus:ring-offset-0",
|
|
28
29
|
"transition-colors",
|
|
30
|
+
"cursor-pointer",
|
|
29
31
|
n
|
|
30
32
|
),
|
|
31
33
|
onClick: m,
|
|
@@ -36,18 +38,18 @@ const b = x(
|
|
|
36
38
|
/* @__PURE__ */ r(
|
|
37
39
|
u,
|
|
38
40
|
{
|
|
39
|
-
className: "shrink-0 text-stone-
|
|
41
|
+
className: "shrink-0 text-stone-800 dark:text-stone-500",
|
|
40
42
|
size: 16
|
|
41
43
|
}
|
|
42
44
|
),
|
|
43
45
|
/* @__PURE__ */ r("span", { className: "flex-1 text-stone-500 dark:text-stone-400", children: a || "Search..." }),
|
|
44
|
-
o && /* @__PURE__ */ r("kbd", { className: "hidden items-center gap-0.5 rounded
|
|
46
|
+
o && /* @__PURE__ */ r("kbd", { className: "hidden items-center gap-0.5 rounded px-1.5 py-0.5 font-medium font-sans text-stone-500 text-xs sm:inline-flex dark:text-stone-400", children: s })
|
|
45
47
|
]
|
|
46
48
|
}
|
|
47
49
|
);
|
|
48
50
|
}
|
|
49
51
|
);
|
|
50
|
-
|
|
52
|
+
h.displayName = "SearchButton";
|
|
51
53
|
export {
|
|
52
|
-
|
|
54
|
+
h as SearchButton
|
|
53
55
|
};
|
|
@@ -4,6 +4,7 @@ type SearchResult = {
|
|
|
4
4
|
header: string;
|
|
5
5
|
content: string;
|
|
6
6
|
link: string;
|
|
7
|
+
icon?: ReactNode;
|
|
7
8
|
metadata?: {
|
|
8
9
|
breadcrumbs?: string[];
|
|
9
10
|
[key: string]: unknown;
|
|
@@ -22,14 +23,16 @@ type SearchProps = {
|
|
|
22
23
|
emptyState?: ReactNode;
|
|
23
24
|
loadingState?: ReactNode;
|
|
24
25
|
position?: "top" | "center";
|
|
26
|
+
paddingTop?: string;
|
|
25
27
|
};
|
|
26
28
|
type SearchHitProps = {
|
|
27
29
|
isActive: boolean;
|
|
28
30
|
header: string;
|
|
29
31
|
description: string;
|
|
32
|
+
icon?: ReactNode;
|
|
30
33
|
metadata?: SearchResult["metadata"];
|
|
31
34
|
};
|
|
32
|
-
declare const SearchHit: ({ isActive, header, description, metadata, }: SearchHitProps) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
declare const SearchHit: ({ isActive, header, description, icon, metadata, }: SearchHitProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
36
|
declare const Search: import('react').ForwardRefExoticComponent<SearchProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
34
37
|
export type { SearchResult, SearchProps };
|
|
35
38
|
export { Search, SearchHit };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/components/search/search.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/components/search/search.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAGL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAGf,KAAK,YAAY,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE;QACT,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC;IAChC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;CACrC,CAAC;AAEF,QAAA,MAAM,SAAS,GAAI,oDAMhB,cAAc,4CAuChB,CAAC;AAEF,QAAA,MAAM,MAAM,0GA6RX,CAAC;AAIF,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1,127 +1,134 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Combobox as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { Transition as
|
|
9
|
-
import { Dialog as
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as s, jsx as t, Fragment as g } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as G, useState as T, useRef as M, useImperativeHandle as O, useEffect as P, useCallback as p, useMemo as b, Fragment as x } from "react";
|
|
3
|
+
import { cn as m } from "../../utils/cn.js";
|
|
4
|
+
import { Combobox as X, ComboboxInput as B, ComboboxOptions as J, ComboboxOption as C } from "../../node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/components/combobox/combobox.js";
|
|
5
|
+
import U from "../../node_modules/.pnpm/lucide-react@0.453.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/search.js";
|
|
6
|
+
import V from "../../node_modules/.pnpm/lucide-react@0.453.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
7
|
+
import W from "../../node_modules/.pnpm/lucide-react@0.453.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/search-x.js";
|
|
8
|
+
import { Transition as Y, TransitionChild as F } from "../../node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/components/transition/transition.js";
|
|
9
|
+
import { Dialog as Z, DialogPanel as _ } from "../../node_modules/.pnpm/@headlessui_react@2.2.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@headlessui/react/dist/components/dialog/dialog.js";
|
|
10
|
+
import L from "../../node_modules/.pnpm/lucide-react@0.453.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-right.js";
|
|
11
|
+
const j = ({
|
|
12
|
+
isActive: d,
|
|
12
13
|
header: r,
|
|
13
|
-
description:
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
description: i,
|
|
15
|
+
icon: o,
|
|
16
|
+
metadata: n
|
|
17
|
+
}) => /* @__PURE__ */ s(
|
|
16
18
|
"div",
|
|
17
19
|
{
|
|
18
|
-
className:
|
|
19
|
-
"flex w-full cursor-pointer
|
|
20
|
-
|
|
20
|
+
className: m(
|
|
21
|
+
"flex w-full cursor-pointer items-start gap-2 rounded-xl border border-transparent bg-transparent px-3 py-2 text-stone-500 transition-colors focus:ring-0 focus:ring-offset-0",
|
|
22
|
+
d && "bg-stone-100 dark:bg-white/5"
|
|
21
23
|
),
|
|
22
24
|
children: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
o && /* @__PURE__ */ t("div", { className: "shrink-0 self-center text-stone-700 dark:text-stone-300", children: o }),
|
|
26
|
+
/* @__PURE__ */ s("div", { className: "flex flex-1 flex-col gap-1", children: [
|
|
27
|
+
(n == null ? void 0 : n.breadcrumbs) && n.breadcrumbs.length > 0 && /* @__PURE__ */ t("div", { className: "flex items-center gap-1 truncate text-stone-500 text-xs dark:text-stone-400", children: n.breadcrumbs.map((f, c) => (
|
|
28
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: Breadcrumbs are positional and may contain duplicates
|
|
29
|
+
/* @__PURE__ */ s(x, { children: [
|
|
30
|
+
c > 0 && /* @__PURE__ */ t("span", { className: "text-stone-400", children: " > " }),
|
|
31
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: f })
|
|
32
|
+
] }, c)
|
|
33
|
+
)) }),
|
|
34
|
+
/* @__PURE__ */ t("div", { className: "truncate font-medium text-sm text-stone-900 dark:text-white", children: r }),
|
|
35
|
+
i && /* @__PURE__ */ t("div", { className: "line-clamp-2 text-sm text-stone-600 dark:text-stone-400", children: i })
|
|
36
|
+
] }),
|
|
37
|
+
d && /* @__PURE__ */ t(L, { className: "size-5 shrink-0 self-center text-stone-400 dark:text-stone-500" })
|
|
32
38
|
]
|
|
33
39
|
}
|
|
34
|
-
),
|
|
40
|
+
), ee = G(
|
|
35
41
|
({
|
|
36
|
-
onSearch:
|
|
42
|
+
onSearch: d,
|
|
37
43
|
results: r,
|
|
38
|
-
isOpen:
|
|
44
|
+
isOpen: i,
|
|
39
45
|
onClose: o,
|
|
40
|
-
isLoading:
|
|
41
|
-
placeholder:
|
|
42
|
-
recentSearches:
|
|
43
|
-
onSelectResult:
|
|
44
|
-
className:
|
|
45
|
-
emptyState:
|
|
46
|
-
loadingState:
|
|
47
|
-
position:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
isLoading: n = !1,
|
|
47
|
+
placeholder: f = "Search...",
|
|
48
|
+
recentSearches: c = [],
|
|
49
|
+
onSelectResult: h,
|
|
50
|
+
className: z,
|
|
51
|
+
emptyState: S,
|
|
52
|
+
loadingState: D,
|
|
53
|
+
position: y = "top",
|
|
54
|
+
paddingTop: E = "64px"
|
|
55
|
+
}, K) => {
|
|
56
|
+
const [a, k] = T(""), [v, N] = T(!1), w = M(null);
|
|
57
|
+
O(K, () => w.current), P(() => {
|
|
58
|
+
i || (k(""), N(!1));
|
|
59
|
+
}, [i]);
|
|
60
|
+
const R = p(
|
|
54
61
|
(e) => {
|
|
55
|
-
|
|
62
|
+
k(e), d(e);
|
|
56
63
|
},
|
|
57
|
-
[
|
|
58
|
-
), u =
|
|
64
|
+
[d]
|
|
65
|
+
), u = p(
|
|
59
66
|
(e) => {
|
|
60
|
-
e && (
|
|
67
|
+
e && (h == null || h(e, a), o());
|
|
61
68
|
},
|
|
62
|
-
[
|
|
63
|
-
), H =
|
|
69
|
+
[h, a, o]
|
|
70
|
+
), H = p(
|
|
64
71
|
(e) => {
|
|
65
72
|
if (e.key === "Escape") {
|
|
66
73
|
e.preventDefault(), o();
|
|
67
74
|
return;
|
|
68
75
|
}
|
|
69
|
-
if (e.key === "Tab" && (r.length > 0 ||
|
|
76
|
+
if (e.key === "Tab" && (r.length > 0 || c.length > 0) && (e.preventDefault(), e.currentTarget.setSelectionRange(
|
|
70
77
|
e.currentTarget.value.length,
|
|
71
78
|
e.currentTarget.value.length
|
|
72
|
-
)), e.key === "Enter" && (e.metaKey || e.ctrlKey) && a && r.length > 0 && !
|
|
73
|
-
const
|
|
74
|
-
|
|
79
|
+
)), e.key === "Enter" && (e.metaKey || e.ctrlKey) && a && r.length > 0 && !n) {
|
|
80
|
+
const l = r[0];
|
|
81
|
+
l && u(l);
|
|
75
82
|
}
|
|
76
83
|
},
|
|
77
|
-
[r,
|
|
78
|
-
), I =
|
|
79
|
-
|
|
80
|
-
}, []),
|
|
81
|
-
() => !a &&
|
|
82
|
-
[a,
|
|
83
|
-
),
|
|
84
|
-
() => a && r.length > 0 && !
|
|
85
|
-
[a, r.length,
|
|
86
|
-
),
|
|
87
|
-
() => a && !
|
|
88
|
-
[a,
|
|
89
|
-
),
|
|
90
|
-
|
|
84
|
+
[r, c, u, o, a, n]
|
|
85
|
+
), I = p((e) => {
|
|
86
|
+
N(e.currentTarget.scrollTop > 0);
|
|
87
|
+
}, []), Q = b(
|
|
88
|
+
() => !a && c.length > 0 && r.length === 0,
|
|
89
|
+
[a, c.length, r.length]
|
|
90
|
+
), $ = b(
|
|
91
|
+
() => a && r.length > 0 && !n,
|
|
92
|
+
[a, r.length, n]
|
|
93
|
+
), q = b(
|
|
94
|
+
() => a && !n && r.length === 0,
|
|
95
|
+
[a, n, r.length]
|
|
96
|
+
), A = /* @__PURE__ */ s(
|
|
97
|
+
X,
|
|
91
98
|
{
|
|
92
99
|
onChange: (e) => {
|
|
93
100
|
e && u(e);
|
|
94
101
|
},
|
|
95
102
|
value: null,
|
|
96
103
|
children: [
|
|
97
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ s(
|
|
98
105
|
"div",
|
|
99
106
|
{
|
|
100
|
-
className:
|
|
107
|
+
className: m(
|
|
101
108
|
"relative z-10 h-14 border-transparent border-b p-1.5 transition",
|
|
102
109
|
v && "border-stone-200 dark:border-white/10"
|
|
103
110
|
),
|
|
104
111
|
children: [
|
|
105
112
|
/* @__PURE__ */ t(
|
|
106
|
-
|
|
113
|
+
B,
|
|
107
114
|
{
|
|
108
115
|
autoComplete: "off",
|
|
109
116
|
autoFocus: !0,
|
|
110
|
-
className:
|
|
111
|
-
"peer h-full w-full rounded-
|
|
117
|
+
className: m(
|
|
118
|
+
"peer h-full w-full rounded-xl bg-white pr-14 pl-11 text-stone-950 tracking-tight shadow-sm outline-none ring ring-black/5 transition placeholder:text-stone-400 focus:ring-black/90 dark:bg-stone-900 dark:text-white dark:focus:ring-white placeholder:dark:text-white/50",
|
|
112
119
|
"[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none",
|
|
113
120
|
!v && a && "shadow-lg"
|
|
114
121
|
),
|
|
115
|
-
onChange: (e) =>
|
|
122
|
+
onChange: (e) => R(e.target.value),
|
|
116
123
|
onKeyDown: H,
|
|
117
|
-
placeholder:
|
|
124
|
+
placeholder: f,
|
|
118
125
|
ref: w,
|
|
119
126
|
type: "search",
|
|
120
127
|
value: a
|
|
121
128
|
}
|
|
122
129
|
),
|
|
123
130
|
/* @__PURE__ */ t(
|
|
124
|
-
|
|
131
|
+
U,
|
|
125
132
|
{
|
|
126
133
|
className: "absolute top-1/2 left-5 -translate-y-1/2 text-stone-950 opacity-50 peer-focus:opacity-100 dark:text-white",
|
|
127
134
|
size: 18
|
|
@@ -131,26 +138,27 @@ const F = ({
|
|
|
131
138
|
]
|
|
132
139
|
}
|
|
133
140
|
),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
|
|
141
|
+
/* @__PURE__ */ s(
|
|
142
|
+
J,
|
|
136
143
|
{
|
|
137
144
|
className: "mx-1.5 max-h-[calc(100vh-10rem)] overflow-y-auto",
|
|
138
145
|
onScroll: I,
|
|
139
146
|
static: !0,
|
|
140
147
|
children: [
|
|
141
|
-
|
|
148
|
+
Q && /* @__PURE__ */ s(g, { children: [
|
|
142
149
|
/* @__PURE__ */ t("div", { className: "flex items-center justify-between px-2.5 py-2", children: /* @__PURE__ */ t("span", { className: "truncate text-sm text-stone-500", children: "Recent searches" }) }),
|
|
143
|
-
|
|
144
|
-
|
|
150
|
+
c.map((e) => /* @__PURE__ */ t(
|
|
151
|
+
C,
|
|
145
152
|
{
|
|
146
|
-
className: "last:mb-
|
|
153
|
+
className: "last:mb-2",
|
|
147
154
|
value: e,
|
|
148
|
-
children: ({ focus:
|
|
149
|
-
|
|
155
|
+
children: ({ focus: l }) => /* @__PURE__ */ t(
|
|
156
|
+
j,
|
|
150
157
|
{
|
|
151
158
|
description: e.content,
|
|
152
159
|
header: e.header,
|
|
153
|
-
|
|
160
|
+
icon: e.icon,
|
|
161
|
+
isActive: l,
|
|
154
162
|
metadata: e.metadata
|
|
155
163
|
}
|
|
156
164
|
)
|
|
@@ -158,37 +166,38 @@ const F = ({
|
|
|
158
166
|
e.id
|
|
159
167
|
))
|
|
160
168
|
] }),
|
|
161
|
-
|
|
162
|
-
|
|
169
|
+
$ && r.map((e) => /* @__PURE__ */ t(
|
|
170
|
+
C,
|
|
163
171
|
{
|
|
164
|
-
className: "last:mb-
|
|
172
|
+
className: "last:mb-2",
|
|
165
173
|
value: e,
|
|
166
|
-
children: ({ focus:
|
|
167
|
-
|
|
174
|
+
children: ({ focus: l }) => /* @__PURE__ */ t(
|
|
175
|
+
j,
|
|
168
176
|
{
|
|
169
177
|
description: e.content,
|
|
170
178
|
header: e.header,
|
|
171
|
-
|
|
179
|
+
icon: e.icon,
|
|
180
|
+
isActive: l,
|
|
172
181
|
metadata: e.metadata
|
|
173
182
|
}
|
|
174
183
|
)
|
|
175
184
|
},
|
|
176
185
|
e.id
|
|
177
186
|
)),
|
|
178
|
-
|
|
179
|
-
/* @__PURE__ */ t(
|
|
180
|
-
/* @__PURE__ */
|
|
187
|
+
n && a && /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center gap-3 px-2.5 py-12", children: D || /* @__PURE__ */ s(g, { children: [
|
|
188
|
+
/* @__PURE__ */ t(V, { className: "size-6 animate-spin text-stone-400 dark:text-stone-500" }),
|
|
189
|
+
/* @__PURE__ */ s("div", { className: "text-center", children: [
|
|
181
190
|
/* @__PURE__ */ t("p", { className: "font-medium text-sm text-stone-700 dark:text-stone-300", children: "Searching..." }),
|
|
182
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ s("p", { className: "mt-1 text-stone-500 text-xs dark:text-stone-400", children: [
|
|
183
192
|
'Finding results for "',
|
|
184
193
|
a,
|
|
185
194
|
'"'
|
|
186
195
|
] })
|
|
187
196
|
] })
|
|
188
197
|
] }) }),
|
|
189
|
-
|
|
190
|
-
/* @__PURE__ */ t(
|
|
191
|
-
/* @__PURE__ */
|
|
198
|
+
q && /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center gap-3 px-2.5 py-12", children: S || /* @__PURE__ */ s(g, { children: [
|
|
199
|
+
/* @__PURE__ */ t(W, { className: "size-6 text-stone-300 dark:text-stone-600" }),
|
|
200
|
+
/* @__PURE__ */ s("div", { className: "text-center", children: [
|
|
192
201
|
/* @__PURE__ */ t("p", { className: "font-medium text-sm text-stone-700 dark:text-stone-300", children: "No results found" }),
|
|
193
202
|
/* @__PURE__ */ t("p", { className: "mt-1 text-stone-500 text-xs dark:text-stone-400", children: "Try searching with different keywords" })
|
|
194
203
|
] })
|
|
@@ -199,17 +208,17 @@ const F = ({
|
|
|
199
208
|
]
|
|
200
209
|
}
|
|
201
210
|
);
|
|
202
|
-
return /* @__PURE__ */ t(
|
|
203
|
-
|
|
211
|
+
return /* @__PURE__ */ t(Y, { appear: !0, as: x, show: i, children: /* @__PURE__ */ s(
|
|
212
|
+
Z,
|
|
204
213
|
{
|
|
205
214
|
as: "div",
|
|
206
|
-
className:
|
|
215
|
+
className: m("relative z-50", z),
|
|
207
216
|
onClose: o,
|
|
208
217
|
children: [
|
|
209
218
|
/* @__PURE__ */ t(
|
|
210
|
-
|
|
219
|
+
F,
|
|
211
220
|
{
|
|
212
|
-
as:
|
|
221
|
+
as: x,
|
|
213
222
|
enter: "ease-out duration-100",
|
|
214
223
|
enterFrom: "opacity-0",
|
|
215
224
|
enterTo: "opacity-100",
|
|
@@ -222,21 +231,22 @@ const F = ({
|
|
|
222
231
|
/* @__PURE__ */ t(
|
|
223
232
|
"div",
|
|
224
233
|
{
|
|
225
|
-
className:
|
|
234
|
+
className: m(
|
|
226
235
|
"fixed inset-0 z-10 flex justify-center p-4",
|
|
227
|
-
|
|
236
|
+
y === "top" ? "items-start" : "items-center"
|
|
228
237
|
),
|
|
238
|
+
style: y === "top" ? { paddingTop: E } : void 0,
|
|
229
239
|
children: /* @__PURE__ */ t(
|
|
230
|
-
|
|
240
|
+
F,
|
|
231
241
|
{
|
|
232
|
-
as:
|
|
242
|
+
as: x,
|
|
233
243
|
enter: "ease-out duration-100",
|
|
234
244
|
enterFrom: "opacity-0 scale-95",
|
|
235
245
|
enterTo: "opacity-100 scale-100",
|
|
236
246
|
leave: "ease-in duration-50",
|
|
237
247
|
leaveFrom: "opacity-100 scale-100",
|
|
238
248
|
leaveTo: "opacity-0 scale-95",
|
|
239
|
-
children: /* @__PURE__ */ t(
|
|
249
|
+
children: /* @__PURE__ */ t(_, { className: "flex w-full max-w-[640px] flex-col overflow-hidden rounded-2xl border border-stone-200 bg-white shadow-2xl dark:border-white/10 dark:bg-stone-900", children: A })
|
|
240
250
|
}
|
|
241
251
|
)
|
|
242
252
|
}
|
|
@@ -246,8 +256,8 @@ const F = ({
|
|
|
246
256
|
) });
|
|
247
257
|
}
|
|
248
258
|
);
|
|
249
|
-
|
|
259
|
+
ee.displayName = "Search";
|
|
250
260
|
export {
|
|
251
|
-
|
|
252
|
-
|
|
261
|
+
ee as Search,
|
|
262
|
+
j as SearchHit
|
|
253
263
|
};
|