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,35 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { IconName } from '../../types';
3
+ import { EcoToastTone } from './types';
4
+ export interface EcoToastProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "children"> {
5
+ title: string;
6
+ /** The line under the title; `children` override it. */
7
+ description?: string;
8
+ /** `accent` (no modifier) is the default rule for progress. */
9
+ tone?: EcoToastTone;
10
+ /** Override the tone's fixed icon (normally leave it). */
11
+ icon?: IconName;
12
+ /**
13
+ * The action: a label renders the action link (calls `onAction`); any other node replaces the
14
+ * link (the `#action` slot).
15
+ */
16
+ action?: ReactNode;
17
+ dismissible?: boolean;
18
+ /** Set while the toast plays its exit transition (drops `is-in`). */
19
+ leaving?: boolean;
20
+ dismissLabel?: string;
21
+ /** The × was pressed. */
22
+ onDismiss?: () => void;
23
+ /** The action link was pressed. */
24
+ onAction?: () => void;
25
+ /** Replaces `description` (the default slot). */
26
+ children?: ReactNode;
27
+ }
28
+ /**
29
+ * Toast — a title you can read in half a second, plus an optional line that says what it means.
30
+ * The type carries the status through the left rule and a fixed icon; the surface stays white.
31
+ * Title is a fact ("Rotation failed"); the description says what did not happen and what to do.
32
+ * One action at most — a toast that needs two decisions needs to be a Dialog.
33
+ * Usually rendered by `EcoToaster` from `useToast()`; usable on its own too.
34
+ */
35
+ export declare function EcoToast({ title, description, tone, icon, action, dismissible, leaving, dismissLabel, onDismiss, onAction, children, className, ...rest }: EcoToastProps): import('react').JSX.Element;
@@ -0,0 +1,9 @@
1
+ export interface EcoToasterProps {
2
+ /** Portal target: a CSS selector (default `body`). Nothing renders while it matches nothing. */
3
+ to?: string;
4
+ }
5
+ /**
6
+ * Toaster — the fixed bottom-left `toasts` stack that shows what `useToast()` pushes,
7
+ * newest at the bottom. Mount it once near the root of the app.
8
+ */
9
+ export declare function EcoToaster({ to }: EcoToasterProps): import('react').ReactPortal | null;
@@ -0,0 +1,26 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { EcoTooltipPlacement } from './types';
3
+ export interface EcoTooltipProps extends Omit<HTMLAttributes<HTMLSpanElement>, "content" | "children"> {
4
+ /** The tooltip text: a few words, no full stop ("Copy link"). `content` overrides it. */
5
+ text?: string;
6
+ /** Side of the trigger the bubble opens on; `start` / `end` follow the writing direction. */
7
+ placement?: EcoTooltipPlacement;
8
+ /** Renders no bubble and removes the trigger's `aria-describedby`. */
9
+ disabled?: boolean;
10
+ /** Richer bubble content (a shortcut, a short emphasis); replaces `text` (the `#content` slot). */
11
+ content?: ReactNode;
12
+ /** Exactly one focusable trigger. Its first element gets `aria-describedby` pointing at the bubble. */
13
+ children?: ReactNode;
14
+ }
15
+ /**
16
+ * Tooltip — a short label for a control that has no visible text: what the icon does, or the
17
+ * shortcut. Wrap exactly one focusable element; it gets `aria-describedby` pointing at the
18
+ * bubble. Never put the control's only name in a tooltip (an icon button still needs its
19
+ * `aria-label`), never put anything to click inside one, and do not also set the trigger's own
20
+ * `tip`. Opens on hover after the same 400ms delay as `[data-tip]`, at once on keyboard focus;
21
+ * closes on mouseleave, blur and Escape (which it consumes, so a surrounding dialog stays open).
22
+ * The bubble is positioned against the inline wrapper, not portalled: pick a `placement` that
23
+ * stays clear of clipping containers. Like `[data-tip]`, the bubble is not shown on touch
24
+ * screens or below 1024px; the description still reaches assistive tech there.
25
+ */
26
+ export declare function EcoTooltip({ text, placement, disabled, content, children, className, onMouseEnter, onMouseLeave, onPointerDown, onFocus, onBlur, ...rest }: EcoTooltipProps): import('react').JSX.Element;
@@ -0,0 +1,25 @@
1
+ export { EcoMenu } from './EcoMenu';
2
+ export type { EcoMenuProps, EcoMenuHandle, EcoMenuScope, EcoMenuTriggerAttrs, EcoMenuTriggerScope } from './EcoMenu';
3
+ export { EcoDialog } from './EcoDialog';
4
+ export type { EcoDialogProps, EcoDialogFooterScope } from './EcoDialog';
5
+ export { EcoDrawer } from './EcoDrawer';
6
+ export type { EcoDrawerProps, EcoDrawerScope } from './EcoDrawer';
7
+ export { EcoComposeModal } from './EcoComposeModal';
8
+ export type { EcoComposeModalProps, EcoComposeMessage } from './EcoComposeModal';
9
+ export { EcoToast } from './EcoToast';
10
+ export type { EcoToastProps } from './EcoToast';
11
+ export { EcoToaster } from './EcoToaster';
12
+ export type { EcoToasterProps } from './EcoToaster';
13
+ export { EcoNotice } from './EcoNotice';
14
+ export type { EcoNoticeProps } from './EcoNotice';
15
+ export { EcoNotifications } from './EcoNotifications';
16
+ export type { EcoNotificationsProps, EcoNotificationsTriggerAttrs, EcoNotificationsTriggerScope } from './EcoNotifications';
17
+ export { EcoSpinner } from './EcoSpinner';
18
+ export type { EcoSpinnerProps } from './EcoSpinner';
19
+ export { EcoConfirmHost } from './EcoConfirmHost';
20
+ export type { EcoConfirmHostProps } from './EcoConfirmHost';
21
+ export { EcoTooltip } from './EcoTooltip';
22
+ export type { EcoTooltipProps } from './EcoTooltip';
23
+ export { useToast } from './useToast';
24
+ export { useConfirm } from './useConfirm';
25
+ export type * from './types';
@@ -0,0 +1,94 @@
1
+ import { IconName, ToastTone } from '../../types';
2
+ /** One entry in an `EcoMenu`. */
3
+ export interface EcoMenuItem {
4
+ /**
5
+ * - `item` (default): an action (`menuitem`) that runs and closes the menu.
6
+ * - `checkbox`: toggles membership in `checked` without closing (`check` box, `on`).
7
+ * - `radio`: a single choice with a `tick`, sets `selected` and closes.
8
+ * - `separator`: a `menu__sep` rule. `head`: a `menu__head` caption.
9
+ */
10
+ type?: "item" | "checkbox" | "radio" | "separator" | "head";
11
+ label?: string;
12
+ /** Value for checkbox/radio entries (defaults to `label`). */
13
+ value?: string | number;
14
+ /** Leading icon (actions only; give every entry one or none). */
15
+ icon?: IconName;
16
+ /** Destructive action, placed last after a separator (`menu__opt--danger`). */
17
+ danger?: boolean;
18
+ disabled?: boolean;
19
+ }
20
+ export type EcoToastTone = ToastTone;
21
+ /** `EcoNotice` status colour. `warning` (the default) is the original look; `info` uses the accent. */
22
+ export type EcoNoticeTone = "warning" | "info" | "success" | "danger";
23
+ /** Side of the trigger an `EcoTooltip` opens on; `start` / `end` follow the writing direction. */
24
+ export type EcoTooltipPlacement = "top" | "bottom" | "start" | "end";
25
+ export interface EcoToastOptions {
26
+ /** A fact, not a sentence: "Rotation failed". */
27
+ title: string;
28
+ /** The consequence: what did not happen and what to do. */
29
+ description?: string;
30
+ /** `accent` (no modifier) is for progress that is neither good nor bad news. */
31
+ tone?: EcoToastTone;
32
+ /** Override the tone's fixed icon (normally leave it). */
33
+ icon?: IconName;
34
+ /** One action link at most. */
35
+ action?: string;
36
+ onAction?: () => void;
37
+ /** Auto-dismiss after this many ms. `0` keeps it until dismissed. Default 6000. */
38
+ duration?: number;
39
+ dismissible?: boolean;
40
+ }
41
+ export interface EcoToastItem extends EcoToastOptions {
42
+ id: number;
43
+ /** True while the toast plays its exit transition. */
44
+ leaving: boolean;
45
+ }
46
+ /** One row in `EcoNotifications`. */
47
+ export interface EcoNotification {
48
+ id: string | number;
49
+ /** Person or event, e.g. "Grace Kim". */
50
+ title: string;
51
+ /** One line of what happened. */
52
+ text?: string;
53
+ /** Short date, e.g. "Aug 8". */
54
+ date?: string;
55
+ unread?: boolean;
56
+ /** Icon style: reply, follow-up, error or system (`nrow__ico--*`). */
57
+ kind?: "reply" | "fup" | "err" | "sys";
58
+ /** Override the kind's icon. */
59
+ icon?: IconName;
60
+ /** Section heading within the "All" tab (`notif__sec`), and the tab key it belongs to. */
61
+ category?: string;
62
+ /** Optional sub-section heading inside a category tab (e.g. "Needs a follow-up"). */
63
+ section?: string;
64
+ }
65
+ export interface EcoNotificationTab {
66
+ /** Matches `EcoNotification.category`; the special key `all` shows every row grouped by category. */
67
+ key: string;
68
+ label: string;
69
+ /** Plain count in `tab__n`; omitted = no count. */
70
+ count?: number;
71
+ }
72
+ /** Formatting commands reported by `EcoComposeModal`'s toolbar (`onFormat`). */
73
+ export type EcoComposeFormat = "b" | "i" | "u" | "ul" | "ol" | "quote" | "link" | "clear";
74
+ /** What `useConfirm()` asks; `<EcoConfirmHost />` renders it as an `EcoDialog`. */
75
+ export interface EcoConfirmOptions {
76
+ /** The question, as the dialog title: "Delete this report?". */
77
+ title: string;
78
+ /** The dialog subtitle: what happens, and for a destructive action what is lost. */
79
+ text?: string;
80
+ /** The commit button. Required: name the consequence ("Delete report"), never "OK". */
81
+ confirmLabel: string;
82
+ /** The button that backs out. Default "Cancel"; "Keep it" reads better beside a deletion. */
83
+ cancelLabel?: string;
84
+ /** The commit becomes `btn--danger`. */
85
+ danger?: boolean;
86
+ /**
87
+ * Runs on commit. The commit button shows its spinner and the dialog cannot be dismissed
88
+ * meanwhile. When it settles the dialog closes and the promise resolves `true`; when it throws
89
+ * the dialog stays open for a retry or a cancel, and reporting the error is up to you.
90
+ */
91
+ onConfirm?: () => unknown;
92
+ }
93
+ /** The function `useConfirm()` returns: resolves `true` once confirmed, `false` otherwise. */
94
+ export type EcoConfirm = (options: EcoConfirmOptions) => Promise<boolean>;
@@ -0,0 +1,43 @@
1
+ import { EcoConfirm, EcoConfirmOptions } from './types';
2
+ /** One queued question. Internal: the host reads it, callers only see the promise. */
3
+ export interface ConfirmRequest extends EcoConfirmOptions {
4
+ id: number;
5
+ resolve: (ok: boolean) => void;
6
+ }
7
+ interface ConfirmState {
8
+ queue: readonly ConfirmRequest[];
9
+ hosts: readonly symbol[];
10
+ }
11
+ /** Internal: the store `EcoConfirmHost` reads with `useSyncExternalStore`. */
12
+ export declare const confirmStore: {
13
+ subscribe(listener: () => void): () => void;
14
+ get(): ConfirmState;
15
+ };
16
+ /** Resolve a request and take it off the queue (host only). */
17
+ export declare function settleConfirm(req: ConfirmRequest, ok: boolean): void;
18
+ export declare function addConfirmHost(id: symbol): void;
19
+ /** When the last host goes, nothing can answer what is still queued: those resolve `false`. */
20
+ export declare function removeConfirmHost(id: symbol): void;
21
+ /**
22
+ * Ask for a confirmation from anywhere; mount one `<EcoConfirmHost />` near the app root to show it.
23
+ * Questions queue and show one at a time. Not a hook in the React sense: it returns the same
24
+ * function every time and can be called outside components.
25
+ *
26
+ * ```ts
27
+ * const confirm = useConfirm();
28
+ * const ok = await confirm({
29
+ * title: "Delete this report?",
30
+ * text: "It disappears for everyone. This cannot be undone.",
31
+ * confirmLabel: "Delete report",
32
+ * cancelLabel: "Keep it",
33
+ * danger: true,
34
+ * onConfirm: () => api.deleteReport(id), // commit shows loading; throw to keep the dialog open
35
+ * });
36
+ * ```
37
+ *
38
+ * Resolves `true` once confirmed (after `onConfirm` succeeds), `false` on Cancel, ×, Escape or the
39
+ * scrim. Without a mounted host it logs one console error and resolves `false`; on the server it
40
+ * resolves `false`.
41
+ */
42
+ export declare function useConfirm(): EcoConfirm;
43
+ export {};
@@ -0,0 +1,38 @@
1
+ import { EcoToastItem, EcoToastOptions } from './types';
2
+ /** Default auto-dismiss delay in ms. */
3
+ export declare const TOAST_DURATION = 6000;
4
+ /** Internal: the store `EcoToaster` reads with `useSyncExternalStore`. */
5
+ export declare const toastStore: {
6
+ subscribe(listener: () => void): () => void;
7
+ get(): readonly EcoToastItem[];
8
+ };
9
+ declare function dismiss(id: number): void;
10
+ declare function push(options: EcoToastOptions): number;
11
+ declare function clear(): void;
12
+ type Shortcut = (title: string, options?: Omit<EcoToastOptions, "title" | "tone">) => number;
13
+ declare const api: {
14
+ /** The queue, oldest first: read when accessed (`toast.toasts`), not a subscription. */
15
+ readonly toasts: readonly Readonly<EcoToastItem>[];
16
+ push: typeof push;
17
+ dismiss: typeof dismiss;
18
+ clear: typeof clear;
19
+ success: Shortcut;
20
+ warning: Shortcut;
21
+ danger: Shortcut;
22
+ info: Shortcut;
23
+ /** The accent rule, for progress that is neither good nor bad news. */
24
+ accent: Shortcut;
25
+ };
26
+ /**
27
+ * Push toasts from anywhere (components, event handlers, plain modules); mount one
28
+ * `<EcoToaster />` near the app root to show them. Not a hook in the React sense: it holds no
29
+ * state of its own and can be called outside components. `toasts` is the queue at the moment you
30
+ * read it; `<EcoToaster />` is what re-renders on change.
31
+ *
32
+ * ```ts
33
+ * const toast = useToast();
34
+ * toast.success("Destination added", { description: "Primary cluster is receiving traffic." });
35
+ * ```
36
+ */
37
+ export declare function useToast(): typeof api;
38
+ export {};
@@ -0,0 +1,28 @@
1
+ import { LabelHTMLAttributes, ReactNode } from 'react';
2
+ export interface EcoCheckboxProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, "onChange" | "children"> {
3
+ /** The thing that becomes true when checked; `children` override it. */
4
+ label?: string;
5
+ /** Second line (`checkbox__h`), e.g. why the box is disabled. Text or a node (`#hint`). */
6
+ hint?: ReactNode;
7
+ indeterminate?: boolean;
8
+ disabled?: boolean;
9
+ /** Sets `aria-invalid` (a group shows one `field__err` for all its boxes). */
10
+ invalid?: boolean;
11
+ /** Native value attribute. */
12
+ value?: string;
13
+ name?: string;
14
+ /** Checked state (controlled; v-model). */
15
+ checked?: boolean;
16
+ /** Initial checked state when uncontrolled. */
17
+ defaultChecked?: boolean;
18
+ /** The checked state changed (receives the new state, not the event). */
19
+ onChange?: (checked: boolean) => void;
20
+ children?: ReactNode;
21
+ }
22
+ /**
23
+ * Checkbox — a labelled on/off choice: the native `cbox` inside a `checkbox` label, so the whole
24
+ * line toggles. Write the label as the thing that becomes true when checked. Set `indeterminate`
25
+ * on a parent box whose children are partly checked (it is a property, not an attribute).
26
+ * The ref goes to the `<input>`; other attributes to the `<label>`.
27
+ */
28
+ export declare const EcoCheckbox: import('react').ForwardRefExoticComponent<EcoCheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,27 @@
1
+ import { FieldsetHTMLAttributes, ReactNode } from 'react';
2
+ import { EcoOption } from '../../types';
3
+ export interface EcoCheckboxGroupProps<V extends string | number = string | number> extends Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "onChange" | "defaultValue" | "children" | "name" | "disabled"> {
4
+ options: EcoOption<V>[];
5
+ /** Legend (`field__l`). Text or a node (`#label`). */
6
+ label?: ReactNode;
7
+ required?: boolean;
8
+ hint?: string;
9
+ /** One message for the whole group. */
10
+ error?: string;
11
+ invalid?: boolean;
12
+ /** Lay the options out in a row (`checkgroup--row`). */
13
+ row?: boolean;
14
+ disabled?: boolean;
15
+ name?: string;
16
+ /** The checked values (controlled; v-model). */
17
+ value?: V[];
18
+ /** Initial checked values when uncontrolled. */
19
+ defaultValue?: V[];
20
+ /** The checked values changed. */
21
+ onChange?: (value: V[]) => void;
22
+ }
23
+ /**
24
+ * CheckboxGroup — related checkboxes under one legend (`fieldset.checkgroup`). `row` lays short
25
+ * options side by side. An error shows once, under the group, and marks every box invalid.
26
+ */
27
+ export declare function EcoCheckboxGroup<V extends string | number>({ options, label, required, hint, error, invalid, row, disabled, name, value, defaultValue, onChange, className, ...rest }: EcoCheckboxGroupProps<V>): import('react').JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { EcoOption } from '../../types';
3
+ export interface EcoChoicePillsProps<V extends string | number = string | number> extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue" | "children"> {
4
+ options: EcoOption<V>[];
5
+ /** Accessible name of the group. */
6
+ label?: string;
7
+ /** Show the trailing `pill--add`. */
8
+ addable?: boolean;
9
+ addLabel?: string;
10
+ /** Content of the `pill--add` button (vue-ecosphere's `#add` slot); defaults to `addLabel`. */
11
+ add?: ReactNode;
12
+ disabled?: boolean;
13
+ /** The picked values (controlled; v-model). */
14
+ value?: V[];
15
+ /** Initial picked values when uncontrolled. */
16
+ defaultValue?: V[];
17
+ /** The picked values changed. */
18
+ onChange?: (value: V[]) => void;
19
+ /** The `pill--add` button was pressed. */
20
+ onAdd?: () => void;
21
+ }
22
+ /**
23
+ * ChoicePills — many small values chosen at once: sections, working days, periods.
24
+ * Short values, a closed set, several picked. `addable` puts one dashed `pill--add` at the end:
25
+ * the escape from the enumeration ("Stream instead"), not another value in it.
26
+ */
27
+ export declare function EcoChoicePills<V extends string | number>({ options, label, addable, addLabel, add, disabled, value, defaultValue, onChange, onAdd, className, ...rest }: EcoChoicePillsProps<V>): import('react').JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface EcoComposerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue" | "children" | "placeholder"> {
3
+ placeholder?: string;
4
+ /** Accessible name of the textarea. */
5
+ label?: string;
6
+ sendLabel?: string;
7
+ attachLabel?: string;
8
+ scheduleLabel?: string;
9
+ /** Show the attach button. */
10
+ attachable?: boolean;
11
+ /** Show the schedule chevron (`split-btn__c`). */
12
+ schedulable?: boolean;
13
+ /** The schedule menu is open (`aria-expanded`). */
14
+ scheduleOpen?: boolean;
15
+ /** Scheduled send time, e.g. "Sends tomorrow at 09:00". */
16
+ when?: string;
17
+ disabled?: boolean;
18
+ /** Empty the box after `onSend`. */
19
+ clearOnSend?: boolean;
20
+ /** Above the textarea, e.g. the message being replied to (`#top`). */
21
+ top?: ReactNode;
22
+ /** Extra tools at the start of the toolbar (`#tools`). */
23
+ tools?: ReactNode;
24
+ /** After the send button, e.g. the schedule menu (`#schedule`). */
25
+ schedule?: ReactNode;
26
+ /** The draft (controlled; v-model). */
27
+ value?: string;
28
+ /** Initial draft when uncontrolled. */
29
+ defaultValue?: string;
30
+ /** The draft changed (receives the value, not the event). */
31
+ onChange?: (value: string) => void;
32
+ /** Send (or Ctrl/⌘+Enter) with a non-empty draft. */
33
+ onSend?: (text: string) => void;
34
+ /** The attach button was pressed. */
35
+ onAttach?: () => void;
36
+ /** The schedule chevron was pressed; open your menu. */
37
+ onSchedule?: () => void;
38
+ }
39
+ /**
40
+ * Composer — the reply box: a `comp__in` textarea over a toolbar with attach and a split send.
41
+ * Send stays disabled until there is something to send; Ctrl/⌘+Enter sends. The chevron beside
42
+ * Send asks to schedule it (`onSchedule`), and `when` shows the scheduled time in `cwhen`.
43
+ * The ref goes to the `<textarea>`.
44
+ */
45
+ export declare const EcoComposer: import('react').ForwardRefExoticComponent<EcoComposerProps & import('react').RefAttributes<HTMLTextAreaElement>>;
@@ -0,0 +1,24 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { EcoOption } from '../../types';
3
+ export interface EcoCycleSelectProps<V extends string | number = string | number> extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue" | "children"> {
4
+ options: EcoOption<V>[];
5
+ /** The scope's key, e.g. "Cycle", "Term", "Year". */
6
+ label: string;
7
+ disabled?: boolean;
8
+ /** The chosen value, or `null` (controlled; v-model). */
9
+ value?: V | null;
10
+ /** Initial value when uncontrolled. */
11
+ defaultValue?: V | null;
12
+ /** A value was chosen. */
13
+ onChange?: (value: V | null) => void;
14
+ /** Whether the menu is open (controlled; v-model:open). */
15
+ open?: boolean;
16
+ defaultOpen?: boolean;
17
+ onOpenChange?: (open: boolean) => void;
18
+ }
19
+ /**
20
+ * CycleSelect — the header control that says which cycle, year or term the whole screen shows.
21
+ * The key sits inside the button in small caps ("Cycle 2027–28"), so it reads as a statement
22
+ * about the page, not a filter. It opens a `Menu` widened by `cycmenu`. Put it first in `pacts`.
23
+ */
24
+ export declare function EcoCycleSelect<V extends string | number>({ options, label, disabled, value, defaultValue, onChange, open: openProp, defaultOpen, onOpenChange, className, ...rest }: EcoCycleSelectProps<V>): import('react').JSX.Element;
@@ -0,0 +1,42 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface EcoDatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue" | "children" | "id" | "placeholder"> {
3
+ /** Field label. Text or a node (`#label`). */
4
+ label?: ReactNode;
5
+ required?: boolean;
6
+ hint?: string;
7
+ error?: string;
8
+ invalid?: boolean;
9
+ first?: boolean;
10
+ disabled?: boolean;
11
+ /** Id of the input; generated when omitted. */
12
+ id?: string;
13
+ placeholder?: string;
14
+ /** Earliest pickable date, ISO. */
15
+ min?: string;
16
+ /** Latest pickable date, ISO. */
17
+ max?: string;
18
+ /** Locale for the month name and day labels. */
19
+ locale?: string;
20
+ /** Override today (ISO), e.g. for a fixed demo. */
21
+ today?: string;
22
+ todayLabel?: string;
23
+ applyLabel?: string;
24
+ /** The date as ISO `YYYY-MM-DD`, or `""` (controlled; v-model). */
25
+ value?: string;
26
+ /** Initial date when uncontrolled. */
27
+ defaultValue?: string;
28
+ /** The date changed (ISO, or `""` when cleared). */
29
+ onChange?: (value: string) => void;
30
+ /** Whether the calendar is open (controlled; v-model:open). */
31
+ open?: boolean;
32
+ defaultOpen?: boolean;
33
+ onOpenChange?: (open: boolean) => void;
34
+ }
35
+ /**
36
+ * DatePicker — a date field with a calendar glyph, and the `cal` month grid that opens from it in
37
+ * the popover layer. The typed field stays editable: typing is faster for a known date, the grid
38
+ * for "a Tuesday near the end of the month". Write the format as the hint (`DD/MM/YYYY`).
39
+ * `is-today` rings today, `is-sel` fills the chosen day; days outside `min`/`max` are disabled.
40
+ * `value` is an ISO date string, `YYYY-MM-DD`. The ref goes to the `<input>`.
41
+ */
42
+ export declare const EcoDatePicker: import('react').ForwardRefExoticComponent<EcoDatePickerProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,13 @@
1
+ import { EcoTextFieldProps } from './EcoTextField';
2
+ export interface EcoEmailFieldProps extends Omit<EcoTextFieldProps, "type" | "icon" | "iconEnd" | "reveal" | "showLabel" | "hideLabel"> {
3
+ /** Check the address on blur and show what is missing. */
4
+ validate?: boolean;
5
+ /** The address was checked on blur. */
6
+ onValidate?: (valid: boolean) => void;
7
+ }
8
+ /**
9
+ * EmailField — the mail glyph inside the box (`ifield`) and `type="email"` for the right keyboard.
10
+ * It validates on blur, not on every keystroke, and says what is missing rather than "invalid email".
11
+ * An `error` you pass always wins over the built-in check. The ref goes to the `<input>`.
12
+ */
13
+ export declare const EcoEmailField: import('react').ForwardRefExoticComponent<EcoEmailFieldProps & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,34 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * EcoField's own props. (`EcoFieldProps` is vue-ecosphere's name for the props every field-style
4
+ * control shares, kept with that meaning in `types.ts`.)
5
+ */
6
+ export interface EcoFieldComponentProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
7
+ /** Label text, or a node (vue-ecosphere's `#label` slot). */
8
+ label?: ReactNode;
9
+ required?: boolean;
10
+ /** One line of help; text or a node (`#hint`). */
11
+ hint?: ReactNode;
12
+ /** Replaces the hint while set; text or a node (`#error`). */
13
+ error?: ReactNode;
14
+ /** First field in its container (`field--first`). */
15
+ first?: boolean;
16
+ /** Id of the control the label names: renders a `<label for>`. Without it the label is a `<span>`. */
17
+ htmlFor?: string;
18
+ /** Id for the label element (for `aria-labelledby`). */
19
+ labelId?: string;
20
+ /** Id given to the hint or error (for the control's `aria-describedby`). */
21
+ describedId?: string;
22
+ /** Replaces the hint / error line (`#foot`). */
23
+ foot?: ReactNode;
24
+ /** Rendered after the help line, inside the field (`#after`). */
25
+ after?: ReactNode;
26
+ /** The control. */
27
+ children?: ReactNode;
28
+ }
29
+ /**
30
+ * Field — the label, the control and one line of help. A `field__hint` says the format;
31
+ * a `field__err` replaces it when the value is wrong. Never stack the two.
32
+ * Every form control in this group renders inside one; use it directly to label your own control.
33
+ */
34
+ export declare function EcoField({ label, required, hint, error, first, htmlFor, labelId, describedId, foot, after, children, className, ...rest }: EcoFieldComponentProps): import('react').JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export interface EcoFieldGridProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** First thing in its container: drops the top margin (`fgrid--first`). */
4
+ first?: boolean;
5
+ /** Two fields. */
6
+ children?: ReactNode;
7
+ }
8
+ /** Field grid — two fields side by side (`fgrid`), e.g. Title and Company. */
9
+ export declare function EcoFieldGrid({ first, className, children, ...rest }: EcoFieldGridProps): import('react').JSX.Element;
@@ -0,0 +1,48 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { IconName } from '../../types';
3
+ import { EcoFileStatus } from './types';
4
+ export interface EcoFileUploadProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "defaultValue" | "children"> {
5
+ /** Field label. Text or a node (`#label`). */
6
+ label?: ReactNode;
7
+ required?: boolean;
8
+ hint?: string;
9
+ /** Panel-level error, e.g. "Choose at least one valid PDF to upload." */
10
+ error?: string;
11
+ first?: boolean;
12
+ disabled?: boolean;
13
+ /** Native `accept`, e.g. ".pdf,application/pdf". */
14
+ accept?: string;
15
+ multiple?: boolean;
16
+ /** Largest file in bytes; bigger files are queued as "Check file". */
17
+ maxSize?: number;
18
+ /** File-type tile and row icon. */
19
+ icon?: IconName;
20
+ emptyTitle?: string;
21
+ emptyHint?: string;
22
+ chosenHint?: string;
23
+ chooseLabel?: string;
24
+ addLabel?: string;
25
+ listLabel?: string;
26
+ /** Upload state per file (waiting when undefined). */
27
+ status?: (file: File) => EcoFileStatus | undefined;
28
+ /** Your own validation: return the problem in the reader's terms, or nothing. */
29
+ validate?: (file: File) => string | undefined;
30
+ /** The queued files (controlled; v-model). */
31
+ value?: File[];
32
+ /** Initial queue when uncontrolled. */
33
+ defaultValue?: File[];
34
+ /** The queue changed. */
35
+ onChange?: (files: File[]) => void;
36
+ /** Files just picked or dropped (after de-duplication). */
37
+ onFiles?: (files: File[]) => void;
38
+ /** A file was removed from the queue. */
39
+ onRemove?: (file: File) => void;
40
+ }
41
+ /**
42
+ * FileUpload — the `upload` panel opens a hidden file input from a real button, and the `uplist`
43
+ * queue under it shows each file with its size, status, any error and a remove control.
44
+ * Drag and drop is an enhancement (`is-dragover`); the Choose button always stays.
45
+ * While a file uploads, remove and Add more are disabled so the queue cannot change under it.
46
+ * Uploading is your code: report each file's state through `status`.
47
+ */
48
+ export declare function EcoFileUpload({ label, required, hint, error, first, disabled, accept, multiple, maxSize, icon, emptyTitle, emptyHint, chosenHint, chooseLabel, addLabel, listLabel, status, validate, value, defaultValue, onChange, onFiles, onRemove, ...rest }: EcoFileUploadProps): import('react').JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { EcoFieldProps } from './types';
3
+ export interface EcoNumberFieldProps extends EcoFieldProps, Omit<InputHTMLAttributes<HTMLInputElement>, keyof EcoFieldProps | "type" | "value" | "defaultValue" | "onChange" | "children" | "min" | "max" | "step"> {
4
+ placeholder?: string;
5
+ min?: number;
6
+ max?: number;
7
+ step?: number;
8
+ /** Show the up/down `stepper__b` buttons. */
9
+ stepper?: boolean;
10
+ /** Unit inside the box (`input__unit`), e.g. "sec". */
11
+ unit?: string;
12
+ increaseLabel?: string;
13
+ decreaseLabel?: string;
14
+ /** The number, or `null` while empty (controlled; v-model). */
15
+ value?: number | null;
16
+ /** Initial number when uncontrolled. */
17
+ defaultValue?: number | null;
18
+ /** The number changed: `null` when the field is emptied; nothing while the text is not a number. */
19
+ onChange?: (value: number | null) => void;
20
+ }
21
+ /**
22
+ * NumberField — a figure you can edit (`input--num`, tabular figures), with optional steppers
23
+ * and a unit inside the box. A text input with `inputMode="numeric"`, never `type="number"`.
24
+ * Use the steppers only where a person nudges the value; they disable at the end of the range.
25
+ * Say the range in the hint so the limit is known before the field refuses it.
26
+ */
27
+ export declare const EcoNumberField: import('react').ForwardRefExoticComponent<EcoNumberFieldProps & import('react').RefAttributes<HTMLInputElement>>;