react-ecosphere 0.0.0-stage → 1.1.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.
Files changed (151) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/LICENSE +21 -0
  3. package/README.md +126 -2
  4. package/dist/components/actions/EcoButton.d.ts +34 -0
  5. package/dist/components/actions/EcoIconButton.d.ts +43 -0
  6. package/dist/components/actions/EcoLink.d.ts +20 -0
  7. package/dist/components/actions/EcoSplitButton.d.ts +28 -0
  8. package/dist/components/actions/index.d.ts +8 -0
  9. package/dist/components/charts/ChartFrame.d.ts +33 -0
  10. package/dist/components/charts/EcoAreaChart.d.ts +38 -0
  11. package/dist/components/charts/EcoBarChart.d.ts +65 -0
  12. package/dist/components/charts/EcoBarList.d.ts +33 -0
  13. package/dist/components/charts/EcoChartTooltip.d.ts +28 -0
  14. package/dist/components/charts/EcoDivergingBarChart.d.ts +33 -0
  15. package/dist/components/charts/EcoDonutChart.d.ts +27 -0
  16. package/dist/components/charts/EcoLineChart.d.ts +35 -0
  17. package/dist/components/charts/EcoPieChart.d.ts +26 -0
  18. package/dist/components/charts/EcoRadarChart.d.ts +31 -0
  19. package/dist/components/charts/EcoStepLineChart.d.ts +31 -0
  20. package/dist/components/charts/index.d.ts +21 -0
  21. package/dist/components/charts/types.d.ts +99 -0
  22. package/dist/components/charts/useChart.d.ts +19 -0
  23. package/dist/components/charts/utils.d.ts +113 -0
  24. package/dist/components/data/EcoChecklist.d.ts +16 -0
  25. package/dist/components/data/EcoDataTable.d.ts +98 -0
  26. package/dist/components/data/EcoFindings.d.ts +15 -0
  27. package/dist/components/data/EcoKpi.d.ts +26 -0
  28. package/dist/components/data/EcoLeaderRow.d.ts +28 -0
  29. package/dist/components/data/EcoListRow.d.ts +51 -0
  30. package/dist/components/data/EcoListRows.d.ts +6 -0
  31. package/dist/components/data/EcoQuestionItem.d.ts +25 -0
  32. package/dist/components/data/EcoRowGroup.d.ts +29 -0
  33. package/dist/components/data/EcoRowItem.d.ts +31 -0
  34. package/dist/components/data/EcoSourceRow.d.ts +21 -0
  35. package/dist/components/data/EcoStat.d.ts +22 -0
  36. package/dist/components/data/EcoTable.d.ts +97 -0
  37. package/dist/components/data/EcoTaskRow.d.ts +37 -0
  38. package/dist/components/data/EcoTaskRows.d.ts +7 -0
  39. package/dist/components/data/EcoTimeline.d.ts +23 -0
  40. package/dist/components/data/EcoTreeTable.d.ts +43 -0
  41. package/dist/components/data/EcoTreeView.d.ts +46 -0
  42. package/dist/components/data/EcoTreeViewNode.d.ts +14 -0
  43. package/dist/components/data/EcoValueChange.d.ts +18 -0
  44. package/dist/components/data/index.d.ts +39 -0
  45. package/dist/components/data/treeContext.d.ts +17 -0
  46. package/dist/components/data/types.d.ts +175 -0
  47. package/dist/components/display/EcoAvatar.d.ts +19 -0
  48. package/dist/components/display/EcoBadge.d.ts +20 -0
  49. package/dist/components/display/EcoEmptyState.d.ts +28 -0
  50. package/dist/components/display/EcoKeyValue.d.ts +24 -0
  51. package/dist/components/display/EcoMeter.d.ts +21 -0
  52. package/dist/components/display/EcoPlaceholder.d.ts +19 -0
  53. package/dist/components/display/EcoPlanCard.d.ts +32 -0
  54. package/dist/components/display/EcoScore.d.ts +14 -0
  55. package/dist/components/display/EcoSkeleton.d.ts +32 -0
  56. package/dist/components/display/EcoTag.d.ts +8 -0
  57. package/dist/components/display/EcoTags.d.ts +9 -0
  58. package/dist/components/display/index.d.ts +23 -0
  59. package/dist/components/display/types.d.ts +17 -0
  60. package/dist/components/feedback/EcoComposeModal.d.ts +80 -0
  61. package/dist/components/feedback/EcoConfirmHost.d.ts +9 -0
  62. package/dist/components/feedback/EcoDialog.d.ts +58 -0
  63. package/dist/components/feedback/EcoDrawer.d.ts +41 -0
  64. package/dist/components/feedback/EcoMenu.d.ts +76 -0
  65. package/dist/components/feedback/EcoNotice.d.ts +38 -0
  66. package/dist/components/feedback/EcoNotifications.d.ts +52 -0
  67. package/dist/components/feedback/EcoSpinner.d.ts +29 -0
  68. package/dist/components/feedback/EcoToast.d.ts +35 -0
  69. package/dist/components/feedback/EcoToaster.d.ts +9 -0
  70. package/dist/components/feedback/EcoTooltip.d.ts +26 -0
  71. package/dist/components/feedback/index.d.ts +25 -0
  72. package/dist/components/feedback/types.d.ts +94 -0
  73. package/dist/components/feedback/useConfirm.d.ts +43 -0
  74. package/dist/components/feedback/useToast.d.ts +38 -0
  75. package/dist/components/forms/EcoCheckbox.d.ts +28 -0
  76. package/dist/components/forms/EcoCheckboxGroup.d.ts +27 -0
  77. package/dist/components/forms/EcoChoicePills.d.ts +27 -0
  78. package/dist/components/forms/EcoComposer.d.ts +45 -0
  79. package/dist/components/forms/EcoCycleSelect.d.ts +24 -0
  80. package/dist/components/forms/EcoDatePicker.d.ts +42 -0
  81. package/dist/components/forms/EcoEmailField.d.ts +13 -0
  82. package/dist/components/forms/EcoField.d.ts +34 -0
  83. package/dist/components/forms/EcoFieldGrid.d.ts +9 -0
  84. package/dist/components/forms/EcoFileUpload.d.ts +48 -0
  85. package/dist/components/forms/EcoNumberField.d.ts +27 -0
  86. package/dist/components/forms/EcoOtpField.d.ts +37 -0
  87. package/dist/components/forms/EcoPhoneField.d.ts +38 -0
  88. package/dist/components/forms/EcoSearchField.d.ts +36 -0
  89. package/dist/components/forms/EcoSegmented.d.ts +23 -0
  90. package/dist/components/forms/EcoSelect.d.ts +82 -0
  91. package/dist/components/forms/EcoSelectButton.d.ts +43 -0
  92. package/dist/components/forms/EcoSwitch.d.ts +34 -0
  93. package/dist/components/forms/EcoTextField.d.ts +32 -0
  94. package/dist/components/forms/EcoTextarea.d.ts +20 -0
  95. package/dist/components/forms/EcoTimePicker.d.ts +39 -0
  96. package/dist/components/forms/index.d.ts +43 -0
  97. package/dist/components/forms/types.d.ts +47 -0
  98. package/dist/components/general/EcoAuroraBackground.d.ts +13 -0
  99. package/dist/components/general/EcoIcon.d.ts +13 -0
  100. package/dist/components/general/index.d.ts +4 -0
  101. package/dist/components/index.d.ts +9 -0
  102. package/dist/components/layout/EcoAppShell.d.ts +46 -0
  103. package/dist/components/layout/EcoCard.d.ts +29 -0
  104. package/dist/components/layout/EcoDivider.d.ts +18 -0
  105. package/dist/components/layout/EcoHero.d.ts +40 -0
  106. package/dist/components/layout/EcoHeroPanelRow.d.ts +18 -0
  107. package/dist/components/layout/EcoMasthead.d.ts +31 -0
  108. package/dist/components/layout/EcoNavItem.d.ts +40 -0
  109. package/dist/components/layout/EcoNavSection.d.ts +11 -0
  110. package/dist/components/layout/EcoPageGrid.d.ts +13 -0
  111. package/dist/components/layout/EcoPageHeader.d.ts +20 -0
  112. package/dist/components/layout/EcoSection.d.ts +17 -0
  113. package/dist/components/layout/EcoThread.d.ts +66 -0
  114. package/dist/components/layout/EcoTimetable.d.ts +32 -0
  115. package/dist/components/layout/index.d.ts +27 -0
  116. package/dist/components/layout/types.d.ts +81 -0
  117. package/dist/components/navigation/EcoDisclosure.d.ts +29 -0
  118. package/dist/components/navigation/EcoDisclosureGroup.d.ts +14 -0
  119. package/dist/components/navigation/EcoFilterChips.d.ts +23 -0
  120. package/dist/components/navigation/EcoPagination.d.ts +40 -0
  121. package/dist/components/navigation/EcoProgressSteps.d.ts +24 -0
  122. package/dist/components/navigation/EcoTabs.d.ts +33 -0
  123. package/dist/components/navigation/disclosure.d.ts +9 -0
  124. package/dist/components/navigation/index.d.ts +13 -0
  125. package/dist/components/navigation/types.d.ts +66 -0
  126. package/dist/ecosphere.css +5789 -0
  127. package/dist/fonts/GoogleSans.woff2 +0 -0
  128. package/dist/fonts/fraunces-latin-ext-opsz-normal.woff2 +0 -0
  129. package/dist/fonts/fraunces-latin-opsz-normal.woff2 +0 -0
  130. package/dist/fonts/fraunces-vietnamese-opsz-normal.woff2 +0 -0
  131. package/dist/fonts/remixicon.woff2 +0 -0
  132. package/dist/hooks/index.d.ts +1 -0
  133. package/dist/hooks/useEcoId.d.ts +6 -0
  134. package/dist/index.d.ts +3 -0
  135. package/dist/internal/Portal.d.ts +8 -0
  136. package/dist/internal/attrs.d.ts +5 -0
  137. package/dist/internal/cx.d.ts +4 -0
  138. package/dist/internal/data-slot.d.ts +16 -0
  139. package/dist/internal/feedback-node.d.ts +8 -0
  140. package/dist/internal/feedback-value.d.ts +10 -0
  141. package/dist/internal/forms-hooks.d.ts +14 -0
  142. package/dist/internal/forms-popover.d.ts +11 -0
  143. package/dist/internal/layout-watch.d.ts +6 -0
  144. package/dist/internal/overlay.d.ts +28 -0
  145. package/dist/internal/useControllableState.d.ts +8 -0
  146. package/dist/internal/useIsClient.d.ts +5 -0
  147. package/dist/react-ecosphere.cjs +1 -0
  148. package/dist/react-ecosphere.js +8710 -0
  149. package/dist/tokens.json +690 -0
  150. package/dist/types.d.ts +15 -0
  151. package/package.json +66 -5
