@astra-kit/ui 1.0.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 +32 -0
- package/README.md +14 -3
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/components/button-link.d.ts +15 -0
- package/dist/components/button-link.js +70 -0
- package/dist/components/button-recipe.d.ts +27 -0
- package/dist/components/button-recipe.js +44 -0
- package/dist/components/button.d.ts +3 -5
- package/dist/components/button.js +1 -25
- 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/radio-group.d.ts +5 -3
- package/dist/components/radio-group.js +88 -85
- 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 +7 -0
- package/dist/index.js +8 -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 +31 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import type { UsageMeterCopyValues, UsageMeterMessages, UsageMeterStatus } from "../constants/usage-meter.js";
|
|
3
|
+
export type { UsageMeterCopyValues, UsageMeterMessages, UsageMeterStatus };
|
|
4
|
+
export type UsageMeterSegment = {
|
|
5
|
+
/** Stable identity. Keep it while the value changes, so the segment re-flows instead of being replaced. */
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
/** Used amount, in the same unit as the limit. */
|
|
9
|
+
value: number;
|
|
10
|
+
};
|
|
11
|
+
export type UsageMeterProps = Omit<ComponentProps<"div">, "children"> & {
|
|
12
|
+
/** What is measured, such as "Códigos enviados hoy". */
|
|
13
|
+
label: string;
|
|
14
|
+
/** Used amounts in display order. Keep ids stable so segments re-flow. Up to four read clearly. */
|
|
15
|
+
segments: UsageMeterSegment[];
|
|
16
|
+
/** The plan limit, in the same unit as the segments. */
|
|
17
|
+
limit: number;
|
|
18
|
+
/** Unit shown after numbers, such as "GB". */
|
|
19
|
+
unit?: string;
|
|
20
|
+
/** Digits after the decimal separator. Defaults to 1. */
|
|
21
|
+
decimals?: number;
|
|
22
|
+
/** Legend label of the remaining space. Defaults to "Libre". */
|
|
23
|
+
freeLabel?: string;
|
|
24
|
+
/** Legend label of the overage. Defaults to "Excedente". */
|
|
25
|
+
overLabel?: string;
|
|
26
|
+
/** Share of the limit at which the badge warns that it is almost full. Defaults to 0.9. */
|
|
27
|
+
warnAt?: number;
|
|
28
|
+
/** Replaces any of the Spanish captions, badges and announcements. */
|
|
29
|
+
messages?: Partial<UsageMeterMessages>;
|
|
30
|
+
/** Locale of the numbers' separators. Defaults to `"es-AR"`. */
|
|
31
|
+
locale?: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* A segmented bar showing what uses a fixed allowance, with a rolling total, a status badge and an interactive legend.
|
|
35
|
+
* @param props - Label, segments, limit, unit, legend labels, copy overrides and native div attributes.
|
|
36
|
+
* @returns The usage meter.
|
|
37
|
+
*/
|
|
38
|
+
declare function UsageMeter({ label, segments: rawSegments, limit, unit, decimals, freeLabel, overLabel, warnAt, messages, locale, className, ...props }: UsageMeterProps): import("react").JSX.Element;
|
|
39
|
+
export { UsageMeter };
|