@astra-kit/ui 1.1.0 → 1.2.1
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 +25 -0
- package/README.md +5 -3
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/components/empty-state.d.ts +20 -0
- package/dist/components/empty-state.js +357 -0
- package/dist/components/metric-card.d.ts +22 -0
- package/dist/components/metric-card.js +378 -0
- package/dist/components/stepper.d.ts +39 -0
- package/dist/components/stepper.js +693 -0
- package/dist/components/timeline.d.ts +51 -0
- package/dist/components/timeline.js +1013 -0
- package/dist/components/usage-meter.d.ts +39 -0
- package/dist/components/usage-meter.js +1093 -0
- package/dist/constants/empty-state.d.ts +12 -0
- package/dist/constants/empty-state.js +12 -0
- package/dist/constants/metric-card.d.ts +12 -0
- package/dist/constants/metric-card.js +12 -0
- package/dist/constants/stepper.d.ts +52 -0
- package/dist/constants/stepper.js +23 -0
- package/dist/constants/timeline.d.ts +62 -0
- package/dist/constants/timeline.js +31 -0
- package/dist/constants/usage-meter.d.ts +100 -0
- package/dist/constants/usage-meter.js +38 -0
- package/dist/hooks/use-has-entered-view.d.ts +9 -0
- package/dist/hooks/use-has-entered-view.js +46 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/motion/arc-odometer.d.ts +53 -0
- package/dist/motion/arc-odometer.js +424 -0
- package/dist/motion/arc-text-swap.d.ts +22 -0
- package/dist/motion/arc-text-swap.js +142 -0
- package/dist/motion/arc-tokens.d.ts +1 -0
- package/dist/motion/arc-tokens.js +2 -1
- package/dist/styles.css +1 -1
- package/package.json +26 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import type { TimelineHeadingLevel, TimelineMessages, TimelineTone } from "../constants/timeline.js";
|
|
3
|
+
export type { TimelineHeadingLevel, TimelineMessages, TimelineTone };
|
|
4
|
+
export type TimelineEvent = {
|
|
5
|
+
id: string;
|
|
6
|
+
/** When it happened, as an ISO string or epoch milliseconds. */
|
|
7
|
+
at: string | number;
|
|
8
|
+
/** Who did it, shown first in the foreground colour. */
|
|
9
|
+
actor?: string;
|
|
10
|
+
/** What happened, completing the actor: "aprobó la solicitud". */
|
|
11
|
+
title: string;
|
|
12
|
+
/** Short context under the title. */
|
|
13
|
+
meta?: string;
|
|
14
|
+
/** Revealed in place when the row is expanded. Rows without detail are not interactive. */
|
|
15
|
+
detail?: ReactNode;
|
|
16
|
+
/** Portrait URL for an event by a person. */
|
|
17
|
+
avatar?: string;
|
|
18
|
+
/** Icon for a system event, used when there is no avatar. */
|
|
19
|
+
icon?: ReactNode;
|
|
20
|
+
/** Status of a system event. Always say the outcome in the title too, so it never rests on colour. */
|
|
21
|
+
tone?: TimelineTone;
|
|
22
|
+
};
|
|
23
|
+
export type TimelineProps = Omit<ComponentProps<"div">, "children" | "role"> & {
|
|
24
|
+
/** Updates in any order; the newest shows first. Rows with `detail` are expandable. */
|
|
25
|
+
events: TimelineEvent[];
|
|
26
|
+
/** Reference time for relative labels and day groups, in epoch milliseconds. Pass a ticking clock to keep labels fresh. */
|
|
27
|
+
now: number;
|
|
28
|
+
/** Accessible name of the feed. */
|
|
29
|
+
label: string;
|
|
30
|
+
/** Time zone of day groups and clock times. Defaults to `"UTC"`, so server and client agree. */
|
|
31
|
+
timeZone?: string;
|
|
32
|
+
/** Locale of day labels and clock times. Defaults to `"es-AR"`. */
|
|
33
|
+
locale?: string;
|
|
34
|
+
/** Height of the scrolling area. Without it the feed grows with the page. */
|
|
35
|
+
maxHeight?: number | string;
|
|
36
|
+
/** Scrolls back to the top when a new update arrives. Defaults to `true`. */
|
|
37
|
+
scrollToNew?: boolean;
|
|
38
|
+
/** Event ids expanded on mount. */
|
|
39
|
+
defaultExpanded?: string[];
|
|
40
|
+
/** Heading level of the day labels. Defaults to 3. */
|
|
41
|
+
headingLevel?: TimelineHeadingLevel;
|
|
42
|
+
/** Replaces any of the Spanish day labels, relative times, counts and announcements. */
|
|
43
|
+
messages?: Partial<TimelineMessages>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* A vertical activity feed grouped by day with pinned day labels and rows that expand in place.
|
|
47
|
+
* @param props - Events, reference time, accessible name, formatting, scrolling, copy and native div attributes.
|
|
48
|
+
* @returns The labelled feed region.
|
|
49
|
+
*/
|
|
50
|
+
declare function Timeline({ events, now, label, timeZone, locale, maxHeight, scrollToNew, defaultExpanded, headingLevel, messages, className, ...props }: TimelineProps): import("react").JSX.Element;
|
|
51
|
+
export { Timeline };
|