@k2b/ui 0.52.0 → 0.53.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 +17 -0
- package/dist/browser/actions/SplitButton.js +10 -1
- package/dist/browser/actions/SplitButton.js.map +1 -1
- package/dist/browser/actions/Toolbar.js +83 -51
- package/dist/browser/actions/Toolbar.js.map +1 -1
- package/dist/browser/actions/index.js +1 -1
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/charts/core/area.js +1 -1
- package/dist/browser/charts/core/area.js.map +1 -1
- package/dist/browser/charts/core/bar-base-render.js +10 -0
- package/dist/browser/charts/core/bar-base-render.js.map +1 -0
- package/dist/browser/charts/core/bar-common.js +63 -0
- package/dist/browser/charts/core/bar-common.js.map +1 -0
- package/dist/browser/charts/core/bar-labels.js +12 -0
- package/dist/browser/charts/core/bar-labels.js.map +1 -1
- package/dist/browser/charts/core/bar-render.js +10 -0
- package/dist/browser/charts/core/bar-render.js.map +1 -0
- package/dist/browser/charts/core/bar-series.js +112 -0
- package/dist/browser/charts/core/bar-series.js.map +1 -0
- package/dist/browser/charts/core/calendar.js +63 -47
- package/dist/browser/charts/core/calendar.js.map +1 -1
- package/dist/browser/charts/core/dot-options.js +28 -0
- package/dist/browser/charts/core/dot-options.js.map +1 -0
- package/dist/browser/charts/core/dots.js +12 -0
- package/dist/browser/charts/core/dots.js.map +1 -0
- package/dist/browser/charts/core/index.js +14 -2
- package/dist/browser/charts/core/index.js.map +1 -1
- package/dist/browser/charts/core/line-base.js +102 -0
- package/dist/browser/charts/core/line-base.js.map +1 -0
- package/dist/browser/charts/core/line-details.js +264 -0
- package/dist/browser/charts/core/line-details.js.map +1 -0
- package/dist/browser/charts/core/line-options.js +32 -0
- package/dist/browser/charts/core/line-options.js.map +1 -0
- package/dist/browser/charts/core/line-paths.js +60 -0
- package/dist/browser/charts/core/line-paths.js.map +1 -0
- package/dist/browser/charts/core/line.js +15 -0
- package/dist/browser/charts/core/line.js.map +1 -0
- package/dist/browser/charts/core/palette.js +11 -0
- package/dist/browser/charts/core/palette.js.map +1 -0
- package/dist/browser/charts/core/pareto.js +23 -5
- package/dist/browser/charts/core/pareto.js.map +1 -1
- package/dist/browser/charts/core/registry.js +4 -2
- package/dist/browser/charts/core/registry.js.map +1 -1
- package/dist/browser/charts/core/render-size.js +4 -1
- package/dist/browser/charts/core/render-size.js.map +1 -1
- package/dist/browser/charts/core/render.js +23 -7
- package/dist/browser/charts/core/render.js.map +1 -1
- package/dist/browser/charts/core/sankey-size.js +105 -0
- package/dist/browser/charts/core/sankey-size.js.map +1 -0
- package/dist/browser/charts/core/sankey.js +280 -0
- package/dist/browser/charts/core/sankey.js.map +1 -0
- package/dist/browser/charts/core/snapshot.js +4 -2
- package/dist/browser/charts/core/snapshot.js.map +1 -1
- package/dist/browser/charts/core/svg-common.js +5 -67
- package/dist/browser/charts/core/svg-common.js.map +1 -1
- package/dist/browser/charts/core/svg-format.js +7 -0
- package/dist/browser/charts/core/svg-format.js.map +1 -0
- package/dist/browser/charts/core/svg-renderers.js +10 -108
- package/dist/browser/charts/core/svg-renderers.js.map +1 -1
- package/dist/browser/charts/core/treemap.js +1 -1
- package/dist/browser/charts/core/treemap.js.map +1 -1
- package/dist/browser/charts/description.js.map +1 -1
- package/dist/browser/charts.js +2 -1
- package/dist/browser/charts.js.map +1 -1
- package/dist/browser/content/ChartExplorer.js +22 -7
- package/dist/browser/content/ChartExplorer.js.map +1 -1
- package/dist/browser/content/ChartRoot.js +69 -52
- package/dist/browser/content/ChartRoot.js.map +1 -1
- package/dist/browser/content/ChartSnapshotView.js +18 -11
- package/dist/browser/content/ChartSnapshotView.js.map +1 -1
- package/dist/browser/content/chart-bar.js +50 -200
- package/dist/browser/content/chart-bar.js.map +1 -1
- package/dist/browser/content/chart-calendar.js +30 -14
- package/dist/browser/content/chart-calendar.js.map +1 -1
- package/dist/browser/content/chart-inspection-core.js +13 -6
- package/dist/browser/content/chart-inspection-core.js.map +1 -1
- package/dist/browser/content/chart-message-catalog.js +8 -0
- package/dist/browser/content/chart-message-catalog.js.map +1 -1
- package/dist/browser/content/chart-sankey.js +13 -0
- package/dist/browser/content/chart-sankey.js.map +1 -0
- package/dist/browser/content/chart-svg.js +1 -1
- package/dist/browser/content/chart-svg.js.map +1 -1
- package/dist/browser/content/chart-time-axis.js +10 -108
- package/dist/browser/content/chart-time-axis.js.map +1 -1
- package/dist/browser/content/chart-time-calendar.js +108 -0
- package/dist/browser/content/chart-time-calendar.js.map +1 -0
- package/dist/browser/inputs/DatePicker.js +30 -21
- package/dist/browser/inputs/DatePicker.js.map +1 -1
- package/dist/browser/inputs/NumberInput.js +188 -160
- package/dist/browser/inputs/NumberInput.js.map +1 -1
- package/dist/browser/inputs/Select.js +433 -400
- package/dist/browser/inputs/Select.js.map +1 -1
- package/dist/browser/inputs/Switch.js +203 -77
- package/dist/browser/inputs/Switch.js.map +1 -1
- package/dist/browser/inputs/TextInput.js +212 -188
- package/dist/browser/inputs/TextInput.js.map +1 -1
- package/dist/browser/inputs/field-contract.js.map +1 -1
- package/dist/browser/inputs/field-suggestion-slot.js +21 -0
- package/dist/browser/inputs/field-suggestion-slot.js.map +1 -0
- package/dist/browser/inputs/field-suggestion-types.js +2 -0
- package/dist/browser/inputs/field-suggestion-types.js.map +1 -0
- package/dist/browser/inputs/field-suggestion.js +502 -0
- package/dist/browser/inputs/field-suggestion.js.map +1 -0
- package/dist/browser/inputs/index.js +1 -0
- package/dist/browser/inputs/index.js.map +1 -1
- package/dist/browser/inputs/suggestion-messages.js +160 -0
- package/dist/browser/inputs/suggestion-messages.js.map +1 -0
- package/dist/browser/layout/AppOverview.js +15 -5
- package/dist/browser/layout/AppOverview.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +66 -411
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/DetailSections.js +8 -7
- package/dist/browser/layout/DetailSections.js.map +1 -1
- package/dist/browser/layout/Discussion.js +194 -246
- package/dist/browser/layout/Discussion.js.map +1 -1
- package/dist/browser/layout/detail-panel-messages.js +1 -1
- package/dist/browser/layout/detail-panel-messages.js.map +1 -1
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/surfaces/Field.js +102 -0
- package/dist/browser/surfaces/Field.js.map +1 -0
- package/dist/browser/surfaces/LinkCard.js +70 -21
- package/dist/browser/surfaces/LinkCard.js.map +1 -1
- package/dist/browser/surfaces/NoticeRow.js +75 -0
- package/dist/browser/surfaces/NoticeRow.js.map +1 -0
- package/dist/browser/surfaces/Section.js +441 -0
- package/dist/browser/surfaces/Section.js.map +1 -0
- package/dist/browser/surfaces/index.js +3 -0
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/browser/surfaces/section-messages.js +25 -0
- package/dist/browser/surfaces/section-messages.js.map +1 -0
- package/dist/ssr/actions/SplitButton.js +10 -1
- package/dist/ssr/actions/SplitButton.js.map +1 -1
- package/dist/ssr/actions/Toolbar.js +40 -16
- package/dist/ssr/actions/Toolbar.js.map +1 -1
- package/dist/ssr/actions/index.js +1 -1
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/charts/core/area.js +1 -1
- package/dist/ssr/charts/core/area.js.map +1 -1
- package/dist/ssr/charts/core/bar-base-render.js +10 -0
- package/dist/ssr/charts/core/bar-base-render.js.map +1 -0
- package/dist/ssr/charts/core/bar-common.js +63 -0
- package/dist/ssr/charts/core/bar-common.js.map +1 -0
- package/dist/ssr/charts/core/bar-labels.js +12 -0
- package/dist/ssr/charts/core/bar-labels.js.map +1 -1
- package/dist/ssr/charts/core/bar-render.js +10 -0
- package/dist/ssr/charts/core/bar-render.js.map +1 -0
- package/dist/ssr/charts/core/bar-series.js +112 -0
- package/dist/ssr/charts/core/bar-series.js.map +1 -0
- package/dist/ssr/charts/core/calendar.js +63 -47
- package/dist/ssr/charts/core/calendar.js.map +1 -1
- package/dist/ssr/charts/core/dot-options.js +28 -0
- package/dist/ssr/charts/core/dot-options.js.map +1 -0
- package/dist/ssr/charts/core/dots.js +12 -0
- package/dist/ssr/charts/core/dots.js.map +1 -0
- package/dist/ssr/charts/core/index.js +14 -2
- package/dist/ssr/charts/core/index.js.map +1 -1
- package/dist/ssr/charts/core/line-base.js +102 -0
- package/dist/ssr/charts/core/line-base.js.map +1 -0
- package/dist/ssr/charts/core/line-details.js +264 -0
- package/dist/ssr/charts/core/line-details.js.map +1 -0
- package/dist/ssr/charts/core/line-options.js +32 -0
- package/dist/ssr/charts/core/line-options.js.map +1 -0
- package/dist/ssr/charts/core/line-paths.js +60 -0
- package/dist/ssr/charts/core/line-paths.js.map +1 -0
- package/dist/ssr/charts/core/line.js +15 -0
- package/dist/ssr/charts/core/line.js.map +1 -0
- package/dist/ssr/charts/core/palette.js +11 -0
- package/dist/ssr/charts/core/palette.js.map +1 -0
- package/dist/ssr/charts/core/pareto.js +23 -5
- package/dist/ssr/charts/core/pareto.js.map +1 -1
- package/dist/ssr/charts/core/registry.js +4 -2
- package/dist/ssr/charts/core/registry.js.map +1 -1
- package/dist/ssr/charts/core/render-size.js +4 -1
- package/dist/ssr/charts/core/render-size.js.map +1 -1
- package/dist/ssr/charts/core/render.js +23 -7
- package/dist/ssr/charts/core/render.js.map +1 -1
- package/dist/ssr/charts/core/sankey-size.js +105 -0
- package/dist/ssr/charts/core/sankey-size.js.map +1 -0
- package/dist/ssr/charts/core/sankey.js +280 -0
- package/dist/ssr/charts/core/sankey.js.map +1 -0
- package/dist/ssr/charts/core/snapshot.js +4 -2
- package/dist/ssr/charts/core/snapshot.js.map +1 -1
- package/dist/ssr/charts/core/svg-common.js +5 -67
- package/dist/ssr/charts/core/svg-common.js.map +1 -1
- package/dist/ssr/charts/core/svg-format.js +7 -0
- package/dist/ssr/charts/core/svg-format.js.map +1 -0
- package/dist/ssr/charts/core/svg-renderers.js +10 -108
- package/dist/ssr/charts/core/svg-renderers.js.map +1 -1
- package/dist/ssr/charts/core/treemap.js +1 -1
- package/dist/ssr/charts/core/treemap.js.map +1 -1
- package/dist/ssr/charts/description.js.map +1 -1
- package/dist/ssr/charts.js +2 -1
- package/dist/ssr/charts.js.map +1 -1
- package/dist/ssr/content/ChartExplorer.js +16 -4
- package/dist/ssr/content/ChartExplorer.js.map +1 -1
- package/dist/ssr/content/ChartRoot.js +24 -12
- package/dist/ssr/content/ChartRoot.js.map +1 -1
- package/dist/ssr/content/ChartSnapshotView.js +6 -2
- package/dist/ssr/content/ChartSnapshotView.js.map +1 -1
- package/dist/ssr/content/chart-bar.js +50 -200
- package/dist/ssr/content/chart-bar.js.map +1 -1
- package/dist/ssr/content/chart-calendar.js +30 -14
- package/dist/ssr/content/chart-calendar.js.map +1 -1
- package/dist/ssr/content/chart-inspection-core.js +13 -6
- package/dist/ssr/content/chart-inspection-core.js.map +1 -1
- package/dist/ssr/content/chart-message-catalog.js +8 -0
- package/dist/ssr/content/chart-message-catalog.js.map +1 -1
- package/dist/ssr/content/chart-sankey.js +13 -0
- package/dist/ssr/content/chart-sankey.js.map +1 -0
- package/dist/ssr/content/chart-svg.js +1 -1
- package/dist/ssr/content/chart-svg.js.map +1 -1
- package/dist/ssr/content/chart-time-axis.js +10 -108
- package/dist/ssr/content/chart-time-axis.js.map +1 -1
- package/dist/ssr/content/chart-time-calendar.js +108 -0
- package/dist/ssr/content/chart-time-calendar.js.map +1 -0
- package/dist/ssr/inputs/DatePicker.js +30 -21
- package/dist/ssr/inputs/DatePicker.js.map +1 -1
- package/dist/ssr/inputs/NumberInput.js +33 -7
- package/dist/ssr/inputs/NumberInput.js.map +1 -1
- package/dist/ssr/inputs/Select.js +38 -7
- package/dist/ssr/inputs/Select.js.map +1 -1
- package/dist/ssr/inputs/Switch.js +79 -18
- package/dist/ssr/inputs/Switch.js.map +1 -1
- package/dist/ssr/inputs/TextInput.js +31 -7
- package/dist/ssr/inputs/TextInput.js.map +1 -1
- package/dist/ssr/inputs/field-contract.js.map +1 -1
- package/dist/ssr/inputs/field-suggestion-slot.js +21 -0
- package/dist/ssr/inputs/field-suggestion-slot.js.map +1 -0
- package/dist/ssr/inputs/field-suggestion-types.js +2 -0
- package/dist/ssr/inputs/field-suggestion-types.js.map +1 -0
- package/dist/ssr/inputs/field-suggestion.js +402 -0
- package/dist/ssr/inputs/field-suggestion.js.map +1 -0
- package/dist/ssr/inputs/index.js +1 -0
- package/dist/ssr/inputs/index.js.map +1 -1
- package/dist/ssr/inputs/suggestion-messages.js +160 -0
- package/dist/ssr/inputs/suggestion-messages.js.map +1 -0
- package/dist/ssr/layout/AppOverview.js +3 -3
- package/dist/ssr/layout/AppOverview.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +24 -220
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/DetailSections.js +8 -7
- package/dist/ssr/layout/DetailSections.js.map +1 -1
- package/dist/ssr/layout/Discussion.js +56 -76
- package/dist/ssr/layout/Discussion.js.map +1 -1
- package/dist/ssr/layout/detail-panel-messages.js +1 -1
- package/dist/ssr/layout/detail-panel-messages.js.map +1 -1
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/surfaces/Field.js +58 -0
- package/dist/ssr/surfaces/Field.js.map +1 -0
- package/dist/ssr/surfaces/LinkCard.js +38 -5
- package/dist/ssr/surfaces/LinkCard.js.map +1 -1
- package/dist/ssr/surfaces/NoticeRow.js +39 -0
- package/dist/ssr/surfaces/NoticeRow.js.map +1 -0
- package/dist/ssr/surfaces/Section.js +295 -0
- package/dist/ssr/surfaces/Section.js.map +1 -0
- package/dist/ssr/surfaces/index.js +3 -0
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/ssr/surfaces/section-messages.js +25 -0
- package/dist/ssr/surfaces/section-messages.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/tabler.css +2 -1
- package/dist/types/actions/SplitButton.d.ts +5 -1
- package/dist/types/actions/Toolbar.d.ts +18 -1
- package/dist/types/actions/index.d.ts +2 -2
- package/dist/types/charts/core/bar-base-render.d.ts +7 -0
- package/dist/types/charts/core/bar-common.d.ts +13 -0
- package/dist/types/charts/core/bar-labels.d.ts +1 -0
- package/dist/types/charts/core/bar-render.d.ts +7 -0
- package/dist/types/charts/core/bar-series.d.ts +7 -0
- package/dist/types/charts/core/calendar.d.ts +9 -0
- package/dist/types/charts/core/dot-options.d.ts +27 -0
- package/dist/types/charts/core/dots.d.ts +7 -0
- package/dist/types/charts/core/index.d.ts +14 -2
- package/dist/types/charts/core/line-base.d.ts +3 -0
- package/dist/types/charts/core/line-details.d.ts +30 -0
- package/dist/types/charts/core/line-options.d.ts +25 -0
- package/dist/types/charts/core/line-paths.d.ts +16 -0
- package/dist/types/charts/core/line.d.ts +2 -0
- package/dist/types/charts/core/palette.d.ts +5 -0
- package/dist/types/charts/core/pareto.d.ts +2 -0
- package/dist/types/charts/core/registry.d.ts +3 -1
- package/dist/types/charts/core/render.d.ts +4 -1
- package/dist/types/charts/core/sankey-size.d.ts +38 -0
- package/dist/types/charts/core/sankey.d.ts +106 -0
- package/dist/types/charts/core/snapshot.d.ts +2 -0
- package/dist/types/charts/core/svg-common.d.ts +23 -16
- package/dist/types/charts/core/svg-format.d.ts +1 -0
- package/dist/types/charts/core/svg-renderers.d.ts +9 -9
- package/dist/types/charts/description.d.ts +39 -1
- package/dist/types/charts.d.ts +2 -1
- package/dist/types/content/ChartExplorer.d.ts +2 -0
- package/dist/types/content/chart-bar.d.ts +27 -19
- package/dist/types/content/chart-inspection-core.d.ts +4 -1
- package/dist/types/content/chart-sankey.d.ts +3 -0
- package/dist/types/content/chart-svg.d.ts +1 -1
- package/dist/types/content/chart-time-axis.d.ts +3 -19
- package/dist/types/content/chart-time-calendar.d.ts +24 -0
- package/dist/types/inputs/DatePicker.d.ts +4 -2
- package/dist/types/inputs/NumberInput.d.ts +2 -2
- package/dist/types/inputs/Select.d.ts +2 -2
- package/dist/types/inputs/Switch.d.ts +8 -2
- package/dist/types/inputs/TextInput.d.ts +4 -2
- package/dist/types/inputs/field-contract.d.ts +1 -0
- package/dist/types/inputs/field-suggestion-slot.d.ts +3 -0
- package/dist/types/inputs/field-suggestion-types.d.ts +103 -0
- package/dist/types/inputs/field-suggestion.d.ts +26 -0
- package/dist/types/inputs/index.d.ts +3 -1
- package/dist/types/inputs/suggestion-messages.d.ts +67 -0
- package/dist/types/layout/AppOverview.d.ts +2 -0
- package/dist/types/layout/DetailPanel.d.ts +4 -37
- package/dist/types/layout/detail-panel-messages.d.ts +1 -1
- package/dist/types/layout/index.d.ts +1 -1
- package/dist/types/surfaces/Field.d.ts +20 -0
- package/dist/types/surfaces/LinkCard.d.ts +9 -1
- package/dist/types/surfaces/NoticeRow.d.ts +23 -0
- package/dist/types/surfaces/Section.d.ts +74 -0
- package/dist/types/surfaces/index.d.ts +6 -0
- package/dist/types/surfaces/section-messages.d.ts +10 -0
- package/package.json +2 -2
- /package/dist/{tabler-icons-15sezdfp.woff2 → tabler-icons-dafbdda4cb0cdcb2.woff2} +0 -0
|
@@ -85,7 +85,11 @@ type Variants<N> = {
|
|
|
85
85
|
label: string;
|
|
86
86
|
data: (number | null)[];
|
|
87
87
|
}[];
|
|
88
|
-
|
|
88
|
+
/** Rows accept signed values. Ordered categories and legacy drawing options retain the original row renderer. */
|
|
89
|
+
layout?: "columns" | "rows" | "grouped" | "stacked" | "nested";
|
|
90
|
+
marks?: "bars" | "dots";
|
|
91
|
+
total?: number;
|
|
92
|
+
dots?: number;
|
|
89
93
|
normalize?: boolean;
|
|
90
94
|
share?: boolean;
|
|
91
95
|
limit?: number;
|
|
@@ -130,6 +134,21 @@ type Variants<N> = {
|
|
|
130
134
|
legend?: boolean;
|
|
131
135
|
area?: boolean;
|
|
132
136
|
smooth?: boolean;
|
|
137
|
+
step?: "after" | "before" | "middle";
|
|
138
|
+
zero?: boolean;
|
|
139
|
+
legendValues?: boolean;
|
|
140
|
+
forecast?: {
|
|
141
|
+
from: number | string;
|
|
142
|
+
band?: [number, number][];
|
|
143
|
+
};
|
|
144
|
+
threshold?: {
|
|
145
|
+
value: number;
|
|
146
|
+
label: string;
|
|
147
|
+
};
|
|
148
|
+
marker?: {
|
|
149
|
+
at: number | string;
|
|
150
|
+
label: string;
|
|
151
|
+
};
|
|
133
152
|
references?: Reference[];
|
|
134
153
|
} | {
|
|
135
154
|
kind: "scatter";
|
|
@@ -232,6 +251,25 @@ type Variants<N> = {
|
|
|
232
251
|
label: string;
|
|
233
252
|
value: number;
|
|
234
253
|
prev: number;
|
|
254
|
+
rest?: boolean;
|
|
255
|
+
}[];
|
|
256
|
+
format?: ChartNumberFormat;
|
|
257
|
+
locale?: string;
|
|
258
|
+
} | {
|
|
259
|
+
kind: "sankey";
|
|
260
|
+
nodes: {
|
|
261
|
+
id: string;
|
|
262
|
+
label: string;
|
|
263
|
+
tone?: "in" | "out" | "muted" | "blue" | "green" | "amber" | "red" | "violet" | "tax";
|
|
264
|
+
}[];
|
|
265
|
+
links: {
|
|
266
|
+
source: string;
|
|
267
|
+
target: string;
|
|
268
|
+
value: number;
|
|
269
|
+
}[];
|
|
270
|
+
legend?: {
|
|
271
|
+
tone: "in" | "out" | "muted" | "blue" | "green" | "amber" | "red" | "violet" | "tax";
|
|
272
|
+
label: string;
|
|
235
273
|
}[];
|
|
236
274
|
format?: ChartNumberFormat;
|
|
237
275
|
locale?: string;
|
package/dist/types/charts.d.ts
CHANGED
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
export * from "./charts/core";
|
|
5
5
|
export type * from "./charts/description";
|
|
6
6
|
export type { ChartKindProps, ChartLabels, ChartProps, ChartRenderOptions } from "./content/Chart";
|
|
7
|
-
export { type BarChartLayout, type BarChartOptions, barChartLayout
|
|
7
|
+
export { type BarChartLayout, type BarChartOptions, barChartLayout } from "./content/chart-bar";
|
|
8
8
|
export { calendarInspectionNavigation, mountCalendarScroll } from "./content/chart-calendar";
|
|
9
|
+
export { sankeyInspectionNavigation } from "./content/chart-sankey";
|
|
@@ -18,6 +18,8 @@ export type ChartExplorerColumn<T> = {
|
|
|
18
18
|
export type ChartLegendEntry = {
|
|
19
19
|
label: string;
|
|
20
20
|
color: number;
|
|
21
|
+
/** Source series index when entries omit empty series or use a wrapped palette. Defaults to the entry position. */
|
|
22
|
+
seriesIndex?: number;
|
|
21
23
|
/** Line pattern of a line series; a solid series shows a filled swatch. */
|
|
22
24
|
style?: "solid" | "dashed" | "dotted";
|
|
23
25
|
/** A comparison series, drawn hollow like its marks. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AxisOptions, type BarItem, type ReferenceLine } from "../charts/core/svg-renderers";
|
|
2
|
+
export { chartTextWidth, headerHeight, renderHeader, wrapLabel } from "../charts/core/bar-common";
|
|
2
3
|
/**
|
|
3
4
|
* Bar chart options: stdlib's `charts.bar` options plus a title for the category axis and a separate value format.
|
|
4
5
|
* The wrapper owns size and inspection.
|
|
@@ -11,9 +12,15 @@ export type BarChartOptions = {
|
|
|
11
12
|
label: string;
|
|
12
13
|
data: (number | null)[];
|
|
13
14
|
}[];
|
|
14
|
-
layout?: "columns" | "rows" | "grouped" | "stacked";
|
|
15
|
+
layout?: "columns" | "rows" | "grouped" | "stacked" | "nested";
|
|
15
16
|
normalize?: boolean;
|
|
16
|
-
/**
|
|
17
|
+
/** Initial/restored legend: sum counts, or show the last category for rates and shares. */
|
|
18
|
+
legendValues?: "total" | "latest";
|
|
19
|
+
marks?: "bars" | "dots";
|
|
20
|
+
/** Dot matrix capacity in source units and an even mark budget (default 100). */
|
|
21
|
+
total?: number;
|
|
22
|
+
dots?: number;
|
|
23
|
+
/** Unordered nonnegative rows without legacy drawing options form a ranked list. */
|
|
17
24
|
share?: boolean;
|
|
18
25
|
limit?: number;
|
|
19
26
|
tone?: "in" | "out";
|
|
@@ -58,31 +65,18 @@ export type BarChartOptions = {
|
|
|
58
65
|
};
|
|
59
66
|
};
|
|
60
67
|
export type BarChartLayout = "columns" | "rows";
|
|
61
|
-
/** Estimated width of `text` at `size` pixels in the UI sans font with tabular figures; a little wide on purpose. */
|
|
62
|
-
export declare const chartTextWidth: (text: string, size?: number) => number;
|
|
63
|
-
/** Split a label into at most `lines` lines of `maxPx`; the last line ends with an ellipsis when the label is longer. */
|
|
64
|
-
export declare const wrapLabel: (label: string, maxPx: number, lines: number) => {
|
|
65
|
-
lines: string[];
|
|
66
|
-
truncated: boolean;
|
|
67
|
-
};
|
|
68
68
|
type Scale = {
|
|
69
69
|
domain: [number, number];
|
|
70
70
|
ticks: number[];
|
|
71
71
|
log: boolean;
|
|
72
72
|
};
|
|
73
|
-
export declare const headerHeight: (opts: Pick<BarChartOptions, "title" | "subtitle">) => number;
|
|
74
73
|
/** The layout a bar chart takes and its logical height, so server and browser reserve the same box. */
|
|
75
74
|
export declare const barChartLayout: (opts: BarChartOptions, width?: number) => {
|
|
76
75
|
layout: BarChartLayout;
|
|
77
76
|
height: number;
|
|
78
77
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
* Render a bar chart in which every category has its label. Few short labels stand below vertical columns; otherwise
|
|
82
|
-
* each category becomes a horizontal row with its label left of the bar and its value at the bar's end. Rows grow the
|
|
83
|
-
* drawing instead of dropping labels: use {@link barChartLayout} for its logical height.
|
|
84
|
-
*/
|
|
85
|
-
export declare const renderBarChartSvg: (opts: BarChartOptions & {
|
|
78
|
+
/** Internal legacy/category drawing; the series drawing entry loads separately from frame sizing. */
|
|
79
|
+
export declare const renderBarDataSvg: (opts: BarChartOptions & {
|
|
86
80
|
width: number;
|
|
87
81
|
height: number;
|
|
88
82
|
inspect?: boolean;
|
|
@@ -91,7 +85,7 @@ export declare const renderBarChartSvg: (opts: BarChartOptions & {
|
|
|
91
85
|
export declare function barSeriesLegend(entries: {
|
|
92
86
|
label: string;
|
|
93
87
|
data: (number | null)[];
|
|
94
|
-
}[], format: (v: number) => string, width?: number, displayWidth?: number, maxHeight?: number): {
|
|
88
|
+
}[], format: (v: number) => string, width?: number, displayWidth?: number, maxHeight?: number, summary?: "total" | "latest"): {
|
|
95
89
|
items: {
|
|
96
90
|
label: string;
|
|
97
91
|
data: (number | null)[];
|
|
@@ -123,6 +117,12 @@ export declare function seriesBarLayout(opts: BarChartOptions, size?: {
|
|
|
123
117
|
}[];
|
|
124
118
|
total: number;
|
|
125
119
|
previous: number | null | undefined;
|
|
120
|
+
matrix: {
|
|
121
|
+
x: number;
|
|
122
|
+
y: number;
|
|
123
|
+
radius: number;
|
|
124
|
+
seriesIndex: number | null;
|
|
125
|
+
}[];
|
|
126
126
|
}[];
|
|
127
127
|
totals: (number | null)[];
|
|
128
128
|
scale: Scale;
|
|
@@ -133,6 +133,10 @@ export declare function seriesBarLayout(opts: BarChartOptions, size?: {
|
|
|
133
133
|
slot: number;
|
|
134
134
|
y: (value: number) => number;
|
|
135
135
|
format: (value: number) => string;
|
|
136
|
+
labels: {
|
|
137
|
+
delta: string;
|
|
138
|
+
total: string;
|
|
139
|
+
};
|
|
136
140
|
units: number;
|
|
137
141
|
entries: {
|
|
138
142
|
label: string;
|
|
@@ -153,7 +157,12 @@ export declare function seriesBarLayout(opts: BarChartOptions, size?: {
|
|
|
153
157
|
height: number;
|
|
154
158
|
};
|
|
155
159
|
barWidthPx: number;
|
|
160
|
+
dot: {
|
|
161
|
+
total: number;
|
|
162
|
+
count: number;
|
|
163
|
+
} | undefined;
|
|
156
164
|
};
|
|
165
|
+
export type SeriesBarLayout = ReturnType<typeof seriesBarLayout>;
|
|
157
166
|
/** Ranked rows retain original indices. A limit changes the drawing, never the denominator or source data. */
|
|
158
167
|
export declare function rankedBarLayout(opts: BarChartOptions, size?: {
|
|
159
168
|
width: number;
|
|
@@ -186,4 +195,3 @@ export declare function rankedBarLayout(opts: BarChartOptions, size?: {
|
|
|
186
195
|
shareWidth: number;
|
|
187
196
|
labelWidth: number;
|
|
188
197
|
};
|
|
189
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChartKind } from "../charts/core/types";
|
|
1
|
+
import type { ChartDatum, ChartKind } from "../charts/core/types";
|
|
2
2
|
import type { ChartCursor } from "./chart-cursor";
|
|
3
3
|
export { type ChartDatumRef, type ChartSelection, type ChartTooltip, type ChartTooltipFormatter, isChartDatum, sameChartDatum, } from "../charts/core/inspection";
|
|
4
4
|
export type { ChartKind } from "../charts/core/types";
|
|
@@ -6,6 +6,9 @@ import { type ChartDatumRef, type ChartSelection, type ChartTooltipFormatter } f
|
|
|
6
6
|
/** Host policy for inspecting an overflowing drawing. */
|
|
7
7
|
export type ChartInspectionNavigation = {
|
|
8
8
|
last?: boolean;
|
|
9
|
+
order?: (entries: {
|
|
10
|
+
datum: ChartDatum;
|
|
11
|
+
}[]) => void;
|
|
9
12
|
pointer?: boolean;
|
|
10
13
|
reveal?: (element: SVGGraphicsElement) => void;
|
|
11
14
|
keepScroll?: boolean;
|
|
@@ -5,7 +5,7 @@ import type { MapViewport } from "../charts/core/svg";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function responsiveMapSvg(svg: string, width: number, height: number, viewport: MapViewport): string;
|
|
7
7
|
/** Adapt our generated SVGs to a CSS-sized box without rebuilding their geometry.
|
|
8
|
-
* Only
|
|
8
|
+
* Only UI core renderers supply this markup; this is not a
|
|
9
9
|
* parser for arbitrary SVG. The viewBox remains the interaction coordinate space.
|
|
10
10
|
*/
|
|
11
11
|
export declare function responsiveChartSvg(svg: string): string;
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export type ChartTimeAxis = {
|
|
6
|
-
/** IANA zone whose wall clock the ticks follow, such as the zone the data's buckets use. */
|
|
7
|
-
timeZone: string;
|
|
8
|
-
/** Locale of the default tick labels; `xAxis.format` replaces them. Defaults to `en`. */
|
|
9
|
-
locale?: string;
|
|
10
|
-
};
|
|
11
|
-
export type ChartTimeUnit = "minute" | "hour" | "day" | "week" | "month" | "year";
|
|
12
|
-
export type ChartTimeStep = {
|
|
13
|
-
unit: ChartTimeUnit;
|
|
14
|
-
size: number;
|
|
15
|
-
};
|
|
16
|
-
/** The round step for a time span: the finest one that keeps at most `maxTicks` ticks. */
|
|
17
|
-
export declare const chartTimeStep: (span: number, maxTicks: number) => ChartTimeStep;
|
|
18
|
-
/** Tick instants inside `domain` that fall on round wall times of `step` in `timeZone`. */
|
|
1
|
+
import { type ChartTimeAxis, type ChartTimeStep, chartTimeStep } from "./chart-time-calendar";
|
|
2
|
+
export type { ChartTimeAxis, ChartTimeStep, ChartTimeUnit } from "./chart-time-calendar";
|
|
3
|
+
export { chartTimeStep };
|
|
19
4
|
export declare const chartTimeTicks: (domain: readonly [number, number], timeZone: string, step: ChartTimeStep) => number[];
|
|
20
|
-
/** Default label of a tick: the clock time, the day at local midnight, the month or the year. */
|
|
21
5
|
export declare const chartTimeLabel: (tick: number, step: ChartTimeStep, axis: ChartTimeAxis) => string;
|
|
22
6
|
/**
|
|
23
7
|
* Replaces the renderer's X tick labels, which sit on decimal millisecond steps, with labels on round times. The
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A line chart whose X values are instants (Unix milliseconds). Its axis ticks land on round times in `timeZone`:
|
|
3
|
+
* minutes, hours, days, weeks, months, or years, whichever step keeps the requested number of ticks.
|
|
4
|
+
*/
|
|
5
|
+
export type ChartTimeAxis = {
|
|
6
|
+
/** IANA zone whose wall clock the ticks follow, such as the zone the data's buckets use. */
|
|
7
|
+
timeZone: string;
|
|
8
|
+
/** Locale of the default tick labels; `xAxis.format` replaces them. Defaults to `en`. */
|
|
9
|
+
locale?: string;
|
|
10
|
+
};
|
|
11
|
+
export type ChartTimeUnit = "minute" | "hour" | "day" | "week" | "month" | "year";
|
|
12
|
+
export type ChartTimeStep = {
|
|
13
|
+
unit: ChartTimeUnit;
|
|
14
|
+
size: number;
|
|
15
|
+
};
|
|
16
|
+
/** The round step for a time span: the finest one that keeps at most `maxTicks` ticks. */
|
|
17
|
+
export declare const chartTimeStep: (span: number, maxTicks: number) => ChartTimeStep;
|
|
18
|
+
/** Tick instants inside `domain` that fall on round wall times of `step` in `timeZone`. */
|
|
19
|
+
export declare const calendarTimeTicks: (domain: readonly [number, number], timeZone: string, step: ChartTimeStep, clock: {
|
|
20
|
+
wallOf: (instant: number, zone: string) => number;
|
|
21
|
+
instantOf: (wall: number, zone: string) => number;
|
|
22
|
+
}) => number[];
|
|
23
|
+
/** Default label of a tick: the clock time, the day at local midnight, the month or the year. */
|
|
24
|
+
export declare const calendarTimeLabel: (tick: number, step: ChartTimeStep, axis: ChartTimeAxis, midnight: boolean) => string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type DateContext } from "@k2b/stdlib";
|
|
2
2
|
import { type JSX } from "solid-js";
|
|
3
3
|
import { type DateRangeValue } from "./date-picker";
|
|
4
|
-
import type { MaybeAccessor, ValueFieldProps } from "./field-contract";
|
|
4
|
+
import type { FieldSuggestionProps, MaybeAccessor, ValueFieldProps } from "./field-contract";
|
|
5
5
|
import type { ChoiceAppearance } from "./Select";
|
|
6
6
|
export type { DateRangeValue } from "./date-picker";
|
|
7
7
|
export type DatePreset<T> = {
|
|
@@ -30,7 +30,9 @@ export type DatePickerBaseProps<T> = Omit<ValueFieldProps<T>, "value"> & {
|
|
|
30
30
|
/** Shows and announces the value without changing it; the field stays focusable. */
|
|
31
31
|
readOnly?: boolean;
|
|
32
32
|
};
|
|
33
|
-
export type DatePickerProps = DatePickerBaseProps<string | null> &
|
|
33
|
+
export type DatePickerProps = DatePickerBaseProps<string | null> &
|
|
34
|
+
/** A suggested day is a date key such as `2026-10-28`; only the default `field` appearance shows it. */
|
|
35
|
+
FieldSuggestionProps<string> & {
|
|
34
36
|
/** Content for a set value: the trigger of a `plain` picker, or the resting status line of a typed field. */
|
|
35
37
|
renderValue?: (value: string) => JSX.Element;
|
|
36
38
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type JSX } from "solid-js";
|
|
2
|
-
import type { ValueFieldProps } from "./field-contract";
|
|
2
|
+
import type { FieldSuggestionProps, ValueFieldProps } from "./field-contract";
|
|
3
3
|
import type { ChoiceAppearance } from "./Select";
|
|
4
|
-
export type NumberInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "max" | "min" | "onChange" | "onInput" | "prefix" | "step" | "type" | "value" | keyof ValueFieldProps<number | null>> & ValueFieldProps<number | null> & {
|
|
4
|
+
export type NumberInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "max" | "min" | "onChange" | "onInput" | "prefix" | "step" | "type" | "value" | keyof ValueFieldProps<number | null>> & ValueFieldProps<number | null> & FieldSuggestionProps<number> & {
|
|
5
5
|
max?: number;
|
|
6
6
|
min?: number;
|
|
7
7
|
/** Stepper increment and commit grid; defaults to `1`. A fractional step also sets the default `decimalPlaces`. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type JSX } from "solid-js";
|
|
2
2
|
import { type ChoiceOption } from "./choice";
|
|
3
|
-
import type { ValueFieldProps } from "./field-contract";
|
|
3
|
+
import type { FieldSuggestionProps, ValueFieldProps } from "./field-contract";
|
|
4
4
|
export type SelectOption = ChoiceOption<string>;
|
|
5
5
|
export type SelectGroup = {
|
|
6
6
|
value: string;
|
|
@@ -23,7 +23,7 @@ export type SelectSourceOption = string | {
|
|
|
23
23
|
color?: string;
|
|
24
24
|
groups?: readonly string[];
|
|
25
25
|
} | SelectOption;
|
|
26
|
-
export type SelectProps = ValueFieldProps<string | null> & {
|
|
26
|
+
export type SelectProps = ValueFieldProps<string | null> & FieldSuggestionProps<string> & {
|
|
27
27
|
placeholder?: string;
|
|
28
28
|
icon?: string;
|
|
29
29
|
activeIcon?: string;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { type JSX } from "solid-js";
|
|
2
|
-
import type { ValueFieldProps } from "./field-contract";
|
|
3
|
-
export type SwitchProps = ValueFieldProps<boolean> &
|
|
2
|
+
import type { FieldSuggestionProps, ValueFieldProps } from "./field-contract";
|
|
3
|
+
export type SwitchProps = ValueFieldProps<boolean> &
|
|
4
|
+
/**
|
|
5
|
+
* A switch always has a value, so it shows a suggestion until someone flips it: the switch keeps its real
|
|
6
|
+
* position, takes the suggestion ring, and names the suggested position beside it. The label then moves above
|
|
7
|
+
* the switch, next to the status line.
|
|
8
|
+
*/
|
|
9
|
+
FieldSuggestionProps<boolean> & {
|
|
4
10
|
name?: string;
|
|
5
11
|
};
|
|
6
12
|
export declare function Switch(props: SwitchProps): JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type JSX } from "solid-js";
|
|
2
2
|
import type { Completion } from "./completion";
|
|
3
|
-
import type { ValueFieldProps } from "./field-contract";
|
|
4
|
-
export type TextInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "onChange" | "onInput" | "onKeyDown" | "prefix" | "suffix" | "type" | "value" | keyof ValueFieldProps<string>> & ValueFieldProps<string> &
|
|
3
|
+
import type { FieldSuggestionProps, ValueFieldProps } from "./field-contract";
|
|
4
|
+
export type TextInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "onChange" | "onInput" | "onKeyDown" | "prefix" | "suffix" | "type" | "value" | keyof ValueFieldProps<string>> & ValueFieldProps<string> &
|
|
5
|
+
/** Suggestions apply to text and multiline fields, not to `markdown`. */
|
|
6
|
+
FieldSuggestionProps<string> & {
|
|
5
7
|
minLength?: number;
|
|
6
8
|
maxLength?: number;
|
|
7
9
|
type?: "text" | "search" | "email" | "url" | "tel";
|
|
@@ -18,6 +18,7 @@ export type ValueFieldProps<T> = FieldProps & {
|
|
|
18
18
|
onValueChange?: (value: T) => void;
|
|
19
19
|
onValueCommit?: (value: T) => void;
|
|
20
20
|
};
|
|
21
|
+
export type { FieldSuggestion, FieldSuggestionProps } from "./field-suggestion-types";
|
|
21
22
|
/** Reports one atomic edit as both the current and committed field value. */
|
|
22
23
|
export declare const commitFieldValue: <T>(owner: Pick<ValueFieldProps<T>, "onValueChange" | "onValueCommit">, value: T) => void;
|
|
23
24
|
export declare function resolveMaybeAccessor<T>(value: MaybeAccessor<T>): T;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CreateFieldSuggestion, FieldSuggestionControl, FieldSuggestionOptions } from "./field-suggestion-types";
|
|
2
|
+
export declare const FieldSuggestionContext: import("solid-js").Context<CreateFieldSuggestion | undefined>;
|
|
3
|
+
export declare function useFieldSuggestion<T>(options: FieldSuggestionOptions<T>): FieldSuggestionControl<T>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
import type { FieldMeta } from "../internal/field";
|
|
3
|
+
import type { FieldProps, MaybeAccessor } from "./field-contract";
|
|
4
|
+
/**
|
|
5
|
+
* A value someone or something proposes for a field, such as a value an assistant read from a document. It is
|
|
6
|
+
* plain data: the field shows it and reports acceptance, it never fetches, stores, or submits it.
|
|
7
|
+
*/
|
|
8
|
+
export type FieldSuggestion<T> = {
|
|
9
|
+
id: string;
|
|
10
|
+
state: "loading";
|
|
11
|
+
source?: string;
|
|
12
|
+
} | {
|
|
13
|
+
id: string;
|
|
14
|
+
state: "error";
|
|
15
|
+
source?: string;
|
|
16
|
+
onRetry?: () => void;
|
|
17
|
+
} | {
|
|
18
|
+
/** Stable per suggestion and source revision, such as `"re-4471:v3:amount"`. */
|
|
19
|
+
id: string;
|
|
20
|
+
state: "ready";
|
|
21
|
+
value: T;
|
|
22
|
+
/** Only `"high"` takes part in accept-all; `"low"` stays open until someone accepts it on its own. */
|
|
23
|
+
confidence: "high" | "low";
|
|
24
|
+
/** One sentence why the value is uncertain. */
|
|
25
|
+
reason?: string;
|
|
26
|
+
/** How the value reads, when the field cannot name it itself, such as an option from a remote list. */
|
|
27
|
+
label?: string;
|
|
28
|
+
/** Who proposes the value, such as an assistant's name. */
|
|
29
|
+
source?: string;
|
|
30
|
+
/** Set by the owner once the field's value came from this suggestion. */
|
|
31
|
+
accepted?: boolean;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Fields that can show a suggestion inside a `SuggestionGroup`, which brings the suggestion code; outside one the
|
|
35
|
+
* suggestion is ignored. The suggestion never becomes the value by itself: an empty field shows it as a placeholder,
|
|
36
|
+
* a value someone entered stays, and only accepting it reports `onSuggestionAccept` and then the normal
|
|
37
|
+
* `onValueChange` and `onValueCommit`.
|
|
38
|
+
*/
|
|
39
|
+
export type FieldSuggestionProps<T> = {
|
|
40
|
+
/** Passing the prop at all reserves the status line, also while it resolves to `undefined`. */
|
|
41
|
+
suggestion?: MaybeAccessor<FieldSuggestion<T> | undefined>;
|
|
42
|
+
onSuggestionAccept?: (id: string) => void;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* What a field shows for its suggestion:
|
|
46
|
+
* `open` — an empty, untouched field shows the suggestion as its placeholder;
|
|
47
|
+
* `differs` — the field holds someone's own value (or was deliberately emptied) and the suggestion only sits in the status line;
|
|
48
|
+
* `matches` — the value equals the suggestion, entered by hand;
|
|
49
|
+
* `accepted` — the value equals the suggestion and the owner marked it accepted.
|
|
50
|
+
*/
|
|
51
|
+
export type FieldSuggestionView = "none" | "loading" | "error" | "open" | "differs" | "matches" | "accepted";
|
|
52
|
+
/** What a field wires into its control. Without a `SuggestionGroup` around it, every part is empty or unchanged. */
|
|
53
|
+
export type FieldSuggestionControl<T> = {
|
|
54
|
+
/** True when the field was given a `suggestion` prop inside a group; the status line is reserved from the first render. */
|
|
55
|
+
enabled: boolean;
|
|
56
|
+
view: () => FieldSuggestionView;
|
|
57
|
+
/** The ready suggestion's value, also once accepted or overruled. */
|
|
58
|
+
value: () => T | undefined;
|
|
59
|
+
/** The suggestion's text while the field shows it in place of a value. */
|
|
60
|
+
placeholder: () => string | undefined;
|
|
61
|
+
/** The control's `aria-describedby` with the status line's description added. */
|
|
62
|
+
describe: (describedBy: string | undefined) => string | undefined;
|
|
63
|
+
/** The suggested position a switch names beside itself. */
|
|
64
|
+
inline: () => string | undefined;
|
|
65
|
+
/** The field's class with the suggestion marker and its state (open, unsure, loading) added. */
|
|
66
|
+
field: (className: string | undefined) => string | undefined;
|
|
67
|
+
/** The status line beside a visible label, for `Field`'s `labelEnd`. */
|
|
68
|
+
status: JSX.Element;
|
|
69
|
+
/** The control, followed by the status line when the field has no visible label. */
|
|
70
|
+
under: (control: JSX.Element) => JSX.Element;
|
|
71
|
+
};
|
|
72
|
+
type SuggestionOwner<T> = FieldSuggestionProps<T> & Pick<FieldProps, "label" | "aria-label" | "disabled" | "error"> & {
|
|
73
|
+
readOnly?: boolean;
|
|
74
|
+
/** Bounds a number or a date key must keep to be offered. */
|
|
75
|
+
min?: unknown;
|
|
76
|
+
max?: unknown;
|
|
77
|
+
onValueChange?: (value: T) => void;
|
|
78
|
+
onValueCommit?: (value: T) => void;
|
|
79
|
+
};
|
|
80
|
+
export type FieldSuggestionOptions<T> = {
|
|
81
|
+
/** The field's props; disabled, read-only, error, and the value callbacks come from here unless overridden. */
|
|
82
|
+
props: SuggestionOwner<T>;
|
|
83
|
+
/** `false` turns suggestions off for a mode that cannot show them. */
|
|
84
|
+
enabled?: boolean;
|
|
85
|
+
meta: FieldMeta;
|
|
86
|
+
value: () => T | null | undefined;
|
|
87
|
+
/** Whether the field counts as empty; defaults to `null`, `undefined`, or `""`. */
|
|
88
|
+
blank?: () => boolean;
|
|
89
|
+
same?: (left: T, right: T) => boolean;
|
|
90
|
+
/** How a value reads; strings read as they are, booleans as yes and no. */
|
|
91
|
+
format?: (value: T) => string;
|
|
92
|
+
/** Sets the value; defaults to the normal change and commit callbacks. `label` is how the suggestion named it. */
|
|
93
|
+
apply?: (value: T, label: string | undefined) => void;
|
|
94
|
+
/**
|
|
95
|
+
* Whether the field would take this value as it is (step, enabled option); otherwise it offers no Accept. Values
|
|
96
|
+
* outside the field's `min` and `max` are never offered.
|
|
97
|
+
*/
|
|
98
|
+
acceptable?: (value: T) => boolean;
|
|
99
|
+
/** The control does not speak its placeholder (a button or a switch), so the description names the value. */
|
|
100
|
+
spokenValue?: boolean;
|
|
101
|
+
};
|
|
102
|
+
export type CreateFieldSuggestion = <T>(options: FieldSuggestionOptions<T>) => FieldSuggestionControl<T>;
|
|
103
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import type { FieldSuggestion } from "./field-contract";
|
|
3
|
+
import type { FieldSuggestionView } from "./field-suggestion-types";
|
|
4
|
+
/** The one rule every field follows: a suggestion never replaces what someone entered. */
|
|
5
|
+
export declare function deriveSuggestionView<T>(suggestion: FieldSuggestion<T> | undefined, value: T | null | undefined, field: {
|
|
6
|
+
blank: boolean;
|
|
7
|
+
edited: boolean;
|
|
8
|
+
same: (left: T, right: T) => boolean;
|
|
9
|
+
}): FieldSuggestionView;
|
|
10
|
+
export type SuggestionGroupProps = {
|
|
11
|
+
/**
|
|
12
|
+
* The line above the fields, such as "Gustav read 8 fields from RE-4471.pdf", or what is still loading. Screen
|
|
13
|
+
* readers hear it when it changes. Defaults to "Suggestions from {source}".
|
|
14
|
+
*/
|
|
15
|
+
title?: JSX.Element;
|
|
16
|
+
/** Who proposes the values; fields without their own `source` use it. */
|
|
17
|
+
source?: string;
|
|
18
|
+
/** Called once with every open, certain suggestion of an enabled, valid field. Apply them as one form change. */
|
|
19
|
+
onAcceptAll: (ids: string[]) => void;
|
|
20
|
+
/** Shown while a field's suggestion failed. */
|
|
21
|
+
onRetryAll?: () => void;
|
|
22
|
+
class?: string;
|
|
23
|
+
children: JSX.Element;
|
|
24
|
+
};
|
|
25
|
+
/** Groups fields with suggestions under one line: counts and "Accept all" for the certain ones. */
|
|
26
|
+
export declare function SuggestionGroup(props: SuggestionGroupProps): JSX.Element;
|
|
@@ -38,7 +38,9 @@ export type { FileDropDetails, FileDropOptions, FileDropRejection, FileDropTarge
|
|
|
38
38
|
export { FileDropTarget, fileDropTarget } from "./FileDropTarget";
|
|
39
39
|
export type { FileDropzoneProps, ImageCropperProps, ImageInputProps } from "./FileInputs";
|
|
40
40
|
export { FileDropzone, ImageCropper, ImageInput } from "./FileInputs";
|
|
41
|
-
export type { DateContext, FieldProps, MaybeAccessor, ValueFieldProps } from "./field-contract";
|
|
41
|
+
export type { DateContext, FieldProps, FieldSuggestion, FieldSuggestionProps, MaybeAccessor, ValueFieldProps } from "./field-contract";
|
|
42
|
+
export type { SuggestionGroupProps } from "./field-suggestion";
|
|
43
|
+
export { SuggestionGroup } from "./field-suggestion";
|
|
42
44
|
export type { IconChoiceOption, IconChoicesProps } from "./IconChoices";
|
|
43
45
|
export { IconChoices } from "./IconChoices";
|
|
44
46
|
export { DEFAULT_ICON_GROUPS, DEFAULT_ICON_OPTIONS } from "./icon-options";
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
type Source = {
|
|
2
|
+
source?: string;
|
|
3
|
+
};
|
|
4
|
+
declare const suggestionMessages: import("@k2b/stdlib").Catalog<{
|
|
5
|
+
suggestion: string;
|
|
6
|
+
accept: string;
|
|
7
|
+
acceptFor: ({ label }: {
|
|
8
|
+
label?: string;
|
|
9
|
+
}) => string;
|
|
10
|
+
unsure: string;
|
|
11
|
+
acceptedFrom: ({ source }: Source) => string;
|
|
12
|
+
offered: ({ source, value }: Source & {
|
|
13
|
+
value: string;
|
|
14
|
+
}) => string;
|
|
15
|
+
loading: ({ source }: Source) => string;
|
|
16
|
+
failed: string;
|
|
17
|
+
retry: string;
|
|
18
|
+
yes: string;
|
|
19
|
+
no: string;
|
|
20
|
+
switchValue: ({ value }: {
|
|
21
|
+
value: string;
|
|
22
|
+
}) => string;
|
|
23
|
+
describeOpen: ({ source, value }: Source & {
|
|
24
|
+
value?: string;
|
|
25
|
+
}) => string;
|
|
26
|
+
describeOffered: ({ source, value }: Source & {
|
|
27
|
+
value: string;
|
|
28
|
+
}) => string;
|
|
29
|
+
describeAccepted: ({ source }: Source) => string;
|
|
30
|
+
describeLoading: ({ source }: Source) => string;
|
|
31
|
+
describeFailed: string;
|
|
32
|
+
describeUnsure: ({ reason }: {
|
|
33
|
+
reason?: string;
|
|
34
|
+
}) => string;
|
|
35
|
+
announceAccepted: ({ label, value }: {
|
|
36
|
+
label?: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}) => string;
|
|
39
|
+
announceOffered: ({ source, label, value, own }: Source & {
|
|
40
|
+
label?: string;
|
|
41
|
+
value: string;
|
|
42
|
+
own: string;
|
|
43
|
+
}) => string;
|
|
44
|
+
groupTitle: ({ source }: Source) => string;
|
|
45
|
+
countAccepted: ({ count }: {
|
|
46
|
+
count: number;
|
|
47
|
+
}) => string;
|
|
48
|
+
countOpen: ({ count }: {
|
|
49
|
+
count: number;
|
|
50
|
+
}) => string;
|
|
51
|
+
countUnsure: ({ count }: {
|
|
52
|
+
count: number;
|
|
53
|
+
}) => string;
|
|
54
|
+
acceptAll: ({ count }: {
|
|
55
|
+
count: number;
|
|
56
|
+
}) => string;
|
|
57
|
+
retryAll: string;
|
|
58
|
+
announceAcceptedAll: ({ count, unsure }: {
|
|
59
|
+
count: number;
|
|
60
|
+
unsure: readonly string[];
|
|
61
|
+
}) => string;
|
|
62
|
+
}>;
|
|
63
|
+
export type SuggestionMessages = ReturnType<(typeof suggestionMessages)["resolve"]>["t"];
|
|
64
|
+
/** Resolved from the inherited render locale. */
|
|
65
|
+
export declare const useSuggestionMessages: () => (() => SuggestionMessages);
|
|
66
|
+
export declare const checkSuggestionMessages: () => import("@k2b/stdlib").CatalogIssue[];
|
|
67
|
+
export {};
|
|
@@ -24,6 +24,8 @@ export type AppOverviewEmptyStateProps = {
|
|
|
24
24
|
};
|
|
25
25
|
export type AppOverviewCardsProps = {
|
|
26
26
|
class?: string;
|
|
27
|
+
/** `plain` is the closer grid for `LinkCard surface="plain"`; the cards' text lines up with the heading above. */
|
|
28
|
+
surface?: "paper" | "plain";
|
|
27
29
|
children: JSX.Element;
|
|
28
30
|
};
|
|
29
31
|
type AppOverviewComponent = ((props: AppOverviewProps) => JSX.Element) & {
|
|
@@ -53,18 +53,6 @@ export type DetailPanelGroupProps = {
|
|
|
53
53
|
title?: JSX.Element;
|
|
54
54
|
class?: string;
|
|
55
55
|
};
|
|
56
|
-
export type DetailPanelTone = "accent" | "neutral" | "success" | "warning" | "danger";
|
|
57
|
-
type DetailPanelSectionBaseProps = {
|
|
58
|
-
title: JSX.Element;
|
|
59
|
-
icon?: string;
|
|
60
|
-
tone?: DetailPanelTone;
|
|
61
|
-
description?: JSX.Element;
|
|
62
|
-
/** How many things the section lists, as a chip after the title; `0` reads "None yet". */
|
|
63
|
-
count?: number;
|
|
64
|
-
/** Short state after the title, such as "2 of 4 done". */
|
|
65
|
-
meta?: JSX.Element;
|
|
66
|
-
class?: string;
|
|
67
|
-
};
|
|
68
56
|
/** One direct secondary command, rendered as a sibling icon button at the end of the row. */
|
|
69
57
|
export type DetailPanelActionSecondary = {
|
|
70
58
|
/** Icon class, for example `ti ti-trash`. */
|
|
@@ -120,38 +108,17 @@ export type DetailPanelRowProps = {
|
|
|
120
108
|
trailing?: JSX.Element;
|
|
121
109
|
class?: string;
|
|
122
110
|
};
|
|
123
|
-
export type DetailPanelSectionProps = DetailPanelSectionBaseProps & ({
|
|
124
|
-
children?: JSX.Element;
|
|
125
|
-
actions?: JSX.Element;
|
|
126
|
-
collapsible?: false;
|
|
127
|
-
summary?: never;
|
|
128
|
-
defaultOpen?: never;
|
|
129
|
-
open?: never;
|
|
130
|
-
onOpenChange?: never;
|
|
131
|
-
disabled?: never;
|
|
132
|
-
} | {
|
|
133
|
-
children: JSX.Element;
|
|
134
|
-
actions?: never;
|
|
135
|
-
collapsible: true;
|
|
136
|
-
/** One line that says what the closed section holds, such as its newest entry; hidden while open. */
|
|
137
|
-
summary?: JSX.Element;
|
|
138
|
-
defaultOpen?: boolean;
|
|
139
|
-
open?: boolean;
|
|
140
|
-
onOpenChange?: (open: boolean) => void;
|
|
141
|
-
disabled?: boolean;
|
|
142
|
-
});
|
|
143
111
|
type DetailPanelComponent = ((props: DetailPanelProps) => JSX.Element) & {
|
|
144
112
|
Header: (props: DetailPanelHeaderProps) => JSX.Element;
|
|
145
113
|
Body: (props: DetailPanelBodyProps) => JSX.Element;
|
|
146
114
|
Summary: (props: DetailPanelSummaryProps) => JSX.Element;
|
|
147
115
|
Group: (props: DetailPanelGroupProps) => JSX.Element;
|
|
148
|
-
Section: (props: DetailPanelSectionProps) => JSX.Element;
|
|
149
116
|
Action: (props: DetailPanelActionProps) => JSX.Element;
|
|
150
117
|
Row: (props: DetailPanelRowProps) => JSX.Element;
|
|
151
118
|
};
|
|
152
|
-
/**
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
119
|
+
/**
|
|
120
|
+
* The panel for one selected object. Its topics are `Section`s; the panel frames them itself, so they stand flat
|
|
121
|
+
* inside it.
|
|
122
|
+
*/
|
|
156
123
|
declare const DetailPanel: DetailPanelComponent;
|
|
157
124
|
export default DetailPanel;
|