@imfusion/web-ui 0.5.1-dev.50.ga7a4f1c3 → 0.5.1-dev.52.gcaa229a7

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 (41) hide show
  1. package/README.md +1 -1
  2. package/dist/chunk-DA_OvQe2.js +11 -0
  3. package/dist/code-BRy_lg-h.js +135 -0
  4. package/dist/codegen/gen-icons.d.ts +24 -0
  5. package/dist/components/callout/callout.d.ts +1 -1
  6. package/dist/components/chip-link/chip-link.d.ts +1 -1
  7. package/dist/components/code/code.d.ts +10 -18
  8. package/dist/components/icon/icon.d.ts +16 -0
  9. package/dist/components/icon/icon.meta.d.ts +2 -0
  10. package/dist/components/icon/index.d.ts +4 -0
  11. package/dist/components/icon/types.d.ts +2 -0
  12. package/dist/components/input/input.d.ts +3 -1
  13. package/dist/components/typo/typo.d.ts +2 -2
  14. package/dist/docgen/component-sources.d.ts +7 -0
  15. package/dist/hooks/index.d.ts +1 -0
  16. package/dist/hooks/use-resize-observer.d.ts +2 -0
  17. package/dist/icons/catalog.gen.d.ts +8357 -0
  18. package/dist/icons/icon-config-provider.d.ts +8 -0
  19. package/dist/icons/icon-context.d.ts +4 -0
  20. package/dist/icons/icons.gen.d.ts +1672 -0
  21. package/dist/icons/index.d.ts +3 -0
  22. package/dist/icons-BhogvWBV.js +77 -0
  23. package/dist/icons.js +2 -0
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.js +5026 -5059
  26. package/dist/integrations/code-highlight/code-highlight.d.ts +8 -6
  27. package/dist/integrations/code-highlight.js +59 -60
  28. package/dist/integrations/image-display-options.js +56 -56
  29. package/dist/meta-BwCupYyq.js +64 -0
  30. package/dist/provider/web-ui-provider.d.ts +4 -1
  31. package/dist/style.css +1 -1
  32. package/dist/{tabs-CVp_SgBl.js → tabs-CYqtw1q9.js} +2 -1
  33. package/package.json +8 -2
  34. package/src/docgen/doc.gen.json +54 -38
  35. package/src/llms/icon-catalog.gen.json +11203 -0
  36. package/src/llms/llms.gen.txt +5 -0
  37. package/src/llms/skills/imf-web-ui-components/SKILL.md +55 -3
  38. package/src/llms/skills/imf-web-ui-conventions/topics/library-boundary.md +2 -0
  39. package/src/llms/tokens.gen.json +2 -2
  40. package/dist/code-qBbqAHK-.js +0 -190
  41. package/dist/meta-B8C51eyL.js +0 -74
