@plenustech/design-system 0.1.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/README.md +209 -0
- package/dist/design-system.css +1 -0
- package/dist/folha.d.ts +7 -0
- package/dist/plenus-design-system.cjs +2 -0
- package/dist/plenus-design-system.cjs.map +1 -0
- package/dist/plenus-design-system.es.js +5853 -0
- package/dist/plenus-design-system.es.js.map +1 -0
- package/dist/reset.css +79 -0
- package/dist/types/components/actions/Button/Button.d.ts +9 -0
- package/dist/types/components/actions/Button/index.d.ts +2 -0
- package/dist/types/components/charts/ChartArea/ChartArea.d.ts +35 -0
- package/dist/types/components/charts/ChartArea/index.d.ts +2 -0
- package/dist/types/components/charts/ChartBar/ChartBar.d.ts +31 -0
- package/dist/types/components/charts/ChartBar/index.d.ts +2 -0
- package/dist/types/components/charts/ChartCombo/ChartCombo.d.ts +44 -0
- package/dist/types/components/charts/ChartCombo/index.d.ts +2 -0
- package/dist/types/components/charts/ChartDonut/ChartDonut.d.ts +31 -0
- package/dist/types/components/charts/ChartDonut/index.d.ts +2 -0
- package/dist/types/components/charts/ChartLine/ChartLine.d.ts +34 -0
- package/dist/types/components/charts/ChartLine/index.d.ts +2 -0
- package/dist/types/components/charts/ChartPie/ChartPie.d.ts +27 -0
- package/dist/types/components/charts/ChartPie/index.d.ts +2 -0
- package/dist/types/components/charts/ChartRadial/ChartRadial.d.ts +32 -0
- package/dist/types/components/charts/ChartRadial/index.d.ts +2 -0
- package/dist/types/components/charts/ChartSankey/ChartSankey.d.ts +41 -0
- package/dist/types/components/charts/ChartSankey/index.d.ts +2 -0
- package/dist/types/components/charts/ChartScatter/ChartScatter.d.ts +37 -0
- package/dist/types/components/charts/ChartScatter/index.d.ts +2 -0
- package/dist/types/components/charts/ChartSunburst/ChartSunburst.d.ts +27 -0
- package/dist/types/components/charts/ChartSunburst/index.d.ts +2 -0
- package/dist/types/components/charts/ChartTooltip/ChartTooltip.d.ts +41 -0
- package/dist/types/components/charts/ChartTooltip/index.d.ts +2 -0
- package/dist/types/components/charts/ChartTreemap/ChartTreemap.d.ts +30 -0
- package/dist/types/components/charts/ChartTreemap/index.d.ts +2 -0
- package/dist/types/components/charts/ChartWaterfall/ChartWaterfall.d.ts +24 -0
- package/dist/types/components/charts/ChartWaterfall/index.d.ts +2 -0
- package/dist/types/components/charts/core/Axis.d.ts +18 -0
- package/dist/types/components/charts/core/BandCursor.d.ts +15 -0
- package/dist/types/components/charts/core/CartesianFrame.d.ts +41 -0
- package/dist/types/components/charts/core/ChartFrame.d.ts +31 -0
- package/dist/types/components/charts/core/ChartLegend.d.ts +24 -0
- package/dist/types/components/charts/core/Grid.d.ts +12 -0
- package/dist/types/components/charts/core/arcs.d.ts +27 -0
- package/dist/types/components/charts/core/cartesianLayout.d.ts +70 -0
- package/dist/types/components/charts/core/centerText.d.ts +14 -0
- package/dist/types/components/charts/core/index.d.ts +36 -0
- package/dist/types/components/charts/core/measureText.d.ts +25 -0
- package/dist/types/components/charts/core/shapes.d.ts +26 -0
- package/dist/types/components/charts/core/slices.d.ts +18 -0
- package/dist/types/components/charts/core/spacing.d.ts +39 -0
- package/dist/types/components/charts/core/useChartMetrics.d.ts +19 -0
- package/dist/types/components/charts/core/useHoveredBand.d.ts +9 -0
- package/dist/types/components/charts/core/useSeriesToggle.d.ts +16 -0
- package/dist/types/components/charts/core/useSliceRing.d.ts +31 -0
- package/dist/types/components/charts/core/useTweenedNumbers.d.ts +14 -0
- package/dist/types/components/charts/palette/index.d.ts +3 -0
- package/dist/types/components/charts/palette/palette.d.ts +17 -0
- package/dist/types/components/charts/palette/seriesColor.d.ts +24 -0
- package/dist/types/components/charts/scales/index.d.ts +2 -0
- package/dist/types/components/charts/scales/scales.d.ts +57 -0
- package/dist/types/components/data-display/Accordion/Accordion.d.ts +20 -0
- package/dist/types/components/data-display/Accordion/index.d.ts +2 -0
- package/dist/types/components/data-display/Avatar/Avatar.d.ts +8 -0
- package/dist/types/components/data-display/Avatar/index.d.ts +2 -0
- package/dist/types/components/data-display/Badge/Badge.d.ts +8 -0
- package/dist/types/components/data-display/Badge/index.d.ts +2 -0
- package/dist/types/components/data-display/Card/Card.d.ts +29 -0
- package/dist/types/components/data-display/Card/index.d.ts +2 -0
- package/dist/types/components/data-display/List/List.d.ts +40 -0
- package/dist/types/components/data-display/List/ListingOptions.d.ts +20 -0
- package/dist/types/components/data-display/List/index.d.ts +2 -0
- package/dist/types/components/data-display/List/useListing.d.ts +35 -0
- package/dist/types/components/data-display/List/useVirtualWindow.d.ts +25 -0
- package/dist/types/components/data-display/Table/Table.d.ts +78 -0
- package/dist/types/components/data-display/Table/index.d.ts +2 -0
- package/dist/types/components/feedback/Alert/Alert.d.ts +8 -0
- package/dist/types/components/feedback/Alert/index.d.ts +2 -0
- package/dist/types/components/feedback/Progress/Progress.d.ts +10 -0
- package/dist/types/components/feedback/Progress/index.d.ts +2 -0
- package/dist/types/components/feedback/Spinner/Spinner.d.ts +7 -0
- package/dist/types/components/feedback/Spinner/index.d.ts +2 -0
- package/dist/types/components/forms/Checkbox/Checkbox.d.ts +8 -0
- package/dist/types/components/forms/Checkbox/index.d.ts +2 -0
- package/dist/types/components/forms/ComboBox/ComboBox.d.ts +29 -0
- package/dist/types/components/forms/ComboBox/index.d.ts +2 -0
- package/dist/types/components/forms/DatePicker/Calendar.d.ts +9 -0
- package/dist/types/components/forms/DatePicker/DatePicker.d.ts +29 -0
- package/dist/types/components/forms/DatePicker/index.d.ts +2 -0
- package/dist/types/components/forms/DateTimePicker/DateTimePicker.d.ts +33 -0
- package/dist/types/components/forms/DateTimePicker/index.d.ts +2 -0
- package/dist/types/components/forms/Field/Field.d.ts +19 -0
- package/dist/types/components/forms/Field/index.d.ts +2 -0
- package/dist/types/components/forms/InputCurrency/InputCurrency.d.ts +9 -0
- package/dist/types/components/forms/InputCurrency/index.d.ts +2 -0
- package/dist/types/components/forms/InputNumber/InputNumber.d.ts +8 -0
- package/dist/types/components/forms/InputNumber/index.d.ts +2 -0
- package/dist/types/components/forms/InputPassword/InputPassword.d.ts +13 -0
- package/dist/types/components/forms/InputPassword/index.d.ts +2 -0
- package/dist/types/components/forms/InputText/InputText.d.ts +10 -0
- package/dist/types/components/forms/InputText/index.d.ts +2 -0
- package/dist/types/components/forms/Label/Label.d.ts +5 -0
- package/dist/types/components/forms/Label/index.d.ts +2 -0
- package/dist/types/components/forms/RadioGroup/Radio.d.ts +6 -0
- package/dist/types/components/forms/RadioGroup/RadioGroup.d.ts +25 -0
- package/dist/types/components/forms/RadioGroup/index.d.ts +4 -0
- package/dist/types/components/forms/Select/Select.d.ts +26 -0
- package/dist/types/components/forms/Select/index.d.ts +2 -0
- package/dist/types/components/forms/Switch/Switch.d.ts +7 -0
- package/dist/types/components/forms/Switch/index.d.ts +2 -0
- package/dist/types/components/forms/Textarea/Textarea.d.ts +10 -0
- package/dist/types/components/forms/Textarea/index.d.ts +2 -0
- package/dist/types/components/forms/TimePicker/TimePicker.d.ts +28 -0
- package/dist/types/components/forms/TimePicker/TimeSlots.d.ts +22 -0
- package/dist/types/components/forms/TimePicker/index.d.ts +2 -0
- package/dist/types/components/icons/Icon.d.ts +23 -0
- package/dist/types/components/icons/icons.d.ts +12 -0
- package/dist/types/components/icons/index.d.ts +2 -0
- package/dist/types/components/navigation/Breadcrumb/Breadcrumb.d.ts +17 -0
- package/dist/types/components/navigation/Breadcrumb/index.d.ts +2 -0
- package/dist/types/components/navigation/Pagination/Pagination.d.ts +11 -0
- package/dist/types/components/navigation/Pagination/index.d.ts +2 -0
- package/dist/types/components/navigation/Tabs/Tabs.d.ts +17 -0
- package/dist/types/components/navigation/Tabs/index.d.ts +2 -0
- package/dist/types/components/overlays/Dialog/Dialog.d.ts +13 -0
- package/dist/types/components/overlays/Dialog/index.d.ts +2 -0
- package/dist/types/components/overlays/Menu/Menu.d.ts +13 -0
- package/dist/types/components/overlays/Menu/index.d.ts +2 -0
- package/dist/types/components/overlays/Popover/Popover.d.ts +13 -0
- package/dist/types/components/overlays/Popover/index.d.ts +2 -0
- package/dist/types/components/overlays/Tooltip/Tooltip.d.ts +9 -0
- package/dist/types/components/overlays/Tooltip/index.d.ts +2 -0
- package/dist/types/hooks/useCalendar/calendar.d.ts +16 -0
- package/dist/types/hooks/useCalendar/index.d.ts +3 -0
- package/dist/types/hooks/useCalendar/useCalendar.d.ts +21 -0
- package/dist/types/hooks/useCharacterCount/index.d.ts +1 -0
- package/dist/types/hooks/useCharacterCount/useCharacterCount.d.ts +7 -0
- package/dist/types/hooks/useFormReset.d.ts +6 -0
- package/dist/types/hooks/useSelection/index.d.ts +3 -0
- package/dist/types/hooks/useSelection/selection.d.ts +25 -0
- package/dist/types/hooks/useSelection/useSelection.d.ts +26 -0
- package/dist/types/index.d.ts +97 -0
- package/dist/types/utils/formatters/formatarData.d.ts +10 -0
- package/dist/types/utils/formatters/formatarEntradaData.d.ts +5 -0
- package/dist/types/utils/formatters/formatarEntradaDecimal.d.ts +1 -0
- package/dist/types/utils/formatters/formatarEntradaMonetaria.d.ts +1 -0
- package/dist/types/utils/formatters/formatarNumero.d.ts +27 -0
- package/dist/types/utils/formatters/index.d.ts +7 -0
- package/dist/types/utils/mergeRefs.d.ts +7 -0
- package/dist/types/utils/textSearch/index.d.ts +1 -0
- package/dist/types/utils/textSearch/textSearch.d.ts +2 -0
- package/package.json +86 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type AxisTick } from './Axis.js';
|
|
3
|
+
import type { ChartLegendAlign, ChartLegendEntry, ChartLegendPosition } from './ChartLegend.js';
|
|
4
|
+
import { type GridOrientation } from './Grid.js';
|
|
5
|
+
import type { AxisLabelRotation, AxisVisibility, ChartMargins, ChartPlot } from './cartesianLayout.js';
|
|
6
|
+
export interface CartesianAxis {
|
|
7
|
+
hideLine?: boolean;
|
|
8
|
+
labelRotation?: AxisLabelRotation;
|
|
9
|
+
ticks: readonly AxisTick[];
|
|
10
|
+
visibility?: AxisVisibility;
|
|
11
|
+
}
|
|
12
|
+
export interface CartesianGrid {
|
|
13
|
+
baseline?: number;
|
|
14
|
+
lines: readonly number[];
|
|
15
|
+
orientation: GridOrientation;
|
|
16
|
+
}
|
|
17
|
+
export interface CartesianFrameProps {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
containerRef: (node: HTMLElement | null) => void;
|
|
20
|
+
empty: boolean;
|
|
21
|
+
emptyMessage: string;
|
|
22
|
+
fillHeight: boolean;
|
|
23
|
+
grid?: readonly CartesianGrid[];
|
|
24
|
+
height: number;
|
|
25
|
+
legend?: readonly ChartLegendEntry[];
|
|
26
|
+
legendAlign?: ChartLegendAlign;
|
|
27
|
+
legendPosition: ChartLegendPosition;
|
|
28
|
+
margins: ChartMargins;
|
|
29
|
+
onToggleSeries?: (label: string) => void;
|
|
30
|
+
plot: ChartPlot;
|
|
31
|
+
title: string;
|
|
32
|
+
width: number;
|
|
33
|
+
xAxis: CartesianAxis;
|
|
34
|
+
yAxis: CartesianAxis;
|
|
35
|
+
yAxisRight?: CartesianAxis;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Camada cartesiana sobre a moldura comum: grade, os dois eixos e as marcas,
|
|
39
|
+
* todos dentro das margens ja calculadas a partir dos rotulos.
|
|
40
|
+
*/
|
|
41
|
+
export declare function CartesianFrame({ children, containerRef, empty, emptyMessage, fillHeight, grid, height, legend, legendAlign, legendPosition, margins, onToggleSeries, plot, title, width, xAxis, yAxis, yAxisRight, }: CartesianFrameProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ChartLegendAlign, type ChartLegendEntry, type ChartLegendPosition, type ChartLegendSwatch } from './ChartLegend.js';
|
|
3
|
+
export interface ChartFrameProps {
|
|
4
|
+
/** Marcas do grafico, em coordenadas da area de desenho. */
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Leva a origem das marcas para o centro da area, de modo que o filho
|
|
8
|
+
* raciocine em raio e angulo em vez de converter coordenadas.
|
|
9
|
+
*/
|
|
10
|
+
centerOrigin?: boolean;
|
|
11
|
+
containerRef: (node: HTMLElement | null) => void;
|
|
12
|
+
empty: boolean;
|
|
13
|
+
emptyMessage: string;
|
|
14
|
+
fillHeight: boolean;
|
|
15
|
+
height: number;
|
|
16
|
+
legend?: readonly ChartLegendEntry[];
|
|
17
|
+
legendAlign?: ChartLegendAlign;
|
|
18
|
+
legendPosition: ChartLegendPosition;
|
|
19
|
+
/** A partir de quantas entradas a legenda aparece. */
|
|
20
|
+
minLegendEntries?: number;
|
|
21
|
+
onToggleSeries?: (label: string) => void;
|
|
22
|
+
swatch?: ChartLegendSwatch;
|
|
23
|
+
title: string;
|
|
24
|
+
width: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Moldura de qualquer grafico: titulo, area de desenho, estado vazio e legenda.
|
|
28
|
+
* O que muda entre as familias e o que se desenha dentro dela — eixos, aneis ou
|
|
29
|
+
* a area inteira —, e nao o cerco, que era o mesmo repetido tres vezes.
|
|
30
|
+
*/
|
|
31
|
+
export declare function ChartFrame({ children, centerOrigin, containerRef, empty, emptyMessage, fillHeight, height, legend, legendAlign, legendPosition, minLegendEntries, onToggleSeries, swatch, title, width, }: ChartFrameProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type ChartLegendPosition = 'top' | 'bottom' | 'left' | 'right' | 'none';
|
|
2
|
+
export interface ChartLegendEntry {
|
|
3
|
+
color: string;
|
|
4
|
+
hidden?: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Medida da entrada, alinhada a direita. Serve a legenda em lista do anel. */
|
|
7
|
+
value?: string;
|
|
8
|
+
}
|
|
9
|
+
export type ChartLegendSwatch = 'square' | 'dot';
|
|
10
|
+
/** Onde a legenda horizontal se apoia na largura do grafico. */
|
|
11
|
+
export type ChartLegendAlign = 'left' | 'center' | 'right';
|
|
12
|
+
interface ChartLegendProps {
|
|
13
|
+
align?: ChartLegendAlign;
|
|
14
|
+
entries: readonly ChartLegendEntry[];
|
|
15
|
+
onToggle?: (label: string) => void;
|
|
16
|
+
position: ChartLegendPosition;
|
|
17
|
+
swatch?: ChartLegendSwatch;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Legenda do grafico. Quando existe um alvo para o clique, cada entrada vira um
|
|
21
|
+
* botao que liga e desliga a serie, com o estado exposto por `aria-pressed`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ChartLegend({ align, entries, onToggle, position, swatch, }: ChartLegendProps): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type GridOrientation = 'horizontal' | 'vertical';
|
|
2
|
+
export interface GridProps {
|
|
3
|
+
baseline?: number;
|
|
4
|
+
length: number;
|
|
5
|
+
lines: readonly number[];
|
|
6
|
+
orientation: GridOrientation;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Linhas de referencia do grafico. A linha da base recebe destaque proprio:
|
|
10
|
+
* ela separa valores positivos de negativos e nao e apenas mais uma marca.
|
|
11
|
+
*/
|
|
12
|
+
export declare function Grid({ baseline, length, lines, orientation }: GridProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const VOLTA: number;
|
|
2
|
+
export interface ArcAngles {
|
|
3
|
+
endAngle: number;
|
|
4
|
+
startAngle: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ArcShape extends ArcAngles {
|
|
7
|
+
cornerRadius?: number;
|
|
8
|
+
innerRadius: number;
|
|
9
|
+
outerRadius: number;
|
|
10
|
+
padAngle?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface SliceAnglesOptions {
|
|
13
|
+
endAngle?: number;
|
|
14
|
+
padAngle?: number;
|
|
15
|
+
startAngle?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Angulo de cada fatia, **na ordem recebida**. A ordenacao por valor fica de
|
|
19
|
+
* fora: a fatia precisa ficar onde o consumidor a colocou, porque e essa ordem
|
|
20
|
+
* que a legenda repete.
|
|
21
|
+
*/
|
|
22
|
+
export declare function sliceAngles(values: readonly number[], { endAngle, padAngle, startAngle }?: SliceAnglesOptions): ArcAngles[];
|
|
23
|
+
export declare function arcPath({ cornerRadius, endAngle, innerRadius, outerRadius, padAngle, startAngle }: ArcShape): string;
|
|
24
|
+
/** Centro geometrico do arco, onde um rotulo sobre a fatia se apoia. */
|
|
25
|
+
export declare function arcCentroid({ endAngle, innerRadius, outerRadius, startAngle }: ArcShape): [number, number];
|
|
26
|
+
/** Ponto na borda do arco, de onde parte o conector de um rotulo externo. */
|
|
27
|
+
export declare function arcAnchor(angles: ArcAngles, radius: number): [number, number];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type LabelFont } from './measureText.js';
|
|
2
|
+
import { type NumericRange } from '../scales/index.js';
|
|
3
|
+
export type AxisLabelRotation = 0 | 45 | 90;
|
|
4
|
+
export type AxisLabelAngle = AxisLabelRotation | 'auto';
|
|
5
|
+
/**
|
|
6
|
+
* Como o eixo se mostra. `onHover` reserva a calha e desliza o eixo para dentro
|
|
7
|
+
* dela, de modo que o desenho nao se mexa sob o ponteiro; `hidden` dispensa a
|
|
8
|
+
* calha, e e o unico modo em que a area de desenho realmente cresce.
|
|
9
|
+
*/
|
|
10
|
+
export type AxisVisibility = 'visible' | 'hidden' | 'onHover';
|
|
11
|
+
/** Altura do desenho: um numero fixa, `fill` entrega a decisao ao contêiner. */
|
|
12
|
+
export type ChartHeight = number | 'fill';
|
|
13
|
+
export interface ResolvedHeight {
|
|
14
|
+
fillHeight: boolean;
|
|
15
|
+
value: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Altura efetiva do desenho. Com `fill`, ela vem da medida do contêiner, o que
|
|
19
|
+
* permite ao grafico ocupar a celula de um painel sem que ninguem repita a
|
|
20
|
+
* medida em JavaScript.
|
|
21
|
+
*/
|
|
22
|
+
export declare function chartHeight(height: ChartHeight, measured: number): ResolvedHeight;
|
|
23
|
+
export interface ChartMargins {
|
|
24
|
+
bottom: number;
|
|
25
|
+
left: number;
|
|
26
|
+
right: number;
|
|
27
|
+
top: number;
|
|
28
|
+
}
|
|
29
|
+
export interface ChartPlot {
|
|
30
|
+
height: number;
|
|
31
|
+
width: number;
|
|
32
|
+
}
|
|
33
|
+
export interface CartesianLayoutOptions {
|
|
34
|
+
bottomLabels: readonly string[];
|
|
35
|
+
font: LabelFont;
|
|
36
|
+
height: number;
|
|
37
|
+
labelAngle: AxisLabelAngle;
|
|
38
|
+
leftLabels: readonly string[];
|
|
39
|
+
rightLabels: readonly string[];
|
|
40
|
+
topRoom: number;
|
|
41
|
+
width: number;
|
|
42
|
+
xAxis: AxisVisibility;
|
|
43
|
+
yAxis: AxisVisibility;
|
|
44
|
+
yAxisRight: AxisVisibility;
|
|
45
|
+
}
|
|
46
|
+
export interface CartesianLayout {
|
|
47
|
+
margins: ChartMargins;
|
|
48
|
+
plot: ChartPlot;
|
|
49
|
+
rotation: AxisLabelRotation;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Angulo dos rotulos do eixo de baixo. Em zero grau, dois rotulos vizinhos nao
|
|
53
|
+
* podem se tocar. Girados, o que precisa caber e a distancia perpendicular
|
|
54
|
+
* entre duas linhas de base vizinhas, que vale o passo vezes o seno do angulo.
|
|
55
|
+
*/
|
|
56
|
+
export declare function bottomLabelRotation(labels: readonly string[], font: LabelFont, step: number): AxisLabelRotation;
|
|
57
|
+
/**
|
|
58
|
+
* Margens derivadas do conteudo, e nao de constantes. A ordem resolve sozinha a
|
|
59
|
+
* dependencia entre elas: as calhas laterais definem a largura util, a largura
|
|
60
|
+
* util define o passo entre categorias, o passo define o angulo dos rotulos e o
|
|
61
|
+
* angulo define a altura que eles ocupam embaixo.
|
|
62
|
+
*/
|
|
63
|
+
export declare function cartesianLayout({ bottomLabels, font, height, labelAngle, leftLabels, rightLabels, topRoom, width, xAxis, yAxis, yAxisRight, }: CartesianLayoutOptions): CartesianLayout;
|
|
64
|
+
/**
|
|
65
|
+
* Rotulos de valor usados apenas para medir a calha do eixo, antes de a area de
|
|
66
|
+
* desenho existir. Eles saem da altura total em vez da altura util, o que pode
|
|
67
|
+
* render uma marca a mais ou a menos: a largura do rotulo mais largo nao muda
|
|
68
|
+
* por isso, e e so ela que a medida precisa.
|
|
69
|
+
*/
|
|
70
|
+
export declare function valueLabelsFor(domain: NumericRange, length: number, format: (value: number) => string): string[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type LabelFont } from './measureText.js';
|
|
2
|
+
export interface CenterText {
|
|
3
|
+
family: string;
|
|
4
|
+
label: string;
|
|
5
|
+
lineHeight: number;
|
|
6
|
+
size: number;
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Valor e rotulo do centro, no maior degrau da escala em que o texto ainda cabe
|
|
11
|
+
* dentro do anel. O SVG nao quebra linha nem corta o que transborda, entao quem
|
|
12
|
+
* precisa caber e o texto: ele desce de degrau e, no ultimo, e cortado.
|
|
13
|
+
*/
|
|
14
|
+
export declare function fitCenterText(value: string, label: string, font: LabelFont, innerDiameter: number): CenterText;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export { BandCursor } from './BandCursor.js';
|
|
2
|
+
export type { BandCursorProps, BandOrientation } from './BandCursor.js';
|
|
3
|
+
export { Axis } from './Axis.js';
|
|
4
|
+
export type { AxisOrientation, AxisProps, AxisTick } from './Axis.js';
|
|
5
|
+
export { Grid } from './Grid.js';
|
|
6
|
+
export type { GridOrientation, GridProps } from './Grid.js';
|
|
7
|
+
export { bottomLabelRotation, cartesianLayout, chartHeight, valueLabelsFor, } from './cartesianLayout.js';
|
|
8
|
+
export type { AxisLabelAngle, AxisLabelRotation, AxisVisibility, CartesianLayout, CartesianLayoutOptions, ChartHeight, ChartMargins, ChartPlot, ResolvedHeight, } from './cartesianLayout.js';
|
|
9
|
+
export { arcAnchor, arcCentroid, arcPath, sliceAngles, VOLTA } from './arcs.js';
|
|
10
|
+
export type { ArcAngles, ArcShape, SliceAnglesOptions } from './arcs.js';
|
|
11
|
+
export { fitCenterText } from './centerText.js';
|
|
12
|
+
export type { CenterText } from './centerText.js';
|
|
13
|
+
export { CartesianFrame } from './CartesianFrame.js';
|
|
14
|
+
export type { CartesianAxis, CartesianFrameProps, CartesianGrid } from './CartesianFrame.js';
|
|
15
|
+
export { ChartFrame } from './ChartFrame.js';
|
|
16
|
+
export type { ChartFrameProps } from './ChartFrame.js';
|
|
17
|
+
export { ChartLegend } from './ChartLegend.js';
|
|
18
|
+
export type { ChartLegendAlign, ChartLegendEntry, ChartLegendPosition, ChartLegendSwatch, } from './ChartLegend.js';
|
|
19
|
+
export { labelFontOf, measureLabel, truncateToWidth, widestLabel } from './measureText.js';
|
|
20
|
+
export { CHART_BAR_GAP, CHART_EDGE_GAP, CHART_LABEL_BAND, CHART_LABEL_OFFSET, NO_BAR_SLOT, barSlots, ringDiameter, valueLabelRoom, } from './spacing.js';
|
|
21
|
+
export type { BarSlot } from './spacing.js';
|
|
22
|
+
export type { LabelFont } from './measureText.js';
|
|
23
|
+
export { areaPath, linePath, roundedBarPath } from './shapes.js';
|
|
24
|
+
export { groupSmallSlices } from './slices.js';
|
|
25
|
+
export type { ChartSlice, GroupSmallSlicesOptions } from './slices.js';
|
|
26
|
+
export type { ChartBand, ChartCurve, ChartPoint, CornerRadii } from './shapes.js';
|
|
27
|
+
export { useChartMetrics } from './useChartMetrics.js';
|
|
28
|
+
export type { ChartMetrics } from './useChartMetrics.js';
|
|
29
|
+
export { useHoveredBand } from './useHoveredBand.js';
|
|
30
|
+
export type { HoveredBand } from './useHoveredBand.js';
|
|
31
|
+
export { useSeriesToggle } from './useSeriesToggle.js';
|
|
32
|
+
export type { SeriesToggle, UseSeriesToggleOptions } from './useSeriesToggle.js';
|
|
33
|
+
export { useSliceRing } from './useSliceRing.js';
|
|
34
|
+
export type { SliceRing, UseSliceRingOptions } from './useSliceRing.js';
|
|
35
|
+
export { useTweenedNumbers } from './useTweenedNumbers.js';
|
|
36
|
+
export type { TweenOptions } from './useTweenedNumbers.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface LabelFont {
|
|
2
|
+
family: string;
|
|
3
|
+
/** Familia de display, usada onde o valor e um KPI. */
|
|
4
|
+
headingFamily: string;
|
|
5
|
+
lineHeight: number;
|
|
6
|
+
size: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Fonte dos rotulos, lida dos tokens no proprio elemento do grafico. Ler do
|
|
10
|
+
* elemento evita repetir em JavaScript um valor que ja pertence ao CSS.
|
|
11
|
+
*/
|
|
12
|
+
export declare function labelFontOf(node: Element | null): LabelFont;
|
|
13
|
+
/**
|
|
14
|
+
* Largura do texto na fonte informada. O canvas mede sem inserir nada na
|
|
15
|
+
* pagina; onde ele nao existe, a estimativa por caractere mantem o calculo
|
|
16
|
+
* deterministico, em vez de devolver zero e amontoar os rotulos.
|
|
17
|
+
*/
|
|
18
|
+
export declare function measureLabel(text: string, font: LabelFont): number;
|
|
19
|
+
export declare function widestLabel(labels: readonly string[], font: LabelFont): number;
|
|
20
|
+
/**
|
|
21
|
+
* Texto cortado para caber na largura, com reticencia. Onde o desenho e o
|
|
22
|
+
* proprio espaco — o centro de um anel, o retangulo de um mapa de area — nao ha
|
|
23
|
+
* caixa que corte por conta propria.
|
|
24
|
+
*/
|
|
25
|
+
export declare function truncateToWidth(text: string, font: LabelFont, maxWidth: number): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type ChartCurve = 'smooth' | 'straight';
|
|
2
|
+
export interface ChartPoint {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ChartBand {
|
|
7
|
+
x: number;
|
|
8
|
+
y0: number;
|
|
9
|
+
y1: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Caminho de uma curva, com interrupcao onde o valor nao existe. Emendar sobre
|
|
13
|
+
* o buraco desenharia um trecho que o dado nao afirma.
|
|
14
|
+
*/
|
|
15
|
+
export declare function linePath(points: readonly (ChartPoint | null)[], curve: ChartCurve): string;
|
|
16
|
+
/** Caminho da faixa entre duas linhas. A base varia quando as areas empilham. */
|
|
17
|
+
export declare function areaPath(bands: readonly (ChartBand | null)[], curve: ChartCurve): string;
|
|
18
|
+
/** Raios dos quatro cantos, no sentido horario a partir do superior esquerdo. */
|
|
19
|
+
export type CornerRadii = [number, number, number, number];
|
|
20
|
+
/**
|
|
21
|
+
* Retangulo com raio por canto, arredondado por curva quadratica com o controle
|
|
22
|
+
* no proprio canto. O atributo `rx` arredonda os quatro de uma vez, e numa barra
|
|
23
|
+
* empilhada isso separa os segmentos: a pilha precisa das duas pontas
|
|
24
|
+
* arredondadas e do meio reto, para parecer uma barra so.
|
|
25
|
+
*/
|
|
26
|
+
export declare function roundedBarPath(x: number, y: number, width: number, height: number, radii: CornerRadii): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SeriesAppearance } from '../palette/index.js';
|
|
2
|
+
export interface ChartSlice extends SeriesAppearance {
|
|
3
|
+
label: string;
|
|
4
|
+
value: number;
|
|
5
|
+
}
|
|
6
|
+
export interface GroupSmallSlicesOptions {
|
|
7
|
+
label: string;
|
|
8
|
+
threshold: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Reune as fatias pequenas numa so. Abaixo de um limiar a fatia deixa de ser
|
|
12
|
+
* legivel no anel e ainda ocupa uma linha da legenda; o agrupamento e a regra
|
|
13
|
+
* de percentual minimo da referencia.
|
|
14
|
+
*
|
|
15
|
+
* A fatia reunida entra no lugar da primeira pequena, para que a ordem das
|
|
16
|
+
* demais, que a legenda repete, permaneca a mesma.
|
|
17
|
+
*/
|
|
18
|
+
export declare function groupSmallSlices(slices: readonly ChartSlice[], { label, threshold }: GroupSmallSlicesOptions): readonly ChartSlice[];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { LabelFont } from './measureText.js';
|
|
2
|
+
/**
|
|
3
|
+
* Medidas de espaco do desenho. Elas vivem aqui, e nao em cada grafico, porque
|
|
4
|
+
* sao a mesma decisao visual repetida: quando cada arquivo guardava a sua, o
|
|
5
|
+
* mesmo conceito aparecia com valores diferentes em dois vizinhos.
|
|
6
|
+
*
|
|
7
|
+
* Geometria em SVG nao le variavel CSS, entao estes sao numeros — mas numeros
|
|
8
|
+
* de um lugar so.
|
|
9
|
+
*/
|
|
10
|
+
/** Distancia entre uma marca e o rotulo que a descreve. */
|
|
11
|
+
export declare const CHART_LABEL_OFFSET = 8;
|
|
12
|
+
/** Folga minima nas bordas, para o rotulo das pontas nao encostar no limite. */
|
|
13
|
+
export declare const CHART_EDGE_GAP = 12;
|
|
14
|
+
/** Teto da banda de rotulos projetados, como fracao da largura. */
|
|
15
|
+
export declare const CHART_LABEL_BAND = 0.24;
|
|
16
|
+
/**
|
|
17
|
+
* Espaco que um rotulo de valor ocupa acima da marca. Sai da entrelinha medida,
|
|
18
|
+
* e nao de um numero fixo: o rotulo ocupa o que o texto ocupa.
|
|
19
|
+
*/
|
|
20
|
+
export declare function valueLabelRoom(font: LabelFont): number;
|
|
21
|
+
/** Folga entre duas barras vizinhas dentro da mesma faixa. */
|
|
22
|
+
export declare const CHART_BAR_GAP = 2;
|
|
23
|
+
export interface BarSlot {
|
|
24
|
+
offset: number;
|
|
25
|
+
thickness: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Faixa de um indice que ainda nao existe. Quando entra uma serie, o tween
|
|
29
|
+
* devolve o array anterior por um render, e ali a nova nao tem presenca.
|
|
30
|
+
*/
|
|
31
|
+
export declare const NO_BAR_SLOT: BarSlot;
|
|
32
|
+
/**
|
|
33
|
+
* Espessura e deslocamento de cada barra dentro da faixa, a partir da presenca
|
|
34
|
+
* de cada serie. A barra desligada encolhe a zero e as demais ocupam o lugar
|
|
35
|
+
* dela, sem deixar a folga sobrando no fim.
|
|
36
|
+
*/
|
|
37
|
+
export declare function barSlots(band: number, presences: readonly number[]): BarSlot[];
|
|
38
|
+
/** Diametro do anel: o lado menor da area disponivel, menos a folga. */
|
|
39
|
+
export declare function ringDiameter(width: number, height: number): number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type LabelFont } from './measureText.js';
|
|
2
|
+
export interface ChartMetrics {
|
|
3
|
+
font: LabelFont;
|
|
4
|
+
height: number;
|
|
5
|
+
/** Raio dos cantos, lido do token: geometria de caminho nao le variavel CSS. */
|
|
6
|
+
radius: number;
|
|
7
|
+
ref: (node: HTMLElement | null) => void;
|
|
8
|
+
width: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Mede o espaco em que o grafico sera desenhado: largura, altura e a fonte que
|
|
12
|
+
* os rotulos vao usar. A area de desenho nao entra no fluxo, entao a medida e
|
|
13
|
+
* sempre o que o layout concedeu, e nunca o que o proprio grafico ocupou.
|
|
14
|
+
*
|
|
15
|
+
* A fonte sai da mesma medida porque as duas vem do elemento e mudam juntas:
|
|
16
|
+
* as margens do grafico dependem da largura dos rotulos, e a largura de um
|
|
17
|
+
* rotulo depende da fonte resolvida ali.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useChartMetrics(): ChartMetrics;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface HoveredBand {
|
|
2
|
+
hover: (index: number | null) => void;
|
|
3
|
+
hovered: number | null;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Faixa sob o ponteiro. O grafico a usa para o realce e o consumidor recebe o
|
|
7
|
+
* aviso pela mesma porta, em vez de cada grafico repetir estado e callback.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useHoveredBand(onHover?: (index: number | null) => void): HoveredBand;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface UseSeriesToggleOptions {
|
|
2
|
+
defaultHiddenSeries?: readonly string[];
|
|
3
|
+
hiddenSeries?: readonly string[];
|
|
4
|
+
onHiddenSeriesChange?: (hidden: readonly string[]) => void;
|
|
5
|
+
}
|
|
6
|
+
export interface SeriesToggle {
|
|
7
|
+
isHidden: (label: string) => boolean;
|
|
8
|
+
toggle: (label: string) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Quais series estao ocultas. Controlado quando o produto informa
|
|
12
|
+
* `hiddenSeries`, nao controlado em caso contrario, conforme `COMPONENTS.md`
|
|
13
|
+
* secao 6. Trabalha com rotulos porque e o rotulo que a legenda exibe e o que
|
|
14
|
+
* o produto reconhece; indices mudariam de significado ao reordenar as series.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useSeriesToggle({ defaultHiddenSeries, hiddenSeries, onHiddenSeriesChange, }: UseSeriesToggleOptions): SeriesToggle;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ArcAngles } from './arcs.js';
|
|
2
|
+
import { type ChartSlice } from './slices.js';
|
|
3
|
+
export interface UseSliceRingOptions {
|
|
4
|
+
accent?: string;
|
|
5
|
+
defaultHiddenSlices?: readonly string[];
|
|
6
|
+
hiddenSlices?: readonly string[];
|
|
7
|
+
onHiddenSlicesChange?: (hidden: readonly string[]) => void;
|
|
8
|
+
/** Fatia sob o ponteiro, ja agrupada, ou `null` ao sair dela. */
|
|
9
|
+
onHoverSlice?: (slice: ChartSlice | null) => void;
|
|
10
|
+
otherLabel: string;
|
|
11
|
+
slices: readonly ChartSlice[];
|
|
12
|
+
smallSliceThreshold: number;
|
|
13
|
+
}
|
|
14
|
+
export interface SliceRing {
|
|
15
|
+
angles: readonly ArcAngles[];
|
|
16
|
+
colors: readonly string[];
|
|
17
|
+
focus: (index: number | null) => void;
|
|
18
|
+
focused: number | null;
|
|
19
|
+
isHidden: (label: string) => boolean;
|
|
20
|
+
ratioOf: (index: number) => number;
|
|
21
|
+
slices: readonly ChartSlice[];
|
|
22
|
+
toggle: (label: string) => void;
|
|
23
|
+
total: number;
|
|
24
|
+
values: readonly number[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* O anel repartido: fatias pequenas ja reunidas, cores resolvidas, valores das
|
|
28
|
+
* fatias ligadas e os angulos em movimento. E o que `ChartPie` e `ChartDonut`
|
|
29
|
+
* compartilham — o anel, nao o componente.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useSliceRing({ accent, defaultHiddenSlices, hiddenSlices, onHiddenSlicesChange, onHoverSlice, otherLabel, slices, smallSliceThreshold, }: UseSliceRingOptions): SliceRing;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Numeros que caminham ate o alvo em vez de saltar. Animar o dominio de uma
|
|
3
|
+
* escala move o grafico inteiro — barras, curvas, grade e marcas do eixo — com
|
|
4
|
+
* uma unica animacao, em vez de uma por marca.
|
|
5
|
+
*
|
|
6
|
+
* Quando a quantidade de numeros muda nao existe par para interpolar, e o valor
|
|
7
|
+
* assume o alvo de imediato.
|
|
8
|
+
*/
|
|
9
|
+
export interface TweenOptions {
|
|
10
|
+
duration?: number;
|
|
11
|
+
/** Ponto de partida do primeiro quadro, para o grafico entrar em vez de surgir pronto. */
|
|
12
|
+
from?: readonly number[];
|
|
13
|
+
}
|
|
14
|
+
export declare function useTweenedNumbers(target: readonly number[], { duration, from }?: TweenOptions): readonly number[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Quantidade de series que a paleta do Design System cobre. */
|
|
2
|
+
export declare const SERIES_TOKENS = 6;
|
|
3
|
+
/**
|
|
4
|
+
* Cores das series na paleta do Design System, como variaveis CSS. Resolvem
|
|
5
|
+
* tema claro e escuro sozinhas, e a serie N usa sempre o mesmo token, para que
|
|
6
|
+
* um filtro que reduza as series nao repinte as restantes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function seriesColors(quantidade: number): string[];
|
|
9
|
+
/**
|
|
10
|
+
* Paleta que abre com a cor escolhida pela aplicacao e segue com as do Design
|
|
11
|
+
* System, saltando a posicao que repetiria essa cor.
|
|
12
|
+
*
|
|
13
|
+
* Gerar as demais a partir da cor escolhida foi medido e descartado: girar a
|
|
14
|
+
* matiz em passos iguais nao separa as series de forma perceptivel, e a paleta
|
|
15
|
+
* resultante reprova na verificacao de deficiencia de visao de cores.
|
|
16
|
+
*/
|
|
17
|
+
export declare function paletteWithAccent(accent: string, quantidade: number): string[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Papel da serie quando a cor carrega significado. Uma serie com intencao nao
|
|
3
|
+
* entra na rotacao categorica: pintar despesa com a cor de tema do usuario
|
|
4
|
+
* trocaria o significado da barra a cada usuario.
|
|
5
|
+
*/
|
|
6
|
+
export type SeriesIntent = 'positive' | 'negative' | 'warning' | 'neutral';
|
|
7
|
+
export interface SeriesAppearance {
|
|
8
|
+
color?: string;
|
|
9
|
+
intent?: SeriesIntent;
|
|
10
|
+
}
|
|
11
|
+
export interface ResolveSeriesColorsOptions {
|
|
12
|
+
accent?: string;
|
|
13
|
+
}
|
|
14
|
+
/** Token de cada intencao. A paleta e quem detem esse mapa. */
|
|
15
|
+
export declare const INTENT_TOKENS: Record<SeriesIntent, string>;
|
|
16
|
+
/**
|
|
17
|
+
* Cor de cada serie, em tres niveis de precedencia: a cor informada pelo
|
|
18
|
+
* implementador vence; depois a intencao semantica; por fim a paleta
|
|
19
|
+
* categorica, que abre com a cor de tema quando houver.
|
|
20
|
+
*
|
|
21
|
+
* Series com cor ou intencao nao consomem posicao da paleta, para que as
|
|
22
|
+
* categoricas sigam a ordem sem deixar buracos.
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveSeriesColors(series: readonly SeriesAppearance[], { accent }?: ResolveSeriesColorsOptions): string[];
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export type ScaleKind = 'linear' | 'log' | 'time' | 'band' | 'point';
|
|
2
|
+
export interface NumericRange {
|
|
3
|
+
max: number;
|
|
4
|
+
min: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ContinuousScaleOptions {
|
|
7
|
+
clamp?: boolean;
|
|
8
|
+
domain: NumericRange;
|
|
9
|
+
nice?: boolean;
|
|
10
|
+
range: [number, number];
|
|
11
|
+
}
|
|
12
|
+
export interface CategoricalScaleOptions {
|
|
13
|
+
domain: readonly string[];
|
|
14
|
+
padding?: number;
|
|
15
|
+
range: [number, number];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Faixa que cobre os valores, com o zero incluido por padrao. Uma barra que
|
|
19
|
+
* nao parte do zero exagera a diferenca entre os valores.
|
|
20
|
+
*/
|
|
21
|
+
export declare function domainOf(values: readonly number[], { includeZero }?: {
|
|
22
|
+
includeZero?: boolean | undefined;
|
|
23
|
+
}): NumericRange;
|
|
24
|
+
/** Une varias series na mesma faixa, para que compartilhem um unico eixo. */
|
|
25
|
+
/**
|
|
26
|
+
* Extremos que uma pilha alcanca, e nao apenas onde ela termina. Com sinais
|
|
27
|
+
* mistos o total engana: `+10` e `-5` somam `5`, mas o segmento positivo chega
|
|
28
|
+
* a `10` e ficaria desenhado fora da area. O dominio precisa do caminho do
|
|
29
|
+
* acumulado, incluindo o zero de onde ele parte.
|
|
30
|
+
*/
|
|
31
|
+
export declare function stackedExtremes(contributions: readonly number[]): number[];
|
|
32
|
+
export declare function mergeDomains(domains: readonly NumericRange[]): NumericRange;
|
|
33
|
+
export declare function linearScale({ clamp, domain, nice, range }: ContinuousScaleOptions): import("d3-scale").ScaleLinear<number, number, never>;
|
|
34
|
+
/**
|
|
35
|
+
* Escala logaritmica. Nao existe log de zero ou de negativo, entao o dominio
|
|
36
|
+
* e recortado para o primeiro valor positivo.
|
|
37
|
+
*/
|
|
38
|
+
export declare function logScale({ clamp, domain, nice, range }: ContinuousScaleOptions): import("d3-scale").ScaleLogarithmic<number, number, never>;
|
|
39
|
+
export declare function timeScale({ clamp, domain, nice, range }: ContinuousScaleOptions): import("d3-scale").ScaleTime<number, number, never>;
|
|
40
|
+
/** Faixas de largura igual, uma por categoria. Serve barras. */
|
|
41
|
+
export declare function bandScale({ domain, padding, range }: CategoricalScaleOptions): import("d3-scale").ScaleBand<string>;
|
|
42
|
+
/** Pontos sem largura, um por categoria. Serve linhas e dispersao. */
|
|
43
|
+
export declare function pointScale({ domain, padding, range }: CategoricalScaleOptions): import("d3-scale").ScalePoint<string>;
|
|
44
|
+
/**
|
|
45
|
+
* Raio pela raiz do valor, para que a area da bolha acompanhe o dado em vez do
|
|
46
|
+
* raio. Mapeando o valor direto ao raio, a area cresceria com o quadrado dele e
|
|
47
|
+
* exageraria a diferenca.
|
|
48
|
+
*/
|
|
49
|
+
export declare function radiusScale(maxValue: number, range: [number, number]): import("d3-scale").ScalePower<number, number, never>;
|
|
50
|
+
/**
|
|
51
|
+
* Marcas de um eixo continuo. Sem contagem informada, o eixo decide pelo
|
|
52
|
+
* espaco que tem, para nao amontoar rotulos em area estreita. Em escala
|
|
53
|
+
* categorica as marcas sao o proprio dominio.
|
|
54
|
+
*/
|
|
55
|
+
export declare function ticksFor(scale: {
|
|
56
|
+
ticks: (count?: number) => number[];
|
|
57
|
+
}, length: number, count?: number): number[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
+
export interface AccordionItem {
|
|
3
|
+
content: ReactNode;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
export type AccordionIconPosition = 'left' | 'right';
|
|
9
|
+
export interface AccordionProps extends ComponentPropsWithRef<'div'> {
|
|
10
|
+
defaultExpandedKeys?: readonly string[];
|
|
11
|
+
expandedKeys?: readonly string[];
|
|
12
|
+
items: readonly AccordionItem[];
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
onExpandedChange?: (keys: readonly string[]) => void;
|
|
15
|
+
/** Direita e a convencao da web; esquerda serve a rotulos curtos em coluna estreita. */
|
|
16
|
+
iconPosition?: AccordionIconPosition;
|
|
17
|
+
/** Divisor entre as secoes, com a folga que ele exige. */
|
|
18
|
+
divider?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function Accordion({ className, defaultExpandedKeys, expandedKeys, items, multiple, onExpandedChange, iconPosition, divider, ...props }: AccordionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
export type AvatarSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export interface AvatarProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
name: string;
|
|
5
|
+
size?: AvatarSize;
|
|
6
|
+
src?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function Avatar({ className, name, onError, size, src, ...props }: AvatarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export type BadgeTone = 'ok' | 'warn' | 'info' | 'danger' | 'primary' | 'neutral';
|
|
3
|
+
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
dot?: boolean;
|
|
5
|
+
outline?: boolean;
|
|
6
|
+
tone?: BadgeTone;
|
|
7
|
+
}
|
|
8
|
+
export declare function Badge({ children, className, dot, outline, tone, ...props }: BadgeProps): import("react").JSX.Element;
|