@imfusion/web-ui 0.5.1-dev.6.gece7a7b5 → 0.6.0

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.
Files changed (98) hide show
  1. package/README.md +90 -43
  2. package/bin/install.js +428 -0
  3. package/bin/install.test.ts +329 -0
  4. package/dist/build/vite-css-module-names/index.d.ts +20 -0
  5. package/dist/build/vite-css-module-names.js +17 -0
  6. package/dist/chunk-DmhlhrBa.js +11 -0
  7. package/dist/code-Blo48PGr.js +136 -0
  8. package/dist/codegen/gen-icons.d.ts +24 -0
  9. package/dist/components/callout/callout.d.ts +1 -1
  10. package/dist/components/chip-link/chip-link.d.ts +1 -1
  11. package/dist/components/code/code.d.ts +10 -18
  12. package/dist/components/field/field.d.ts +104 -0
  13. package/dist/components/field/field.meta.d.ts +2 -0
  14. package/dist/components/field/index.d.ts +2 -0
  15. package/dist/components/fieldset/fieldset.d.ts +29 -0
  16. package/dist/components/fieldset/fieldset.meta.d.ts +2 -0
  17. package/dist/components/fieldset/index.d.ts +2 -0
  18. package/dist/components/icon/icon.d.ts +16 -0
  19. package/dist/components/icon/icon.meta.d.ts +2 -0
  20. package/dist/components/icon/index.d.ts +4 -0
  21. package/dist/components/icon/types.d.ts +2 -0
  22. package/dist/components/input/input.d.ts +3 -1
  23. package/dist/components/typo/typo.d.ts +2 -2
  24. package/dist/docgen/component-sources.d.ts +7 -0
  25. package/dist/hooks/index.d.ts +1 -0
  26. package/dist/hooks/use-resize-observer.d.ts +2 -0
  27. package/dist/icons/catalog.gen.d.ts +8357 -0
  28. package/dist/icons/icon-config-provider.d.ts +8 -0
  29. package/dist/icons/icon-context.d.ts +4 -0
  30. package/dist/icons/icons.gen.d.ts +1672 -0
  31. package/dist/icons/index.d.ts +3 -0
  32. package/dist/icons-wBmF0U2x.js +78 -0
  33. package/dist/icons.js +2 -0
  34. package/dist/index.d.ts +4 -1
  35. package/dist/index.js +1793 -12210
  36. package/dist/integrations/code-highlight/code-highlight.d.ts +8 -6
  37. package/dist/integrations/code-highlight/highlighter.d.ts +32 -3
  38. package/dist/integrations/code-highlight/language-patterns.d.ts +7 -0
  39. package/dist/integrations/code-highlight/languages/cmake.d.ts +1 -0
  40. package/dist/integrations/code-highlight/languages/cpp.d.ts +1 -0
  41. package/dist/integrations/code-highlight/languages/python.d.ts +1 -0
  42. package/dist/integrations/code-highlight.js +198 -59
  43. package/dist/integrations/image-display-options.js +70 -69
  44. package/dist/llms/gen-tokens.d.ts +7 -0
  45. package/dist/meta-CySnRuVp.js +21 -0
  46. package/dist/provider/web-ui-provider.d.ts +4 -1
  47. package/dist/style.css +1 -1
  48. package/dist/tabs-CMKvMF4E.js +369 -0
  49. package/package.json +48 -26
  50. package/src/docgen/doc.gen.json +381 -38
  51. package/src/llms/icon-catalog.gen.json +11203 -0
  52. package/src/llms/install-templates/AGENTS.md +34 -0
  53. package/src/llms/install-templates/codex-hooks.json +44 -0
  54. package/src/llms/install-templates/hooks/baseline-staleness.sh +17 -0
  55. package/src/llms/install-templates/hooks/session-start.sh +5 -0
  56. package/src/llms/install-templates/hooks/stop.sh +18 -0
  57. package/src/llms/install-templates/hooks/subagent-start.sh +5 -0
  58. package/src/llms/install-templates/hooks/user-prompt-submit.sh +5 -0
  59. package/src/llms/install-templates/settings.json +45 -0
  60. package/src/llms/llms.gen.txt +17 -0
  61. package/src/llms/skills/imf-web-ui/SKILL.md +13 -12
  62. package/src/llms/skills/imf-web-ui-audit/SKILL.md +119 -0
  63. package/src/llms/skills/imf-web-ui-components/SKILL.md +56 -3
  64. package/src/llms/skills/imf-web-ui-conventions/SKILL.md +57 -0
  65. package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +141 -0
  66. package/src/llms/skills/imf-web-ui-conventions/templates/REPORT.md +45 -0
  67. package/src/llms/skills/imf-web-ui-conventions/topics/agent-tooling.md +82 -0
  68. package/src/llms/skills/imf-web-ui-conventions/topics/assets.md +27 -0
  69. package/src/llms/skills/imf-web-ui-conventions/topics/authentication.md +65 -0
  70. package/src/llms/skills/imf-web-ui-conventions/topics/class-names.md +50 -0
  71. package/src/llms/skills/imf-web-ui-conventions/topics/components.md +101 -0
  72. package/src/llms/skills/imf-web-ui-conventions/topics/data.md +221 -0
  73. package/src/llms/skills/imf-web-ui-conventions/topics/docs-structure.md +40 -0
  74. package/src/llms/skills/imf-web-ui-conventions/topics/git.md +34 -0
  75. package/src/llms/skills/imf-web-ui-conventions/topics/library-boundary.md +35 -0
  76. package/src/llms/skills/imf-web-ui-conventions/topics/library-setup.md +26 -0
  77. package/src/llms/skills/imf-web-ui-conventions/topics/npm-project.md +53 -0
  78. package/src/llms/skills/imf-web-ui-conventions/topics/project-structure.md +44 -0
  79. package/src/llms/skills/imf-web-ui-conventions/topics/react.md +109 -0
  80. package/src/llms/skills/imf-web-ui-conventions/topics/styling.md +88 -0
  81. package/src/llms/skills/imf-web-ui-conventions/topics/testing.md +25 -0
  82. package/src/llms/skills/imf-web-ui-conventions/topics/tokens.md +7 -0
  83. package/src/llms/skills/imf-web-ui-conventions/topics/tooling.md +116 -0
  84. package/src/llms/skills/imf-web-ui-conventions/topics/typescript.md +73 -0
  85. package/src/llms/skills/imf-web-ui-conventions/topics/validation.md +62 -0
  86. package/src/llms/skills/imf-web-ui-setup/SKILL.md +67 -37
  87. package/src/llms/skills/imf-web-ui-update/SKILL.md +157 -0
  88. package/src/llms/skills/imf-web-ui-ux/SKILL.md +4 -4
  89. package/src/llms/skills/imf-web-ui-ux/references/forms.md +2 -2
  90. package/src/llms/tokens.gen.json +887 -0
  91. package/bin/install-skill.js +0 -180
  92. package/dist/code-qBbqAHK-.js +0 -190
  93. package/dist/meta-B8C51eyL.js +0 -74
  94. package/dist/tabs-DqBFSqq6.js +0 -3789
  95. package/src/llms/skills/imf-web-ui-frontend-patterns/SKILL.md +0 -93
  96. package/src/llms/skills/imf-web-ui-frontend-patterns/references/code-conventions.md +0 -133
  97. package/src/llms/skills/imf-web-ui-frontend-patterns/references/react-patterns.md +0 -94
  98. package/src/llms/skills/imf-web-ui-imfusion-frontend-setup/SKILL.md +0 -201
