@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.
@@ -1,8 +1,8 @@
1
- import { n as e } from "../chunk-DA_OvQe2.js";
2
- import { t } from "../meta-BwCupYyq.js";
3
- import { i as n, n as r, r as i } from "../code-BRy_lg-h.js";
4
- import { cloneElement as a, useMemo as o } from "react";
5
- import { jsx as s } from "react/jsx-runtime";
1
+ import { t as e } from "../chunk-DmhlhrBa.js";
2
+ import { t } from "../meta-CySnRuVp.js";
3
+ import { i as n, n as r, r as i } from "../code-Blo48PGr.js";
4
+ import { jsx as a } from "react/jsx-runtime";
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
8
  import { json as p } from "@tanstack/highlight/languages/json";
@@ -194,13 +194,13 @@ var P = /* @__PURE__ */ e({
194
194
  InlineLink: () => n
195
195
  });
196
196
  function F(e, t) {
197
- return o(() => {
198
- if (!(t == null || e === "")) return /* @__PURE__ */ s("span", { dangerouslySetInnerHTML: { __html: N(e, t) } });
197
+ return s(() => {
198
+ if (!(t == null || e === "")) return /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html: N(e, t) } });
199
199
  }, [e, t]);
200
200
  }
201
201
  function I({ language: e, children: t, ...n }) {
202
202
  let i = F(t, e);
203
- return a(/* @__PURE__ */ s(r, {
203
+ return o(/* @__PURE__ */ a(r, {
204
204
  ...n,
205
205
  language: e,
206
206
  children: t
@@ -209,7 +209,7 @@ function I({ language: e, children: t, ...n }) {
209
209
  I.displayName = "Code.Block";
210
210
  function L({ language: e, children: t, ...n }) {
211
211
  let r = F(t, e);
212
- return a(/* @__PURE__ */ s(i, {
212
+ return o(/* @__PURE__ */ a(i, {
213
213
  ...n,
214
214
  children: t
215
215
  }), { children: r ?? t });
@@ -1,7 +1,8 @@
1
- import { C as e, S as t, a as n, b as r, c as i, d as a, g as o, h as s, i as c, l, n as u, o as d, p as f, r as p, t as m, v as h, w as g, x as _, y as v } from "../tabs-CYqtw1q9.js";
2
- import { n as y, t as b } from "../meta-BwCupYyq.js";
3
- import { useId as x, useMemo as S, useState as C } from "react";
4
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
1
+ import { t as e } from "../meta-CySnRuVp.js";
2
+ import { _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, n as d, o as f, p, r as m, t as h, u as g, v as _, x as v, y } from "../tabs-CMKvMF4E.js";
3
+ import { cva as b } from "class-variance-authority";
4
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
5
+ import { useId as w, useMemo as T, useState as E } from "react";
5
6
  import { useDisplayOptions2d as D, useDisplayOptions3d as O } from "@imfusion/sdk-react";
6
7
  var k = {
7
8
  compactStrip: "imf-ui-image-display-options-module-compactStrip",
@@ -71,50 +72,50 @@ function F(e, t) {
71
72
  }
72
73
  //#endregion
73
74
  //#region src/integrations/image-display-options/image-display-options-view.tsx
74
- var I = y(k.root);
75
- function L({ spec: n, value: i, row: a, onChange: o }) {
76
- let s = /* @__PURE__ */ E(_, {
77
- value: i,
78
- min: n.min,
79
- max: n.max,
80
- step: n.step,
81
- format: n.format,
75
+ var I = b(k.root);
76
+ function L({ spec: e, value: n, row: i, onChange: a }) {
77
+ let o = /* @__PURE__ */ C(_, {
78
+ value: n,
79
+ min: e.min,
80
+ max: e.max,
81
+ step: e.step,
82
+ format: e.format,
82
83
  onValueChange: (e) => {
83
- o(typeof e == "number" ? e : e[0]);
84
+ a(typeof e == "number" ? e : e[0]);
84
85
  },
85
- children: [/* @__PURE__ */ E(l, {
86
+ children: [/* @__PURE__ */ C(u, {
86
87
  justify: "between",
87
- children: [/* @__PURE__ */ T(r, { children: n.label }), /* @__PURE__ */ T(g, {})]
88
- }), /* @__PURE__ */ T(h, { children: /* @__PURE__ */ E(e, { children: [/* @__PURE__ */ T(v, {}), /* @__PURE__ */ T(t, { "aria-label": n.label })] }) })]
88
+ children: [/* @__PURE__ */ S(t, { children: e.label }), /* @__PURE__ */ S(v, {})]
89
+ }), /* @__PURE__ */ S(c, { children: /* @__PURE__ */ C(r, { children: [/* @__PURE__ */ S(s, {}), /* @__PURE__ */ S(y, { "aria-label": e.label })] }) })]
89
90
  });
90
- return a ? /* @__PURE__ */ T("div", {
91
+ return i ? /* @__PURE__ */ S("div", {
91
92
  className: k.rowField,
92
- children: s
93
- }) : s;
93
+ children: o
94
+ }) : o;
94
95
  }
95
96
  function R({ checked: e, row: t, onChange: n }) {
96
- let r = x();
97
- return /* @__PURE__ */ E(l, {
97
+ let r = w();
98
+ return /* @__PURE__ */ C(u, {
98
99
  align: "center",
99
100
  justify: t ? "start" : "between",
100
101
  gap: "2",
101
102
  className: k.invertRow,
102
- children: [/* @__PURE__ */ T("span", {
103
+ children: [/* @__PURE__ */ S("span", {
103
104
  id: r,
104
105
  className: k.invertLabel,
105
106
  children: "Invert"
106
- }), /* @__PURE__ */ T(s, {
107
+ }), /* @__PURE__ */ S(o, {
107
108
  "aria-labelledby": r,
108
109
  checked: e,
109
110
  onCheckedChange: (e) => {
110
111
  n(e);
111
112
  },
112
- children: /* @__PURE__ */ T(o, {})
113
+ children: /* @__PURE__ */ S(p, {})
113
114
  })]
114
115
  });
115
116
  }
116
117
  function z({ active: e, onChange: t }) {
117
- return /* @__PURE__ */ E(a, {
118
+ return /* @__PURE__ */ C(g, {
118
119
  className: k.segment,
119
120
  "aria-label": "Display dimension",
120
121
  value: [e],
@@ -122,10 +123,10 @@ function z({ active: e, onChange: t }) {
122
123
  let n = e[0];
123
124
  (n === "2d" || n === "3d") && t(n);
124
125
  },
125
- children: [/* @__PURE__ */ T(f, {
126
+ children: [/* @__PURE__ */ S(a, {
126
127
  value: "2d",
127
128
  children: "2D"
128
- }), /* @__PURE__ */ T(f, {
129
+ }), /* @__PURE__ */ S(a, {
129
130
  value: "3d",
130
131
  children: "3D"
131
132
  })]
@@ -133,14 +134,14 @@ function z({ active: e, onChange: t }) {
133
134
  }
134
135
  function B({ dimension: e, fields: t, options: n, row: r, onChange: i }) {
135
136
  let a = n[e];
136
- return /* @__PURE__ */ E(w, { children: [t.map((t) => /* @__PURE__ */ T(L, {
137
+ return /* @__PURE__ */ C(x, { children: [t.map((t) => /* @__PURE__ */ S(L, {
137
138
  spec: t,
138
139
  value: F(a, t.key),
139
140
  row: r,
140
141
  onChange: (n) => {
141
142
  i(e, P(t.key, n));
142
143
  }
143
- }, t.key)), /* @__PURE__ */ T(R, {
144
+ }, t.key)), /* @__PURE__ */ S(R, {
144
145
  checked: a.invert,
145
146
  row: r,
146
147
  onChange: (t) => {
@@ -148,32 +149,32 @@ function B({ dimension: e, fields: t, options: n, row: r, onChange: i }) {
148
149
  }
149
150
  })] });
150
151
  }
151
- function V({ variant: e = "default", options: t, intensityRange: r, ranges: a, onOptionsChange: o, className: s, ...f }) {
152
- let [h, g] = C("2d"), _ = N(r, a), v = (e) => {
152
+ function V({ variant: e = "default", options: t, intensityRange: r, ranges: a, onOptionsChange: o, className: s, ...c }) {
153
+ let [p, g] = E("2d"), _ = N(r, a), v = (e) => {
153
154
  g(e === "3d" ? "3d" : "2d");
154
155
  };
155
- return /* @__PURE__ */ T("div", {
156
- ...f,
156
+ return /* @__PURE__ */ S("div", {
157
+ ...c,
157
158
  "data-imf-ui-component": "ImageDisplayOptions",
158
159
  className: I({ className: s }),
159
- children: e === "default" ? /* @__PURE__ */ E(n, {
160
- value: h,
160
+ children: e === "default" ? /* @__PURE__ */ C(n, {
161
+ value: p,
161
162
  onValueChange: v,
162
- children: [/* @__PURE__ */ E(u, { children: [
163
- /* @__PURE__ */ T(d, {
163
+ children: [/* @__PURE__ */ C(d, { children: [
164
+ /* @__PURE__ */ S(f, {
164
165
  value: "2d",
165
166
  children: "2D Slices"
166
167
  }),
167
- /* @__PURE__ */ T(d, {
168
+ /* @__PURE__ */ S(f, {
168
169
  value: "3d",
169
170
  children: "3D Volume"
170
171
  }),
171
- /* @__PURE__ */ T(m, {})
172
- ] }), /* @__PURE__ */ E(c, { children: [/* @__PURE__ */ T(p, {
172
+ /* @__PURE__ */ S(h, {})
173
+ ] }), /* @__PURE__ */ C(l, { children: [/* @__PURE__ */ S(m, {
173
174
  value: "2d",
174
- children: /* @__PURE__ */ T(i, {
175
+ children: /* @__PURE__ */ S(i, {
175
176
  gap: "3",
176
- children: /* @__PURE__ */ T(B, {
177
+ children: /* @__PURE__ */ S(B, {
177
178
  dimension: "2d",
178
179
  fields: _["2d"],
179
180
  options: t,
@@ -181,11 +182,11 @@ function V({ variant: e = "default", options: t, intensityRange: r, ranges: a, o
181
182
  onChange: o
182
183
  })
183
184
  })
184
- }), /* @__PURE__ */ T(p, {
185
+ }), /* @__PURE__ */ S(m, {
185
186
  value: "3d",
186
- children: /* @__PURE__ */ T(i, {
187
+ children: /* @__PURE__ */ S(i, {
187
188
  gap: "3",
188
- children: /* @__PURE__ */ T(B, {
189
+ children: /* @__PURE__ */ S(B, {
189
190
  dimension: "3d",
190
191
  fields: _["3d"],
191
192
  options: t,
@@ -194,33 +195,33 @@ function V({ variant: e = "default", options: t, intensityRange: r, ranges: a, o
194
195
  })
195
196
  })
196
197
  })] })]
197
- }) : e === "horizontal" ? /* @__PURE__ */ E(n, {
198
+ }) : e === "horizontal" ? /* @__PURE__ */ C(n, {
198
199
  className: k.horizontalTabs,
199
200
  orientation: "vertical",
200
- value: h,
201
+ value: p,
201
202
  onValueChange: v,
202
- children: [/* @__PURE__ */ E(u, {
203
+ children: [/* @__PURE__ */ C(d, {
203
204
  fill: !0,
204
205
  children: [
205
- /* @__PURE__ */ T(d, {
206
+ /* @__PURE__ */ S(f, {
206
207
  value: "2d",
207
208
  children: "2D"
208
209
  }),
209
- /* @__PURE__ */ T(d, {
210
+ /* @__PURE__ */ S(f, {
210
211
  value: "3d",
211
212
  children: "3D"
212
213
  }),
213
- /* @__PURE__ */ T(m, {})
214
+ /* @__PURE__ */ S(h, {})
214
215
  ]
215
- }), /* @__PURE__ */ E(c, {
216
+ }), /* @__PURE__ */ C(l, {
216
217
  className: k.horizontalPanel,
217
- children: [/* @__PURE__ */ T(p, {
218
+ children: [/* @__PURE__ */ S(m, {
218
219
  value: "2d",
219
- children: /* @__PURE__ */ T(l, {
220
+ children: /* @__PURE__ */ S(u, {
220
221
  align: "center",
221
222
  gap: "3",
222
223
  className: k.strip,
223
- children: /* @__PURE__ */ T(B, {
224
+ children: /* @__PURE__ */ S(B, {
224
225
  dimension: "2d",
225
226
  fields: _["2d"],
226
227
  options: t,
@@ -228,13 +229,13 @@ function V({ variant: e = "default", options: t, intensityRange: r, ranges: a, o
228
229
  onChange: o
229
230
  })
230
231
  })
231
- }), /* @__PURE__ */ T(p, {
232
+ }), /* @__PURE__ */ S(m, {
232
233
  value: "3d",
233
- children: /* @__PURE__ */ T(l, {
234
+ children: /* @__PURE__ */ S(u, {
234
235
  align: "center",
235
236
  gap: "3",
236
237
  className: k.strip,
237
- children: /* @__PURE__ */ T(B, {
238
+ children: /* @__PURE__ */ S(B, {
238
239
  dimension: "3d",
239
240
  fields: _["3d"],
240
241
  options: t,
@@ -244,16 +245,16 @@ function V({ variant: e = "default", options: t, intensityRange: r, ranges: a, o
244
245
  })
245
246
  })]
246
247
  })]
247
- }) : /* @__PURE__ */ E(l, {
248
+ }) : /* @__PURE__ */ C(u, {
248
249
  align: "center",
249
250
  gap: "3",
250
251
  className: k.compactStrip,
251
- children: [/* @__PURE__ */ T(z, {
252
- active: h,
252
+ children: [/* @__PURE__ */ S(z, {
253
+ active: p,
253
254
  onChange: g
254
- }), /* @__PURE__ */ T(B, {
255
- dimension: h,
256
- fields: _[h],
255
+ }), /* @__PURE__ */ S(B, {
256
+ dimension: p,
257
+ fields: _[p],
257
258
  options: t,
258
259
  row: !0,
259
260
  onChange: o
@@ -277,8 +278,8 @@ function H({ data: e, variant: t = "default", ranges: n, ...r }) {
277
278
  level: a.level,
278
279
  invert: a.invert
279
280
  }
280
- }, s = S(() => e.minmaxIntensityOriginal(), [e]);
281
- return /* @__PURE__ */ T(V, {
281
+ }, s = T(() => e.minmaxIntensityOriginal(), [e]);
282
+ return /* @__PURE__ */ S(V, {
282
283
  ...r,
283
284
  variant: t,
284
285
  options: o,
@@ -294,7 +295,7 @@ H.displayName = "ImageDisplayOptions";
294
295
  //#region src/integrations/image-display-options/image-display-options.meta.ts
295
296
  var U = {
296
297
  name: "ImageDisplayOptions",
297
- category: b.inputs,
298
+ category: e.inputs,
298
299
  status: "experimental",
299
300
  description: "A panel or toolbar of controls bound to an image dataset's display options.",
300
301
  origin: "adapted",
@@ -0,0 +1,21 @@
1
+ //#region src/types/meta.ts
2
+ var e = {
3
+ buttons: {
4
+ id: "buttons",
5
+ label: "Buttons"
6
+ },
7
+ inputs: {
8
+ id: "inputs",
9
+ label: "Inputs"
10
+ },
11
+ layout: {
12
+ id: "layout",
13
+ label: "Layout"
14
+ },
15
+ display: {
16
+ id: "display",
17
+ label: "Display"
18
+ }
19
+ };
20
+ //#endregion
21
+ export { e as t };