@mechane-ai/elements 0.20.1 → 0.21.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.
@@ -8,6 +8,7 @@ export type { InspectorProps } from './inspector.tsx';
8
8
  export { Inspector, Details } from './inspector.tsx';
9
9
  export { ListFooter } from './list-footer.tsx';
10
10
  export { MetricGrid, Metric } from './metrics.tsx';
11
+ export type { MetricGridProps, MetricProps } from './metrics.tsx';
11
12
  export type { TimestampProps } from './timestamp.tsx';
12
13
  export { Timestamp } from './timestamp.tsx';
13
14
  export { Timeline } from './timeline.tsx';
@@ -1,12 +1,71 @@
1
- import type { ComponentProps, ReactNode } from 'react';
1
+ import * as stylex from '@stylexjs/stylex';
2
+ import type { ComponentProps, ReactElement, ReactNode } from 'react';
2
3
  type MetricLayout = 'inline' | 'columns';
3
- type MetricGridProps = ComponentProps<'dl'> & {
4
+ declare const variants: {
5
+ inline: {
6
+ metric: undefined;
7
+ label: undefined;
8
+ value: undefined;
9
+ detail: Readonly<{
10
+ readonly flexBasis: stylex.StyleXClassNameFor<"flexBasis", "100%">;
11
+ }>;
12
+ valueWidth: string;
13
+ };
14
+ statistic: {
15
+ metric: Readonly<{
16
+ readonly flexDirection: stylex.StyleXClassNameFor<"flexDirection", "column">;
17
+ readonly alignItems: stylex.StyleXClassNameFor<"alignItems", "flex-start">;
18
+ }>;
19
+ label: Readonly<{
20
+ readonly order: stylex.StyleXClassNameFor<"order", 0>;
21
+ }>;
22
+ value: Readonly<{
23
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
24
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
25
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
26
+ readonly letterSpacing: stylex.StyleXClassNameFor<"letterSpacing", string>;
27
+ }>;
28
+ detail: undefined;
29
+ valueWidth: string;
30
+ };
31
+ headline: {
32
+ metric: Readonly<{
33
+ readonly columnGap: stylex.StyleXClassNameFor<"columnGap", string>;
34
+ }>;
35
+ label: Readonly<{
36
+ readonly order: stylex.StyleXClassNameFor<"order", 0>;
37
+ readonly flexBasis: stylex.StyleXClassNameFor<"flexBasis", "100%">;
38
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
39
+ }>;
40
+ value: Readonly<{
41
+ readonly fontSize: stylex.StyleXClassNameFor<"fontSize", string>;
42
+ readonly lineHeight: stylex.StyleXClassNameFor<"lineHeight", string>;
43
+ readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", string>;
44
+ readonly letterSpacing: stylex.StyleXClassNameFor<"letterSpacing", string>;
45
+ }>;
46
+ detail: undefined;
47
+ valueWidth: string;
48
+ };
49
+ };
50
+ type MetricVariant = keyof typeof variants;
51
+ export type MetricGridProps = ComponentProps<'dl'> & {
4
52
  readonly layout?: MetricLayout;
5
53
  };
6
- type MetricProps = ComponentProps<'div'> & {
54
+ export type MetricProps = Omit<ComponentProps<'div'>, 'children' | 'dangerouslySetInnerHTML'> & {
7
55
  readonly label: string;
56
+ readonly variant?: MetricVariant;
57
+ readonly trend?: ReactElement;
58
+ } & ({
59
+ readonly isLoading?: false;
8
60
  readonly value: string;
9
- };
61
+ readonly detail?: string;
62
+ readonly hasDetail?: never;
63
+ } | {
64
+ readonly isLoading: true;
65
+ readonly value?: never;
66
+ readonly detail?: never;
67
+ readonly hasDetail?: boolean;
68
+ });
10
69
  export declare function MetricGrid({ layout, ...props }: MetricGridProps): ReactNode;
11
- export declare function Metric({ label, value, ...props }: MetricProps): ReactNode;
70
+ export declare function Metric({ label, value, detail, isLoading, hasDetail, variant, trend, ...props }: MetricProps): ReactNode;
12
71
  export {};
@@ -8,6 +8,8 @@ export { ViewStack } from './view-stack.tsx';
8
8
  export { PageToolbar, ToolbarAction } from './page-toolbar.tsx';
9
9
  export type { PageContentProps } from './page-content.tsx';
10
10
  export { PageContent } from './page-content.tsx';
11
+ export type { ReportSectionProps } from './report-section.tsx';
12
+ export { ReportSection } from './report-section.tsx';
11
13
  export type { RecordPageRootProps, RecordPageToolbarProps, RecordPageBodyProps, RecordPageHeaderProps, RecordPageContentProps, RecordPageAsideProps, } from './record-page.tsx';
12
14
  export { RecordPage } from './record-page.tsx';
13
15
  export type { ResizableRootProps, ResizablePaneProps, ResizableHandleProps } from './resizable.tsx';
@@ -0,0 +1,6 @@
1
+ import type { ReactElement, ReactNode } from 'react';
2
+ export type ReportSectionProps = {
3
+ readonly summary: ReactElement;
4
+ readonly children: ReactElement;
5
+ };
6
+ export declare function ReportSection({ summary, children }: ReportSectionProps): ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mechane-ai/elements",
3
- "version": "0.20.1",
3
+ "version": "0.21.0",
4
4
  "description": "Elements by Mechane — React components for applications, AI interfaces, and analytical graphics",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {