@gramlot/gramlot 0.3.9 → 0.3.15
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/dist/components/editors/__init__.py +13 -0
- package/dist/components/{editors.js → editors/assets/collection.js} +354 -418
- package/dist/components/editors/assets/index.js +2 -0
- package/dist/components/editors/commands.json +7 -0
- package/dist/components/editors/grammar.json +7045 -0
- package/dist/components/inputs/__init__.py +13 -0
- package/dist/components/{inputs.js → inputs/assets/collection.js} +291 -200
- package/dist/components/inputs/assets/index.js +2 -0
- package/dist/components/inputs/commands.json +7 -0
- package/dist/components/inputs/grammar.json +42881 -0
- package/dist/components/layout/__init__.py +13 -0
- package/dist/components/layout/assets/collection.js +25737 -0
- package/dist/components/layout/assets/index.js +2 -0
- package/dist/components/layout/commands.json +7 -0
- package/dist/components/layout/grammar.json +1798 -0
- package/dist/components/tree/__init__.py +13 -0
- package/dist/components/{tree.js → tree/assets/collection.js} +62 -175
- package/dist/components/tree/assets/index.js +2 -0
- package/dist/components/tree/commands.json +7 -0
- package/dist/components/tree/grammar.json +339 -0
- package/dist/components/typst/__init__.py +13 -0
- package/dist/components/typst/assets/collection.js +4 -0
- package/dist/components/typst/assets/index.js +2 -0
- package/dist/components/typst/commands.json +7 -0
- package/dist/components/typst/grammar.json +81 -0
- package/dist/gramlot.js +2525 -905
- package/dist/gramlot.min.js +109 -28
- package/dist/runtime-notices.json +0 -196
- package/package.json +1 -1
- package/src/binding/ask-dialog.js +1 -1
- package/src/binding/installation.js +5 -6
- package/src/binding/remote.js +9 -2
- package/src/binding/runtime.js +12 -5
- package/src/bootstrap.d.ts +1 -1
- package/src/bootstrap.js +52 -30
- package/src/builder/binding.json +25 -0
- package/src/builder/gramlot-builder.js +16 -3
- package/src/builder/source.js +41 -4
- package/src/collection-artifact.d.ts +11 -0
- package/src/collection-artifact.js +57 -0
- package/src/commands.d.ts +9 -0
- package/src/commands.js +36 -0
- package/src/components/bases.js +1 -1
- package/src/components/border-container.js +33 -2
- package/src/components/buttons.js +84 -161
- package/src/components/choice-editor.js +31 -10
- package/src/components/database-choices.js +110 -0
- package/src/components/inputs.js +15 -2
- package/src/components/layout.js +5 -3
- package/src/components/menus.js +346 -0
- package/src/components/popup.js +15 -2
- package/src/components/registry.js +18 -3
- package/src/components/toolbar-overflow.js +181 -0
- package/src/components/tree.js +14 -4
- package/src/components/validation.js +1 -1
- package/src/components/windows.js +284 -0
- package/src/gramlot.d.ts +2 -0
- package/src/gramlot.js +4 -2
- package/src/handlers/rpc-handler.d.ts +6 -1
- package/src/handlers/rpc-handler.js +7 -2
- package/src/handlers/source-handler.d.ts +2 -1
- package/src/handlers/source-handler.js +10 -1
- package/src/index-page-styles.js +1 -1
- package/src/index-theme.js +1 -1
- package/src/index.d.ts +5 -0
- package/src/index.js +5 -0
- package/src/renderer/attributes.js +11 -2
- package/src/renderer/gramlot-html-renderer.js +1 -0
- package/src/renderer/gramlot-renderer.js +13 -3
- package/src/server/assets.js +2 -2
- package/src/server/gramlot-file-server.d.ts +2 -0
- package/src/server/gramlot-file-server.js +45 -1
- package/src/server/gramlot-server.d.ts +20 -2
- package/src/server/gramlot-server.js +86 -6
- package/src/server/page-base.js +1 -0
- package/src/server/page.d.ts +3 -0
- package/src/view/button.js +47 -3
- package/src/view/controls.js +8 -0
- package/src/view/html.js +8 -0
- package/src/view/menu-command.js +45 -0
- package/src/view/menu.js +87 -0
- package/themes/gramlot-compact/README.md +19 -0
- package/themes/gramlot-compact/theme.css +138 -45
- package/themes/joanna/README.md +19 -0
- package/themes/joanna/theme.css +134 -78
- package/themes/mela/theme.css +184 -0
- package/themes/mimi/README.md +19 -0
- package/themes/mimi/theme.css +133 -77
- package/themes/palettes/README.md +3 -0
- package/themes/palettes/compact.css +86 -0
- package/themes/palettes/joanna.css +86 -0
- package/themes/palettes/mimi.css +86 -0
- package/tools/gramlot-tools-inspector.js +3 -3
- package/dist/components/layout.js +0 -1402
- package/dist/components/typst.js +0 -4
package/src/components/tree.js
CHANGED
|
@@ -46,7 +46,7 @@ export const Tree = defineComponent({
|
|
|
46
46
|
style.textContent = `
|
|
47
47
|
.control-box{overflow:auto;padding:4px;min-height:32px}
|
|
48
48
|
ul{list-style:none;margin:0;padding:0} ul ul{padding-inline-start:20px}
|
|
49
|
-
.row{display:flex;align-items:center;min-height:var(--gramlot-tree-row-height,28px);gap:
|
|
49
|
+
.row{display:flex;align-items:center;min-height:var(--gramlot-tree-row-height,28px);gap:2px;border-radius:3px;cursor:default}
|
|
50
50
|
.row:hover{background:var(--gramlot-tree-hover-background,var(--gramlot-field-readonly-background,#f2f4f7))}
|
|
51
51
|
.canBeDropped{outline:2px solid var(--gramlot-brand-blue,#3766b5);outline-offset:-2px}
|
|
52
52
|
.cannotBeDropped{outline:2px dashed currentColor;outline-offset:-2px}.draggedItem{opacity:.75}
|
|
@@ -54,8 +54,11 @@ export const Tree = defineComponent({
|
|
|
54
54
|
color:var(--gramlot-tree-selected-color,#214f91)}
|
|
55
55
|
[role=treeitem]:focus{outline:none}
|
|
56
56
|
[role=treeitem]:focus-visible>.row{outline:2px solid var(--gramlot-brand-blue,#3766b5);outline-offset:-2px}
|
|
57
|
-
button{border:0;background:transparent;color:inherit;width:
|
|
58
|
-
.
|
|
57
|
+
button{border:0;background:transparent;color:inherit;width:max(20px,var(--gramlot-touch-target,0px));height:24px;padding:0;font:inherit;cursor:pointer}
|
|
58
|
+
.expander{display:grid;place-items:center;flex:none}
|
|
59
|
+
.expander svg{display:block;width:14px;height:14px;pointer-events:none}
|
|
60
|
+
[aria-expanded=true]>.row>.expander svg{transform:rotate(90deg)}
|
|
61
|
+
.spacer{width:max(20px,var(--gramlot-touch-target,0px));flex:none}.caption{min-width:0;overflow-wrap:anywhere}
|
|
59
62
|
.icon{width:16px;height:16px;flex:none;background:currentColor;opacity:.7;mask:center/contain no-repeat;
|
|
60
63
|
mask-image:url("data:image/svg+xml,%3Csvg xmlns='${SVG_NS}' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' d='M5 3h9l5 5v13H5zM14 3v6h5M8 13h8M8 17h8'/%3E%3C/svg%3E")}
|
|
61
64
|
.branch-icon{mask-image:url("data:image/svg+xml,%3Csvg xmlns='${SVG_NS}' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.7' d='M3 7V4h7l3 3h8v13H3z'/%3E%3C/svg%3E")}
|
|
@@ -162,6 +165,14 @@ export const Tree = defineComponent({
|
|
|
162
165
|
if (branch) {
|
|
163
166
|
expander.className = 'expander';
|
|
164
167
|
expander.type = 'button'; expander.tabIndex = -1;
|
|
168
|
+
const chevron = this.ownerDocument.createElementNS(SVG_NS, 'svg');
|
|
169
|
+
chevron.setAttribute('viewBox', '0 0 24 24');
|
|
170
|
+
chevron.setAttribute('aria-hidden', 'true'); chevron.setAttribute('focusable', 'false');
|
|
171
|
+
const chevronPath = this.ownerDocument.createElementNS(SVG_NS, 'path');
|
|
172
|
+
chevronPath.setAttribute('d', 'm9 5 7 7-7 7'); chevronPath.setAttribute('fill', 'none');
|
|
173
|
+
chevronPath.setAttribute('stroke', 'currentColor'); chevronPath.setAttribute('stroke-width', '1.8');
|
|
174
|
+
chevronPath.setAttribute('stroke-linecap', 'round'); chevronPath.setAttribute('stroke-linejoin', 'round');
|
|
175
|
+
chevron.append(chevronPath); expander.append(chevron);
|
|
165
176
|
expander.addEventListener('click', event => {
|
|
166
177
|
event.stopPropagation(); toggle(); entry.focus();
|
|
167
178
|
});
|
|
@@ -238,7 +249,6 @@ export const Tree = defineComponent({
|
|
|
238
249
|
entry.classList.toggle('closed', !opened);
|
|
239
250
|
icon.classList.toggle('opened-icon', opened);
|
|
240
251
|
icon.setAttribute('part', `icon branch-icon ${opened ? 'opened-icon' : 'closed-icon'}`);
|
|
241
|
-
expander.textContent = opened ? '▾' : '▸';
|
|
242
252
|
group.hidden = !opened;
|
|
243
253
|
present();
|
|
244
254
|
};
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import {SVG_NS} from '../renderer/attributes.js';
|
|
2
|
+
/** Shared window chrome. Source owns the frame; native dialog owns modality. */
|
|
3
|
+
import {defineComponent} from './registry.js';
|
|
4
|
+
import {projectParameters} from './parameters.js';
|
|
5
|
+
|
|
6
|
+
function WindowShell(HTMLElement) {
|
|
7
|
+
return class extends HTMLElement {
|
|
8
|
+
#context; #observer; #scheduled = false; #live = false;
|
|
9
|
+
#open = false; #collapsed = false; #maximized = false; #pending = null; #generation = 0;
|
|
10
|
+
#geometry = null; #gesture = null; #previousFocus = null;
|
|
11
|
+
#resize = () => { if (this.#open) this.#fit(); };
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
const doc = this.ownerDocument;
|
|
15
|
+
const shadow = this.attachShadow({mode:'open'});
|
|
16
|
+
const style = doc.createElement('style');
|
|
17
|
+
style.textContent = `:host{display:contents;font:inherit;color:var(--gramlot-ink,CanvasText)}
|
|
18
|
+
*,*::before,*::after{box-sizing:border-box}
|
|
19
|
+
dialog{position:fixed;inset:auto;margin:0;padding:0;border:1px solid var(--gramlot-border-control,#8793a4);
|
|
20
|
+
border-radius:var(--gramlot-window-radius,9px);color:inherit;font:inherit;
|
|
21
|
+
background:var(--gramlot-surface,Canvas);box-shadow:0 12px 40px #0005;overflow:hidden;
|
|
22
|
+
max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}
|
|
23
|
+
dialog[open]{display:flex;flex-direction:column}
|
|
24
|
+
dialog[data-maximized]{max-width:100vw;max-height:100dvh;border-radius:0}
|
|
25
|
+
dialog::backdrop{background:var(--gramlot-window-backdrop,#0006)}
|
|
26
|
+
.titlebar{display:flex;align-items:center;gap:var(--gramlot-space-2,8px);flex:none;min-height:max(28px,var(--gramlot-field-height,36px));padding:2px 4px 2px 10px;
|
|
27
|
+
background:var(--gramlot-surface-subtle,#e5e9ef);border-bottom:1px solid var(--gramlot-border-control,#8793a4)}
|
|
28
|
+
.title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:1em;font-weight:600}
|
|
29
|
+
.titlebar[data-movable]{cursor:move;touch-action:none;user-select:none}
|
|
30
|
+
button{font:inherit;color:inherit;background:transparent;border:0;border-radius:4px;cursor:pointer;min-width:max(24px,var(--gramlot-touch-target,0px));min-height:max(24px,var(--gramlot-touch-target,0px))}
|
|
31
|
+
button:hover{background:color-mix(in srgb,currentColor 12%,transparent)}
|
|
32
|
+
button:focus-visible,.titlebar:focus-visible{outline:2px solid var(--gramlot-focus-ring,Highlight);outline-offset:-2px}
|
|
33
|
+
.body{flex:1;min-height:0;min-width:0;display:flex;overflow:hidden}
|
|
34
|
+
slot{display:contents}::slotted(gramlot-frame-pane){flex:1;width:100%;height:100%;min-height:0;min-width:0}
|
|
35
|
+
.resize{position:absolute;right:0;bottom:0;width:20px;height:20px;min-width:20px;min-height:20px;
|
|
36
|
+
display:grid;place-items:end;padding:2px;cursor:nwse-resize;touch-action:none;opacity:.65}
|
|
37
|
+
.resize:hover,.resize:focus-visible{opacity:1}
|
|
38
|
+
.resize svg{width:14px;height:14px;pointer-events:none}
|
|
39
|
+
[hidden]{display:none!important}.status{flex:none;font-size:.85em;padding:4px 10px;color:var(--gramlot-error,#b22)}
|
|
40
|
+
dialog[data-collapsed] .titlebar{border-bottom:0}`;
|
|
41
|
+
this.shell = doc.createElement('dialog'); this.shell.setAttribute('aria-labelledby','title');
|
|
42
|
+
this.titlebar = doc.createElement('header'); this.titlebar.className='titlebar';
|
|
43
|
+
this.heading = doc.createElement('h2'); this.heading.id='title'; this.heading.className='title';
|
|
44
|
+
this.collapseButton = this.#button('Collapse window','−');
|
|
45
|
+
this.maximizeButton = this.#button('Maximize window','□');
|
|
46
|
+
this.closeButton = this.#button('Close window','×');
|
|
47
|
+
this.titlebar.append(this.heading,this.collapseButton,this.maximizeButton,this.closeButton);
|
|
48
|
+
this.body = doc.createElement('div');this.body.className='body';this.body.append(doc.createElement('slot'));
|
|
49
|
+
this.resizeButton = this.#button('Resize window','');this.resizeButton.className='resize';
|
|
50
|
+
const resizeIcon=doc.createElementNS(SVG_NS,'svg');
|
|
51
|
+
resizeIcon.setAttribute('viewBox','0 0 16 16');resizeIcon.setAttribute('aria-hidden','true');resizeIcon.setAttribute('focusable','false');
|
|
52
|
+
const resizePath=doc.createElementNS(SVG_NS,'path');
|
|
53
|
+
resizePath.setAttribute('d','M5 13 13 5M9 13l4-4');resizePath.setAttribute('fill','none');
|
|
54
|
+
resizePath.setAttribute('stroke','currentColor');resizePath.setAttribute('stroke-width','1.25');resizePath.setAttribute('stroke-linecap','round');
|
|
55
|
+
resizeIcon.append(resizePath);this.resizeButton.append(resizeIcon);
|
|
56
|
+
this.status = doc.createElement('div');this.status.className='status';this.status.hidden=true;this.status.setAttribute('role','alert');
|
|
57
|
+
this.shell.append(this.titlebar,this.body,this.status,this.resizeButton);shadow.append(style,this.shell);
|
|
58
|
+
this.closeButton.addEventListener('click',()=>this.requestClose('close'));
|
|
59
|
+
this.collapseButton.addEventListener('click',()=>this.#setCollapsed(!this.#collapsed,true));
|
|
60
|
+
this.maximizeButton.addEventListener('click',()=>this.#setMaximized(!this.#maximized,true));
|
|
61
|
+
this.shell.addEventListener('cancel',event=>{event.preventDefault();this.requestClose('escape');});
|
|
62
|
+
this.shell.addEventListener('keydown',event=>{
|
|
63
|
+
if(!this.modal && event.key==='Escape' && !event.defaultPrevented){event.preventDefault();this.requestClose('escape');}
|
|
64
|
+
});
|
|
65
|
+
this.shell.addEventListener('focusin',()=>this.#raise());
|
|
66
|
+
this.shell.addEventListener('pointerdown',()=>this.#raise());
|
|
67
|
+
for (const [handle,kind] of [[this.titlebar,'move'],[this.resizeButton,'resize']]) {
|
|
68
|
+
handle.addEventListener('pointerdown',event=>this.#startGesture(event,kind));
|
|
69
|
+
handle.addEventListener('pointermove',event=>this.#moveGesture(event));
|
|
70
|
+
handle.addEventListener('pointerup',event=>this.#endGesture(event,true));
|
|
71
|
+
handle.addEventListener('pointercancel',event=>this.#endGesture(event,false));
|
|
72
|
+
handle.addEventListener('lostpointercapture',event=>this.#endGesture(event,false));
|
|
73
|
+
handle.addEventListener('keydown',event=>this.#keyGeometry(event,kind));
|
|
74
|
+
}
|
|
75
|
+
this.#observer=new doc.defaultView.MutationObserver(()=>this.#schedule());
|
|
76
|
+
}
|
|
77
|
+
#button(label,text) { const b=this.ownerDocument.createElement('button');b.type='button';b.textContent=text;b.setAttribute('aria-label',label);b.title=label;return b; }
|
|
78
|
+
get modal() { return this.constructor.gramlotComponent.name==='dialog'; }
|
|
79
|
+
get opened() { return this.#open; }
|
|
80
|
+
setSourceContext(context) { this.#context=context; }
|
|
81
|
+
connectedCallback() {
|
|
82
|
+
this.#live=true;this.#observer.observe(this,{childList:true});
|
|
83
|
+
this.ownerDocument.defaultView.addEventListener('resize',this.#resize);this.#schedule();
|
|
84
|
+
}
|
|
85
|
+
disconnectedCallback() {
|
|
86
|
+
this.#live=false;this.#generation++;this.#pending=null;this.#observer.disconnect();
|
|
87
|
+
this.ownerDocument.defaultView.removeEventListener('resize',this.#resize);this.#cancelGesture();
|
|
88
|
+
if(this.shell.open)this.shell.close();this.#open=false;this.#restoreFocus();
|
|
89
|
+
}
|
|
90
|
+
projectAttributes(attrs) {
|
|
91
|
+
const previous=this.parameters;
|
|
92
|
+
const rest=projectParameters(this,attrs);
|
|
93
|
+
if(previous) {
|
|
94
|
+
if(['width','height','left','top','minWidth','minHeight'].some(name=>previous[name]!==this.parameters[name])) {
|
|
95
|
+
this.#cancelGesture();this.#geometry=null;this.#collapsed=false;this.#maximized=false;
|
|
96
|
+
}
|
|
97
|
+
if(previous.open!==this.parameters.open) { this.#generation++;this.#pending=null; }
|
|
98
|
+
if(previous.movable!==this.parameters.movable || previous.resizable!==this.parameters.resizable)this.#cancelGesture();
|
|
99
|
+
}
|
|
100
|
+
this.#schedule();return rest;
|
|
101
|
+
}
|
|
102
|
+
#schedule() {
|
|
103
|
+
if(this.#scheduled)return;this.#scheduled=true;
|
|
104
|
+
queueMicrotask(()=>{this.#scheduled=false;if(this.#live&&this.isConnected&&this.parameters)this.#sync();});
|
|
105
|
+
}
|
|
106
|
+
#sync() {
|
|
107
|
+
if(this.children.length!==1 || this.firstElementChild.localName!=='gramlot-frame-pane')throw new TypeError('A window requires exactly one framePane child');
|
|
108
|
+
const p=this.parameters;
|
|
109
|
+
this.heading.textContent=p.title;this.shell.setAttribute('aria-label',p.title);
|
|
110
|
+
this.closeButton.hidden=!p.closable;this.closeButton.disabled=Boolean(this.#pending);
|
|
111
|
+
this.collapseButton.hidden=!p.collapsible;this.maximizeButton.hidden=!p.maximizable;
|
|
112
|
+
if(!p.open) { this.#close(false);return; }
|
|
113
|
+
if(!this.#open) {
|
|
114
|
+
this.#previousFocus=this.#activeElement();
|
|
115
|
+
this.#collapsed=false;this.#maximized=false;this.body.hidden=false;this.shell.removeAttribute('data-collapsed');
|
|
116
|
+
if(this.modal)this.shell.showModal();else this.shell.show();
|
|
117
|
+
this.#open=true;this.#applySize();this.#fit();this.#raise();
|
|
118
|
+
this.#context.publish('opened',{});
|
|
119
|
+
} else if(!this.#geometry) { this.#applySize();this.#fit(); }
|
|
120
|
+
this.#setMaximized(p.maximizable&&p.maximized,false);
|
|
121
|
+
this.#setCollapsed(p.collapsible&&p.collapsed,false);
|
|
122
|
+
if(!p.maximizable && p.maximized)this.#context.writeParameter('maximized',false);
|
|
123
|
+
if(!p.collapsible && p.collapsed)this.#context.writeParameter('collapsed',false);
|
|
124
|
+
}
|
|
125
|
+
#activeElement() { let active=this.ownerDocument.activeElement;while(active?.shadowRoot?.activeElement)active=active.shadowRoot.activeElement;return active; }
|
|
126
|
+
#restoreFocus() { const previous=this.#previousFocus;this.#previousFocus=null;if(previous?.isConnected)previous.focus({preventScroll:true}); }
|
|
127
|
+
#applySize() {
|
|
128
|
+
const p=this.parameters,s=this.shell.style;
|
|
129
|
+
this.shell.removeAttribute('data-maximized');
|
|
130
|
+
s.width=p.width??'var(--gramlot-window-width,36rem)';s.height=p.height??'var(--gramlot-window-height,24rem)';
|
|
131
|
+
s.minWidth=p.minWidth??'min(220px, calc(100vw - 16px))';s.minHeight=p.minHeight??'min(140px, calc(100dvh - 16px))';
|
|
132
|
+
s.left=p.left??'0px';s.top=p.top??'0px';
|
|
133
|
+
if(this.#geometry){this.#paint(this.#geometry);return;}
|
|
134
|
+
if(!this.#geometry) {
|
|
135
|
+
const r=this.shell.getBoundingClientRect(),w=this.ownerDocument.defaultView;
|
|
136
|
+
if(p.left==null)s.left=`${Math.max(8,(w.document.documentElement.clientWidth-r.width)/2)}px`;
|
|
137
|
+
if(p.top==null)s.top=`${Math.max(8,(w.document.documentElement.clientHeight-r.height)/2)}px`;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
#fit() {
|
|
141
|
+
if(this.#maximized){this.#renderGeometry();return;}
|
|
142
|
+
const r=this.shell.getBoundingClientRect(),w=this.ownerDocument.defaultView;
|
|
143
|
+
const width=Math.min(r.width,Math.max(0,w.document.documentElement.clientWidth-16)),height=Math.min(r.height,Math.max(0,w.document.documentElement.clientHeight-16));
|
|
144
|
+
const rect={left:Math.max(8,Math.min(r.left,w.document.documentElement.clientWidth-width-8)),top:Math.max(8,Math.min(r.top,w.document.documentElement.clientHeight-height-8)),width,height};
|
|
145
|
+
this.#paint(rect);if(!this.#collapsed)this.#geometry=rect;
|
|
146
|
+
else this.#geometry={...this.#geometry,left:rect.left,top:rect.top,width:rect.width};
|
|
147
|
+
}
|
|
148
|
+
#paint(rect) { for(const key of ['left','top','width','height'])this.shell.style[key]=`${rect[key]}px`; }
|
|
149
|
+
#raise() {
|
|
150
|
+
if(this.modal||!this.#open)return;
|
|
151
|
+
// Reserve the page's low stacking levels for layout chrome (splitters/drawers).
|
|
152
|
+
// Modal dialogs and menu popovers remain above these nonmodal windows in the top layer.
|
|
153
|
+
const base=100;
|
|
154
|
+
const peers=[...this.getRootNode().querySelectorAll('gramlot-floating-pane')].filter(n=>n.opened&&n!==this);
|
|
155
|
+
peers.sort((a,b)=>Number(a.shell.style.zIndex)-Number(b.shell.style.zIndex)).forEach((n,i)=>n.shell.style.zIndex=String(base+i));
|
|
156
|
+
this.shell.style.zIndex=String(base+peers.length);
|
|
157
|
+
}
|
|
158
|
+
// #geometry always holds the normal expanded rectangle, never viewport size.
|
|
159
|
+
#renderGeometry() {
|
|
160
|
+
const viewport=this.ownerDocument.documentElement;
|
|
161
|
+
const rect=this.#maximized?{left:0,top:0,width:viewport.clientWidth,height:viewport.clientHeight}:{...this.#geometry};
|
|
162
|
+
if(this.#collapsed)rect.height=this.titlebar.getBoundingClientRect().height+2;
|
|
163
|
+
this.shell.toggleAttribute('data-maximized',this.#maximized);
|
|
164
|
+
this.shell.style.minWidth=this.#maximized?'0':this.parameters.minWidth??'min(220px, calc(100vw - 16px))';
|
|
165
|
+
this.shell.style.minHeight=this.#collapsed||this.#maximized?'0':this.parameters.minHeight??'min(140px, calc(100dvh - 16px))';
|
|
166
|
+
this.#paint(rect);
|
|
167
|
+
const movable=this.parameters.movable&&!this.#maximized;
|
|
168
|
+
this.titlebar.toggleAttribute('data-movable',movable);this.titlebar.tabIndex=movable?0:-1;
|
|
169
|
+
this.titlebar.setAttribute('aria-label',movable?'Move window: use arrow keys':this.parameters.title);
|
|
170
|
+
this.resizeButton.hidden=this.#collapsed||this.#maximized||!this.parameters.resizable;
|
|
171
|
+
}
|
|
172
|
+
#setMaximized(value,write) {
|
|
173
|
+
if(!this.#open)return;
|
|
174
|
+
if(value!==this.#maximized){this.#cancelGesture();this.#maximized=value;}
|
|
175
|
+
this.#renderGeometry();
|
|
176
|
+
if(!value)this.#fit();
|
|
177
|
+
this.maximizeButton.textContent=value?'❐':'□';
|
|
178
|
+
this.maximizeButton.setAttribute('aria-label',value?'Restore size':'Maximize window');
|
|
179
|
+
this.maximizeButton.title=value?'Restore size':'Maximize window';
|
|
180
|
+
this.maximizeButton.setAttribute('aria-pressed',String(value));
|
|
181
|
+
if(write){this.parameters.maximized=value;this.#context.writeParameter('maximized',value);}
|
|
182
|
+
}
|
|
183
|
+
#setCollapsed(value,write) {
|
|
184
|
+
if(!this.#open)return;
|
|
185
|
+
if(value!==this.#collapsed) {
|
|
186
|
+
this.#cancelGesture();
|
|
187
|
+
if(value && this.body.contains(this.#activeElement()))this.collapseButton.focus();
|
|
188
|
+
this.#collapsed=value;
|
|
189
|
+
}
|
|
190
|
+
this.body.hidden=value;
|
|
191
|
+
this.shell.toggleAttribute('data-collapsed',value);this.collapseButton.textContent=value?'+':'−';
|
|
192
|
+
this.collapseButton.setAttribute('aria-label',value?'Expand window':'Collapse window');
|
|
193
|
+
this.collapseButton.title=value?'Expand window':'Collapse window';
|
|
194
|
+
this.collapseButton.setAttribute('aria-expanded',String(!value));
|
|
195
|
+
this.#renderGeometry();this.#fit();
|
|
196
|
+
if(write){this.parameters.collapsed=value;this.#context.writeParameter('collapsed',value);}
|
|
197
|
+
}
|
|
198
|
+
async requestClose(reason='application') {
|
|
199
|
+
if(!this.#open || (!this.parameters.closable&&reason!=='application'))return false;
|
|
200
|
+
if(this.#pending)return this.#pending;
|
|
201
|
+
const generation=this.#generation;
|
|
202
|
+
this.status.hidden=true;
|
|
203
|
+
const run=async()=>{
|
|
204
|
+
try {
|
|
205
|
+
const accepted=this.parameters.beforeClose?await this.#context.callLogic(this.parameters.beforeClose,{reason}):true;
|
|
206
|
+
if(typeof accepted!=='boolean')throw new TypeError('beforeClose must return a boolean');
|
|
207
|
+
if(!this.#live||generation!==this.#generation||!this.#open)return false;
|
|
208
|
+
if(accepted)this.#close(true);return accepted;
|
|
209
|
+
} catch(error) {
|
|
210
|
+
if(this.#live&&generation===this.#generation){this.status.textContent='Unable to close: '+error.message;this.status.hidden=false;this.ownerDocument.defaultView.console.error(error);}
|
|
211
|
+
return false;
|
|
212
|
+
} finally {if(generation===this.#generation){this.#pending=null;this.closeButton.disabled=false;this.shell.removeAttribute('aria-busy');}}
|
|
213
|
+
};
|
|
214
|
+
this.closeButton.disabled=true;this.shell.setAttribute('aria-busy','true');
|
|
215
|
+
// Start after assigning the pending request, also for a synchronous guard.
|
|
216
|
+
this.#pending=Promise.resolve().then(run);return this.#pending;
|
|
217
|
+
}
|
|
218
|
+
#close(write) {
|
|
219
|
+
if(!this.#open)return;
|
|
220
|
+
this.#generation++;this.#pending=null;this.#cancelGesture();this.#open=false;
|
|
221
|
+
if(this.shell.open)this.shell.close();this.shell.removeAttribute('aria-busy');this.closeButton.disabled=false;
|
|
222
|
+
this.#restoreFocus();
|
|
223
|
+
if(write){this.parameters.open=false;this.#context.writeParameter('open',false);}
|
|
224
|
+
this.#context.publish('closed',{});
|
|
225
|
+
}
|
|
226
|
+
#startGesture(event,kind) {
|
|
227
|
+
if(event.button!==0||!this.#open||this.#maximized||kind==='move'&&!this.parameters.movable||kind==='resize'&&(!this.parameters.resizable||this.#collapsed))return;
|
|
228
|
+
if(kind==='move'&&event.target.closest('button'))return;
|
|
229
|
+
event.preventDefault();this.#cancelGesture();
|
|
230
|
+
const r=this.shell.getBoundingClientRect();
|
|
231
|
+
this.#gesture={kind,id:event.pointerId,handle:event.currentTarget,x:event.clientX,y:event.clientY,rect:{left:r.left,top:r.top,width:r.width,height:r.height}};
|
|
232
|
+
event.currentTarget.setPointerCapture(event.pointerId);event.currentTarget.focus();
|
|
233
|
+
}
|
|
234
|
+
#moveGesture(event) {
|
|
235
|
+
const g=this.#gesture;if(!g||g.id!==event.pointerId)return;
|
|
236
|
+
this.#adjust(g.rect,event.clientX-g.x,event.clientY-g.y,g.kind);
|
|
237
|
+
}
|
|
238
|
+
#adjust(start,dx,dy,kind) {
|
|
239
|
+
const rect={...start},w=this.ownerDocument.defaultView;
|
|
240
|
+
if(kind==='move'){rect.left+=dx;rect.top+=dy;}
|
|
241
|
+
else {
|
|
242
|
+
const style=w.getComputedStyle(this.shell);
|
|
243
|
+
rect.width=Math.max(parseFloat(style.minWidth)||0,rect.width+dx);
|
|
244
|
+
rect.height=Math.max(parseFloat(style.minHeight)||0,rect.height+dy);
|
|
245
|
+
}
|
|
246
|
+
rect.width=Math.min(rect.width,Math.max(0,w.document.documentElement.clientWidth-16));rect.height=Math.min(rect.height,Math.max(0,w.document.documentElement.clientHeight-16));
|
|
247
|
+
rect.left=Math.max(8,Math.min(rect.left,w.document.documentElement.clientWidth-rect.width-8));rect.top=Math.max(8,Math.min(rect.top,w.document.documentElement.clientHeight-rect.height-8));
|
|
248
|
+
this.#paint(rect);
|
|
249
|
+
if(this.#collapsed){this.#geometry={...this.#geometry,left:rect.left,top:rect.top,width:rect.width};}
|
|
250
|
+
else this.#geometry=rect;
|
|
251
|
+
}
|
|
252
|
+
#endGesture(event,commit) {
|
|
253
|
+
const g=this.#gesture;if(!g||g.id!==event.pointerId)return;
|
|
254
|
+
this.#gesture=null;if(g.handle.hasPointerCapture(g.id))g.handle.releasePointerCapture(g.id);
|
|
255
|
+
if(commit)this.#commitGeometry(g.kind);else {this.#paint(g.rect);if(!this.#collapsed)this.#geometry=g.rect;else this.#geometry={...this.#geometry,left:g.rect.left,top:g.rect.top,width:g.rect.width};}
|
|
256
|
+
}
|
|
257
|
+
#cancelGesture() { if(this.#gesture)this.#endGesture({pointerId:this.#gesture.id},false); }
|
|
258
|
+
#commitGeometry(kind) {
|
|
259
|
+
const r=this.shell.getBoundingClientRect();
|
|
260
|
+
for(const key of kind==='move'?['left','top']:['width','height']) {
|
|
261
|
+
const value=`${r[key]}px`;this.#context.writeParameter(key,value);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
#keyGeometry(event,kind) {
|
|
265
|
+
if(event.target!==event.currentTarget||!['ArrowLeft','ArrowRight','ArrowUp','ArrowDown'].includes(event.key))return;
|
|
266
|
+
if(this.#maximized||kind==='move'&&!this.parameters.movable||kind==='resize'&&(!this.parameters.resizable||this.#collapsed))return;
|
|
267
|
+
event.preventDefault();event.stopPropagation();
|
|
268
|
+
const r=this.shell.getBoundingClientRect(),step=event.shiftKey?1:10;
|
|
269
|
+
this.#adjust({left:r.left,top:r.top,width:r.width,height:r.height},event.key==='ArrowLeft'?-step:event.key==='ArrowRight'?step:0,event.key==='ArrowUp'?-step:event.key==='ArrowDown'?step:0,kind);
|
|
270
|
+
this.#commitGeometry(kind);
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
const bool=(value,binding='read')=>({dtype:'B',default:value,binding});
|
|
275
|
+
WindowShell.parameters={
|
|
276
|
+
title:{dtype:'T',default:'',binding:'read'},open:bool(false,'twoWay'),collapsed:bool(false,'twoWay'),closable:bool(true),
|
|
277
|
+
movable:bool(false),resizable:bool(false),collapsible:bool(false),maximizable:bool(false),maximized:bool(false,'twoWay'),
|
|
278
|
+
beforeClose:{dtype:'T',nullable:true},
|
|
279
|
+
...Object.fromEntries(['width','height','left','top'].map(name=>[name,{dtype:'T',nullable:true,binding:'twoWay'}])),
|
|
280
|
+
...Object.fromEntries(['minWidth','minHeight'].map(name=>[name,{dtype:'T',nullable:true,binding:'read'}])),
|
|
281
|
+
};
|
|
282
|
+
export const Dialog=defineComponent({name:'dialog',tag:'gramlot-dialog',base:WindowShell,sourceContext:true,subTags:'framePane',implementation:Base=>class extends Base{}});
|
|
283
|
+
export const FloatingPane=defineComponent({name:'floatingPane',tag:'gramlot-floating-pane',base:WindowShell,sourceContext:true,subTags:'framePane',
|
|
284
|
+
parameters:{movable:bool(true),resizable:bool(true),collapsible:bool(true)},implementation:Base=>class extends Base{}});
|
package/src/gramlot.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type {CommandRegistry} from './commands.js';
|
|
1
2
|
/**
|
|
2
3
|
* One Gramlot page in the browser.
|
|
3
4
|
*
|
|
@@ -72,6 +73,7 @@ export type Publication = string | {topic: string; nodeId: string} |
|
|
|
72
73
|
|
|
73
74
|
/** One Gramlot page: lifecycle, Data and the four proxies `src`, `rpc`, `dom`, `utl`. */
|
|
74
75
|
export class Gramlot {
|
|
76
|
+
readonly commands: CommandRegistry;
|
|
75
77
|
readonly devices: readonly ('desktop' | 'tablet' | 'phone')[];
|
|
76
78
|
locale: string;
|
|
77
79
|
timeZone: string;
|
package/src/gramlot.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
+
import {CommandRegistry} from './commands.js';
|
|
7
8
|
import {ServerAdapter} from './server-adapter.js';
|
|
8
9
|
import {NAME_SYNTAX, NameSyntax} from './builder/name-syntax.js';
|
|
9
10
|
import {SourceHandler} from './handlers/source-handler.js';
|
|
@@ -29,6 +30,7 @@ export class Gramlot {
|
|
|
29
30
|
for (const collection of collections) {
|
|
30
31
|
if (collection instanceof ComponentCollection) collection.register(document.defaultView);
|
|
31
32
|
}
|
|
33
|
+
this.commands = new CommandRegistry();
|
|
32
34
|
this.pageId = pageId;
|
|
33
35
|
const browserContext = locale == null || timeZone == null
|
|
34
36
|
? document.defaultView.Intl.DateTimeFormat().resolvedOptions() : null;
|
|
@@ -71,7 +73,7 @@ export class Gramlot {
|
|
|
71
73
|
async loadMain() {
|
|
72
74
|
let wire;
|
|
73
75
|
try {
|
|
74
|
-
wire = await this.rpc.
|
|
76
|
+
wire = await this.rpc.callEnvelope('source', 'main');
|
|
75
77
|
} catch (error) {
|
|
76
78
|
// The dispose aborts the call at once (RpcHandler.call): the start rejects naming the dispose.
|
|
77
79
|
if (this.state === 'disposed') throw new Error('Gramlot was disposed during main', {cause: error});
|
|
@@ -80,7 +82,7 @@ export class Gramlot {
|
|
|
80
82
|
}
|
|
81
83
|
if (this.state === 'disposed') throw new Error('Gramlot was disposed during main');
|
|
82
84
|
try {
|
|
83
|
-
return this.src.mountMainSource(wire);
|
|
85
|
+
return this.src.mountMainSource(wire.value, wire.data);
|
|
84
86
|
} catch (error) {
|
|
85
87
|
if (this.state !== 'disposed') this.state = 'failed';
|
|
86
88
|
throw error;
|
|
@@ -66,6 +66,11 @@ export class RpcHandler extends Handler {
|
|
|
66
66
|
options?: {signal?: AbortSignal}): Promise<unknown>;
|
|
67
67
|
/** Whether the transport sends a synchronous call (`supportsCallSync`). */
|
|
68
68
|
readonly supportsCallSync: boolean;
|
|
69
|
-
/**
|
|
69
|
+
/** Return the checked response envelope, including optional initial-main Data. */
|
|
70
|
+
callEnvelope(contentType: 'source' | 'data', name: string, params?: Record<string, unknown>,
|
|
71
|
+
options?: {signal?: AbortSignal | null}): Promise<{
|
|
72
|
+
id: string; contentType: string; value: unknown; data?: import('@genrojs/bag').Bag;
|
|
73
|
+
}>;
|
|
74
|
+
/** Send one envelope synchronously; only with a transport that supports it. */
|
|
70
75
|
callSync(contentType: 'source' | 'data', name: string, params?: Record<string, unknown>): unknown;
|
|
71
76
|
}
|
|
@@ -59,7 +59,12 @@ export class RpcHandler extends Handler {
|
|
|
59
59
|
return response.value;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
async call(contentType, name, params = {},
|
|
62
|
+
async call(contentType, name, params = {}, options = {}) {
|
|
63
|
+
return (await this.callEnvelope(contentType, name, params, options)).value;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Return the checked response envelope, including optional initial-main Data. */
|
|
67
|
+
async callEnvelope(contentType, name, params = {}, {signal = null} = {}) {
|
|
63
68
|
if (!this.transport?.call) throw new Error(`rpc '${name}' is unavailable without a server transport`);
|
|
64
69
|
assertTransportData(params);
|
|
65
70
|
const id = randomId();
|
|
@@ -82,7 +87,7 @@ export class RpcHandler extends Handler {
|
|
|
82
87
|
const response = fromTytx(await Promise.race([this.transport.call(text, controller.signal), aborted]));
|
|
83
88
|
if (response.id !== id) throw new Error('rpc response id mismatch');
|
|
84
89
|
if (response.error) throw new RpcError(response.error);
|
|
85
|
-
return response
|
|
90
|
+
return response;
|
|
86
91
|
} finally {
|
|
87
92
|
this.remoteRequests.delete(id);
|
|
88
93
|
for (const source of sources) source.removeEventListener('abort', forward);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
+
import type {Bag} from '@genrojs/bag';
|
|
6
7
|
import type {SourceBag, SourceBagNode} from '@genrojs/builders';
|
|
7
8
|
import type {DomElement} from '../dom.d.ts';
|
|
8
9
|
import type {Gramlot} from '../gramlot.js';
|
|
@@ -35,7 +36,7 @@ export class SourceHandler extends Handler {
|
|
|
35
36
|
/** Start from an embedded typed Source, with the same observed insertion as `main`. */
|
|
36
37
|
startSource(wire: SourceBag | string): Gramlot;
|
|
37
38
|
/** Validate and insert `main` in the Source. */
|
|
38
|
-
mountMainSource(wire: SourceBag | string): Gramlot;
|
|
39
|
+
mountMainSource(wire: SourceBag | string, initialData?: Bag | null): Gramlot;
|
|
39
40
|
/**
|
|
40
41
|
* A Source from a SourceBag or a TYTX wire; only Gramlot Source Bags are accepted, before any
|
|
41
42
|
* effect. The received Source activates its inline code.
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
+
import {Bag} from '@genrojs/bag';
|
|
7
8
|
import {SourceBag, sourceBagFromTytx} from '@genrojs/builders';
|
|
8
9
|
import {Handler} from './handler.js';
|
|
9
10
|
import {GramlotBuilder} from '../builder/gramlot-builder.js';
|
|
@@ -44,9 +45,17 @@ export class SourceHandler extends Handler {
|
|
|
44
45
|
* new one; the Data is not rolled back. A later error (`_init`, DOM) keeps `main` and its
|
|
45
46
|
* NodeBindings (P12, no rollback).
|
|
46
47
|
*/
|
|
47
|
-
mountMainSource(wire) {
|
|
48
|
+
mountMainSource(wire, initialData = null) {
|
|
48
49
|
const source = this.prepareSource(wire);
|
|
49
50
|
this.renderer.validateCandidate(source);
|
|
51
|
+
if (initialData !== null) {
|
|
52
|
+
if (!(initialData instanceof Bag) || initialData instanceof SourceBag) {
|
|
53
|
+
throw new TypeError('Initial page data must be a Data Bag');
|
|
54
|
+
}
|
|
55
|
+
for (const node of initialData.getNodes()) {
|
|
56
|
+
this.builder.data.setItem([node.label], node.getValue(), node.attr, '>', false, false);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
50
59
|
try {
|
|
51
60
|
this.source.setItem('main', source);
|
|
52
61
|
} catch (error) {
|
package/src/index-page-styles.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated from canonical themes; edit themes/, not this file.
|
|
2
|
-
export const appearanceStyles = {"base":"","compact":"/* Gramlot Compact: load after gramlot-base/theme.css. Colors and behavior stay in Base. */\n@layer gramlot.tokens {\n :root {\n --gramlot-field-height: 28px;\n --gramlot-field-line-height: 1.35;\n --gramlot-field-padding: .25rem .5rem;\n --gramlot-field-font-size: 1rem;\n --gramlot-space-1: .2rem;\n --gramlot-space-2: .4rem;\n --gramlot-space-3: .5rem;\n --gramlot-space-4: .6rem;\n --gramlot-space-6: .9rem;\n --gramlot-space-8: 1.2rem;\n --gramlot-space-12: 1.8rem;\n --gramlot-radius-sm: .25rem;\n --gramlot-radius: .35rem;\n --gramlot-radius-lg: .4rem;\n }\n}\n\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.35; }\n :where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, blockquote, pre, figure) { margin-block: 0 .5rem; }\n h1 { font-size: 1.35rem; }\n h2 { font-size: 1.15rem; }\n h3 { font-size: 1.05rem; }\n pre { padding: .5rem; }\n blockquote { padding-inline-start: .6rem; }\n hr { margin-block: 1rem; }\n}\n\n@layer gramlot.components {\n :where(button, input[type=\"button\"], input[type=\"submit\"], input[type=\"reset\"], .button) {\n min-block-size: 28px;\n padding: .25rem .5rem;\n font-size: 1rem;\n line-height: 1.35;\n }\n :where(label) { font-size: .95rem; }\n :where(input:not([type=\"button\"]):not([type=\"submit\"]):not([type=\"reset\"]):not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"range\"]):not([type=\"color\"]):not([type=\"file\"]):not([type=\"hidden\"]), select, textarea) {\n min-block-size: var(--gramlot-field-height);\n padding: var(--gramlot-field-padding);\n font-size: var(--gramlot-field-font-size);\n line-height: var(--gramlot-field-line-height);\n }\n :where(textarea) { min-block-size: 5rem; }\n :where(input[type=\"color\"]) { min-block-size: 28px; }\n :where(input[type=\"file\"])::file-selector-button { margin-inline-end: .5rem; padding: .25rem .5rem; }\n :where(fieldset) { margin-block-end: .6rem; padding: .5rem; }\n :where(table) { font-size: 1rem; }\n :where(th, td) { padding: .4rem .5rem; }\n :where(details) { padding: .4rem .5rem; }\n :where(details[open] > summary) { margin-block-end: .5rem; }\n :where(dialog) { padding: .75rem; }\n}\n\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 1.2rem, var(--gramlot-page-width)); padding-block: .6rem; }\n .card { padding: .6rem; box-shadow: none; }\n}\n","mimi":"/* Gramlot Compact: load after gramlot-base/theme.css. Colors and behavior stay in Base. */\n@layer gramlot.tokens {\n :root {\n --gramlot-field-height: 28px;\n --gramlot-field-line-height: 1.35;\n --gramlot-field-padding: .25rem .5rem;\n --gramlot-field-font-size: 1rem;\n --gramlot-space-1: .2rem;\n --gramlot-space-2: .4rem;\n --gramlot-space-3: .5rem;\n --gramlot-space-4: .6rem;\n --gramlot-space-6: .9rem;\n --gramlot-space-8: 1.2rem;\n --gramlot-space-12: 1.8rem;\n --gramlot-radius-sm: .25rem;\n --gramlot-radius: .35rem;\n --gramlot-radius-lg: .4rem;\n }\n}\n\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.35; }\n :where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, blockquote, pre, figure) { margin-block: 0 .5rem; }\n h1 { font-size: 1.35rem; }\n h2 { font-size: 1.15rem; }\n h3 { font-size: 1.05rem; }\n pre { padding: .5rem; }\n blockquote { padding-inline-start: .6rem; }\n hr { margin-block: 1rem; }\n}\n\n@layer gramlot.components {\n :where(button, input[type=\"button\"], input[type=\"submit\"], input[type=\"reset\"], .button) {\n min-block-size: 28px;\n padding: .25rem .5rem;\n font-size: 1rem;\n line-height: 1.35;\n }\n :where(label) { font-size: .95rem; }\n :where(input:not([type=\"button\"]):not([type=\"submit\"]):not([type=\"reset\"]):not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"range\"]):not([type=\"color\"]):not([type=\"file\"]):not([type=\"hidden\"]), select, textarea) {\n min-block-size: var(--gramlot-field-height);\n padding: var(--gramlot-field-padding);\n font-size: var(--gramlot-field-font-size);\n line-height: var(--gramlot-field-line-height);\n }\n :where(textarea) { min-block-size: 5rem; }\n :where(input[type=\"color\"]) { min-block-size: 28px; }\n :where(input[type=\"file\"])::file-selector-button { margin-inline-end: .5rem; padding: .25rem .5rem; }\n :where(fieldset) { margin-block-end: .6rem; padding: .5rem; }\n :where(table) { font-size: 1rem; }\n :where(th, td) { padding: .4rem .5rem; }\n :where(details) { padding: .4rem .5rem; }\n :where(details[open] > summary) { margin-block-end: .5rem; }\n :where(dialog) { padding: .75rem; }\n}\n\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 1.2rem, var(--gramlot-page-width)); padding-block: .6rem; }\n .card { padding: .6rem; box-shadow: none; }\n}\n\n/* Gramlot adaptation of legacy mimi; load after Base and Compact. */\n@layer gramlot.tokens {\n :root {\n --gramlot-tab-height: 24px;\n --gramlot-tab-padding: 3px 10px;\n --gramlot-tab-radius: 3px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 3px;\n --gramlot-tab-background: var(--gramlot-background);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-ink);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-background: #EDEEF0;\n --gramlot-surface: #F5F5F6;\n --gramlot-surface-subtle: #E0E1E3;\n --gramlot-ink: #3C3D40;\n --gramlot-text-secondary: #6B6E72;\n --gramlot-border: #BDBFC2;\n --gramlot-border-control: #9EA0A3;\n --gramlot-navigation: #48494C;\n --gramlot-navigation-text: #FFFFFF;\n --gramlot-action: #0071E3;\n --gramlot-action-hover: #005BBB;\n --gramlot-brand-blue: #0071E3;\n --gramlot-brand-yellow: #9EA0A3;\n --gramlot-selected: #E8F1FC;\n --gramlot-focus-ring: #0071E3;\n --gramlot-field-background: #FFFFFF;\n --gramlot-field-readonly-background: #E0E1E3;\n --gramlot-error: #B3261E;\n --gramlot-error-background: #FFF1F0;\n --gramlot-shadow: 0 1px 4px rgb(0 0 0 / 6%);\n --gramlot-radius-sm: 4px;\n --gramlot-radius: 3px;\n --gramlot-radius-lg: 3px;\n --gramlot-field-height: 18px;\n --gramlot-field-padding: 1px 3px;\n --gramlot-field-line-height: 1.15;\n --gramlot-field-font-size: 1rem;\n --gramlot-label-size: .9em;\n --gramlot-label-gap: 2px;\n --gramlot-label-color: var(--gramlot-text-secondary);\n --gramlot-space-4: 6px;\n --gramlot-font-ui: -apple-system, BlinkMacSystemFont, \"Helvetica Neue\", Arial, sans-serif;\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n --gramlot-background: #242527;\n --gramlot-surface: #303134;\n --gramlot-surface-subtle: #3C3D40;\n --gramlot-ink: #F2F2F7;\n --gramlot-text-secondary: #C7C7CC;\n --gramlot-border: #6B6E72;\n --gramlot-border-control: #8E8E93;\n --gramlot-navigation: #1C1C1E;\n --gramlot-action: #78B7FF;\n --gramlot-action-hover: #A6CFFF;\n --gramlot-brand-blue: #3478CA;\n --gramlot-selected: #254163;\n --gramlot-focus-ring: #78B7FF;\n --gramlot-field-background: #202124;\n --gramlot-field-readonly-background: #3C3D40;\n --gramlot-error: #FFB4AB;\n --gramlot-error-background: #482524;\n --gramlot-shadow: 0 1px 4px rgb(0 0 0 / 20%);\n }\n }\n :root[data-theme=\"dark\"] {\n --gramlot-background: #242527;\n --gramlot-surface: #303134;\n --gramlot-surface-subtle: #3C3D40;\n --gramlot-ink: #F2F2F7;\n --gramlot-text-secondary: #C7C7CC;\n --gramlot-border: #6B6E72;\n --gramlot-border-control: #8E8E93;\n --gramlot-navigation: #1C1C1E;\n --gramlot-action: #78B7FF;\n --gramlot-action-hover: #A6CFFF;\n --gramlot-brand-blue: #3478CA;\n --gramlot-selected: #254163;\n --gramlot-focus-ring: #78B7FF;\n --gramlot-field-background: #202124;\n --gramlot-field-readonly-background: #3C3D40;\n --gramlot-error: #FFB4AB;\n --gramlot-error-background: #482524;\n --gramlot-shadow: 0 1px 4px rgb(0 0 0 / 20%);\n }\n}\n@layer gramlot.base {\n html { font-size: 12px; }\n}\n@layer gramlot.components {\n :where(label) { font-size: var(--gramlot-label-size); font-weight: normal; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(button, input[type=\"button\"], input[type=\"submit\"], input[type=\"reset\"], .button) { min-block-size: 24px; padding: 2px 8px; font-weight: 500; }\n}\n@layer gramlot.utilities {\n .card { box-shadow: var(--gramlot-shadow); }\n}\n","joanna":"/* Gramlot Compact: load after gramlot-base/theme.css. Colors and behavior stay in Base. */\n@layer gramlot.tokens {\n :root {\n --gramlot-field-height: 28px;\n --gramlot-field-line-height: 1.35;\n --gramlot-field-padding: .25rem .5rem;\n --gramlot-field-font-size: 1rem;\n --gramlot-space-1: .2rem;\n --gramlot-space-2: .4rem;\n --gramlot-space-3: .5rem;\n --gramlot-space-4: .6rem;\n --gramlot-space-6: .9rem;\n --gramlot-space-8: 1.2rem;\n --gramlot-space-12: 1.8rem;\n --gramlot-radius-sm: .25rem;\n --gramlot-radius: .35rem;\n --gramlot-radius-lg: .4rem;\n }\n}\n\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.35; }\n :where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, blockquote, pre, figure) { margin-block: 0 .5rem; }\n h1 { font-size: 1.35rem; }\n h2 { font-size: 1.15rem; }\n h3 { font-size: 1.05rem; }\n pre { padding: .5rem; }\n blockquote { padding-inline-start: .6rem; }\n hr { margin-block: 1rem; }\n}\n\n@layer gramlot.components {\n :where(button, input[type=\"button\"], input[type=\"submit\"], input[type=\"reset\"], .button) {\n min-block-size: 28px;\n padding: .25rem .5rem;\n font-size: 1rem;\n line-height: 1.35;\n }\n :where(label) { font-size: .95rem; }\n :where(input:not([type=\"button\"]):not([type=\"submit\"]):not([type=\"reset\"]):not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"range\"]):not([type=\"color\"]):not([type=\"file\"]):not([type=\"hidden\"]), select, textarea) {\n min-block-size: var(--gramlot-field-height);\n padding: var(--gramlot-field-padding);\n font-size: var(--gramlot-field-font-size);\n line-height: var(--gramlot-field-line-height);\n }\n :where(textarea) { min-block-size: 5rem; }\n :where(input[type=\"color\"]) { min-block-size: 28px; }\n :where(input[type=\"file\"])::file-selector-button { margin-inline-end: .5rem; padding: .25rem .5rem; }\n :where(fieldset) { margin-block-end: .6rem; padding: .5rem; }\n :where(table) { font-size: 1rem; }\n :where(th, td) { padding: .4rem .5rem; }\n :where(details) { padding: .4rem .5rem; }\n :where(details[open] > summary) { margin-block-end: .5rem; }\n :where(dialog) { padding: .75rem; }\n}\n\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 1.2rem, var(--gramlot-page-width)); padding-block: .6rem; }\n .card { padding: .6rem; box-shadow: none; }\n}\n\n/* Gramlot adaptation of legacy joanna; load after Base and Compact. */\n@layer gramlot.tokens {\n :root {\n --gramlot-tab-height: 26px;\n --gramlot-tab-padding: 3px 10px;\n --gramlot-tab-radius: 6px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 3px;\n --gramlot-tab-background: var(--gramlot-background);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-ink);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-background: #F2F2F7;\n --gramlot-surface: #FFFFFF;\n --gramlot-surface-subtle: #F2F2F7;\n --gramlot-ink: #3A3A3C;\n --gramlot-text-secondary: #636366;\n --gramlot-border: #D1D1D6;\n --gramlot-border-control: #AEAEB2;\n --gramlot-navigation: #3A3A3C;\n --gramlot-navigation-text: #FFFFFF;\n --gramlot-action: #007AFF;\n --gramlot-action-hover: #0061CC;\n --gramlot-brand-blue: #007AFF;\n --gramlot-brand-yellow: #AEAEB2;\n --gramlot-selected: #E0EFFF;\n --gramlot-focus-ring: #007AFF;\n --gramlot-field-background: #FFFFFF;\n --gramlot-field-readonly-background: #F2F2F7;\n --gramlot-error: #B3261E;\n --gramlot-error-background: #FFF1F0;\n --gramlot-shadow: 0 1px 4px rgb(0 0 0 / 6%);\n --gramlot-radius-sm: 6px;\n --gramlot-radius: 6px;\n --gramlot-radius-lg: 6px;\n --gramlot-field-height: 20px;\n --gramlot-field-padding: 1px 3px;\n --gramlot-field-line-height: 1.15;\n --gramlot-field-font-size: 1rem;\n --gramlot-label-size: .8em;\n --gramlot-label-gap: 2px;\n --gramlot-label-color: var(--gramlot-text-secondary);\n --gramlot-space-4: 6px;\n --gramlot-font-ui: -apple-system, BlinkMacSystemFont, \"Helvetica Neue\", Arial, sans-serif;\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n --gramlot-background: #1C1C1E;\n --gramlot-surface: #2C2C2E;\n --gramlot-surface-subtle: #3A3A3C;\n --gramlot-ink: #F2F2F7;\n --gramlot-text-secondary: #C7C7CC;\n --gramlot-border: #636366;\n --gramlot-border-control: #8E8E93;\n --gramlot-navigation: #1C1C1E;\n --gramlot-action: #78B7FF;\n --gramlot-action-hover: #A6CFFF;\n --gramlot-brand-blue: #3478CA;\n --gramlot-selected: #254163;\n --gramlot-focus-ring: #78B7FF;\n --gramlot-field-background: #202124;\n --gramlot-field-readonly-background: #3A3A3C;\n --gramlot-error: #FFB4AB;\n --gramlot-error-background: #482524;\n --gramlot-shadow: 0 1px 4px rgb(0 0 0 / 20%);\n }\n }\n :root[data-theme=\"dark\"] {\n --gramlot-background: #1C1C1E;\n --gramlot-surface: #2C2C2E;\n --gramlot-surface-subtle: #3A3A3C;\n --gramlot-ink: #F2F2F7;\n --gramlot-text-secondary: #C7C7CC;\n --gramlot-border: #636366;\n --gramlot-border-control: #8E8E93;\n --gramlot-navigation: #1C1C1E;\n --gramlot-action: #78B7FF;\n --gramlot-action-hover: #A6CFFF;\n --gramlot-brand-blue: #3478CA;\n --gramlot-selected: #254163;\n --gramlot-focus-ring: #78B7FF;\n --gramlot-field-background: #202124;\n --gramlot-field-readonly-background: #3A3A3C;\n --gramlot-error: #FFB4AB;\n --gramlot-error-background: #482524;\n --gramlot-shadow: 0 1px 4px rgb(0 0 0 / 20%);\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n}\n@layer gramlot.components {\n :where(label) { font-size: var(--gramlot-label-size); font-weight: normal; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(button, input[type=\"button\"], input[type=\"submit\"], input[type=\"reset\"], .button) { min-block-size: 26px; padding: 2px 8px; font-weight: 500; }\n}\n@layer gramlot.utilities {\n .card { box-shadow: var(--gramlot-shadow); }\n}\n"};
|
|
2
|
+
export const appearanceStyles = {"base":"","compact":"/* gramlot-compact: professional density profile; load after Base. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #f3f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-surface-subtle: #e9edf2;\n --gramlot-ink: #202936;\n --gramlot-text-secondary: #526174;\n --gramlot-border: #ccd3dc;\n --gramlot-border-control: #7b899b;\n --gramlot-action: #235db2;\n --gramlot-action-hover: #194987;\n --gramlot-selected: #e3edfb;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #e9edf2;\n --gramlot-label-color: #526174;\n --gramlot-focus-ring: #235db2;\n --gramlot-brand-blue: #235db2;\n --gramlot-brand-yellow: #235db2;\n --gramlot-navigation: #202936;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 2px 7px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 2px 7px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 4px;\n --gramlot-radius: 4px;\n --gramlot-radius-lg: 6px;\n --gramlot-window-radius: 6px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 8px;\n --gramlot-space-6: 12px;\n --gramlot-space-8: 16px;\n --gramlot-space-12: 24px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 2px 7px;\n --gramlot-tab-radius: 4px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n","mimi":"/* gramlot-compact: professional density profile; load after Base. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #f3f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-surface-subtle: #e9edf2;\n --gramlot-ink: #202936;\n --gramlot-text-secondary: #526174;\n --gramlot-border: #ccd3dc;\n --gramlot-border-control: #7b899b;\n --gramlot-action: #235db2;\n --gramlot-action-hover: #194987;\n --gramlot-selected: #e3edfb;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #e9edf2;\n --gramlot-label-color: #526174;\n --gramlot-focus-ring: #235db2;\n --gramlot-brand-blue: #235db2;\n --gramlot-brand-yellow: #235db2;\n --gramlot-navigation: #202936;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 2px 7px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 2px 7px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 4px;\n --gramlot-radius: 4px;\n --gramlot-radius-lg: 6px;\n --gramlot-window-radius: 6px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 8px;\n --gramlot-space-6: 12px;\n --gramlot-space-8: 16px;\n --gramlot-space-12: 24px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 2px 7px;\n --gramlot-tab-radius: 4px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* mimi: professional density profile; load after Base and Compact. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #edf1ef;\n --gramlot-surface: #fbfcfb;\n --gramlot-surface-subtle: #e2e9e5;\n --gramlot-ink: #24332e;\n --gramlot-text-secondary: #52655d;\n --gramlot-border: #c4d0c9;\n --gramlot-border-control: #768a7e;\n --gramlot-action: #176b61;\n --gramlot-action-hover: #105247;\n --gramlot-selected: #dceee8;\n --gramlot-field-background: #fbfcfb;\n --gramlot-field-readonly-background: #e2e9e5;\n --gramlot-label-color: #52655d;\n --gramlot-focus-ring: #176b61;\n --gramlot-brand-blue: #176b61;\n --gramlot-brand-yellow: #176b61;\n --gramlot-navigation: #24332e;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 24px;\n --gramlot-field-padding: 1px 5px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 1px 5px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 3px;\n --gramlot-radius: 3px;\n --gramlot-radius-lg: 5px;\n --gramlot-window-radius: 5px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 3px;\n --gramlot-space-3: 6px;\n --gramlot-space-4: 6px;\n --gramlot-space-6: 9px;\n --gramlot-space-8: 12px;\n --gramlot-space-12: 18px;\n --gramlot-tab-height: 24px;\n --gramlot-tab-padding: 1px 5px;\n --gramlot-tab-radius: 3px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #17201d;\n --gramlot-surface: #202c27;\n --gramlot-surface-subtle: #2a3932;\n --gramlot-ink: #ebf3ee;\n --gramlot-text-secondary: #b6c9be;\n --gramlot-border: #40594a;\n --gramlot-border-control: #7c9987;\n --gramlot-action: #8ad8c4;\n --gramlot-action-hover: #b0eadc;\n --gramlot-selected: #2d4c40;\n --gramlot-field-background: #202c27;\n --gramlot-field-readonly-background: #2a3932;\n --gramlot-label-color: #b6c9be;\n --gramlot-focus-ring: #8ad8c4;\n --gramlot-brand-blue: #8ad8c4;\n --gramlot-brand-yellow: #8ad8c4;\n --gramlot-navigation: #17201d;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #17201d;\n --gramlot-surface: #202c27;\n --gramlot-surface-subtle: #2a3932;\n --gramlot-ink: #ebf3ee;\n --gramlot-text-secondary: #b6c9be;\n --gramlot-border: #40594a;\n --gramlot-border-control: #7c9987;\n --gramlot-action: #8ad8c4;\n --gramlot-action-hover: #b0eadc;\n --gramlot-selected: #2d4c40;\n --gramlot-field-background: #202c27;\n --gramlot-field-readonly-background: #2a3932;\n --gramlot-label-color: #b6c9be;\n --gramlot-focus-ring: #8ad8c4;\n --gramlot-brand-blue: #8ad8c4;\n --gramlot-brand-yellow: #8ad8c4;\n --gramlot-navigation: #17201d;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 12.5px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n","joanna":"/* gramlot-compact: professional density profile; load after Base. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #f3f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-surface-subtle: #e9edf2;\n --gramlot-ink: #202936;\n --gramlot-text-secondary: #526174;\n --gramlot-border: #ccd3dc;\n --gramlot-border-control: #7b899b;\n --gramlot-action: #235db2;\n --gramlot-action-hover: #194987;\n --gramlot-selected: #e3edfb;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #e9edf2;\n --gramlot-label-color: #526174;\n --gramlot-focus-ring: #235db2;\n --gramlot-brand-blue: #235db2;\n --gramlot-brand-yellow: #235db2;\n --gramlot-navigation: #202936;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 2px 7px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 2px 7px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 4px;\n --gramlot-radius: 4px;\n --gramlot-radius-lg: 6px;\n --gramlot-window-radius: 6px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 8px;\n --gramlot-space-6: 12px;\n --gramlot-space-8: 16px;\n --gramlot-space-12: 24px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 2px 7px;\n --gramlot-tab-radius: 4px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* joanna: professional density profile; load after Base and Compact. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #f5f4f2;\n --gramlot-surface: #ffffff;\n --gramlot-surface-subtle: #eeece8;\n --gramlot-ink: #292c31;\n --gramlot-text-secondary: #5d636c;\n --gramlot-border: #d5d2cc;\n --gramlot-border-control: #858990;\n --gramlot-action: #245fb4;\n --gramlot-action-hover: #194880;\n --gramlot-selected: #e6eef9;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #eeece8;\n --gramlot-label-color: #5d636c;\n --gramlot-focus-ring: #245fb4;\n --gramlot-brand-blue: #245fb4;\n --gramlot-brand-yellow: #245fb4;\n --gramlot-navigation: #292c31;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 32px;\n --gramlot-field-padding: 3px 9px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 3px 9px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 6px;\n --gramlot-radius: 6px;\n --gramlot-radius-lg: 8px;\n --gramlot-window-radius: 8px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 5px;\n --gramlot-space-3: 10px;\n --gramlot-space-4: 10px;\n --gramlot-space-6: 15px;\n --gramlot-space-8: 20px;\n --gramlot-space-12: 30px;\n --gramlot-tab-height: 32px;\n --gramlot-tab-padding: 3px 9px;\n --gramlot-tab-radius: 6px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #1b1c20;\n --gramlot-surface: #25272c;\n --gramlot-surface-subtle: #303239;\n --gramlot-ink: #f3f2ef;\n --gramlot-text-secondary: #c4c3c0;\n --gramlot-border: #454951;\n --gramlot-border-control: #858c99;\n --gramlot-action: #abcbff;\n --gramlot-action-hover: #cedfff;\n --gramlot-selected: #324765;\n --gramlot-field-background: #25272c;\n --gramlot-field-readonly-background: #303239;\n --gramlot-label-color: #c4c3c0;\n --gramlot-focus-ring: #abcbff;\n --gramlot-brand-blue: #abcbff;\n --gramlot-brand-yellow: #abcbff;\n --gramlot-navigation: #1b1c20;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #1b1c20;\n --gramlot-surface: #25272c;\n --gramlot-surface-subtle: #303239;\n --gramlot-ink: #f3f2ef;\n --gramlot-text-secondary: #c4c3c0;\n --gramlot-border: #454951;\n --gramlot-border-control: #858c99;\n --gramlot-action: #abcbff;\n --gramlot-action-hover: #cedfff;\n --gramlot-selected: #324765;\n --gramlot-field-background: #25272c;\n --gramlot-field-readonly-background: #303239;\n --gramlot-label-color: #c4c3c0;\n --gramlot-focus-ring: #abcbff;\n --gramlot-brand-blue: #abcbff;\n --gramlot-brand-yellow: #abcbff;\n --gramlot-navigation: #1b1c20;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 14px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n","mela":"/* gramlot-compact: professional density profile; load after Base. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-background: #f3f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-surface-subtle: #e9edf2;\n --gramlot-ink: #202936;\n --gramlot-text-secondary: #526174;\n --gramlot-border: #ccd3dc;\n --gramlot-border-control: #7b899b;\n --gramlot-action: #235db2;\n --gramlot-action-hover: #194987;\n --gramlot-selected: #e3edfb;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #e9edf2;\n --gramlot-label-color: #526174;\n --gramlot-focus-ring: #235db2;\n --gramlot-brand-blue: #235db2;\n --gramlot-brand-yellow: #235db2;\n --gramlot-navigation: #202936;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #aa2637;\n --gramlot-error-background: #fff0f1;\n --gramlot-success: #236747;\n --gramlot-success-background: #e9f4ec;\n --gramlot-warning: #735313;\n --gramlot-warning-background: #fff5da;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 2px 7px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 2px 7px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 3px;\n --gramlot-radius-sm: 4px;\n --gramlot-radius: 4px;\n --gramlot-radius-lg: 6px;\n --gramlot-window-radius: 6px;\n --gramlot-toolbar-gap: 2px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 8px;\n --gramlot-space-6: 12px;\n --gramlot-space-8: 16px;\n --gramlot-space-12: 24px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 2px 7px;\n --gramlot-tab-radius: 4px;\n --gramlot-tab-gap: 2px;\n --gramlot-tab-strip-padding: 2px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 2px 8px rgb(0 0 0 / 10%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #171c24;\n --gramlot-surface: #222a35;\n --gramlot-surface-subtle: #2b3543;\n --gramlot-ink: #edf1f7;\n --gramlot-text-secondary: #b8c4d4;\n --gramlot-border: #435064;\n --gramlot-border-control: #7f90a7;\n --gramlot-action: #9dbff4;\n --gramlot-action-hover: #c1d6ff;\n --gramlot-selected: #314766;\n --gramlot-field-background: #222a35;\n --gramlot-field-readonly-background: #2b3543;\n --gramlot-label-color: #b8c4d4;\n --gramlot-focus-ring: #9dbff4;\n --gramlot-brand-blue: #9dbff4;\n --gramlot-brand-yellow: #9dbff4;\n --gramlot-navigation: #171c24;\n --gramlot-navigation-text: #f6f8fb;\n --gramlot-error: #ffb4b4;\n --gramlot-error-background: #48292f;\n --gramlot-success: #98dfbd;\n --gramlot-success-background: #243f32;\n --gramlot-warning: #f3d58c;\n --gramlot-warning-background: #413820;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Mela: Apple-inspired desktop and touch appearance; load after Base and Compact. */\n@layer gramlot.tokens {\n :root {\n color-scheme: light;\n --gramlot-font-ui: -apple-system, BlinkMacSystemFont, \"Helvetica Neue\", system-ui, sans-serif;\n --gramlot-font-code: ui-monospace, SFMono-Regular, Menlo, monospace;\n --gramlot-tree-hover-background: var(--gramlot-surface-subtle);\n --gramlot-tree-selected-background: var(--gramlot-selected);\n --gramlot-tree-selected-color: var(--gramlot-ink);\n --gramlot-window-backdrop: rgb(0 0 0 / 24%);\n --gramlot-background: #f5f5f7;\n --gramlot-surface: #ffffff;\n --gramlot-surface-subtle: #eaeaed;\n --gramlot-ink: #1d1d1f;\n --gramlot-text-secondary: #636366;\n --gramlot-border: #d9d9de;\n --gramlot-border-control: #b5b5bd;\n --gramlot-action: #0066cc;\n --gramlot-action-hover: #004c99;\n --gramlot-selected: #dceaff;\n --gramlot-field-background: #ffffff;\n --gramlot-field-readonly-background: #eaeaed;\n --gramlot-label-color: #636366;\n --gramlot-focus-ring: #0066cc;\n --gramlot-brand-blue: #0066cc;\n --gramlot-brand-yellow: #0066cc;\n --gramlot-navigation: #eaeaed;\n --gramlot-navigation-text: #1d1d1f;\n --gramlot-error: #b42318;\n --gramlot-error-background: #fff0ee;\n --gramlot-success: #20783d;\n --gramlot-success-background: #eaf7ed;\n --gramlot-warning: #805500;\n --gramlot-warning-background: #fff5dc;\n --gramlot-field-height: 28px;\n --gramlot-field-padding: 3px 8px;\n --gramlot-field-line-height: 1.3;\n --gramlot-field-font-size: 1rem;\n --gramlot-button-padding: 3px 9px;\n --gramlot-button-gap: 4px;\n --gramlot-button-background: var(--gramlot-surface);\n --gramlot-button-hover: var(--gramlot-selected);\n --gramlot-label-size: 1em;\n --gramlot-label-gap: 4px;\n --gramlot-radius-sm: 6px;\n --gramlot-radius: 8px;\n --gramlot-radius-lg: 10px;\n --gramlot-window-radius: 12px;\n --gramlot-toolbar-gap: 3px;\n --gramlot-tree-row-height: var(--gramlot-field-height);\n --gramlot-space-1: 3px;\n --gramlot-space-2: 4px;\n --gramlot-space-3: 8px;\n --gramlot-space-4: 12px;\n --gramlot-space-6: 16px;\n --gramlot-space-8: 20px;\n --gramlot-space-12: 28px;\n --gramlot-tab-height: 28px;\n --gramlot-tab-padding: 3px 10px;\n --gramlot-tab-radius: 6px;\n --gramlot-tab-gap: 3px;\n --gramlot-tab-strip-padding: 3px;\n --gramlot-tab-background: var(--gramlot-surface-subtle);\n --gramlot-tab-selected-background: var(--gramlot-surface);\n --gramlot-tab-selected-color: var(--gramlot-action);\n --gramlot-tab-border: var(--gramlot-border);\n --gramlot-shadow: 0 8px 28px rgb(0 0 0 / 16%);\n }\n @media (prefers-color-scheme: dark) {\n :root:not([data-theme=\"light\"]) {\n color-scheme: dark;\n --gramlot-background: #1c1c1e;\n --gramlot-surface: #2c2c2e;\n --gramlot-surface-subtle: #38383a;\n --gramlot-ink: #f5f5f7;\n --gramlot-text-secondary: #bdbdc4;\n --gramlot-border: #48484c;\n --gramlot-border-control: #74747c;\n --gramlot-action: #70b7ff;\n --gramlot-action-hover: #abd5ff;\n --gramlot-selected: #27476d;\n --gramlot-field-background: #2c2c2e;\n --gramlot-field-readonly-background: #38383a;\n --gramlot-label-color: #bdbdc4;\n --gramlot-focus-ring: #70b7ff;\n --gramlot-brand-blue: #70b7ff;\n --gramlot-brand-yellow: #70b7ff;\n --gramlot-navigation: #1c1c1e;\n --gramlot-navigation-text: #f5f5f7;\n --gramlot-error: #ffb4ab;\n --gramlot-error-background: #492926;\n --gramlot-success: #8ddb9d;\n --gramlot-success-background: #263e2c;\n --gramlot-warning: #f5d581;\n --gramlot-warning-background: #433a26;\n }\n }\n :root[data-theme=\"dark\"] {\n color-scheme: dark;\n --gramlot-background: #1c1c1e;\n --gramlot-surface: #2c2c2e;\n --gramlot-surface-subtle: #38383a;\n --gramlot-ink: #f5f5f7;\n --gramlot-text-secondary: #bdbdc4;\n --gramlot-border: #48484c;\n --gramlot-border-control: #74747c;\n --gramlot-action: #70b7ff;\n --gramlot-action-hover: #abd5ff;\n --gramlot-selected: #27476d;\n --gramlot-field-background: #2c2c2e;\n --gramlot-field-readonly-background: #38383a;\n --gramlot-label-color: #bdbdc4;\n --gramlot-focus-ring: #70b7ff;\n --gramlot-brand-blue: #70b7ff;\n --gramlot-brand-yellow: #70b7ff;\n --gramlot-navigation: #1c1c1e;\n --gramlot-navigation-text: #f5f5f7;\n --gramlot-error: #ffb4ab;\n --gramlot-error-background: #492926;\n --gramlot-success: #8ddb9d;\n --gramlot-success-background: #263e2c;\n --gramlot-warning: #f5d581;\n --gramlot-warning-background: #433a26;\n }\n}\n@layer gramlot.base {\n html { font-size: 13px; }\n body { line-height: 1.4; }\n :where(h1,h2,h3,h4,h5,h6,p,ul,ol,dl,blockquote,pre,figure) { margin-block: 0 var(--gramlot-space-3); }\n h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }\n :where(h1,h2,h3) { letter-spacing: -.015em; }\n pre { padding: var(--gramlot-space-3); }\n hr { margin-block: var(--gramlot-space-6); }\n}\n@layer gramlot.components {\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button) {\n min-block-size: var(--gramlot-field-height); padding: var(--gramlot-button-padding);\n font-size: 1rem; line-height: 1.3; font-weight: 500;\n background: var(--gramlot-button-background); color: var(--gramlot-ink); border-color: var(--gramlot-border-control);\n }\n :where(button,input[type=\"button\"],input[type=\"submit\"],input[type=\"reset\"],.button):hover:not(:disabled) {\n background: var(--gramlot-selected); color: var(--gramlot-action-hover); border-color: var(--gramlot-action);\n }\n :where(label) { font-size: 1em; font-weight: 400; color: var(--gramlot-label-color); margin-block-end: var(--gramlot-label-gap); }\n :where(input[readonly],textarea[readonly]) { background: var(--gramlot-field-readonly-background); }\n :where(.button--quiet,button.quiet) { background: transparent; color: var(--gramlot-action); border-color: transparent; }\n :where(.button--quiet,button.quiet):hover:not(:disabled) { background: var(--gramlot-selected); border-color: transparent; }\n :where(textarea) { min-block-size: 4.5rem; }\n :where(input[type=\"color\"]) { min-block-size: var(--gramlot-field-height); }\n :where(input[type=\"file\"])::file-selector-button { padding: var(--gramlot-field-padding); }\n :where(fieldset,details) { padding: var(--gramlot-space-3); margin-block-end: var(--gramlot-space-3); }\n :where(table) { font-size: 1rem; }\n :where(th,td) { padding: var(--gramlot-field-padding); height: var(--gramlot-field-height); vertical-align: middle; }\n :where(details[open]>summary) { margin-block-end: var(--gramlot-space-3); }\n :where(dialog) { padding: var(--gramlot-space-4); }\n}\n@layer gramlot.utilities {\n .example-page { inline-size: min(100% - 2 * var(--gramlot-space-4),var(--gramlot-page-width)); padding-block: var(--gramlot-space-4); }\n .card { padding: var(--gramlot-space-4); box-shadow: none; }\n}\n\n/* Responsive density changes appearance only; Source owns layout and modality. */\n@layer gramlot.tokens {\n @media (max-width: 640px), (pointer: coarse) {\n :root {\n --gramlot-field-height: 44px;\n --gramlot-touch-target: 44px;\n --gramlot-field-font-size: 16px;\n --gramlot-field-padding: 8px 12px;\n --gramlot-button-padding: 8px 12px;\n --gramlot-tab-height: 44px;\n --gramlot-radius-sm: 9px;\n --gramlot-radius: 12px;\n --gramlot-radius-lg: 14px;\n --gramlot-window-radius: 16px;\n --gramlot-space-4: 16px;\n }\n }\n}\n@layer gramlot.base {\n @media (max-width: 640px), (pointer: coarse) {\n html { font-size: 16px; }\n }\n}\n"};
|