@plenustech/design-system 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/README.md +209 -0
  2. package/dist/design-system.css +1 -0
  3. package/dist/folha.d.ts +7 -0
  4. package/dist/plenus-design-system.cjs +2 -0
  5. package/dist/plenus-design-system.cjs.map +1 -0
  6. package/dist/plenus-design-system.es.js +5853 -0
  7. package/dist/plenus-design-system.es.js.map +1 -0
  8. package/dist/reset.css +79 -0
  9. package/dist/types/components/actions/Button/Button.d.ts +9 -0
  10. package/dist/types/components/actions/Button/index.d.ts +2 -0
  11. package/dist/types/components/charts/ChartArea/ChartArea.d.ts +35 -0
  12. package/dist/types/components/charts/ChartArea/index.d.ts +2 -0
  13. package/dist/types/components/charts/ChartBar/ChartBar.d.ts +31 -0
  14. package/dist/types/components/charts/ChartBar/index.d.ts +2 -0
  15. package/dist/types/components/charts/ChartCombo/ChartCombo.d.ts +44 -0
  16. package/dist/types/components/charts/ChartCombo/index.d.ts +2 -0
  17. package/dist/types/components/charts/ChartDonut/ChartDonut.d.ts +31 -0
  18. package/dist/types/components/charts/ChartDonut/index.d.ts +2 -0
  19. package/dist/types/components/charts/ChartLine/ChartLine.d.ts +34 -0
  20. package/dist/types/components/charts/ChartLine/index.d.ts +2 -0
  21. package/dist/types/components/charts/ChartPie/ChartPie.d.ts +27 -0
  22. package/dist/types/components/charts/ChartPie/index.d.ts +2 -0
  23. package/dist/types/components/charts/ChartRadial/ChartRadial.d.ts +32 -0
  24. package/dist/types/components/charts/ChartRadial/index.d.ts +2 -0
  25. package/dist/types/components/charts/ChartSankey/ChartSankey.d.ts +41 -0
  26. package/dist/types/components/charts/ChartSankey/index.d.ts +2 -0
  27. package/dist/types/components/charts/ChartScatter/ChartScatter.d.ts +37 -0
  28. package/dist/types/components/charts/ChartScatter/index.d.ts +2 -0
  29. package/dist/types/components/charts/ChartSunburst/ChartSunburst.d.ts +27 -0
  30. package/dist/types/components/charts/ChartSunburst/index.d.ts +2 -0
  31. package/dist/types/components/charts/ChartTooltip/ChartTooltip.d.ts +41 -0
  32. package/dist/types/components/charts/ChartTooltip/index.d.ts +2 -0
  33. package/dist/types/components/charts/ChartTreemap/ChartTreemap.d.ts +30 -0
  34. package/dist/types/components/charts/ChartTreemap/index.d.ts +2 -0
  35. package/dist/types/components/charts/ChartWaterfall/ChartWaterfall.d.ts +24 -0
  36. package/dist/types/components/charts/ChartWaterfall/index.d.ts +2 -0
  37. package/dist/types/components/charts/core/Axis.d.ts +18 -0
  38. package/dist/types/components/charts/core/BandCursor.d.ts +15 -0
  39. package/dist/types/components/charts/core/CartesianFrame.d.ts +41 -0
  40. package/dist/types/components/charts/core/ChartFrame.d.ts +31 -0
  41. package/dist/types/components/charts/core/ChartLegend.d.ts +24 -0
  42. package/dist/types/components/charts/core/Grid.d.ts +12 -0
  43. package/dist/types/components/charts/core/arcs.d.ts +27 -0
  44. package/dist/types/components/charts/core/cartesianLayout.d.ts +70 -0
  45. package/dist/types/components/charts/core/centerText.d.ts +14 -0
  46. package/dist/types/components/charts/core/index.d.ts +36 -0
  47. package/dist/types/components/charts/core/measureText.d.ts +25 -0
  48. package/dist/types/components/charts/core/shapes.d.ts +26 -0
  49. package/dist/types/components/charts/core/slices.d.ts +18 -0
  50. package/dist/types/components/charts/core/spacing.d.ts +39 -0
  51. package/dist/types/components/charts/core/useChartMetrics.d.ts +19 -0
  52. package/dist/types/components/charts/core/useHoveredBand.d.ts +9 -0
  53. package/dist/types/components/charts/core/useSeriesToggle.d.ts +16 -0
  54. package/dist/types/components/charts/core/useSliceRing.d.ts +31 -0
  55. package/dist/types/components/charts/core/useTweenedNumbers.d.ts +14 -0
  56. package/dist/types/components/charts/palette/index.d.ts +3 -0
  57. package/dist/types/components/charts/palette/palette.d.ts +17 -0
  58. package/dist/types/components/charts/palette/seriesColor.d.ts +24 -0
  59. package/dist/types/components/charts/scales/index.d.ts +2 -0
  60. package/dist/types/components/charts/scales/scales.d.ts +57 -0
  61. package/dist/types/components/data-display/Accordion/Accordion.d.ts +20 -0
  62. package/dist/types/components/data-display/Accordion/index.d.ts +2 -0
  63. package/dist/types/components/data-display/Avatar/Avatar.d.ts +8 -0
  64. package/dist/types/components/data-display/Avatar/index.d.ts +2 -0
  65. package/dist/types/components/data-display/Badge/Badge.d.ts +8 -0
  66. package/dist/types/components/data-display/Badge/index.d.ts +2 -0
  67. package/dist/types/components/data-display/Card/Card.d.ts +29 -0
  68. package/dist/types/components/data-display/Card/index.d.ts +2 -0
  69. package/dist/types/components/data-display/List/List.d.ts +40 -0
  70. package/dist/types/components/data-display/List/ListingOptions.d.ts +20 -0
  71. package/dist/types/components/data-display/List/index.d.ts +2 -0
  72. package/dist/types/components/data-display/List/useListing.d.ts +35 -0
  73. package/dist/types/components/data-display/List/useVirtualWindow.d.ts +25 -0
  74. package/dist/types/components/data-display/Table/Table.d.ts +78 -0
  75. package/dist/types/components/data-display/Table/index.d.ts +2 -0
  76. package/dist/types/components/feedback/Alert/Alert.d.ts +8 -0
  77. package/dist/types/components/feedback/Alert/index.d.ts +2 -0
  78. package/dist/types/components/feedback/Progress/Progress.d.ts +10 -0
  79. package/dist/types/components/feedback/Progress/index.d.ts +2 -0
  80. package/dist/types/components/feedback/Spinner/Spinner.d.ts +7 -0
  81. package/dist/types/components/feedback/Spinner/index.d.ts +2 -0
  82. package/dist/types/components/forms/Checkbox/Checkbox.d.ts +8 -0
  83. package/dist/types/components/forms/Checkbox/index.d.ts +2 -0
  84. package/dist/types/components/forms/ComboBox/ComboBox.d.ts +29 -0
  85. package/dist/types/components/forms/ComboBox/index.d.ts +2 -0
  86. package/dist/types/components/forms/DatePicker/Calendar.d.ts +9 -0
  87. package/dist/types/components/forms/DatePicker/DatePicker.d.ts +29 -0
  88. package/dist/types/components/forms/DatePicker/index.d.ts +2 -0
  89. package/dist/types/components/forms/DateTimePicker/DateTimePicker.d.ts +33 -0
  90. package/dist/types/components/forms/DateTimePicker/index.d.ts +2 -0
  91. package/dist/types/components/forms/Field/Field.d.ts +19 -0
  92. package/dist/types/components/forms/Field/index.d.ts +2 -0
  93. package/dist/types/components/forms/InputCurrency/InputCurrency.d.ts +9 -0
  94. package/dist/types/components/forms/InputCurrency/index.d.ts +2 -0
  95. package/dist/types/components/forms/InputNumber/InputNumber.d.ts +8 -0
  96. package/dist/types/components/forms/InputNumber/index.d.ts +2 -0
  97. package/dist/types/components/forms/InputPassword/InputPassword.d.ts +13 -0
  98. package/dist/types/components/forms/InputPassword/index.d.ts +2 -0
  99. package/dist/types/components/forms/InputText/InputText.d.ts +10 -0
  100. package/dist/types/components/forms/InputText/index.d.ts +2 -0
  101. package/dist/types/components/forms/Label/Label.d.ts +5 -0
  102. package/dist/types/components/forms/Label/index.d.ts +2 -0
  103. package/dist/types/components/forms/RadioGroup/Radio.d.ts +6 -0
  104. package/dist/types/components/forms/RadioGroup/RadioGroup.d.ts +25 -0
  105. package/dist/types/components/forms/RadioGroup/index.d.ts +4 -0
  106. package/dist/types/components/forms/Select/Select.d.ts +26 -0
  107. package/dist/types/components/forms/Select/index.d.ts +2 -0
  108. package/dist/types/components/forms/Switch/Switch.d.ts +7 -0
  109. package/dist/types/components/forms/Switch/index.d.ts +2 -0
  110. package/dist/types/components/forms/Textarea/Textarea.d.ts +10 -0
  111. package/dist/types/components/forms/Textarea/index.d.ts +2 -0
  112. package/dist/types/components/forms/TimePicker/TimePicker.d.ts +28 -0
  113. package/dist/types/components/forms/TimePicker/TimeSlots.d.ts +22 -0
  114. package/dist/types/components/forms/TimePicker/index.d.ts +2 -0
  115. package/dist/types/components/icons/Icon.d.ts +23 -0
  116. package/dist/types/components/icons/icons.d.ts +12 -0
  117. package/dist/types/components/icons/index.d.ts +2 -0
  118. package/dist/types/components/navigation/Breadcrumb/Breadcrumb.d.ts +17 -0
  119. package/dist/types/components/navigation/Breadcrumb/index.d.ts +2 -0
  120. package/dist/types/components/navigation/Pagination/Pagination.d.ts +11 -0
  121. package/dist/types/components/navigation/Pagination/index.d.ts +2 -0
  122. package/dist/types/components/navigation/Tabs/Tabs.d.ts +17 -0
  123. package/dist/types/components/navigation/Tabs/index.d.ts +2 -0
  124. package/dist/types/components/overlays/Dialog/Dialog.d.ts +13 -0
  125. package/dist/types/components/overlays/Dialog/index.d.ts +2 -0
  126. package/dist/types/components/overlays/Menu/Menu.d.ts +13 -0
  127. package/dist/types/components/overlays/Menu/index.d.ts +2 -0
  128. package/dist/types/components/overlays/Popover/Popover.d.ts +13 -0
  129. package/dist/types/components/overlays/Popover/index.d.ts +2 -0
  130. package/dist/types/components/overlays/Tooltip/Tooltip.d.ts +9 -0
  131. package/dist/types/components/overlays/Tooltip/index.d.ts +2 -0
  132. package/dist/types/hooks/useCalendar/calendar.d.ts +16 -0
  133. package/dist/types/hooks/useCalendar/index.d.ts +3 -0
  134. package/dist/types/hooks/useCalendar/useCalendar.d.ts +21 -0
  135. package/dist/types/hooks/useCharacterCount/index.d.ts +1 -0
  136. package/dist/types/hooks/useCharacterCount/useCharacterCount.d.ts +7 -0
  137. package/dist/types/hooks/useFormReset.d.ts +6 -0
  138. package/dist/types/hooks/useSelection/index.d.ts +3 -0
  139. package/dist/types/hooks/useSelection/selection.d.ts +25 -0
  140. package/dist/types/hooks/useSelection/useSelection.d.ts +26 -0
  141. package/dist/types/index.d.ts +97 -0
  142. package/dist/types/utils/formatters/formatarData.d.ts +10 -0
  143. package/dist/types/utils/formatters/formatarEntradaData.d.ts +5 -0
  144. package/dist/types/utils/formatters/formatarEntradaDecimal.d.ts +1 -0
  145. package/dist/types/utils/formatters/formatarEntradaMonetaria.d.ts +1 -0
  146. package/dist/types/utils/formatters/formatarNumero.d.ts +27 -0
  147. package/dist/types/utils/formatters/index.d.ts +7 -0
  148. package/dist/types/utils/mergeRefs.d.ts +7 -0
  149. package/dist/types/utils/textSearch/index.d.ts +1 -0
  150. package/dist/types/utils/textSearch/textSearch.d.ts +2 -0
  151. package/package.json +86 -0