@@ -85,6 +85,11 @@ Semantic grouping for related form controls with a shared legend. Also called a
85
85
  - props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .fieldset (jq: jq '.fieldset' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
86
86
  - further reading (usage/anatomy, not props): https://base-ui.com/react/components/fieldset.md
87
87
 
88
+ ## Icon
89
+ - category: Display, status: stable
90
+ Semantic color wrapper for an icon imported from the Web UI icons entry. Use it when an icon needs a named foreground role instead of the inherited currentColor.
91
+ - props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .icon (jq: jq '.icon' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
92
+
88
93
  ## ImageDisplayOptions
89
94
  - category: Inputs, status: experimental
90
95
  A panel or toolbar of controls bound to an image dataset's display options.
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: imf-web-ui-components
3
3
  description:
4
- "Look up @imfusion/web-ui component APIs without reading their source: the two-hop lookup (identity index -> prop data),
5
- compound components, and integrations. Load when you need the props, sub-components, or defaults of a specific component —
6
- not for choosing between components (imf-web-ui-ux) or first-time setup (imf-web-ui-setup library-setup)."
4
+ "Look up @imfusion/web-ui component APIs and icon glyphs without reading source. Load when you need a component's props,
5
+ sub-components, defaults, or a supplied icon — not for choosing between components (imf-web-ui-ux) or first-time setup
6
+ (imf-web-ui-setup library-setup)."
7
7
  allowed-tools: Bash
8
8
  ---
9
9
 
@@ -16,6 +16,8 @@ reading source or checking out the library's repo:
16
16
  and a one-sentence description of what it's for and what else it's called.
17
17
  - **`node_modules/@imfusion/web-ui/src/docgen/doc.gen.json`** — full prop tables (name, type, default, description) for every
18
18
  component, keyed by kebab-case folder name.
19
+ - **`node_modules/@imfusion/web-ui/src/llms/icon-catalog.gen.json`** — searchable icon names, styles, categories, and tags.
20
+ Read it only when the task needs an icon.
19
21
 
20
22
  Neither file is reachable through the package's pretty import paths (`@imfusion/web-ui/llms.txt`,
21
23
  `@imfusion/web-ui/docgen.json`) — those are Node module-resolution aliases, meaningless to `cat`/`jq`/`grep` reading files
@@ -73,6 +75,56 @@ don't guess at an API — that's a real gap to report, not something to work aro
73
75
  maintainer, or file it in the [WEBSDK Jira project](https://imfusion.atlassian.net/browse/WEBSDK) if you have access. If the
74
76
  gap is about _which_ component to use rather than a missing one, that's a design question: open `imf-web-ui-ux`.
75
77
 
78
+ ## Icons
79
+
80
+ When the task mentions an icon, glyph, symbol, or `@imfusion/web-ui/icons`, query the icon catalog before choosing a name. Do
81
+ not load it for ordinary component work.
82
+
83
+ Search one relevant term at a time, then read only the matching records:
84
+
85
+ ```sh
86
+ node -e '
87
+ const q = process.argv[1].toLowerCase();
88
+ const icons = JSON.parse(
89
+ require("fs").readFileSync(
90
+ "node_modules/@imfusion/web-ui/src/llms/icon-catalog.gen.json",
91
+ "utf8"
92
+ )
93
+ );
94
+ console.log(
95
+ JSON.stringify(
96
+ icons
97
+ .filter(icon => [icon.name, icon.category, ...icon.tags]
98
+ .join(" ")
99
+ .toLowerCase()
100
+ .includes(q))
101
+ .slice(0, 20),
102
+ null,
103
+ 2
104
+ )
105
+ );
106
+ ' "add"
107
+ ```
108
+
109
+ Import the chosen glyph and `Icon` from `@imfusion/web-ui/icons`. Render it through `Icon`, including when it inherits the
110
+ surrounding color:
111
+
112
+ ```tsx
113
+ import { ArrowRight, Icon } from "@imfusion/web-ui/icons";
114
+
115
+ <Icon glyph={ArrowRight} aria-hidden />;
116
+ ```
117
+
118
+ Use `Icon` for every rendered icon. Pass the component reference, not a rendered element:
119
+
120
+ ```tsx
121
+ import { ArrowRight, Icon } from "@imfusion/web-ui/icons";
122
+
123
+ <Icon glyph={ArrowRight} size={16} variant="primary" aria-label="Continue" role="img" />;
124
+ ```
125
+
126
+ Never import `iconoir-react` or another icon package directly.
127
+
76
128
  ## Compound components
77
129
 
78
130
  A component whose docgen entry has a non-empty `subComponents` array is used as a namespace, not a single import — e.g.
@@ -7,6 +7,8 @@ The contract between an app and `@imfusion/web-ui`.
7
7
  - Never import Base UI (or any other upstream the library wraps) directly — no upstream stylesheets, no upstream components,
8
8
  even when upstream docs show it that way: everything a component needs ships in `@imfusion/web-ui`.
9
9
  - Library missing something upstream has → report the gap (see `imf-web-ui-components`); don't reach around it.
10
+ - Import icons from `@imfusion/web-ui/icons` and render them through its `Icon` component. Direct imports from
11
+ `iconoir-react` are outside the library boundary.
10
12
 
11
13
  ## Wrap primitives when the app has a reason to
12
14
 
@@ -265,11 +265,11 @@
265
265
  },
266
266
  {
267
267
  "name": "--imf-ui-color-primary-fg-luma-dark",
268
- "value": "0.8"
268
+ "value": "0.75"
269
269
  },
270
270
  {
271
271
  "name": "--imf-ui-color-primary-fg-luma-light",
272
- "value": "0.65"
272
+ "value": "0.55"
273
273
  },
274
274
  {
275
275
  "name": "--imf-ui-color-primary-hue",
@@ -1,190 +0,0 @@
1
- import { a as e, r as t, t as n } from "./meta-B8C51eyL.js";
2
- import { createContext as r, createElement as i, forwardRef as a, useCallback as o, useContext as s, useEffect as c, useRef as l, useState as u } from "react";
3
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
4
- //#region node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
5
- var p = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), m = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), h = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), g = (e) => {
6
- let t = h(e);
7
- return t.charAt(0).toUpperCase() + t.slice(1);
8
- }, _ = {
9
- xmlns: "http://www.w3.org/2000/svg",
10
- width: 24,
11
- height: 24,
12
- viewBox: "0 0 24 24",
13
- fill: "none",
14
- stroke: "currentColor",
15
- strokeWidth: 2,
16
- strokeLinecap: "round",
17
- strokeLinejoin: "round"
18
- }, v = (e) => {
19
- for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
20
- return !1;
21
- }, y = r({}), b = () => s(y), x = a(({ color: e, size: t, strokeWidth: n, absoluteStrokeWidth: r, className: a = "", children: o, iconNode: s, ...c }, l) => {
22
- let { size: u = 24, strokeWidth: d = 2, absoluteStrokeWidth: f = !1, color: m = "currentColor", className: h = "" } = b() ?? {}, g = r ?? f ? Number(n ?? d) * 24 / Number(t ?? u) : n ?? d;
23
- return i("svg", {
24
- ref: l,
25
- ..._,
26
- width: t ?? u ?? _.width,
27
- height: t ?? u ?? _.height,
28
- stroke: e ?? m,
29
- strokeWidth: g,
30
- className: p("lucide", h, a),
31
- ...!o && !v(c) && { "aria-hidden": "true" },
32
- ...c
33
- }, [...s.map(([e, t]) => i(e, t)), ...Array.isArray(o) ? o : [o]]);
34
- }), S = (e, t) => {
35
- let n = a(({ className: n, ...r }, a) => i(x, {
36
- ref: a,
37
- iconNode: t,
38
- className: p(`lucide-${m(g(e))}`, `lucide-${e}`, n),
39
- ...r
40
- }));
41
- return n.displayName = g(e), n;
42
- }, C = S("arrow-right", [["path", {
43
- d: "M5 12h14",
44
- key: "1ays0h"
45
- }], ["path", {
46
- d: "m12 5 7 7-7 7",
47
- key: "xquz4c"
48
- }]]), w = S("arrow-up-right", [["path", {
49
- d: "M7 7h10v10",
50
- key: "1tivn9"
51
- }], ["path", {
52
- d: "M7 17 17 7",
53
- key: "1vkiza"
54
- }]]), T = S("check", [["path", {
55
- d: "M20 6 9 17l-5-5",
56
- key: "1gmf2c"
57
- }]]), E = S("copy", [["rect", {
58
- width: "14",
59
- height: "14",
60
- x: "8",
61
- y: "8",
62
- rx: "2",
63
- ry: "2",
64
- key: "17jyea"
65
- }], ["path", {
66
- d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
67
- key: "zix9uf"
68
- }]]);
69
- //#endregion
70
- //#region src/hooks/use-clipboard.ts
71
- function D({ timeout: e = 1500 } = {}) {
72
- let [t, n] = u(!1), r = l(void 0);
73
- return c(() => () => clearTimeout(r.current), []), {
74
- copied: t,
75
- copy: o((t) => {
76
- navigator.clipboard.writeText(t).then(() => {
77
- n(!0), clearTimeout(r.current), r.current = setTimeout(() => n(!1), e);
78
- });
79
- }, [e])
80
- };
81
- }
82
- var O = {
83
- block: "imf-ui-code-module-block",
84
- copy: "imf-ui-code-module-copy",
85
- icon: "imf-ui-code-module-icon",
86
- inline: "imf-ui-code-module-inline",
87
- inlineCopy: "imf-ui-code-module-inlineCopy",
88
- inlineLink: "imf-ui-code-module-inlineLink",
89
- language: "imf-ui-code-module-language",
90
- pre: "imf-ui-code-module-pre",
91
- separator: "imf-ui-code-module-separator"
92
- }, k = /* @__PURE__ */ e({
93
- Block: () => M,
94
- Inline: () => A,
95
- InlineLink: () => j
96
- });
97
- function A({ className: e, copyable: n = !1, highlighted: r, children: i, ...a }) {
98
- let { copied: o, copy: s } = D(), c = o ? T : E;
99
- return /* @__PURE__ */ f("code", {
100
- ...a,
101
- "data-imf-ui-component": "Code.Inline",
102
- className: t(O.inline, e),
103
- children: [
104
- r ?? i,
105
- n && /* @__PURE__ */ d("span", { className: O.separator }),
106
- n && /* @__PURE__ */ d("button", {
107
- type: "button",
108
- className: O.inlineCopy,
109
- "data-copied": o || void 0,
110
- "aria-label": o ? "Copied" : "Copy",
111
- onClick: () => s(i),
112
- children: /* @__PURE__ */ d(c, {
113
- size: 12,
114
- strokeWidth: 2,
115
- "aria-hidden": !0
116
- })
117
- })
118
- ]
119
- });
120
- }
121
- A.displayName = "Code.Inline";
122
- function j({ className: e, kind: n = "external", children: r, ...i }) {
123
- let a = n === "external" ? w : C;
124
- return /* @__PURE__ */ f("a", {
125
- ...n === "external" ? {
126
- target: "_blank",
127
- rel: "noreferrer"
128
- } : {},
129
- ...i,
130
- "data-imf-ui-component": "Code.InlineLink",
131
- "data-kind": n,
132
- className: t(O.inline, O.inlineLink, e),
133
- children: [
134
- r,
135
- /* @__PURE__ */ d("span", { className: O.separator }),
136
- /* @__PURE__ */ d("span", {
137
- className: O.icon,
138
- "aria-hidden": !0,
139
- children: /* @__PURE__ */ d(a, {
140
- size: 12,
141
- strokeWidth: 2
142
- })
143
- })
144
- ]
145
- });
146
- }
147
- j.displayName = "Code.InlineLink";
148
- function M({ className: e, language: n, hideCopy: r = !1, highlighted: i, children: a, ...o }) {
149
- let { copied: s, copy: c } = D(), l = s ? T : E;
150
- return /* @__PURE__ */ f("div", {
151
- "data-imf-ui-component": "Code.Block",
152
- className: t(O.block, e),
153
- children: [
154
- n != null && /* @__PURE__ */ d("span", {
155
- className: O.language,
156
- children: n
157
- }),
158
- !r && /* @__PURE__ */ d("button", {
159
- type: "button",
160
- className: O.copy,
161
- "data-copied": s || void 0,
162
- "aria-label": s ? "Copied" : "Copy",
163
- onClick: () => c(a),
164
- children: /* @__PURE__ */ d(l, {
165
- size: 12,
166
- strokeWidth: 2,
167
- "aria-hidden": !0
168
- })
169
- }),
170
- /* @__PURE__ */ d("pre", {
171
- ...o,
172
- className: O.pre,
173
- children: /* @__PURE__ */ d("code", { children: i ?? a })
174
- })
175
- ]
176
- });
177
- }
178
- M.displayName = "Code.Block";
179
- //#endregion
180
- //#region src/components/code/code.meta.ts
181
- var N = {
182
- name: "Code",
183
- category: n.display,
184
- status: "stable",
185
- namespace: !0,
186
- 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.",
187
- origin: "native"
188
- };
189
- //#endregion
190
- export { k as a, T as c, S as d, j as i, w as l, M as n, D as o, A as r, E as s, N as t, C as u };
@@ -1,74 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var e = Object.defineProperty, t = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), n = (t, n) => {
3
- let r = {};
4
- for (var i in t) e(r, i, {
5
- get: t[i],
6
- enumerable: !0
7
- });
8
- return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
9
- };
10
- //#endregion
11
- //#region node_modules/clsx/dist/clsx.mjs
12
- function r(e) {
13
- var t, n, i = "";
14
- if (typeof e == "string" || typeof e == "number") i += e;
15
- else if (typeof e == "object") if (Array.isArray(e)) {
16
- var a = e.length;
17
- for (t = 0; t < a; t++) e[t] && (n = r(e[t])) && (i && (i += " "), i += n);
18
- } else for (n in e) e[n] && (i && (i += " "), i += n);
19
- return i;
20
- }
21
- function i() {
22
- for (var e, t, n = 0, i = "", a = arguments.length; n < a; n++) (e = arguments[n]) && (t = r(e)) && (i && (i += " "), i += t);
23
- return i;
24
- }
25
- //#endregion
26
- //#region node_modules/class-variance-authority/dist/index.mjs
27
- var a = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, o = i, s = (e, t) => (n) => {
28
- if (t?.variants == null) return o(e, n?.class, n?.className);
29
- let { variants: r, defaultVariants: i } = t, s = Object.keys(r).map((e) => {
30
- let t = n?.[e], o = i?.[e];
31
- if (t === null) return null;
32
- let s = a(t) || a(o);
33
- return r[e][s];
34
- }), c = n && Object.entries(n).reduce((e, t) => {
35
- let [n, r] = t;
36
- return r === void 0 || (e[n] = r), e;
37
- }, {});
38
- return o(e, s, t?.compoundVariants?.reduce((e, t) => {
39
- let { class: n, className: r, ...a } = t;
40
- return Object.entries(a).every((e) => {
41
- let [t, n] = e;
42
- return Array.isArray(n) ? n.includes({
43
- ...i,
44
- ...c
45
- }[t]) : {
46
- ...i,
47
- ...c
48
- }[t] === n;
49
- }) ? [
50
- ...e,
51
- n,
52
- r
53
- ] : e;
54
- }, []), n?.class, n?.className);
55
- }, c = {
56
- buttons: {
57
- id: "buttons",
58
- label: "Buttons"
59
- },
60
- inputs: {
61
- id: "inputs",
62
- label: "Inputs"
63
- },
64
- layout: {
65
- id: "layout",
66
- label: "Layout"
67
- },
68
- display: {
69
- id: "display",
70
- label: "Display"
71
- }
72
- };
73
- //#endregion
74
- export { n as a, t as i, s as n, o as r, c as t };