@imfusion/web-ui 0.11.1-dev.33.gefbd75be → 0.11.1-dev.37.gdba3f9f4

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.
@@ -1,11 +1,11 @@
1
1
  import { a as e, o as t, s as n } from "./utils-RZJAXfcf.js";
2
2
  import { _M as r, mh as i } from "./icons-vc1WZCxX.js";
3
3
  import { t as a } from "./meta-V_KyLeGn.js";
4
- import { cva as o } from "class-variance-authority";
5
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
- import { Children as l, createContext as u, useCallback as d, useContext as f } from "react";
7
- import { Toggle as p } from "@base-ui/react/toggle";
8
- import { ToggleGroup as ee } from "@base-ui/react/toggle-group";
4
+ import { cva as o, cx as s } from "class-variance-authority";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ import { Children as u, createContext as d, useCallback as f, useContext as p } from "react";
7
+ import { Toggle as ee } from "@base-ui/react/toggle";
8
+ import { ToggleGroup as te } from "@base-ui/react/toggle-group";
9
9
  import { Switch as m } from "@base-ui/react/switch";
10
10
  import { Tabs as h } from "@base-ui/react/tabs";
11
11
  var g = {
@@ -13,20 +13,20 @@ var g = {
13
13
  icon: "imf-ui-kbd-module-icon",
14
14
  primary: "imf-ui-kbd-module-primary",
15
15
  root: "imf-ui-kbd-module-root"
16
- }, _ = o(g.root, { variants: { variant: {
16
+ }, ne = o(g.root, { variants: { variant: {
17
17
  default: null,
18
18
  primary: g.primary,
19
19
  flat: g.flat
20
20
  } } });
21
- function v({ variant: e = "default", icon: t = !1, children: n, ...a }) {
22
- return /* @__PURE__ */ c("kbd", {
21
+ function _({ variant: e = "default", icon: t = !1, children: n, ...a }) {
22
+ return /* @__PURE__ */ l("kbd", {
23
23
  ...a,
24
24
  "data-imf-ui-component": "Kbd",
25
- className: _({
25
+ className: ne({
26
26
  variant: e,
27
27
  className: a.className
28
28
  }),
29
- children: [t && /* @__PURE__ */ s(r, {
29
+ children: [t && /* @__PURE__ */ c(r, {
30
30
  glyph: i,
31
31
  strokeWidth: 2,
32
32
  "aria-hidden": !0,
@@ -36,14 +36,14 @@ function v({ variant: e = "default", icon: t = !1, children: n, ...a }) {
36
36
  }
37
37
  //#endregion
38
38
  //#region src/components/kbd/kbd.meta.ts
39
- var te = {
39
+ var v = {
40
40
  name: "Kbd",
41
41
  category: a.display,
42
42
  status: "experimental",
43
43
  description: "Shows a keyboard key or shortcut, such as the letter that activates a button. Also called a key hint; Button and Toggle render it through their `shortcut` prop.",
44
44
  origin: "native",
45
45
  internalDependencies: ["Icon"]
46
- }, y = {
46
+ }, re = {
47
47
  ctrl: "Control",
48
48
  control: "Control",
49
49
  cmd: "Meta",
@@ -58,65 +58,65 @@ var te = {
58
58
  esc: "Escape",
59
59
  escape: "Escape"
60
60
  };
61
- function b(e) {
61
+ function y(e) {
62
62
  let t = e.trim().split(/\s+/).filter(Boolean);
63
- if (t.length !== 0) return t.map((e) => y[e.toLowerCase()] ?? (e.length === 1 ? e.toUpperCase() : e)).join("+");
63
+ if (t.length !== 0) return t.map((e) => re[e.toLowerCase()] ?? (e.length === 1 ? e.toUpperCase() : e)).join("+");
64
64
  }
65
65
  //#endregion
66
66
  //#region src/components/toggle-group/toggle-group-size.ts
67
- var x = u("md"), S = {
67
+ var b = d("md"), x = {
68
68
  root: "imf-ui-toggle-module-root",
69
69
  shortcut: "imf-ui-toggle-module-shortcut",
70
70
  sizeSm: "imf-ui-toggle-module-sizeSm"
71
- }, C = o(S.root, { variants: { size: {
72
- sm: S.sizeSm,
71
+ }, ie = o(x.root, { variants: { size: {
72
+ sm: x.sizeSm,
73
73
  md: null
74
- } } }), w = 2;
75
- function T(e) {
74
+ } } }), S = 2;
75
+ function ae(e) {
76
76
  let t = 0;
77
- return l.forEach(e, (e) => {
78
- typeof e == "string" || typeof e == "number" ? t += String(e).trim().length : e != null && typeof e != "boolean" && (t += w);
77
+ return u.forEach(e, (e) => {
78
+ typeof e == "string" || typeof e == "number" ? t += String(e).trim().length : e != null && typeof e != "boolean" && (t += S);
79
79
  }), t;
80
80
  }
81
- function ne({ style: n, shortcut: r, size: i, children: a, ...o }) {
82
- let l = f(x), u = {
83
- "--glyph-count": T(a),
84
- "--max-glyphs": w
81
+ function C({ style: n, shortcut: r, size: i, children: a, ...o }) {
82
+ let s = p(b), u = {
83
+ "--glyph-count": ae(a),
84
+ "--max-glyphs": S
85
85
  };
86
- return /* @__PURE__ */ c(p, {
87
- "aria-keyshortcuts": r ? b(r) : void 0,
86
+ return /* @__PURE__ */ l(ee, {
87
+ "aria-keyshortcuts": r ? y(r) : void 0,
88
88
  ...o,
89
89
  "data-imf-ui-component": "Toggle",
90
90
  style: (e) => ({
91
91
  ...u,
92
92
  ...t(n, e)
93
93
  }),
94
- className: (t) => C({
95
- size: i ?? l,
94
+ className: (t) => ie({
95
+ size: i ?? s,
96
96
  className: e(o.className, t)
97
97
  }),
98
- children: [a, r && /* @__PURE__ */ s(v, {
98
+ children: [a, r && /* @__PURE__ */ c(_, {
99
99
  variant: "flat",
100
- className: S.shortcut,
100
+ className: x.shortcut,
101
101
  "aria-hidden": !0,
102
102
  children: r
103
103
  })]
104
104
  });
105
105
  }
106
- var E = {
106
+ var w = {
107
107
  root: "imf-ui-toggle-group-module-root",
108
108
  sizeSm: "imf-ui-toggle-group-module-sizeSm"
109
- }, re = o(E.root, { variants: { size: {
110
- sm: E.sizeSm,
109
+ }, T = o(w.root, { variants: { size: {
110
+ sm: w.sizeSm,
111
111
  md: null
112
112
  } } });
113
- function ie({ size: t = "md", ...n }) {
114
- return /* @__PURE__ */ s(x.Provider, {
113
+ function E({ size: t = "md", ...n }) {
114
+ return /* @__PURE__ */ c(b.Provider, {
115
115
  value: t ?? "md",
116
- children: /* @__PURE__ */ s(ee, {
116
+ children: /* @__PURE__ */ c(te, {
117
117
  ...n,
118
118
  "data-imf-ui-component": "ToggleGroup",
119
- className: (r) => re({
119
+ className: (r) => T({
120
120
  size: t,
121
121
  className: e(n.className, r)
122
122
  })
@@ -126,27 +126,27 @@ function ie({ size: t = "md", ...n }) {
126
126
  var D = {
127
127
  root: "imf-ui-switch-module-root",
128
128
  thumb: "imf-ui-switch-module-thumb"
129
- }, ae = /* @__PURE__ */ n({
130
- Root: () => A,
131
- Thumb: () => j
132
- }), O = o(D.root), k = o(D.thumb);
133
- function A(t) {
134
- return /* @__PURE__ */ s(m.Root, {
129
+ }, oe = /* @__PURE__ */ n({
130
+ Root: () => O,
131
+ Thumb: () => k
132
+ }), se = o(D.root), ce = o(D.thumb);
133
+ function O(t) {
134
+ return /* @__PURE__ */ c(m.Root, {
135
135
  ...t,
136
136
  "data-imf-ui-component": "Switch.Root",
137
- className: (n) => O({ className: e(t.className, n) })
137
+ className: (n) => se({ className: e(t.className, n) })
138
138
  });
139
139
  }
140
- A.displayName = "Switch.Root";
141
- function j(t) {
142
- return /* @__PURE__ */ s(m.Thumb, {
140
+ O.displayName = "Switch.Root";
141
+ function k(t) {
142
+ return /* @__PURE__ */ c(m.Thumb, {
143
143
  ...t,
144
144
  "data-imf-ui-component": "Switch.Thumb",
145
- className: (n) => k({ className: e(t.className, n) })
145
+ className: (n) => ce({ className: e(t.className, n) })
146
146
  });
147
147
  }
148
- j.displayName = "Switch.Thumb";
149
- var M = {
148
+ k.displayName = "Switch.Thumb";
149
+ var A = {
150
150
  alignCenter: "imf-ui-row-module-alignCenter",
151
151
  alignEnd: "imf-ui-row-module-alignEnd",
152
152
  alignStart: "imf-ui-row-module-alignStart",
@@ -169,43 +169,43 @@ var M = {
169
169
  justifyStart: "imf-ui-row-module-justifyStart",
170
170
  root: "imf-ui-row-module-root",
171
171
  wrap: "imf-ui-row-module-wrap"
172
- }, N = o(M.root, { variants: {
172
+ }, j = o(A.root, { variants: {
173
173
  gap: {
174
- 1: M.gap1,
175
- 2: M.gap2,
176
- 3: M.gap3,
177
- 4: M.gap4,
178
- 5: M.gap5,
179
- 6: M.gap6,
180
- 7: M.gap7,
181
- 8: M.gap8,
182
- 9: M.gap9,
183
- 10: M.gap10
174
+ 1: A.gap1,
175
+ 2: A.gap2,
176
+ 3: A.gap3,
177
+ 4: A.gap4,
178
+ 5: A.gap5,
179
+ 6: A.gap6,
180
+ 7: A.gap7,
181
+ 8: A.gap8,
182
+ 9: A.gap9,
183
+ 10: A.gap10
184
184
  },
185
185
  align: {
186
- start: M.alignStart,
187
- center: M.alignCenter,
188
- end: M.alignEnd,
189
- stretch: M.alignStretch
186
+ start: A.alignStart,
187
+ center: A.alignCenter,
188
+ end: A.alignEnd,
189
+ stretch: A.alignStretch
190
190
  },
191
191
  justify: {
192
- start: M.justifyStart,
193
- center: M.justifyCenter,
194
- end: M.justifyEnd,
195
- between: M.justifyBetween,
196
- around: M.justifyAround,
197
- evenly: M.justifyEvenly
192
+ start: A.justifyStart,
193
+ center: A.justifyCenter,
194
+ end: A.justifyEnd,
195
+ between: A.justifyBetween,
196
+ around: A.justifyAround,
197
+ evenly: A.justifyEvenly
198
198
  },
199
199
  wrap: {
200
- true: M.wrap,
200
+ true: A.wrap,
201
201
  false: null
202
202
  }
203
203
  } });
204
- function P({ gap: e = "2", align: t = "stretch", justify: n = "start", wrap: r = !1, ...i }) {
205
- return /* @__PURE__ */ s("div", {
204
+ function M({ gap: e = "2", align: t = "stretch", justify: n = "start", wrap: r = !1, ...i }) {
205
+ return /* @__PURE__ */ c("div", {
206
206
  ...i,
207
207
  "data-imf-ui-component": "Row",
208
- className: N({
208
+ className: j({
209
209
  gap: e,
210
210
  align: t,
211
211
  justify: n,
@@ -214,7 +214,7 @@ function P({ gap: e = "2", align: t = "stretch", justify: n = "start", wrap: r =
214
214
  })
215
215
  });
216
216
  }
217
- var F = {
217
+ var N = {
218
218
  alignCenter: "imf-ui-stack-module-alignCenter",
219
219
  alignEnd: "imf-ui-stack-module-alignEnd",
220
220
  alignStart: "imf-ui-stack-module-alignStart",
@@ -237,40 +237,40 @@ var F = {
237
237
  justifyEvenly: "imf-ui-stack-module-justifyEvenly",
238
238
  justifyStart: "imf-ui-stack-module-justifyStart",
239
239
  root: "imf-ui-stack-module-root"
240
- }, I = o(F.root, { variants: {
240
+ }, P = o(N.root, { variants: {
241
241
  gap: {
242
- 0: F.gap0,
243
- 1: F.gap1,
244
- 2: F.gap2,
245
- 3: F.gap3,
246
- 4: F.gap4,
247
- 5: F.gap5,
248
- 6: F.gap6,
249
- 7: F.gap7,
250
- 8: F.gap8,
251
- 9: F.gap9,
252
- 10: F.gap10
242
+ 0: N.gap0,
243
+ 1: N.gap1,
244
+ 2: N.gap2,
245
+ 3: N.gap3,
246
+ 4: N.gap4,
247
+ 5: N.gap5,
248
+ 6: N.gap6,
249
+ 7: N.gap7,
250
+ 8: N.gap8,
251
+ 9: N.gap9,
252
+ 10: N.gap10
253
253
  },
254
254
  align: {
255
- start: F.alignStart,
256
- center: F.alignCenter,
257
- end: F.alignEnd,
258
- stretch: F.alignStretch
255
+ start: N.alignStart,
256
+ center: N.alignCenter,
257
+ end: N.alignEnd,
258
+ stretch: N.alignStretch
259
259
  },
260
260
  justify: {
261
- start: F.justifyStart,
262
- center: F.justifyCenter,
263
- end: F.justifyEnd,
264
- between: F.justifyBetween,
265
- around: F.justifyAround,
266
- evenly: F.justifyEvenly
261
+ start: N.justifyStart,
262
+ center: N.justifyCenter,
263
+ end: N.justifyEnd,
264
+ between: N.justifyBetween,
265
+ around: N.justifyAround,
266
+ evenly: N.justifyEvenly
267
267
  }
268
268
  } });
269
- function L({ gap: e = "4", align: t = "stretch", justify: n = "start", ...r }) {
270
- return /* @__PURE__ */ s("div", {
269
+ function F({ gap: e = "4", align: t = "stretch", justify: n = "start", ...r }) {
270
+ return /* @__PURE__ */ c("div", {
271
271
  ...r,
272
272
  "data-imf-ui-component": "Stack",
273
- className: I({
273
+ className: P({
274
274
  gap: e,
275
275
  align: t,
276
276
  justify: n,
@@ -278,25 +278,51 @@ function L({ gap: e = "4", align: t = "stretch", justify: n = "start", ...r }) {
278
278
  })
279
279
  });
280
280
  }
281
- var R = {
281
+ var I = {
282
+ item: "imf-ui-tabs-underline-module-item",
283
+ rule: "imf-ui-tabs-underline-module-rule"
284
+ }, L = o(I.rule), R = o(I.item), z = {
282
285
  indicator: "imf-ui-tabs-module-indicator",
286
+ indicatorUnderline: "imf-ui-tabs-module-indicatorUnderline",
283
287
  list: "imf-ui-tabs-module-list",
284
288
  listFill: "imf-ui-tabs-module-listFill",
289
+ listUnderline: "imf-ui-tabs-module-listUnderline",
285
290
  panel: "imf-ui-tabs-module-panel",
291
+ panelUnderline: "imf-ui-tabs-module-panelUnderline",
286
292
  panelViewport: "imf-ui-tabs-module-panelViewport",
293
+ panelViewportUnderline: "imf-ui-tabs-module-panelViewportUnderline",
287
294
  root: "imf-ui-tabs-module-root",
288
- tab: "imf-ui-tabs-module-tab"
289
- }, z = /* @__PURE__ */ n({
295
+ tab: "imf-ui-tabs-module-tab",
296
+ tabUnderline: "imf-ui-tabs-module-tabUnderline"
297
+ }, B = /* @__PURE__ */ n({
290
298
  Indicator: () => Z,
291
299
  List: () => Y,
292
300
  Panel: () => $,
293
301
  PanelViewport: () => Q,
294
302
  Root: () => J,
295
303
  Tab: () => X
296
- }), B = o(R.list, { variants: { fill: {
297
- true: R.listFill,
298
- false: null
299
- } } }), V = o(R.root), H = o(R.tab), U = o(R.indicator), W = o(R.panelViewport), G = o(R.panel);
304
+ }), V = o(z.list, { variants: {
305
+ fill: {
306
+ true: z.listFill,
307
+ false: null
308
+ },
309
+ appearance: {
310
+ boxed: null,
311
+ underline: s(z.listUnderline, L())
312
+ }
313
+ } }), H = o(z.root), U = o(null, { variants: { appearance: {
314
+ boxed: z.tab,
315
+ underline: s(z.tabUnderline, R())
316
+ } } }), W = o(null, { variants: { appearance: {
317
+ boxed: z.indicator,
318
+ underline: z.indicatorUnderline
319
+ } } }), le = o(z.panelViewport, { variants: { appearance: {
320
+ boxed: null,
321
+ underline: z.panelViewportUnderline
322
+ } } }), ue = o(z.panel, { variants: { appearance: {
323
+ boxed: null,
324
+ underline: z.panelUnderline
325
+ } } }), G = d("boxed");
300
326
  function K(e, t) {
301
327
  typeof e == "function" ? e(t) : e && (e.current = t);
302
328
  }
@@ -312,16 +338,20 @@ function q(e) {
312
338
  t.disconnect(), r.disconnect();
313
339
  };
314
340
  }
315
- function J(t) {
316
- return /* @__PURE__ */ s(h.Root, {
317
- ...t,
318
- "data-imf-ui-component": "Tabs.Root",
319
- className: (n) => V({ className: e(t.className, n) })
341
+ function J({ appearance: t = "boxed", ...n }) {
342
+ let r = n.orientation === "vertical" ? "boxed" : t;
343
+ return /* @__PURE__ */ c(G, {
344
+ value: r,
345
+ children: /* @__PURE__ */ c(h.Root, {
346
+ ...n,
347
+ "data-imf-ui-component": "Tabs.Root",
348
+ className: (t) => H({ className: e(n.className, t) })
349
+ })
320
350
  });
321
351
  }
322
352
  J.displayName = "Tabs.Root";
323
353
  function Y({ fill: t = !1, ref: n, ...r }) {
324
- let i = d((e) => {
354
+ let i = p(G), a = f((e) => {
325
355
  if (!e) return;
326
356
  K(n, e);
327
357
  let t = q(e);
@@ -329,48 +359,65 @@ function Y({ fill: t = !1, ref: n, ...r }) {
329
359
  t(), K(n, null);
330
360
  };
331
361
  }, [n]);
332
- return /* @__PURE__ */ s(h.List, {
362
+ return /* @__PURE__ */ c(h.List, {
333
363
  ...r,
334
- ref: i,
364
+ ref: a,
335
365
  "data-imf-ui-component": "Tabs.List",
336
- className: (n) => B({
366
+ className: (n) => V({
337
367
  fill: t,
368
+ appearance: i,
338
369
  className: e(r.className, n)
339
370
  })
340
371
  });
341
372
  }
342
373
  Y.displayName = "Tabs.List";
343
374
  function X(t) {
344
- return /* @__PURE__ */ s(h.Tab, {
375
+ let n = p(G);
376
+ return /* @__PURE__ */ c(h.Tab, {
345
377
  ...t,
346
378
  "data-imf-ui-component": "Tabs.Tab",
347
- className: (n) => H({ className: e(t.className, n) })
379
+ className: (r) => U({
380
+ appearance: n,
381
+ className: e(t.className, r)
382
+ })
348
383
  });
349
384
  }
350
385
  X.displayName = "Tabs.Tab";
351
386
  function Z(t) {
352
- return /* @__PURE__ */ s(h.Indicator, {
387
+ let n = p(G);
388
+ return /* @__PURE__ */ c(h.Indicator, {
353
389
  ...t,
354
390
  "data-imf-ui-component": "Tabs.Indicator",
355
- className: (n) => U({ className: e(t.className, n) })
391
+ className: (r) => W({
392
+ appearance: n,
393
+ className: e(t.className, r)
394
+ })
356
395
  });
357
396
  }
358
397
  Z.displayName = "Tabs.Indicator";
359
398
  function Q(e) {
360
- return /* @__PURE__ */ s("div", {
399
+ let t = p(G);
400
+ return /* @__PURE__ */ c("div", {
361
401
  ...e,
362
402
  "data-imf-ui-component": "Tabs.PanelViewport",
363
- className: W({ className: e.className })
403
+ className: le({
404
+ appearance: t,
405
+ className: e.className
406
+ })
364
407
  });
365
408
  }
366
409
  Q.displayName = "Tabs.PanelViewport";
367
410
  function $(t) {
368
- return /* @__PURE__ */ s(h.Panel, {
411
+ let n = p(G);
412
+ return /* @__PURE__ */ c(h.Panel, {
369
413
  ...t,
370
414
  "data-imf-ui-component": "Tabs.Panel",
371
- className: (n) => G({ className: e(t.className, n) })
415
+ className: (r) => ue({
416
+ appearance: n,
417
+ className: e(t.className, r)
418
+ })
372
419
  });
373
420
  }
374
421
  $.displayName = "Tabs.Panel";
375
422
  //#endregion
376
- export { v as _, J as a, L as c, j as d, ae as f, te as g, b as h, Q as i, P as l, ne as m, Y as n, X as o, ie as p, $ as r, z as s, Z as t, A as u };
423
+ export { y as _, J as a, R as c, M as d, O as f, C as g, E as h, Q as i, L as l, oe as m, Y as n, X as o, k as p, $ as r, B as s, Z as t, F as u, v, _ as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imfusion/web-ui",
3
- "version": "0.11.1-dev.33.gefbd75be",
3
+ "version": "0.11.1-dev.37.gdba3f9f4",
4
4
  "description": "The official Web UI component library for ImFusion web apps",
5
5
  "author": "ImFusion GmbH",
6
6
  "homepage": "https://imfusion.com",