@mintlify/components 0.4.15 → 0.4.16
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/badge/badge.js +12 -13
- package/dist/components/callout/callout.js +2 -3
- package/dist/components/icon/icon.js +26 -27
- package/package.json +1 -1
- package/dist/components/badge/badge.css +0 -1
- package/dist/components/callout/callout.css +0 -1
- package/dist/components/icon/icon.css +0 -1
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { jsx as m, jsxs as
|
|
2
|
-
import { cn as
|
|
3
|
-
/* empty css */
|
|
1
|
+
import { jsx as m, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { cn as f } from "../../utils/cn.js";
|
|
4
3
|
import { Icon as o } from "../icon/icon.js";
|
|
5
|
-
function
|
|
4
|
+
function u({
|
|
6
5
|
children: n,
|
|
7
6
|
color: e = "gray",
|
|
8
7
|
shape: g = "rounded",
|
|
9
8
|
size: t = "md",
|
|
10
|
-
stroke:
|
|
9
|
+
stroke: c = !1,
|
|
11
10
|
disabled: s = !1,
|
|
12
11
|
icon: a,
|
|
13
|
-
className:
|
|
14
|
-
...
|
|
12
|
+
className: l,
|
|
13
|
+
...p
|
|
15
14
|
}) {
|
|
16
15
|
const d = typeof a == "string" ? /* @__PURE__ */ m(o, { icon: a, className: "mt-badge-icon", size: r[t] }) : a && typeof a == "object" && "icon" in a ? /* @__PURE__ */ m(o, { ...a, className: "mt-badge-icon", size: r[t] }) : a;
|
|
17
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ b(
|
|
18
17
|
"span",
|
|
19
18
|
{
|
|
20
19
|
"data-slot": "badge",
|
|
21
20
|
"data-shape": g,
|
|
22
|
-
"data-stroke":
|
|
21
|
+
"data-stroke": c,
|
|
23
22
|
"data-disabled": s,
|
|
24
23
|
"data-color": e,
|
|
25
24
|
"data-size": t,
|
|
26
25
|
"aria-disabled": s,
|
|
27
|
-
className:
|
|
26
|
+
className: f(
|
|
28
27
|
"mt-badge",
|
|
29
28
|
`mt-badge-${e}`,
|
|
30
29
|
`mt-badge-${t}`,
|
|
31
|
-
|
|
30
|
+
l
|
|
32
31
|
),
|
|
33
|
-
...
|
|
32
|
+
...p,
|
|
34
33
|
children: [
|
|
35
34
|
!!d && d,
|
|
36
35
|
n
|
|
@@ -45,5 +44,5 @@ const r = {
|
|
|
45
44
|
lg: 16
|
|
46
45
|
};
|
|
47
46
|
export {
|
|
48
|
-
|
|
47
|
+
u as Badge
|
|
49
48
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsxs as x, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { cn as i } from "../../utils/cn.js";
|
|
3
3
|
import b from "color";
|
|
4
|
-
/* empty css */
|
|
5
4
|
import { Icon as s } from "../icon/icon.js";
|
|
6
5
|
function h(l) {
|
|
7
6
|
return {
|
|
@@ -128,11 +127,11 @@ function $({
|
|
|
128
127
|
}
|
|
129
128
|
);
|
|
130
129
|
}
|
|
131
|
-
const
|
|
130
|
+
const j = Object.assign($, {
|
|
132
131
|
Root: d,
|
|
133
132
|
Icon: C,
|
|
134
133
|
Content: f
|
|
135
134
|
});
|
|
136
135
|
export {
|
|
137
|
-
|
|
136
|
+
j as Callout
|
|
138
137
|
};
|
|
@@ -4,26 +4,25 @@ 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
|
-
|
|
8
|
-
function R({
|
|
7
|
+
function N({
|
|
9
8
|
icon: t,
|
|
10
|
-
iconType:
|
|
9
|
+
iconType: e,
|
|
11
10
|
iconLibrary: s,
|
|
12
11
|
color: m,
|
|
13
|
-
size:
|
|
12
|
+
size: r,
|
|
14
13
|
className: a,
|
|
15
|
-
style:
|
|
16
|
-
...
|
|
14
|
+
style: n,
|
|
15
|
+
...i
|
|
17
16
|
}) {
|
|
18
|
-
if (
|
|
17
|
+
if (e && !d.includes(e))
|
|
19
18
|
return $ && console.warn(
|
|
20
|
-
`Invalid iconType ${
|
|
19
|
+
`Invalid iconType ${e} expected a string equal to one of: ${d.join(
|
|
21
20
|
", "
|
|
22
21
|
)}`
|
|
23
22
|
), null;
|
|
24
23
|
if (typeof t == "string" && (c(t) || t.startsWith("/"))) {
|
|
25
24
|
if (t.startsWith(o) || t.startsWith("https://mintlify.b-cdn.net")) {
|
|
26
|
-
const k =
|
|
25
|
+
const k = i;
|
|
27
26
|
return /* @__PURE__ */ l(
|
|
28
27
|
"svg",
|
|
29
28
|
{
|
|
@@ -37,15 +36,15 @@ function R({
|
|
|
37
36
|
maskPosition: "center",
|
|
38
37
|
maskSize: "100%",
|
|
39
38
|
backgroundColor: "currentColor",
|
|
40
|
-
width:
|
|
41
|
-
height:
|
|
42
|
-
...
|
|
39
|
+
width: r,
|
|
40
|
+
height: r,
|
|
41
|
+
...n
|
|
43
42
|
},
|
|
44
43
|
...k
|
|
45
44
|
}
|
|
46
45
|
);
|
|
47
46
|
}
|
|
48
|
-
const h =
|
|
47
|
+
const h = i;
|
|
49
48
|
return /* @__PURE__ */ l(
|
|
50
49
|
"img",
|
|
51
50
|
{
|
|
@@ -53,15 +52,15 @@ function R({
|
|
|
53
52
|
alt: t,
|
|
54
53
|
className: u("mt-icon", a),
|
|
55
54
|
style: {
|
|
56
|
-
width:
|
|
57
|
-
height:
|
|
58
|
-
...
|
|
55
|
+
width: r,
|
|
56
|
+
height: r,
|
|
57
|
+
...n
|
|
59
58
|
},
|
|
60
59
|
...h
|
|
61
60
|
}
|
|
62
61
|
);
|
|
63
62
|
}
|
|
64
|
-
const g = v(t.toLowerCase(),
|
|
63
|
+
const g = v(t.toLowerCase(), e, s), p = i;
|
|
65
64
|
return /* @__PURE__ */ l(
|
|
66
65
|
"svg",
|
|
67
66
|
{
|
|
@@ -75,21 +74,21 @@ function R({
|
|
|
75
74
|
maskPosition: "center",
|
|
76
75
|
maskSize: s === "lucide" ? "100%" : void 0,
|
|
77
76
|
backgroundColor: m,
|
|
78
|
-
width:
|
|
79
|
-
height:
|
|
80
|
-
...
|
|
77
|
+
width: r,
|
|
78
|
+
height: r,
|
|
79
|
+
...n
|
|
81
80
|
},
|
|
82
|
-
...
|
|
81
|
+
...p
|
|
83
82
|
}
|
|
84
83
|
);
|
|
85
84
|
}
|
|
86
85
|
function b(t) {
|
|
87
86
|
return t ? f.includes(t.toLowerCase()) : !1;
|
|
88
87
|
}
|
|
89
|
-
function v(t,
|
|
90
|
-
return b(t) ? `${o}/v7.1.0/brands/${t}.svg` : s === "lucide" ? `${o}/lucide/v0.545.0/${t}.svg` : `${o}/v7.1.0/${
|
|
88
|
+
function v(t, e, s) {
|
|
89
|
+
return b(t) ? `${o}/v7.1.0/brands/${t}.svg` : s === "lucide" ? `${o}/lucide/v0.545.0/${t}.svg` : `${o}/v7.1.0/${e ?? "regular"}/${t}.svg`;
|
|
91
90
|
}
|
|
92
|
-
const
|
|
91
|
+
const R = ["fontawesome", "lucide"], d = [
|
|
93
92
|
"brands",
|
|
94
93
|
"duotone",
|
|
95
94
|
"light",
|
|
@@ -103,8 +102,8 @@ const S = ["fontawesome", "lucide"], p = [
|
|
|
103
102
|
"thin"
|
|
104
103
|
];
|
|
105
104
|
export {
|
|
106
|
-
|
|
105
|
+
N as Icon,
|
|
107
106
|
v as getIconUrl,
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
R as iconLibraries,
|
|
108
|
+
d as iconTypes
|
|
110
109
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer mt-components{.mt-badge{display:inline-flex;align-items:center;width:-moz-fit-content;width:fit-content;font-weight:500;position:relative;background-color:var(--color-bg);color:var(--color-text)}.mt-badge[data-disabled=true]{cursor:not-allowed;background-color:var(--color-bg-disabled);color:var(--color-text-disabled)}.mt-badge[data-shape=pill]{border-radius:9999px}.mt-badge[data-stroke=true]{outline:1px solid var(--mt-badge-stroke-color, rgb(11 12 14 / 8%));outline-offset:-1px}:is(.dark,.dark-theme) .mt-badge[data-stroke=true]{outline-color:var(--mt-badge-stroke-color, rgb(255 255 255 / 14%))}.mt-badge-xs svg,.mt-badge-sm svg,.mt-badge-md svg,.mt-badge-lg svg{margin:1px;background-color:var(--color-text)}.mt-badge[data-disabled=true] svg{background-color:var(--color-text-disabled)}.mt-badge-icon{flex-shrink:0;color:var(--color-text)}.mt-badge[data-disabled=true] .mt-badge-icon{color:var(--color-text-disabled)}.mt-badge .mt-icon{color:var(--color-text)}.mt-badge[data-disabled=true] .mt-icon{color:var(--color-text-disabled)}.mt-badge-xs{gap:.125rem;padding:0 .125rem;font-size:.75rem;line-height:1rem}.mt-badge-xs:has(svg),.mt-badge-xs:has(.mt-icon){padding-right:.25rem}.mt-badge-xs[data-shape=rounded]{border-radius:.25rem}.mt-badge-sm{gap:.1875rem;padding:.125rem .125rem .125rem .1875rem;font-size:.75rem;line-height:1rem}.mt-badge-sm:has(svg),.mt-badge-sm:has(.mt-icon){padding-right:.375rem}.mt-badge-sm[data-shape=rounded]{border-radius:.375rem}.mt-badge-md{gap:.25rem;padding:.125rem .25rem;font-size:.875rem;line-height:1.25rem;letter-spacing:-.01em}.mt-badge-md:has(svg),.mt-badge-md:has(.mt-icon){padding-right:.5rem}.mt-badge-md[data-shape=rounded]{border-radius:.5rem}.mt-badge-lg{gap:.25rem;padding:.25rem .375rem;font-size:.875rem;line-height:1.25rem;letter-spacing:-.01em}.mt-badge-lg:has(svg),.mt-badge-lg:has(.mt-icon){padding-right:.625rem}.mt-badge-lg[data-shape=rounded]{border-radius:.5rem}.mt-badge-gray{--color-bg: var(--mt-color-badge-gray);--color-text: var(--mt-color-gray-7);--color-bg-disabled: var(--mt-color-badge-gray);--color-text-disabled: var(--mt-color-gray-3)}:is(.dark,.dark-theme) .mt-badge-gray{--color-bg: var(--mt-color-gray-10);--color-text: var(--mt-color-gray-4);--color-bg-disabled: var(--mt-color-gray-10);--color-text-disabled: var(--mt-color-gray-9)}.mt-badge-blue{--color-bg: var(--mt-color-badge-blue);--color-text: var(--mt-color-text-accent-blue-inverted);--color-bg-disabled: var(--mt-color-badge-blue-disabled);--color-text-disabled: var(--mt-color-text-accent-blue-tertiary)}:is(.dark,.dark-theme) .mt-badge-blue{--color-bg: var(--mt-color-badge-blue);--color-text: var(--mt-color-text-accent-blue-inverted);--color-bg-disabled: var(--mt-color-badge-blue-disabled);--color-text-disabled: var(--mt-color-text-accent-blue-tertiary)}.mt-badge-green{--color-bg: var(--mt-color-badge-green);--color-text: var(--mt-color-text-accent-green);--color-bg-disabled: var(--mt-color-badge-green-disabled);--color-text-disabled: var(--mt-color-text-accent-green-secondary)}:is(.dark,.dark-theme) .mt-badge-green{--color-bg: var(--mt-color-badge-green);--color-text: var(--mt-color-text-accent-green-inverted);--color-bg-disabled: var(--mt-color-badge-green-disabled);--color-text-disabled: var(--mt-color-text-accent-green-secondary)}.mt-badge-orange{--color-bg: var(--mt-color-badge-orange);--color-text: var(--mt-color-text-accent-orange-inverted);--color-bg-disabled: var(--mt-color-badge-orange-disabled);--color-text-disabled: var(--mt-color-text-accent-orange-secondary)}:is(.dark,.dark-theme) .mt-badge-orange{--color-bg: var(--mt-color-badge-orange);--color-text: var(--mt-color-text-accent-orange-inverted);--color-bg-disabled: var(--mt-color-badge-orange-disabled);--color-text-disabled: var(--mt-color-text-accent-orange-secondary)}.mt-badge-red{--color-bg: var(--mt-color-badge-red);--color-text: var(--mt-color-text-accent-red-inverted);--color-bg-disabled: var(--mt-color-badge-red-disabled);--color-text-disabled: var(--mt-color-text-accent-red-secondary)}:is(.dark,.dark-theme) .mt-badge-red{--color-bg: var(--mt-color-badge-red);--color-text: var(--mt-color-text-accent-red-inverted);--color-bg-disabled: var(--mt-color-badge-red-disabled);--color-text-disabled: var(--mt-color-text-accent-red-secondary)}.mt-badge-purple{--color-bg: var(--mt-color-badge-purple);--color-text: var(--mt-color-text-accent-purple-inverted);--color-bg-disabled: var(--mt-color-badge-purple);--color-text-disabled: var(--mt-color-text-accent-purple-secondary)}:is(.dark,.dark-theme) .mt-badge-purple{--color-bg: var(--mt-color-badge-purple);--color-text: var(--mt-color-text-accent-purple-inverted);--color-bg-disabled: var(--mt-color-badge-purple);--color-text-disabled: var(--mt-color-text-accent-purple-secondary)}.mt-badge-white{--color-bg: var(--mt-color-white-9);--color-text: var(--mt-color-text-static-dark-secondary);--color-bg-disabled: rgb(255 255 255 / 8%);--color-text-disabled: var(--mt-color-gray-3)}:is(.dark,.dark-theme) .mt-badge-white{--color-bg: rgb(255 255 255 / 99%);--color-text: var(--mt-color-text-static-dark-secondary);--color-bg-disabled: var(--mt-color-white-2);--color-text-disabled: rgb(11 12 14 / 60%)}.mt-badge-surface{--color-bg: rgb(255 255 255 / 95%);--color-text: var(--mt-color-text-secondary);--color-bg-disabled: rgb(255 255 255 / 95%);--color-text-disabled: var(--mt-color-gray-3)}:is(.dark,.dark-theme) .mt-badge-surface{--color-bg: var(--mt-color-gray-10);--color-text: var(--mt-color-text-secondary);--color-bg-disabled: var(--mt-color-gray-10);--color-text-disabled: var(--mt-color-gray-9)}.mt-badge-white-destructive{--color-bg: rgb(255 255 255 / 95%);--color-text: var(--mt-color-text-destructive);--color-bg-disabled: rgb(255 255 255 / 8%);--color-text-disabled: var(--mt-color-text-destructive-tertiary)}:is(.dark,.dark-theme) .mt-badge-white-destructive{--color-bg: rgb(255 255 255 / 95%);--color-text: var(--mt-color-text-destructive);--color-bg-disabled: rgb(255 255 255 / 24%);--color-text-disabled: var(--mt-color-text-destructive-tertiary)}.mt-badge-surface-destructive{--color-bg: rgb(255 255 255 / 95%);--color-text: var(--mt-color-text-destructive);--color-bg-disabled: rgb(255 255 255 / 95%);--color-text-disabled: var(--mt-color-text-destructive-tertiary)}:is(.dark,.dark-theme) .mt-badge-surface-destructive{--color-bg: var(--mt-color-gray-10);--color-text: var(--mt-color-text-destructive);--color-bg-disabled: var(--mt-color-gray-10);--color-text-disabled: var(--mt-color-text-destructive-tertiary)}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer mt-components{.mt-callout{display:flex;gap:.75rem;padding:1rem 1.25rem;border-radius:1rem;border-width:1px;border-style:solid;margin:1rem 0;background-color:var(--callout-bg, rgb(250 250 250 / 50%));border-color:var(--callout-border, rgb(113 113 122 / 20%));color:var(--callout-text, rgb(24 24 27));--callout-icon-color: rgb(161 161 170)}:is(.dark,.dark-theme) .mt-callout{background-color:var(--callout-bg, rgb(113 113 122 / 10%));border-color:var(--callout-border, rgb(113 113 122 / 30%));color:var(--callout-text, rgb(228 228 231));--callout-icon-color: rgb(212 212 216)}.mt-callout-icon-wrapper{flex-shrink:0;display:flex;align-items:flex-start;padding-top:.125rem}.mt-callout-icon{color:var(--callout-icon-color)}.mt-callout-content{flex:1;min-width:0;font-size:.875rem;line-height:1.5}.mt-callout-body{color:var(--callout-text)}:is(.dark,.dark-theme) .mt-callout-custom .mt-callout-body{color:var(--dark-callout-text)}.mt-callout-info{--callout-bg: rgb(250 250 250 / 50%);--callout-border: rgb(113 113 122 / 20%);--callout-text: rgb(24 24 27);--callout-icon-color: rgb(161 161 170)}:is(.dark,.dark-theme) .mt-callout-info{--callout-bg: rgb(113 113 122 / 10%);--callout-border: rgb(113 113 122 / 30%);--callout-text: rgb(228 228 231);--callout-icon-color: rgb(212 212 216)}.mt-callout-warning{--callout-bg: rgb(255 251 235 / 50%);--callout-border: rgb(245 158 11 / 20%);--callout-text: rgb(120 53 15);--callout-icon-color: rgb(251 191 36)}:is(.dark,.dark-theme) .mt-callout-warning{--callout-bg: rgb(245 158 11 / 10%);--callout-border: rgb(245 158 11 / 30%);--callout-text: rgb(253 230 138);--callout-icon-color: rgb(252 211 77 / 80%)}.mt-callout-success{--callout-bg: rgb(236 253 245 / 50%);--callout-border: rgb(16 185 129 / 20%);--callout-text: rgb(6 78 59);--callout-icon-color: rgb(22 163 74)}:is(.dark,.dark-theme) .mt-callout-success{--callout-bg: rgb(16 185 129 / 10%);--callout-border: rgb(16 185 129 / 30%);--callout-text: rgb(167 243 208);--callout-icon-color: rgb(74 222 128 / 80%)}.mt-callout-danger{--callout-bg: rgb(254 242 242 / 50%);--callout-border: rgb(239 68 68 / 20%);--callout-text: rgb(127 29 29);--callout-icon-color: rgb(220 38 38)}:is(.dark,.dark-theme) .mt-callout-danger{--callout-bg: rgb(239 68 68 / 10%);--callout-border: rgb(239 68 68 / 30%);--callout-text: rgb(252 165 165);--callout-icon-color: rgb(248 113 113 / 80%)}.mt-callout-note{--callout-bg: rgb(240 249 255 / 50%);--callout-border: rgb(14 165 233 / 20%);--callout-text: rgb(12 74 110);--callout-icon-color: rgb(14 165 233)}:is(.dark,.dark-theme) .mt-callout-note{--callout-bg: rgb(14 165 233 / 10%);--callout-border: rgb(14 165 233 / 30%);--callout-text: rgb(186 230 253);--callout-icon-color: rgb(14 165 233)}.mt-callout-tip{--callout-bg: rgb(236 253 245 / 50%);--callout-border: rgb(16 185 129 / 20%);--callout-text: rgb(6 78 59);--callout-icon-color: rgb(5 150 105)}:is(.dark,.dark-theme) .mt-callout-tip{--callout-bg: rgb(16 185 129 / 10%);--callout-border: rgb(16 185 129 / 30%);--callout-text: rgb(167 243 208);--callout-icon-color: rgb(52 211 153 / 80%)}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@layer mt-components{.mt-icon{flex-shrink:0}}
|