@@ -0,0 +1,28 @@
1
+ import { Time } from '@internationalized/date';
2
+ export type TimePickerSize = 'sm' | 'md';
3
+ export interface TimePickerProps {
4
+ defaultValue?: Time;
5
+ disabled?: boolean;
6
+ error?: string;
7
+ hint?: string;
8
+ id?: string;
9
+ label?: string;
10
+ /**
11
+ * Nome do campo no formulario. Com ele, um input oculto carrega o valor para
12
+ * o `FormData`: sem controle nativo por baixo, o envio ignorava o campo.
13
+ */
14
+ name?: string;
15
+ max?: Time;
16
+ min?: Time;
17
+ step?: number;
18
+ onValueChange?: (value?: Time) => void;
19
+ placeholder?: string;
20
+ required?: boolean;
21
+ size?: TimePickerSize;
22
+ /**
23
+ * `null` e "controlado e vazio": devolver a propriedade a `undefined` nao
24
+ * limpa o campo, porque ali ele volta a ser nao controlado.
25
+ */
26
+ value?: Time | null;
27
+ }
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;
@@ -0,0 +1,22 @@
1
+ import { Time } from '@internationalized/date';
2
+ export interface TimeSlotsProps {
3
+ baseId: string;
4
+ label?: string;
5
+ max?: Time;
6
+ min?: Time;
7
+ onChange: (value: Time) => void;
8
+ step?: number;
9
+ value?: Time;
10
+ }
11
+ 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;
20
+ /** Horarios do dia inteiro, do primeiro ao ultimo que couber no passo. */
21
+ 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;
@@ -0,0 +1,2 @@
1
+ export { TimePicker } from './TimePicker.js';
2
+ export type { TimePickerProps, TimePickerSize } from './TimePicker.js';
@@ -0,0 +1,23 @@
1
+ import type { ReactNode, SVGProps } from 'react';
2
+ export interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'children' | 'viewBox'> {
3
+ /**
4
+ * Nome acessivel. Sem ele o icone e decorativo e sai da arvore de
5
+ * acessibilidade — que e o caso sempre que houver texto ao lado dizendo a
6
+ * mesma coisa.
7
+ */
8
+ label?: string;
9
+ /** Sem medida declarada, o icone acompanha o tamanho do texto ao redor. */
10
+ size?: number | string;
11
+ }
12
+ interface DesenhoProps extends IconProps {
13
+ children: ReactNode;
14
+ }
15
+ /**
16
+ * Base dos icones do Design System. **Interna**: ela fecha o conjunto, para que
17
+ * a aplicacao use a biblioteca oficial em vez de desenhar o proprio caminho,
18
+ * conforme `ARCHITECTURE.md` secao 12.
19
+ *
20
+ * A cor vem de `currentColor`, entao o icone herda a cor do texto em que esta.
21
+ */
22
+ export declare function Icon({ children, label, size, ...props }: DesenhoProps): import("react").JSX.Element;
23
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type IconProps } from './Icon.js';
2
+ export declare function IconArrowDown(props: IconProps): import("react").JSX.Element;
3
+ export declare function IconArrowUp(props: IconProps): import("react").JSX.Element;
4
+ export declare function IconCalendar(props: IconProps): import("react").JSX.Element;
5
+ export declare function IconChevronDown(props: IconProps): import("react").JSX.Element;
6
+ export declare function IconChevronLeft(props: IconProps): import("react").JSX.Element;
7
+ export declare function IconChevronRight(props: IconProps): import("react").JSX.Element;
8
+ export declare function IconChevronUp(props: IconProps): import("react").JSX.Element;
9
+ export declare function IconClock(props: IconProps): import("react").JSX.Element;
10
+ export declare function IconClose(props: IconProps): import("react").JSX.Element;
11
+ export declare function IconMinusCircle(props: IconProps): import("react").JSX.Element;
12
+ export declare function IconPlusCircle(props: IconProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export type { IconProps } from './Icon.js';
2
+ export { IconArrowDown, IconArrowUp, IconCalendar, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClock, IconClose, IconMinusCircle, IconPlusCircle, } from './icons.js';
@@ -0,0 +1,17 @@
1
+ import type { ComponentPropsWithRef, ElementType } from 'react';
2
+ export interface BreadcrumbItem {
3
+ href?: string;
4
+ label: string;
5
+ /**
6
+ * Propriedades entregues inteiras ao componente de link. Serve ao roteador
7
+ * que nao usa `href` — o do React Router pede `to`.
8
+ */
9
+ linkProps?: Record<string, unknown>;
10
+ }
11
+ export interface BreadcrumbProps extends ComponentPropsWithRef<'nav'> {
12
+ /** Componente de link da aplicacao, para nao acoplar o sistema a um roteador. */
13
+ as?: ElementType;
14
+ items: readonly BreadcrumbItem[];
15
+ label?: string;
16
+ }
17
+ export declare function Breadcrumb({ as: Link, className, items, label, ...props }: BreadcrumbProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Breadcrumb } from './Breadcrumb.js';
2
+ export type { BreadcrumbProps, BreadcrumbItem } from './Breadcrumb.js';
@@ -0,0 +1,11 @@
1
+ import { type ComponentPropsWithRef } from 'react';
2
+ export interface PaginationProps extends ComponentPropsWithRef<'nav'> {
3
+ label?: string;
4
+ onPageChange: (page: number) => void;
5
+ page: number;
6
+ pageCount: number;
7
+ /** Quantidade de paginas mostradas de cada lado da atual. */
8
+ siblings?: number;
9
+ }
10
+ export declare function Pagination({ className, label, onPageChange, page, pageCount, siblings, ...props }: PaginationProps): import("react").JSX.Element | null;
11
+ export declare function montarFaixa(atual: number, total: number, vizinhos: number): (number | null)[];
@@ -0,0 +1,2 @@
1
+ export { Pagination } from './Pagination.js';
2
+ export type { PaginationProps } from './Pagination.js';
@@ -0,0 +1,17 @@
1
+ import { type ComponentPropsWithRef, type ReactNode } from 'react';
2
+ export interface TabItem {
3
+ content: ReactNode;
4
+ disabled?: boolean;
5
+ key: string;
6
+ label: string;
7
+ }
8
+ export type TabsOrientation = 'horizontal' | 'vertical';
9
+ export interface TabsProps extends ComponentPropsWithRef<'div'> {
10
+ defaultSelectedKey?: string;
11
+ items: readonly TabItem[];
12
+ label: string;
13
+ onSelectionChange?: (key: string) => void;
14
+ orientation?: TabsOrientation;
15
+ selectedKey?: string;
16
+ }
17
+ export declare function Tabs({ className, defaultSelectedKey, items, label, onSelectionChange, orientation, selectedKey, ...props }: TabsProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Tabs } from './Tabs.js';
2
+ export type { TabsProps, TabItem, TabsOrientation } from './Tabs.js';
@@ -0,0 +1,13 @@
1
+ import { type ReactNode } from 'react';
2
+ export type DialogSize = 'sm' | 'md' | 'lg';
3
+ export interface DialogProps {
4
+ children?: ReactNode;
5
+ description?: string;
6
+ dismissable?: boolean;
7
+ footer?: ReactNode;
8
+ onClose: () => void;
9
+ open: boolean;
10
+ size?: DialogSize;
11
+ title: string;
12
+ }
13
+ export declare function Dialog({ open, ...props }: DialogProps): import("react").ReactPortal | null;
@@ -0,0 +1,2 @@
1
+ export { Dialog } from './Dialog.js';
2
+ export type { DialogProps, DialogSize } from './Dialog.js';
@@ -0,0 +1,13 @@
1
+ import { type ReactElement } from 'react';
2
+ export interface MenuItem {
3
+ disabled?: boolean;
4
+ key: string;
5
+ label: string;
6
+ onSelect?: () => void;
7
+ }
8
+ export interface MenuProps {
9
+ children: ReactElement<Record<string, unknown>>;
10
+ items: readonly MenuItem[];
11
+ label: string;
12
+ }
13
+ export declare function Menu({ children, items, label }: MenuProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Menu } from './Menu.js';
2
+ export type { MenuProps, MenuItem } from './Menu.js';
@@ -0,0 +1,13 @@
1
+ import { type ReactNode, type RefObject } from 'react';
2
+ export type PopoverPlacement = 'top' | 'top start' | 'top end' | 'bottom' | 'bottom start' | 'bottom end' | 'left' | 'right';
3
+ export interface PopoverProps {
4
+ 'aria-label'?: string;
5
+ 'aria-labelledby'?: string;
6
+ children: ReactNode;
7
+ offset?: number;
8
+ onClose: () => void;
9
+ open: boolean;
10
+ placement?: PopoverPlacement;
11
+ triggerRef: RefObject<HTMLElement | null>;
12
+ }
13
+ export declare function Popover({ open, ...props }: PopoverProps): import("react").ReactPortal | null;
@@ -0,0 +1,2 @@
1
+ export { Popover } from './Popover.js';
2
+ export type { PopoverProps, PopoverPlacement } from './Popover.js';
@@ -0,0 +1,9 @@
1
+ import { type ReactElement, type ReactNode } from 'react';
2
+ export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
3
+ export interface TooltipProps {
4
+ children: ReactElement<Record<string, unknown>>;
5
+ content: ReactNode;
6
+ delay?: number;
7
+ placement?: TooltipPlacement;
8
+ }
9
+ export declare function Tooltip({ children, content, delay, placement }: TooltipProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Tooltip } from './Tooltip.js';
2
+ export type { TooltipProps, TooltipPlacement } from './Tooltip.js';
@@ -0,0 +1,16 @@
1
+ import { type CalendarDate } from '@internationalized/date';
2
+ export interface CalendarLimits {
3
+ isDateUnavailable?: (date: CalendarDate) => boolean;
4
+ max?: CalendarDate;
5
+ min?: CalendarDate;
6
+ }
7
+ export interface CalendarDay {
8
+ date: CalendarDate;
9
+ outside: boolean;
10
+ unavailable: boolean;
11
+ }
12
+ export declare function isUnavailable(date: CalendarDate, { isDateUnavailable, max, min }: CalendarLimits): boolean;
13
+ export declare function buildMonth(anchor: CalendarDate, locale: string, limits?: CalendarLimits): CalendarDay[][];
14
+ export declare function clamp(date: CalendarDate, { max, min }: CalendarLimits): CalendarDate;
15
+ export declare function moveFocus(date: CalendarDate, key: string, shift: boolean, limits: CalendarLimits): CalendarDate | undefined;
16
+ export declare function sameDay(a: CalendarDate | undefined, b: CalendarDate | undefined): boolean;
@@ -0,0 +1,3 @@
1
+ export { useCalendar } from './useCalendar.js';
2
+ export type { UseCalendarOptions, UseCalendarResult } from './useCalendar.js';
3
+ export type { CalendarDay, CalendarLimits } from './calendar.js';
@@ -0,0 +1,21 @@
1
+ import { type KeyboardEvent } from 'react';
2
+ import { type CalendarDate } from '@internationalized/date';
3
+ import { type CalendarDay, type CalendarLimits } from './calendar.js';
4
+ export interface UseCalendarOptions extends CalendarLimits {
5
+ locale?: string;
6
+ onSelect?: (date: CalendarDate) => void;
7
+ value?: CalendarDate;
8
+ }
9
+ export interface UseCalendarResult {
10
+ /** Leva o foco a uma data e traz o mes dela para a grade. */
11
+ focus: (date: CalendarDate) => void;
12
+ focusedDate: CalendarDate;
13
+ goToMonth: (offset: number) => void;
14
+ handleKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
15
+ isSelected: (date: CalendarDate) => boolean;
16
+ isToday: (date: CalendarDate) => boolean;
17
+ select: (date: CalendarDate) => void;
18
+ visibleMonth: CalendarDate;
19
+ weeks: CalendarDay[][];
20
+ }
21
+ export declare function useCalendar({ isDateUnavailable, locale, max, min, onSelect, value, }?: UseCalendarOptions): UseCalendarResult;
@@ -0,0 +1 @@
1
+ export { useCharacterCount } from './useCharacterCount.js';
@@ -0,0 +1,7 @@
1
+ type FieldValue = string | number | readonly string[] | undefined;
2
+ export declare function useCharacterCount<T extends HTMLInputElement | HTMLTextAreaElement>(value: FieldValue, defaultValue: FieldValue): {
3
+ ref: import("react").RefObject<T | null>;
4
+ count: number;
5
+ updateCount(nextValue: string): void;
6
+ };
7
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Restaura o valor inicial quando o formulario e reiniciado. Campo que guarda o
3
+ * texto exibido em estado do React nao volta sozinho: o `reset` mexe no DOM, e
4
+ * o estado continua onde estava.
5
+ */
6
+ export declare function useFormReset<T extends HTMLElement>(restaurar: () => void): import("react").RefObject<T | null>;
@@ -0,0 +1,3 @@
1
+ export { useSelection } from './useSelection.js';
2
+ export type { UseSelectionOptions, UseSelectionResult } from './useSelection.js';
3
+ export type { SelectionItem, SelectionMode, SelectionState, SelectionStatus } from './selection.js';
@@ -0,0 +1,25 @@
1
+ export type SelectionMode = 'none' | 'single' | 'multiple';
2
+ export interface SelectionItem {
3
+ key: string;
4
+ disabled?: boolean;
5
+ textValue?: string;
6
+ }
7
+ export type SelectionStatus = 'none' | 'partial' | 'all';
8
+ export interface SelectionState {
9
+ anchorKey?: string;
10
+ focusedKey?: string;
11
+ selectedKeys: ReadonlySet<string>;
12
+ }
13
+ export declare const emptySelection: SelectionState;
14
+ export declare function firstKey(items: readonly SelectionItem[]): string | undefined;
15
+ export declare function lastKey(items: readonly SelectionItem[]): string | undefined;
16
+ export declare function nextKey(items: readonly SelectionItem[], from: string | undefined): string | undefined;
17
+ export declare function previousKey(items: readonly SelectionItem[], from: string | undefined): string | undefined;
18
+ export declare function matchKey(items: readonly SelectionItem[], query: string, from: string | undefined): string | undefined;
19
+ export declare function select(state: SelectionState, key: string, mode: SelectionMode, { allowEmpty }?: {
20
+ allowEmpty?: boolean;
21
+ }): SelectionState;
22
+ export declare function selectRange(state: SelectionState, key: string, items: readonly SelectionItem[]): SelectionState;
23
+ export declare function selectionStatus(state: SelectionState, items: readonly SelectionItem[]): SelectionStatus;
24
+ export declare function toggleAll(state: SelectionState, items: readonly SelectionItem[]): SelectionState;
25
+ export declare function clearSelection(state: SelectionState): SelectionState;
@@ -0,0 +1,26 @@
1
+ import { type SelectionItem, type SelectionMode, type SelectionState, type SelectionStatus } from './selection.js';
2
+ export interface UseSelectionOptions {
3
+ /** Em modo unico, escolher de novo o mesmo item desfaz a escolha. */
4
+ allowEmpty?: boolean;
5
+ defaultSelectedKeys?: Iterable<string>;
6
+ items: readonly SelectionItem[];
7
+ mode?: SelectionMode;
8
+ onSelectionChange?: (keys: ReadonlySet<string>) => void;
9
+ selectedKeys?: Iterable<string>;
10
+ typeaheadDelay?: number;
11
+ }
12
+ export interface UseSelectionResult extends SelectionState {
13
+ selectedItems: readonly SelectionItem[];
14
+ clear: () => void;
15
+ focus: (key?: string) => void;
16
+ focusFirst: (extend?: boolean) => void;
17
+ focusLast: (extend?: boolean) => void;
18
+ focusNext: (extend?: boolean) => void;
19
+ focusPrevious: (extend?: boolean) => void;
20
+ search: (character: string) => void;
21
+ select: (key: string) => void;
22
+ selectRange: (key: string) => void;
23
+ status: SelectionStatus;
24
+ toggleAll: () => void;
25
+ }
26
+ export declare function useSelection({ allowEmpty, defaultSelectedKeys, items, mode, onSelectionChange, selectedKeys, typeaheadDelay, }: UseSelectionOptions): UseSelectionResult;
@@ -0,0 +1,97 @@
1
+ export { IconArrowDown, IconArrowUp, IconCalendar, IconChevronDown, IconChevronLeft, IconChevronRight, IconChevronUp, IconClock, IconClose, IconMinusCircle, IconPlusCircle, } from './components/icons/index.js';
2
+ export type { IconProps } from './components/icons/index.js';
3
+ export { Button } from './components/actions/Button/index.js';
4
+ export type { ButtonProps, ButtonSize, ButtonVariant } from './components/actions/Button/index.js';
5
+ export { Field } from './components/forms/Field/index.js';
6
+ export type { FieldProps, FieldWiring } from './components/forms/Field/index.js';
7
+ export { Label } from './components/forms/Label/index.js';
8
+ export type { LabelProps } from './components/forms/Label/index.js';
9
+ export { InputText } from './components/forms/InputText/index.js';
10
+ export type { InputTextProps, InputTextSize } from './components/forms/InputText/index.js';
11
+ export { InputNumber } from './components/forms/InputNumber/index.js';
12
+ export type { InputNumberProps } from './components/forms/InputNumber/index.js';
13
+ export { InputPassword } from './components/forms/InputPassword/index.js';
14
+ export type { InputPasswordProps } from './components/forms/InputPassword/index.js';
15
+ export { InputCurrency } from './components/forms/InputCurrency/index.js';
16
+ export type { InputCurrencyProps } from './components/forms/InputCurrency/index.js';
17
+ export { Textarea } from './components/forms/Textarea/index.js';
18
+ export type { TextareaProps, TextareaSize } from './components/forms/Textarea/index.js';
19
+ export { Checkbox } from './components/forms/Checkbox/index.js';
20
+ export type { CheckboxProps } from './components/forms/Checkbox/index.js';
21
+ export { RadioGroup, Radio } from './components/forms/RadioGroup/index.js';
22
+ export type { RadioGroupProps, RadioProps } from './components/forms/RadioGroup/index.js';
23
+ export { Switch } from './components/forms/Switch/index.js';
24
+ export type { SwitchProps } from './components/forms/Switch/index.js';
25
+ export { Alert } from './components/feedback/Alert/index.js';
26
+ export type { AlertProps, AlertTone } from './components/feedback/Alert/index.js';
27
+ export { Progress } from './components/feedback/Progress/index.js';
28
+ export type { ProgressProps, ProgressSize } from './components/feedback/Progress/index.js';
29
+ export { Spinner } from './components/feedback/Spinner/index.js';
30
+ export type { SpinnerProps, SpinnerSize } from './components/feedback/Spinner/index.js';
31
+ export { Popover } from './components/overlays/Popover/index.js';
32
+ export type { PopoverProps, PopoverPlacement } from './components/overlays/Popover/index.js';
33
+ export { Tabs } from './components/navigation/Tabs/index.js';
34
+ export type { TabsProps, TabItem, TabsOrientation } from './components/navigation/Tabs/index.js';
35
+ export { Breadcrumb } from './components/navigation/Breadcrumb/index.js';
36
+ export type { BreadcrumbProps, BreadcrumbItem } from './components/navigation/Breadcrumb/index.js';
37
+ export { Pagination } from './components/navigation/Pagination/index.js';
38
+ export type { PaginationProps } from './components/navigation/Pagination/index.js';
39
+ export { Accordion } from './components/data-display/Accordion/index.js';
40
+ export type { AccordionProps, AccordionItem, AccordionIconPosition } from './components/data-display/Accordion/index.js';
41
+ export { Select } from './components/forms/Select/index.js';
42
+ export type { SelectProps, SelectOption, SelectSize } from './components/forms/Select/index.js';
43
+ export { ComboBox } from './components/forms/ComboBox/index.js';
44
+ export type { ComboBoxProps, ComboBoxOption, ComboBoxSize } from './components/forms/ComboBox/index.js';
45
+ export { Menu } from './components/overlays/Menu/index.js';
46
+ export type { MenuProps, MenuItem } from './components/overlays/Menu/index.js';
47
+ export { Tooltip } from './components/overlays/Tooltip/index.js';
48
+ export type { TooltipProps, TooltipPlacement } from './components/overlays/Tooltip/index.js';
49
+ export { Dialog } from './components/overlays/Dialog/index.js';
50
+ export type { DialogProps, DialogSize } from './components/overlays/Dialog/index.js';
51
+ export { Badge } from './components/data-display/Badge/index.js';
52
+ export type { BadgeProps, BadgeTone } from './components/data-display/Badge/index.js';
53
+ export { Avatar } from './components/data-display/Avatar/index.js';
54
+ export type { AvatarProps, AvatarSize } from './components/data-display/Avatar/index.js';
55
+ export { List } from './components/data-display/List/index.js';
56
+ export type { ListEmptyProps, ListItem, ListOptionsProps, ListProps, ListSearchProps, ListSelectAllProps, ListSelectionMode, } from './components/data-display/List/index.js';
57
+ export { Card } from './components/data-display/Card/index.js';
58
+ export type { CardBodyProps, CardFooterProps, CardHeaderProps, CardHeadingLevel, CardProps, } from './components/data-display/Card/index.js';
59
+ export { Table } from './components/data-display/Table/index.js';
60
+ export type { SortDirection, TableAlign, TableBodyProps, TableBreakpoint, TableCellProps, TableColumnProps, TableHeaderProps, TableProps, TableRowItem, TableRowProps, TableSelectionControl, TableSelectionMode, TableSize, TableSort, } from './components/data-display/Table/index.js';
61
+ export { DatePicker } from './components/forms/DatePicker/index.js';
62
+ export type { DatePickerProps, DatePickerSize } from './components/forms/DatePicker/index.js';
63
+ export { TimePicker } from './components/forms/TimePicker/index.js';
64
+ export type { TimePickerProps, TimePickerSize } from './components/forms/TimePicker/index.js';
65
+ export { DateTimePicker } from './components/forms/DateTimePicker/index.js';
66
+ export type { DateTimePickerProps, DateTimePickerSize } from './components/forms/DateTimePicker/index.js';
67
+ export { formatarData, formatarHora, formatarMoeda, formatarNumero, formatarPercentual, } from './utils/formatters/index.js';
68
+ export type { OpcoesDeData, OpcoesDeHora, OpcoesDeMoeda, OpcoesDeNumero, OpcoesDePercentual, } from './utils/formatters/index.js';
69
+ export { ChartBar } from './components/charts/ChartBar/index.js';
70
+ export type { ChartBarOrientation, ChartBarProps, ChartBarSeries } from './components/charts/ChartBar/index.js';
71
+ export { ChartLine } from './components/charts/ChartLine/index.js';
72
+ export type { ChartLineProps, ChartLineSeries } from './components/charts/ChartLine/index.js';
73
+ export { ChartTooltip } from './components/charts/ChartTooltip/index.js';
74
+ export type { ChartTooltipColumn, ChartTooltipComputed, ChartTooltipProps, ChartTooltipRow, ChartTooltipTotal, } from './components/charts/ChartTooltip/index.js';
75
+ export { ChartCombo } from './components/charts/ChartCombo/index.js';
76
+ export type { ChartComboAxis, ChartComboKind, ChartComboProps, ChartComboSeries, } from './components/charts/ChartCombo/index.js';
77
+ export { ChartArea } from './components/charts/ChartArea/index.js';
78
+ export type { ChartAreaProps, ChartAreaSeries } from './components/charts/ChartArea/index.js';
79
+ export { ChartScatter } from './components/charts/ChartScatter/index.js';
80
+ export type { ChartScatterPoint, ChartScatterProps, ChartScatterSeries, } from './components/charts/ChartScatter/index.js';
81
+ export { ChartPie } from './components/charts/ChartPie/index.js';
82
+ export type { ChartPieProps, ChartPieSlice } from './components/charts/ChartPie/index.js';
83
+ export { ChartDonut } from './components/charts/ChartDonut/index.js';
84
+ export type { ChartDonutProps, ChartDonutSlice } from './components/charts/ChartDonut/index.js';
85
+ export { ChartRadial } from './components/charts/ChartRadial/index.js';
86
+ export type { ChartRadialProps, ChartRadialTrack } from './components/charts/ChartRadial/index.js';
87
+ export { ChartWaterfall } from './components/charts/ChartWaterfall/index.js';
88
+ export type { ChartWaterfallProps, ChartWaterfallStep } from './components/charts/ChartWaterfall/index.js';
89
+ export { ChartTreemap } from './components/charts/ChartTreemap/index.js';
90
+ export type { ChartTreemapNode, ChartTreemapProps } from './components/charts/ChartTreemap/index.js';
91
+ export { ChartSunburst } from './components/charts/ChartSunburst/index.js';
92
+ export type { ChartSunburstNode, ChartSunburstProps } from './components/charts/ChartSunburst/index.js';
93
+ export { ChartSankey } from './components/charts/ChartSankey/index.js';
94
+ export type { ChartSankeyAlign, ChartSankeyFlow, ChartSankeyFlowColor, ChartSankeyFlowValuePosition, ChartSankeyNode, ChartSankeyProps, } from './components/charts/ChartSankey/index.js';
95
+ export type { AxisLabelAngle, AxisLabelRotation, AxisVisibility, ChartCurve, ChartHeight, ChartLegendAlign, ChartLegendPosition, } from './components/charts/core/index.js';
96
+ export { paletteWithAccent, resolveSeriesColors, seriesColors } from './components/charts/palette/index.js';
97
+ export type { SeriesAppearance, SeriesIntent } from './components/charts/palette/index.js';
@@ -0,0 +1,10 @@
1
+ export interface OpcoesDeData {
2
+ localidade?: string;
3
+ formato?: 'curto' | 'longo' | 'numerico';
4
+ }
5
+ export interface OpcoesDeHora {
6
+ localidade?: string;
7
+ segundos?: boolean;
8
+ }
9
+ export declare function formatarData(valor: Date | string, { localidade, formato }?: OpcoesDeData): string;
10
+ export declare function formatarHora(valor: Date | string, { localidade, segundos }?: OpcoesDeHora): string;
@@ -0,0 +1,5 @@
1
+ import { CalendarDate } from '@internationalized/date';
2
+ /** Aplica a mascara dia/mes/ano conforme o usuario digita. */
3
+ export declare function formatarEntradaData(valor: string): string;
4
+ /** Le dia, mes e ano separados por barra, traco, ponto ou espaco. */
5
+ export declare function lerEntradaData(valor: string): CalendarDate | undefined;
@@ -0,0 +1 @@
1
+ export declare function formatarEntradaDecimal(valor: string | number, casasDecimais?: number): string;
@@ -0,0 +1 @@
1
+ export declare function formatarEntradaMonetaria(valor: string | number, moeda?: string, casasDecimais?: number): string;
@@ -0,0 +1,27 @@
1
+ export interface OpcoesDeNumero {
2
+ /** Sem declarar, quem decide e a localidade — e, na moeda, a propria moeda. */
3
+ casasDecimais?: number;
4
+ compacto?: boolean;
5
+ localidade?: string;
6
+ }
7
+ export interface OpcoesDeMoeda extends OpcoesDeNumero {
8
+ moeda?: string;
9
+ }
10
+ export interface OpcoesDePercentual {
11
+ casasDecimais?: number;
12
+ localidade?: string;
13
+ }
14
+ export declare function formatarNumero(valor: number, { casasDecimais, compacto, localidade }?: OpcoesDeNumero): string;
15
+ /**
16
+ * Valor monetario. O separador entre simbolo e numero e um espaco nao
17
+ * separavel, escolha do `Intl`: ele impede que a quebra de linha afaste o
18
+ * simbolo do valor. As mascaras de entrada usam espaco comum, e a convergencia
19
+ * das duas ainda esta em aberto.
20
+ */
21
+ export declare function formatarMoeda(valor: number, { casasDecimais, compacto, localidade, moeda }?: OpcoesDeMoeda): string;
22
+ /**
23
+ * Percentual a partir da **fracao**: `0.42` vira `42%`. Receber o numero ja
24
+ * multiplicado obrigaria cada consumidor a dividir antes de exibir, e e a
25
+ * fracao que sai de uma divisao de duas medidas.
26
+ */
27
+ export declare function formatarPercentual(valor: number, { casasDecimais, localidade }?: OpcoesDePercentual): string;
@@ -0,0 +1,7 @@
1
+ export { formatarEntradaDecimal } from './formatarEntradaDecimal.js';
2
+ export { formatarEntradaMonetaria } from './formatarEntradaMonetaria.js';
3
+ export { formatarData, formatarHora } from './formatarData.js';
4
+ export type { OpcoesDeData, OpcoesDeHora } from './formatarData.js';
5
+ export { formatarMoeda, formatarNumero, formatarPercentual } from './formatarNumero.js';
6
+ export type { OpcoesDeMoeda, OpcoesDeNumero, OpcoesDePercentual } from './formatarNumero.js';
7
+ export { formatarEntradaData, lerEntradaData } from './formatarEntradaData.js';
@@ -0,0 +1,7 @@
1
+ import type { Ref } from 'react';
2
+ /**
3
+ * Junta o ref interno do componente ao que veio de fora. Sem isto, um dos dois
4
+ * se perde: o interno, porque `{...props}` o sobrescreve, ou o de fora, porque
5
+ * o componente aplica o seu depois.
6
+ */
7
+ export declare function mergeRefs<T>(...refs: readonly (Ref<T> | undefined)[]): (node: T | null) => void;
@@ -0,0 +1 @@
1
+ export { containsTerm, startsWithTerm } from './textSearch.js';
@@ -0,0 +1,2 @@
1
+ export declare function startsWithTerm(text: string, term: string): boolean;
2
+ export declare function containsTerm(text: string, term: string): boolean;
package/package.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "@plenustech/design-system",
3
+ "version": "0.1.1",
4
+ "description": "Design System centralizado para os produtos web da Plenustech.",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/MikeiasSM/plenus-design-system.git"
11
+ },
12
+ "type": "module",
13
+ "main": "./dist/plenus-design-system.cjs",
14
+ "module": "./dist/plenus-design-system.es.js",
15
+ "types": "./dist/types/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/types/index.d.ts",
19
+ "import": "./dist/plenus-design-system.es.js",
20
+ "require": "./dist/plenus-design-system.cjs"
21
+ },
22
+ "./styles.css": {
23
+ "types": "./dist/folha.d.ts",
24
+ "default": "./dist/design-system.css"
25
+ },
26
+ "./reset.css": {
27
+ "types": "./dist/folha.d.ts",
28
+ "default": "./dist/reset.css"
29
+ },
30
+ "./package.json": "./package.json"
31
+ },
32
+ "sideEffects": [
33
+ "**/*.css"
34
+ ],
35
+ "files": [
36
+ "dist"
37
+ ],
38
+ "scripts": {
39
+ "dev": "vite",
40
+ "dev:showcase": "vite --config showcase/vite.config.ts",
41
+ "build": "tsc -b && vite build && tsc -p tsconfig.build.json && node scripts/finaliza-pacote.mjs",
42
+ "check:pacote": "node scripts/check-pacote.mjs",
43
+ "check:contraste": "node scripts/check-contraste.mjs",
44
+ "prepare": "npm run build:pacote",
45
+ "build:showcase": "vite build --config showcase/vite.config.ts",
46
+ "test": "vitest run",
47
+ "test:watch": "vitest",
48
+ "test:coverage": "vitest run --coverage",
49
+ "preview": "vite preview",
50
+ "preview:showcase": "vite preview --config showcase/vite.config.ts",
51
+ "build:pacote": "tsc -p tsconfig.app.json && vite build && tsc -p tsconfig.build.json && node scripts/finaliza-pacote.mjs"
52
+ },
53
+ "dependencies": {
54
+ "@internationalized/date": "^3.12.4",
55
+ "@react-aria/focus": "^3.22.1",
56
+ "@react-aria/overlays": "^3.32.1",
57
+ "@types/d3-scale": "^4.0.9",
58
+ "d3-array": "^3.2.4",
59
+ "d3-hierarchy": "^3.1.2",
60
+ "d3-sankey": "^0.12.3",
61
+ "d3-scale": "^4.0.2",
62
+ "d3-shape": "^3.2.0"
63
+ },
64
+ "peerDependencies": {
65
+ "react": "^19.1.0",
66
+ "react-dom": "^19.1.0"
67
+ },
68
+ "devDependencies": {
69
+ "@testing-library/jest-dom": "^6.6.3",
70
+ "@testing-library/react": "^16.3.0",
71
+ "@types/d3-array": "^3.2.2",
72
+ "@types/d3-hierarchy": "^3.1.7",
73
+ "@types/d3-sankey": "^0.12.5",
74
+ "@types/d3-shape": "^3.2.0",
75
+ "@types/node": "^22.15.0",
76
+ "@types/react": "^19.1.2",
77
+ "@types/react-dom": "^19.1.2",
78
+ "@vitejs/plugin-react": "^4.4.1",
79
+ "jsdom": "^26.1.0",
80
+ "react": "^19.1.0",
81
+ "react-dom": "^19.1.0",
82
+ "typescript": "^5.8.3",
83
+ "vite": "^6.3.5",
84
+ "vitest": "^3.2.4"
85
+ }
86
+ }