@selectwin/kit 0.1.145 → 0.1.147

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.
@@ -0,0 +1,54 @@
1
+ import { ReactNode } from 'react';
2
+ export type SelectCalendarView = 'month' | 'week';
3
+ export interface SelectCalendarEvent {
4
+ id: string;
5
+ title: string;
6
+ /** Com hora: o instante (Date ou ISO). Dia inteiro: a DATA do primeiro dia, 'YYYY-MM-DD' (um ISO serve: vale a data). */
7
+ start: Date | string;
8
+ /** Fim EXCLUSIVO: o instante, ou (dia inteiro) a data do dia SEGUINTE ao último. */
9
+ end: Date | string;
10
+ allDay?: boolean;
11
+ /** A cor da agenda (qualquer cor CSS). Sem ela, a do tema. */
12
+ color?: string | null;
13
+ /** `cancelled` sai riscado; `tentative`, com o "talvez". */
14
+ status?: 'confirmed' | 'tentative' | 'cancelled';
15
+ /** Uma linha a mais no bloco da semana (o local, a empresa). */
16
+ detail?: string | null;
17
+ }
18
+ export interface SelectCalendarProps {
19
+ view: SelectCalendarView;
20
+ /** Um dia qualquer do mês ou da semana mostrados ('YYYY-MM-DD'). */
21
+ date: string;
22
+ events: SelectCalendarEvent[];
23
+ onViewChange?: (view: SelectCalendarView) => void;
24
+ onDateChange?: (date: string) => void;
25
+ onEventClick?: (id: string) => void;
26
+ /** O número do dia e o "+N" do mês. Sem ele, são texto. */
27
+ onDayClick?: (date: string) => void;
28
+ /** O fuso em que a grade é desenhada. Padrão: America/Sao_Paulo. */
29
+ timeZone?: string;
30
+ /** O primeiro dia da semana: 0 domingo (padrão), 1 segunda. */
31
+ weekStartsOn?: 0 | 1;
32
+ /** Na barra, à direita (ex.: "Marcar reunião"). */
33
+ actions?: ReactNode;
34
+ /** Carregando: a grade fica, os eventos esmaecem. */
35
+ loading?: boolean;
36
+ /** Na semana, a hora em que a grade abre rolada. Padrão: 8. */
37
+ scrollToHour?: number;
38
+ className?: string;
39
+ }
40
+ /** Hoje no fuso da grade ('YYYY-MM-DD'). */
41
+ export declare function calendarToday(timeZone?: string): string;
42
+ /**
43
+ * O intervalo que a grade mostra — o que o app busca: `from`/`to` são instantes ISO (meia-noite no fuso da grade, `to`
44
+ * exclusivo), e `days` os dias da grade. Mês: as semanas inteiras (35 ou 42 dias); semana: 7.
45
+ */
46
+ export declare function calendarRange(view: SelectCalendarView, date: string, opts?: {
47
+ timeZone?: string;
48
+ weekStartsOn?: 0 | 1;
49
+ }): {
50
+ from: string;
51
+ to: string;
52
+ days: string[];
53
+ };
54
+ export declare function SelectCalendar({ view, date, events, onViewChange, onDateChange, onEventClick, onDayClick, timeZone, weekStartsOn, actions, loading, scrollToHour, className, }: SelectCalendarProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ export interface SelectHtmlFrameProps {
2
+ /** O documento: um caminho da própria origem (`/api/…`) ou uma URL `https:`. Fora disso, nada é carregado. */
3
+ src: string;
4
+ /** O nome do quadro para o leitor de tela (ex.: "Corpo da mensagem"). */
5
+ title: string;
6
+ /** Altura do quadro; o conteúdo rola dentro. Padrão `28rem`. */
7
+ height?: string;
8
+ /** Os links do documento abrem em outra aba. Nunca libera script nem a origem. */
9
+ allowLinks?: boolean;
10
+ className?: string;
11
+ }
12
+ /** Só a própria origem (um caminho que não é `//host`) ou `https:`. */
13
+ export declare function frameSrcAllowed(src: string): boolean;
14
+ export declare function SelectHtmlFrame({ src, title, height, allowLinks, className }: SelectHtmlFrameProps): import("react").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SelectMailAddress {
3
+ name: string | null;
4
+ address: string;
5
+ }
6
+ /** "Ana Souza" ou, sem nome, o endereço. */
7
+ export declare function mailName(a: SelectMailAddress | null | undefined): string;
8
+ export declare function SelectMailList({ children, 'aria-label': ariaLabel }: {
9
+ children: ReactNode;
10
+ 'aria-label'?: string;
11
+ }): import("react").JSX.Element;
12
+ export interface SelectMailListItemProps {
13
+ /** Quem escreveu (na entrada) ou para quem foi (nos enviados). */
14
+ from: ReactNode;
15
+ subject: ReactNode;
16
+ snippet?: ReactNode;
17
+ /** Quando — já formatado. */
18
+ date: ReactNode;
19
+ /** Mensagens na conversa (só aparece de 2 em diante). */
20
+ count?: number;
21
+ /** Quantos anexos a mensagem mais recente leva. */
22
+ attachments?: number;
23
+ /** A conversa aberta no leitor. */
24
+ active?: boolean;
25
+ onClick: () => void;
26
+ }
27
+ export declare function SelectMailListItem({ from, subject, snippet, date, count, attachments, active, onClick }: SelectMailListItemProps): import("react").JSX.Element;
28
+ export interface SelectMailMessageProps {
29
+ from: SelectMailAddress | null;
30
+ to?: SelectMailAddress[];
31
+ cc?: SelectMailAddress[];
32
+ /** Quando — já formatado. */
33
+ date: ReactNode;
34
+ /** No canto do cabeçalho (ex.: "Responder"). */
35
+ actions?: ReactNode;
36
+ /** Sobre o corpo (ex.: "3 imagens externas bloqueadas"). */
37
+ notice?: ReactNode;
38
+ /** O corpo em texto — escapado, com as quebras de linha. Ignorado quando há `children`. */
39
+ text?: string | null;
40
+ /** O corpo em HTML: só o `SelectHtmlFrame`. */
41
+ children?: ReactNode;
42
+ /** Sob o corpo: os anexos. */
43
+ attachments?: ReactNode;
44
+ }
45
+ export declare function SelectMailMessage({ from, to, cc, date, actions, notice, text, children, attachments }: SelectMailMessageProps): import("react").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -76,6 +76,12 @@ export { SelectActionCard } from './SelectActionCard';
76
76
  export { SelectAppTile, SelectCreateTile } from './SelectTile';
77
77
  export { SelectWorkspaceSwitcher } from './SelectWorkspaceSwitcher';
78
78
  export { SelectKanban, SelectKanbanCard } from './SelectKanban';
79
+ export { SelectCalendar, calendarRange, calendarToday } from './SelectCalendar';
80
+ export type { SelectCalendarEvent, SelectCalendarProps, SelectCalendarView } from './SelectCalendar';
81
+ export { SelectHtmlFrame } from './SelectHtmlFrame';
82
+ export type { SelectHtmlFrameProps } from './SelectHtmlFrame';
83
+ export { SelectMailList, SelectMailListItem, SelectMailMessage, mailName } from './SelectMail';
84
+ export type { SelectMailAddress, SelectMailListItemProps, SelectMailMessageProps } from './SelectMail';
79
85
  export type { SelectKanbanColumn, SelectKanbanProps, SelectKanbanCardProps } from './SelectKanban';
80
86
  export { SelectModal } from './SelectModal';
81
87
  export { SelectPopover } from './SelectPopover';