@imfusion/web-ui 0.6.4-dev.8.g41d03f2f → 0.6.4-dev.84.gbfc0d437
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 +19 -55
- package/dist/assets/vendors/base-ui.d.ts +2 -3
- package/dist/breakpoints/min-width.d.ts +3 -7
- package/dist/breakpoints/registry.d.ts +3 -9
- package/dist/{code-Ce8uiPsv.js → code-D2lwxHgd.js} +15 -15
- package/dist/codegen/gen-breakpoints-css.d.ts +0 -4
- package/dist/codegen/gen-token-css.d.ts +0 -2
- package/dist/components/app-shell/app-shell.d.ts +7 -11
- package/dist/components/button/button.d.ts +7 -12
- package/dist/components/callout/callout.d.ts +11 -18
- package/dist/components/card/card.d.ts +11 -10
- package/dist/components/checkbox/checkbox.d.ts +2 -38
- package/dist/components/chip/chip.cva.d.ts +2 -4
- package/dist/components/chip/chip.d.ts +1 -1
- package/dist/components/code/code.d.ts +2 -2
- package/dist/components/collapsible/collapsible.d.ts +4 -35
- package/dist/components/copy-button/copy-button.d.ts +1 -1
- package/dist/components/drawer/drawer.d.ts +17 -100
- package/dist/components/field/field.d.ts +7 -67
- package/dist/components/fieldset/fieldset.d.ts +2 -15
- package/dist/components/icon/icon.d.ts +2 -2
- package/dist/components/input/input.d.ts +2 -8
- package/dist/components/logo/imfusion/imfusion.d.ts +2 -5
- package/dist/components/logo/imfusion/marks.d.ts +10 -0
- package/dist/components/logo/logo.d.ts +3 -3
- package/dist/components/navigation-menu/subs/flyout-link.d.ts +5 -19
- package/dist/components/navigation-menu/subs/inline-submenu.d.ts +2 -4
- package/dist/components/navigation-menu/subs/link.d.ts +6 -23
- package/dist/components/navigation-menu/subs/overlay.d.ts +6 -51
- package/dist/components/navigation-menu/subs/shared.d.ts +4 -14
- package/dist/components/navigation-menu/subs/structure.d.ts +7 -29
- package/dist/components/navigation-menu/subs/trigger.d.ts +11 -20
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/number-field.d.ts +72 -0
- package/dist/components/number-field/number-field.meta.d.ts +2 -0
- package/dist/components/popover/popover.d.ts +23 -98
- package/dist/components/row/row.d.ts +1 -1
- package/dist/components/select/select.d.ts +26 -189
- package/dist/components/separator/separator.d.ts +5 -4
- package/dist/components/slider/slider.d.ts +7 -77
- package/dist/components/spinner/spinner.d.ts +13 -8
- package/dist/components/stack/stack.d.ts +3 -4
- package/dist/components/switch/switch.d.ts +2 -31
- package/dist/components/table/table.d.ts +10 -18
- package/dist/components/tabs/tabs.d.ts +18 -52
- package/dist/components/toast/toast.d.ts +16 -103
- package/dist/components/toggle/toggle.d.ts +3 -21
- package/dist/components/toggle-group/toggle-group.d.ts +3 -20
- package/dist/components/tooltip/tooltip.d.ts +26 -85
- package/dist/components/typo/typo.d.ts +25 -25
- package/dist/docgen/gen-docgen.utils.d.ts +3 -4
- package/dist/hooks/use-color-scheme.d.ts +5 -11
- package/dist/hooks/use-media-query.d.ts +2 -7
- package/dist/{icons-Cy1HAosO.js → icons-CaGCCwG-.js} +7 -7
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1486 -1368
- package/dist/integrations/code-highlight/highlighter.d.ts +1 -56
- package/dist/integrations/code-highlight.js +41 -189
- package/dist/integrations/image-display-options/image-display-options-view.utils.d.ts +0 -1
- package/dist/integrations/image-display-options.js +54 -54
- package/dist/llms/evals/runner/affected.d.ts +2 -0
- package/dist/llms/evals/runner/benchmark.d.ts +12 -0
- package/dist/llms/evals/runner/compare.d.ts +2 -0
- package/dist/llms/evals/runner/config.d.ts +29 -0
- package/dist/llms/evals/runner/evidence.d.ts +7 -0
- package/dist/llms/evals/runner/execute.d.ts +32 -0
- package/dist/llms/evals/runner/grade.d.ts +10 -0
- package/dist/llms/evals/runner/report-md.d.ts +2 -0
- package/dist/llms/evals/runner/report.d.ts +4 -0
- package/dist/llms/evals/runner/run.d.ts +2 -0
- package/dist/llms/evals/runner/scenario.d.ts +3 -0
- package/dist/llms/evals/runner/types.d.ts +140 -0
- package/dist/llms/evals/runner/workspace.d.ts +2 -0
- package/dist/llms/evals/runner/write-generated.d.ts +1 -0
- package/dist/provider/web-ui-provider.d.ts +4 -1
- package/dist/style.css +1 -1
- package/dist/{tabs-DIe1Utiy.js → tabs-By5ir2pt.js} +162 -159
- package/dist/tokens/apply.d.ts +4 -9
- package/dist/tokens/control-registry.d.ts +3 -6
- package/dist/tokens/types.d.ts +7 -24
- package/dist/tokens/use-token-controls.d.ts +3 -12
- package/dist/types/meta.d.ts +15 -32
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/resolve-state-props.d.ts +4 -0
- package/dist/vite/brand-assets.d.ts +3 -0
- package/dist/vite/index.d.ts +2 -0
- package/dist/vite/readable-css-module-names.d.ts +11 -0
- package/dist/vite.js +55 -0
- package/dist/web-ui-cli.js +322 -0
- package/docs/user-guide/AgentTooling.mdx +127 -0
- package/docs/user-guide/BrandAssets.mdx +102 -0
- package/docs/user-guide/Changelog.mdx +23 -0
- package/docs/user-guide/GettingStarted.mdx +70 -0
- package/docs/user-guide/HowItsBuilt.mdx +113 -0
- package/docs/user-guide/Tokens.mdx +87 -0
- package/docs/user-guide/UsagePatterns.mdx +122 -0
- package/package.json +27 -22
- package/src/assets/public/favicon/apple-touch-icon.png +0 -0
- package/src/assets/public/favicon/favicon-16.png +0 -0
- package/src/assets/public/favicon/favicon-32.png +0 -0
- package/src/assets/public/favicon/favicon.ico +0 -0
- package/src/assets/public/favicon/favicon.svg +7 -0
- package/src/assets/public/favicon/icon-192.png +0 -0
- package/src/assets/public/favicon/icon-512.png +0 -0
- package/src/assets/public/favicon/og-image.png +0 -0
- package/src/assets/public/spinner/imfusion-spinner-black.webp +0 -0
- package/src/assets/public/spinner/imfusion-spinner-blue.webp +0 -0
- package/src/assets/public/spinner/imfusion-spinner-white.webp +0 -0
- package/src/docgen/doc.gen.json +3255 -603
- package/src/llms/install-templates/AGENTS.md +4 -4
- package/src/llms/install-templates/hooks/baseline-staleness.sh +9 -2
- package/src/llms/llms.gen.txt +7 -1
- package/src/llms/skills/imf-web-ui/SKILL.md +44 -21
- package/src/llms/skills/imf-web-ui-audit/SKILL.md +25 -11
- package/src/llms/skills/imf-web-ui-components/SKILL.md +4 -1
- package/src/llms/skills/imf-web-ui-conventions/SKILL.md +2 -2
- package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +0 -1
- package/src/llms/skills/imf-web-ui-conventions/templates/REPORT.md +21 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/agent-tooling.md +15 -10
- package/src/llms/skills/imf-web-ui-conventions/topics/assets.md +7 -4
- package/src/llms/skills/imf-web-ui-conventions/topics/data.md +3 -1
- package/src/llms/skills/imf-web-ui-conventions/topics/docs-structure.md +2 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/git.md +4 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/library-setup.md +10 -1
- package/src/llms/skills/imf-web-ui-conventions/topics/styling.md +2 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/tokens.md +4 -2
- package/src/llms/skills/imf-web-ui-conventions/topics/tooling.md +13 -11
- package/src/llms/skills/imf-web-ui-setup/SKILL.md +17 -9
- package/src/llms/skills/imf-web-ui-update/SKILL.md +36 -14
- package/src/llms/skills/imf-web-ui-ux/SKILL.md +5 -3
- package/src/llms/tokens.gen.json +71 -7
- package/bin/install.js +0 -446
- package/dist/build/vite-css-module-names/index.d.ts +0 -20
- package/dist/build/vite-css-module-names.js +0 -17
- package/dist/components/spinner/spinner.geometry.d.ts +0 -37
- package/dist/integrations/code-highlight/languages/cmake.d.ts +0 -1
- package/dist/integrations/code-highlight/languages/cpp.d.ts +0 -1
- /package/dist/{meta-CySnRuVp.js → meta-j-7HGrWv.js} +0 -0
|
@@ -7,7 +7,17 @@ import { Switch as a } from "@base-ui/react/switch";
|
|
|
7
7
|
import { Toggle as o } from "@base-ui/react/toggle";
|
|
8
8
|
import { ToggleGroup as s } from "@base-ui/react/toggle-group";
|
|
9
9
|
import { Tabs as c } from "@base-ui/react/tabs";
|
|
10
|
-
|
|
10
|
+
//#region src/utils/resolve-state-props.ts
|
|
11
|
+
function l(e, t) {
|
|
12
|
+
return e instanceof Function ? e(t) : e;
|
|
13
|
+
}
|
|
14
|
+
function u(e, t) {
|
|
15
|
+
return l(e, t);
|
|
16
|
+
}
|
|
17
|
+
function d(e, t) {
|
|
18
|
+
return l(e, t);
|
|
19
|
+
}
|
|
20
|
+
var f = {
|
|
11
21
|
control: "imf-ui-slider-module-control",
|
|
12
22
|
indicator: "imf-ui-slider-module-indicator",
|
|
13
23
|
label: "imf-ui-slider-module-label",
|
|
@@ -15,21 +25,21 @@ var l = {
|
|
|
15
25
|
thumb: "imf-ui-slider-module-thumb",
|
|
16
26
|
track: "imf-ui-slider-module-track",
|
|
17
27
|
value: "imf-ui-slider-module-value"
|
|
18
|
-
},
|
|
19
|
-
Control: () =>
|
|
20
|
-
Indicator: () =>
|
|
21
|
-
Label: () =>
|
|
22
|
-
Root: () =>
|
|
23
|
-
Thumb: () =>
|
|
24
|
-
Track: () =>
|
|
25
|
-
Value: () =>
|
|
26
|
-
}),
|
|
27
|
-
function
|
|
28
|
+
}, p = /* @__PURE__ */ e({
|
|
29
|
+
Control: () => C,
|
|
30
|
+
Indicator: () => T,
|
|
31
|
+
Label: () => x,
|
|
32
|
+
Root: () => b,
|
|
33
|
+
Thumb: () => E,
|
|
34
|
+
Track: () => w,
|
|
35
|
+
Value: () => S
|
|
36
|
+
}), ee = t(f.root), m = t(f.label), h = t(f.value), g = t(f.control), _ = t(f.track), v = t(f.indicator), y = t(f.thumb);
|
|
37
|
+
function b({ value: e, defaultValue: t, onValueChange: r, onValueCommitted: a, min: o = 0, max: s = 100, step: c = 1, largeStep: l = 10, minStepsBetweenValues: d = 0, disabled: f = !1, orientation: p = "horizontal", name: m, form: h, locale: g, thumbAlignment: _ = "edge", thumbCollisionBehavior: v = "push", format: y, ...b }) {
|
|
28
38
|
return /* @__PURE__ */ n(i.Root, {
|
|
29
|
-
...
|
|
39
|
+
...b,
|
|
30
40
|
"data-imf-ui-component": "Slider.Root",
|
|
31
41
|
"data-orientation": p,
|
|
32
|
-
className: (e) =>
|
|
42
|
+
className: (e) => ee({ className: u(b.className, e) }),
|
|
33
43
|
value: e,
|
|
34
44
|
defaultValue: t,
|
|
35
45
|
onValueChange: r,
|
|
@@ -38,7 +48,7 @@ function v({ value: e, defaultValue: t, onValueChange: r, onValueCommitted: a, m
|
|
|
38
48
|
max: s,
|
|
39
49
|
step: c,
|
|
40
50
|
largeStep: l,
|
|
41
|
-
minStepsBetweenValues:
|
|
51
|
+
minStepsBetweenValues: d,
|
|
42
52
|
disabled: f,
|
|
43
53
|
orientation: p,
|
|
44
54
|
name: m,
|
|
@@ -46,124 +56,119 @@ function v({ value: e, defaultValue: t, onValueChange: r, onValueCommitted: a, m
|
|
|
46
56
|
locale: g,
|
|
47
57
|
thumbAlignment: _,
|
|
48
58
|
thumbCollisionBehavior: v,
|
|
49
|
-
format: y
|
|
50
|
-
children: x.children
|
|
59
|
+
format: y
|
|
51
60
|
});
|
|
52
61
|
}
|
|
53
|
-
|
|
54
|
-
function
|
|
62
|
+
b.displayName = "Slider.Root";
|
|
63
|
+
function x(e) {
|
|
55
64
|
return /* @__PURE__ */ n(i.Label, {
|
|
56
|
-
...
|
|
65
|
+
...e,
|
|
57
66
|
"data-imf-ui-component": "Slider.Label",
|
|
58
|
-
className: (t) =>
|
|
59
|
-
children: t.children
|
|
67
|
+
className: (t) => m({ className: u(e.className, t) })
|
|
60
68
|
});
|
|
61
69
|
}
|
|
62
|
-
|
|
63
|
-
function
|
|
70
|
+
x.displayName = "Slider.Label";
|
|
71
|
+
function S({ children: e, ...t }) {
|
|
64
72
|
return /* @__PURE__ */ n(i.Value, {
|
|
65
|
-
...
|
|
73
|
+
...t,
|
|
66
74
|
"data-imf-ui-component": "Slider.Value",
|
|
67
|
-
className: (
|
|
68
|
-
children:
|
|
75
|
+
className: (e) => h({ className: u(t.className, e) }),
|
|
76
|
+
children: e
|
|
69
77
|
});
|
|
70
78
|
}
|
|
71
|
-
|
|
72
|
-
function
|
|
79
|
+
S.displayName = "Slider.Value";
|
|
80
|
+
function C(e) {
|
|
73
81
|
return /* @__PURE__ */ n(i.Control, {
|
|
74
|
-
...
|
|
82
|
+
...e,
|
|
75
83
|
"data-imf-ui-component": "Slider.Control",
|
|
76
|
-
className: (t) =>
|
|
77
|
-
children: t.children
|
|
84
|
+
className: (t) => g({ className: u(e.className, t) })
|
|
78
85
|
});
|
|
79
86
|
}
|
|
80
|
-
|
|
81
|
-
function
|
|
87
|
+
C.displayName = "Slider.Control";
|
|
88
|
+
function w(e) {
|
|
82
89
|
return /* @__PURE__ */ n(i.Track, {
|
|
83
|
-
...
|
|
90
|
+
...e,
|
|
84
91
|
"data-imf-ui-component": "Slider.Track",
|
|
85
|
-
className: (t) =>
|
|
86
|
-
children: t.children
|
|
92
|
+
className: (t) => _({ className: u(e.className, t) })
|
|
87
93
|
});
|
|
88
94
|
}
|
|
89
|
-
|
|
90
|
-
function
|
|
95
|
+
w.displayName = "Slider.Track";
|
|
96
|
+
function T(e) {
|
|
91
97
|
return /* @__PURE__ */ n(i.Indicator, {
|
|
92
|
-
...
|
|
98
|
+
...e,
|
|
93
99
|
"data-imf-ui-component": "Slider.Indicator",
|
|
94
|
-
className: (t) =>
|
|
100
|
+
className: (t) => v({ className: u(e.className, t) })
|
|
95
101
|
});
|
|
96
102
|
}
|
|
97
|
-
|
|
98
|
-
function
|
|
103
|
+
T.displayName = "Slider.Indicator";
|
|
104
|
+
function E({ index: e, ...t }) {
|
|
99
105
|
return /* @__PURE__ */ n(i.Thumb, {
|
|
100
|
-
...
|
|
106
|
+
...t,
|
|
101
107
|
"data-imf-ui-component": "Slider.Thumb",
|
|
102
|
-
className: (e) =>
|
|
108
|
+
className: (e) => y({ className: u(t.className, e) }),
|
|
103
109
|
index: e
|
|
104
110
|
});
|
|
105
111
|
}
|
|
106
|
-
|
|
107
|
-
var
|
|
112
|
+
E.displayName = "Slider.Thumb";
|
|
113
|
+
var D = {
|
|
108
114
|
root: "imf-ui-switch-module-root",
|
|
109
115
|
thumb: "imf-ui-switch-module-thumb"
|
|
110
|
-
},
|
|
111
|
-
Root: () =>
|
|
112
|
-
Thumb: () =>
|
|
113
|
-
}),
|
|
114
|
-
function
|
|
116
|
+
}, te = /* @__PURE__ */ e({
|
|
117
|
+
Root: () => A,
|
|
118
|
+
Thumb: () => j
|
|
119
|
+
}), O = t(D.root), k = t(D.thumb);
|
|
120
|
+
function A(e) {
|
|
115
121
|
return /* @__PURE__ */ n(a.Root, {
|
|
116
|
-
...
|
|
122
|
+
...e,
|
|
117
123
|
"data-imf-ui-component": "Switch.Root",
|
|
118
|
-
className: (t) =>
|
|
119
|
-
children: t.children
|
|
124
|
+
className: (t) => O({ className: u(e.className, t) })
|
|
120
125
|
});
|
|
121
126
|
}
|
|
122
|
-
|
|
123
|
-
function
|
|
127
|
+
A.displayName = "Switch.Root";
|
|
128
|
+
function j(e) {
|
|
124
129
|
return /* @__PURE__ */ n(a.Thumb, {
|
|
125
|
-
...
|
|
130
|
+
...e,
|
|
126
131
|
"data-imf-ui-component": "Switch.Thumb",
|
|
127
|
-
className: (t) =>
|
|
132
|
+
className: (t) => k({ className: u(e.className, t) })
|
|
128
133
|
});
|
|
129
134
|
}
|
|
130
|
-
|
|
135
|
+
j.displayName = "Switch.Thumb";
|
|
131
136
|
//#endregion
|
|
132
137
|
//#region src/components/toggle/toggle.tsx
|
|
133
|
-
var
|
|
134
|
-
function
|
|
138
|
+
var M = t({ root: "imf-ui-toggle-module-root" }.root), N = 2;
|
|
139
|
+
function P(e) {
|
|
135
140
|
let t = 0;
|
|
136
141
|
return r.forEach(e, (e) => {
|
|
137
|
-
typeof e == "string" || typeof e == "number" ? t += String(e).trim().length : e != null && typeof e != "boolean" && (t +=
|
|
142
|
+
typeof e == "string" || typeof e == "number" ? t += String(e).trim().length : e != null && typeof e != "boolean" && (t += N);
|
|
138
143
|
}), t;
|
|
139
144
|
}
|
|
140
|
-
function
|
|
141
|
-
let
|
|
142
|
-
"--glyph-count":
|
|
143
|
-
"--max-glyphs":
|
|
145
|
+
function F({ style: e, children: t, ...r }) {
|
|
146
|
+
let i = {
|
|
147
|
+
"--glyph-count": P(t),
|
|
148
|
+
"--max-glyphs": N
|
|
144
149
|
};
|
|
145
150
|
return /* @__PURE__ */ n(o, {
|
|
146
|
-
...
|
|
151
|
+
...r,
|
|
147
152
|
"data-imf-ui-component": "Toggle",
|
|
148
|
-
style: (
|
|
149
|
-
...
|
|
150
|
-
...
|
|
153
|
+
style: (t) => ({
|
|
154
|
+
...i,
|
|
155
|
+
...d(e, t)
|
|
151
156
|
}),
|
|
152
|
-
className: (
|
|
153
|
-
children:
|
|
157
|
+
className: (e) => M({ className: u(r.className, e) }),
|
|
158
|
+
children: t
|
|
154
159
|
});
|
|
155
160
|
}
|
|
156
161
|
//#endregion
|
|
157
162
|
//#region src/components/toggle-group/toggle-group.tsx
|
|
158
|
-
var
|
|
159
|
-
function
|
|
163
|
+
var I = t({ root: "imf-ui-toggle-group-module-root" }.root);
|
|
164
|
+
function L(e) {
|
|
160
165
|
return /* @__PURE__ */ n(s, {
|
|
161
|
-
...
|
|
166
|
+
...e,
|
|
162
167
|
"data-imf-ui-component": "ToggleGroup",
|
|
163
|
-
className: (t) =>
|
|
168
|
+
className: (t) => I({ className: u(e.className, t) })
|
|
164
169
|
});
|
|
165
170
|
}
|
|
166
|
-
var
|
|
171
|
+
var R = {
|
|
167
172
|
alignCenter: "imf-ui-row-module-alignCenter",
|
|
168
173
|
alignEnd: "imf-ui-row-module-alignEnd",
|
|
169
174
|
alignStart: "imf-ui-row-module-alignStart",
|
|
@@ -186,53 +191,52 @@ var P = {
|
|
|
186
191
|
justifyStart: "imf-ui-row-module-justifyStart",
|
|
187
192
|
root: "imf-ui-row-module-root",
|
|
188
193
|
wrap: "imf-ui-row-module-wrap"
|
|
189
|
-
},
|
|
194
|
+
}, z = t(R.root, { variants: {
|
|
190
195
|
gap: {
|
|
191
|
-
1:
|
|
192
|
-
2:
|
|
193
|
-
3:
|
|
194
|
-
4:
|
|
195
|
-
5:
|
|
196
|
-
6:
|
|
197
|
-
7:
|
|
198
|
-
8:
|
|
199
|
-
9:
|
|
200
|
-
10:
|
|
196
|
+
1: R.gap1,
|
|
197
|
+
2: R.gap2,
|
|
198
|
+
3: R.gap3,
|
|
199
|
+
4: R.gap4,
|
|
200
|
+
5: R.gap5,
|
|
201
|
+
6: R.gap6,
|
|
202
|
+
7: R.gap7,
|
|
203
|
+
8: R.gap8,
|
|
204
|
+
9: R.gap9,
|
|
205
|
+
10: R.gap10
|
|
201
206
|
},
|
|
202
207
|
align: {
|
|
203
|
-
start:
|
|
204
|
-
center:
|
|
205
|
-
end:
|
|
206
|
-
stretch:
|
|
208
|
+
start: R.alignStart,
|
|
209
|
+
center: R.alignCenter,
|
|
210
|
+
end: R.alignEnd,
|
|
211
|
+
stretch: R.alignStretch
|
|
207
212
|
},
|
|
208
213
|
justify: {
|
|
209
|
-
start:
|
|
210
|
-
center:
|
|
211
|
-
end:
|
|
212
|
-
between:
|
|
213
|
-
around:
|
|
214
|
-
evenly:
|
|
214
|
+
start: R.justifyStart,
|
|
215
|
+
center: R.justifyCenter,
|
|
216
|
+
end: R.justifyEnd,
|
|
217
|
+
between: R.justifyBetween,
|
|
218
|
+
around: R.justifyAround,
|
|
219
|
+
evenly: R.justifyEvenly
|
|
215
220
|
},
|
|
216
221
|
wrap: {
|
|
217
|
-
true:
|
|
222
|
+
true: R.wrap,
|
|
218
223
|
false: null
|
|
219
224
|
}
|
|
220
225
|
} });
|
|
221
|
-
function
|
|
226
|
+
function B({ gap: e = "2", align: t = "stretch", justify: r = "start", wrap: i = !1, ...a }) {
|
|
222
227
|
return /* @__PURE__ */ n("div", {
|
|
223
|
-
...
|
|
228
|
+
...a,
|
|
224
229
|
"data-imf-ui-component": "Row",
|
|
225
|
-
className:
|
|
230
|
+
className: z({
|
|
226
231
|
gap: e,
|
|
227
232
|
align: t,
|
|
228
233
|
justify: r,
|
|
229
234
|
wrap: i,
|
|
230
|
-
className: a
|
|
231
|
-
})
|
|
232
|
-
children: o.children
|
|
235
|
+
className: a.className
|
|
236
|
+
})
|
|
233
237
|
});
|
|
234
238
|
}
|
|
235
|
-
var
|
|
239
|
+
var V = {
|
|
236
240
|
alignCenter: "imf-ui-stack-module-alignCenter",
|
|
237
241
|
alignEnd: "imf-ui-stack-module-alignEnd",
|
|
238
242
|
alignStart: "imf-ui-stack-module-alignStart",
|
|
@@ -255,49 +259,48 @@ var L = {
|
|
|
255
259
|
justifyEvenly: "imf-ui-stack-module-justifyEvenly",
|
|
256
260
|
justifyStart: "imf-ui-stack-module-justifyStart",
|
|
257
261
|
root: "imf-ui-stack-module-root"
|
|
258
|
-
},
|
|
262
|
+
}, H = t(V.root, { variants: {
|
|
259
263
|
gap: {
|
|
260
|
-
0:
|
|
261
|
-
1:
|
|
262
|
-
2:
|
|
263
|
-
3:
|
|
264
|
-
4:
|
|
265
|
-
5:
|
|
266
|
-
6:
|
|
267
|
-
7:
|
|
268
|
-
8:
|
|
269
|
-
9:
|
|
270
|
-
10:
|
|
264
|
+
0: V.gap0,
|
|
265
|
+
1: V.gap1,
|
|
266
|
+
2: V.gap2,
|
|
267
|
+
3: V.gap3,
|
|
268
|
+
4: V.gap4,
|
|
269
|
+
5: V.gap5,
|
|
270
|
+
6: V.gap6,
|
|
271
|
+
7: V.gap7,
|
|
272
|
+
8: V.gap8,
|
|
273
|
+
9: V.gap9,
|
|
274
|
+
10: V.gap10
|
|
271
275
|
},
|
|
272
276
|
align: {
|
|
273
|
-
start:
|
|
274
|
-
center:
|
|
275
|
-
end:
|
|
276
|
-
stretch:
|
|
277
|
+
start: V.alignStart,
|
|
278
|
+
center: V.alignCenter,
|
|
279
|
+
end: V.alignEnd,
|
|
280
|
+
stretch: V.alignStretch
|
|
277
281
|
},
|
|
278
282
|
justify: {
|
|
279
|
-
start:
|
|
280
|
-
center:
|
|
281
|
-
end:
|
|
282
|
-
between:
|
|
283
|
-
around:
|
|
284
|
-
evenly:
|
|
283
|
+
start: V.justifyStart,
|
|
284
|
+
center: V.justifyCenter,
|
|
285
|
+
end: V.justifyEnd,
|
|
286
|
+
between: V.justifyBetween,
|
|
287
|
+
around: V.justifyAround,
|
|
288
|
+
evenly: V.justifyEvenly
|
|
285
289
|
}
|
|
286
290
|
} });
|
|
287
|
-
function
|
|
291
|
+
function U({ gap: e = "4", align: t = "stretch", justify: r = "start", ...i }) {
|
|
288
292
|
return /* @__PURE__ */ n("div", {
|
|
289
|
-
...
|
|
293
|
+
...i,
|
|
290
294
|
"data-imf-ui-component": "Stack",
|
|
291
|
-
className:
|
|
295
|
+
className: H({
|
|
292
296
|
gap: e,
|
|
293
297
|
align: t,
|
|
294
298
|
justify: r,
|
|
295
|
-
className: i
|
|
296
|
-
})
|
|
297
|
-
children: a.children
|
|
299
|
+
className: i.className
|
|
300
|
+
})
|
|
298
301
|
});
|
|
299
302
|
}
|
|
300
|
-
var
|
|
303
|
+
var W = {
|
|
301
304
|
indicator: "imf-ui-tabs-module-indicator",
|
|
302
305
|
list: "imf-ui-tabs-module-list",
|
|
303
306
|
listFill: "imf-ui-tabs-module-listFill",
|
|
@@ -305,67 +308,67 @@ var B = {
|
|
|
305
308
|
panelViewport: "imf-ui-tabs-module-panelViewport",
|
|
306
309
|
root: "imf-ui-tabs-module-root",
|
|
307
310
|
tab: "imf-ui-tabs-module-tab"
|
|
308
|
-
},
|
|
311
|
+
}, G = /* @__PURE__ */ e({
|
|
309
312
|
Indicator: () => Z,
|
|
310
313
|
List: () => Y,
|
|
311
314
|
Panel: () => $,
|
|
312
315
|
PanelViewport: () => Q,
|
|
313
316
|
Root: () => J,
|
|
314
317
|
Tab: () => X
|
|
315
|
-
}),
|
|
316
|
-
true:
|
|
318
|
+
}), K = t(W.list, { variants: { fill: {
|
|
319
|
+
true: W.listFill,
|
|
317
320
|
false: null
|
|
318
|
-
} } }),
|
|
319
|
-
function J(
|
|
321
|
+
} } }), q = t(W.root), ne = t(W.tab), re = t(W.indicator), ie = t(W.panelViewport), ae = t(W.panel);
|
|
322
|
+
function J(e) {
|
|
320
323
|
return /* @__PURE__ */ n(c.Root, {
|
|
321
|
-
...
|
|
324
|
+
...e,
|
|
322
325
|
"data-imf-ui-component": "Tabs.Root",
|
|
323
|
-
className: (t) =>
|
|
326
|
+
className: (t) => q({ className: u(e.className, t) })
|
|
324
327
|
});
|
|
325
328
|
}
|
|
326
329
|
J.displayName = "Tabs.Root";
|
|
327
|
-
function Y({ fill: e = !1,
|
|
330
|
+
function Y({ fill: e = !1, ...t }) {
|
|
328
331
|
return /* @__PURE__ */ n(c.List, {
|
|
329
|
-
...
|
|
332
|
+
...t,
|
|
330
333
|
"data-imf-ui-component": "Tabs.List",
|
|
331
|
-
className: (n) =>
|
|
334
|
+
className: (n) => K({
|
|
332
335
|
fill: e,
|
|
333
|
-
className:
|
|
336
|
+
className: u(t.className, n)
|
|
334
337
|
})
|
|
335
338
|
});
|
|
336
339
|
}
|
|
337
340
|
Y.displayName = "Tabs.List";
|
|
338
|
-
function X(
|
|
341
|
+
function X(e) {
|
|
339
342
|
return /* @__PURE__ */ n(c.Tab, {
|
|
340
|
-
...
|
|
343
|
+
...e,
|
|
341
344
|
"data-imf-ui-component": "Tabs.Tab",
|
|
342
|
-
className: (t) =>
|
|
345
|
+
className: (t) => ne({ className: u(e.className, t) })
|
|
343
346
|
});
|
|
344
347
|
}
|
|
345
348
|
X.displayName = "Tabs.Tab";
|
|
346
|
-
function Z(
|
|
349
|
+
function Z(e) {
|
|
347
350
|
return /* @__PURE__ */ n(c.Indicator, {
|
|
348
|
-
...
|
|
351
|
+
...e,
|
|
349
352
|
"data-imf-ui-component": "Tabs.Indicator",
|
|
350
|
-
className: (t) =>
|
|
353
|
+
className: (t) => re({ className: u(e.className, t) })
|
|
351
354
|
});
|
|
352
355
|
}
|
|
353
356
|
Z.displayName = "Tabs.Indicator";
|
|
354
|
-
function Q(
|
|
357
|
+
function Q(e) {
|
|
355
358
|
return /* @__PURE__ */ n("div", {
|
|
356
|
-
...
|
|
359
|
+
...e,
|
|
357
360
|
"data-imf-ui-component": "Tabs.PanelViewport",
|
|
358
|
-
className:
|
|
361
|
+
className: ie({ className: e.className })
|
|
359
362
|
});
|
|
360
363
|
}
|
|
361
364
|
Q.displayName = "Tabs.PanelViewport";
|
|
362
|
-
function $(
|
|
365
|
+
function $(e) {
|
|
363
366
|
return /* @__PURE__ */ n(c.Panel, {
|
|
364
|
-
...
|
|
367
|
+
...e,
|
|
365
368
|
"data-imf-ui-component": "Tabs.Panel",
|
|
366
|
-
className: (t) =>
|
|
369
|
+
className: (t) => ae({ className: u(e.className, t) })
|
|
367
370
|
});
|
|
368
371
|
}
|
|
369
372
|
$.displayName = "Tabs.Panel";
|
|
370
373
|
//#endregion
|
|
371
|
-
export { u as S,
|
|
374
|
+
export { u as C, p as S, x as _, J as a, w as b, U as c, F as d, A as f, T as g, C as h, Q as i, B as l, te as m, Y as n, X as o, j as p, $ as r, G as s, Z as t, L as u, b as v, S as x, E as y };
|
package/dist/tokens/apply.d.ts
CHANGED
|
@@ -5,12 +5,8 @@ import { TokenOverrides } from './types';
|
|
|
5
5
|
* Pure token-application layer — no React, no router, no DOM ownership beyond the one imperative
|
|
6
6
|
* writer ({@link applyTokenOverrides}). The stateful, persistence-agnostic hook is `useTokenControls`.
|
|
7
7
|
*/
|
|
8
|
-
/** Flatten a possibly scheme-keyed numeric value to the active scheme. */
|
|
9
8
|
export declare function resolveScheme(field: number | Record<ColorScheme, number>, scheme: ColorScheme): number;
|
|
10
|
-
/**
|
|
11
|
-
* A control resolved to the active scheme — the panel-facing view. Slider controls carry numeric
|
|
12
|
-
* bounds; select controls carry options.
|
|
13
|
-
*/
|
|
9
|
+
/** A control resolved to the active scheme — the panel-facing view of a token control. */
|
|
14
10
|
export type ResolvedControl = {
|
|
15
11
|
id: TokenId;
|
|
16
12
|
cssVar: string;
|
|
@@ -47,9 +43,8 @@ export declare function resolve(control: TokenControl, scheme: ColorScheme): Res
|
|
|
47
43
|
*/
|
|
48
44
|
export declare function deriveAll(live: TokenOverrides): TokenOverrides;
|
|
49
45
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* a layout effect, and hosts (Storybook, consumers) can call it directly.
|
|
46
|
+
* Reconciles `documentElement`'s inline custom properties to `overrides`: sets present vars, removes
|
|
47
|
+
* every registry var absent from `overrides` (both `-light`/`-dark`), so reset and scheme switches
|
|
48
|
+
* leave nothing stale. This is the one DOM writer.
|
|
54
49
|
*/
|
|
55
50
|
export declare function applyTokenOverrides(overrides: TokenOverrides, root?: HTMLElement): void;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { TokenControl } from './token-registry';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Not every token appears here: the semantic font aliases (`font-family-heading` / `-body` / `-ui`
|
|
8
|
-
* / `-code`) are `var()` indirections with no direct control, so they have no entry.
|
|
3
|
+
* Every {@link TokenControl}: a token with a live adjuster, spreading its data from
|
|
4
|
+
* `TOKEN_REGISTRY`. Semantic font aliases (`font-family-heading`/`-body`/`-ui`/`-code`) are
|
|
5
|
+
* `var()` indirections with no direct control, so they have no entry here.
|
|
9
6
|
*/
|
|
10
7
|
export declare const TOKEN_CONTROLS: readonly TokenControl[];
|
package/dist/tokens/types.d.ts
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { ColorScheme } from '../types/theme';
|
|
2
|
-
/**
|
|
3
|
-
* A **token** is a CSS custom property under `--imf-ui-` carrying a design value; every token lives
|
|
4
|
-
* in `TOKEN_REGISTRY`. A **TokenControl** is a live adjuster *bound to* a token, not a kind of token —
|
|
5
|
-
* it carries the token's own fields plus the control's `id`. Not every token has a control.
|
|
6
|
-
*
|
|
7
|
-
* The shapes below are generic over the id type to avoid an import cycle with the registry that
|
|
8
|
-
* defines the concrete `TokenId` union. Import `Token` / `TokenControl` from `./token-registry` (bound
|
|
9
|
-
* to the concrete id), not from here directly.
|
|
10
|
-
*/
|
|
2
|
+
/** Import `Token` / `TokenControl` from `./token-registry`, not from here directly. */
|
|
11
3
|
/** A continuous or per-scheme numeric value (slider tokens) or a fixed string (select tokens). */
|
|
12
4
|
export type TokenValue = number | string | Record<ColorScheme, number>;
|
|
13
5
|
/** A numeric value that may be resolved per color scheme (min / max / default on slider controls). */
|
|
@@ -15,14 +7,9 @@ export type NumericTokenValue = number | Record<ColorScheme, number>;
|
|
|
15
7
|
/** Grouping for panel layout. */
|
|
16
8
|
export type TokenGroup = "brand" | "surface" | "primary" | "status" | "accent" | "shadow" | "shape" | "font";
|
|
17
9
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* -
|
|
21
|
-
* `Record<TokenId, Token>`, so every key and every `id` is checked against it);
|
|
22
|
-
* - every `id` / `derivedFrom` on a control is checked against it.
|
|
23
|
-
*
|
|
24
|
-
* Adding or renaming a token is a deliberate two-step edit: this union **and** `TOKEN_REGISTRY`. The
|
|
25
|
-
* `token-registry.test.ts` "union ↔ registry agree" test fails loudly if the two drift.
|
|
10
|
+
* Hand-authored, not derived from the registry. This is the source of truth for valid `--imf-ui-*` token ids.
|
|
11
|
+
* Adding or renaming a token requires updating this union and `TOKEN_REGISTRY` together;
|
|
12
|
+
* `token-registry.test.ts` fails if the two drift.
|
|
26
13
|
*/
|
|
27
14
|
export type TokenId = "color-brand-luma" | "color-brand-chroma" | "color-brand-hue" | "color-surface-bg-luma" | "color-surface-fg-luma" | "color-surface-chroma" | "color-surface-main-hue" | "color-surface-support-hue" | "color-surface-minor-hue" | "color-primary-bg-luma" | "color-primary-fg-luma" | "color-primary-chroma" | "color-primary-hue" | "color-status-bg-luma" | "color-status-fg-luma" | "color-status-chroma" | "color-status-positive-hue" | "color-status-negative-hue" | "color-status-warning-hue" | "color-status-info-hue" | "color-accent-1-bg-luma" | "color-accent-1-fg-luma" | "color-accent-1-chroma" | "color-accent-1-hue" | "color-accent-2-bg-luma" | "color-accent-2-fg-luma" | "color-accent-2-chroma" | "color-accent-2-hue" | "color-accent-3-bg-luma" | "color-accent-3-fg-luma" | "color-accent-3-chroma" | "color-accent-3-hue" | "shadow-angle" | "shadow-hardness" | "shadow-spread" | "shadow-intensity" | "corner-radius" | "font-family-sans" | "font-family-mono" | "font-family-heading" | "font-family-body" | "font-family-ui" | "font-family-code";
|
|
28
15
|
/**
|
|
@@ -43,13 +30,9 @@ export interface Token {
|
|
|
43
30
|
description: string;
|
|
44
31
|
}
|
|
45
32
|
/**
|
|
46
|
-
* A live adjuster bound to a token
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* - `select` — a discrete choice from an enumerated option list (e.g. font stacks).
|
|
50
|
-
*
|
|
51
|
-
* The finer constraint — slider ↔ numeric token, select ↔ string token — is a runtime/test guard, not
|
|
52
|
-
* encoded here (encoding it would add cryptic type machinery for little gain).
|
|
33
|
+
* A live adjuster bound to a token, carrying the token's own fields plus kind-specific control metadata.
|
|
34
|
+
* The finer constraint (slider ↔ numeric token, select ↔ string token) is enforced by a
|
|
35
|
+
* runtime/test guard, not encoded in the type; that would add cryptic generics for little gain.
|
|
53
36
|
*/
|
|
54
37
|
export type TokenControl = Token & ({
|
|
55
38
|
kind: "slider";
|
|
@@ -14,18 +14,9 @@ export interface UseTokenControlsResult {
|
|
|
14
14
|
reset: () => void;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* `useTokenControls` owns *no* persistence — the host decides where `overrides` lives and how writes
|
|
22
|
-
* are debounced, then passes the current map and a commit callback in on every render.
|
|
23
|
-
*
|
|
24
|
-
* **Contract — synchronous read-back:** each mutator builds its next map by spreading the current
|
|
25
|
-
* `overrides`. If the host debounces persistence, it must still surface each committed map as
|
|
26
|
-
* `overrides` *synchronously* (e.g. a `useState` working copy) so back-to-back `setControl` calls in
|
|
27
|
-
* one tick don't clobber each other. A host that only reflects the committed map after an async
|
|
28
|
-
* round trip will drop rapid successive edits.
|
|
17
|
+
* Owns no persistence — the host supplies `overrides`/`onChange`. Contract: each mutator spreads the
|
|
18
|
+
* current `overrides`, so the host must surface each committed map back synchronously (e.g. a
|
|
19
|
+
* `useState` working copy) or back-to-back calls in one tick will clobber each other.
|
|
29
20
|
*/
|
|
30
21
|
export declare function useTokenControls({ overrides, onChange, scheme }: {
|
|
31
22
|
/** Current overrides, keyed by full CSS custom property name. Must update synchronously on commit. */
|