@mintlify/components 1.0.6 → 1.0.8

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