@ssa-ui-kit/core 3.4.0 → 3.6.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/dist/components/Charts/BarGaugeChart/types.d.ts +1 -1
- package/dist/components/Charts/BarLineComplexChart/constants.d.ts +0 -15
- package/dist/components/Charts/BarLineComplexChart/types.d.ts +1 -1
- package/dist/components/Charts/BigNumberChart/BigNumberChart.d.ts +1 -1
- package/dist/components/Charts/CandlestickChart/CandlestickChart.d.ts +1 -1
- package/dist/components/Charts/GaugeChart/GaugeChart.d.ts +1 -1
- package/dist/components/Charts/RadarChart/RadarChart.d.ts +1 -1
- package/dist/components/Charts/TreeMapChart/TreeMapChart.d.ts +1 -1
- package/dist/components/Counter/Counter.d.ts +60 -0
- package/dist/components/Counter/index.d.ts +1 -0
- package/dist/components/Counter/styles.d.ts +15 -0
- package/dist/components/Counter/types.d.ts +57 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/index.js +264 -97
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,16 +1 @@
|
|
|
1
1
|
export declare const FONT_FAMILY = "Manrope, sans-serif";
|
|
2
|
-
export declare const TITLE_PADDING_LEFT: {
|
|
3
|
-
mobile: number;
|
|
4
|
-
md: number;
|
|
5
|
-
other: number;
|
|
6
|
-
};
|
|
7
|
-
export declare const TITLE_PADDING_TOP: {
|
|
8
|
-
mobile: number;
|
|
9
|
-
md: number;
|
|
10
|
-
other: number;
|
|
11
|
-
};
|
|
12
|
-
export declare const TITLE_FONT_SIZE: {
|
|
13
|
-
mobile: number;
|
|
14
|
-
md: number;
|
|
15
|
-
other: number;
|
|
16
|
-
};
|
|
@@ -15,7 +15,7 @@ export interface BarLineComplexChartProps extends Omit<PlotParams, 'layout'> {
|
|
|
15
15
|
lineShape?: Plotly.ScatterLine['shape'];
|
|
16
16
|
width?: string;
|
|
17
17
|
height?: string;
|
|
18
|
-
title?:
|
|
18
|
+
title?: React.ReactNode;
|
|
19
19
|
maxVisibleBars?: number;
|
|
20
20
|
maxVisibleLines?: number;
|
|
21
21
|
container?: Element | DocumentFragment;
|
|
@@ -6,7 +6,7 @@ type Datum = LineSeries['data'][number];
|
|
|
6
6
|
export interface BigNumberChartProps {
|
|
7
7
|
data: Datum[];
|
|
8
8
|
interactive?: boolean;
|
|
9
|
-
title?:
|
|
9
|
+
title?: React.ReactNode;
|
|
10
10
|
widgetCardProps?: WidgetCardProps;
|
|
11
11
|
trendLineProps?: Omit<TrendLineProps, 'data' | 'height' | 'width'>;
|
|
12
12
|
features?: BigNumberChartFeatures[];
|
|
@@ -5,7 +5,7 @@ export type CandlestickChartFeatures = 'header' | 'fullscreenMode';
|
|
|
5
5
|
export interface CandlestickChartProps extends Partial<Omit<PlotParams, 'data' | 'style'>> {
|
|
6
6
|
data: CandlestickChartData;
|
|
7
7
|
style?: CandlestickStyle;
|
|
8
|
-
title?:
|
|
8
|
+
title?: React.ReactNode;
|
|
9
9
|
features?: CandlestickChartFeatures[];
|
|
10
10
|
widgetCardProps?: WidgetCardProps;
|
|
11
11
|
}
|
|
@@ -4,7 +4,7 @@ declare const ResponsiveRadar: <D extends Record<string, unknown>>(props: import
|
|
|
4
4
|
export type RadarChartFeatures = 'header' | 'fullscreenMode';
|
|
5
5
|
type ResponsiveRadarProps<D extends Record<string, unknown>> = ComponentProps<typeof ResponsiveRadar<D>>;
|
|
6
6
|
export interface RadarChartProps<D extends Record<string, unknown>> extends Omit<ResponsiveRadarProps<D>, 'legends'> {
|
|
7
|
-
title?:
|
|
7
|
+
title?: React.ReactNode;
|
|
8
8
|
legends?: Partial<NonNullable<ResponsiveRadarProps<D>['legends']>[number]>[];
|
|
9
9
|
features?: RadarChartFeatures[];
|
|
10
10
|
widgetCardProps?: WidgetCardProps;
|
|
@@ -10,7 +10,7 @@ export type TreeMapChartFeature = 'header' | 'fullscreenMode';
|
|
|
10
10
|
type NivoTreeMapChartProps = React.ComponentProps<typeof ResponsiveTreeMap<TreeNode>>;
|
|
11
11
|
export interface TreeMapChartProps extends Omit<NivoTreeMapChartProps, 'data'> {
|
|
12
12
|
data: TreeNode;
|
|
13
|
-
title?:
|
|
13
|
+
title?: React.ReactNode;
|
|
14
14
|
fullScreen?: boolean;
|
|
15
15
|
features?: TreeMapChartFeature[];
|
|
16
16
|
widgetCardProps?: WidgetCardProps;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { CounterProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Counter - Compact numeric indicator for displaying counts or notification badges.
|
|
4
|
+
*
|
|
5
|
+
* ### Sizing
|
|
6
|
+
* Accepts `'small' | 'medium' | 'large'` via the `size` prop (default `'medium'`).
|
|
7
|
+
* When `count` is omitted the counter shrinks to a small dot (`dot` size) — useful
|
|
8
|
+
* as a presence indicator with no number shown.
|
|
9
|
+
*
|
|
10
|
+
* ### Color
|
|
11
|
+
* Background is driven by `theme.palette[variant].main` for the five semantic variants.
|
|
12
|
+
* Pass `color` to override: a `theme.colors` key resolves to the design token value,
|
|
13
|
+
* any other string is used as a raw CSS color.
|
|
14
|
+
*
|
|
15
|
+
* ### CSS override
|
|
16
|
+
* Pass `css` to apply one-off Emotion styles on top of all internal styles
|
|
17
|
+
* (size → variant → color → css). Useful for margins, positioning, or shape tweaks.
|
|
18
|
+
*
|
|
19
|
+
* ### Overflow
|
|
20
|
+
* Values above 99 are automatically clamped to `"99+"`.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* // Basic usage — primary variant, medium size
|
|
25
|
+
* <Counter count={5} />
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* // Overflow label
|
|
31
|
+
* <Counter count={120} variant={CounterVariants.error} size="large" />
|
|
32
|
+
* // renders "99+"
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* // Raw hex color override
|
|
38
|
+
* <Counter count={3} color="#F7931A" />
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // theme.colors key as color
|
|
44
|
+
* <Counter count={7} color="purple" />
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* // Empty dot indicator (no count)
|
|
50
|
+
* <Counter variant={CounterVariants.error} />
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```tsx
|
|
55
|
+
* // CSS override for layout / shape
|
|
56
|
+
* <Counter count={3} css={{ marginLeft: 8, borderRadius: 4 }} />
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare const Counter: ({ count, variant, size, color, className, css, ref, }: CounterProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
60
|
+
export default Counter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Counter';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VariantStyle, CounterSizes } from './types';
|
|
2
|
+
import { Theme, SerializedStyles } from '@emotion/react';
|
|
3
|
+
import { ColorsKeys } from '../../types/emotion';
|
|
4
|
+
export declare const variantStyles: VariantStyle;
|
|
5
|
+
export declare const sizeStyles: CounterSizes;
|
|
6
|
+
/**
|
|
7
|
+
* Builds a background override from a `color` string.
|
|
8
|
+
* If `color` matches a key in `theme.colors` the design token is used;
|
|
9
|
+
* otherwise the value is passed through as a raw CSS color string.
|
|
10
|
+
*/
|
|
11
|
+
export declare const makeColorOverride: (theme: Theme, color: ColorsKeys | string) => SerializedStyles;
|
|
12
|
+
export declare const CounterBase: import("@emotion/styled").StyledComponent<{
|
|
13
|
+
theme?: Theme;
|
|
14
|
+
as?: React.ElementType;
|
|
15
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MainSizes } from '../../types/global';
|
|
3
|
+
import { ColorsKeys } from '../../types/emotion';
|
|
4
|
+
import { Interpolation, SerializedStyles, Theme } from '@emotion/react';
|
|
5
|
+
export declare enum CounterVariants {
|
|
6
|
+
primary = "primary",
|
|
7
|
+
secondary = "secondary",
|
|
8
|
+
error = "error",
|
|
9
|
+
warning = "warning",
|
|
10
|
+
success = "success"
|
|
11
|
+
}
|
|
12
|
+
export type VariantStyle = {
|
|
13
|
+
[k in CounterVariants]: (theme: Theme) => SerializedStyles;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Extends `MainSizes` with a `dot` slot used internally when `count` is
|
|
17
|
+
* undefined — renders a small dot with no label as a presence indicator.
|
|
18
|
+
*/
|
|
19
|
+
export type CounterSizes = MainSizes & {
|
|
20
|
+
dot: SerializedStyles;
|
|
21
|
+
};
|
|
22
|
+
export type CounterProps = {
|
|
23
|
+
/**
|
|
24
|
+
* The numeric value to display. Values above 99 are clamped to `"99+"`.
|
|
25
|
+
* When omitted, the counter renders as a dot with no label.
|
|
26
|
+
*/
|
|
27
|
+
count?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Visual style variant. Drives the background color from `theme.palette`.
|
|
30
|
+
* @default CounterVariants.primary
|
|
31
|
+
*/
|
|
32
|
+
variant?: CounterVariants;
|
|
33
|
+
/**
|
|
34
|
+
* Size of the counter.
|
|
35
|
+
* Ignored when `count` is undefined — the component uses `dot` automatically.
|
|
36
|
+
* @default 'medium'
|
|
37
|
+
*/
|
|
38
|
+
size?: keyof MainSizes;
|
|
39
|
+
/**
|
|
40
|
+
* Optional color override. Accepts a `theme.colors` key or any valid CSS color string.
|
|
41
|
+
* When provided, overrides the variant background.
|
|
42
|
+
*/
|
|
43
|
+
color?: ColorsKeys | string;
|
|
44
|
+
/**
|
|
45
|
+
* Custom CSS class name.
|
|
46
|
+
*/
|
|
47
|
+
className?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Emotion CSS override applied after all internal styles.
|
|
50
|
+
* Use for one-off layout adjustments (e.g. margins, positioning).
|
|
51
|
+
*/
|
|
52
|
+
css?: Interpolation<Theme>;
|
|
53
|
+
/**
|
|
54
|
+
* Ref forwarded to the root `<div>` element.
|
|
55
|
+
*/
|
|
56
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
57
|
+
};
|
|
@@ -70,6 +70,8 @@ export * from './Typography';
|
|
|
70
70
|
export type * from './Typography/types';
|
|
71
71
|
export { default as Badge } from './Badge';
|
|
72
72
|
export type * from './Badge/types';
|
|
73
|
+
export * from './Counter';
|
|
74
|
+
export type * from './Counter/types';
|
|
73
75
|
export { default as Tag } from './Tag';
|
|
74
76
|
export * from './Tag';
|
|
75
77
|
export type * from './Tag/types';
|