@ketvietlab/design-system 0.1.16 → 0.1.17

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.
Files changed (94) hide show
  1. package/README.md +29 -0
  2. package/dist/catalogue/catalogue.css +8 -0
  3. package/dist/catalogue/index.js +1 -1
  4. package/dist/catalogue/inventory-policy.json +21 -0
  5. package/dist/catalogue/inventory.generated.js +1 -1
  6. package/dist/catalogue/inventory.generated.js.map +1 -1
  7. package/dist/catalogue/inventory.generated.json +646 -84
  8. package/dist/catalogue/registry.d.ts.map +1 -1
  9. package/dist/catalogue/registry.js +6 -0
  10. package/dist/catalogue/registry.js.map +1 -1
  11. package/dist/catalogue/specimens.d.ts.map +1 -1
  12. package/dist/catalogue/specimens.js +113 -8
  13. package/dist/catalogue/specimens.js.map +1 -1
  14. package/dist/contract/index.d.ts.map +1 -1
  15. package/dist/contract/index.js +6 -0
  16. package/dist/contract/index.js.map +1 -1
  17. package/dist/data-display/bar-chart/index.d.ts +61 -0
  18. package/dist/data-display/bar-chart/index.d.ts.map +1 -0
  19. package/dist/data-display/bar-chart/index.js +64 -0
  20. package/dist/data-display/bar-chart/index.js.map +1 -0
  21. package/dist/data-display/bar-chart/styles.css +191 -0
  22. package/dist/data-display/matrix/index.d.ts +36 -0
  23. package/dist/data-display/matrix/index.d.ts.map +1 -0
  24. package/dist/data-display/matrix/index.js +28 -0
  25. package/dist/data-display/matrix/index.js.map +1 -0
  26. package/dist/data-display/matrix/styles.css +148 -0
  27. package/dist/data-operations/timeframe-filter/index.d.ts +34 -0
  28. package/dist/data-operations/timeframe-filter/index.d.ts.map +1 -0
  29. package/dist/data-operations/timeframe-filter/index.js +30 -0
  30. package/dist/data-operations/timeframe-filter/index.js.map +1 -0
  31. package/dist/data-operations/timeframe-filter/styles.css +109 -0
  32. package/dist/foundations/tokens.css +10 -0
  33. package/dist/index.d.ts +11 -3
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +4 -1
  36. package/dist/index.js.map +1 -1
  37. package/dist/interactions/menu/index.d.ts +17 -2
  38. package/dist/interactions/menu/index.d.ts.map +1 -1
  39. package/dist/interactions/menu/index.js +21 -5
  40. package/dist/interactions/menu/index.js.map +1 -1
  41. package/dist/interactions/menu/styles.css +36 -0
  42. package/dist/layouts/app-navigation/styles.css +8 -0
  43. package/dist/layouts/layout/index.d.ts +43 -3
  44. package/dist/layouts/layout/index.d.ts.map +1 -1
  45. package/dist/layouts/layout/index.js +28 -4
  46. package/dist/layouts/layout/index.js.map +1 -1
  47. package/dist/layouts/layout/styles.css +182 -4
  48. package/dist/layouts/page-identity/index.d.ts +19 -0
  49. package/dist/layouts/page-identity/index.d.ts.map +1 -0
  50. package/dist/layouts/page-identity/index.js +6 -0
  51. package/dist/layouts/page-identity/index.js.map +1 -0
  52. package/dist/layouts/shell/index.d.ts +7 -11
  53. package/dist/layouts/shell/index.d.ts.map +1 -1
  54. package/dist/layouts/shell/index.js +12 -2
  55. package/dist/layouts/shell/index.js.map +1 -1
  56. package/dist/layouts/shell/styles.css +16 -31
  57. package/dist/patterns/data-table/index.d.ts.map +1 -1
  58. package/dist/patterns/data-table/index.js +1 -1
  59. package/dist/patterns/data-table/index.js.map +1 -1
  60. package/dist/patterns/data-table/styles.css +124 -43
  61. package/dist/patterns/list-chrome/index.d.ts +2 -2
  62. package/dist/patterns/list-chrome/index.d.ts.map +1 -1
  63. package/dist/patterns/list-chrome/index.js +4 -3
  64. package/dist/patterns/list-chrome/index.js.map +1 -1
  65. package/dist/patterns/list-chrome/styles.css +122 -40
  66. package/dist/patterns/list-page/styles.css +5 -1
  67. package/dist/patterns/modal-sheet/styles.css +1 -1
  68. package/dist/patterns/page-shell/index.d.ts +2 -23
  69. package/dist/patterns/page-shell/index.d.ts.map +1 -1
  70. package/dist/patterns/page-shell/index.js +1 -10
  71. package/dist/patterns/page-shell/index.js.map +1 -1
  72. package/dist/patterns/page-shell/styles.css +131 -0
  73. package/dist/patterns/patterns.css +1 -0
  74. package/dist/primitives/feedback/index.d.ts.map +1 -1
  75. package/dist/primitives/feedback/index.js +1 -1
  76. package/dist/primitives/feedback/index.js.map +1 -1
  77. package/dist/primitives/feedback/styles.css +13 -11
  78. package/dist/primitives/navigation/index.d.ts +11 -5
  79. package/dist/primitives/navigation/index.d.ts.map +1 -1
  80. package/dist/primitives/navigation/index.js +17 -2
  81. package/dist/primitives/navigation/index.js.map +1 -1
  82. package/dist/primitives/navigation/styles.css +101 -13
  83. package/dist/primitives/status/index.d.ts.map +1 -1
  84. package/dist/primitives/status/index.js +2 -2
  85. package/dist/primitives/status/index.js.map +1 -1
  86. package/dist/primitives/status/styles.css +8 -8
  87. package/dist/record/display/index.js +1 -1
  88. package/dist/record/display/index.js.map +1 -1
  89. package/dist/record/display/styles.css +2 -2
  90. package/dist/runtime/index.d.ts.map +1 -1
  91. package/dist/runtime/index.js +99 -4
  92. package/dist/runtime/index.js.map +1 -1
  93. package/dist/styles.css +2 -50
  94. package/package.json +2 -2
