agentcss 0.25.0 → 0.25.2
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/02-primitives/button/README.md +7 -0
- package/02-primitives/button/demo.html +52 -0
- package/02-primitives/card/README.md +6 -1
- package/02-primitives/card/demo.html +13 -0
- package/02-primitives/choice/choice.css +10 -0
- package/02-primitives/choice/demo.html +38 -0
- package/02-primitives/date-range/README.md +1 -1
- package/02-primitives/date-range/demo.html +41 -1
- package/02-primitives/input/README.md +3 -2
- package/02-primitives/input/demo.html +42 -0
- package/03-patterns/accordion/demo.html +113 -0
- package/03-patterns/content/demo.html +17 -0
- package/03-patterns/drawer/README.md +11 -1
- package/03-patterns/drawer/drawer.css +22 -6
- package/03-patterns/drawer/drawer.js +16 -1
- package/03-patterns/dropdown/README.md +10 -8
- package/03-patterns/dropdown/demo.html +5 -0
- package/03-patterns/dropdown/dropdown.js +8 -0
- package/03-patterns/form-validation/demo.html +20 -0
- package/03-patterns/list/demo.html +10 -0
- package/03-patterns/overlay/overlay.js +14 -1
- package/03-patterns/pagination/demo.html +23 -0
- package/03-patterns/states/demo.html +39 -1
- package/03-patterns/tabs/demo.html +34 -0
- package/03-patterns/tooltip/tooltip.js +8 -4
- package/04-recipes/app-shell/demo.html +27 -0
- package/04-recipes/table/demo.html +34 -0
- package/09-assets/bar/bar.js +8 -4
- package/09-assets/bar/demo.html +27 -0
- package/CHANGELOG.md +127 -0
- package/CONTRIBUTING.md +1 -1
- package/START-HERE.md +6 -6
- package/ai/components.json +6 -3
- package/ai/pdf-pages.js +31 -3
- package/dist/02-primitives/choice/choice.css +1 -1
- package/dist/03-patterns/drawer/drawer.css +1 -1
- package/dist/03-patterns/drawer/drawer.js +10 -1
- package/dist/03-patterns/dropdown/dropdown.js +4 -0
- package/dist/03-patterns/overlay/overlay.js +7 -1
- package/dist/03-patterns/tooltip/tooltip.js +3 -3
- package/dist/09-assets/bar/bar.js +4 -3
- package/dist/COSTS.md +7 -7
- package/docs/ACCESSIBILITY.md +2 -2
- package/index.html +1 -1
- package/llms-full.txt +3 -3
- package/package.json +1 -1
package/ai/components.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
3
|
"generatedBy": "05-audit/gen-ai-contract.py",
|
|
4
|
-
"libraryVersion": "0.25.
|
|
4
|
+
"libraryVersion": "0.25.2",
|
|
5
5
|
"$comment": "机器可读的组件契约。slots = BEM 元素名(在本库里元素名就是插槽名),states.enum = 组件会在 DOM 上写出的 data-* 取值,states.legacyClass = 仍未收敛到 data 属性的历史状态类(INVARIANT I-8 未达标)。printPolicy = 这个组件在纸上会发生什么(空数组 = 原样保留);pagination = 内容是否被分页裁过(server 不许与 expand 同时出现,否则展开的只是当前一页)。",
|
|
6
6
|
"maturityCriteria": {
|
|
7
7
|
"alpha": "缺 demo.html 或缺 05-audit 下的专属门禁 ⇒ 还没被机器验证过,不要用",
|
|
@@ -645,7 +645,8 @@
|
|
|
645
645
|
"list"
|
|
646
646
|
],
|
|
647
647
|
"attrs": [
|
|
648
|
-
"hidden"
|
|
648
|
+
"hidden",
|
|
649
|
+
"live"
|
|
649
650
|
]
|
|
650
651
|
},
|
|
651
652
|
"usesOtherNamespaces": [],
|
|
@@ -1272,7 +1273,9 @@
|
|
|
1272
1273
|
"roles": [],
|
|
1273
1274
|
"attrs": [
|
|
1274
1275
|
"busy",
|
|
1275
|
-
"disabled"
|
|
1276
|
+
"disabled",
|
|
1277
|
+
"hidden",
|
|
1278
|
+
"label"
|
|
1276
1279
|
]
|
|
1277
1280
|
},
|
|
1278
1281
|
"usesOtherNamespaces": [],
|
package/ai/pdf-pages.js
CHANGED
|
@@ -34,10 +34,38 @@ function countPageObjects(raw) {
|
|
|
34
34
|
return (raw.match(/\/Type\s*\/Page[^s]/g) || []).length;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* 页树**根节点**声明的 `/Count`(拿不到则 null)。
|
|
39
|
+
*
|
|
40
|
+
* 🔴 不能取"文件里第一个 `/Count`" —— 那是**叶节点**的数。
|
|
41
|
+
* 实测一份 50 页的 Chromium 产物:文件里 8 个 `/Count`,依次是
|
|
42
|
+
* `8,8,8,8,8,8,2,50` —— 只有最后一个(根节点)是 50。
|
|
43
|
+
* 按"第一个"取会读成 8,于是 `pages=50` 与 `countFromTree=8` 打架,
|
|
44
|
+
* 导出器据此报"两套说法不一致,无法判定预算" —— **用户拿着一份 50 页的
|
|
45
|
+
* 正常文档,被一个读法错误挡在门外**。
|
|
46
|
+
*
|
|
47
|
+
* 正确路径:catalog `/Type /Catalog` → 它的 `/Pages N 0 R` → 对象 N 的 `/Count`。
|
|
48
|
+
* 对象内的键序不保证,所以两侧各开一个窗口找;找不到就返回 null
|
|
49
|
+
* (null 表示"没有交叉核对",`agree` 为真 —— 宁可少一道核对,
|
|
50
|
+
* 也不能拿一个错数字去否决用户的文件)。
|
|
51
|
+
*/
|
|
38
52
|
function countFromTree(raw) {
|
|
39
|
-
const
|
|
40
|
-
|
|
53
|
+
const s = Buffer.isBuffer(raw) ? raw.toString('latin1') : String(raw);
|
|
54
|
+
const cat = s.search(/\/Type\s*\/Catalog/);
|
|
55
|
+
if (cat < 0) return null;
|
|
56
|
+
|
|
57
|
+
/* 键序不固定:在 catalog 前后各取一段找 /Pages 引用 */
|
|
58
|
+
const win = s.slice(Math.max(0, cat - 2000), cat + 2000);
|
|
59
|
+
const ref = /\/Pages\s+(\d+)\s+0\s+R/.exec(win);
|
|
60
|
+
if (!ref) return null;
|
|
61
|
+
|
|
62
|
+
/* 找 `N 0 obj` 本身,再在它后面找 /Count。
|
|
63
|
+
⚠️ 不用 `[\s\S]*?endobj` 截取:流数据里可能**恰好**出现 endobj 的字节。 */
|
|
64
|
+
const at = s.search(new RegExp('(^|[^0-9])' + ref[1] + '\\s+0\\s+obj'));
|
|
65
|
+
if (at < 0) return null;
|
|
66
|
+
const body = s.slice(at, at + 2000);
|
|
67
|
+
const c = /\/Count\s+(\d+)/.exec(body);
|
|
68
|
+
return c ? +c[1] : null;
|
|
41
69
|
}
|
|
42
70
|
|
|
43
71
|
/** 第一张纸的 `/MediaBox [x0 y0 x1 y1]` → `{width, height}`(pt,1/72 英寸)。 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.choice {position:relative;display:flex;align-items:center;min-height:44px;cursor:pointer;user-select:none;}.choice__label {display:flex;align-items:center;gap:var(--sp-2);cursor:pointer;min-height:44px;flex:1;min-width:0;}.choice--radio .choice__label {border-radius:var(--r-sm);}.choice__input {position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;z-index:1;}.choice__mark {position:relative;flex:none;display:grid;place-items:center;width:20px;height:20px;background:var(--surface);border:1px solid var(--border-control);transition:background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);}@media (hover:hover) and (pointer:fine) {.choice:hover .choice__mark {border-color:var(--text-tertiary);}}.choice__input:focus-visible ~ .choice__label .choice__mark {outline:2px solid var(--accent);outline-offset:2px;}.choice__mark::after {content:"";position:absolute;width:5px;height:9px;border:solid var(--text-on-accent);border-width:0 2px 2px 0;transform:rotate(45deg) scale(0);transform-origin:center;transition:transform var(--dur-fast) var(--ease-out);}.choice__input:checked ~ .choice__label .choice__mark {background:var(--accent);border-color:var(--accent);}.choice__input:checked ~ .choice__label .choice__mark::after {transform:rotate(45deg) scale(1);}.choice__input:disabled {cursor:not-allowed;}.choice__input:disabled ~ .choice__label .choice__mark, .choice__input:disabled ~ .choice__label {background:var(--surface-sunken);border-color:var(--border-decor);}.choice__input:disabled ~ .choice__label {color:var(--text-tertiary);cursor:not-allowed;}.choice__label {font-size:var(--fs-sm);line-height:var(--lh-base);color:var(--text-primary);}.choice__hint {font-size:var(--fs-xs);color:var(--text-tertiary);line-height:1.5;}.choice--checkbox .choice__mark {border-radius:5px;}.choice--checkbox .choice__input:indeterminate ~ .choice__label .choice__mark {background:var(--surface);border-color:var(--accent);}.choice--checkbox .choice__input:indeterminate ~ .choice__label .choice__mark::after {width:10px;height:2px;border:none;background:var(--accent);border-radius:1px;transform:none;}.choice--radio .choice__mark {border-radius:var(--r-pill);}.choice--radio .choice__mark::after {width:8px;height:8px;border:none;background:var(--text-on-accent);border-radius:var(--r-pill);transform:scale(0);}.choice--radio .choice__input:checked ~ .choice__label .choice__mark {background:var(--accent);border-color:var(--accent);}.choice--radio .choice__input:checked ~ .choice__label .choice__mark::after {transform:scale(1);}.choice__group {border:none;margin:0;padding:0;min-width:0;}.choice__legend {padding:0;margin-bottom:var(--sp-2);font-size:var(--fs-sm);font-weight:500;color:var(--text-primary);}.choice__options {display:flex;flex-direction:column;gap:var(--sp-1);}.select {position:relative;display:inline-flex;align-items:center;width:100%;}.select__control {width:100%;height:44px;padding:0 40px 0 var(--sp-3);font-family:inherit;font-size:16px;line-height:1.5;color:var(--text-primary);background:var(--surface);border:1px solid var(--border-control);border-radius:var(--r-sm);appearance:none;-webkit-appearance:none;-moz-appearance:none;cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);}.select__control::-ms-expand {display:none;}.select__control::-webkit-calendar-picker-indicator {opacity:0;}@media (hover:hover) and (pointer:fine) {.select__control:hover:not(:disabled) {border-color:var(--text-tertiary);}}.select__control:focus {outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft);}.select__control:disabled {background:var(--surface-sunken);color:var(--text-tertiary);border-color:var(--border-decor);cursor:not-allowed;}.select__arrow {position:absolute;inset-inline-end:var(--sp-3);pointer-events:none;color:var(--text-tertiary);display:grid;place-items:center;}.select__control--auto {height:auto;min-height:44px;padding-block:var(--sp-2);}@media (prefers-reduced-motion:reduce) {.choice__mark::after {transition:none;}}@media (forced-colors:active) {.choice--radio .choice__mark::after {background:CanvasText;}.choice--checkbox .choice__input:indeterminate ~ .choice__label .choice__mark::after {background:CanvasText;}}
|
|
1
|
+
.choice {position:relative;display:flex;align-items:center;min-height:44px;cursor:pointer;user-select:none;flex-wrap:wrap;}.choice__label {display:flex;align-items:center;gap:var(--sp-2);cursor:pointer;min-height:44px;flex:1;min-width:0;}.choice--radio .choice__label {border-radius:var(--r-sm);}.choice__input {position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;z-index:1;}.choice__mark {position:relative;flex:none;display:grid;place-items:center;width:20px;height:20px;background:var(--surface);border:1px solid var(--border-control);transition:background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);}@media (hover:hover) and (pointer:fine) {.choice:hover .choice__mark {border-color:var(--text-tertiary);}}.choice__input:focus-visible ~ .choice__label .choice__mark {outline:2px solid var(--accent);outline-offset:2px;}.choice__mark::after {content:"";position:absolute;width:5px;height:9px;border:solid var(--text-on-accent);border-width:0 2px 2px 0;transform:rotate(45deg) scale(0);transform-origin:center;transition:transform var(--dur-fast) var(--ease-out);}.choice__input:checked ~ .choice__label .choice__mark {background:var(--accent);border-color:var(--accent);}.choice__input:checked ~ .choice__label .choice__mark::after {transform:rotate(45deg) scale(1);}.choice__input:disabled {cursor:not-allowed;}.choice__input:disabled ~ .choice__label .choice__mark, .choice__input:disabled ~ .choice__label {background:var(--surface-sunken);border-color:var(--border-decor);}.choice__input:disabled ~ .choice__label {color:var(--text-tertiary);cursor:not-allowed;}.choice__label {font-size:var(--fs-sm);line-height:var(--lh-base);color:var(--text-primary);}.choice__hint {font-size:var(--fs-xs);color:var(--text-tertiary);line-height:1.5;flex:1 0 100%;margin-inline-start:calc(20px + var(--sp-2));}.choice--checkbox .choice__mark {border-radius:5px;}.choice--checkbox .choice__input:indeterminate ~ .choice__label .choice__mark {background:var(--surface);border-color:var(--accent);}.choice--checkbox .choice__input:indeterminate ~ .choice__label .choice__mark::after {width:10px;height:2px;border:none;background:var(--accent);border-radius:1px;transform:none;}.choice--radio .choice__mark {border-radius:var(--r-pill);}.choice--radio .choice__mark::after {width:8px;height:8px;border:none;background:var(--text-on-accent);border-radius:var(--r-pill);transform:scale(0);}.choice--radio .choice__input:checked ~ .choice__label .choice__mark {background:var(--accent);border-color:var(--accent);}.choice--radio .choice__input:checked ~ .choice__label .choice__mark::after {transform:scale(1);}.choice__group {border:none;margin:0;padding:0;min-width:0;}.choice__legend {padding:0;margin-bottom:var(--sp-2);font-size:var(--fs-sm);font-weight:500;color:var(--text-primary);}.choice__options {display:flex;flex-direction:column;gap:var(--sp-1);}.select {position:relative;display:inline-flex;align-items:center;width:100%;}.select__control {width:100%;height:44px;padding:0 40px 0 var(--sp-3);font-family:inherit;font-size:16px;line-height:1.5;color:var(--text-primary);background:var(--surface);border:1px solid var(--border-control);border-radius:var(--r-sm);appearance:none;-webkit-appearance:none;-moz-appearance:none;cursor:pointer;transition:border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);}.select__control::-ms-expand {display:none;}.select__control::-webkit-calendar-picker-indicator {opacity:0;}@media (hover:hover) and (pointer:fine) {.select__control:hover:not(:disabled) {border-color:var(--text-tertiary);}}.select__control:focus {outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft);}.select__control:disabled {background:var(--surface-sunken);color:var(--text-tertiary);border-color:var(--border-decor);cursor:not-allowed;}.select__arrow {position:absolute;inset-inline-end:var(--sp-3);pointer-events:none;color:var(--text-tertiary);display:grid;place-items:center;}.select__control--auto {height:auto;min-height:44px;padding-block:var(--sp-2);}@media (prefers-reduced-motion:reduce) {.choice__mark::after {transition:none;}}@media (forced-colors:active) {.choice--radio .choice__mark::after {background:CanvasText;}.choice--checkbox .choice__input:indeterminate ~ .choice__label .choice__mark::after {background:CanvasText;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.drawer-backdrop {position:fixed;inset:0;z-index:var(--z-modal);background:var(--scrim);display:flex;justify-content:flex-end;}.drawer-backdrop[hidden] {display:none;}.drawer {width:min(420px, 92vw);height:100%;display:flex;flex-direction:column;background:var(--surface);border-inline-start:1px solid var(--border-decor);box-shadow:var(--shadow-2);overflow:hidden;}.drawer--left {border-inline-start:0;border-inline-end:1px solid var(--border-decor);}.drawer--top {width:100%;height:min(60vh, 420px);border-inline-start:0;border-bottom:1px solid var(--border-decor);}.drawer--bottom {width:100%;height:min(60vh, 420px);border-inline-start:0;border-top:1px solid var(--border-decor);}.drawer__head {display:flex;align-items:center;gap:var(--sp-3);padding:var(--sp-4);border-bottom:1px solid var(--border-decor);flex:0 0 auto;}.drawer__title {flex:1 1 auto;margin:0;font-size:var(--fs-lg);font-weight:600;}.drawer__close {flex:0 0 auto;width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:none;border:0;border-radius:var(--r-sm);color:var(--text-secondary);font-size:20px;line-height:1;cursor:pointer;}.drawer__close:focus-visible {outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);}@media (hover:hover) and (pointer:fine) {.drawer__close:hover {background:var(--surface-sunken);}}.drawer__body {flex:1 1 auto;padding:var(--sp-4);overflow-y:auto;-webkit-overflow-scrolling:touch;}.drawer__foot {flex:0 0 auto;display:flex;gap:var(--sp-2);justify-content:flex-end;padding:var(--sp-4);border-top:1px solid var(--border-decor);}@media (prefers-reduced-motion:no-preference) {.drawer--right {animation:drawer-in-right 220ms var(--ease-drawer, ease);}.drawer--left {animation:drawer-in-left 220ms var(--ease-drawer, ease);}.drawer--top {animation:drawer-in-top 220ms var(--ease-drawer, ease);}.drawer--bottom {animation:drawer-in-bottom 220ms var(--ease-drawer, ease);}@keyframes drawer-in-right {from {transform:translateX(16px);opacity:.6;}}@keyframes drawer-in-left {from {transform:translateX(-16px);opacity:.6;}}@keyframes drawer-in-top {from {transform:translateY(-16px);opacity:.6;}}@keyframes drawer-in-bottom {from {transform:translateY(16px);opacity:.6;}}}.drawer[data-state="leaving"] {opacity:0;transition:opacity 160ms var(--ease-out, ease);}
|
|
1
|
+
.drawer-backdrop {position:fixed;inset:0;z-index:var(--z-modal);background:var(--scrim);display:flex;justify-content:flex-end;}.drawer-backdrop[hidden] {display:none;}.drawer {width:min(420px, 92vw);height:100%;display:flex;flex-direction:column;background:var(--surface);border-inline-start:1px solid var(--border-decor);box-shadow:var(--shadow-2);overflow:hidden;}.drawer--left {margin-inline-end:auto;border-inline-start:0;border-inline-end:1px solid var(--border-decor);}.drawer--top {align-self:flex-start;width:100%;height:min(60vh, 420px);border-inline-start:0;border-bottom:1px solid var(--border-decor);}.drawer--bottom {align-self:flex-end;width:100%;height:min(60vh, 420px);border-inline-start:0;border-top:1px solid var(--border-decor);}.drawer__head {display:flex;align-items:center;gap:var(--sp-3);padding:var(--sp-4);border-bottom:1px solid var(--border-decor);flex:0 0 auto;}.drawer__title {flex:1 1 auto;margin:0;font-size:var(--fs-lg);font-weight:600;}.drawer__close {flex:0 0 auto;width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:none;border:0;border-radius:var(--r-sm);color:var(--text-secondary);font-size:20px;line-height:1;cursor:pointer;}.drawer__close:focus-visible {outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);}@media (hover:hover) and (pointer:fine) {.drawer__close:hover {background:var(--surface-sunken);}}.drawer__body {flex:1 1 auto;padding:var(--sp-4);overflow-y:auto;-webkit-overflow-scrolling:touch;}.drawer__foot {flex:0 0 auto;display:flex;gap:var(--sp-2);justify-content:flex-end;padding:var(--sp-4);border-top:1px solid var(--border-decor);}@media (prefers-reduced-motion:no-preference) {.drawer--right {animation:drawer-in-right 220ms var(--ease-drawer, ease);}.drawer--left {animation:drawer-in-left 220ms var(--ease-drawer, ease);}.drawer--top {animation:drawer-in-top 220ms var(--ease-drawer, ease);}.drawer--bottom {animation:drawer-in-bottom 220ms var(--ease-drawer, ease);}@keyframes drawer-in-right {from {transform:translateX(16px);opacity:.6;}}@keyframes drawer-in-left {from {transform:translateX(-16px);opacity:.6;}}@keyframes drawer-in-top {from {transform:translateY(-16px);opacity:.6;}}@keyframes drawer-in-bottom {from {transform:translateY(16px);opacity:.6;}}}.drawer[data-state="leaving"] {opacity:0;transition:opacity 160ms var(--ease-out, ease);}
|
|
@@ -164,9 +164,18 @@ inerts = [];
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
+
var PLACE_CLASS = {
|
|
168
|
+
right: 'drawer--right', end: 'drawer--right',
|
|
169
|
+
left: 'drawer--left', start: 'drawer--left',
|
|
170
|
+
top: 'drawer--top',
|
|
171
|
+
bottom: 'drawer--bottom'
|
|
172
|
+
};
|
|
173
|
+
|
|
167
174
|
function open(opt) {
|
|
168
175
|
opt = opt || {};
|
|
169
176
|
var place = opt.place || 'right';
|
|
177
|
+
var placeCls = PLACE_CLASS[place];
|
|
178
|
+
if (!placeCls) placeCls = PLACE_CLASS.right;
|
|
170
179
|
|
|
171
180
|
var fr = flFocusReturn({});
|
|
172
181
|
fr.save();
|
|
@@ -177,7 +186,7 @@ host.setAttribute('data-drawer-host', '');
|
|
|
177
186
|
if (opt.label) host.setAttribute('aria-label', opt.label);
|
|
178
187
|
|
|
179
188
|
var d = document.createElement('aside');
|
|
180
|
-
d.className = 'drawer
|
|
189
|
+
d.className = 'drawer ' + placeCls;
|
|
181
190
|
d.setAttribute('role', 'dialog');
|
|
182
191
|
d.setAttribute('aria-modal', 'true');
|
|
183
192
|
if (!d.id) d.id = 'drawer-' + (new Date()).getTime();
|
|
@@ -314,6 +314,10 @@ String(li.className).indexOf('dd__item') < 0) {
|
|
|
314
314
|
li.className = li.className ? (li.className + ' dd__item') : 'dd__item';
|
|
315
315
|
}
|
|
316
316
|
if (li.hasAttribute('data-dd-sep')) {
|
|
317
|
+
|
|
318
|
+
if (String(li.className).indexOf('dd__sep') < 0) {
|
|
319
|
+
li.className = li.className ? (li.className + ' dd__sep') : 'dd__sep';
|
|
320
|
+
}
|
|
317
321
|
li.setAttribute('role', 'separator');
|
|
318
322
|
li.setAttribute('aria-hidden', 'true');
|
|
319
323
|
} else if (!li.hasAttribute('role')) {
|
|
@@ -150,6 +150,12 @@ document.removeEventListener('click', onPointer, true);
|
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
var TOAST_VARIANT = {
|
|
154
|
+
success: 'toast--success',
|
|
155
|
+
error: 'toast--error',
|
|
156
|
+
warning: 'toast--warning'
|
|
157
|
+
};
|
|
158
|
+
|
|
153
159
|
function toast(opts) {
|
|
154
160
|
opts = opts || {};
|
|
155
161
|
|
|
@@ -164,7 +170,7 @@ document.body.appendChild(region);
|
|
|
164
170
|
}
|
|
165
171
|
|
|
166
172
|
var el = document.createElement('div');
|
|
167
|
-
el.className = 'toast' + (opts.variant ? '
|
|
173
|
+
el.className = 'toast' + (TOAST_VARIANT[opts.variant] ? ' ' + TOAST_VARIANT[opts.variant] : '');
|
|
168
174
|
|
|
169
175
|
var body = document.createElement('div');
|
|
170
176
|
body.className = 'toast__body';
|
|
@@ -124,8 +124,8 @@ return r;
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
var CLS = {
|
|
127
|
-
top: 'top', bottom: 'bottom',
|
|
128
|
-
start: 'inset-inline-start', end: 'inset-inline-end',
|
|
127
|
+
top: 'tooltip--top', bottom: 'tooltip--bottom',
|
|
128
|
+
start: 'tooltip--inset-inline-start', end: 'tooltip--inset-inline-end',
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
function resolve(el, place) {
|
|
@@ -147,7 +147,7 @@ var pos = resolve(el, place);
|
|
|
147
147
|
var id = 'tt' + (++uid);
|
|
148
148
|
var tip = document.createElement('div');
|
|
149
149
|
tip.id = id;
|
|
150
|
-
tip.className = 'tooltip
|
|
150
|
+
tip.className = 'tooltip ' + CLS[pos];
|
|
151
151
|
tip.setAttribute('role', 'tooltip');
|
|
152
152
|
tip.textContent = text;
|
|
153
153
|
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
var NS = 'http://www.w3.org/2000/svg';
|
|
5
5
|
var uid = 0;
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var SERIES_CLS = ['bar__s0', 'bar__s1', 'bar__s2', 'bar__s3', 'bar__s4'];
|
|
8
|
+
var SERIES_STYLES = SERIES_CLS.length;
|
|
8
9
|
|
|
9
10
|
function pickKeyPoints(values) {
|
|
10
11
|
var keys = {}, i, maxI = 0;
|
|
@@ -110,7 +111,7 @@ x = mode === 'group'
|
|
|
110
111
|
yy = padT + plotH - vt;
|
|
111
112
|
|
|
112
113
|
rect = el('rect', {
|
|
113
|
-
'class': 'bar__bar
|
|
114
|
+
'class': 'bar__bar ' + SERIES_CLS[s % SERIES_STYLES] +
|
|
114
115
|
(series[s].cls ? ' ' + series[s].cls : ''),
|
|
115
116
|
x: x, y: yy, width: barW, height: vt - vb,
|
|
116
117
|
});
|
|
@@ -181,7 +182,7 @@ series.forEach(function (se, si) {
|
|
|
181
182
|
var li = document.createElement('li');
|
|
182
183
|
li.className = 'bar__legend-item';
|
|
183
184
|
var sw = document.createElement('span');
|
|
184
|
-
sw.className = 'bar__legend-swatch
|
|
185
|
+
sw.className = 'bar__legend-swatch ' + SERIES_CLS[si % SERIES_STYLES] +
|
|
185
186
|
(se.cls ? ' ' + se.cls : '');
|
|
186
187
|
|
|
187
188
|
li.appendChild(sw);
|
package/dist/COSTS.md
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
| primitive | `badge` | 2.9 KB | 0.5 KB | — | **3.4 KB** | 24.6 KB | −21.2 KB |
|
|
22
22
|
| primitive | `button` | 2.9 KB | 1.0 KB | — | **3.9 KB** | 28.3 KB | −24.4 KB |
|
|
23
23
|
| primitive | `card` | 2.9 KB | 0.9 KB | — | **3.9 KB** | 26.0 KB | −22.1 KB |
|
|
24
|
-
| primitive | `choice` | 2.9 KB | 1.1 KB | — | **4.
|
|
24
|
+
| primitive | `choice` | 2.9 KB | 1.1 KB | — | **4.1 KB** | 28.1 KB | −24.0 KB |
|
|
25
25
|
| primitive | `combobox` | 2.9 KB | 1.0 KB | 5.4 KB | **9.3 KB** | 31.4 KB | −22.1 KB |
|
|
26
26
|
| primitive | `date-range` | 2.9 KB | 0.8 KB | 2.5 KB | **6.3 KB** | 28.4 KB | −22.1 KB |
|
|
27
27
|
| primitive | `delta` | 2.9 KB | 0.3 KB | — | **3.2 KB** | 24.6 KB | −21.4 KB |
|
|
@@ -37,23 +37,23 @@
|
|
|
37
37
|
| primitive | `upload` | 2.9 KB | 1.4 KB | 4.2 KB | **8.5 KB** | 39.3 KB | −30.8 KB |
|
|
38
38
|
| pattern | `accordion` | 2.9 KB | 1.3 KB | 1.8 KB | **6.0 KB** | 36.4 KB | −30.4 KB |
|
|
39
39
|
| pattern | `content` | 2.9 KB | 1.0 KB | — | **4.0 KB** | 26.5 KB | −22.5 KB |
|
|
40
|
-
| pattern | `drawer` | 2.9 KB | 0.8 KB | 2.
|
|
41
|
-
| pattern | `dropdown` | 2.9 KB | 0.8 KB | 3.
|
|
40
|
+
| pattern | `drawer` | 2.9 KB | 0.8 KB | 2.6 KB | **6.3 KB** | 30.1 KB | −23.8 KB |
|
|
41
|
+
| pattern | `dropdown` | 2.9 KB | 0.8 KB | 3.5 KB | **7.2 KB** | 31.5 KB | −24.4 KB |
|
|
42
42
|
| pattern | `form-validation` | 2.9 KB | 0.8 KB | — | **3.7 KB** | 26.8 KB | −23.1 KB |
|
|
43
43
|
| pattern | `list` | 2.9 KB | 0.6 KB | — | **3.5 KB** | 24.3 KB | −20.8 KB |
|
|
44
44
|
| pattern | `nav` | 2.9 KB | 1.2 KB | 2.6 KB | **6.8 KB** | 33.0 KB | −26.2 KB |
|
|
45
|
-
| pattern | `overlay` | 2.9 KB | 1.2 KB | 3.
|
|
45
|
+
| pattern | `overlay` | 2.9 KB | 1.2 KB | 3.6 KB | **7.7 KB** | 38.5 KB | −30.8 KB |
|
|
46
46
|
| pattern | `pagination` | 2.9 KB | 0.8 KB | 2.6 KB | **6.3 KB** | 32.4 KB | −26.1 KB |
|
|
47
47
|
| pattern | `reveal` | 2.9 KB | 0.3 KB | 1.2 KB | **4.4 KB** | 26.4 KB | −22.0 KB |
|
|
48
48
|
| pattern | `states` | 2.9 KB | 0.9 KB | — | **3.8 KB** | 26.3 KB | −22.5 KB |
|
|
49
49
|
| pattern | `tabs` | 2.9 KB | 0.7 KB | 2.0 KB | **5.6 KB** | 29.1 KB | −23.5 KB |
|
|
50
|
-
| pattern | `tooltip` | 2.9 KB | 0.5 KB | 1.9 KB | **5.3 KB** | 28.
|
|
50
|
+
| pattern | `tooltip` | 2.9 KB | 0.5 KB | 1.9 KB | **5.3 KB** | 28.5 KB | −23.2 KB |
|
|
51
51
|
| pattern | `tree` | 2.9 KB | 0.6 KB | 2.9 KB | **6.5 KB** | 30.1 KB | −23.6 KB |
|
|
52
52
|
|
|
53
53
|
## 三、全库
|
|
54
54
|
|
|
55
|
-
- 全部组件都用上(min,含 tokens 一份):**70.
|
|
56
|
-
- 源码版(带注释)全库 gzip:
|
|
55
|
+
- 全部组件都用上(min,含 tokens 一份):**70.4 KB**
|
|
56
|
+
- 源码版(带注释)全库 gzip:358.8 KB
|
|
57
57
|
|
|
58
58
|
> ⚠️ 源码版那个数字**不是**要付的钱:它包含我们的注释(全库 CSS 有 69% 是注释,字节口径)。
|
|
59
59
|
> 它的用途只有一个 —— 让人看清"dist 到底省了多少"。
|
package/docs/ACCESSIBILITY.md
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
| 项目 | 值 |
|
|
7
7
|
|---|---|
|
|
8
|
-
| 声明适用版本 | agentcss `0.25.
|
|
9
|
-
| 声明日期 | 2026-11-
|
|
8
|
+
| 声明适用版本 | agentcss `0.25.2` |
|
|
9
|
+
| 声明日期 | 2026-11-03 |
|
|
10
10
|
| 复核节奏 | 每次发版前重跑(`npm run gate` 内含全部证据) |
|
|
11
11
|
| 范围 | 本库交付的 CSS / JS、全部 `demo.html`(组件页 + 图表页 + 组合页)、以及文档站生成的页面 |
|
|
12
12
|
| 不在范围 | 使用者拿这些组件拼出来的业务页面(那是你的无障碍责任,不是库的) |
|
package/index.html
CHANGED
package/llms-full.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# agentcss — full reference (one file)
|
|
2
2
|
|
|
3
|
-
> Generated from `ai/components.json` + `ai/pitfalls*.json` + `ai/behaviors.json` at version **0.25.
|
|
3
|
+
> Generated from `ai/components.json` + `ai/pitfalls*.json` + `ai/behaviors.json` at version **0.25.2**.
|
|
4
4
|
> Do not edit by hand: run `python 05-audit/gen-llms.py` (freshness is gated).
|
|
5
5
|
> Short version: `llms.txt`. Machine contract: `ai/*.json`.
|
|
6
6
|
|
|
@@ -33,7 +33,7 @@ Every subcommand accepts `--json`; failures print `{"ok":false,...}` and exit no
|
|
|
33
33
|
| `sparkline` | `sparkline` | asset | stable | 7.2 KB | `sparkline.js` | 迷你趋势图:无坐标轴、纯形状,适合表格内嵌的一行走势 | `chart-multiline-label` |
|
|
34
34
|
| `accordion` | `accordion` | pattern | stable | 18.0 KB | `accordion.js` | 可折叠分组 | — |
|
|
35
35
|
| `content` | `prose` | pattern | stable | 11.1 KB | — | 长文排版容器(标题/段落/列表/引用/代码) | `single-scroll-container` `line-height-constant-sync` |
|
|
36
|
-
| `drawer` | `drawer` | pattern | stable |
|
|
36
|
+
| `drawer` | `drawer` | pattern | stable | 5.9 KB | `drawer.js` | 侧边抽屉,含遮罩 | `fixed-element-inventory` |
|
|
37
37
|
| `dropdown` | `dd` | pattern | stable | 3.9 KB | `dropdown.js` | 下拉菜单 | `popover-measure-after-render` |
|
|
38
38
|
| `form-validation` | `form` | pattern | stable | 11.8 KB | — | 表单校验反馈与错误汇总 | — |
|
|
39
39
|
| `list` | `list` | pattern | stable | 6.1 KB | `flip.js` | 键值列表/条目列表 | `empty-state-no-decoration` `text-injection-xss` |
|
|
@@ -48,7 +48,7 @@ Every subcommand accepts `--json`; failures print `{"ok":false,...}` and exit no
|
|
|
48
48
|
| `badge` | `badge` | primitive | stable | 6.1 KB | — | 状态标签:计数、分类、结果标记 | — |
|
|
49
49
|
| `button` | `btn` | primitive | stable | 15.7 KB | — | 动作触发:主/次/危险/纯文字四档 | — |
|
|
50
50
|
| `card` | `card` | primitive | stable | 10.4 KB | — | 内容容器:媒体+正文+操作区三段 | — |
|
|
51
|
-
| `choice` | `choice` | primitive | stable |
|
|
51
|
+
| `choice` | `choice` | primitive | stable | 17.4 KB | — | 单选/多选/原生 select 外观的统一控件 | — |
|
|
52
52
|
| `combobox` | `combo` | primitive | stable | 7.0 KB | `combobox.js` | 可搜索 + 可多选标签的输入控件 | — |
|
|
53
53
|
| `date-range` | `drange` | primitive | stable | 6.0 KB | `date-range.js` | 日期区间选择,含预设快捷范围 | — |
|
|
54
54
|
| `delta` | `delta` | primitive | stable | 5.5 KB | — | 变化量:涨跌方向 + 符号 + 颜色。只描述往哪边变,不判断好坏(等于好恶是 … | — |
|