@imfusion/web-ui 0.11.1-dev.6.gf4b6c627 → 0.11.1-dev.62.gfcd31b6e
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/CHANGELOG.md +168 -1
- package/dist/{code-Cl9AzRyF.js → code-BaLXMEMa.js} +8 -8
- package/dist/components/autocomplete/autocomplete.d.ts +144 -0
- package/dist/components/autocomplete/autocomplete.meta.d.ts +2 -0
- package/dist/components/autocomplete/index.d.ts +2 -0
- package/dist/components/avatar/avatar.d.ts +1 -1
- package/dist/components/card/card.d.ts +3 -2
- package/dist/components/checkbox/checkbox.cva.d.ts +3 -0
- package/dist/components/combobox/combobox.cva.d.ts +37 -0
- package/dist/components/combobox/combobox.d.ts +171 -0
- package/dist/components/combobox/combobox.meta.d.ts +2 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/dialog/dialog.d.ts +23 -3
- package/dist/components/file-drop-zone/collect-files.d.ts +56 -0
- package/dist/components/file-drop-zone/file-drop-zone-context.d.ts +15 -0
- package/dist/components/file-drop-zone/file-drop-zone.d.ts +185 -0
- package/dist/components/file-drop-zone/file-drop-zone.meta.d.ts +2 -0
- package/dist/components/file-drop-zone/format-bytes.d.ts +5 -0
- package/dist/components/file-drop-zone/index.d.ts +4 -0
- package/dist/components/image/image.d.ts +50 -0
- package/dist/components/image/image.meta.d.ts +2 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/logo/logo.d.ts +1 -1
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/progress/index.d.ts +2 -0
- package/dist/components/progress/progress.d.ts +40 -0
- package/dist/components/progress/progress.meta.d.ts +2 -0
- package/dist/components/rich-link/rich-link.d.ts +1 -1
- package/dist/components/select/select.cva.d.ts +7 -0
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/tab-nav/index.d.ts +2 -0
- package/dist/components/tab-nav/tab-nav.d.ts +26 -0
- package/dist/components/tab-nav/tab-nav.meta.d.ts +2 -0
- package/dist/components/table/table.d.ts +8 -0
- package/dist/components/tabs/tabs-underline.cva.d.ts +6 -0
- package/dist/components/tabs/tabs.d.ts +13 -4
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/textarea.d.ts +32 -0
- package/dist/components/textarea/textarea.meta.d.ts +2 -0
- package/dist/components/toast/toast.d.ts +2 -2
- package/dist/components/typo/typo.d.ts +5 -1
- package/dist/docgen/component-sources.d.ts +4 -0
- package/dist/icon-button-roSB497o.js +171 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +4536 -2958
- package/dist/integrations/code-highlight.js +2 -2
- package/dist/integrations/frame-selection.js +1 -1
- package/dist/integrations/image-display-options.js +73 -71
- package/dist/integrations/layout-mode/index.d.ts +2 -0
- package/dist/integrations/layout-mode/layout-mode-view.d.ts +32 -0
- package/dist/integrations/layout-mode/layout-mode.d.ts +13 -0
- package/dist/integrations/layout-mode/layout-mode.meta.d.ts +2 -0
- package/dist/integrations/layout-mode.js +103 -0
- package/dist/integrations/view-tools/index.d.ts +4 -0
- package/dist/integrations/view-tools/use-view-interaction.d.ts +21 -0
- package/dist/integrations/view-tools/view-tools-view.d.ts +23 -0
- package/dist/integrations/view-tools/view-tools.d.ts +14 -0
- package/dist/integrations/view-tools/view-tools.meta.d.ts +2 -0
- package/dist/integrations/view-tools.js +133 -0
- package/dist/{resolve-state-props-DQf9WiGv.js → rolldown-runtime-Dy4uBu1J.js} +1 -12
- package/dist/row-CImu8yXV.js +136 -0
- package/dist/{scroll-area-z9Lf9uIk.js → scroll-area-CXQ_SxPX.js} +2 -1
- package/dist/{slider-Bf274cMe.js → slider-CpIZMAFl.js} +2 -1
- package/dist/style.css +2 -1
- package/dist/tabs-BqgyMmo6.js +173 -0
- package/dist/toggle-group-Bhb3qicp.js +31 -0
- package/dist/toggle-group-eGr6_hgQ.js +125 -0
- package/dist/utils/email.d.ts +4 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/initials.d.ts +4 -0
- package/dist/utils/item-parts.d.ts +23 -0
- package/dist/utils/stable-popup-height.d.ts +10 -0
- package/dist/utils-J6vbjIt1.js +46 -0
- package/package.json +4 -4
- package/src/docgen/doc.gen.json +5526 -1748
- package/src/llms/llms.gen.txt +52 -1
- package/src/llms/skills/imf-web-ui-audit/SKILL.md +5 -2
- package/src/llms/skills/imf-web-ui-conventions/SKILL.md +2 -2
- package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +19 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/assets.md +28 -4
- package/src/llms/skills/imf-web-ui-conventions/topics/components.md +10 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/library-boundary.md +3 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/npm-project.md +2 -1
- package/src/llms/skills/imf-web-ui-conventions/topics/react/composition.md +54 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/react/effects.md +59 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/react/state.md +41 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/react.md +7 -60
- package/src/llms/skills/imf-web-ui-conventions/topics/styling.md +22 -1
- package/src/llms/skills/imf-web-ui-conventions/topics/tooling.md +3 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/validation.md +7 -0
- package/src/llms/skills/imf-web-ui-ux/references/forms.md +3 -2
- package/src/llms/tokens.gen.json +19 -1
- package/dist/tabs-DsDSCA--.js +0 -376
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { a as t } from "./utils-J6vbjIt1.js";
|
|
3
|
+
import { cva as n, cx as r } from "class-variance-authority";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
import { createContext as a, useCallback as o, useContext as s } from "react";
|
|
6
|
+
import { Switch as c } from "@base-ui/react/switch";
|
|
7
|
+
import { Tabs as l } from "@base-ui/react/tabs";
|
|
8
|
+
var u = {
|
|
9
|
+
root: "imf-ui-switch-module-root",
|
|
10
|
+
thumb: "imf-ui-switch-module-thumb"
|
|
11
|
+
}, d = /* @__PURE__ */ e({
|
|
12
|
+
Root: () => m,
|
|
13
|
+
Thumb: () => h
|
|
14
|
+
}), f = n(u.root), p = n(u.thumb);
|
|
15
|
+
function m(e) {
|
|
16
|
+
return /* @__PURE__ */ i(c.Root, {
|
|
17
|
+
...e,
|
|
18
|
+
"data-imf-ui-component": "Switch.Root",
|
|
19
|
+
className: (n) => f({ className: t(e.className, n) })
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
m.displayName = "Switch.Root";
|
|
23
|
+
function h(e) {
|
|
24
|
+
return /* @__PURE__ */ i(c.Thumb, {
|
|
25
|
+
...e,
|
|
26
|
+
"data-imf-ui-component": "Switch.Thumb",
|
|
27
|
+
className: (n) => p({ className: t(e.className, n) })
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
h.displayName = "Switch.Thumb";
|
|
31
|
+
var g = {
|
|
32
|
+
item: "imf-ui-tabs-underline-module-item",
|
|
33
|
+
rule: "imf-ui-tabs-underline-module-rule"
|
|
34
|
+
}, _ = n(g.rule), v = n(g.item), y = {
|
|
35
|
+
indicator: "imf-ui-tabs-module-indicator",
|
|
36
|
+
indicatorUnderline: "imf-ui-tabs-module-indicatorUnderline",
|
|
37
|
+
list: "imf-ui-tabs-module-list",
|
|
38
|
+
listFill: "imf-ui-tabs-module-listFill",
|
|
39
|
+
listUnderline: "imf-ui-tabs-module-listUnderline",
|
|
40
|
+
panel: "imf-ui-tabs-module-panel",
|
|
41
|
+
panelUnderline: "imf-ui-tabs-module-panelUnderline",
|
|
42
|
+
panelViewport: "imf-ui-tabs-module-panelViewport",
|
|
43
|
+
panelViewportUnderline: "imf-ui-tabs-module-panelViewportUnderline",
|
|
44
|
+
root: "imf-ui-tabs-module-root",
|
|
45
|
+
tab: "imf-ui-tabs-module-tab",
|
|
46
|
+
tabUnderline: "imf-ui-tabs-module-tabUnderline"
|
|
47
|
+
}, b = /* @__PURE__ */ e({
|
|
48
|
+
Indicator: () => N,
|
|
49
|
+
List: () => j,
|
|
50
|
+
Panel: () => F,
|
|
51
|
+
PanelViewport: () => P,
|
|
52
|
+
Root: () => A,
|
|
53
|
+
Tab: () => M
|
|
54
|
+
}), x = n(y.list, { variants: {
|
|
55
|
+
fill: {
|
|
56
|
+
true: y.listFill,
|
|
57
|
+
false: null
|
|
58
|
+
},
|
|
59
|
+
appearance: {
|
|
60
|
+
boxed: null,
|
|
61
|
+
underline: r(y.listUnderline, _())
|
|
62
|
+
}
|
|
63
|
+
} }), S = n(y.root), C = n(null, { variants: { appearance: {
|
|
64
|
+
boxed: y.tab,
|
|
65
|
+
underline: r(y.tabUnderline, v())
|
|
66
|
+
} } }), w = n(null, { variants: { appearance: {
|
|
67
|
+
boxed: y.indicator,
|
|
68
|
+
underline: y.indicatorUnderline
|
|
69
|
+
} } }), T = n(y.panelViewport, { variants: { appearance: {
|
|
70
|
+
boxed: null,
|
|
71
|
+
underline: y.panelViewportUnderline
|
|
72
|
+
} } }), E = n(y.panel, { variants: { appearance: {
|
|
73
|
+
boxed: null,
|
|
74
|
+
underline: y.panelUnderline
|
|
75
|
+
} } }), D = a("boxed");
|
|
76
|
+
function O(e, t) {
|
|
77
|
+
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
78
|
+
}
|
|
79
|
+
function k(e) {
|
|
80
|
+
let t = new ResizeObserver(() => {
|
|
81
|
+
let t = e.dataset.orientation === "vertical" ? e.scrollHeight > e.clientHeight : e.scrollWidth > e.clientWidth;
|
|
82
|
+
e.toggleAttribute("data-overflowing", t);
|
|
83
|
+
}), n = () => {
|
|
84
|
+
t.disconnect(), t.observe(e);
|
|
85
|
+
for (let n of e.children) t.observe(n);
|
|
86
|
+
}, r = new MutationObserver(n);
|
|
87
|
+
return r.observe(e, { childList: !0 }), n(), () => {
|
|
88
|
+
t.disconnect(), r.disconnect();
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function A({ appearance: e = "boxed", ...n }) {
|
|
92
|
+
let r = n.orientation === "vertical" ? "boxed" : e;
|
|
93
|
+
return /* @__PURE__ */ i(D, {
|
|
94
|
+
value: r,
|
|
95
|
+
children: /* @__PURE__ */ i(l.Root, {
|
|
96
|
+
...n,
|
|
97
|
+
"data-imf-ui-component": "Tabs.Root",
|
|
98
|
+
className: (e) => S({ className: t(n.className, e) })
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
A.displayName = "Tabs.Root";
|
|
103
|
+
function j({ fill: e = !1, ref: n, ...r }) {
|
|
104
|
+
let a = s(D), c = o((e) => {
|
|
105
|
+
if (!e) return;
|
|
106
|
+
O(n, e);
|
|
107
|
+
let t = k(e);
|
|
108
|
+
return () => {
|
|
109
|
+
t(), O(n, null);
|
|
110
|
+
};
|
|
111
|
+
}, [n]);
|
|
112
|
+
return /* @__PURE__ */ i(l.List, {
|
|
113
|
+
...r,
|
|
114
|
+
ref: c,
|
|
115
|
+
"data-imf-ui-component": "Tabs.List",
|
|
116
|
+
className: (n) => x({
|
|
117
|
+
fill: e,
|
|
118
|
+
appearance: a,
|
|
119
|
+
className: t(r.className, n)
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
j.displayName = "Tabs.List";
|
|
124
|
+
function M(e) {
|
|
125
|
+
let n = s(D);
|
|
126
|
+
return /* @__PURE__ */ i(l.Tab, {
|
|
127
|
+
...e,
|
|
128
|
+
"data-imf-ui-component": "Tabs.Tab",
|
|
129
|
+
className: (r) => C({
|
|
130
|
+
appearance: n,
|
|
131
|
+
className: t(e.className, r)
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
M.displayName = "Tabs.Tab";
|
|
136
|
+
function N(e) {
|
|
137
|
+
let n = s(D);
|
|
138
|
+
return /* @__PURE__ */ i(l.Indicator, {
|
|
139
|
+
...e,
|
|
140
|
+
"data-imf-ui-component": "Tabs.Indicator",
|
|
141
|
+
className: (r) => w({
|
|
142
|
+
appearance: n,
|
|
143
|
+
className: t(e.className, r)
|
|
144
|
+
})
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
N.displayName = "Tabs.Indicator";
|
|
148
|
+
function P(e) {
|
|
149
|
+
let t = s(D);
|
|
150
|
+
return /* @__PURE__ */ i("div", {
|
|
151
|
+
...e,
|
|
152
|
+
"data-imf-ui-component": "Tabs.PanelViewport",
|
|
153
|
+
className: T({
|
|
154
|
+
appearance: t,
|
|
155
|
+
className: e.className
|
|
156
|
+
})
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
P.displayName = "Tabs.PanelViewport";
|
|
160
|
+
function F(e) {
|
|
161
|
+
let n = s(D);
|
|
162
|
+
return /* @__PURE__ */ i(l.Panel, {
|
|
163
|
+
...e,
|
|
164
|
+
"data-imf-ui-component": "Tabs.Panel",
|
|
165
|
+
className: (r) => E({
|
|
166
|
+
appearance: n,
|
|
167
|
+
className: t(e.className, r)
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
F.displayName = "Tabs.Panel";
|
|
172
|
+
//#endregion
|
|
173
|
+
export { A as a, v as c, h as d, d as f, P as i, _ as l, j as n, M as o, F as r, b as s, N as t, m as u };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { t as e } from "./meta-V_KyLeGn.js";
|
|
2
|
+
import "./toggle-group-eGr6_hgQ.js";
|
|
3
|
+
//#region src/components/toggle/toggle.meta.ts
|
|
4
|
+
var t = {
|
|
5
|
+
name: "Toggle",
|
|
6
|
+
category: e.inputs,
|
|
7
|
+
status: "experimental",
|
|
8
|
+
description: "Two-state button for a pressed or unpressed option. Compose several in ToggleGroup for a segmented control.",
|
|
9
|
+
origin: "adapted",
|
|
10
|
+
internalDependencies: ["Kbd"],
|
|
11
|
+
upstream: {
|
|
12
|
+
name: "Base UI",
|
|
13
|
+
websiteLink: "https://base-ui.com/",
|
|
14
|
+
docLink: "https://base-ui.com/react/components/toggle",
|
|
15
|
+
llmDocLink: "https://base-ui.com/react/components/toggle.md"
|
|
16
|
+
}
|
|
17
|
+
}, n = {
|
|
18
|
+
name: "ToggleGroup",
|
|
19
|
+
category: e.inputs,
|
|
20
|
+
status: "experimental",
|
|
21
|
+
description: "Group of connected Toggle buttons that share a selection. Also called a segmented control; set `multiple` for more than one active option.",
|
|
22
|
+
origin: "adapted",
|
|
23
|
+
upstream: {
|
|
24
|
+
name: "Base UI",
|
|
25
|
+
websiteLink: "https://base-ui.com/",
|
|
26
|
+
docLink: "https://base-ui.com/react/components/toggle-group",
|
|
27
|
+
llmDocLink: "https://base-ui.com/react/components/toggle-group.md"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { t as n, n as t };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { _M as e, mh as t } from "./icons-vc1WZCxX.js";
|
|
2
|
+
import { t as n } from "./meta-V_KyLeGn.js";
|
|
3
|
+
import { a as r, o as i } from "./utils-J6vbjIt1.js";
|
|
4
|
+
import { cva as a } from "class-variance-authority";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { Children as c, createContext as l, useContext as u } from "react";
|
|
7
|
+
import { Toggle as d } from "@base-ui/react/toggle";
|
|
8
|
+
import { ToggleGroup as f } from "@base-ui/react/toggle-group";
|
|
9
|
+
var p = {
|
|
10
|
+
flat: "imf-ui-kbd-module-flat",
|
|
11
|
+
icon: "imf-ui-kbd-module-icon",
|
|
12
|
+
primary: "imf-ui-kbd-module-primary",
|
|
13
|
+
root: "imf-ui-kbd-module-root"
|
|
14
|
+
}, m = a(p.root, { variants: { variant: {
|
|
15
|
+
default: null,
|
|
16
|
+
primary: p.primary,
|
|
17
|
+
flat: p.flat
|
|
18
|
+
} } });
|
|
19
|
+
function h({ variant: n = "default", icon: r = !1, children: i, ...a }) {
|
|
20
|
+
return /* @__PURE__ */ s("kbd", {
|
|
21
|
+
...a,
|
|
22
|
+
"data-imf-ui-component": "Kbd",
|
|
23
|
+
className: m({
|
|
24
|
+
variant: n,
|
|
25
|
+
className: a.className
|
|
26
|
+
}),
|
|
27
|
+
children: [r && /* @__PURE__ */ o(e, {
|
|
28
|
+
glyph: t,
|
|
29
|
+
strokeWidth: 2,
|
|
30
|
+
"aria-hidden": !0,
|
|
31
|
+
className: p.icon
|
|
32
|
+
}), i]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/kbd/kbd.meta.ts
|
|
37
|
+
var g = {
|
|
38
|
+
name: "Kbd",
|
|
39
|
+
category: n.display,
|
|
40
|
+
status: "experimental",
|
|
41
|
+
description: "Shows a keyboard key or shortcut, such as the letter that activates a button. Also called a key hint; Button and Toggle render it through their `shortcut` prop.",
|
|
42
|
+
origin: "native",
|
|
43
|
+
internalDependencies: ["Icon"]
|
|
44
|
+
}, _ = {
|
|
45
|
+
ctrl: "Control",
|
|
46
|
+
control: "Control",
|
|
47
|
+
cmd: "Meta",
|
|
48
|
+
"⌘": "Meta",
|
|
49
|
+
meta: "Meta",
|
|
50
|
+
opt: "Alt",
|
|
51
|
+
option: "Alt",
|
|
52
|
+
"⌥": "Alt",
|
|
53
|
+
alt: "Alt",
|
|
54
|
+
shift: "Shift",
|
|
55
|
+
"⇧": "Shift",
|
|
56
|
+
esc: "Escape",
|
|
57
|
+
escape: "Escape"
|
|
58
|
+
};
|
|
59
|
+
function v(e) {
|
|
60
|
+
let t = e.trim().split(/\s+/).filter(Boolean);
|
|
61
|
+
if (t.length !== 0) return t.map((e) => _[e.toLowerCase()] ?? (e.length === 1 ? e.toUpperCase() : e)).join("+");
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/components/toggle-group/toggle-group-size.ts
|
|
65
|
+
var y = l("md"), b = {
|
|
66
|
+
root: "imf-ui-toggle-module-root",
|
|
67
|
+
shortcut: "imf-ui-toggle-module-shortcut",
|
|
68
|
+
sizeSm: "imf-ui-toggle-module-sizeSm"
|
|
69
|
+
}, x = a(b.root, { variants: { size: {
|
|
70
|
+
sm: b.sizeSm,
|
|
71
|
+
md: null
|
|
72
|
+
} } }), S = 2;
|
|
73
|
+
function C(e) {
|
|
74
|
+
let t = 0;
|
|
75
|
+
return c.forEach(e, (e) => {
|
|
76
|
+
typeof e == "string" || typeof e == "number" ? t += String(e).trim().length : e != null && typeof e != "boolean" && (t += S);
|
|
77
|
+
}), t;
|
|
78
|
+
}
|
|
79
|
+
function w({ style: e, shortcut: t, size: n, children: a, ...c }) {
|
|
80
|
+
let l = u(y), f = {
|
|
81
|
+
"--glyph-count": C(a),
|
|
82
|
+
"--max-glyphs": S
|
|
83
|
+
};
|
|
84
|
+
return /* @__PURE__ */ s(d, {
|
|
85
|
+
"aria-keyshortcuts": t ? v(t) : void 0,
|
|
86
|
+
...c,
|
|
87
|
+
"data-imf-ui-component": "Toggle",
|
|
88
|
+
style: (t) => ({
|
|
89
|
+
...f,
|
|
90
|
+
...i(e, t)
|
|
91
|
+
}),
|
|
92
|
+
className: (e) => x({
|
|
93
|
+
size: n ?? l,
|
|
94
|
+
className: r(c.className, e)
|
|
95
|
+
}),
|
|
96
|
+
children: [a, t && /* @__PURE__ */ o(h, {
|
|
97
|
+
variant: "flat",
|
|
98
|
+
className: b.shortcut,
|
|
99
|
+
"aria-hidden": !0,
|
|
100
|
+
children: t
|
|
101
|
+
})]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
var T = {
|
|
105
|
+
root: "imf-ui-toggle-group-module-root",
|
|
106
|
+
sizeSm: "imf-ui-toggle-group-module-sizeSm"
|
|
107
|
+
}, E = a(T.root, { variants: { size: {
|
|
108
|
+
sm: T.sizeSm,
|
|
109
|
+
md: null
|
|
110
|
+
} } });
|
|
111
|
+
function D({ size: e = "md", ...t }) {
|
|
112
|
+
return /* @__PURE__ */ o(y.Provider, {
|
|
113
|
+
value: e ?? "md",
|
|
114
|
+
children: /* @__PURE__ */ o(f, {
|
|
115
|
+
...t,
|
|
116
|
+
"data-imf-ui-component": "ToggleGroup",
|
|
117
|
+
className: (n) => E({
|
|
118
|
+
size: e,
|
|
119
|
+
className: r(t.className, n)
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
export { h as a, g as i, w as n, v as r, D as t };
|
package/dist/utils/email.d.ts
CHANGED
|
@@ -3,5 +3,8 @@ export declare function splitEmail(email: string): {
|
|
|
3
3
|
local: string;
|
|
4
4
|
domain?: string;
|
|
5
5
|
};
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* One or two initials from the email's local part, split at dots, dashes, and underscores: `m.rossi@…` gives `MR`,
|
|
8
|
+
* `jkeller@…` gives `JK`.
|
|
9
|
+
*/
|
|
7
10
|
export declare function initialsFromEmail(email: string): string;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** One or two letters from words: the first letter of the first two, or the first two letters of a single word. */
|
|
2
|
+
export declare function initialsFromWords(words: string[]): string;
|
|
3
|
+
/** One or two initials from a display name, split at whitespace: `Mona Keller` gives `MK`, `Bob` gives `BO`. */
|
|
4
|
+
export declare function initialsFromName(name: string): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface ItemParts {
|
|
2
|
+
labelId: string;
|
|
3
|
+
descriptionId: string;
|
|
4
|
+
setHasLabel: (has: boolean) => void;
|
|
5
|
+
setHasDescription: (has: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const ItemPartsContext: import('react').Context<ItemParts | null>;
|
|
8
|
+
/** Creates the ids for one item. Spread `ariaProps` on the item and wrap its tree in `ItemPartsContext`. */
|
|
9
|
+
export declare function useItemParts(): {
|
|
10
|
+
context: {
|
|
11
|
+
labelId: string;
|
|
12
|
+
descriptionId: string;
|
|
13
|
+
setHasLabel: import('react').Dispatch<import('react').SetStateAction<boolean>>;
|
|
14
|
+
setHasDescription: import('react').Dispatch<import('react').SetStateAction<boolean>>;
|
|
15
|
+
};
|
|
16
|
+
ariaProps: {
|
|
17
|
+
"aria-labelledby": string | undefined;
|
|
18
|
+
"aria-describedby": string | undefined;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/** Returns the id an item's text or description part must render, or undefined outside an item. */
|
|
22
|
+
export declare function useItemPartId(part: "label" | "description"): string | undefined;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps a popup or inline list at the height it had when it mounted, so filtering does not shrink it under the pointer.
|
|
3
|
+
* Unmounting resets the height. Spread `style` before the consumer's style so theirs wins.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useStablePopupHeight({ ref: forwardedRef }: {
|
|
6
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
7
|
+
}): {
|
|
8
|
+
ref: (node: HTMLDivElement | null) => void;
|
|
9
|
+
style: import('react').CSSProperties | undefined;
|
|
10
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createContext as e, useCallback as t, useContext as n, useEffect as r, useId as i, useMemo as a, useState as o } from "react";
|
|
2
|
+
//#region src/utils/resolve-state-props.ts
|
|
3
|
+
function s(e, t) {
|
|
4
|
+
return e instanceof Function ? e(t) : e;
|
|
5
|
+
}
|
|
6
|
+
function c(e, t) {
|
|
7
|
+
return s(e, t);
|
|
8
|
+
}
|
|
9
|
+
function l(e, t) {
|
|
10
|
+
return s(e, t);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/utils/item-parts.tsx
|
|
14
|
+
var u = e(null);
|
|
15
|
+
function d() {
|
|
16
|
+
let e = i(), t = i(), [n, r] = o(!1), [s, c] = o(!1);
|
|
17
|
+
return {
|
|
18
|
+
context: a(() => ({
|
|
19
|
+
labelId: e,
|
|
20
|
+
descriptionId: t,
|
|
21
|
+
setHasLabel: r,
|
|
22
|
+
setHasDescription: c
|
|
23
|
+
}), [e, t]),
|
|
24
|
+
ariaProps: {
|
|
25
|
+
"aria-labelledby": n ? e : void 0,
|
|
26
|
+
"aria-describedby": s ? t : void 0
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function f(e) {
|
|
31
|
+
let t = n(u), i = e === "label" ? t?.setHasLabel : t?.setHasDescription;
|
|
32
|
+
return r(() => (i?.(!0), () => i?.(!1)), [i]), e === "label" ? t?.labelId : t?.descriptionId;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/utils/stable-popup-height.ts
|
|
36
|
+
function p({ ref: e }) {
|
|
37
|
+
let [n, r] = o();
|
|
38
|
+
return {
|
|
39
|
+
ref: t((t) => {
|
|
40
|
+
typeof e == "function" ? e(t) : e && (e.current = t), t && r((e) => e ?? t.offsetHeight);
|
|
41
|
+
}, [e]),
|
|
42
|
+
style: n === void 0 ? void 0 : { minBlockSize: `min(${String(n)}px, var(--available-height, ${String(n)}px))` }
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { c as a, d as i, u as n, l as o, f as r, p as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imfusion/web-ui",
|
|
3
|
-
"version": "0.11.1-dev.
|
|
3
|
+
"version": "0.11.1-dev.62.gfcd31b6e",
|
|
4
4
|
"description": "The official Web UI component library for ImFusion web apps",
|
|
5
5
|
"author": "ImFusion GmbH",
|
|
6
6
|
"homepage": "https://imfusion.com",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"type": "module",
|
|
13
13
|
"engines": {
|
|
14
|
-
"node": "^
|
|
14
|
+
"node": "^24.14 || >=26"
|
|
15
15
|
},
|
|
16
16
|
"imports": {
|
|
17
17
|
"#/*": "./src/*",
|
|
@@ -122,8 +122,8 @@
|
|
|
122
122
|
"commander": "15.0.0"
|
|
123
123
|
},
|
|
124
124
|
"devDependencies": {
|
|
125
|
-
"@imfusion/sdk": "1.
|
|
126
|
-
"@imfusion/sdk-react": "1.
|
|
125
|
+
"@imfusion/sdk": "1.3.0",
|
|
126
|
+
"@imfusion/sdk-react": "1.3.0",
|
|
127
127
|
"@storybook/addon-a11y": "10.6.2",
|
|
128
128
|
"@storybook/addon-docs": "10.6.2",
|
|
129
129
|
"@storybook/addon-mcp": "10.6.2",
|