@imfusion/web-ui 0.5.1-dev.51.gad24cd6e → 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.
- package/README.md +1 -1
- package/dist/chunk-DA_OvQe2.js +11 -0
- package/dist/code-BRy_lg-h.js +135 -0
- package/dist/codegen/gen-icons.d.ts +24 -0
- package/dist/components/callout/callout.d.ts +1 -1
- package/dist/components/chip-link/chip-link.d.ts +1 -1
- package/dist/components/icon/icon.d.ts +16 -0
- package/dist/components/icon/icon.meta.d.ts +2 -0
- package/dist/components/icon/index.d.ts +4 -0
- package/dist/components/icon/types.d.ts +2 -0
- package/dist/components/input/input.d.ts +3 -1
- package/dist/components/typo/typo.d.ts +2 -2
- package/dist/docgen/component-sources.d.ts +7 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-resize-observer.d.ts +2 -0
- package/dist/icons/catalog.gen.d.ts +8357 -0
- package/dist/icons/icon-config-provider.d.ts +8 -0
- package/dist/icons/icon-context.d.ts +4 -0
- package/dist/icons/icons.gen.d.ts +1672 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons-BhogvWBV.js +77 -0
- package/dist/icons.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5026 -5059
- package/dist/integrations/code-highlight.js +3 -2
- package/dist/integrations/image-display-options.js +56 -56
- package/dist/meta-BwCupYyq.js +64 -0
- package/dist/provider/web-ui-provider.d.ts +4 -1
- package/dist/style.css +1 -1
- package/dist/{tabs-CVp_SgBl.js → tabs-CYqtw1q9.js} +2 -1
- package/package.json +8 -2
- package/src/docgen/doc.gen.json +40 -3
- package/src/llms/icon-catalog.gen.json +11203 -0
- package/src/llms/llms.gen.txt +5 -0
- package/src/llms/skills/imf-web-ui-components/SKILL.md +55 -3
- package/src/llms/skills/imf-web-ui-conventions/topics/library-boundary.md +2 -0
- package/src/llms/tokens.gen.json +2 -2
- package/dist/code-B83kAmnS.js +0 -196
- 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
|
|
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
|
-
* (
|
|
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 {};
|
|
@@ -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 {};
|
|
@@ -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" |
|
|
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 (
|
|
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;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -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';
|