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.
- package/CHANGELOG.md +28 -0
- package/LICENSE +21 -0
- package/README.md +126 -2
- package/dist/components/actions/EcoButton.d.ts +34 -0
- package/dist/components/actions/EcoIconButton.d.ts +43 -0
- package/dist/components/actions/EcoLink.d.ts +20 -0
- package/dist/components/actions/EcoSplitButton.d.ts +28 -0
- package/dist/components/actions/index.d.ts +8 -0
- package/dist/components/charts/ChartFrame.d.ts +33 -0
- package/dist/components/charts/EcoAreaChart.d.ts +38 -0
- package/dist/components/charts/EcoBarChart.d.ts +65 -0
- package/dist/components/charts/EcoBarList.d.ts +33 -0
- package/dist/components/charts/EcoChartTooltip.d.ts +28 -0
- package/dist/components/charts/EcoDivergingBarChart.d.ts +33 -0
- package/dist/components/charts/EcoDonutChart.d.ts +27 -0
- package/dist/components/charts/EcoLineChart.d.ts +35 -0
- package/dist/components/charts/EcoPieChart.d.ts +26 -0
- package/dist/components/charts/EcoRadarChart.d.ts +31 -0
- package/dist/components/charts/EcoStepLineChart.d.ts +31 -0
- package/dist/components/charts/index.d.ts +21 -0
- package/dist/components/charts/types.d.ts +99 -0
- package/dist/components/charts/useChart.d.ts +19 -0
- package/dist/components/charts/utils.d.ts +113 -0
- package/dist/components/data/EcoChecklist.d.ts +16 -0
- package/dist/components/data/EcoDataTable.d.ts +98 -0
- package/dist/components/data/EcoFindings.d.ts +15 -0
- package/dist/components/data/EcoKpi.d.ts +26 -0
- package/dist/components/data/EcoLeaderRow.d.ts +28 -0
- package/dist/components/data/EcoListRow.d.ts +51 -0
- package/dist/components/data/EcoListRows.d.ts +6 -0
- package/dist/components/data/EcoQuestionItem.d.ts +25 -0
- package/dist/components/data/EcoRowGroup.d.ts +29 -0
- package/dist/components/data/EcoRowItem.d.ts +31 -0
- package/dist/components/data/EcoSourceRow.d.ts +21 -0
- package/dist/components/data/EcoStat.d.ts +22 -0
- package/dist/components/data/EcoTable.d.ts +97 -0
- package/dist/components/data/EcoTaskRow.d.ts +37 -0
- package/dist/components/data/EcoTaskRows.d.ts +7 -0
- package/dist/components/data/EcoTimeline.d.ts +23 -0
- package/dist/components/data/EcoTreeTable.d.ts +43 -0
- package/dist/components/data/EcoTreeView.d.ts +46 -0
- package/dist/components/data/EcoTreeViewNode.d.ts +14 -0
- package/dist/components/data/EcoValueChange.d.ts +18 -0
- package/dist/components/data/index.d.ts +39 -0
- package/dist/components/data/treeContext.d.ts +17 -0
- package/dist/components/data/types.d.ts +175 -0
- package/dist/components/display/EcoAvatar.d.ts +19 -0
- package/dist/components/display/EcoBadge.d.ts +20 -0
- package/dist/components/display/EcoEmptyState.d.ts +28 -0
- package/dist/components/display/EcoKeyValue.d.ts +24 -0
- package/dist/components/display/EcoMeter.d.ts +21 -0
- package/dist/components/display/EcoPlaceholder.d.ts +19 -0
- package/dist/components/display/EcoPlanCard.d.ts +32 -0
- package/dist/components/display/EcoScore.d.ts +14 -0
- package/dist/components/display/EcoSkeleton.d.ts +32 -0
- package/dist/components/display/EcoTag.d.ts +8 -0
- package/dist/components/display/EcoTags.d.ts +9 -0
- package/dist/components/display/index.d.ts +23 -0
- package/dist/components/display/types.d.ts +17 -0
- package/dist/components/feedback/EcoComposeModal.d.ts +80 -0
- package/dist/components/feedback/EcoConfirmHost.d.ts +9 -0
- package/dist/components/feedback/EcoDialog.d.ts +58 -0
- package/dist/components/feedback/EcoDrawer.d.ts +41 -0
- package/dist/components/feedback/EcoMenu.d.ts +76 -0
- package/dist/components/feedback/EcoNotice.d.ts +38 -0
- package/dist/components/feedback/EcoNotifications.d.ts +52 -0
- package/dist/components/feedback/EcoSpinner.d.ts +29 -0
- package/dist/components/feedback/EcoToast.d.ts +35 -0
- package/dist/components/feedback/EcoToaster.d.ts +9 -0
- package/dist/components/feedback/EcoTooltip.d.ts +26 -0
- package/dist/components/feedback/index.d.ts +25 -0
- package/dist/components/feedback/types.d.ts +94 -0
- package/dist/components/feedback/useConfirm.d.ts +43 -0
- package/dist/components/feedback/useToast.d.ts +38 -0
- package/dist/components/forms/EcoCheckbox.d.ts +28 -0
- package/dist/components/forms/EcoCheckboxGroup.d.ts +27 -0
- package/dist/components/forms/EcoChoicePills.d.ts +27 -0
- package/dist/components/forms/EcoComposer.d.ts +45 -0
- package/dist/components/forms/EcoCycleSelect.d.ts +24 -0
- package/dist/components/forms/EcoDatePicker.d.ts +42 -0
- package/dist/components/forms/EcoEmailField.d.ts +13 -0
- package/dist/components/forms/EcoField.d.ts +34 -0
- package/dist/components/forms/EcoFieldGrid.d.ts +9 -0
- package/dist/components/forms/EcoFileUpload.d.ts +48 -0
- package/dist/components/forms/EcoNumberField.d.ts +27 -0
- package/dist/components/forms/EcoOtpField.d.ts +37 -0
- package/dist/components/forms/EcoPhoneField.d.ts +38 -0
- package/dist/components/forms/EcoSearchField.d.ts +36 -0
- package/dist/components/forms/EcoSegmented.d.ts +23 -0
- package/dist/components/forms/EcoSelect.d.ts +82 -0
- package/dist/components/forms/EcoSelectButton.d.ts +43 -0
- package/dist/components/forms/EcoSwitch.d.ts +34 -0
- package/dist/components/forms/EcoTextField.d.ts +32 -0
- package/dist/components/forms/EcoTextarea.d.ts +20 -0
- package/dist/components/forms/EcoTimePicker.d.ts +39 -0
- package/dist/components/forms/index.d.ts +43 -0
- package/dist/components/forms/types.d.ts +47 -0
- package/dist/components/general/EcoAuroraBackground.d.ts +13 -0
- package/dist/components/general/EcoIcon.d.ts +13 -0
- package/dist/components/general/index.d.ts +4 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/components/layout/EcoAppShell.d.ts +46 -0
- package/dist/components/layout/EcoCard.d.ts +29 -0
- package/dist/components/layout/EcoDivider.d.ts +18 -0
- package/dist/components/layout/EcoHero.d.ts +40 -0
- package/dist/components/layout/EcoHeroPanelRow.d.ts +18 -0
- package/dist/components/layout/EcoMasthead.d.ts +31 -0
- package/dist/components/layout/EcoNavItem.d.ts +40 -0
- package/dist/components/layout/EcoNavSection.d.ts +11 -0
- package/dist/components/layout/EcoPageGrid.d.ts +13 -0
- package/dist/components/layout/EcoPageHeader.d.ts +20 -0
- package/dist/components/layout/EcoSection.d.ts +17 -0
- package/dist/components/layout/EcoThread.d.ts +66 -0
- package/dist/components/layout/EcoTimetable.d.ts +32 -0
- package/dist/components/layout/index.d.ts +27 -0
- package/dist/components/layout/types.d.ts +81 -0
- package/dist/components/navigation/EcoDisclosure.d.ts +29 -0
- package/dist/components/navigation/EcoDisclosureGroup.d.ts +14 -0
- package/dist/components/navigation/EcoFilterChips.d.ts +23 -0
- package/dist/components/navigation/EcoPagination.d.ts +40 -0
- package/dist/components/navigation/EcoProgressSteps.d.ts +24 -0
- package/dist/components/navigation/EcoTabs.d.ts +33 -0
- package/dist/components/navigation/disclosure.d.ts +9 -0
- package/dist/components/navigation/index.d.ts +13 -0
- package/dist/components/navigation/types.d.ts +66 -0
- package/dist/ecosphere.css +5789 -0
- package/dist/fonts/GoogleSans.woff2 +0 -0
- package/dist/fonts/fraunces-latin-ext-opsz-normal.woff2 +0 -0
- package/dist/fonts/fraunces-latin-opsz-normal.woff2 +0 -0
- package/dist/fonts/fraunces-vietnamese-opsz-normal.woff2 +0 -0
- package/dist/fonts/remixicon.woff2 +0 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useEcoId.d.ts +6 -0
- package/dist/index.d.ts +3 -0
- package/dist/internal/Portal.d.ts +8 -0
- package/dist/internal/attrs.d.ts +5 -0
- package/dist/internal/cx.d.ts +4 -0
- package/dist/internal/data-slot.d.ts +16 -0
- package/dist/internal/feedback-node.d.ts +8 -0
- package/dist/internal/feedback-value.d.ts +10 -0
- package/dist/internal/forms-hooks.d.ts +14 -0
- package/dist/internal/forms-popover.d.ts +11 -0
- package/dist/internal/layout-watch.d.ts +6 -0
- package/dist/internal/overlay.d.ts +28 -0
- package/dist/internal/useControllableState.d.ts +8 -0
- package/dist/internal/useIsClient.d.ts +5 -0
- package/dist/react-ecosphere.cjs +1 -0
- package/dist/react-ecosphere.js +8710 -0
- package/dist/tokens.json +690 -0
- package/dist/types.d.ts +15 -0
- package/package.json +66 -5
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface EcoHeroProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
/** On-fill eyebrow, usually the date ("Saturday, 8 August"); text or a node. */
|
|
4
|
+
eyebrow?: ReactNode;
|
|
5
|
+
/** The figure (`hero__n`). */
|
|
6
|
+
count?: number | string;
|
|
7
|
+
/** Unit after the figure ("requests"). */
|
|
8
|
+
unit?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The line under the count, before the highlighted part. Pass a node (with `highlight` and
|
|
11
|
+
* `lineEnd` unset) to write the whole line yourself.
|
|
12
|
+
*/
|
|
13
|
+
line?: ReactNode;
|
|
14
|
+
/** The words set in white (`hi`). */
|
|
15
|
+
highlight?: string;
|
|
16
|
+
/** Text after the highlighted part. */
|
|
17
|
+
lineEnd?: string;
|
|
18
|
+
/** One or two sentences under the line; text or a node. */
|
|
19
|
+
sub?: ReactNode;
|
|
20
|
+
/** Figure in the side panel's head (`panel__n`). */
|
|
21
|
+
panelCount?: number | string;
|
|
22
|
+
/** Label in the side panel's head ("Reminders due"). */
|
|
23
|
+
panelLabel?: string;
|
|
24
|
+
/** Heading level of the line. */
|
|
25
|
+
as?: "h1" | "h2" | "p";
|
|
26
|
+
/** On-fill buttons (`hero__cta`): `onfill` and `ghostfill` only. */
|
|
27
|
+
cta?: ReactNode;
|
|
28
|
+
/** Panel rows (`EcoHeroPanelRow`). */
|
|
29
|
+
panel?: ReactNode;
|
|
30
|
+
/** The panel's footer action (`panel__foot`). */
|
|
31
|
+
panelFoot?: ReactNode;
|
|
32
|
+
/** More content at the end of `hero__main`. */
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Hero — the dashboard moment: the one gradient wash per screen (with noise), a big count,
|
|
37
|
+
* a line with its key words in white (`hi`), on-fill CTAs and an optional glass panel of
|
|
38
|
+
* follow-ups beside it. Never put it behind data. Buttons inside take `onfill` / `ghostfill`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function EcoHero({ eyebrow, count, unit, line, highlight, lineEnd, sub, panelCount, panelLabel, as: As, cta, panel, panelFoot, className, children, ...rest }: EcoHeroProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
export interface EcoHeroPanelRowProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "name" | "type" | "onClick"> {
|
|
3
|
+
/** Row title (`prow__n`); `children` override it. */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Second line (`prow__h`): "api.internal · 6 days". */
|
|
6
|
+
hint?: string;
|
|
7
|
+
/** Initials in the avatar; derived from `name` when omitted. */
|
|
8
|
+
initials?: string;
|
|
9
|
+
/** Render as a link. */
|
|
10
|
+
href?: string;
|
|
11
|
+
onClick?: (event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* HeroPanelRow — one follow-up in the hero's glass panel (`prow`): initials, a name, a muted
|
|
16
|
+
* hint line, and a chevron. The whole row is the button (or, with `href`, the link).
|
|
17
|
+
*/
|
|
18
|
+
export declare const EcoHeroPanelRow: import('react').ForwardRefExoticComponent<EcoHeroPanelRowProps & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface EcoMastheadProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
3
|
+
/** Institution name (`mast__school`): text or a node. */
|
|
4
|
+
title?: ReactNode;
|
|
5
|
+
/** Year and term (`mast__eyebrow`): text or a node. */
|
|
6
|
+
eyebrow?: ReactNode;
|
|
7
|
+
/** Heading level of the name. */
|
|
8
|
+
as?: "h1" | "h2" | "p";
|
|
9
|
+
/**
|
|
10
|
+
* The element that scrolls, or a CSS selector for it. Omit for the document; set it when
|
|
11
|
+
* the masthead sits inside a scrolling pane.
|
|
12
|
+
*/
|
|
13
|
+
scroller?: HTMLElement | string | null;
|
|
14
|
+
/** Pin the tightened state regardless of scroll. */
|
|
15
|
+
tight?: boolean;
|
|
16
|
+
/** Pin the at-rest state regardless of scroll (a static preview of the tall header). */
|
|
17
|
+
rest?: boolean;
|
|
18
|
+
/** Content beside the name, inside `mast__in`. */
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Masthead — the institution's name where a topbar would be: tall at rest, tightening into a
|
|
23
|
+
* navbar as the page scrolls (the eyebrow collapses, the padding closes, the name drops to
|
|
24
|
+
* 16px over the first 96px). Put the year and term in the eyebrow and nothing else — it is
|
|
25
|
+
* the first thing to disappear. The name truncates rather than wrapping.
|
|
26
|
+
*
|
|
27
|
+
* The stylesheet drives the tightening with a root scroll timeline. When the page scrolls
|
|
28
|
+
* inside a container instead (pass `scroller`), or the browser has no scroll-driven
|
|
29
|
+
* animation, the component drives the same keyframes from the scroll position.
|
|
30
|
+
*/
|
|
31
|
+
export declare function EcoMasthead({ title, eyebrow, as: As, scroller, tight, rest, className, children, ...attrs }: EcoMastheadProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, ElementType, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import { IconName } from '../../types';
|
|
3
|
+
import { NavTarget } from './types';
|
|
4
|
+
export interface EcoNavItemProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "children"> {
|
|
5
|
+
/** RemixIcon name without `ri-`. */
|
|
6
|
+
icon?: IconName;
|
|
7
|
+
/** Label; `children` override it. Also the rail tooltip. */
|
|
8
|
+
label: string;
|
|
9
|
+
href?: string;
|
|
10
|
+
/**
|
|
11
|
+
* A router destination, passed as `to` to the `as` component (react-router's `Link`).
|
|
12
|
+
* Without `as`, a string `to` becomes the anchor's `href`.
|
|
13
|
+
*/
|
|
14
|
+
to?: NavTarget;
|
|
15
|
+
/**
|
|
16
|
+
* The link component for client-side routing, e.g. react-router's `Link` (with `to`) or
|
|
17
|
+
* Next.js's `Link` (with `href`). It receives the same props the plain `<a>` gets
|
|
18
|
+
* (`className`, `href` or `to`, `data-label`, `aria-current`, `onClick`, the ref) and must
|
|
19
|
+
* render an `<a>`. Omit it for a plain anchor.
|
|
20
|
+
*/
|
|
21
|
+
as?: ElementType;
|
|
22
|
+
/** Marks the current page (`is-active`, `aria-current="page"`). With a router, pass its match. */
|
|
23
|
+
active?: boolean;
|
|
24
|
+
/** Count after the label (`nav-item__n`). */
|
|
25
|
+
count?: number | string;
|
|
26
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* NavItem — one sidebar destination: an icon, its label, an optional count. The active item
|
|
31
|
+
* takes a 2px accent bar, never a filled pill. `data-label` becomes the hover tooltip when
|
|
32
|
+
* the sidebar is collapsed to the rail.
|
|
33
|
+
*
|
|
34
|
+
* Routing: React has no built-in router, so the item renders a plain `<a>` by default (`href`,
|
|
35
|
+
* or a string `to`, or `#` with the click's default prevented). For client-side navigation pass
|
|
36
|
+
* your router's link component as `as` — `<EcoNavItem as={Link} to="/requests" …>` with
|
|
37
|
+
* react-router, `<EcoNavItem as={Link} href="/requests" …>` with Next.js — and compute `active`
|
|
38
|
+
* from the router (vue-ecosphere's `exact` has no React form: the router decides the match).
|
|
39
|
+
*/
|
|
40
|
+
export declare const EcoNavItem: import('react').ForwardRefExoticComponent<EcoNavItemProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface EcoNavSectionProps extends Omit<HTMLAttributes<HTMLParagraphElement>, "children"> {
|
|
3
|
+
/** Label text; `children` override it. */
|
|
4
|
+
label?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* NavSection — a section label between groups of nav items, set as an eyebrow. A sidebar
|
|
9
|
+
* that runs past about six items stops being scannable without them. Hidden in the rail.
|
|
10
|
+
*/
|
|
11
|
+
export declare function EcoNavSection({ label, className, children, ...rest }: EcoNavSectionProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ElementType, HTMLAttributes } from 'react';
|
|
2
|
+
import { PageGridLayout } from './types';
|
|
3
|
+
export interface EcoPageGridProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
layout?: PageGridLayout;
|
|
5
|
+
/** Element to render. */
|
|
6
|
+
tag?: ElementType;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* PageGrid — the four column shapes a screen needs. `2` and `3` are auto-fit card grids
|
|
10
|
+
* that reflow without breakpoints; `rail` is a working column beside a fixed `--rail-w` rail;
|
|
11
|
+
* `studio` is the three-pane editor shape. All four stack to one column at 1240px.
|
|
12
|
+
*/
|
|
13
|
+
export declare function EcoPageGrid({ layout, tag: Tag, className, children, ...rest }: EcoPageGridProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface EcoPageHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "children"> {
|
|
3
|
+
/** The title (`ptitle`): text or a node. */
|
|
4
|
+
title?: ReactNode;
|
|
5
|
+
/** Small caps label above the title: text or a node. */
|
|
6
|
+
eyebrow?: ReactNode;
|
|
7
|
+
/** One sentence, capped at 64ch (`psub`): text or a node. */
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
/** Heading level of the title. */
|
|
10
|
+
as?: "h1" | "h2" | "h3";
|
|
11
|
+
/** One primary and the rest secondary or tertiary (`pacts`); they wrap rather than compress. */
|
|
12
|
+
actions?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* PageHeader — eyebrow, title, one sentence of what the screen governs, and the actions on
|
|
16
|
+
* the same baseline. Use the description to say what depends on this screen; leave it off
|
|
17
|
+
* when the title is self-evident. Keep one primary button in `actions`; a scope control
|
|
18
|
+
* (CycleSelect) goes ahead of the buttons. Actions wrap rather than compress.
|
|
19
|
+
*/
|
|
20
|
+
export declare function EcoPageHeader({ title, eyebrow, description, as: As, actions, className, ...rest }: EcoPageHeaderProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface EcoSectionProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
3
|
+
/** The heading (`csec__t`): text or a node. */
|
|
4
|
+
title?: ReactNode;
|
|
5
|
+
/** Heading level of the title. */
|
|
6
|
+
as?: "h2" | "h3" | "h4";
|
|
7
|
+
/** Element to render. */
|
|
8
|
+
tag?: ElementType;
|
|
9
|
+
/** One link or control opposite the heading. */
|
|
10
|
+
action?: ReactNode;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Section — the section below the fold: a display-face heading with one link or control
|
|
15
|
+
* opposite it (`action`), `--gap-section` clear of what came before.
|
|
16
|
+
*/
|
|
17
|
+
export declare function EcoSection({ title, as: As, tag: Tag, action, className, children, ...rest }: EcoSectionProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { StatusTone } from '../../types';
|
|
3
|
+
import { ThreadItem } from './types';
|
|
4
|
+
export interface EcoThreadProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onClose"> {
|
|
5
|
+
/** The other party's name in the header. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Their role and organisation (`th__h`). */
|
|
8
|
+
hint?: string;
|
|
9
|
+
/** Their initials; derived from `name` when omitted. */
|
|
10
|
+
initials?: string;
|
|
11
|
+
/** Your initials on your bubbles. */
|
|
12
|
+
myInitials?: string;
|
|
13
|
+
/** Messages and day dividers, oldest first. */
|
|
14
|
+
messages?: ThreadItem[];
|
|
15
|
+
/**
|
|
16
|
+
* Status badge in the bar under the header: a string is the badge's text (in `statusTone`);
|
|
17
|
+
* any other node replaces the badge.
|
|
18
|
+
*/
|
|
19
|
+
status?: ReactNode;
|
|
20
|
+
statusTone?: StatusTone;
|
|
21
|
+
/** Muted text at the end of the status bar ("Last reply 2h ago"). */
|
|
22
|
+
last?: string;
|
|
23
|
+
/** Every message in one column with a name label (narrow panes). */
|
|
24
|
+
stacked?: boolean;
|
|
25
|
+
/** Your bubbles in the accent tint with dark ink instead of a solid fill. */
|
|
26
|
+
tint?: boolean;
|
|
27
|
+
/** Hide avatars. */
|
|
28
|
+
noAvatars?: boolean;
|
|
29
|
+
/** A timestamp on every message, not just the last of a burst. */
|
|
30
|
+
stamps?: boolean;
|
|
31
|
+
/** Composer placeholder; defaults to "Message <first name>". */
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The header controls: `true` (default) shows the record-details and close buttons, `false`
|
|
35
|
+
* none, and a node replaces them.
|
|
36
|
+
*/
|
|
37
|
+
actions?: ReactNode;
|
|
38
|
+
/** Height of the pane, e.g. "640px". Omit to size to the parent. */
|
|
39
|
+
height?: string;
|
|
40
|
+
/** The composer's draft (controlled; v-model:draft). */
|
|
41
|
+
draft?: string;
|
|
42
|
+
defaultDraft?: string;
|
|
43
|
+
onDraftChange?: (draft: string) => void;
|
|
44
|
+
/** Send was pressed (or Enter typed) with a non-empty draft; the draft then clears. */
|
|
45
|
+
onSend?: (text: string) => void;
|
|
46
|
+
/** The attach button was pressed. */
|
|
47
|
+
onAttach?: () => void;
|
|
48
|
+
/** The record-details button was pressed. */
|
|
49
|
+
onDetails?: () => void;
|
|
50
|
+
/** The close button was pressed. */
|
|
51
|
+
onClose?: () => void;
|
|
52
|
+
/** Replaces the message box (`chatbox`). */
|
|
53
|
+
composer?: ReactNode;
|
|
54
|
+
/** Replaces the rendered messages inside `chat`. */
|
|
55
|
+
children?: ReactNode;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Thread — a chat-style conversation in the detail pane. The other party sits on the left in
|
|
59
|
+
* the sunken surface, you on the right in the accent: the side does the work, so nobody has
|
|
60
|
+
* to read a label to know who spoke. Consecutive messages from one side group into a burst
|
|
61
|
+
* with one timestamp and one avatar. The message box is attach, one growing textarea and a
|
|
62
|
+
* round send that is enabled only when there is text.
|
|
63
|
+
*
|
|
64
|
+
* It renders its own `.split.is-open` wrapper, which is what makes the detail pane visible.
|
|
65
|
+
*/
|
|
66
|
+
export declare function EcoThread({ name, hint, initials, myInitials, messages, status, statusTone, last, stacked, tint, noAvatars, stamps, placeholder, actions, height, draft: draftProp, defaultDraft, onDraftChange, onSend, onAttach, onDetails, onClose, composer, className, style, children, ...rest }: EcoThreadProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { TimetableDay, TimetableEvent, TimetableNow, TimetableRow, TimetableSlot } from './types';
|
|
3
|
+
export interface EcoTimetableProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onSelect"> {
|
|
4
|
+
days: TimetableDay[];
|
|
5
|
+
/** The periods and breaks, top to bottom; each is one 56px row. */
|
|
6
|
+
rows: TimetableRow[];
|
|
7
|
+
events?: TimetableEvent[];
|
|
8
|
+
slots?: TimetableSlot[];
|
|
9
|
+
/** Draw the now-line. */
|
|
10
|
+
now?: TimetableNow | null;
|
|
11
|
+
/** Subject names for the legend under the grid, in `subj1`…`subj6` order. */
|
|
12
|
+
subjects?: string[];
|
|
13
|
+
/** Wrap the grid in a flush card (`card` › `card__body`), the legend sitting under the card. */
|
|
14
|
+
card?: boolean;
|
|
15
|
+
/** A lesson was pressed. */
|
|
16
|
+
onSelect?: (event: TimetableEvent) => void;
|
|
17
|
+
/** An empty slot was pressed. */
|
|
18
|
+
onSlot?: (slot: TimetableSlot) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Timetable — a week as a fixed time gutter plus one absolutely-positioned column per day.
|
|
22
|
+
* Rows are 56px per period and an event is placed by its start and end time, so a double
|
|
23
|
+
* period is one element and a lesson that starts mid-period lands where it starts.
|
|
24
|
+
*
|
|
25
|
+
* Colour is the subject, not the state (`subj1`…`subj6`). A clash is not a colour: it is a
|
|
26
|
+
* glyph in the corner — warning for a soft clash, danger (`crit`) for one that cannot ship.
|
|
27
|
+
* `slots` are empty periods as dashed targets; break rows become a band across every day;
|
|
28
|
+
* the now-line is a 1px danger rule that never eats a click. Set `card` to wrap the grid in the
|
|
29
|
+
* artifact's flush card, with the legend under the card (or put it in a flush `EcoCard` yourself).
|
|
30
|
+
* `className`, `style` and other attributes land on `.ttwrap`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function EcoTimetable({ days, rows, events, slots, now, subjects, card, onSelect, onSlot, className, ...rest }: EcoTimetableProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export { EcoAppShell } from './EcoAppShell';
|
|
2
|
+
export type { EcoAppShellProps } from './EcoAppShell';
|
|
3
|
+
export { EcoNavItem } from './EcoNavItem';
|
|
4
|
+
export type { EcoNavItemProps } from './EcoNavItem';
|
|
5
|
+
export { EcoNavSection } from './EcoNavSection';
|
|
6
|
+
export type { EcoNavSectionProps } from './EcoNavSection';
|
|
7
|
+
export { EcoMasthead } from './EcoMasthead';
|
|
8
|
+
export type { EcoMastheadProps } from './EcoMasthead';
|
|
9
|
+
export { EcoPageHeader } from './EcoPageHeader';
|
|
10
|
+
export type { EcoPageHeaderProps } from './EcoPageHeader';
|
|
11
|
+
export { EcoPageGrid } from './EcoPageGrid';
|
|
12
|
+
export type { EcoPageGridProps } from './EcoPageGrid';
|
|
13
|
+
export { EcoSection } from './EcoSection';
|
|
14
|
+
export type { EcoSectionProps } from './EcoSection';
|
|
15
|
+
export { EcoCard } from './EcoCard';
|
|
16
|
+
export type { EcoCardProps } from './EcoCard';
|
|
17
|
+
export { EcoDivider } from './EcoDivider';
|
|
18
|
+
export type { EcoDividerProps } from './EcoDivider';
|
|
19
|
+
export { EcoHero } from './EcoHero';
|
|
20
|
+
export type { EcoHeroProps } from './EcoHero';
|
|
21
|
+
export { EcoHeroPanelRow } from './EcoHeroPanelRow';
|
|
22
|
+
export type { EcoHeroPanelRowProps } from './EcoHeroPanelRow';
|
|
23
|
+
export { EcoThread } from './EcoThread';
|
|
24
|
+
export type { EcoThreadProps } from './EcoThread';
|
|
25
|
+
export { EcoTimetable } from './EcoTimetable';
|
|
26
|
+
export type { EcoTimetableProps } from './EcoTimetable';
|
|
27
|
+
export type * from './types';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/** Types for the layout components (AppShell, PageGrid, Hero, Thread, Timetable…). */
|
|
2
|
+
/** `cg--2` / `cg--3` card grids, `cg--rail` body + fixed rail, `cg--studio` three panes. */
|
|
3
|
+
export type PageGridLayout = "2" | "3" | "rail" | "studio";
|
|
4
|
+
/**
|
|
5
|
+
* A router destination for `EcoNavItem`'s `to`. Kept structural so the package does not
|
|
6
|
+
* depend on a router: a path string or a route-location object, handed to the `as` link
|
|
7
|
+
* component (react-router's `Link` takes either).
|
|
8
|
+
*/
|
|
9
|
+
export type NavTarget = string | Record<string, unknown>;
|
|
10
|
+
/** One message in an `EcoThread`. Consecutive messages from one side group into a burst. */
|
|
11
|
+
export interface ThreadMessage {
|
|
12
|
+
/** Stable key; the index is used when omitted. */
|
|
13
|
+
id?: string | number;
|
|
14
|
+
text: string;
|
|
15
|
+
/** Sent by the viewer: right-aligned, accent bubble (`bubble--me`). */
|
|
16
|
+
mine?: boolean;
|
|
17
|
+
/** Name in the meta line ("Kiara"); defaults to "You" for `mine`. */
|
|
18
|
+
who?: string;
|
|
19
|
+
/** Timestamp shown on the last message of a burst ("9:41 AM"). */
|
|
20
|
+
time?: string;
|
|
21
|
+
/** Avatar initials; defaults to the thread's `initials` (theirs) or `myInitials` (mine). */
|
|
22
|
+
initials?: string;
|
|
23
|
+
}
|
|
24
|
+
/** A day divider between messages (`chat__day`). */
|
|
25
|
+
export interface ThreadDay {
|
|
26
|
+
day: string;
|
|
27
|
+
}
|
|
28
|
+
export type ThreadItem = ThreadMessage | ThreadDay;
|
|
29
|
+
/** Subject colour step for a timetable event: `subj1`…`subj6`. */
|
|
30
|
+
export type TimetableSubject = 1 | 2 | 3 | 4 | 5 | 6;
|
|
31
|
+
/** A day column header. */
|
|
32
|
+
export interface TimetableDay {
|
|
33
|
+
/** Short weekday label ("Mon"). */
|
|
34
|
+
label: string;
|
|
35
|
+
/** Day of the month ("14"). */
|
|
36
|
+
date?: string | number;
|
|
37
|
+
/** Marks the column (`is-today`). */
|
|
38
|
+
today?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/** One 56px row of the grid: a period or a break. Times are "H:MM" in 24-hour form. */
|
|
41
|
+
export interface TimetableRow {
|
|
42
|
+
/** Gutter label ("P1 · 8:00"); defaults to the start time. */
|
|
43
|
+
label?: string;
|
|
44
|
+
start: string;
|
|
45
|
+
end: string;
|
|
46
|
+
/** A non-teaching band across every day (`ttbreak`); a string sets its text. */
|
|
47
|
+
break?: boolean | string;
|
|
48
|
+
}
|
|
49
|
+
/** A lesson, positioned by its start and end time. */
|
|
50
|
+
export interface TimetableEvent {
|
|
51
|
+
id?: string | number;
|
|
52
|
+
/** Index into `days`. */
|
|
53
|
+
day: number;
|
|
54
|
+
start: string;
|
|
55
|
+
end: string;
|
|
56
|
+
/** Subject name (`evt__t`). */
|
|
57
|
+
title: string;
|
|
58
|
+
/** Teacher and room (`evt__h`). */
|
|
59
|
+
hint?: string;
|
|
60
|
+
subject?: TimetableSubject;
|
|
61
|
+
/** A soft clash: a warning glyph in the corner (`is-warn`). */
|
|
62
|
+
warn?: boolean;
|
|
63
|
+
/** A clash that cannot ship: the glyph in danger (`evt--crit`, implies `warn`). */
|
|
64
|
+
crit?: boolean;
|
|
65
|
+
/** The lesson in progress (`is-now`). */
|
|
66
|
+
now?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** An empty period as a dashed target (`slot`). */
|
|
69
|
+
export interface TimetableSlot {
|
|
70
|
+
day: number;
|
|
71
|
+
start: string;
|
|
72
|
+
end: string;
|
|
73
|
+
/** Defaults to "+ Free". */
|
|
74
|
+
label?: string;
|
|
75
|
+
}
|
|
76
|
+
/** Where the now-line sits. */
|
|
77
|
+
export interface TimetableNow {
|
|
78
|
+
day: number;
|
|
79
|
+
/** "H:MM"; also the label on the line. */
|
|
80
|
+
time: string;
|
|
81
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DetailsHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface EcoDisclosureProps extends Omit<DetailsHTMLAttributes<HTMLDetailsElement>, "title" | "open" | "name" | "onToggle"> {
|
|
3
|
+
/** The summary line (`disc__t`): text or a node. */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/** Small pill for how many items the body holds (`disc__n`). */
|
|
6
|
+
count?: number | string;
|
|
7
|
+
/** A figure or short fact at the end of the line (`disc__m`): "Total 4,539.25". Text or a node. */
|
|
8
|
+
meta?: ReactNode;
|
|
9
|
+
/** Disabled-looking: nothing to show yet. Say why in `meta` ("None recorded"). */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Native exclusive-group name; normally set by `EcoDisclosureGroup exclusive`. */
|
|
12
|
+
name?: string;
|
|
13
|
+
/** Whether it is open (controlled; v-model:open). */
|
|
14
|
+
open?: boolean;
|
|
15
|
+
defaultOpen?: boolean;
|
|
16
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
|
+
/** The reader opened or closed it. */
|
|
18
|
+
onToggle?: (open: boolean) => void;
|
|
19
|
+
/** The detail (`disc__b`). */
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Disclosure — a section that shows its summary line and hides its detail until opened, built on
|
|
24
|
+
* native `<details>`/`<summary>`. Use it for secondary detail most readers skip (timing, notes, a
|
|
25
|
+
* breakdown behind a total); never hide something needed to finish the task. Keep the summary to
|
|
26
|
+
* one short line of plain text: the whole summary is already the control.
|
|
27
|
+
* Stack several inside `EcoDisclosureGroup` for the bordered `discs` accordion.
|
|
28
|
+
*/
|
|
29
|
+
export declare function EcoDisclosure({ title, count, meta, disabled, name, open: openProp, defaultOpen, onOpenChange, onToggle, className, children, ...rest }: EcoDisclosureProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface EcoDisclosureGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** One open at a time. */
|
|
4
|
+
exclusive?: boolean;
|
|
5
|
+
/** Explicit group name (defaults to a generated id). */
|
|
6
|
+
name?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* DisclosureGroup — the bordered `discs` accordion: one frame, hairline dividers, 48px rows.
|
|
10
|
+
* Each item opens on its own by default; `exclusive` keeps one open at a time (the native
|
|
11
|
+
* `details[name]` behaviour) for parallel, mutually exclusive answers such as FAQs.
|
|
12
|
+
* Do not nest an accordion inside an accordion.
|
|
13
|
+
*/
|
|
14
|
+
export declare function EcoDisclosureGroup({ exclusive, name, className, children, ...rest }: EcoDisclosureGroupProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { EcoFilter, EcoFilterValue, EcoFilterValues } from './types';
|
|
3
|
+
export interface EcoFilterChipsProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onChange" | "defaultValue"> {
|
|
4
|
+
filters: EcoFilter[];
|
|
5
|
+
/** Accessible name of the row ("Filter requests"). */
|
|
6
|
+
label?: string;
|
|
7
|
+
clearAllLabel?: string;
|
|
8
|
+
/** Current values, keyed by filter key (controlled; v-model). */
|
|
9
|
+
value?: EcoFilterValues;
|
|
10
|
+
defaultValue?: EcoFilterValues;
|
|
11
|
+
/** The values changed (every change, Clear filters included). */
|
|
12
|
+
onChange?: (values: EcoFilterValues) => void;
|
|
13
|
+
/** One filter changed (vue-ecosphere's `change` event). Not called by Clear filters. */
|
|
14
|
+
onFilterChange?: (key: string, value: EcoFilterValue | undefined) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* FilterChips — one chip per filterable column, each opening its own menu: a checklist of
|
|
18
|
+
* options, a minimum and maximum, or one exact value. An idle chip is the column name and a
|
|
19
|
+
* chevron; once it has a value it shows the column, the first value (cut to 15 characters),
|
|
20
|
+
* "+N" for the rest and a × that clears it. Keep the chips in the table's column order;
|
|
21
|
+
* "Clear filters" shows only while something is filtered.
|
|
22
|
+
*/
|
|
23
|
+
export declare function EcoFilterChips({ filters, label, clearAllLabel, value, defaultValue, onChange, onFilterChange, className, ...rest }: EcoFilterChipsProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { EcoPaginationForm } from './types';
|
|
3
|
+
/** Scope of `renderCount`. */
|
|
4
|
+
export interface EcoPaginationCountScope {
|
|
5
|
+
from: number;
|
|
6
|
+
to: number;
|
|
7
|
+
total: number;
|
|
8
|
+
page: number;
|
|
9
|
+
pages: number;
|
|
10
|
+
}
|
|
11
|
+
export interface EcoPaginationProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
12
|
+
/** Total number of items. */
|
|
13
|
+
total: number;
|
|
14
|
+
form?: EcoPaginationForm;
|
|
15
|
+
/** Rows-per-page choices; shows the `pager__size` select when set. */
|
|
16
|
+
pageSizes?: number[];
|
|
17
|
+
/** Show the go-to-page field (`pager__jump`). */
|
|
18
|
+
jump?: boolean;
|
|
19
|
+
/** Text before the range, e.g. "Showing". */
|
|
20
|
+
prefix?: string;
|
|
21
|
+
sizeLabel?: string;
|
|
22
|
+
jumpLabel?: string;
|
|
23
|
+
/** Current page, 1-based (controlled; v-model:page). */
|
|
24
|
+
page?: number;
|
|
25
|
+
defaultPage?: number;
|
|
26
|
+
onPageChange?: (page: number) => void;
|
|
27
|
+
/** Items per page (controlled; v-model:pageSize). */
|
|
28
|
+
pageSize?: number;
|
|
29
|
+
defaultPageSize?: number;
|
|
30
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
31
|
+
/** Replaces the range text in `pager__c`. */
|
|
32
|
+
renderCount?: (scope: EcoPaginationCountScope) => ReactNode;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Pagination — paging for a table or a list: the range and total ("51–75 of 187"), an optional
|
|
36
|
+
* rows-per-page or go-to-page control, and the page row. `bar` sits inside a table or card
|
|
37
|
+
* footer, `row` under a list, `compact` is prev / position / next. At most seven page buttons,
|
|
38
|
+
* the rest elided with `pg--gap`; prev and next disable at the ends rather than disappear.
|
|
39
|
+
*/
|
|
40
|
+
export declare function EcoPagination({ total, form, pageSizes, jump, prefix, sizeLabel, jumpLabel, page: pageProp, defaultPage, onPageChange, pageSize: pageSizeProp, defaultPageSize, onPageSizeChange, renderCount, className, ...rest }: EcoPaginationProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { EcoStep } from './types';
|
|
3
|
+
export interface EcoProgressStepsProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
|
|
4
|
+
steps: EcoStep[];
|
|
5
|
+
/** Index of the current step. Omit (or -1) when nothing has started: every step is upcoming. */
|
|
6
|
+
current?: number;
|
|
7
|
+
/** Accessible name of the list ("Catalogue import progress"). */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Horizontal numbered row for a form (`steps--h`, wrapped in `nav`). */
|
|
10
|
+
horizontal?: boolean;
|
|
11
|
+
/** Explanation above the list (`steps__note`) when the markers cannot say it: text or a node. */
|
|
12
|
+
note?: ReactNode;
|
|
13
|
+
noteIcon?: string;
|
|
14
|
+
/** Footnote under the list (`steps__foot`): text or a node. */
|
|
15
|
+
foot?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* ProgressSteps — the ordered steps of a long-running job, each with a state marker and badge;
|
|
19
|
+
* only the current step carries its description and live counts. `horizontal` lays the list
|
|
20
|
+
* out as a compact numbered row for a multi-step form. It does not poll or infer anything:
|
|
21
|
+
* derive each state from what the job recorded, and never show a percentage it did not measure.
|
|
22
|
+
* Replaces the old Stepper.
|
|
23
|
+
*/
|
|
24
|
+
export declare function EcoProgressSteps({ steps, current, label, horizontal, note, noteIcon, foot, className, ...rest }: EcoProgressStepsProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { EcoTabItem } from './types';
|
|
3
|
+
/** Scope of a tab panel renderer. */
|
|
4
|
+
export interface EcoTabPanelScope {
|
|
5
|
+
item: EcoTabItem;
|
|
6
|
+
}
|
|
7
|
+
export type EcoTabPanelRender = (scope: EcoTabPanelScope) => ReactNode;
|
|
8
|
+
export interface EcoTabsProps extends Omit<HTMLAttributes<HTMLElement>, "children" | "onChange" | "defaultValue"> {
|
|
9
|
+
items: EcoTabItem[];
|
|
10
|
+
/** `page` for the screen's main views (`tabs--page`); `section` shares the width equally. */
|
|
11
|
+
size?: "page" | "section";
|
|
12
|
+
/** Accessible name of the row, e.g. "Views". */
|
|
13
|
+
label?: string;
|
|
14
|
+
/** Key of the active tab (controlled; v-model). Defaults to the first enabled tab. */
|
|
15
|
+
value?: string;
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
/** A tab was chosen (click, arrows, Home / End). */
|
|
18
|
+
onChange?: (key: string) => void;
|
|
19
|
+
/**
|
|
20
|
+
* The `tabpanel` under the row, for the active tab: one function for every tab (`#panel`), or
|
|
21
|
+
* a record of functions keyed by tab key (`#panel-<key>`). Without it no panel renders.
|
|
22
|
+
*/
|
|
23
|
+
renderPanel?: EcoTabPanelRender | Record<string, EcoTabPanelRender>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Tabs — a row of views of one thing, the active one underlined in `--accent`: page tabs across
|
|
27
|
+
* the top of a screen (`size="page"`), or section tabs inside a card or drawer. When every tab has
|
|
28
|
+
* an `href` the row renders as links (`nav.tabs`, `aria-current`), for views worth a URL;
|
|
29
|
+
* otherwise it is a `tablist` that switches content in place with arrow keys.
|
|
30
|
+
* A count goes in `tab__n`; one that asks for attention (`notify`) is `badge--notification`.
|
|
31
|
+
* `className` and other attributes land on the row, not the panel.
|
|
32
|
+
*/
|
|
33
|
+
export declare function EcoTabs({ items, size, label, value, defaultValue, onChange, renderPanel, className, ...rest }: EcoTabsProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Shared by `EcoDisclosureGroup` and `EcoDisclosure` (internal). */
|
|
2
|
+
export interface DisclosureGroupContext {
|
|
3
|
+
/** Native `name` for one-open-at-a-time groups; undefined when each opens on its own. */
|
|
4
|
+
name: string | undefined;
|
|
5
|
+
/** The id of the disclosure that opened last (fallback for browsers without exclusive `details`). */
|
|
6
|
+
openId: string | null;
|
|
7
|
+
setOpenId: (id: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const DisclosureGroup: import('react').Context<DisclosureGroupContext | null>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { EcoTabs } from './EcoTabs';
|
|
2
|
+
export type { EcoTabsProps, EcoTabPanelScope, EcoTabPanelRender } from './EcoTabs';
|
|
3
|
+
export { EcoPagination } from './EcoPagination';
|
|
4
|
+
export type { EcoPaginationProps, EcoPaginationCountScope } from './EcoPagination';
|
|
5
|
+
export { EcoFilterChips } from './EcoFilterChips';
|
|
6
|
+
export type { EcoFilterChipsProps } from './EcoFilterChips';
|
|
7
|
+
export { EcoProgressSteps } from './EcoProgressSteps';
|
|
8
|
+
export type { EcoProgressStepsProps } from './EcoProgressSteps';
|
|
9
|
+
export { EcoDisclosure } from './EcoDisclosure';
|
|
10
|
+
export type { EcoDisclosureProps } from './EcoDisclosure';
|
|
11
|
+
export { EcoDisclosureGroup } from './EcoDisclosureGroup';
|
|
12
|
+
export type { EcoDisclosureGroupProps } from './EcoDisclosureGroup';
|
|
13
|
+
export type * from './types';
|