nuxt-ui-tools 1.23.0 → 1.25.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/module.d.mts +3 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +8 -0
- package/dist/runtime/display/components/blocks/display-accordion.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-accordion.vue +93 -0
- package/dist/runtime/display/components/blocks/display-accordion.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-alert.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-alert.vue +133 -0
- package/dist/runtime/display/components/blocks/display-alert.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-breakdown.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-breakdown.vue +178 -0
- package/dist/runtime/display/components/blocks/display-breakdown.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-chart.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-chart.vue +237 -0
- package/dist/runtime/display/components/blocks/display-chart.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-code.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-code.vue +143 -0
- package/dist/runtime/display/components/blocks/display-code.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-date.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-date.vue +174 -0
- package/dist/runtime/display/components/blocks/display-date.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-diff.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-diff.vue +142 -0
- package/dist/runtime/display/components/blocks/display-diff.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-empty.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-empty.vue +74 -0
- package/dist/runtime/display/components/blocks/display-empty.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-facts.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-facts.vue +180 -0
- package/dist/runtime/display/components/blocks/display-facts.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-heading.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-heading.vue +96 -0
- package/dist/runtime/display/components/blocks/display-heading.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-list.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-list.vue +295 -0
- package/dist/runtime/display/components/blocks/display-list.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-media.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-media.vue +326 -0
- package/dist/runtime/display/components/blocks/display-media.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-meter.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-meter.vue +301 -0
- package/dist/runtime/display/components/blocks/display-meter.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-person.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-person.vue +146 -0
- package/dist/runtime/display/components/blocks/display-person.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-record.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-record.vue +208 -0
- package/dist/runtime/display/components/blocks/display-record.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-stat.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-stat.vue +178 -0
- package/dist/runtime/display/components/blocks/display-stat.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-table.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-table.vue +132 -0
- package/dist/runtime/display/components/blocks/display-table.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-text.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-text.vue +135 -0
- package/dist/runtime/display/components/blocks/display-text.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-timeline.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-timeline.vue +232 -0
- package/dist/runtime/display/components/blocks/display-timeline.vue.d.ts +4 -0
- package/dist/runtime/display/components/display.d.vue.ts +24 -0
- package/dist/runtime/display/components/display.vue +21 -0
- package/dist/runtime/display/components/display.vue.d.ts +24 -0
- package/dist/runtime/display/components/parts/display-actions.d.vue.ts +9 -0
- package/dist/runtime/display/components/parts/display-actions.vue +24 -0
- package/dist/runtime/display/components/parts/display-actions.vue.d.ts +9 -0
- package/dist/runtime/display/components/parts/display-chip.d.vue.ts +11 -0
- package/dist/runtime/display/components/parts/display-chip.vue +45 -0
- package/dist/runtime/display/components/parts/display-chip.vue.d.ts +11 -0
- package/dist/runtime/display/components/parts/display-copy.d.vue.ts +6 -0
- package/dist/runtime/display/components/parts/display-copy.vue +27 -0
- package/dist/runtime/display/components/parts/display-copy.vue.d.ts +6 -0
- package/dist/runtime/display/components/parts/display-empty-line.d.vue.ts +7 -0
- package/dist/runtime/display/components/parts/display-empty-line.vue +21 -0
- package/dist/runtime/display/components/parts/display-empty-line.vue.d.ts +7 -0
- package/dist/runtime/display/components/parts/display-fact-value.d.vue.ts +7 -0
- package/dist/runtime/display/components/parts/display-fact-value.vue +35 -0
- package/dist/runtime/display/components/parts/display-fact-value.vue.d.ts +7 -0
- package/dist/runtime/display/components/parts/display-load-error.d.vue.ts +7 -0
- package/dist/runtime/display/components/parts/display-load-error.vue +29 -0
- package/dist/runtime/display/components/parts/display-load-error.vue.d.ts +7 -0
- package/dist/runtime/display/components/parts/display-more.d.vue.ts +10 -0
- package/dist/runtime/display/components/parts/display-more.vue +23 -0
- package/dist/runtime/display/components/parts/display-more.vue.d.ts +10 -0
- package/dist/runtime/display/components/parts/display-record-media.d.vue.ts +9 -0
- package/dist/runtime/display/components/parts/display-record-media.vue +59 -0
- package/dist/runtime/display/components/parts/display-record-media.vue.d.ts +9 -0
- package/dist/runtime/display/components/parts/display-render.d.ts +10 -0
- package/dist/runtime/display/components/parts/display-render.js +5 -0
- package/dist/runtime/display/components/parts/display-skeleton.d.vue.ts +7 -0
- package/dist/runtime/display/components/parts/display-skeleton.vue +67 -0
- package/dist/runtime/display/components/parts/display-skeleton.vue.d.ts +7 -0
- package/dist/runtime/display/composables/use-display-config.d.ts +6 -0
- package/dist/runtime/display/composables/use-display-config.js +11 -0
- package/dist/runtime/display/composables/use-display-file-preview.d.ts +9 -0
- package/dist/runtime/display/composables/use-display-file-preview.js +11 -0
- package/dist/runtime/display/composables/use-display-icons.d.ts +8 -0
- package/dist/runtime/display/composables/use-display-icons.js +62 -0
- package/dist/runtime/display/composables/use-display-locale.d.ts +5 -0
- package/dist/runtime/display/composables/use-display-locale.js +5 -0
- package/dist/runtime/display/composables/use-display-number.d.ts +2 -0
- package/dist/runtime/display/composables/use-display-number.js +7 -0
- package/dist/runtime/display/composables/use-display-reveal.d.ts +14 -0
- package/dist/runtime/display/composables/use-display-reveal.js +15 -0
- package/dist/runtime/display/composables/use-display-url.d.ts +26 -0
- package/dist/runtime/display/composables/use-display-url.js +46 -0
- package/dist/runtime/display/index.d.ts +4 -0
- package/dist/runtime/display/index.js +3 -0
- package/dist/runtime/display/plugins/display-tones.d.ts +3 -0
- package/dist/runtime/display/plugins/display-tones.js +17 -0
- package/dist/runtime/display/types/blocks/accordion.d.ts +18 -0
- package/dist/runtime/display/types/blocks/accordion.js +0 -0
- package/dist/runtime/display/types/blocks/alert.d.ts +31 -0
- package/dist/runtime/display/types/blocks/alert.js +0 -0
- package/dist/runtime/display/types/blocks/breakdown.d.ts +36 -0
- package/dist/runtime/display/types/blocks/breakdown.js +0 -0
- package/dist/runtime/display/types/blocks/chart.d.ts +23 -0
- package/dist/runtime/display/types/blocks/chart.js +0 -0
- package/dist/runtime/display/types/blocks/code.d.ts +21 -0
- package/dist/runtime/display/types/blocks/code.js +0 -0
- package/dist/runtime/display/types/blocks/date.d.ts +27 -0
- package/dist/runtime/display/types/blocks/date.js +0 -0
- package/dist/runtime/display/types/blocks/diff.d.ts +20 -0
- package/dist/runtime/display/types/blocks/diff.js +0 -0
- package/dist/runtime/display/types/blocks/empty.d.ts +13 -0
- package/dist/runtime/display/types/blocks/empty.js +0 -0
- package/dist/runtime/display/types/blocks/facts.d.ts +50 -0
- package/dist/runtime/display/types/blocks/facts.js +0 -0
- package/dist/runtime/display/types/blocks/heading.d.ts +19 -0
- package/dist/runtime/display/types/blocks/heading.js +0 -0
- package/dist/runtime/display/types/blocks/list.d.ts +36 -0
- package/dist/runtime/display/types/blocks/list.js +0 -0
- package/dist/runtime/display/types/blocks/media.d.ts +42 -0
- package/dist/runtime/display/types/blocks/media.js +0 -0
- package/dist/runtime/display/types/blocks/meter.d.ts +48 -0
- package/dist/runtime/display/types/blocks/meter.js +0 -0
- package/dist/runtime/display/types/blocks/person.d.ts +32 -0
- package/dist/runtime/display/types/blocks/person.js +0 -0
- package/dist/runtime/display/types/blocks/record.d.ts +42 -0
- package/dist/runtime/display/types/blocks/record.js +0 -0
- package/dist/runtime/display/types/blocks/stat.d.ts +44 -0
- package/dist/runtime/display/types/blocks/stat.js +0 -0
- package/dist/runtime/display/types/blocks/table.d.ts +28 -0
- package/dist/runtime/display/types/blocks/table.js +0 -0
- package/dist/runtime/display/types/blocks/text.d.ts +22 -0
- package/dist/runtime/display/types/blocks/text.js +0 -0
- package/dist/runtime/display/types/blocks/timeline.d.ts +37 -0
- package/dist/runtime/display/types/blocks/timeline.js +0 -0
- package/dist/runtime/display/types/config.d.ts +53 -0
- package/dist/runtime/display/types/config.js +0 -0
- package/dist/runtime/display/types/index.d.ts +22 -0
- package/dist/runtime/display/types/index.js +0 -0
- package/dist/runtime/display/types/registry.d.ts +57 -0
- package/dist/runtime/display/types/registry.js +0 -0
- package/dist/runtime/display/types/shared.d.ts +71 -0
- package/dist/runtime/display/types/shared.js +0 -0
- package/dist/runtime/display/utils/classes.d.ts +3 -0
- package/dist/runtime/display/utils/classes.js +7 -0
- package/dist/runtime/display/utils/config.d.ts +6 -0
- package/dist/runtime/display/utils/config.js +7 -0
- package/dist/runtime/display/utils/content.d.ts +7 -0
- package/dist/runtime/display/utils/content.js +13 -0
- package/dist/runtime/display/utils/dates.d.ts +16 -0
- package/dist/runtime/display/utils/dates.js +34 -0
- package/dist/runtime/display/utils/json.d.ts +7 -0
- package/dist/runtime/display/utils/json.js +15 -0
- package/dist/runtime/display/utils/meter.d.ts +7 -0
- package/dist/runtime/display/utils/meter.js +13 -0
- package/dist/runtime/display/utils/registry.d.ts +47 -0
- package/dist/runtime/display/utils/registry.js +64 -0
- package/dist/runtime/display/utils/tone-css.d.ts +7 -0
- package/dist/runtime/display/utils/tone-css.js +38 -0
- package/dist/runtime/display/utils/tone.d.ts +26 -0
- package/dist/runtime/display/utils/tone.js +38 -0
- package/dist/runtime/display/utils/urls.d.ts +10 -0
- package/dist/runtime/display/utils/urls.js +33 -0
- package/dist/runtime/file-preview/components/shell/file-preview-stage.vue +5 -3
- package/dist/runtime/file-preview/composables/use-file-preview-source.d.ts +7 -0
- package/dist/runtime/file-preview/composables/use-file-preview-source.js +7 -1
- package/dist/runtime/file-preview/index.d.ts +1 -0
- package/dist/runtime/file-preview/index.js +1 -0
- package/dist/runtime/file-preview/types/file.d.ts +9 -0
- package/dist/runtime/file-preview/utils/errors.d.ts +30 -0
- package/dist/runtime/file-preview/utils/errors.js +26 -0
- package/dist/runtime/form/components/utils/form-file-preview.vue +7 -2
- package/dist/runtime/form/composables/use-form-root.js +2 -0
- package/dist/runtime/form/composables/use-form-runtime.js +7 -2
- package/dist/runtime/form/fields/index.d.ts +5 -0
- package/dist/runtime/form/fields/info/component.vue +51 -19
- package/dist/runtime/form/fields/info/config.d.ts +5 -0
- package/dist/runtime/form/fields/info/config.js +2 -1
- package/dist/runtime/form/fields/info/types.d.ts +78 -4
- package/dist/runtime/form/fields/info/use-info-display.d.ts +20 -0
- package/dist/runtime/form/fields/info/use-info-display.js +82 -0
- package/dist/runtime/form/fields/upload/upload-item.vue +10 -2
- package/dist/runtime/form/types/api.d.ts +6 -0
- package/dist/runtime/form/types/runtime.d.ts +2 -0
- package/dist/runtime/form/utils/dynamic.d.ts +6 -0
- package/dist/runtime/form/utils/dynamic.js +7 -0
- package/dist/runtime/i18n/locales/en.js +32 -0
- package/dist/runtime/i18n/locales/fr.js +32 -0
- package/dist/runtime/i18n/types.d.ts +40 -0
- package/dist/runtime/shared/styles/tokens.css +1 -1
- package/dist/runtime/shared/utils/file.d.ts +1 -1
- package/dist/runtime/table/components/data-list/data-list-root.vue +2 -0
- package/dist/runtime/table/components/data-list/data-list-selection-actions.d.vue.ts +1 -1
- package/dist/runtime/table/components/data-list/data-list-selection-actions.vue +32 -5
- package/dist/runtime/table/components/data-list/data-list-selection-actions.vue.d.ts +1 -1
- package/dist/runtime/table/components/data-list/data-list-selection-sheet.d.vue.ts +10 -0
- package/dist/runtime/table/components/data-list/data-list-selection-sheet.vue +238 -0
- package/dist/runtime/table/components/data-list/data-list-selection-sheet.vue.d.ts +10 -0
- package/dist/runtime/table/components/grid/grid-renderer.vue +2 -0
- package/dist/runtime/table/components/summary/summary-renderer.vue +2 -0
- package/dist/runtime/table/components/table/table-renderer.vue +2 -0
- package/dist/runtime/table/components/utils/overlay-inset-spacer.d.vue.ts +3 -0
- package/dist/runtime/table/components/utils/overlay-inset-spacer.vue +13 -0
- package/dist/runtime/table/components/utils/overlay-inset-spacer.vue.d.ts +3 -0
- package/dist/runtime/table/composables/use-data-list-overlay-inset.d.ts +10 -0
- package/dist/runtime/table/composables/use-data-list-overlay-inset.js +11 -0
- package/dist/runtime/table/composables/use-table-actions.js +11 -2
- package/dist/runtime/table/constants/mobile.d.ts +0 -7
- package/dist/runtime/table/constants/mobile.js +0 -1
- package/dist/runtime/table/types/actions.d.ts +7 -0
- package/dist/runtime/table/types/data-list.d.ts +8 -1
- package/dist/runtime/table/utils/data-list-ui.d.ts +1 -1
- package/package.json +16 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DisplaySpec } from '../registry.js';
|
|
2
|
+
import type { DisplayBlockBase, DisplayContent } from '../shared.js';
|
|
3
|
+
export type DisplayAccordionSlot = 'root' | 'item' | 'trigger' | 'icon' | 'label' | 'chevron' | 'content';
|
|
4
|
+
export interface DisplayAccordionItem {
|
|
5
|
+
label: DisplayContent;
|
|
6
|
+
icon?: string;
|
|
7
|
+
content?: DisplayContent;
|
|
8
|
+
/** A display block drawn as the content, such as `{ display: 'facts', props: { ... } }`. */
|
|
9
|
+
block?: DisplaySpec;
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface DisplayAccordionProps extends DisplayBlockBase<DisplayAccordionSlot> {
|
|
13
|
+
/** `separated` boxes each item, `flush` separates them with rules. Defaults to `separated`. */
|
|
14
|
+
variant?: 'separated' | 'flush';
|
|
15
|
+
items: readonly DisplayAccordionItem[];
|
|
16
|
+
/** Lets several items stay open. Defaults to `false`. */
|
|
17
|
+
multiple?: boolean;
|
|
18
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { DisplayAction, DisplayBlockBase, DisplayContent, DisplayTone } from '../shared.js';
|
|
2
|
+
export type DisplayAlertAppearance = 'soft' | 'outline' | 'subtle' | 'solid' | 'callout' | 'inline' | 'banner';
|
|
3
|
+
export type DisplayAlertSlot = 'root' | 'icon' | 'body' | 'title' | 'message' | 'items' | 'item' | 'itemIcon' | 'list' | 'toggle' | 'details' | 'actions';
|
|
4
|
+
export interface DisplayAlertItem {
|
|
5
|
+
/** Defaults to the alert icon. */
|
|
6
|
+
icon?: string;
|
|
7
|
+
text: DisplayContent;
|
|
8
|
+
}
|
|
9
|
+
export interface DisplayAlertProps extends DisplayBlockBase<DisplayAlertSlot> {
|
|
10
|
+
/** Defaults to `info`. */
|
|
11
|
+
tone?: DisplayTone;
|
|
12
|
+
/**
|
|
13
|
+
* `soft`, `outline`, `subtle` and `solid` box the notice; `callout` draws an accent bar,
|
|
14
|
+
* `inline` drops the box, and `banner` sets the icon in a tile with the actions at the end.
|
|
15
|
+
* Defaults to `soft`.
|
|
16
|
+
*/
|
|
17
|
+
appearance?: DisplayAlertAppearance;
|
|
18
|
+
/** Defaults to the tone's icon from `appConfig.ui.icons`; `false` hides it. */
|
|
19
|
+
icon?: string | false;
|
|
20
|
+
title?: DisplayContent;
|
|
21
|
+
message?: DisplayContent;
|
|
22
|
+
/** Lines led by their own icon. */
|
|
23
|
+
items?: readonly DisplayAlertItem[];
|
|
24
|
+
/** Bulleted lines. */
|
|
25
|
+
list?: readonly DisplayContent[];
|
|
26
|
+
/** Folded text revealed by a "Show details" toggle. */
|
|
27
|
+
details?: DisplayContent;
|
|
28
|
+
/** Opens `details` initially. */
|
|
29
|
+
defaultOpen?: boolean;
|
|
30
|
+
actions?: readonly DisplayAction[];
|
|
31
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { DisplayBlockBase, DisplayChip, DisplayContent, DisplaySurface, DisplayTone } from '../shared.js';
|
|
2
|
+
export type DisplayBreakdownSlot = 'root' | 'title' | 'header' | 'headerCell' | 'line' | 'label' | 'detail' | 'value' | 'total' | 'totalLabel' | 'totalValue' | 'toggle' | 'body' | 'footnote';
|
|
3
|
+
export interface DisplayBreakdownLine {
|
|
4
|
+
label: DisplayContent;
|
|
5
|
+
value?: DisplayContent;
|
|
6
|
+
/** `compare` mode: the figure of each column. */
|
|
7
|
+
values?: readonly [DisplayContent, DisplayContent];
|
|
8
|
+
/** Secondary figure after the label, such as `24 × 96,00 €` or a rate. */
|
|
9
|
+
detail?: DisplayContent;
|
|
10
|
+
/** Bold line after a rule, such as a subtotal. */
|
|
11
|
+
subtotal?: boolean;
|
|
12
|
+
/** Ink of the value, such as `success` for a discount. */
|
|
13
|
+
tone?: DisplayTone;
|
|
14
|
+
/** Dims the line, such as a discount that does not apply yet. */
|
|
15
|
+
muted?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface DisplayBreakdownTotal extends DisplayBreakdownLine {
|
|
18
|
+
chip?: DisplayChip;
|
|
19
|
+
}
|
|
20
|
+
export interface DisplayBreakdownProps extends DisplayBlockBase<DisplayBreakdownSlot> {
|
|
21
|
+
/**
|
|
22
|
+
* `open` lists every line, `collapsible` shows the total until it is unfolded, `compare` sets two
|
|
23
|
+
* columns side by side. Defaults to `open`.
|
|
24
|
+
*/
|
|
25
|
+
mode?: 'open' | 'collapsible' | 'compare';
|
|
26
|
+
title?: DisplayContent;
|
|
27
|
+
lines: readonly DisplayBreakdownLine[];
|
|
28
|
+
total?: DisplayBreakdownTotal;
|
|
29
|
+
/** `compare` column headings. */
|
|
30
|
+
columns?: readonly [DisplayContent, DisplayContent];
|
|
31
|
+
footnote?: DisplayContent;
|
|
32
|
+
/** `collapsible` only: starts unfolded. */
|
|
33
|
+
defaultOpen?: boolean;
|
|
34
|
+
/** Defaults to `bordered`. */
|
|
35
|
+
surface?: DisplaySurface;
|
|
36
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DisplayBlockBase, DisplayContent, DisplayText, DisplayTone } from '../shared.js';
|
|
2
|
+
export type DisplayChartSlot = 'root' | 'header' | 'title' | 'aside' | 'plot' | 'bar' | 'axis' | 'legend' | 'legendItem' | 'step' | 'stepLabel' | 'stepValue' | 'stepRate';
|
|
3
|
+
export interface DisplayChartDatum {
|
|
4
|
+
label: DisplayText;
|
|
5
|
+
value: number;
|
|
6
|
+
/** Defaults to the dashboard palette, in order. */
|
|
7
|
+
tone?: DisplayTone;
|
|
8
|
+
}
|
|
9
|
+
export interface DisplayChartProps extends DisplayBlockBase<DisplayChartSlot> {
|
|
10
|
+
/** Defaults to `bars`. `funnel` shows the rate kept from one step to the next. */
|
|
11
|
+
variant?: 'bars' | 'line' | 'donut' | 'funnel';
|
|
12
|
+
title?: DisplayContent;
|
|
13
|
+
/** Text at the end of the header, such as a period or a total. */
|
|
14
|
+
aside?: DisplayContent;
|
|
15
|
+
data: readonly DisplayChartDatum[];
|
|
16
|
+
/** Formats values in labels and the legend. Defaults to the locale number format. */
|
|
17
|
+
format?: (value: number) => string;
|
|
18
|
+
/** Plot height in pixels, for `bars` and `line`. Defaults to `96`. */
|
|
19
|
+
height?: number;
|
|
20
|
+
/** `bars`: the bar drawn in the accent color with its value. Defaults to `last`. */
|
|
21
|
+
highlight?: 'last' | 'max' | number | false;
|
|
22
|
+
empty?: DisplayContent;
|
|
23
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DisplayBlockBase, DisplayText } from '../shared.js';
|
|
2
|
+
export type DisplayCodeSlot = 'root' | 'header' | 'language' | 'body' | 'icon' | 'value' | 'actions';
|
|
3
|
+
export interface DisplayCodeProps extends DisplayBlockBase<DisplayCodeSlot> {
|
|
4
|
+
/** `block` is a code panel, `value` a one-line field to copy, `secret` a masked value. Defaults to `block`. */
|
|
5
|
+
variant?: 'block' | 'value' | 'secret';
|
|
6
|
+
value: string;
|
|
7
|
+
/** `block` header. `json` is highlighted. */
|
|
8
|
+
language?: string;
|
|
9
|
+
/** `block` header text. Defaults to `language`. */
|
|
10
|
+
label?: DisplayText;
|
|
11
|
+
/** Icon at the start of `value` and `secret`. */
|
|
12
|
+
icon?: string;
|
|
13
|
+
/** Adds a button opening this address. */
|
|
14
|
+
href?: string;
|
|
15
|
+
/** Defaults to `true`. */
|
|
16
|
+
copy?: boolean;
|
|
17
|
+
/** `secret`: characters left visible at the end. Defaults to `4`. */
|
|
18
|
+
visible?: number;
|
|
19
|
+
/** `block`: scrolls past this height (px or CSS length). */
|
|
20
|
+
maxHeight?: number | string;
|
|
21
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DisplayBlockBase, DisplayContent, DisplayDate, DisplayText, DisplayTone } from '../shared.js';
|
|
2
|
+
export type DisplayDateSlot = 'root' | 'tile' | 'month' | 'day' | 'weekday' | 'body' | 'title' | 'description' | 'bound' | 'boundLabel' | 'boundValue' | 'line' | 'duration' | 'icon' | 'value' | 'caption';
|
|
3
|
+
export interface DisplayDateProps extends DisplayBlockBase<DisplayDateSlot> {
|
|
4
|
+
/**
|
|
5
|
+
* `tile` draws a calendar leaf beside a title, `range` two dates with the duration between
|
|
6
|
+
* them, and `countdown` the time left until `value` (or past it). Defaults to `tile`.
|
|
7
|
+
*/
|
|
8
|
+
variant?: 'tile' | 'range' | 'countdown';
|
|
9
|
+
value: DisplayDate;
|
|
10
|
+
/** `range`: the last day. */
|
|
11
|
+
end?: DisplayDate;
|
|
12
|
+
title?: DisplayContent;
|
|
13
|
+
description?: DisplayContent;
|
|
14
|
+
icon?: string;
|
|
15
|
+
/** Tile header and countdown tone. A countdown defaults to its urgency. */
|
|
16
|
+
tone?: DisplayTone;
|
|
17
|
+
/** Adds the time to the formatted dates. */
|
|
18
|
+
time?: boolean;
|
|
19
|
+
/** `countdown`: a passed date reads as overdue. Defaults to `true`. */
|
|
20
|
+
deadline?: boolean;
|
|
21
|
+
/** `countdown`: days left from which it turns to `warning`. Defaults to `3`. */
|
|
22
|
+
warnWithin?: number;
|
|
23
|
+
/** Defaults to the current time. */
|
|
24
|
+
now?: DisplayDate;
|
|
25
|
+
/** `countdown`: replaces the computed "In 2 days". */
|
|
26
|
+
label?: DisplayText;
|
|
27
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DisplayBlockBase, DisplayChip, DisplayContent } from '../shared.js';
|
|
2
|
+
export type DisplayDiffSlot = 'root' | 'title' | 'item' | 'label' | 'values' | 'before' | 'after' | 'arrow' | 'note' | 'unchanged' | 'table' | 'headCell' | 'cell';
|
|
3
|
+
export interface DisplayDiffItem {
|
|
4
|
+
label: DisplayContent;
|
|
5
|
+
before?: DisplayContent;
|
|
6
|
+
after?: DisplayContent;
|
|
7
|
+
/** Defaults to `true`. Unchanged rows are dimmed in `columns`, and hidden in `inline` unless `showUnchanged`. */
|
|
8
|
+
changed?: boolean;
|
|
9
|
+
note?: DisplayChip;
|
|
10
|
+
}
|
|
11
|
+
export interface DisplayDiffProps extends DisplayBlockBase<DisplayDiffSlot> {
|
|
12
|
+
/** `inline` strikes the old value before the new one, `columns` sets them side by side. Defaults to `inline`. */
|
|
13
|
+
variant?: 'inline' | 'columns';
|
|
14
|
+
title?: DisplayContent;
|
|
15
|
+
/** `columns` headings: the field, the old value, the new value. Default to localized words. */
|
|
16
|
+
columns?: readonly [DisplayContent, DisplayContent, DisplayContent];
|
|
17
|
+
items: readonly DisplayDiffItem[];
|
|
18
|
+
/** `inline`: also lists unchanged items, with their value as is. Defaults to `false`. */
|
|
19
|
+
showUnchanged?: boolean;
|
|
20
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DisplayAction, DisplayBlockBase, DisplayContent, DisplayTone } from '../shared.js';
|
|
2
|
+
export type DisplayEmptySlot = 'root' | 'icon' | 'title' | 'description' | 'actions';
|
|
3
|
+
export interface DisplayEmptyProps extends DisplayBlockBase<DisplayEmptySlot> {
|
|
4
|
+
/** `dashed` is a centred box with actions, `plain` a single quiet line. Defaults to `dashed`. */
|
|
5
|
+
variant?: 'dashed' | 'plain';
|
|
6
|
+
/** Defaults to `appConfig.ui.icons.folder`. */
|
|
7
|
+
icon?: string;
|
|
8
|
+
title?: DisplayContent;
|
|
9
|
+
description?: DisplayContent;
|
|
10
|
+
actions?: readonly DisplayAction[];
|
|
11
|
+
/** Tint of the icon tile. Defaults to `neutral`. */
|
|
12
|
+
tone?: DisplayTone;
|
|
13
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { DisplayAction, DisplayBlockBase, DisplayChip, DisplayContent, DisplaySurface, DisplayTone } from '../shared.js';
|
|
2
|
+
export type DisplayFactsLayout = 'ledger' | 'grid' | 'inline' | 'columns' | 'tiles';
|
|
3
|
+
export type DisplayFactsSlot = 'root' | 'group' | 'groupHeader' | 'groupTitle' | 'groupAside' | 'item' | 'label' | 'hint' | 'value' | 'empty' | 'actions';
|
|
4
|
+
export interface DisplayFact {
|
|
5
|
+
label: DisplayContent;
|
|
6
|
+
/** `null`, `undefined` and `''` draw a dash. */
|
|
7
|
+
value?: DisplayContent;
|
|
8
|
+
/** Secondary line under the label (`ledger`) or the value (`grid`, `columns`, `tiles`). */
|
|
9
|
+
hint?: DisplayContent;
|
|
10
|
+
tone?: DisplayTone;
|
|
11
|
+
/** Draws the value as a badge. */
|
|
12
|
+
chip?: DisplayChip;
|
|
13
|
+
/** Text copied by a trailing button; `true` copies a text `value`. */
|
|
14
|
+
copy?: string | boolean;
|
|
15
|
+
mono?: boolean;
|
|
16
|
+
/** Larger, bolder value, such as the amount being confirmed. */
|
|
17
|
+
emphasis?: boolean;
|
|
18
|
+
/** Icon before the label. */
|
|
19
|
+
icon?: string;
|
|
20
|
+
/** Makes the value a link. */
|
|
21
|
+
to?: string;
|
|
22
|
+
/** Draws a placeholder bar instead of the value, such as one figure still loading. */
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface DisplayFactGroup {
|
|
26
|
+
title?: DisplayContent;
|
|
27
|
+
/** Text at the end of the group heading. */
|
|
28
|
+
aside?: DisplayContent;
|
|
29
|
+
items: readonly DisplayFact[];
|
|
30
|
+
}
|
|
31
|
+
export interface DisplayFactsProps extends DisplayBlockBase<DisplayFactsSlot> {
|
|
32
|
+
/**
|
|
33
|
+
* `ledger` lists rows with the value at the end, `grid` stacks a caption over each value,
|
|
34
|
+
* `inline` runs the pairs on one line, `columns` sets a label column beside the values, and
|
|
35
|
+
* `tiles` puts each fact in a tinted tile. Defaults to `ledger`.
|
|
36
|
+
*/
|
|
37
|
+
layout?: DisplayFactsLayout;
|
|
38
|
+
/** Defaults to `bordered` for `ledger`, `plain` otherwise. */
|
|
39
|
+
surface?: DisplaySurface;
|
|
40
|
+
items?: readonly DisplayFact[];
|
|
41
|
+
/** Titled groups of facts. Other layouts than `ledger` draw them one after the other. */
|
|
42
|
+
groups?: readonly DisplayFactGroup[];
|
|
43
|
+
/** Columns of `grid` and `tiles`. Defaults to as many as fit. */
|
|
44
|
+
columns?: number;
|
|
45
|
+
/** Width of the label column in `columns`. Defaults to `8rem`. */
|
|
46
|
+
labelWidth?: string;
|
|
47
|
+
empty?: DisplayContent;
|
|
48
|
+
/** Buttons under the facts, such as « Edit the address ». */
|
|
49
|
+
actions?: readonly DisplayAction[];
|
|
50
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DisplayAction, DisplayBlockBase, DisplayContent, DisplaySize, DisplayText, DisplayTone } from '../shared.js';
|
|
2
|
+
export type DisplayHeadingSlot = 'root' | 'icon' | 'text' | 'title' | 'count' | 'description' | 'action' | 'rule';
|
|
3
|
+
export interface DisplayHeadingProps extends DisplayBlockBase<DisplayHeadingSlot> {
|
|
4
|
+
title: DisplayContent;
|
|
5
|
+
description?: DisplayContent;
|
|
6
|
+
/** `eyebrow` is a small uppercase label followed by a rule. Defaults to `title`. */
|
|
7
|
+
variant?: 'title' | 'eyebrow';
|
|
8
|
+
/** Defaults to `md`. At `lg`, the icon sits in a tinted tile. */
|
|
9
|
+
size?: DisplaySize;
|
|
10
|
+
icon?: string;
|
|
11
|
+
/** Tone of the icon tile. Defaults to `primary`. */
|
|
12
|
+
tone?: DisplayTone;
|
|
13
|
+
/** Pill after the title, such as the number of items below. */
|
|
14
|
+
count?: DisplayText;
|
|
15
|
+
/** Link-style button at the end of the row. */
|
|
16
|
+
action?: DisplayAction;
|
|
17
|
+
/** Heading level of the title element. Defaults to `3`. */
|
|
18
|
+
level?: 2 | 3 | 4 | 5 | 6;
|
|
19
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { DisplayBlockBase, DisplayContent, DisplayRevealable, DisplayText, DisplayTone, DisplayUrl } from '../shared.js';
|
|
2
|
+
export type DisplayListVariant = 'bullets' | 'numbered' | 'icons' | 'checks' | 'steps' | 'columns' | 'files' | 'chips';
|
|
3
|
+
export type DisplayListSlot = 'root' | 'title' | 'list' | 'item' | 'marker' | 'text' | 'description' | 'meta' | 'action' | 'more' | 'empty';
|
|
4
|
+
export interface DisplayListItem {
|
|
5
|
+
/** The text, or the file name for `files`. */
|
|
6
|
+
text: DisplayContent;
|
|
7
|
+
description?: DisplayContent;
|
|
8
|
+
icon?: string;
|
|
9
|
+
tone?: DisplayTone;
|
|
10
|
+
/** `checks` and `steps`: done. */
|
|
11
|
+
done?: boolean;
|
|
12
|
+
/** `steps`: the current step. */
|
|
13
|
+
current?: boolean;
|
|
14
|
+
/** Text at the end of the item. */
|
|
15
|
+
meta?: DisplayContent;
|
|
16
|
+
/** `chips`: tooltip of the chip. */
|
|
17
|
+
tooltip?: DisplayText;
|
|
18
|
+
/** `files`: link of the file, or a function returning it, opened in the file preview or a new tab. */
|
|
19
|
+
href?: DisplayUrl;
|
|
20
|
+
/** `files`: name used for the type badge. Defaults to `text` when it is a string. */
|
|
21
|
+
name?: string;
|
|
22
|
+
/** `files`: size in bytes. */
|
|
23
|
+
size?: number;
|
|
24
|
+
/** `files`: MIME type. */
|
|
25
|
+
type?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface DisplayListProps extends DisplayBlockBase<DisplayListSlot>, DisplayRevealable {
|
|
28
|
+
/** Defaults to `bullets`. */
|
|
29
|
+
variant?: DisplayListVariant;
|
|
30
|
+
title?: DisplayContent;
|
|
31
|
+
items: readonly DisplayListItem[];
|
|
32
|
+
/** `columns`: column count. Defaults to `2`. */
|
|
33
|
+
columns?: number;
|
|
34
|
+
/** `files`: opens files in the file preview instead of a new tab. Defaults to `true`. */
|
|
35
|
+
preview?: boolean;
|
|
36
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { DisplayAction, DisplayBlockBase, DisplayContent, DisplayText, DisplayUrl } from '../shared.js';
|
|
2
|
+
export type DisplayMediaSlot = 'root' | 'frame' | 'image' | 'caption' | 'grid' | 'tile' | 'overflow' | 'play' | 'duration' | 'title' | 'page' | 'body' | 'name' | 'meta' | 'actions' | 'domain' | 'description' | 'thumbnail';
|
|
3
|
+
export interface DisplayMediaImage {
|
|
4
|
+
src: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DisplayMediaProps extends DisplayBlockBase<DisplayMediaSlot> {
|
|
8
|
+
/**
|
|
9
|
+
* `image` and `video` show one file, `gallery` a grid of `images`, `document` a file card with
|
|
10
|
+
* a page preview, and `link` a link preview card. Defaults to `image`.
|
|
11
|
+
*/
|
|
12
|
+
variant?: 'image' | 'gallery' | 'video' | 'document' | 'link';
|
|
13
|
+
/** Image or video file, or the document to open: a URL, or a function returning one. */
|
|
14
|
+
src?: DisplayUrl;
|
|
15
|
+
alt?: string;
|
|
16
|
+
caption?: DisplayContent;
|
|
17
|
+
images?: readonly DisplayMediaImage[];
|
|
18
|
+
/** `gallery`: tiles shown before the `+N` one. Defaults to `3`. */
|
|
19
|
+
max?: number;
|
|
20
|
+
/** `video` poster, `document` first page, or `link` image. */
|
|
21
|
+
thumbnail?: string;
|
|
22
|
+
title?: DisplayContent;
|
|
23
|
+
/** `video` length, such as `2:14`. */
|
|
24
|
+
duration?: DisplayText;
|
|
25
|
+
/** `document` file name. Defaults to the last segment of `src`. */
|
|
26
|
+
name?: string;
|
|
27
|
+
/** `document` size in bytes. */
|
|
28
|
+
size?: number;
|
|
29
|
+
/** `document` MIME type. */
|
|
30
|
+
type?: string;
|
|
31
|
+
/** `document` page count. */
|
|
32
|
+
pages?: number;
|
|
33
|
+
/** `link` address, or a function returning it. */
|
|
34
|
+
href?: DisplayUrl;
|
|
35
|
+
description?: DisplayContent;
|
|
36
|
+
/** CSS aspect ratio of `image`, `gallery` and `video`. Defaults to `16 / 9`. */
|
|
37
|
+
aspect?: string;
|
|
38
|
+
/** Opens images and documents in the file preview. Defaults to `true`. */
|
|
39
|
+
preview?: boolean;
|
|
40
|
+
/** `document` buttons. Default to "Open" and "Download". */
|
|
41
|
+
actions?: readonly DisplayAction[];
|
|
42
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { DisplayBlockBase, DisplayContent, DisplaySize, DisplayText, DisplayTone } from '../shared.js';
|
|
2
|
+
export type DisplayMeterSlot = 'root' | 'header' | 'label' | 'value' | 'track' | 'bar' | 'caption' | 'legend' | 'legendItem' | 'ring' | 'parts' | 'levels' | 'level' | 'levelCaption';
|
|
3
|
+
export interface DisplayMeterPart {
|
|
4
|
+
label: DisplayContent;
|
|
5
|
+
value: number;
|
|
6
|
+
/** Text shown for the value. Defaults to the number. */
|
|
7
|
+
valueLabel?: DisplayContent;
|
|
8
|
+
tone?: DisplayTone;
|
|
9
|
+
icon?: string;
|
|
10
|
+
/** `ring` parts: the maximum of this part's own bar. Defaults to the meter `max`. */
|
|
11
|
+
max?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface DisplayMeterLevel {
|
|
14
|
+
label: DisplayText;
|
|
15
|
+
caption?: DisplayText;
|
|
16
|
+
}
|
|
17
|
+
export interface DisplayMeterProps extends DisplayBlockBase<DisplayMeterSlot> {
|
|
18
|
+
/**
|
|
19
|
+
* `bar` fills one track, `segments` stacks `parts` in one track with a legend, `split` shares
|
|
20
|
+
* the track between two `parts` labelled at both ends, `ring` draws a circular gauge with
|
|
21
|
+
* `parts` as small bars beside it, and `scale` highlights the `current` of discrete `levels`.
|
|
22
|
+
* Defaults to `bar`.
|
|
23
|
+
*/
|
|
24
|
+
variant?: 'bar' | 'segments' | 'split' | 'ring' | 'scale';
|
|
25
|
+
label?: DisplayContent;
|
|
26
|
+
value?: number;
|
|
27
|
+
/** Defaults to `100`, or to the sum of the parts for `segments` and `split`. */
|
|
28
|
+
max?: number;
|
|
29
|
+
/** Text shown for the value. Defaults to `value / max`. */
|
|
30
|
+
valueLabel?: DisplayContent;
|
|
31
|
+
/** Defaults to `primary`, unless `thresholds` pick another. */
|
|
32
|
+
tone?: DisplayTone;
|
|
33
|
+
/** Switches the tone once the filled share reaches these percentages. */
|
|
34
|
+
thresholds?: {
|
|
35
|
+
warning?: number;
|
|
36
|
+
error?: number;
|
|
37
|
+
};
|
|
38
|
+
parts?: readonly DisplayMeterPart[];
|
|
39
|
+
caption?: DisplayContent;
|
|
40
|
+
/** `scale` levels, lowest first. */
|
|
41
|
+
levels?: readonly (DisplayText | DisplayMeterLevel)[];
|
|
42
|
+
/** `scale`: index of the reached level. */
|
|
43
|
+
current?: number;
|
|
44
|
+
/** `scale`: index of the level aimed for, drawn dashed. */
|
|
45
|
+
target?: number;
|
|
46
|
+
/** `ring` diameter. Defaults to `md`. */
|
|
47
|
+
size?: DisplaySize;
|
|
48
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { DisplayAvatar, DisplayBlockBase, DisplayChip, DisplayContent, DisplaySize, DisplayText, DisplayTone } from '../shared.js';
|
|
2
|
+
export type DisplayPersonSlot = 'root' | 'avatar' | 'body' | 'name' | 'description' | 'chip' | 'group' | 'label' | 'contacts' | 'contact' | 'contactIcon' | 'contactValue';
|
|
3
|
+
export interface DisplayPerson {
|
|
4
|
+
name: DisplayText;
|
|
5
|
+
description?: DisplayContent;
|
|
6
|
+
/** Defaults to the initials of `name`. */
|
|
7
|
+
avatar?: DisplayAvatar;
|
|
8
|
+
/** Tint of the initials. Defaults to a tone picked from the name. */
|
|
9
|
+
tone?: DisplayTone;
|
|
10
|
+
chip?: DisplayChip;
|
|
11
|
+
}
|
|
12
|
+
export interface DisplayPersonContact {
|
|
13
|
+
icon?: string;
|
|
14
|
+
value: string;
|
|
15
|
+
/** Makes the value a link, such as `mailto:` or `tel:`. */
|
|
16
|
+
href?: string;
|
|
17
|
+
/** Adds a copy button. Defaults to `true`. */
|
|
18
|
+
copy?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface DisplayPersonProps extends DisplayBlockBase<DisplayPersonSlot>, Partial<DisplayPerson> {
|
|
21
|
+
/** `user` is one person, `group` a row of avatars, `contact` a card with ways to reach them. Defaults to `user`. */
|
|
22
|
+
variant?: 'user' | 'group' | 'contact';
|
|
23
|
+
/** `group` people. */
|
|
24
|
+
people?: readonly DisplayPerson[];
|
|
25
|
+
/** `group`: avatars shown before the `+N` one. Defaults to `4`. */
|
|
26
|
+
max?: number;
|
|
27
|
+
/** `group`: text after the avatars. */
|
|
28
|
+
label?: DisplayContent;
|
|
29
|
+
contacts?: readonly DisplayPersonContact[];
|
|
30
|
+
/** Defaults to `md`. */
|
|
31
|
+
size?: DisplaySize;
|
|
32
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { DisplayAvatar, DisplayBlockBase, DisplayChip, DisplayContent, DisplayRevealable, DisplaySurface, DisplayTone } from '../shared.js';
|
|
2
|
+
export type DisplayRecordSlot = 'root' | 'media' | 'icon' | 'body' | 'reference' | 'title' | 'meta' | 'description' | 'badges' | 'trailing' | 'trailingValue' | 'trailingCaption' | 'header' | 'list' | 'item' | 'more' | 'empty';
|
|
3
|
+
export interface DisplayRecordItem {
|
|
4
|
+
/** Small reference over the title, such as an identifier. */
|
|
5
|
+
reference?: DisplayContent;
|
|
6
|
+
title: DisplayContent;
|
|
7
|
+
meta?: DisplayContent;
|
|
8
|
+
metaIcon?: string;
|
|
9
|
+
/** `card` text under the title, clamped to two lines. */
|
|
10
|
+
description?: DisplayContent;
|
|
11
|
+
/** A missing or broken `src` shows a placeholder tile. */
|
|
12
|
+
image?: {
|
|
13
|
+
src?: string | null;
|
|
14
|
+
alt?: string;
|
|
15
|
+
};
|
|
16
|
+
avatar?: DisplayAvatar;
|
|
17
|
+
/** Icon tile, used when there is no image or avatar. */
|
|
18
|
+
icon?: string;
|
|
19
|
+
tone?: DisplayTone;
|
|
20
|
+
badges?: readonly DisplayChip[];
|
|
21
|
+
/** Text at the end of the row, such as a price. */
|
|
22
|
+
trailing?: DisplayContent;
|
|
23
|
+
trailingCaption?: DisplayContent;
|
|
24
|
+
/** Badge at the end of the row. */
|
|
25
|
+
chip?: DisplayChip;
|
|
26
|
+
/** Makes the record a link. */
|
|
27
|
+
to?: string;
|
|
28
|
+
onClick?: () => void;
|
|
29
|
+
}
|
|
30
|
+
export interface DisplayRecordProps extends DisplayBlockBase<DisplayRecordSlot>, Partial<DisplayRecordItem>, DisplayRevealable {
|
|
31
|
+
/**
|
|
32
|
+
* `row` and `card` show one record, `compact` is a slim row with an icon tile, and `stack` lists
|
|
33
|
+
* `items` under a heading. Defaults to `row`.
|
|
34
|
+
*/
|
|
35
|
+
variant?: 'row' | 'card' | 'compact' | 'stack';
|
|
36
|
+
/** `stack` heading. */
|
|
37
|
+
heading?: DisplayContent;
|
|
38
|
+
headingIcon?: string;
|
|
39
|
+
items?: readonly DisplayRecordItem[];
|
|
40
|
+
/** Defaults to `bordered`. */
|
|
41
|
+
surface?: DisplaySurface;
|
|
42
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { DisplayBlockBase, DisplayChip, DisplayContent, DisplaySize, DisplaySurface, DisplayText, DisplayTone } from '../shared.js';
|
|
2
|
+
export type DisplayStatSlot = 'root' | 'label' | 'value' | 'unit' | 'caption' | 'status' | 'delta' | 'sparkline' | 'items' | 'item' | 'itemLabel' | 'itemValue' | 'itemCaption';
|
|
3
|
+
export interface DisplayStatItem {
|
|
4
|
+
label: DisplayContent;
|
|
5
|
+
value: DisplayContent;
|
|
6
|
+
caption?: DisplayContent;
|
|
7
|
+
tone?: DisplayTone;
|
|
8
|
+
}
|
|
9
|
+
export interface DisplayStatDelta {
|
|
10
|
+
/** The change, such as `+12 %`. */
|
|
11
|
+
value: DisplayText;
|
|
12
|
+
/** Defaults to `up`. */
|
|
13
|
+
direction?: 'up' | 'down' | 'flat';
|
|
14
|
+
/** Defaults to `success` going up, `error` going down, `neutral` flat. */
|
|
15
|
+
tone?: DisplayTone;
|
|
16
|
+
}
|
|
17
|
+
export interface DisplayStatProps extends DisplayBlockBase<DisplayStatSlot> {
|
|
18
|
+
/**
|
|
19
|
+
* `hero` centres one figure, `price` adds a status line, `row` lines up two to four figures,
|
|
20
|
+
* and `trend` adds a change and a sparkline. Defaults to `hero`.
|
|
21
|
+
*/
|
|
22
|
+
variant?: 'hero' | 'price' | 'row' | 'trend';
|
|
23
|
+
label?: DisplayContent;
|
|
24
|
+
value?: DisplayContent;
|
|
25
|
+
/** Small text after the value, such as `HT`. */
|
|
26
|
+
unit?: DisplayContent;
|
|
27
|
+
caption?: DisplayContent;
|
|
28
|
+
chip?: DisplayChip;
|
|
29
|
+
status?: {
|
|
30
|
+
icon?: string;
|
|
31
|
+
text: DisplayContent;
|
|
32
|
+
tone?: DisplayTone;
|
|
33
|
+
};
|
|
34
|
+
delta?: DisplayStatDelta;
|
|
35
|
+
/** Points of the `trend` sparkline, oldest first. */
|
|
36
|
+
trend?: readonly number[];
|
|
37
|
+
/** Figures of `row`. */
|
|
38
|
+
items?: readonly DisplayStatItem[];
|
|
39
|
+
tone?: DisplayTone;
|
|
40
|
+
/** Defaults to `md`. */
|
|
41
|
+
size?: DisplaySize;
|
|
42
|
+
/** Defaults to `muted` for `hero`, `bordered` for `row`, `plain` otherwise. */
|
|
43
|
+
surface?: DisplaySurface;
|
|
44
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DisplayBlockBase, DisplayContent, DisplayRevealable, DisplaySurface } from '../shared.js';
|
|
2
|
+
export type DisplayTableSlot = 'root' | 'scroller' | 'table' | 'head' | 'headCell' | 'row' | 'cell' | 'foot' | 'footCell' | 'meta' | 'empty' | 'more';
|
|
3
|
+
export interface DisplayTableColumn {
|
|
4
|
+
key: string;
|
|
5
|
+
label: DisplayContent;
|
|
6
|
+
/** Tabular figures aligned to the end. */
|
|
7
|
+
numeric?: boolean;
|
|
8
|
+
/** Defaults to `end` for numeric columns, `start` otherwise. */
|
|
9
|
+
align?: 'start' | 'center' | 'end';
|
|
10
|
+
/** CSS width, such as `8rem` or `30%`. */
|
|
11
|
+
width?: string;
|
|
12
|
+
mono?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export type DisplayTableRow = Readonly<Record<string, DisplayContent>>;
|
|
15
|
+
export interface DisplayTableProps extends DisplayBlockBase<DisplayTableSlot>, DisplayRevealable {
|
|
16
|
+
columns: readonly DisplayTableColumn[];
|
|
17
|
+
rows: readonly DisplayTableRow[];
|
|
18
|
+
/** Totals or averages pinned under the rows. */
|
|
19
|
+
footer?: DisplayTableRow;
|
|
20
|
+
/** Line under the table, at the start. */
|
|
21
|
+
caption?: DisplayContent;
|
|
22
|
+
/** Line under the table, at the end. */
|
|
23
|
+
note?: DisplayContent;
|
|
24
|
+
/** Scrolls the rows past this height, with the header and footer pinned (px or CSS length). */
|
|
25
|
+
maxHeight?: number | string;
|
|
26
|
+
/** Defaults to `bordered`. */
|
|
27
|
+
surface?: DisplaySurface;
|
|
28
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DisplayBlockBase, DisplayContent, DisplayTone } from '../shared.js';
|
|
2
|
+
export type DisplayTextAppearance = 'body' | 'lead' | 'muted' | 'caption' | 'quote' | 'legal' | 'prose';
|
|
3
|
+
export type DisplayTextSlot = 'root' | 'header' | 'icon' | 'title' | 'paragraph' | 'footer' | 'toggle';
|
|
4
|
+
export interface DisplayTextProps extends DisplayBlockBase<DisplayTextSlot> {
|
|
5
|
+
/** Defaults to `body`. `prose` styles rich content: links, lists, bold, inline code. */
|
|
6
|
+
appearance?: DisplayTextAppearance;
|
|
7
|
+
text?: DisplayContent;
|
|
8
|
+
/** Several paragraphs, drawn after `text`. */
|
|
9
|
+
paragraphs?: readonly DisplayContent[];
|
|
10
|
+
/** Heading of a `legal` block. */
|
|
11
|
+
title?: DisplayContent;
|
|
12
|
+
/** Icon before the `legal` title or the `caption` text. */
|
|
13
|
+
icon?: string;
|
|
14
|
+
/** `quote` attribution, such as the author's name. */
|
|
15
|
+
author?: DisplayContent;
|
|
16
|
+
/** Second part of the attribution line, such as a date. */
|
|
17
|
+
meta?: DisplayContent;
|
|
18
|
+
/** Accent of the `quote` bar and the `legal` rule. Defaults to `primary` and `neutral`. */
|
|
19
|
+
tone?: DisplayTone;
|
|
20
|
+
/** Clamps the text to this many lines with a "Read more" toggle when it overflows. */
|
|
21
|
+
maxLines?: number;
|
|
22
|
+
}
|
|
File without changes
|