@imfusion/web-ui 0.5.1-dev.52.gcaa229a7 → 0.5.1-dev.56.gcf89961f
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/README.md +16 -9
- package/dist/{chunk-DA_OvQe2.js → chunk-DmhlhrBa.js} +2 -2
- package/dist/code-Blo48PGr.js +136 -0
- package/dist/{icons-BhogvWBV.js → icons-wBmF0U2x.js} +4 -3
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1377 -12400
- package/dist/integrations/code-highlight.js +9 -9
- package/dist/integrations/image-display-options.js +68 -67
- package/dist/meta-CySnRuVp.js +21 -0
- package/dist/style.css +1 -1
- package/dist/tabs-CMKvMF4E.js +369 -0
- package/package.json +4 -2
- package/dist/code-BRy_lg-h.js +0 -135
- package/dist/meta-BwCupYyq.js +0 -64
- package/dist/tabs-CYqtw1q9.js +0 -3790
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
+
import { cva as t } from "class-variance-authority";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { Children as r } from "react";
|
|
5
|
+
import { Slider as i } from "@base-ui/react/slider";
|
|
6
|
+
import { Switch as a } from "@base-ui/react/switch";
|
|
7
|
+
import { Toggle as o } from "@base-ui/react/toggle";
|
|
8
|
+
import { ToggleGroup as s } from "@base-ui/react/toggle-group";
|
|
9
|
+
import { Tabs as c } from "@base-ui/react/tabs";
|
|
10
|
+
var l = {
|
|
11
|
+
control: "imf-ui-slider-module-control",
|
|
12
|
+
indicator: "imf-ui-slider-module-indicator",
|
|
13
|
+
label: "imf-ui-slider-module-label",
|
|
14
|
+
root: "imf-ui-slider-module-root",
|
|
15
|
+
thumb: "imf-ui-slider-module-thumb",
|
|
16
|
+
track: "imf-ui-slider-module-track",
|
|
17
|
+
value: "imf-ui-slider-module-value"
|
|
18
|
+
}, u = /* @__PURE__ */ e({
|
|
19
|
+
Control: () => x,
|
|
20
|
+
Indicator: () => C,
|
|
21
|
+
Label: () => y,
|
|
22
|
+
Root: () => v,
|
|
23
|
+
Thumb: () => w,
|
|
24
|
+
Track: () => S,
|
|
25
|
+
Value: () => b
|
|
26
|
+
}), d = t(l.root), f = t(l.label), p = t(l.value), m = t(l.control), h = t(l.track), g = t(l.indicator), _ = t(l.thumb);
|
|
27
|
+
function v({ value: e, defaultValue: t, onValueChange: r, onValueCommitted: a, min: o = 0, max: s = 100, step: c = 1, largeStep: l = 10, minStepsBetweenValues: u = 0, disabled: f = !1, orientation: p = "horizontal", name: m, form: h, locale: g, thumbAlignment: _ = "edge", thumbCollisionBehavior: v = "push", format: y, className: b, ...x }) {
|
|
28
|
+
return /* @__PURE__ */ n(i.Root, {
|
|
29
|
+
...x,
|
|
30
|
+
"data-imf-ui-component": "Slider.Root",
|
|
31
|
+
"data-orientation": p,
|
|
32
|
+
className: (e) => d({ className: typeof b == "function" ? b(e) : b }),
|
|
33
|
+
value: e,
|
|
34
|
+
defaultValue: t,
|
|
35
|
+
onValueChange: r,
|
|
36
|
+
onValueCommitted: a,
|
|
37
|
+
min: o,
|
|
38
|
+
max: s,
|
|
39
|
+
step: c,
|
|
40
|
+
largeStep: l,
|
|
41
|
+
minStepsBetweenValues: u,
|
|
42
|
+
disabled: f,
|
|
43
|
+
orientation: p,
|
|
44
|
+
name: m,
|
|
45
|
+
form: h,
|
|
46
|
+
locale: g,
|
|
47
|
+
thumbAlignment: _,
|
|
48
|
+
thumbCollisionBehavior: v,
|
|
49
|
+
format: y,
|
|
50
|
+
children: x.children
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
v.displayName = "Slider.Root";
|
|
54
|
+
function y({ className: e, ...t }) {
|
|
55
|
+
return /* @__PURE__ */ n(i.Label, {
|
|
56
|
+
...t,
|
|
57
|
+
"data-imf-ui-component": "Slider.Label",
|
|
58
|
+
className: (t) => f({ className: typeof e == "function" ? e(t) : e }),
|
|
59
|
+
children: t.children
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
y.displayName = "Slider.Label";
|
|
63
|
+
function b({ className: e, children: t, ...r }) {
|
|
64
|
+
return /* @__PURE__ */ n(i.Value, {
|
|
65
|
+
...r,
|
|
66
|
+
"data-imf-ui-component": "Slider.Value",
|
|
67
|
+
className: (t) => p({ className: typeof e == "function" ? e(t) : e }),
|
|
68
|
+
children: t
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
b.displayName = "Slider.Value";
|
|
72
|
+
function x({ className: e, ...t }) {
|
|
73
|
+
return /* @__PURE__ */ n(i.Control, {
|
|
74
|
+
...t,
|
|
75
|
+
"data-imf-ui-component": "Slider.Control",
|
|
76
|
+
className: (t) => m({ className: typeof e == "function" ? e(t) : e }),
|
|
77
|
+
children: t.children
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
x.displayName = "Slider.Control";
|
|
81
|
+
function S({ className: e, ...t }) {
|
|
82
|
+
return /* @__PURE__ */ n(i.Track, {
|
|
83
|
+
...t,
|
|
84
|
+
"data-imf-ui-component": "Slider.Track",
|
|
85
|
+
className: (t) => h({ className: typeof e == "function" ? e(t) : e }),
|
|
86
|
+
children: t.children
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
S.displayName = "Slider.Track";
|
|
90
|
+
function C({ className: e, ...t }) {
|
|
91
|
+
return /* @__PURE__ */ n(i.Indicator, {
|
|
92
|
+
...t,
|
|
93
|
+
"data-imf-ui-component": "Slider.Indicator",
|
|
94
|
+
className: (t) => g({ className: typeof e == "function" ? e(t) : e })
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
C.displayName = "Slider.Indicator";
|
|
98
|
+
function w({ index: e, className: t, ...r }) {
|
|
99
|
+
return /* @__PURE__ */ n(i.Thumb, {
|
|
100
|
+
...r,
|
|
101
|
+
"data-imf-ui-component": "Slider.Thumb",
|
|
102
|
+
className: (e) => _({ className: typeof t == "function" ? t(e) : t }),
|
|
103
|
+
index: e
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
w.displayName = "Slider.Thumb";
|
|
107
|
+
var T = {
|
|
108
|
+
root: "imf-ui-switch-module-root",
|
|
109
|
+
thumb: "imf-ui-switch-module-thumb"
|
|
110
|
+
}, E = /* @__PURE__ */ e({
|
|
111
|
+
Root: () => O,
|
|
112
|
+
Thumb: () => k
|
|
113
|
+
}), D = t(T.root), ee = t(T.thumb);
|
|
114
|
+
function O({ className: e, ...t }) {
|
|
115
|
+
return /* @__PURE__ */ n(a.Root, {
|
|
116
|
+
...t,
|
|
117
|
+
"data-imf-ui-component": "Switch.Root",
|
|
118
|
+
className: (t) => D({ className: typeof e == "function" ? e(t) : e }),
|
|
119
|
+
children: t.children
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
O.displayName = "Switch.Root";
|
|
123
|
+
function k({ className: e, ...t }) {
|
|
124
|
+
return /* @__PURE__ */ n(a.Thumb, {
|
|
125
|
+
...t,
|
|
126
|
+
"data-imf-ui-component": "Switch.Thumb",
|
|
127
|
+
className: (t) => ee({ className: typeof e == "function" ? e(t) : e })
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
k.displayName = "Switch.Thumb";
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/components/toggle/toggle.tsx
|
|
133
|
+
var A = t({ root: "imf-ui-toggle-module-root" }.root), j = 2;
|
|
134
|
+
function M(e) {
|
|
135
|
+
let t = 0;
|
|
136
|
+
return r.forEach(e, (e) => {
|
|
137
|
+
typeof e == "string" || typeof e == "number" ? t += String(e).trim().length : e != null && typeof e != "boolean" && (t += j);
|
|
138
|
+
}), t;
|
|
139
|
+
}
|
|
140
|
+
function N({ className: e, style: t, children: r, ...i }) {
|
|
141
|
+
let a = {
|
|
142
|
+
"--glyph-count": M(r),
|
|
143
|
+
"--max-glyphs": j
|
|
144
|
+
};
|
|
145
|
+
return /* @__PURE__ */ n(o, {
|
|
146
|
+
...i,
|
|
147
|
+
"data-imf-ui-component": "Toggle",
|
|
148
|
+
style: (e) => ({
|
|
149
|
+
...a,
|
|
150
|
+
...typeof t == "function" ? t(e) : t
|
|
151
|
+
}),
|
|
152
|
+
className: (t) => A({ className: typeof e == "function" ? e(t) : e }),
|
|
153
|
+
children: r
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/components/toggle-group/toggle-group.tsx
|
|
158
|
+
var te = t({ root: "imf-ui-toggle-group-module-root" }.root);
|
|
159
|
+
function ne({ className: e, ...t }) {
|
|
160
|
+
return /* @__PURE__ */ n(s, {
|
|
161
|
+
...t,
|
|
162
|
+
"data-imf-ui-component": "ToggleGroup",
|
|
163
|
+
className: (t) => te({ className: typeof e == "function" ? e(t) : e })
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
var P = {
|
|
167
|
+
alignCenter: "imf-ui-row-module-alignCenter",
|
|
168
|
+
alignEnd: "imf-ui-row-module-alignEnd",
|
|
169
|
+
alignStart: "imf-ui-row-module-alignStart",
|
|
170
|
+
alignStretch: "imf-ui-row-module-alignStretch",
|
|
171
|
+
gap1: "imf-ui-row-module-gap1",
|
|
172
|
+
gap10: "imf-ui-row-module-gap10",
|
|
173
|
+
gap2: "imf-ui-row-module-gap2",
|
|
174
|
+
gap3: "imf-ui-row-module-gap3",
|
|
175
|
+
gap4: "imf-ui-row-module-gap4",
|
|
176
|
+
gap5: "imf-ui-row-module-gap5",
|
|
177
|
+
gap6: "imf-ui-row-module-gap6",
|
|
178
|
+
gap7: "imf-ui-row-module-gap7",
|
|
179
|
+
gap8: "imf-ui-row-module-gap8",
|
|
180
|
+
gap9: "imf-ui-row-module-gap9",
|
|
181
|
+
justifyAround: "imf-ui-row-module-justifyAround",
|
|
182
|
+
justifyBetween: "imf-ui-row-module-justifyBetween",
|
|
183
|
+
justifyCenter: "imf-ui-row-module-justifyCenter",
|
|
184
|
+
justifyEnd: "imf-ui-row-module-justifyEnd",
|
|
185
|
+
justifyEvenly: "imf-ui-row-module-justifyEvenly",
|
|
186
|
+
justifyStart: "imf-ui-row-module-justifyStart",
|
|
187
|
+
root: "imf-ui-row-module-root",
|
|
188
|
+
wrap: "imf-ui-row-module-wrap"
|
|
189
|
+
}, F = t(P.root, { variants: {
|
|
190
|
+
gap: {
|
|
191
|
+
1: P.gap1,
|
|
192
|
+
2: P.gap2,
|
|
193
|
+
3: P.gap3,
|
|
194
|
+
4: P.gap4,
|
|
195
|
+
5: P.gap5,
|
|
196
|
+
6: P.gap6,
|
|
197
|
+
7: P.gap7,
|
|
198
|
+
8: P.gap8,
|
|
199
|
+
9: P.gap9,
|
|
200
|
+
10: P.gap10
|
|
201
|
+
},
|
|
202
|
+
align: {
|
|
203
|
+
start: P.alignStart,
|
|
204
|
+
center: P.alignCenter,
|
|
205
|
+
end: P.alignEnd,
|
|
206
|
+
stretch: P.alignStretch
|
|
207
|
+
},
|
|
208
|
+
justify: {
|
|
209
|
+
start: P.justifyStart,
|
|
210
|
+
center: P.justifyCenter,
|
|
211
|
+
end: P.justifyEnd,
|
|
212
|
+
between: P.justifyBetween,
|
|
213
|
+
around: P.justifyAround,
|
|
214
|
+
evenly: P.justifyEvenly
|
|
215
|
+
},
|
|
216
|
+
wrap: {
|
|
217
|
+
true: P.wrap,
|
|
218
|
+
false: null
|
|
219
|
+
}
|
|
220
|
+
} });
|
|
221
|
+
function I({ gap: e = "2", align: t = "stretch", justify: r = "start", wrap: i = !1, className: a, ...o }) {
|
|
222
|
+
return /* @__PURE__ */ n("div", {
|
|
223
|
+
...o,
|
|
224
|
+
"data-imf-ui-component": "Row",
|
|
225
|
+
className: F({
|
|
226
|
+
gap: e,
|
|
227
|
+
align: t,
|
|
228
|
+
justify: r,
|
|
229
|
+
wrap: i,
|
|
230
|
+
className: a
|
|
231
|
+
}),
|
|
232
|
+
children: o.children
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
var L = {
|
|
236
|
+
alignCenter: "imf-ui-stack-module-alignCenter",
|
|
237
|
+
alignEnd: "imf-ui-stack-module-alignEnd",
|
|
238
|
+
alignStart: "imf-ui-stack-module-alignStart",
|
|
239
|
+
alignStretch: "imf-ui-stack-module-alignStretch",
|
|
240
|
+
gap1: "imf-ui-stack-module-gap1",
|
|
241
|
+
gap10: "imf-ui-stack-module-gap10",
|
|
242
|
+
gap2: "imf-ui-stack-module-gap2",
|
|
243
|
+
gap3: "imf-ui-stack-module-gap3",
|
|
244
|
+
gap4: "imf-ui-stack-module-gap4",
|
|
245
|
+
gap5: "imf-ui-stack-module-gap5",
|
|
246
|
+
gap6: "imf-ui-stack-module-gap6",
|
|
247
|
+
gap7: "imf-ui-stack-module-gap7",
|
|
248
|
+
gap8: "imf-ui-stack-module-gap8",
|
|
249
|
+
gap9: "imf-ui-stack-module-gap9",
|
|
250
|
+
justifyAround: "imf-ui-stack-module-justifyAround",
|
|
251
|
+
justifyBetween: "imf-ui-stack-module-justifyBetween",
|
|
252
|
+
justifyCenter: "imf-ui-stack-module-justifyCenter",
|
|
253
|
+
justifyEnd: "imf-ui-stack-module-justifyEnd",
|
|
254
|
+
justifyEvenly: "imf-ui-stack-module-justifyEvenly",
|
|
255
|
+
justifyStart: "imf-ui-stack-module-justifyStart",
|
|
256
|
+
root: "imf-ui-stack-module-root"
|
|
257
|
+
}, R = t(L.root, { variants: {
|
|
258
|
+
gap: {
|
|
259
|
+
1: L.gap1,
|
|
260
|
+
2: L.gap2,
|
|
261
|
+
3: L.gap3,
|
|
262
|
+
4: L.gap4,
|
|
263
|
+
5: L.gap5,
|
|
264
|
+
6: L.gap6,
|
|
265
|
+
7: L.gap7,
|
|
266
|
+
8: L.gap8,
|
|
267
|
+
9: L.gap9,
|
|
268
|
+
10: L.gap10
|
|
269
|
+
},
|
|
270
|
+
align: {
|
|
271
|
+
start: L.alignStart,
|
|
272
|
+
center: L.alignCenter,
|
|
273
|
+
end: L.alignEnd,
|
|
274
|
+
stretch: L.alignStretch
|
|
275
|
+
},
|
|
276
|
+
justify: {
|
|
277
|
+
start: L.justifyStart,
|
|
278
|
+
center: L.justifyCenter,
|
|
279
|
+
end: L.justifyEnd,
|
|
280
|
+
between: L.justifyBetween,
|
|
281
|
+
around: L.justifyAround,
|
|
282
|
+
evenly: L.justifyEvenly
|
|
283
|
+
}
|
|
284
|
+
} });
|
|
285
|
+
function z({ gap: e = "4", align: t = "stretch", justify: r = "start", className: i, ...a }) {
|
|
286
|
+
return /* @__PURE__ */ n("div", {
|
|
287
|
+
...a,
|
|
288
|
+
"data-imf-ui-component": "Stack",
|
|
289
|
+
className: R({
|
|
290
|
+
gap: e,
|
|
291
|
+
align: t,
|
|
292
|
+
justify: r,
|
|
293
|
+
className: i
|
|
294
|
+
}),
|
|
295
|
+
children: a.children
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
var B = {
|
|
299
|
+
indicator: "imf-ui-tabs-module-indicator",
|
|
300
|
+
list: "imf-ui-tabs-module-list",
|
|
301
|
+
listFill: "imf-ui-tabs-module-listFill",
|
|
302
|
+
panel: "imf-ui-tabs-module-panel",
|
|
303
|
+
panelViewport: "imf-ui-tabs-module-panelViewport",
|
|
304
|
+
root: "imf-ui-tabs-module-root",
|
|
305
|
+
tab: "imf-ui-tabs-module-tab"
|
|
306
|
+
}, V = /* @__PURE__ */ e({
|
|
307
|
+
Indicator: () => Z,
|
|
308
|
+
List: () => Y,
|
|
309
|
+
Panel: () => $,
|
|
310
|
+
PanelViewport: () => Q,
|
|
311
|
+
Root: () => J,
|
|
312
|
+
Tab: () => X
|
|
313
|
+
}), H = t(B.list, { variants: { fill: {
|
|
314
|
+
true: B.listFill,
|
|
315
|
+
false: null
|
|
316
|
+
} } }), U = t(B.root), W = t(B.tab), G = t(B.indicator), K = t(B.panelViewport), q = t(B.panel);
|
|
317
|
+
function J({ className: e, ...t }) {
|
|
318
|
+
return /* @__PURE__ */ n(c.Root, {
|
|
319
|
+
...t,
|
|
320
|
+
"data-imf-ui-component": "Tabs.Root",
|
|
321
|
+
className: (t) => U({ className: typeof e == "function" ? e(t) : e })
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
J.displayName = "Tabs.Root";
|
|
325
|
+
function Y({ fill: e = !1, className: t, ...r }) {
|
|
326
|
+
return /* @__PURE__ */ n(c.List, {
|
|
327
|
+
...r,
|
|
328
|
+
"data-imf-ui-component": "Tabs.List",
|
|
329
|
+
className: (n) => H({
|
|
330
|
+
fill: e,
|
|
331
|
+
className: typeof t == "function" ? t(n) : t
|
|
332
|
+
})
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
Y.displayName = "Tabs.List";
|
|
336
|
+
function X({ className: e, ...t }) {
|
|
337
|
+
return /* @__PURE__ */ n(c.Tab, {
|
|
338
|
+
...t,
|
|
339
|
+
"data-imf-ui-component": "Tabs.Tab",
|
|
340
|
+
className: (t) => W({ className: typeof e == "function" ? e(t) : e })
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
X.displayName = "Tabs.Tab";
|
|
344
|
+
function Z({ className: e, ...t }) {
|
|
345
|
+
return /* @__PURE__ */ n(c.Indicator, {
|
|
346
|
+
...t,
|
|
347
|
+
"data-imf-ui-component": "Tabs.Indicator",
|
|
348
|
+
className: (t) => G({ className: typeof e == "function" ? e(t) : e })
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
Z.displayName = "Tabs.Indicator";
|
|
352
|
+
function Q({ className: e, ...t }) {
|
|
353
|
+
return /* @__PURE__ */ n("div", {
|
|
354
|
+
...t,
|
|
355
|
+
"data-imf-ui-component": "Tabs.PanelViewport",
|
|
356
|
+
className: K({ className: e })
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
Q.displayName = "Tabs.PanelViewport";
|
|
360
|
+
function $({ className: e, ...t }) {
|
|
361
|
+
return /* @__PURE__ */ n(c.Panel, {
|
|
362
|
+
...t,
|
|
363
|
+
"data-imf-ui-component": "Tabs.Panel",
|
|
364
|
+
className: (t) => q({ className: typeof e == "function" ? e(t) : e })
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
$.displayName = "Tabs.Panel";
|
|
368
|
+
//#endregion
|
|
369
|
+
export { u as S, y as _, J as a, S as b, z as c, N as d, O as f, C as g, x as h, Q as i, I as l, E as m, Y as n, X as o, k as p, $ as r, V as s, Z as t, ne as u, v, b as x, w as y };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imfusion/web-ui",
|
|
3
|
-
"version": "0.5.1-dev.
|
|
3
|
+
"version": "0.5.1-dev.56.gcf89961f",
|
|
4
4
|
"description": "The official Web UI component library for ImFusion web apps",
|
|
5
5
|
"author": "ImFusion GmbH",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"codegen:docgen": "tsx src/docgen/gen-docgen.ts",
|
|
68
68
|
"codegen:llms": "tsx src/llms/gen-llms.ts",
|
|
69
69
|
"codegen:tokens": "tsx src/llms/gen-tokens.ts",
|
|
70
|
-
"verify:format": "prettier --check .",
|
|
70
|
+
"verify:format": "prettier --check . --ignore-path .gitignore --ignore-path .prettierignore --ignore-path $(git rev-parse --path-format=absolute --git-path info/exclude)",
|
|
71
71
|
"verify:lint": "eslint . --cache --max-warnings=0",
|
|
72
72
|
"verify:typecheck": "npm run codegen && tsc -p tsconfig.json --noEmit && tsc -p tsconfig.lib.json --noEmit && tsc -p .storybook/tsconfig.json --noEmit",
|
|
73
73
|
"verify:tests": "vitest run",
|
|
@@ -77,6 +77,8 @@
|
|
|
77
77
|
"verify:changelog": "tsx scripts/verify/changelog.ts",
|
|
78
78
|
"verify:staged": "tsx scripts/verify/staged.ts",
|
|
79
79
|
"verify:full": "tsx scripts/verify/full.ts && npm run verify:tests",
|
|
80
|
+
"release:prepare": "tsx scripts/release.ts prepare",
|
|
81
|
+
"release:tag": "tsx scripts/release.ts tag",
|
|
80
82
|
"format": "prettier --write .",
|
|
81
83
|
"lint": "eslint . --cache --fix",
|
|
82
84
|
"lint:inspect": "npx @eslint/config-inspector@latest",
|
package/dist/code-BRy_lg-h.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./chunk-DA_OvQe2.js";
|
|
2
|
-
import { r as t, t as n } from "./meta-BwCupYyq.js";
|
|
3
|
-
import { Ma as r, Qt as i, Xo as a, hn as o, r as s } from "./icons-BhogvWBV.js";
|
|
4
|
-
import { useCallback as c, useEffect as l, useRef as u, useState as d } from "react";
|
|
5
|
-
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
6
|
-
//#region src/hooks/use-clipboard.ts
|
|
7
|
-
function m({ timeout: e = 1500 } = {}) {
|
|
8
|
-
let [t, n] = d(!1), r = u(void 0);
|
|
9
|
-
return l(() => () => clearTimeout(r.current), []), {
|
|
10
|
-
copied: t,
|
|
11
|
-
copy: c((t) => {
|
|
12
|
-
navigator.clipboard.writeText(t).then(() => {
|
|
13
|
-
n(!0), clearTimeout(r.current), r.current = setTimeout(() => n(!1), e);
|
|
14
|
-
});
|
|
15
|
-
}, [e])
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
var h = {
|
|
19
|
-
block: "imf-ui-code-module-block",
|
|
20
|
-
copy: "imf-ui-code-module-copy",
|
|
21
|
-
icon: "imf-ui-code-module-icon",
|
|
22
|
-
inline: "imf-ui-code-module-inline",
|
|
23
|
-
inlineCopy: "imf-ui-code-module-inlineCopy",
|
|
24
|
-
inlineLink: "imf-ui-code-module-inlineLink",
|
|
25
|
-
language: "imf-ui-code-module-language",
|
|
26
|
-
pre: "imf-ui-code-module-pre",
|
|
27
|
-
separator: "imf-ui-code-module-separator"
|
|
28
|
-
}, g = /* @__PURE__ */ e({
|
|
29
|
-
Block: () => y,
|
|
30
|
-
Inline: () => _,
|
|
31
|
-
InlineLink: () => v
|
|
32
|
-
});
|
|
33
|
-
function _({ className: e, copyable: n = !1, children: i, ...o }) {
|
|
34
|
-
let { copied: c, copy: l } = m(), d = u(null), g = c ? r : a;
|
|
35
|
-
return /* @__PURE__ */ p("code", {
|
|
36
|
-
...o,
|
|
37
|
-
"data-imf-ui-component": "Code.Inline",
|
|
38
|
-
className: t(h.inline, e),
|
|
39
|
-
children: [
|
|
40
|
-
/* @__PURE__ */ f("span", {
|
|
41
|
-
ref: d,
|
|
42
|
-
children: i
|
|
43
|
-
}),
|
|
44
|
-
n && /* @__PURE__ */ f("span", { className: h.separator }),
|
|
45
|
-
n && /* @__PURE__ */ f("button", {
|
|
46
|
-
type: "button",
|
|
47
|
-
className: h.inlineCopy,
|
|
48
|
-
"data-copied": c || void 0,
|
|
49
|
-
"aria-label": c ? "Copied" : "Copy",
|
|
50
|
-
onClick: () => l(d.current?.textContent ?? ""),
|
|
51
|
-
children: /* @__PURE__ */ f(s, {
|
|
52
|
-
glyph: g,
|
|
53
|
-
size: 12,
|
|
54
|
-
strokeWidth: 2,
|
|
55
|
-
"aria-hidden": !0
|
|
56
|
-
})
|
|
57
|
-
})
|
|
58
|
-
]
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
_.displayName = "Code.Inline";
|
|
62
|
-
function v({ className: e, kind: n = "external", children: r, ...a }) {
|
|
63
|
-
let c = n === "external" ? o : i;
|
|
64
|
-
return /* @__PURE__ */ p("a", {
|
|
65
|
-
...n === "external" ? {
|
|
66
|
-
target: "_blank",
|
|
67
|
-
rel: "noreferrer"
|
|
68
|
-
} : {},
|
|
69
|
-
...a,
|
|
70
|
-
"data-imf-ui-component": "Code.InlineLink",
|
|
71
|
-
"data-kind": n,
|
|
72
|
-
className: t(h.inline, h.inlineLink, e),
|
|
73
|
-
children: [
|
|
74
|
-
r,
|
|
75
|
-
/* @__PURE__ */ f("span", { className: h.separator }),
|
|
76
|
-
/* @__PURE__ */ f("span", {
|
|
77
|
-
className: h.icon,
|
|
78
|
-
"aria-hidden": !0,
|
|
79
|
-
children: /* @__PURE__ */ f(s, {
|
|
80
|
-
glyph: c,
|
|
81
|
-
size: 12,
|
|
82
|
-
strokeWidth: 2
|
|
83
|
-
})
|
|
84
|
-
})
|
|
85
|
-
]
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
v.displayName = "Code.InlineLink";
|
|
89
|
-
function y({ className: e, language: n, hideCopy: i = !1, children: o, ...c }) {
|
|
90
|
-
let { copied: l, copy: d } = m(), g = u(null), _ = l ? r : a;
|
|
91
|
-
return /* @__PURE__ */ p("div", {
|
|
92
|
-
"data-imf-ui-component": "Code.Block",
|
|
93
|
-
className: t(h.block, e),
|
|
94
|
-
children: [
|
|
95
|
-
n != null && /* @__PURE__ */ f("span", {
|
|
96
|
-
className: h.language,
|
|
97
|
-
children: n
|
|
98
|
-
}),
|
|
99
|
-
!i && /* @__PURE__ */ f("button", {
|
|
100
|
-
type: "button",
|
|
101
|
-
className: h.copy,
|
|
102
|
-
"data-copied": l || void 0,
|
|
103
|
-
"aria-label": l ? "Copied" : "Copy",
|
|
104
|
-
onClick: () => d(g.current?.textContent ?? ""),
|
|
105
|
-
children: /* @__PURE__ */ f(s, {
|
|
106
|
-
glyph: _,
|
|
107
|
-
size: 12,
|
|
108
|
-
strokeWidth: 2,
|
|
109
|
-
"aria-hidden": !0
|
|
110
|
-
})
|
|
111
|
-
}),
|
|
112
|
-
/* @__PURE__ */ f("pre", {
|
|
113
|
-
...c,
|
|
114
|
-
className: h.pre,
|
|
115
|
-
children: /* @__PURE__ */ f("code", {
|
|
116
|
-
ref: g,
|
|
117
|
-
children: o
|
|
118
|
-
})
|
|
119
|
-
})
|
|
120
|
-
]
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
y.displayName = "Code.Block";
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/components/code/code.meta.ts
|
|
126
|
-
var b = {
|
|
127
|
-
name: "Code",
|
|
128
|
-
category: n.display,
|
|
129
|
-
status: "stable",
|
|
130
|
-
namespace: !0,
|
|
131
|
-
description: "Displays source code — Code.Inline for a fragment in running text, Code.Block for a fenced block with an optional language label and copy button. Also called a code snippet or code block.",
|
|
132
|
-
origin: "native"
|
|
133
|
-
};
|
|
134
|
-
//#endregion
|
|
135
|
-
export { g as a, v as i, y as n, m as o, _ as r, b as t };
|
package/dist/meta-BwCupYyq.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
//#region node_modules/clsx/dist/clsx.mjs
|
|
2
|
-
function e(t) {
|
|
3
|
-
var n, r, i = "";
|
|
4
|
-
if (typeof t == "string" || typeof t == "number") i += t;
|
|
5
|
-
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
6
|
-
var a = t.length;
|
|
7
|
-
for (n = 0; n < a; n++) t[n] && (r = e(t[n])) && (i && (i += " "), i += r);
|
|
8
|
-
} else for (r in t) t[r] && (i && (i += " "), i += r);
|
|
9
|
-
return i;
|
|
10
|
-
}
|
|
11
|
-
function t() {
|
|
12
|
-
for (var t, n, r = 0, i = "", a = arguments.length; r < a; r++) (t = arguments[r]) && (n = e(t)) && (i && (i += " "), i += n);
|
|
13
|
-
return i;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region node_modules/class-variance-authority/dist/index.mjs
|
|
17
|
-
var n = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, r = t, i = (e, t) => (i) => {
|
|
18
|
-
if (t?.variants == null) return r(e, i?.class, i?.className);
|
|
19
|
-
let { variants: a, defaultVariants: o } = t, s = Object.keys(a).map((e) => {
|
|
20
|
-
let t = i?.[e], r = o?.[e];
|
|
21
|
-
if (t === null) return null;
|
|
22
|
-
let s = n(t) || n(r);
|
|
23
|
-
return a[e][s];
|
|
24
|
-
}), c = i && Object.entries(i).reduce((e, t) => {
|
|
25
|
-
let [n, r] = t;
|
|
26
|
-
return r === void 0 || (e[n] = r), e;
|
|
27
|
-
}, {});
|
|
28
|
-
return r(e, s, t?.compoundVariants?.reduce((e, t) => {
|
|
29
|
-
let { class: n, className: r, ...i } = t;
|
|
30
|
-
return Object.entries(i).every((e) => {
|
|
31
|
-
let [t, n] = e;
|
|
32
|
-
return Array.isArray(n) ? n.includes({
|
|
33
|
-
...o,
|
|
34
|
-
...c
|
|
35
|
-
}[t]) : {
|
|
36
|
-
...o,
|
|
37
|
-
...c
|
|
38
|
-
}[t] === n;
|
|
39
|
-
}) ? [
|
|
40
|
-
...e,
|
|
41
|
-
n,
|
|
42
|
-
r
|
|
43
|
-
] : e;
|
|
44
|
-
}, []), i?.class, i?.className);
|
|
45
|
-
}, a = {
|
|
46
|
-
buttons: {
|
|
47
|
-
id: "buttons",
|
|
48
|
-
label: "Buttons"
|
|
49
|
-
},
|
|
50
|
-
inputs: {
|
|
51
|
-
id: "inputs",
|
|
52
|
-
label: "Inputs"
|
|
53
|
-
},
|
|
54
|
-
layout: {
|
|
55
|
-
id: "layout",
|
|
56
|
-
label: "Layout"
|
|
57
|
-
},
|
|
58
|
-
display: {
|
|
59
|
-
id: "display",
|
|
60
|
-
label: "Display"
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
//#endregion
|
|
64
|
-
export { i as n, r, a as t };
|