@imfusion/web-ui 0.6.4-dev.1.g4ec1264f → 0.6.4-dev.7.g1840f300
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/code-Ce8uiPsv.js +134 -0
- package/dist/components/code/code.d.ts +4 -6
- package/dist/components/typo/typo.d.ts +2 -2
- package/dist/index.js +935 -941
- package/dist/integrations/code-highlight.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/docgen/doc.gen.json +7 -21
- package/dist/code-BFMQnmu9.js +0 -147
package/package.json
CHANGED
package/src/docgen/doc.gen.json
CHANGED
|
@@ -545,21 +545,14 @@
|
|
|
545
545
|
},
|
|
546
546
|
{
|
|
547
547
|
"name": "Code.InlineLink",
|
|
548
|
-
"description": "Code.InlineLink — the inline-code chip rendered as a link: the same hairline\nbox, with
|
|
548
|
+
"description": "Code.InlineLink — the inline-code chip rendered as a link: the same hairline\nbox, with an optional directional arrow behind the separator instead of a copy button.\nSibling of `Code.Inline`, sharing its chip visual (`.inline`) — never both a\ncopy button and a link on the same chip. Mirrors `ChipLink`'s shape (anchor\nis the chip root, trailing icon nudges on hover, `data-kind` picks the icon).",
|
|
549
549
|
"props": [
|
|
550
|
-
{
|
|
551
|
-
"name": "children",
|
|
552
|
-
"required": true,
|
|
553
|
-
"type": "string",
|
|
554
|
-
"defaultValue": null,
|
|
555
|
-
"description": "The link text, as a raw string, rendered as a code fragment."
|
|
556
|
-
},
|
|
557
550
|
{
|
|
558
551
|
"name": "kind",
|
|
559
552
|
"required": false,
|
|
560
553
|
"type": "CodeInlineLinkKind",
|
|
561
554
|
"defaultValue": "external",
|
|
562
|
-
"description": "Link target scope. `\"external\"` (default) opens in a new tab
|
|
555
|
+
"description": "Link target scope. `\"external\"` (default) opens in a new tab; `\"internal\"` stays in the current tab."
|
|
563
556
|
},
|
|
564
557
|
{
|
|
565
558
|
"name": "render",
|
|
@@ -5294,14 +5287,14 @@
|
|
|
5294
5287
|
},
|
|
5295
5288
|
{
|
|
5296
5289
|
"name": "Typo.Link",
|
|
5297
|
-
"description": "Typo.Link — inline anchor
|
|
5290
|
+
"description": "Typo.Link — inline anchor with an optional local Web UI directional icon.",
|
|
5298
5291
|
"props": [
|
|
5299
5292
|
{
|
|
5300
5293
|
"name": "kind",
|
|
5301
5294
|
"required": false,
|
|
5302
5295
|
"type": "TypoLinkKind",
|
|
5303
5296
|
"defaultValue": "external",
|
|
5304
|
-
"description": "Link target scope. `\"external\"` (default) opens in a new tab
|
|
5297
|
+
"description": "Link target scope. `\"external\"` (default) opens in a new tab; `\"internal\"` stays in the current tab."
|
|
5305
5298
|
},
|
|
5306
5299
|
{
|
|
5307
5300
|
"name": "render",
|
|
@@ -5314,7 +5307,7 @@
|
|
|
5314
5307
|
"name": "variant",
|
|
5315
5308
|
"required": false,
|
|
5316
5309
|
"type": "| \"main\"\n| \"support\"\n| \"minor\"\n| \"brand\"\n| \"primary\"\n| \"negative\"\n| \"positive\"\n| \"warning\"\n| \"info\"\n| \"oncolor\"\n| \"accent-1\"\n| \"accent-2\"\n| \"accent-3\"\n| null",
|
|
5317
|
-
"defaultValue": "
|
|
5310
|
+
"defaultValue": "primary",
|
|
5318
5311
|
"description": ""
|
|
5319
5312
|
}
|
|
5320
5313
|
]
|
|
@@ -5492,21 +5485,14 @@
|
|
|
5492
5485
|
},
|
|
5493
5486
|
{
|
|
5494
5487
|
"name": "CodeHighlight.InlineLink",
|
|
5495
|
-
"description": "Code.InlineLink — the inline-code chip rendered as a link: the same hairline\nbox, with
|
|
5488
|
+
"description": "Code.InlineLink — the inline-code chip rendered as a link: the same hairline\nbox, with an optional directional arrow behind the separator instead of a copy button.\nSibling of `Code.Inline`, sharing its chip visual (`.inline`) — never both a\ncopy button and a link on the same chip. Mirrors `ChipLink`'s shape (anchor\nis the chip root, trailing icon nudges on hover, `data-kind` picks the icon).",
|
|
5496
5489
|
"props": [
|
|
5497
|
-
{
|
|
5498
|
-
"name": "children",
|
|
5499
|
-
"required": true,
|
|
5500
|
-
"type": "string",
|
|
5501
|
-
"defaultValue": null,
|
|
5502
|
-
"description": "The link text, as a raw string, rendered as a code fragment."
|
|
5503
|
-
},
|
|
5504
5490
|
{
|
|
5505
5491
|
"name": "kind",
|
|
5506
5492
|
"required": false,
|
|
5507
5493
|
"type": "CodeInlineLinkKind",
|
|
5508
5494
|
"defaultValue": "external",
|
|
5509
|
-
"description": "Link target scope. `\"external\"` (default) opens in a new tab
|
|
5495
|
+
"description": "Link target scope. `\"external\"` (default) opens in a new tab; `\"internal\"` stays in the current tab."
|
|
5510
5496
|
},
|
|
5511
5497
|
{
|
|
5512
5498
|
"name": "render",
|
package/dist/code-BFMQnmu9.js
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
-
import { t } from "./meta-CySnRuVp.js";
|
|
3
|
-
import { Ma as n, Qt as r, Xo as i, hn as a, r as o } from "./icons-Cy1HAosO.js";
|
|
4
|
-
import { cx as s } from "class-variance-authority";
|
|
5
|
-
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
|
-
import { useCallback as d, useEffect as f, useRef as p, useState as m } from "react";
|
|
7
|
-
import { mergeProps as h } from "@base-ui/react/merge-props";
|
|
8
|
-
import { useRender as g } from "@base-ui/react/use-render";
|
|
9
|
-
//#region src/hooks/use-clipboard.ts
|
|
10
|
-
function _({ timeout: e = 1500 } = {}) {
|
|
11
|
-
let [t, n] = m(!1), r = p(void 0);
|
|
12
|
-
return f(() => () => clearTimeout(r.current), []), {
|
|
13
|
-
copied: t,
|
|
14
|
-
copy: d((t) => {
|
|
15
|
-
navigator.clipboard.writeText(t).then(() => {
|
|
16
|
-
n(!0), clearTimeout(r.current), r.current = setTimeout(() => n(!1), e);
|
|
17
|
-
});
|
|
18
|
-
}, [e])
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
var v = {
|
|
22
|
-
block: "imf-ui-code-module-block",
|
|
23
|
-
copy: "imf-ui-code-module-copy",
|
|
24
|
-
icon: "imf-ui-code-module-icon",
|
|
25
|
-
inline: "imf-ui-code-module-inline",
|
|
26
|
-
inlineCopy: "imf-ui-code-module-inlineCopy",
|
|
27
|
-
inlineLink: "imf-ui-code-module-inlineLink",
|
|
28
|
-
language: "imf-ui-code-module-language",
|
|
29
|
-
pre: "imf-ui-code-module-pre",
|
|
30
|
-
separator: "imf-ui-code-module-separator"
|
|
31
|
-
}, y = /* @__PURE__ */ e({
|
|
32
|
-
Block: () => S,
|
|
33
|
-
Inline: () => b,
|
|
34
|
-
InlineLink: () => x
|
|
35
|
-
});
|
|
36
|
-
function b({ className: e, copyable: t = !1, children: r, render: a, ...d }) {
|
|
37
|
-
let { copied: f, copy: m } = _(), y = p(null), b = f ? n : i;
|
|
38
|
-
return g({
|
|
39
|
-
defaultTagName: "code",
|
|
40
|
-
render: a,
|
|
41
|
-
props: {
|
|
42
|
-
...h(d, {
|
|
43
|
-
className: s(v.inline, e),
|
|
44
|
-
children: /* @__PURE__ */ u(c, { children: [
|
|
45
|
-
/* @__PURE__ */ l("span", {
|
|
46
|
-
ref: y,
|
|
47
|
-
children: r
|
|
48
|
-
}),
|
|
49
|
-
t && /* @__PURE__ */ l("span", { className: v.separator }),
|
|
50
|
-
t && /* @__PURE__ */ l("button", {
|
|
51
|
-
type: "button",
|
|
52
|
-
className: v.inlineCopy,
|
|
53
|
-
"data-copied": f || void 0,
|
|
54
|
-
"aria-label": f ? "Copied" : "Copy",
|
|
55
|
-
onClick: () => m(y.current?.textContent ?? ""),
|
|
56
|
-
children: /* @__PURE__ */ l(o, {
|
|
57
|
-
glyph: b,
|
|
58
|
-
size: 12,
|
|
59
|
-
strokeWidth: 2,
|
|
60
|
-
"aria-hidden": !0
|
|
61
|
-
})
|
|
62
|
-
})
|
|
63
|
-
] })
|
|
64
|
-
}),
|
|
65
|
-
"data-imf-ui-component": "Code.Inline"
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
b.displayName = "Code.Inline";
|
|
70
|
-
function x({ className: e, kind: t = "external", children: n, render: i, ...d }) {
|
|
71
|
-
let f = t === "external" ? a : r;
|
|
72
|
-
return g({
|
|
73
|
-
defaultTagName: "a",
|
|
74
|
-
render: i,
|
|
75
|
-
props: {
|
|
76
|
-
...h(t === "external" ? {
|
|
77
|
-
target: "_blank",
|
|
78
|
-
rel: "noreferrer"
|
|
79
|
-
} : {}, d, {
|
|
80
|
-
className: s(v.inline, v.inlineLink, e),
|
|
81
|
-
children: /* @__PURE__ */ u(c, { children: [
|
|
82
|
-
n,
|
|
83
|
-
/* @__PURE__ */ l("span", { className: v.separator }),
|
|
84
|
-
/* @__PURE__ */ l("span", {
|
|
85
|
-
className: v.icon,
|
|
86
|
-
"aria-hidden": !0,
|
|
87
|
-
children: /* @__PURE__ */ l(o, {
|
|
88
|
-
glyph: f,
|
|
89
|
-
size: 12,
|
|
90
|
-
strokeWidth: 2
|
|
91
|
-
})
|
|
92
|
-
})
|
|
93
|
-
] })
|
|
94
|
-
}),
|
|
95
|
-
"data-imf-ui-component": "Code.InlineLink",
|
|
96
|
-
"data-kind": t
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
x.displayName = "Code.InlineLink";
|
|
101
|
-
function S({ className: e, language: t, hideCopy: r = !1, children: a, ...c }) {
|
|
102
|
-
let { copied: d, copy: f } = _(), m = p(null), h = d ? n : i;
|
|
103
|
-
return /* @__PURE__ */ u("div", {
|
|
104
|
-
"data-imf-ui-component": "Code.Block",
|
|
105
|
-
className: s(v.block, e),
|
|
106
|
-
children: [
|
|
107
|
-
t != null && /* @__PURE__ */ l("span", {
|
|
108
|
-
className: v.language,
|
|
109
|
-
children: t
|
|
110
|
-
}),
|
|
111
|
-
!r && /* @__PURE__ */ l("button", {
|
|
112
|
-
type: "button",
|
|
113
|
-
className: v.copy,
|
|
114
|
-
"data-copied": d || void 0,
|
|
115
|
-
"aria-label": d ? "Copied" : "Copy",
|
|
116
|
-
onClick: () => f(m.current?.textContent ?? ""),
|
|
117
|
-
children: /* @__PURE__ */ l(o, {
|
|
118
|
-
glyph: h,
|
|
119
|
-
size: 12,
|
|
120
|
-
strokeWidth: 2,
|
|
121
|
-
"aria-hidden": !0
|
|
122
|
-
})
|
|
123
|
-
}),
|
|
124
|
-
/* @__PURE__ */ l("pre", {
|
|
125
|
-
...c,
|
|
126
|
-
className: v.pre,
|
|
127
|
-
children: /* @__PURE__ */ l("code", {
|
|
128
|
-
ref: m,
|
|
129
|
-
children: a
|
|
130
|
-
})
|
|
131
|
-
})
|
|
132
|
-
]
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
S.displayName = "Code.Block";
|
|
136
|
-
//#endregion
|
|
137
|
-
//#region src/components/code/code.meta.ts
|
|
138
|
-
var C = {
|
|
139
|
-
name: "Code",
|
|
140
|
-
category: t.display,
|
|
141
|
-
status: "stable",
|
|
142
|
-
namespace: !0,
|
|
143
|
-
description: "Displays source code inline or in a block, with optional language labels and copying. Also called a code snippet or code block.",
|
|
144
|
-
origin: "native"
|
|
145
|
-
};
|
|
146
|
-
//#endregion
|
|
147
|
-
export { y as a, x as i, S as n, _ as o, b as r, C as t };
|