@sakaniui/react 0.16.0 → 0.17.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.
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export type ChartSize = 'sm' | 'md' | 'lg' | 'xl';
3
+ export type ChartAppearance = 'default' | 'rich';
3
4
  export type AreaChartVariant = 'default' | 'stacked' | 'step' | 'linear';
4
5
  export interface AreaChartDatum {
5
6
  label: string;
@@ -15,6 +16,10 @@ export interface AreaChartProps {
15
16
  seriesLabels?: [string, string?];
16
17
  size?: ChartSize;
17
18
  height?: number;
19
+ /** Draw the loading state (the chart's own silhouette, breathing) instead of the chart. */
20
+ loading?: boolean;
21
+ /** `rich`: the livelier look (an entrance on mount, a soft glow and lift on hover, a frosted card). `default` is the Figma look. */
22
+ appearance?: ChartAppearance;
18
23
  className?: string;
19
24
  }
20
25
  export declare const AreaChart: React.FC<AreaChartProps>;
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export type ChartSize = 'sm' | 'md' | 'lg' | 'xl';
3
+ export type ChartAppearance = 'default' | 'rich';
3
4
  export type BarChartVariant = 'default' | 'active' | 'multiple' | 'stacked' | 'negative' | 'horizontal';
4
5
  export interface BarChartDatum {
5
6
  label: string;
@@ -13,6 +14,10 @@ export interface BarChartProps {
13
14
  size?: ChartSize;
14
15
  /** Legend labels for `value` / `value2`, shown for "multiple" and "stacked". */
15
16
  seriesLabels?: [string, string?];
17
+ /** Draw the loading state (the chart's own silhouette, breathing) instead of the chart. */
18
+ loading?: boolean;
19
+ /** `rich`: the livelier look (an entrance on mount, a soft glow and lift on hover, a frosted card). `default` is the Figma look. */
20
+ appearance?: ChartAppearance;
16
21
  className?: string;
17
22
  }
18
23
  export declare const BarChart: React.FC<BarChartProps>;
@@ -1,2 +1,2 @@
1
1
  export { BarChart, default } from './BarChart';
2
- export type { BarChartProps, BarChartDatum, BarChartVariant, ChartSize } from './BarChart';
2
+ export type { BarChartProps, BarChartDatum, BarChartVariant, ChartSize, ChartAppearance } from './BarChart';
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export type ChartSize = 'sm' | 'md' | 'lg' | 'xl';
3
+ export type ChartAppearance = 'default' | 'rich';
3
4
  export interface DonutDatum {
4
5
  label: string;
5
6
  value: number;
@@ -13,6 +14,10 @@ export interface DonutChartProps {
13
14
  centerCaption?: string;
14
15
  /** Pixel height override, takes precedence over `size`'s preset. */
15
16
  height?: number;
17
+ /** Draw the loading state (the chart's own silhouette, breathing) instead of the chart. */
18
+ loading?: boolean;
19
+ /** `rich`: the livelier look (turns into place on mount, the hovered slice lifts, a frosted card). `default` is the Figma look. */
20
+ appearance?: ChartAppearance;
16
21
  className?: string;
17
22
  }
18
23
  export declare const DonutChart: React.FC<DonutChartProps>;
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export type ChartSize = 'sm' | 'md' | 'lg' | 'xl';
3
+ export type ChartAppearance = 'default' | 'rich';
3
4
  export interface FunnelDatum {
4
5
  label: string;
5
6
  value: number;
@@ -7,6 +8,14 @@ export interface FunnelDatum {
7
8
  export interface FunnelChartProps {
8
9
  data: FunnelDatum[];
9
10
  size?: ChartSize;
11
+ /** Dots streaming through the band, thinning where the funnel does. Default true; off for reduced motion. */
12
+ flow?: boolean;
13
+ /** Draw the loading state (the funnel's silhouette, a light gliding through it) instead of the chart. */
14
+ loading?: boolean;
15
+ /** How a stage's value is written in the header and the card. Defaults to a compact number (61.2K). */
16
+ formatValue?: (value: number) => string;
17
+ /** `rich`: the header, the drop-off chips, the stream of dots, the wipe-in and a frosted card. `default` is the Figma funnel. `flow` and `formatValue` apply to `rich` only. */
18
+ appearance?: ChartAppearance;
10
19
  className?: string;
11
20
  }
12
21
  export declare const FunnelChart: React.FC<FunnelChartProps>;
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export type ChartSize = 'sm' | 'md' | 'lg' | 'xl';
3
+ export type ChartAppearance = 'default' | 'rich';
3
4
  export interface HeatmapChartProps {
4
5
  /** Row-major matrix of values; every row must be the same length. */
5
6
  data: number[][];
@@ -8,6 +9,10 @@ export interface HeatmapChartProps {
8
9
  /** Legend label for the tooltip's value row (Figma: "Revenue"). */
9
10
  valueLabel?: string;
10
11
  size?: ChartSize;
12
+ /** Draw the loading state (the chart's own silhouette, breathing) instead of the chart. */
13
+ loading?: boolean;
14
+ /** `rich`: the livelier look (the cells arrive as a wave on mount, the hovered one lifts). `default` is the Figma look. */
15
+ appearance?: ChartAppearance;
11
16
  className?: string;
12
17
  }
13
18
  export declare const HeatmapChart: React.FC<HeatmapChartProps>;
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export type ChartSize = 'sm' | 'md' | 'lg' | 'xl';
3
+ export type ChartAppearance = 'default' | 'rich';
3
4
  export type LineChartVariant = 'default' | 'linear' | 'step' | 'multiple' | 'dots' | 'custom-dots' | 'dots-colors' | 'label' | 'custom-label';
4
5
  export interface LineChartProps {
5
6
  /** Rows keyed by label plus one field per series. */
@@ -19,6 +20,10 @@ export interface LineChartProps {
19
20
  * on an ancestor. */
20
21
  height?: number;
21
22
  showLegend?: boolean;
23
+ /** Draw the loading state (the chart's own silhouette, breathing) instead of the chart. */
24
+ loading?: boolean;
25
+ /** `rich`: the livelier look (an entrance on mount, a soft glow and lift on hover, a frosted card). `default` is the Figma look. */
26
+ appearance?: ChartAppearance;
22
27
  className?: string;
23
28
  }
24
29
  export declare const LineChart: React.FC<LineChartProps>;
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export type ChartSize = 'sm' | 'md' | 'lg' | 'xl';
3
+ export type ChartAppearance = 'default' | 'rich';
3
4
  export type PieChartVariant = 'pie' | 'pie-no-separator' | 'label' | 'custom-label' | 'label-list' | 'donut' | 'donut-active' | 'donut-with-text' | 'stacked' | 'interactive';
4
5
  export interface PieDatum {
5
6
  label: string;
@@ -12,6 +13,10 @@ export interface PieChartProps {
12
13
  /** Big number shown in the center. Only rendered for "donut-with-text". */
13
14
  centerValue?: string;
14
15
  centerCaption?: string;
16
+ /** Draw the loading state (the chart's own silhouette, breathing) instead of the chart. */
17
+ loading?: boolean;
18
+ /** `rich`: the livelier look (turns into place on mount, the hovered slice lifts, a frosted card). `default` is the Figma look. */
19
+ appearance?: ChartAppearance;
15
20
  className?: string;
16
21
  }
17
22
  export declare const PieChart: React.FC<PieChartProps>;
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export type ChartSize = 'sm' | 'md' | 'lg' | 'xl';
3
+ export type ChartAppearance = 'default' | 'rich';
3
4
  export type RadarChartVariant = 'default' | 'dots' | 'dots-grid-none' | 'lines-only' | 'circle-grid' | 'circle-grid-no-lines' | 'grid-custom' | 'grid-filled' | 'circle-grid-filled' | 'multiple' | 'custom-label';
4
5
  export interface RadarDatum {
5
6
  label: string;
@@ -13,6 +14,16 @@ export interface RadarChartProps {
13
14
  size?: ChartSize;
14
15
  /** Legend labels for `value` / `value2`, shown for "multiple". */
15
16
  seriesLabels?: [string, string?];
17
+ /** Draw the loading state (the radar's own silhouette, breathing) instead of the chart. */
18
+ loading?: boolean;
19
+ /**
20
+ * `rich`: the livelier look. Shapes get a soft gradient fill, a crisp edge and a glow, grow out of the centre on mount
21
+ * and morph when the data changes, and hovering a spoke draws a crosshair, a dot on each series and a card with the
22
+ * values and the gap between two series. `default` is the Figma look.
23
+ */
24
+ appearance?: ChartAppearance;
25
+ /** appearance="rich" only: the spoke crosshair and its card. Default true. */
26
+ interactive?: boolean;
16
27
  className?: string;
17
28
  }
18
29
  export declare const RadarChart: React.FC<RadarChartProps>;
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  export type ChartSize = 'sm' | 'md' | 'lg' | 'xl';
3
+ export type ChartAppearance = 'default' | 'rich';
3
4
  export type RadialChartVariant = 'multi' | 'grid' | 'text' | 'shape' | 'gauge-tick' | 'stacked' | 'stacked-3-layers' | 'stacked-label';
4
5
  export interface RadialDatum {
5
6
  label: string;
@@ -12,6 +13,10 @@ export interface RadialChartProps {
12
13
  size?: ChartSize;
13
14
  centerValue?: string;
14
15
  centerCaption?: string;
16
+ /** Draw the loading state (the chart's own silhouette, breathing) instead of the chart. */
17
+ loading?: boolean;
18
+ /** `rich`: the livelier look (turns into place on mount, the rings and gauges rise in). `default` is the Figma look. */
19
+ appearance?: ChartAppearance;
15
20
  className?: string;
16
21
  }
17
22
  export declare const RadialChart: React.FC<RadialChartProps>;