@k2b/ui 0.50.0 → 0.51.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/dist/base.css +32 -1
- package/dist/browser/actions/Button.js.map +1 -1
- package/dist/browser/actions/CommandList.js +861 -0
- package/dist/browser/actions/CommandList.js.map +1 -0
- package/dist/browser/actions/CommandMenu.js +237 -0
- package/dist/browser/actions/CommandMenu.js.map +1 -0
- package/dist/browser/actions/Dropdown.js +43 -10
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/command-dock.js +47 -0
- package/dist/browser/actions/command-dock.js.map +1 -0
- package/dist/browser/actions/command-items.js +84 -0
- package/dist/browser/actions/command-items.js.map +1 -0
- package/dist/browser/actions/command-messages.js +42 -0
- package/dist/browser/actions/command-messages.js.map +1 -0
- package/dist/browser/actions/index.js +1 -0
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/charts/core/area.js +3 -5
- package/dist/browser/charts/core/area.js.map +1 -1
- package/dist/browser/charts/core/calendar.js +1 -1
- package/dist/browser/charts/core/calendar.js.map +1 -1
- package/dist/browser/charts/core/chart-messages.js +17 -0
- package/dist/browser/charts/core/chart-messages.js.map +1 -0
- package/dist/browser/charts/core/hbar-layout.js +118 -0
- package/dist/browser/charts/core/hbar-layout.js.map +1 -0
- package/dist/browser/charts/core/hbar.js +39 -0
- package/dist/browser/charts/core/hbar.js.map +1 -0
- package/dist/browser/charts/core/index.js +7 -2
- package/dist/browser/charts/core/index.js.map +1 -1
- package/dist/browser/charts/core/map.js +116 -0
- package/dist/browser/charts/core/map.js.map +1 -0
- package/dist/browser/charts/core/registry.js +22 -15
- package/dist/browser/charts/core/registry.js.map +1 -1
- package/dist/browser/charts/core/render-size.js +13 -0
- package/dist/browser/charts/core/render-size.js.map +1 -0
- package/dist/browser/charts/core/render.js +20 -10
- package/dist/browser/charts/core/render.js.map +1 -1
- package/dist/browser/charts/core/snapshot.js +3 -3
- package/dist/browser/charts/core/snapshot.js.map +1 -1
- package/dist/browser/charts/core/svg-renderers.js +2406 -0
- package/dist/browser/charts/core/svg-renderers.js.map +1 -0
- package/dist/browser/charts/core/svg.js +4 -2525
- package/dist/browser/charts/core/svg.js.map +1 -1
- package/dist/browser/charts/core/types.js +0 -2
- package/dist/browser/charts/core/types.js.map +1 -1
- package/dist/browser/charts/core/waterfall.js +162 -0
- package/dist/browser/charts/core/waterfall.js.map +1 -0
- package/dist/browser/charts/description.js +2 -0
- package/dist/browser/charts/description.js.map +1 -0
- package/dist/browser/charts.js.map +1 -1
- package/dist/browser/content/Chart.js +14 -628
- package/dist/browser/content/Chart.js.map +1 -1
- package/dist/browser/content/ChartRoot.js +632 -0
- package/dist/browser/content/ChartRoot.js.map +1 -0
- package/dist/browser/content/ChartSparkline.js +24 -0
- package/dist/browser/content/ChartSparkline.js.map +1 -0
- package/dist/browser/content/FileView.js +111 -61
- package/dist/browser/content/FileView.js.map +1 -1
- package/dist/browser/content/Lightbox.js +8 -8
- package/dist/browser/content/Lightbox.js.map +1 -1
- package/dist/browser/content/MapView.js +30 -28
- package/dist/browser/content/MapView.js.map +1 -1
- package/dist/browser/content/PdfPreview.js +84 -52
- package/dist/browser/content/PdfPreview.js.map +1 -1
- package/dist/browser/content/PdfViewer.js +588 -0
- package/dist/browser/content/PdfViewer.js.map +1 -0
- package/dist/browser/content/chart-bar.js +246 -16
- package/dist/browser/content/chart-bar.js.map +1 -1
- package/dist/browser/content/chart-inspection-core.js +22 -21
- package/dist/browser/content/chart-inspection-core.js.map +1 -1
- package/dist/browser/content/chart-line-gaps.js +1 -1
- package/dist/browser/content/chart-line-gaps.js.map +1 -1
- package/dist/browser/content/chart-message-catalog.js +10 -0
- package/dist/browser/content/chart-message-catalog.js.map +1 -1
- package/dist/browser/content/chart-state-timeline.js +1 -1
- package/dist/browser/content/chart-state-timeline.js.map +1 -1
- package/dist/browser/content/chart-svg.js +2 -1
- package/dist/browser/content/chart-svg.js.map +1 -1
- package/dist/browser/content/index.js +1 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/pdf-document.js +29 -0
- package/dist/browser/content/pdf-document.js.map +1 -0
- package/dist/browser/content/pdf-limits.js +31 -0
- package/dist/browser/content/pdf-limits.js.map +1 -0
- package/dist/browser/content/pdf-messages.js +34 -2
- package/dist/browser/content/pdf-messages.js.map +1 -1
- package/dist/browser/content/pdf-viewer-engine.js +57 -0
- package/dist/browser/content/pdf-viewer-worker.js +28 -0
- package/dist/browser/inputs/ChoiceInputs.js +94 -51
- package/dist/browser/inputs/ChoiceInputs.js.map +1 -1
- package/dist/browser/inputs/ChoiceSlider.js +75 -58
- package/dist/browser/inputs/ChoiceSlider.js.map +1 -1
- package/dist/browser/inputs/DatePicker.js +113 -98
- package/dist/browser/inputs/DatePicker.js.map +1 -1
- package/dist/browser/inputs/PeriodPicker.js +874 -0
- package/dist/browser/inputs/PeriodPicker.js.map +1 -0
- package/dist/browser/inputs/index.js +4 -1
- package/dist/browser/inputs/index.js.map +1 -1
- package/dist/browser/inputs/input-messages.js +8 -2
- package/dist/browser/inputs/input-messages.js.map +1 -1
- package/dist/browser/inputs/markdown/MarkdownEditor.js +14 -10
- package/dist/browser/inputs/markdown/MarkdownEditor.js.map +1 -1
- package/dist/browser/inputs/markdown/SlashCommands.js +402 -0
- package/dist/browser/inputs/markdown/SlashCommands.js.map +1 -0
- package/dist/browser/inputs/period-picker-messages.js +71 -0
- package/dist/browser/inputs/period-picker-messages.js.map +1 -0
- package/dist/browser/inputs/period.js +263 -0
- package/dist/browser/inputs/period.js.map +1 -0
- package/dist/browser/layout/DetailPanel.js +147 -120
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/Discussion.js +101 -108
- package/dist/browser/layout/Discussion.js.map +1 -1
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/surfaces/DescriptionList.js +5 -2
- package/dist/browser/surfaces/DescriptionList.js.map +1 -1
- package/dist/browser/surfaces/StatCell.js +19 -14
- package/dist/browser/surfaces/StatCell.js.map +1 -1
- package/dist/browser/surfaces/delta-badge.js +16 -2
- package/dist/browser/surfaces/delta-badge.js.map +1 -1
- package/dist/browser/widgets/DashboardFrame.js +310 -0
- package/dist/browser/widgets/DashboardFrame.js.map +1 -0
- package/dist/browser/widgets/index.js +1 -0
- package/dist/browser/widgets/index.js.map +1 -1
- package/dist/licenses/pdfjs-dist.txt +177 -0
- package/dist/ssr/actions/Button.js.map +1 -1
- package/dist/ssr/actions/CommandList.js +638 -0
- package/dist/ssr/actions/CommandList.js.map +1 -0
- package/dist/ssr/actions/CommandMenu.js +197 -0
- package/dist/ssr/actions/CommandMenu.js.map +1 -0
- package/dist/ssr/actions/Dropdown.js +43 -10
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/command-dock.js +47 -0
- package/dist/ssr/actions/command-dock.js.map +1 -0
- package/dist/ssr/actions/command-items.js +84 -0
- package/dist/ssr/actions/command-items.js.map +1 -0
- package/dist/ssr/actions/command-messages.js +42 -0
- package/dist/ssr/actions/command-messages.js.map +1 -0
- package/dist/ssr/actions/index.js +1 -0
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/charts/core/area.js +3 -5
- package/dist/ssr/charts/core/area.js.map +1 -1
- package/dist/ssr/charts/core/calendar.js +1 -1
- package/dist/ssr/charts/core/calendar.js.map +1 -1
- package/dist/ssr/charts/core/chart-messages.js +17 -0
- package/dist/ssr/charts/core/chart-messages.js.map +1 -0
- package/dist/ssr/charts/core/hbar-layout.js +118 -0
- package/dist/ssr/charts/core/hbar-layout.js.map +1 -0
- package/dist/ssr/charts/core/hbar.js +39 -0
- package/dist/ssr/charts/core/hbar.js.map +1 -0
- package/dist/ssr/charts/core/index.js +7 -2
- package/dist/ssr/charts/core/index.js.map +1 -1
- package/dist/ssr/charts/core/map.js +116 -0
- package/dist/ssr/charts/core/map.js.map +1 -0
- package/dist/ssr/charts/core/registry.js +22 -15
- package/dist/ssr/charts/core/registry.js.map +1 -1
- package/dist/ssr/charts/core/render-size.js +13 -0
- package/dist/ssr/charts/core/render-size.js.map +1 -0
- package/dist/ssr/charts/core/render.js +20 -10
- package/dist/ssr/charts/core/render.js.map +1 -1
- package/dist/ssr/charts/core/snapshot.js +3 -3
- package/dist/ssr/charts/core/snapshot.js.map +1 -1
- package/dist/ssr/charts/core/svg-renderers.js +2406 -0
- package/dist/ssr/charts/core/svg-renderers.js.map +1 -0
- package/dist/ssr/charts/core/svg.js +4 -2525
- package/dist/ssr/charts/core/svg.js.map +1 -1
- package/dist/ssr/charts/core/types.js +0 -2
- package/dist/ssr/charts/core/types.js.map +1 -1
- package/dist/ssr/charts/core/waterfall.js +162 -0
- package/dist/ssr/charts/core/waterfall.js.map +1 -0
- package/dist/ssr/charts/description.js +2 -0
- package/dist/ssr/charts/description.js.map +1 -0
- package/dist/ssr/charts.js.map +1 -1
- package/dist/ssr/content/Chart.js +14 -471
- package/dist/ssr/content/Chart.js.map +1 -1
- package/dist/ssr/content/ChartRoot.js +475 -0
- package/dist/ssr/content/ChartRoot.js.map +1 -0
- package/dist/ssr/content/ChartSparkline.js +24 -0
- package/dist/ssr/content/ChartSparkline.js.map +1 -0
- package/dist/ssr/content/FileView.js +56 -7
- package/dist/ssr/content/FileView.js.map +1 -1
- package/dist/ssr/content/Lightbox.js +8 -8
- package/dist/ssr/content/Lightbox.js.map +1 -1
- package/dist/ssr/content/MapView.js +9 -9
- package/dist/ssr/content/MapView.js.map +1 -1
- package/dist/ssr/content/PdfPreview.js +49 -20
- package/dist/ssr/content/PdfPreview.js.map +1 -1
- package/dist/ssr/content/PdfViewer.js +484 -0
- package/dist/ssr/content/PdfViewer.js.map +1 -0
- package/dist/ssr/content/chart-bar.js +246 -16
- package/dist/ssr/content/chart-bar.js.map +1 -1
- package/dist/ssr/content/chart-inspection-core.js +22 -21
- package/dist/ssr/content/chart-inspection-core.js.map +1 -1
- package/dist/ssr/content/chart-line-gaps.js +1 -1
- package/dist/ssr/content/chart-line-gaps.js.map +1 -1
- package/dist/ssr/content/chart-message-catalog.js +10 -0
- package/dist/ssr/content/chart-message-catalog.js.map +1 -1
- package/dist/ssr/content/chart-state-timeline.js +1 -1
- package/dist/ssr/content/chart-state-timeline.js.map +1 -1
- package/dist/ssr/content/chart-svg.js +2 -1
- package/dist/ssr/content/chart-svg.js.map +1 -1
- package/dist/ssr/content/index.js +1 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/pdf-document.js +29 -0
- package/dist/ssr/content/pdf-document.js.map +1 -0
- package/dist/ssr/content/pdf-limits.js +31 -0
- package/dist/ssr/content/pdf-limits.js.map +1 -0
- package/dist/ssr/content/pdf-messages.js +34 -2
- package/dist/ssr/content/pdf-messages.js.map +1 -1
- package/dist/ssr/inputs/ChoiceInputs.js +49 -12
- package/dist/ssr/inputs/ChoiceInputs.js.map +1 -1
- package/dist/ssr/inputs/ChoiceSlider.js +17 -12
- package/dist/ssr/inputs/ChoiceSlider.js.map +1 -1
- package/dist/ssr/inputs/DatePicker.js +14 -9
- package/dist/ssr/inputs/DatePicker.js.map +1 -1
- package/dist/ssr/inputs/PeriodPicker.js +598 -0
- package/dist/ssr/inputs/PeriodPicker.js.map +1 -0
- package/dist/ssr/inputs/index.js +4 -1
- package/dist/ssr/inputs/index.js.map +1 -1
- package/dist/ssr/inputs/input-messages.js +8 -2
- package/dist/ssr/inputs/input-messages.js.map +1 -1
- package/dist/ssr/inputs/markdown/MarkdownEditor.js +3 -2
- package/dist/ssr/inputs/markdown/MarkdownEditor.js.map +1 -1
- package/dist/ssr/inputs/markdown/SlashCommands.js +339 -0
- package/dist/ssr/inputs/markdown/SlashCommands.js.map +1 -0
- package/dist/ssr/inputs/period-picker-messages.js +71 -0
- package/dist/ssr/inputs/period-picker-messages.js.map +1 -0
- package/dist/ssr/inputs/period.js +263 -0
- package/dist/ssr/inputs/period.js.map +1 -0
- package/dist/ssr/layout/DetailPanel.js +27 -4
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/Discussion.js +16 -2
- package/dist/ssr/layout/Discussion.js.map +1 -1
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/surfaces/DescriptionList.js +1 -1
- package/dist/ssr/surfaces/DescriptionList.js.map +1 -1
- package/dist/ssr/surfaces/StatCell.js +4 -5
- package/dist/ssr/surfaces/StatCell.js.map +1 -1
- package/dist/ssr/surfaces/delta-badge.js +16 -2
- package/dist/ssr/surfaces/delta-badge.js.map +1 -1
- package/dist/ssr/widgets/DashboardFrame.js +200 -0
- package/dist/ssr/widgets/DashboardFrame.js.map +1 -0
- package/dist/ssr/widgets/index.js +1 -0
- package/dist/ssr/widgets/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/Button.d.ts +1 -1
- package/dist/types/actions/CommandList.d.ts +120 -0
- package/dist/types/actions/CommandMenu.d.ts +39 -0
- package/dist/types/actions/Dropdown.d.ts +17 -0
- package/dist/types/actions/command-dock.d.ts +8 -0
- package/dist/types/actions/command-items.d.ts +134 -0
- package/dist/types/actions/command-messages.d.ts +19 -0
- package/dist/types/actions/index.d.ts +3 -0
- package/dist/types/charts/core/calendar.d.ts +1 -1
- package/dist/types/charts/core/chart-messages.d.ts +5 -0
- package/dist/types/charts/core/hbar-layout.d.ts +74 -0
- package/dist/types/charts/core/hbar.d.ts +13 -0
- package/dist/types/charts/core/index.d.ts +7 -2
- package/dist/types/charts/core/map.d.ts +3 -0
- package/dist/types/charts/core/registry.d.ts +17 -11
- package/dist/types/charts/core/render-size.d.ts +7 -0
- package/dist/types/charts/core/render.d.ts +1 -4
- package/dist/types/charts/core/snapshot.d.ts +2 -2
- package/dist/types/charts/core/svg-renderers.d.ts +722 -0
- package/dist/types/charts/core/svg.d.ts +4 -698
- package/dist/types/charts/core/types.d.ts +1 -12
- package/dist/types/charts/core/waterfall.d.ts +68 -0
- package/dist/types/charts/description.d.ts +226 -0
- package/dist/types/charts.d.ts +1 -0
- package/dist/types/content/Chart.d.ts +3 -91
- package/dist/types/content/ChartRoot.d.ts +92 -0
- package/dist/types/content/ChartSparkline.d.ts +5 -0
- package/dist/types/content/PdfViewer.d.ts +32 -0
- package/dist/types/content/chart-bar.d.ts +95 -2
- package/dist/types/content/index.d.ts +2 -0
- package/dist/types/content/pdf-document.d.ts +5 -0
- package/dist/types/content/pdf-engine.d.ts +9 -0
- package/dist/types/content/pdf-limits.d.ts +43 -0
- package/dist/types/content/pdf-messages.d.ts +16 -0
- package/dist/types/inputs/ChoiceInputs.d.ts +4 -0
- package/dist/types/inputs/ChoiceSlider.d.ts +12 -0
- package/dist/types/inputs/DatePicker.d.ts +22 -0
- package/dist/types/inputs/PeriodPicker.d.ts +24 -0
- package/dist/types/inputs/index.d.ts +8 -2
- package/dist/types/inputs/input-messages.d.ts +3 -0
- package/dist/types/inputs/markdown/MarkdownEditor.d.ts +5 -0
- package/dist/types/inputs/markdown/SlashCommands.d.ts +20 -0
- package/dist/types/inputs/period-picker-messages.d.ts +34 -0
- package/dist/types/inputs/period.d.ts +134 -0
- package/dist/types/layout/DetailPanel.d.ts +12 -0
- package/dist/types/layout/index.d.ts +1 -1
- package/dist/types/surfaces/DescriptionList.d.ts +5 -0
- package/dist/types/surfaces/StatCell.d.ts +6 -1
- package/dist/types/widgets/DashboardFrame.d.ts +58 -0
- package/dist/types/widgets/index.d.ts +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PdfDocumentHandle } from "./pdf-limits";
|
|
2
|
+
/**
|
|
3
|
+
* The PDF engine: pdf.js and the glue `PdfViewer` needs. The @k2b/ui build bundles this module on its own into
|
|
4
|
+
* `pdf-viewer-engine.js`; `openPdfDocument` loads it by address, so a host's bundle never contains pdf.js. The legacy
|
|
5
|
+
* build also runs on older Safari on iPad. Parsing never runs code from the document: there is no scripting, XFA stays
|
|
6
|
+
* off, and pdf.js loads nothing beyond the given bytes. `workerUrl` is resolved against this module, next to which the
|
|
7
|
+
* host's bundler put the worker file.
|
|
8
|
+
*/
|
|
9
|
+
export declare function openPdf(data: ArrayBuffer, signal: AbortSignal, workerUrl: string): Promise<PdfDocumentHandle | null>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Shapes and bounds shared by `PdfViewer`, its loader, and the pdf.js engine. */
|
|
2
|
+
/** A page's size in PDF points at scale 1. */
|
|
3
|
+
export type PdfPageSize = {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
};
|
|
7
|
+
/** One drawn page: an object URL the caller revokes, and its size in pixels. */
|
|
8
|
+
export type PdfPageImage = {
|
|
9
|
+
url: string;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
export type PdfDocumentHandle = {
|
|
14
|
+
pages: readonly PdfPageSize[];
|
|
15
|
+
/** Draws one page `widthPx` wide; `null` after an abort. The caller revokes the returned URL. */
|
|
16
|
+
draw: (index: number, widthPx: number, signal: AbortSignal) => Promise<PdfPageImage | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Lays the selectable, searchable text of one page into `container`. Positions are relative to the page; the font
|
|
19
|
+
* follows `--total-scale-factor` (CSS pixels per point) on the container or above, so zoom changes only that value.
|
|
20
|
+
*/
|
|
21
|
+
textLayer: (index: number, container: HTMLElement, signal: AbortSignal) => Promise<void>;
|
|
22
|
+
close: () => Promise<void>;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Bounds for one document. Bytes and pages bound parsing work and memory; a larger document falls back to the
|
|
26
|
+
* browser's own viewer. Canvas pixels stay below the size Safari still draws (larger canvases come out blank).
|
|
27
|
+
*/
|
|
28
|
+
export declare const PDF_LIMITS: {
|
|
29
|
+
readonly maxBytes: number;
|
|
30
|
+
readonly maxPages: 2000;
|
|
31
|
+
readonly maxCanvasPixels: 16000000;
|
|
32
|
+
readonly maxImageWidth: 4096;
|
|
33
|
+
};
|
|
34
|
+
/** The name of the error a document past `PDF_LIMITS` raises; the host shows the browser's viewer instead. */
|
|
35
|
+
export declare const PDF_TOO_LARGE = "PdfTooLargeError";
|
|
36
|
+
export declare const pdfTooLarge: (message: string) => Error;
|
|
37
|
+
/**
|
|
38
|
+
* Pixel width for a page image shown `displayWidth` CSS pixels wide: display width times the device pixel ratio
|
|
39
|
+
* (at most 2), at least 400 px where the page allows it, at most `PDF_LIMITS.maxImageWidth`, and always small enough
|
|
40
|
+
* that the canvas stays under `PDF_LIMITS.maxCanvasPixels` for the page's height-to-width `ratio`, also for a very
|
|
41
|
+
* tall page. Very deep zoom turns slightly soft, never blank.
|
|
42
|
+
*/
|
|
43
|
+
export declare const pageImageWidth: (displayWidth: number, pixelRatio: number, ratio: number) => number;
|
|
@@ -10,6 +10,22 @@ declare const pdfMessages: import("@k2b/stdlib").Catalog<{
|
|
|
10
10
|
pdfPreviewRendering: string;
|
|
11
11
|
previewPdf: string;
|
|
12
12
|
renderPdfPreview: string;
|
|
13
|
+
pdfPage: ({ number, total }: {
|
|
14
|
+
number: number;
|
|
15
|
+
total: number;
|
|
16
|
+
}) => string;
|
|
17
|
+
pdfPageShort: ({ number, total }: {
|
|
18
|
+
number: number;
|
|
19
|
+
total: number;
|
|
20
|
+
}) => string;
|
|
21
|
+
pdfZoom: string;
|
|
22
|
+
pdfZoomOut: string;
|
|
23
|
+
pdfZoomIn: string;
|
|
24
|
+
pdfZoomPercent: ({ value }: {
|
|
25
|
+
value: number;
|
|
26
|
+
}) => string;
|
|
27
|
+
pdfFitWidth: string;
|
|
28
|
+
pdfFitWidthLabel: string;
|
|
13
29
|
}>;
|
|
14
30
|
export type PdfMessages = ReturnType<(typeof pdfMessages)["resolve"]>["t"];
|
|
15
31
|
/** Resolved from the inherited render locale. */
|
|
@@ -14,6 +14,10 @@ export type SliderProps = FieldProps & Omit<JSX.InputHTMLAttributes<HTMLInputEle
|
|
|
14
14
|
formatValue?: (value: number) => string;
|
|
15
15
|
showValue?: boolean;
|
|
16
16
|
center?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The value the setting starts from. With it, a changed value shows in the accent color and a reset button
|
|
19
|
+
* appears in a slot the slider always keeps, so nothing moves. Double-click resets too.
|
|
20
|
+
*/
|
|
17
21
|
defaultValue?: number;
|
|
18
22
|
};
|
|
19
23
|
export declare function Slider(props: SliderProps): JSX.Element;
|
|
@@ -34,3 +34,15 @@ export type ChoiceSliderProps = {
|
|
|
34
34
|
* never changes. Unavailable stops stay visible and are skipped.
|
|
35
35
|
*/
|
|
36
36
|
export declare function ChoiceSlider(props: ChoiceSliderProps): JSX.Element;
|
|
37
|
+
export type ChoiceSliderIndicatorProps = {
|
|
38
|
+
/** How many stops the slider it stands for has. */
|
|
39
|
+
count: number;
|
|
40
|
+
/** The chosen stop's index, or `null` (or a negative index) for a choice that is none of the stops. */
|
|
41
|
+
index: number | null;
|
|
42
|
+
class?: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* The slider in small and without interaction, 24 px wide: rail, fill and thumb in the same look, for a trigger that
|
|
46
|
+
* opens the real slider. It is decoration; the trigger's own label says the value.
|
|
47
|
+
*/
|
|
48
|
+
export declare function ChoiceSliderIndicator(props: ChoiceSliderIndicatorProps): JSX.Element;
|
|
@@ -52,6 +52,28 @@ export type DateRangePickerProps = DatePickerBaseProps<DateRangeValue> & {
|
|
|
52
52
|
};
|
|
53
53
|
/** `below` is a line under the trigger that the panel must not cover, such as a typed field's status line. */
|
|
54
54
|
export declare const placeDatePopover: (trigger: HTMLElement, popover: HTMLElement, wide: boolean, below?: HTMLElement) => void;
|
|
55
|
+
/** One month of days. Exported for composite pickers in this package (the period picker shows two side by side). */
|
|
56
|
+
export declare function DatePickerPanel(props: {
|
|
57
|
+
visibleMonth: () => Date;
|
|
58
|
+
setVisibleMonth: (date: Date) => void;
|
|
59
|
+
selected?: () => string | null | undefined;
|
|
60
|
+
range?: () => DateRangeValue;
|
|
61
|
+
focusDate?: () => string | null | undefined;
|
|
62
|
+
onSelect: (date: string) => void;
|
|
63
|
+
onDayPreview?: (date: string | null) => void;
|
|
64
|
+
dateConfig?: DateContext;
|
|
65
|
+
/** Earliest and latest selectable day as date keys. */
|
|
66
|
+
min?: string;
|
|
67
|
+
max?: string;
|
|
68
|
+
/** Which month steps this panel offers; a second month beside it offers the other one. */
|
|
69
|
+
nav?: "both" | "previous" | "next";
|
|
70
|
+
/** Leaves the days of neighbouring months empty (`visibility: hidden`), so two months side by side never show a day twice. */
|
|
71
|
+
hideOutside?: boolean;
|
|
72
|
+
/** Whether a day is already on screen, also in a neighbouring panel; arrow keys then move there without paging. */
|
|
73
|
+
isShown?: (date: Date) => boolean;
|
|
74
|
+
/** Where keyboard navigation looks for the day to focus; the panel itself by default. */
|
|
75
|
+
focusRoot?: () => HTMLElement | undefined;
|
|
76
|
+
}): JSX.Element;
|
|
55
77
|
export declare function DatePicker(props: DatePickerProps): JSX.Element;
|
|
56
78
|
export declare function DateTimePicker(props: DateTimePickerProps): JSX.Element;
|
|
57
79
|
export declare function DateRangePicker(props: DateRangePickerProps): JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import type { DateContext, MaybeAccessor, ValueFieldProps } from "./field-contract";
|
|
3
|
+
import { type PeriodPreset, type PeriodValue } from "./period";
|
|
4
|
+
export type PeriodPickerProps = Omit<ValueFieldProps<PeriodValue | null>, "value"> & {
|
|
5
|
+
/** A preset key or two explicit days; `null` or an unknown preset key shows the placeholder. */
|
|
6
|
+
value: MaybeAccessor<PeriodValue | null>;
|
|
7
|
+
/** The presets in list order, for example `periodPresets.thisMonth` or an app's own `{ key, label, resolve }`. */
|
|
8
|
+
presets: readonly PeriodPreset[];
|
|
9
|
+
/** Offers "Custom range" with a calendar in the same popover. On by default. */
|
|
10
|
+
custom?: boolean;
|
|
11
|
+
/** Time zone, week start and locale. Presets resolve "today" in `timeZone`; pass the zone the data uses. */
|
|
12
|
+
dateConfig?: DateContext;
|
|
13
|
+
/** The instant "today" is read from. Pass the server's instant so the first render and the browser agree. */
|
|
14
|
+
now?: Date;
|
|
15
|
+
/** Shows that a change is saving: the trigger keeps its size, cannot be opened, and shows a spinner. */
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* PeriodPicker — one control for the period an evaluation or dashboard shows: presets such as "This month" plus a
|
|
20
|
+
* custom range, edited in the same popover (a bottom sheet on phones). The trigger shows the preset with its days or
|
|
21
|
+
* the custom days with their count, and keeps the width of its longest text so nothing beside it moves.
|
|
22
|
+
*/
|
|
23
|
+
export declare function PeriodPicker(props: PeriodPickerProps): JSX.Element;
|
|
24
|
+
export default PeriodPicker;
|
|
@@ -12,8 +12,8 @@ export type { ColorInputProps, PinInputProps, SliderProps, } from "./ChoiceInput
|
|
|
12
12
|
export { ColorInput, PinInput, Slider } from "./ChoiceInputs";
|
|
13
13
|
export type { ChoiceListOption, ChoiceListProps } from "./ChoiceList";
|
|
14
14
|
export { ChoiceList } from "./ChoiceList";
|
|
15
|
-
export type { ChoiceSliderOption, ChoiceSliderProps } from "./ChoiceSlider";
|
|
16
|
-
export { ChoiceSlider } from "./ChoiceSlider";
|
|
15
|
+
export type { ChoiceSliderIndicatorProps, ChoiceSliderOption, ChoiceSliderProps } from "./ChoiceSlider";
|
|
16
|
+
export { ChoiceSlider, ChoiceSliderIndicator } from "./ChoiceSlider";
|
|
17
17
|
export type { ChoiceTileOption, ChoiceTilesProps } from "./ChoiceTiles";
|
|
18
18
|
export { ChoiceTiles } from "./ChoiceTiles";
|
|
19
19
|
export type { ColorChoiceOption, ColorChoicesProps } from "./ColorChoices";
|
|
@@ -48,8 +48,14 @@ export type { MultiSelectFetchDataFn, MultiSelectInputProps, MultiSelectOption,
|
|
|
48
48
|
export { MultiSelectInput } from "./MultiSelectInput";
|
|
49
49
|
export type { MarkdownEditorProps } from "./markdown/MarkdownEditor";
|
|
50
50
|
export { MarkdownEditor } from "./markdown/MarkdownEditor";
|
|
51
|
+
export type { SlashCommandsProps } from "./markdown/SlashCommands";
|
|
52
|
+
export { SlashCommands } from "./markdown/SlashCommands";
|
|
51
53
|
export type { NumberInputProps } from "./NumberInput";
|
|
52
54
|
export { NumberInput } from "./NumberInput";
|
|
55
|
+
export type { PeriodPickerProps } from "./PeriodPicker";
|
|
56
|
+
export { PeriodPicker } from "./PeriodPicker";
|
|
57
|
+
export type { PeriodClock, PeriodContext, PeriodPreset, PeriodRange, PeriodValue } from "./period";
|
|
58
|
+
export { formatPeriodDays, formatPeriodRange, isPeriodDay, parsePeriodValue, periodContext, periodDayCount, periodInstants, periodPresets, resolvePeriod, } from "./period";
|
|
53
59
|
export type { QrScannerError, QrScannerProps } from "./QrScanner";
|
|
54
60
|
export { QrScanner } from "./QrScanner";
|
|
55
61
|
export type { RichSelectFact, RichSelectFooter, RichSelectItem, RichSelectProps, RichSelectSection, RichSelectStatus, } from "./RichSelect";
|
|
@@ -9,6 +9,9 @@ declare const inputMessages: import("@k2b/stdlib").Catalog<{
|
|
|
9
9
|
index: number;
|
|
10
10
|
total: number;
|
|
11
11
|
}) => string;
|
|
12
|
+
resetTo: ({ value }: {
|
|
13
|
+
value: string;
|
|
14
|
+
}) => string;
|
|
12
15
|
}>;
|
|
13
16
|
export type InputMessages = ReturnType<(typeof inputMessages)["resolve"]>["t"];
|
|
14
17
|
/** Resolved from the inherited render locale. */
|
|
@@ -14,6 +14,11 @@ export type MarkdownEditorProps = ValueFieldProps<string> & {
|
|
|
14
14
|
completions?: readonly Completion[];
|
|
15
15
|
showStats?: boolean;
|
|
16
16
|
variant?: "default" | "paper" | "embedded";
|
|
17
|
+
/**
|
|
18
|
+
* The font of the text, its highlighting, and the placeholder together: `mono` (default) for Markdown source,
|
|
19
|
+
* `sans` for a message composer whose text later shows in the interface font.
|
|
20
|
+
*/
|
|
21
|
+
font?: "mono" | "sans";
|
|
17
22
|
fill?: boolean;
|
|
18
23
|
/** Groups save and close at the end of the toolbar. The caller owns navigation and unsaved-change confirmation. */
|
|
19
24
|
onClose?: () => void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type CommandSource } from "../../actions/command-items";
|
|
3
|
+
export type SlashCommandsProps = {
|
|
4
|
+
/** The editor's textarea, from `MarkdownEditor`'s `textareaRef`. The commands attach once it is there. */
|
|
5
|
+
textarea: HTMLTextAreaElement | undefined;
|
|
6
|
+
/** The same entries as `CommandMenu`'s `items`. */
|
|
7
|
+
items: CommandSource;
|
|
8
|
+
/**
|
|
9
|
+
* The composer box the list docks to, such as the frame around the editor and its "+" row. Defaults to the editor
|
|
10
|
+
* itself.
|
|
11
|
+
*/
|
|
12
|
+
composer?: HTMLElement;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Slash commands for a `MarkdownEditor`: `/` at the start of a line or after a space opens the entries docked above the
|
|
16
|
+
* composer, as wide as it is. Place it beside the editor and pass the editor's textarea. It listens to the textarea itself, so editors without
|
|
17
|
+
* commands carry none of it: native listeners run before the editor's own, and a key it uses is marked handled with
|
|
18
|
+
* `preventDefault`, which the editor respects.
|
|
19
|
+
*/
|
|
20
|
+
export declare function SlashCommands(props: SlashCommandsProps): JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Labels of the built-in period presets and the picker's own words. */
|
|
2
|
+
declare const periodPickerMessages: import("@k2b/stdlib").Catalog<{
|
|
3
|
+
period: string;
|
|
4
|
+
choosePeriod: string;
|
|
5
|
+
custom: string;
|
|
6
|
+
from: string;
|
|
7
|
+
to: string;
|
|
8
|
+
backToPresets: string;
|
|
9
|
+
since: ({ date }: {
|
|
10
|
+
date: string;
|
|
11
|
+
}) => string;
|
|
12
|
+
days: ({ count }: {
|
|
13
|
+
count: number;
|
|
14
|
+
}) => string;
|
|
15
|
+
today: string;
|
|
16
|
+
yesterday: string;
|
|
17
|
+
"this-week": string;
|
|
18
|
+
"last-week": string;
|
|
19
|
+
"this-month": string;
|
|
20
|
+
"last-month": string;
|
|
21
|
+
"this-quarter": string;
|
|
22
|
+
"last-quarter": string;
|
|
23
|
+
"this-year": string;
|
|
24
|
+
"last-year": string;
|
|
25
|
+
all: string;
|
|
26
|
+
}>;
|
|
27
|
+
export type PeriodPickerMessages = ReturnType<(typeof periodPickerMessages)["resolve"]>["t"];
|
|
28
|
+
/** The translated label of a built-in preset key, if it is one. */
|
|
29
|
+
export declare const builtInPresetLabel: (t: PeriodPickerMessages, key: string) => string | undefined;
|
|
30
|
+
/** Resolved from the inherited render locale. */
|
|
31
|
+
export declare const usePeriodPickerMessages: () => (() => PeriodPickerMessages);
|
|
32
|
+
export declare const resolvePeriodPickerMessages: (locale?: string) => PeriodPickerMessages;
|
|
33
|
+
export declare const checkPeriodPickerMessages: () => import("@k2b/stdlib").CatalogIssue[];
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A period as an app stores it: a preset key that stays relative ("this month" is next month's month too), or two
|
|
3
|
+
* explicit days. Days are date keys such as `2026-11-01`; `end` is inclusive.
|
|
4
|
+
*/
|
|
5
|
+
export type PeriodValue = {
|
|
6
|
+
preset: string;
|
|
7
|
+
} | {
|
|
8
|
+
start: string;
|
|
9
|
+
end: string;
|
|
10
|
+
};
|
|
11
|
+
/** Inclusive days of a period. `null` is an open edge, for example "All time" without a known first day. */
|
|
12
|
+
export type PeriodRange = {
|
|
13
|
+
start: string | null;
|
|
14
|
+
end: string | null;
|
|
15
|
+
};
|
|
16
|
+
/** What a preset resolves against: today in the period's time zone and the first day of the week. */
|
|
17
|
+
export type PeriodContext = {
|
|
18
|
+
today: string;
|
|
19
|
+
weekStartsOn: 0 | 1;
|
|
20
|
+
};
|
|
21
|
+
export type PeriodPreset = {
|
|
22
|
+
key: string;
|
|
23
|
+
/** Shown in the list and the trigger. Built-in presets bring a translated label; app presets name their own. */
|
|
24
|
+
label?: string;
|
|
25
|
+
resolve: (context: PeriodContext) => PeriodRange;
|
|
26
|
+
};
|
|
27
|
+
/** The clock a period is resolved with. Server and browser pass the same values so the first render agrees. */
|
|
28
|
+
export type PeriodClock = {
|
|
29
|
+
/** The instant "today" is read from; defaults to now. */
|
|
30
|
+
now?: Date;
|
|
31
|
+
/** IANA time zone the days belong to, for example a base's zone; defaults to the runtime zone. */
|
|
32
|
+
timeZone?: string;
|
|
33
|
+
/** First day of the week, as in the calendar's date config; Monday by default. */
|
|
34
|
+
weekStartsOn?: 0 | 1;
|
|
35
|
+
/** Alias of `weekStartsOn`, accepted from a shared date config. */
|
|
36
|
+
firstDayOfWeek?: 0 | 1;
|
|
37
|
+
};
|
|
38
|
+
/** Adds whole days to a date key; calendar days, so a DST change never moves it. */
|
|
39
|
+
export declare const addPeriodDays: (key: string, count: number) => string;
|
|
40
|
+
/** Number of days in an inclusive range of date keys. */
|
|
41
|
+
export declare const periodDayCount: (range: {
|
|
42
|
+
start: string;
|
|
43
|
+
end: string;
|
|
44
|
+
}) => number;
|
|
45
|
+
/**
|
|
46
|
+
* Built-in presets. Each covers its whole calendar period ("This month" is the 1st to the last day, not up to
|
|
47
|
+
* today) in the period's time zone; weeks start on the context's first day of the week.
|
|
48
|
+
*/
|
|
49
|
+
export declare const periodPresets: {
|
|
50
|
+
today: {
|
|
51
|
+
key: string;
|
|
52
|
+
resolve: ({ today }: PeriodContext) => {
|
|
53
|
+
start: string;
|
|
54
|
+
end: string;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
yesterday: {
|
|
58
|
+
key: string;
|
|
59
|
+
resolve: ({ today }: PeriodContext) => {
|
|
60
|
+
start: string;
|
|
61
|
+
end: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
thisWeek: {
|
|
65
|
+
key: string;
|
|
66
|
+
resolve: (context: PeriodContext) => PeriodRange;
|
|
67
|
+
};
|
|
68
|
+
lastWeek: {
|
|
69
|
+
key: string;
|
|
70
|
+
resolve: (context: PeriodContext) => PeriodRange;
|
|
71
|
+
};
|
|
72
|
+
thisMonth: {
|
|
73
|
+
key: string;
|
|
74
|
+
resolve: ({ today }: PeriodContext) => PeriodRange;
|
|
75
|
+
};
|
|
76
|
+
lastMonth: {
|
|
77
|
+
key: string;
|
|
78
|
+
resolve: ({ today }: PeriodContext) => PeriodRange;
|
|
79
|
+
};
|
|
80
|
+
thisQuarter: {
|
|
81
|
+
key: string;
|
|
82
|
+
resolve: ({ today }: PeriodContext) => PeriodRange;
|
|
83
|
+
};
|
|
84
|
+
lastQuarter: {
|
|
85
|
+
key: string;
|
|
86
|
+
resolve: ({ today }: PeriodContext) => PeriodRange;
|
|
87
|
+
};
|
|
88
|
+
thisYear: {
|
|
89
|
+
key: string;
|
|
90
|
+
resolve: ({ today }: PeriodContext) => PeriodRange;
|
|
91
|
+
};
|
|
92
|
+
lastYear: {
|
|
93
|
+
key: string;
|
|
94
|
+
resolve: ({ today }: PeriodContext) => PeriodRange;
|
|
95
|
+
};
|
|
96
|
+
/** Everything up to today; `since` is the first day with data when the app knows it, else the start stays open. */
|
|
97
|
+
all: (options?: {
|
|
98
|
+
since?: string | null;
|
|
99
|
+
}) => PeriodPreset;
|
|
100
|
+
};
|
|
101
|
+
/** A real calendar day key, not only the shape (`2026-02-30` is refused). */
|
|
102
|
+
export declare const isPeriodDay: (value: unknown) => value is string;
|
|
103
|
+
/** Accepts a stored or URL value only when it is a known preset key or two real days in order. */
|
|
104
|
+
export declare const parsePeriodValue: (value: unknown, presets: readonly PeriodPreset[]) => PeriodValue | undefined;
|
|
105
|
+
/** The context presets resolve against: today in the clock's time zone. */
|
|
106
|
+
export declare const periodContext: (clock?: PeriodClock) => PeriodContext;
|
|
107
|
+
/**
|
|
108
|
+
* Resolves a value to inclusive days. Returns `undefined` for a preset key the list does not contain, so a stored
|
|
109
|
+
* period that no longer exists is never silently replaced.
|
|
110
|
+
*/
|
|
111
|
+
export declare const resolvePeriod: (value: PeriodValue, presets: readonly PeriodPreset[], clock?: PeriodClock) => PeriodRange | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* The instants a query uses for a resolved period: `from` is the start of the first day and `to` the start of the
|
|
114
|
+
* day after the last one (exclusive), both in the time zone. Days are never assumed to last 24 hours.
|
|
115
|
+
*/
|
|
116
|
+
export declare const periodInstants: (range: PeriodRange, timeZone: string) => {
|
|
117
|
+
from: string | null;
|
|
118
|
+
to: string | null;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Short days of a preset, for the list and the trigger: "Sat, Nov 7", "Nov 1 – 30", "2025", "since 3/14/2019".
|
|
122
|
+
* The year is added only when the period is not in today's year.
|
|
123
|
+
*/
|
|
124
|
+
export declare const formatPeriodDays: (range: PeriodRange, today: string, locale: string, since: (date: string) => string) => string;
|
|
125
|
+
/** Explicit days as numbers with the year: "01.–07.11.2026" in German, "11/1/2026 – 11/7/2026" in English. */
|
|
126
|
+
export declare const formatPeriodRange: (range: {
|
|
127
|
+
start: string;
|
|
128
|
+
end: string;
|
|
129
|
+
}, locale: string) => string;
|
|
130
|
+
/** The widest explicit range within today's year, all of it (two-digit days, a three-digit count), so a trigger can reserve its width. */
|
|
131
|
+
export declare const widePeriodRangeSample: (today: string) => {
|
|
132
|
+
start: string;
|
|
133
|
+
end: string;
|
|
134
|
+
};
|
|
@@ -74,12 +74,24 @@ export type DetailPanelActionSecondary = {
|
|
|
74
74
|
onClick: () => void;
|
|
75
75
|
variant?: "danger";
|
|
76
76
|
};
|
|
77
|
+
/**
|
|
78
|
+
* A checkbox before the row that toggles on its own, such as "done" for a task the row opens. It always shows its
|
|
79
|
+
* state, unlike a secondary action, which waits for hover.
|
|
80
|
+
*/
|
|
81
|
+
export type DetailPanelActionCheckbox = {
|
|
82
|
+
checked: boolean;
|
|
83
|
+
/** Accessible name, after the row, such as "Done: Call Mrs. Weber". */
|
|
84
|
+
label: string;
|
|
85
|
+
onChange: (checked: boolean) => void;
|
|
86
|
+
disabled?: boolean;
|
|
87
|
+
};
|
|
77
88
|
type DetailPanelActionBaseProps = {
|
|
78
89
|
title: JSX.Element;
|
|
79
90
|
description?: JSX.Element;
|
|
80
91
|
leading?: JSX.Element;
|
|
81
92
|
trailing?: JSX.Element;
|
|
82
93
|
secondaryAction?: DetailPanelActionSecondary;
|
|
94
|
+
checkbox?: DetailPanelActionCheckbox;
|
|
83
95
|
/** Marks the row of the current place, such as the section in view, in the panel's accent. */
|
|
84
96
|
current?: boolean;
|
|
85
97
|
/** Lets the title wrap to two lines instead of ending with an ellipsis. */
|
|
@@ -12,7 +12,7 @@ export { APP_WORKSPACE_DETAIL_DEFAULT, APP_WORKSPACE_DETAIL_MAX, APP_WORKSPACE_D
|
|
|
12
12
|
export { type BottomSheetProps, bottomSheetAdaptiveOptions, bottomSheetOptions, default as BottomSheet } from "./BottomSheet";
|
|
13
13
|
export type { DataPanelProps } from "./DataPanel";
|
|
14
14
|
export { DataPanel } from "./DataPanel";
|
|
15
|
-
export type { DetailPanelActionButtonProps, DetailPanelActionLinkProps, DetailPanelActionProps, DetailPanelActionSecondary, DetailPanelBodyProps, DetailPanelGroupProps, DetailPanelHeaderProps, DetailPanelProps, DetailPanelRowProps, DetailPanelSectionProps, DetailPanelSummaryProps, DetailPanelTone, } from "./DetailPanel";
|
|
15
|
+
export type { DetailPanelActionButtonProps, DetailPanelActionCheckbox, DetailPanelActionLinkProps, DetailPanelActionProps, DetailPanelActionSecondary, DetailPanelBodyProps, DetailPanelGroupProps, DetailPanelHeaderProps, DetailPanelProps, DetailPanelRowProps, DetailPanelSectionProps, DetailPanelSummaryProps, DetailPanelTone, } from "./DetailPanel";
|
|
16
16
|
export { default as DetailPanel } from "./DetailPanel";
|
|
17
17
|
export type { DetailAccessEntry, DetailAccessProps, DetailLinkItem, DetailLinksProps, DetailPresencePerson, DetailPresenceProps, DetailPresenceState, DetailPropertiesProps, DetailProperty, DetailTag, DetailTagsProps, } from "./DetailSections";
|
|
18
18
|
export { DetailAccess, DetailLinks, DetailPresence, DetailPresenceSlot, DetailProperties, DetailTags } from "./DetailSections";
|
|
@@ -10,6 +10,11 @@ export type DescriptionListProps = {
|
|
|
10
10
|
layout?: "grid" | "rows" | "compact";
|
|
11
11
|
size?: "sm" | "md";
|
|
12
12
|
actionVisibility?: "always" | "progressive";
|
|
13
|
+
/**
|
|
14
|
+
* Joins each term to its right-aligned value with a dotted leader, for `rows` or `compact` lists that must span a
|
|
15
|
+
* very wide container. A fallback, never the default: first keep rows within the row measure.
|
|
16
|
+
*/
|
|
17
|
+
leader?: "dotted";
|
|
13
18
|
class?: string;
|
|
14
19
|
};
|
|
15
20
|
/** Semantic key-value content with predictable responsive density. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type JSX } from "solid-js";
|
|
2
|
+
import type { ChartNumberFormat } from "../charts/description";
|
|
2
3
|
import type { ChartTooltipFormatter } from "../content/chart-inspection-core";
|
|
3
4
|
import type { AccentColor } from "../semantics";
|
|
4
5
|
import { type StatGridSize } from "./StatGrid";
|
|
@@ -15,7 +16,9 @@ export type StatCellAccent = {
|
|
|
15
16
|
*/
|
|
16
17
|
export type StatCellDelta = {
|
|
17
18
|
value: number;
|
|
18
|
-
unit?: "ratio" | "points";
|
|
19
|
+
unit?: "ratio" | "points" | "absolute";
|
|
20
|
+
/** Existing measures can express a change in their own unit instead of a ratio. */
|
|
21
|
+
format?: ChartNumberFormat;
|
|
19
22
|
better?: "up" | "down";
|
|
20
23
|
};
|
|
21
24
|
/** The value the change compares against, shown under the figure, such as "Last month 44,560". */
|
|
@@ -36,6 +39,8 @@ export type StatCellProps = {
|
|
|
36
39
|
tone?: StatCellTone | "in" | "out";
|
|
37
40
|
accent?: StatCellAccent;
|
|
38
41
|
delta?: StatCellDelta;
|
|
42
|
+
/** Keep the figure and change on separate rows, including while loading. Defaults to beside the figure. */
|
|
43
|
+
deltaPlacement?: "below";
|
|
39
44
|
compare?: StatCellCompare;
|
|
40
45
|
href?: string;
|
|
41
46
|
title?: string;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import type { DashboardWidth } from "./Dashboard";
|
|
3
|
+
/**
|
|
4
|
+
* What the host's read shows: its content (`ready`), the first read in flight (`loading`), nothing to show (`empty`),
|
|
5
|
+
* a failed first read (`error`), or content whose refresh failed (`stale`).
|
|
6
|
+
*/
|
|
7
|
+
export type DashboardFrameState = "ready" | "loading" | "empty" | "error" | "stale";
|
|
8
|
+
export type DashboardFrameProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Heading of the frame. Without it the frame is only the surface, for content that brings its own head and states,
|
|
11
|
+
* such as `ChartExplorer` with `inset="1rem"`.
|
|
12
|
+
*/
|
|
13
|
+
title?: string;
|
|
14
|
+
/** One line under the title; loading and stale notes take its place, so nothing moves. */
|
|
15
|
+
subtitle?: JSX.Element;
|
|
16
|
+
/** Level of the title heading; defaults to 3. */
|
|
17
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
18
|
+
/** Controls at the right of the head, such as a search field or a grouping chip. */
|
|
19
|
+
tools?: JSX.Element;
|
|
20
|
+
/** Defaults to `ready`. */
|
|
21
|
+
state?: DashboardFrameState;
|
|
22
|
+
/** When the shown content was read, formatted by the host ("09:12"); a stale note names it. */
|
|
23
|
+
asOf?: string;
|
|
24
|
+
/** Try again after a failure; without it a failure has no button. */
|
|
25
|
+
onRetry?: () => void;
|
|
26
|
+
/** The empty sentence, such as "No campaign in this period." */
|
|
27
|
+
empty?: JSX.Element;
|
|
28
|
+
/** Tabler icon of the empty state; defaults to `ti ti-chart-bar-off`. */
|
|
29
|
+
emptyIcon?: string;
|
|
30
|
+
/** An action under the empty sentence, such as "Clear search". */
|
|
31
|
+
emptyAction?: JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* The content has nothing to show right now although the read succeeded, such as a search without matches: the body
|
|
34
|
+
* shows the empty sentence and action while the head keeps its state, so a stale note stays.
|
|
35
|
+
*/
|
|
36
|
+
emptyContent?: boolean;
|
|
37
|
+
/** Height of the body, a CSS length. Every state keeps it. */
|
|
38
|
+
height?: string;
|
|
39
|
+
/**
|
|
40
|
+
* A hidden copy of the full content that holds the body's height in every state, such as every row of a table. The
|
|
41
|
+
* body then reaches the frame's left, right and bottom edges, like a table that brings its own rows.
|
|
42
|
+
*/
|
|
43
|
+
reserve?: JSX.Element;
|
|
44
|
+
/** States as one quiet line instead of a centred message, for short content such as an amount or one bar. */
|
|
45
|
+
compact?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Share of a `DashboardSection`'s six columns, like `DashboardPanel`: the frame is the grid cell itself, so it never
|
|
48
|
+
* sits in a second frame. Defaults to a third there; ignored elsewhere.
|
|
49
|
+
*/
|
|
50
|
+
width?: DashboardWidth;
|
|
51
|
+
class?: string;
|
|
52
|
+
children?: JSX.Element;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* One framed dashboard panel: title, subtitle, tools and the content the host passes, with loading, empty, failure and
|
|
56
|
+
* stale in the same place and at the same height.
|
|
57
|
+
*/
|
|
58
|
+
export declare function DashboardFrame(props: DashboardFrameProps): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k2b/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0",
|
|
4
4
|
"description": "Production-ready components for SolidJS applications.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"maplibre-gl": "6.14.0",
|
|
95
95
|
"marked": "18.0.14",
|
|
96
96
|
"pbf": "5.1.2",
|
|
97
|
+
"pdfjs-dist": "6.3.289",
|
|
97
98
|
"qr-scanner": "1.4.2"
|
|
98
99
|
},
|
|
99
100
|
"peerDependencies": {
|