@mintlify/components 0.4.7 → 0.4.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.
@@ -1,27 +1,27 @@
1
- import { jsx as l, jsxs as y } from "react/jsx-runtime";
1
+ import { jsx as l, jsxs as b } from "react/jsx-runtime";
2
2
  import { cn as m } from "../../utils/cn.js";
3
- import b from "color";
3
+ import x from "color";
4
4
  /* empty css */
5
- import { Icon as r } from "../icon/icon.js";
5
+ import { Icon as u } from "../icon/icon.js";
6
6
  function d({
7
- children: n,
7
+ children: a,
8
8
  variant: o,
9
9
  color: t,
10
- className: c,
11
- style: a,
12
- ...u
10
+ className: n,
11
+ style: c,
12
+ ...i
13
13
  }) {
14
- let s = {};
14
+ let r = {};
15
15
  if (t) {
16
- const e = b(t), i = e.isDark(), f = e.lighten(0.5), C = e.darken(0.5);
17
- s = {
16
+ const e = x(t), s = e.isDark(), C = e.lighten(0.5), g = e.darken(0.5);
17
+ r = {
18
18
  borderColor: `${t}33`,
19
19
  backgroundColor: `${t}1a`,
20
- "--callout-border": i ? `${t}66` : `${t}4d`,
21
- "--callout-bg": i ? `${t}4d` : `${t}1a`,
22
- "--callout-text": C.hex(),
20
+ "--callout-border": s ? `${t}66` : `${t}4d`,
21
+ "--callout-bg": s ? `${t}4d` : `${t}1a`,
22
+ "--callout-text": g.hex(),
23
23
  "--callout-icon-color": t,
24
- "--dark-callout-text": f.hex()
24
+ "--dark-callout-text": C.hex()
25
25
  };
26
26
  }
27
27
  return /* @__PURE__ */ l(
@@ -33,27 +33,27 @@ function d({
33
33
  "mt-callout",
34
34
  o && `mt-callout-${o}`,
35
35
  t && "mt-callout-custom",
36
- c
36
+ n
37
37
  ),
38
38
  role: "note",
39
39
  "aria-label": o ? `${o} callout` : "callout",
40
- style: { ...s, ...a },
41
- ...u,
42
- children: n
40
+ style: { ...r, ...c },
41
+ ...i,
42
+ children: a
43
43
  }
44
44
  );
45
45
  }
46
- function p({
47
- children: n,
46
+ function f({
47
+ children: a,
48
48
  icon: o,
49
49
  className: t,
50
- ...c
50
+ ...n
51
51
  }) {
52
- const a = n || (typeof o == "string" ? /* @__PURE__ */ l(r, { icon: o, className: "mt-callout-icon", size: 16 }) : o && typeof o == "object" && "icon" in o ? /* @__PURE__ */ l(r, { ...o, className: "mt-callout-icon", size: 16 }) : null);
53
- return /* @__PURE__ */ l("div", { className: m("mt-callout-icon-wrapper", t), ...c, children: a });
52
+ const c = a || (typeof o == "string" ? /* @__PURE__ */ l(u, { icon: o, className: "mt-callout-icon", size: 16 }) : o && typeof o == "object" && "icon" in o ? /* @__PURE__ */ l(u, { ...o, className: "mt-callout-icon", size: 16 }) : null);
53
+ return /* @__PURE__ */ l("div", { className: m("mt-callout-icon-wrapper", t), ...n, children: c });
54
54
  }
55
- function g({
56
- children: n,
55
+ function p({
56
+ children: a,
57
57
  className: o,
58
58
  ...t
59
59
  }) {
@@ -63,77 +63,59 @@ function g({
63
63
  "data-slot": "callout-content",
64
64
  className: m("mt-callout-content", o),
65
65
  ...t,
66
- children: /* @__PURE__ */ l("div", { "data-slot": "callout-content-body", className: "mt-callout-body", children: n })
66
+ children: /* @__PURE__ */ l("div", { "data-slot": "callout-content-body", className: "mt-callout-body", children: a })
67
67
  }
68
68
  );
69
69
  }
70
- function x({
71
- children: n,
70
+ function h({
71
+ children: a,
72
72
  variant: o,
73
73
  icon: t,
74
- color: c,
75
- className: a,
76
- style: u,
77
- ...s
74
+ color: n,
75
+ className: c,
76
+ style: i,
77
+ ...r
78
78
  }) {
79
- const e = o ? h(o) : null, i = typeof t == "string" ? /* @__PURE__ */ l(r, { icon: t, className: "mt-callout-icon", size: 16 }) : t && typeof t == "object" && "icon" in t ? /* @__PURE__ */ l(r, { ...t, className: "mt-callout-icon", size: 16 }) : t !== void 0 ? t : e ? /* @__PURE__ */ l(
80
- r,
79
+ const e = o ? y(o) : null, s = typeof t == "string" ? /* @__PURE__ */ l(u, { icon: t, className: "mt-callout-icon", size: 16 }) : t && typeof t == "object" && "icon" in t ? /* @__PURE__ */ l(u, { ...t, className: "mt-callout-icon", size: 16 }) : t !== void 0 ? t : e ? /* @__PURE__ */ l(
80
+ u,
81
81
  {
82
- icon: e.icon,
82
+ icon: e,
83
83
  className: "mt-callout-icon",
84
84
  size: 16,
85
- iconType: e.iconType
85
+ iconType: "regular"
86
86
  }
87
87
  ) : null;
88
- return /* @__PURE__ */ y(
88
+ return /* @__PURE__ */ b(
89
89
  d,
90
90
  {
91
91
  "data-slot": "callout-root",
92
92
  variant: o,
93
- color: c,
94
- className: a,
95
- style: u,
96
- ...s,
93
+ color: n,
94
+ className: c,
95
+ style: i,
96
+ ...r,
97
97
  children: [
98
- i && /* @__PURE__ */ l(p, { children: i }),
99
- /* @__PURE__ */ l(g, { children: n })
98
+ s && /* @__PURE__ */ l(f, { children: s }),
99
+ /* @__PURE__ */ l(p, { children: a })
100
100
  ]
101
101
  }
102
102
  );
103
103
  }
104
- function h(n) {
104
+ function y(a) {
105
105
  return {
106
- info: {
107
- icon: "circle-info",
108
- iconType: "regular"
109
- },
110
- warning: {
111
- icon: "triangle-exclamation",
112
- iconType: "regular"
113
- },
114
- success: {
115
- icon: "check",
116
- iconType: "regular"
117
- },
118
- danger: {
119
- icon: "hexagon-exclamation",
120
- iconType: "regular"
121
- },
122
- note: {
123
- icon: "circle-exclamation",
124
- iconType: "regular"
125
- },
126
- tip: {
127
- icon: "lightbulb",
128
- iconType: "regular"
129
- }
130
- }[n];
106
+ info: "circle-info",
107
+ warning: "triangle-exclamation",
108
+ success: "check",
109
+ danger: "hexagon-exclamation",
110
+ note: "circle-exclamation",
111
+ tip: "lightbulb"
112
+ }[a];
131
113
  }
132
- const j = Object.assign(x, {
114
+ const z = Object.assign(h, {
133
115
  Root: d,
134
- Icon: p,
135
- Content: g
116
+ Icon: f,
117
+ Content: p
136
118
  });
137
119
  export {
138
- j as Callout
120
+ z as Callout
139
121
  };
@@ -0,0 +1 @@
1
+ .mt-frame-container{display:block}.mt-frame-hint{display:flex;align-items:center;gap:.5rem;margin-bottom:1rem}.mt-frame-hint-icon{flex-shrink:0;width:1rem;height:1rem;fill:#9ca3af}.mt-frame-hint-text{font-size:.875rem;font-weight:500;line-height:1.25rem;color:#374151}.mt-frame{position:relative;padding:.5rem;border-radius:1rem;overflow:hidden;background-color:#f9fafb7f}.mt-frame-background{position:absolute;top:0;right:0;bottom:0;left:0;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='rgb(229 229 229 / 0.2)'%3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e");background-position:10px 10px;mask-image:linear-gradient(0deg,#fff,#fff9);-webkit-mask-image:linear-gradient(0deg,#fff,rgb(255 255 255 / 60%))}.mt-frame-content{position:relative;display:flex;justify-content:center;border-radius:.75rem;overflow:hidden;background-color:#fff}.mt-frame-caption{position:relative;display:flex;justify-content:center;margin-top:.75rem;padding:0 2rem .5rem;font-size:.875rem;line-height:1.25rem;color:#374151}.mt-frame-border{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;border:1px solid rgb(0 0 0 / 5%);border-radius:1rem}:is(.dark,.dark-theme) .mt-frame{background-color:#1f293740}:is(.dark,.dark-theme) .mt-frame-hint-icon{fill:#d1d5db}:is(.dark,.dark-theme) .mt-frame-hint-text{color:#e5e7eb}:is(.dark,.dark-theme) .mt-frame-background{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='rgb(255 255 255 / 0.05)'%3e%3cpath d='M0 .5H31.5V32'/%3e%3c/svg%3e");mask-image:linear-gradient(0deg,#ffffff1a,#ffffff7f);-webkit-mask-image:linear-gradient(0deg,rgb(255 255 255 / 10%),rgb(255 255 255 / 50%))}:is(.dark,.dark-theme) .mt-frame-content{background-color:#111827}:is(.dark,.dark-theme) .mt-frame-caption{color:#9ca3af}:is(.dark,.dark-theme) .mt-frame-border{border-color:#ffffff0d}
@@ -0,0 +1,124 @@
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import { useRender as d } from "@base-ui-components/react/use-render";
3
+ import { cn as n } from "../../utils/cn.js";
4
+ /* empty css */
5
+ import { Icon as l } from "../icon/icon.js";
6
+ function N({
7
+ children: a,
8
+ caption: r,
9
+ hint: t,
10
+ hintIcon: s,
11
+ className: m,
12
+ containerClassName: o,
13
+ style: C,
14
+ render: u = /* @__PURE__ */ e("div", {}),
15
+ ...v
16
+ }) {
17
+ const i = d({
18
+ defaultTagName: "div",
19
+ render: u,
20
+ props: {
21
+ ...v,
22
+ style: C,
23
+ className: n("mt-frame", m),
24
+ "data-slot": "frame"
25
+ }
26
+ });
27
+ return /* @__PURE__ */ c("div", { className: n("mt-frame-container", o), children: [
28
+ t && /* @__PURE__ */ e(
29
+ h,
30
+ {
31
+ icon: s || /* @__PURE__ */ e(
32
+ "svg",
33
+ {
34
+ xmlns: "http://www.w3.org/2000/svg",
35
+ viewBox: "0 0 512 512",
36
+ className: "mt-frame-hint-icon",
37
+ "aria-hidden": "true",
38
+ children: /* @__PURE__ */ e("path", { d: "M224 320c0 17.69 14.33 32 32 32h64c17.67 0 32-14.31 32-32s-14.33-32-32-32h-64C238.3 288 224 302.3 224 320zM267.6 256H352c17.67 0 32-14.31 32-32s-14.33-32-32-32h-80v40C272 240.5 270.3 248.5 267.6 256zM272 160H480c17.67 0 32-14.31 32-32s-14.33-32-32-32h-208.8C271.5 98.66 272 101.3 272 104V160zM320 416c0-17.69-14.33-32-32-32H224c-17.67 0-32 14.31-32 32s14.33 32 32 32h64C305.7 448 320 433.7 320 416zM202.1 355.8C196 345.6 192 333.3 192 320c0-5.766 1.08-11.24 2.51-16.55C157.4 300.6 128 269.9 128 232V159.1C128 151.2 135.2 144 143.1 144S160 151.2 159.1 159.1l0 69.72C159.1 245.2 171.3 271.1 200 271.1C222.1 271.1 240 254.1 240 232v-128C240 81.91 222.1 64 200 64H136.6C103.5 64 72.03 80 52.47 106.8L26.02 143.2C9.107 166.5 0 194.5 0 223.3V312C0 387.1 60.89 448 136 448h32.88C163.4 438.6 160 427.7 160 416C160 388.1 178 364.6 202.1 355.8z" })
39
+ }
40
+ ),
41
+ children: t
42
+ }
43
+ ),
44
+ /* @__PURE__ */ c(i.type, { ...i.props, children: [
45
+ /* @__PURE__ */ e("div", { className: "mt-frame-background" }),
46
+ /* @__PURE__ */ e(f, { children: a }),
47
+ r && /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e("p", { children: r }) }),
48
+ /* @__PURE__ */ e("div", { className: "mt-frame-border" })
49
+ ] })
50
+ ] });
51
+ }
52
+ function g({
53
+ children: a,
54
+ className: r,
55
+ style: t,
56
+ render: s = /* @__PURE__ */ e("div", {}),
57
+ ...m
58
+ }) {
59
+ const o = d({
60
+ defaultTagName: "div",
61
+ render: s,
62
+ props: {
63
+ ...m,
64
+ style: t,
65
+ className: n("mt-frame", r),
66
+ "data-slot": "frame"
67
+ }
68
+ });
69
+ return /* @__PURE__ */ e(o.type, { ...o.props, children: /* @__PURE__ */ c("div", { className: "mt-frame-wrapper", children: [
70
+ /* @__PURE__ */ e("div", { className: "mt-frame-background" }),
71
+ a,
72
+ /* @__PURE__ */ e("div", { className: "mt-frame-border" })
73
+ ] }) });
74
+ }
75
+ function f({ children: a, className: r, ...t }) {
76
+ return /* @__PURE__ */ e(
77
+ "div",
78
+ {
79
+ "data-slot": "frame-content",
80
+ className: n("mt-frame-content", r),
81
+ ...t,
82
+ children: a
83
+ }
84
+ );
85
+ }
86
+ function p({ children: a, className: r, ...t }) {
87
+ return /* @__PURE__ */ e(
88
+ "div",
89
+ {
90
+ "data-slot": "frame-caption",
91
+ className: n("mt-frame-caption", r),
92
+ ...t,
93
+ children: a
94
+ }
95
+ );
96
+ }
97
+ function h({ children: a, className: r, icon: t, ...s }) {
98
+ const m = typeof t == "string" ? /* @__PURE__ */ e(l, { icon: t, className: "mt-frame-hint-icon", size: 16 }) : t && typeof t == "object" && "icon" in t ? /* @__PURE__ */ e(l, { ...t, className: "mt-frame-hint-icon", size: 16 }) : t || null;
99
+ return /* @__PURE__ */ c(
100
+ "div",
101
+ {
102
+ "data-slot": "frame-hint",
103
+ className: n("mt-frame-hint", r),
104
+ ...s,
105
+ children: [
106
+ m || null,
107
+ a && /* @__PURE__ */ e("p", { className: "mt-frame-hint-text", children: a })
108
+ ]
109
+ }
110
+ );
111
+ }
112
+ const H = Object.assign(N, {
113
+ Root: g,
114
+ Content: f,
115
+ Caption: p,
116
+ Hint: h
117
+ });
118
+ export {
119
+ H as Frame,
120
+ p as FrameCaption,
121
+ f as FrameContent,
122
+ h as FrameHint,
123
+ g as FrameRoot
124
+ };
@@ -0,0 +1 @@
1
+ .mt-icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
@@ -4,7 +4,8 @@ import { isAbsoluteUrl as c } from "../../utils/isAbsoluteUrl.js";
4
4
  import { MINTLIFY_ICONS_CDN_URL as o } from "../../constants/index.js";
5
5
  import { FONT_AWESOME_BRANDS as f } from "../../constants/font-awesome-brands.js";
6
6
  import { IS_DEV as $ } from "../../constants/env.js";
7
- function N({
7
+ /* empty css */
8
+ function R({
8
9
  icon: t,
9
10
  iconType: r,
10
11
  iconLibrary: s,
@@ -14,9 +15,9 @@ function N({
14
15
  style: i,
15
16
  ...l
16
17
  }) {
17
- if (r && !d.includes(r))
18
+ if (r && !p.includes(r))
18
19
  return $ && console.warn(
19
- `Invalid iconType ${r} expected a string equal to one of: ${d.join(
20
+ `Invalid iconType ${r} expected a string equal to one of: ${p.join(
20
21
  ", "
21
22
  )}`
22
23
  ), null;
@@ -60,7 +61,7 @@ function N({
60
61
  }
61
62
  );
62
63
  }
63
- const g = v(t.toLowerCase(), r, s), p = l;
64
+ const g = v(t.toLowerCase(), r, s), d = l;
64
65
  return /* @__PURE__ */ u(
65
66
  "svg",
66
67
  {
@@ -78,7 +79,7 @@ function N({
78
79
  height: e,
79
80
  ...i
80
81
  },
81
- ...p
82
+ ...d
82
83
  }
83
84
  );
84
85
  }
@@ -88,7 +89,7 @@ function b(t) {
88
89
  function v(t, r, s) {
89
90
  return b(t) ? `${o}/v7.1.0/brands/${t}.svg` : s === "lucide" ? `${o}/lucide/v0.545.0/${t}.svg` : `${o}/v7.1.0/${r ?? "regular"}/${t}.svg`;
90
91
  }
91
- const R = ["fontawesome", "lucide"], d = [
92
+ const S = ["fontawesome", "lucide"], p = [
92
93
  "brands",
93
94
  "duotone",
94
95
  "light",
@@ -102,8 +103,8 @@ const R = ["fontawesome", "lucide"], d = [
102
103
  "thin"
103
104
  ];
104
105
  export {
105
- N as Icon,
106
+ R as Icon,
106
107
  v as getIconUrl,
107
- R as iconLibraries,
108
- d as iconTypes
108
+ S as iconLibraries,
109
+ p as iconTypes
109
110
  };
package/dist/index.d.ts CHANGED
@@ -433,6 +433,67 @@ declare const focus_2: {
433
433
  };
434
434
  export { focus_2 as focus }
435
435
 
436
+ export declare const Frame: typeof FrameComponent & {
437
+ Root: typeof FrameRoot;
438
+ Content: typeof FrameContent;
439
+ Caption: typeof FrameCaption;
440
+ Hint: typeof FrameHint;
441
+ };
442
+
443
+ export declare function FrameCaption({ children, className, ...props }: FrameCaptionProps): JSX_2.Element;
444
+
445
+ export declare interface FrameCaptionProps extends HTMLAttributes<HTMLDivElement> {
446
+ children: ReactNode;
447
+ className?: string;
448
+ }
449
+
450
+ declare function FrameComponent({ children, caption, hint, hintIcon, className, containerClassName, style, render, ...props }: FrameProps): JSX_2.Element;
451
+
452
+ export declare function FrameContent({ children, className, ...props }: FrameContentProps): JSX_2.Element;
453
+
454
+ export declare interface FrameContentProps extends HTMLAttributes<HTMLDivElement> {
455
+ children: ReactNode;
456
+ className?: string;
457
+ }
458
+
459
+ export declare function FrameHint({ children, className, icon, ...props }: FrameHintProps): JSX_2.Element;
460
+
461
+ export declare interface FrameHintProps extends HTMLAttributes<HTMLDivElement> {
462
+ icon?: IconProp;
463
+ children: ReactNode;
464
+ className?: string;
465
+ }
466
+
467
+ export declare interface FrameProps extends HTMLAttributes<HTMLElement> {
468
+ /**
469
+ * Frame caption, at the bottom of the frame.
470
+ */
471
+ caption?: string;
472
+ /**
473
+ * Frame hint text, at the top of the frame.
474
+ */
475
+ hint?: string;
476
+ /**
477
+ * Frame hint, at the top of the frame.
478
+ * @see {@link IconProp}
479
+ */
480
+ hintIcon?: IconProp;
481
+ className?: string;
482
+ containerClassName?: string;
483
+ style?: CSSProperties;
484
+ children: ReactNode;
485
+ render?: React.ReactElement;
486
+ }
487
+
488
+ export declare function FrameRoot({ children, className, style, render, ...props }: FrameRootProps): JSX_2.Element;
489
+
490
+ export declare interface FrameRootProps extends HTMLAttributes<HTMLElement> {
491
+ className?: string;
492
+ style?: CSSProperties;
493
+ children: ReactNode;
494
+ render?: React.ReactElement;
495
+ }
496
+
436
497
  export declare function getIconUrl(icon: string, iconType?: IconType, iconLibrary?: IconLibrary): string;
437
498
 
438
499
  export declare function Icon({ icon, iconType, iconLibrary, color, size, className, style, ...props }: IconProps): JSX_2.Element | null;
package/dist/index.js CHANGED
@@ -1,17 +1,19 @@
1
1
  /* empty css */
2
2
  import { Badge as s } from "./components/badge/badge.js";
3
- import { Callout as c } from "./components/callout/callout.js";
4
- import { Icon as n, getIconUrl as p, iconLibraries as f, iconTypes as m } from "./components/icon/icon.js";
5
- import { colors as l, designTokens as x, focus as d, shadows as g } from "./styles/design-tokens.js";
3
+ import { Callout as m } from "./components/callout/callout.js";
4
+ import { Frame as c } from "./components/frame/frame.js";
5
+ import { Icon as i, getIconUrl as n, iconLibraries as a, iconTypes as x } from "./components/icon/icon.js";
6
+ import { colors as d, designTokens as g, focus as u, shadows as I } from "./styles/design-tokens.js";
6
7
  export {
7
8
  s as Badge,
8
- c as Callout,
9
- n as Icon,
10
- l as colors,
11
- x as designTokens,
12
- d as focus,
13
- p as getIconUrl,
14
- f as iconLibraries,
15
- m as iconTypes,
16
- g as shadows
9
+ m as Callout,
10
+ c as Frame,
11
+ i as Icon,
12
+ d as colors,
13
+ g as designTokens,
14
+ u as focus,
15
+ n as getIconUrl,
16
+ a as iconLibraries,
17
+ x as iconTypes,
18
+ I as shadows
17
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/components",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "Mintlify Headless UI components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -61,6 +61,7 @@
61
61
  "react-dom": "^18.0.0 || ^19.0.0"
62
62
  },
63
63
  "dependencies": {
64
+ "@base-ui-components/react": "1.0.0-beta.6",
64
65
  "clsx": "^2.1.1",
65
66
  "color": "^5.0.3"
66
67
  },