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
package/CHANGELOG.md ADDED
@@ -0,0 +1,28 @@
1
+ # Changelog
2
+
3
+ react-ecosphere follows vue-ecosphere's major.minor: the same components, props and markup.
4
+ Patch releases are independent.
5
+
6
+ ## 1.1.0 — unreleased
7
+
8
+ First release: the Ecosphere Design System for React, matching vue-ecosphere 1.1.0.
9
+
10
+ - All 97 components, with vue-ecosphere's props and markup. Vue's `v-model` becomes controlled
11
+ props (`value` / `onChange`, `foo` / `onFooChange`), emits become `on…` callbacks, and slots
12
+ become `children`, ReactNode props and `render…` props.
13
+ - `useToast()` with `<EcoToaster />`, `useConfirm()` with `<EcoConfirmHost />`, and `useEcoId()`.
14
+ - The stylesheet (`react-ecosphere/styles.css`), fonts and `tokens.json`, identical to
15
+ vue-ecosphere 1.1.0's.
16
+ - React 18.2 and 19; server rendering; `"use client"` for React Server Components.
17
+ - Parity tests render every component in both packages and compare the markup.
18
+
19
+ Where the React API is not the mechanical translation of the Vue one:
20
+
21
+ - `EcoCheckbox` and `EcoSwitch` take `checked` / `defaultChecked` / `onChange(checked)`.
22
+ - `EcoField` takes `htmlFor`; its props type is `EcoFieldComponentProps`.
23
+ - `EcoNavItem` renders a plain `<a>`; pass your router's link as `as` and set `active` from the
24
+ router's match (there is no `exact`).
25
+ - Where Vue has a prop and a slot of the same name (a dialog's `title`, a toast's `action`), React
26
+ has one ReactNode prop. `EcoSearchField`'s `#filter` slot is `filterButton`, and
27
+ `EcoComposeModal`'s `#to` slot is `toField`.
28
+ - `useToast()` and `useConfirm()` can be called anywhere, not only in components.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Dipanjan De
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,127 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <img src="https://raw.githubusercontent.com/bacon-delight/vue-ecosphere/main/public/logo.png" width="88" alt="Ecosphere hummingbird logo" />
4
+
5
+ # Ecosphere for React
6
+
7
+ **Calm interfaces for data-heavy work.**<br />
8
+ The Ecosphere Design System for React: built on minimalism and inspired by Scandinavian
9
+ architecture. Blue on cool slate, quiet surfaces, and figures that never shift.
10
+
11
+ [![npm](https://img.shields.io/npm/v/react-ecosphere?style=flat-square&color=1d57a6&label=npm)](https://www.npmjs.com/package/react-ecosphere)
12
+ [![CI](https://img.shields.io/github/actions/workflow/status/bacon-delight/react-ecosphere/ci.yml?branch=main&style=flat-square&label=CI)](https://github.com/bacon-delight/react-ecosphere/actions/workflows/ci.yml)
13
+ [![License](https://img.shields.io/npm/l/react-ecosphere?style=flat-square&color=4b6584)](LICENSE)
14
+
15
+ [**Documentation**](https://ecosphere.dev) · [Quick start](#quick-start) · [From Vue to React](#from-the-vue-api-to-react) · [Changelog](CHANGELOG.md)
16
+
17
+ </div>
18
+
19
+ ## One design system, two frameworks
20
+
21
+ Ecosphere ships as two packages with the same 97 components, the same props, the same markup and
22
+ the same stylesheet:
23
+
24
+ | | Package | Repository |
25
+ |---|---|---|
26
+ | Vue 3.5+ | [`vue-ecosphere`](https://www.npmjs.com/package/vue-ecosphere) | [bacon-delight/vue-ecosphere](https://github.com/bacon-delight/vue-ecosphere) (and the docs) |
27
+ | React 18.2+ / 19 | [`react-ecosphere`](https://www.npmjs.com/package/react-ecosphere) | this repository |
28
+
29
+ The docs at [ecosphere.dev](https://ecosphere.dev) cover both: switch the framework at the top of
30
+ any page to see React examples and the React API.
31
+
32
+ ## Quick start
33
+
34
+ ```sh
35
+ npm install react-ecosphere
36
+ ```
37
+
38
+ Import the stylesheet once, and mount the toaster (and the confirm host, if you use `useConfirm`)
39
+ near the root:
40
+
41
+ ```tsx
42
+ // main.tsx
43
+ import { createRoot } from "react-dom/client";
44
+ import "react-ecosphere/styles.css";
45
+ import App from "./App";
46
+
47
+ createRoot(document.getElementById("root")!).render(<App />);
48
+ ```
49
+
50
+ ```tsx
51
+ // App.tsx
52
+ import { useState } from "react";
53
+ import { EcoButton, EcoConfirmHost, EcoTextField, EcoToaster, useToast } from "react-ecosphere";
54
+
55
+ export default function App() {
56
+ const [email, setEmail] = useState("");
57
+ const toast = useToast();
58
+ return (
59
+ <>
60
+ <EcoTextField value={email} onChange={setEmail} label="Email" required hint="We'll send the receipt here." />
61
+ <EcoButton variant="primary" icon="send-plane-line" onClick={() => toast.success("Receipt sent")}>
62
+ Send receipt
63
+ </EcoButton>
64
+ <EcoToaster />
65
+ <EcoConfirmHost />
66
+ </>
67
+ );
68
+ }
69
+ ```
70
+
71
+ Fonts (Google Sans, Fraunces) and the RemixIcon set ship inside the stylesheet: add no CDN links.
72
+
73
+ **Next.js, Remix and other server renderers:** every component renders on the server, and the
74
+ bundle is marked `"use client"`, so you can import components straight into Server Components
75
+ pages.
76
+
77
+ ## From the Vue API to React
78
+
79
+ The docs show each component's API in the framework you pick. The translation is mechanical:
80
+
81
+ | vue-ecosphere | react-ecosphere |
82
+ |---|---|
83
+ | `v-model="x"` | `value={x} onChange={setX}` (the callback receives the value) |
84
+ | `v-model:open="open"` | `open={open} onOpenChange={setOpen}` |
85
+ | a model that also works unbound | `defaultValue` / `defaultOpen` for uncontrolled use |
86
+ | `@row-click="fn"` | `onRowClick={fn}` (same arguments) |
87
+ | default slot | `children` |
88
+ | `#footer` | `footer={<…/>}` |
89
+ | `#actions="{ item }"` | `renderActions={({ item }) => <…/>}` |
90
+ | `#cell-name="{ row }"` | `renderCell={{ name: ({ row }) => <…/> }}` |
91
+ | `class` / `style` / attributes | `className` / `style` / attributes, on the same element |
92
+ | `useToast()`, `useConfirm()` | the same hooks, with the same options |
93
+
94
+ Components around a native control (buttons, links, inputs) forward their `ref` to it.
95
+
96
+ ## Theming
97
+
98
+ Override custom properties after the stylesheet, in one place:
99
+
100
+ ```css
101
+ :root {
102
+ --accent: #1d57a6;
103
+ }
104
+ ```
105
+
106
+ Every accent state derives from the accent family tokens. The tokens are in
107
+ `react-ecosphere/tokens.json`.
108
+
109
+ ## Use with AI agents
110
+
111
+ The [Ecosphere skill](https://github.com/bacon-delight/ecosphere-skill) teaches Claude Code,
112
+ Codex and ChatGPT the components, props and rules for both packages:
113
+
114
+ ```text
115
+ /plugin marketplace add bacon-delight/ecosphere-skill
116
+ /plugin install ecosphere@ecosphere
117
+ ```
118
+
119
+ ## Contributing
120
+
121
+ See [CONTRIBUTING.md](CONTRIBUTING.md). Components, CSS and docs start in
122
+ [vue-ecosphere](https://github.com/bacon-delight/vue-ecosphere); this repository ports them to
123
+ React, and parity tests check that both render the same markup.
124
+
125
+ ## License
126
+
127
+ [MIT](LICENSE)
@@ -0,0 +1,34 @@
1
+ import { ButtonHTMLAttributes, MouseEvent, ReactNode } from 'react';
2
+ import { IconName } from '../../types';
3
+ export interface EcoButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "onClick"> {
4
+ variant?: "primary" | "secondary" | "tertiary" | "danger" | "onfill" | "ghostfill";
5
+ size?: "md" | "sm";
6
+ /** Fill the container width. */
7
+ wide?: boolean;
8
+ /** Leading RemixIcon name. */
9
+ icon?: IconName;
10
+ /** Trailing arrow-style icon (rendered with the `arr` nudge). */
11
+ iconEnd?: IconName;
12
+ /** Text label; `children` override it. */
13
+ label?: string;
14
+ type?: "button" | "submit" | "reset";
15
+ disabled?: boolean;
16
+ /**
17
+ * The action is running: a spinner replaces the leading icon, `aria-busy` and
18
+ * `aria-disabled` are set, and clicks (and form submits) are ignored. The button keeps its
19
+ * variant colour (`is-loading`) and its focus. An `href` button renders as a button meanwhile.
20
+ */
21
+ loading?: boolean;
22
+ /** Render as a link. */
23
+ href?: string;
24
+ onClick?: (event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
25
+ children?: ReactNode;
26
+ }
27
+ /**
28
+ * Button — one `primary` (or `danger`) per region; everything else secondary,
29
+ * tertiary or an icon button. `onfill` / `ghostfill` sit on the hero wash only.
30
+ * Name the consequence on a destructive button: "Delete request", never "OK".
31
+ * While its action runs, set `loading`: the leading icon becomes a spinner, the label stays
32
+ * (so the width barely moves), the variant keeps its colour and clicks are ignored.
33
+ */
34
+ export declare const EcoButton: import('react').ForwardRefExoticComponent<EcoButtonProps & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
@@ -0,0 +1,43 @@
1
+ import { ButtonHTMLAttributes, MouseEvent } from 'react';
2
+ import { IconName } from '../../types';
3
+ export interface EcoIconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "children" | "onClick"> {
4
+ /** Accessible name, rendered as `aria-label`. Required: the button has no visible text. */
5
+ label: string;
6
+ /** RemixIcon name. Defaults to `star-line` / `star-fill` for a star toggle. */
7
+ icon?: IconName;
8
+ /** Icon while pressed (the filled glyph). */
9
+ iconPressed?: IconName;
10
+ /** `aria-label` while pressed, e.g. "Remove star" against "Add star". */
11
+ labelPressed?: string;
12
+ size?: "md" | "sm";
13
+ /** Outlined (`iconbtn--out`). */
14
+ outlined?: boolean;
15
+ /** Star toggle (`iconbtn--star`); implies a pressed state. */
16
+ star?: boolean;
17
+ /** Unread dot (`iconbtn__dot`). */
18
+ dot?: boolean;
19
+ /** Hover tooltip text (`data-tip`). */
20
+ tip?: string;
21
+ type?: "button" | "submit" | "reset";
22
+ disabled?: boolean;
23
+ /**
24
+ * The action is running: the glyph becomes a spinner, `aria-busy` and `aria-disabled` are set,
25
+ * and clicks (including a toggle) are ignored. The button keeps its focus.
26
+ */
27
+ loading?: boolean;
28
+ /** Pressed state (controlled). Leave `pressed` and `defaultPressed` unset for a plain action button. */
29
+ pressed?: boolean;
30
+ /** Initial pressed state when uncontrolled; setting it makes the button a toggle. */
31
+ defaultPressed?: boolean;
32
+ /** The pressed state changed (v-model:pressed). */
33
+ onPressedChange?: (pressed: boolean) => void;
34
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
35
+ }
36
+ /**
37
+ * IconButton — an icon-only button: default, small, outlined, with an unread dot, or a star toggle.
38
+ * Every icon-only button needs an `aria-label` (the required `label`); `tip` adds the hover tooltip,
39
+ * which is not a substitute for it. A toggled-on icon takes the filled glyph (`ri-star-fill`), and
40
+ * `is-on` carries the colour change only. While its action runs, set `loading`: the glyph becomes
41
+ * a spinner and clicks are ignored; the `label` still names the action.
42
+ */
43
+ export declare const EcoIconButton: import('react').ForwardRefExoticComponent<EcoIconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,20 @@
1
+ import { AnchorHTMLAttributes, ReactNode } from 'react';
2
+ export interface EcoLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "type"> {
3
+ /** Navigate to this URL (renders an anchor). Without it the link is a button. */
4
+ href?: string;
5
+ /** Text label; `children` override it. */
6
+ label?: string;
7
+ /** Underlined (`link--ul`). */
8
+ underline?: boolean;
9
+ /** Trailing arrow (`arr ri-arrow-right-line`). */
10
+ arrow?: boolean;
11
+ type?: "button" | "submit" | "reset";
12
+ disabled?: boolean;
13
+ children?: ReactNode;
14
+ }
15
+ /**
16
+ * Link — an inline text link: plain, underlined (`link--ul`), or with a trailing arrow that
17
+ * nudges on hover. Renders an `<a>` with `href`, otherwise a `<button>` for an in-page action
18
+ * ("Mark all as read").
19
+ */
20
+ export declare const EcoLink: import('react').ForwardRefExoticComponent<EcoLinkProps & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
@@ -0,0 +1,28 @@
1
+ import { HTMLAttributes, MouseEvent, ReactNode } from 'react';
2
+ import { IconName } from '../../types';
3
+ export interface EcoSplitButtonProps extends Omit<HTMLAttributes<HTMLDivElement>, "onClick" | "children"> {
4
+ /** Main action label; `children` override it. */
5
+ label?: string;
6
+ /** Leading RemixIcon on the main action. */
7
+ icon?: IconName;
8
+ /** Accessible name (and tooltip) of the caret, e.g. "Schedule send". */
9
+ menuLabel: string;
10
+ /** `id` of the menu the caret controls (`aria-controls`). */
11
+ menuId?: string;
12
+ disabled?: boolean;
13
+ /** Whether the menu is open (controlled; v-model:open). Drives `aria-expanded` and the chevron. */
14
+ open?: boolean;
15
+ defaultOpen?: boolean;
16
+ onOpenChange?: (open: boolean) => void;
17
+ /** The main action was pressed. */
18
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
19
+ /** The caret was pressed; open your menu. */
20
+ onMenu?: (event: MouseEvent<HTMLButtonElement>) => void;
21
+ children?: ReactNode;
22
+ }
23
+ /**
24
+ * SplitButton — a primary action with a caret that opens related choices ("Send" / "Schedule
25
+ * send"). The main half calls `onClick`; the caret calls `onMenu` and toggles `open`, which
26
+ * drives `aria-expanded` and rotates the chevron. Pair it with an `EcoMenu` for the choices.
27
+ */
28
+ export declare function EcoSplitButton({ label, icon, menuLabel, menuId, disabled, open: openProp, defaultOpen, onOpenChange, onClick, onMenu, children, className, ...rest }: EcoSplitButtonProps): import('react').JSX.Element;
@@ -0,0 +1,8 @@
1
+ export { EcoButton } from './EcoButton';
2
+ export type { EcoButtonProps } from './EcoButton';
3
+ export { EcoIconButton } from './EcoIconButton';
4
+ export type { EcoIconButtonProps } from './EcoIconButton';
5
+ export { EcoLink } from './EcoLink';
6
+ export type { EcoLinkProps } from './EcoLink';
7
+ export { EcoSplitButton } from './EcoSplitButton';
8
+ export type { EcoSplitButtonProps } from './EcoSplitButton';
@@ -0,0 +1,33 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { ChartLegendItem } from './types';
3
+ /** What every chart passes through to its frame: the head, actions and footer slots, and root attributes. */
4
+ export interface ChartFrameSlots extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "children"> {
5
+ /** Replaces the whole head (title, sub-title and actions). */
6
+ head?: ReactNode;
7
+ /** Beside the title in `chart__head`: a Chart | Table toggle, a menu. */
8
+ actions?: ReactNode;
9
+ /** After the legend and the caption. */
10
+ footer?: ReactNode;
11
+ }
12
+ export interface ChartFrameProps extends ChartFrameSlots {
13
+ title?: string;
14
+ subtitle?: string;
15
+ /** A bare `h3.chart__t` with no head (small multiples). */
16
+ bare?: boolean;
17
+ empty?: boolean;
18
+ emptyIcon?: string;
19
+ emptyTitle?: string;
20
+ emptyText?: string;
21
+ emptyHeight?: number;
22
+ legend?: ChartLegendItem[];
23
+ /** Put the legend above the figure (DivergingBarChart names both sides first). */
24
+ legendFirst?: boolean;
25
+ caption?: string;
26
+ children?: ReactNode;
27
+ }
28
+ /**
29
+ * Internal frame shared by the charts: `chart` → optional `chart__head` (title, sub-title,
30
+ * actions) → the figure, or `chart__empty` at the chart's height so the card does not jump →
31
+ * `legend legend--row` → optional caption. Not exported.
32
+ */
33
+ export declare function ChartFrame({ title, subtitle, bare, empty, emptyIcon, emptyTitle, emptyText, emptyHeight, legend, legendFirst, caption, head, actions, footer, children, className, ...rest }: ChartFrameProps): import('react').JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { ChartFrameSlots } from './ChartFrame';
2
+ import { ChartFormat, ChartSlot } from './types';
3
+ export interface EcoAreaChartProps extends ChartFrameSlots {
4
+ /** Period labels ("Mar"…"Oct"). */
5
+ labels: string[];
6
+ data: number[];
7
+ /** Series slot; `1` is the accent. */
8
+ seriesSlot?: ChartSlot;
9
+ /** Highlighted label (index or text), in accent. Defaults to the latest. */
10
+ current?: number | string;
11
+ /** Text after each value in the tipbox: "requests". */
12
+ unit?: string;
13
+ valueFormat?: ChartFormat;
14
+ /** Long period names for the hit labels ("March 2026"). */
15
+ titles?: string[];
16
+ /** Small multiple: no month labels, a bare title. */
17
+ small?: boolean;
18
+ /** Shared scale ceiling for small multiples. Default: this series' maximum. */
19
+ max?: number;
20
+ height?: number;
21
+ width?: number;
22
+ title?: string;
23
+ subtitle?: string;
24
+ caption?: string;
25
+ ariaLabel?: string;
26
+ emptyTitle?: string;
27
+ emptyText?: string;
28
+ /** The point under the pointer or focus, or `null` when none. */
29
+ onActiveChange?: (index: number | null) => void;
30
+ }
31
+ /**
32
+ * AreaChart — one series over time, drawn the way the system's cards draw it: a smoothed curve,
33
+ * a gradient fading from 22% to nothing at the baseline, a dot on every point and a `tipbox`
34
+ * per point on hover or focus. For a volume (requests received, storage used), never a rate.
35
+ * No y-axis: lead with the figure in the head. `small` drops the month labels for small multiples;
36
+ * pass a shared `max` so the multiples share a scale.
37
+ */
38
+ export declare function EcoAreaChart({ labels, data, seriesSlot, current, unit, valueFormat, titles, small, max, height, width, title, subtitle, caption, ariaLabel, emptyTitle, emptyText, onActiveChange, ...frame }: EcoAreaChartProps): import('react').JSX.Element;
@@ -0,0 +1,65 @@
1
+ import { ChartFrameSlots } from './ChartFrame';
2
+ import { BarChartForm, ChartFormat, ChartSeries, ChartTooltipData } from './types';
3
+ export interface EcoBarChartProps extends ChartFrameSlots {
4
+ /** Period or category labels on the axis ("Mar", "Site reliability"). */
5
+ labels: string[];
6
+ /** One series: a value per label. */
7
+ data?: (number | null)[];
8
+ /** Stacked series, bottom segment first (largest at the bottom). */
9
+ series?: ChartSeries[];
10
+ /** Defaults to `stacked` when `series` is given, else `columns`. */
11
+ form?: BarChartForm;
12
+ /** Last period's values for the `ghost` form. */
13
+ ghost?: (number | null)[];
14
+ /** Legend name of this period (`ghost` form). */
15
+ name?: string;
16
+ /** Legend name of the ghost line. */
17
+ ghostName?: string;
18
+ /** Highlighted label (index or label text): `xl on`, and the emphasised bar. Defaults to the latest. */
19
+ current?: number | string;
20
+ /** A target hairline with its label. */
21
+ target?: number;
22
+ targetLabel?: string;
23
+ /** Long period names for the tooltip and the hit labels ("October 2026"). Default: `labels`. */
24
+ titles?: string[];
25
+ /** Unit after the figure: "requests closed", "open". */
26
+ unit?: string;
27
+ /** Formats every figure in the tooltip and the hit labels. */
28
+ valueFormat?: ChartFormat;
29
+ /** Formats cap labels and legend values (e.g. "$74.9k"). Default: `valueFormat`. */
30
+ capFormat?: ChartFormat;
31
+ /** Formats y ticks. Default: `capFormat`. */
32
+ tickFormat?: ChartFormat;
33
+ /** Show a y-axis with dashed gridlines. Default: on for `ghost`, and for `stacked` past 8 periods. */
34
+ axis?: boolean;
35
+ /** viewBox height (px at the measured width). Default 234; horizontal grows with the rows. */
36
+ height?: number;
37
+ /** Fix the viewBox width instead of measuring the frame. */
38
+ width?: number;
39
+ /** Space for the names in the horizontal form. */
40
+ nameWidth?: number;
41
+ /** Denominator for the share in the horizontal form. Default: the sum of `data`. */
42
+ total?: number;
43
+ title?: string;
44
+ subtitle?: string;
45
+ caption?: string;
46
+ ariaLabel?: string;
47
+ legend?: boolean;
48
+ emptyTitle?: string;
49
+ emptyText?: string;
50
+ /** Override the tooltip card for a band. */
51
+ tooltip?: (index: number) => ChartTooltipData;
52
+ /** Override the hit area's label for a band. */
53
+ pointLabel?: (index: number) => string;
54
+ /** The band under the pointer or focus, or `null` when none. */
55
+ onActiveChange?: (index: number | null) => void;
56
+ }
57
+ /**
58
+ * BarChart — magnitude compared across periods or categories: flat columns or bars from zero,
59
+ * 60% of the band (at most 64 units), a 3px radius on the data end only, a strong baseline.
60
+ * Forms: `columns` (values on the caps, no axis), `ghost` (against last period, with a scale),
61
+ * `stacked` (parts of a whole; with a y-axis past eight periods), `horizontal` (long names) and
62
+ * `emphasis` (one bar in accent, the rest `s-rest`, optionally against a `target`).
63
+ * Label the caps or keep the axis, never both. Hover or focus a band for its ChartTooltip.
64
+ */
65
+ export declare function EcoBarChart({ labels, data, series, form, ghost, name, ghostName, current, target, targetLabel, titles, unit, valueFormat, capFormat, tickFormat, axis, height, width, nameWidth, total, title, subtitle, caption, ariaLabel, legend, emptyTitle, emptyText, tooltip, pointLabel, onActiveChange, ...frame }: EcoBarChartProps): import('react').JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { BarListItem, ChartFormat } from './types';
3
+ export interface EcoBarListProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "children"> {
4
+ /** Rows in rank order. */
5
+ items: BarListItem[];
6
+ /** Group title (`h4.barlist__t`), for two related rankings. */
7
+ title?: string;
8
+ /** Show the top N and a "Show all" button. */
9
+ limit?: number;
10
+ /** What the rows are, for the footer caption: "product lines". */
11
+ noun?: string;
12
+ /** The whole the shares are of (including rows the list does not show). Default: the sum. */
13
+ total?: number;
14
+ /** Print the share column. Leave it off where a share means nothing, as with changes. */
15
+ showShare?: boolean;
16
+ /** Scale bars to this instead of the largest item (share one scale across groups). */
17
+ scaleMax?: number;
18
+ valueFormat?: ChartFormat;
19
+ /** Text when there are no rows: "No sales recorded for this store in May." */
20
+ emptyText?: string;
21
+ /** Whether every row is shown (controlled; v-model:expanded). */
22
+ expanded?: boolean;
23
+ defaultExpanded?: boolean;
24
+ onExpandedChange?: (expanded: boolean) => void;
25
+ }
26
+ /**
27
+ * BarList — a ranked list of named values: a two-line label, the value, its share of the total
28
+ * and Meter's bar scaled to the largest item. A real `ol`, because the order is the ranking.
29
+ * `limit` shows the top N with a "Show all" disclosure; `scaleMax` scales two related groups
30
+ * (increases and decreases) to one largest absolute change. Bars are `aria-hidden`: the value and
31
+ * the share are always in the row as text.
32
+ */
33
+ export declare function EcoBarList({ items, title, limit, noun, total, showShare, scaleMax, valueFormat, emptyText, expanded: expandedProp, defaultExpanded, onExpandedChange, className, ...rest }: EcoBarListProps): import('react').JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { ChartAnchor, ChartTooltipRow } from './types';
3
+ export interface EcoChartTooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "children"> {
4
+ /** The period: "October 2026". */
5
+ title?: string;
6
+ /** Headline figure; "—" when the period has no data. */
7
+ total?: string;
8
+ unit?: string;
9
+ rows?: ChartTooltipRow[];
10
+ note?: string;
11
+ /** Shown (removes `hidden`). */
12
+ open?: boolean;
13
+ /** The mark, in px relative to `chart__fig`. The card is placed beside it and clamped to the frame. */
14
+ anchor?: ChartAnchor | null;
15
+ /** Render in flow (for documentation and static cards) instead of absolutely placed. */
16
+ inline?: boolean;
17
+ /** Escape was pressed while the card was open. */
18
+ onClose?: () => void;
19
+ /** Extra content at the end of the card. */
20
+ children?: ReactNode;
21
+ }
22
+ /**
23
+ * ChartTooltip — the `ctip` card that opens beside the column or point under the pointer or
24
+ * keyboard focus: the period as a title, a total, one keyed row per series (top segment first)
25
+ * and a note. Place it inside `chart__fig`, after the `svg`. It stays `aria-hidden`: the hit
26
+ * area's label already says everything. Escape closes it.
27
+ */
28
+ export declare function EcoChartTooltip({ title, total, unit, rows, note, open, anchor, inline, onClose, children, className, style, ...rest }: EcoChartTooltipProps): import('react').JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { ChartFrameSlots } from './ChartFrame';
2
+ import { ChartFormat, ChartTooltipData, DivergingDatum } from './types';
3
+ export interface EcoDivergingBarChartProps extends ChartFrameSlots {
4
+ data: DivergingDatum[];
5
+ /** Words for the side above the line. */
6
+ overLabel?: string;
7
+ /** Words for the side below the line. */
8
+ underLabel?: string;
9
+ /** Full figures for the tooltip and hit labels ("$15,800"). */
10
+ valueFormat?: ChartFormat;
11
+ /** Tick figures without a sign ("$10k"); the chart adds "+" / "−". */
12
+ tickFormat?: ChartFormat;
13
+ height?: number;
14
+ width?: number;
15
+ title?: string;
16
+ subtitle?: string;
17
+ caption?: string;
18
+ ariaLabel?: string;
19
+ legend?: boolean;
20
+ emptyTitle?: string;
21
+ emptyText?: string;
22
+ tooltip?: (index: number) => ChartTooltipData;
23
+ /** The period under the pointer or focus, or `null` when none. */
24
+ onActiveChange?: (index: number | null) => void;
25
+ }
26
+ /**
27
+ * DivergingBarChart — two opposed amounts per period, growing up and down from one strong zero
28
+ * line: over above it in `s1`, under below it in `s6`. One shared "nice" scale, signed ticks,
29
+ * bars 60% of the band (at most 26 units) that stop 1px short of zero, a 3px stub for a tiny
30
+ * amount, and a two-line month / year axis thinned from the latest. Never red and green: the sides
31
+ * are named in words in the legend, the ticks, the tooltip and every hit label.
32
+ */
33
+ export declare function EcoDivergingBarChart({ data, overLabel, underLabel, valueFormat, tickFormat, height, width, title, subtitle, caption, ariaLabel, legend, emptyTitle, emptyText, tooltip, onActiveChange, ...frame }: EcoDivergingBarChartProps): import('react').JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { ChartFrameSlots } from './ChartFrame';
2
+ import { ChartFormat, ChartSlice } from './types';
3
+ export interface EcoDonutChartProps extends ChartFrameSlots {
4
+ data: ChartSlice[];
5
+ /** The figure in the hole. Default: the sum of the slices. */
6
+ total?: string | number;
7
+ /** The small caps line under it: "Requests", "of 500". */
8
+ centerLabel?: string;
9
+ size?: number;
10
+ sort?: boolean;
11
+ legendValue?: "percent" | "value";
12
+ valueFormat?: ChartFormat;
13
+ title?: string;
14
+ subtitle?: string;
15
+ caption?: string;
16
+ ariaLabel?: string;
17
+ legend?: boolean;
18
+ emptyTitle?: string;
19
+ emptyText?: string;
20
+ }
21
+ /**
22
+ * DonutChart — a pie with its middle given back: the same part-to-whole reading plus the total
23
+ * the slices add up to (or the one ratio the ring is about) in `donut__n`, with its label in
24
+ * `donut__l`. Six slices at most, never for comparing close values, always a legend with numbers.
25
+ * For a single ratio against a limit, pass two slices and give the remainder `slot: "rest"`.
26
+ */
27
+ export declare function EcoDonutChart({ data, total, centerLabel, size, sort, legendValue, valueFormat, title, subtitle, caption, ariaLabel, legend, emptyTitle, emptyText, ...frame }: EcoDonutChartProps): import('react').JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { ChartFrameSlots } from './ChartFrame';
2
+ import { ChartFormat, ChartSeries, ChartTooltipData } from './types';
3
+ export interface EcoLineChartProps extends ChartFrameSlots {
4
+ labels: string[];
5
+ /** Two to four series, in slot order. */
6
+ series: ChartSeries[];
7
+ /** The one series the story is about (index or name); the others turn grey and lose their labels. */
8
+ emphasis?: number | string;
9
+ /** Value beside each line's last point. Default: on for four series or fewer. */
10
+ endLabels?: boolean;
11
+ valueFormat?: ChartFormat;
12
+ tickFormat?: ChartFormat;
13
+ /** Long period names for the tooltip ("October 2026"). */
14
+ titles?: string[];
15
+ height?: number;
16
+ width?: number;
17
+ title?: string;
18
+ subtitle?: string;
19
+ caption?: string;
20
+ ariaLabel?: string;
21
+ legend?: boolean;
22
+ emptyTitle?: string;
23
+ emptyText?: string;
24
+ tooltip?: (index: number) => ChartTooltipData;
25
+ /** The period under the pointer or focus, or `null` when none. */
26
+ onActiveChange?: (index: number | null) => void;
27
+ }
28
+ /**
29
+ * LineChart — change over time: a 2px line per series in its slot, a dot on the last point and
30
+ * the value beside it. Two to four series; one y-axis only. Label the line ends rather than every
31
+ * point. `emphasis` keeps one series in its slot colour and greys the rest (`--text-disabled`),
32
+ * which is almost always clearer than several colours competing. Hover or focus a period for a
33
+ * ChartTooltip listing every series.
34
+ */
35
+ export declare function EcoLineChart({ labels, series, emphasis, endLabels, valueFormat, tickFormat, titles, height, width, title, subtitle, caption, ariaLabel, legend, emptyTitle, emptyText, tooltip, onActiveChange, ...frame }: EcoLineChartProps): import('react').JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { ChartFrameSlots } from './ChartFrame';
2
+ import { ChartFormat, ChartSlice } from './types';
3
+ export interface EcoPieChartProps extends ChartFrameSlots {
4
+ data: ChartSlice[];
5
+ /** viewBox size; the radius is half of it less 6. */
6
+ size?: number;
7
+ /** Largest first (default). Turn off when the categories carry an order. */
8
+ sort?: boolean;
9
+ /** What the legend prints beside each label. */
10
+ legendValue?: "percent" | "value";
11
+ valueFormat?: ChartFormat;
12
+ title?: string;
13
+ subtitle?: string;
14
+ caption?: string;
15
+ ariaLabel?: string;
16
+ legend?: boolean;
17
+ emptyTitle?: string;
18
+ emptyText?: string;
19
+ }
20
+ /**
21
+ * PieChart — part-to-whole at a glance: up to six slices, each a categorical slot, separated by a
22
+ * 2px gap in the surface. Slices run clockwise from twelve o'clock, largest first. Past six, the
23
+ * tail is grouped into "Other". Always ships the legend with numbers beside it: a pie without
24
+ * numbers asks the reader to estimate angles. For "which is bigger", use a bar chart.
25
+ */
26
+ export declare function EcoPieChart({ data, size, sort, legendValue, valueFormat, title, subtitle, caption, ariaLabel, legend, emptyTitle, emptyText, ...frame }: EcoPieChartProps): import('react').JSX.Element;