@plenustech/design-system 0.1.1 → 0.2.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.
Files changed (54) hide show
  1. package/README.md +19 -3
  2. package/dist/design-system.css +1 -1
  3. package/dist/plenus-design-system.cjs +2 -1
  4. package/dist/plenus-design-system.cjs.map +1 -1
  5. package/dist/plenus-design-system.es.js +4064 -3530
  6. package/dist/plenus-design-system.es.js.map +1 -1
  7. package/dist/reset.css +9 -8
  8. package/dist/types/components/charts/ChartArea/ChartArea.d.ts +1 -1
  9. package/dist/types/components/charts/ChartBar/ChartBar.d.ts +1 -0
  10. package/dist/types/components/charts/ChartLine/ChartLine.d.ts +1 -1
  11. package/dist/types/components/charts/ChartRadial/ChartRadial.d.ts +1 -0
  12. package/dist/types/components/charts/ChartScatter/ChartScatter.d.ts +4 -4
  13. package/dist/types/components/charts/core/centerText.d.ts +4 -3
  14. package/dist/types/components/charts/core/index.d.ts +1 -1
  15. package/dist/types/components/charts/core/measureText.d.ts +8 -0
  16. package/dist/types/components/charts/core/slices.d.ts +0 -8
  17. package/dist/types/components/charts/palette/index.d.ts +1 -1
  18. package/dist/types/components/charts/palette/seriesColor.d.ts +5 -0
  19. package/dist/types/components/charts/scales/index.d.ts +2 -2
  20. package/dist/types/components/charts/scales/scales.d.ts +8 -12
  21. package/dist/types/components/data-display/Card/Card.d.ts +1 -1
  22. package/dist/types/components/data-display/List/useListing.d.ts +1 -0
  23. package/dist/types/components/data-display/Table/Table.d.ts +6 -3
  24. package/dist/types/components/feedback/Progress/Progress.d.ts +2 -2
  25. package/dist/types/components/forms/Checkbox/Checkbox.d.ts +4 -3
  26. package/dist/types/components/forms/ComboBox/ComboBox.d.ts +17 -8
  27. package/dist/types/components/forms/ComboBox/index.d.ts +1 -1
  28. package/dist/types/components/forms/DatePicker/DatePicker.d.ts +15 -9
  29. package/dist/types/components/forms/DatePicker/iso.d.ts +7 -0
  30. package/dist/types/components/forms/DateTimePicker/DateTimePicker.d.ts +16 -12
  31. package/dist/types/components/forms/Field/FormValue.d.ts +13 -0
  32. package/dist/types/components/forms/InputNumber/InputNumber.d.ts +1 -1
  33. package/dist/types/components/forms/RadioGroup/RadioGroup.d.ts +2 -1
  34. package/dist/types/components/forms/Select/Select.d.ts +4 -4
  35. package/dist/types/components/forms/Switch/Switch.d.ts +1 -1
  36. package/dist/types/components/forms/TimePicker/TimePicker.d.ts +14 -8
  37. package/dist/types/components/forms/TimePicker/TimeSlots.d.ts +4 -9
  38. package/dist/types/components/icons/icons.d.ts +2 -0
  39. package/dist/types/components/icons/index.d.ts +1 -1
  40. package/dist/types/components/navigation/Pagination/Pagination.d.ts +7 -1
  41. package/dist/types/components/overlays/Dialog/Dialog.d.ts +6 -2
  42. package/dist/types/components/overlays/Dialog/index.d.ts +1 -1
  43. package/dist/types/components/overlays/Menu/Menu.d.ts +7 -1
  44. package/dist/types/components/overlays/Popover/Popover.d.ts +3 -4
  45. package/dist/types/hooks/useDecimalInput.d.ts +19 -0
  46. package/dist/types/hooks/useMergedRefs.d.ts +6 -0
  47. package/dist/types/hooks/useSelection/useSelection.d.ts +1 -0
  48. package/dist/types/index.d.ts +3 -3
  49. package/dist/types/utils/formatters/formatarEntradaDecimal.d.ts +5 -0
  50. package/dist/types/utils/formatters/formatarEntradaHora.d.ts +7 -0
  51. package/dist/types/utils/formatters/index.d.ts +2 -1
  52. package/dist/types/utils/formatters/mascararPartes.d.ts +5 -0
  53. package/package.json +3 -2
  54. package/dist/types/utils/mergeRefs.d.ts +0 -7
