@imfusion/web-ui 0.11.1-dev.83.g3251cc92 → 0.11.1-dev.87.g55c5e1df
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/CHANGELOG.md +7 -0
- package/dist/code-BtxeEf9P.js +185 -0
- package/dist/components/code/code.d.ts +25 -2
- package/dist/components/code/text-of.d.ts +3 -0
- package/dist/components/rich-link/rich-link.d.ts +3 -1
- package/dist/index.js +6 -5
- 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 +178 -3
- package/dist/code-72NzL5Cp.js +0 -139
package/package.json
CHANGED
package/src/docgen/doc.gen.json
CHANGED
|
@@ -2219,15 +2219,36 @@
|
|
|
2219
2219
|
},
|
|
2220
2220
|
{
|
|
2221
2221
|
"name": "Code.Inline",
|
|
2222
|
-
"description": "Code.Inline — an inline code fragment (a `<code>` chip) for use inside running\ntext. `Typo.InlineCode` renders this under the hood so inline-code chrome is\ndefined in one place. The copy button copies the rendered text.",
|
|
2222
|
+
"description": "Code.Inline — an inline code fragment (a `<code>` chip) for use inside running\ntext. `Typo.InlineCode` renders this under the hood so inline-code chrome is\ndefined in one place. The copy button copies the rendered text.\n\nWith `concealable`, the content is replaced by a hatched placeholder until the\neye button reveals it. A chip without content shows the placeholder with a\npulse, so a consumer can reveal before the value has loaded.",
|
|
2223
2223
|
"props": [
|
|
2224
2224
|
{
|
|
2225
2225
|
"name": "children",
|
|
2226
|
-
"required":
|
|
2226
|
+
"required": false,
|
|
2227
2227
|
"type": "ReactNode",
|
|
2228
2228
|
"defaultValue": null,
|
|
2229
2229
|
"description": "Code content shown in the chip. The copy button copies its rendered text."
|
|
2230
2230
|
},
|
|
2231
|
+
{
|
|
2232
|
+
"name": "concealable",
|
|
2233
|
+
"required": false,
|
|
2234
|
+
"type": "boolean",
|
|
2235
|
+
"defaultValue": "false",
|
|
2236
|
+
"description": "Show an eye button at the start that hides the content until it is pressed."
|
|
2237
|
+
},
|
|
2238
|
+
{
|
|
2239
|
+
"name": "concealed",
|
|
2240
|
+
"required": false,
|
|
2241
|
+
"type": "boolean",
|
|
2242
|
+
"defaultValue": null,
|
|
2243
|
+
"description": "Whether the content is hidden. Needs `concealable`. Pass it with `onConcealedChange` to control the chip."
|
|
2244
|
+
},
|
|
2245
|
+
{
|
|
2246
|
+
"name": "concealedLength",
|
|
2247
|
+
"required": false,
|
|
2248
|
+
"type": "number",
|
|
2249
|
+
"defaultValue": "8",
|
|
2250
|
+
"description": "Width in characters of the hidden placeholder when there is no text to measure."
|
|
2251
|
+
},
|
|
2231
2252
|
{
|
|
2232
2253
|
"name": "copyable",
|
|
2233
2254
|
"required": false,
|
|
@@ -2235,6 +2256,27 @@
|
|
|
2235
2256
|
"defaultValue": "false",
|
|
2236
2257
|
"description": "Show a small copy button on the right, behind a hairline separator."
|
|
2237
2258
|
},
|
|
2259
|
+
{
|
|
2260
|
+
"name": "copyConcealed",
|
|
2261
|
+
"required": false,
|
|
2262
|
+
"type": "boolean",
|
|
2263
|
+
"defaultValue": "false",
|
|
2264
|
+
"description": "Keep the copy button enabled while the content is hidden. It copies the text read from `children` without revealing it,\nso it needs text children: a component child copies nothing until revealed."
|
|
2265
|
+
},
|
|
2266
|
+
{
|
|
2267
|
+
"name": "defaultConcealed",
|
|
2268
|
+
"required": false,
|
|
2269
|
+
"type": "boolean",
|
|
2270
|
+
"defaultValue": "true",
|
|
2271
|
+
"description": "Starting value of an uncontrolled chip."
|
|
2272
|
+
},
|
|
2273
|
+
{
|
|
2274
|
+
"name": "onConcealedChange",
|
|
2275
|
+
"required": false,
|
|
2276
|
+
"type": "(concealed: boolean) => void",
|
|
2277
|
+
"defaultValue": null,
|
|
2278
|
+
"description": "Called with the new value when the eye button is pressed."
|
|
2279
|
+
},
|
|
2238
2280
|
{
|
|
2239
2281
|
"name": "ref",
|
|
2240
2282
|
"required": false,
|
|
@@ -2248,6 +2290,20 @@
|
|
|
2248
2290
|
"type": "| ReactElement<\n unknown,\n string | JSXElementConstructor<any>\n >\n| ComponentRenderFn<HTMLProps, {}>",
|
|
2249
2291
|
"defaultValue": null,
|
|
2250
2292
|
"description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
|
|
2293
|
+
},
|
|
2294
|
+
{
|
|
2295
|
+
"name": "size",
|
|
2296
|
+
"required": false,
|
|
2297
|
+
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
2298
|
+
"defaultValue": "sm",
|
|
2299
|
+
"description": "Height and type scale of the chip."
|
|
2300
|
+
},
|
|
2301
|
+
{
|
|
2302
|
+
"name": "toggleLabel",
|
|
2303
|
+
"required": false,
|
|
2304
|
+
"type": "string",
|
|
2305
|
+
"defaultValue": "Show",
|
|
2306
|
+
"description": "Accessible name of the eye button; `aria-pressed` tells whether the content is shown."
|
|
2251
2307
|
}
|
|
2252
2308
|
]
|
|
2253
2309
|
},
|
|
@@ -11030,6 +11086,13 @@
|
|
|
11030
11086
|
"type": "Ref<HTMLAnchorElement>",
|
|
11031
11087
|
"defaultValue": null,
|
|
11032
11088
|
"description": "Allows getting a ref to the component instance.\nOnce the component unmounts, React will set `ref.current` to `null`\n(or call the ref with `null` if you passed a callback ref).\n@see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs}"
|
|
11089
|
+
},
|
|
11090
|
+
{
|
|
11091
|
+
"name": "size",
|
|
11092
|
+
"required": false,
|
|
11093
|
+
"type": "\"sm\" | \"md\"",
|
|
11094
|
+
"defaultValue": "md",
|
|
11095
|
+
"description": "Row density. `\"md\"` is the default row; `\"sm\"` tightens the padding, tile, and gap for dense lists."
|
|
11033
11096
|
}
|
|
11034
11097
|
]
|
|
11035
11098
|
},
|
|
@@ -15705,11 +15768,32 @@
|
|
|
15705
15768
|
"props": [
|
|
15706
15769
|
{
|
|
15707
15770
|
"name": "children",
|
|
15708
|
-
"required":
|
|
15771
|
+
"required": false,
|
|
15709
15772
|
"type": "ReactNode",
|
|
15710
15773
|
"defaultValue": null,
|
|
15711
15774
|
"description": "Code content shown in the chip. The copy button copies its rendered text."
|
|
15712
15775
|
},
|
|
15776
|
+
{
|
|
15777
|
+
"name": "concealable",
|
|
15778
|
+
"required": false,
|
|
15779
|
+
"type": "boolean",
|
|
15780
|
+
"defaultValue": "false",
|
|
15781
|
+
"description": "Show an eye button at the start that hides the content until it is pressed."
|
|
15782
|
+
},
|
|
15783
|
+
{
|
|
15784
|
+
"name": "concealed",
|
|
15785
|
+
"required": false,
|
|
15786
|
+
"type": "boolean",
|
|
15787
|
+
"defaultValue": null,
|
|
15788
|
+
"description": "Whether the content is hidden. Needs `concealable`. Pass it with `onConcealedChange` to control the chip."
|
|
15789
|
+
},
|
|
15790
|
+
{
|
|
15791
|
+
"name": "concealedLength",
|
|
15792
|
+
"required": false,
|
|
15793
|
+
"type": "number",
|
|
15794
|
+
"defaultValue": "8",
|
|
15795
|
+
"description": "Width in characters of the hidden placeholder when there is no text to measure."
|
|
15796
|
+
},
|
|
15713
15797
|
{
|
|
15714
15798
|
"name": "copyable",
|
|
15715
15799
|
"required": false,
|
|
@@ -15717,6 +15801,27 @@
|
|
|
15717
15801
|
"defaultValue": "false",
|
|
15718
15802
|
"description": "Show a small copy button on the right, behind a hairline separator."
|
|
15719
15803
|
},
|
|
15804
|
+
{
|
|
15805
|
+
"name": "copyConcealed",
|
|
15806
|
+
"required": false,
|
|
15807
|
+
"type": "boolean",
|
|
15808
|
+
"defaultValue": "false",
|
|
15809
|
+
"description": "Keep the copy button enabled while the content is hidden. It copies the text read from `children` without revealing it,\nso it needs text children: a component child copies nothing until revealed."
|
|
15810
|
+
},
|
|
15811
|
+
{
|
|
15812
|
+
"name": "defaultConcealed",
|
|
15813
|
+
"required": false,
|
|
15814
|
+
"type": "boolean",
|
|
15815
|
+
"defaultValue": "true",
|
|
15816
|
+
"description": "Starting value of an uncontrolled chip."
|
|
15817
|
+
},
|
|
15818
|
+
{
|
|
15819
|
+
"name": "onConcealedChange",
|
|
15820
|
+
"required": false,
|
|
15821
|
+
"type": "(concealed: boolean) => void",
|
|
15822
|
+
"defaultValue": null,
|
|
15823
|
+
"description": "Called with the new value when the eye button is pressed."
|
|
15824
|
+
},
|
|
15720
15825
|
{
|
|
15721
15826
|
"name": "ref",
|
|
15722
15827
|
"required": false,
|
|
@@ -15730,6 +15835,20 @@
|
|
|
15730
15835
|
"type": "| ReactElement<\n unknown,\n string | JSXElementConstructor<any>\n >\n| ComponentRenderFn<HTMLProps, {}>",
|
|
15731
15836
|
"defaultValue": null,
|
|
15732
15837
|
"description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
|
|
15838
|
+
},
|
|
15839
|
+
{
|
|
15840
|
+
"name": "size",
|
|
15841
|
+
"required": false,
|
|
15842
|
+
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
15843
|
+
"defaultValue": "sm",
|
|
15844
|
+
"description": "Height and type scale of the chip."
|
|
15845
|
+
},
|
|
15846
|
+
{
|
|
15847
|
+
"name": "toggleLabel",
|
|
15848
|
+
"required": false,
|
|
15849
|
+
"type": "string",
|
|
15850
|
+
"defaultValue": "Show",
|
|
15851
|
+
"description": "Accessible name of the eye button; `aria-pressed` tells whether the content is shown."
|
|
15733
15852
|
}
|
|
15734
15853
|
]
|
|
15735
15854
|
},
|
|
@@ -16005,6 +16124,27 @@
|
|
|
16005
16124
|
"defaultValue": null,
|
|
16006
16125
|
"description": "Grammar used to tokenize the fragment. Purely visual — the chip shows no language label. Omit for plain text."
|
|
16007
16126
|
},
|
|
16127
|
+
{
|
|
16128
|
+
"name": "concealable",
|
|
16129
|
+
"required": false,
|
|
16130
|
+
"type": "boolean",
|
|
16131
|
+
"defaultValue": "false",
|
|
16132
|
+
"description": "Show an eye button at the start that hides the content until it is pressed."
|
|
16133
|
+
},
|
|
16134
|
+
{
|
|
16135
|
+
"name": "concealed",
|
|
16136
|
+
"required": false,
|
|
16137
|
+
"type": "boolean",
|
|
16138
|
+
"defaultValue": null,
|
|
16139
|
+
"description": "Whether the content is hidden. Needs `concealable`. Pass it with `onConcealedChange` to control the chip."
|
|
16140
|
+
},
|
|
16141
|
+
{
|
|
16142
|
+
"name": "concealedLength",
|
|
16143
|
+
"required": false,
|
|
16144
|
+
"type": "number",
|
|
16145
|
+
"defaultValue": "8",
|
|
16146
|
+
"description": "Width in characters of the hidden placeholder when there is no text to measure."
|
|
16147
|
+
},
|
|
16008
16148
|
{
|
|
16009
16149
|
"name": "copyable",
|
|
16010
16150
|
"required": false,
|
|
@@ -16012,6 +16152,20 @@
|
|
|
16012
16152
|
"defaultValue": "false",
|
|
16013
16153
|
"description": "Show a small copy button on the right, behind a hairline separator."
|
|
16014
16154
|
},
|
|
16155
|
+
{
|
|
16156
|
+
"name": "copyConcealed",
|
|
16157
|
+
"required": false,
|
|
16158
|
+
"type": "boolean",
|
|
16159
|
+
"defaultValue": "false",
|
|
16160
|
+
"description": "Keep the copy button enabled while the content is hidden. It copies the text read from `children` without revealing it,\nso it needs text children: a component child copies nothing until revealed."
|
|
16161
|
+
},
|
|
16162
|
+
{
|
|
16163
|
+
"name": "defaultConcealed",
|
|
16164
|
+
"required": false,
|
|
16165
|
+
"type": "boolean",
|
|
16166
|
+
"defaultValue": "true",
|
|
16167
|
+
"description": "Starting value of an uncontrolled chip."
|
|
16168
|
+
},
|
|
16015
16169
|
{
|
|
16016
16170
|
"name": "language",
|
|
16017
16171
|
"required": false,
|
|
@@ -16019,6 +16173,13 @@
|
|
|
16019
16173
|
"defaultValue": null,
|
|
16020
16174
|
"description": ""
|
|
16021
16175
|
},
|
|
16176
|
+
{
|
|
16177
|
+
"name": "onConcealedChange",
|
|
16178
|
+
"required": false,
|
|
16179
|
+
"type": "(concealed: boolean) => void",
|
|
16180
|
+
"defaultValue": null,
|
|
16181
|
+
"description": "Called with the new value when the eye button is pressed."
|
|
16182
|
+
},
|
|
16022
16183
|
{
|
|
16023
16184
|
"name": "ref",
|
|
16024
16185
|
"required": false,
|
|
@@ -16032,6 +16193,20 @@
|
|
|
16032
16193
|
"type": "| ReactElement<\n unknown,\n string | JSXElementConstructor<any>\n >\n| ComponentRenderFn<HTMLProps, {}>",
|
|
16033
16194
|
"defaultValue": null,
|
|
16034
16195
|
"description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."
|
|
16196
|
+
},
|
|
16197
|
+
{
|
|
16198
|
+
"name": "size",
|
|
16199
|
+
"required": false,
|
|
16200
|
+
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
16201
|
+
"defaultValue": "sm",
|
|
16202
|
+
"description": "Height and type scale of the chip."
|
|
16203
|
+
},
|
|
16204
|
+
{
|
|
16205
|
+
"name": "toggleLabel",
|
|
16206
|
+
"required": false,
|
|
16207
|
+
"type": "string",
|
|
16208
|
+
"defaultValue": "Show",
|
|
16209
|
+
"description": "Accessible name of the eye button; `aria-pressed` tells whether the content is shown."
|
|
16035
16210
|
}
|
|
16036
16211
|
]
|
|
16037
16212
|
},
|
package/dist/code-72NzL5Cp.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { Xo as t, ja as n, vM as r } from "./icons-CMetKl2x.js";
|
|
3
|
-
import { t as i } from "./meta-V_KyLeGn.js";
|
|
4
|
-
import { a, i as o, n as s, o as c, s as l } from "./scroll-area-CXQ_SxPX.js";
|
|
5
|
-
import { cx as u } from "class-variance-authority";
|
|
6
|
-
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
|
-
import { useCallback as m, useEffect as h, useRef as g, useState as _ } from "react";
|
|
8
|
-
import { useRender as v } from "@base-ui/react/use-render";
|
|
9
|
-
import { mergeProps as y } from "@base-ui/react/merge-props";
|
|
10
|
-
//#region src/hooks/use-clipboard.ts
|
|
11
|
-
function b({ timeout: e = 1500 } = {}) {
|
|
12
|
-
let [t, n] = _(!1), r = g(void 0);
|
|
13
|
-
return h(() => () => clearTimeout(r.current), []), {
|
|
14
|
-
copied: t,
|
|
15
|
-
copy: m((t) => {
|
|
16
|
-
navigator.clipboard.writeText(t).then(() => {
|
|
17
|
-
n(!0), clearTimeout(r.current), r.current = setTimeout(() => n(!1), e);
|
|
18
|
-
});
|
|
19
|
-
}, [e])
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
var x = {
|
|
23
|
-
block: "imf-ui-code-module-block",
|
|
24
|
-
copy: "imf-ui-code-module-copy",
|
|
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
|
-
}, S = /* @__PURE__ */ e({
|
|
32
|
-
Block: () => T,
|
|
33
|
-
Inline: () => C,
|
|
34
|
-
InlineLink: () => w
|
|
35
|
-
});
|
|
36
|
-
function C({ copyable: e = !1, children: i, render: a, ...o }) {
|
|
37
|
-
let { copied: s, copy: c } = b(), l = g(null), u = s ? n : t;
|
|
38
|
-
return v({
|
|
39
|
-
defaultTagName: "code",
|
|
40
|
-
render: a,
|
|
41
|
-
props: {
|
|
42
|
-
...y(o, {
|
|
43
|
-
className: x.inline,
|
|
44
|
-
children: /* @__PURE__ */ p(d, { children: [
|
|
45
|
-
/* @__PURE__ */ f("span", {
|
|
46
|
-
ref: l,
|
|
47
|
-
children: i
|
|
48
|
-
}),
|
|
49
|
-
e && /* @__PURE__ */ f("span", { className: x.separator }),
|
|
50
|
-
e && /* @__PURE__ */ f("button", {
|
|
51
|
-
type: "button",
|
|
52
|
-
className: x.inlineCopy,
|
|
53
|
-
"data-copied": s || void 0,
|
|
54
|
-
"aria-label": s ? "Copied" : "Copy",
|
|
55
|
-
onClick: () => c(l.current?.textContent ?? ""),
|
|
56
|
-
children: /* @__PURE__ */ f(r, {
|
|
57
|
-
glyph: u,
|
|
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
|
-
C.displayName = "Code.Inline";
|
|
70
|
-
function w({ kind: e = "external", ...t }) {
|
|
71
|
-
let n = e === "external" ? {
|
|
72
|
-
target: "_blank",
|
|
73
|
-
rel: "noreferrer"
|
|
74
|
-
} : {};
|
|
75
|
-
return v({
|
|
76
|
-
defaultTagName: "a",
|
|
77
|
-
render: t.render,
|
|
78
|
-
props: {
|
|
79
|
-
...y(n, t, {
|
|
80
|
-
className: u(x.inline, x.inlineLink, t.className),
|
|
81
|
-
children: t.children
|
|
82
|
-
}),
|
|
83
|
-
"data-imf-ui-component": "Code.InlineLink",
|
|
84
|
-
"data-kind": e
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
w.displayName = "Code.InlineLink";
|
|
89
|
-
function T({ className: e, language: i, hideCopy: d = !1, children: m, ...h }) {
|
|
90
|
-
let { copied: _, copy: v } = b(), y = g(null), S = _ ? n : t;
|
|
91
|
-
return /* @__PURE__ */ p("div", {
|
|
92
|
-
"data-imf-ui-component": "Code.Block",
|
|
93
|
-
className: u(x.block, e),
|
|
94
|
-
children: [
|
|
95
|
-
i != null && /* @__PURE__ */ f("span", {
|
|
96
|
-
className: x.language,
|
|
97
|
-
children: i
|
|
98
|
-
}),
|
|
99
|
-
!d && /* @__PURE__ */ f("button", {
|
|
100
|
-
type: "button",
|
|
101
|
-
className: x.copy,
|
|
102
|
-
"data-copied": _ || void 0,
|
|
103
|
-
"aria-label": _ ? "Copied" : "Copy",
|
|
104
|
-
onClick: () => v(y.current?.textContent ?? ""),
|
|
105
|
-
children: /* @__PURE__ */ f(r, {
|
|
106
|
-
glyph: S,
|
|
107
|
-
size: 12,
|
|
108
|
-
strokeWidth: 2,
|
|
109
|
-
"aria-hidden": !0
|
|
110
|
-
})
|
|
111
|
-
}),
|
|
112
|
-
/* @__PURE__ */ p(o, { children: [/* @__PURE__ */ f(l, { children: /* @__PURE__ */ f(s, { children: /* @__PURE__ */ f("pre", {
|
|
113
|
-
...h,
|
|
114
|
-
className: x.pre,
|
|
115
|
-
children: /* @__PURE__ */ f("code", {
|
|
116
|
-
ref: y,
|
|
117
|
-
children: m
|
|
118
|
-
})
|
|
119
|
-
}) }) }), /* @__PURE__ */ f(a, {
|
|
120
|
-
orientation: "horizontal",
|
|
121
|
-
children: /* @__PURE__ */ f(c, {})
|
|
122
|
-
})] })
|
|
123
|
-
]
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
T.displayName = "Code.Block";
|
|
127
|
-
//#endregion
|
|
128
|
-
//#region src/components/code/code.meta.ts
|
|
129
|
-
var E = {
|
|
130
|
-
name: "Code",
|
|
131
|
-
category: i.display,
|
|
132
|
-
status: "stable",
|
|
133
|
-
namespace: !0,
|
|
134
|
-
description: "Displays source code inline or in a block, with optional language labels and copying. Also called a code snippet or code block.",
|
|
135
|
-
origin: "native",
|
|
136
|
-
internalDependencies: ["ScrollArea"]
|
|
137
|
-
};
|
|
138
|
-
//#endregion
|
|
139
|
-
export { S as a, w as i, T as n, b as o, C as r, E as t };
|