@selectwin/kit 0.1.117 → 0.1.119
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/SelectBalanceCard.d.ts +27 -1
- package/dist/SelectChartLegend.d.ts +17 -0
- package/dist/SelectColumnChart.d.ts +22 -2
- package/dist/SelectInsight.d.ts +119 -0
- package/dist/chartUtils.d.ts +4 -0
- package/dist/icons.d.ts +6 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +1547 -1001
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -4,11 +4,23 @@ export interface SelectBalanceBucket {
|
|
|
4
4
|
cents: number | string | null | undefined;
|
|
5
5
|
/** Optional icon embedded in the bucket's mini-card. */
|
|
6
6
|
icon?: ReactNode;
|
|
7
|
+
/** One line of context under the amount (hero tiles only) — "Entra no disponível nos próximos dias". */
|
|
8
|
+
hint?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** One context number on the hero's strip ("Entra nos próximos 7 dias", "Último saque · 23/09"). */
|
|
11
|
+
export interface SelectBalanceMeta {
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
/** Amount in CENTS (through SelectMoney → honors hide-values)… */
|
|
14
|
+
cents?: number | string | null;
|
|
15
|
+
/** …or any other content when the value isn't money (or the amount is null — else "—"). */
|
|
16
|
+
value?: ReactNode;
|
|
17
|
+
/** Sign/prefix drawn before the amount, e.g. "+ ". */
|
|
18
|
+
prefix?: string;
|
|
7
19
|
}
|
|
8
20
|
export interface SelectBalanceCardProps {
|
|
9
21
|
availableCents: number | string | null | undefined;
|
|
10
22
|
availableLabel?: string;
|
|
11
|
-
/** Period-over-period variation of the available balance (percentage). */
|
|
23
|
+
/** Period-over-period variation of the available balance (percentage). `card` only. */
|
|
12
24
|
delta?: number | null;
|
|
13
25
|
buckets?: SelectBalanceBucket[];
|
|
14
26
|
action?: {
|
|
@@ -16,6 +28,20 @@ export interface SelectBalanceCardProps {
|
|
|
16
28
|
onAction: () => void;
|
|
17
29
|
disabled?: boolean;
|
|
18
30
|
loading?: boolean;
|
|
31
|
+
icon?: ReactNode;
|
|
32
|
+
};
|
|
33
|
+
/** `card` (default) or `hero` — see the file header. */
|
|
34
|
+
variant?: 'card' | 'hero';
|
|
35
|
+
/** hero: a quiet line under the amount — "Atualizado há 3 min". */
|
|
36
|
+
updatedLabel?: ReactNode;
|
|
37
|
+
/** hero: context numbers on a strip under the amount (2 read best; empty = no strip). */
|
|
38
|
+
meta?: SelectBalanceMeta[];
|
|
39
|
+
/** hero: state pill beside the action (e.g. the auto-cashout that is on). */
|
|
40
|
+
status?: {
|
|
41
|
+
label: ReactNode;
|
|
42
|
+
tone?: 'success' | 'warning' | 'neutral';
|
|
19
43
|
};
|
|
44
|
+
/** hero: amounts become skeletons (the frame keeps its shape — swaps once when data lands). */
|
|
45
|
+
loading?: boolean;
|
|
20
46
|
}
|
|
21
47
|
export declare const SelectBalanceCard: import('react').ForwardRefExoticComponent<SelectBalanceCardProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof SelectBalanceCardProps> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export interface SelectChartLegendItem {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
value?: ReactNode;
|
|
5
|
+
/** Swatch color — the series' `color`. */
|
|
6
|
+
color?: string;
|
|
7
|
+
/** Match a `pattern: 'hatch'` series. */
|
|
8
|
+
pattern?: 'hatch';
|
|
9
|
+
/** Instead of a swatch (a total that isn't drawn, e.g. "Cancelados"). */
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
type SelectChartLegendOwnProps = {
|
|
13
|
+
items: SelectChartLegendItem[];
|
|
14
|
+
};
|
|
15
|
+
export type SelectChartLegendProps = SelectChartLegendOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectChartLegendOwnProps>;
|
|
16
|
+
export declare function SelectChartLegend({ items, className, ...rest }: SelectChartLegendProps): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
import { SelectChartSeries } from './chartUtils';
|
|
3
|
+
/** What the hover card shows for one slot (see `tooltip`). */
|
|
4
|
+
export interface SelectColumnTooltip {
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
rows: {
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
value: ReactNode;
|
|
9
|
+
color?: string;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
3
12
|
type SelectColumnChartOwnProps = {
|
|
4
13
|
series: SelectChartSeries[];
|
|
5
14
|
labels: string[];
|
|
@@ -7,7 +16,18 @@ type SelectColumnChartOwnProps = {
|
|
|
7
16
|
format?: (n: number) => string;
|
|
8
17
|
/** Stack the series into one bar per label instead of grouping side by side. */
|
|
9
18
|
stacked?: boolean;
|
|
19
|
+
/** A dashed vertical line with a label ("Hoje") on slot `index` — through its centre, or on
|
|
20
|
+
* its trailing edge with `edge: 'end'` (the seam between what happened and what's scheduled).
|
|
21
|
+
* The thinned x labels anchor on this slot, so it always keeps its label. */
|
|
22
|
+
marker?: {
|
|
23
|
+
index: number;
|
|
24
|
+
label?: string;
|
|
25
|
+
edge?: 'center' | 'end';
|
|
26
|
+
};
|
|
27
|
+
/** Custom hover card for slot `index`; return null for no card there. Default: the slot's
|
|
28
|
+
* label as title and one row per series. */
|
|
29
|
+
tooltip?: (index: number) => SelectColumnTooltip | null;
|
|
10
30
|
};
|
|
11
31
|
export type SelectColumnChartProps = SelectColumnChartOwnProps & Omit<ComponentPropsWithoutRef<'div'>, keyof SelectColumnChartOwnProps>;
|
|
12
|
-
export declare function SelectColumnChart({ series, labels, height, format, stacked, className, ...rest }: SelectColumnChartProps): import("react").JSX.Element;
|
|
32
|
+
export declare function SelectColumnChart({ series, labels, height, format, stacked, marker, tooltip, className, ...rest }: SelectColumnChartProps): import("react").JSX.Element;
|
|
13
33
|
export {};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** Um valor do achado: `display` para ler, `raw` para gráfico/ordenação (percentual em fração, dinheiro em centavos). */
|
|
3
|
+
export interface SelectInsightValue {
|
|
4
|
+
type: string;
|
|
5
|
+
raw: number | string | readonly string[];
|
|
6
|
+
display: string;
|
|
7
|
+
currency: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface SelectInsightItem {
|
|
10
|
+
/** `product`, `ad`, `campaign`, `coupon`, `channel`, `network`, `field`, `segment`… */
|
|
11
|
+
kind: string;
|
|
12
|
+
/** O id do recurso quando existe tela para ele (`prd_…`). */
|
|
13
|
+
id: string | null;
|
|
14
|
+
label: string;
|
|
15
|
+
value: SelectInsightValue | null;
|
|
16
|
+
}
|
|
17
|
+
export type SelectInsightBlock = {
|
|
18
|
+
type: 'metric';
|
|
19
|
+
label: string;
|
|
20
|
+
value: SelectInsightValue;
|
|
21
|
+
hint: string | null;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'comparison';
|
|
24
|
+
label: string;
|
|
25
|
+
value: SelectInsightValue;
|
|
26
|
+
baseline: SelectInsightValue;
|
|
27
|
+
baselineLabel: string;
|
|
28
|
+
hint: string | null;
|
|
29
|
+
} | {
|
|
30
|
+
type: 'table';
|
|
31
|
+
title: string;
|
|
32
|
+
columns: ReadonlyArray<{
|
|
33
|
+
key: string;
|
|
34
|
+
label: string;
|
|
35
|
+
}>;
|
|
36
|
+
rows: ReadonlyArray<Record<string, SelectInsightValue>>;
|
|
37
|
+
} | {
|
|
38
|
+
type: 'items';
|
|
39
|
+
title: string;
|
|
40
|
+
items: ReadonlyArray<SelectInsightItem>;
|
|
41
|
+
} | {
|
|
42
|
+
type: 'text';
|
|
43
|
+
text: string;
|
|
44
|
+
};
|
|
45
|
+
export interface SelectInsightAction {
|
|
46
|
+
label: string;
|
|
47
|
+
/** Destino estável (`guide:utm`, `product:prd_…`) ou `null` — conselho sem tela. */
|
|
48
|
+
target: string | null;
|
|
49
|
+
}
|
|
50
|
+
/** O achado como o node o entrega. Campos a mais (id, status, score…) passam sem atrapalhar. */
|
|
51
|
+
export interface SelectInsightData {
|
|
52
|
+
title: string;
|
|
53
|
+
summary: string;
|
|
54
|
+
severity: string;
|
|
55
|
+
confidence?: string | null;
|
|
56
|
+
sampleSize?: number | null;
|
|
57
|
+
kind?: string | null;
|
|
58
|
+
domain?: string | null;
|
|
59
|
+
impact?: {
|
|
60
|
+
currency: string;
|
|
61
|
+
minCents: number;
|
|
62
|
+
maxCents: number;
|
|
63
|
+
} | null;
|
|
64
|
+
period?: {
|
|
65
|
+
start: string;
|
|
66
|
+
end: string;
|
|
67
|
+
} | null;
|
|
68
|
+
methodology?: string | null;
|
|
69
|
+
/** Aceita tipos que esta versão não conhece — são ignorados na renderização. */
|
|
70
|
+
blocks?: ReadonlyArray<SelectInsightBlock | {
|
|
71
|
+
type: string;
|
|
72
|
+
}>;
|
|
73
|
+
actions?: ReadonlyArray<SelectInsightAction>;
|
|
74
|
+
}
|
|
75
|
+
export type SelectInsightLocale = 'pt-BR' | 'en' | 'es';
|
|
76
|
+
export interface SelectInsightLabels {
|
|
77
|
+
severity: Record<string, string>;
|
|
78
|
+
kind: Record<string, string>;
|
|
79
|
+
domain: Record<string, string>;
|
|
80
|
+
confidence: Record<string, string>;
|
|
81
|
+
sample: (n: string) => string;
|
|
82
|
+
/** A faixa já formatada ("R$ 2.038 a R$ 3.962") → a frase do impacto. */
|
|
83
|
+
impact: (range: string) => string;
|
|
84
|
+
/** Impacto com mínimo = máximo — ainda é estimativa, então nunca um número seco. */
|
|
85
|
+
impactAbout: (value: string) => string;
|
|
86
|
+
rangeJoin: string;
|
|
87
|
+
methodology: string;
|
|
88
|
+
actions: string;
|
|
89
|
+
locked: string;
|
|
90
|
+
}
|
|
91
|
+
/** "R$ 2.038 a R$ 3.962" — em reais inteiros: é estimativa, centavo seria falsa precisão. */
|
|
92
|
+
export declare function formatInsightImpact(impact: {
|
|
93
|
+
currency: string;
|
|
94
|
+
minCents: number;
|
|
95
|
+
maxCents: number;
|
|
96
|
+
}, locale?: string, labels?: Pick<SelectInsightLabels, 'impact' | 'impactAbout' | 'rangeJoin'>): string;
|
|
97
|
+
export interface SelectInsightProps {
|
|
98
|
+
insight: SelectInsightData;
|
|
99
|
+
/** Os rótulos do card. O TEXTO do achado já vem traduzido pelo node — passe a mesma língua que pediu a ele. */
|
|
100
|
+
locale?: string;
|
|
101
|
+
labels?: Partial<SelectInsightLabels>;
|
|
102
|
+
/** Fuso do período (o calendário do Lince é o de São Paulo). */
|
|
103
|
+
timeZone?: string;
|
|
104
|
+
/** A isca do plano: só título, resumo e impacto, esmaecidos, com o `lockedCta`. */
|
|
105
|
+
locked?: boolean;
|
|
106
|
+
lockedCta?: ReactNode;
|
|
107
|
+
/** Selos a mais no cabeçalho (no console: o estado do achado, o "o lojista vê travado"). */
|
|
108
|
+
badges?: ReactNode;
|
|
109
|
+
/** Linha a mais no pé do card (no console: o `subjectKey`). */
|
|
110
|
+
footer?: ReactNode;
|
|
111
|
+
/** O rótulo de um item virado link quando houver tela (`product` + `prd_…`). `undefined` = só o texto. */
|
|
112
|
+
renderItem?: (item: SelectInsightItem) => ReactNode | undefined;
|
|
113
|
+
/** Uma ação virada link/botão pelo `target`. `undefined` = só o texto. */
|
|
114
|
+
renderAction?: (action: SelectInsightAction) => ReactNode | undefined;
|
|
115
|
+
/** "Como calculamos" aberto de saída. */
|
|
116
|
+
methodologyOpen?: boolean;
|
|
117
|
+
className?: string;
|
|
118
|
+
}
|
|
119
|
+
export declare function SelectInsight({ insight, locale, labels: labelsOverride, timeZone, locked, lockedCta, badges, footer, renderItem, renderAction, methodologyOpen, className, }: SelectInsightProps): import("react").JSX.Element;
|
package/dist/chartUtils.d.ts
CHANGED
|
@@ -58,6 +58,10 @@ export interface SelectChartSeries {
|
|
|
58
58
|
name: string;
|
|
59
59
|
data: number[];
|
|
60
60
|
color?: string;
|
|
61
|
+
/** SelectColumnChart: paint the bars with diagonal stripes of `color` instead of the solid
|
|
62
|
+
* gradient — the second encoding for "not happened yet" (scheduled, projected), so the
|
|
63
|
+
* difference never rides on color alone. */
|
|
64
|
+
pattern?: 'hatch';
|
|
61
65
|
}
|
|
62
66
|
export interface SelectBarDatum {
|
|
63
67
|
label: string;
|
package/dist/icons.d.ts
CHANGED
|
@@ -97,6 +97,12 @@ export declare function LockIcon(): import("react").JSX.Element;
|
|
|
97
97
|
export declare function CalendarIcon(): import("react").JSX.Element;
|
|
98
98
|
export declare function ChevronUpIcon(): import("react").JSX.Element;
|
|
99
99
|
export declare function ExportIcon(): import("react").JSX.Element;
|
|
100
|
+
/** Iconsax "Bank" — conta bancária / destino de saque (o prédio genérico é o BuildingIcon). */
|
|
101
|
+
export declare function BankIcon(): import("react").JSX.Element;
|
|
102
|
+
/** Iconsax "MoneySend" — dinheiro saindo (saque). O ExportIcon é o de exportação de arquivo. */
|
|
103
|
+
export declare function MoneySendIcon(): import("react").JSX.Element;
|
|
104
|
+
/** Iconsax "MoneyRecive" — dinheiro entrando (recebíveis, liberações). */
|
|
105
|
+
export declare function MoneyReceiveIcon(): import("react").JSX.Element;
|
|
100
106
|
export declare function ClipboardIcon(): import("react").JSX.Element;
|
|
101
107
|
export declare function NoteIcon(): import("react").JSX.Element;
|
|
102
108
|
export declare function DiscountIcon(): import("react").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ export { SelectMoney, SelectSensitiveValue, SelectMetricDelta, SelectHideMoneyTo
|
|
|
96
96
|
export { SelectBalanceCard } from './SelectBalanceCard';
|
|
97
97
|
export { SelectFeeBreakdown } from './SelectFeeBreakdown';
|
|
98
98
|
export { SelectKpiCard } from './SelectKpiCard';
|
|
99
|
+
export { SelectInsight, formatInsightImpact } from './SelectInsight';
|
|
99
100
|
export { SelectChartCard } from './SelectChartCard';
|
|
100
101
|
export { SelectSparkline } from './SelectSparkline';
|
|
101
102
|
export { SelectBarChart } from './SelectBarChart';
|
|
@@ -104,6 +105,7 @@ export { SelectStackedArea } from './SelectStackedArea';
|
|
|
104
105
|
export { SelectComboChart } from './SelectComboChart';
|
|
105
106
|
export { SelectDonut } from './SelectDonut';
|
|
106
107
|
export { SelectColumnChart } from './SelectColumnChart';
|
|
108
|
+
export { SelectChartLegend } from './SelectChartLegend';
|
|
107
109
|
export { SelectFunnel } from './SelectFunnel';
|
|
108
110
|
export { SelectGauge } from './SelectGauge';
|
|
109
111
|
export { SelectHeatmap } from './SelectHeatmap';
|
|
@@ -204,7 +206,7 @@ export type { ComboboxOption } from './SelectCombobox';
|
|
|
204
206
|
export type { SelectTheme } from './SelectThemeSwitcher';
|
|
205
207
|
export type { SelectToastApi, SelectToastVariant } from './SelectToast';
|
|
206
208
|
export type { SelectPreviewFrameProps } from './SelectPreviewFrame';
|
|
207
|
-
export type { SelectBalanceCardProps, SelectBalanceBucket } from './SelectBalanceCard';
|
|
209
|
+
export type { SelectBalanceCardProps, SelectBalanceBucket, SelectBalanceMeta } from './SelectBalanceCard';
|
|
208
210
|
export type { SelectFeeBreakdownProps, SelectFeeLine } from './SelectFeeBreakdown';
|
|
209
211
|
export type { SelectDatePickerProps, SelectDateRange, SelectDatePreset, SelectDateLocale } from './SelectDatePicker';
|
|
210
212
|
export type { SelectDateRangeFieldProps, SelectDateRangeValue } from './SelectDateRangeField';
|
|
@@ -224,6 +226,7 @@ export type { SelectRowAction } from './SelectRowActions';
|
|
|
224
226
|
export type { SelectStatusMeta } from './SelectStatusBadge';
|
|
225
227
|
export type { SelectTimelineItem, SelectTimelineTone } from './SelectTimeline';
|
|
226
228
|
export type { SelectDataColumn } from './SelectDataTable';
|
|
229
|
+
export type { SelectInsightProps, SelectInsightData, SelectInsightBlock, SelectInsightValue, SelectInsightItem, SelectInsightAction, SelectInsightLabels, SelectInsightLocale, } from './SelectInsight';
|
|
227
230
|
export type { SelectRecordCardProps, SelectRecordCardTone, SelectLayoutThumbProps } from './SelectRecordCard';
|
|
228
231
|
export type { SelectSplitChainProps, SelectSplitNode } from './SelectSplitChain';
|
|
229
232
|
export type { SelectOfferPriceProps } from './SelectOfferPrice';
|
|
@@ -234,6 +237,8 @@ export type { SelectPaginationProps } from './SelectPagination';
|
|
|
234
237
|
export type { SelectFilterDef } from './SelectFilterBar';
|
|
235
238
|
export type { SelectTagOption } from './SelectTagSelect';
|
|
236
239
|
export type { SelectChartSeries, SelectBarDatum, SelectDonutSegment, SelectFunnelStage } from './chartUtils';
|
|
240
|
+
export type { SelectColumnChartProps, SelectColumnTooltip } from './SelectColumnChart';
|
|
241
|
+
export type { SelectChartLegendProps, SelectChartLegendItem } from './SelectChartLegend';
|
|
237
242
|
export type { SelectHeatmapRow } from './SelectHeatmap';
|
|
238
243
|
export type { SelectProgressItem } from './SelectProgressList';
|
|
239
244
|
export type { SelectRadialSeries } from './SelectRadialBar';
|