anvilui 0.4.0 → 0.4.1
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/AGENTS.md +3 -0
- package/dist/components/FloatingToolbar/FloatingToolbar.d.ts +1 -1
- package/dist/index.cjs +76 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +76 -9
- package/dist/index.js.map +1 -1
- package/docs/llms-index.md +1 -0
- package/docs/styling.md +40 -0
- package/docs/theming.md +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2246,7 +2246,7 @@ function FABMenu({
|
|
|
2246
2246
|
ref: mergeRefs(trigger, ref),
|
|
2247
2247
|
"aria-label": ariaLabel,
|
|
2248
2248
|
className: cx(
|
|
2249
|
-
"avl-fab avl-fab-size-normal avl-fab-menu-trigger",
|
|
2249
|
+
"avl-fab avl-fab-size-normal avl-fab-menu avl-fab-menu-trigger",
|
|
2250
2250
|
colorClass(color, fillType),
|
|
2251
2251
|
className
|
|
2252
2252
|
),
|
|
@@ -2568,7 +2568,10 @@ function MenuSubmenuTrigger({
|
|
|
2568
2568
|
BaseMenu2.SubmenuTrigger,
|
|
2569
2569
|
{
|
|
2570
2570
|
...props,
|
|
2571
|
-
className: withClass(
|
|
2571
|
+
className: withClass(
|
|
2572
|
+
"avl-menu-item avl-menu-submenu-trigger",
|
|
2573
|
+
className
|
|
2574
|
+
),
|
|
2572
2575
|
children: [
|
|
2573
2576
|
startIcon && /* @__PURE__ */ jsx27(Icon, { name: startIcon }),
|
|
2574
2577
|
/* @__PURE__ */ jsx27("span", { className: "avl-menu-item-label", children }),
|
|
@@ -2879,7 +2882,7 @@ function PreviewCardPopup({
|
|
|
2879
2882
|
{
|
|
2880
2883
|
...props,
|
|
2881
2884
|
className: withClass(
|
|
2882
|
-
"avl-menu-popup avl-popover-popup",
|
|
2885
|
+
"avl-menu-popup avl-popover-popup avl-preview-card-popup",
|
|
2883
2886
|
className
|
|
2884
2887
|
)
|
|
2885
2888
|
}
|
|
@@ -3979,7 +3982,10 @@ function ComboboxItem({
|
|
|
3979
3982
|
BaseCombobox.Item,
|
|
3980
3983
|
{
|
|
3981
3984
|
...props,
|
|
3982
|
-
className: withClass(
|
|
3985
|
+
className: withClass(
|
|
3986
|
+
"avl-menu-item avl-select-item avl-combobox-item",
|
|
3987
|
+
className
|
|
3988
|
+
),
|
|
3983
3989
|
children: [
|
|
3984
3990
|
/* @__PURE__ */ jsx39("span", { className: "avl-menu-item-label", children }),
|
|
3985
3991
|
/* @__PURE__ */ jsx39(BaseCombobox.ItemIndicator, { className: "avl-select-item-indicator", children: /* @__PURE__ */ jsx39(Icon, { name: "check" }) })
|
|
@@ -4203,7 +4209,7 @@ function SearchItem({
|
|
|
4203
4209
|
BaseAutocomplete.Item,
|
|
4204
4210
|
{
|
|
4205
4211
|
...props,
|
|
4206
|
-
className: withClass("avl-menu-item", className),
|
|
4212
|
+
className: withClass("avl-menu-item avl-search-item", className),
|
|
4207
4213
|
children: [
|
|
4208
4214
|
startIcon && /* @__PURE__ */ jsx42(Icon, { name: startIcon }),
|
|
4209
4215
|
/* @__PURE__ */ jsx42("span", { className: "avl-menu-item-label", children })
|
|
@@ -4662,13 +4668,25 @@ function FloatingToolbarButton({
|
|
|
4662
4668
|
// Filled means highlighted: primary stands out on the toolbar's surface
|
|
4663
4669
|
color = fillType === "filled" ? "primary" : "container",
|
|
4664
4670
|
disabled,
|
|
4671
|
+
className,
|
|
4665
4672
|
...props
|
|
4666
4673
|
}) {
|
|
4667
4674
|
return /* @__PURE__ */ jsx51(
|
|
4668
4675
|
BaseToolbar.Button,
|
|
4669
4676
|
{
|
|
4670
4677
|
disabled,
|
|
4671
|
-
render: /* @__PURE__ */ jsx51(
|
|
4678
|
+
render: /* @__PURE__ */ jsx51(
|
|
4679
|
+
IconButton,
|
|
4680
|
+
{
|
|
4681
|
+
...props,
|
|
4682
|
+
color,
|
|
4683
|
+
fillType,
|
|
4684
|
+
className: withClass(
|
|
4685
|
+
"avl-floating-toolbar-button",
|
|
4686
|
+
className
|
|
4687
|
+
)
|
|
4688
|
+
}
|
|
4689
|
+
)
|
|
4672
4690
|
}
|
|
4673
4691
|
);
|
|
4674
4692
|
}
|
|
@@ -5206,23 +5224,72 @@ var neutralRoles = [
|
|
|
5206
5224
|
"inverseSurface",
|
|
5207
5225
|
"inverseOnSurface"
|
|
5208
5226
|
];
|
|
5227
|
+
var statusSwaps = [
|
|
5228
|
+
{
|
|
5229
|
+
roles: [
|
|
5230
|
+
"success",
|
|
5231
|
+
"onSuccess",
|
|
5232
|
+
"successContainer",
|
|
5233
|
+
"onSuccessContainer"
|
|
5234
|
+
],
|
|
5235
|
+
from: 105,
|
|
5236
|
+
to: 190,
|
|
5237
|
+
hue: 255
|
|
5238
|
+
},
|
|
5239
|
+
{
|
|
5240
|
+
roles: ["error", "onError", "errorContainer", "onErrorContainer"],
|
|
5241
|
+
from: 10,
|
|
5242
|
+
to: 60,
|
|
5243
|
+
hue: 350
|
|
5244
|
+
},
|
|
5245
|
+
// Only yellow/gold: past orange there's no hue left that still reads as
|
|
5246
|
+
// a warning without looking like the error color
|
|
5247
|
+
{
|
|
5248
|
+
roles: [
|
|
5249
|
+
"warning",
|
|
5250
|
+
"onWarning",
|
|
5251
|
+
"warningContainer",
|
|
5252
|
+
"onWarningContainer"
|
|
5253
|
+
],
|
|
5254
|
+
from: 75,
|
|
5255
|
+
to: 105,
|
|
5256
|
+
hue: 55
|
|
5257
|
+
}
|
|
5258
|
+
];
|
|
5209
5259
|
var reference = toOklch(parseHex(baseLightTheme.primary));
|
|
5210
5260
|
function generate(base, primary, secondary) {
|
|
5211
5261
|
const theme = { ...base };
|
|
5262
|
+
const roleOf = (key) => toOklch(parseHex(base[key]));
|
|
5263
|
+
const write = (key, l, c, h) => {
|
|
5264
|
+
;
|
|
5265
|
+
theme[key] = toHex(l, c, h);
|
|
5266
|
+
};
|
|
5212
5267
|
const set = (keys, seed, neutral) => {
|
|
5213
5268
|
const scale = seed.c / reference.c;
|
|
5214
5269
|
for (const key of keys) {
|
|
5215
|
-
const role =
|
|
5270
|
+
const role = roleOf(key);
|
|
5216
5271
|
const c = role.c * (neutral ? Math.min(scale, 1) : scale);
|
|
5217
|
-
|
|
5218
|
-
theme[key] = toHex(role.l, c, h);
|
|
5272
|
+
write(key, role.l, c, seed.h + role.h - reference.h);
|
|
5219
5273
|
}
|
|
5220
5274
|
};
|
|
5221
5275
|
set(primaryRoles, primary, false);
|
|
5222
5276
|
set(tonalRoles, secondary, false);
|
|
5223
5277
|
set(neutralRoles, primary, true);
|
|
5278
|
+
if (primary.c >= 0.04) {
|
|
5279
|
+
for (const swap of statusSwaps) {
|
|
5280
|
+
if (!hueInRange(primary.h, swap.from, swap.to)) continue;
|
|
5281
|
+
const shift = swap.hue - roleOf(swap.roles[0]).h;
|
|
5282
|
+
for (const key of swap.roles) {
|
|
5283
|
+
const role = roleOf(key);
|
|
5284
|
+
write(key, role.l, role.c, role.h + shift);
|
|
5285
|
+
}
|
|
5286
|
+
}
|
|
5287
|
+
}
|
|
5224
5288
|
return theme;
|
|
5225
5289
|
}
|
|
5290
|
+
function hueInRange(h, from, to) {
|
|
5291
|
+
return from <= to ? h >= from && h <= to : h >= from || h <= to;
|
|
5292
|
+
}
|
|
5226
5293
|
function mainColors(pixels) {
|
|
5227
5294
|
const bins = Array.from({ length: 36 }, () => ({ w: 0, l: 0, a: 0, b: 0 }));
|
|
5228
5295
|
const grey = { w: 0, l: 0, a: 0, b: 0 };
|