toolroll 0.9.86 → 0.9.87
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 +59 -0
- package/dist/agents-board.d.ts +12 -0
- package/dist/agents-board.js +26 -0
- package/dist/approval-rules-ui.d.ts +4 -1
- package/dist/approval-rules-ui.js +31 -15
- package/dist/assignment-ui.js +1 -1
- package/dist/backup-ui.d.ts +5 -4
- package/dist/backup-ui.js +65 -32
- package/dist/browser/terminal.css +1 -1
- package/dist/browser/terminal.js +57 -54
- package/dist/browser/workspace.css +2 -2
- package/dist/browser/workspace.js +35 -70
- package/dist/browser-crew.js +1 -1
- package/dist/browser-workspace.d.ts +329 -183
- package/dist/browser-workspace.js +10 -9
- package/dist/chat-controls.d.ts +1 -1
- package/dist/chat-controls.js +1 -1
- package/dist/chat-settings-page.d.ts +29 -9
- package/dist/chat-settings-page.js +59 -28
- package/dist/check-levels-ui.d.ts +2 -1
- package/dist/check-levels-ui.js +67 -58
- package/dist/contracts/cli.d.ts +43 -0
- package/dist/contracts/cli.js +4 -0
- package/dist/contracts/console-api.d.ts +1 -1
- package/dist/contracts/console-api.js +1 -1
- package/dist/credentials-ui.d.ts +5 -3
- package/dist/credentials-ui.js +58 -31
- package/dist/design/kit.css +685 -0
- package/dist/design/kit.d.ts +208 -0
- package/dist/design/kit.js +177 -0
- package/dist/design/tokens.css +19 -1
- package/dist/discord-settings.js +8 -4
- package/dist/export-ui.d.ts +6 -4
- package/dist/export-ui.js +18 -8
- package/dist/flow-changed.d.ts +14 -0
- package/dist/flow-changed.js +53 -0
- package/dist/flow-gallery-ui.d.ts +41 -4
- package/dist/flow-gallery-ui.js +95 -63
- package/dist/flow-starters-ui.d.ts +3 -9
- package/dist/flow-starters-ui.js +12 -23
- package/dist/flow-unattended-words.d.ts +20 -0
- package/dist/flow-unattended-words.js +24 -0
- package/dist/flow-unattended.d.ts +9 -5
- package/dist/flow-unattended.js +45 -23
- package/dist/flows-cli.js +7 -3
- package/dist/flows-ui.d.ts +12 -6
- package/dist/flows-ui.js +141 -30
- package/dist/integrations-ui.d.ts +6 -4
- package/dist/integrations-ui.js +34 -40
- package/dist/integrations.d.ts +2 -2
- package/dist/integrations.js +4 -4
- package/dist/kits-ui.d.ts +8 -10
- package/dist/kits-ui.js +29 -33
- package/dist/kits.js +1 -1
- package/dist/knowledge-ui.js +76 -19
- package/dist/ledger-view.d.ts +2 -0
- package/dist/ledger-view.js +41 -38
- package/dist/models-ui.d.ts +8 -3
- package/dist/models-ui.js +82 -59
- package/dist/monitoring-ui.d.ts +4 -2
- package/dist/monitoring-ui.js +44 -13
- package/dist/needs-you.d.ts +1 -1
- package/dist/needs-you.js +8 -0
- package/dist/operate-remote-arguments.js +1 -0
- package/dist/operate-remote.js +1 -1
- package/dist/operate.d.ts +1 -1
- package/dist/operate.js +38 -4
- package/dist/passwordless.d.ts +1 -1
- package/dist/passwordless.js +1 -1
- package/dist/people-audit-ui.d.ts +2 -1
- package/dist/people-audit-ui.js +25 -23
- package/dist/policy-ui.d.ts +3 -2
- package/dist/policy-ui.js +27 -21
- package/dist/policy.d.ts +3 -0
- package/dist/policy.js +14 -1
- package/dist/project-delete-ui.d.ts +4 -2
- package/dist/project-delete-ui.js +135 -126
- package/dist/project-knowledge.d.ts +10 -10
- package/dist/publish.d.ts +11 -0
- package/dist/publish.js +16 -3
- package/dist/pull-request-ui.d.ts +2 -1
- package/dist/pull-request-ui.js +39 -28
- package/dist/recipe-ui.d.ts +4 -2
- package/dist/recipe-ui.js +14 -4
- package/dist/release-adapters.d.ts +3 -0
- package/dist/release-adapters.js +22 -2
- package/dist/release-cli.js +81 -9
- package/dist/release.d.ts +21 -0
- package/dist/release.js +40 -4
- package/dist/releases.js +1 -1
- package/dist/request-budget-ui.d.ts +4 -2
- package/dist/request-budget-ui.js +30 -19
- package/dist/retention-ui.d.ts +4 -3
- package/dist/retention-ui.js +15 -12
- package/dist/scope.d.ts +3 -0
- package/dist/scope.js +6 -0
- package/dist/serve.d.ts +0 -1
- package/dist/serve.js +51 -7
- package/dist/server/agents-computers.d.ts +9 -0
- package/dist/server/agents-computers.js +67 -0
- package/dist/server/chat.js +16 -16
- package/dist/server/chrome.d.ts +1 -1
- package/dist/server/chrome.js +19 -9
- package/dist/server/console.css +2 -2
- package/dist/server/flows.js +64 -36
- package/dist/server/home.d.ts +35 -0
- package/dist/server/home.js +104 -0
- package/dist/server/http.d.ts +3 -0
- package/dist/server/http.js +5 -0
- package/dist/server/kit-standalone.d.ts +22 -0
- package/dist/server/kit-standalone.js +69 -0
- package/dist/server/kit.d.ts +405 -0
- package/dist/server/kit.js +361 -0
- package/dist/server/pages.d.ts +2 -1
- package/dist/server/pages.js +213 -174
- package/dist/server/people-tokens.js +26 -85
- package/dist/server/render-history.d.ts +51 -0
- package/dist/server/render-history.js +228 -0
- package/dist/server/render-new-task.d.ts +29 -0
- package/dist/server/render-new-task.js +96 -0
- package/dist/server/render-next.d.ts +63 -0
- package/dist/server/render-next.js +109 -0
- package/dist/server/render-pages.d.ts +22 -190
- package/dist/server/render-pages.js +123 -575
- package/dist/server/render-people.d.ts +24 -3
- package/dist/server/render-people.js +93 -72
- package/dist/server/render-projects.d.ts +103 -0
- package/dist/server/render-projects.js +247 -0
- package/dist/server/render-results.d.ts +5 -24
- package/dist/server/render-results.js +48 -185
- package/dist/server/render-settings.d.ts +5 -74
- package/dist/server/render-settings.js +102 -493
- package/dist/server/render-tasks.d.ts +35 -5
- package/dist/server/render-tasks.js +114 -85
- package/dist/server/route-table.js +20 -5
- package/dist/server/settings.js +276 -255
- package/dist/server/task-views.d.ts +8 -0
- package/dist/server/task-views.js +85 -2
- package/dist/server/tasks.d.ts +8 -0
- package/dist/server/tasks.js +95 -40
- package/dist/server/terminals.js +1 -1
- package/dist/server/welcome.d.ts +22 -0
- package/dist/server/welcome.js +69 -0
- package/dist/settings-groups-ui.d.ts +279 -0
- package/dist/settings-groups-ui.js +615 -0
- package/dist/settings-kit.d.ts +42 -6
- package/dist/settings-kit.js +69 -7
- package/dist/setup-guide.d.ts +2 -2
- package/dist/skills-ui.js +59 -7
- package/dist/slack-settings.js +12 -5
- package/dist/spend-ui.d.ts +45 -26
- package/dist/spend-ui.js +124 -56
- package/dist/sso-ui.d.ts +5 -2
- package/dist/sso-ui.js +63 -31
- package/dist/storage-ui.d.ts +3 -2
- package/dist/storage-ui.js +56 -50
- package/dist/store.d.ts +112 -3
- package/dist/store.js +292 -20
- package/dist/surface.js +5 -1
- package/dist/teams-settings.d.ts +2 -1
- package/dist/teams-settings.js +24 -41
- package/dist/telegram-settings.d.ts +0 -4
- package/dist/telegram-settings.js +52 -25
- package/dist/toolroll-update-ui.d.ts +8 -4
- package/dist/toolroll-update-ui.js +55 -45
- package/dist/tools-ui.d.ts +5 -3
- package/dist/tools-ui.js +107 -42
- package/dist/work-index.js +11 -7
- package/dist/workspace-ui.d.ts +1 -1
- package/dist/workspace-ui.js +7 -4
- package/package.json +1 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kit's behaviour for a server page the workspace bundle doesn't place (src/design/KIT.md): a chromed page
|
|
3
|
+
* answered without the React workspace (a bearer or link session, or a build without browser assets). It is the
|
|
4
|
+
* same behaviour src/browser/kit/behavior.ts gives kit markup inside the workspace, kept small and dependency-free so
|
|
5
|
+
* it can ride the page's one nonce'd script (serve.ts sendScreen):
|
|
6
|
+
*
|
|
7
|
+
* - the composer grows from its rows to its max rows and then scrolls, and keeps "has text" and a gated send in step;
|
|
8
|
+
* - a gated send does nothing while the box is empty;
|
|
9
|
+
* - an idea (`data-k-draft`) adds its words to its composer in place;
|
|
10
|
+
* - the composer's project chip and + open a small menu;
|
|
11
|
+
* - overlays (`data-k-open`, `data-k-close`): the page behind inert, Tab kept inside, Escape, Close and the scrim close
|
|
12
|
+
* it, focus returns to the trigger; a popover or menu becomes a bottom sheet on a phone;
|
|
13
|
+
* - a button switch (`button.k-switch[role=switch][data-k-switch]`) flips and says its new state;
|
|
14
|
+
* - the phone keyboard: html.kb-open and --kb from the visual viewport.
|
|
15
|
+
*
|
|
16
|
+
* It reads no field but a composer's own text, posts nothing and fetches nothing: every control still works as plain
|
|
17
|
+
* HTML without it. It never rides a sensitive page (one that asks for a password or shows a secret), where the page
|
|
18
|
+
* carries no chrome additions.
|
|
19
|
+
*/
|
|
20
|
+
export const KIT_STANDALONE_SCRIPT = `(function(){
|
|
21
|
+
if(window.__kitStandalone)return;window.__kitStandalone=1;var d=document;
|
|
22
|
+
var PHONE="(max-width: 760px)";var FOCUSABLE='a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
23
|
+
function phone(){return window.matchMedia(PHONE).matches;}
|
|
24
|
+
function sync(t){var box=t.closest(".k-composer");if(!box)return;var st=getComputedStyle(t);var line=parseFloat(st.lineHeight)||21;
|
|
25
|
+
var pad=(parseFloat(st.paddingTop)||0)+(parseFloat(st.paddingBottom)||0);var max=line*(Number(t.getAttribute("data-max"))||8)+pad;var min=line*(Number(t.getAttribute("data-min"))||1)+pad;
|
|
26
|
+
t.style.height="auto";t.style.height=Math.max(min,Math.min(t.scrollHeight,max))+"px";t.style.overflowY=t.scrollHeight>max+1?"auto":"hidden";
|
|
27
|
+
var on=t.value.trim()!=="";box.classList.toggle("has-text",on);var sends=box.querySelectorAll(".k-send[data-gate]:not(:disabled)");for(var i=0;i<sends.length;i++)sends[i].setAttribute("aria-disabled",String(!on));}
|
|
28
|
+
function syncAll(){var all=d.querySelectorAll(".k-composer-ta");for(var i=0;i<all.length;i++)sync(all[i]);}
|
|
29
|
+
var stack=[];
|
|
30
|
+
function visible(el){return !!el&&el.isConnected&&el.getClientRects().length>0;}
|
|
31
|
+
function openPanel(panel,trigger,onClose){if(stack.length)closeTop("close");var floating=panel.classList.contains("k-pop");var ph=phone();
|
|
32
|
+
if(!panel.isConnected)d.body.appendChild(panel);var scrim=d.createElement("div");scrim.className="k-scrim"+(!floating||ph?" dim":"");panel.parentNode.insertBefore(scrim,panel);
|
|
33
|
+
panel.hidden=false;panel.setAttribute("aria-modal","true");if(!panel.hasAttribute("tabindex"))panel.tabIndex=-1;panel.classList.toggle("as-sheet",floating&&ph);
|
|
34
|
+
if(floating&&!ph&&trigger){var at=trigger.getBoundingClientRect();var w=panel.offsetWidth||336,h=panel.offsetHeight||200;var left=Math.min(Math.max(8,at.right-w),window.innerWidth-w-8);var below=at.bottom+6;var top=below+h>window.innerHeight-8?Math.max(8,at.top-h-6):below;panel.style.left=Math.round(left)+"px";panel.style.top=Math.round(top)+"px";}
|
|
35
|
+
var inerted=[];for(var node=panel;node!==d.body&&node.parentElement;node=node.parentElement){var kids=node.parentElement.children;for(var i=0;i<kids.length;i++){var s=kids[i];if(s===node||s===scrim||s.inert)continue;s.inert=true;inerted.push(s);}}
|
|
36
|
+
var entry={panel:panel,scrim:scrim,trigger:trigger,inerted:inerted,onClose:onClose};stack.push(entry);scrim.addEventListener("click",function(){closeEntry(entry);});
|
|
37
|
+
var first=panel.querySelector("[autofocus]")||panel.querySelector('input:not([type="hidden"]), textarea, select')||panel;first.focus();}
|
|
38
|
+
function closeEntry(entry){var at=stack.indexOf(entry);if(at<0)return;stack.splice(at,1);for(var i=0;i<entry.inerted.length;i++)entry.inerted[i].inert=false;
|
|
39
|
+
entry.scrim.remove();entry.panel.hidden=true;entry.panel.classList.remove("as-sheet");if(visible(entry.trigger))entry.trigger.focus();if(entry.onClose)entry.onClose();}
|
|
40
|
+
function closeTop(){var top=stack[stack.length-1];if(top)closeEntry(top);}
|
|
41
|
+
function menu(trigger,title,items){var ph=phone();var panel=d.createElement("div");panel.className=ph?"k-sheet":"k-pop k-pop-menu";panel.setAttribute("role","dialog");
|
|
42
|
+
var id="k-menu-"+Math.random().toString(36).slice(2,8);panel.setAttribute("aria-labelledby",id);var head=d.createElement("div");head.className=ph?"k-sheet-h":"k-pop-h";
|
|
43
|
+
var h=d.createElement(ph?"h2":"h3");h.id=id;h.textContent=title;var x=d.createElement("button");x.type="button";x.className="k-btn k-btn-ghost k-btn-sm k-btn-icon";x.setAttribute("aria-label","Close");x.setAttribute("data-k-close","");x.textContent="\\u00d7";
|
|
44
|
+
head.appendChild(h);head.appendChild(x);var list=d.createElement("div");list.className="k-menu";var entry;
|
|
45
|
+
items.forEach(function(item){var b=d.createElement("button");b.type="button";b.textContent=item.current?item.label+" \\u00b7 current":item.label;if(item.current)b.setAttribute("aria-current","true");b.addEventListener("click",function(){closeTop();item.act();});list.appendChild(b);});
|
|
46
|
+
panel.appendChild(head);panel.appendChild(list);openPanel(panel,trigger,function(){panel.remove();});}
|
|
47
|
+
function composerMenu(target){var chip=target.closest("[data-k-composer-project]");var plus=target.closest("[data-k-composer-plus]");var id=chip?chip.getAttribute("data-k-composer-project"):plus?plus.getAttribute("data-k-composer-plus"):null;if(id===null)return false;
|
|
48
|
+
var hidden=d.getElementById(id+"-project");function choose(trigger){if(!hidden)return;var items=[];try{var parsed=JSON.parse(hidden.getAttribute("data-items")||"[]");if(Array.isArray(parsed))items=parsed.filter(function(one){return typeof one==="string";});}catch(e){items=[];}
|
|
49
|
+
menu(trigger,"Project",items.map(function(name){return{label:name,current:name===hidden.value,act:function(){hidden.value=name;var c=d.querySelector('[data-k-composer-project="'+CSS.escape(id)+'"]');if(c){var l=c.querySelector("[data-k-project-name]");if(l)l.textContent=name;c.setAttribute("aria-label","Project: "+name+". Change");}hidden.dispatchEvent(new Event("change",{bubbles:true}));}};}));}
|
|
50
|
+
if(chip){choose(chip);return true;}var attach=d.querySelector('input[type="file"][data-k-attach="'+CSS.escape(id)+'"]');var items=[];if(attach)items.push({label:"Attach a file",act:function(){attach.click();}});
|
|
51
|
+
if(hidden)items.push({label:"Choose project",act:function(){choose(d.querySelector('[data-k-composer-project="'+CSS.escape(id)+'"]')||plus);}});if(items.length)menu(plus,"Add to your message",items);return true;}
|
|
52
|
+
d.addEventListener("input",function(e){var t=e.target;if(t&&t.classList&&t.classList.contains("k-composer-ta"))sync(t);});
|
|
53
|
+
d.addEventListener("click",function(e){var t=e.target;if(!t||!t.closest)return;
|
|
54
|
+
if(t.closest('.k-send[data-gate][aria-disabled="true"]')){e.preventDefault();return;}
|
|
55
|
+
var draft=t.closest("[data-k-draft]");if(draft){var box=d.getElementById((draft.getAttribute("data-k-into")||"")+"-text");if(box&&!box.disabled){e.preventDefault();var words=draft.getAttribute("data-k-draft")||"";var typed=box.value;
|
|
56
|
+
box.value=typed.trim()===""?words:typed.indexOf(words)>=0?typed:typed.replace(/\\s+$/,"")+"\\n"+words;sync(box);box.focus();}return;}
|
|
57
|
+
if((t.closest("[data-k-composer-project]")||t.closest("[data-k-composer-plus]"))&&composerMenu(t)){e.preventDefault();return;}
|
|
58
|
+
var opener=t.closest("[data-k-open]");if(opener){var panel=d.getElementById(opener.getAttribute("data-k-open")||"");if(panel){e.preventDefault();openPanel(panel,opener);}return;}
|
|
59
|
+
if(t.closest("[data-k-close]")){var top=stack[stack.length-1];if(top&&top.panel.contains(t)){e.preventDefault();closeEntry(top);}return;}
|
|
60
|
+
var sw=t.closest("button.k-switch[role=switch][data-k-switch]");if(sw){var on=sw.getAttribute("aria-checked")!=="true";sw.setAttribute("aria-checked",String(on));var w=(sw.getAttribute("data-k-switch")||"On|Off").split("|");var s=sw.querySelector("[data-k-words]");if(s)s.textContent=(on?w[0]:w[1])||"";sw.dispatchEvent(new CustomEvent("k-switch",{bubbles:true,detail:{on:on}}));}});
|
|
61
|
+
d.addEventListener("keydown",function(e){var top=stack[stack.length-1];if(!top)return;if(e.key==="Escape"){e.preventDefault();closeEntry(top);return;}if(e.key!=="Tab")return;
|
|
62
|
+
var items=Array.prototype.filter.call(top.panel.querySelectorAll(FOCUSABLE),visible);if(!items.length){e.preventDefault();top.panel.focus();return;}var first=items[0],last=items[items.length-1];
|
|
63
|
+
if(e.shiftKey&&(d.activeElement===first||d.activeElement===top.panel)){e.preventDefault();last.focus();}else if(!e.shiftKey&&d.activeElement===last){e.preventDefault();first.focus();}},true);
|
|
64
|
+
function kb(){var v=window.visualViewport;if(!v)return;var covered=Math.max(0,Math.round(window.innerHeight-v.height-v.offsetTop));d.documentElement.style.setProperty("--kb",covered+"px");d.documentElement.classList.toggle("kb-open",covered>80);}
|
|
65
|
+
if(window.visualViewport){window.visualViewport.addEventListener("resize",kb);window.visualViewport.addEventListener("scroll",kb);}
|
|
66
|
+
if(d.readyState==="loading")d.addEventListener("DOMContentLoaded",syncAll);else syncAll();
|
|
67
|
+
})();`;
|
|
68
|
+
/** Whether a page's markup has kit pieces the standalone behaviour wires (a composer, an overlay, a button switch, an idea). */
|
|
69
|
+
export const KIT_BEHAVIOR_MARKUP = /class="k-composer[ "]|data-k-open=|data-k-switch=|data-k-draft=/;
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The revamp kit for server pages: the same markup the React kit (src/browser/kit/) renders, as `Html`, so a
|
|
3
|
+
* server page and a React view built from the kit look and behave alike. Rules: src/design/KIT.md. Look:
|
|
4
|
+
* src/design/kit.css (served with console.css). Words and approval rules: src/design/kit.ts.
|
|
5
|
+
*
|
|
6
|
+
* Everything here escapes by construction (html.ts): strings are text, only `Html` is markup. Behaviour (the
|
|
7
|
+
* composer growing, Stop, the keyboard, overlays, switches) comes from the workspace bundle's kit behaviour
|
|
8
|
+
* (src/browser/kit/behavior.ts), which wires any kit markup the workspace places; every control here still works
|
|
9
|
+
* as plain HTML without it.
|
|
10
|
+
*/
|
|
11
|
+
import { type AttributeValue, type Html, type HtmlValue, type PostFormOptions } from "../html.js";
|
|
12
|
+
import { type ApprovalFacts, type ApprovalKind, type ChipTone, type KitIcon, type StatusKey, type StepItem, type TimingRow } from "../design/kit.js";
|
|
13
|
+
import type { Headline } from "../task-status.js";
|
|
14
|
+
type Attrs = Readonly<Record<string, AttributeValue>>;
|
|
15
|
+
export declare function icon(name: KitIcon, small?: boolean): Html;
|
|
16
|
+
export type BtnVariant = "primary" | "outline" | "ghost" | "danger";
|
|
17
|
+
export type BtnOptions = {
|
|
18
|
+
variant?: BtnVariant;
|
|
19
|
+
sm?: boolean;
|
|
20
|
+
/** Icon-only: give it `label` (read aloud and shown as the tooltip). */
|
|
21
|
+
iconOnly?: KitIcon;
|
|
22
|
+
lead?: KitIcon;
|
|
23
|
+
/** A link styled as a button (navigation is never the primary act). */
|
|
24
|
+
href?: string;
|
|
25
|
+
type?: "button" | "submit";
|
|
26
|
+
/** The screen's one primary, which the phone dock also carries: hidden in the card on a phone. */
|
|
27
|
+
docked?: boolean;
|
|
28
|
+
attrs?: Attrs;
|
|
29
|
+
className?: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function btn(label: string, options?: BtnOptions): Html;
|
|
32
|
+
export declare function chip(word: string, tone?: ChipTone, options?: {
|
|
33
|
+
dot?: boolean;
|
|
34
|
+
}): Html;
|
|
35
|
+
/** One of the five status words in its tone. */
|
|
36
|
+
export declare const status: (key: StatusKey) => Html;
|
|
37
|
+
/** A task's headline (task-status.ts) as its chip. */
|
|
38
|
+
export declare function headlineChip(headline: Headline): Html;
|
|
39
|
+
/** A count pill: ink only for a Needs-you count; zero is muted. */
|
|
40
|
+
export declare function count(n: number, options?: {
|
|
41
|
+
ink?: boolean;
|
|
42
|
+
}): Html;
|
|
43
|
+
export type TabItem = {
|
|
44
|
+
key: string;
|
|
45
|
+
label: string;
|
|
46
|
+
href: string;
|
|
47
|
+
count?: Html;
|
|
48
|
+
};
|
|
49
|
+
/** Sections of one object as addresses: a <nav> of links, the current one aria-current="page". */
|
|
50
|
+
export declare function linkTabs(label: string, current: string, items: readonly TabItem[]): Html;
|
|
51
|
+
/** Filters or views of a list as addresses: the segmented track. */
|
|
52
|
+
export declare function segLinks(label: string, current: string, items: readonly TabItem[]): Html;
|
|
53
|
+
/** Filters or views as addresses with icons (List / Board): each item an icon, its label read aloud. */
|
|
54
|
+
export declare function iconSegLinks(label: string, current: string, items: ReadonlyArray<{
|
|
55
|
+
key: string;
|
|
56
|
+
label: string;
|
|
57
|
+
href: string;
|
|
58
|
+
icon: KitIcon;
|
|
59
|
+
}>): Html;
|
|
60
|
+
/** A list's text filter (the workspace narrows the rows on the page as it is typed; without it, a GET form). */
|
|
61
|
+
export declare function filterInput(options: {
|
|
62
|
+
label: string;
|
|
63
|
+
name?: string;
|
|
64
|
+
value?: string;
|
|
65
|
+
placeholder?: string;
|
|
66
|
+
}): Html;
|
|
67
|
+
/** A field: label, control, one hint line, and the error slot tied to the control (aria-describedby). */
|
|
68
|
+
export declare function field(options: {
|
|
69
|
+
id: string;
|
|
70
|
+
label: string;
|
|
71
|
+
control: Html;
|
|
72
|
+
hint?: string;
|
|
73
|
+
error?: string | null;
|
|
74
|
+
}): Html;
|
|
75
|
+
/** A text input; `error` marks it invalid and points it at its error line. */
|
|
76
|
+
export declare function input(options: {
|
|
77
|
+
id: string;
|
|
78
|
+
name: string;
|
|
79
|
+
value?: string;
|
|
80
|
+
type?: "text" | "number" | "url" | "email" | "search" | "password" | "time";
|
|
81
|
+
error?: boolean;
|
|
82
|
+
hint?: boolean;
|
|
83
|
+
attrs?: Attrs;
|
|
84
|
+
}): Html;
|
|
85
|
+
export declare function textarea(options: {
|
|
86
|
+
id: string;
|
|
87
|
+
name: string;
|
|
88
|
+
value?: string;
|
|
89
|
+
rows?: number;
|
|
90
|
+
error?: boolean;
|
|
91
|
+
attrs?: Attrs;
|
|
92
|
+
}): Html;
|
|
93
|
+
/** A native select with the kit's chevron: 32px, `sm` 28px in a toolbar, 44px and 16px text on a phone. */
|
|
94
|
+
export declare function select(options: {
|
|
95
|
+
id?: string;
|
|
96
|
+
name?: string;
|
|
97
|
+
label?: string;
|
|
98
|
+
items: ReadonlyArray<readonly [value: string, label: string] | string>;
|
|
99
|
+
current?: string;
|
|
100
|
+
sm?: boolean;
|
|
101
|
+
wide?: boolean;
|
|
102
|
+
attrs?: Attrs;
|
|
103
|
+
}): Html;
|
|
104
|
+
/** An on/off setting in a form: a checkbox with role=switch and a visible label (posts `name=on` when on). */
|
|
105
|
+
export declare function switchInput(options: {
|
|
106
|
+
id: string;
|
|
107
|
+
name: string;
|
|
108
|
+
label: string;
|
|
109
|
+
on: boolean;
|
|
110
|
+
attrs?: Attrs;
|
|
111
|
+
}): Html;
|
|
112
|
+
/** Two columns: label and one muted line | the control. `inline` keeps the control beside the label on a phone. */
|
|
113
|
+
export declare function formRow(label: string, hint: string | null, control: Html, variant?: "" | "inline" | "top" | "wide"): Html;
|
|
114
|
+
/** Radio cards: one choice from a few, each with a bold label and one muted line. */
|
|
115
|
+
export declare function radios(options: {
|
|
116
|
+
name: string;
|
|
117
|
+
legend: string;
|
|
118
|
+
current: string;
|
|
119
|
+
items: ReadonlyArray<{
|
|
120
|
+
value: string;
|
|
121
|
+
label: string;
|
|
122
|
+
text?: string;
|
|
123
|
+
tag?: Html;
|
|
124
|
+
}>;
|
|
125
|
+
}): Html;
|
|
126
|
+
export declare const acts: (...buttons: HtmlValue[]) => Html;
|
|
127
|
+
export declare function facts(rows: ReadonlyArray<readonly [key: string, value: HtmlValue]>): Html;
|
|
128
|
+
export declare const note: (text: HtmlValue) => Html;
|
|
129
|
+
/** A refusal or problem, where it happened (role=alert): what went wrong and what didn't change. */
|
|
130
|
+
export declare const notice: (text: HtmlValue) => Html;
|
|
131
|
+
/** One neutral system line (a builder offline, an update): not a failure, never amber. */
|
|
132
|
+
export declare const infoLine: (text: HtmlValue) => Html;
|
|
133
|
+
export declare function empty(options: {
|
|
134
|
+
title: string;
|
|
135
|
+
text?: string;
|
|
136
|
+
action?: Html;
|
|
137
|
+
}): Html;
|
|
138
|
+
/** A disclosure for secondary detail. */
|
|
139
|
+
export declare const disclose: (summary: string, body: HtmlValue, open?: boolean) => Html;
|
|
140
|
+
/** A group heading with its count; `right` puts one quiet tool at its end. */
|
|
141
|
+
export declare const group: (label: string, n?: Html, right?: Html) => Html;
|
|
142
|
+
/** A list row: chip · title (the whole row is the link) · one muted line · meta · one action, always in one column. */
|
|
143
|
+
export declare function row(options: {
|
|
144
|
+
href?: string;
|
|
145
|
+
chip: Html;
|
|
146
|
+
title: string;
|
|
147
|
+
desc?: HtmlValue;
|
|
148
|
+
meta?: HtmlValue;
|
|
149
|
+
action?: Html;
|
|
150
|
+
wait?: boolean;
|
|
151
|
+
message?: Html;
|
|
152
|
+
attrs?: Attrs;
|
|
153
|
+
}): Html;
|
|
154
|
+
/** The phone header: back (or nothing), the title, one trailing action. Hidden at a desk. */
|
|
155
|
+
export declare function phoneHeader(title: string, options?: {
|
|
156
|
+
back?: string;
|
|
157
|
+
trailing?: Html;
|
|
158
|
+
}): Html;
|
|
159
|
+
/** A list page's header: the phone header and the desk top bar (title · muted context · spacer · tools). */
|
|
160
|
+
export declare function pageHeader(title: string, options?: {
|
|
161
|
+
ctx?: HtmlValue;
|
|
162
|
+
right?: Html;
|
|
163
|
+
back?: string;
|
|
164
|
+
phoneTitle?: string;
|
|
165
|
+
trailing?: Html;
|
|
166
|
+
}): Html;
|
|
167
|
+
/** A reading page's header: a back link, the one h1, a meta line. `same` when the phone header already shows the
|
|
168
|
+
* title: the h1 stays for assistive tech and is drawn once. */
|
|
169
|
+
export declare function docHeader(options: {
|
|
170
|
+
title: string;
|
|
171
|
+
back?: readonly [href: string, label: string];
|
|
172
|
+
meta?: HtmlValue;
|
|
173
|
+
right?: Html;
|
|
174
|
+
same?: boolean;
|
|
175
|
+
}): Html;
|
|
176
|
+
export declare const doc: (...parts: HtmlValue[]) => Html;
|
|
177
|
+
/** The four fixed slots: status (chip + heading) · supporting text · actions · terms, plus the error slot. The same
|
|
178
|
+
* slots in every state (waiting, approved, automatic, refused), so nothing moves. `body`: the choice the act takes
|
|
179
|
+
* (radio cards, a note), between the text and the actions. */
|
|
180
|
+
export declare function slots(options: {
|
|
181
|
+
wait?: boolean;
|
|
182
|
+
status: Html;
|
|
183
|
+
text: HtmlValue;
|
|
184
|
+
body?: HtmlValue;
|
|
185
|
+
acts: HtmlValue;
|
|
186
|
+
terms: HtmlValue;
|
|
187
|
+
err?: HtmlValue;
|
|
188
|
+
attrs?: Attrs;
|
|
189
|
+
}): Html;
|
|
190
|
+
/** This request's approval facts: Passwordless as the request sees it, plus what the page read for this act. */
|
|
191
|
+
export declare function approvalFactsNow(read?: Omit<ApprovalFacts, "passwordless">): ApprovalFacts;
|
|
192
|
+
/**
|
|
193
|
+
* The control that approves one act, inside its slots: a POST form with the act's button and, only when the rules
|
|
194
|
+
* say so, the password field (name `token`, as every ceremony reads it). Automatic approval renders nothing to
|
|
195
|
+
* press. The page decides only what it shows: the server proves the person, the freshness and the scope again
|
|
196
|
+
* when the form arrives.
|
|
197
|
+
*/
|
|
198
|
+
export declare function approveForm(options: {
|
|
199
|
+
action: string;
|
|
200
|
+
kind: ApprovalKind;
|
|
201
|
+
facts: ApprovalFacts;
|
|
202
|
+
label: string;
|
|
203
|
+
/** The screen's one primary (ink); otherwise outline. */
|
|
204
|
+
primary?: boolean;
|
|
205
|
+
docked?: boolean;
|
|
206
|
+
/** Hidden fields, return path, project revision, extra attributes. Never `signedOut`: an approval always carries the
|
|
207
|
+
* request's CSRF field. Extra classes are added to `k-approve`, never instead of it. */
|
|
208
|
+
form?: Omit<PostFormOptions, "signedOut">;
|
|
209
|
+
/** Extra controls before the button (a note field, a confirm checkbox). */
|
|
210
|
+
before?: Html;
|
|
211
|
+
}): Html;
|
|
212
|
+
/** The terms line for an act, from the same rules. */
|
|
213
|
+
export declare const approvalTerms: (kind: ApprovalKind, facts: ApprovalFacts) => string;
|
|
214
|
+
/** Waits that aren't tasks, on their own page (a spend limit, a failed backup): one amber outline, a count, items
|
|
215
|
+
* split by hairlines, each with its one action. They never join the global Needs-you count. */
|
|
216
|
+
export declare function needsPanel(items: ReadonlyArray<{
|
|
217
|
+
title: string;
|
|
218
|
+
text?: string;
|
|
219
|
+
action?: Html;
|
|
220
|
+
}>, label?: string): Html;
|
|
221
|
+
/** A run's steps on one elapsed-time axis (Release, a flow's run, a pull request's checks). */
|
|
222
|
+
export declare function timing(options: {
|
|
223
|
+
label?: string;
|
|
224
|
+
chip?: Html;
|
|
225
|
+
rows: readonly TimingRow[];
|
|
226
|
+
scale?: number;
|
|
227
|
+
foot?: HtmlValue;
|
|
228
|
+
head?: string;
|
|
229
|
+
}): Html;
|
|
230
|
+
/** A few named steps on one line, filled up to where the work is. */
|
|
231
|
+
export declare function steps(items: readonly StepItem[], label?: string): Html;
|
|
232
|
+
/** The board's columns; on a phone one at a time (`on`). */
|
|
233
|
+
export declare const board: (label: string, ...columns: HtmlValue[]) => Html;
|
|
234
|
+
export declare function boardCol(options: {
|
|
235
|
+
label: string;
|
|
236
|
+
count?: Html;
|
|
237
|
+
needs?: boolean;
|
|
238
|
+
on?: boolean;
|
|
239
|
+
empty: string;
|
|
240
|
+
cards: readonly Html[];
|
|
241
|
+
}): Html;
|
|
242
|
+
export declare const card: (options: {
|
|
243
|
+
href: string;
|
|
244
|
+
title: string;
|
|
245
|
+
meta: HtmlValue;
|
|
246
|
+
}) => Html;
|
|
247
|
+
/** The not-found page, inside the shell: what was asked for and two ways on. */
|
|
248
|
+
export declare function notFound(path: string, options?: {
|
|
249
|
+
title?: string;
|
|
250
|
+
text?: string;
|
|
251
|
+
}): Html;
|
|
252
|
+
/** The Settings frame: Overview and the eight groups, a desk breadcrumb, a phone back header, one column. */
|
|
253
|
+
export declare function settingsShell(options: {
|
|
254
|
+
group: string;
|
|
255
|
+
title: string;
|
|
256
|
+
lead?: string;
|
|
257
|
+
body: HtmlValue;
|
|
258
|
+
sub?: boolean;
|
|
259
|
+
back?: string;
|
|
260
|
+
flags?: Readonly<Record<string, boolean>>;
|
|
261
|
+
}): Html;
|
|
262
|
+
/** The round send, an arrow up; with `stop` it carries its Stop twin (the composer's .working class swaps them).
|
|
263
|
+
* `gate` (a message box) marks it aria-disabled while the box is empty. */
|
|
264
|
+
export declare function sendButton(options?: {
|
|
265
|
+
label?: string;
|
|
266
|
+
name?: string;
|
|
267
|
+
gate?: boolean;
|
|
268
|
+
empty?: boolean;
|
|
269
|
+
stop?: {
|
|
270
|
+
label?: string;
|
|
271
|
+
attrs?: Attrs;
|
|
272
|
+
};
|
|
273
|
+
attrs?: Attrs;
|
|
274
|
+
}): Html;
|
|
275
|
+
/**
|
|
276
|
+
* The message box: one soft rounded container, the textarea grows from `rows` to `maxRows` lines then scrolls,
|
|
277
|
+
* one bottom row inside (+ menu, the project as a quiet chip, small controls, the round send). Textarea
|
|
278
|
+
* `<id>-text` (named `name`), refusal slot `<id>-err`, chosen project a hidden input `<id>-project` (named
|
|
279
|
+
* `projectName`). A refused send keeps the words in the box with the reason in the error slot.
|
|
280
|
+
*/
|
|
281
|
+
export declare function composer(options: {
|
|
282
|
+
id: string;
|
|
283
|
+
name: string;
|
|
284
|
+
label: string;
|
|
285
|
+
placeholder?: string;
|
|
286
|
+
value?: string;
|
|
287
|
+
rows?: number;
|
|
288
|
+
maxRows?: number;
|
|
289
|
+
plus?: boolean;
|
|
290
|
+
project?: {
|
|
291
|
+
current: string;
|
|
292
|
+
items: readonly string[];
|
|
293
|
+
name?: string;
|
|
294
|
+
};
|
|
295
|
+
before?: Html;
|
|
296
|
+
send: Html;
|
|
297
|
+
note?: HtmlValue;
|
|
298
|
+
error?: string | null;
|
|
299
|
+
disabled?: boolean;
|
|
300
|
+
line?: boolean;
|
|
301
|
+
working?: boolean;
|
|
302
|
+
/** Extra attributes for the textarea (maxlength, required, autofocus). */
|
|
303
|
+
textAttrs?: Attrs;
|
|
304
|
+
}): Html;
|
|
305
|
+
export type OverlayKind = "popover" | "drawer" | "sheet" | "menu";
|
|
306
|
+
/** A floating panel, hidden until its trigger (`overlayTrigger`) opens it: role=dialog, a labelled Close, Escape
|
|
307
|
+
* and the scrim close it, Tab stays inside, focus returns to the trigger. A popover and a menu become a bottom
|
|
308
|
+
* sheet on a phone. */
|
|
309
|
+
export declare function overlay(options: {
|
|
310
|
+
id: string;
|
|
311
|
+
kind: OverlayKind;
|
|
312
|
+
title: string;
|
|
313
|
+
sub?: string;
|
|
314
|
+
body: HtmlValue;
|
|
315
|
+
}): Html;
|
|
316
|
+
/** The button that opens an overlay. */
|
|
317
|
+
export declare function overlayTrigger(label: string, overlayId: string, options?: Omit<BtnOptions, "href" | "type">): Html;
|
|
318
|
+
/** The phone dock: this screen's one primary (the same act the card hides on a phone). */
|
|
319
|
+
export declare function dock(primary: Html | null): Html;
|
|
320
|
+
/** Several kit parts joined. */
|
|
321
|
+
export declare const parts: (...values: HtmlValue[]) => Html;
|
|
322
|
+
/**
|
|
323
|
+
* A page outside the shell (sign in, the first account, an invite, signed out, an error): the brand, one narrow
|
|
324
|
+
* column with the one h1, then an optional foot line under a hairline. `brand` is the product mark (chrome.ts
|
|
325
|
+
* BRAND_HTML). These pages carry no script: everything on them works as plain HTML.
|
|
326
|
+
*/
|
|
327
|
+
export declare function outPage(options: {
|
|
328
|
+
brand: Html;
|
|
329
|
+
brandHref?: string;
|
|
330
|
+
title: string;
|
|
331
|
+
sub?: HtmlValue;
|
|
332
|
+
note?: HtmlValue;
|
|
333
|
+
body?: HtmlValue;
|
|
334
|
+
foot?: HtmlValue;
|
|
335
|
+
}): Html;
|
|
336
|
+
/** A form field outside the shell: label, input, one hint line, and its error line (the field is aria-invalid, described
|
|
337
|
+
* by both and focused when the error is about it). The error is a server's refusal; nothing here validates. */
|
|
338
|
+
export declare function outField(options: {
|
|
339
|
+
id: string;
|
|
340
|
+
label: string;
|
|
341
|
+
name: string;
|
|
342
|
+
type?: "text" | "password";
|
|
343
|
+
value?: string;
|
|
344
|
+
hint?: string;
|
|
345
|
+
error?: string | null;
|
|
346
|
+
attrs?: Attrs;
|
|
347
|
+
}): Html;
|
|
348
|
+
export type CheckStep = {
|
|
349
|
+
key: string;
|
|
350
|
+
title: string;
|
|
351
|
+
text: HtmlValue;
|
|
352
|
+
state: "done" | "open" | "checking";
|
|
353
|
+
action?: Html | null;
|
|
354
|
+
};
|
|
355
|
+
/** A short list of steps: a mark, the step and one line, its one action. Done steps read muted with a check; a step
|
|
356
|
+
* being checked shows a static ring (running state never animates). The state is also said in words. */
|
|
357
|
+
export declare function checklist(steps: readonly CheckStep[], label?: string): Html;
|
|
358
|
+
/** Ideas that draft words into a composer: each is a link that opens the page with the words in the box (no script),
|
|
359
|
+
* and with the kit behaviour it adds them to the box in place (`data-k-draft`, `data-k-into` = the composer id). */
|
|
360
|
+
export declare function ideas(options: {
|
|
361
|
+
label: HtmlValue;
|
|
362
|
+
into: string;
|
|
363
|
+
items: ReadonlyArray<{
|
|
364
|
+
label: string;
|
|
365
|
+
draft: string;
|
|
366
|
+
href: string;
|
|
367
|
+
}>;
|
|
368
|
+
}): Html;
|
|
369
|
+
/** A settings section: its heading (with an optional muted state after it), one muted lead line, then its rows.
|
|
370
|
+
* No nested wells. `id` is also the anchor other pages link to. */
|
|
371
|
+
export declare function settingsSection(options: {
|
|
372
|
+
id: string;
|
|
373
|
+
title: string;
|
|
374
|
+
state?: HtmlValue;
|
|
375
|
+
lead?: HtmlValue;
|
|
376
|
+
right?: Html;
|
|
377
|
+
body: HtmlValue;
|
|
378
|
+
}): Html;
|
|
379
|
+
/** One row that opens a settings page: icon, title (with "1 item needs you" when something waits), one status line,
|
|
380
|
+
* anything on the right, a chevron. The whole row is the link. */
|
|
381
|
+
export declare function settingsLink(options: {
|
|
382
|
+
href: string;
|
|
383
|
+
title: string;
|
|
384
|
+
status?: HtmlValue;
|
|
385
|
+
icon?: KitIcon;
|
|
386
|
+
needs?: number;
|
|
387
|
+
right?: Html;
|
|
388
|
+
}): Html;
|
|
389
|
+
/** A list of settings links under a section heading ("In this group"), or the overview's unlabelled list. */
|
|
390
|
+
export declare function settingsLinks(title: string | null, links: readonly Html[], options?: {
|
|
391
|
+
label?: string;
|
|
392
|
+
}): Html;
|
|
393
|
+
/** A record row (a session, a token, a person, a device, a provider): title and one muted line · when · one action,
|
|
394
|
+
* and anything opened under it (a form, a refusal). */
|
|
395
|
+
export declare function settingsRecord(options: {
|
|
396
|
+
title: HtmlValue;
|
|
397
|
+
sub?: HtmlValue;
|
|
398
|
+
when?: HtmlValue;
|
|
399
|
+
action?: HtmlValue;
|
|
400
|
+
more?: HtmlValue;
|
|
401
|
+
attrs?: Attrs;
|
|
402
|
+
}): Html;
|
|
403
|
+
/** A command or path to copy by hand: monospace, selectable. */
|
|
404
|
+
export declare const codeLine: (text: string) => Html;
|
|
405
|
+
export {};
|