@@ -0,0 +1,61 @@
1
+ import type { TemplateResult } from '@ketvietlab/ketjs-view';
2
+ export declare const HOOKS: readonly ['bar-chart', 'bar-chart-rows', 'bar-chart-row', 'bar-chart-label', 'bar-chart-caption', 'bar-chart-track', 'bar-chart-fill', 'bar-chart-segment', 'bar-chart-value', 'bar-chart-scale', 'bar-chart-legend', 'bar-chart-legend-item', 'bar-chart-legend-swatch', 'bar-chart-empty'];
3
+ /** How many categorical colours the stylesheet defines. Past this a legend stops being readable. */
4
+ export declare const CHART_SERIES = 6;
5
+ /** One part of a stacked bar. `series` is the 1-based palette slot its legend key also names. */
6
+ export type BarChartSegment = {
7
+ series: number;
8
+ value: number;
9
+ };
10
+ /** A named magnitude, drawn against the largest in its set or against `max`. */
11
+ export type BarChartBar = {
12
+ id: string;
13
+ label: string;
14
+ value: number;
15
+ caption?: string | null;
16
+ href?: string | null;
17
+ /** Parts of `value`, in legend order. Present on every bar when the chart is stacked. */
18
+ segments?: readonly BarChartSegment[];
19
+ };
20
+ export type BarChartKey = {
21
+ id: string;
22
+ label: string;
23
+ series: number;
24
+ };
25
+ export type BarChartProps = {
26
+ /** The accessible name of the list; the visible heading belongs to the surface around it. */
27
+ label: string;
28
+ bars: readonly BarChartBar[];
29
+ value: (bar: BarChartBar) => string;
30
+ /** A fixed top for the track, such as 100 for rates. Defaults to a round number above the largest bar. */
31
+ max?: number;
32
+ /** What each stacked segment colour means. Required for a stacked chart to be readable. */
33
+ keys?: readonly BarChartKey[];
34
+ /** The scale spelled out under the bars, when the caller wants one printed. */
35
+ scale?: readonly string[];
36
+ empty?: string;
37
+ };
38
+ /**
39
+ * A round number at or above `max`, for the top of a bar track.
40
+ *
41
+ * A track topped by the largest bar puts that bar against the frame and leaves
42
+ * the reader deciding whether it touches; 1, 2, 2.5 or 5 times a power of ten is
43
+ * the smallest ceiling that still reads as a number.
44
+ */
45
+ export declare const axisCeiling: (max: number) => number;
46
+ /**
47
+ * Magnitudes against one scale.
48
+ *
49
+ * HTML rather than a canvas or SVG, on purpose. Bars run horizontally because
50
+ * their labels are business names that need room, a row may link to the records
51
+ * behind it, and every number is real text — so the chart reads the same to a
52
+ * screen reader, a printed page and an agent comparing screens, with no script.
53
+ *
54
+ * Plain bars share one colour: they are one series, and a hue per row would
55
+ * read as a legend that does not exist.
56
+ *
57
+ * A bar with `segments` is stacked: the fill still spans the bar's total, and
58
+ * the segments divide it. `keys` names the segments once, above the rows.
59
+ */
60
+ export declare const BarChart: (props: BarChartProps) => TemplateResult;
61
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/design-system/src/data-display/bar-chart/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,eAAO,MAAM,KAAK,YAChB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,E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;AACH,eAAO,MAAM,QAAQ,UAAW,aAAa,KAAG,cAyE/C,CAAA"}
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@ketvietlab/ketjs-view/jsx-runtime";
2
+ import { each } from '@ketvietlab/ketjs-view';
3
+ export const HOOKS = [
4
+ 'bar-chart',
5
+ 'bar-chart-rows',
6
+ 'bar-chart-row',
7
+ 'bar-chart-label',
8
+ 'bar-chart-caption',
9
+ 'bar-chart-track',
10
+ 'bar-chart-fill',
11
+ 'bar-chart-segment',
12
+ 'bar-chart-value',
13
+ 'bar-chart-scale',
14
+ 'bar-chart-legend',
15
+ 'bar-chart-legend-item',
16
+ 'bar-chart-legend-swatch',
17
+ 'bar-chart-empty',
18
+ ];
19
+ /** How many categorical colours the stylesheet defines. Past this a legend stops being readable. */
20
+ export const CHART_SERIES = 6;
21
+ const finite = (value) => (Number.isFinite(value) ? value : 0);
22
+ const slotOf = (series) => String(((Math.max(1, Math.trunc(series)) - 1) % CHART_SERIES) + 1);
23
+ const percent = (value, of) => of <= 0 ? '0' : Math.min(100, (Math.abs(finite(value)) / of) * 100).toFixed(2);
24
+ /**
25
+ * A round number at or above `max`, for the top of a bar track.
26
+ *
27
+ * A track topped by the largest bar puts that bar against the frame and leaves
28
+ * the reader deciding whether it touches; 1, 2, 2.5 or 5 times a power of ten is
29
+ * the smallest ceiling that still reads as a number.
30
+ */
31
+ export const axisCeiling = (max) => {
32
+ const value = finite(max);
33
+ if (value <= 0)
34
+ return 0;
35
+ const magnitude = 10 ** Math.floor(Math.log10(value));
36
+ for (const step of [1, 2, 2.5, 5, 10])
37
+ if (value <= step * magnitude)
38
+ return step * magnitude;
39
+ return 10 * magnitude;
40
+ };
41
+ /**
42
+ * Magnitudes against one scale.
43
+ *
44
+ * HTML rather than a canvas or SVG, on purpose. Bars run horizontally because
45
+ * their labels are business names that need room, a row may link to the records
46
+ * behind it, and every number is real text — so the chart reads the same to a
47
+ * screen reader, a printed page and an agent comparing screens, with no script.
48
+ *
49
+ * Plain bars share one colour: they are one series, and a hue per row would
50
+ * read as a legend that does not exist.
51
+ *
52
+ * A bar with `segments` is stacked: the fill still spans the bar's total, and
53
+ * the segments divide it. `keys` names the segments once, above the rows.
54
+ */
55
+ export const BarChart = (props) => {
56
+ const bars = props.bars.filter((bar) => finite(bar.value) !== 0);
57
+ if (!bars.length)
58
+ return _jsx("p", { "data-ui": "bar-chart-empty", children: props.empty ?? '' });
59
+ const largest = Math.max(...bars.map((bar) => Math.abs(finite(bar.value))), 0);
60
+ const ceiling = props.max !== undefined && props.max > 0 ? props.max : axisCeiling(largest);
61
+ const stacked = bars.some((bar) => bar.segments?.length);
62
+ return (_jsxs("div", { "data-ui": "bar-chart", "data-stacked": stacked ? 'true' : null, children: [!!props.keys?.length && (_jsx("ul", { "data-ui": "bar-chart-legend", children: each(props.keys, (key) => key.id, (key) => (_jsxs("li", { "data-ui": "bar-chart-legend-item", "data-series": slotOf(key.series), children: [_jsx("span", { "data-ui": "bar-chart-legend-swatch", "aria-hidden": "true" }), key.label] }))) })), _jsx("ul", { "data-ui": "bar-chart-rows", "aria-label": props.label, children: each(bars, (bar) => bar.id, (bar) => (_jsxs("li", { "data-ui": "bar-chart-row", children: [_jsxs("span", { "data-ui": "bar-chart-label", children: [bar.href ? _jsx("a", { href: bar.href, children: bar.label }) : bar.label, !!bar.caption && _jsx("small", { "data-ui": "bar-chart-caption", children: bar.caption })] }), _jsx("span", { "data-ui": "bar-chart-track", "aria-hidden": "true", children: bar.segments?.length ? (_jsx("span", { "data-ui": "bar-chart-fill", style: `inline-size: ${percent(bar.value, ceiling)}%`, children: each(bar.segments, (segment) => String(segment.series), (segment) => (_jsx("span", { "data-ui": "bar-chart-segment", "data-series": slotOf(segment.series), style: `inline-size: ${percent(segment.value, Math.abs(finite(bar.value)))}%` }))) })) : (_jsx("span", { "data-ui": "bar-chart-fill", "data-series": props.keys?.length ? slotOf(props.keys[0].series) : '1', style: `inline-size: ${percent(bar.value, ceiling)}%` })) }), _jsx("span", { "data-ui": "bar-chart-value", children: props.value(bar) })] }))) }), !!props.scale?.length && (_jsx("div", { "data-ui": "bar-chart-scale", "aria-hidden": "true", children: each(props.scale, (tick, at) => `${tick}:${at}`, (tick) => (_jsx("span", { children: tick }))) }))] }));
63
+ };
64
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/design-system/src/data-display/bar-chart/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAG7C,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,WAAW;IACX,gBAAgB;IAChB,eAAe;IACf,iBAAiB;IACjB,mBAAmB;IACnB,iBAAiB;IACjB,gBAAgB;IAChB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;IAClB,uBAAuB;IACvB,yBAAyB;IACzB,iBAAiB;CACT,CAAA;AAEV,oGAAoG;AACpG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAA;AAgC7B,MAAM,MAAM,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAE9E,MAAM,MAAM,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAA;AAE7G,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAU,EAAU,EAAE,CACpD,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC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
2
+ `data-series` slot, so a scheme change re-reads colour instead of baking it. */
3
+
4
+ @layer ket.app {
5
+ :where([data-kv-design-system]) [data-ui="bar-chart"] {
6
+ display: grid;
7
+ min-width: 0;
8
+ gap: var(--kv-space-3);
9
+ }
10
+
11
+ :where([data-kv-design-system]) [data-ui="bar-chart-rows"] {
12
+ display: grid;
13
+ min-width: 0;
14
+ gap: var(--kv-space-3);
15
+ margin: 0;
16
+ padding: 0;
17
+ list-style: none;
18
+ }
19
+
20
+ :where([data-kv-design-system]) [data-ui="bar-chart-row"] {
21
+ display: grid;
22
+ grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr) auto;
23
+ align-items: center;
24
+ gap: var(--kv-space-3);
25
+ font-size: var(--kv-text-sm);
26
+ }
27
+
28
+ :where([data-kv-design-system]) [data-ui="bar-chart-label"] {
29
+ display: grid;
30
+ min-width: 0;
31
+ color: var(--kv-color-ink-secondary);
32
+ overflow-wrap: anywhere;
33
+ }
34
+
35
+ :where([data-kv-design-system]) [data-ui="bar-chart-label"] a {
36
+ color: inherit;
37
+ text-decoration: none;
38
+ }
39
+
40
+ :where([data-kv-design-system]) [data-ui="bar-chart-label"] a:hover {
41
+ color: var(--kv-color-accent);
42
+ text-decoration: underline;
43
+ }
44
+
45
+ :where([data-kv-design-system]) [data-ui="bar-chart-caption"] {
46
+ color: var(--kv-color-ink-muted);
47
+ font-size: var(--kv-text-xs);
48
+ }
49
+
50
+ :where([data-kv-design-system]) [data-ui="bar-chart-track"] {
51
+ display: block;
52
+ block-size: 0.625rem;
53
+ overflow: hidden;
54
+ border-radius: var(--kv-radius-full);
55
+ background: var(--kv-chart-track);
56
+ }
57
+
58
+ :where([data-kv-design-system]) [data-ui="bar-chart-fill"] {
59
+ display: flex;
60
+ block-size: 100%;
61
+ min-inline-size: 2px;
62
+ overflow: hidden;
63
+ border-radius: inherit;
64
+ }
65
+
66
+ :where([data-kv-design-system]) [data-ui="bar-chart-segment"] {
67
+ display: block;
68
+ block-size: 100%;
69
+ }
70
+
71
+ :where([data-kv-design-system]) [data-ui="bar-chart-value"] {
72
+ color: var(--kv-color-ink);
73
+ font-variant-numeric: tabular-nums;
74
+ text-align: end;
75
+ white-space: nowrap;
76
+ }
77
+
78
+ :where([data-kv-design-system]) [data-ui="bar-chart-scale"] {
79
+ display: flex;
80
+ justify-content: space-between;
81
+ color: var(--kv-color-ink-muted);
82
+ font-size: var(--kv-text-xs);
83
+ font-variant-numeric: tabular-nums;
84
+ }
85
+
86
+ :where([data-kv-design-system]) [data-ui="bar-chart-legend"] {
87
+ display: flex;
88
+ flex-wrap: wrap;
89
+ gap: var(--kv-space-2) var(--kv-space-4);
90
+ margin: 0;
91
+ padding: 0;
92
+ color: var(--kv-color-ink-secondary);
93
+ font-size: var(--kv-text-sm);
94
+ list-style: none;
95
+ }
96
+
97
+ :where([data-kv-design-system]) [data-ui="bar-chart-legend-item"] {
98
+ display: inline-flex;
99
+ align-items: center;
100
+ gap: var(--kv-space-2);
101
+ }
102
+
103
+ :where([data-kv-design-system]) [data-ui="bar-chart-legend-swatch"] {
104
+ inline-size: 0.5rem;
105
+ block-size: 0.5rem;
106
+ border-radius: var(--kv-radius-xs);
107
+ }
108
+
109
+ :where([data-kv-design-system]) [data-ui="bar-chart-empty"] {
110
+ margin: 0;
111
+ color: var(--kv-color-ink-muted);
112
+ font-size: var(--kv-text-sm);
113
+ }
114
+
115
+ :where([data-kv-design-system])
116
+ :is(
117
+ [data-ui="bar-chart-fill"],
118
+ [data-ui="bar-chart-segment"],
119
+ [data-ui="bar-chart-legend-item"]
120
+ )[data-series="1"] {
121
+ --kv-chart-mark: var(--kv-chart-1);
122
+ }
123
+ :where([data-kv-design-system])
124
+ :is(
125
+ [data-ui="bar-chart-fill"],
126
+ [data-ui="bar-chart-segment"],
127
+ [data-ui="bar-chart-legend-item"]
128
+ )[data-series="2"] {
129
+ --kv-chart-mark: var(--kv-chart-2);
130
+ }
131
+ :where([data-kv-design-system])
132
+ :is(
133
+ [data-ui="bar-chart-fill"],
134
+ [data-ui="bar-chart-segment"],
135
+ [data-ui="bar-chart-legend-item"]
136
+ )[data-series="3"] {
137
+ --kv-chart-mark: var(--kv-chart-3);
138
+ }
139
+ :where([data-kv-design-system])
140
+ :is(
141
+ [data-ui="bar-chart-fill"],
142
+ [data-ui="bar-chart-segment"],
143
+ [data-ui="bar-chart-legend-item"]
144
+ )[data-series="4"] {
145
+ --kv-chart-mark: var(--kv-chart-4);
146
+ }
147
+ :where([data-kv-design-system])
148
+ :is(
149
+ [data-ui="bar-chart-fill"],
150
+ [data-ui="bar-chart-segment"],
151
+ [data-ui="bar-chart-legend-item"]
152
+ )[data-series="5"] {
153
+ --kv-chart-mark: var(--kv-chart-5);
154
+ }
155
+ :where([data-kv-design-system])
156
+ :is(
157
+ [data-ui="bar-chart-fill"],
158
+ [data-ui="bar-chart-segment"],
159
+ [data-ui="bar-chart-legend-item"]
160
+ )[data-series="6"] {
161
+ --kv-chart-mark: var(--kv-chart-6);
162
+ }
163
+
164
+ :where([data-kv-design-system]) :is([data-ui="bar-chart-fill"][data-series], [data-ui="bar-chart-segment"]),
165
+ :where([data-kv-design-system]) [data-ui="bar-chart-legend-swatch"] {
166
+ background: var(--kv-chart-mark, var(--kv-chart-1));
167
+ }
168
+
169
+ @media (max-width: 48rem) {
170
+ :where([data-kv-design-system]) [data-ui="bar-chart-row"] {
171
+ grid-template-columns: minmax(0, 1fr) auto;
172
+ }
173
+
174
+ /* Label and value share the first line; the track runs full width under them. */
175
+ :where([data-kv-design-system]) [data-ui="bar-chart-label"] {
176
+ grid-row: 1;
177
+ grid-column: 1;
178
+ }
179
+
180
+ :where([data-kv-design-system]) [data-ui="bar-chart-value"] {
181
+ grid-row: 1;
182
+ grid-column: 2;
183
+ align-self: start;
184
+ }
185
+
186
+ :where([data-kv-design-system]) [data-ui="bar-chart-track"] {
187
+ grid-row: 2;
188
+ grid-column: 1 / -1;
189
+ }
190
+ }
191
+ }
@@ -0,0 +1,36 @@
1
+ import type { JSXChild, TemplateResult } from '@ketvietlab/ketjs-view';
2
+ export declare const HOOKS: readonly ['data-matrix', 'data-matrix-head', 'data-matrix-heading', 'data-matrix-eyebrow', 'data-matrix-title', 'data-matrix-description', 'data-matrix-summary', 'data-matrix-scroll', 'data-matrix-table', 'data-matrix-column', 'data-matrix-row-head', 'data-matrix-row-leading', 'data-matrix-row-title', 'data-matrix-row-description', 'data-matrix-row-status', 'data-matrix-row-actions', 'data-matrix-cell'];
3
+ export type DataMatrixColumn = {
4
+ id: string;
5
+ label: string;
6
+ description?: string | null;
7
+ };
8
+ export type DataMatrixRow = {
9
+ id: string;
10
+ label: string;
11
+ description?: string | null;
12
+ leading?: JSXChild;
13
+ status?: JSXChild;
14
+ actions?: JSXChild;
15
+ cells: Readonly<Record<string, JSXChild>>;
16
+ };
17
+ export type DataMatrixProps = {
18
+ label: string;
19
+ /** Localised heading for the row identity column, for example “Checkpoint”. */
20
+ rowLabel: string;
21
+ columns: readonly DataMatrixColumn[];
22
+ rows: readonly DataMatrixRow[];
23
+ eyebrow?: string | null;
24
+ title?: string | null;
25
+ description?: string | null;
26
+ summary?: JSXChild;
27
+ /** Controls only the scrollable table's readable floor, never the viewport. */
28
+ width?: 'default' | 'wide';
29
+ };
30
+ /**
31
+ * Compare the same dimensions across ordered records or checkpoints.
32
+ * Applications own cell content and workflow actions; the matrix owns table
33
+ * semantics, sticky row identity, horizontal containment and responsive chrome.
34
+ */
35
+ export declare const DataMatrix: (props: DataMatrixProps) => TemplateResult;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/design-system/src/data-display/matrix/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEtE,eAAO,MAAM,KAAK,YAChB,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB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as _jsx, jsxs as _jsxs } from "@ketvietlab/ketjs-view/jsx-runtime";
2
+ import { each } from '@ketvietlab/ketjs-view';
3
+ export const HOOKS = [
4
+ 'data-matrix',
5
+ 'data-matrix-head',
6
+ 'data-matrix-heading',
7
+ 'data-matrix-eyebrow',
8
+ 'data-matrix-title',
9
+ 'data-matrix-description',
10
+ 'data-matrix-summary',
11
+ 'data-matrix-scroll',
12
+ 'data-matrix-table',
13
+ 'data-matrix-column',
14
+ 'data-matrix-row-head',
15
+ 'data-matrix-row-leading',
16
+ 'data-matrix-row-title',
17
+ 'data-matrix-row-description',
18
+ 'data-matrix-row-status',
19
+ 'data-matrix-row-actions',
20
+ 'data-matrix-cell',
21
+ ];
22
+ /**
23
+ * Compare the same dimensions across ordered records or checkpoints.
24
+ * Applications own cell content and workflow actions; the matrix owns table
25
+ * semantics, sticky row identity, horizontal containment and responsive chrome.
26
+ */
27
+ export const DataMatrix = (props) => (_jsxs("section", { "data-ui": "data-matrix", "aria-label": props.label, "data-width": props.width ?? 'default', children: [(props.title || props.description || props.summary !== undefined) && (_jsxs("header", { "data-ui": "data-matrix-head", children: [_jsxs("div", { "data-ui": "data-matrix-heading", children: [!!props.eyebrow && _jsx("span", { "data-ui": "data-matrix-eyebrow", children: props.eyebrow }), !!props.title && _jsx("h2", { "data-ui": "data-matrix-title", children: props.title }), !!props.description && _jsx("p", { "data-ui": "data-matrix-description", children: props.description })] }), props.summary !== undefined && _jsx("div", { "data-ui": "data-matrix-summary", children: props.summary })] })), _jsx("div", { "data-ui": "data-matrix-scroll", role: "region", tabIndex: "0", "aria-label": props.label, children: _jsxs("table", { "data-ui": "data-matrix-table", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", "data-ui": "data-matrix-row-head", children: props.rowLabel }), each(props.columns, (column) => column.id, (column) => (_jsxs("th", { scope: "col", "data-ui": "data-matrix-column", children: [_jsx("strong", { children: column.label }), !!column.description && _jsx("small", { children: column.description })] })))] }) }), _jsx("tbody", { children: each(props.rows, (row) => row.id, (row) => (_jsxs("tr", { children: [_jsxs("th", { scope: "row", "data-ui": "data-matrix-row-head", children: [_jsxs("div", { "data-ui": "data-matrix-row-title", children: [row.leading !== undefined && (_jsx("span", { "data-ui": "data-matrix-row-leading", children: row.leading })), _jsx("strong", { children: row.label }), row.status !== undefined && _jsx("span", { "data-ui": "data-matrix-row-status", children: row.status })] }), !!row.description && (_jsx("small", { "data-ui": "data-matrix-row-description", children: row.description })), row.actions !== undefined && _jsx("div", { "data-ui": "data-matrix-row-actions", children: row.actions })] }), each(props.columns, (column) => column.id, (column) => (_jsx("td", { "data-ui": "data-matrix-cell", children: row.cells[column.id] })))] }))) })] }) })] }));
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/design-system/src/data-display/matrix/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAG7C,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,aAAa;IACb,kBAAkB;IAClB,qBAAqB;IACrB,qBAAqB;IACrB,mBAAmB;IACnB,yBAAyB;IACzB,qBAAqB;IACrB,oBAAoB;IACpB,mBAAmB;IACnB,oBAAoB;IACpB,sBAAsB;IACtB,yBAAyB;IACzB,uBAAuB;IACvB,6BAA6B;IAC7B,wBAAwB;IACxB,yBAAyB;IACzB,kBAAkB;CACV,CAAA;AAgCV;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAkB,EAAE,CAAC,CACpE,8BAAiB,aAAa,gBAAa,KAAK,CAAC,KAAK,gBAAc,KAAK,CAAC,KAAK,IAAI,SAAS,aACzF,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,IAAI,CACpE,6BAAgB,kBAAkB,aAChC,0BAAa,qBAAqB,aAC/B,CAAC,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AM,KAAK,SAAS,IAAI,0BAAc,wBAAwB,YAAE,GAAG,CAAC,MAAM,GAAQ,IACnF,EACL,CAAC,CAAC,GAAG,CAAC,WAAW,IAAI,CACpB,2BAAe,6BAA6B,YAAE,GAAG,CAAC,WAAW,GAAS,CACvE,EACA,GAAG,CAAC,OAAO,KAAK,SAAS,IAAI,yBAAa,yBAAyB,YAAE,GAAG,CAAC,OAAO,GAAO,IACrF,EACJ,IAAI,CACH,KAAK,CAAC,OAAO,EACb,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,EACrB,CAAC,MAAM,EAAE,EAAE,CAAC,CACV,wBAAY,kBAAkB,YAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,GAAM,CAC3D,CACF,IACE,CACN,CACF,GACK,IACF,GACJ,IACE,CACX,CAAA"}
@@ -0,0 +1,148 @@
1
+ @layer ket.app {
2
+ :where([data-kv-design-system]) [data-ui="data-matrix"] {
3
+ min-width: 0;
4
+ overflow: hidden;
5
+ border: 1px solid var(--kv-panel-border);
6
+ border-radius: var(--kv-radius-md);
7
+ background: var(--kv-panel-bg);
8
+ }
9
+
10
+ :where([data-kv-design-system]) [data-ui="data-matrix-head"] {
11
+ display: flex;
12
+ min-width: 0;
13
+ align-items: center;
14
+ justify-content: space-between;
15
+ gap: var(--kv-space-4);
16
+ padding: var(--kv-space-3) var(--kv-space-4);
17
+ border-bottom: 1px solid var(--kv-panel-border);
18
+ background: var(--kv-panel-bg-subtle);
19
+ }
20
+
21
+ :where([data-kv-design-system]) [data-ui="data-matrix-heading"] {
22
+ display: grid;
23
+ min-width: 0;
24
+ gap: var(--kv-space-0-5);
25
+ }
26
+
27
+ :where([data-kv-design-system]) [data-ui="data-matrix-eyebrow"] {
28
+ color: var(--kv-text-muted);
29
+ font-size: var(--kv-text-2xs);
30
+ font-weight: var(--kv-weight-bold);
31
+ text-transform: uppercase;
32
+ }
33
+
34
+ :where([data-kv-design-system]) [data-ui="data-matrix-title"] {
35
+ margin: 0;
36
+ overflow-wrap: anywhere;
37
+ font-size: var(--kv-text-base);
38
+ }
39
+
40
+ :where([data-kv-design-system]) [data-ui="data-matrix-description"] {
41
+ margin: 0;
42
+ color: var(--kv-text-muted);
43
+ font-size: var(--kv-text-xs);
44
+ }
45
+
46
+ :where([data-kv-design-system]) [data-ui="data-matrix-summary"] {
47
+ flex: none;
48
+ }
49
+
50
+ :where([data-kv-design-system]) [data-ui="data-matrix-scroll"] {
51
+ max-width: 100%;
52
+ overflow: auto;
53
+ }
54
+
55
+ :where([data-kv-design-system]) [data-ui="data-matrix-scroll"]:focus-visible {
56
+ outline: 2px solid var(--kv-accent);
57
+ outline-offset: -2px;
58
+ }
59
+
60
+ :where([data-kv-design-system]) [data-ui="data-matrix-table"] {
61
+ width: 100%;
62
+ min-width: 42rem;
63
+ table-layout: fixed;
64
+ border-collapse: collapse;
65
+ }
66
+
67
+ :where([data-kv-design-system]) [data-ui="data-matrix"][data-width="wide"] [data-ui="data-matrix-table"] {
68
+ min-width: 54rem;
69
+ }
70
+
71
+ :where([data-kv-design-system]) [data-ui="data-matrix-table"] :is(th, td) {
72
+ padding: var(--kv-space-3);
73
+ border-right: 1px solid var(--kv-panel-border);
74
+ border-bottom: 1px solid var(--kv-panel-border);
75
+ vertical-align: top;
76
+ text-align: left;
77
+ }
78
+
79
+ :where([data-kv-design-system]) [data-ui="data-matrix-table"] :is(th, td):last-child {
80
+ border-right: 0;
81
+ }
82
+
83
+ :where([data-kv-design-system]) [data-ui="data-matrix-table"] tbody tr:last-child > * {
84
+ border-bottom: 0;
85
+ }
86
+
87
+ :where([data-kv-design-system]) [data-ui="data-matrix-table"] thead th {
88
+ background: var(--kv-panel-bg-subtle);
89
+ }
90
+
91
+ :where([data-kv-design-system]) [data-ui="data-matrix-column"] :is(strong, small),
92
+ :where([data-kv-design-system]) [data-ui="data-matrix-row-description"] {
93
+ display: block;
94
+ }
95
+
96
+ :where([data-kv-design-system]) [data-ui="data-matrix-column"] small,
97
+ :where([data-kv-design-system]) [data-ui="data-matrix-row-description"] {
98
+ margin-top: var(--kv-space-0-5);
99
+ color: var(--kv-text-muted);
100
+ font-size: var(--kv-text-xs);
101
+ font-weight: 400;
102
+ }
103
+
104
+ :where([data-kv-design-system]) [data-ui="data-matrix-row-head"] {
105
+ width: 28%;
106
+ background: var(--kv-panel-bg);
107
+ }
108
+
109
+ :where([data-kv-design-system]) tbody [data-ui="data-matrix-row-head"] {
110
+ position: sticky;
111
+ z-index: 1;
112
+ left: 0;
113
+ }
114
+
115
+ :where([data-kv-design-system]) [data-ui="data-matrix-row-title"] {
116
+ display: flex;
117
+ min-width: 0;
118
+ align-items: center;
119
+ flex-wrap: wrap;
120
+ gap: var(--kv-space-2);
121
+ }
122
+
123
+ :where([data-kv-design-system]) [data-ui="data-matrix-row-leading"] {
124
+ color: var(--kv-accent);
125
+ }
126
+
127
+ :where([data-kv-design-system]) [data-ui="data-matrix-row-status"] {
128
+ margin-left: auto;
129
+ }
130
+
131
+ :where([data-kv-design-system]) [data-ui="data-matrix-row-actions"] {
132
+ display: flex;
133
+ flex-wrap: wrap;
134
+ gap: var(--kv-space-2);
135
+ margin-top: var(--kv-space-3);
136
+ }
137
+
138
+ :where([data-kv-design-system]) [data-ui="data-matrix-cell"] {
139
+ min-height: 8rem;
140
+ }
141
+
142
+ @media (max-width: 42rem) {
143
+ :where([data-kv-design-system]) [data-ui="data-matrix-head"] {
144
+ align-items: flex-start;
145
+ flex-direction: column;
146
+ }
147
+ }
148
+ }
@@ -0,0 +1,34 @@
1
+ import type { TemplateResult } from '@ketvietlab/ketjs-view';
2
+ export declare const HOOKS: readonly ['timeframe', 'timeframe-menu', 'timeframe-trigger', 'timeframe-label', 'timeframe-value', 'timeframe-content', 'timeframe-option', 'timeframe-option-label', 'timeframe-option-detail', 'timeframe-range', 'timeframe-asof', 'timeframe-note'];
3
+ export type TimeframeOption = {
4
+ id: string;
5
+ label: string;
6
+ href: string;
7
+ active?: boolean;
8
+ /** Shown under the option, e.g. the dates the preset resolves to. */
9
+ detail?: string | null;
10
+ };
11
+ export type TimeframeFilterProps = {
12
+ id: string;
13
+ /** What is being filtered, e.g. "Reporting period". Also the group's label. */
14
+ label: string;
15
+ options: readonly TimeframeOption[];
16
+ /** The range the active option resolves to, e.g. "2026-08-06 → 2026-09-05". */
17
+ range?: string | null;
18
+ /** When the figures were computed, and the words for it. */
19
+ asOf?: string | null;
20
+ asOfLabel?: string | null;
21
+ /** Trailing note, e.g. the timezone the range is expressed in. */
22
+ note?: string | null;
23
+ };
24
+ /**
25
+ * The period a screen is reporting on.
26
+ *
27
+ * A filter, not navigation: tabs mean sibling views, and a row of periods read
28
+ * as tabs looks like five screens rather than one screen under five constraints.
29
+ * Every option is a link, so the choice survives a copied URL and needs no
30
+ * script. The resolved range and the build time sit beside the choice, because
31
+ * a period label alone does not say what a number covers.
32
+ */
33
+ export declare const TimeframeFilter: (props: TimeframeFilterProps) => TemplateResult;
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/design-system/src/data-operations/timeframe-filter/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,eAAO,MAAM,KAAK,YAChB,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,CACR,CAAA;AAEV,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,SAAS,eAAe,EAAE,CAAA;IACnC,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,UAAW,oBAAoB,KAAG,cAoC7D,CAAA"}
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@ketvietlab/ketjs-view/jsx-runtime";
2
+ import { each } from '@ketvietlab/ketjs-view';
3
+ export const HOOKS = [
4
+ 'timeframe',
5
+ 'timeframe-menu',
6
+ 'timeframe-trigger',
7
+ 'timeframe-label',
8
+ 'timeframe-value',
9
+ 'timeframe-content',
10
+ 'timeframe-option',
11
+ 'timeframe-option-label',
12
+ 'timeframe-option-detail',
13
+ 'timeframe-range',
14
+ 'timeframe-asof',
15
+ 'timeframe-note',
16
+ ];
17
+ /**
18
+ * The period a screen is reporting on.
19
+ *
20
+ * A filter, not navigation: tabs mean sibling views, and a row of periods read
21
+ * as tabs looks like five screens rather than one screen under five constraints.
22
+ * Every option is a link, so the choice survives a copied URL and needs no
23
+ * script. The resolved range and the build time sit beside the choice, because
24
+ * a period label alone does not say what a number covers.
25
+ */
26
+ export const TimeframeFilter = (props) => {
27
+ const active = props.options.find((option) => option.active) ?? props.options[0];
28
+ return (_jsxs("div", { "data-ui": "timeframe", role: "group", "aria-label": props.label, children: [_jsxs("details", { "data-ui": "timeframe-menu", children: [_jsxs("summary", { "data-ui": "timeframe-trigger", "aria-label": props.label, title: props.label, children: [_jsx("span", { "data-ui": "timeframe-label", children: props.label }), _jsx("span", { "data-ui": "timeframe-value", children: active?.label ?? '' })] }), _jsx("div", { "data-ui": "timeframe-content", id: `${props.id}-options`, children: each(props.options, (option) => option.id, (option) => (_jsxs("a", { "data-ui": "timeframe-option", "data-active": String(option.active === true), "aria-current": option.active === true ? 'true' : null, href: option.href, children: [_jsx("span", { "data-ui": "timeframe-option-label", children: option.label }), !!option.detail && _jsx("small", { "data-ui": "timeframe-option-detail", children: option.detail })] }))) })] }), !!props.range && _jsx("span", { "data-ui": "timeframe-range", children: props.range }), !!props.asOf && (_jsx("span", { "data-ui": "timeframe-asof", children: props.asOfLabel ? `${props.asOfLabel} ${props.asOf}` : props.asOf })), !!props.note && _jsx("span", { "data-ui": "timeframe-note", children: props.note })] }));
29
+ };
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/design-system/src/data-operations/timeframe-filter/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAG7C,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,kBAAkB;IAClB,wBAAwB;IACxB,yBAAyB;IACzB,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;CACR,CAAA;AAyBV;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAkB,EAAE;IAC7E,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAChF,OAAO,CACL,0BAAa,WAAW,EAAC,IAAI,EAAC,OAAO,gBAAa,KAAK,CAAC,KAAK,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