@mintlify/components 1.0.0 → 1.0.2
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/accordion/accordion-cover.d.ts +12 -0
- package/dist/components/accordion/accordion-cover.d.ts.map +1 -0
- package/dist/components/accordion/accordion-cover.js +28 -28
- package/dist/components/accordion/accordion-group.d.ts +9 -0
- package/dist/components/accordion/accordion-group.d.ts.map +1 -0
- package/dist/components/accordion/accordion-group.js +1 -1
- package/dist/components/accordion/accordion-url-utils.d.ts +5 -0
- package/dist/components/accordion/accordion-url-utils.d.ts.map +1 -0
- package/dist/components/accordion/accordion.d.ts +35 -0
- package/dist/components/accordion/accordion.d.ts.map +1 -0
- package/dist/components/accordion/accordion.js +72 -65
- package/dist/components/accordion/index.d.ts +7 -0
- package/dist/components/accordion/index.d.ts.map +1 -0
- package/dist/components/badge/badge.d.ts +29 -0
- package/dist/components/badge/badge.d.ts.map +1 -0
- package/dist/components/badge/badge.js +18 -18
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/callout/callout.d.ts +24 -0
- package/dist/components/callout/callout.d.ts.map +1 -0
- package/dist/components/callout/callout.js +46 -46
- package/dist/components/callout/index.d.ts +3 -0
- package/dist/components/callout/index.d.ts.map +1 -0
- package/dist/components/card/card.d.ts +34 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/card.js +59 -59
- package/dist/components/card/index.d.ts +3 -0
- package/dist/components/card/index.d.ts.map +1 -0
- package/dist/components/code-block/base-code-block.d.ts +9 -0
- package/dist/components/code-block/base-code-block.d.ts.map +1 -0
- package/dist/components/code-block/code-block.d.ts +74 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -0
- package/dist/components/code-block/code-block.js +34 -34
- package/dist/components/code-block/code-footer.d.ts +8 -0
- package/dist/components/code-block/code-footer.d.ts.map +1 -0
- package/dist/components/code-block/code-footer.js +9 -9
- package/dist/components/code-block/code-header.d.ts +11 -0
- package/dist/components/code-block/code-header.d.ts.map +1 -0
- package/dist/components/code-block/code-header.js +20 -20
- package/dist/components/code-block/copy-button.d.ts +16 -0
- package/dist/components/code-block/copy-button.d.ts.map +1 -0
- package/dist/components/code-block/index.d.ts +5 -0
- package/dist/components/code-block/index.d.ts.map +1 -0
- package/dist/components/code-block/story-utils.d.ts +13 -0
- package/dist/components/code-block/story-utils.d.ts.map +1 -0
- package/dist/components/code-group/code-group.d.ts +23 -0
- package/dist/components/code-group/code-group.d.ts.map +1 -0
- package/dist/components/code-group/code-group.js +72 -72
- package/dist/components/code-group/code-select-dropdown.d.ts +10 -0
- package/dist/components/code-group/code-select-dropdown.d.ts.map +1 -0
- package/dist/components/code-group/code-snippet.d.ts +13 -0
- package/dist/components/code-group/code-snippet.d.ts.map +1 -0
- package/dist/components/code-group/dropdown.d.ts +34 -0
- package/dist/components/code-group/dropdown.d.ts.map +1 -0
- package/dist/components/code-group/dropdown.js +47 -47
- package/dist/components/code-group/index.d.ts +3 -0
- package/dist/components/code-group/index.d.ts.map +1 -0
- package/dist/components/code-group/language-dropdown.d.ts +10 -0
- package/dist/components/code-group/language-dropdown.d.ts.map +1 -0
- package/dist/components/code-group/language-dropdown.js +39 -39
- package/dist/components/code-group/language-icon.d.ts +7 -0
- package/dist/components/code-group/language-icon.d.ts.map +1 -0
- package/dist/components/color/color.d.ts +28 -0
- package/dist/components/color/color.d.ts.map +1 -0
- package/dist/components/color/color.js +37 -37
- package/dist/components/color/constants.d.ts +5 -0
- package/dist/components/color/constants.d.ts.map +1 -0
- package/dist/components/color/index.d.ts +4 -0
- package/dist/components/color/index.d.ts.map +1 -0
- package/dist/components/columns/columns.d.ts +11 -0
- package/dist/components/columns/columns.d.ts.map +1 -0
- package/dist/components/columns/constants.d.ts +5 -0
- package/dist/components/columns/constants.d.ts.map +1 -0
- package/dist/components/columns/index.d.ts +3 -0
- package/dist/components/columns/index.d.ts.map +1 -0
- package/dist/components/expandable/expandable.d.ts +21 -0
- package/dist/components/expandable/expandable.d.ts.map +1 -0
- package/dist/components/expandable/expandable.js +46 -46
- package/dist/components/expandable/index.d.ts +3 -0
- package/dist/components/expandable/index.d.ts.map +1 -0
- package/dist/components/frame/frame.d.ts +14 -0
- package/dist/components/frame/frame.d.ts.map +1 -0
- package/dist/components/frame/frame.js +21 -21
- package/dist/components/frame/index.d.ts +3 -0
- package/dist/components/frame/index.d.ts.map +1 -0
- package/dist/components/icon/icon.d.ts +19 -0
- package/dist/components/icon/icon.d.ts.map +1 -0
- package/dist/components/icon/icon.js +24 -24
- package/dist/components/icon/index.d.ts +3 -0
- package/dist/components/icon/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/mermaid/index.d.ts +7 -0
- package/dist/components/mermaid/index.d.ts.map +1 -0
- package/dist/components/mermaid/mermaid.d.ts +12 -0
- package/dist/components/mermaid/mermaid.d.ts.map +1 -0
- package/dist/components/mermaid/mermaid.js +38 -31
- package/dist/components/mermaid/use-pan-zoom.d.ts +13 -0
- package/dist/components/mermaid/use-pan-zoom.d.ts.map +1 -0
- package/dist/components/mermaid/zoom-controls.d.ts +13 -0
- package/dist/components/mermaid/zoom-controls.d.ts.map +1 -0
- package/dist/components/mermaid/zoom-controls.js +32 -32
- package/dist/components/panel/index.d.ts +3 -0
- package/dist/components/panel/index.d.ts.map +1 -0
- package/dist/components/panel/panel.d.ts +6 -0
- package/dist/components/panel/panel.d.ts.map +1 -0
- package/dist/components/property/index.d.ts +3 -0
- package/dist/components/property/index.d.ts.map +1 -0
- package/dist/components/property/param-head.d.ts +5 -0
- package/dist/components/property/param-head.d.ts.map +1 -0
- package/dist/components/property/param-head.js +40 -40
- package/dist/components/property/pills.d.ts +15 -0
- package/dist/components/property/pills.d.ts.map +1 -0
- package/dist/components/property/pills.js +13 -13
- package/dist/components/property/property.d.ts +24 -0
- package/dist/components/property/property.d.ts.map +1 -0
- package/dist/components/property/property.js +33 -33
- package/dist/components/steps/constants.d.ts +5 -0
- package/dist/components/steps/constants.d.ts.map +1 -0
- package/dist/components/steps/index.d.ts +5 -0
- package/dist/components/steps/index.d.ts.map +1 -0
- package/dist/components/steps/steps.d.ts +35 -0
- package/dist/components/steps/steps.d.ts.map +1 -0
- package/dist/components/steps/steps.js +157 -59
- package/dist/components/tabs/index.d.ts +3 -0
- package/dist/components/tabs/index.d.ts.map +1 -0
- package/dist/components/tabs/tabs.d.ts +36 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -0
- package/dist/components/tabs/tabs.js +84 -78
- package/dist/components/tile/index.d.ts +3 -0
- package/dist/components/tile/index.d.ts.map +1 -0
- package/dist/components/tile/tile.d.ts +11 -0
- package/dist/components/tile/tile.d.ts.map +1 -0
- package/dist/components/tile/tile.js +27 -27
- package/dist/components/tooltip/index.d.ts +3 -0
- package/dist/components/tooltip/index.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +14 -0
- package/dist/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip/tooltip.js +95 -84
- package/dist/components/tree/context.d.ts +9 -0
- package/dist/components/tree/context.d.ts.map +1 -0
- package/dist/components/tree/file.d.ts +7 -0
- package/dist/components/tree/file.d.ts.map +1 -0
- package/dist/components/tree/file.js +9 -9
- package/dist/components/tree/folder.d.ts +11 -0
- package/dist/components/tree/folder.d.ts.map +1 -0
- package/dist/components/tree/folder.js +21 -21
- package/dist/components/tree/index.d.ts +9 -0
- package/dist/components/tree/index.d.ts.map +1 -0
- package/dist/components/tree/root.d.ts +9 -0
- package/dist/components/tree/root.d.ts.map +1 -0
- package/dist/components/tree/tree-level-context.d.ts +8 -0
- package/dist/components/tree/tree-level-context.d.ts.map +1 -0
- package/dist/components/tree/use-tree-level.d.ts +3 -0
- package/dist/components/tree/use-tree-level.d.ts.map +1 -0
- package/dist/components/tree/utils.d.ts +9 -0
- package/dist/components/tree/utils.d.ts.map +1 -0
- package/dist/components/update/index.d.ts +3 -0
- package/dist/components/update/index.d.ts.map +1 -0
- package/dist/components/update/update.d.ts +22 -0
- package/dist/components/update/update.d.ts.map +1 -0
- package/dist/components/update/update.js +21 -21
- package/dist/components/view/index.d.ts +3 -0
- package/dist/components/view/index.d.ts.map +1 -0
- package/dist/components/view/view.d.ts +12 -0
- package/dist/components/view/view.d.ts.map +1 -0
- package/dist/components/view/view.js +29 -23
- package/dist/constants/brands.d.ts +3 -0
- package/dist/constants/brands.d.ts.map +1 -0
- package/dist/constants/index.d.ts +7 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/selectors.d.ts +126 -0
- package/dist/constants/selectors.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/use-expandable-memory.d.ts +8 -0
- package/dist/hooks/use-expandable-memory.d.ts.map +1 -0
- package/dist/hooks/use-expandable.d.ts +13 -0
- package/dist/hooks/use-expandable.d.ts.map +1 -0
- package/dist/hooks/use-get-shiki-highlighted-html.d.ts +4 -0
- package/dist/hooks/use-get-shiki-highlighted-html.d.ts.map +1 -0
- package/dist/hooks/use-has-hover.d.ts +3 -0
- package/dist/hooks/use-has-hover.d.ts.map +1 -0
- package/dist/hooks/use-is-dark-theme.d.ts +5 -0
- package/dist/hooks/use-is-dark-theme.d.ts.map +1 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts +4 -0
- package/dist/hooks/use-isomorphic-layout-effect.d.ts.map +1 -0
- package/dist/icons/index.d.ts +21 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/index.js +2 -2
- package/dist/index.d.ts +3 -565
- package/dist/index.d.ts.map +1 -0
- package/dist/plugins/bg-grid.d.ts +3 -0
- package/dist/plugins/bg-grid.d.ts.map +1 -0
- package/dist/plugins/scrollbar.d.ts +3 -0
- package/dist/plugins/scrollbar.d.ts.map +1 -0
- package/dist/styles.css +2 -0
- package/dist/utils/cn.d.ts +4 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/copy-to-clipboard.d.ts +5 -0
- package/dist/utils/copy-to-clipboard.d.ts.map +1 -0
- package/dist/utils/enhance-video-props.d.ts +4 -0
- package/dist/utils/enhance-video-props.d.ts.map +1 -0
- package/dist/utils/get-node-text.d.ts +3 -0
- package/dist/utils/get-node-text.d.ts.map +1 -0
- package/dist/utils/icon-utils.d.ts +19 -0
- package/dist/utils/icon-utils.d.ts.map +1 -0
- package/dist/utils/is-absolute-url.d.ts +5 -0
- package/dist/utils/is-absolute-url.d.ts.map +1 -0
- package/dist/utils/is-remote-url.d.ts +3 -0
- package/dist/utils/is-remote-url.d.ts.map +1 -0
- package/dist/utils/make-marker-ids-unique.d.ts +3 -0
- package/dist/utils/make-marker-ids-unique.d.ts.map +1 -0
- package/dist/utils/make-marker-ids-unique.js +42 -0
- package/dist/utils/render-as-child.d.ts +4 -0
- package/dist/utils/render-as-child.d.ts.map +1 -0
- package/dist/utils/shiki/code-styling.d.ts +12 -0
- package/dist/utils/shiki/code-styling.d.ts.map +1 -0
- package/dist/utils/shiki/constants.d.ts +23 -0
- package/dist/utils/shiki/constants.d.ts.map +1 -0
- package/dist/utils/shiki/get-code-styling.d.ts +10 -0
- package/dist/utils/shiki/get-code-styling.d.ts.map +1 -0
- package/dist/utils/shiki/get-shiki-background-colors.d.ts +21 -0
- package/dist/utils/shiki/get-shiki-background-colors.d.ts.map +1 -0
- package/dist/utils/shiki/index.d.ts +31 -0
- package/dist/utils/shiki/index.d.ts.map +1 -0
- package/dist/utils/shiki/lib.d.ts +6 -0
- package/dist/utils/shiki/lib.d.ts.map +1 -0
- package/dist/utils/shiki/shiki-themes.d.ts +3 -0
- package/dist/utils/shiki/shiki-themes.d.ts.map +1 -0
- package/dist/utils/shiki/snippet-presets.d.ts +28 -0
- package/dist/utils/shiki/snippet-presets.d.ts.map +1 -0
- package/dist/utils/shiki/worker-client.d.ts +10 -0
- package/dist/utils/shiki/worker-client.d.ts.map +1 -0
- package/dist/utils/slugify.d.ts +3 -0
- package/dist/utils/slugify.d.ts.map +1 -0
- package/package.json +4 -2
|
@@ -1,164 +1,170 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsxs as y, jsx as p, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as $, useId as C, useMemo as I, Children as B, isValidElement as H, useState as j, useEffect as M, useCallback as h } from "react";
|
|
3
3
|
import { CHILD_TAB_IDS_ATTRIBUTE as S, CHILD_HEADING_IDS_ATTRIBUTE as U } from "../../constants/index.js";
|
|
4
|
-
import { Classes as
|
|
5
|
-
import { cn as
|
|
4
|
+
import { Classes as v } from "../../constants/selectors.js";
|
|
5
|
+
import { cn as u } from "../../utils/cn.js";
|
|
6
6
|
import { slugify as F } from "../../utils/slugify.js";
|
|
7
7
|
import { Icon as K } from "../icon/icon.js";
|
|
8
|
-
const
|
|
9
|
-
children:
|
|
10
|
-
defaultTabIndex:
|
|
11
|
-
onTabChange:
|
|
12
|
-
className:
|
|
13
|
-
borderBottom:
|
|
14
|
-
ariaLabel:
|
|
15
|
-
panelsRef:
|
|
8
|
+
const k = "Tab Title", q = ({ children: b }) => /* @__PURE__ */ p(R, { children: b }), z = ({
|
|
9
|
+
children: b,
|
|
10
|
+
defaultTabIndex: g = 0,
|
|
11
|
+
onTabChange: m,
|
|
12
|
+
className: A,
|
|
13
|
+
borderBottom: D,
|
|
14
|
+
ariaLabel: w,
|
|
15
|
+
panelsRef: E
|
|
16
16
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
const f = $([]), T = C(), o = I(
|
|
18
|
+
() => B.toArray(b).filter(
|
|
19
|
+
(t) => H(t)
|
|
20
|
+
),
|
|
21
|
+
[b]
|
|
22
|
+
), s = I(
|
|
23
|
+
() => o.map((t, e) => {
|
|
24
|
+
if (t.props.id)
|
|
25
|
+
return t.props.id;
|
|
26
|
+
const r = t.props.title ?? k;
|
|
27
|
+
return `${T}-${F(r)}-${e}`;
|
|
28
|
+
}),
|
|
29
|
+
[o, T]
|
|
30
|
+
), L = o.length > 0 ? Math.max(0, Math.min(g, o.length - 1)) : 0, [i, x] = j(L);
|
|
31
|
+
M(() => {
|
|
32
|
+
o.length > 0 && i >= o.length && x(o.length - 1);
|
|
33
|
+
}, [o.length, i]);
|
|
34
|
+
const l = h(
|
|
29
35
|
(t) => {
|
|
30
|
-
t !== i && (
|
|
36
|
+
t !== i && (x(t), m == null || m(t));
|
|
31
37
|
},
|
|
32
|
-
[i,
|
|
33
|
-
),
|
|
34
|
-
(t,
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
38
|
+
[i, m]
|
|
39
|
+
), _ = h(
|
|
40
|
+
(t, e) => {
|
|
41
|
+
const r = o.length;
|
|
42
|
+
if (r !== 0) {
|
|
37
43
|
if (t.key === "ArrowLeft" || t.key === "ArrowRight") {
|
|
38
44
|
t.preventDefault();
|
|
39
|
-
const
|
|
40
|
-
l(
|
|
45
|
+
const a = t.key === "ArrowLeft" ? (e - 1 + r) % r : (e + 1) % r;
|
|
46
|
+
l(a), setTimeout(() => {
|
|
41
47
|
var n;
|
|
42
|
-
(n =
|
|
48
|
+
(n = f.current[a]) == null || n.focus();
|
|
43
49
|
}, 0);
|
|
44
50
|
} else if (t.key === "Enter" || t.key === " ")
|
|
45
|
-
t.preventDefault(), l(
|
|
51
|
+
t.preventDefault(), l(e);
|
|
46
52
|
else if (t.key === "Home")
|
|
47
53
|
t.preventDefault(), l(0), setTimeout(() => {
|
|
48
|
-
var
|
|
49
|
-
(
|
|
54
|
+
var a;
|
|
55
|
+
(a = f.current[0]) == null || a.focus();
|
|
50
56
|
}, 0);
|
|
51
57
|
else if (t.key === "End") {
|
|
52
58
|
t.preventDefault();
|
|
53
|
-
const
|
|
54
|
-
l(
|
|
59
|
+
const a = r - 1;
|
|
60
|
+
l(a), setTimeout(() => {
|
|
55
61
|
var n;
|
|
56
|
-
(n =
|
|
62
|
+
(n = f.current[a]) == null || n.focus();
|
|
57
63
|
}, 0);
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
66
|
},
|
|
61
|
-
[
|
|
67
|
+
[o.length, l]
|
|
62
68
|
);
|
|
63
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ y(
|
|
64
70
|
"div",
|
|
65
71
|
{
|
|
66
|
-
className:
|
|
67
|
-
|
|
72
|
+
className: u(
|
|
73
|
+
v.Tabs,
|
|
68
74
|
"tabs tab-container",
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
D && "border-stone-200 border-b pb-6 dark:border-stone-700",
|
|
76
|
+
A
|
|
71
77
|
),
|
|
72
78
|
children: [
|
|
73
79
|
/* @__PURE__ */ p(
|
|
74
80
|
"ul",
|
|
75
81
|
{
|
|
76
|
-
"aria-label":
|
|
77
|
-
className: "not-prose mb-6 flex min-w-full flex-none gap-x-6 overflow-auto border-
|
|
82
|
+
"aria-label": w ?? "Tabs",
|
|
83
|
+
className: "not-prose mb-6 flex min-w-full flex-none gap-x-6 overflow-auto border-stone-200 border-b pb-px dark:border-stone-700",
|
|
78
84
|
"data-component-part": "tabs-list",
|
|
79
85
|
role: "tablist",
|
|
80
|
-
children:
|
|
81
|
-
const
|
|
86
|
+
children: o.map((t, e) => {
|
|
87
|
+
const r = t.props.title ?? k, a = t.props.icon, n = t.props.iconType, N = t.props.iconLibrary, c = e === i;
|
|
82
88
|
return /* @__PURE__ */ p(
|
|
83
89
|
"li",
|
|
84
90
|
{
|
|
85
|
-
"aria-controls": `panel-${s[
|
|
91
|
+
"aria-controls": `panel-${s[e]}`,
|
|
86
92
|
"aria-selected": c,
|
|
87
93
|
className: "cursor-pointer",
|
|
88
94
|
"data-child-heading-ids": t.props[U],
|
|
89
95
|
"data-child-tab-ids": t.props[S],
|
|
90
96
|
"data-component-part": "tab",
|
|
91
|
-
id: s[
|
|
97
|
+
id: s[e],
|
|
92
98
|
onClick: (d) => {
|
|
93
|
-
d.stopPropagation(), l(
|
|
99
|
+
d.stopPropagation(), l(e);
|
|
94
100
|
},
|
|
95
|
-
onKeyDown: (d) =>
|
|
101
|
+
onKeyDown: (d) => _(d, e),
|
|
96
102
|
ref: (d) => {
|
|
97
|
-
|
|
103
|
+
f.current[e] = d;
|
|
98
104
|
},
|
|
99
105
|
role: "tab",
|
|
100
106
|
tabIndex: c ? 0 : -1,
|
|
101
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ y(
|
|
102
108
|
"div",
|
|
103
109
|
{
|
|
104
|
-
className:
|
|
110
|
+
className: u(
|
|
105
111
|
"-mb-px flex max-w-max items-center gap-1.5 whitespace-nowrap border-b pt-3 pb-2.5 font-semibold text-sm leading-6",
|
|
106
|
-
c ? "border-current text-primary dark:text-primary-light" : "border-transparent text-
|
|
112
|
+
c ? "border-current text-primary dark:text-primary-light" : "border-transparent text-stone-900 hover:border-stone-300 dark:text-stone-200 dark:hover:border-stone-700"
|
|
107
113
|
),
|
|
108
114
|
"data-active": c,
|
|
109
115
|
"data-component-part": "tab-button",
|
|
110
|
-
"data-testid": `tab-${
|
|
116
|
+
"data-testid": `tab-${r}`,
|
|
111
117
|
children: [
|
|
112
|
-
|
|
118
|
+
a && /* @__PURE__ */ p(
|
|
113
119
|
K,
|
|
114
120
|
{
|
|
115
|
-
className:
|
|
121
|
+
className: u(
|
|
116
122
|
"size-4 shrink-0",
|
|
117
|
-
c ? "bg-primary dark:bg-primary-light" : "bg-
|
|
118
|
-
|
|
123
|
+
c ? "bg-primary dark:bg-primary-light" : "bg-stone-900 dark:bg-stone-200",
|
|
124
|
+
v.TabIcon
|
|
119
125
|
),
|
|
120
|
-
icon:
|
|
121
|
-
iconLibrary:
|
|
126
|
+
icon: a,
|
|
127
|
+
iconLibrary: N,
|
|
122
128
|
iconType: n,
|
|
123
129
|
overrideColor: !0
|
|
124
130
|
}
|
|
125
131
|
),
|
|
126
|
-
|
|
132
|
+
r
|
|
127
133
|
]
|
|
128
134
|
}
|
|
129
135
|
)
|
|
130
136
|
},
|
|
131
|
-
s[
|
|
137
|
+
s[e]
|
|
132
138
|
);
|
|
133
139
|
})
|
|
134
140
|
}
|
|
135
141
|
),
|
|
136
|
-
/* @__PURE__ */ p("div", { "data-component-part": "tabs-panels", ref:
|
|
137
|
-
const
|
|
142
|
+
/* @__PURE__ */ p("div", { "data-component-part": "tabs-panels", ref: E, children: o.map((t, e) => {
|
|
143
|
+
const r = e === i;
|
|
138
144
|
return /* @__PURE__ */ p(
|
|
139
145
|
"div",
|
|
140
146
|
{
|
|
141
|
-
"aria-hidden": !
|
|
142
|
-
"aria-labelledby": s[
|
|
143
|
-
className:
|
|
147
|
+
"aria-hidden": !r,
|
|
148
|
+
"aria-labelledby": s[e],
|
|
149
|
+
className: u(
|
|
144
150
|
"prose dark:prose-invert overflow-x-auto",
|
|
145
|
-
!
|
|
151
|
+
!r && "hidden"
|
|
146
152
|
),
|
|
147
153
|
"data-component-part": "tab-content",
|
|
148
|
-
id: `panel-${s[
|
|
154
|
+
id: `panel-${s[e]}`,
|
|
149
155
|
role: "tabpanel",
|
|
150
|
-
tabIndex:
|
|
156
|
+
tabIndex: r ? 0 : -1,
|
|
151
157
|
children: t.props.children
|
|
152
158
|
},
|
|
153
|
-
s[
|
|
159
|
+
s[e]
|
|
154
160
|
);
|
|
155
161
|
}) })
|
|
156
162
|
]
|
|
157
163
|
}
|
|
158
164
|
);
|
|
159
|
-
},
|
|
160
|
-
Item:
|
|
165
|
+
}, X = Object.assign(z, {
|
|
166
|
+
Item: q
|
|
161
167
|
});
|
|
162
168
|
export {
|
|
163
|
-
|
|
169
|
+
X as Tabs
|
|
164
170
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tile/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type TileProps = {
|
|
2
|
+
href: string;
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const Tile: ({ href, children, title, description, className }: TileProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Tile };
|
|
10
|
+
export type { TileProps };
|
|
11
|
+
//# sourceMappingURL=tile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../../../src/components/tile/tile.tsx"],"names":[],"mappings":"AAgCA,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,IAAI,GAAI,mDAAmD,SAAS,4CAyEzE,CAAC;AAEF,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { Classes as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { isRemoteUrl as
|
|
5
|
-
const
|
|
2
|
+
import { Classes as g } from "../../constants/selectors.js";
|
|
3
|
+
import { cn as l } from "../../utils/cn.js";
|
|
4
|
+
import { isRemoteUrl as u } from "../../utils/is-remote-url.js";
|
|
5
|
+
const n = 24, s = 10, e = n / 2, p = (t) => {
|
|
6
6
|
const i = `
|
|
7
|
-
<svg width="${
|
|
7
|
+
<svg width="${n}" height="${n}" xmlns="http://www.w3.org/2000/svg">
|
|
8
8
|
<g opacity="0.5">
|
|
9
9
|
<line x1="${e}" y1="${e - s / 2}" x2="${e}" y2="${e + s / 2}"
|
|
10
10
|
stroke="${t}" stroke-width="1" stroke-linecap="round"/>
|
|
@@ -14,38 +14,38 @@ const a = 24, s = 10, e = a / 2, m = (t) => {
|
|
|
14
14
|
</svg>
|
|
15
15
|
`;
|
|
16
16
|
return `data:image/svg+xml,${encodeURIComponent(i)}`;
|
|
17
|
-
}, x =
|
|
18
|
-
const d =
|
|
17
|
+
}, x = p("#F0F0F0"), b = p("#232323"), m = `${n}px ${n}px`, $ = ({ href: t, children: i, title: a, description: o, className: f }) => {
|
|
18
|
+
const d = l(
|
|
19
19
|
"pointer-events-none size-full select-none bg-center bg-repeat-round [grid-area:1/1]",
|
|
20
|
-
"after:absolute after:left-0 after:h-full after:w-[7px] after:bg-
|
|
21
|
-
"before:absolute before:right-0 before:h-full before:w-[7px] before:bg-
|
|
20
|
+
"after:absolute after:left-0 after:h-full after:w-[7px] after:bg-stone-50 after:content-[''] dark:after:bg-stone-900",
|
|
21
|
+
"before:absolute before:right-0 before:h-full before:w-[7px] before:bg-stone-50 before:content-[''] dark:before:bg-stone-900"
|
|
22
22
|
);
|
|
23
23
|
return /* @__PURE__ */ c(
|
|
24
24
|
"a",
|
|
25
25
|
{
|
|
26
26
|
href: t,
|
|
27
|
-
...
|
|
28
|
-
className:
|
|
29
|
-
|
|
27
|
+
...u(t) ? { target: "_blank", rel: "noreferrer" } : {},
|
|
28
|
+
className: l(
|
|
29
|
+
g.Tile,
|
|
30
30
|
"group not-prose flex w-full min-w-0 cursor-pointer flex-col items-center justify-center gap-1",
|
|
31
|
-
|
|
31
|
+
f
|
|
32
32
|
),
|
|
33
33
|
children: [
|
|
34
34
|
/* @__PURE__ */ c(
|
|
35
35
|
"div",
|
|
36
36
|
{
|
|
37
|
-
className: "relative grid h-[170px] w-full place-items-center overflow-hidden rounded-2xl bg-
|
|
37
|
+
className: "relative grid h-[170px] w-full place-items-center overflow-hidden rounded-2xl bg-stone-50 py-1 dark:bg-stone-900",
|
|
38
38
|
"data-component-part": "tile-children-container",
|
|
39
39
|
children: [
|
|
40
40
|
/* @__PURE__ */ r(
|
|
41
41
|
"div",
|
|
42
42
|
{
|
|
43
43
|
"aria-hidden": "true",
|
|
44
|
-
className:
|
|
44
|
+
className: l(d, "block dark:hidden"),
|
|
45
45
|
"data-component-part": "tile-background-light",
|
|
46
46
|
style: {
|
|
47
47
|
backgroundImage: `url("${x}")`,
|
|
48
|
-
backgroundSize:
|
|
48
|
+
backgroundSize: m
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
),
|
|
@@ -53,11 +53,11 @@ const a = 24, s = 10, e = a / 2, m = (t) => {
|
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
55
|
"aria-hidden": "true",
|
|
56
|
-
className:
|
|
56
|
+
className: l(d, "hidden dark:block"),
|
|
57
57
|
"data-component-part": "tile-background-dark",
|
|
58
58
|
style: {
|
|
59
59
|
backgroundImage: `url("${b}")`,
|
|
60
|
-
backgroundSize:
|
|
60
|
+
backgroundSize: m
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
),
|
|
@@ -72,28 +72,28 @@ const a = 24, s = 10, e = a / 2, m = (t) => {
|
|
|
72
72
|
]
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
|
-
(!!
|
|
75
|
+
(!!a || !!o) && /* @__PURE__ */ c(
|
|
76
76
|
"div",
|
|
77
77
|
{
|
|
78
78
|
className: "flex w-full min-w-0 flex-col items-center justify-center gap-1 p-2",
|
|
79
79
|
"data-component-part": "tile-text-container",
|
|
80
80
|
children: [
|
|
81
|
-
!!
|
|
81
|
+
!!a && /* @__PURE__ */ r(
|
|
82
82
|
"p",
|
|
83
83
|
{
|
|
84
|
-
className: "m-0 max-w-full truncate font-medium text-base text-
|
|
84
|
+
className: "m-0 max-w-full truncate font-medium text-base text-stone-900 tracking-[-0.2px] dark:text-stone-200",
|
|
85
85
|
"data-component-part": "tile-title",
|
|
86
|
-
title:
|
|
87
|
-
children:
|
|
86
|
+
title: a,
|
|
87
|
+
children: a
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
|
-
!!
|
|
90
|
+
!!o && /* @__PURE__ */ r(
|
|
91
91
|
"p",
|
|
92
92
|
{
|
|
93
|
-
className: "m-0 max-w-full truncate font-normal text-
|
|
93
|
+
className: "m-0 max-w-full truncate font-normal text-sm text-stone-600 tracking-[-0.1px] dark:text-stone-400",
|
|
94
94
|
"data-component-part": "tile-description",
|
|
95
|
-
title:
|
|
96
|
-
children:
|
|
95
|
+
title: o,
|
|
96
|
+
children: o
|
|
97
97
|
}
|
|
98
98
|
)
|
|
99
99
|
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TooltipPositionerProps } from '@base-ui/react/tooltip';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
type TooltipProps = {
|
|
4
|
+
description?: string;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
title?: string;
|
|
7
|
+
cta?: string;
|
|
8
|
+
href?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
} & Pick<TooltipPositionerProps, "side" | "align">;
|
|
11
|
+
declare const Tooltip: ({ description, children, title, cta, href, className, side, align, }: TooltipProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export { Tooltip };
|
|
13
|
+
export type { TooltipProps };
|
|
14
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGrE,OAAO,EAAkB,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAO1E,KAAK,YAAY,GAAG;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;AAEnD,QAAA,MAAM,OAAO,GAAI,sEASd,YAAY,mDA+Gd,CAAC;AAyCF,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,110 +1,121 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Classes as
|
|
4
|
-
import { useHasHover as
|
|
1
|
+
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as k, useMemo as T, isValidElement as d } from "react";
|
|
3
|
+
import { Classes as C } from "../../constants/selectors.js";
|
|
4
|
+
import { useHasHover as N } from "../../hooks/use-has-hover.js";
|
|
5
5
|
import { cn as u } from "../../utils/cn.js";
|
|
6
|
-
import { isRemoteUrl as
|
|
7
|
-
import { renderAsChild as
|
|
8
|
-
import
|
|
9
|
-
import { TooltipProvider as
|
|
10
|
-
import { TooltipRoot as
|
|
11
|
-
import { TooltipTrigger as
|
|
12
|
-
import { TooltipPortal as
|
|
13
|
-
import { TooltipPositioner as
|
|
14
|
-
import { TooltipPopup as
|
|
15
|
-
const
|
|
6
|
+
import { isRemoteUrl as P } from "../../utils/is-remote-url.js";
|
|
7
|
+
import { renderAsChild as w } from "../../utils/render-as-child.js";
|
|
8
|
+
import O from "../../node_modules/.pnpm/lucide-react@0.453.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-right.js";
|
|
9
|
+
import { TooltipProvider as j } from "../../node_modules/.pnpm/@base-ui_react@1.1.0_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tooltip/provider/TooltipProvider.js";
|
|
10
|
+
import { TooltipRoot as H } from "../../node_modules/.pnpm/@base-ui_react@1.1.0_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tooltip/root/TooltipRoot.js";
|
|
11
|
+
import { TooltipTrigger as R } from "../../node_modules/.pnpm/@base-ui_react@1.1.0_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tooltip/trigger/TooltipTrigger.js";
|
|
12
|
+
import { TooltipPortal as z } from "../../node_modules/.pnpm/@base-ui_react@1.1.0_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tooltip/portal/TooltipPortal.js";
|
|
13
|
+
import { TooltipPositioner as E } from "../../node_modules/.pnpm/@base-ui_react@1.1.0_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tooltip/positioner/TooltipPositioner.js";
|
|
14
|
+
import { TooltipPopup as I } from "../../node_modules/.pnpm/@base-ui_react@1.1.0_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tooltip/popup/TooltipPopup.js";
|
|
15
|
+
const X = ({
|
|
16
16
|
description: e,
|
|
17
|
-
children:
|
|
18
|
-
title:
|
|
17
|
+
children: n,
|
|
18
|
+
title: o,
|
|
19
19
|
cta: p,
|
|
20
|
-
href:
|
|
21
|
-
className: c
|
|
20
|
+
href: a,
|
|
21
|
+
className: c,
|
|
22
|
+
side: x = "top",
|
|
23
|
+
align: g = "center"
|
|
22
24
|
}) => {
|
|
23
|
-
const [
|
|
24
|
-
|
|
25
|
-
}, y = (
|
|
26
|
-
const { reason: f } =
|
|
25
|
+
const [b, i] = k(!1), m = N(), r = L(n), v = m ? void 0 : () => {
|
|
26
|
+
i((s) => !s);
|
|
27
|
+
}, y = (s, _) => {
|
|
28
|
+
const { reason: f } = _;
|
|
27
29
|
if (m) {
|
|
28
|
-
|
|
30
|
+
i(s);
|
|
29
31
|
return;
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
if (!
|
|
34
|
-
return
|
|
35
|
-
}, [
|
|
36
|
-
return
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
33
|
+
s ? i(!0) : (f === "escape-key" || f === "outside-press") && i(!1);
|
|
34
|
+
}, h = T(() => {
|
|
35
|
+
if (!r)
|
|
36
|
+
return o && e ? `${o}: ${e}` : o || e;
|
|
37
|
+
}, [o, e, r]);
|
|
38
|
+
return n == null ? null : /* @__PURE__ */ t(j, { delay: 0, children: /* @__PURE__ */ l(H, { onOpenChange: y, open: b, children: [
|
|
39
|
+
/* @__PURE__ */ t(
|
|
40
|
+
R,
|
|
39
41
|
{
|
|
40
|
-
"aria-label":
|
|
42
|
+
"aria-label": h,
|
|
41
43
|
className: u(
|
|
42
44
|
c,
|
|
43
|
-
!
|
|
45
|
+
!r && "rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2"
|
|
44
46
|
),
|
|
45
|
-
onClick:
|
|
46
|
-
render:
|
|
47
|
-
children:
|
|
47
|
+
onClick: v,
|
|
48
|
+
render: r ? w(n) : void 0,
|
|
49
|
+
children: r ? null : W(n)
|
|
48
50
|
}
|
|
49
51
|
),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
52
|
+
/* @__PURE__ */ t(z, { children: /* @__PURE__ */ t(
|
|
53
|
+
E,
|
|
52
54
|
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
55
|
+
align: g,
|
|
56
|
+
collisionPadding: 8,
|
|
57
|
+
side: x,
|
|
58
|
+
sideOffset: 4,
|
|
59
|
+
children: /* @__PURE__ */ l(
|
|
60
|
+
I,
|
|
61
|
+
{
|
|
62
|
+
className: "z-50 flex max-w-[16rem] flex-col gap-1 rounded-xl border border-stone-200 bg-white px-4 py-3 shadow-[0_10px_16px_-3px_rgb(10_10_10/0.05),0_3px_10px_-2px_rgb(10_10_10/0.02)] dark:border-stone-900 dark:bg-stone-950",
|
|
63
|
+
"data-component-part": "tooltip-content",
|
|
64
|
+
children: [
|
|
65
|
+
!!o && /* @__PURE__ */ t(
|
|
66
|
+
"p",
|
|
67
|
+
{
|
|
68
|
+
className: "font-medium text-stone-900 text-xs leading-4 dark:text-stone-200",
|
|
69
|
+
"data-component-part": "tooltip-title",
|
|
70
|
+
children: o
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
!!e && /* @__PURE__ */ t(
|
|
74
|
+
"p",
|
|
75
|
+
{
|
|
76
|
+
className: "text-stone-600 text-xs leading-4 dark:text-stone-400",
|
|
77
|
+
"data-component-part": "tooltip-description",
|
|
78
|
+
children: e
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
p && a && /* @__PURE__ */ l(
|
|
82
|
+
"a",
|
|
83
|
+
{
|
|
84
|
+
href: a,
|
|
85
|
+
...P(a) ? { target: "_blank", rel: "noreferrer" } : {},
|
|
86
|
+
className: "mt-2! flex items-center gap-0.5 rounded-sm font-medium text-stone-600 text-xs leading-4 hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 dark:text-stone-400 dark:hover:text-primary-light",
|
|
87
|
+
"data-component-part": "tooltip-cta",
|
|
88
|
+
children: [
|
|
89
|
+
p,
|
|
90
|
+
/* @__PURE__ */ t(
|
|
91
|
+
O,
|
|
92
|
+
{
|
|
93
|
+
"aria-hidden": "true",
|
|
94
|
+
className: "size-3",
|
|
95
|
+
strokeWidth: 2.5
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
)
|
|
93
104
|
}
|
|
94
|
-
) })
|
|
105
|
+
) })
|
|
95
106
|
] }) });
|
|
96
|
-
},
|
|
107
|
+
}, L = (e) => d(e) ? typeof e.type == "function" || typeof e.type == "object" ? !0 : typeof e.type == "string" ? ["button", "a", "input", "select", "textarea"].includes(
|
|
97
108
|
e.type.toLowerCase()
|
|
98
|
-
) : !1 : !1,
|
|
109
|
+
) : !1 : !1, W = (e) => d(e) ? e : /* @__PURE__ */ t(
|
|
99
110
|
"span",
|
|
100
111
|
{
|
|
101
112
|
className: u(
|
|
102
|
-
|
|
103
|
-
"underline decoration-2 decoration-
|
|
113
|
+
C.Tooltip,
|
|
114
|
+
"underline decoration-2 decoration-stone-400 decoration-dotted underline-offset-4 dark:decoration-stone-500"
|
|
104
115
|
),
|
|
105
116
|
children: e
|
|
106
117
|
}
|
|
107
118
|
);
|
|
108
119
|
export {
|
|
109
|
-
|
|
120
|
+
X as Tooltip
|
|
110
121
|
};
|