@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,76 +1,76 @@
|
|
|
1
1
|
import { jsxs as T, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { MAX_DEFAULT_VALUE_LENGTH as
|
|
4
|
-
import { Classes as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { ParamHead as
|
|
7
|
-
const
|
|
2
|
+
import { useMemo as N } from "react";
|
|
3
|
+
import { MAX_DEFAULT_VALUE_LENGTH as U } from "../../constants/index.js";
|
|
4
|
+
import { Classes as j } from "../../constants/selectors.js";
|
|
5
|
+
import { cn as F } from "../../utils/cn.js";
|
|
6
|
+
import { ParamHead as g } from "./param-head.js";
|
|
7
|
+
const h = "Navigate to header", y = "default", O = "required", R = "deprecated", k = ({
|
|
8
8
|
name: n,
|
|
9
9
|
type: i,
|
|
10
10
|
location: c,
|
|
11
11
|
hidden: m,
|
|
12
|
-
default:
|
|
13
|
-
required:
|
|
14
|
-
deprecated:
|
|
15
|
-
children:
|
|
16
|
-
id:
|
|
17
|
-
pre:
|
|
18
|
-
post:
|
|
12
|
+
default: t,
|
|
13
|
+
required: p,
|
|
14
|
+
deprecated: d,
|
|
15
|
+
children: r,
|
|
16
|
+
id: l,
|
|
17
|
+
pre: E,
|
|
18
|
+
post: a,
|
|
19
19
|
className: A,
|
|
20
20
|
onMount: f,
|
|
21
|
-
navigateToHeaderAriaLabel: L =
|
|
22
|
-
defaultLabel: _ =
|
|
21
|
+
navigateToHeaderAriaLabel: L = h,
|
|
22
|
+
defaultLabel: _ = y,
|
|
23
23
|
requiredLabel: u = O,
|
|
24
24
|
deprecatedLabel: b = R
|
|
25
25
|
}) => {
|
|
26
|
-
const D =
|
|
27
|
-
if (
|
|
26
|
+
const D = N(() => {
|
|
27
|
+
if (t !== null && typeof t == "object" && Object.values(t).some(
|
|
28
28
|
(o) => o !== null && typeof o == "object"
|
|
29
29
|
))
|
|
30
30
|
return null;
|
|
31
31
|
try {
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
return
|
|
32
|
+
const e = JSON.stringify(t);
|
|
33
|
+
if (e && e.length > 0 && e.length < U)
|
|
34
|
+
return e;
|
|
35
35
|
} catch {
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
38
|
return null;
|
|
39
|
-
}, [
|
|
39
|
+
}, [t]);
|
|
40
40
|
return m ? null : /* @__PURE__ */ T(
|
|
41
41
|
"div",
|
|
42
42
|
{
|
|
43
|
-
className:
|
|
44
|
-
|
|
45
|
-
"my-2.5 border-
|
|
43
|
+
className: F(
|
|
44
|
+
j.Field,
|
|
45
|
+
"my-2.5 border-stone-50 border-b pt-2.5 pb-5 dark:border-stone-800/50",
|
|
46
46
|
A
|
|
47
47
|
),
|
|
48
48
|
children: [
|
|
49
49
|
/* @__PURE__ */ s(
|
|
50
|
-
|
|
50
|
+
g,
|
|
51
51
|
{
|
|
52
52
|
default: D,
|
|
53
53
|
defaultLabel: _,
|
|
54
|
-
deprecated:
|
|
54
|
+
deprecated: d,
|
|
55
55
|
deprecatedLabel: b,
|
|
56
|
-
id:
|
|
56
|
+
id: l,
|
|
57
57
|
location: c,
|
|
58
58
|
name: n,
|
|
59
59
|
navigateToHeaderAriaLabel: L,
|
|
60
60
|
onMount: f,
|
|
61
|
-
post:
|
|
62
|
-
pre:
|
|
63
|
-
required:
|
|
61
|
+
post: a,
|
|
62
|
+
pre: E,
|
|
63
|
+
required: p,
|
|
64
64
|
requiredLabel: u,
|
|
65
65
|
type: i
|
|
66
66
|
}
|
|
67
67
|
),
|
|
68
|
-
|
|
68
|
+
r && /* @__PURE__ */ s(
|
|
69
69
|
"div",
|
|
70
70
|
{
|
|
71
|
-
className: "prose-sm prose-
|
|
71
|
+
className: "prose-sm prose-stone dark:prose-invert mt-4 [&_.prose>p:first-child]:mt-0 [&_.prose>p:last-child]:mb-0",
|
|
72
72
|
"data-component-part": "field-content",
|
|
73
|
-
children:
|
|
73
|
+
children: r
|
|
74
74
|
}
|
|
75
75
|
)
|
|
76
76
|
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/steps/constants.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,gBAAgB,kCAAmC,CAAC;AAC1D,KAAK,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/steps/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { Rect } from 'react-use-rect';
|
|
3
|
+
import { IconLibrary, IconType } from '../../utils/icon-utils';
|
|
4
|
+
import { StepTitleSize } from './constants';
|
|
5
|
+
type Numberish = number | `${number}`;
|
|
6
|
+
type StepsItemProps = {
|
|
7
|
+
icon?: ReactNode | string;
|
|
8
|
+
stepNumber?: Numberish;
|
|
9
|
+
iconType?: IconType;
|
|
10
|
+
iconLibrary?: IconLibrary;
|
|
11
|
+
title: string | ReactNode;
|
|
12
|
+
children?: string | ReactNode;
|
|
13
|
+
titleSize?: StepTitleSize;
|
|
14
|
+
className?: string;
|
|
15
|
+
isLast?: boolean;
|
|
16
|
+
id?: string;
|
|
17
|
+
noAnchor?: boolean;
|
|
18
|
+
scrollElementIntoView?: (id: string) => void;
|
|
19
|
+
onCopyAnchorLink?: (id: string | undefined) => void;
|
|
20
|
+
onRegisterHeading?: (id: string, rect: Rect) => void;
|
|
21
|
+
onUnregisterHeading?: (id: string) => void;
|
|
22
|
+
_hasContext?: boolean;
|
|
23
|
+
};
|
|
24
|
+
type StepsProps = {
|
|
25
|
+
children: React.ReactElement<StepsItemProps> | React.ReactElement<StepsItemProps>[];
|
|
26
|
+
titleSize?: StepTitleSize;
|
|
27
|
+
className?: string;
|
|
28
|
+
};
|
|
29
|
+
declare const Steps: {
|
|
30
|
+
({ children, titleSize, className }: StepsProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
Item: ({ stepNumber, icon, iconType, iconLibrary, title, children, titleSize, className, isLast, id, noAnchor, scrollElementIntoView, onRegisterHeading, onUnregisterHeading, _hasContext, onCopyAnchorLink, }: StepsItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
};
|
|
33
|
+
export { Steps };
|
|
34
|
+
export type { StepsItemProps, StepsProps };
|
|
35
|
+
//# sourceMappingURL=steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"steps.d.ts","sourceRoot":"","sources":["../../../src/components/steps/steps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,SAAS,EAAoC,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,KAAK,IAAI,EAAW,MAAM,gBAAgB,CAAC;AAMpD,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEnE,KAAK,SAAS,GAAG,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;AAEtC,KAAK,cAAc,GAAG;IACpB,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,gBAAgB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IACpD,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACrD,mBAAmB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAqOF,KAAK,UAAU,GAAG;IAChB,QAAQ,EACJ,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,GAClC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC;IACzC,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,KAAK;yCAAwC,UAAU;oNA1N1D,cAAc;CAkPhB,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,92 +1,190 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as t, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { useState as E, useCallback as z, useEffect as C } from "react";
|
|
3
|
+
import { useRect as O } from "../../node_modules/.pnpm/react-use-rect@2.0.6_react@18.3.1/node_modules/react-use-rect/dist/index.esm.js";
|
|
4
|
+
import { Classes as j } from "../../constants/selectors.js";
|
|
5
|
+
import { LinkIcon as Z } from "../../icons/index.js";
|
|
6
|
+
import { cn as r } from "../../utils/cn.js";
|
|
7
|
+
import { copyToClipboard as _ } from "../../utils/copy-to-clipboard.js";
|
|
8
|
+
import { STEP_TITLE_SIZES as q } from "./constants.js";
|
|
9
|
+
import { Icon as F } from "../icon/icon.js";
|
|
10
|
+
const M = ({
|
|
11
|
+
stepNumber: c = 1,
|
|
12
|
+
icon: o,
|
|
13
|
+
iconType: v,
|
|
14
|
+
iconLibrary: m,
|
|
15
|
+
title: s,
|
|
16
|
+
children: n,
|
|
17
|
+
titleSize: k = "p",
|
|
18
|
+
className: $,
|
|
19
|
+
isLast: P = !1,
|
|
20
|
+
id: e,
|
|
21
|
+
noAnchor: l = !1,
|
|
22
|
+
scrollElementIntoView: N,
|
|
23
|
+
onRegisterHeading: i,
|
|
24
|
+
onUnregisterHeading: f,
|
|
25
|
+
_hasContext: y,
|
|
26
|
+
onCopyAnchorLink: u
|
|
16
27
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
|
|
28
|
+
const [x, R] = E(null), [S, B] = E(!1), [D] = O(R), I = q.includes(k) ? k : "p", p = ["h2", "h3"].includes(I), T = z(async () => {
|
|
29
|
+
if (!p || l || !e || typeof window > "u")
|
|
30
|
+
return;
|
|
31
|
+
await _(
|
|
32
|
+
`${window.location.href.split("#")[0]}#${encodeURIComponent(e)}`
|
|
33
|
+
) === "success" && (window.location.hash = encodeURIComponent(e), u == null || u(e));
|
|
34
|
+
}, [p, e, l, u]);
|
|
35
|
+
C(() => {
|
|
36
|
+
if (y && e && x)
|
|
37
|
+
return i == null || i(e, x), () => {
|
|
38
|
+
f == null || f(e);
|
|
39
|
+
};
|
|
40
|
+
}, [x, e, y, i, f]), C(() => {
|
|
41
|
+
if (!(!e || l))
|
|
42
|
+
try {
|
|
43
|
+
decodeURIComponent(window.location.hash.substring(1)) === e && (N == null || N(e));
|
|
44
|
+
} catch {
|
|
45
|
+
}
|
|
46
|
+
}, []);
|
|
47
|
+
const d = z(
|
|
48
|
+
(a) => {
|
|
49
|
+
!p || l || !e || B(a);
|
|
50
|
+
},
|
|
51
|
+
[p, l, e]
|
|
52
|
+
), h = {
|
|
53
|
+
onMouseEnter: () => d(!0),
|
|
54
|
+
onMouseLeave: () => d(!1),
|
|
55
|
+
onClick: T
|
|
56
|
+
}, L = typeof o == "string" ? /* @__PURE__ */ t(
|
|
57
|
+
F,
|
|
19
58
|
{
|
|
20
|
-
className: "size-3 bg-
|
|
21
|
-
icon:
|
|
22
|
-
iconLibrary:
|
|
23
|
-
iconType:
|
|
59
|
+
className: "size-3 bg-stone-900 dark:bg-stone-50",
|
|
60
|
+
icon: o,
|
|
61
|
+
iconLibrary: m,
|
|
62
|
+
iconType: v,
|
|
24
63
|
overrideColor: !0,
|
|
25
64
|
overrideSize: !0
|
|
26
65
|
}
|
|
27
|
-
) :
|
|
66
|
+
) : o ?? Number(c);
|
|
28
67
|
return (
|
|
29
68
|
// biome-ignore lint/a11y/useSemanticElements: TODO
|
|
30
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ w(
|
|
31
70
|
"div",
|
|
32
71
|
{
|
|
33
|
-
className:
|
|
34
|
-
|
|
72
|
+
className: r(
|
|
73
|
+
j.Step,
|
|
35
74
|
"group/step relative flex items-start pb-5",
|
|
36
|
-
|
|
75
|
+
$
|
|
37
76
|
),
|
|
38
77
|
"data-component-part": "step-item",
|
|
78
|
+
id: e,
|
|
79
|
+
ref: D,
|
|
39
80
|
role: "listitem",
|
|
40
81
|
children: [
|
|
41
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ t(
|
|
42
83
|
"div",
|
|
43
84
|
{
|
|
44
|
-
className:
|
|
85
|
+
className: r(
|
|
45
86
|
"absolute top-11 h-[calc(100%-2.75rem)] w-px",
|
|
46
|
-
|
|
87
|
+
P ? 'bg-linear-to-b from-stone-200 via-80% via-stone-200 to-transparent group-has-[[data-component-part="step-content"]:empty]/step:hidden dark:from-white/10 dark:via-white/10' : "bg-stone-200/70 dark:bg-white/10"
|
|
47
88
|
),
|
|
48
89
|
contentEditable: !1,
|
|
49
90
|
"data-component-part": "step-line"
|
|
50
91
|
}
|
|
51
92
|
),
|
|
52
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ t(
|
|
53
94
|
"div",
|
|
54
95
|
{
|
|
55
96
|
className: "absolute ml-[-13px] py-2",
|
|
56
97
|
contentEditable: !1,
|
|
57
98
|
"data-component-part": "step-number",
|
|
58
|
-
children: /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ w(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
className: "relative flex size-7 shrink-0 items-center justify-center rounded-full bg-stone-50 font-semibold text-stone-900 text-xs dark:bg-white/10 dark:text-stone-50",
|
|
103
|
+
onMouseEnter: () => d(!0),
|
|
104
|
+
onMouseLeave: () => d(!1),
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ t("div", { className: r(S && "opacity-0"), children: L }),
|
|
107
|
+
p && !l && e && /* @__PURE__ */ t(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
className: "absolute",
|
|
111
|
+
"data-component-part": "step-number-anchor-link",
|
|
112
|
+
children: /* @__PURE__ */ t(
|
|
113
|
+
"a",
|
|
114
|
+
{
|
|
115
|
+
"aria-label": "Navigate to header",
|
|
116
|
+
className: r(
|
|
117
|
+
"flex items-center border-0 opacity-0",
|
|
118
|
+
S && "opacity-100"
|
|
119
|
+
),
|
|
120
|
+
href: `#${encodeURIComponent(e)}`,
|
|
121
|
+
onClick: (a) => {
|
|
122
|
+
a.preventDefault(), T();
|
|
123
|
+
},
|
|
124
|
+
children: /* @__PURE__ */ t("div", { className: "flex size-6 items-center justify-center", children: /* @__PURE__ */ t(Z, {}) })
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
)
|
|
59
132
|
}
|
|
60
133
|
),
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
!!
|
|
63
|
-
const
|
|
134
|
+
/* @__PURE__ */ w("div", { className: "w-full overflow-hidden pr-px pl-8", children: [
|
|
135
|
+
!!s && (() => {
|
|
136
|
+
const a = "mt-2 text-stone-900 dark:text-stone-200", b = {
|
|
64
137
|
contentEditable: !1,
|
|
65
138
|
"data-component-part": "step-title"
|
|
66
139
|
};
|
|
67
140
|
return {
|
|
68
|
-
p: /* @__PURE__ */
|
|
141
|
+
p: /* @__PURE__ */ t(
|
|
69
142
|
"p",
|
|
70
143
|
{
|
|
71
|
-
className:
|
|
72
|
-
|
|
144
|
+
className: r(
|
|
145
|
+
a,
|
|
73
146
|
"prose dark:prose-invert font-semibold"
|
|
74
147
|
),
|
|
75
|
-
...
|
|
76
|
-
|
|
148
|
+
...b,
|
|
149
|
+
...h,
|
|
150
|
+
children: s
|
|
77
151
|
}
|
|
78
152
|
),
|
|
79
|
-
h2: /* @__PURE__ */
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
153
|
+
h2: /* @__PURE__ */ t(
|
|
154
|
+
"h2",
|
|
155
|
+
{
|
|
156
|
+
className: a,
|
|
157
|
+
...b,
|
|
158
|
+
...h,
|
|
159
|
+
children: s
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
h3: /* @__PURE__ */ t(
|
|
163
|
+
"h3",
|
|
164
|
+
{
|
|
165
|
+
className: a,
|
|
166
|
+
...b,
|
|
167
|
+
...h,
|
|
168
|
+
children: s
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
h4: /* @__PURE__ */ t(
|
|
172
|
+
"h4",
|
|
173
|
+
{
|
|
174
|
+
className: a,
|
|
175
|
+
...b,
|
|
176
|
+
...h,
|
|
177
|
+
children: s
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
}[I];
|
|
83
181
|
})(),
|
|
84
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ t(
|
|
85
183
|
"div",
|
|
86
184
|
{
|
|
87
|
-
className:
|
|
185
|
+
className: r("prose dark:prose-invert", !s && "mt-2"),
|
|
88
186
|
"data-component-part": "step-content",
|
|
89
|
-
children:
|
|
187
|
+
children: n
|
|
90
188
|
}
|
|
91
189
|
)
|
|
92
190
|
] })
|
|
@@ -94,33 +192,33 @@ const h = ({
|
|
|
94
192
|
}
|
|
95
193
|
)
|
|
96
194
|
);
|
|
97
|
-
},
|
|
98
|
-
const
|
|
195
|
+
}, G = ({ children: c, titleSize: o, className: v }) => {
|
|
196
|
+
const m = (Array.isArray(c) ? c : [c]).filter(
|
|
99
197
|
Boolean
|
|
100
198
|
);
|
|
101
199
|
return (
|
|
102
200
|
// biome-ignore lint/a11y/useSemanticElements: TODO
|
|
103
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ t(
|
|
104
202
|
"div",
|
|
105
203
|
{
|
|
106
|
-
className:
|
|
204
|
+
className: r(j.Steps, "mt-10 mb-6 ml-3.5", v),
|
|
107
205
|
"data-component-part": "steps",
|
|
108
206
|
role: "list",
|
|
109
|
-
children:
|
|
110
|
-
|
|
207
|
+
children: m.map(({ props: s }, n) => /* @__PURE__ */ t(
|
|
208
|
+
M,
|
|
111
209
|
{
|
|
112
|
-
...
|
|
113
|
-
isLast:
|
|
114
|
-
stepNumber:
|
|
115
|
-
titleSize:
|
|
210
|
+
...s,
|
|
211
|
+
isLast: n === m.length - 1,
|
|
212
|
+
stepNumber: s.stepNumber ?? n + 1,
|
|
213
|
+
titleSize: s.titleSize ?? o
|
|
116
214
|
},
|
|
117
|
-
`step-${
|
|
215
|
+
`step-${n}`
|
|
118
216
|
))
|
|
119
217
|
}
|
|
120
218
|
)
|
|
121
219
|
);
|
|
122
220
|
};
|
|
123
|
-
|
|
221
|
+
G.Item = M;
|
|
124
222
|
export {
|
|
125
|
-
|
|
223
|
+
G as Steps
|
|
126
224
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactElement, ReactNode, RefObject } from 'react';
|
|
2
|
+
import { CHILD_HEADING_IDS_ATTRIBUTE, CHILD_TAB_IDS_ATTRIBUTE } from '../../constants';
|
|
3
|
+
import { IconLibrary, IconType } from '../../utils/icon-utils';
|
|
4
|
+
type TabsItemProps = {
|
|
5
|
+
id?: string;
|
|
6
|
+
title: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
iconType?: IconType;
|
|
9
|
+
iconLibrary?: IconLibrary;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
[CHILD_TAB_IDS_ATTRIBUTE]?: string;
|
|
12
|
+
[CHILD_HEADING_IDS_ATTRIBUTE]?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Mint app integration:
|
|
16
|
+
* - Wrap with useTabState hook for URL hash sync, tab sync across components, and localStorage persistence
|
|
17
|
+
* - useTabState provides: activeIndex, setActiveIndex (handles hash/sync/persist updates)
|
|
18
|
+
* - Connect onTabChange to setActiveIndex for full integration
|
|
19
|
+
* - Pass panelsRef and use it to implement findInPanels callback for useTabState
|
|
20
|
+
* - The component renders role="tabpanel" and aria-controls attributes that useTabState's
|
|
21
|
+
* findAndActivateTabContainingElement() uses for DOM-based navigation
|
|
22
|
+
*/
|
|
23
|
+
type TabsProps = {
|
|
24
|
+
children: ReactElement<TabsItemProps> | ReactElement<TabsItemProps>[];
|
|
25
|
+
defaultTabIndex?: number;
|
|
26
|
+
onTabChange?: (tabIndex: number) => void;
|
|
27
|
+
className?: string;
|
|
28
|
+
borderBottom?: boolean;
|
|
29
|
+
ariaLabel?: string;
|
|
30
|
+
panelsRef?: RefObject<HTMLDivElement>;
|
|
31
|
+
};
|
|
32
|
+
export declare const Tabs: (({ children, defaultTabIndex, onTabChange, className, borderBottom, ariaLabel, panelsRef, }: TabsProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
33
|
+
Item: ({ children }: TabsItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
};
|
|
35
|
+
export type { TabsProps, TabsItemProps };
|
|
36
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAKhE,KAAK,aAAa,GAAG;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,CAAC,uBAAuB,CAAC,CAAC,EAAE,MAAM,CAAC;IACnC,CAAC,2BAA2B,CAAC,CAAC,EAAE,MAAM,CAAC;CACxC,CAAC;AAMF;;;;;;;;GAQG;AACH,KAAK,SAAS,GAAG;IACf,QAAQ,EAAE,YAAY,CAAC,aAAa,CAAC,GAAG,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC;IACtE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;CACvC,CAAC;AAwMF,eAAO,MAAM,IAAI,gGA9Ld,SAAS;yBA/BoB,aAAa;CA+N3C,CAAC;AAEH,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC"}
|