@mistriwork/kit 1.0.0-rc.74 → 1.0.0-rc.77
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/client/brandLook.css +1 -1
- package/dist/client/components/AppList.js +11 -22
- package/dist/client/components/CardsList.js +2 -1
- package/dist/client/components/Chart.d.ts +2 -1
- package/dist/client/components/Chart.js +5 -4
- package/dist/client/components/ChartFigure.js +1 -1
- package/dist/client/components/CopyValue.d.ts +6 -0
- package/dist/client/components/CopyValue.js +23 -0
- package/dist/client/components/FilterTabs.d.ts +53 -0
- package/dist/client/components/FilterTabs.js +23 -0
- package/dist/client/components/NewRecord.js +18 -10
- package/dist/client/components/PageFields.js +9 -2
- package/dist/client/components/PageHeading.js +5 -2
- package/dist/client/components/PageMetrics.js +1 -1
- package/dist/client/components/PageTimeline.js +16 -2
- package/dist/client/components/RecordPicker.js +1 -1
- package/dist/client/components/Value.js +3 -15
- package/dist/client/components/columnPresentation.js +7 -0
- package/dist/client/components/dashboardModel.d.ts +4 -0
- package/dist/client/components/useConditionWords.js +6 -2
- package/dist/client/copy/record/components/CopyValue.d.ts +4 -0
- package/dist/client/copy/record/components/CopyValue.js +6 -0
- package/dist/client/copy/record/components/Value.d.ts +0 -2
- package/dist/client/copy/record/components/Value.js +0 -2
- package/dist/client/features.css +11 -1
- package/dist/client/lumenLook.css +2 -2
- package/dist/client/page.css +13 -9
- package/dist/client/sageLook.css +1 -1
- package/dist/client/structure.css +35 -20
- package/dist/client/style.css +5 -3
- package/dist/client/themeFamilies.css +13 -10
- package/dist/client/tilesLook.css +2 -2
- package/dist/client/visualThemes.css +1 -1
- package/package.json +3 -3
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
:root[data-look-table='banded'] .table-wrap tbody tr:nth-child(even):hover td {
|
|
136
136
|
background: color-mix(in srgb, var(--ink) 6%, var(--band, var(--raised)));
|
|
137
137
|
}
|
|
138
|
-
:root[data-look-tabs='rule'] :is(.tab, :where(body.app-mode) .page-tab)[aria-selected='true'] {
|
|
138
|
+
:root[data-look-tabs='rule'] :is(.tab, :where(body.app-mode) .page-tab):is([aria-selected='true'], [aria-pressed='true']) {
|
|
139
139
|
background: none;
|
|
140
140
|
color: var(--ink);
|
|
141
141
|
border-radius: 0;
|
|
@@ -59,7 +59,7 @@ function oneValue(tail) {
|
|
|
59
59
|
}
|
|
60
60
|
import { useConditionWords } from './useConditionWords.js';
|
|
61
61
|
import { message } from '../messages.js';
|
|
62
|
-
import {
|
|
62
|
+
import { FilterTabs, TabCount } from './FilterTabs.js';
|
|
63
63
|
import { DropGroup, DropItem, DropMenu } from '@mistriwork/ui/DropMenu.js';
|
|
64
64
|
import { FilterRail, FilterSheet } from './FilterRail.js';
|
|
65
65
|
import { clearFacets, facetActive } from './filterRailModel.js';
|
|
@@ -148,13 +148,6 @@ function knownCounts(client) {
|
|
|
148
148
|
lastKnown = known;
|
|
149
149
|
return known;
|
|
150
150
|
}
|
|
151
|
-
/** A tab's badge: its count from the batch, or the grid's own total when the tab is the one on screen. */
|
|
152
|
-
function TabCount({ counted }) {
|
|
153
|
-
// null is a current result with no count, not permission to show an older one.
|
|
154
|
-
const said = counted == null ? '' : `${formatNumber(counted.total)}${counted.capped ? '+' : ''}`;
|
|
155
|
-
/* The number in a box of its own, over the room a tab keeps for it (features.css). */
|
|
156
|
-
return _jsx("span", { className: "tab-count", children: said && _jsx("span", { children: said }) });
|
|
157
|
-
}
|
|
158
151
|
/* The switch's width where a list has drawn one, by the list's table: a list is made again on a change of tab, and
|
|
159
152
|
the room it held would be forgotten with it. */
|
|
160
153
|
const switchRoom = new Map();
|
|
@@ -282,15 +275,6 @@ export function AppList({ entry, spec, navigate, embedded = false, newButton, in
|
|
|
282
275
|
const store = saved.store;
|
|
283
276
|
const savable = !inDashboard && (store === 'shared' || store === 'account');
|
|
284
277
|
const yourLit = yours.findIndex((f) => canonicalize(f.query) === canonicalize(refinement));
|
|
285
|
-
/* The strip fits its row (useTabFold.ts): the list's tabs by their place, then the saved views' heading, then each
|
|
286
|
-
saved view; what does not fit is under More, and the lit one never is. */
|
|
287
|
-
const savedAt = tabs.length + 1;
|
|
288
|
-
const { strip: tabStrip, folded } = useTabFold(tabs.length + (yours.length ? yours.length + 1 : 0), yourLit === -1 ? litTab : savedAt + yourLit);
|
|
289
|
-
const foldMark = (at) => ({
|
|
290
|
-
'data-fold': at,
|
|
291
|
-
'data-folded': folded.has(at) ? '' : undefined,
|
|
292
|
-
'aria-hidden': folded.has(at) || undefined,
|
|
293
|
-
});
|
|
294
278
|
const writeViews = useMutation({
|
|
295
279
|
mutationFn: (change) => writeSavedViews(client, viewKey, change),
|
|
296
280
|
onError: (err) => toast(err.message, 'error'),
|
|
@@ -753,15 +737,20 @@ export function AppList({ entry, spec, navigate, embedded = false, newButton, in
|
|
|
753
737
|
const headTo = ownList && spec.link ? openLink?.(spec.link.view, 'reset', { tab: spec.link.tab }) : undefined;
|
|
754
738
|
const headLink = headTo && spec.link ? (_jsx("a", { className: "applist-link", ...headTo, children: spec.link.label })) : null;
|
|
755
739
|
return (_jsxs(_Fragment, { children: [boundNames.map((name) => (_jsx(DefinedBoxes, { column: name, binding: bound[name], per: bound[name].per ? oneValue(conditionTail(refinement, bound[name].per)) : undefined, onBoxes: onDefinedBoxes }, name))), inBar && createPortal(title, crumbs.note), inBar &&
|
|
756
|
-
createPortal(_jsxs(_Fragment, { children: [headLink, viewsMenu, pageVerbs] }), crumbs.tools), _jsxs("div", { className: `applist-head${inBar ? ' in-crumbs' : ''}`, children: [!inBar && !inDashboard && (_jsxs("div", { className: "applist-head-row", ref: head, children: [title, ownList ? (_jsxs("div", { className: "applist-head-tools", children: [headLink, viewsMenu, _jsx("span", { className: "applist-head-slot", ref: listHeadRef }), pageVerbs] })) : (pageVerbs)] })), !beside && !chipsInBar && _jsx("div", { className: "applist-chips", children: chipList })] }), summary, _jsxs("div", { className: "applist-controls", role: "group", "aria-label": say('listControls', { caption }), children: [(tabs.length > 1 || yours.length > 0) && (
|
|
740
|
+
createPortal(_jsxs(_Fragment, { children: [headLink, viewsMenu, pageVerbs] }), crumbs.tools), _jsxs("div", { className: `applist-head${inBar ? ' in-crumbs' : ''}`, children: [!inBar && !inDashboard && (_jsxs("div", { className: "applist-head-row", ref: head, children: [title, ownList ? (_jsxs("div", { className: "applist-head-tools", children: [headLink, viewsMenu, _jsx("span", { className: "applist-head-slot", ref: listHeadRef }), pageVerbs] })) : (pageVerbs)] })), !beside && !chipsInBar && _jsx("div", { className: "applist-chips", children: chipList })] }), summary, _jsxs("div", { className: "applist-controls", role: "group", "aria-label": say('listControls', { caption }), children: [(tabs.length > 1 || yours.length > 0) && (_jsx(FilterTabs, { tabs: tabs.map((tab, i) => ({ key: tab.label, label: tab.label, count: countOf(i) })), lit: yourLit === -1 ? litTab : -1, onPick: pickTab, extra: {
|
|
741
|
+
count: yours.length ? yours.length + 1 : 0,
|
|
742
|
+
lit: yourLit === -1 ? -1 : 1 + yourLit,
|
|
743
|
+
row: (foldMark) => (_jsxs(_Fragment, { children: [yours.length > 0 && (_jsxs("span", { className: "tab-group", ...foldMark(0), "aria-hidden": "true", children: [tabs.length > 1 && _jsx("span", { className: "tab-divider" }), _jsx("span", { className: "tab-group-label", children: store === 'account' ? say('myViews') : say('savedViews') })] })), yours.map((f, i) => (_jsxs("span", { className: "tab-wrap", role: "presentation", ...foldMark(1 + i), children: [_jsxs("button", { type: "button", role: "tab", className: "tab tab-yours", "aria-selected": i === yourLit, title: `${viewWords(f.query) || say('everything')} — ${store === 'account' ? say('yourView') : say('aSavedView')}`, onClick: () => {
|
|
757
744
|
if (i !== yourLit) {
|
|
758
745
|
state.page = 0;
|
|
759
746
|
apply(f.query);
|
|
760
747
|
}
|
|
761
|
-
}, children: [_jsx("span", { children: f.name }), _jsx(TabCount, { counted: tabCounts?.get(squeeze(`${entry.table} ${f.query}`)) })] }), savable && (_jsx("button", { type: "button", className: "tab-x", title: say('common.removeName', { name: f.name }), "aria-label": say('removeTheView', { name: f.name }), onClick: () => writeViews.mutate((views) => withoutView(views, f.name)), children: "\u00D7" }))] }, f.name)))] })
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
748
|
+
}, children: [_jsx("span", { children: f.name }), _jsx(TabCount, { counted: tabCounts?.get(squeeze(`${entry.table} ${f.query}`)) })] }), savable && (_jsx("button", { type: "button", className: "tab-x", title: say('common.removeName', { name: f.name }), "aria-label": say('removeTheView', { name: f.name }), onClick: () => writeViews.mutate((views) => withoutView(views, f.name)), children: "\u00D7" }))] }, f.name)))] })),
|
|
749
|
+
more: (folded) => yours.some((_, i) => folded(1 + i)) && (_jsx(DropGroup, { labelClassName: "more-group-label", label: store === 'account' ? say('myViews') : say('savedViews'), children: yours.map((f, i) => folded(1 + i) ? (_jsx(DropItem, { className: "page-actions-item", onClick: () => {
|
|
750
|
+
state.page = 0;
|
|
751
|
+
apply(f.query);
|
|
752
|
+
}, children: f.name }, f.name)) : null) })),
|
|
753
|
+
} })), spec.filterBar !== 'none' && (_jsxs("form", { className: "applist-filterbar", ref: form, onSubmit: submit, children: [_jsxs("div", { className: "applist-fields", children: [chipsInBar && table && (_jsx(ListFilterBar, { table: table, boxes: boxes, search: searchBox, refinement: refinement, tabQuery: tabQuery, standing: spec.query ?? '', unitOf: unitOf, typed: searchBox ? edits[searchBox.column]?.raw : undefined, onType: (raw) => {
|
|
765
754
|
if (!searchBox)
|
|
766
755
|
return;
|
|
767
756
|
/* Now, not on the next paint: the search field's own × asks in the same event. */
|
|
@@ -201,7 +201,8 @@ export function CardsList({ table, rows, spec, interactive = true, recordNavigat
|
|
|
201
201
|
const mark = (dressed?.kind === 'tone' || dressed?.kind === 'mark') && dressed.icon
|
|
202
202
|
? { name: dressed.icon, label: dressed.label, tone: dressed.kind === 'tone' ? dressed.tone : undefined }
|
|
203
203
|
: null;
|
|
204
|
-
|
|
204
|
+
/* A badge on the title's own column (a vocabulary word titling the card) would say the title twice. */
|
|
205
|
+
const badge = spec.badge && spec.badge !== spec.primary && row[spec.badge] != null && row[spec.badge] !== '' ? (_jsx("span", { className: "cards-badge", children: said(row, spec.badge) })) : null;
|
|
205
206
|
return (_jsx("li", { className: "cards-item", ...(win.windowed ? { 'data-index': win.lineOf(index), ref: win.measure } : {}), ...(id ? ordering.item(id) : {}), onKeyDown: id ? (event) => ordering.keyDown(event, id) : undefined, children: _jsxs("article", { className: `cards-card${hasMedia ? ' has-media' : ''}${avatar ? ' cards-profile' : ''}${changedRows.has(row) ? ` row-changed-${changedRows.get(row)}` : ''}`, children: [hasMedia && _jsx(CardPicture, { src: src, avatar: avatar, title: title, first: index < FIRST_ROW }), id && ordering.menu(id), _jsxs("div", { className: "cards-body", children: [tile && (_jsx("span", { className: `cards-tile${mark?.tone ? ` tone-${mark.tone}` : ''}`, children: mark && _jsx(Icon, { name: mark.name, label: mark.label, size: 22 }) })), _jsxs("h3", { className: "cards-title", children: [mark && !tile && _jsx(Icon, { name: mark.name, label: mark.label, className: "cards-icon" }), canOpen && key ? (_jsx("button", { type: "button", className: "cards-open", "data-order-focus": "", "aria-keyshortcuts": ordering.shortcuts, "data-opens": opensRecord(table.id, key), onClick: () => void openRecord(table.id, key, title, 'push', { records, list }), children: title })) : (_jsx("span", { children: title }))] }), titleSecond !== undefined && _jsx("p", { className: "cards-subtitle", children: titleSecond }), description !== undefined && (_jsx("p", { className: "cards-description", title: description, children: description })), (!hasMedia || avatar) && badge, spec.value && spec.value !== spec.primary && row[spec.value] != null && (_jsx("p", { className: "cards-value", children: saidWithSecond(row, spec.value) })), summary?.some((name) => present(row, name)) ? (_jsx("p", { className: "cards-summary", children: summary.filter((name) => present(row, name)).map((name) => fact(row, name, 'cards-summary-item')) })) : null, lines?.length ? (_jsx("dl", { className: "cards-facts", children: lines.map((name) => (_jsxs("div", { className: "cards-fact", children: [_jsx("dt", { children: caption(name) }), _jsx("dd", { children: saidWithSecond(row, name) })] }, name))) })) : null] }), footer?.length ? (_jsx("p", { className: "cards-foot", children: footer.some((name) => present(row, name))
|
|
206
207
|
? footer.filter((name) => present(row, name)).map((name) => fact(row, name, 'cards-foot-item'))
|
|
207
208
|
: '\u00a0' })) : null, hasMedia && !avatar && badge] }) }, key ? JSON.stringify(key) : index));
|
|
@@ -150,9 +150,10 @@ export declare function sliceRing(center: number, radius: number, from: number,
|
|
|
150
150
|
* A donut with its legend: how the whole divides, said twice — arc length
|
|
151
151
|
* and a labelled figure. Past six slices the tail is gathered into "others".
|
|
152
152
|
*/
|
|
153
|
-
export declare function DonutChart({ rows, say, label, onPick, total, ordered, tone, }: {
|
|
153
|
+
export declare function DonutChart({ rows, say, sayLegend, label, onPick, total, ordered, tone, }: {
|
|
154
154
|
rows: ChartRow[];
|
|
155
155
|
say?: Say;
|
|
156
|
+
sayLegend?: (totals: readonly number[]) => (value: unknown) => string;
|
|
156
157
|
label?: (key: unknown) => string;
|
|
157
158
|
/** A slice's display tone, where its column has them: slices wear the ink their dot and badge wear when every one has its own. */
|
|
158
159
|
tone?: (key: unknown) => string | undefined;
|
|
@@ -685,7 +685,7 @@ export function sliceRing(center, radius, from, length, width = 7) {
|
|
|
685
685
|
* A donut with its legend: how the whole divides, said twice — arc length
|
|
686
686
|
* and a labelled figure. Past six slices the tail is gathered into "others".
|
|
687
687
|
*/
|
|
688
|
-
export function DonutChart({ rows, say = String, label = keyWord, onPick, total, ordered, tone, }) {
|
|
688
|
+
export function DonutChart({ rows, say = String, sayLegend, label = keyWord, onPick, total, ordered, tone, }) {
|
|
689
689
|
/* The slice's stroke as the look draws it (.chart-slice: 7 units, 4.5 in Lumen's line charts), read as a slice takes
|
|
690
690
|
the keyboard, the moment its ring is drawn: a look is picked while the page is open, and a stylesheet says it. */
|
|
691
691
|
const [sliceWidth, setSliceWidth] = useState(7);
|
|
@@ -700,6 +700,7 @@ export function DonutChart({ rows, say = String, label = keyWord, onPick, total,
|
|
|
700
700
|
if (rest.length)
|
|
701
701
|
slices.push({ key: `others (${rest.length})`, value: rest.reduce((n, p) => n + p.value, 0) });
|
|
702
702
|
const whole = slices.reduce((n, p) => n + p.value, 0);
|
|
703
|
+
const sayFigure = sayLegend ? sayLegend([whole, ...slices.map((p) => p.value)]) : say;
|
|
703
704
|
const R = 15.9155; /* circumference 100, so dasharray speaks percent. */
|
|
704
705
|
const C = 21;
|
|
705
706
|
/* A step of the ramp rides in a property of its own, which the slice and its swatch both paint with. */
|
|
@@ -721,7 +722,7 @@ export function DonutChart({ rows, say = String, label = keyWord, onPick, total,
|
|
|
721
722
|
a drillable slice carries the button's role, name and keyboard
|
|
722
723
|
behaviour, and the legend button stays as the second way in. */
|
|
723
724
|
const drillable = onPick && p.raw != null && !(rest.length && i === slices.length - 1);
|
|
724
|
-
const said = `${p.key}: ${
|
|
725
|
+
const said = `${p.key}: ${sayFigure(p.value)} (${formatPercent(share, { maximumFractionDigits: 0 })})`;
|
|
725
726
|
const arc = (_jsx("circle", { className: `chart-slice${drillable ? ' chart-slice-drill' : ''}`, cx: C, cy: C, r: R, strokeDasharray: `${drawn.toFixed(2)} ${(100 - drawn).toFixed(2)}`, strokeDashoffset: at.toFixed(2), style: { ...ramp(i), stroke: color(i), opacity: opacity(i) }, children: !drillable && _jsx("title", { children: said }) }, i));
|
|
726
727
|
/* The door is the slice and its ring together: the ring is drawn (and read by grade) only while the door holds the
|
|
727
728
|
keyboard's focus. The dash starts at -offset along a path that begins at 3 o'clock. */
|
|
@@ -745,8 +746,8 @@ export function DonutChart({ rows, say = String, label = keyWord, onPick, total,
|
|
|
745
746
|
slices as the picture's unnamed parts. Where nothing drills it stays
|
|
746
747
|
an image, as before. */
|
|
747
748
|
const anyDrillable = onPick && slices.some((p, i) => p.raw != null && !(rest.length && i === slices.length - 1));
|
|
748
|
-
return (_jsxs("div", { className: `chart-donut-wrap${ordered ? ' is-ordered' : ''}`, children: [_jsxs("svg", { className: "chart-donut", viewBox: `0 0 ${C * 2} ${C * 2}`, role: anyDrillable ? 'group' : 'img', "aria-label": sayCopy('inAll', { whole:
|
|
749
|
-
const parts = (_jsxs(_Fragment, { children: [_jsx("span", { className: "chart-swatch", style: { ...ramp(i), background: color(i), opacity: opacity(i) } }), _jsx("span", { className: "chart-legend-key", children: p.key }), _jsx("span", { className: "chart-legend-value", children:
|
|
749
|
+
return (_jsxs("div", { className: `chart-donut-wrap${ordered ? ' is-ordered' : ''}`, children: [_jsxs("svg", { className: "chart-donut", viewBox: `0 0 ${C * 2} ${C * 2}`, role: anyDrillable ? 'group' : 'img', "aria-label": sayCopy('inAll', { whole: sayFigure(whole), map: slices.map((p) => `${p.key} ${sayFigure(p.value)}`).join(', ') }), children: [rings, _jsx("text", { className: "chart-donut-total", x: C, y: total ? C : C + 1.5, textAnchor: "middle", children: sayFigure(whole) }), total && (_jsx("text", { className: "chart-donut-caption", x: C, y: C + 4.5, textAnchor: "middle", children: total }))] }), _jsx("ul", { className: "chart-legend", children: slices.map((p, i) => {
|
|
750
|
+
const parts = (_jsxs(_Fragment, { children: [_jsx("span", { className: "chart-swatch", style: { ...ramp(i), background: color(i), opacity: opacity(i) } }), _jsx("span", { className: "chart-legend-key", children: p.key }), _jsx("span", { className: "chart-legend-value", children: sayFigure(p.value) }), _jsx("span", { className: "chart-legend-share", children: formatPercent((100 * p.value) / whole, { maximumFractionDigits: 0 }) })] }));
|
|
750
751
|
const drillable = onPick && p.raw != null && !(rest.length && i === slices.length - 1);
|
|
751
752
|
return (_jsx("li", { children: drillable ? (_jsx("button", { type: "button", className: "chart-legend-drill", onClick: () => onPick(p.raw), children: parts })) : (parts) }, i));
|
|
752
753
|
}) })] }));
|
|
@@ -64,7 +64,7 @@ export function ChartFigure({ answer, shape, limit, target, height, say, label,
|
|
|
64
64
|
return _jsx(ChartWait, { shape: stacked ? (timed ? 'columns' : 'rows') : donut ? 'donut' : 'plot', height: height, rows: limit });
|
|
65
65
|
return (_jsx("div", { className: "chart-host", ref: host, children: answer &&
|
|
66
66
|
wide > 0 &&
|
|
67
|
-
(donut ? (_jsx(DonutChart, { rows: rows, say: say, label: label, onPick: onPick, total: total, ordered: scale, tone: tone })) : bars ? (_jsx(BarChart, { rows: rows, say: say, label: label, wide: wide, high: height, target: target, tone: tone, partial: partial })) : stacked ? (_jsx(StackedBars, { rows: rows, say: say, target: target, limit: limit, label: label, seriesLabel: seriesLabel, onPick: onPick, seriesVocabulary: seriesVocabulary, seriesOrdered: seriesScale, seriesTone: seriesTone, sayLegend: sayLegend })) : (_jsx(LineChart, { rows: rows, say: say, wide: wide, high: height, target: target, smooth: curve === 'smooth', dots: dots, seriesLabel: seriesLabel, seriesVocabulary: seriesVocabulary, onPick: onPick, partial: partial }))) }));
|
|
67
|
+
(donut ? (_jsx(DonutChart, { rows: rows, say: say, sayLegend: sayLegend, label: label, onPick: onPick, total: total, ordered: scale, tone: tone })) : bars ? (_jsx(BarChart, { rows: rows, say: say, label: label, wide: wide, high: height, target: target, tone: tone, partial: partial })) : stacked ? (_jsx(StackedBars, { rows: rows, say: say, target: target, limit: limit, label: label, seriesLabel: seriesLabel, onPick: onPick, seriesVocabulary: seriesVocabulary, seriesOrdered: seriesScale, seriesTone: seriesTone, sayLegend: sayLegend })) : (_jsx(LineChart, { rows: rows, say: say, wide: wide, high: height, target: target, smooth: curve === 'smooth', dots: dots, seriesLabel: seriesLabel, seriesVocabulary: seriesVocabulary, onPick: onPick, partial: partial }))) }));
|
|
68
68
|
}
|
|
69
69
|
/** One of the further shapes, measured as the others are and drawn by the part on demand. */
|
|
70
70
|
export function ChartShapeFigure({ answer, empty, emptyDetail, emptyAction, height, ...rest }) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The stored value to the clipboard, as stored: an id past 2^53 arrives as a string and is copied as one. */
|
|
2
|
+
export declare function CopyValue({ value, label, announce, }: {
|
|
3
|
+
value: unknown;
|
|
4
|
+
label: string;
|
|
5
|
+
announce: (text: string, tone: 'ok' | 'error') => void;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* A value's copy button (a display rule's `copy`), shared by the record's Value and the custom components' Value. It
|
|
4
|
+
* reads no global of the walk: what it says when the copy is done or refused goes to the caller's `announce` (the
|
|
5
|
+
* shell's toast on a record, the host's announcement in a component), so the SDK can draw it too.
|
|
6
|
+
*/
|
|
7
|
+
import { Icon } from './Icon.js';
|
|
8
|
+
import { say } from '../copy/record/components/CopyValue.js';
|
|
9
|
+
/** The stored value to the clipboard, as stored: an id past 2^53 arrives as a string and is copied as one. */
|
|
10
|
+
export function CopyValue({ value, label, announce, }) {
|
|
11
|
+
const named = say('copyValue', { label });
|
|
12
|
+
return (_jsx("button", { type: "button", className: "value-copy", "aria-label": named, title: named, onClick: (event) => {
|
|
13
|
+
/* A copy is never also the click of what holds it: a table row, a link's row. */
|
|
14
|
+
event.stopPropagation();
|
|
15
|
+
const text = typeof value === 'object' ? JSON.stringify(value) : String(value);
|
|
16
|
+
/* No clipboard at all (an insecure origin) is a refusal too, said the same way rather than thrown. */
|
|
17
|
+
Promise.resolve()
|
|
18
|
+
.then(() => navigator.clipboard.writeText(text))
|
|
19
|
+
.then(() => announce(say('copiedValue', { label }), 'ok'))
|
|
20
|
+
/* The clipboard can be refused — an insecure origin, a permission denied; the value is on screen. */
|
|
21
|
+
.catch(() => announce(say('common.theBrowserRefusedClipboard'), 'error'));
|
|
22
|
+
}, children: _jsx(Icon, { name: "copy", size: 16 }) }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A row of filter tabs with counts, folding what does not fit under More (useTabFold.ts): the generated list's tabs
|
|
3
|
+
* (AppList.tsx) and a page's counted `<Choose>` (sdk/paramControls.tsx) are this one row, so a look that dresses one
|
|
4
|
+
* dresses both.
|
|
5
|
+
*
|
|
6
|
+
* Two semantics over one markup. The list's tabs are a `tablist` that switches what the list below shows; a page's
|
|
7
|
+
* Choose is a group of toggle buttons (`aria-pressed`) that set a param, named by the page, each named with its count
|
|
8
|
+
* ("Working, 12") so a screen reader hears the number it sees. The lit dress keys on either state (style.css).
|
|
9
|
+
*/
|
|
10
|
+
import type { ReactNode } from 'react';
|
|
11
|
+
/** A tab's count: the total, and whether it is a floor ("10,000+"). */
|
|
12
|
+
export interface Counted {
|
|
13
|
+
total: number;
|
|
14
|
+
capped: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const sayCount: (counted: Counted) => string;
|
|
17
|
+
/** A tab's badge. `null` is a current result with no count, not permission to show an older one. */
|
|
18
|
+
export declare function TabCount({ counted }: {
|
|
19
|
+
counted?: Counted | null;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
interface FilterTab {
|
|
22
|
+
key: string;
|
|
23
|
+
label: string;
|
|
24
|
+
count?: Counted | null;
|
|
25
|
+
}
|
|
26
|
+
/** What the fold marks an item with: its place in the strip, and whether it is folded under More. */
|
|
27
|
+
type FoldMark = (at: number) => {
|
|
28
|
+
'data-fold': number;
|
|
29
|
+
'data-folded': '' | undefined;
|
|
30
|
+
'aria-hidden': true | undefined;
|
|
31
|
+
};
|
|
32
|
+
interface FilterTabsProps {
|
|
33
|
+
tabs: readonly FilterTab[];
|
|
34
|
+
/** The lit tab's index, -1 for none (a saved view may be the lit one). */
|
|
35
|
+
lit: number;
|
|
36
|
+
onPick(index: number): void;
|
|
37
|
+
/** `tablist` for tabs that switch a view; `group` for a control's toggle buttons, which `name` names. */
|
|
38
|
+
semantics?: 'tablist' | 'group';
|
|
39
|
+
name?: string;
|
|
40
|
+
/**
|
|
41
|
+
* More items after the tabs, in the same fold (a list's saved views): how many, which of them is lit (-1 for none),
|
|
42
|
+
* what the row draws for them with their fold marks (counted from 0 after the tabs), and what More lists for the
|
|
43
|
+
* folded ones.
|
|
44
|
+
*/
|
|
45
|
+
extra?: {
|
|
46
|
+
count: number;
|
|
47
|
+
lit: number;
|
|
48
|
+
row(mark: FoldMark): ReactNode;
|
|
49
|
+
more(folded: (at: number) => boolean): ReactNode;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export declare function FilterTabs({ tabs, lit, onPick, semantics, name, extra }: FilterTabsProps): import("react").JSX.Element;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DropItem, DropMenu } from '@mistriwork/ui/DropMenu.js';
|
|
3
|
+
import { formatNumber } from '../locale.js';
|
|
4
|
+
import { message } from '../messages.js';
|
|
5
|
+
import { useTabFold } from './useTabFold.js';
|
|
6
|
+
export const sayCount = (counted) => `${formatNumber(counted.total)}${counted.capped ? '+' : ''}`;
|
|
7
|
+
/** A tab's badge. `null` is a current result with no count, not permission to show an older one. */
|
|
8
|
+
export function TabCount({ counted }) {
|
|
9
|
+
const said = counted == null ? '' : sayCount(counted);
|
|
10
|
+
/* The number in a box of its own, over the room a tab keeps for it (features.css). */
|
|
11
|
+
return _jsx("span", { className: "tab-count", children: said && _jsx("span", { children: said }) });
|
|
12
|
+
}
|
|
13
|
+
export function FilterTabs({ tabs, lit, onPick, semantics = 'tablist', name, extra }) {
|
|
14
|
+
const after = tabs.length;
|
|
15
|
+
const { strip, folded } = useTabFold(after + (extra?.count ?? 0), extra && extra.lit !== -1 ? after + extra.lit : lit);
|
|
16
|
+
const foldMark = (at) => ({
|
|
17
|
+
'data-fold': at,
|
|
18
|
+
'data-folded': folded.has(at) ? '' : undefined,
|
|
19
|
+
'aria-hidden': folded.has(at) || undefined,
|
|
20
|
+
});
|
|
21
|
+
const group = semantics === 'group';
|
|
22
|
+
return (_jsxs("div", { className: "tabs folds", ref: strip, children: [_jsxs("div", { className: "tabs-row", ...(group ? { role: 'group', 'aria-label': name } : { role: 'tablist' }), children: [tabs.map((tab, i) => (_jsxs("button", { type: "button", role: group ? undefined : 'tab', className: "tab", "aria-selected": group ? undefined : i === lit, "aria-pressed": group ? i === lit : undefined, "aria-label": group && tab.count != null ? `${tab.label}, ${sayCount(tab.count)}` : undefined, onClick: () => onPick(i), ...foldMark(i), children: [_jsx("span", { children: tab.label }), _jsx(TabCount, { counted: tab.count })] }, tab.key))), extra?.row((at) => foldMark(after + at))] }), _jsx("div", { className: "tab-more", "data-fold-more": "", "data-folded": folded.size ? undefined : '', "aria-hidden": !folded.size || undefined, children: _jsxs(DropMenu, { className: "tab-more-menu", triggerClassName: "tab", label: message('common.more'), popupClassName: "page-actions-popup", align: "end", children: [tabs.map((tab, i) => folded.has(i) ? (_jsxs(DropItem, { className: "page-actions-item", onClick: () => onPick(i), children: [_jsx("span", { children: tab.label }), _jsx(TabCount, { counted: tab.count })] }, tab.key)) : null), extra?.more((at) => folded.has(after + at))] }) })] }));
|
|
23
|
+
}
|
|
@@ -53,7 +53,7 @@ import { onDemand, useArrived } from './onDemand.js';
|
|
|
53
53
|
import { isPickerDateTime } from '@mistriwork/ui/internal/datePickerModel.js';
|
|
54
54
|
import { defaultCurrency } from '../locale.js';
|
|
55
55
|
import { wordFor } from './valueModel.js';
|
|
56
|
-
import { rowCurrency } from '@mistriwork/engine/shared/money.js';
|
|
56
|
+
import { majorText, minorToMajor, rowCurrency } from '@mistriwork/engine/shared/money.js';
|
|
57
57
|
import { MinorMoneyInput, minorProblem } from './MinorMoneyInput.js';
|
|
58
58
|
import { clockDefault, fieldInput, inferredNarrowing, flagStart, formColumns, formFrame, formGroups, hasFormChanges, insertValues, isFormFieldVisible, missingFields, narrowingCondition, presetValue, SEGMENTED_WORDS, withDisplayChoices, } from './newRecordModel.js';
|
|
59
59
|
import { derivedValue, formWords, resolvedForm, useMeDefaults } from './formDefaults.js';
|
|
@@ -640,21 +640,29 @@ export function PlatformControl({ id, column, app, required, assigned, spoken, t
|
|
|
640
640
|
plain value, said as the column says it: an expression (a clock, a sequence) or a default the server keeps
|
|
641
641
|
private is the database's to fill, and a field has nothing useful to say about it (a field report). */
|
|
642
642
|
const literal = app ? literalDefault(column.default) : undefined;
|
|
643
|
+
const moneyDefault = kind === 'money' && literal !== undefined
|
|
644
|
+
? (() => {
|
|
645
|
+
const currency = rule?.currency ?? defaultCurrency();
|
|
646
|
+
return rule?.minor ? minorToMajor(literal, currency) : majorText(literal, currency);
|
|
647
|
+
})()
|
|
648
|
+
: undefined;
|
|
643
649
|
const hint = explicitNull
|
|
644
650
|
? app
|
|
645
651
|
? say('common.noValue')
|
|
646
652
|
: 'null'
|
|
647
653
|
: column.identity || column.name === assigned
|
|
648
654
|
? say('assignedByTheDatabase')
|
|
649
|
-
:
|
|
650
|
-
?
|
|
651
|
-
:
|
|
652
|
-
?
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
:
|
|
655
|
+
: moneyDefault !== undefined
|
|
656
|
+
? moneyDefault
|
|
657
|
+
: literal !== undefined
|
|
658
|
+
? say('defaultValue', { value: allowed?.includes(literal) ? word(literal) : (wordFor(rule, literal) ?? literal) })
|
|
659
|
+
: column.default !== undefined || column.hasDefault === true
|
|
660
|
+
? app
|
|
661
|
+
? ''
|
|
662
|
+
: `default: ${column.default ?? ''}`
|
|
663
|
+
: column.references
|
|
664
|
+
? `→ ${column.references.table}`
|
|
665
|
+
: '';
|
|
658
666
|
const said = placeholder ?? hint;
|
|
659
667
|
/* An App's listbox with nothing chosen asks, quietly, as a command form's does; the workbench keeps its dash. */
|
|
660
668
|
const unchosen = hint || (app ? (readsAsName(spoken) ? say('choosePlaceholder', { label: spoken.toLowerCase() }) : say('chooseOne')) : '—');
|
|
@@ -22,6 +22,7 @@ import { canEditRow } from '../write.js';
|
|
|
22
22
|
import { cardStem, sharedPrefix } from '@mistriwork/engine/shared/pagePaths.js';
|
|
23
23
|
import { labelColumn } from '@mistriwork/engine/shared/schema.js';
|
|
24
24
|
import { Editable } from './Editable.js';
|
|
25
|
+
import { jsonValueOf } from './jsonModel.js';
|
|
25
26
|
import { RefJump, Value } from './Value.js';
|
|
26
27
|
import { defaultFieldPaths, definedThrough, fieldsColumns } from '@mistriwork/engine/shared/recordReads.js';
|
|
27
28
|
import { presentationColumns } from './columnPresentation.js';
|
|
@@ -265,7 +266,7 @@ export function FieldsSection({ page, section, index, base, recordKey: key, fold
|
|
|
265
266
|
? adorn({ table: base.id, column: path, key, filled: value !== null && value !== undefined && value !== '' })
|
|
266
267
|
: null;
|
|
267
268
|
if (editing && byName.has(path) && !column?.primaryKey && column?.writable !== false) {
|
|
268
|
-
const display = (next, referenceLabel) => column?.references && next !== null && next !== undefined && String(next) !== '' ? (_jsx(RefJump, { references: column.references, value: next, label: referenceLabel ?? (String(next) === String(value) && refLabels.get(path) ? row[refLabels.get(path)] : undefined), table: base, column: path, row: { ...row, [path]: next } })) : (_jsx(Value, { col: column, value: next, tableId: base.id, compact:
|
|
269
|
+
const display = (next, referenceLabel) => column?.references && next !== null && next !== undefined && String(next) !== '' ? (_jsx(RefJump, { references: column.references, value: next, label: referenceLabel ?? (String(next) === String(value) && refLabels.get(path) ? row[refLabels.get(path)] : undefined), table: base, column: path, row: { ...row, [path]: next } })) : (_jsx(Value, { col: column, value: next, tableId: base.id, compact: jsonValueOf(column, next) === null, links: true, wholeText: true }));
|
|
269
270
|
dd = (_jsx("dd", { className: "page-field-edit", children: _jsx(Editable, { table: base, row: row, column: byName.get(path), recordKey: key, onSaved: onEdit, isCurrent: isCurrent, app: shell().inApp(), display: shell().inApp() ? display : undefined }) }));
|
|
270
271
|
}
|
|
271
272
|
else if (section.edit &&
|
|
@@ -311,7 +312,10 @@ export function FieldsSection({ page, section, index, base, recordKey: key, fold
|
|
|
311
312
|
its caption in an aside, Depot's product description wrapped word by word. */
|
|
312
313
|
const rule = columnDisplay(base.id, path);
|
|
313
314
|
const dress = column?.references || value === null || value === undefined ? null : dressFor(rule, value);
|
|
315
|
+
/* A JSON document is read whole under its caption, in a rail or a grid alike. */
|
|
316
|
+
const isJson = !column?.references && (dress?.kind === 'json' || jsonValueOf(column, value) !== null);
|
|
314
317
|
const long = rule?.format === 'richText' ||
|
|
318
|
+
isJson ||
|
|
315
319
|
(rail && !column?.references && value != null && (dress ? dress.kind === 'richText' : sayValue(column, value).kind === 'long'));
|
|
316
320
|
/* …and a long text alone under its section's title is read under that title, as a document's paragraph. */
|
|
317
321
|
const lone = Boolean(section.title) && paths.length === 1 && (!rail || long);
|
|
@@ -334,6 +338,9 @@ export function FieldsSection({ page, section, index, base, recordKey: key, fold
|
|
|
334
338
|
in a <div> had no list for assistive technology to announce. */
|
|
335
339
|
/* An inferred page's form is the classic one (structure.css); a rail an author placed keeps its own dress. */
|
|
336
340
|
const classic = inferredForm;
|
|
337
|
-
const grid = rail ? (_jsx("dl", { className: classic ? 'page-properties page-classic' : 'page-properties', style: columns ? { '--page-properties-columns': String(columns) } : undefined, children: fields })) : (_jsx("dl", {
|
|
341
|
+
const grid = rail ? (_jsx("dl", { className: classic ? 'page-properties page-classic' : 'page-properties', style: columns ? { '--page-properties-columns': String(columns) } : undefined, children: fields })) : (_jsx("dl", {
|
|
342
|
+
/* Read-only, it is the kit's `Details` (sdk/kit.tsx) and shares its class, so a look dresses both; a grid with
|
|
343
|
+
fields open for editing is the form's alone. */
|
|
344
|
+
className: `page-field-grid${presentation === 'summary' ? ' page-field-summary' : ''}${editing ? '' : ' kit-details'}`, "data-columns": columns, style: columns ? { '--page-field-columns': `repeat(${columns}, minmax(0, 1fr))` } : undefined, children: fields }));
|
|
338
345
|
return (_jsx(SectionBox, { section: section, foldable: foldable, body: _jsxs(_Fragment, { children: [section.workflow && _jsx(WorkflowStatus, { definition: section.workflow, value: row[section.workflow.field], reachable: reachable }), grid] }) }));
|
|
339
346
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
export function PageHeading({ title, favorite, description, actions, back, hidden = false, level = 1, }) {
|
|
3
3
|
const Title = level === 1 ? 'h1' : 'h2';
|
|
4
4
|
const drawn = actions !== undefined && actions !== null && actions !== false;
|
|
5
|
-
|
|
5
|
+
const heading = _jsx(Title, { className: `applist-title${hidden ? ' visually-hidden' : ''}`, children: title });
|
|
6
|
+
/* A page that draws its own head says its own intro; `heading: false` hides only the title. */
|
|
7
|
+
const intro = description ? _jsx("p", { className: "note dash-description", children: description }) : null;
|
|
8
|
+
return (_jsxs("div", { className: `applist-head dash-head${drawn ? ' has-actions' : ''}${back ? ' has-back' : ''}`, children: [back ? _jsx("div", { className: "dash-head-back", children: back }) : null, drawn ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "dash-head-text", children: [heading, favorite, intro] }), _jsx("div", { className: "applist-head-tools dash-head-actions", children: actions })] })) : (_jsxs(_Fragment, { children: [heading, favorite, intro] }))] }));
|
|
6
9
|
}
|
|
@@ -257,5 +257,5 @@ export function ChartSection({ section, plan, base }) {
|
|
|
257
257
|
go(tableView(plan.breakdown.base, `${plan.breakdown.base} ${where}`), 'push');
|
|
258
258
|
}
|
|
259
259
|
: null;
|
|
260
|
-
return (_jsx(SectionBox, { section: section, foldable: false, body: _jsx(ChartFigure, { answer: drawn, arrange: section.sort === 'value' ? 'value' : plan.breakdown.orderBy?.[0]?.name === 'value' ? undefined : 'answer', shape: section.shape, limit: section.limit, target: section.target, curve: section.curve, total: section.total, height: section.height, say: say, label: namedGroups(got, got.columns[0], firstLabel.say), seriesLabel: namedGroups(got, second ? got.columns[1] : undefined, labelFor(second).say), vocabulary: firstLabel.allowed, onPick: drill, empty: inAppPage() ? sayCopy('nothingToDrawYet') : sayCopy('noForThisRecord', { from }) }) }));
|
|
260
|
+
return (_jsx(SectionBox, { section: section, foldable: false, body: _jsx(ChartFigure, { answer: drawn, arrange: section.sort === 'value' ? 'value' : plan.breakdown.orderBy?.[0]?.name === 'value' ? undefined : 'answer', shape: section.shape, limit: section.limit, target: section.target, curve: section.curve, total: section.total, height: section.height, say: say, sayLegend: section.shape === 'donut' || section.shape === 'stacked' ? (totals) => say.among(totals) : undefined, label: namedGroups(got, got.columns[0], firstLabel.say), seriesLabel: namedGroups(got, second ? got.columns[1] : undefined, labelFor(second).say), vocabulary: firstLabel.allowed, onPick: drill, empty: inAppPage() ? sayCopy('nothingToDrawYet') : sayCopy('noForThisRecord', { from }) }) }));
|
|
261
261
|
}
|
|
@@ -182,10 +182,18 @@ export function TimelineSection({ section, plan, base, recordKey }) {
|
|
|
182
182
|
})(),
|
|
183
183
|
}));
|
|
184
184
|
}));
|
|
185
|
+
const toEpoch = (when) => {
|
|
186
|
+
const normalized = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}/.test(when) ? `${when.replace(' ', 'T')}Z` : when;
|
|
187
|
+
const ms = Date.parse(normalized);
|
|
188
|
+
return Number.isNaN(ms) ? 0 : ms;
|
|
189
|
+
};
|
|
185
190
|
const merged = answers
|
|
186
191
|
.flat()
|
|
187
192
|
.filter((r) => r.when)
|
|
188
|
-
.sort((a, b) =>
|
|
193
|
+
.sort((a, b) => {
|
|
194
|
+
const diff = toEpoch(b.when) - toEpoch(a.when);
|
|
195
|
+
return diff !== 0 ? diff : a.when < b.when ? 1 : a.when > b.when ? -1 : 0;
|
|
196
|
+
});
|
|
189
197
|
return { rows: merged.slice(0, step * pages), more: streamMore || merged.length > step * pages };
|
|
190
198
|
},
|
|
191
199
|
staleTime: 0,
|
|
@@ -213,9 +221,15 @@ export function TimelineSection({ section, plan, base, recordKey }) {
|
|
|
213
221
|
/* The box's height and its scroll are whole pixels and a face's lines are not (Barlow's start at fractions):
|
|
214
222
|
floored, the edge fell up to a pixel inside the line it was meant to start. Rounded, it falls within half a
|
|
215
223
|
pixel of that line's start, on either side, so a line is taken only where rounding lands no lower. */
|
|
224
|
+
/* A day's label stays in view at the top while its day scrolls (page.css), over the start of what is under
|
|
225
|
+
it: a message starts at the label's foot, not at the box's edge. A stuck label reports where it is held,
|
|
226
|
+
so a label is measured where its day starts. */
|
|
227
|
+
const label = (line) => line.matches('.timeline-day-label');
|
|
228
|
+
const under = (line) => label(line) ? 0 : (line.closest('.timeline-day')?.querySelector('.timeline-day-label')?.offsetHeight ?? 0);
|
|
229
|
+
const at = (line) => ((label(line) && line.closest('.timeline-day')) || line).getBoundingClientRect().top;
|
|
216
230
|
const edge = [...box.querySelectorAll('.timeline-day-label, [data-timeline-row], .timeline-fold')]
|
|
217
231
|
.filter((line) => line.offsetHeight > 0)
|
|
218
|
-
.map((line) => line
|
|
232
|
+
.map((line) => at(line) - origin - under(line))
|
|
219
233
|
.filter((top) => top >= over - 0.5)
|
|
220
234
|
.sort((a, b) => a - b)[0];
|
|
221
235
|
const height = edge === undefined ? room : Math.round(whole - edge);
|
|
@@ -301,7 +301,7 @@ function RecordPickerControl(props) {
|
|
|
301
301
|
const subOf = (o) => (o.sub && (subline?.declared || twice.has(o.label)) ? o.sub : undefined);
|
|
302
302
|
const twiceChosen = collidingNames(ids.map(shownLabel));
|
|
303
303
|
const chipName = (value) => twiceChosen.has(shownLabel(value)) && subs.get(value) ? `${shownLabel(value)} · ${subs.get(value)}` : shownLabel(value);
|
|
304
|
-
return (_jsxs("div", { className: `picker${props.multiple ? ' picker-multi' : ''}`, ref: wrap, onKeyDownCapture: (e) => {
|
|
304
|
+
return (_jsxs("div", { className: `picker${props.multiple ? ' picker-multi' : ''}`, "aria-disabled": props.disabled || undefined, ref: wrap, onKeyDownCapture: (e) => {
|
|
305
305
|
if (editing && open && e.key === 'Escape') {
|
|
306
306
|
e.preventDefault();
|
|
307
307
|
e.stopPropagation();
|
|
@@ -19,7 +19,7 @@ import { itemsText, jsonValueOf, previewOf } from './jsonModel.js';
|
|
|
19
19
|
import { TAGS_TYPE, tagChips } from '@mistriwork/engine/shared/tagLists.js';
|
|
20
20
|
import { AvatarText, Dressed, Said } from './Dressed.js';
|
|
21
21
|
import { ValueSlot } from './valueRenderers.js';
|
|
22
|
-
import {
|
|
22
|
+
import { CopyValue } from './CopyValue.js';
|
|
23
23
|
import { say } from '../copy/record/components/Value.js';
|
|
24
24
|
import { shellBody } from '../shellHost.js';
|
|
25
25
|
import { Subtitled } from './SecondLine.js';
|
|
@@ -70,19 +70,7 @@ function BareValue(props) {
|
|
|
70
70
|
maskedText(rule, value) !== undefined ||
|
|
71
71
|
!shellBody().classList.contains('app-mode'))
|
|
72
72
|
return drawn;
|
|
73
|
-
return (_jsxs("span", { className: "value-copyable", children: [drawn, _jsx(CopyValue, { value: value, label: columnLabel(tableId, col?.name ?? '') ?? humanName(col?.name ?? '') })] }));
|
|
74
|
-
}
|
|
75
|
-
/** The stored value to the clipboard, as stored: an id past 2^53 arrives as a string and is copied as one. */
|
|
76
|
-
function CopyValue({ value, label }) {
|
|
77
|
-
const named = say('copyValue', { label });
|
|
78
|
-
return (_jsx("button", { type: "button", className: "value-copy", "aria-label": named, title: named, onClick: () => {
|
|
79
|
-
const text = typeof value === 'object' ? JSON.stringify(value) : String(value);
|
|
80
|
-
navigator.clipboard
|
|
81
|
-
.writeText(text)
|
|
82
|
-
.then(() => toast(say('copiedValue', { label })))
|
|
83
|
-
/* The clipboard can be refused — an insecure origin, a permission denied; the value is on screen. */
|
|
84
|
-
.catch(() => toast(say('common.theBrowserRefusedClipboard'), 'error'));
|
|
85
|
-
}, children: _jsx(Icon, { name: "copy", size: 16 }) }));
|
|
73
|
+
return (_jsxs("span", { className: "value-copyable", children: [drawn, _jsx(CopyValue, { value: value, label: columnLabel(tableId, col?.name ?? '') ?? humanName(col?.name ?? ''), announce: (text, tone) => (tone === 'error' ? toast(text, 'error') : toast(text)) })] }));
|
|
86
74
|
}
|
|
87
75
|
function DrawnValue(props) {
|
|
88
76
|
const { col, value, tableId, compact = false, rule } = props;
|
|
@@ -157,7 +145,7 @@ function PlatformValue({ col, value, tableId, compact = false, links = !compact,
|
|
|
157
145
|
return _jsx(ValueLink, { link: link });
|
|
158
146
|
const dress = tableId === undefined ? null : dressFor(rule, value);
|
|
159
147
|
if (dress)
|
|
160
|
-
return _jsx(Dressed, { dress: dress, compact: compact && !(wholeText && dress.kind === 'richText') });
|
|
148
|
+
return _jsx(Dressed, { dress: dress, compact: compact && !(wholeText && (dress.kind === 'richText' || dress.kind === 'json')) });
|
|
161
149
|
/* In an App a vocabulary's value is a word, as its chip says it ("On hold"
|
|
162
150
|
for `on_hold`); the Workbench shows the data exactly. */
|
|
163
151
|
return _jsx(Said, { col: col, value: value, compact: compact, app: shellBody().classList.contains('app-mode') });
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { LABEL_SEGMENT } from '@mistriwork/engine/shared/recordLabel.js';
|
|
1
2
|
import { TAGS_COLUMN, tagsColumnMeta } from '@mistriwork/engine/shared/tagLists.js';
|
|
2
3
|
import { resolvePath } from '@mistriwork/engine/shared/view.js';
|
|
4
|
+
import { labelColumnMeta } from '@mistriwork/engine/shared/viewPaths.js';
|
|
3
5
|
import { rollupColumnMeta } from '@mistriwork/engine/shared/rollups.js';
|
|
4
6
|
import { computedColumnMeta } from '@mistriwork/engine/shared/computed.js';
|
|
5
7
|
/** Dotted projections retain their source type without becoming the base row's key. */
|
|
@@ -26,6 +28,11 @@ export function presentationColumns(schema, table, paths) {
|
|
|
26
28
|
columns.set(path, { ...tagsColumnMeta(), identifier: false });
|
|
27
29
|
continue;
|
|
28
30
|
}
|
|
31
|
+
// A templated record label (recordLabel.ts): searched and filtered as text.
|
|
32
|
+
if (path === LABEL_SEGMENT && table.labelTemplate && !columns.has(path)) {
|
|
33
|
+
columns.set(path, { ...labelColumnMeta(), identifier: false });
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
29
36
|
if (columns.has(path) || !path.includes('.'))
|
|
30
37
|
continue;
|
|
31
38
|
try {
|
|
@@ -63,6 +63,10 @@ export interface Section {
|
|
|
63
63
|
x?: string;
|
|
64
64
|
/** breakdown, steps: a line under a step, by its value. */
|
|
65
65
|
notes?: Record<string, string>;
|
|
66
|
+
/** breakdown drawn as bars: a second measure said beside each bar ("4 deals"), asked in the same request. */
|
|
67
|
+
also?: string;
|
|
68
|
+
/** chart: whether buckets with no rows stand at zero across the window, across what was observed, or not at all. */
|
|
69
|
+
fill?: 'window' | 'observed' | false;
|
|
66
70
|
/** chart: a line's curve, and a donut's words for its middle figure. */
|
|
67
71
|
curve?: 'smooth' | 'straight';
|
|
68
72
|
total?: string;
|
|
@@ -15,8 +15,10 @@ import { useQueries } from '@tanstack/react-query';
|
|
|
15
15
|
import { useEffect, useState } from 'react';
|
|
16
16
|
import { columnDisplay, columnLabel, findTable, state } from '../core.js';
|
|
17
17
|
import { hasFilterOf } from '@mistriwork/engine/shared/listFilters.js';
|
|
18
|
+
import { LABEL_SEGMENT } from '@mistriwork/engine/shared/recordLabel.js';
|
|
18
19
|
import { presentationColumns } from './columnPresentation.js';
|
|
19
20
|
import { humanName } from '@mistriwork/engine/shared/model.js';
|
|
21
|
+
import { message } from '../messages.js';
|
|
20
22
|
import { andWords, written } from './conditionText.js';
|
|
21
23
|
import { referenceNameQuery } from './FilterBoxes.js';
|
|
22
24
|
import { useMessageLanguage } from './useMessageLanguage.js';
|
|
@@ -32,7 +34,7 @@ function appSpeaker(table) {
|
|
|
32
34
|
return null;
|
|
33
35
|
return {
|
|
34
36
|
column: (name) => table.columns.find((column) => column.name === name) ?? acrossColumn(table, name),
|
|
35
|
-
label: (name) => columnLabel(table.id, name) ?? humanName(name),
|
|
37
|
+
label: (name) => name === LABEL_SEGMENT ? message('common.name') : (columnLabel(table.id, name) ?? humanName(name)),
|
|
36
38
|
rule: (name) => columnDisplay(table.id, name),
|
|
37
39
|
};
|
|
38
40
|
}
|
|
@@ -42,7 +44,9 @@ function appSpeaker(table) {
|
|
|
42
44
|
function acrossColumn(table, name) {
|
|
43
45
|
const has = hasFilterOf(name);
|
|
44
46
|
if (!has)
|
|
45
|
-
return name.includes('.')
|
|
47
|
+
return name.includes('.') || name === LABEL_SEGMENT
|
|
48
|
+
? presentationColumns(state.schema, table, [name]).get(name)
|
|
49
|
+
: undefined;
|
|
46
50
|
const child = (findTable(has.child) ?? state.schema?.tables.find((t) => t.name === has.child));
|
|
47
51
|
if (!child)
|
|
48
52
|
return undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** What CopyValue says, in the record page room (packages/kit/src/client/messages.ts says how the catalog is split). */
|
|
2
|
+
import { defineMessages } from '../../../messages.js';
|
|
3
|
+
export const say = defineMessages({
|
|
4
|
+
copyValue: 'Copy {label}',
|
|
5
|
+
copiedValue: 'Copied {label}.',
|
|
6
|
+
});
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export declare const say: import("../../../messages.js").RoomMessage<{
|
|
2
2
|
readonly openReference: "Open {label} ({table} {key})";
|
|
3
3
|
readonly openTableKey: "Open {table} {key}";
|
|
4
|
-
readonly copyValue: "Copy {label}";
|
|
5
|
-
readonly copiedValue: "Copied {label}.";
|
|
6
4
|
readonly findOnAMap: "Find on a map";
|
|
7
5
|
}>;
|
|
@@ -3,7 +3,5 @@ import { defineMessages } from '../../../messages.js';
|
|
|
3
3
|
export const say = defineMessages({
|
|
4
4
|
openReference: 'Open {label} ({table} {key})',
|
|
5
5
|
openTableKey: 'Open {table} {key}',
|
|
6
|
-
copyValue: 'Copy {label}',
|
|
7
|
-
copiedValue: 'Copied {label}.',
|
|
8
6
|
findOnAMap: 'Find on a map',
|
|
9
7
|
});
|
package/dist/client/features.css
CHANGED
|
@@ -455,7 +455,7 @@ body.app-mode .page-edit { font-family: var(--sans); }
|
|
|
455
455
|
:is(.page-tab, .page-section-head) .tab-count::before { content: '00' / ''; visibility: hidden; }
|
|
456
456
|
.page-tab[aria-selected="true"] .tab-count { color: inherit; }
|
|
457
457
|
/* The count takes the tab's ink whole: faded, it was 3.3:1 on a filled tab. */
|
|
458
|
-
.tab[aria-selected="true"] .tab-count { color: inherit; }
|
|
458
|
+
.tab:is([aria-selected="true"], [aria-pressed="true"]) .tab-count { color: inherit; }
|
|
459
459
|
/* Quick filters: the list's key vocabularies as one-click conditions. */
|
|
460
460
|
.applist-quick {
|
|
461
461
|
padding: var(--space-2h) var(--space-3);
|
|
@@ -729,6 +729,13 @@ body.app-mode.page-bare .content { padding-inline: 0; }
|
|
|
729
729
|
.applist-head.dash-head:is(.has-actions, .has-back) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2h); }
|
|
730
730
|
.dash-head.has-back > .dash-head-back { flex-basis: 100%; margin-left: calc(var(--space-2) * -1); }
|
|
731
731
|
.dash-head.has-actions > .dash-head-actions { margin-left: auto; }
|
|
732
|
+
/* With verbs the words are one region (PageHeading.tsx): the intro under the title, the verbs at the far end, and the
|
|
733
|
+
verbs under the words once the line cannot hold both, at a phone. */
|
|
734
|
+
.dash-head.has-actions > .dash-head-text { flex: 1 1 18rem; min-width: 0; }
|
|
735
|
+
.dash-head-text > .applist-title { margin: 0; }
|
|
736
|
+
/* A head a page draws in its own body stands in the body's gutter: its own inline padding was a second inset, the
|
|
737
|
+
head's words a step in from the page's first card. */
|
|
738
|
+
.free-page-body .dash-head { padding-inline: 0; }
|
|
732
739
|
.dash-head:is(.has-actions, .has-back) > .dash-description { flex-basis: 100%; margin: 0; }
|
|
733
740
|
.dash-head-compact { align-items: center; gap: var(--space-2h); width: 100%; margin-bottom: var(--space-3); }
|
|
734
741
|
.dash-head-compact .applist-title { margin: 0; }
|
|
@@ -844,6 +851,9 @@ body.app-mode.page-bare .content { padding-inline: 0; }
|
|
|
844
851
|
/* A meter: a number against its max, the bar coloured by the rule's tone. */
|
|
845
852
|
.meter-wrap { display: inline-flex; align-items: center; gap: var(--space-3); }
|
|
846
853
|
.meter-wrap .pct-bar { width: 64px; }
|
|
854
|
+
/* A fluid meter is the bar across its row (a card, a column), the figure at its end: the bar takes what is left. */
|
|
855
|
+
.meter-wrap.meter-fluid { display: flex; width: 100%; min-width: 0; }
|
|
856
|
+
.meter-wrap.meter-fluid .pct-bar { width: auto; flex: 1 1 auto; min-width: 0; }
|
|
847
857
|
.meter-good .pct-fill { background: var(--status-good); }
|
|
848
858
|
.meter-warn .pct-fill { background: var(--status-warning); }
|
|
849
859
|
.meter-bad .pct-fill { background: var(--status-critical); }
|
|
@@ -592,12 +592,12 @@
|
|
|
592
592
|
background: transparent;
|
|
593
593
|
color: var(--ink);
|
|
594
594
|
}
|
|
595
|
-
:root[data-look-tabs='underline'] :is(.tab, :where(body.app-mode) .page-tab)[aria-selected='true'] {
|
|
595
|
+
:root[data-look-tabs='underline'] :is(.tab, :where(body.app-mode) .page-tab):is([aria-selected='true'], [aria-pressed='true']) {
|
|
596
596
|
background: transparent;
|
|
597
597
|
color: var(--ink);
|
|
598
598
|
font-weight: 600;
|
|
599
599
|
}
|
|
600
|
-
:root[data-look-tabs='underline'] :is(.tab, :where(body.app-mode) .page-tab)[aria-selected='true']::after {
|
|
600
|
+
:root[data-look-tabs='underline'] :is(.tab, :where(body.app-mode) .page-tab):is([aria-selected='true'], [aria-pressed='true'])::after {
|
|
601
601
|
content: '';
|
|
602
602
|
position: absolute;
|
|
603
603
|
left: 0;
|
package/dist/client/page.css
CHANGED
|
@@ -1915,6 +1915,13 @@
|
|
|
1915
1915
|
max-height: min(60vh, 30rem);
|
|
1916
1916
|
overflow-y: auto;
|
|
1917
1917
|
}
|
|
1918
|
+
.timeline-scroll .timeline-day-label {
|
|
1919
|
+
position: sticky;
|
|
1920
|
+
top: 0;
|
|
1921
|
+
z-index: 1;
|
|
1922
|
+
padding-block: var(--space-1);
|
|
1923
|
+
background: var(--surface);
|
|
1924
|
+
}
|
|
1918
1925
|
/* A tinted message (an internal note) is a card in its column: its tone's wash, and an edge that says what it is. */
|
|
1919
1926
|
.timeline-row.is-tinted {
|
|
1920
1927
|
padding: var(--space-3) var(--space-3h);
|
|
@@ -3399,17 +3406,14 @@
|
|
|
3399
3406
|
color: var(--ink-muted);
|
|
3400
3407
|
font: var(--text-base)/1.45 var(--sans);
|
|
3401
3408
|
}
|
|
3402
|
-
.cards-summary-item + .cards-summary-item {
|
|
3403
|
-
|
|
3404
|
-
}
|
|
3405
|
-
.cards-summary-item::before {
|
|
3406
|
-
content: '·';
|
|
3407
|
-
display: inline-block;
|
|
3408
|
-
width: 15px;
|
|
3409
|
-
margin-inline-start: -15px;
|
|
3410
|
-
text-align: center;
|
|
3409
|
+
.cards-summary-item + .cards-summary-item::before {
|
|
3410
|
+
content: ' · ' / '';
|
|
3411
3411
|
color: var(--ink-subtle);
|
|
3412
3412
|
}
|
|
3413
|
+
.cards-summary .tone {
|
|
3414
|
+
max-width: 100%;
|
|
3415
|
+
vertical-align: bottom;
|
|
3416
|
+
}
|
|
3413
3417
|
.cards-summary .num-value {
|
|
3414
3418
|
font: inherit;
|
|
3415
3419
|
}
|
package/dist/client/sageLook.css
CHANGED
|
@@ -280,7 +280,7 @@
|
|
|
280
280
|
}
|
|
281
281
|
/* What is chosen: a tint of the accent and the text's ink, never a fill in the accent. A record's tabs are the
|
|
282
282
|
list's: one soft pill for the group that is open, on a page and on a list alike. */
|
|
283
|
-
:root[data-look-tabs='tint'] :is(.tab, body.app-mode .page-tab)[aria-selected='true'] {
|
|
283
|
+
:root[data-look-tabs='tint'] :is(.tab, body.app-mode .page-tab):is([aria-selected='true'], [aria-pressed='true']) {
|
|
284
284
|
background: var(--chosen);
|
|
285
285
|
color: var(--ink);
|
|
286
286
|
}
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
#table-list button[aria-current='true'],
|
|
28
28
|
.mobile-nav-list button[aria-current='true']
|
|
29
29
|
) {
|
|
30
|
-
background: var(--nav-current);
|
|
31
|
-
color: var(--nav-on-current, var(--nav-ink));
|
|
30
|
+
background: var(--part-nav-current-ground, var(--nav-current));
|
|
31
|
+
color: var(--part-nav-current-ink, var(--nav-on-current, var(--nav-ink)));
|
|
32
32
|
/* The block replaces a look's own mark, but not one the look draws beside any block (`--nav-current-mark`, the
|
|
33
33
|
slot's marker in workshopLook.css), so a theme may tint the current entry and keep the accent's slot, as
|
|
34
34
|
Workshop does. */
|
|
35
|
-
box-shadow: var(--nav-current-mark, none);
|
|
35
|
+
box-shadow: var(--part-nav-current-lift, var(--nav-current-mark, none));
|
|
36
36
|
}
|
|
37
37
|
:root[data-nav-current] .app-mode .topbar :is(.tn-item[aria-current='true'], .tn-group.active > .tn-group-button)::after {
|
|
38
38
|
background: transparent;
|
|
@@ -256,15 +256,16 @@
|
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
/* A heading, not a crumb: the list title's step in the look's heading face (style.css tokens)
|
|
259
|
+
/* A heading, not a crumb: the list title's step in the look's heading face (style.css tokens), or in the theme's
|
|
260
|
+
own (`page.title` part). */
|
|
260
261
|
.crumbs h1.applist-title {
|
|
261
262
|
margin: 0;
|
|
262
|
-
font-family: var(--heading-font, var(--sans));
|
|
263
|
+
font-family: var(--part-page-title-face, var(--heading-font, var(--sans)));
|
|
263
264
|
font-size: var(--type-list-title);
|
|
264
265
|
line-height: 1.2;
|
|
265
|
-
font-weight: var(--heading-weight);
|
|
266
|
-
letter-spacing: var(--track-title);
|
|
267
|
-
color: var(--ink);
|
|
266
|
+
font-weight: var(--part-page-title-weight, var(--heading-weight));
|
|
267
|
+
letter-spacing: var(--part-page-title-tracking, var(--track-title));
|
|
268
|
+
color: var(--part-page-title-ink, var(--ink));
|
|
268
269
|
}
|
|
269
270
|
|
|
270
271
|
.applist-head.in-crumbs {
|
|
@@ -900,9 +901,9 @@
|
|
|
900
901
|
.pbd-drill {
|
|
901
902
|
min-height: 44px;
|
|
902
903
|
}
|
|
903
|
-
/* The command form's line pickers draw at
|
|
904
|
+
/* The command form's line pickers draw at 44px on a coarse pointer. */
|
|
904
905
|
.form-lines-grid .lines-ref:not(.has-sub) .picker-input {
|
|
905
|
-
height:
|
|
906
|
+
height: 44px;
|
|
906
907
|
}
|
|
907
908
|
/* The chrome's own controls the same way, on ::before, since a tab's underline and a field's pencil are
|
|
908
909
|
already their ::after: the brand, the header's icon buttons, a view's tabs, the buttons and a checklist
|
|
@@ -938,6 +939,7 @@
|
|
|
938
939
|
.tn-mobile-menu,
|
|
939
940
|
.tn-search,
|
|
940
941
|
.presentation-seg,
|
|
942
|
+
.timeline-mode,
|
|
941
943
|
.page-metric-value,
|
|
942
944
|
.dashboard-note-action,
|
|
943
945
|
.peekpanel-close,
|
|
@@ -972,6 +974,7 @@
|
|
|
972
974
|
.tn-mobile-menu,
|
|
973
975
|
.tn-search,
|
|
974
976
|
.presentation-seg,
|
|
977
|
+
.timeline-mode,
|
|
975
978
|
.page-metric-value,
|
|
976
979
|
.dashboard-note-action,:is([data-slot='date-field'] > [data-slot='popover-trigger']),
|
|
977
980
|
.peekpanel-close,
|
|
@@ -1199,6 +1202,13 @@
|
|
|
1199
1202
|
.free-page-body.is-own > .page-section {
|
|
1200
1203
|
padding-top: 0;
|
|
1201
1204
|
}
|
|
1205
|
+
/* ...but a page that draws the kit's own head (PageHeader) keeps the pane's top space, the one a head's row leaves
|
|
1206
|
+
above its title (--page-top): without it that head stood flush under the pane's bar, a step higher than every page
|
|
1207
|
+
whose head the shell draws. A page whose first part is its own (a hero) still starts at the pane's top, and a bare
|
|
1208
|
+
page owns the window and keeps none. */
|
|
1209
|
+
.free-page-body.is-own:not(.is-bare):has(.applist-head) {
|
|
1210
|
+
padding-top: var(--page-top);
|
|
1211
|
+
}
|
|
1202
1212
|
/* The first part of a free-form page that has a head stands one gap under it (--page-head-gap), as a list's controls
|
|
1203
1213
|
do. It was the head's own margin, the body's (the sidebar shell's rule below) and the section's, three spaces said
|
|
1204
1214
|
one on another: 62px under the head against a list's 27. */
|
|
@@ -1427,7 +1437,11 @@
|
|
|
1427
1437
|
/* The room is a pane standing on the menu's ground (docs/design.md, the shell): inset from the window's edge on the
|
|
1428
1438
|
three sides the menu is not, a hairline round it and corners a step rounder than a control's. The menu and the
|
|
1429
1439
|
room then read as two things, and the room as the one that changes. The menu's own edge would be a second
|
|
1430
|
-
line beside the pane's.
|
|
1440
|
+
line beside the pane's, unless a theme draws it (`nav` part's edge).
|
|
1441
|
+
A theme's part rules are in `@layer theme`, under this one: what a part may set on an element is said here
|
|
1442
|
+
through the part's own token (`--part-ground-ground` and the rest, appTheme.js), so a declared part wins and
|
|
1443
|
+
every other App draws as before (test/theme-parts-structure.test.ts). The pane's bar is the pane's head, so it
|
|
1444
|
+
wears the page's ground, edge and corner too. */
|
|
1431
1445
|
body.app-sidebar-shell .layout {
|
|
1432
1446
|
display: grid;
|
|
1433
1447
|
grid-template-columns: auto minmax(0, 1fr);
|
|
@@ -1436,7 +1450,7 @@
|
|
|
1436
1450
|
}
|
|
1437
1451
|
body.app-sidebar-shell .layout > .sidebar {
|
|
1438
1452
|
grid-row: 1 / -1;
|
|
1439
|
-
border-right-color: transparent;
|
|
1453
|
+
border-right-color: var(--part-nav-edge, transparent);
|
|
1440
1454
|
}
|
|
1441
1455
|
/* The pane's bar (sidebarShell.js): where the reader is, then what is the same in every room — the search, the
|
|
1442
1456
|
bell, the account — at its far end, over a rule. It is the pane's head: its corners are the pane's, the room
|
|
@@ -1452,18 +1466,19 @@
|
|
|
1452
1466
|
height: 52px;
|
|
1453
1467
|
margin: var(--space-3) var(--space-3) 0 0;
|
|
1454
1468
|
padding-inline: calc(var(--space-5) + var(--room-inset)) var(--space-4);
|
|
1455
|
-
border: 1px solid var(--line);
|
|
1469
|
+
border: 1px solid var(--part-ground-edge, var(--line));
|
|
1456
1470
|
border-bottom: 0;
|
|
1457
|
-
border-radius: calc(var(--radius) + 4px) calc(var(--radius) + 4px) 0 0;
|
|
1458
|
-
background: var(--surface);
|
|
1471
|
+
border-radius: var(--part-ground-radius, calc(var(--radius) + 4px)) var(--part-ground-radius, calc(var(--radius) + 4px)) 0 0;
|
|
1472
|
+
background: var(--part-ground-ground, var(--surface));
|
|
1459
1473
|
}
|
|
1460
1474
|
body.app-sidebar-shell .layout > .content {
|
|
1461
1475
|
grid-column: 2;
|
|
1462
1476
|
margin: 0 var(--space-3) var(--space-3) 0;
|
|
1463
|
-
border: 1px solid var(--line);
|
|
1464
|
-
|
|
1465
|
-
border-
|
|
1466
|
-
|
|
1477
|
+
border: 1px solid var(--part-ground-edge, var(--line));
|
|
1478
|
+
/* A look that rules its bar in ink keeps that rule: it is the bar's foot, not the pane's edge. */
|
|
1479
|
+
border-top: var(--pane-rule, 1px solid var(--part-ground-edge, var(--line)));
|
|
1480
|
+
border-radius: 0 0 var(--part-ground-radius, calc(var(--radius) + 4px)) var(--part-ground-radius, calc(var(--radius) + 4px));
|
|
1481
|
+
background: var(--part-ground-ground, var(--surface));
|
|
1467
1482
|
}
|
|
1468
1483
|
/* The pane's own edge is a margin already: the room keeps a step less of its gutter inside it, so what stands
|
|
1469
1484
|
in it starts where it would under a bar. An App's own gutter and a bare page keep theirs (features.css). */
|
|
@@ -1477,7 +1492,7 @@
|
|
|
1477
1492
|
body.app-sidebar-shell.page-bare .layout > .content {
|
|
1478
1493
|
margin: 0;
|
|
1479
1494
|
border: 0;
|
|
1480
|
-
border-radius: 0;
|
|
1495
|
+
border-radius: var(--part-ground-radius, 0);
|
|
1481
1496
|
}
|
|
1482
1497
|
/* Where the reader is: the menu's group, then the room, said once more for the eye (the menu's current row and
|
|
1483
1498
|
the room's heading say it to everyone else). The room's name gives way first. */
|
package/dist/client/style.css
CHANGED
|
@@ -28,8 +28,10 @@
|
|
|
28
28
|
picture { display: contents; }
|
|
29
29
|
|
|
30
30
|
/* A plain link a free-form page writes (`<a href={useHref().page(…)}>`) is the look's link ink, as the platform's own links
|
|
31
|
-
are, not the browser's blue. In base, so any rule the page or a component brings (a later layer) still wins.
|
|
32
|
-
|
|
31
|
+
are, not the browser's blue. In base, so any rule the page or a component brings (a later layer) still wins. Only a
|
|
32
|
+
plain link: a rule written straight into base outranks every sub-layer base imports, the button part's included, so
|
|
33
|
+
without the :where() a `<Button href intent="primary">` wore the link ink on the primary fill (1.22:1). */
|
|
34
|
+
.free-page-body a:where(:not([data-slot])) { color: var(--link); }
|
|
33
35
|
|
|
34
36
|
body {
|
|
35
37
|
margin: 0;
|
|
@@ -461,7 +463,7 @@ html[data-starting] .content.nav-holding.nav-holding-focusable > :not(.nav-held)
|
|
|
461
463
|
white-space: nowrap; flex-shrink: 0;
|
|
462
464
|
}
|
|
463
465
|
.tab:hover { color: var(--ink); }
|
|
464
|
-
.tab[aria-selected="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); }
|
|
466
|
+
.tab:is([aria-selected="true"], [aria-pressed="true"]) { color: var(--accent-ink); border-bottom-color: var(--accent); }
|
|
465
467
|
|
|
466
468
|
/* Wider than it was: with the sidebar on the left, 14px of gutter on the
|
|
467
469
|
right reads as none at all beside a panel edge. */
|
|
@@ -210,8 +210,10 @@
|
|
|
210
210
|
:root[data-theme-style] .app-mode .topbar :is(.tn-group.active > .tn-group-button, .tn-item[aria-current="true"]) { background: color-mix(in srgb, var(--nav-ink) 8%, transparent); color: var(--nav-ink); border-radius: var(--radius); }
|
|
211
211
|
:root[data-theme-style] td:where(:not([data-slot])) { font-size: var(--text-md); }
|
|
212
212
|
/* The row's name anchors it, in every look: its first column a step heavier than the rest, so the eye has somewhere
|
|
213
|
-
to land before it reads across (a row's tick, where it has one, stands before it).
|
|
214
|
-
:
|
|
213
|
+
to land before it reads across (a row's tick, where it has one, stands before it). A kit Table's cell is
|
|
214
|
+
not bold as a whole: its weight is its primary line's (`.kit-cell-primary-strong`, kit.css), so a secondary
|
|
215
|
+
line under it keeps the body's. */
|
|
216
|
+
:root[data-theme-style] .app-mode td:is(:first-child:not(.row-host), .row-host + td):not(.kit-cell) { font-weight: 600; }
|
|
215
217
|
:root[data-theme-style] td.num { font-weight: 500; }
|
|
216
218
|
/* List tabs are pills here: the current one filled in the accent. */
|
|
217
219
|
:root[data-theme-style] .tabs { border-bottom: 0; gap: var(--space-2); padding-top: var(--space-4); }
|
|
@@ -222,14 +224,14 @@
|
|
|
222
224
|
`font` shorthand resets neither, so four looks named their record tabs in capitals. Mono
|
|
223
225
|
sets its own label below. */
|
|
224
226
|
:root[data-theme-style] :is(.tab, :where(body.app-mode) .page-tab) { border: 0; border-radius: var(--radius); padding: var(--space-2) var(--space-4); font: 500 var(--text-base) var(--sans); text-transform: none; letter-spacing: normal; color: var(--ink-muted); }
|
|
225
|
-
:root[data-theme-style] :is(.tab, :where(body.app-mode) .page-tab)[aria-selected="true"] { background: var(--accent); color: var(--on-accent); border-bottom-width: 0; }
|
|
227
|
+
:root[data-theme-style] :is(.tab, :where(body.app-mode) .page-tab):is([aria-selected="true"], [aria-pressed="true"]) { background: var(--accent); color: var(--on-accent); border-bottom-width: 0; }
|
|
226
228
|
/* A tab drawn as a box is a control in the list's toolbar: the toolbar's height, so it stands level with the filters
|
|
227
229
|
beside it (a 24px pill stood beside 30px filters), and the control's corner, so a look whose buttons are pills has
|
|
228
230
|
pill tabs. The height is the line's, not a box's, so a count beside the name keeps its baseline. */
|
|
229
231
|
:root[data-theme-style]:is([data-look-tabs='pill'], [data-look-tabs='tint'], [data-look-tabs='inverted']) :is(.tab, :where(body.app-mode) .page-tab) { line-height: calc(var(--control-h-sm) - 2 * var(--space-2)); border-radius: var(--control-radius, var(--radius)); }
|
|
230
232
|
/* The chosen pill is a soft one in the ink with an edge of its own: filled in the accent, as the primary button
|
|
231
233
|
is, it read as a second primary over every list and on every record. */
|
|
232
|
-
html:root[data-theme-style][data-look-tabs='pill'] :is(.tab, :where(body.app-mode) .page-tab)[aria-selected='true'] { background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
|
|
234
|
+
html:root[data-theme-style][data-look-tabs='pill'] :is(.tab, :where(body.app-mode) .page-tab):is([aria-selected='true'], [aria-pressed='true']) { background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
|
|
233
235
|
:root[data-theme-style] .tab .tab-count { font-size: var(--text-sm); line-height: 1; }
|
|
234
236
|
/* A two-or-three-way switch (a Segmented, a list's Rows/Board, the phone's Records/Table, Tree/Raw) is one drawing in every
|
|
235
237
|
look: a tray on the raised ground with a hairline, and the chosen one inside it. The tray's corner is the item's plus
|
|
@@ -514,7 +516,7 @@ html:root[data-theme-style] .record-presentation { margin-inline-start: auto; }
|
|
|
514
516
|
:root[data-look-nav='inverted'] .app-mode .topbar :is(.tn-group.active > .tn-group-button, .tn-item[aria-current='true']) :is(.tn-caret, .nav-icon) {
|
|
515
517
|
color: inherit;
|
|
516
518
|
}
|
|
517
|
-
:root[data-look-tabs='inverted'] :is(.tab, :where(body.app-mode) .page-tab)[aria-selected='true'] {
|
|
519
|
+
:root[data-look-tabs='inverted'] :is(.tab, :where(body.app-mode) .page-tab):is([aria-selected='true'], [aria-pressed='true']) {
|
|
518
520
|
background: var(--ink);
|
|
519
521
|
color: var(--ground);
|
|
520
522
|
border-radius: var(--radius);
|
|
@@ -1261,16 +1263,17 @@ html:root[data-theme-style] .record-presentation { margin-inline-start: auto; }
|
|
|
1261
1263
|
:root[data-look-pane='edge'] body.app-sidebar-shell .layout > .pane-bar {
|
|
1262
1264
|
margin: 0;
|
|
1263
1265
|
border: 0;
|
|
1264
|
-
border-left: 1px solid var(--line);
|
|
1266
|
+
border-left: 1px solid var(--part-ground-edge, var(--line));
|
|
1265
1267
|
border-radius: 0;
|
|
1266
1268
|
}
|
|
1269
|
+
/* A theme's ground part still wins here (structure.css, the pane): its edge, corner and lift through its tokens. */
|
|
1267
1270
|
:root[data-look-pane='edge'] body.app-sidebar-shell .layout > .content {
|
|
1268
1271
|
margin: 0;
|
|
1269
1272
|
border: 0;
|
|
1270
|
-
border-left: 1px solid var(--line);
|
|
1271
|
-
border-top: var(--pane-rule, 1px solid var(--line));
|
|
1272
|
-
border-radius: 0;
|
|
1273
|
-
box-shadow: none;
|
|
1273
|
+
border-left: 1px solid var(--part-ground-edge, var(--line));
|
|
1274
|
+
border-top: var(--pane-rule, 1px solid var(--part-ground-edge, var(--line)));
|
|
1275
|
+
border-radius: var(--part-ground-radius, 0);
|
|
1276
|
+
box-shadow: var(--part-ground-lift, none);
|
|
1274
1277
|
}
|
|
1275
1278
|
:root[data-look-pane='edge'] body.app-sidebar-shell.page-bare .layout > .content {
|
|
1276
1279
|
border: 0;
|
|
@@ -164,12 +164,12 @@
|
|
|
164
164
|
text-transform: none;
|
|
165
165
|
}
|
|
166
166
|
@media (hover: hover) {
|
|
167
|
-
:root[data-look-tabs='lifted'] :is(.tab, :where(body.app-mode) .page-tab):hover:not([aria-selected='true']) {
|
|
167
|
+
:root[data-look-tabs='lifted'] :is(.tab, :where(body.app-mode) .page-tab):hover:not([aria-selected='true'], [aria-pressed='true']) {
|
|
168
168
|
background: color-mix(in srgb, var(--ink) 5%, transparent);
|
|
169
169
|
color: var(--ink);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
:root[data-look-tabs='lifted'] :is(.tab, :where(body.app-mode) .page-tab)[aria-selected='true'] {
|
|
172
|
+
:root[data-look-tabs='lifted'] :is(.tab, :where(body.app-mode) .page-tab):is([aria-selected='true'], [aria-pressed='true']) {
|
|
173
173
|
background: var(--surface);
|
|
174
174
|
color: var(--ink);
|
|
175
175
|
font-weight: 600;
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
:root[data-visual-theme] .applist-quick-text { min-height: 32px; background: var(--surface); }
|
|
191
191
|
:root[data-visual-theme] .tabs { gap: var(--space-4h); padding-top: var(--space-4); }
|
|
192
192
|
:root[data-visual-theme] .tab { padding: var(--space-3) 0 var(--space-4); font-weight: 550; }
|
|
193
|
-
:root[data-visual-theme] .tab[aria-selected="true"] { border-bottom-width: 3px; }
|
|
193
|
+
:root[data-visual-theme] .tab:is([aria-selected="true"], [aria-pressed="true"]) { border-bottom-width: 3px; }
|
|
194
194
|
:root[data-visual-theme] .app-mode .result-head { padding-top: var(--space-4); padding-bottom: var(--space-4); }
|
|
195
195
|
:root[data-visual-theme] .app-mode table { font-family: var(--mono); font-variant-numeric: tabular-nums; }
|
|
196
196
|
:root[data-visual-theme] .app-mode th { font-family: var(--sans); color: var(--ink-muted); font-weight: 600; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mistriwork/kit",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.77",
|
|
4
4
|
"description": "The shared React client both shells are drawn with: the walk and the address, Grid, Value, the record page, lists, filters and charts.",
|
|
5
5
|
"homepage": "https://mistriwork.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"./package.json": "./package.json"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@mistriwork/engine": "1.0.0-rc.
|
|
89
|
-
"@mistriwork/ui": "1.0.0-rc.
|
|
88
|
+
"@mistriwork/engine": "1.0.0-rc.77",
|
|
89
|
+
"@mistriwork/ui": "1.0.0-rc.77",
|
|
90
90
|
"intl-messageformat": "12.1.2",
|
|
91
91
|
"qrcode-generator": "^2.0.4"
|
|
92
92
|
},
|