@selectwin/kit 0.1.177 → 0.1.179

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.
@@ -9,6 +9,19 @@ export declare function SelectValueVisibilityProvider({ children }: {
9
9
  }): import("react").JSX.Element;
10
10
  /** Tolerant: no provider → a no-op default (values render unblurred). */
11
11
  export declare function useSelectValueVisibility(): ValueVisibility;
12
+ /**
13
+ * Marks the calling component as a maskable value while it is mounted (and `active`). SelectSensitiveValue
14
+ * — and so SelectMoney — already does it; call this only in a component that masks on its own by reading
15
+ * `hidden` (e.g. a chart that hides its money axis). No provider → no-op.
16
+ */
17
+ export declare function useSelectSensitiveValueMark(active?: boolean): void;
18
+ /**
19
+ * True while at least one maskable value is mounted under the provider — the eye ("ocultar valores")
20
+ * only means something then. It flips on mount/unmount: a page swapping its skeleton for data, or a
21
+ * route change, can flip it for a moment, so a header that hides on `false` should wait a beat
22
+ * before hiding. The `hidden` preference itself is untouched. No provider → always false.
23
+ */
24
+ export declare function useSelectHasSensitiveValues(): boolean;
12
25
  type SelectSensitiveValueOwnProps = {
13
26
  children: ReactNode;
14
27
  label?: string;
@@ -0,0 +1,59 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ type SelectQuestionStageOwnProps = {
3
+ /** Muda a cada pergunta: o miolo remonta (a animação) e o foco vai para a resposta. */
4
+ stepKey?: string | number;
5
+ /** A barra fina do topo; sem ela, nada no topo (a abertura, a tela final). */
6
+ progress?: {
7
+ value: number;
8
+ max: number;
9
+ };
10
+ /** O número da pergunta ("1 →"). */
11
+ number?: number;
12
+ title: ReactNode;
13
+ required?: boolean;
14
+ /** A linha de apoio sob a pergunta. */
15
+ help?: ReactNode;
16
+ /** A resposta: um `SelectQuestionInput`, um `SelectQuestionChoices` ou o que a tela pedir. */
17
+ children?: ReactNode;
18
+ /** O botão que avança ("OK", "Começar", "Enviar"). Sem `onOk`, sem botão. */
19
+ okLabel?: string;
20
+ onOk?: () => void;
21
+ okDisabled?: boolean;
22
+ /** Ao lado do botão; padrão "pressione Enter ↵". `null` esconde. */
23
+ okHint?: ReactNode;
24
+ /** As setas do canto. Sem a função, a seta fica desligada. */
25
+ onPrev?: () => void;
26
+ onNext?: () => void;
27
+ /** O rodapé à esquerda ("Pergunta 1 de 5"). */
28
+ footer?: ReactNode;
29
+ /** A altura do palco; padrão 560px (cabe na prévia do console). */
30
+ height?: string;
31
+ };
32
+ export type SelectQuestionStageProps = SelectQuestionStageOwnProps & Omit<ComponentPropsWithoutRef<'section'>, keyof SelectQuestionStageOwnProps | 'title'>;
33
+ export declare const SelectQuestionStage: import('react').ForwardRefExoticComponent<SelectQuestionStageOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, keyof SelectQuestionStageOwnProps> & import('react').RefAttributes<HTMLElement>>;
34
+ type SelectQuestionInputOwnProps = {
35
+ value: string;
36
+ onChange: (value: string) => void;
37
+ type?: 'text' | 'email' | 'tel' | 'number' | 'date';
38
+ /** Texto longo: uma caixa que cresce, e Enter quebra a linha (Ctrl/⌘+Enter avança). */
39
+ multiline?: boolean;
40
+ placeholder?: string;
41
+ /** O nome acessível; sem ele, o campo se nomeia pelo título da pergunta do palco. */
42
+ ariaLabel?: string;
43
+ };
44
+ export type SelectQuestionInputProps = SelectQuestionInputOwnProps & Omit<ComponentPropsWithoutRef<'input'>, keyof SelectQuestionInputOwnProps | 'type'>;
45
+ /** A resposta digitada: uma linha grande, só com o traço embaixo. */
46
+ export declare function SelectQuestionInput({ value, onChange, type, multiline, placeholder, ariaLabel, className, inputMode }: SelectQuestionInputProps): import("react").JSX.Element;
47
+ type SelectQuestionChoicesProps = {
48
+ options: string[];
49
+ /** Escolha única: a opção; múltipla: a lista. */
50
+ value: string | string[];
51
+ multiple?: boolean;
52
+ onChange: (value: string | string[]) => void;
53
+ /** As teclas de cada opção; padrão A, B, C… (no Sim/Não, S e N). */
54
+ keys?: string[];
55
+ ariaLabel?: string;
56
+ };
57
+ /** As opções em botões com a letra; a tecla da letra escolhe (com o foco nas opções). */
58
+ export declare function SelectQuestionChoices({ options, value, multiple, onChange, keys, ariaLabel }: SelectQuestionChoicesProps): import("react").JSX.Element;
59
+ export {};
package/dist/index.d.ts CHANGED
@@ -119,7 +119,7 @@ export { SelectTagSelect } from './SelectTagSelect';
119
119
  export { SelectSurface } from './SelectSurface';
120
120
  export { SelectToastProvider, useSelectToast } from './SelectToast';
121
121
  export { SelectPreviewFrame } from './SelectPreviewFrame';
122
- export { SelectMoney, SelectSensitiveValue, SelectMetricDelta, SelectHideMoneyToggle, SelectValueVisibilityProvider, useSelectValueVisibility, } from './SelectMoney';
122
+ export { SelectMoney, SelectSensitiveValue, SelectMetricDelta, SelectHideMoneyToggle, SelectValueVisibilityProvider, useSelectValueVisibility, useSelectHasSensitiveValues, useSelectSensitiveValueMark, } from './SelectMoney';
123
123
  export { SelectBalanceCard } from './SelectBalanceCard';
124
124
  export { SelectFeeBreakdown } from './SelectFeeBreakdown';
125
125
  export { SelectKpiCard } from './SelectKpiCard';
@@ -231,6 +231,7 @@ export { SelectFlowCanvas, SelectFlowNode, SelectFlowLayout } from './SelectFlow
231
231
  export { SelectSwitchField } from './SelectSwitchField';
232
232
  export { SelectColorField, SELECT_COLOR_PRESETS, normalizeHex, contrastRatio, hexToHsv, hsvToHex } from './SelectColorField';
233
233
  export { SelectProgressBar, type SelectProgressBarProps, type SelectProgressTone } from './SelectProgressBar';
234
+ export { SelectQuestionStage, SelectQuestionInput, SelectQuestionChoices, type SelectQuestionStageProps, type SelectQuestionInputProps, } from './SelectQuestionStage';
234
235
  export { SelectChoiceCard, SelectChoiceCardSkeleton, SelectChoiceGrid, type SelectChoiceCardProps, type SelectChoiceGridProps } from './SelectChoiceCard';
235
236
  export { SelectCertificatePreview, type SelectCertificatePreviewProps, type SelectCertificateSignature } from './SelectCertificatePreview';
236
237
  export { SelectImageField } from './SelectImageField';