@imfusion/web-ui 0.6.1-dev.15.g96aa499b → 0.6.1-dev.20.g3845eed7
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.
|
@@ -13,6 +13,7 @@ type UpstreamPositioner = React.ComponentProps<typeof ToastPrimitive.Positioner>
|
|
|
13
13
|
type UpstreamArrow = React.ComponentProps<typeof ToastPrimitive.Arrow>;
|
|
14
14
|
declare const toastViewport: (props?: ({
|
|
15
15
|
position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | null | undefined;
|
|
16
|
+
width?: "content" | "default" | "compact" | "wide" | null | undefined;
|
|
16
17
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
17
18
|
declare const toastRoot: (props?: ({
|
|
18
19
|
variant?: "warning" | "info" | "neutral" | "success" | "error" | null | undefined;
|
|
@@ -62,6 +63,8 @@ export declare namespace Portal {
|
|
|
62
63
|
type ViewportProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className"> & {
|
|
63
64
|
/** Which edge or corner of the screen the stack anchors to. */
|
|
64
65
|
position?: VariantProps<typeof toastViewport>["position"];
|
|
66
|
+
/** Width treatment for the toast stack. */
|
|
67
|
+
width?: VariantProps<typeof toastViewport>["width"];
|
|
65
68
|
className?: UpstreamViewport["className"];
|
|
66
69
|
render?: UpstreamViewport["render"];
|
|
67
70
|
};
|
|
@@ -70,7 +73,7 @@ type ViewportProps = Omit<React.HTMLAttributes<HTMLDivElement>, "className"> & {
|
|
|
70
73
|
* expands the collapsed toasts; it ignores pointer events except on the toasts
|
|
71
74
|
* themselves so the app underneath stays clickable.
|
|
72
75
|
*/
|
|
73
|
-
export declare function Viewport({ className, position, ...props }: ViewportProps): import("react/jsx-runtime").JSX.Element;
|
|
76
|
+
export declare function Viewport({ className, position, width, ...props }: ViewportProps): import("react/jsx-runtime").JSX.Element;
|
|
74
77
|
export declare namespace Viewport {
|
|
75
78
|
var displayName: string;
|
|
76
79
|
}
|
package/dist/index.js
CHANGED
|
@@ -2308,7 +2308,11 @@ var ja = {
|
|
|
2308
2308
|
variantInfo: "imf-ui-toast-module-variantInfo",
|
|
2309
2309
|
variantSuccess: "imf-ui-toast-module-variantSuccess",
|
|
2310
2310
|
variantWarning: "imf-ui-toast-module-variantWarning",
|
|
2311
|
-
viewport: "imf-ui-toast-module-viewport"
|
|
2311
|
+
viewport: "imf-ui-toast-module-viewport",
|
|
2312
|
+
widthCompact: "imf-ui-toast-module-widthCompact",
|
|
2313
|
+
widthContent: "imf-ui-toast-module-widthContent",
|
|
2314
|
+
widthDefault: "imf-ui-toast-module-widthDefault",
|
|
2315
|
+
widthWide: "imf-ui-toast-module-widthWide"
|
|
2312
2316
|
}, Na = /* @__PURE__ */ e({
|
|
2313
2317
|
Action: () => eo,
|
|
2314
2318
|
Arrow: () => no,
|
|
@@ -2324,15 +2328,26 @@ var ja = {
|
|
|
2324
2328
|
createToastManager: () => Ga,
|
|
2325
2329
|
useToastManager: () => Wa
|
|
2326
2330
|
}), Pa = h(Y.portal), Fa = h(Y.viewport, {
|
|
2327
|
-
variants: {
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2331
|
+
variants: {
|
|
2332
|
+
position: {
|
|
2333
|
+
"top-left": Y.positionTopLeft,
|
|
2334
|
+
"top-center": Y.positionTopCenter,
|
|
2335
|
+
"top-right": Y.positionTopRight,
|
|
2336
|
+
"bottom-left": Y.positionBottomLeft,
|
|
2337
|
+
"bottom-center": Y.positionBottomCenter,
|
|
2338
|
+
"bottom-right": Y.positionBottomRight
|
|
2339
|
+
},
|
|
2340
|
+
width: {
|
|
2341
|
+
compact: Y.widthCompact,
|
|
2342
|
+
default: Y.widthDefault,
|
|
2343
|
+
wide: Y.widthWide,
|
|
2344
|
+
content: Y.widthContent
|
|
2345
|
+
}
|
|
2346
|
+
},
|
|
2347
|
+
defaultVariants: {
|
|
2348
|
+
position: "bottom-center",
|
|
2349
|
+
width: "default"
|
|
2350
|
+
}
|
|
2336
2351
|
}), Ia = h(Y.root, {
|
|
2337
2352
|
variants: { variant: {
|
|
2338
2353
|
neutral: null,
|
|
@@ -2359,13 +2374,14 @@ function qa({ className: e, ...t }) {
|
|
|
2359
2374
|
});
|
|
2360
2375
|
}
|
|
2361
2376
|
qa.displayName = "Toast.Portal";
|
|
2362
|
-
function Ja({ className: e, position: t = "bottom-center",
|
|
2377
|
+
function Ja({ className: e, position: t = "bottom-center", width: n = "default", ...r }) {
|
|
2363
2378
|
return /* @__PURE__ */ _(T.Viewport, {
|
|
2364
|
-
...
|
|
2379
|
+
...r,
|
|
2365
2380
|
"data-imf-ui-component": "Toast.Viewport",
|
|
2366
|
-
className: (
|
|
2381
|
+
className: (r) => Fa({
|
|
2367
2382
|
position: t,
|
|
2368
|
-
|
|
2383
|
+
width: n,
|
|
2384
|
+
className: typeof e == "function" ? e(r) : e
|
|
2369
2385
|
})
|
|
2370
2386
|
});
|
|
2371
2387
|
}
|
|
@@ -23,6 +23,30 @@ declare const LANGUAGE_DEFINITIONS: {
|
|
|
23
23
|
readonly cmake: {
|
|
24
24
|
readonly aliases: readonly [];
|
|
25
25
|
};
|
|
26
|
+
readonly html: {
|
|
27
|
+
readonly aliases: readonly ["htm", "xml", "angular-html"];
|
|
28
|
+
};
|
|
29
|
+
readonly js: {
|
|
30
|
+
readonly aliases: readonly ["javascript", "mjs", "cjs", "js-vue"];
|
|
31
|
+
};
|
|
32
|
+
readonly jsx: {
|
|
33
|
+
readonly aliases: readonly [];
|
|
34
|
+
};
|
|
35
|
+
readonly markdown: {
|
|
36
|
+
readonly aliases: readonly ["md"];
|
|
37
|
+
};
|
|
38
|
+
readonly yaml: {
|
|
39
|
+
readonly aliases: readonly ["yml"];
|
|
40
|
+
};
|
|
41
|
+
readonly sql: {
|
|
42
|
+
readonly aliases: readonly [];
|
|
43
|
+
};
|
|
44
|
+
readonly dockerfile: {
|
|
45
|
+
readonly aliases: readonly [];
|
|
46
|
+
};
|
|
47
|
+
readonly toml: {
|
|
48
|
+
readonly aliases: readonly [];
|
|
49
|
+
};
|
|
26
50
|
};
|
|
27
51
|
export declare const SUPPORTED_LANGUAGES: string[];
|
|
28
52
|
type CanonicalLanguage = keyof typeof LANGUAGE_DEFINITIONS;
|
|
@@ -5,14 +5,22 @@ import { jsx as a } from "react/jsx-runtime";
|
|
|
5
5
|
import { cloneElement as o, useMemo as s } from "react";
|
|
6
6
|
import { createHighlighter as c, defineLanguage as l, renderNodesToHtml as u, renderTokens as d } from "@tanstack/highlight/core";
|
|
7
7
|
import { css as f } from "@tanstack/highlight/languages/css";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
8
|
+
import { dockerfile as p } from "@tanstack/highlight/languages/dockerfile";
|
|
9
|
+
import { html as m } from "@tanstack/highlight/languages/html";
|
|
10
|
+
import { js as h } from "@tanstack/highlight/languages/js";
|
|
11
|
+
import { jsx as g } from "@tanstack/highlight/languages/jsx";
|
|
12
|
+
import { json as _ } from "@tanstack/highlight/languages/json";
|
|
13
|
+
import { markdown as v } from "@tanstack/highlight/languages/markdown";
|
|
14
|
+
import { plaintext as y } from "@tanstack/highlight/languages/plaintext";
|
|
15
|
+
import { shell as b } from "@tanstack/highlight/languages/shell";
|
|
16
|
+
import { sql as x } from "@tanstack/highlight/languages/sql";
|
|
17
|
+
import { toml as S } from "@tanstack/highlight/languages/toml";
|
|
18
|
+
import { ts as C } from "@tanstack/highlight/languages/ts";
|
|
19
|
+
import { tsx as w } from "@tanstack/highlight/languages/tsx";
|
|
20
|
+
import { yaml as T } from "@tanstack/highlight/languages/yaml";
|
|
21
|
+
import { python as E } from "@tanstack/highlight/languages/python";
|
|
14
22
|
//#region src/integrations/code-highlight/language-patterns.ts
|
|
15
|
-
function
|
|
23
|
+
function D(e, t, n = []) {
|
|
16
24
|
let r = [], i = new Uint8Array(e.length);
|
|
17
25
|
for (let { start: e, end: t } of n) i.fill(1, e, t);
|
|
18
26
|
for (let n of t) {
|
|
@@ -42,7 +50,7 @@ function y(e, t, n = []) {
|
|
|
42
50
|
}
|
|
43
51
|
//#endregion
|
|
44
52
|
//#region src/integrations/code-highlight/languages/cmake.ts
|
|
45
|
-
var
|
|
53
|
+
var O = [
|
|
46
54
|
{
|
|
47
55
|
className: "string",
|
|
48
56
|
regex: /"(?:\\.|[^"\\\n])*"|\[(=*)\[[\s\S]*?\]\1\]/g
|
|
@@ -75,12 +83,12 @@ var b = [
|
|
|
75
83
|
className: "operator",
|
|
76
84
|
regex: /(?:LESS_EQUAL|GREATER_EQUAL|STREQUAL|IN_LIST|MATCHES|EQUAL|LESS|GREATER|AND|OR|NOT|[=<>+*/!-])/gi
|
|
77
85
|
}
|
|
78
|
-
],
|
|
86
|
+
], k = l({
|
|
79
87
|
name: "cmake",
|
|
80
88
|
tokenize(e) {
|
|
81
|
-
return
|
|
89
|
+
return D(e, O);
|
|
82
90
|
}
|
|
83
|
-
}),
|
|
91
|
+
}), A = [
|
|
84
92
|
{
|
|
85
93
|
className: "comment",
|
|
86
94
|
regex: /\/\/[^\n]*|\/\*[\s\S]*?\*\//g
|
|
@@ -117,7 +125,7 @@ var b = [
|
|
|
117
125
|
className: "operator",
|
|
118
126
|
regex: /(?:<<=?|>>=?|->\*|->|\+\+|--|&&|\|\||==|!=|<=|>=|::|\+=|-=|\*=|\/=|%=|&=|\|=|\^=|[-+*/%=&|^!<>?:~])/g
|
|
119
127
|
}
|
|
120
|
-
],
|
|
128
|
+
], j = l({
|
|
121
129
|
name: "cpp",
|
|
122
130
|
aliases: [
|
|
123
131
|
"c++",
|
|
@@ -126,19 +134,19 @@ var b = [
|
|
|
126
134
|
"hpp"
|
|
127
135
|
],
|
|
128
136
|
tokenize(e) {
|
|
129
|
-
return
|
|
137
|
+
return D(e, A);
|
|
130
138
|
}
|
|
131
|
-
}),
|
|
139
|
+
}), M = [{
|
|
132
140
|
className: "function",
|
|
133
141
|
regex: /\b[A-Za-z_]\w*(?=\s*\()/g
|
|
134
|
-
}],
|
|
142
|
+
}], N = l({
|
|
135
143
|
name: "python",
|
|
136
144
|
aliases: ["py"],
|
|
137
145
|
tokenize(e, t) {
|
|
138
|
-
let n =
|
|
146
|
+
let n = E.tokenize(e, t), r = D(e, M, n);
|
|
139
147
|
return [...n, ...r];
|
|
140
148
|
}
|
|
141
|
-
}),
|
|
149
|
+
}), P = {
|
|
142
150
|
tsx: { aliases: ["typescriptreact"] },
|
|
143
151
|
ts: { aliases: ["typescript"] },
|
|
144
152
|
css: { aliases: ["scss"] },
|
|
@@ -156,68 +164,93 @@ var b = [
|
|
|
156
164
|
"hpp"
|
|
157
165
|
] },
|
|
158
166
|
python: { aliases: ["py"] },
|
|
159
|
-
cmake: { aliases: [] }
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
167
|
+
cmake: { aliases: [] },
|
|
168
|
+
html: { aliases: [
|
|
169
|
+
"htm",
|
|
170
|
+
"xml",
|
|
171
|
+
"angular-html"
|
|
172
|
+
] },
|
|
173
|
+
js: { aliases: [
|
|
174
|
+
"javascript",
|
|
175
|
+
"mjs",
|
|
176
|
+
"cjs",
|
|
177
|
+
"js-vue"
|
|
178
|
+
] },
|
|
179
|
+
jsx: { aliases: [] },
|
|
180
|
+
markdown: { aliases: ["md"] },
|
|
181
|
+
yaml: { aliases: ["yml"] },
|
|
182
|
+
sql: { aliases: [] },
|
|
183
|
+
dockerfile: { aliases: [] },
|
|
184
|
+
toml: { aliases: [] }
|
|
185
|
+
}, F = Object.keys(P), I = [...F, ...Object.values(P).flatMap(({ aliases: e }) => e)];
|
|
186
|
+
function L(e) {
|
|
187
|
+
return I.includes(e);
|
|
163
188
|
}
|
|
164
|
-
function
|
|
189
|
+
function R(e, t) {
|
|
165
190
|
return e.aliases.includes(t);
|
|
166
191
|
}
|
|
167
|
-
function
|
|
168
|
-
for (let [t, n] of Object.entries(
|
|
192
|
+
function z(e) {
|
|
193
|
+
for (let [t, n] of Object.entries(P)) if (R(n, e)) return t;
|
|
169
194
|
return e;
|
|
170
195
|
}
|
|
171
|
-
var
|
|
196
|
+
var B = c({
|
|
172
197
|
languages: [
|
|
173
|
-
|
|
174
|
-
|
|
198
|
+
w,
|
|
199
|
+
C,
|
|
175
200
|
f,
|
|
201
|
+
b,
|
|
202
|
+
_,
|
|
203
|
+
j,
|
|
204
|
+
N,
|
|
205
|
+
k,
|
|
206
|
+
m,
|
|
176
207
|
h,
|
|
177
|
-
|
|
178
|
-
|
|
208
|
+
g,
|
|
209
|
+
v,
|
|
179
210
|
T,
|
|
180
211
|
x,
|
|
181
|
-
|
|
212
|
+
p,
|
|
213
|
+
S,
|
|
214
|
+
y
|
|
182
215
|
],
|
|
183
216
|
fallbackLanguage: "plaintext"
|
|
184
217
|
});
|
|
185
|
-
function
|
|
186
|
-
let n =
|
|
218
|
+
function V(e, t) {
|
|
219
|
+
let n = z(t), { tokens: r } = B.tokenize(e, { lang: n });
|
|
187
220
|
return u(d(r));
|
|
188
221
|
}
|
|
189
222
|
//#endregion
|
|
190
223
|
//#region src/integrations/code-highlight/code-highlight.tsx
|
|
191
|
-
var
|
|
192
|
-
Block: () =>
|
|
193
|
-
Inline: () =>
|
|
224
|
+
var H = /* @__PURE__ */ e({
|
|
225
|
+
Block: () => W,
|
|
226
|
+
Inline: () => G,
|
|
194
227
|
InlineLink: () => n
|
|
195
228
|
});
|
|
196
|
-
function
|
|
229
|
+
function U(e, t) {
|
|
197
230
|
return s(() => {
|
|
198
|
-
if (!(t == null || e === "")) return /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html:
|
|
231
|
+
if (!(t == null || e === "")) return /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html: V(e, t) } });
|
|
199
232
|
}, [e, t]);
|
|
200
233
|
}
|
|
201
|
-
function
|
|
202
|
-
let i =
|
|
234
|
+
function W({ language: e, children: t, ...n }) {
|
|
235
|
+
let i = U(t, e);
|
|
203
236
|
return o(/* @__PURE__ */ a(r, {
|
|
204
237
|
...n,
|
|
205
238
|
language: e,
|
|
206
239
|
children: t
|
|
207
240
|
}), { children: i ?? t });
|
|
208
241
|
}
|
|
209
|
-
|
|
210
|
-
function
|
|
211
|
-
let r =
|
|
242
|
+
W.displayName = "Code.Block";
|
|
243
|
+
function G({ language: e, children: t, ...n }) {
|
|
244
|
+
let r = U(t, e);
|
|
212
245
|
return o(/* @__PURE__ */ a(i, {
|
|
213
246
|
...n,
|
|
214
247
|
children: t
|
|
215
248
|
}), { children: r ?? t });
|
|
216
249
|
}
|
|
217
|
-
|
|
250
|
+
G.displayName = "Code.Inline";
|
|
218
251
|
//#endregion
|
|
219
252
|
//#region src/integrations/code-highlight/code-highlight.meta.ts
|
|
220
|
-
var
|
|
253
|
+
var K = {
|
|
221
254
|
name: "CodeHighlight",
|
|
222
255
|
category: t.display,
|
|
223
256
|
status: "experimental",
|
|
@@ -233,4 +266,4 @@ var R = {
|
|
|
233
266
|
}
|
|
234
267
|
};
|
|
235
268
|
//#endregion
|
|
236
|
-
export {
|
|
269
|
+
export { H as Code, F as SUPPORTED_LANGUAGES, K as codeHighlightMeta, L as isSupportedLanguage };
|