package/dist/reset.css CHANGED
@@ -14,20 +14,21 @@ html {
14
14
 
15
15
  body {
16
16
  margin: 0;
17
- background: var(--pl-bg);
18
- color: var(--pl-text);
17
+ background: var(--pl-color-background);
18
+ color: var(--pl-color-text);
19
19
  font-family: var(--pl-font-body);
20
20
  font-size: var(--pl-type-body-size);
21
- line-height: var(--pl-leading);
21
+ line-height: var(--pl-type-body-line-height);
22
22
  -webkit-font-smoothing: antialiased;
23
23
  text-rendering: optimizeLegibility;
24
24
  }
25
25
 
26
+ /* O tamanho de cada titulo e da pagina; a entrelinha acompanha o tamanho, qualquer que seja. */
26
27
  h1, h2, h3, h4, h5, h6 {
27
28
  margin: 0;
28
29
  font-family: var(--pl-font-heading);
29
- font-weight: var(--pl-weight-semibold);
30
- line-height: var(--pl-leading-tight);
30
+ font-weight: var(--pl-type-headline-medium-weight);
31
+ line-height: 1.2;
31
32
  }
32
33
 
33
34
  p, figure, blockquote { margin: 0; }
@@ -58,8 +59,8 @@ select {
58
59
  }
59
60
 
60
61
  ::selection {
61
- background: var(--pl-primary);
62
- color: var(--pl-on-primary);
62
+ background: var(--pl-color-primary);
63
+ color: var(--pl-color-on-primary);
63
64
  }
64
65
 
65
66
  /* Foco visivel para o que a pagina traz. Os componentes do sistema definem o
@@ -72,7 +73,7 @@ select {
72
73
  ::-webkit-scrollbar { width: 10px; height: 10px; }
73
74
 
74
75
  ::-webkit-scrollbar-thumb {
75
- background: var(--pl-border-strong);
76
+ background: var(--pl-color-border-strong);
76
77
  border-radius: var(--pl-radius-md);
77
78
  border: 3px solid transparent;
78
79
  background-clip: content-box;
@@ -14,7 +14,7 @@ export interface ChartAreaProps {
14
14
  /**
15
15
  * Inclui o zero no dominio do eixo de valor. Ligado por padrao, porque marca
16
16
  * que nao parte do zero exagera a diferenca; para medidas que nao se comparam
17
- * a ele — um ano, uma temperatura — desligue.
17
+ * a ele — um ano, uma temperatura — desligue; um ano pede tambem um formato sem separador de milhar em `formatValue`.
18
18
  */
19
19
  includeZero?: boolean;
20
20
  height?: ChartHeight;
@@ -21,6 +21,7 @@ export interface ChartBarProps {
21
21
  onHoverCategory?: (index: number | null) => void;
22
22
  orientation?: ChartBarOrientation;
23
23
  series: readonly ChartBarSeries[];
24
+ /** Valor alem da ponta de cada barra; empilhada, o total da categoria alem da ponta da pilha. */
24
25
  showDataLabels?: boolean;
25
26
  stacked?: boolean;
26
27
  title: string;
@@ -14,7 +14,7 @@ export interface ChartLineProps {
14
14
  /**
15
15
  * Inclui o zero no dominio do eixo de valor. Ligado por padrao, porque marca
16
16
  * que nao parte do zero exagera a diferenca; para medidas que nao se comparam
17
- * a ele — um ano, uma temperatura — desligue.
17
+ * a ele — um ano, uma temperatura — desligue; um ano pede tambem um formato sem separador de milhar em `formatValue`.
18
18
  */
19
19
  includeZero?: boolean;
20
20
  height?: ChartHeight;
@@ -20,6 +20,7 @@ export interface ChartRadialProps {
20
20
  legend?: ChartLegendPosition;
21
21
  legendAlign?: ChartLegendAlign;
22
22
  onHiddenTracksChange?: (hidden: readonly string[]) => void;
23
+ /** Valor no centro. Ele reserva o proprio espaco, ate metade do raio: com muitos aneis, quem cede e a espessura deles. */
23
24
  showCenter?: boolean;
24
25
  startAngle?: number;
25
26
  /** Raio das pontas do arco. Sem valor, o token de raio pequeno. */
@@ -18,11 +18,11 @@ export interface ChartScatterProps {
18
18
  formatY?: (value: number) => string;
19
19
  formatZ?: (value: number) => string;
20
20
  /**
21
- * Inclui o zero no dominio dos eixos. Ligado por padrao, porque barra que nao
22
- * parte do zero exagera a diferenca; para medidas que nao se comparam a ele —
23
- * um ano, uma temperatura — desligue.
21
+ * Inclui o zero no dominio: `true` nos dois eixos, `'x'` ou `'y'` so naquele, `false` em nenhum.
22
+ * Medida que nao se compara ao zero — um ano, uma temperatura — fica com o eixo dela de fora;
23
+ * um ano pede tambem um formato sem separador de milhar em `formatX` ou `formatY`.
24
24
  */
25
- includeZero?: boolean;
25
+ includeZero?: boolean | 'x' | 'y';
26
26
  height?: ChartHeight;
27
27
  hiddenSeries?: readonly string[];
28
28
  legend?: ChartLegendPosition;
@@ -6,9 +6,10 @@ export interface CenterText {
6
6
  size: number;
7
7
  value: string;
8
8
  }
9
+ /** Raio do vazio central em que o valor cabe inteiro no menor degrau da escala. */
10
+ export declare function centerTextRadius(value: string, font: LabelFont): number;
9
11
  /**
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.
12
+ * Valor e rotulo do centro, no maior degrau da escala oficial em que o texto ainda cabe dentro do anel: o valor e um
13
+ * KPI, e anel pequeno desce na escala em vez de sair dela. O SVG nao corta o que transborda; no ultimo degrau, corta-se.
13
14
  */
14
15
  export declare function fitCenterText(value: string, label: string, font: LabelFont, innerDiameter: number): CenterText;
@@ -8,7 +8,7 @@ export { bottomLabelRotation, cartesianLayout, chartHeight, valueLabelsFor, } fr
8
8
  export type { AxisLabelAngle, AxisLabelRotation, AxisVisibility, CartesianLayout, CartesianLayoutOptions, ChartHeight, ChartMargins, ChartPlot, ResolvedHeight, } from './cartesianLayout.js';
9
9
  export { arcAnchor, arcCentroid, arcPath, sliceAngles, VOLTA } from './arcs.js';
10
10
  export type { ArcAngles, ArcShape, SliceAnglesOptions } from './arcs.js';
11
- export { fitCenterText } from './centerText.js';
11
+ export { centerTextRadius, fitCenterText } from './centerText.js';
12
12
  export type { CenterText } from './centerText.js';
13
13
  export { CartesianFrame } from './CartesianFrame.js';
14
14
  export type { CartesianAxis, CartesianFrameProps, CartesianGrid } from './CartesianFrame.js';
@@ -1,4 +1,12 @@
1
+ /** Um degrau da escala tipografica para o valor do centro de um anel. */
2
+ export interface CenterStep {
3
+ display: boolean;
4
+ lineHeight: number;
5
+ size: number;
6
+ }
1
7
  export interface LabelFont {
8
+ /** Degraus do valor do centro, do maior ao menor: display, headline e title. */
9
+ centerSteps: readonly CenterStep[];
2
10
  family: string;
3
11
  /** Familia de display, usada onde o valor e um KPI. */
4
12
  headingFamily: string;
@@ -7,12 +7,4 @@ export interface GroupSmallSlicesOptions {
7
7
  label: string;
8
8
  threshold: number;
9
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
10
  export declare function groupSmallSlices(slices: readonly ChartSlice[], { label, threshold }: GroupSmallSlicesOptions): readonly ChartSlice[];
@@ -1,3 +1,3 @@
1
1
  export { SERIES_TOKENS, paletteWithAccent, seriesColors } from './palette.js';
2
- export { INTENT_TOKENS, resolveSeriesColors } from './seriesColor.js';
2
+ export { INTENT_TOKENS, resolveSeriesColors, textColorOn } from './seriesColor.js';
3
3
  export type { ResolveSeriesColorsOptions, SeriesAppearance, SeriesIntent } from './seriesColor.js';
@@ -13,6 +13,11 @@ export interface ResolveSeriesColorsOptions {
13
13
  }
14
14
  /** Token de cada intencao. A paleta e quem detem esse mapa. */
15
15
  export declare const INTENT_TOKENS: Record<SeriesIntent, string>;
16
+ /**
17
+ * Cor do texto escrito sobre a marca, como a porcentagem dentro da fatia. A cor
18
+ * informada em hexadecimal e medida; em outro formato, o texto fica branco.
19
+ */
20
+ export declare function textColorOn(color: string): string;
16
21
  /**
17
22
  * Cor de cada serie, em tres niveis de precedencia: a cor informada pelo
18
23
  * implementador vence; depois a intencao semantica; por fim a paleta
@@ -1,2 +1,2 @@
1
- export { bandScale, domainOf, linearScale, logScale, mergeDomains, pointScale, radiusScale, stackedExtremes, ticksFor, timeScale, } from './scales.js';
2
- export type { CategoricalScaleOptions, ContinuousScaleOptions, NumericRange, ScaleKind } from './scales.js';
1
+ export { alignZeros, bandScale, domainOf, linearScale, mergeDomains, pointScale, radiusScale, stackDiverging, ticksFor, } from './scales.js';
2
+ export type { CategoricalScaleOptions, ContinuousScaleOptions, NumericRange } from './scales.js';
@@ -1,4 +1,3 @@
1
- export type ScaleKind = 'linear' | 'log' | 'time' | 'band' | 'point';
2
1
  export interface NumericRange {
3
2
  max: number;
4
3
  min: number;
@@ -21,22 +20,19 @@ export interface CategoricalScaleOptions {
21
20
  export declare function domainOf(values: readonly number[], { includeZero }?: {
22
21
  includeZero?: boolean | undefined;
23
22
  }): NumericRange;
24
- /** Une varias series na mesma faixa, para que compartilhem um unico eixo. */
25
23
  /**
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.
24
+ * Pilha divergente: positivos sobem do zero e negativos descem dele, cada sinal com o proprio acumulado.
25
+ * Na soma corrida, `+10` e `-5` desenhavam o negativo por cima do positivo.
30
26
  */
31
- export declare function stackedExtremes(contributions: readonly number[]): number[];
27
+ export declare function stackDiverging(contributions: readonly number[]): [number, number][];
28
+ /** Une varias series na mesma faixa, para que compartilhem um unico eixo. */
32
29
  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
30
  /**
35
- * Escala logaritmica. Nao existe log de zero ou de negativo, entao o dominio
36
- * e recortado para o primeiro valor positivo.
31
+ * Estende dois dominios que contem o zero para que ele caia na mesma altura nos
32
+ * dois eixos. Cada um cresce so do lado que precisa, e a folga sai igual nos dois.
37
33
  */
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>;
34
+ export declare function alignZeros(a: NumericRange, b: NumericRange): [NumericRange, NumericRange];
35
+ export declare function linearScale({ clamp, domain, nice, range }: ContinuousScaleOptions): import("d3-scale").ScaleLinear<number, number, never>;
40
36
  /** Faixas de largura igual, uma por categoria. Serve barras. */
41
37
  export declare function bandScale({ domain, padding, range }: CategoricalScaleOptions): import("d3-scale").ScaleBand<string>;
42
38
  /** Pontos sem largura, um por categoria. Serve linhas e dispersao. */
@@ -3,7 +3,7 @@ export type CardHeadingLevel = 2 | 3 | 4 | 5 | 6;
3
3
  export interface CardProps extends ComponentPropsWithRef<'section'> {
4
4
  children: ReactNode;
5
5
  }
6
- export declare function Card({ children, className, ...props }: CardProps): import("react").JSX.Element;
6
+ export declare function Card({ 'aria-labelledby': ariaLabelledBy, children, className, ...props }: CardProps): import("react").JSX.Element;
7
7
  export declare namespace Card {
8
8
  var Header: typeof CardHeader;
9
9
  var Body: typeof CardBody;
@@ -23,6 +23,7 @@ export interface Listing {
23
23
  handleKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
24
24
  isSelected: (value: string) => boolean;
25
25
  filter: (term: string) => void;
26
+ reset: () => void;
26
27
  typeahead: (character: string) => void;
27
28
  select: (item: ListingItem, extend?: boolean) => void;
28
29
  selected: readonly ListingItem[];
@@ -15,6 +15,8 @@ export interface TableSort {
15
15
  }
16
16
  export interface TableProps extends ComponentPropsWithRef<'div'> {
17
17
  children: ReactNode;
18
+ /** Escolha inicial no modo nao controlado. */
19
+ defaultSelectedIds?: readonly string[];
18
20
  defaultSort?: TableSort;
19
21
  divider?: boolean;
20
22
  label?: string;
@@ -29,10 +31,11 @@ export interface TableProps extends ComponentPropsWithRef<'div'> {
29
31
  selectionMode?: TableSelectionMode;
30
32
  size?: TableSize;
31
33
  sort?: TableSort;
34
+ /** Cabecalho colado no topo da rolagem da pagina; com a tabela mais larga ou mais alta que o espaco, no dela. */
32
35
  stickyHeader?: boolean;
33
36
  striped?: boolean;
34
37
  }
35
- export declare function Table({ children, className, defaultSort, divider, highlightSelectedRow, label, loading, loadingMessage, onSelectionChange, onSortChange, rows, selectedIds, selectionControl, selectionMode, size, sort, stickyHeader, striped, ...props }: TableProps): import("react").JSX.Element;
38
+ export declare function Table({ children, className, defaultSelectedIds, defaultSort, divider, highlightSelectedRow, label, loading, loadingMessage, onSelectionChange, onSortChange, rows, selectedIds, selectionControl, selectionMode, size, sort, stickyHeader, striped, ref, ...props }: TableProps): import("react").JSX.Element;
36
39
  export declare namespace Table {
37
40
  var Header: typeof TableHeader;
38
41
  var Column: typeof TableColumn;
@@ -55,12 +58,12 @@ export interface TableColumnProps {
55
58
  width?: string;
56
59
  }
57
60
  declare function TableColumn({ align, children, help, hideBelow, id, numeric, sortable, width }: TableColumnProps): import("react").JSX.Element;
58
- export interface TableBodyProps<T> {
61
+ export interface TableBodyProps<T extends TableRowItem> {
59
62
  children: (item: T) => ReactNode;
60
63
  empty?: ReactNode;
61
64
  items: readonly T[];
62
65
  }
63
- declare function TableBody<T>({ children, empty, items }: TableBodyProps<T>): import("react").JSX.Element;
66
+ declare function TableBody<T extends TableRowItem>({ children, empty, items }: TableBodyProps<T>): import("react").JSX.Element;
64
67
  export interface TableRowProps {
65
68
  children: ReactNode;
66
69
  disabled?: boolean;
@@ -1,6 +1,6 @@
1
- import type { HTMLAttributes } from 'react';
1
+ import type { ComponentPropsWithRef } from 'react';
2
2
  export type ProgressSize = 'sm' | 'md';
3
- export interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
3
+ export interface ProgressProps extends Omit<ComponentPropsWithRef<'div'>, 'children'> {
4
4
  label: string;
5
5
  max?: number;
6
6
  showValue?: boolean;
@@ -1,8 +1,9 @@
1
- import { type ComponentPropsWithRef } from 'react';
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
2
  export interface CheckboxProps extends Omit<ComponentPropsWithRef<'input'>, 'type' | 'size'> {
3
3
  error?: string;
4
4
  hint?: string;
5
5
  indeterminate?: boolean;
6
- label: string;
6
+ /** Sem rotulo visivel, o nome vem de `aria-label` ou `aria-labelledby`. */
7
+ label?: ReactNode;
7
8
  }
8
- export declare function Checkbox({ 'aria-describedby': ariaDescribedBy, className, error, hint, id: providedId, indeterminate, label, ref, ...props }: CheckboxProps): import("react").JSX.Element;
9
+ export declare function Checkbox({ 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, className, error, hint, id: providedId, indeterminate, label, ref, ...props }: CheckboxProps): import("react").JSX.Element;
@@ -1,16 +1,15 @@
1
+ import { type ComponentPropsWithRef } from 'react';
1
2
  export type ComboBoxSize = 'sm' | 'md';
2
3
  export interface ComboBoxOption {
3
4
  disabled?: boolean;
4
5
  label: string;
5
6
  value: string;
6
7
  }
7
- export interface ComboBoxProps {
8
- defaultValue?: string;
9
- disabled?: boolean;
8
+ /** As propriedades nativas vao ao campo de texto, que e o controle; o `className` soma ao do sistema. */
9
+ interface ComboBoxBaseProps extends Omit<ComponentPropsWithRef<'input'>, 'defaultValue' | 'name' | 'onChange' | 'size' | 'type' | 'value'> {
10
10
  emptyMessage?: string;
11
11
  error?: string;
12
12
  hint?: string;
13
- id?: string;
14
13
  label?: string;
15
14
  /**
16
15
  * Nome do campo no formulario. Com ele, um input oculto carrega o valor para
@@ -19,11 +18,21 @@ export interface ComboBoxProps {
19
18
  name?: string;
20
19
  loading?: boolean;
21
20
  onSearch?: (term: string) => void;
22
- onValueChange?: (value: string) => void;
23
21
  options: readonly ComboBoxOption[];
24
- placeholder?: string;
25
- required?: boolean;
26
22
  size?: ComboBoxSize;
23
+ }
24
+ export interface ComboBoxSingleProps extends ComboBoxBaseProps {
25
+ defaultValue?: string;
26
+ onValueChange?: (value: string) => void;
27
+ selectionMode?: 'single';
27
28
  value?: string;
28
29
  }
29
- export declare function ComboBox({ defaultValue, name, disabled, emptyMessage, error, hint, id: providedId, label, loading, onSearch, onValueChange, options, placeholder, required, size, value, }: ComboBoxProps): import("react").JSX.Element;
30
+ export interface ComboBoxMultipleProps extends ComboBoxBaseProps {
31
+ defaultValue?: readonly string[];
32
+ onValueChange?: (values: readonly string[]) => void;
33
+ selectionMode: 'multiple';
34
+ value?: readonly string[];
35
+ }
36
+ export type ComboBoxProps = ComboBoxSingleProps | ComboBoxMultipleProps;
37
+ export declare function ComboBox(allProps: ComboBoxProps): import("react").JSX.Element;
38
+ export {};
@@ -1,2 +1,2 @@
1
1
  export { ComboBox } from './ComboBox.js';
2
- export type { ComboBoxProps, ComboBoxOption, ComboBoxSize } from './ComboBox.js';
2
+ export type { ComboBoxMultipleProps, ComboBoxOption, ComboBoxProps, ComboBoxSingleProps, ComboBoxSize, } from './ComboBox.js';
@@ -1,12 +1,17 @@
1
- import { type CalendarDate } from '@internationalized/date';
1
+ import { type ComponentPropsWithRef } from 'react';
2
2
  export type DatePickerSize = 'sm' | 'md';
3
- export interface DatePickerProps {
4
- defaultValue?: CalendarDate;
3
+ /**
4
+ * As propriedades nativas vao ao campo de texto, que e o controle; o `className` soma a caixa do campo, que e o que
5
+ * se posiciona e dimensiona.
6
+ */
7
+ export interface DatePickerProps extends Omit<ComponentPropsWithRef<'input'>, 'defaultValue' | 'max' | 'min' | 'name' | 'onChange' | 'size' | 'type' | 'value'> {
8
+ /** Data em ISO, `2026-03-09`, como no `FormData`: a API nao expoe tipo de biblioteca de terceiros. */
9
+ defaultValue?: string;
5
10
  disabled?: boolean;
6
11
  error?: string;
7
12
  hint?: string;
8
13
  id?: string;
9
- isDateUnavailable?: (date: CalendarDate) => boolean;
14
+ isDateUnavailable?: (date: string) => boolean;
10
15
  label?: string;
11
16
  /**
12
17
  * Nome do campo no formulario. Com ele, um input oculto carrega o valor para
@@ -14,9 +19,10 @@ export interface DatePickerProps {
14
19
  */
15
20
  name?: string;
16
21
  locale?: string;
17
- max?: CalendarDate;
18
- min?: CalendarDate;
19
- onValueChange?: (value?: CalendarDate) => void;
22
+ max?: string;
23
+ min?: string;
24
+ /** Sem data inteira e permitida, o valor e `null`, que mantem o campo controlado e vazio. */
25
+ onValueChange?: (value: string | null) => void;
20
26
  placeholder?: string;
21
27
  required?: boolean;
22
28
  size?: DatePickerSize;
@@ -24,6 +30,6 @@ export interface DatePickerProps {
24
30
  * `null` e "controlado e vazio": devolver a propriedade a `undefined` nao
25
31
  * limpa o campo, porque ali ele volta a ser nao controlado.
26
32
  */
27
- value?: CalendarDate | null;
33
+ value?: string | null;
28
34
  }
29
- export declare function DatePicker({ defaultValue, name, disabled, error, hint, id: providedId, isDateUnavailable, label, locale, max, min, onValueChange, placeholder, required, size, value, }: DatePickerProps): import("react").JSX.Element;
35
+ export declare function DatePicker({ 'aria-describedby': ariaDescribedBy, className, defaultValue, name, disabled, error, hint, id: providedId, isDateUnavailable, label, locale, max, min, onValueChange, onBlur, onKeyDown, placeholder, required, size, ref, value, ...props }: DatePickerProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { type CalendarDateTime, type Time } from '@internationalized/date';
2
+ export declare const readIsoDate: (texto?: string | null) => import("@internationalized/date").CalendarDate | undefined;
3
+ export declare const readIsoTime: (texto?: string | null) => Time | undefined;
4
+ export declare const readIsoDateTime: (texto?: string | null) => CalendarDateTime | undefined;
5
+ /** Hora e data com hora saem sem segundos, que os seletores nao escolhem: `09:30` e `2026-03-09T09:30`. */
6
+ export declare const toIsoTime: (hora: Time) => string;
7
+ export declare const toIsoDateTime: (instante: CalendarDateTime) => string;
@@ -1,12 +1,17 @@
1
- import { CalendarDate, CalendarDateTime } from '@internationalized/date';
1
+ import { type ComponentPropsWithRef } from 'react';
2
2
  export type DateTimePickerSize = 'sm' | 'md';
3
- export interface DateTimePickerProps {
4
- defaultValue?: CalendarDateTime;
3
+ /**
4
+ * As propriedades nativas vao ao campo de texto, que e o controle; o `className` soma a caixa do campo, que e o que
5
+ * se posiciona e dimensiona.
6
+ */
7
+ export interface DateTimePickerProps extends Omit<ComponentPropsWithRef<'input'>, 'defaultValue' | 'max' | 'min' | 'name' | 'onChange' | 'size' | 'type' | 'value' | 'step'> {
8
+ /** Data e hora em ISO, `2026-03-09T18:40`, como no `FormData`: a API nao expoe tipo de biblioteca de terceiros. */
9
+ defaultValue?: string;
5
10
  disabled?: boolean;
6
11
  error?: string;
7
12
  hint?: string;
8
13
  id?: string;
9
- isDateUnavailable?: (date: CalendarDate) => boolean;
14
+ isDateUnavailable?: (date: string) => boolean;
10
15
  label?: string;
11
16
  /**
12
17
  * Nome do campo no formulario. Com ele, um input oculto carrega o valor para
@@ -14,10 +19,12 @@ export interface DateTimePickerProps {
14
19
  */
15
20
  name?: string;
16
21
  locale?: string;
17
- max?: CalendarDate;
18
- min?: CalendarDate;
22
+ /** Limites de data, em `2026-03-09`. */
23
+ max?: string;
24
+ min?: string;
19
25
  step?: number;
20
- onValueChange?: (value?: CalendarDateTime) => void;
26
+ /** Sem data e hora inteiras e permitidas, o valor e `null`, que mantem o campo controlado e vazio. */
27
+ onValueChange?: (value: string | null) => void;
21
28
  placeholder?: string;
22
29
  required?: boolean;
23
30
  size?: DateTimePickerSize;
@@ -25,9 +32,6 @@ export interface DateTimePickerProps {
25
32
  * `null` e "controlado e vazio": devolver a propriedade a `undefined` nao
26
33
  * limpa o campo, porque ali ele volta a ser nao controlado.
27
34
  */
28
- value?: CalendarDateTime | null;
35
+ value?: string | null;
29
36
  }
30
- /** Aplica a mascara dia/mes/ano hora:minuto conforme o usuario digita. */
31
- export declare function formatarEntradaDataHora(valor: string): string;
32
- export declare function lerEntradaDataHora(valor: string): CalendarDateTime | undefined;
33
- export declare function DateTimePicker({ defaultValue, name, disabled, error, hint, id: providedId, isDateUnavailable, label, locale, max, min, step, onValueChange, placeholder, required, size, value, }: DateTimePickerProps): import("react").JSX.Element;
37
+ export declare function DateTimePicker({ 'aria-describedby': ariaDescribedBy, className, defaultValue, name, disabled, error, hint, id: providedId, isDateUnavailable, label, locale, max, min, step, onValueChange, onBlur, onKeyDown, placeholder, required, size, ref, value, ...props }: DateTimePickerProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ export interface FormValueProps {
2
+ disabled: boolean;
3
+ name?: string;
4
+ /** O navegador foca o campo invalido no envio; o foco segue para o controle que a pessoa enxerga. */
5
+ onFocus: () => void;
6
+ required: boolean;
7
+ value: string;
8
+ }
9
+ /**
10
+ * Leva ao formulario o valor de um campo sem controle nativo por baixo. Oculto quando basta enviar; obrigatorio, vai
11
+ * num campo que o navegador valida, porque o oculto fica fora da validacao e o envio vazio passava.
12
+ */
13
+ export declare function FormValue({ disabled, name, onFocus, required, value }: FormValueProps): import("react").JSX.Element | null;
@@ -5,4 +5,4 @@ export interface InputNumberProps extends Omit<InputTextProps, 'defaultValue' |
5
5
  onValueChange?: (value: string) => void;
6
6
  value?: string | number;
7
7
  }
8
- export declare function InputNumber({ decimalScale, defaultValue, onKeyDown, onValueChange, value, ...props }: InputNumberProps): import("react").JSX.Element;
8
+ export declare function InputNumber({ decimalScale, defaultValue, onBlur, onKeyDown, onValueChange, value, ...props }: InputNumberProps): import("react").JSX.Element;
@@ -5,6 +5,7 @@ interface RadioGroupContexto {
5
5
  invalid: boolean;
6
6
  name: string;
7
7
  onValueChange?: (value: string) => void;
8
+ required: boolean;
8
9
  value?: string;
9
10
  }
10
11
  declare const RadioGroupContexto: import("react").Context<RadioGroupContexto | null>;
@@ -21,5 +22,5 @@ export interface RadioGroupProps extends Omit<ComponentPropsWithRef<'fieldset'>,
21
22
  required?: boolean;
22
23
  value?: string;
23
24
  }
24
- export declare function RadioGroup({ children, className, defaultValue, disabled, error, hint, label, name: providedName, onValueChange, required, value, ...props }: RadioGroupProps): import("react").JSX.Element;
25
+ export declare function RadioGroup({ 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, children, className, defaultValue, disabled, error, hint, label, name: providedName, onValueChange, required, value, ...props }: RadioGroupProps): import("react").JSX.Element;
25
26
  export {};
@@ -1,15 +1,15 @@
1
+ import { type ComponentPropsWithRef } from 'react';
1
2
  export type SelectSize = 'sm' | 'md';
2
3
  export interface SelectOption {
3
4
  disabled?: boolean;
4
5
  label: string;
5
6
  value: string;
6
7
  }
7
- export interface SelectProps {
8
+ /** As propriedades nativas vao ao gatilho, que e o controle; o `className` soma ao do sistema. */
9
+ export interface SelectProps extends Omit<ComponentPropsWithRef<'button'>, 'children' | 'defaultValue' | 'name' | 'onChange' | 'type' | 'value'> {
8
10
  defaultValue?: string;
9
- disabled?: boolean;
10
11
  error?: string;
11
12
  hint?: string;
12
- id?: string;
13
13
  label?: string;
14
14
  /**
15
15
  * Nome do campo no formulario. Com ele, um input oculto carrega o valor para
@@ -23,4 +23,4 @@ export interface SelectProps {
23
23
  size?: SelectSize;
24
24
  value?: string;
25
25
  }
26
- export declare function Select({ defaultValue, name, disabled, error, hint, id: providedId, label, onValueChange, options, placeholder, required, size, value, }: SelectProps): import("react").JSX.Element;
26
+ export declare function Select({ 'aria-describedby': ariaDescribedBy, className, defaultValue, name, disabled, error, hint, id: providedId, label, onClick, onKeyDown, onValueChange, options, placeholder, ref, required, size, value, ...props }: SelectProps): import("react").JSX.Element;
@@ -4,4 +4,4 @@ export interface SwitchProps extends Omit<ComponentPropsWithRef<'input'>, 'type'
4
4
  hint?: string;
5
5
  label: string;
6
6
  }
7
- export declare function Switch({ 'aria-describedby': ariaDescribedBy, className, error, hint, id: providedId, label, ref, ...props }: SwitchProps): import("react").JSX.Element;
7
+ export declare function Switch({ 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, className, error, hint, id: providedId, label, ref, ...props }: SwitchProps): import("react").JSX.Element;
@@ -1,7 +1,12 @@
1
- import { Time } from '@internationalized/date';
1
+ import { type ComponentPropsWithRef } from 'react';
2
2
  export type TimePickerSize = 'sm' | 'md';
3
- export interface TimePickerProps {
4
- defaultValue?: Time;
3
+ /**
4
+ * As propriedades nativas vao ao campo de texto, que e o controle; o `className` soma a caixa do campo, que e o que
5
+ * se posiciona e dimensiona.
6
+ */
7
+ export interface TimePickerProps extends Omit<ComponentPropsWithRef<'input'>, 'defaultValue' | 'max' | 'min' | 'name' | 'onChange' | 'size' | 'type' | 'value' | 'step'> {
8
+ /** Hora em `HH:mm`, como no `FormData`: a API nao expoe tipo de biblioteca de terceiros. */
9
+ defaultValue?: string;
5
10
  disabled?: boolean;
6
11
  error?: string;
7
12
  hint?: string;
@@ -12,10 +17,11 @@ export interface TimePickerProps {
12
17
  * o `FormData`: sem controle nativo por baixo, o envio ignorava o campo.
13
18
  */
14
19
  name?: string;
15
- max?: Time;
16
- min?: Time;
20
+ max?: string;
21
+ min?: string;
17
22
  step?: number;
18
- onValueChange?: (value?: Time) => void;
23
+ /** Sem hora inteira e permitida, o valor e `null`, que mantem o campo controlado e vazio. */
24
+ onValueChange?: (value: string | null) => void;
19
25
  placeholder?: string;
20
26
  required?: boolean;
21
27
  size?: TimePickerSize;
@@ -23,6 +29,6 @@ export interface TimePickerProps {
23
29
  * `null` e "controlado e vazio": devolver a propriedade a `undefined` nao
24
30
  * limpa o campo, porque ali ele volta a ser nao controlado.
25
31
  */
26
- value?: Time | null;
32
+ value?: string | null;
27
33
  }
28
- export declare function TimePicker({ defaultValue, name, disabled, error, hint, id: providedId, label, max, min, step, onValueChange, placeholder, required, size, value, }: TimePickerProps): import("react").JSX.Element;
34
+ export declare function TimePicker({ 'aria-describedby': ariaDescribedBy, className, defaultValue, name, disabled, error, hint, id: providedId, label, max, min, step, onValueChange, onBlur, onKeyDown, placeholder, required, size, ref, value, ...props }: TimePickerProps): import("react").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { Time } from '@internationalized/date';
2
2
  export interface TimeSlotsProps {
3
+ autoFocus?: boolean;
3
4
  baseId: string;
4
5
  label?: string;
5
6
  max?: Time;
@@ -9,14 +10,8 @@ export interface TimeSlotsProps {
9
10
  value?: Time;
10
11
  }
11
12
  export declare function paraTextoDeHora(hora?: Time): string;
12
- /** Aplica a mascara hora:minuto conforme o usuario digita. */
13
- export declare function formatarEntradaHora(valor: string): string;
14
- /**
15
- * So devolve a hora quando os quatro digitos foram informados. Aceitar
16
- * 18:4 como 18:04 fixaria o valor no terceiro digito e impediria completar
17
- * a dezena do minuto.
18
- */
19
- export declare function lerEntradaHora(valor: string): Time | undefined;
13
+ /** A hora digitada respeita os limites que a lista ja respeita. */
14
+ export declare function isTimeAllowed(time: Time, min?: Time, max?: Time): boolean;
20
15
  /** Horarios do dia inteiro, do primeiro ao ultimo que couber no passo. */
21
16
  export declare function gerarHorarios(step: number, min?: Time, max?: Time): Time[];
22
- export declare function TimeSlots({ baseId, label, max, min, onChange, step, value }: TimeSlotsProps): import("react").JSX.Element;
17
+ export declare function TimeSlots({ autoFocus, baseId, label, max, min, onChange, step, value }: TimeSlotsProps): import("react").JSX.Element;
@@ -3,6 +3,7 @@ export declare function IconArrowDown(props: IconProps): import("react").JSX.Ele
3
3
  export declare function IconArrowUp(props: IconProps): import("react").JSX.Element;
4
4
  export declare function IconCalendar(props: IconProps): import("react").JSX.Element;
5
5
  export declare function IconChevronDown(props: IconProps): import("react").JSX.Element;
6
+ export declare function IconChevronExpand(props: IconProps): import("react").JSX.Element;
6
7
  export declare function IconChevronLeft(props: IconProps): import("react").JSX.Element;
7
8
  export declare function IconChevronRight(props: IconProps): import("react").JSX.Element;
8
9
  export declare function IconChevronUp(props: IconProps): import("react").JSX.Element;
@@ -10,3 +11,4 @@ export declare function IconClock(props: IconProps): import("react").JSX.Element
10
11
  export declare function IconClose(props: IconProps): import("react").JSX.Element;
11
12
  export declare function IconMinusCircle(props: IconProps): import("react").JSX.Element;
12
13
  export declare function IconPlusCircle(props: IconProps): import("react").JSX.Element;
14
+ export declare function IconQuestionCircle(props: IconProps): import("react").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  export type { IconProps } from './Icon.js';
2
- export { IconArrowDown, IconArrowUp, IconCalendar, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClock, IconClose, IconMinusCircle, IconPlusCircle, } from './icons.js';
2
+ export { IconArrowDown, IconArrowUp, IconCalendar, IconChevronDown, IconChevronExpand, IconChevronLeft, IconChevronRight, IconChevronUp, IconClock, IconClose, IconMinusCircle, IconPlusCircle, IconQuestionCircle, } from './icons.js';