@@ -0,0 +1,31 @@
1
+ import { ChartFrameSlots } from './ChartFrame';
2
+ import { ChartFormat, RadarSeries } from './types';
3
+ export interface EcoRadarChartProps extends ChartFrameSlots {
4
+ /** Five to seven measure names, clockwise from twelve o'clock. */
5
+ axes: string[];
6
+ /** One or two shapes. */
7
+ series: RadarSeries[];
8
+ /** The shared scale's top (default 100). */
9
+ max?: number;
10
+ /** viewBox size; the web's radius is half of it less 38. */
11
+ size?: number;
12
+ /** Rings on the web. */
13
+ rings?: number;
14
+ /** Legend figure per series. Default: the mean score, rounded. */
15
+ legendValue?: (s: RadarSeries) => string;
16
+ valueFormat?: ChartFormat;
17
+ title?: string;
18
+ subtitle?: string;
19
+ caption?: string;
20
+ ariaLabel?: string;
21
+ legend?: boolean;
22
+ emptyTitle?: string;
23
+ emptyText?: string;
24
+ }
25
+ /**
26
+ * RadarChart — a profile across five to seven measures on one shared scale: a web of four rings
27
+ * and a spoke per axis, each series a 2px outline over a 14% wash in its slot. At most two series;
28
+ * every axis must point the same way (higher is better). It answers "what is this profile",
29
+ * never "which measure is largest" — for ranking, use a bar chart. Keep the axis order fixed.
30
+ */
31
+ export declare function EcoRadarChart({ axes, series, max, size, rings, legendValue, valueFormat, title, subtitle, caption, ariaLabel, legend, emptyTitle, emptyText, ...frame }: EcoRadarChartProps): import('react').JSX.Element;
@@ -0,0 +1,31 @@
1
+ import { ChartFrameSlots } from './ChartFrame';
2
+ import { ChartFormat, ChartTooltipData, StepPoint } from './types';
3
+ export interface EcoStepLineChartProps extends ChartFrameSlots {
4
+ points: StepPoint[];
5
+ /** Unit after the value: "per unit". */
6
+ unit?: string;
7
+ /** Axis unit at the top left: "USD per unit". */
8
+ axisLabel?: string;
9
+ /** Axis title at the bottom left. Default: "Effective date" or "Version". */
10
+ xTitle?: string;
11
+ valueFormat?: ChartFormat;
12
+ height?: number;
13
+ width?: number;
14
+ title?: string;
15
+ subtitle?: string;
16
+ caption?: string;
17
+ ariaLabel?: string;
18
+ emptyTitle?: string;
19
+ emptyText?: string;
20
+ tooltip?: (index: number) => ChartTooltipData;
21
+ /** The change under the pointer or focus, or `null` when none. */
22
+ onActiveChange?: (index: number | null) => void;
23
+ }
24
+ /**
25
+ * StepLineChart — a value that holds until it changes (a price, a rate, a tier), drawn step-after:
26
+ * flat while it applies, a vertical where it changed, a hollow marker with its value at each change.
27
+ * Placed by effective date when every point has a `date` (x proportional to time), otherwise evenly
28
+ * by version. The y axis does not start at zero; it is padded by 40% of the range, never less than
29
+ * 8% of the highest value. Labels thin to the width; every value stays in the tooltip.
30
+ */
31
+ export declare function EcoStepLineChart({ points, unit, axisLabel, xTitle, valueFormat, height, width, title, subtitle, caption, ariaLabel, emptyTitle, emptyText, tooltip, onActiveChange, ...frame }: EcoStepLineChartProps): import('react').JSX.Element;
@@ -0,0 +1,21 @@
1
+ export { EcoChartTooltip } from './EcoChartTooltip';
2
+ export type { EcoChartTooltipProps } from './EcoChartTooltip';
3
+ export { EcoBarChart } from './EcoBarChart';
4
+ export type { EcoBarChartProps } from './EcoBarChart';
5
+ export { EcoLineChart } from './EcoLineChart';
6
+ export type { EcoLineChartProps } from './EcoLineChart';
7
+ export { EcoAreaChart } from './EcoAreaChart';
8
+ export type { EcoAreaChartProps } from './EcoAreaChart';
9
+ export { EcoStepLineChart } from './EcoStepLineChart';
10
+ export type { EcoStepLineChartProps } from './EcoStepLineChart';
11
+ export { EcoDivergingBarChart } from './EcoDivergingBarChart';
12
+ export type { EcoDivergingBarChartProps } from './EcoDivergingBarChart';
13
+ export { EcoBarList } from './EcoBarList';
14
+ export type { EcoBarListProps } from './EcoBarList';
15
+ export { EcoPieChart } from './EcoPieChart';
16
+ export type { EcoPieChartProps } from './EcoPieChart';
17
+ export { EcoDonutChart } from './EcoDonutChart';
18
+ export type { EcoDonutChartProps } from './EcoDonutChart';
19
+ export { EcoRadarChart } from './EcoRadarChart';
20
+ export type { EcoRadarChartProps } from './EcoRadarChart';
21
+ export type * from './types';
@@ -0,0 +1,99 @@
1
+ /** Types for the chart components (BarChart, LineChart, AreaChart, PieChart, ChartTooltip…). */
2
+ /**
3
+ * A series slot: `1`…`6` map to `s1`…`s6` (`--cat-1`…`--cat-6`, in fixed order),
4
+ * `"rest"` to `s-rest` (`--p1`, the context colour beside one emphasised mark).
5
+ */
6
+ export type ChartSlot = 1 | 2 | 3 | 4 | 5 | 6 | "rest";
7
+ /** Formats a number for display: a cap label, a tick, a tooltip figure. */
8
+ export type ChartFormat = (value: number) => string;
9
+ /** One named series of values, one value per label. `null` is a gap, never a zero. */
10
+ export interface ChartSeries {
11
+ name: string;
12
+ values: (number | null)[];
13
+ /** Slot override. Defaults to the series' position (`s1`, `s2`…). */
14
+ slot?: ChartSlot;
15
+ }
16
+ /** One row of a `ChartTooltip` card. Without `slot` it is a plain figure, such as a change. */
17
+ export interface ChartTooltipRow {
18
+ label: string;
19
+ value: string;
20
+ slot?: ChartSlot;
21
+ /** The key the chart itself uses: a swatch for bars and areas, a line key for lines. */
22
+ key?: "sw" | "key";
23
+ }
24
+ /** Everything one `ChartTooltip` card shows. */
25
+ export interface ChartTooltipData {
26
+ /** The period: "October 2026", "Version 3". */
27
+ title: string;
28
+ /** Headline figure. Leave out when the rows do not add up to one amount. */
29
+ total?: string;
30
+ /** Unit after the total: "total", "per unit". */
31
+ unit?: string;
32
+ rows?: ChartTooltipRow[];
33
+ /** One line of context: "Held until 1 July 2024". */
34
+ note?: string;
35
+ }
36
+ /** Where the mark sits, in px relative to `chart__fig`: its centre, half its width, its data end. */
37
+ export interface ChartAnchor {
38
+ x: number;
39
+ y: number;
40
+ /** Half the mark's width, so the card clears the bar (default 0). */
41
+ half?: number;
42
+ }
43
+ /** BarChart forms; each answers a different question. */
44
+ export type BarChartForm = "columns" | "ghost" | "stacked" | "horizontal" | "emphasis";
45
+ /** One slice of a pie or donut. */
46
+ export interface ChartSlice {
47
+ label: string;
48
+ value: number;
49
+ slot?: ChartSlot;
50
+ }
51
+ /** One shape on a radar: a value per axis on the shared scale. */
52
+ export interface RadarSeries {
53
+ name: string;
54
+ values: number[];
55
+ slot?: ChartSlot;
56
+ }
57
+ /** One change on a step line: an effective date or a version, and the value from then on. */
58
+ export interface StepPoint {
59
+ /** Short axis label. Defaults to the formatted date ("Mar 2021") or is the version ("v1"). */
60
+ label?: string;
61
+ /** Effective date. When every point has one, x is proportional to time. */
62
+ date?: Date | string;
63
+ value: number;
64
+ /** Long title for the tooltip and the hit label: "From 1 March 2021", "Version 1". */
65
+ title?: string;
66
+ }
67
+ /** One period of a diverging chart. Both amounts are positive numbers. */
68
+ export interface DivergingDatum {
69
+ /** Month label on the first axis line ("May"). */
70
+ label: string;
71
+ over: number;
72
+ under: number;
73
+ /** Year, printed on the second axis line where it changes. */
74
+ year?: string | number;
75
+ /** Long title for the tooltip and the hit label ("May 2025"). */
76
+ title?: string;
77
+ }
78
+ /** One ranked row of a BarList. */
79
+ export interface BarListItem {
80
+ name: string;
81
+ /** One line of metadata: "412 products · 18,240 orders". */
82
+ detail?: string;
83
+ value: number;
84
+ /** Formatted value; defaults to `valueFormat(value)`. */
85
+ display?: string;
86
+ /** Share of the whole, as text ("38.2%") or a 0–100 number. Computed from `total` when omitted. */
87
+ share?: string | number;
88
+ /** Makes the name a link. */
89
+ href?: string;
90
+ }
91
+ /** One entry of a chart legend. */
92
+ export interface ChartLegendItem {
93
+ label: string;
94
+ /** Slot class (`s1`, `s-rest`…) or none. */
95
+ cls?: string;
96
+ n?: string;
97
+ key?: "sw" | "key";
98
+ style?: string;
99
+ }
@@ -0,0 +1,19 @@
1
+ import { useEffect, CSSProperties, KeyboardEvent as ReactKeyboardEvent, RefObject } from 'react';
2
+ /** `useLayoutEffect` in the browser (place before paint, as Vue's `nextTick` does), `useEffect` on the server. */
3
+ export declare const useIsoLayoutEffect: typeof useEffect;
4
+ /**
5
+ * Width of the frame in px, or `fallback` until measured (SSR, tests) or when `fixed` is set.
6
+ * As in vue-ecosphere, the observer is attached once, on mount, to the figure present then.
7
+ */
8
+ export declare function useChartWidth(fig: RefObject<HTMLElement | null>, fallback: number, fixed: number | undefined): number;
9
+ /** Which point is open (hovered or focused), with the handlers each hit area binds. */
10
+ export declare function useChartHover(onChange?: (i: number | null) => void): {
11
+ active: number | null;
12
+ open: (i: number) => void;
13
+ close: () => void;
14
+ onKeyDown: (e: ReactKeyboardEvent) => void;
15
+ };
16
+ /** Scale from viewBox units to px: the figure's rendered width over the layout width (1 until laid out). */
17
+ export declare function figScale(fig: RefObject<HTMLElement | null>, W: number): number;
18
+ /** A CSS declaration string ("color:var(--text-primary)") as a React style object. */
19
+ export declare function styleObject(css: string | undefined): CSSProperties | undefined;
@@ -0,0 +1,113 @@
1
+ import { ChartAnchor, ChartSlot } from './types';
2
+ /** One decimal, as the artifact writes its coordinates. */
3
+ export declare const r1: (n: number) => string;
4
+ /** Two decimals (arc endpoints). */
5
+ export declare const r2: (n: number) => string;
6
+ export declare const MINUS = "\u2212";
7
+ /** Slot → class: `1` → `s1`, `"rest"` → `s-rest`. */
8
+ export declare function slotClass(slot: ChartSlot | undefined, index?: number): string;
9
+ /** Plain number, grouped: 18240 → "18,240". */
10
+ export declare const defaultFormat: (v: number) => string;
11
+ /** Signed with a true minus: +6, −3, 0. */
12
+ export declare function signed(v: number, fmt?: (n: number) => string): string;
13
+ /** A change and its per cent: "+6 (+16%)", "−$0.50 (−4.1%)". */
14
+ export declare function changeText(value: number, prev: number, fmt?: (n: number) => string, pctDigits?: number): string;
15
+ /** The smallest "nice" step (1, 2, 2.5 or 5 × 10ⁿ) at or above `raw`. */
16
+ export declare function niceStep(raw: number): number;
17
+ /**
18
+ * Ticks from zero to a nice ceiling over `max`, about `steps` steps.
19
+ * niceTicks(71) → { step: 20, max: 80, ticks: [0, 20, 40, 60, 80] }.
20
+ */
21
+ export declare function niceTicks(max: number, steps?: number): {
22
+ step: number;
23
+ max: number;
24
+ ticks: number[];
25
+ };
26
+ /** A shared signed scale over `-lo … hi` with one nice step for about `steps` steps overall. */
27
+ export declare function niceSpan(hi: number, lo: number, steps?: number): {
28
+ step: number;
29
+ top: number;
30
+ bottom: number;
31
+ };
32
+ /** A bar is 60% of its band and at most `max` units wide (64 in BarChart, 26 in DivergingBarChart). */
33
+ export declare function barWidth(band: number, max?: number, ratio?: number): number;
34
+ /** Evenly divided bands: start, width and centre of each. */
35
+ export declare function bands(n: number, x0: number, x1: number): {
36
+ band: number;
37
+ starts: number[];
38
+ centres: number[];
39
+ };
40
+ /** Label every ⌈minGap ÷ band⌉-th period, counted back from the latest so it always shows. */
41
+ export declare function thinEvery(band: number, minGap?: number): number;
42
+ /** Indices that keep a label when every `every`-th is labelled, counted back from the last. */
43
+ export declare function labelledIndices(n: number, every: number): Set<number>;
44
+ /**
45
+ * Distance thinning (StepLineChart): keep the first and last; keep a middle label only when it is
46
+ * at least `gap` from the last kept label and from the last point.
47
+ */
48
+ export declare function thinByDistance(xs: number[], gap: number): Set<number>;
49
+ /** A column from `base` up to `top`, 3px radius on the top corners only. */
50
+ export declare function columnPath(x: number, w: number, base: number, top: number, radius?: number): string;
51
+ /** A bar from `start` down to `end` (below zero), rounded at the bottom only. */
52
+ export declare function columnDownPath(x: number, w: number, start: number, end: number, radius?: number): string;
53
+ /** A square stacked segment (every segment but the top one). */
54
+ export declare function segmentPath(x: number, w: number, top: number, h: number): string;
55
+ /** A horizontal bar from `x0` to `x1`, rounded on the right end only. */
56
+ export declare function hbarPath(x0: number, x1: number, y: number, h: number, radius?: number): string;
57
+ export interface Pt {
58
+ x: number;
59
+ y: number;
60
+ }
61
+ /**
62
+ * The smoothed curve the system's cards draw: a Catmull–Rom spline written as cubic Béziers,
63
+ * control points a sixth of the neighbour span away, end tangents clamped.
64
+ */
65
+ export declare function smoothPath(pts: Pt[]): string;
66
+ /** Step-after: `M x0,y0 H x1 V y1 H x2 V y2 …`. */
67
+ export declare function stepPath(pts: Pt[]): string;
68
+ /** "x,y x,y …" for polyline / polygon. */
69
+ export declare const pointsAttr: (pts: Pt[]) => string;
70
+ /** A point at `deg` degrees clockwise from twelve o'clock. */
71
+ export declare function polar(cx: number, cy: number, r: number, deg: number): Pt;
72
+ /** Start and end angle (degrees, clockwise from twelve) of each slice. They sum to 360. */
73
+ export declare function sliceAngles(values: number[]): {
74
+ start: number;
75
+ end: number;
76
+ }[];
77
+ /** A pie wedge. A full circle is drawn as two half arcs. */
78
+ export declare function piePath(cx: number, cy: number, r: number, start: number, end: number): string;
79
+ /** A ring segment between radius `ri` and `ro`. */
80
+ export declare function donutPath(cx: number, cy: number, ro: number, ri: number, start: number, end: number): string;
81
+ /**
82
+ * ChartTooltip placement: 8px right of the mark, else 8px left; clamp to the frame;
83
+ * centre vertically on the mark's data end, clamped. Returns px relative to `chart__fig`.
84
+ */
85
+ export declare function placeTooltip(anchor: ChartAnchor, frame: {
86
+ width: number;
87
+ height: number;
88
+ }, card: {
89
+ width: number;
90
+ height: number;
91
+ }): {
92
+ left: number;
93
+ top: number;
94
+ };
95
+ /** Approximate width of a label in px (for padding the y-axis to its longest tick). */
96
+ export declare const textWidth: (s: string, px?: number) => number;
97
+ export interface PreparedSlice {
98
+ label: string;
99
+ value: number;
100
+ cls: string;
101
+ pct: number;
102
+ start: number;
103
+ end: number;
104
+ }
105
+ /**
106
+ * Pie and donut slices: largest first (unless `sort` is false), at most six — the tail is grouped
107
+ * into "Other" — each in its slot, with its share and its angles clockwise from twelve o'clock.
108
+ */
109
+ export declare function prepareSlices(data: {
110
+ label: string;
111
+ value: number;
112
+ slot?: ChartSlot;
113
+ }[], sort?: boolean, otherLabel?: string): PreparedSlice[];
@@ -0,0 +1,16 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { EcoBreakdownPart, EcoChecklistStep } from './types';
3
+ export interface EcoChecklistProps extends HTMLAttributes<HTMLDivElement> {
4
+ /** One step per criterion or prerequisite. */
5
+ steps?: EcoChecklistStep[];
6
+ /** The breakdown under a total. */
7
+ parts?: EcoBreakdownPart[];
8
+ /** Further rows after the steps and parts. */
9
+ children?: ReactNode;
10
+ }
11
+ /**
12
+ * Checklist — two thin rows that carry an audit trail: `step` for what was satisfied
13
+ * (a tick disc when met, a cross under `step--miss` when not — never colour alone), and
14
+ * `bp` for how a total was reached: a named part, its arithmetic and its contribution.
15
+ */
16
+ export declare function EcoChecklist({ steps, parts, children, className, ...rest }: EcoChecklistProps): import('react').JSX.Element;
@@ -0,0 +1,98 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { EcoTableCellScope, EcoTableExpandedScope, EcoTableHeadScope } from './EcoTable';
3
+ import { EcoRowExpandable, EcoRowKey, EcoRowToggleLabel, EcoTableColumn, EcoTableRow, EcoTableSort } from './types';
4
+ /** Scope of `renderActions`: the selected keys and a function that clears them. */
5
+ export interface EcoDataTableActionsScope {
6
+ selected: EcoRowKey[];
7
+ clear: () => void;
8
+ }
9
+ export interface EcoDataTableProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "children"> {
10
+ title?: string;
11
+ /** Total shown beside the title ("1,284"). */
12
+ count?: string | number;
13
+ /** Accessible name of the frame (defaults to `title`). */
14
+ label?: string;
15
+ columns?: EcoTableColumn[];
16
+ rows?: EcoTableRow[];
17
+ rowKey?: string | ((row: EcoTableRow) => EcoRowKey);
18
+ /** Visually hidden caption (defaults to `title`). */
19
+ caption?: string;
20
+ compact?: boolean;
21
+ sticky?: boolean;
22
+ nowrap?: boolean;
23
+ pinFirst?: boolean;
24
+ pinLast?: boolean;
25
+ rowHeader?: boolean;
26
+ selectable?: boolean;
27
+ manualSort?: boolean;
28
+ loading?: boolean;
29
+ /** Scroll area height, e.g. "330px" (the stylesheet default is 420px). */
30
+ maxHeight?: string;
31
+ rowLabel?: (row: EcoTableRow) => string;
32
+ /** Message for a failed load; shows a notice with Retry instead of the table. */
33
+ error?: string;
34
+ errorTitle?: string;
35
+ clearLabel?: string;
36
+ /**
37
+ * Rows that open a detail row (`renderExpanded`) under them: `true` for every row, or a
38
+ * function picking them. Adds a toggle column after the selection column.
39
+ */
40
+ expandable?: EcoRowExpandable;
41
+ /** Name of a closed row's toggle: a prefix before `rowLabel(row)` ("Show details for"), or a function of the row. */
42
+ expandLabel?: EcoRowToggleLabel;
43
+ /** Name of an open row's toggle: a prefix before `rowLabel(row)` ("Hide details for"), or a function of the row. */
44
+ collapseLabel?: EcoRowToggleLabel;
45
+ /** Visually hidden header of the toggle column (default "Details"). */
46
+ expandColumnLabel?: string;
47
+ /** Selected row keys (controlled; v-model:selected). */
48
+ selected?: EcoRowKey[];
49
+ defaultSelected?: EcoRowKey[];
50
+ onSelectedChange?: (selected: EcoRowKey[]) => void;
51
+ /** The sort (controlled; v-model:sort). `null` is unsorted. */
52
+ sort?: EcoTableSort | null;
53
+ defaultSort?: EcoTableSort | null;
54
+ onSortChange?: (sort: EcoTableSort | null) => void;
55
+ /** Keys of the rows whose detail row is open (controlled; v-model:expanded). */
56
+ expanded?: EcoRowKey[];
57
+ defaultExpanded?: EcoRowKey[];
58
+ onExpandedChange?: (expanded: EcoRowKey[]) => void;
59
+ /** Retry was pressed in the error notice. */
60
+ onRetry?: () => void;
61
+ /** A row's detail row opened. */
62
+ onExpand?: (row: EcoTableRow) => void;
63
+ /** A row's detail row closed. */
64
+ onCollapse?: (row: EcoTableRow) => void;
65
+ /** Toolbar end, beside the title (`#tools`). */
66
+ tools?: ReactNode;
67
+ /** Search and filter bar (`dtable__bar`, `#bar`). */
68
+ bar?: ReactNode;
69
+ /** Pager (`dtable__foot`, `#footer`). */
70
+ footer?: ReactNode;
71
+ /** Bulk actions in the selection bar (`#actions`). One filled button; a destructive one names the count. */
72
+ renderActions?: (scope: EcoDataTableActionsScope) => ReactNode;
73
+ /** Replaces the error notice's Retry button (`#error-actions`). */
74
+ errorActions?: ReactNode;
75
+ /** EmptyState markup in the frame when there are no rows (`#empty`). */
76
+ empty?: ReactNode;
77
+ /** Cell content per column key (`#cell-<key>`), passed to the table. */
78
+ renderCell?: Record<string, (scope: EcoTableCellScope) => ReactNode>;
79
+ /** Header content per column key (`#head-<key>`), passed to the table. */
80
+ renderHead?: Record<string, (scope: EcoTableHeadScope) => ReactNode>;
81
+ /** Content of an open row's detail row (`#expanded`). */
82
+ renderExpanded?: (scope: EcoTableExpandedScope) => ReactNode;
83
+ /** Frame any other table (e.g. `EcoTreeTable`) in `dtable__scroll` instead. */
84
+ children?: ReactNode;
85
+ }
86
+ /**
87
+ * DataTable — the table with its working parts in one frame: a title and count with tools,
88
+ * a bar for search and filter chips, the scrolling table, and a footer for the pager. When
89
+ * rows are checked, the same top bar switches to `is-sel`: it says how many are selected,
90
+ * shows the bulk actions (`renderActions`) and "Clear selection" — one row of controls in two
91
+ * states, never a second bar. Keep one filled button there; a destructive action names the
92
+ * count ("Delete 2 requests"). Loading keeps the header with skeleton rows; no rows shows
93
+ * `empty` inside the frame; a failed load shows a notice with Retry, never an empty table.
94
+ * An `expandable` row opens its `renderExpanded` detail in a full-width row under it; keep that
95
+ * for a row's secondary facts, and nest rows with `EcoTreeTable` instead.
96
+ * Put any other table (e.g. `EcoTreeTable`) in `children` to frame it instead.
97
+ */
98
+ export declare function EcoDataTable({ title, count, label, columns, rows, rowKey, caption, compact, sticky, nowrap, pinFirst, pinLast, rowHeader, selectable, manualSort, loading, maxHeight, rowLabel, error, errorTitle, clearLabel, expandable, expandLabel, collapseLabel, expandColumnLabel, selected: selectedProp, defaultSelected, onSelectedChange, sort: sortProp, defaultSort, onSortChange, expanded: expandedProp, defaultExpanded, onExpandedChange, onRetry, onExpand, onCollapse, tools, bar, footer, renderActions, errorActions, empty, renderCell, renderHead, renderExpanded, children, className, ...rest }: EcoDataTableProps): import('react').JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { EcoFinding } from './types';
3
+ export interface EcoFindingsProps extends Omit<HTMLAttributes<HTMLUListElement>, "children"> {
4
+ items: EcoFinding[];
5
+ /** Accessible name of the list (omit when a visible heading labels it via `aria-labelledby`). */
6
+ label?: string;
7
+ compact?: boolean;
8
+ }
9
+ /**
10
+ * Findings — a short list of observations set beside a chart or a summary figure: a toned
11
+ * icon, one plain statement and an optional link to the rows behind it. Each tone has its own
12
+ * icon shape and `sr` word, so it never rests on colour alone. Order problems first; keep it
13
+ * to five or fewer. `compact` drops the discs for use inside a card or under a KPI figure.
14
+ */
15
+ export declare function EcoFindings({ items, label, compact, className, ...rest }: EcoFindingsProps): import('react').JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { IconName } from '../../types';
3
+ export interface EcoKpiProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
4
+ label: string;
5
+ icon?: IconName;
6
+ /** Formatted value ("$4.82M"); the tile does not abbreviate. */
7
+ value?: string | number;
8
+ /** Delta words, e.g. "Up 6.1%" or "Unchanged". */
9
+ delta?: string;
10
+ trend?: "up" | "down" | "flat";
11
+ /** What the delta is measured against, e.g. "vs April". */
12
+ vs?: string;
13
+ judgement?: "good" | "bad";
14
+ /** Helper text at the foot of the tile. */
15
+ hint?: string;
16
+ loading?: boolean;
17
+ /** Make the label a heading of this level. */
18
+ level?: 2 | 3 | 4;
19
+ }
20
+ /**
21
+ * Kpi — one headline figure on its own card (`card kpi`); lay several out in a `kpis` grid.
22
+ * The delta is an arrow and a word ("Up 6.1%") with what it is measured against; it is
23
+ * neutral unless the direction is a judgement (`judgement="good" | "bad"`). With nothing to
24
+ * compare, leave the delta out and say why in the helper. `loading` keeps label and icon.
25
+ */
26
+ export declare function EcoKpi({ label, icon, value, delta, trend, vs, judgement, hint, loading, level, className, ...rest }: EcoKpiProps): import('react').JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { HTMLAttributes, MouseEvent, ReactNode } from 'react';
2
+ import { EcoDataBadge } from './types';
3
+ export interface EcoLeaderRowProps extends Omit<HTMLAttributes<HTMLElement>, "children" | "onClick"> {
4
+ name: string;
5
+ /** Why this row is in this list ("Grade 9-B · 98.4% attendance"). One line; it truncates. */
6
+ hint?: string;
7
+ initials?: string;
8
+ /** Replaces the initials avatar (`#avatar`). */
9
+ avatar?: ReactNode;
10
+ rank?: number | string;
11
+ /** First place: the numeral takes `--accent`. */
12
+ top?: boolean;
13
+ status?: EcoDataBadge;
14
+ /** Replaces the status badge (`#badge`). */
15
+ badge?: ReactNode;
16
+ /** Render as a `<button class="lbrl lbr">`. */
17
+ selectable?: boolean;
18
+ selected?: boolean;
19
+ /** The selectable row was clicked. */
20
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
21
+ }
22
+ /**
23
+ * LeaderRow — the compact row a rail is made of: position, avatar, a name with one line of
24
+ * why it is here, and its state. `top` puts the leader's numeral in accent; leave `rank` out
25
+ * when the list is not ranked. `selectable` renders the row as a button (`lbrl`) for a rail
26
+ * that selects what the body shows; selected takes the violet selection tint.
27
+ */
28
+ export declare function EcoLeaderRow({ name, hint, initials, avatar, rank, top, status, badge, selectable, selected, onClick, className, ...rest }: EcoLeaderRowProps): import('react').JSX.Element;
@@ -0,0 +1,51 @@
1
+ import { HTMLAttributes, KeyboardEvent, MouseEvent, ReactNode } from 'react';
2
+ import { EcoDataBadgeTone } from './types';
3
+ export interface EcoListRowProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "children"> {
4
+ /**
5
+ * The title. A string also names the star and overflow buttons ("Star Deploy request"); any
6
+ * other node renders as given (vue-ecosphere's `#title` slot) and leaves those names bare.
7
+ */
8
+ title?: ReactNode;
9
+ /** Second line part; a node renders as given (`#subtitle`). */
10
+ subtitle?: ReactNode;
11
+ /** The part that truncates; a node renders as given (`#preview`). */
12
+ preview?: ReactNode;
13
+ /** Avatar initials; `avatar` overrides it. */
14
+ initials?: string;
15
+ /** Replaces the initials avatar (`#avatar`). */
16
+ avatar?: ReactNode;
17
+ /** Settled (read) row. Unread rows show the dot and an `sr` "Unread". */
18
+ read?: boolean;
19
+ /** Selected row (`is-sel`). */
20
+ selected?: boolean;
21
+ /** Show the leading star toggle. */
22
+ starrable?: boolean;
23
+ /** Status badge tone; pair with `statusLabel`, or use `badge`. */
24
+ status?: EcoDataBadgeTone;
25
+ statusLabel?: string;
26
+ /** Show the badge dot (the neutral "Archived" badge in the artifact has none). */
27
+ statusDot?: boolean;
28
+ /** Replaces the status badge (`#badge`). */
29
+ badge?: ReactNode;
30
+ /** Time or date at the end of the row; a node renders as given (`#meta`). */
31
+ meta?: ReactNode;
32
+ /** Show the overflow button. */
33
+ moreButton?: boolean;
34
+ /** `aria-expanded` of the overflow button while its menu is open. */
35
+ moreExpanded?: boolean;
36
+ /** The star toggle (controlled; v-model:starred). */
37
+ starred?: boolean;
38
+ defaultStarred?: boolean;
39
+ onStarredChange?: (starred: boolean) => void;
40
+ /** The row was clicked, or Enter / Space pressed while it has focus. */
41
+ onOpen?: (event: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>) => void;
42
+ /** The overflow button was clicked. Open a Menu from it. */
43
+ onMore?: (event: MouseEvent<HTMLButtonElement>) => void;
44
+ }
45
+ /**
46
+ * ListRow — the workhorse list row: leading star toggle, avatar, a title/subtitle/preview
47
+ * block that truncates, a status badge, meta and an overflow button. Unread by default;
48
+ * `read` settles it back. Order inside the body is fixed: title, unread dot, subtitle,
49
+ * em-dash, preview — only the preview truncates.
50
+ */
51
+ export declare function EcoListRow({ title, subtitle, preview, initials, avatar, read, selected, starrable, status, statusLabel, statusDot, badge, meta, moreButton, moreExpanded, starred: starredProp, defaultStarred, onStarredChange, onOpen, onMore, className, onClick, onKeyDown, ...rest }: EcoListRowProps): import('react').JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export type EcoListRowsProps = HTMLAttributes<HTMLDivElement>;
3
+ /**
4
+ * ListRows — the surface that holds a stack of `EcoListRow`s and owns their dividers.
5
+ */
6
+ export declare function EcoListRows({ className, children, ...rest }: EcoListRowsProps): import('react').JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { EcoChecklistStep } from './types';
3
+ export interface EcoQuestionItemProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
4
+ number: number | string;
5
+ /** The question; `children` override it. */
6
+ question?: string;
7
+ /** A number renders as "5 marks"; a string is shown as given. */
8
+ marks?: number | string;
9
+ /** Provenance chips: "NCERT Physics 11 · ch 7.4". */
10
+ sources?: string[];
11
+ /** A neutral badge after the sources, e.g. the cognitive level "Apply". */
12
+ tag?: string;
13
+ /** Mark scheme, one step per criterion with the marks awarded. */
14
+ steps?: EcoChecklistStep[];
15
+ /** Content after everything else (`#footer`). */
16
+ footer?: ReactNode;
17
+ /** The question as rich content; overrides `question` (the default slot). */
18
+ children?: ReactNode;
19
+ }
20
+ /**
21
+ * QuestionItem — a question as it appears in a paper or a marked script: number, question,
22
+ * marks, and what hangs off it — `cite` chips for where it came from (an unattributed
23
+ * question is one a teacher has to verify), or Checklist steps as its mark scheme.
24
+ */
25
+ export declare function EcoQuestionItem({ number, question, marks, sources, tag, steps, footer, children, className, ...rest }: EcoQuestionItemProps): import('react').JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { EcoRowItemData, EcoScoreStep } from './types';
3
+ export interface EcoRowGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "children"> {
4
+ title: string;
5
+ /** Band dot / default score step, 1…6. */
6
+ tone?: EcoScoreStep;
7
+ /** Heading level of the band title. */
8
+ level?: 2 | 3 | 4;
9
+ /** Rows as data; or put `EcoRowItem`s in `children`. */
10
+ items?: EcoRowItemData[];
11
+ /** A data row was opened. */
12
+ onOpen?: (item: EcoRowItemData) => void;
13
+ /** A data row's save button was pressed. */
14
+ onSave?: (item: EcoRowItemData) => void;
15
+ /** A data row's primary was pressed. */
16
+ onAction?: (item: EcoRowItemData) => void;
17
+ /** Replaces each data row's badge, save button and primary (`#actions="{ item }"`). */
18
+ renderActions?: (scope: {
19
+ item: EcoRowItemData;
20
+ }) => ReactNode;
21
+ /** `EcoRowItem`s, instead of `items`. */
22
+ children?: ReactNode;
23
+ }
24
+ /**
25
+ * RowGroup — a titled band with its rows underneath: the unit you repeat when a list is
26
+ * ranked or bucketed rather than flat. The band dot takes the same `dot1`…`dot6` ramp as
27
+ * `score`, so a group's colour and its rows' scores agree. Two or three groups per view.
28
+ */
29
+ export declare function EcoRowGroup({ title, tone, level, items, onOpen, onSave, onAction, renderActions, children, className, ...rest }: EcoRowGroupProps): import('react').JSX.Element;