@@ -1,20 +1,22 @@
1
1
  import { Code } from '../../components/code';
2
2
  import { SupportedLanguage } from './highlighter';
3
- type BlockProps = Omit<React.ComponentProps<typeof Code.Block>, "highlighted" | "language"> & {
3
+ type BlockProps = Omit<React.ComponentProps<typeof Code.Block>, "children" | "language"> & {
4
4
  /** Language of `children`: grammar for tokenization and label for the corner notch. Omit to hide the notch and skip highlighting. */
5
+ children: string;
5
6
  language?: SupportedLanguage;
6
7
  };
7
- /** Code.Block — the core `Code.Block` with TanStack Highlight tokens filling its `highlighted` slot. */
8
- export declare function Block({ language, children, ...props }: BlockProps): import("react/jsx-runtime").JSX.Element;
8
+ /** Code.Block — the core `Code.Block` with TanStack Highlight tokens rendered inside. */
9
+ export declare function Block({ language, children, ...props }: BlockProps): import('react').FunctionComponentElement<any>;
9
10
  export declare namespace Block {
10
11
  var displayName: string;
11
12
  }
12
- type InlineProps = Omit<React.ComponentProps<typeof Code.Inline>, "highlighted"> & {
13
+ type InlineProps = Omit<React.ComponentProps<typeof Code.Inline>, "children"> & {
13
14
  /** Grammar used to tokenize the fragment. Purely visual — the chip shows no language label. Omit for plain text. */
15
+ children: string;
14
16
  language?: SupportedLanguage;
15
17
  };
16
- /** Code.Inline — the core `Code.Inline` with TanStack Highlight tokens filling its `highlighted` slot. */
17
- export declare function Inline({ language, children, ...props }: InlineProps): import("react/jsx-runtime").JSX.Element;
18
+ /** Code.Inline — the core `Code.Inline` with TanStack Highlight tokens rendered inside. */
19
+ export declare function Inline({ language, children, ...props }: InlineProps): import('react').FunctionComponentElement<any>;
18
20
  export declare namespace Inline {
19
21
  var displayName: string;
20
22
  }
@@ -1,6 +1,35 @@
1
- export declare const SUPPORTED_LANGUAGES: readonly ["tsx", "ts", "css", "shell", "json"];
2
- declare const LANGUAGE_ALIASES: readonly ["typescript", "bash", "sh", "zsh", "shellscript", "scss"];
3
- export type SupportedLanguage = (typeof SUPPORTED_LANGUAGES)[number] | (typeof LANGUAGE_ALIASES)[number];
1
+ declare const LANGUAGE_DEFINITIONS: {
2
+ readonly tsx: {
3
+ readonly aliases: readonly ["typescriptreact"];
4
+ };
5
+ readonly ts: {
6
+ readonly aliases: readonly ["typescript"];
7
+ };
8
+ readonly css: {
9
+ readonly aliases: readonly ["scss"];
10
+ };
11
+ readonly shell: {
12
+ readonly aliases: readonly ["bash", "sh", "zsh", "shellscript"];
13
+ };
14
+ readonly json: {
15
+ readonly aliases: readonly [];
16
+ };
17
+ readonly cpp: {
18
+ readonly aliases: readonly ["c++", "cc", "cxx", "hpp"];
19
+ };
20
+ readonly python: {
21
+ readonly aliases: readonly ["py"];
22
+ };
23
+ readonly cmake: {
24
+ readonly aliases: readonly [];
25
+ };
26
+ };
27
+ export declare const SUPPORTED_LANGUAGES: string[];
28
+ type CanonicalLanguage = keyof typeof LANGUAGE_DEFINITIONS;
29
+ type LanguageAlias = {
30
+ [Language in CanonicalLanguage]: (typeof LANGUAGE_DEFINITIONS)[Language]["aliases"][number];
31
+ }[CanonicalLanguage];
32
+ export type SupportedLanguage = CanonicalLanguage | LanguageAlias;
4
33
  export declare function isSupportedLanguage(value: string): value is SupportedLanguage;
5
34
  export declare function highlightToHtml(code: string, language: SupportedLanguage): string;
6
35
  export {};
@@ -0,0 +1,7 @@
1
+ import { HighlightTokenClass, TokenRange } from '@tanstack/highlight/core';
2
+ export type LanguagePattern = {
3
+ className: HighlightTokenClass;
4
+ group?: number;
5
+ regex: RegExp;
6
+ };
7
+ export declare function collectPatternRanges(code: string, patterns: readonly LanguagePattern[], initialRanges?: readonly TokenRange[]): TokenRange[];
@@ -0,0 +1 @@
1
+ export declare const cmake: import('@tanstack/highlight/core').LanguageDefinition<"cmake">;
@@ -0,0 +1 @@
1
+ export declare const cpp: import('@tanstack/highlight/core').LanguageDefinition<"cpp">;
@@ -0,0 +1 @@
1
+ export declare const python: import('@tanstack/highlight/core').LanguageDefinition<"python">;
@@ -1,84 +1,223 @@
1
- import { a as e, t } from "../meta-B8C51eyL.js";
2
- import { i as n, n as r, r as i } from "../code-qBbqAHK-.js";
3
- import { useMemo as a } from "react";
4
- import { jsx as o } from "react/jsx-runtime";
5
- import { createHighlighter as s, renderNodesToHtml as c, renderTokens as l } from "@tanstack/highlight/core";
6
- import { css as u } from "@tanstack/highlight/languages/css";
7
- import { json as d } from "@tanstack/highlight/languages/json";
8
- import { plaintext as f } from "@tanstack/highlight/languages/plaintext";
9
- import { shell as p } from "@tanstack/highlight/languages/shell";
10
- import { ts as m } from "@tanstack/highlight/languages/ts";
11
- import { tsx as h } from "@tanstack/highlight/languages/tsx";
12
- //#region src/integrations/code-highlight/highlighter.ts
13
- var g = [
14
- "tsx",
15
- "ts",
16
- "css",
17
- "shell",
18
- "json"
19
- ], _ = [
20
- "typescript",
21
- "bash",
22
- "sh",
23
- "zsh",
24
- "shellscript",
25
- "scss"
26
- ], v = [...g, ..._];
27
- function y(e) {
28
- return v.includes(e);
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
+ import { createHighlighter as c, defineLanguage as l, renderNodesToHtml as u, renderTokens as d } from "@tanstack/highlight/core";
7
+ import { css as f } from "@tanstack/highlight/languages/css";
8
+ import { json as p } from "@tanstack/highlight/languages/json";
9
+ import { plaintext as m } from "@tanstack/highlight/languages/plaintext";
10
+ import { shell as h } from "@tanstack/highlight/languages/shell";
11
+ import { ts as g } from "@tanstack/highlight/languages/ts";
12
+ import { tsx as _ } from "@tanstack/highlight/languages/tsx";
13
+ import { python as v } from "@tanstack/highlight/languages/python";
14
+ //#region src/integrations/code-highlight/language-patterns.ts
15
+ function y(e, t, n = []) {
16
+ let r = [], i = new Uint8Array(e.length);
17
+ for (let { start: e, end: t } of n) i.fill(1, e, t);
18
+ for (let n of t) {
19
+ let t = new RegExp(n.regex.source, n.regex.flags.includes("g") ? n.regex.flags : `${n.regex.flags}g`), a;
20
+ for (; (a = t.exec(e)) !== null;) {
21
+ let e = n.group == null ? a[0] : a[n.group];
22
+ if (e === "") {
23
+ a[0] === "" && (t.lastIndex += 1);
24
+ continue;
25
+ }
26
+ let o = n.group == null ? 0 : a[0].indexOf(e), s = a.index + o, c = s + e.length;
27
+ if (s < c) {
28
+ let e = !1;
29
+ for (let t = s; t < c; t += 1) if (i[t]) {
30
+ e = !0;
31
+ break;
32
+ }
33
+ e || (r.push({
34
+ start: s,
35
+ end: c,
36
+ className: n.className
37
+ }), i.fill(1, s, c));
38
+ }
39
+ }
40
+ }
41
+ return r;
42
+ }
43
+ //#endregion
44
+ //#region src/integrations/code-highlight/languages/cmake.ts
45
+ var b = [
46
+ {
47
+ className: "string",
48
+ regex: /"(?:\\.|[^"\\\n])*"|\[(=*)\[[\s\S]*?\]\1\]/g
49
+ },
50
+ {
51
+ className: "comment",
52
+ regex: /#[^\n]*/g
53
+ },
54
+ {
55
+ className: "variable",
56
+ regex: /\$(?:ENV|CACHE)?\{[^}\n]+\}/g
57
+ },
58
+ {
59
+ className: "keyword",
60
+ regex: /\b(?:break|continue|else|elseif|endforeach|endfunction|endif|endmacro|endwhile|if|include|macro|return|while)\b/gi
61
+ },
62
+ {
63
+ className: "literal",
64
+ regex: /\b(?:FALSE|IGNORE|NOTFOUND|NO|OFF|ON|TRUE|YES)\b/gi
65
+ },
66
+ {
67
+ className: "function",
68
+ regex: /\b[A-Za-z_][\w-]*(?=\s*\()/g
69
+ },
70
+ {
71
+ className: "number",
72
+ regex: /\b\d+(?:\.\d+)?\b/g
73
+ },
74
+ {
75
+ className: "operator",
76
+ regex: /(?:LESS_EQUAL|GREATER_EQUAL|STREQUAL|IN_LIST|MATCHES|EQUAL|LESS|GREATER|AND|OR|NOT|[=<>+*/!-])/gi
77
+ }
78
+ ], x = l({
79
+ name: "cmake",
80
+ tokenize(e) {
81
+ return y(e, b);
82
+ }
83
+ }), S = [
84
+ {
85
+ className: "comment",
86
+ regex: /\/\/[^\n]*|\/\*[\s\S]*?\*\//g
87
+ },
88
+ {
89
+ className: "string",
90
+ regex: /"(?:\\.|[^"\\\n])*"|'(?:\\.|[^'\\\n])*'/g
91
+ },
92
+ {
93
+ className: "meta",
94
+ regex: /^[ \t]*#[ \t]*(?:include|define|if|ifdef|ifndef|elif|else|endif|pragma|undef|error|warning)\b/gm
95
+ },
96
+ {
97
+ className: "keyword",
98
+ regex: /\b(?:alignas|alignof|and|asm|atomic_cancel|atomic_commit|atomic_noexcept|auto|bitand|bitor|break|case|catch|co_await|co_return|co_yield|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|default|delete|do|dynamic_cast|else|enum|explicit|export|extern|for|friend|goto|if|inline|mutable|namespace|new|noexcept|not|operator|or|private|protected|public|reflexpr|register|reinterpret_cast|requires|return|sizeof|static|static_assert|static_cast|struct|switch|synchronized|template|this|thread_local|throw|try|typedef|typeid|typename|union|using|virtual|volatile|while|xor)\b/g
99
+ },
100
+ {
101
+ className: "type",
102
+ regex: /\b(?:bool|char|char8_t|char16_t|char32_t|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/g
103
+ },
104
+ {
105
+ className: "literal",
106
+ regex: /\b(?:NULL|nullptr|true|false)\b/g
107
+ },
108
+ {
109
+ className: "function",
110
+ regex: /\b[A-Za-z_]\w*(?=\s*\()/g
111
+ },
112
+ {
113
+ className: "number",
114
+ regex: /\b(?:0[xX][\da-fA-F']+|0[bB][01']+|\d[\d']*(?:\.\d[\d']*)?(?:[eE][+-]?\d[\d']*)?[uUlLfF]*)\b/g
115
+ },
116
+ {
117
+ className: "operator",
118
+ regex: /(?:<<=?|>>=?|->\*|->|\+\+|--|&&|\|\||==|!=|<=|>=|::|\+=|-=|\*=|\/=|%=|&=|\|=|\^=|[-+*/%=&|^!<>?:~])/g
119
+ }
120
+ ], C = l({
121
+ name: "cpp",
122
+ aliases: [
123
+ "c++",
124
+ "cc",
125
+ "cxx",
126
+ "hpp"
127
+ ],
128
+ tokenize(e) {
129
+ return y(e, S);
130
+ }
131
+ }), w = [{
132
+ className: "function",
133
+ regex: /\b[A-Za-z_]\w*(?=\s*\()/g
134
+ }], T = l({
135
+ name: "python",
136
+ aliases: ["py"],
137
+ tokenize(e, t) {
138
+ let n = v.tokenize(e, t), r = y(e, w, n);
139
+ return [...n, ...r];
140
+ }
141
+ }), E = {
142
+ tsx: { aliases: ["typescriptreact"] },
143
+ ts: { aliases: ["typescript"] },
144
+ css: { aliases: ["scss"] },
145
+ shell: { aliases: [
146
+ "bash",
147
+ "sh",
148
+ "zsh",
149
+ "shellscript"
150
+ ] },
151
+ json: { aliases: [] },
152
+ cpp: { aliases: [
153
+ "c++",
154
+ "cc",
155
+ "cxx",
156
+ "hpp"
157
+ ] },
158
+ python: { aliases: ["py"] },
159
+ cmake: { aliases: [] }
160
+ }, D = Object.keys(E), O = [...D, ...Object.values(E).flatMap(({ aliases: e }) => e)];
161
+ function k(e) {
162
+ return O.includes(e);
163
+ }
164
+ function A(e, t) {
165
+ return e.aliases.includes(t);
166
+ }
167
+ function j(e) {
168
+ for (let [t, n] of Object.entries(E)) if (A(n, e)) return t;
169
+ return e;
29
170
  }
30
- var b = {
31
- shellscript: "shell",
32
- scss: "css"
33
- }, x = s({
171
+ var M = c({
34
172
  languages: [
173
+ _,
174
+ g,
175
+ f,
35
176
  h,
36
- m,
37
- u,
38
177
  p,
39
- d,
40
- f
178
+ C,
179
+ T,
180
+ x,
181
+ m
41
182
  ],
42
183
  fallbackLanguage: "plaintext"
43
184
  });
44
- function S(e, t) {
45
- let n = b[t] ?? t, { tokens: r } = x.tokenize(e, { lang: n });
46
- return c(l(r));
185
+ function N(e, t) {
186
+ let n = j(t), { tokens: r } = M.tokenize(e, { lang: n });
187
+ return u(d(r));
47
188
  }
48
189
  //#endregion
49
190
  //#region src/integrations/code-highlight/code-highlight.tsx
50
- var C = /* @__PURE__ */ e({
51
- Block: () => T,
52
- Inline: () => E,
191
+ var P = /* @__PURE__ */ e({
192
+ Block: () => I,
193
+ Inline: () => L,
53
194
  InlineLink: () => n
54
195
  });
55
- function w(e, t) {
56
- return a(() => {
57
- if (!(t == null || e === "")) return /* @__PURE__ */ o("span", { dangerouslySetInnerHTML: { __html: S(e, t) } });
196
+ function F(e, t) {
197
+ return s(() => {
198
+ if (!(t == null || e === "")) return /* @__PURE__ */ a("span", { dangerouslySetInnerHTML: { __html: N(e, t) } });
58
199
  }, [e, t]);
59
200
  }
60
- function T({ language: e, children: t, ...n }) {
61
- let i = w(t, e);
62
- return /* @__PURE__ */ o(r, {
201
+ function I({ language: e, children: t, ...n }) {
202
+ let i = F(t, e);
203
+ return o(/* @__PURE__ */ a(r, {
63
204
  ...n,
64
205
  language: e,
65
- highlighted: i,
66
206
  children: t
67
- });
207
+ }), { children: i ?? t });
68
208
  }
69
- T.displayName = "Code.Block";
70
- function E({ language: e, children: t, ...n }) {
71
- let r = w(t, e);
72
- return /* @__PURE__ */ o(i, {
209
+ I.displayName = "Code.Block";
210
+ function L({ language: e, children: t, ...n }) {
211
+ let r = F(t, e);
212
+ return o(/* @__PURE__ */ a(i, {
73
213
  ...n,
74
- highlighted: r,
75
214
  children: t
76
- });
215
+ }), { children: r ?? t });
77
216
  }
78
- E.displayName = "Code.Inline";
217
+ L.displayName = "Code.Inline";
79
218
  //#endregion
80
219
  //#region src/integrations/code-highlight/code-highlight.meta.ts
81
- var D = {
220
+ var R = {
82
221
  name: "CodeHighlight",
83
222
  category: t.display,
84
223
  status: "experimental",
@@ -94,4 +233,4 @@ var D = {
94
233
  }
95
234
  };
96
235
  //#endregion
97
- export { C as Code, g as SUPPORTED_LANGUAGES, D as codeHighlightMeta, y as isSupportedLanguage };
236
+ export { P as Code, D as SUPPORTED_LANGUAGES, R as codeHighlightMeta, k as isSupportedLanguage };
@@ -1,7 +1,8 @@
1
- import { n as e, t } from "../meta-B8C51eyL.js";
2
- import { C as n, S as r, a as i, b as a, c as o, d as s, g as c, h as l, i as u, l as d, n as f, o as p, p as m, r as h, t as g, v as _, w as v, x as y, y as b } from "../tabs-DqBFSqq6.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 = e(k.root);
75
- function L({ spec: e, value: t, row: i, onChange: o }) {
76
- let s = /* @__PURE__ */ E(y, {
77
- value: t,
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,
78
79
  min: e.min,
79
80
  max: e.max,
80
81
  step: e.step,
81
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(d, {
86
+ children: [/* @__PURE__ */ C(u, {
86
87
  justify: "between",
87
- children: [/* @__PURE__ */ T(a, { children: e.label }), /* @__PURE__ */ T(v, {})]
88
- }), /* @__PURE__ */ T(_, { children: /* @__PURE__ */ E(n, { children: [/* @__PURE__ */ T(b, {}), /* @__PURE__ */ T(r, { "aria-label": e.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 i ? /* @__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(d, {
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(l, {
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(c, {})
113
+ children: /* @__PURE__ */ S(p, {})
113
114
  })]
114
115
  });
115
116
  }
116
117
  function z({ active: e, onChange: t }) {
117
- return /* @__PURE__ */ E(s, {
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(m, {
126
+ children: [/* @__PURE__ */ S(a, {
126
127
  value: "2d",
127
128
  children: "2D"
128
- }), /* @__PURE__ */ T(m, {
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,115 +149,115 @@ 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: n, ranges: r, onOptionsChange: a, className: s, ...c }) {
152
- let [l, m] = C("2d"), _ = N(n, r), v = (e) => {
153
- m(e === "3d" ? "3d" : "2d");
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) => {
154
+ g(e === "3d" ? "3d" : "2d");
154
155
  };
155
- return /* @__PURE__ */ T("div", {
156
+ return /* @__PURE__ */ S("div", {
156
157
  ...c,
157
158
  "data-imf-ui-component": "ImageDisplayOptions",
158
159
  className: I({ className: s }),
159
- children: e === "default" ? /* @__PURE__ */ E(i, {
160
- value: l,
160
+ children: e === "default" ? /* @__PURE__ */ C(n, {
161
+ value: p,
161
162
  onValueChange: v,
162
- children: [/* @__PURE__ */ E(f, { children: [
163
- /* @__PURE__ */ T(p, {
163
+ children: [/* @__PURE__ */ C(d, { children: [
164
+ /* @__PURE__ */ S(f, {
164
165
  value: "2d",
165
166
  children: "2D Slices"
166
167
  }),
167
- /* @__PURE__ */ T(p, {
168
+ /* @__PURE__ */ S(f, {
168
169
  value: "3d",
169
170
  children: "3D Volume"
170
171
  }),
171
- /* @__PURE__ */ T(g, {})
172
- ] }), /* @__PURE__ */ E(u, { children: [/* @__PURE__ */ T(h, {
172
+ /* @__PURE__ */ S(h, {})
173
+ ] }), /* @__PURE__ */ C(l, { children: [/* @__PURE__ */ S(m, {
173
174
  value: "2d",
174
- children: /* @__PURE__ */ T(o, {
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,
180
181
  row: !1,
181
- onChange: a
182
+ onChange: o
182
183
  })
183
184
  })
184
- }), /* @__PURE__ */ T(h, {
185
+ }), /* @__PURE__ */ S(m, {
185
186
  value: "3d",
186
- children: /* @__PURE__ */ T(o, {
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,
192
193
  row: !1,
193
- onChange: a
194
+ onChange: o
194
195
  })
195
196
  })
196
197
  })] })]
197
- }) : e === "horizontal" ? /* @__PURE__ */ E(i, {
198
+ }) : e === "horizontal" ? /* @__PURE__ */ C(n, {
198
199
  className: k.horizontalTabs,
199
200
  orientation: "vertical",
200
- value: l,
201
+ value: p,
201
202
  onValueChange: v,
202
- children: [/* @__PURE__ */ E(f, {
203
+ children: [/* @__PURE__ */ C(d, {
203
204
  fill: !0,
204
205
  children: [
205
- /* @__PURE__ */ T(p, {
206
+ /* @__PURE__ */ S(f, {
206
207
  value: "2d",
207
208
  children: "2D"
208
209
  }),
209
- /* @__PURE__ */ T(p, {
210
+ /* @__PURE__ */ S(f, {
210
211
  value: "3d",
211
212
  children: "3D"
212
213
  }),
213
- /* @__PURE__ */ T(g, {})
214
+ /* @__PURE__ */ S(h, {})
214
215
  ]
215
- }), /* @__PURE__ */ E(u, {
216
+ }), /* @__PURE__ */ C(l, {
216
217
  className: k.horizontalPanel,
217
- children: [/* @__PURE__ */ T(h, {
218
+ children: [/* @__PURE__ */ S(m, {
218
219
  value: "2d",
219
- children: /* @__PURE__ */ T(d, {
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,
227
228
  row: !0,
228
- onChange: a
229
+ onChange: o
229
230
  })
230
231
  })
231
- }), /* @__PURE__ */ T(h, {
232
+ }), /* @__PURE__ */ S(m, {
232
233
  value: "3d",
233
- children: /* @__PURE__ */ T(d, {
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,
241
242
  row: !0,
242
- onChange: a
243
+ onChange: o
243
244
  })
244
245
  })
245
246
  })]
246
247
  })]
247
- }) : /* @__PURE__ */ E(d, {
248
+ }) : /* @__PURE__ */ C(u, {
248
249
  align: "center",
249
250
  gap: "3",
250
251
  className: k.compactStrip,
251
- children: [/* @__PURE__ */ T(z, {
252
- active: l,
253
- onChange: m
254
- }), /* @__PURE__ */ T(B, {
255
- dimension: l,
256
- fields: _[l],
252
+ children: [/* @__PURE__ */ S(z, {
253
+ active: p,
254
+ onChange: g
255
+ }), /* @__PURE__ */ S(B, {
256
+ dimension: p,
257
+ fields: _[p],
257
258
  options: t,
258
259
  row: !0,
259
- onChange: a
260
+ onChange: o
260
261
  })]
261
262
  })
262
263
  });
@@ -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: t.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",