@fieldia/widgets 0.12.0 → 0.13.0
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/package.json +2 -2
- package/src/lib/choice-tags.js +4 -2
- package/src/lib/choice-tags.js.map +1 -1
- package/src/lib/choice-tags.mjs +4 -2
- package/src/lib/choice-tags.mjs.map +1 -1
- package/src/lib/float.d.mts +14 -0
- package/src/lib/float.d.ts +14 -0
- package/src/lib/float.js +91 -0
- package/src/lib/float.js.map +1 -0
- package/src/lib/float.mjs +88 -0
- package/src/lib/float.mjs.map +1 -0
- package/src/lib/labels.d.mts +2 -0
- package/src/lib/labels.d.ts +2 -0
- package/src/lib/labels.js +1 -0
- package/src/lib/labels.js.map +1 -1
- package/src/lib/labels.mjs +1 -0
- package/src/lib/labels.mjs.map +1 -1
- package/src/lib/layout-styles.d.mts +1 -1
- package/src/lib/layout-styles.d.ts +1 -1
- package/src/lib/layout-styles.js +12 -5
- package/src/lib/layout-styles.js.map +1 -1
- package/src/lib/layout-styles.mjs +12 -5
- package/src/lib/layout-styles.mjs.map +1 -1
- package/src/lib/lines.js +121 -10
- package/src/lib/lines.js.map +1 -1
- package/src/lib/lines.mjs +121 -10
- package/src/lib/lines.mjs.map +1 -1
- package/src/lib/locales/ar.js +1 -0
- package/src/lib/locales/ar.js.map +1 -1
- package/src/lib/locales/ar.mjs +1 -0
- package/src/lib/locales/ar.mjs.map +1 -1
- package/src/lib/locales/de.js +1 -0
- package/src/lib/locales/de.js.map +1 -1
- package/src/lib/locales/de.mjs +1 -0
- package/src/lib/locales/de.mjs.map +1 -1
- package/src/lib/locales/fr.js +1 -0
- package/src/lib/locales/fr.js.map +1 -1
- package/src/lib/locales/fr.mjs +1 -0
- package/src/lib/locales/fr.mjs.map +1 -1
- package/src/lib/numbers.d.mts +5 -1
- package/src/lib/numbers.d.ts +5 -1
- package/src/lib/numbers.js +15 -2
- package/src/lib/numbers.js.map +1 -1
- package/src/lib/numbers.mjs +13 -2
- package/src/lib/numbers.mjs.map +1 -1
- package/src/lib/relations.js +11 -2
- package/src/lib/relations.js.map +1 -1
- package/src/lib/relations.mjs +11 -2
- package/src/lib/relations.mjs.map +1 -1
- package/src/lib/styles-business.d.mts +1 -1
- package/src/lib/styles-business.d.ts +1 -1
- package/src/lib/styles-business.js +1 -1
- package/src/lib/styles-business.mjs +1 -1
- package/src/lib/styles-inputs.d.mts +1 -1
- package/src/lib/styles-inputs.d.ts +1 -1
- package/src/lib/styles-inputs.js +2 -0
- package/src/lib/styles-inputs.js.map +1 -1
- package/src/lib/styles-inputs.mjs +2 -0
- package/src/lib/styles-inputs.mjs.map +1 -1
- package/src/lib/styles-kinds.d.mts +1 -1
- package/src/lib/styles-kinds.d.ts +1 -1
- package/src/lib/styles-kinds.js +1 -1
- package/src/lib/styles-kinds.mjs +1 -1
- package/src/lib/styles-sheet.d.mts +1 -1
- package/src/lib/styles-sheet.d.ts +1 -1
- package/src/lib/styles-sheet.js +28 -12
- package/src/lib/styles-sheet.js.map +1 -1
- package/src/lib/styles-sheet.mjs +28 -12
- package/src/lib/styles-sheet.mjs.map +1 -1
- package/src/lib/styles.js +83 -19
- package/src/lib/styles.js.map +1 -1
- package/src/lib/styles.mjs +83 -19
- package/src/lib/styles.mjs.map +1 -1
- package/src/lib/themes.d.mts +29 -0
- package/src/lib/themes.d.ts +29 -0
- package/src/lib/themes.js +180 -0
- package/src/lib/themes.js.map +1 -0
- package/src/lib/themes.mjs +177 -0
- package/src/lib/themes.mjs.map +1 -0
- package/src/lib/widgets.js +26 -5
- package/src/lib/widgets.js.map +1 -1
- package/src/lib/widgets.mjs +27 -6
- package/src/lib/widgets.mjs.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fieldia/widgets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Fieldia field inputs in plain DOM, with the underline and outlined skins.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://fieldia.dev",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"./package.json": "./package.json"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@fieldia/core": "0.
|
|
24
|
+
"@fieldia/core": "0.13.0",
|
|
25
25
|
"tslib": "^2.8.1"
|
|
26
26
|
},
|
|
27
27
|
"sideEffects": false,
|
package/src/lib/choice-tags.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.searchWidget = exports.choiceTagsWidget = void 0;
|
|
4
4
|
const choice_rules_1 = require("./choice-rules");
|
|
5
|
+
const float_1 = require("./float");
|
|
5
6
|
const kind_parts_1 = require("./kind-parts");
|
|
6
7
|
/**
|
|
7
8
|
* Several answers from a list, as tags in a box (`selection.tags`): the box
|
|
@@ -41,6 +42,7 @@ function combo({ form, name, field, node, id, document, labels, locale }, single
|
|
|
41
42
|
const list = make('ul', { id: listId, class: 'fd-listbox', role: 'listbox', hidden: '' });
|
|
42
43
|
const chips = make('ul', { class: 'fd-chips' });
|
|
43
44
|
const box = make('div', { class: 'fd-combo' }, input, list);
|
|
45
|
+
const floating = (0, float_1.floatUnder)(input, list);
|
|
44
46
|
const element = single ? make('div', { class: 'fd-choice-search' }, box) : make('div', { class: 'fd-tags fd-choice-tags' }, chips, box);
|
|
45
47
|
const current = () => form.getState().values[name];
|
|
46
48
|
const chosen = () => (Array.isArray(current()) ? current() : []);
|
|
@@ -73,11 +75,11 @@ function combo({ form, name, field, node, id, document, labels, locale }, single
|
|
|
73
75
|
found.push({ value: written, label: (0, kind_parts_1.fillIn)(words.createNamed, { name: written }) });
|
|
74
76
|
active = -1;
|
|
75
77
|
draw();
|
|
76
|
-
|
|
78
|
+
floating.show();
|
|
77
79
|
input.setAttribute('aria-expanded', 'true');
|
|
78
80
|
}
|
|
79
81
|
function close() {
|
|
80
|
-
|
|
82
|
+
floating.hide();
|
|
81
83
|
active = -1;
|
|
82
84
|
input.setAttribute('aria-expanded', 'false');
|
|
83
85
|
input.removeAttribute('aria-activedescendant');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choice-tags.js","sourceRoot":"","sources":["../../../../../libs/widgets/src/lib/choice-tags.ts"],"names":[],"mappings":";;;AACA,iDAA2C;AAC3C,6CAA+E;AAG/E;;;;;;;;;;;;;GAaG;AACI,MAAM,gBAAgB,GAAkB,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAArE,QAAA,gBAAgB,oBAAqD;AAC3E,MAAM,YAAY,GAAkB,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAAhE,QAAA,YAAY,gBAAoD;AAE7E,SAAS,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAiB,EAAE,MAAe;IACtG,MAAM,KAAK,GAAG,IAAA,qBAAQ,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,IAAA,kBAAK,EAAC,QAAQ,CAAC,CAAC;IAC7B,MAAM,OAAO,GAAa,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1E,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,UAAU,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC;IAC/E,MAAM,MAAM,GAAG,GAAG,EAAE,OAAO,CAAC;IAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE;QAC1B,EAAE;QACF,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,yBAAyB;QAChC,IAAI,E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atUnder } from './float.mjs';
|
|
2
3
|
import { describeState, fillIn, maker, setAttr, wordsFor } from './kind-parts.mjs';
|
|
3
4
|
/**
|
|
4
5
|
* Several answers from a list, as tags in a box (`selection.tags`): the box
|
|
@@ -36,6 +37,7 @@ function combo({ form, name, field, node, id, document, labels, locale }, single
|
|
|
36
37
|
const list = make('ul', { id: listId, class: 'fd-listbox', role: 'listbox', hidden: '' });
|
|
37
38
|
const chips = make('ul', { class: 'fd-chips' });
|
|
38
39
|
const box = make('div', { class: 'fd-combo' }, input, list);
|
|
40
|
+
const floating = floatUnder(input, list);
|
|
39
41
|
const element = single ? make('div', { class: 'fd-choice-search' }, box) : make('div', { class: 'fd-tags fd-choice-tags' }, chips, box);
|
|
40
42
|
const current = () => form.getState().values[name];
|
|
41
43
|
const chosen = () => (Array.isArray(current()) ? current() : []);
|
|
@@ -68,11 +70,11 @@ function combo({ form, name, field, node, id, document, labels, locale }, single
|
|
|
68
70
|
found.push({ value: written, label: fillIn(words.createNamed, { name: written }) });
|
|
69
71
|
active = -1;
|
|
70
72
|
draw();
|
|
71
|
-
|
|
73
|
+
floating.show();
|
|
72
74
|
input.setAttribute('aria-expanded', 'true');
|
|
73
75
|
}
|
|
74
76
|
function close() {
|
|
75
|
-
|
|
77
|
+
floating.hide();
|
|
76
78
|
active = -1;
|
|
77
79
|
input.setAttribute('aria-expanded', 'false');
|
|
78
80
|
input.removeAttribute('aria-activedescendant');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choice-tags.mjs","sourceRoot":"","sources":["../../../../../libs/widgets/src/lib/choice-tags.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG/E;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAkB,CAAC,OAAO,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AK,EAAE,SAAS,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;gBAC/F,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACd,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;oBACrI,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC;oBACnF,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBACtB,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC,CAAC,CACH,CAAC;YACF,oDAAoD;YACpD,IAAI,CAAC,IAAI,CAAC,MAAM;gBAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;KACkC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A list floating under the control it belongs to, over everything else: in
|
|
3
|
+
* the page's top layer where the browser has one, so no scrolling table, grid
|
|
4
|
+
* cell or folded part clips it. At least as wide as its control, above it when
|
|
5
|
+
* there is more room there, kept on the screen, and following the control
|
|
6
|
+
* wherever it goes while the list is open: a scroll, a resize, or the page
|
|
7
|
+
* moving it some other way (a line added above, a screenshot's resize).
|
|
8
|
+
*/
|
|
9
|
+
export declare function floatUnder(anchor: HTMLElement, box: HTMLElement): {
|
|
10
|
+
show(): void;
|
|
11
|
+
/** Placed again: its words changed, and with them its height. */
|
|
12
|
+
place: () => void;
|
|
13
|
+
hide(): void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A list floating under the control it belongs to, over everything else: in
|
|
3
|
+
* the page's top layer where the browser has one, so no scrolling table, grid
|
|
4
|
+
* cell or folded part clips it. At least as wide as its control, above it when
|
|
5
|
+
* there is more room there, kept on the screen, and following the control
|
|
6
|
+
* wherever it goes while the list is open: a scroll, a resize, or the page
|
|
7
|
+
* moving it some other way (a line added above, a screenshot's resize).
|
|
8
|
+
*/
|
|
9
|
+
export declare function floatUnder(anchor: HTMLElement, box: HTMLElement): {
|
|
10
|
+
show(): void;
|
|
11
|
+
/** Placed again: its words changed, and with them its height. */
|
|
12
|
+
place: () => void;
|
|
13
|
+
hide(): void;
|
|
14
|
+
};
|
package/src/lib/float.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.floatUnder = floatUnder;
|
|
4
|
+
/**
|
|
5
|
+
* A list floating under the control it belongs to, over everything else: in
|
|
6
|
+
* the page's top layer where the browser has one, so no scrolling table, grid
|
|
7
|
+
* cell or folded part clips it. At least as wide as its control, above it when
|
|
8
|
+
* there is more room there, kept on the screen, and following the control
|
|
9
|
+
* wherever it goes while the list is open: a scroll, a resize, or the page
|
|
10
|
+
* moving it some other way (a line added above, a screenshot's resize).
|
|
11
|
+
*/
|
|
12
|
+
function floatUnder(anchor, box) {
|
|
13
|
+
const doc = anchor.ownerDocument;
|
|
14
|
+
const win = doc.defaultView;
|
|
15
|
+
const topLayer = typeof box.showPopover === 'function';
|
|
16
|
+
if (topLayer)
|
|
17
|
+
box.setAttribute('popover', 'manual');
|
|
18
|
+
let shown = false;
|
|
19
|
+
/** Where the control was when the list was last placed, watched each frame while it is open. */
|
|
20
|
+
let placedAt = '';
|
|
21
|
+
let watching = 0;
|
|
22
|
+
function place() {
|
|
23
|
+
const at = anchor.getBoundingClientRect();
|
|
24
|
+
const width = doc.documentElement.clientWidth;
|
|
25
|
+
const height = doc.documentElement.clientHeight;
|
|
26
|
+
const [below, above] = [height - at.bottom - 10, at.top - 10];
|
|
27
|
+
const up = below < 160 && above > below;
|
|
28
|
+
Object.assign(box.style, {
|
|
29
|
+
position: 'fixed',
|
|
30
|
+
inset: 'auto',
|
|
31
|
+
margin: '0',
|
|
32
|
+
minWidth: `${Math.min(Math.max(at.width, 224), width - 16)}px`,
|
|
33
|
+
maxWidth: `${Math.max(at.width, Math.min(448, width - 16))}px`,
|
|
34
|
+
maxHeight: `${Math.max(96, Math.min(240, up ? above : below))}px`,
|
|
35
|
+
});
|
|
36
|
+
placedAt = `${at.left},${at.top},${at.width},${width},${height}`;
|
|
37
|
+
const own = box.offsetWidth;
|
|
38
|
+
const rtl = win?.getComputedStyle(anchor).direction === 'rtl';
|
|
39
|
+
const left = Math.max(8, Math.min(rtl ? at.right - own : at.left, width - own - 8));
|
|
40
|
+
Object.assign(box.style, { left: `${left}px`, top: `${up ? at.top - 2 - box.offsetHeight : at.bottom + 2}px` });
|
|
41
|
+
}
|
|
42
|
+
// Its control gone (a grid's cell closed under it), it goes too.
|
|
43
|
+
const follow = () => {
|
|
44
|
+
if (!shown)
|
|
45
|
+
return;
|
|
46
|
+
if (!anchor.isConnected)
|
|
47
|
+
return floating.hide();
|
|
48
|
+
place();
|
|
49
|
+
};
|
|
50
|
+
// Moved by anything but a scroll or a resize, it is placed again on the next frame.
|
|
51
|
+
const watch = () => {
|
|
52
|
+
if (!shown)
|
|
53
|
+
return;
|
|
54
|
+
const at = anchor.getBoundingClientRect();
|
|
55
|
+
if (`${at.left},${at.top},${at.width},${doc.documentElement.clientWidth},${doc.documentElement.clientHeight}` !== placedAt)
|
|
56
|
+
follow();
|
|
57
|
+
watching = win?.requestAnimationFrame(watch) ?? 0;
|
|
58
|
+
};
|
|
59
|
+
const floating = {
|
|
60
|
+
show() {
|
|
61
|
+
box.hidden = false;
|
|
62
|
+
if (topLayer && !box.matches(':popover-open'))
|
|
63
|
+
box.showPopover();
|
|
64
|
+
place();
|
|
65
|
+
if (!shown) {
|
|
66
|
+
doc.addEventListener('scroll', follow, true);
|
|
67
|
+
win?.addEventListener('resize', follow);
|
|
68
|
+
}
|
|
69
|
+
shown = true;
|
|
70
|
+
if (!watching && win?.requestAnimationFrame)
|
|
71
|
+
watching = win.requestAnimationFrame(watch);
|
|
72
|
+
},
|
|
73
|
+
/** Placed again: its words changed, and with them its height. */
|
|
74
|
+
place: follow,
|
|
75
|
+
hide() {
|
|
76
|
+
if (topLayer && box.matches(':popover-open'))
|
|
77
|
+
box.hidePopover();
|
|
78
|
+
box.hidden = true;
|
|
79
|
+
if (shown) {
|
|
80
|
+
doc.removeEventListener('scroll', follow, true);
|
|
81
|
+
win?.removeEventListener('resize', follow);
|
|
82
|
+
}
|
|
83
|
+
if (watching)
|
|
84
|
+
win?.cancelAnimationFrame(watching);
|
|
85
|
+
watching = 0;
|
|
86
|
+
shown = false;
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
return floating;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=float.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"float.js","sourceRoot":"","sources":["../../../../../libs/widgets/src/lib/float.ts"],"names":[],"mappings":";;AAQA,gCAuEC;AA/ED;;;;;;;GAOG;AACH,SAAgB,UAAU,CAAC,MAAmB,EAAE,GAAgB;IAC9D,MAAM,GAAG,GAAG,MAAM,CAAC,aAAa,CAAC;IACjC,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,CAAC;IAC5B,MAAM,QAAQ,GAAG,OAAO,GAAG,CAAC,WAAW,KAAK,UAAU,CAAC;IACvD,IAAI,QAAQ;QAAE,GAAG,CAAC,YAAY,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACpD,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,gGAAgG;IAChG,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAI,QAAQ,GA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M,QAAQ,GAAG;QACf,IAAI;YACF,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC;YACnB,IAAI,QAAQ,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC;gBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;YACjE,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,GAAG,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;gBAC7C,GAAG,EAAE,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC1C,CAAC;YACD,KAAK,GAAG,IAAI,CAAC;YACb,IAAI,CAAC,QAAQ,IAAI,GAAG,EAAE,qBAAqB;gBAAE,QAAQ,GAAG,GAAG,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;QAC3F,CAAC;QACD,iEAAiE;QACjE,KAAK,EAAE,MAAM;QACb,IAAI;YACF,IAAI,QAAQ,IAAI,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC;gBAAE,GAAG,CAAC,WAAW,EAAE,CAAC;YAChE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC;YAClB,IAAI,KAAK,EAAE,CAAC;gBACV,GAAG,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;gBAChD,GAAG,EAAE,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC7C,CAAC;YACD,IAAI,QAAQ;gBAAE,GAAG,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;YAClD,QAAQ,GAAG,CAAC,CAAC;YACb,KAAK,GAAG,KAAK,CAAC;QAChB,CAAC;KACF,CAAC;IACF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A list floating under the control it belongs to, over everything else: in
|
|
3
|
+
* the page's top layer where the browser has one, so no scrolling table, grid
|
|
4
|
+
* cell or folded part clips it. At least as wide as its control, above it when
|
|
5
|
+
* there is more room there, kept on the screen, and following the control
|
|
6
|
+
* wherever it goes while the list is open: a scroll, a resize, or the page
|
|
7
|
+
* moving it some other way (a line added above, a screenshot's resize).
|
|
8
|
+
*/
|
|
9
|
+
export function floatUnder(anchor, box) {
|
|
10
|
+
const doc = anchor.ownerDocument;
|
|
11
|
+
const win = doc.defaultView;
|
|
12
|
+
const topLayer = typeof box.showPopover === 'function';
|
|
13
|
+
if (topLayer)
|
|
14
|
+
box.setAttribute('popover', 'manual');
|
|
15
|
+
let shown = false;
|
|
16
|
+
/** Where the control was when the list was last placed, watched each frame while it is open. */
|
|
17
|
+
let placedAt = '';
|
|
18
|
+
let watching = 0;
|
|
19
|
+
function place() {
|
|
20
|
+
const at = anchor.getBoundingClientRect();
|
|
21
|
+
const width = doc.documentElement.clientWidth;
|
|
22
|
+
const height = doc.documentElement.clientHeight;
|
|
23
|
+
const [below, above] = [height - at.bottom - 10, at.top - 10];
|
|
24
|
+
const up = below < 160 && above > below;
|
|
25
|
+
Object.assign(box.style, {
|
|
26
|
+
position: 'fixed',
|
|
27
|
+
inset: 'auto',
|
|
28
|
+
margin: '0',
|
|
29
|
+
minWidth: `${Math.min(Math.max(at.width, 224), width - 16)}px`,
|
|
30
|
+
maxWidth: `${Math.max(at.width, Math.min(448, width - 16))}px`,
|
|
31
|
+
maxHeight: `${Math.max(96, Math.min(240, up ? above : below))}px`,
|
|
32
|
+
});
|
|
33
|
+
placedAt = `${at.left},${at.top},${at.width},${width},${height}`;
|
|
34
|
+
const own = box.offsetWidth;
|
|
35
|
+
const rtl = win?.getComputedStyle(anchor).direction === 'rtl';
|
|
36
|
+
const left = Math.max(8, Math.min(rtl ? at.right - own : at.left, width - own - 8));
|
|
37
|
+
Object.assign(box.style, { left: `${left}px`, top: `${up ? at.top - 2 - box.offsetHeight : at.bottom + 2}px` });
|
|
38
|
+
}
|
|
39
|
+
// Its control gone (a grid's cell closed under it), it goes too.
|
|
40
|
+
const follow = () => {
|
|
41
|
+
if (!shown)
|
|
42
|
+
return;
|
|
43
|
+
if (!anchor.isConnected)
|
|
44
|
+
return floating.hide();
|
|
45
|
+
place();
|
|
46
|
+
};
|
|
47
|
+
// Moved by anything but a scroll or a resize, it is placed again on the next frame.
|
|
48
|
+
const watch = () => {
|
|
49
|
+
if (!shown)
|
|
50
|
+
return;
|
|
51
|
+
const at = anchor.getBoundingClientRect();
|
|
52
|
+
if (`${at.left},${at.top},${at.width},${doc.documentElement.clientWidth},${doc.documentElement.clientHeight}` !== placedAt)
|
|
53
|
+
follow();
|
|
54
|
+
watching = win?.requestAnimationFrame(watch) ?? 0;
|
|
55
|
+
};
|
|
56
|
+
const floating = {
|
|
57
|
+
show() {
|
|
58
|
+
box.hidden = false;
|
|
59
|
+
if (topLayer && !box.matches(':popover-open'))
|
|
60
|
+
box.showPopover();
|
|
61
|
+
place();
|
|
62
|
+
if (!shown) {
|
|
63
|
+
doc.addEventListener('scroll', follow, true);
|
|
64
|
+
win?.addEventListener('resize', follow);
|
|
65
|
+
}
|
|
66
|
+
shown = true;
|
|
67
|
+
if (!watching && win?.requestAnimationFrame)
|
|
68
|
+
watching = win.requestAnimationFrame(watch);
|
|
69
|
+
},
|
|
70
|
+
/** Placed again: its words changed, and with them its height. */
|
|
71
|
+
place: follow,
|
|
72
|
+
hide() {
|
|
73
|
+
if (topLayer && box.matches(':popover-open'))
|
|
74
|
+
box.hidePopover();
|
|
75
|
+
box.hidden = true;
|
|
76
|
+
if (shown) {
|
|
77
|
+
doc.removeEventListener('scroll', follow, true);
|
|
78
|
+
win?.removeEventListener('resize', follow);
|
|
79
|
+
}
|
|
80
|
+
if (watching)
|
|
81
|
+
win?.cancelAnimationFrame(watching);
|
|
82
|
+
watching = 0;
|
|
83
|
+
shown = false;
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
return floating;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=float.mjs.map
|
|
@@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AAC,MAAM,GAAG,IAAI,CAAC;YAClB,IAAI,KAAK,EAAE,CAAC;gBACV,GAAG,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;gBAChD,GAAG,EAAE,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC7C,CAAC;YACD,IAAI,QAAQ;gBAAE,GAAG,EAAE,oBAAoB,CAAC,QAAQ,CAAC,CAAC;YAClD,QAAQ,GAAG,CAAC,CAAC;YACb,KAAK,GAAG,KAAK,CAAC;QAChB,CAAC;KACF,CAAC;IACF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/src/lib/labels.d.mts
CHANGED
|
@@ -11,6 +11,8 @@ export interface WidgetLabels {
|
|
|
11
11
|
deleteLine: string;
|
|
12
12
|
/** A line of a table, as a person is told of it: `{n}` counts from 1. */
|
|
13
13
|
lineN: string;
|
|
14
|
+
/** Said in a table with no lines yet, unless the page has words of its own (`emptyLabel`). */
|
|
15
|
+
noLines: string;
|
|
14
16
|
/** Heads the row that adds up a table's number columns. */
|
|
15
17
|
total: string;
|
|
16
18
|
/** A problem on one line of a table, under the table. `{n}` counts from 1. */
|
package/src/lib/labels.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export interface WidgetLabels {
|
|
|
11
11
|
deleteLine: string;
|
|
12
12
|
/** A line of a table, as a person is told of it: `{n}` counts from 1. */
|
|
13
13
|
lineN: string;
|
|
14
|
+
/** Said in a table with no lines yet, unless the page has words of its own (`emptyLabel`). */
|
|
15
|
+
noLines: string;
|
|
14
16
|
/** Heads the row that adds up a table's number columns. */
|
|
15
17
|
total: string;
|
|
16
18
|
/** A problem on one line of a table, under the table. `{n}` counts from 1. */
|
package/src/lib/labels.js
CHANGED
package/src/lib/labels.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.js","sourceRoot":"","sources":["../../../../../libs/widgets/src/lib/labels.ts"],"names":[],"mappings":";;;AACA,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AAa,EAAE,iBAAiB;IAChC,eAAe,EAAE,UAAU;IAC3B,cAAc,EAAE,SAAS;IACzB,KAAK,EAAE,WAAW;IAClB,UAAU,EAAE,aAAa;IACzB,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,gBAAgB;IACzB,cAAc,EAAE,kBAAkB;IAClC,aAAa,EAAE,wBAAwB;IACvC,UAAU,EAAE,2BAA2B;IACvC,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,iBAAiB;IAC5B,KAAK,EAAE,cAAc;IACrB,cAAc,EAAE,sBAAsB;IACtC,WAAW,EAAE,iFAAiF;IAC9F,SAAS,EAAE,MAAM;IACjB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,iBAAiB;IAC7B,YAAY,EAAE,mBAAmB;IACjC,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,YAAY;IACnB,UAAU,EAAE,gBAAgB;IAC5B,SAAS,EAAE,oCAAoC;IAC/C,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE,gBAAgB;IACxB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,qBAAqB;IAChC,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,WAAW,EAAE,gBAAgB;IAC7B,YAAY,EAAE,eAAe;IAC7B,YAAY,EAAE,MAAM;IACpB,aAAa,EAAE,mDAAmD;IAClE,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,UAAU;CACpB,CAAC;AAEF;;;;;GAKG;AACU,QAAA,aAAa,GAAiC,EAAE,EAAE,EAAE,GAAG,eAAS,EAAE,CAAC"}
|
package/src/lib/labels.mjs
CHANGED
package/src/lib/labels.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.mjs","sourceRoot":"","sources":["../../../../../libs/widgets/src/lib/labels.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"labels.mjs","sourceRoot":"","sources":["../../../../../libs/widgets/src/lib/labels.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAmL1C,iEAAiE;AACjE,MAAM,EAAE,GAAiB;IACvB,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,YAAY;IACvB,MAAM,EAAE,eAAe;IACvB,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,YAAY;IACrB,UAAU,EAAE,eAAe;IAC3B,OAAO,EAAE,YAAY;IACrB,UAAU,EAAE,aAAa;IACzB,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,cAAc;IACvB,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,qBAAqB;IAClC,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,gBAAgB;IAC/B,WAAW,EAAE,iBAAiB;IAC9B,aAAa,EAAE,kBAAkB;IACjC,UAAU,EAAE,cAAc;IAC1B,SAAS,EAAE,aAAa;IACxB,QAAQ,EAAE,WAAW;IACrB,UAAU,EAAE,eAAe;IAC3B,cAAc,EAAE,mBAAmB;IACnC,WAAW,EAAE,YAAY;IACzB,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,qBAAqB;IACjC,UAAU,EAAE,eAAe;IAC3B,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,iBAAiB;IAC9B,cAAc,EAAE,iBAAiB;IACjC,aAAa,EAAE,gBAAgB;IAC/B,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,IAAI;IACf,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,YAAY;IACxB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,YAAY;I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ughout, so right to left mirrors on its own.
|
|
10
10
|
*/
|
|
11
|
-
export declare const LAYOUT_CSS = "\n/* ---- arrangements: parts side by side or one under another, nothing drawn round them ---- */\n/* On its grid's columns: the grid's own tracks and gaps, so its parts line up with everything above and below. */\n.fd-grid > .fd-section[data-place=\"tracks\"] {\n /* The columns it covers: its span, never more than its grid has at this width. */\n --fd-tracks: min(var(--fd-span, 1), var(--fd-cols));\n grid-template-columns: subgrid;\n column-gap: var(--fd-gap-x);\n}\n.fd-form .fd-section[data-place=\"tracks\"] > .fd-grid { --fd-cols: var(--fd-tracks); grid-column: 1 / -1; grid-template-columns: subgrid; }\n.fd-section[data-place] > .fd-section-description { grid-column: 1 / -1; }\n/* Parts sharing one cell, side by side; one under the other where the cell is too narrow for that. */\n.fd-grid > .fd-section[data-place=\"shared\"] { container-type: inline-size; }\n.fd-form .fd-section[data-place=\"shared\"] > .fd-grid { --fd-cols: var(--fd-columns, 1); }\n@container (max-width: 330px) {\n .fd-form .fd-section[data-place=\"shared\"] > .fd-grid { --fd-cols: 1; }\n}\n\n/* ---- how a group is drawn: a card, plain, a line under its title, or a frame round it ---- */\n/* A group of its own paints the ground it stands on, so nothing of the grid round it shows through. */\n.fd-form { --fd-ground: transparent; }\n.fd-card, .fd-form[data-fd-skin=\"outlined\"] .fd-section[data-style=\"card\"][data-on-page] { --fd-ground: var(--fd-surface); }\nfieldset.fd-section[data-style] { background-color: var(--fd-ground); }\n.fd-form .fd-section[data-style=\"line\"] > .fd-section-title { border-block-end: 1px solid var(--fd-border); padding-block-end: 8px; }\n.fd-form .fd-section[data-style=\"plain\"] > .fd-section-title { border-block-end: 0; padding-block-end: 0; }\n.fd-form .fd-section[data-style=\"framed\"] {\n border: 1px solid var(--fd-border); border-radius: var(--fd-control-radius); padding: 6px 18px 18px;\n}\n/* The title sits on the frame, as a fieldset's legend does: the frame breaks round it. */\n.fd-form .fd-section[data-style=\"framed\"] > .fd-section-title {\n float: none; width: auto; max-width: 100%; padding: 0 6px; margin-inline-start: -6px; border: 0;\n}\n\n/* ---- where labels sit: as the page, a group or the field itself says (data-labels), in either skin ---- */\n.fd-form .fd-field[data-labels] { grid-template-columns: minmax(0, 1fr); }\n.fd-form .fd-field[data-labels] > * { grid-column: 1 / -1; }\n/* Beside: the label in a column of its own while the field has room for both. In a cell narrower\n than that the label goes back above its box, so the box is never crushed. */\n.fd-form .fd-field[data-labels=\"beside\"] {\n container-type: inline-size;\n grid-template-columns: minmax(0, var(--fd-label-width, 140px)) minmax(0, 1fr);\n column-gap: 14px;\n}\n@container (min-width: 300px) {\n .fd-form .fd-field[data-labels=\"beside\"] > .fd-label {\n grid-column: 1; align-self: start; padding-block-start: max(0px, calc((var(--fd-control-height, 30px) - 1.45em) / 2));\n }\n .fd-form .fd-field[data-labels=\"beside\"] > :not(.fd-label) { grid-column: 2; }\n}\n/* Hidden: out of sight, still the box's name for a screen reader; the empty box shows it instead. */\n.fd-form .fd-field[data-labels=\"hidden\"] > .fd-label {\n position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;\n}\n/* After: a tick box, then its words on the same line, as a sentence; its help and messages under the words. They\n drop to sit level with the boxes beside them in a row, by margins: the field's own padding is left to whoever\n draws round it (a designer's canvas rings a part there). */\n.fd-form .fd-field[data-labels=\"after\"] {\n grid-template-columns: auto minmax(0, 1fr); column-gap: 9px; align-items: start;\n --fd-tick-drop: max(0px, calc((var(--fd-control-height, 30px) - 1.45em) / 2));\n}\n/* The box, or what holds it (a designer's canvas wraps each answer box). */\n.fd-form .fd-field[data-labels=\"after\"] > :is(.fd-tick, :has(> .fd-tick)) { grid-column: 1; grid-row: 1; display: flex; margin-block-start: calc(var(--fd-tick-drop) + (1.45em - 17px) / 2); }\n.fd-form .fd-field[data-labels=\"after\"] .fd-tick { width: 17px; height: 17px; }\n.fd-form .fd-field[data-labels=\"after\"] > :not(.fd-tick, :has(> .fd-tick)) { grid-column: 2; }\n.fd-form .fd-field[data-labels=\"after\"] > .fd-label { grid-row: 1; margin-block-start: var(--fd-tick-drop); font-weight: inherit; line-height: 1.45; cursor: pointer; }\n/* A field or a cell that measures itself is drawn over its neighbours while it is worked in: its lists and calendars open over them. */\n.fd-form .fd-field[data-labels=\"beside\"]:focus-within, .fd-grid > .fd-section[data-place=\"shared\"]:focus-within { z-index: 3; }\n\n/* ---- widths for tabs, words and buttons: they span columns like fields; a button stays as wide as its words ---- */\n:is(.fd-grid, .fd-sections) > .fd-button { justify-self: start; }\n/* A note: words set apart in a soft panel, a shade off whatever it stands on \u2014 a card, the page, or the dark. */\n.fd-form .fd-text-note { background: color-mix(in srgb, var(--fd-text) 6%, transparent); color: var(--fd-text); border-radius: var(--fd-control-radius, 6px); padding: 10px 12px; }\n\n/* ---- the page's look: worn by the form, and by a dialog it opens (its box and the page in it) ---- */\n:is(.fd-form, .fd-form-dialog)[data-font=\"serif\"] { --fd-font: \"Source Serif 4\", Georgia, serif; }\n:is(.fd-form, .fd-form-dialog)[data-font=\"rounded\"] { --fd-font: Nunito, \"Varela Round\", system-ui; }\n/* Room between and inside parts: gaps, the height of a box, a group's padding, the space between groups. */\n:is(.fd-form, .fd-form-dialog)[data-density=\"compact\"] { --fd-gap-y: 10px; --fd-gap-x: 16px; --fd-control-height: 30px; --fd-gap-block: 16px; --fd-group-pad: 14px 16px; }\n:is(.fd-form, .fd-form-dialog)[data-density=\"comfortable\"] { --fd-gap-y: 16px; --fd-gap-x: 20px; --fd-control-height: 36px; --fd-gap-block: 22px; --fd-group-pad: 18px 22px; }\n:is(.fd-form, .fd-form-dialog)[data-density=\"roomy\"] { --fd-gap-y: 22px; --fd-gap-x: 28px; --fd-control-height: 42px; --fd-gap-block: 30px; --fd-group-pad: 24px 30px; }\n:is(.fd-form, .fd-form-dialog)[data-corners=\"square\"] { --fd-radius: 0px; --fd-control-radius: 0px; }\n:is(.fd-form, .fd-form-dialog)[data-corners=\"soft\"] { --fd-radius: 10px; --fd-control-radius: 6px; }\n:is(.fd-form, .fd-form-dialog)[data-corners=\"round\"] { --fd-radius: 16px; --fd-control-radius: 12px; }\n\n/* Light or dark: a page that names its scheme paints its own ground, so it reads the same on any page round it. */\n.fd-form[data-scheme] { color-scheme: light; background: var(--fd-page); color: var(--fd-text); border-radius: var(--fd-radius); --fd-ground: var(--fd-page); }\n.fd-form[data-scheme] > .fd-content:not(:has(> .fd-sheet-page)) { padding: 20px; }\n/* A page in a dialog paints no ground of its own and adds no room: the dialog is its ground. */\n.fd-form-dialog-body > .fd-form[data-scheme] { background: none; border-radius: 0; }\n.fd-form-dialog-body > .fd-form[data-scheme] > .fd-content:not(:has(> .fd-sheet-page)) { padding: 0; }\n:is(.fd-form, .fd-form-dialog)[data-scheme=\"dark\"] {\n color-scheme: dark;\n --fd-text: #e8eaed;\n --fd-muted: #a3a9b2;\n --fd-page: #16191e;\n --fd-surface: #1f2329;\n --fd-border: #3a4048;\n --fd-border-strong: #59616c;\n --fd-accent: #5aa2ff;\n --fd-accent-text: #0b1220;\n --fd-accent-soft: rgba(90, 162, 255, 0.16);\n --fd-focus: #5aa2ff;\n --fd-error: #ff8a7a;\n --fd-error-soft: rgba(255, 138, 122, 0.13);\n --fd-success: #6fd08e;\n --fd-success-soft: rgba(111, 208, 142, 0.14);\n --fd-warning: #f2b55c;\n --fd-warning-soft: rgba(242, 181, 92, 0.13);\n --fd-info: #7db7ff;\n --fd-info-soft: rgba(90, 162, 255, 0.14);\n --fd-edge: #59616c;\n}\n/* Auto follows the reader's system: the same dark tokens, when it is dark. */\n@media (prefers-color-scheme: dark) {\n :is(.fd-form, .fd-form-dialog)[data-scheme=\"auto\"] {\n color-scheme: dark;\n --fd-text: #e8eaed;\n --fd-muted: #a3a9b2;\n --fd-page: #16191e;\n --fd-surface: #1f2329;\n --fd-border: #3a4048;\n --fd-border-strong: #59616c;\n --fd-accent: #5aa2ff;\n --fd-accent-text: #0b1220;\n --fd-accent-soft: rgba(90, 162, 255, 0.16);\n --fd-focus: #5aa2ff;\n --fd-error: #ff8a7a;\n --fd-error-soft: rgba(255, 138, 122, 0.13);\n --fd-success: #6fd08e;\n --fd-success-soft: rgba(111, 208, 142, 0.14);\n --fd-warning: #f2b55c;\n --fd-warning-soft: rgba(242, 181, 92, 0.13);\n --fd-info: #7db7ff;\n --fd-info-soft: rgba(90, 162, 255, 0.14);\n --fd-edge: #59616c;\n }\n}\n\n/* The page's accent, and the softer and hover shades mixed from it on whatever surface the scheme has. */\n:is(.fd-form, .fd-form-dialog)[data-accent] {\n --fd-accent: var(--fd-look-accent);\n --fd-accent-text: var(--fd-look-accent-text);\n --fd-focus: var(--fd-look-accent);\n --fd-accent-soft: color-mix(in srgb, var(--fd-accent) 12%, var(--fd-surface));\n --fd-accent-hover: color-mix(in srgb, var(--fd-accent) 84%, var(--fd-text));\n}\n/* On a dark page, the accent the viewer lightened, when it had to be, so it still reads there. */\n:is(.fd-form, .fd-form-dialog)[data-scheme=\"dark\"][data-accent] {\n --fd-accent: var(--fd-look-accent-dark);\n --fd-accent-text: var(--fd-look-accent-dark-text);\n --fd-focus: var(--fd-look-accent-dark);\n}\n@media (prefers-color-scheme: dark) {\n :is(.fd-form, .fd-form-dialog)[data-scheme=\"auto\"][data-accent] {\n --fd-accent: var(--fd-look-accent-dark);\n --fd-accent-text: var(--fd-look-accent-dark-text);\n --fd-focus: var(--fd-look-accent-dark);\n }\n}\n:is(.fd-form, .fd-form-dialog)[data-fd-skin=\"outlined\"][data-accent] { --fd-focus-ring: 0 0 0 2px color-mix(in srgb, var(--fd-accent) 22%, transparent); }\n:is(.fd-form, .fd-form-dialog)[data-accent] .fd-button-primary:hover { filter: none; background: var(--fd-accent-hover); border-color: var(--fd-accent-hover); }\n/* A band of the accent under the page's title. */\n.fd-form[data-accent] .fd-page-head { border-block-end: 3px solid var(--fd-accent); padding-block-end: 14px; }\n";
|
|
11
|
+
export declare const LAYOUT_CSS = "\n/* ---- arrangements: parts side by side or one under another, nothing drawn round them ---- */\n/* On its grid's columns: the grid's own tracks and gaps, so its parts line up with everything above and below. */\n.fd-grid > .fd-section[data-place=\"tracks\"] {\n /* The columns it covers: its span, never more than its grid has at this width. */\n --fd-tracks: min(var(--fd-span, 1), var(--fd-cols));\n grid-template-columns: subgrid;\n column-gap: var(--fd-gap-x);\n}\n.fd-form .fd-section[data-place=\"tracks\"] > .fd-grid { --fd-cols: var(--fd-tracks); grid-column: 1 / -1; grid-template-columns: subgrid; }\n.fd-section[data-place] > .fd-section-description { grid-column: 1 / -1; }\n/* Parts sharing one cell, side by side; one under the other where the cell is too narrow for that. */\n.fd-grid > .fd-section[data-place=\"shared\"] { container-type: inline-size; }\n.fd-form .fd-section[data-place=\"shared\"] > .fd-grid { --fd-cols: var(--fd-columns, 1); }\n@container (max-width: 330px) {\n .fd-form .fd-section[data-place=\"shared\"] > .fd-grid { --fd-cols: 1; }\n}\n\n/* ---- how a group is drawn: a card, plain, a line under its title, or a frame round it ---- */\n/* A group of its own paints the ground it stands on, so nothing of the grid round it shows through. */\n.fd-form { --fd-ground: transparent; }\n.fd-card, .fd-form[data-fd-skin=\"outlined\"] .fd-section[data-style=\"card\"][data-on-page] { --fd-ground: var(--fd-surface); }\nfieldset.fd-section[data-style] { background-color: var(--fd-ground); }\n.fd-form .fd-section[data-style=\"line\"] > .fd-section-title { border-block-end: 1px solid var(--fd-border); padding-block-end: 8px; }\n.fd-form .fd-section[data-style=\"plain\"] > .fd-section-title { border-block-end: 0; padding-block-end: 0; }\n.fd-form .fd-section[data-style=\"framed\"] {\n border: 1px solid var(--fd-border); border-radius: var(--fd-control-radius); padding: 6px 18px 18px;\n}\n/* The title sits on the frame, as a fieldset's legend does: the frame breaks round it. */\n.fd-form .fd-section[data-style=\"framed\"] > .fd-section-title {\n float: none; width: auto; max-width: 100%; padding: 0 6px; margin-inline-start: -6px; border: 0;\n}\n\n/* ---- where labels sit: as the page, a group or the field itself says (data-labels), in either skin ---- */\n.fd-form .fd-field[data-labels] { grid-template-columns: minmax(0, 1fr); }\n.fd-form .fd-field[data-labels] > * { grid-column: 1 / -1; }\n/* Beside: the label in a column of its own while the field has room for both. In a cell narrower\n than that the label goes back above its box, so the box is never crushed. */\n.fd-form .fd-field[data-labels=\"beside\"] {\n container-type: inline-size;\n grid-template-columns: minmax(0, var(--fd-label-width, 140px)) minmax(0, 1fr);\n column-gap: 14px;\n}\n@container (min-width: 300px) {\n .fd-form .fd-field[data-labels=\"beside\"] > .fd-label {\n grid-column: 1; align-self: start; padding-block-start: max(0px, calc((var(--fd-control-height, 30px) - 1.45em) / 2));\n }\n .fd-form .fd-field[data-labels=\"beside\"] > :not(.fd-label) { grid-column: 2; }\n}\n/* Hidden: out of sight, still the box's name for a screen reader; the empty box shows it instead. */\n.fd-form .fd-field[data-labels=\"hidden\"] > .fd-label {\n position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;\n}\n/* After: a tick box, then its words on the same line, as a sentence; its help and messages under the words. They\n drop to sit level with the boxes beside them in a row, by margins: the field's own padding is left to whoever\n draws round it (a designer's canvas rings a part there). */\n.fd-form .fd-field[data-labels=\"after\"] {\n grid-template-columns: auto minmax(0, 1fr); column-gap: 9px; align-items: start;\n --fd-tick-drop: max(0px, calc((var(--fd-control-height, 30px) - 1.45em) / 2));\n}\n/* The box, or what holds it (a designer's canvas wraps each answer box). */\n.fd-form .fd-field[data-labels=\"after\"] > :is(.fd-tick, :has(> .fd-tick)) { grid-column: 1; grid-row: 1; display: flex; margin-block-start: calc(var(--fd-tick-drop) + (1.45em - 17px) / 2); }\n.fd-form .fd-field[data-labels=\"after\"] .fd-tick { width: 17px; height: 17px; }\n.fd-form .fd-field[data-labels=\"after\"] > :not(.fd-tick, :has(> .fd-tick)) { grid-column: 2; }\n.fd-form .fd-field[data-labels=\"after\"] > .fd-label { grid-row: 1; margin-block-start: var(--fd-tick-drop); font-weight: inherit; line-height: 1.45; cursor: pointer; }\n/* A field or a cell that measures itself is drawn over its neighbours while it is worked in: its lists and calendars open over them. */\n.fd-form .fd-field[data-labels=\"beside\"]:focus-within, .fd-grid > .fd-section[data-place=\"shared\"]:focus-within { z-index: 3; }\n\n/* ---- widths for tabs, words and buttons: they span columns like fields; a button stays as wide as its words ---- */\n:is(.fd-grid, .fd-sections) > .fd-button { justify-self: start; }\n/* A note: words set apart in a soft panel, a shade off whatever it stands on \u2014 a card, the page, or the dark. */\n.fd-form .fd-text-note { background: color-mix(in srgb, var(--fd-text) 6%, transparent); color: var(--fd-text); border-radius: var(--fd-control-radius, 6px); padding: 10px 12px; }\n\n/* ---- the page's look: worn by the form, and by a dialog it opens (its box and the page in it) ----\n Its tokens in Fieldia's tokens' layer (styles.ts): a host's own rule sets them over the page's. */\n@layer fieldia-tokens {\n:is(.fd-form, .fd-form-dialog)[data-font=\"serif\"] { --fd-font: \"Source Serif 4\", Georgia, serif; }\n:is(.fd-form, .fd-form-dialog)[data-font=\"rounded\"] { --fd-font: Nunito, \"Varela Round\", system-ui; }\n/* Room between and inside parts: gaps, the height of a box, a group's padding, the space between groups. */\n:is(.fd-form, .fd-form-dialog)[data-density=\"compact\"] { --fd-gap-y: 10px; --fd-gap-x: 16px; --fd-control-height: 30px; --fd-gap-block: 16px; --fd-group-pad: 14px 16px; }\n:is(.fd-form, .fd-form-dialog)[data-density=\"comfortable\"] { --fd-gap-y: 16px; --fd-gap-x: 20px; --fd-control-height: 36px; --fd-gap-block: 22px; --fd-group-pad: 18px 22px; }\n:is(.fd-form, .fd-form-dialog)[data-density=\"roomy\"] { --fd-gap-y: 22px; --fd-gap-x: 28px; --fd-control-height: 42px; --fd-gap-block: 30px; --fd-group-pad: 24px 30px; }\n:is(.fd-form, .fd-form-dialog)[data-corners=\"square\"] { --fd-radius: 0px; --fd-control-radius: 0px; }\n:is(.fd-form, .fd-form-dialog)[data-corners=\"soft\"] { --fd-radius: 10px; --fd-control-radius: 6px; }\n:is(.fd-form, .fd-form-dialog)[data-corners=\"round\"] { --fd-radius: 16px; --fd-control-radius: 12px; }\n.fd-form[data-scheme] { --fd-ground: var(--fd-page); }\n}\n\n/* Light or dark: a page that names its scheme paints its own ground, so it reads the same on any page round it.\n Its native controls (scroll bars, date pickers) follow it. */\n.fd-form[data-scheme] { color-scheme: light; background: var(--fd-page); color: var(--fd-text); border-radius: var(--fd-radius); }\n:is(.fd-form, .fd-form-dialog)[data-scheme=\"dark\"] { color-scheme: dark; }\n@media (prefers-color-scheme: dark) { :is(.fd-form, .fd-form-dialog)[data-scheme=\"auto\"] { color-scheme: dark; } }\n.fd-form[data-scheme] > .fd-content:not(:has(> .fd-sheet-page)) { padding: 20px; }\n/* A page in a dialog paints no ground of its own and adds no room: the dialog is its ground. */\n.fd-form-dialog-body > .fd-form[data-scheme] { background: none; border-radius: 0; }\n.fd-form-dialog-body > .fd-form[data-scheme] > .fd-content:not(:has(> .fd-sheet-page)) { padding: 0; }\n@layer fieldia-tokens {\n:is(.fd-form, .fd-form-dialog)[data-scheme=\"dark\"] {\n --fd-text: #e8eaed;\n --fd-muted: #a3a9b2;\n --fd-page: #16191e;\n --fd-surface: #1f2329;\n --fd-border: #3a4048;\n --fd-border-strong: #59616c;\n --fd-accent: #5aa2ff;\n --fd-accent-text: #0b1220;\n --fd-accent-soft: rgba(90, 162, 255, 0.16);\n --fd-focus: #5aa2ff;\n --fd-error: #ff8a7a;\n --fd-error-soft: rgba(255, 138, 122, 0.13);\n --fd-success: #6fd08e;\n --fd-success-soft: rgba(111, 208, 142, 0.14);\n --fd-warning: #f2b55c;\n --fd-warning-soft: rgba(242, 181, 92, 0.13);\n --fd-info: #7db7ff;\n --fd-info-soft: rgba(90, 162, 255, 0.14);\n --fd-edge: #59616c;\n}\n/* Auto follows the reader's system: the same dark tokens, when it is dark. */\n@media (prefers-color-scheme: dark) {\n :is(.fd-form, .fd-form-dialog)[data-scheme=\"auto\"] {\n --fd-text: #e8eaed;\n --fd-muted: #a3a9b2;\n --fd-page: #16191e;\n --fd-surface: #1f2329;\n --fd-border: #3a4048;\n --fd-border-strong: #59616c;\n --fd-accent: #5aa2ff;\n --fd-accent-text: #0b1220;\n --fd-accent-soft: rgba(90, 162, 255, 0.16);\n --fd-focus: #5aa2ff;\n --fd-error: #ff8a7a;\n --fd-error-soft: rgba(255, 138, 122, 0.13);\n --fd-success: #6fd08e;\n --fd-success-soft: rgba(111, 208, 142, 0.14);\n --fd-warning: #f2b55c;\n --fd-warning-soft: rgba(242, 181, 92, 0.13);\n --fd-info: #7db7ff;\n --fd-info-soft: rgba(90, 162, 255, 0.14);\n --fd-edge: #59616c;\n }\n}\n\n/* The page's accent, and the softer and hover shades mixed from it on whatever surface the scheme has. */\n:is(.fd-form, .fd-form-dialog)[data-accent] {\n --fd-accent: var(--fd-look-accent);\n --fd-accent-text: var(--fd-look-accent-text);\n --fd-focus: var(--fd-look-accent);\n --fd-accent-soft: color-mix(in srgb, var(--fd-accent) 12%, var(--fd-surface));\n --fd-accent-hover: color-mix(in srgb, var(--fd-accent) 84%, var(--fd-text));\n}\n/* On a dark page, the accent the viewer lightened, when it had to be, so it still reads there. */\n:is(.fd-form, .fd-form-dialog)[data-scheme=\"dark\"][data-accent] {\n --fd-accent: var(--fd-look-accent-dark);\n --fd-accent-text: var(--fd-look-accent-dark-text);\n --fd-focus: var(--fd-look-accent-dark);\n}\n@media (prefers-color-scheme: dark) {\n :is(.fd-form, .fd-form-dialog)[data-scheme=\"auto\"][data-accent] {\n --fd-accent: var(--fd-look-accent-dark);\n --fd-accent-text: var(--fd-look-accent-dark-text);\n --fd-focus: var(--fd-look-accent-dark);\n }\n}\n:is(.fd-form, .fd-form-dialog)[data-fd-skin=\"outlined\"][data-accent] { --fd-focus-ring: 0 0 0 2px color-mix(in srgb, var(--fd-accent) 22%, transparent); }\n}\n:is(.fd-form, .fd-form-dialog)[data-accent] .fd-button-primary:hover { filter: none; background: var(--fd-accent-hover); border-color: var(--fd-accent-hover); }\n/* A band of the accent under the page's title. */\n.fd-form[data-accent] .fd-page-head { border-block-end: 3px solid var(--fd-accent); padding-block-end: 14px; }\n";
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Logical properties throughout, so right to left mirrors on its own.
|
|
10
10
|
*/
|
|
11
|
-
export declare const LAYOUT_CSS = "\n/* ---- arrangements: parts side by side or one under another, nothing drawn round them ---- */\n/* On its grid's columns: the grid's own tracks and gaps, so its parts line up with everything above and below. */\n.fd-grid > .fd-section[data-place=\"tracks\"] {\n /* The columns it covers: its span, never more than its grid has at this width. */\n --fd-tracks: min(var(--fd-span, 1), var(--fd-cols));\n grid-template-columns: subgrid;\n column-gap: var(--fd-gap-x);\n}\n.fd-form .fd-section[data-place=\"tracks\"] > .fd-grid { --fd-cols: var(--fd-tracks); grid-column: 1 / -1; grid-template-columns: subgrid; }\n.fd-section[data-place] > .fd-section-description { grid-column: 1 / -1; }\n/* Parts sharing one cell, side by side; one under the other where the cell is too narrow for that. */\n.fd-grid > .fd-section[data-place=\"shared\"] { container-type: inline-size; }\n.fd-form .fd-section[data-place=\"shared\"] > .fd-grid { --fd-cols: var(--fd-columns, 1); }\n@container (max-width: 330px) {\n .fd-form .fd-section[data-place=\"shared\"] > .fd-grid { --fd-cols: 1; }\n}\n\n/* ---- how a group is drawn: a card, plain, a line under its title, or a frame round it ---- */\n/* A group of its own paints the ground it stands on, so nothing of the grid round it shows through. */\n.fd-form { --fd-ground: transparent; }\n.fd-card, .fd-form[data-fd-skin=\"outlined\"] .fd-section[data-style=\"card\"][data-on-page] { --fd-ground: var(--fd-surface); }\nfieldset.fd-section[data-style] { background-color: var(--fd-ground); }\n.fd-form .fd-section[data-style=\"line\"] > .fd-section-title { border-block-end: 1px solid var(--fd-border); padding-block-end: 8px; }\n.fd-form .fd-section[data-style=\"plain\"] > .fd-section-title { border-block-end: 0; padding-block-end: 0; }\n.fd-form .fd-section[data-style=\"framed\"] {\n border: 1px solid var(--fd-border); border-radius: var(--fd-control-radius); padding: 6px 18px 18px;\n}\n/* The title sits on the frame, as a fieldset's legend does: the frame breaks round it. */\n.fd-form .fd-section[data-style=\"framed\"] > .fd-section-title {\n float: none; width: auto; max-width: 100%; padding: 0 6px; margin-inline-start: -6px; border: 0;\n}\n\n/* ---- where labels sit: as the page, a group or the field itself says (data-labels), in either skin ---- */\n.fd-form .fd-field[data-labels] { grid-template-columns: minmax(0, 1fr); }\n.fd-form .fd-field[data-labels] > * { grid-column: 1 / -1; }\n/* Beside: the label in a column of its own while the field has room for both. In a cell narrower\n than that the label goes back above its box, so the box is never crushed. */\n.fd-form .fd-field[data-labels=\"beside\"] {\n container-type: inline-size;\n grid-template-columns: minmax(0, var(--fd-label-width, 140px)) minmax(0, 1fr);\n column-gap: 14px;\n}\n@container (min-width: 300px) {\n .fd-form .fd-field[data-labels=\"beside\"] > .fd-label {\n grid-column: 1; align-self: start; padding-block-start: max(0px, calc((var(--fd-control-height, 30px) - 1.45em) / 2));\n }\n .fd-form .fd-field[data-labels=\"beside\"] > :not(.fd-label) { grid-column: 2; }\n}\n/* Hidden: out of sight, still the box's name for a screen reader; the empty box shows it instead. */\n.fd-form .fd-field[data-labels=\"hidden\"] > .fd-label {\n position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;\n}\n/* After: a tick box, then its words on the same line, as a sentence; its help and messages under the words. They\n drop to sit level with the boxes beside them in a row, by margins: the field's own padding is left to whoever\n draws round it (a designer's canvas rings a part there). */\n.fd-form .fd-field[data-labels=\"after\"] {\n grid-template-columns: auto minmax(0, 1fr); column-gap: 9px; align-items: start;\n --fd-tick-drop: max(0px, calc((var(--fd-control-height, 30px) - 1.45em) / 2));\n}\n/* The box, or what holds it (a designer's canvas wraps each answer box). */\n.fd-form .fd-field[data-labels=\"after\"] > :is(.fd-tick, :has(> .fd-tick)) { grid-column: 1; grid-row: 1; display: flex; margin-block-start: calc(var(--fd-tick-drop) + (1.45em - 17px) / 2); }\n.fd-form .fd-field[data-labels=\"after\"] .fd-tick { width: 17px; height: 17px; }\n.fd-form .fd-field[data-labels=\"after\"] > :not(.fd-tick, :has(> .fd-tick)) { grid-column: 2; }\n.fd-form .fd-field[data-labels=\"after\"] > .fd-label { grid-row: 1; margin-block-start: var(--fd-tick-drop); font-weight: inherit; line-height: 1.45; cursor: pointer; }\n/* A field or a cell that measures itself is drawn over its neighbours while it is worked in: its lists and calendars open over them. */\n.fd-form .fd-field[data-labels=\"beside\"]:focus-within, .fd-grid > .fd-section[data-place=\"shared\"]:focus-within { z-index: 3; }\n\n/* ---- widths for tabs, words and buttons: they span columns like fields; a button stays as wide as its words ---- */\n:is(.fd-grid, .fd-sections) > .fd-button { justify-self: start; }\n/* A note: words set apart in a soft panel, a shade off whatever it stands on \u2014 a card, the page, or the dark. */\n.fd-form .fd-text-note { background: color-mix(in srgb, var(--fd-text) 6%, transparent); color: var(--fd-text); border-radius: var(--fd-control-radius, 6px); padding: 10px 12px; }\n\n/* ---- the page's look: worn by the form, and by a dialog it opens (its box and the page in it) ---- */\n:is(.fd-form, .fd-form-dialog)[data-font=\"serif\"] { --fd-font: \"Source Serif 4\", Georgia, serif; }\n:is(.fd-form, .fd-form-dialog)[data-font=\"rounded\"] { --fd-font: Nunito, \"Varela Round\", system-ui; }\n/* Room between and inside parts: gaps, the height of a box, a group's padding, the space between groups. */\n:is(.fd-form, .fd-form-dialog)[data-density=\"compact\"] { --fd-gap-y: 10px; --fd-gap-x: 16px; --fd-control-height: 30px; --fd-gap-block: 16px; --fd-group-pad: 14px 16px; }\n:is(.fd-form, .fd-form-dialog)[data-density=\"comfortable\"] { --fd-gap-y: 16px; --fd-gap-x: 20px; --fd-control-height: 36px; --fd-gap-block: 22px; --fd-group-pad: 18px 22px; }\n:is(.fd-form, .fd-form-dialog)[data-density=\"roomy\"] { --fd-gap-y: 22px; --fd-gap-x: 28px; --fd-control-height: 42px; --fd-gap-block: 30px; --fd-group-pad: 24px 30px; }\n:is(.fd-form, .fd-form-dialog)[data-corners=\"square\"] { --fd-radius: 0px; --fd-control-radius: 0px; }\n:is(.fd-form, .fd-form-dialog)[data-corners=\"soft\"] { --fd-radius: 10px; --fd-control-radius: 6px; }\n:is(.fd-form, .fd-form-dialog)[data-corners=\"round\"] { --fd-radius: 16px; --fd-control-radius: 12px; }\n\n/* Light or dark: a page that names its scheme paints its own ground, so it reads the same on any page round it. */\n.fd-form[data-scheme] { color-scheme: light; background: var(--fd-page); color: var(--fd-text); border-radius: var(--fd-radius); --fd-ground: var(--fd-page); }\n.fd-form[data-scheme] > .fd-content:not(:has(> .fd-sheet-page)) { padding: 20px; }\n/* A page in a dialog paints no ground of its own and adds no room: the dialog is its ground. */\n.fd-form-dialog-body > .fd-form[data-scheme] { background: none; border-radius: 0; }\n.fd-form-dialog-body > .fd-form[data-scheme] > .fd-content:not(:has(> .fd-sheet-page)) { padding: 0; }\n:is(.fd-form, .fd-form-dialog)[data-scheme=\"dark\"] {\n color-scheme: dark;\n --fd-text: #e8eaed;\n --fd-muted: #a3a9b2;\n --fd-page: #16191e;\n --fd-surface: #1f2329;\n --fd-border: #3a4048;\n --fd-border-strong: #59616c;\n --fd-accent: #5aa2ff;\n --fd-accent-text: #0b1220;\n --fd-accent-soft: rgba(90, 162, 255, 0.16);\n --fd-focus: #5aa2ff;\n --fd-error: #ff8a7a;\n --fd-error-soft: rgba(255, 138, 122, 0.13);\n --fd-success: #6fd08e;\n --fd-success-soft: rgba(111, 208, 142, 0.14);\n --fd-warning: #f2b55c;\n --fd-warning-soft: rgba(242, 181, 92, 0.13);\n --fd-info: #7db7ff;\n --fd-info-soft: rgba(90, 162, 255, 0.14);\n --fd-edge: #59616c;\n}\n/* Auto follows the reader's system: the same dark tokens, when it is dark. */\n@media (prefers-color-scheme: dark) {\n :is(.fd-form, .fd-form-dialog)[data-scheme=\"auto\"] {\n color-scheme: dark;\n --fd-text: #e8eaed;\n --fd-muted: #a3a9b2;\n --fd-page: #16191e;\n --fd-surface: #1f2329;\n --fd-border: #3a4048;\n --fd-border-strong: #59616c;\n --fd-accent: #5aa2ff;\n --fd-accent-text: #0b1220;\n --fd-accent-soft: rgba(90, 162, 255, 0.16);\n --fd-focus: #5aa2ff;\n --fd-error: #ff8a7a;\n --fd-error-soft: rgba(255, 138, 122, 0.13);\n --fd-success: #6fd08e;\n --fd-success-soft: rgba(111, 208, 142, 0.14);\n --fd-warning: #f2b55c;\n --fd-warning-soft: rgba(242, 181, 92, 0.13);\n --fd-info: #7db7ff;\n --fd-info-soft: rgba(90, 162, 255, 0.14);\n --fd-edge: #59616c;\n }\n}\n\n/* The page's accent, and the softer and hover shades mixed from it on whatever surface the scheme has. */\n:is(.fd-form, .fd-form-dialog)[data-accent] {\n --fd-accent: var(--fd-look-accent);\n --fd-accent-text: var(--fd-look-accent-text);\n --fd-focus: var(--fd-look-accent);\n --fd-accent-soft: color-mix(in srgb, var(--fd-accent) 12%, var(--fd-surface));\n --fd-accent-hover: color-mix(in srgb, var(--fd-accent) 84%, var(--fd-text));\n}\n/* On a dark page, the accent the viewer lightened, when it had to be, so it still reads there. */\n:is(.fd-form, .fd-form-dialog)[data-scheme=\"dark\"][data-accent] {\n --fd-accent: var(--fd-look-accent-dark);\n --fd-accent-text: var(--fd-look-accent-dark-text);\n --fd-focus: var(--fd-look-accent-dark);\n}\n@media (prefers-color-scheme: dark) {\n :is(.fd-form, .fd-form-dialog)[data-scheme=\"auto\"][data-accent] {\n --fd-accent: var(--fd-look-accent-dark);\n --fd-accent-text: var(--fd-look-accent-dark-text);\n --fd-focus: var(--fd-look-accent-dark);\n }\n}\n:is(.fd-form, .fd-form-dialog)[data-fd-skin=\"outlined\"][data-accent] { --fd-focus-ring: 0 0 0 2px color-mix(in srgb, var(--fd-accent) 22%, transparent); }\n:is(.fd-form, .fd-form-dialog)[data-accent] .fd-button-primary:hover { filter: none; background: var(--fd-accent-hover); border-color: var(--fd-accent-hover); }\n/* A band of the accent under the page's title. */\n.fd-form[data-accent] .fd-page-head { border-block-end: 3px solid var(--fd-accent); padding-block-end: 14px; }\n";
|
|
11
|
+
export declare const LAYOUT_CSS = "\n/* ---- arrangements: parts side by side or one under another, nothing drawn round them ---- */\n/* On its grid's columns: the grid's own tracks and gaps, so its parts line up with everything above and below. */\n.fd-grid > .fd-section[data-place=\"tracks\"] {\n /* The columns it covers: its span, never more than its grid has at this width. */\n --fd-tracks: min(var(--fd-span, 1), var(--fd-cols));\n grid-template-columns: subgrid;\n column-gap: var(--fd-gap-x);\n}\n.fd-form .fd-section[data-place=\"tracks\"] > .fd-grid { --fd-cols: var(--fd-tracks); grid-column: 1 / -1; grid-template-columns: subgrid; }\n.fd-section[data-place] > .fd-section-description { grid-column: 1 / -1; }\n/* Parts sharing one cell, side by side; one under the other where the cell is too narrow for that. */\n.fd-grid > .fd-section[data-place=\"shared\"] { container-type: inline-size; }\n.fd-form .fd-section[data-place=\"shared\"] > .fd-grid { --fd-cols: var(--fd-columns, 1); }\n@container (max-width: 330px) {\n .fd-form .fd-section[data-place=\"shared\"] > .fd-grid { --fd-cols: 1; }\n}\n\n/* ---- how a group is drawn: a card, plain, a line under its title, or a frame round it ---- */\n/* A group of its own paints the ground it stands on, so nothing of the grid round it shows through. */\n.fd-form { --fd-ground: transparent; }\n.fd-card, .fd-form[data-fd-skin=\"outlined\"] .fd-section[data-style=\"card\"][data-on-page] { --fd-ground: var(--fd-surface); }\nfieldset.fd-section[data-style] { background-color: var(--fd-ground); }\n.fd-form .fd-section[data-style=\"line\"] > .fd-section-title { border-block-end: 1px solid var(--fd-border); padding-block-end: 8px; }\n.fd-form .fd-section[data-style=\"plain\"] > .fd-section-title { border-block-end: 0; padding-block-end: 0; }\n.fd-form .fd-section[data-style=\"framed\"] {\n border: 1px solid var(--fd-border); border-radius: var(--fd-control-radius); padding: 6px 18px 18px;\n}\n/* The title sits on the frame, as a fieldset's legend does: the frame breaks round it. */\n.fd-form .fd-section[data-style=\"framed\"] > .fd-section-title {\n float: none; width: auto; max-width: 100%; padding: 0 6px; margin-inline-start: -6px; border: 0;\n}\n\n/* ---- where labels sit: as the page, a group or the field itself says (data-labels), in either skin ---- */\n.fd-form .fd-field[data-labels] { grid-template-columns: minmax(0, 1fr); }\n.fd-form .fd-field[data-labels] > * { grid-column: 1 / -1; }\n/* Beside: the label in a column of its own while the field has room for both. In a cell narrower\n than that the label goes back above its box, so the box is never crushed. */\n.fd-form .fd-field[data-labels=\"beside\"] {\n container-type: inline-size;\n grid-template-columns: minmax(0, var(--fd-label-width, 140px)) minmax(0, 1fr);\n column-gap: 14px;\n}\n@container (min-width: 300px) {\n .fd-form .fd-field[data-labels=\"beside\"] > .fd-label {\n grid-column: 1; align-self: start; padding-block-start: max(0px, calc((var(--fd-control-height, 30px) - 1.45em) / 2));\n }\n .fd-form .fd-field[data-labels=\"beside\"] > :not(.fd-label) { grid-column: 2; }\n}\n/* Hidden: out of sight, still the box's name for a screen reader; the empty box shows it instead. */\n.fd-form .fd-field[data-labels=\"hidden\"] > .fd-label {\n position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;\n}\n/* After: a tick box, then its words on the same line, as a sentence; its help and messages under the words. They\n drop to sit level with the boxes beside them in a row, by margins: the field's own padding is left to whoever\n draws round it (a designer's canvas rings a part there). */\n.fd-form .fd-field[data-labels=\"after\"] {\n grid-template-columns: auto minmax(0, 1fr); column-gap: 9px; align-items: start;\n --fd-tick-drop: max(0px, calc((var(--fd-control-height, 30px) - 1.45em) / 2));\n}\n/* The box, or what holds it (a designer's canvas wraps each answer box). */\n.fd-form .fd-field[data-labels=\"after\"] > :is(.fd-tick, :has(> .fd-tick)) { grid-column: 1; grid-row: 1; display: flex; margin-block-start: calc(var(--fd-tick-drop) + (1.45em - 17px) / 2); }\n.fd-form .fd-field[data-labels=\"after\"] .fd-tick { width: 17px; height: 17px; }\n.fd-form .fd-field[data-labels=\"after\"] > :not(.fd-tick, :has(> .fd-tick)) { grid-column: 2; }\n.fd-form .fd-field[data-labels=\"after\"] > .fd-label { grid-row: 1; margin-block-start: var(--fd-tick-drop); font-weight: inherit; line-height: 1.45; cursor: pointer; }\n/* A field or a cell that measures itself is drawn over its neighbours while it is worked in: its lists and calendars open over them. */\n.fd-form .fd-field[data-labels=\"beside\"]:focus-within, .fd-grid > .fd-section[data-place=\"shared\"]:focus-within { z-index: 3; }\n\n/* ---- widths for tabs, words and buttons: they span columns like fields; a button stays as wide as its words ---- */\n:is(.fd-grid, .fd-sections) > .fd-button { justify-self: start; }\n/* A note: words set apart in a soft panel, a shade off whatever it stands on \u2014 a card, the page, or the dark. */\n.fd-form .fd-text-note { background: color-mix(in srgb, var(--fd-text) 6%, transparent); color: var(--fd-text); border-radius: var(--fd-control-radius, 6px); padding: 10px 12px; }\n\n/* ---- the page's look: worn by the form, and by a dialog it opens (its box and the page in it) ----\n Its tokens in Fieldia's tokens' layer (styles.ts): a host's own rule sets them over the page's. */\n@layer fieldia-tokens {\n:is(.fd-form, .fd-form-dialog)[data-font=\"serif\"] { --fd-font: \"Source Serif 4\", Georgia, serif; }\n:is(.fd-form, .fd-form-dialog)[data-font=\"rounded\"] { --fd-font: Nunito, \"Varela Round\", system-ui; }\n/* Room between and inside parts: gaps, the height of a box, a group's padding, the space between groups. */\n:is(.fd-form, .fd-form-dialog)[data-density=\"compact\"] { --fd-gap-y: 10px; --fd-gap-x: 16px; --fd-control-height: 30px; --fd-gap-block: 16px; --fd-group-pad: 14px 16px; }\n:is(.fd-form, .fd-form-dialog)[data-density=\"comfortable\"] { --fd-gap-y: 16px; --fd-gap-x: 20px; --fd-control-height: 36px; --fd-gap-block: 22px; --fd-group-pad: 18px 22px; }\n:is(.fd-form, .fd-form-dialog)[data-density=\"roomy\"] { --fd-gap-y: 22px; --fd-gap-x: 28px; --fd-control-height: 42px; --fd-gap-block: 30px; --fd-group-pad: 24px 30px; }\n:is(.fd-form, .fd-form-dialog)[data-corners=\"square\"] { --fd-radius: 0px; --fd-control-radius: 0px; }\n:is(.fd-form, .fd-form-dialog)[data-corners=\"soft\"] { --fd-radius: 10px; --fd-control-radius: 6px; }\n:is(.fd-form, .fd-form-dialog)[data-corners=\"round\"] { --fd-radius: 16px; --fd-control-radius: 12px; }\n.fd-form[data-scheme] { --fd-ground: var(--fd-page); }\n}\n\n/* Light or dark: a page that names its scheme paints its own ground, so it reads the same on any page round it.\n Its native controls (scroll bars, date pickers) follow it. */\n.fd-form[data-scheme] { color-scheme: light; background: var(--fd-page); color: var(--fd-text); border-radius: var(--fd-radius); }\n:is(.fd-form, .fd-form-dialog)[data-scheme=\"dark\"] { color-scheme: dark; }\n@media (prefers-color-scheme: dark) { :is(.fd-form, .fd-form-dialog)[data-scheme=\"auto\"] { color-scheme: dark; } }\n.fd-form[data-scheme] > .fd-content:not(:has(> .fd-sheet-page)) { padding: 20px; }\n/* A page in a dialog paints no ground of its own and adds no room: the dialog is its ground. */\n.fd-form-dialog-body > .fd-form[data-scheme] { background: none; border-radius: 0; }\n.fd-form-dialog-body > .fd-form[data-scheme] > .fd-content:not(:has(> .fd-sheet-page)) { padding: 0; }\n@layer fieldia-tokens {\n:is(.fd-form, .fd-form-dialog)[data-scheme=\"dark\"] {\n --fd-text: #e8eaed;\n --fd-muted: #a3a9b2;\n --fd-page: #16191e;\n --fd-surface: #1f2329;\n --fd-border: #3a4048;\n --fd-border-strong: #59616c;\n --fd-accent: #5aa2ff;\n --fd-accent-text: #0b1220;\n --fd-accent-soft: rgba(90, 162, 255, 0.16);\n --fd-focus: #5aa2ff;\n --fd-error: #ff8a7a;\n --fd-error-soft: rgba(255, 138, 122, 0.13);\n --fd-success: #6fd08e;\n --fd-success-soft: rgba(111, 208, 142, 0.14);\n --fd-warning: #f2b55c;\n --fd-warning-soft: rgba(242, 181, 92, 0.13);\n --fd-info: #7db7ff;\n --fd-info-soft: rgba(90, 162, 255, 0.14);\n --fd-edge: #59616c;\n}\n/* Auto follows the reader's system: the same dark tokens, when it is dark. */\n@media (prefers-color-scheme: dark) {\n :is(.fd-form, .fd-form-dialog)[data-scheme=\"auto\"] {\n --fd-text: #e8eaed;\n --fd-muted: #a3a9b2;\n --fd-page: #16191e;\n --fd-surface: #1f2329;\n --fd-border: #3a4048;\n --fd-border-strong: #59616c;\n --fd-accent: #5aa2ff;\n --fd-accent-text: #0b1220;\n --fd-accent-soft: rgba(90, 162, 255, 0.16);\n --fd-focus: #5aa2ff;\n --fd-error: #ff8a7a;\n --fd-error-soft: rgba(255, 138, 122, 0.13);\n --fd-success: #6fd08e;\n --fd-success-soft: rgba(111, 208, 142, 0.14);\n --fd-warning: #f2b55c;\n --fd-warning-soft: rgba(242, 181, 92, 0.13);\n --fd-info: #7db7ff;\n --fd-info-soft: rgba(90, 162, 255, 0.14);\n --fd-edge: #59616c;\n }\n}\n\n/* The page's accent, and the softer and hover shades mixed from it on whatever surface the scheme has. */\n:is(.fd-form, .fd-form-dialog)[data-accent] {\n --fd-accent: var(--fd-look-accent);\n --fd-accent-text: var(--fd-look-accent-text);\n --fd-focus: var(--fd-look-accent);\n --fd-accent-soft: color-mix(in srgb, var(--fd-accent) 12%, var(--fd-surface));\n --fd-accent-hover: color-mix(in srgb, var(--fd-accent) 84%, var(--fd-text));\n}\n/* On a dark page, the accent the viewer lightened, when it had to be, so it still reads there. */\n:is(.fd-form, .fd-form-dialog)[data-scheme=\"dark\"][data-accent] {\n --fd-accent: var(--fd-look-accent-dark);\n --fd-accent-text: var(--fd-look-accent-dark-text);\n --fd-focus: var(--fd-look-accent-dark);\n}\n@media (prefers-color-scheme: dark) {\n :is(.fd-form, .fd-form-dialog)[data-scheme=\"auto\"][data-accent] {\n --fd-accent: var(--fd-look-accent-dark);\n --fd-accent-text: var(--fd-look-accent-dark-text);\n --fd-focus: var(--fd-look-accent-dark);\n }\n}\n:is(.fd-form, .fd-form-dialog)[data-fd-skin=\"outlined\"][data-accent] { --fd-focus-ring: 0 0 0 2px color-mix(in srgb, var(--fd-accent) 22%, transparent); }\n}\n:is(.fd-form, .fd-form-dialog)[data-accent] .fd-button-primary:hover { filter: none; background: var(--fd-accent-hover); border-color: var(--fd-accent-hover); }\n/* A band of the accent under the page's title. */\n.fd-form[data-accent] .fd-page-head { border-block-end: 3px solid var(--fd-accent); padding-block-end: 14px; }\n";
|