@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
package/README.md CHANGED
@@ -66,7 +66,7 @@ skill.
66
66
  | ------------------------- | ------------------------------------------------------------------------------ |
67
67
  | `/imf-web-ui` | The router: decides whether guidance is needed, then which companion to open. |
68
68
  | `/imf-web-ui-setup` | Plan and, after approval, bootstrap a consumer project by topic. |
69
- | `/imf-web-ui-components` | Component reference — what exists and how it's meant to be used. |
69
+ | `/imf-web-ui-components` | Component and icon reference — what exists and how it's meant to be used. |
70
70
  | `/imf-web-ui-ux` | UX guidance for building interfaces with the library. |
71
71
  | `/imf-web-ui-conventions` | The frontend conventions baseline, including the sanctioned styling seams. |
72
72
  | `/imf-web-ui-audit` | Read-only health check for a consumer project, ending in a plan you approve. |
@@ -0,0 +1,11 @@
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
+ export { n, t };
@@ -0,0 +1,135 @@
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 };
@@ -0,0 +1,24 @@
1
+ export type IconMetadata = {
2
+ filename: string;
3
+ category: string;
4
+ tags: string[];
5
+ };
6
+ export type IconCatalogRecord = {
7
+ name: string;
8
+ category: string;
9
+ tags: string[];
10
+ style: "regular" | "solid";
11
+ };
12
+ type IconMetadataSource = {
13
+ commit: string;
14
+ url: string;
15
+ };
16
+ export declare function parseIconMetadata(csv: string): IconMetadata[];
17
+ export declare function validateIconMetadataSource(source: string): IconMetadataSource;
18
+ export declare function buildIconCatalog(iconNames: readonly string[], metadata: readonly IconMetadata[]): IconCatalogRecord[];
19
+ export declare function renderIconAliases(iconNames: readonly string[]): string;
20
+ export declare function renderIconCatalogJson(records: readonly IconCatalogRecord[]): string;
21
+ export declare function renderIconCatalog(records: readonly IconCatalogRecord[]): string;
22
+ export declare function writeIconAliases(): void;
23
+ export declare function writeIconCatalog(): void;
24
+ export {};
@@ -19,7 +19,7 @@ declare namespace Root {
19
19
  type IconProps = React.HTMLAttributes<HTMLSpanElement>;
20
20
  /**
21
21
  * Callout.Icon — the leading status glyph. With no children it renders the
22
- * variant's default lucide icon; pass a custom icon as children to override.
22
+ * variant's default local icon; pass a custom icon as children to override.
23
23
  * `aria-hidden` (the variant is conveyed by copy, not the glyph) and inherits
24
24
  * the status colour via `currentColor`.
25
25
  */
@@ -11,7 +11,7 @@ type Props = React.AnchorHTMLAttributes<HTMLAnchorElement> & VariantProps<typeof
11
11
  /**
12
12
  * ChipLink — anchor styled as a Chip. Reuses Chip's shared variants so the
13
13
  * variant and appearance axes stay aligned, and auto-appends a directional icon
14
- * (Lucide `ArrowUpRight` for external, `ArrowRight` for internal).
14
+ * (local Web UI `ArrowUpRight` for external, `ArrowRight` for internal).
15
15
  */
16
16
  export declare function ChipLink({ variant, appearance, inline, kind, className, children, ...props }: Props): import("react/jsx-runtime").JSX.Element;
17
17
  export {};
@@ -1,19 +1,15 @@
1
1
  type InlineProps = Omit<React.HTMLAttributes<HTMLElement>, "children"> & {
2
- /** The inline code, as a raw string — also the value copied when `copyable`. */
3
- children: string;
2
+ /** Code content shown in the chip. The copy button copies its rendered text. */
3
+ children: React.ReactNode;
4
4
  /** Show a small copy button on the right, behind a hairline separator. @default false */
5
5
  copyable?: boolean;
6
- /** Pre-rendered display content (e.g. syntax-highlighted tokens) shown in place of `children`, which stays the copied value. The code-highlight integration fills this slot. */
7
- highlighted?: React.ReactNode;
8
6
  };
9
7
  /**
10
8
  * Code.Inline — an inline code fragment (a `<code>` chip) for use inside running
11
- * text. Dumb: styling only — syntax coloring arrives pre-rendered through the
12
- * `highlighted` slot (the code-highlight integration supplies it). `Typo.InlineCode`
13
- * renders this under the hood so inline-code chrome is defined in one place.
14
- * Children must be a string so an opted-in copy button has clean text to copy.
9
+ * text. `Typo.InlineCode` renders this under the hood so inline-code chrome is
10
+ * defined in one place. The copy button copies the rendered text.
15
11
  */
16
- export declare function Inline({ className, copyable, highlighted, children, ...props }: InlineProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function Inline({ className, copyable, children, ...props }: InlineProps): import("react/jsx-runtime").JSX.Element;
17
13
  export declare namespace Inline {
18
14
  var displayName: string;
19
15
  }
@@ -36,24 +32,20 @@ export declare namespace InlineLink {
36
32
  var displayName: string;
37
33
  }
38
34
  type BlockProps = Omit<React.HTMLAttributes<HTMLPreElement>, "children"> & {
39
- /** The code to display, as a raw string — also the value copied by the copy button. */
40
- children: string;
35
+ /** Code content shown in the block. The copy button copies its rendered text. */
36
+ children: React.ReactNode;
41
37
  /** Language label shown in the corner notch. Omit to hide the notch. */
42
38
  language?: string;
43
39
  /** Hide the copy button. @default false */
44
40
  hideCopy?: boolean;
45
- /** Pre-rendered display content (e.g. syntax-highlighted tokens) shown in place of `children`, which stays the copied value. The code-highlight integration fills this slot. */
46
- highlighted?: React.ReactNode;
47
41
  };
48
42
  /**
49
43
  * Code.Block — a fenced code block on a flat brand surface, with an optional
50
44
  * chamfered language notch (top-left) and a copy button (top-right). The
51
- * surface follows the global corner-radius token when a preset opts in.
52
- * Dumb: styling only — syntax coloring arrives pre-rendered through the
53
- * `highlighted` slot (the code-highlight integration supplies it). Children
54
- * must be a string so the copy button has clean text to copy.
45
+ * surface follows the global corner-radius token when a preset opts in. The
46
+ * copy button copies the rendered text.
55
47
  */
56
- export declare function Block({ className, language, hideCopy, highlighted, children, ...props }: BlockProps): import("react/jsx-runtime").JSX.Element;
48
+ export declare function Block({ className, language, hideCopy, children, ...props }: BlockProps): import("react/jsx-runtime").JSX.Element;
57
49
  export declare namespace Block {
58
50
  var displayName: string;
59
51
  }
@@ -0,0 +1,16 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import { IconComponent } from './types';
3
+ export declare const ICON_VARIANTS: readonly ["inherit", "main", "support", "minor", "brand", "primary", "positive", "negative", "warning", "info", "oncolor", "accent-1", "accent-2", "accent-3"];
4
+ export type IconVariant = (typeof ICON_VARIANTS)[number];
5
+ declare const icon: (props?: ({
6
+ variant?: "primary" | "positive" | "negative" | "main" | "inherit" | "support" | "minor" | "brand" | "warning" | "info" | "oncolor" | "accent-1" | "accent-2" | "accent-3" | null | undefined;
7
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
+ type Props = Omit<React.ComponentProps<IconComponent>, "color"> & VariantProps<typeof icon> & {
9
+ /** Icon component imported from `@imfusion/web-ui/icons`. */
10
+ glyph: IconComponent;
11
+ /** Sets both SVG dimensions unless `width` or `height` is provided. */
12
+ size?: React.SVGProps<SVGSVGElement>["width"];
13
+ };
14
+ /** Icon — renders an icon component with a semantic Web UI foreground color. */
15
+ export declare function Icon({ glyph: Glyph, variant, size, width, height, className, ...props }: Props): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ComponentMeta } from '../../types/meta';
2
+ export declare const iconMeta: ComponentMeta;
@@ -0,0 +1,4 @@
1
+ export { Icon, ICON_VARIANTS } from './icon';
2
+ export { iconMeta } from './icon.meta';
3
+ export type { IconComponent } from './types';
4
+ export type { IconVariant } from './icon';
@@ -0,0 +1,2 @@
1
+ import type * as React from "react";
2
+ export type IconComponent = React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
@@ -9,6 +9,8 @@ type Props = Omit<React.InputHTMLAttributes<HTMLInputElement>, "className" | "st
9
9
  value?: UpstreamInput["value"];
10
10
  defaultValue?: UpstreamInput["defaultValue"];
11
11
  onValueChange?: UpstreamInput["onValueChange"];
12
+ /** Called when the search input's clear button is pressed. */
13
+ onClear?: () => void;
12
14
  className?: UpstreamInput["className"];
13
15
  style?: UpstreamInput["style"];
14
16
  render?: UpstreamInput["render"];
@@ -21,5 +23,5 @@ type Props = Omit<React.InputHTMLAttributes<HTMLInputElement>, "className" | "st
21
23
  * @see https://base-ui.com/react/components/input
22
24
  * @llm https://base-ui.com/react/components/input.md
23
25
  */
24
- export declare function Input({ variant, size, className, ...props }: Props): import("react/jsx-runtime").JSX.Element;
26
+ export declare function Input({ variant, size, type, value, defaultValue, onValueChange, onClear, disabled, className, ...props }: Props): import("react/jsx-runtime").JSX.Element;
25
27
  export {};
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import { Code } from '../code';
3
3
  declare const typo: (props?: ({
4
- variant?: "primary" | "positive" | "negative" | "main" | "support" | "minor" | "brand" | "warning" | "info" | "accent-1" | "accent-2" | "accent-3" | "oncolor" | null | undefined;
4
+ variant?: "primary" | "positive" | "negative" | "main" | "support" | "minor" | "brand" | "warning" | "info" | "oncolor" | "accent-1" | "accent-2" | "accent-3" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  declare const spacingVariants: (props?: ({
7
7
  spacing?: "none" | "default" | null | undefined;
@@ -82,7 +82,7 @@ export declare function Highlight({ variant, className, ...props }: InlineProps)
82
82
  export declare namespace Highlight {
83
83
  var displayName: string;
84
84
  }
85
- /** Typo.Link — inline anchor. Auto-appends a directional icon (Lucide `ArrowUpRight` for external, `ArrowRight` for internal), mirroring ChipLink's affordance for prose links. */
85
+ /** Typo.Link — inline anchor. Auto-appends a local Web UI directional icon (`ArrowUpRight` for external, `ArrowRight` for internal), mirroring ChipLink's affordance for prose links. */
86
86
  export declare function Link({ variant, kind, className, ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
87
87
  export declare namespace Link {
88
88
  var displayName: string;
@@ -0,0 +1,7 @@
1
+ /** A public component source shared by the docgen and LLM index generators. */
2
+ export type ComponentSource = {
3
+ key: string;
4
+ componentFile: string;
5
+ metaFile: string;
6
+ };
7
+ export declare function publicComponentSources(srcDir: string): ComponentSource[];
@@ -3,3 +3,4 @@ export type { UseClipboardOptions } from './use-clipboard';
3
3
  export { useColorScheme } from './use-color-scheme';
4
4
  export { useMediaQuery } from './use-media-query';
5
5
  export type { UseMediaQueryOptions } from './use-media-query';
6
+ export { useResizeObserver } from './use-resize-observer';
@@ -0,0 +1,2 @@
1
+ import { RefObject } from 'react';
2
+ export declare function useResizeObserver<T extends Element>(callback: ResizeObserverCallback, enabled?: boolean): RefObject<T | null>;