@plenustech/design-system 0.2.3 → 0.2.4
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/ChartGauge/ChartGauge.cjs +2 -0
- package/dist/components/charts/ChartGauge/ChartGauge.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/ChartGauge.js +307 -0
- package/dist/components/charts/ChartGauge/ChartGauge.js.map +1 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.cjs +2 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.js +76 -0
- package/dist/components/charts/ChartGauge/ChartGauge.module.css.js.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.cjs +2 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.js +107 -0
- package/dist/components/charts/ChartGauge/gaugeLayout.js.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeReading.cjs +2 -0
- package/dist/components/charts/ChartGauge/gaugeReading.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeReading.js +112 -0
- package/dist/components/charts/ChartGauge/gaugeReading.js.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeScale.cjs +2 -0
- package/dist/components/charts/ChartGauge/gaugeScale.cjs.map +1 -0
- package/dist/components/charts/ChartGauge/gaugeScale.js +57 -0
- package/dist/components/charts/ChartGauge/gaugeScale.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMap.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.js +523 -0
- package/dist/components/charts/ChartMap/ChartMap.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.js +124 -0
- package/dist/components/charts/ChartMap/ChartMap.module.css.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.js +102 -0
- package/dist/components/charts/ChartMap/ChartMapLegend.js.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapTable.cjs +2 -0
- package/dist/components/charts/ChartMap/ChartMapTable.cjs.map +1 -0
- package/dist/components/charts/ChartMap/ChartMapTable.js +118 -0
- package/dist/components/charts/ChartMap/ChartMapTable.js.map +1 -0
- package/dist/components/charts/ChartMap/mapGeometry.cjs +2 -0
- package/dist/components/charts/ChartMap/mapGeometry.cjs.map +1 -0
- package/dist/components/charts/ChartMap/mapGeometry.js +113 -0
- package/dist/components/charts/ChartMap/mapGeometry.js.map +1 -0
- package/dist/components/charts/ChartMap/mapLabels.cjs +2 -0
- package/dist/components/charts/ChartMap/mapLabels.cjs.map +1 -0
- package/dist/components/charts/ChartMap/mapLabels.js +80 -0
- package/dist/components/charts/ChartMap/mapLabels.js.map +1 -0
- package/dist/components/charts/ChartMap/mapScales.cjs +2 -0
- package/dist/components/charts/ChartMap/mapScales.cjs.map +1 -0
- package/dist/components/charts/ChartMap/mapScales.js +131 -0
- package/dist/components/charts/ChartMap/mapScales.js.map +1 -0
- package/dist/components/charts/ChartMap/polylabel.cjs +2 -0
- package/dist/components/charts/ChartMap/polylabel.cjs.map +1 -0
- package/dist/components/charts/ChartMap/polylabel.js +50 -0
- package/dist/components/charts/ChartMap/polylabel.js.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.cjs +2 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.js +703 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.js.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.cjs +2 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.js +124 -0
- package/dist/components/charts/ChartTimeline/ChartTimeline.module.css.js.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.cjs +2 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.js +42 -0
- package/dist/components/charts/ChartTimeline/ChartTimelineTable.js.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.cjs +2 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.js +109 -0
- package/dist/components/charts/ChartTimeline/timelineLayout.js.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTime.cjs +2 -0
- package/dist/components/charts/ChartTimeline/timelineTime.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTime.js +91 -0
- package/dist/components/charts/ChartTimeline/timelineTime.js.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.cjs +2 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.cjs.map +1 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.js +77 -0
- package/dist/components/charts/ChartTimeline/timelineTooltip.js.map +1 -0
- package/dist/components/charts/core/ChartLegend.cjs +1 -1
- package/dist/components/charts/core/ChartLegend.cjs.map +1 -1
- package/dist/components/charts/core/ChartLegend.js +37 -25
- package/dist/components/charts/core/ChartLegend.js.map +1 -1
- package/dist/components/charts/core/useChartMetrics.cjs +1 -1
- package/dist/components/charts/core/useChartMetrics.cjs.map +1 -1
- package/dist/components/charts/core/useChartMetrics.js +20 -25
- package/dist/components/charts/core/useChartMetrics.js.map +1 -1
- package/dist/components/data-display/List/List.cjs.map +1 -1
- package/dist/components/data-display/List/List.js.map +1 -1
- package/dist/components/data-display/List/List.module.css.cjs +1 -1
- package/dist/components/data-display/List/List.module.css.js +34 -24
- package/dist/components/data-display/List/List.module.css.js.map +1 -1
- package/dist/components/data-display/List/ListingOptions.cjs +1 -1
- package/dist/components/data-display/List/ListingOptions.cjs.map +1 -1
- package/dist/components/data-display/List/ListingOptions.js +98 -74
- package/dist/components/data-display/List/ListingOptions.js.map +1 -1
- package/dist/components/data-display/List/useListing.cjs.map +1 -1
- package/dist/components/data-display/List/useListing.js.map +1 -1
- package/dist/components/forms/ComboBox/ComboBox.cjs.map +1 -1
- package/dist/components/forms/ComboBox/ComboBox.js.map +1 -1
- package/dist/components/navigation/TabsNav/TabsNav.cjs +2 -0
- package/dist/components/navigation/TabsNav/TabsNav.cjs.map +1 -0
- package/dist/components/navigation/TabsNav/TabsNav.js +21 -0
- package/dist/components/navigation/TabsNav/TabsNav.js.map +1 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.cjs +2 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.cjs.map +1 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.js +18 -0
- package/dist/components/navigation/TabsNav/TabsNav.module.css.js.map +1 -0
- package/dist/components/overlays/Dialog/Dialog.cjs.map +1 -1
- package/dist/components/overlays/Dialog/Dialog.js.map +1 -1
- package/dist/components/overlays/Dialog/DialogFrame.cjs +1 -1
- package/dist/components/overlays/Dialog/DialogFrame.cjs.map +1 -1
- package/dist/components/overlays/Dialog/DialogFrame.js +30 -30
- package/dist/components/overlays/Dialog/DialogFrame.js.map +1 -1
- package/dist/components/overlays/Drawer/Drawer.cjs.map +1 -1
- package/dist/components/overlays/Drawer/Drawer.js.map +1 -1
- package/dist/design-system.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +184 -174
- package/dist/index.js.map +1 -1
- package/dist/types/components/charts/ChartGauge/ChartGauge.d.ts +83 -0
- package/dist/types/components/charts/ChartGauge/gaugeLayout.d.ts +64 -0
- package/dist/types/components/charts/ChartGauge/gaugeReading.d.ts +97 -0
- package/dist/types/components/charts/ChartGauge/gaugeScale.d.ts +38 -0
- package/dist/types/components/charts/ChartGauge/index.d.ts +2 -0
- package/dist/types/components/charts/ChartMap/ChartMap.d.ts +104 -0
- package/dist/types/components/charts/ChartMap/ChartMapLegend.d.ts +44 -0
- package/dist/types/components/charts/ChartMap/ChartMapTable.d.ts +38 -0
- package/dist/types/components/charts/ChartMap/index.d.ts +4 -0
- package/dist/types/components/charts/ChartMap/mapGeometry.d.ts +56 -0
- package/dist/types/components/charts/ChartMap/mapLabels.d.ts +51 -0
- package/dist/types/components/charts/ChartMap/mapScales.d.ts +76 -0
- package/dist/types/components/charts/ChartMap/polylabel.d.ts +9 -0
- package/dist/types/components/charts/ChartTimeline/ChartTimeline.d.ts +137 -0
- package/dist/types/components/charts/ChartTimeline/ChartTimelineTable.d.ts +25 -0
- package/dist/types/components/charts/ChartTimeline/index.d.ts +2 -0
- package/dist/types/components/charts/ChartTimeline/timelineLayout.d.ts +70 -0
- package/dist/types/components/charts/ChartTimeline/timelineTime.d.ts +16 -0
- package/dist/types/components/charts/ChartTimeline/timelineTooltip.d.ts +45 -0
- package/dist/types/components/charts/core/ChartLegend.d.ts +3 -1
- package/dist/types/components/data-display/List/List.d.ts +1 -1
- package/dist/types/components/data-display/List/useListing.d.ts +7 -1
- package/dist/types/components/forms/ComboBox/ComboBox.d.ts +7 -1
- package/dist/types/components/navigation/TabsNav/TabsNav.d.ts +20 -0
- package/dist/types/components/navigation/TabsNav/index.d.ts +2 -0
- package/dist/types/components/overlays/Dialog/Dialog.d.ts +19 -7
- package/dist/types/components/overlays/Dialog/DialogFrame.d.ts +8 -2
- package/dist/types/components/overlays/Drawer/Drawer.d.ts +2 -2
- package/dist/types/index.d.ts +9 -1
- package/dist/types/utils/formatters/formatarDuracao.d.ts +5 -0
- package/dist/types/utils/formatters/index.d.ts +1 -0
- package/dist/utils/formatters/formatarDuracao.cjs +2 -0
- package/dist/utils/formatters/formatarDuracao.cjs.map +1 -0
- package/dist/utils/formatters/formatarDuracao.js +10 -0
- package/dist/utils/formatters/formatarDuracao.js.map +1 -0
- package/package.json +3 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ChartTimelineGroup, ChartTimelineOverlap, ChartTimelineRow, ChartTimelineScale, ChartTimelineSegment, ChartTimelineState, ChartTimelineTime } from './ChartTimeline.js';
|
|
2
|
+
export interface TimelineRange {
|
|
3
|
+
end: number;
|
|
4
|
+
start: number;
|
|
5
|
+
}
|
|
6
|
+
/** Intervalo com as pontas em posicao do eixo. `source` e o que o consumidor recebe de volta. */
|
|
7
|
+
export interface TimelineSegment extends TimelineRange {
|
|
8
|
+
id: number;
|
|
9
|
+
label?: string;
|
|
10
|
+
progress?: number;
|
|
11
|
+
row: string;
|
|
12
|
+
series: string;
|
|
13
|
+
source: ChartTimelineSegment;
|
|
14
|
+
}
|
|
15
|
+
export interface PlacedSegment extends TimelineSegment {
|
|
16
|
+
lane: number;
|
|
17
|
+
}
|
|
18
|
+
export type TimelineItem = {
|
|
19
|
+
child: boolean;
|
|
20
|
+
height: number;
|
|
21
|
+
kind: 'row';
|
|
22
|
+
laneCount: number;
|
|
23
|
+
row: ChartTimelineRow;
|
|
24
|
+
segments: readonly PlacedSegment[];
|
|
25
|
+
y: number;
|
|
26
|
+
} | {
|
|
27
|
+
collapsed: boolean;
|
|
28
|
+
group: ChartTimelineGroup;
|
|
29
|
+
height: number;
|
|
30
|
+
kind: 'group';
|
|
31
|
+
rows: readonly ChartTimelineRow[];
|
|
32
|
+
segments: readonly TimelineSegment[];
|
|
33
|
+
y: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Pontas em posicao do eixo. Em `dayHours`, o fim antes do inicio e o intervalo que cruza a meia-noite: ele termina
|
|
37
|
+
* no dia seguinte, e o desenho o corta no fim do eixo. Instante invalido, ou fim antes do inicio em datas, nao vira
|
|
38
|
+
* geometria.
|
|
39
|
+
*/
|
|
40
|
+
export declare function toRange(start: ChartTimelineTime, end: ChartTimelineTime, scale: ChartTimelineScale): {
|
|
41
|
+
end: number;
|
|
42
|
+
start: number;
|
|
43
|
+
} | undefined;
|
|
44
|
+
export declare function toTimelineSegments(segments: readonly ChartTimelineSegment[], scale: ChartTimelineScale): TimelineSegment[];
|
|
45
|
+
/** Cada estado vale ate o seguinte da linha, e o ultimo ate `end`. Com `merge`, iguais seguidos viram uma regiao. */
|
|
46
|
+
export declare function statesToSegments(states: readonly ChartTimelineState[], end: ChartTimelineTime, merge: boolean, scale: ChartTimelineScale): ChartTimelineSegment[];
|
|
47
|
+
/** Sub-faixas: cada intervalo entra na primeira cujo ultimo intervalo ja terminou. Em `overlay`, todos na mesma. */
|
|
48
|
+
export declare function placeInLanes(segments: readonly TimelineSegment[], overlap: ChartTimelineOverlap): {
|
|
49
|
+
laneCount: number;
|
|
50
|
+
segments: PlacedSegment[];
|
|
51
|
+
};
|
|
52
|
+
/** As linhas sem grupo, ou de grupo desconhecido, vem primeiro; depois as de cada grupo, na ordem dos grupos. */
|
|
53
|
+
export declare function rowsInDisplayOrder(rows: readonly ChartTimelineRow[], groups: readonly ChartTimelineGroup[]): ChartTimelineRow[];
|
|
54
|
+
export interface TimelineLayoutOptions {
|
|
55
|
+
groupHeight: number;
|
|
56
|
+
groups: readonly ChartTimelineGroup[];
|
|
57
|
+
isCollapsed: (groupKey: string) => boolean;
|
|
58
|
+
laneStep: number;
|
|
59
|
+
overlap: ChartTimelineOverlap;
|
|
60
|
+
rowGap: number;
|
|
61
|
+
rowHeight: number;
|
|
62
|
+
rows: readonly ChartTimelineRow[];
|
|
63
|
+
/** So os visiveis: a serie desligada nao ocupa sub-faixa. */
|
|
64
|
+
segments: readonly TimelineSegment[];
|
|
65
|
+
}
|
|
66
|
+
/** Ordem e altura de cada linha e cabecalho de grupo. A linha cresce uma sub-faixa por intervalo sobreposto. */
|
|
67
|
+
export declare function layoutTimeline({ groupHeight, groups, isCollapsed, laneStep, overlap, rowGap, rowHeight, rows, segments, }: TimelineLayoutOptions): {
|
|
68
|
+
height: number;
|
|
69
|
+
items: TimelineItem[];
|
|
70
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ChartTimelineScale, ChartTimelineTime } from './ChartTimeline.js';
|
|
2
|
+
export declare const HOUR_MS = 3600000;
|
|
3
|
+
export interface TimeTick {
|
|
4
|
+
label: string;
|
|
5
|
+
position: number;
|
|
6
|
+
}
|
|
7
|
+
/** Posicao no eixo: em `calendar`, milissegundos desde a epoca; em `dayHours`, a hora decimal do dia. */
|
|
8
|
+
export declare function toPosition(time: ChartTimelineTime, scale: ChartTimelineScale): number;
|
|
9
|
+
/** A posicao como `Date`, para os formatadores do consumidor. Em `dayHours` a data e indiferente: vale a hora. */
|
|
10
|
+
export declare function toDate(position: number, scale: ChartTimelineScale): Date;
|
|
11
|
+
export declare function durationMs(start: number, end: number, scale: ChartTimelineScale): number;
|
|
12
|
+
/** Faixa automatica: do primeiro ao ultimo instante, arredondada a hora ou ao dia, com uma unidade no minimo. */
|
|
13
|
+
export declare function autoDomain(positions: readonly number[], scale: ChartTimelineScale): [number, number];
|
|
14
|
+
/** Instante no balao e na tabela: `07:12` em horas do dia; `05/10 14:00`, ou so `05/10` a meia-noite, em datas. */
|
|
15
|
+
export declare function formatPosition(position: number, scale: ChartTimelineScale): string;
|
|
16
|
+
export declare function timeTicks(domain: readonly [number, number], scale: ChartTimelineScale, width: number, formatTick?: (time: Date) => string): TimeTick[];
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ChartTooltipProps } from '../ChartTooltip/index.js';
|
|
2
|
+
import type { ChartTimelineGroup, ChartTimelineMarker, ChartTimelineRow } from './ChartTimeline.js';
|
|
3
|
+
import type { TimelineRange, TimelineSegment } from './timelineLayout.js';
|
|
4
|
+
export interface TimelineMarker extends ChartTimelineMarker {
|
|
5
|
+
position: number;
|
|
6
|
+
}
|
|
7
|
+
export interface TimelineRowBand extends TimelineRange {
|
|
8
|
+
row: string;
|
|
9
|
+
series: string;
|
|
10
|
+
}
|
|
11
|
+
/** O que esta sob o ponteiro. Cada caso carrega o que o balao dele precisa. */
|
|
12
|
+
export type TimelineTarget = {
|
|
13
|
+
clip: string | undefined;
|
|
14
|
+
kind: 'segment';
|
|
15
|
+
row: ChartTimelineRow;
|
|
16
|
+
segment: TimelineSegment;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'marker';
|
|
19
|
+
marker: TimelineMarker;
|
|
20
|
+
row: ChartTimelineRow;
|
|
21
|
+
} | {
|
|
22
|
+
collapsed: boolean;
|
|
23
|
+
group: ChartTimelineGroup;
|
|
24
|
+
kind: 'group';
|
|
25
|
+
rowCount: number;
|
|
26
|
+
segments: readonly TimelineSegment[];
|
|
27
|
+
} | {
|
|
28
|
+
/** A linha nao tem intervalo algum, de nenhuma serie. */
|
|
29
|
+
empty: boolean;
|
|
30
|
+
kind: 'row';
|
|
31
|
+
row: ChartTimelineRow;
|
|
32
|
+
rowBands: readonly TimelineRowBand[];
|
|
33
|
+
segments: readonly TimelineSegment[];
|
|
34
|
+
};
|
|
35
|
+
export interface TimelineTooltipOptions {
|
|
36
|
+
colorOf: (series: string) => string | undefined;
|
|
37
|
+
duration: (range: TimelineRange) => number;
|
|
38
|
+
emptyRowLabel: string;
|
|
39
|
+
formatDuration: (durationMs: number) => string;
|
|
40
|
+
formatInstant: (position: number) => string;
|
|
41
|
+
seriesOrder: readonly string[];
|
|
42
|
+
showProgress: boolean;
|
|
43
|
+
}
|
|
44
|
+
export type TimelineTooltip = Omit<ChartTooltipProps, 'children'>;
|
|
45
|
+
export declare function timelineTooltip(target: TimelineTarget | null, options: TimelineTooltipOptions): TimelineTooltip;
|
|
@@ -12,6 +12,8 @@ export type ChartLegendAlign = 'left' | 'center' | 'right';
|
|
|
12
12
|
interface ChartLegendProps {
|
|
13
13
|
align?: ChartLegendAlign;
|
|
14
14
|
entries: readonly ChartLegendEntry[];
|
|
15
|
+
/** Entrada sob o ponteiro ou o foco, para o grafico destacar o que ela representa; `null` ao sair. */
|
|
16
|
+
onHighlight?: (label: string | null) => void;
|
|
15
17
|
onToggle?: (label: string) => void;
|
|
16
18
|
position: ChartLegendPosition;
|
|
17
19
|
swatch?: ChartLegendSwatch;
|
|
@@ -20,5 +22,5 @@ interface ChartLegendProps {
|
|
|
20
22
|
* Legenda do grafico. Quando existe um alvo para o clique, cada entrada vira um
|
|
21
23
|
* botao que liga e desliga a serie, com o estado exposto por `aria-pressed`.
|
|
22
24
|
*/
|
|
23
|
-
export declare function ChartLegend({ align, entries, onToggle, position, swatch, }: ChartLegendProps): import("react").JSX.Element;
|
|
25
|
+
export declare function ChartLegend({ align, entries, onHighlight, onToggle, position, swatch, }: ChartLegendProps): import("react").JSX.Element;
|
|
24
26
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
2
|
import { type ListingItem, type ListingSelectionMode } from './useListing.js';
|
|
3
3
|
export type ListSelectionMode = ListingSelectionMode;
|
|
4
|
-
export type ListItem = ListingItem
|
|
4
|
+
export type ListItem = Omit<ListingItem, 'description' | 'group' | 'icon'>;
|
|
5
5
|
export interface ListProps extends Omit<ComponentPropsWithRef<'div'>, 'defaultValue'> {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
defaultValue?: readonly ListItem[];
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { type KeyboardEvent } from 'react';
|
|
1
|
+
import { type KeyboardEvent, type ReactNode } from 'react';
|
|
2
2
|
import { type SelectionStatus } from '../../../hooks/useSelection/index.js';
|
|
3
3
|
export type ListingSelectionMode = 'none' | 'single' | 'multiple';
|
|
4
4
|
export interface ListingItem {
|
|
5
|
+
/** Segunda linha da opção, como a coleção de um documento. */
|
|
6
|
+
description?: string;
|
|
5
7
|
disabled?: boolean;
|
|
8
|
+
/** Título do grupo. As opções seguidas de um mesmo grupo aparecem juntas, sob ele. */
|
|
9
|
+
group?: string;
|
|
10
|
+
/** Decorativo, à frente do rótulo: quem nomeia a opção é o rótulo. */
|
|
11
|
+
icon?: ReactNode;
|
|
6
12
|
label: string;
|
|
7
13
|
value: string;
|
|
8
14
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { type ComponentPropsWithRef } from 'react';
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
2
|
export type ComboBoxSize = 'sm' | 'md';
|
|
3
3
|
export interface ComboBoxOption {
|
|
4
|
+
/** Segunda linha da opção, como a coleção de um documento. A busca local procura só no rótulo. */
|
|
5
|
+
description?: string;
|
|
4
6
|
disabled?: boolean;
|
|
7
|
+
/** Título do grupo. As opções seguidas de um mesmo grupo aparecem juntas, sob ele. */
|
|
8
|
+
group?: string;
|
|
9
|
+
/** Decorativo, à frente do rótulo. */
|
|
10
|
+
icon?: ReactNode;
|
|
5
11
|
label: string;
|
|
6
12
|
value: string;
|
|
7
13
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ElementType } from 'react';
|
|
2
|
+
export interface TabsNavItem {
|
|
3
|
+
href?: string;
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Propriedades entregues inteiras ao componente de link, para o roteador que não usa `href`. */
|
|
7
|
+
linkProps?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export interface TabsNavProps extends Omit<ComponentPropsWithRef<'nav'>, 'aria-label'> {
|
|
10
|
+
/** Componente de link da aplicação, para não acoplar o sistema a um roteador. */
|
|
11
|
+
as?: ElementType;
|
|
12
|
+
/** Chave da aba do endereço atual. */
|
|
13
|
+
current: string;
|
|
14
|
+
/** As abas dividem a largura em partes iguais, em vez de ficar do tamanho do rótulo. */
|
|
15
|
+
fitted?: boolean;
|
|
16
|
+
items: readonly TabsNavItem[];
|
|
17
|
+
label: string;
|
|
18
|
+
}
|
|
19
|
+
/** Abas que são endereços: cada uma é um link, e a da página atual leva `aria-current="page"`. */
|
|
20
|
+
export declare function TabsNav({ as: Link, className, current, fitted, items, label, ...props }: TabsNavProps): import("react").JSX.Element;
|
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
2
|
export type DialogSize = 'sm' | 'md' | 'lg';
|
|
3
3
|
export type DialogRole = 'dialog' | 'alertdialog';
|
|
4
|
-
/** As propriedades nativas vao ao elemento do dialogo
|
|
5
|
-
export interface
|
|
4
|
+
/** O que o `Dialog` e o `Drawer` compartilham. As propriedades nativas vao ao elemento do dialogo. */
|
|
5
|
+
export interface DialogBaseProps extends Omit<ComponentPropsWithRef<'div'>, 'aria-label' | 'children' | 'role' | 'title'> {
|
|
6
6
|
children?: ReactNode;
|
|
7
|
-
description?: string;
|
|
8
7
|
dismissable?: boolean;
|
|
9
8
|
footer?: ReactNode;
|
|
10
|
-
/** Opcional. Desenhado ao lado do titulo, fora da leitura: quem fala e o titulo. */
|
|
11
|
-
icon?: ReactNode;
|
|
12
9
|
onClose: () => void;
|
|
13
10
|
open: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface DialogTitledProps {
|
|
13
|
+
'aria-label'?: never;
|
|
14
|
+
description?: string;
|
|
15
|
+
/** Opcional. Desenhado ao lado do titulo, fora da leitura: quem fala e o titulo. */
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
title: string;
|
|
18
|
+
}
|
|
19
|
+
/** Sem titulo, sem cabecalho: o nome vem do `aria-label`, como na paleta de busca. Esc continua fechando. */
|
|
20
|
+
export interface DialogUntitledProps {
|
|
21
|
+
'aria-label': string;
|
|
22
|
+
description?: never;
|
|
23
|
+
icon?: never;
|
|
24
|
+
title?: never;
|
|
25
|
+
}
|
|
26
|
+
export type DialogProps = DialogBaseProps & (DialogTitledProps | DialogUntitledProps) & {
|
|
14
27
|
/** `alertdialog` para a confirmacao que interrompe e exige resposta, como a de uma acao destrutiva. */
|
|
15
28
|
role?: DialogRole;
|
|
16
29
|
size?: DialogSize;
|
|
17
|
-
|
|
18
|
-
}
|
|
30
|
+
};
|
|
19
31
|
export declare function Dialog({ size, ...props }: DialogProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { DialogBaseProps, DialogRole } from './Dialog.js';
|
|
3
|
+
export interface DialogFrameProps extends DialogBaseProps {
|
|
4
|
+
'aria-label'?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
role?: DialogRole;
|
|
3
8
|
surfaceClassName: string;
|
|
9
|
+
title?: string;
|
|
4
10
|
underlayClassName: string;
|
|
5
11
|
}
|
|
6
12
|
/** Mecanica modal do `Dialog` e do `Drawer`: portal, foco preso, rolagem travada, cabecalho, corpo e rodape. Interna. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DialogBaseProps, DialogTitledProps } from '../Dialog/Dialog.js';
|
|
2
2
|
export type DrawerSide = 'left' | 'right';
|
|
3
3
|
export type DrawerSize = 'sm' | 'md' | 'lg';
|
|
4
|
-
export interface DrawerProps extends Omit<
|
|
4
|
+
export interface DrawerProps extends DialogBaseProps, Omit<DialogTitledProps, 'icon'> {
|
|
5
5
|
side?: DrawerSide;
|
|
6
6
|
size?: DrawerSize;
|
|
7
7
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -52,6 +52,8 @@ export { Popover } from './components/overlays/Popover/index.js';
|
|
|
52
52
|
export type { PopoverProps, PopoverPlacement } from './components/overlays/Popover/index.js';
|
|
53
53
|
export { Tabs } from './components/navigation/Tabs/index.js';
|
|
54
54
|
export type { TabsProps, TabItem, TabsOrientation } from './components/navigation/Tabs/index.js';
|
|
55
|
+
export { TabsNav } from './components/navigation/TabsNav/index.js';
|
|
56
|
+
export type { TabsNavItem, TabsNavProps } from './components/navigation/TabsNav/index.js';
|
|
55
57
|
export { Breadcrumb } from './components/navigation/Breadcrumb/index.js';
|
|
56
58
|
export type { BreadcrumbProps, BreadcrumbItem } from './components/navigation/Breadcrumb/index.js';
|
|
57
59
|
export { Pagination } from './components/navigation/Pagination/index.js';
|
|
@@ -98,12 +100,18 @@ export { TimePicker } from './components/forms/TimePicker/index.js';
|
|
|
98
100
|
export type { TimePickerProps, TimePickerSize } from './components/forms/TimePicker/index.js';
|
|
99
101
|
export { DateTimePicker } from './components/forms/DateTimePicker/index.js';
|
|
100
102
|
export type { DateTimePickerProps, DateTimePickerSize } from './components/forms/DateTimePicker/index.js';
|
|
101
|
-
export { formatarData, formatarHora, formatarMoeda, formatarNumero, formatarPercentual, formatarTamanhoDeArquivo, } from './utils/formatters/index.js';
|
|
103
|
+
export { formatarData, formatarDuracao, formatarHora, formatarMoeda, formatarNumero, formatarPercentual, formatarTamanhoDeArquivo, } from './utils/formatters/index.js';
|
|
102
104
|
export type { Compacto, OpcoesDeData, OpcoesDeHora, OpcoesDeMoeda, OpcoesDeNumero, OpcoesDePercentual, OpcoesDeTamanhoDeArquivo, } from './utils/formatters/index.js';
|
|
103
105
|
export { ChartBar } from './components/charts/ChartBar/index.js';
|
|
104
106
|
export type { ChartBarOrientation, ChartBarProps, ChartBarSeries } from './components/charts/ChartBar/index.js';
|
|
105
107
|
export { ChartLine } from './components/charts/ChartLine/index.js';
|
|
106
108
|
export type { ChartLineProps, ChartLineSeries } from './components/charts/ChartLine/index.js';
|
|
109
|
+
export { ChartGauge } from './components/charts/ChartGauge/index.js';
|
|
110
|
+
export type { ChartGaugeDelta, ChartGaugeIndicator, ChartGaugeProps, ChartGaugeScaleLabels, ChartGaugeSegment, ChartGaugeSegmentStyle, ChartGaugeSegmentUnit, ChartGaugeSize, ChartGaugeTarget, ChartGaugeTicks, ChartGaugeValueDisplay, } from './components/charts/ChartGauge/index.js';
|
|
111
|
+
export { ChartMap } from './components/charts/ChartMap/index.js';
|
|
112
|
+
export type { ChartMapCategory, ChartMapColorScale, ChartMapFeature, ChartMapFeatureCollection, ChartMapLegendPosition, ChartMapMarker, ChartMapMarkerEvent, ChartMapMarkerSeries, ChartMapProps, ChartMapRegion, ChartMapRegionDatum, } from './components/charts/ChartMap/index.js';
|
|
113
|
+
export { ChartTimeline } from './components/charts/ChartTimeline/index.js';
|
|
114
|
+
export type { ChartTimelineBand, ChartTimelineDensity, ChartTimelineGroup, ChartTimelineLabelAlign, ChartTimelineMarker, ChartTimelineMarkerShape, ChartTimelineOverlap, ChartTimelineProps, ChartTimelineReferenceLine, ChartTimelineRow, ChartTimelineRowBand, ChartTimelineScale, ChartTimelineSegment, ChartTimelineSegmentLabelContent, ChartTimelineSegmentLabels, ChartTimelineSeries, ChartTimelineState, ChartTimelineSummary, ChartTimelineTime, } from './components/charts/ChartTimeline/index.js';
|
|
107
115
|
export { ChartTooltip } from './components/charts/ChartTooltip/index.js';
|
|
108
116
|
export type { ChartTooltipColumn, ChartTooltipComputed, ChartTooltipProps, ChartTooltipRow, ChartTooltipTotal, } from './components/charts/ChartTooltip/index.js';
|
|
109
117
|
export { ChartCombo } from './components/charts/ChartCombo/index.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Duracao em horas e minutos, arredondada ao minuto: `10h16m`, `1h05m`, `48m`, `12h`. Recebe milissegundos.
|
|
3
|
+
* Duracao em dias fica com quem a exibe: um prazo de projeto e lido em dias, uma jornada nao.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatarDuracao(milissegundos: number): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { formatarEdicaoDecimal, formatarEntradaDecimal } from './formatarEntradaDecimal.js';
|
|
2
2
|
export { formatarEntradaMonetaria } from './formatarEntradaMonetaria.js';
|
|
3
3
|
export { formatarData, formatarHora } from './formatarData.js';
|
|
4
|
+
export { formatarDuracao } from './formatarDuracao.js';
|
|
4
5
|
export type { OpcoesDeData, OpcoesDeHora } from './formatarData.js';
|
|
5
6
|
export { formatarMoeda, formatarNumero, formatarPercentual } from './formatarNumero.js';
|
|
6
7
|
export type { Compacto, OpcoesDeMoeda, OpcoesDeNumero, OpcoesDePercentual } from './formatarNumero.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=6e4;function e(t){if(!Number.isFinite(t)||t<0)return"";const a=Math.round(t/n),r=Math.floor(a/60),o=a%60;return r===0?`${o}m`:o===0?`${r}h`:`${r}h${String(o).padStart(2,"0")}m`}exports.formatarDuracao=e;
|
|
2
|
+
//# sourceMappingURL=formatarDuracao.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatarDuracao.cjs","sources":["../../../src/utils/formatters/formatarDuracao.ts"],"sourcesContent":["const MINUTO = 60_000;\n\n/**\n * Duracao em horas e minutos, arredondada ao minuto: `10h16m`, `1h05m`, `48m`, `12h`. Recebe milissegundos.\n * Duracao em dias fica com quem a exibe: um prazo de projeto e lido em dias, uma jornada nao.\n */\nexport function formatarDuracao(milissegundos: number) {\n if (!Number.isFinite(milissegundos) || milissegundos < 0) {\n return '';\n }\n\n const minutos = Math.round(milissegundos / MINUTO);\n const horas = Math.floor(minutos / 60);\n const resto = minutos % 60;\n\n if (horas === 0) {\n return `${resto}m`;\n }\n\n return resto === 0 ? `${horas}h` : `${horas}h${String(resto).padStart(2, '0')}m`;\n}\n"],"names":["MINUTO","formatarDuracao","milissegundos","minutos","horas","resto"],"mappings":"gFAAA,MAAMA,EAAS,IAMR,SAASC,EAAgBC,EAAuB,CACrD,GAAI,CAAC,OAAO,SAASA,CAAa,GAAKA,EAAgB,EACrD,MAAO,GAGT,MAAMC,EAAU,KAAK,MAAMD,EAAgBF,CAAM,EAC3CI,EAAQ,KAAK,MAAMD,EAAU,EAAE,EAC/BE,EAAQF,EAAU,GAExB,OAAIC,IAAU,EACL,GAAGC,CAAK,IAGVA,IAAU,EAAI,GAAGD,CAAK,IAAM,GAAGA,CAAK,IAAI,OAAOC,CAAK,EAAE,SAAS,EAAG,GAAG,CAAC,GAC/E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function a(t) {
|
|
2
|
+
if (!Number.isFinite(t) || t < 0)
|
|
3
|
+
return "";
|
|
4
|
+
const n = Math.round(t / 6e4), r = Math.floor(n / 60), o = n % 60;
|
|
5
|
+
return r === 0 ? `${o}m` : o === 0 ? `${r}h` : `${r}h${String(o).padStart(2, "0")}m`;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
a as formatarDuracao
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=formatarDuracao.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatarDuracao.js","sources":["../../../src/utils/formatters/formatarDuracao.ts"],"sourcesContent":["const MINUTO = 60_000;\n\n/**\n * Duracao em horas e minutos, arredondada ao minuto: `10h16m`, `1h05m`, `48m`, `12h`. Recebe milissegundos.\n * Duracao em dias fica com quem a exibe: um prazo de projeto e lido em dias, uma jornada nao.\n */\nexport function formatarDuracao(milissegundos: number) {\n if (!Number.isFinite(milissegundos) || milissegundos < 0) {\n return '';\n }\n\n const minutos = Math.round(milissegundos / MINUTO);\n const horas = Math.floor(minutos / 60);\n const resto = minutos % 60;\n\n if (horas === 0) {\n return `${resto}m`;\n }\n\n return resto === 0 ? `${horas}h` : `${horas}h${String(resto).padStart(2, '0')}m`;\n}\n"],"names":["formatarDuracao","milissegundos","minutos","horas","resto"],"mappings":"AAMO,SAASA,EAAgBC,GAAuB;AACrD,MAAI,CAAC,OAAO,SAASA,CAAa,KAAKA,IAAgB;AACrD,WAAO;AAGT,QAAMC,IAAU,KAAK,MAAMD,IAAgB,GAAM,GAC3CE,IAAQ,KAAK,MAAMD,IAAU,EAAE,GAC/BE,IAAQF,IAAU;AAExB,SAAIC,MAAU,IACL,GAAGC,CAAK,MAGVA,MAAU,IAAI,GAAGD,CAAK,MAAM,GAAGA,CAAK,IAAI,OAAOC,CAAK,EAAE,SAAS,GAAG,GAAG,CAAC;AAC/E;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plenustech/design-system",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Design System centralizado para os produtos web da Plenustech.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"@react-aria/overlays": "^3.32.1",
|
|
58
58
|
"@types/d3-scale": "^4.0.9",
|
|
59
59
|
"d3-array": "^3.2.4",
|
|
60
|
+
"d3-geo": "^3.1.1",
|
|
60
61
|
"d3-hierarchy": "^3.1.2",
|
|
61
62
|
"d3-sankey": "^0.12.3",
|
|
62
63
|
"d3-scale": "^4.0.2",
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
"@testing-library/jest-dom": "^6.6.3",
|
|
71
72
|
"@testing-library/react": "^16.3.0",
|
|
72
73
|
"@types/d3-array": "^3.2.2",
|
|
74
|
+
"@types/d3-geo": "^3.1.0",
|
|
73
75
|
"@types/d3-hierarchy": "^3.1.7",
|
|
74
76
|
"@types/d3-sankey": "^0.12.5",
|
|
75
77
|
"@types/d3-shape": "^3.2.0",
|