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 { HTMLAttributes, KeyboardEvent, MouseEvent, ReactNode } from 'react';
2
+ import { EcoDataBadge, EcoScoreStep } from './types';
3
+ export interface EcoRowItemProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
4
+ name: string;
5
+ hint?: string;
6
+ initials?: string;
7
+ /** Replaces the initials avatar (`#avatar`). */
8
+ avatar?: ReactNode;
9
+ /** Score pill text, e.g. "95%". */
10
+ score?: string;
11
+ scoreTone?: EcoScoreStep;
12
+ status?: EcoDataBadge;
13
+ /** Show the save (bookmark) button. */
14
+ saveButton?: boolean;
15
+ saved?: boolean;
16
+ saveLabel?: string;
17
+ /** Primary action label (default "Open"); empty string hides it. */
18
+ actionLabel?: string;
19
+ selected?: boolean;
20
+ /** Replaces the status badge, save button and primary (`#actions`). */
21
+ actions?: ReactNode;
22
+ /** The row was clicked, or Enter / Space pressed while it has focus. */
23
+ onOpen?: (event: MouseEvent<HTMLDivElement> | KeyboardEvent<HTMLDivElement>) => void;
24
+ onSave?: () => void;
25
+ onAction?: () => void;
26
+ }
27
+ /**
28
+ * RowItem — one row of a RowGroup: avatar, a name with its `score` pill, a qualifier line,
29
+ * then a status badge and the row's actions. The row itself opens (role=button).
30
+ */
31
+ export declare function EcoRowItem(props: EcoRowItemProps): import('react').JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { EcoDataBadge } from './types';
3
+ export interface EcoSourceRowProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "children"> {
4
+ title: string;
5
+ /** Pages, chapters, question count — "412 pages · chapters 1–12". */
6
+ extent?: string;
7
+ /** Indexed / Indexing / Not uploaded. */
8
+ status?: EcoDataBadge;
9
+ /** Replaces the status badge (`#badge`). */
10
+ badge?: ReactNode;
11
+ /** Spine colour (any CSS colour or token). Without it or `coverImage` the spine is a `ph` placeholder. */
12
+ coverColor?: string;
13
+ /** Spine image URL. */
14
+ coverImage?: string;
15
+ }
16
+ /**
17
+ * SourceRow — a document the system has ingested: a spine, the title, its extent, and
18
+ * whether it is indexed yet. A stack of spines reads as a shelf. For a general file or
19
+ * attachment row, use ListRow; this one is for sources a system reasons over.
20
+ */
21
+ export declare function EcoSourceRow({ title, extent, status, badge, coverColor, coverImage, className, ...rest }: EcoSourceRowProps): import('react').JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { EcoStatSegment } from './types';
3
+ export interface EcoStatProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
4
+ /** Eyebrow label, e.g. "Requests closed". */
5
+ label?: string;
6
+ value?: string | number;
7
+ /** Delta text, e.g. "32%". */
8
+ delta?: string;
9
+ /** Direction of the delta: arrow and colour (`stat__delta--down`). */
10
+ trend?: "up" | "down";
11
+ /** Segments of the bar under the figure. */
12
+ segments?: EcoStatSegment[];
13
+ /** Controls at the end of the head, e.g. a period control (`#actions`). */
14
+ actions?: ReactNode;
15
+ }
16
+ /**
17
+ * Stat — the figure a dashboard leads with: an eyebrow, a value with its delta, and
18
+ * optionally a segmented bar with its legend. Lead with the number, not a chart. Say what the
19
+ * delta is measured against or leave it off. The figure is always `--font-num`, tabular.
20
+ * Put a period control (`wknav`) in `actions`.
21
+ */
22
+ export declare function EcoStat({ label, value, delta, trend, segments, actions, className, ...rest }: EcoStatProps): import('react').JSX.Element;
@@ -0,0 +1,97 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { EcoRowExpandable, EcoRowKey, EcoRowToggleLabel, EcoTableColumn, EcoTableRow, EcoTableSort } from './types';
3
+ /** Scope of a `renderCell` entry. */
4
+ export interface EcoTableCellScope {
5
+ row: EcoTableRow;
6
+ value: unknown;
7
+ index: number;
8
+ }
9
+ /** Scope of a `renderHead` entry. */
10
+ export interface EcoTableHeadScope {
11
+ column: EcoTableColumn;
12
+ }
13
+ /** Scope of `renderExpanded`. */
14
+ export interface EcoTableExpandedScope {
15
+ row: EcoTableRow;
16
+ index: number;
17
+ }
18
+ export interface EcoTableProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
19
+ columns: EcoTableColumn[];
20
+ rows: EcoTableRow[];
21
+ /** Row identity: a property name or a function (default `"id"`). */
22
+ rowKey?: string | ((row: EcoTableRow) => EcoRowKey);
23
+ /** Visually hidden caption naming the table. */
24
+ caption?: string;
25
+ compact?: boolean;
26
+ /** Header stays put while the body scrolls (`table--sticky`). */
27
+ sticky?: boolean;
28
+ /** One line per row; a wide table scrolls sideways (`table--nowrap`). */
29
+ nowrap?: boolean;
30
+ /** Fixed layout (`table--fixedw`): column widths come from the header. */
31
+ fixed?: boolean;
32
+ /** Freeze the first (identifying) column. */
33
+ pinFirst?: boolean;
34
+ /** Freeze the last (action) column. */
35
+ pinLast?: boolean;
36
+ /** Render the first column as the row header (`th scope="row"`). */
37
+ rowHeader?: boolean;
38
+ /** Checkbox column with select-all; use `selected` / `onSelectedChange`. */
39
+ selectable?: boolean;
40
+ /** Report sort changes but leave `rows` in the given order (server-side sorting). */
41
+ manualSort?: boolean;
42
+ /** Skeleton rows with `aria-busy` while the page loads. */
43
+ loading?: boolean;
44
+ loadingRows?: number;
45
+ /** Class of the scroll wrapper (default `tablewrap`; `EcoDataTable` passes `dtable__scroll`). */
46
+ wrapClass?: string;
47
+ /** Accessible name of a row's checkbox target; defaults to the first column's text. */
48
+ rowLabel?: (row: EcoTableRow) => string;
49
+ selectAllLabel?: string;
50
+ /**
51
+ * Rows that open a detail row (`renderExpanded`) under them: `true` for every row, or a
52
+ * function picking them. Adds a toggle column after the selection column.
53
+ */
54
+ expandable?: EcoRowExpandable;
55
+ /** Name of a closed row's toggle: a prefix before `rowLabel(row)`, or a function of the row. */
56
+ expandLabel?: EcoRowToggleLabel;
57
+ /** Name of an open row's toggle: a prefix before `rowLabel(row)`, or a function of the row. */
58
+ collapseLabel?: EcoRowToggleLabel;
59
+ /** Visually hidden header of the toggle column. */
60
+ expandColumnLabel?: string;
61
+ /** Selected row keys (controlled; v-model:selected). */
62
+ selected?: EcoRowKey[];
63
+ defaultSelected?: EcoRowKey[];
64
+ onSelectedChange?: (selected: EcoRowKey[]) => void;
65
+ /** The sort (controlled; v-model:sort). `null` is unsorted. */
66
+ sort?: EcoTableSort | null;
67
+ defaultSort?: EcoTableSort | null;
68
+ onSortChange?: (sort: EcoTableSort | null) => void;
69
+ /** Keys of the rows whose detail row is open (controlled; v-model:expanded). */
70
+ expanded?: EcoRowKey[];
71
+ defaultExpanded?: EcoRowKey[];
72
+ onExpandedChange?: (expanded: EcoRowKey[]) => void;
73
+ /** A row's detail row opened. */
74
+ onExpand?: (row: EcoTableRow) => void;
75
+ /** A row's detail row closed. */
76
+ onCollapse?: (row: EcoTableRow) => void;
77
+ /** Cell content per column key (`#cell-<key>`). */
78
+ renderCell?: Record<string, (scope: EcoTableCellScope) => ReactNode>;
79
+ /** Header content per column key (`#head-<key>`). */
80
+ renderHead?: Record<string, (scope: EcoTableHeadScope) => ReactNode>;
81
+ /** Shown in a full-width row when there are no rows (`#empty`). */
82
+ empty?: ReactNode;
83
+ /** Content of an open row's full-width detail row (`#expanded`). */
84
+ renderExpanded?: (scope: EcoTableExpandedScope) => ReactNode;
85
+ }
86
+ /**
87
+ * Table — the base table: a header, hairline-separated rows, figure columns and an optional
88
+ * compact density. Data-driven: pass `columns` and `rows`, and override any cell with
89
+ * `renderCell[key]` or header with `renderHead[key]`. Figures go in `numeric` columns
90
+ * (`col-num`, right-aligned, tabular). Never striped. Selection is the violet tint with an
91
+ * accent rule; sortable headers carry `aria-sort` and a `sortbtn`. Pin the identifying first
92
+ * column and the action column of a wide table with `pinFirst` / `pinLast`. An `expandable` row
93
+ * gets a chevron toggle in a leading column and opens its `renderExpanded` content in a
94
+ * full-width row directly under it — for a row's secondary detail, not for a hierarchy (use
95
+ * EcoTreeTable).
96
+ */
97
+ export declare function EcoTable({ columns, rows, rowKey, caption, compact, sticky, nowrap, fixed, pinFirst, pinLast, rowHeader, selectable, manualSort, loading, loadingRows, wrapClass, rowLabel, selectAllLabel, expandable, expandLabel, collapseLabel, expandColumnLabel, selected: selectedProp, defaultSelected, onSelectedChange, sort: sortProp, defaultSort, onSortChange, expanded: expandedProp, defaultExpanded, onExpandedChange, onExpand, onCollapse, renderCell, renderHead, empty, renderExpanded, className, onScroll, ...rest }: EcoTableProps): import('react').JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface EcoTaskRowProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "children"> {
3
+ title: string;
4
+ subtitle?: string;
5
+ /** Body sentence; `children` override it. */
6
+ description?: string;
7
+ /**
8
+ * Media text in the avatar, e.g. "01" or initials. Any other node replaces the avatar
9
+ * (vue-ecosphere's `#media` slot).
10
+ */
11
+ media?: ReactNode;
12
+ /** Due date, shown as "Due **Jul 24**". */
13
+ due?: string;
14
+ dueLabel?: string;
15
+ /** Replaces the due line (`#meta`). */
16
+ meta?: ReactNode;
17
+ /** Primary action label, e.g. "Renew now". */
18
+ actionLabel?: string;
19
+ snoozeLabel?: string;
20
+ dismissLabel?: string;
21
+ /** Show the snooze / dismiss icon buttons. */
22
+ snooze?: boolean;
23
+ dismiss?: boolean;
24
+ /** Replaces the primary and the two icon buttons (`#actions`). */
25
+ actions?: ReactNode;
26
+ onAction?: () => void;
27
+ onSnooze?: () => void;
28
+ onDismiss?: () => void;
29
+ /** Body content; overrides `description` (the default slot). */
30
+ children?: ReactNode;
31
+ }
32
+ /**
33
+ * TaskRow — a row that owes you an action: media, a two-line body with a due date, then one
34
+ * primary and two outlined icon buttons. Taller and calmer than ListRow — use it where the
35
+ * list is a to-do, not an archive. The primary always names the action, never "OK".
36
+ */
37
+ export declare function EcoTaskRow({ title, subtitle, description, media, due, dueLabel, meta, actionLabel, snoozeLabel, dismissLabel, snooze, dismiss, actions, onAction, onSnooze, onDismiss, children, className, ...rest }: EcoTaskRowProps): import('react').JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export type EcoTaskRowsProps = HTMLAttributes<HTMLDivElement>;
3
+ /**
4
+ * TaskRows — wrap task rows in it: it owns the surface, the border and the dividers,
5
+ * so a row is never flush against whatever happens to contain it.
6
+ */
7
+ export declare function EcoTaskRows({ className, children, ...rest }: EcoTaskRowsProps): import('react').JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { OlHTMLAttributes } from 'react';
2
+ import { EcoTimelineGroup, EcoTrailStage } from './types';
3
+ export interface EcoTimelineProps extends Omit<OlHTMLAttributes<HTMLOListElement>, "children"> {
4
+ variant?: "group" | "trail";
5
+ /** Dated groups (variant "group"). Each renders its own `tl` block. */
6
+ groups?: EcoTimelineGroup[];
7
+ /** Stages in order, source first (variant "trail"). */
8
+ stages?: EcoTrailStage[];
9
+ /** Trail: names what is traced ("Evidence for the price of …"). */
10
+ label?: string;
11
+ /** Trail: heading level of each stage name. */
12
+ level?: 2 | 3 | 4 | 5;
13
+ }
14
+ /**
15
+ * Timeline — a dated group with a tile, a heading pair, and nested entries under a running
16
+ * rule: versions of a release, stages of a case, roles at an employer. `variant="trail"`
17
+ * turns it into an evidence trail: the stages a value passed through, source first, each
18
+ * with a heading, a status badge, its evidence and a link to that stage's source.
19
+ *
20
+ * `className`, `style` and other attributes land on the trail's `<ol>`. The group variant
21
+ * renders its `tl` blocks side by side with no wrapper, so it takes none (as in vue-ecosphere).
22
+ */
23
+ export declare function EcoTimeline({ variant, groups, stages, label, level, className, ...rest }: EcoTimelineProps): import('react').JSX.Element;
@@ -0,0 +1,43 @@
1
+ import { ReactNode, TableHTMLAttributes } from 'react';
2
+ import { EcoTableColumn, EcoTreeTableRow } from './types';
3
+ /** Scope of a TreeTable `renderCell` entry. */
4
+ export interface EcoTreeTableCellScope {
5
+ row: EcoTreeTableRow;
6
+ value: unknown;
7
+ depth: number;
8
+ }
9
+ export interface EcoTreeTableProps extends Omit<TableHTMLAttributes<HTMLTableElement>, "children" | "onToggle"> {
10
+ columns: EcoTableColumn[];
11
+ rows: EcoTreeTableRow[];
12
+ /** Visually hidden caption. Say that a row with a toggle lists its children below it. */
13
+ caption?: string;
14
+ compact?: boolean;
15
+ sticky?: boolean;
16
+ nowrap?: boolean;
17
+ repeatText?: string;
18
+ /** Ids of the open rows (controlled; v-model:expanded). */
19
+ expanded?: string[];
20
+ defaultExpanded?: string[];
21
+ onExpandedChange?: (expanded: string[]) => void;
22
+ /** A row was opened or closed. Load its level the first time it opens. */
23
+ onToggle?: (row: EcoTreeTableRow, open: boolean) => void;
24
+ /** Retry was pressed in a level that failed to load. */
25
+ onRetry?: (row: EcoTreeTableRow) => void;
26
+ /** The "show more" button of a level was pressed. */
27
+ onMore?: (row: EcoTreeTableRow) => void;
28
+ /** Cell content per column key (`#cell-<key>`). */
29
+ renderCell?: Record<string, (scope: EcoTreeTableCellScope) => ReactNode>;
30
+ /** Replaces a level's "show more" button (`#more`). */
31
+ renderMore?: (scope: {
32
+ row: EcoTreeTableRow;
33
+ }) => ReactNode;
34
+ }
35
+ /**
36
+ * TreeTable — nested rows inside a table: a row with children gets a toggle in its name cell,
37
+ * and opening it shows that level's rows directly beneath it, indented one step per level,
38
+ * with their own loading, failed, empty and "show more" rows. Rows stay flat `tr`s in one
39
+ * `tbody`. A row whose id repeats among its ancestors never gets a toggle, so a cycle cannot
40
+ * loop. Native table semantics with disclosure buttons, not `role="treegrid"`. Frame it in
41
+ * `EcoDataTable` (as its children) or a `tablewrap`. Listen to `onToggle` to load a level.
42
+ */
43
+ export declare function EcoTreeTable({ columns, rows, caption, compact, sticky, nowrap, repeatText, expanded: expandedProp, defaultExpanded, onExpandedChange, onToggle, onRetry, onMore, renderCell, renderMore, className, ...rest }: EcoTreeTableProps): import('react').JSX.Element;
@@ -0,0 +1,46 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { EcoTreeNode } from './types';
3
+ export interface EcoTreeViewProps extends Omit<HTMLAttributes<HTMLUListElement>, "children" | "onToggle" | "onSelect"> {
4
+ nodes: EcoTreeNode[];
5
+ /** Accessible name: whose hierarchy this is ("Hierarchy of North region"). */
6
+ label?: string;
7
+ /** Id of a visible element naming the tree. */
8
+ labelledby?: string;
9
+ /** Narrow container spacing (`tree--tight`). */
10
+ tight?: boolean;
11
+ /** Selection widget (`role="tree"`) instead of navigation. */
12
+ selectable?: boolean;
13
+ /** Allow several selected items (`selected` is an array). */
14
+ multiple?: boolean;
15
+ /** In a selectable tree, let nodes with children be selected too. */
16
+ selectParents?: boolean;
17
+ /** Levels shown before deeper nodes stop offering a toggle. */
18
+ maxDepth?: number;
19
+ /** Ids of the open branches (controlled; v-model:expanded). */
20
+ expanded?: string[];
21
+ defaultExpanded?: string[];
22
+ onExpandedChange?: (expanded: string[]) => void;
23
+ /** The selected id, or ids with `multiple` (controlled; v-model:selected). */
24
+ selected?: string | string[] | null;
25
+ defaultSelected?: string | string[] | null;
26
+ onSelectedChange?: (selected: string | string[] | null) => void;
27
+ /** A branch was opened or closed. Load it the first time it opens. */
28
+ onToggle?: (node: EcoTreeNode, open: boolean) => void;
29
+ /** A node was selected (or, with `multiple`, toggled). */
30
+ onSelect?: (node: EcoTreeNode) => void;
31
+ /** Retry was pressed in a branch that failed to load. */
32
+ onRetry?: (node: EcoTreeNode) => void;
33
+ /** A branch's "show more" button was pressed. */
34
+ onMore?: (node: EcoTreeNode) => void;
35
+ }
36
+ /**
37
+ * TreeView — a hierarchy: the path of ancestors down to the current node, then that node's
38
+ * children in branches that open with a disclosure button, tied to their parent by connector
39
+ * lines. By default it follows the ARIA disclosure pattern (names are links, toggles are
40
+ * buttons, Tab moves through them). With `selectable` it becomes a selection widget on the
41
+ * full ARIA tree pattern: `role="tree"`, one roving tab stop, Up/Down, Right/Left to open,
42
+ * close or move, Home/End, type-ahead, and Enter/Space to select (`selected`).
43
+ * Open branches live in `expanded`; listen to `onToggle` to load a branch the first
44
+ * time it opens. A node that repeats among its ancestors is never expanded again.
45
+ */
46
+ export declare function EcoTreeView({ nodes, label, labelledby, tight, selectable, multiple, selectParents, maxDepth, expanded: expandedProp, defaultExpanded, onExpandedChange, selected: selectedProp, defaultSelected, onSelectedChange, onToggle, onSelect, onRetry, onMore, className, onKeyDown, onFocus, ...rest }: EcoTreeViewProps): import('react').JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { EcoTreeNode } from './types';
2
+ interface EcoTreeViewNodeProps {
3
+ node: EcoTreeNode;
4
+ depth: number;
5
+ setsize: number;
6
+ posinset: number;
7
+ ancestors: string[];
8
+ }
9
+ /**
10
+ * TreeViewNode — one `tree__node` of an EcoTreeView, rendering its own branch recursively.
11
+ * Internal: use `EcoTreeView`.
12
+ */
13
+ export declare function EcoTreeViewNode({ node, depth, setsize, posinset, ancestors }: EcoTreeViewNodeProps): import('react').JSX.Element;
14
+ export {};
@@ -0,0 +1,18 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { EcoDataBadgeTone } from './types';
3
+ export interface EcoValueChangeProps extends Omit<HTMLAttributes<HTMLParagraphElement>, "children"> {
4
+ from?: string | number;
5
+ to: string | number;
6
+ /** Badge text: "+5.6%", "−3.2%", "No change", "New". */
7
+ change?: string;
8
+ tone?: EcoDataBadgeTone;
9
+ /** The sentence a screen reader hears; defaults to "From A to B, change". */
10
+ label?: string;
11
+ }
12
+ /**
13
+ * ValueChange — one value moving from before to after: the old value struck through, an
14
+ * arrow, the new value and a signed badge. Every visual part is hidden from assistive tech and
15
+ * an `sr` sentence says the change. Without `from`, it shows the value alone (unchanged / new).
16
+ * Sign the badge with a true minus (U+2212). Neutral unless up or down is plainly better.
17
+ */
18
+ export declare function EcoValueChange({ from, to, change, tone, label, className, ...rest }: EcoValueChangeProps): import('react').JSX.Element;
@@ -0,0 +1,39 @@
1
+ export { EcoListRow } from './EcoListRow';
2
+ export type { EcoListRowProps } from './EcoListRow';
3
+ export { EcoListRows } from './EcoListRows';
4
+ export type { EcoListRowsProps } from './EcoListRows';
5
+ export { EcoTaskRow } from './EcoTaskRow';
6
+ export type { EcoTaskRowProps } from './EcoTaskRow';
7
+ export { EcoTaskRows } from './EcoTaskRows';
8
+ export type { EcoTaskRowsProps } from './EcoTaskRows';
9
+ export { EcoRowGroup } from './EcoRowGroup';
10
+ export type { EcoRowGroupProps } from './EcoRowGroup';
11
+ export { EcoRowItem } from './EcoRowItem';
12
+ export type { EcoRowItemProps } from './EcoRowItem';
13
+ export { EcoTimeline } from './EcoTimeline';
14
+ export type { EcoTimelineProps } from './EcoTimeline';
15
+ export { EcoLeaderRow } from './EcoLeaderRow';
16
+ export type { EcoLeaderRowProps } from './EcoLeaderRow';
17
+ export { EcoChecklist } from './EcoChecklist';
18
+ export type { EcoChecklistProps } from './EcoChecklist';
19
+ export { EcoSourceRow } from './EcoSourceRow';
20
+ export type { EcoSourceRowProps } from './EcoSourceRow';
21
+ export { EcoFindings } from './EcoFindings';
22
+ export type { EcoFindingsProps } from './EcoFindings';
23
+ export { EcoQuestionItem } from './EcoQuestionItem';
24
+ export type { EcoQuestionItemProps } from './EcoQuestionItem';
25
+ export { EcoStat } from './EcoStat';
26
+ export type { EcoStatProps } from './EcoStat';
27
+ export { EcoKpi } from './EcoKpi';
28
+ export type { EcoKpiProps } from './EcoKpi';
29
+ export { EcoValueChange } from './EcoValueChange';
30
+ export type { EcoValueChangeProps } from './EcoValueChange';
31
+ export { EcoTable } from './EcoTable';
32
+ export type { EcoTableProps, EcoTableCellScope, EcoTableHeadScope, EcoTableExpandedScope } from './EcoTable';
33
+ export { EcoDataTable } from './EcoDataTable';
34
+ export type { EcoDataTableProps, EcoDataTableActionsScope } from './EcoDataTable';
35
+ export { EcoTreeView } from './EcoTreeView';
36
+ export type { EcoTreeViewProps } from './EcoTreeView';
37
+ export { EcoTreeTable } from './EcoTreeTable';
38
+ export type { EcoTreeTableProps, EcoTreeTableCellScope } from './EcoTreeTable';
39
+ export type * from './types';
@@ -0,0 +1,17 @@
1
+ import { EcoTreeNode } from './types';
2
+ /** Shared state between `EcoTreeView` and its recursive `EcoTreeViewNode`s. */
3
+ export interface EcoTreeContext {
4
+ selectable: boolean;
5
+ maxDepth: number;
6
+ tabId: string | null;
7
+ isOpen(id: string): boolean;
8
+ isSelected(id: string): boolean;
9
+ canSelect(node: EcoTreeNode): boolean;
10
+ toggle(node: EcoTreeNode): void;
11
+ activate(node: EcoTreeNode): void;
12
+ retry(node: EcoTreeNode): void;
13
+ more(node: EcoTreeNode): void;
14
+ register(id: string, el: HTMLElement | null): void;
15
+ }
16
+ export declare const TreeContext: import('react').Context<EcoTreeContext | null>;
17
+ export declare const hasKids: (n: EcoTreeNode) => boolean;
@@ -0,0 +1,175 @@
1
+ import { IconName, StatusTone } from '../../types';
2
+ /** Badge tones used by data rows: the shared status tones plus the outlined `quiet` ("Not assessed"). */
3
+ export type EcoDataBadgeTone = StatusTone | "quiet";
4
+ /** A status badge as data: `{ label: "Pending", tone: "warning" }`. */
5
+ export interface EcoDataBadge {
6
+ label: string;
7
+ tone?: EcoDataBadgeTone;
8
+ /** Show the leading `badge__dot` (default `true`). */
9
+ dot?: boolean;
10
+ }
11
+ /** The `dot1`…`dot6` / `sc1`…`sc6` ramp shared by RowGroup bands and score pills. */
12
+ export type EcoScoreStep = 1 | 2 | 3 | 4 | 5 | 6;
13
+ /** A link as data. */
14
+ export interface EcoDataLink {
15
+ label: string;
16
+ href: string;
17
+ }
18
+ export interface EcoRowItemData {
19
+ id: string | number;
20
+ /** Avatar initials. */
21
+ initials?: string;
22
+ name: string;
23
+ /** Qualifier line under the name. */
24
+ hint?: string;
25
+ /** Score pill text, e.g. "95%". */
26
+ score?: string;
27
+ /** Score ramp step; defaults to the group's tone. */
28
+ scoreTone?: EcoScoreStep;
29
+ status?: EcoDataBadge;
30
+ saved?: boolean;
31
+ }
32
+ export interface EcoTimelineEntry {
33
+ title: string;
34
+ /** Date span, e.g. "Jul 2024 – Present · 2 yrs 1 mo". */
35
+ span?: string;
36
+ /** Further meta parts, separated by the dot separators. */
37
+ meta?: string[];
38
+ description?: string;
39
+ }
40
+ export interface EcoTimelineGroup {
41
+ /** Group date on top, spanning its children. */
42
+ when?: string;
43
+ /** Tile text, e.g. "v4". */
44
+ tile?: string;
45
+ /** Group name (`tl__co`). */
46
+ title: string;
47
+ /** Heading pair line (`tl__h`). */
48
+ heading?: string;
49
+ entries?: EcoTimelineEntry[];
50
+ }
51
+ export interface EcoTrailStage {
52
+ title: string;
53
+ status?: EcoDataBadge;
54
+ /** Meta line parts such as file, page and row. */
55
+ meta?: string[];
56
+ /** Evidence paragraphs. */
57
+ body?: string[];
58
+ /** Values found at this stage (rendered as a `kv` list). */
59
+ values?: {
60
+ term: string;
61
+ detail: string;
62
+ }[];
63
+ /** Where the stage's source opens. Leave it out when there is nothing to open. */
64
+ link?: EcoDataLink;
65
+ }
66
+ export interface EcoChecklistStep {
67
+ label: string;
68
+ /** `false` renders `step--miss` with a cross. Default `true`. */
69
+ met?: boolean;
70
+ /** Marks awarded, e.g. "1 / 1". */
71
+ score?: string;
72
+ }
73
+ export interface EcoBreakdownPart {
74
+ label: string;
75
+ /** The arithmetic, e.g. "10 × 1". */
76
+ formula?: string;
77
+ /** A neutral badge, e.g. "Remember". */
78
+ tag?: string;
79
+ /** The contribution to the total. */
80
+ value: string | number;
81
+ }
82
+ export type EcoFindingTone = "danger" | "warning" | "success" | "neutral";
83
+ export interface EcoFinding {
84
+ tone?: EcoFindingTone;
85
+ /** One plain sentence. Wrap the figure that matters in `**…**` to set it in bold. */
86
+ text: string;
87
+ link?: EcoDataLink;
88
+ }
89
+ export interface EcoStatSegment {
90
+ label: string;
91
+ /** Share of the bar (any unit; segments are sized relative to each other). */
92
+ value: number;
93
+ /** Fill colour; defaults to the `--p5`, `--p2`, `--p0` … magnitude ramp. */
94
+ color?: string;
95
+ /** Legend figure; defaults to `${value}%`. */
96
+ display?: string;
97
+ }
98
+ export type EcoTableRow = Record<string, any>;
99
+ export interface EcoTableColumn<R = EcoTableRow> {
100
+ key: string;
101
+ label: string;
102
+ /** Figure column: right-aligned and tabular (`col-num`). */
103
+ numeric?: boolean;
104
+ /** CSS width for the header cell, e.g. "26%" or "120px". */
105
+ width?: string;
106
+ sortable?: boolean;
107
+ /** Action column (`col-act`); its label is visually hidden. */
108
+ action?: boolean;
109
+ /** Hide the header label visually (keeps it for screen readers). */
110
+ srLabel?: boolean;
111
+ /** Value used for sorting; defaults to `row[key]`. */
112
+ sortValue?: (row: R) => string | number | null | undefined;
113
+ /** Text shown in the cell when no `renderCell[key]` is given; defaults to `row[key]`. */
114
+ format?: (value: unknown, row: R) => string;
115
+ }
116
+ export type EcoSortDir = "asc" | "desc";
117
+ export interface EcoTableSort {
118
+ key: string;
119
+ dir: EcoSortDir;
120
+ }
121
+ export type EcoRowKey = string | number;
122
+ /** Which rows of a Table or DataTable can open a detail row: all of them, or those the function accepts. */
123
+ export type EcoRowExpandable<R = EcoTableRow> = boolean | ((row: R) => boolean);
124
+ /** Accessible name of a row's expand toggle: a prefix put before the row's label ("Show details for"), or the whole name from the row. */
125
+ export type EcoRowToggleLabel<R = EcoTableRow> = string | ((row: R) => string);
126
+ /** Async state of a node's branch (TreeView) or level (TreeTable). */
127
+ export type EcoBranchState = "loading" | "error" | "empty";
128
+ export interface EcoTreeNode {
129
+ id: string;
130
+ label: string;
131
+ /** The node's own page. Omitted in a `selectable` tree, where the item itself is the control. */
132
+ href?: string;
133
+ /** ID, kind and child count, e.g. "1130 · Branch · 4 depots". */
134
+ meta?: string;
135
+ /** Icon for the mark of a node without a toggle (default `building-4-line`). */
136
+ icon?: IconName;
137
+ badges?: EcoDataBadge[];
138
+ /** The node the reader is on: violet ground, plain label with `aria-current="page"`. */
139
+ current?: boolean;
140
+ /** Part of the ancestor path: a mark instead of a toggle, its branch always shown. */
141
+ path?: boolean;
142
+ /** A note under the meta line. */
143
+ note?: string;
144
+ children?: EcoTreeNode[];
145
+ /** The node has children that are not loaded yet (shows a toggle). */
146
+ hasChildren?: boolean;
147
+ /** Branch state while it loads, fails or comes back empty. */
148
+ state?: EcoBranchState;
149
+ /** Message for the `error` / `empty` / `loading` state. */
150
+ stateText?: string;
151
+ /** "Show more" row at the end of the branch. */
152
+ more?: {
153
+ message: string;
154
+ label: string;
155
+ };
156
+ /** In a `selectable` tree, whether this node can be selected (default: leaves only). */
157
+ selectable?: boolean;
158
+ }
159
+ export interface EcoTreeTableRow {
160
+ id: string;
161
+ /** Cell values keyed by column key. The first column is the name cell. */
162
+ cells: Record<string, unknown>;
163
+ /** The row's own page; the name renders as a link. */
164
+ href?: string;
165
+ /** Second line under the name (`table__s`). */
166
+ sub?: string;
167
+ children?: EcoTreeTableRow[];
168
+ hasChildren?: boolean;
169
+ state?: EcoBranchState;
170
+ stateText?: string;
171
+ more?: {
172
+ message: string;
173
+ label: string;
174
+ };
175
+ }
@@ -0,0 +1,19 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { AvatarSize } from './types';
3
+ export interface EcoAvatarProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
4
+ /** Full name; initials are taken from its first and last words. */
5
+ name?: string;
6
+ size?: AvatarSize;
7
+ /** Photo URL, shown in place of the initials. */
8
+ src?: string;
9
+ /** Accessible name. Omit when the name is already on screen beside it. */
10
+ label?: string;
11
+ /** Replaces the initials. */
12
+ children?: ReactNode;
13
+ }
14
+ /**
15
+ * Avatar — initials (or a photo) in four sizes. Initials are word initials, not the first two
16
+ * letters: Alex Jordan is AJ, Analytics warehouse AW. Decorative by default (`aria-hidden`)
17
+ * because the name is usually already on screen; pass `label` when the avatar stands alone.
18
+ */
19
+ export declare function EcoAvatar({ name, size, src, label, className, children, ...rest }: EcoAvatarProps): import('react').JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { StatusTone } from '../../types';
3
+ export interface EcoBadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children"> {
4
+ /** Status tone. Status badges default to `neutral`; counts to the danger fill. */
5
+ tone?: StatusTone;
6
+ /** Text label; `children` override it. */
7
+ label?: string;
8
+ /** Render a notification count instead of a status. */
9
+ count?: number | string;
10
+ /** Cap the count, e.g. `99` shows "99+". */
11
+ max?: number;
12
+ children?: ReactNode;
13
+ }
14
+ /**
15
+ * Badge — a status label with a dot (success, warning, danger, accent, neutral), or with `count`
16
+ * a notification count (`badge--notification`): filled, no dot, tabular figures. Status colour is
17
+ * never alone — every status badge carries its own text label. A count defaults to danger; pass
18
+ * `tone="accent"` or `"neutral"` when it is informational rather than urgent.
19
+ */
20
+ export declare function EcoBadge({ tone, label, count, max, className, children, ...rest }: EcoBadgeProps): import('react').JSX.Element;