@plenustech/design-system 0.2.3 → 0.2.5
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 +8 -0
- package/dist/components/actions/ButtonTile/ButtonTile.module.css.cjs +1 -1
- package/dist/components/actions/ButtonTile/ButtonTile.module.css.js +10 -10
- package/dist/components/actions/Toolbar/Toolbar.cjs +1 -1
- package/dist/components/actions/Toolbar/Toolbar.cjs.map +1 -1
- package/dist/components/actions/Toolbar/Toolbar.js +64 -53
- package/dist/components/actions/Toolbar/Toolbar.js.map +1 -1
- 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/CodeBlock/syntax.cjs +10 -3
- package/dist/components/data-display/CodeBlock/syntax.cjs.map +1 -1
- package/dist/components/data-display/CodeBlock/syntax.js +68 -48
- package/dist/components/data-display/CodeBlock/syntax.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/data-display/Timeline/Timeline.cjs +1 -1
- package/dist/components/data-display/Timeline/Timeline.cjs.map +1 -1
- package/dist/components/data-display/Timeline/Timeline.js +6 -6
- package/dist/components/data-display/Timeline/Timeline.js.map +1 -1
- package/dist/components/data-display/Timeline/Timeline.module.css.cjs +1 -1
- package/dist/components/data-display/Timeline/Timeline.module.css.js +18 -16
- package/dist/components/data-display/Timeline/Timeline.module.css.js.map +1 -1
- package/dist/components/forms/Checkbox/Checkbox.module.css.cjs +1 -1
- package/dist/components/forms/Checkbox/Checkbox.module.css.js +5 -5
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.cjs +1 -1
- package/dist/components/forms/CheckboxGroup/CheckboxGroup.module.css.js +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/forms/Field/Field.cjs +1 -1
- package/dist/components/forms/Field/Field.cjs.map +1 -1
- package/dist/components/forms/Field/Field.js +22 -22
- package/dist/components/forms/Field/Field.js.map +1 -1
- package/dist/components/forms/Field/Field.module.css.cjs +1 -1
- package/dist/components/forms/Field/Field.module.css.js +19 -17
- package/dist/components/forms/Field/Field.module.css.js.map +1 -1
- package/dist/components/forms/InputText/InputText.cjs +1 -1
- package/dist/components/forms/InputText/InputText.cjs.map +1 -1
- package/dist/components/forms/InputText/InputText.js +24 -24
- package/dist/components/forms/InputText/InputText.js.map +1 -1
- package/dist/components/forms/InputText/InputText.module.css.cjs +1 -1
- package/dist/components/forms/InputText/InputText.module.css.js +9 -7
- package/dist/components/forms/InputText/InputText.module.css.js.map +1 -1
- package/dist/components/forms/RadioGroup/RadioGroup.module.css.cjs +1 -1
- package/dist/components/forms/RadioGroup/RadioGroup.module.css.js +4 -4
- package/dist/components/forms/Select/Select.cjs.map +1 -1
- package/dist/components/forms/Select/Select.js.map +1 -1
- package/dist/components/forms/Switch/Switch.module.css.cjs +1 -1
- package/dist/components/forms/Switch/Switch.module.css.js +6 -6
- package/dist/components/icons/suite.cjs +1 -0
- package/dist/components/icons/suite.js +10894 -0
- package/dist/components/navigation/Pagination/Pagination.cjs +1 -1
- package/dist/components/navigation/Pagination/Pagination.cjs.map +1 -1
- package/dist/components/navigation/Pagination/Pagination.js +71 -44
- package/dist/components/navigation/Pagination/Pagination.js.map +1 -1
- package/dist/components/navigation/Pagination/Pagination.module.css.cjs +1 -1
- package/dist/components/navigation/Pagination/Pagination.module.css.js +18 -14
- package/dist/components/navigation/Pagination/Pagination.module.css.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/components/overlays/Menu/Menu.cjs +1 -1
- package/dist/components/overlays/Menu/Menu.cjs.map +1 -1
- package/dist/components/overlays/Menu/Menu.js +37 -36
- package/dist/components/overlays/Menu/Menu.js.map +1 -1
- package/dist/components/overlays/Menu/keyShortcuts.cjs +2 -0
- package/dist/components/overlays/Menu/keyShortcuts.cjs.map +1 -0
- package/dist/components/overlays/Menu/keyShortcuts.js +55 -0
- package/dist/components/overlays/Menu/keyShortcuts.js.map +1 -0
- package/dist/components/overlays/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +81 -56
- package/dist/components/overlays/Tooltip/Tooltip.js.map +1 -1
- package/dist/design-system.css +1 -1
- package/dist/icons.cjs +2 -0
- package/dist/icons.cjs.map +1 -0
- package/dist/icons.js +2054 -0
- package/dist/icons.js.map +1 -0
- 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/CodeBlock/syntax.d.ts +1 -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/data-display/Timeline/Timeline.d.ts +4 -1
- package/dist/types/components/data-display/Timeline/index.d.ts +1 -1
- package/dist/types/components/forms/ComboBox/ComboBox.d.ts +7 -1
- package/dist/types/components/forms/Field/Field.d.ts +1 -1
- package/dist/types/components/forms/InputText/InputText.d.ts +1 -1
- package/dist/types/components/forms/Select/Select.d.ts +5 -1
- package/dist/types/components/icons/suite.d.ts +2051 -0
- package/dist/types/components/navigation/Pagination/Pagination.d.ts +13 -1
- package/dist/types/components/navigation/Pagination/index.d.ts +1 -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/components/overlays/Menu/Menu.d.ts +3 -1
- package/dist/types/components/overlays/Menu/keyShortcuts.d.ts +2 -0
- package/dist/types/components/overlays/Tooltip/Tooltip.d.ts +26 -5
- package/dist/types/icons.d.ts +6 -0
- package/dist/types/index.d.ts +11 -3
- 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 +10 -1
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef } from 'react';
|
|
2
|
+
/** Posições, contadas de 1, do primeiro e do último item da página, e o total de itens. */
|
|
3
|
+
export interface PaginationRange {
|
|
4
|
+
end: number;
|
|
5
|
+
start: number;
|
|
6
|
+
total: number;
|
|
7
|
+
}
|
|
2
8
|
export interface PaginationProps extends ComponentPropsWithRef<'nav'> {
|
|
3
9
|
/** Suspende a troca de pagina, como enquanto a pagina pedida carrega. Os botoes continuam focaveis. */
|
|
4
10
|
disabled?: boolean;
|
|
11
|
+
/** Troca o texto do intervalo, que por padrão é `1.201–1.250 de 4.380`. */
|
|
12
|
+
formatRange?: (range: PaginationRange) => string;
|
|
5
13
|
label?: string;
|
|
6
14
|
onPageChange: (page: number) => void;
|
|
7
15
|
page: number;
|
|
8
16
|
pageCount: number;
|
|
17
|
+
/** Itens por página. Com `totalItems`, mostra o intervalo da página atual. */
|
|
18
|
+
pageSize?: number;
|
|
9
19
|
/** Quantidade de paginas mostradas de cada lado da atual. */
|
|
10
20
|
siblings?: number;
|
|
21
|
+
/** Total de itens. Com `pageSize`, mostra o intervalo da página atual. */
|
|
22
|
+
totalItems?: number;
|
|
11
23
|
}
|
|
12
|
-
export declare function Pagination({ className, disabled, label, onPageChange, page, pageCount, siblings, ...props }: PaginationProps): import("react").JSX.Element | null;
|
|
24
|
+
export declare function Pagination({ className, disabled, formatRange, label, onPageChange, page, pageCount, pageSize, siblings, totalItems, ...props }: PaginationProps): import("react").JSX.Element | null;
|
|
13
25
|
/**
|
|
14
26
|
* Primeira e ultima pagina sempre visiveis; null representa a reticencia. A faixa tem sempre as mesmas vagas: perto
|
|
15
27
|
* da ponta a janela encosta nela em vez de encolher, e reticencia nunca esconde uma pagina so.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Pagination } from './Pagination.js';
|
|
2
|
-
export type { PaginationProps } from './Pagination.js';
|
|
2
|
+
export type { PaginationProps, PaginationRange } from './Pagination.js';
|
|
@@ -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
|
}
|
|
@@ -8,8 +8,10 @@ export interface MenuItem {
|
|
|
8
8
|
key: string;
|
|
9
9
|
label: string;
|
|
10
10
|
onSelect?: () => void;
|
|
11
|
-
/** Atalho escrito
|
|
11
|
+
/** Atalho escrito à direita, como `Ctrl+D` ou `⌘⇧D`; convertido nos nomes de tecla de `aria-keyshortcuts`. */
|
|
12
12
|
shortcut?: string;
|
|
13
|
+
/** Valor de `aria-keyshortcuts` quando a conversão do `shortcut` não basta, como `Control+Shift+D Meta+Shift+D`. */
|
|
14
|
+
shortcutKeys?: string;
|
|
13
15
|
/** `danger` para a acao que destroi, como remover. */
|
|
14
16
|
tone?: 'danger';
|
|
15
17
|
}
|
|
@@ -1,9 +1,30 @@
|
|
|
1
|
-
import { type ReactElement, type ReactNode } from 'react';
|
|
1
|
+
import { type ReactElement, type ReactNode, type RefObject } from 'react';
|
|
2
2
|
export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
3
|
-
|
|
4
|
-
children: ReactElement<Record<string, unknown>>;
|
|
3
|
+
interface TooltipCommonProps {
|
|
5
4
|
content: ReactNode;
|
|
6
|
-
|
|
5
|
+
/** Avisa cada pedido de abrir ou fechar: ponteiro, foco, blur e Escape. */
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
7
|
placement?: TooltipPlacement;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
interface TooltipOnChildProps extends TooltipCommonProps {
|
|
10
|
+
anchorRef?: never;
|
|
11
|
+
/** O gatilho: o Tooltip o clona, soma os manipuladores e liga a descrição por `aria-describedby`. */
|
|
12
|
+
children: ReactElement<Record<string, unknown>>;
|
|
13
|
+
delay?: number;
|
|
14
|
+
id?: never;
|
|
15
|
+
/** Controla a abertura; sem ele, o Tooltip guarda o próprio estado. */
|
|
16
|
+
open?: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface TooltipOnAnchorProps extends TooltipCommonProps {
|
|
19
|
+
/** Âncora que não é filho do Tooltip, como um elemento que precisa da própria referência e não pode ser clonado. */
|
|
20
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
21
|
+
children?: never;
|
|
22
|
+
delay?: never;
|
|
23
|
+
/** Id do balão. O produto o põe no `aria-describedby` da âncora enquanto `open`. */
|
|
24
|
+
id: string;
|
|
25
|
+
/** Com âncora externa, a abertura é sempre do produto. */
|
|
26
|
+
open: boolean;
|
|
27
|
+
}
|
|
28
|
+
export type TooltipProps = TooltipOnChildProps | TooltipOnAnchorProps;
|
|
29
|
+
export declare function Tooltip(props: TooltipProps): import("react").JSX.Element;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Suite completa do Bootstrap Icons, pelo nome do desenho: `@plenustech/design-system/icons`. Fica fora do ponto de
|
|
3
|
+
* entrada principal para o autocompletar e as declaracoes dele continuarem leves; o bundle leva so os importados.
|
|
4
|
+
*/
|
|
5
|
+
export * from './components/icons/suite.js';
|
|
6
|
+
export type { IconProps } from './components/icons/Icon.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -52,10 +52,12 @@ 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';
|
|
58
|
-
export type { PaginationProps } from './components/navigation/Pagination/index.js';
|
|
60
|
+
export type { PaginationProps, PaginationRange } from './components/navigation/Pagination/index.js';
|
|
59
61
|
export { SkipLink } from './components/navigation/SkipLink/index.js';
|
|
60
62
|
export type { SkipLinkProps } from './components/navigation/SkipLink/index.js';
|
|
61
63
|
export { Steps } from './components/navigation/Steps/index.js';
|
|
@@ -88,7 +90,7 @@ export { CodeBlock } from './components/data-display/CodeBlock/index.js';
|
|
|
88
90
|
export { SortableList } from './components/data-display/SortableList/index.js';
|
|
89
91
|
export type { SortableListItem, SortableListProps } from './components/data-display/SortableList/index.js';
|
|
90
92
|
export { Timeline } from './components/data-display/Timeline/index.js';
|
|
91
|
-
export type { TimelineItem, TimelineProps } from './components/data-display/Timeline/index.js';
|
|
93
|
+
export type { TimelineItem, TimelineProps, TimelineSize } from './components/data-display/Timeline/index.js';
|
|
92
94
|
export type { CodeBlockProps, CodeSyntax } from './components/data-display/CodeBlock/index.js';
|
|
93
95
|
export { Table } from './components/data-display/Table/index.js';
|
|
94
96
|
export type { SortDirection, TableAlign, TableBodyProps, TableBreakpoint, TableCellProps, TableColumnProps, TableHeaderProps, TableProps, TableRowItem, TableRowProps, TableSelectionControl, TableSelectionMode, TableSize, TableSort, } from './components/data-display/Table/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.5",
|
|
4
4
|
"description": "Design System centralizado para os produtos web da Plenustech.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
"import": "./dist/index.js",
|
|
21
21
|
"require": "./dist/index.cjs"
|
|
22
22
|
},
|
|
23
|
+
"./icons": {
|
|
24
|
+
"types": "./dist/types/icons.d.ts",
|
|
25
|
+
"import": "./dist/icons.js",
|
|
26
|
+
"require": "./dist/icons.cjs"
|
|
27
|
+
},
|
|
23
28
|
"./styles.css": {
|
|
24
29
|
"types": "./dist/folha.d.ts",
|
|
25
30
|
"default": "./dist/design-system.css"
|
|
@@ -41,6 +46,7 @@
|
|
|
41
46
|
"dev:showcase": "vite --config showcase/vite.config.ts",
|
|
42
47
|
"build": "tsc -b && vite build && tsc -p tsconfig.build.json && node scripts/finaliza-pacote.mjs",
|
|
43
48
|
"check:pacote": "node scripts/check-pacote.mjs",
|
|
49
|
+
"gerar:icones": "node scripts/gerar-icones.mjs",
|
|
44
50
|
"check:contraste": "node scripts/check-contraste.mjs",
|
|
45
51
|
"prepare": "npm run build:pacote",
|
|
46
52
|
"build:showcase": "npm run build:pacote && vite build --config showcase/vite.config.ts",
|
|
@@ -57,6 +63,7 @@
|
|
|
57
63
|
"@react-aria/overlays": "^3.32.1",
|
|
58
64
|
"@types/d3-scale": "^4.0.9",
|
|
59
65
|
"d3-array": "^3.2.4",
|
|
66
|
+
"d3-geo": "^3.1.1",
|
|
60
67
|
"d3-hierarchy": "^3.1.2",
|
|
61
68
|
"d3-sankey": "^0.12.3",
|
|
62
69
|
"d3-scale": "^4.0.2",
|
|
@@ -70,6 +77,7 @@
|
|
|
70
77
|
"@testing-library/jest-dom": "^6.6.3",
|
|
71
78
|
"@testing-library/react": "^16.3.0",
|
|
72
79
|
"@types/d3-array": "^3.2.2",
|
|
80
|
+
"@types/d3-geo": "^3.1.0",
|
|
73
81
|
"@types/d3-hierarchy": "^3.1.7",
|
|
74
82
|
"@types/d3-sankey": "^0.12.5",
|
|
75
83
|
"@types/d3-shape": "^3.2.0",
|
|
@@ -77,6 +85,7 @@
|
|
|
77
85
|
"@types/react": "^19.1.2",
|
|
78
86
|
"@types/react-dom": "^19.1.2",
|
|
79
87
|
"@vitejs/plugin-react": "^4.4.1",
|
|
88
|
+
"bootstrap-icons": "1.11.3",
|
|
80
89
|
"jsdom": "^26.1.0",
|
|
81
90
|
"react": "^19.1.0",
|
|
82
91
|
"react-dom": "^19.1.0",
|