@aspprev/versi-ds 0.2.0 → 0.4.0

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 @@
1
+ {"version":3,"sources":["../src/components/Modal/Modal.tsx","../src/components/InputSwitch/InputSwitch.tsx","../src/components/InputSwitch/InputSwitch.style.ts","../src/components/accessibility-preferences/ContrastPreference.tsx","../src/components/accessibility-preferences/PreferenceSection.tsx","../src/components/accessibility-preferences/FontSizePreference.tsx","../src/components/accessibility-preferences/ReadingPreferences.tsx","../src/components/accessibility-preferences/ThemePreference.tsx","../src/components/accessibility-preferences/AccessibilityPreferencesPanel.tsx","../src/components/accessibility-preferences/types.ts","../src/components/accessibility-preferences/HighContrastToggle.tsx"],"sourcesContent":["\"use client\";\n\nimport React, { Fragment } from \"react\";\nimport {\n MdCheckCircle,\n MdCancel,\n MdDeleteForever,\n MdOutlineClose,\n MdDownload,\n MdSend,\n MdErrorOutline,\n} from \"react-icons/md\";\nimport {\n Transition,\n Dialog,\n TransitionChild,\n DialogTitle,\n DialogPanel,\n} from \"@headlessui/react\";\n\nexport type ModalProps = {\n children?: React.ReactNode;\n isOpen: boolean;\n title?: string;\n onClose: () => void;\n showIcon?: boolean;\n variant?:\n | \"success\"\n | \"error\"\n | \"warning\"\n | \"delete\"\n | \"downloading\"\n | \"sendMessage\";\n size?: \"small\" | \"medium\" | \"large\" | \"viewer\" | \"full\";\n className?: string;\n} & React.HTMLAttributes<HTMLDivElement>;\n\nconst modalMaxWidths = {\n small: \"28rem\",\n medium: \"42rem\",\n large: \"56rem\",\n viewer: \"72rem\",\n full: \"calc(100vw - 40px)\",\n} as const;\n\nconst Modal = ({\n children,\n isOpen,\n onClose,\n className,\n style,\n title,\n showIcon = true,\n variant = \"success\",\n size = \"small\",\n}: ModalProps) => {\n const variantStyles = {\n success: {\n bgColor: \"bg-feedback-success-soft\",\n icon: <MdCheckCircle className=\"h-6 w-6 text-feedback-success-content\" />,\n },\n error: {\n bgColor: \"bg-feedback-danger-soft\",\n icon: <MdCancel className=\"h-6 w-6 text-feedback-danger-content\" />,\n },\n warning: {\n bgColor: \"bg-feedback-warning-soft\",\n icon: (\n <MdErrorOutline className=\"h-6 w-6 text-feedback-warning-content\" />\n ),\n },\n downloading: {\n bgColor: \"bg-feedback-info-soft\",\n icon: <MdDownload className=\"h-6 w-6 text-feedback-info-content\" />,\n },\n delete: {\n bgColor: \"bg-feedback-info-soft\",\n icon: <MdDeleteForever className=\"h-6 w-6 text-feedback-info-content\" />,\n },\n sendMessage: {\n bgColor: \"bg-feedback-info-soft\",\n icon: <MdSend className=\"h-6 w-6 text-feedback-info-content\" />,\n },\n };\n\n const { bgColor, icon } = variantStyles[variant];\n\n return (\n <Transition appear show={isOpen} as={Fragment}>\n <Dialog\n as=\"div\"\n className=\"relative z-modal gap-0\"\n aria-label={title ? undefined : \"Janela de diálogo\"}\n onClose={onClose}\n >\n <TransitionChild\n as={Fragment}\n enter=\"ease-out duration-300\"\n enterFrom=\"opacity-0\"\n enterTo=\"opacity-100\"\n leave=\"ease-in duration-200\"\n leaveFrom=\"opacity-100\"\n leaveTo=\"opacity-0\"\n >\n <div className=\"fixed inset-0 bg-overlay/50 backdrop-blur-[1px]\" />\n </TransitionChild>\n <div className=\"portal-safe-modal fixed inset-0 overflow-y-auto gap-0\">\n <div className=\"flex min-h-full items-center justify-center p-5 gap-0\">\n <DialogPanel\n className={`relative flex max-h-[calc(100dvh-40px)] max-w-[calc(100vw-40px)] flex-col space-y-5 overflow-x-hidden overflow-y-auto rounded-sm bg-surface-card p-5 shadow-md transition-all ${className ?? \"\"}`}\n style={{\n ...style,\n width: \"100%\",\n maxWidth: modalMaxWidths[size],\n }}\n >\n <div className=\"absolute right-5 top-5 flex items-center justify-end\">\n <button\n type=\"button\"\n aria-label=\"Fechar janela\"\n onClick={onClose}\n className=\"inline-flex h-6 w-6 touch-manipulation items-center justify-center rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring\"\n >\n <MdOutlineClose\n aria-hidden=\"true\"\n size={20}\n className=\"text-content-secondary\"\n />\n </button>\n </div>\n\n {showIcon && (\n <div aria-hidden=\"true\" className=\"flex justify-center p-0\">\n <div\n className={`inline-flex items-center justify-center w-12 h-12 rounded-full ${bgColor}`}\n >\n {icon}\n </div>\n </div>\n )}\n\n <div className=\"space-y-3\">\n {title && (\n <DialogTitle\n as=\"h3\"\n className=\"text-xl font-extrabold text-center\"\n >\n {title}\n </DialogTitle>\n )}\n {children}\n </div>\n </DialogPanel>\n </div>\n </div>\n </Dialog>\n </Transition>\n );\n};\n\nexport default Modal;\n\n","\"use client\";\n\nimport React, { useState } from \"react\";\nimport useStyle from \"./InputSwitch.style\";\nimport { MdCheck, MdOutlineClose, MdSunny, MdNightsStay } from \"react-icons/md\";\nimport type { IconType } from \"react-icons\";\n\ntype NativeSwitchProps = {\n id?: string;\n name?: string;\n value?: string;\n form?: string;\n autoFocus?: boolean;\n tabIndex?: number;\n} & React.AriaAttributes & (\n | {\n \"aria-label\": string;\n \"aria-labelledby\"?: never;\n }\n | {\n \"aria-label\"?: never;\n \"aria-labelledby\": string;\n }\n);\n\nexport type InputSwitchProps = {\n defaultEnable?: boolean;\n checked?: boolean;\n variant?: \"primary\" | \"secondary\" | \"tertiary\" | \"contract\" | \"theme\";\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n onChange?: (enabled: boolean) => void;\n icon?: IconType;\n} & NativeSwitchProps;\n\nexport type InputSwitchStyleProps = Pick<\n InputSwitchProps,\n \"variant\" | \"disabled\" | \"size\"\n> & {\n enabled: boolean;\n};\n\nexport type SwitchProps = InputSwitchProps;\n\nconst InputSwitch: React.FC<InputSwitchProps> = ({\n defaultEnable: enabledByDefault,\n id,\n name,\n value,\n form,\n autoFocus,\n tabIndex,\n variant = \"primary\",\n size = \"md\",\n disabled,\n onChange,\n checked,\n icon: Icon,\n ...rest\n}) => {\n const [enabled, setEnabled] = useState(enabledByDefault ?? false);\n const resolvedEnabled = typeof checked === \"boolean\" ? checked : enabled;\n const style = useStyle({\n variant,\n enabled: resolvedEnabled,\n disabled,\n size,\n });\n\n const toggle = () => {\n const newState = !resolvedEnabled;\n if (typeof checked !== \"boolean\") {\n setEnabled(newState);\n }\n onChange?.(newState);\n };\n return (\n <>\n {name && (\n <input\n type=\"checkbox\"\n name={name}\n value={value ?? \"on\"}\n form={form}\n checked={resolvedEnabled}\n readOnly\n tabIndex={-1}\n aria-hidden=\"true\"\n className=\"sr-only\"\n />\n )}\n <button\n {...rest}\n id={id}\n type=\"button\"\n role=\"switch\"\n aria-checked={resolvedEnabled}\n disabled={disabled ?? false}\n autoFocus={autoFocus}\n tabIndex={tabIndex}\n onClick={toggle}\n className={style.Container}\n >\n {variant !== \"contract\" && variant !== \"theme\" && (\n <span className={style.Switch}>\n {Icon && <Icon aria-hidden=\"true\" className={style.Icon} />}\n </span>\n )}\n {variant === \"contract\" && (\n <span className={style.Switch}>\n {resolvedEnabled && (\n <MdCheck className={style.Icon} aria-disabled={disabled} />\n )}\n {resolvedEnabled || (\n <MdOutlineClose className={style.Icon} aria-disabled={disabled} />\n )}\n </span>\n )}\n\n {variant === \"theme\" && (\n <span className={style.SwitchTheme}>\n {resolvedEnabled && (\n <MdNightsStay\n className={style.IconTheme}\n aria-disabled={disabled}\n />\n )}\n {resolvedEnabled || (\n <MdSunny className={style.IconTheme} aria-disabled={disabled} />\n )}\n </span>\n )}\n </button>\n </>\n );\n};\n\nexport default InputSwitch;\n\n","import { cva } from \"class-variance-authority\";\nimport classNames from \"classnames\";\nimport { InputSwitchProps, InputSwitchStyleProps } from \"./InputSwitch\";\n\nconst SIZE_STYLES: Record<\n NonNullable<InputSwitchProps[\"size\"]>,\n {\n container: string;\n knob: string;\n icon: string;\n }\n> = {\n sm: {\n container:\n \"h-[1rem] w-[1.75rem] [--switch-padding:2px] [--switch-knob-size:0.75rem] [--switch-width:1.75rem]\",\n knob: \"h-[var(--switch-knob-size)] w-[var(--switch-knob-size)]\",\n icon: \"h-2 w-2\",\n },\n md: {\n container:\n \"h-[1.25rem] w-[3rem] [--switch-padding:2px] [--switch-knob-size:1rem] [--switch-width:3rem]\",\n knob: \"h-[var(--switch-knob-size)] w-[var(--switch-knob-size)]\",\n icon: \"h-3 w-3\",\n },\n lg: {\n container:\n \"h-[1.5rem] w-[3.5rem] [--switch-padding:2px] [--switch-knob-size:1.25rem] [--switch-width:3.5rem]\",\n knob: \"h-[var(--switch-knob-size)] w-[var(--switch-knob-size)]\",\n icon: \"h-4 w-4\",\n },\n};\n\nconst getInputSwitchStyles = ({\n variant,\n enabled,\n disabled,\n size = \"md\",\n}: InputSwitchStyleProps) => {\n const sizeStyle = SIZE_STYLES[size];\n const containerVariant = cva(\n classNames(\n \"switch-control relative inline-flex shrink-0 items-center rounded-full transition-colors before:absolute before:left-1/2 before:top-1/2 before:h-5 before:w-full before:min-w-5 before:-translate-x-1/2 before:-translate-y-1/2 before:content-[''] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-1 disabled:bg-switch-track-disabled\",\n sizeStyle.container,\n { \"pointer-events-none\": disabled },\n ),\n {\n variants: {\n variant: {\n primary: classNames(\n \"[--switch-state-layer:var(--switch-track-primary-on)]\",\n { \"bg-switch-track-primary-on\": enabled },\n { \"bg-switch-track-off\": !enabled },\n ),\n secondary: classNames(\n \"[--switch-state-layer:var(--switch-track-secondary-on)]\",\n { \"bg-switch-track-secondary-on\": enabled },\n { \"bg-switch-track-off\": !enabled },\n ),\n tertiary: classNames(\n \"[--switch-state-layer:var(--switch-track-tertiary-on)]\",\n { \"bg-switch-track-tertiary-on\": enabled },\n { \"bg-switch-track-off\": !enabled },\n ),\n contract: classNames(\n enabled\n ? \"bg-switch-track-contract-on [--switch-state-layer:var(--switch-track-contract-on)]\"\n : \"bg-switch-track-contract-off [--switch-state-layer:var(--switch-track-contract-off)]\",\n ),\n theme: classNames(\n enabled\n ? \"bg-switch-track-theme-on [--switch-state-layer:var(--switch-track-theme-on)]\"\n : \"bg-switch-track-theme-off [--switch-state-layer:var(--switch-track-theme-off)]\",\n ),\n },\n },\n defaultVariants: {\n variant: \"primary\",\n },\n },\n );\n const containerClasses = containerVariant({ variant });\n\n const switchClasses = classNames(\n \"switch-knob absolute left-[var(--switch-padding)] top-1/2 flex items-center justify-center rounded-full transition-[transform,box-shadow,background-color] duration-200 ease-in-out -translate-y-1/2\",\n sizeStyle.knob,\n disabled ? \"bg-switch-knob-disabled\" : \"bg-switch-knob\",\n enabled\n ? \"translate-x-[calc(var(--switch-width)-var(--switch-knob-size)-var(--switch-padding)*2)]\"\n : \"translate-x-0\",\n );\n\n const switchClassesTheme = classNames(\n \"switch-knob absolute left-[var(--switch-padding)] top-1/2 flex items-center justify-center rounded-full transition-[transform,box-shadow,background-color] duration-200 ease-in-out -translate-y-1/2\",\n sizeStyle.knob,\n {\n \"bg-switch-knob-theme-on\": enabled && !disabled,\n \"bg-switch-knob\": !enabled && !disabled,\n \"bg-switch-knob-disabled\": disabled,\n \"translate-x-[calc(var(--switch-width)-var(--switch-knob-size)-var(--switch-padding)*2)]\":\n enabled,\n \"translate-x-0\": !enabled,\n },\n );\n\n const iconClasses = classNames(\n \"aria-disabled:text-font-disabled\",\n sizeStyle.icon,\n { \"text-feedback-success-content\": enabled && !disabled },\n { \"text-feedback-danger-content\": !enabled && !disabled },\n { \"text-content-disabled\": disabled },\n );\n\n const iconClassesTheme = classNames(\n \"aria-disabled:text-font-disabled\",\n sizeStyle.icon,\n { \"text-content-inverse\": enabled && !disabled },\n { \"text-feedback-warning-content\": !enabled && !disabled },\n { \"text-content-disabled\": disabled },\n );\n\n return {\n Icon: iconClasses,\n IconTheme: iconClassesTheme,\n Switch: switchClasses,\n SwitchTheme: switchClassesTheme,\n Container: containerClasses,\n };\n};\n\nexport default getInputSwitchStyles;\n\n","import { MdContrast } from \"react-icons/md\";\nimport InputSwitch from \"../InputSwitch/InputSwitch\";\nimport PreferenceSection from \"./PreferenceSection\";\n\nexport type ContrastPreferenceProps = {\n checked: boolean;\n onChange: (checked: boolean) => void;\n className?: string;\n};\n\nexport default function ContrastPreference({\n checked,\n onChange,\n className,\n}: ContrastPreferenceProps) {\n return (\n <PreferenceSection\n title=\"Contraste\"\n description=\"Aumente a diferenciação entre conteúdo e superfície.\"\n icon={MdContrast}\n className={className}\n >\n <div className=\"flex min-h-16 items-center justify-between gap-4 rounded-sm border border-border-default bg-surface-card px-3 py-3\">\n <span className=\"flex items-center gap-1.5 font-semibold\">\n <MdContrast aria-hidden=\"true\" className=\"h-4 w-4\" />\n Alto contraste\n </span>\n <InputSwitch\n aria-label=\"Alternar alto contraste\"\n checked={checked}\n size=\"lg\"\n onChange={onChange}\n />\n </div>\n </PreferenceSection>\n );\n}\n","import type { IconType } from \"react-icons\";\n\nexport type PreferenceSectionProps = {\n title: string;\n description: string;\n icon: IconType;\n children: React.ReactNode;\n className?: string;\n};\n\nexport default function PreferenceSection({\n title,\n description,\n icon: Icon,\n children,\n className,\n}: PreferenceSectionProps) {\n return (\n <fieldset\n className={`rounded-md border border-border-default bg-surface-subtle p-4 tablet:p-5 ${className ?? \"\"}`.trim()}\n >\n <legend className=\"sr-only\">{title}</legend>\n <div className=\"mb-4 flex items-start gap-3\">\n <span className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary-5 text-primary-1\">\n <Icon aria-hidden=\"true\" className=\"h-5 w-5\" />\n </span>\n <div>\n <h3 className=\"font-bold\">{title}</h3>\n <p className=\"text-sm text-content-secondary\">{description}</p>\n </div>\n </div>\n {children}\n </fieldset>\n );\n}\n","import { useId } from \"react\";\nimport { MdTextFields } from \"react-icons/md\";\nimport PreferenceSection from \"./PreferenceSection\";\nimport type { AccessibilityFontScale } from \"./types\";\n\nconst FONT_SCALE_OPTIONS: Array<{\n value: AccessibilityFontScale;\n label: string;\n}> = [\n { value: \"standard\", label: \"Padrão\" },\n { value: \"large\", label: \"Grande\" },\n { value: \"extra-large\", label: \"Muito grande\" },\n];\n\nexport type FontSizePreferenceProps = {\n value: AccessibilityFontScale;\n onChange: (value: AccessibilityFontScale) => void;\n className?: string;\n};\n\nexport default function FontSizePreference({\n value,\n onChange,\n className,\n}: FontSizePreferenceProps) {\n const groupId = useId();\n\n return (\n <PreferenceSection\n title=\"Tamanho do texto\"\n description=\"Amplie os textos para facilitar a leitura.\"\n icon={MdTextFields}\n className={className}\n >\n <div className=\"grid gap-2\">\n {FONT_SCALE_OPTIONS.map((option) => (\n <label\n key={option.value}\n className=\"flex min-h-11 cursor-pointer items-center gap-3 rounded-sm border border-border-default bg-surface-card p-3 text-content-primary transition-colors hover:border-border-strong hover:bg-surface-muted\"\n >\n <input\n type=\"radio\"\n name={`${groupId}-font-scale`}\n value={option.value}\n checked={value === option.value}\n onChange={() => onChange(option.value)}\n className=\"radio-control shrink-0\"\n />\n <span className=\"flex w-9 shrink-0 justify-center font-extrabold text-primary-1\">\n Aa\n </span>\n <span className=\"font-semibold\">{option.label}</span>\n </label>\n ))}\n </div>\n </PreferenceSection>\n );\n}\n","import {\n MdAccessibilityNew,\n MdAnimation,\n MdCenterFocusStrong,\n MdLink,\n} from \"react-icons/md\";\nimport PreferenceSection from \"./PreferenceSection\";\nimport type { AccessibilityPreferences } from \"./types\";\n\ntype ReadingPreferenceKey =\n | \"reduceMotion\"\n | \"emphasizeFocus\"\n | \"underlineLinks\";\n\nconst READING_OPTIONS: Array<{\n key: ReadingPreferenceKey;\n label: string;\n description: string;\n Icon: typeof MdAnimation;\n}> = [\n {\n key: \"reduceMotion\",\n label: \"Reduzir animações\",\n description: \"Minimiza animações, transições e rolagens suaves.\",\n Icon: MdAnimation,\n },\n {\n key: \"emphasizeFocus\",\n label: \"Destacar foco\",\n description: \"Evidencia o elemento selecionado durante o uso do teclado.\",\n Icon: MdCenterFocusStrong,\n },\n {\n key: \"underlineLinks\",\n label: \"Sublinhar links\",\n description: \"Mantém links de texto sublinhados fora do foco.\",\n Icon: MdLink,\n },\n];\n\nexport type ReadingPreferencesProps = Pick<\n AccessibilityPreferences,\n ReadingPreferenceKey\n> & {\n onChange: (\n changes: Partial<Pick<AccessibilityPreferences, ReadingPreferenceKey>>,\n ) => void;\n className?: string;\n};\n\nexport default function ReadingPreferences({\n reduceMotion,\n emphasizeFocus,\n underlineLinks,\n onChange,\n className,\n}: ReadingPreferencesProps) {\n const values = { reduceMotion, emphasizeFocus, underlineLinks };\n\n return (\n <PreferenceSection\n title=\"Leitura e navegação\"\n description=\"Ajustes para reduzir distrações e facilitar a orientação.\"\n icon={MdAccessibilityNew}\n className={`desktop:col-span-2 ${className ?? \"\"}`.trim()}\n >\n <div className=\"grid gap-3 tablet:grid-cols-3\">\n {READING_OPTIONS.map(({ key, label, description, Icon }) => (\n <label\n key={key}\n className=\"flex min-h-11 cursor-pointer items-start gap-3 rounded-sm border border-border-default bg-surface-card p-3 text-content-primary transition-colors hover:border-border-strong hover:bg-surface-muted\"\n >\n <input\n type=\"checkbox\"\n aria-label={label}\n checked={values[key]}\n onChange={(event) => onChange({ [key]: event.target.checked })}\n className=\"checkbox-control mt-1\"\n />\n <span>\n <span className=\"flex items-center gap-2 font-semibold\">\n <Icon aria-hidden=\"true\" className=\"h-5 w-5 shrink-0 text-primary-1\" />\n {label}\n </span>\n <span className=\"mt-1 block text-sm text-content-secondary\">\n {description}\n </span>\n </span>\n </label>\n ))}\n </div>\n </PreferenceSection>\n );\n}\n","import { MdPalette } from \"react-icons/md\";\nimport InputSwitch from \"../InputSwitch/InputSwitch\";\nimport PreferenceSection from \"./PreferenceSection\";\nimport type { AccessibilityColorScheme } from \"./types\";\n\nexport type ThemePreferenceProps = {\n value: AccessibilityColorScheme;\n onChange: (value: AccessibilityColorScheme) => void;\n className?: string;\n};\n\nexport default function ThemePreference({\n value,\n onChange,\n className,\n}: ThemePreferenceProps) {\n const isDark = value === \"dark\";\n const isSystem = value === \"system\";\n\n return (\n <PreferenceSection\n title=\"Aparência\"\n description=\"Tema e esquema de cores da interface.\"\n icon={MdPalette}\n className={className}\n >\n <div className=\"divide-y divide-border-subtle rounded-sm border border-border-default bg-surface-card px-3\">\n <div className=\"flex min-h-16 items-center justify-between gap-4 py-3\">\n <span className=\"font-semibold\">Tema {isDark ? \"escuro\" : \"claro\"}</span>\n <InputSwitch\n aria-label=\"Alternar tema claro ou escuro\"\n variant=\"theme\"\n size=\"lg\"\n checked={isDark}\n disabled={isSystem}\n onChange={(enabled) => onChange(enabled ? \"dark\" : \"light\")}\n />\n </div>\n <label className=\"flex min-h-14 cursor-pointer items-start gap-3 py-3\">\n <input\n type=\"checkbox\"\n className=\"checkbox-control mt-0.5\"\n checked={isSystem}\n onChange={(event) =>\n onChange(event.target.checked ? \"system\" : isDark ? \"dark\" : \"light\")\n }\n />\n <span className=\"font-semibold\">Usar configuração do dispositivo</span>\n </label>\n </div>\n </PreferenceSection>\n );\n}\n","\"use client\";\n\nimport { useState } from \"react\";\nimport { MdAccessibilityNew, MdRestartAlt } from \"react-icons/md\";\nimport Modal from \"../Modal/Modal\";\nimport ContrastPreference from \"./ContrastPreference\";\nimport FontSizePreference from \"./FontSizePreference\";\nimport ReadingPreferences from \"./ReadingPreferences\";\nimport ThemePreference from \"./ThemePreference\";\nimport type { AccessibilityPreferences } from \"./types\";\n\nexport type AccessibilityPreferencesPanelProps = {\n preferences: AccessibilityPreferences;\n onPreferencesChange: (\n changes: Partial<AccessibilityPreferences>,\n ) => void;\n onReset?: () => void;\n isOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n showTrigger?: boolean;\n triggerLabel?: string;\n className?: string;\n};\n\nexport default function AccessibilityPreferencesPanel({\n preferences,\n onPreferencesChange,\n onReset,\n isOpen: controlledOpen,\n onOpenChange,\n showTrigger = true,\n triggerLabel = \"Preferências de acessibilidade\",\n className,\n}: AccessibilityPreferencesPanelProps) {\n const [internalOpen, setInternalOpen] = useState(false);\n const [announcement, setAnnouncement] = useState(\"\");\n const isOpen = controlledOpen ?? internalOpen;\n\n const setOpen = (open: boolean) => {\n if (controlledOpen === undefined) setInternalOpen(open);\n onOpenChange?.(open);\n };\n\n const update = (\n changes: Partial<AccessibilityPreferences>,\n message: string,\n ) => {\n onPreferencesChange(changes);\n setAnnouncement(message);\n };\n\n return (\n <>\n {showTrigger && (\n <button\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-expanded={isOpen}\n onClick={() => setOpen(true)}\n className={`inline-flex min-h-11 items-center justify-center gap-2 rounded-sm border-2 border-action-primary-content bg-action-primary px-3 text-sm font-bold text-action-primary-content shadow-sm hover:bg-action-primary-hover focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring ${className ?? \"\"}`.trim()}\n >\n <MdAccessibilityNew aria-hidden=\"true\" className=\"h-5 w-5\" />\n <span>{triggerLabel}</span>\n </button>\n )}\n\n <Modal\n isOpen={isOpen}\n onClose={() => setOpen(false)}\n title={triggerLabel}\n showIcon={false}\n size=\"large\"\n >\n <p className=\"mt-2 text-center text-sm text-content-secondary\">\n As alterações são aplicadas pelo consumidor do componente.\n </p>\n\n <div className=\"mt-5 grid gap-4 desktop:grid-cols-2\">\n <ThemePreference\n value={preferences.colorScheme}\n onChange={(colorScheme) =>\n update(\n {\n colorScheme,\n ...(colorScheme === \"system\"\n ? {}\n : {\n highContrastTheme:\n colorScheme === \"dark\" ? \"dark\" : \"light\",\n }),\n },\n `Tema ${colorScheme === \"dark\" ? \"escuro\" : colorScheme === \"light\" ? \"claro\" : \"do dispositivo\"} ativado.`,\n )\n }\n />\n <ContrastPreference\n checked={preferences.highContrast}\n onChange={(highContrast) =>\n update(\n { highContrast },\n `Alto contraste ${highContrast ? \"ativado\" : \"desativado\"}.`,\n )\n }\n />\n <FontSizePreference\n value={preferences.fontScale}\n onChange={(fontScale) =>\n update({ fontScale }, \"Tamanho do texto alterado.\")\n }\n />\n <ReadingPreferences\n reduceMotion={preferences.reduceMotion}\n emphasizeFocus={preferences.emphasizeFocus}\n underlineLinks={preferences.underlineLinks}\n onChange={(changes) => {\n const key = Object.keys(changes)[0] as\n | \"reduceMotion\"\n | \"emphasizeFocus\"\n | \"underlineLinks\";\n const label =\n key === \"reduceMotion\"\n ? \"Reduzir animações\"\n : key === \"emphasizeFocus\"\n ? \"Destacar foco\"\n : \"Sublinhar links\";\n update(\n changes,\n `${label} ${changes[key] ? \"ativado\" : \"desativado\"}.`,\n );\n }}\n />\n </div>\n <div className=\"mt-5 flex justify-center border-t border-border-subtle pt-4 tablet:justify-start\">\n <button\n type=\"button\"\n onClick={() => {\n onReset?.();\n setAnnouncement(\"Configurações padrão restauradas.\");\n }}\n className=\"inline-flex min-h-11 items-center gap-2 rounded-sm border-2 border-action-primary px-4 font-bold text-content-link hover:bg-surface-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring\"\n >\n <MdRestartAlt aria-hidden=\"true\" className=\"h-5 w-5\" />\n Restaurar configurações padrão\n </button>\n </div>\n <p className=\"sr-only\" role=\"status\" aria-live=\"polite\">\n {announcement}\n </p>\n </Modal>\n </>\n );\n}\n","export type AccessibilityColorScheme = \"system\" | \"light\" | \"dark\";\nexport type AccessibilityHighContrastTheme = \"light\" | \"dark\";\nexport type AccessibilityFontScale = \"standard\" | \"large\" | \"extra-large\";\n\nexport interface AccessibilityPreferences {\n colorScheme: AccessibilityColorScheme;\n highContrast: boolean;\n highContrastTheme: AccessibilityHighContrastTheme;\n fontScale: AccessibilityFontScale;\n reduceMotion: boolean;\n emphasizeFocus: boolean;\n underlineLinks: boolean;\n}\n\nexport const DEFAULT_ACCESSIBILITY_PREFERENCES: AccessibilityPreferences = {\n colorScheme: \"light\",\n highContrast: false,\n highContrastTheme: \"light\",\n fontScale: \"standard\",\n reduceMotion: false,\n emphasizeFocus: false,\n underlineLinks: false,\n};\n","\"use client\";\n\nimport { MdContrast } from \"react-icons/md\";\n\nexport interface HighContrastToggleProps {\n checked: boolean;\n onChange: (checked: boolean) => void;\n label?: string;\n className?: string;\n}\n\nexport default function HighContrastToggle({\n checked,\n onChange,\n label = \"Alto contraste\",\n className,\n}: HighContrastToggleProps) {\n return (\n <button\n type=\"button\"\n aria-pressed={checked}\n onClick={() => onChange(!checked)}\n className={`inline-flex min-h-11 items-center justify-center gap-2 rounded-sm border-2 border-action-primary-content bg-action-primary px-3 text-sm font-bold text-action-primary-content shadow-sm hover:bg-action-primary-hover active:bg-action-primary-active focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-ring ${className ?? \"\"}`.trim()}\n >\n <MdContrast aria-hidden=\"true\" className=\"h-5 w-5\" />\n <span>{label}</span>\n <span aria-hidden=\"true\" className=\"rounded-sm bg-surface-card px-1.5 py-0.5 text-xs text-content-primary\">\n {checked ? \"Ativado\" : \"Desativado\"}\n </span>\n </button>\n );\n}\n"],"mappings":";;;;;;;AAEA,SAAgB,gBAAgB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAyCK,cAkFE,YAlFF;AAtBZ,IAAM,iBAAiB;AAAA,EACrB,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AACR;AAEA,IAAM,QAAQ,CAAC;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,UAAU;AAAA,EACV,OAAO;AACT,MAAkB;AAChB,QAAM,gBAAgB;AAAA,IACpB,SAAS;AAAA,MACP,SAAS;AAAA,MACT,MAAM,oBAAC,iBAAc,WAAU,yCAAwC;AAAA,IACzE;AAAA,IACA,OAAO;AAAA,MACL,SAAS;AAAA,MACT,MAAM,oBAAC,YAAS,WAAU,wCAAuC;AAAA,IACnE;AAAA,IACA,SAAS;AAAA,MACP,SAAS;A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;AAAA,cACA,WAAU;AAAA,cAEV;AAAA,gCAAAD,KAAC,gBAAa,eAAY,QAAO,WAAU,WAAU;AAAA,gBAAE;AAAA;AAAA;AAAA,UAEzD,GACF;AAAA,UACA,gBAAAA,KAAC,OAAE,WAAU,WAAU,MAAK,UAAS,aAAU,UAC5C,wBACH;AAAA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;;;ACzIO,IAAM,oCAA8D;AAAA,EACzE,aAAa;AAAA,EACb,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,gBAAgB;AAClB;;;ACpBA,SAAS,cAAAI,mBAAkB;AAgBvB,SAME,OAAAC,MANF,QAAAC,aAAA;AAPW,SAAR,mBAAoC;AAAA,EACzC;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AACF,GAA4B;AAC1B,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,gBAAc;AAAA,MACd,SAAS,MAAM,SAAS,CAAC,OAAO;AAAA,MAChC,WAAW,uWAAuW,gCAAa,EAAE,GAAG,KAAK;AAAA,MAEzY;AAAA,wBAAAD,KAACD,aAAA,EAAW,eAAY,QAAO,WAAU,WAAU;AAAA,QACnD,gBAAAC,KAAC,UAAM,iBAAM;AAAA,QACb,gBAAAA,KAAC,UAAK,eAAY,QAAO,WAAU,yEAChC,oBAAU,YAAY,cACzB;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["MdOutlineClose","Fragment","jsx","jsxs","MdOutlineClose","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","useState","MdAccessibilityNew","Fragment","jsx","jsxs","useState","MdAccessibilityNew","MdContrast","jsx","jsxs"]}
package/dist/core.d.ts CHANGED
@@ -305,6 +305,18 @@ interface ResolvedStatusAppearance {
305
305
  tone: StatusTone;
306
306
  appearance: StatusAppearance;
307
307
  }
308
+ /**
309
+ * Map owned by the consuming application. Keys are normalized with
310
+ * `normalizeStatus` before lookup, so accented and differently-cased labels
311
+ * can be used safely by consumers.
312
+ */
313
+ type StatusAppearanceMap = Readonly<Record<string, ResolvedStatusAppearance>>;
314
+ interface StatusResolverOptions {
315
+ map?: StatusAppearanceMap;
316
+ fallback?: ResolvedStatusAppearance;
317
+ }
318
+ declare const normalizeStatus: (status: unknown) => string;
319
+ declare const resolveStatusAppearance: (status: unknown, domain?: StatusDomain, options?: StatusResolverOptions) => ResolvedStatusAppearance;
308
320
 
309
321
  declare const SIZE_STYLES: {
310
322
  readonly sm: "min-h-5 px-1 py-0.5 text-xs";
@@ -327,8 +339,10 @@ interface DomainStatusBadgeProps extends Omit<ComponentProps<typeof StatusBadge>
327
339
  domain?: StatusDomain;
328
340
  empty?: "hide" | "placeholder";
329
341
  placeholder?: string;
342
+ /** Optional consumer-owned map for statuses specific to a product domain. */
343
+ statusMap?: StatusAppearanceMap;
330
344
  }
331
- declare function DomainStatusBadge({ status, domain, empty, placeholder, ...rest }: DomainStatusBadgeProps): React.JSX.Element | null;
345
+ declare function DomainStatusBadge({ status, domain, empty, placeholder, statusMap, ...rest }: DomainStatusBadgeProps): React.JSX.Element | null;
332
346
 
333
347
  interface SkipLinkProps {
334
348
  targetId?: string;
@@ -355,6 +369,12 @@ interface IFilterControl {
355
369
  placeholder?: string;
356
370
  }
357
371
  interface IFilterProps {
372
+ /** Stable id used to associate the popup with its trigger. */
373
+ id?: string;
374
+ /** Accessible name for the filter popup. */
375
+ accessibleName?: string;
376
+ /** Unique radio group prefix when multiple filters are rendered together. */
377
+ groupName?: string;
358
378
  optionList?: IFilterOption[];
359
379
  optionChecked?: string;
360
380
  onChange?: (value: string) => void;
@@ -478,6 +498,7 @@ declare const breakpoints: {
478
498
  tv: number;
479
499
  };
480
500
  type Breakpoint = keyof typeof breakpoints;
501
+ declare function getBreakpoint(width: number): Breakpoint;
481
502
  declare const useBreakpoint: () => Breakpoint;
482
503
 
483
504
  type ContainerBreakpointMap = Record<string, number>;
@@ -485,6 +506,7 @@ type ContainerBreakpoint = string | undefined;
485
506
  interface UseContainerBreakpointOptions {
486
507
  breakpoints?: ContainerBreakpointMap;
487
508
  }
509
+ declare function resolveContainerBreakpoint(width: number, breakpoints?: ContainerBreakpointMap): ContainerBreakpoint;
488
510
  declare function useContainerBreakpoint<TElement extends HTMLElement = HTMLElement>(ref: RefObject<TElement | null>, options?: UseContainerBreakpointOptions): ContainerBreakpoint;
489
511
 
490
- export { Avatar, type AvatarProps, type BoxProps, Button, type ButtonProps, CheckBox, type CheckBoxProps, Checkbox, type CheckboxProps, CircularLoading, type CircularLoadingProps, type ContainerBreakpoint, type ContainerBreakpointMap, Divider, DomainStatusBadge, type DomainStatusBadgeProps, FilterBar, type FilterBarProps, FocusNavigationMode, FormActions, type FormActionsProps, FormErrorNavigation, FormGrid, type FormGridProps, type IFilterControl, type IFilterOption, type IFilterProps, type IHeaderItem, type IMobileCardTableExpandableConfig, type IMobileCardTableHeader, type ITableColumnConfig, type ITableExpandableConfig, type ITablePaginationProps, IconProvider, type IconProviderProps, InfoGrid, type InfoGridProps, InfoItem, type InfoItemProps, InputSlider, type InputSliderProps, LoadingDots, MobileCardTable, type MobileCardTableProps, ModalCardView as ModalCard, type ModalCardProps, NoticeView as Notice, type OptionalValuePolicy, PageHeading, type PageHeadingBackAction, type PageHeadingProps, PageState, type PageTabItem, PageTabsHeader, PaginationView as Pagination, type PaginationProps, IconProvider as PortalIconProvider, type ResolvedStatusAppearance, SkipLink, type SkipLinkProps, Slider, type SliderProps, type StatusAppearance, StatusBadge, type StatusBadgeProps, type StatusDomain, type StatusTone, Surface, type SurfaceProps, Table, type TableDensity, type TableHeaderVariant, type TableOverflowMode, type TableProps, type TableRowVariant, TextGroup, type TextGroupProps, ThemedImage, type ThemedImageProps, Tooltip, type TooltipProps, Typography, Typography as TypographyComponent, type TypographyProps, type TypographySemanticRole, type UseContainerBreakpointOptions, breakpoints, findFirstInvalidField, getStatusBadgeClassName, useBreakpoint, useContainerBreakpoint };
512
+ export { Avatar, type AvatarProps, type BoxProps, type Breakpoint, Button, type ButtonProps, CheckBox, type CheckBoxProps, Checkbox, type CheckboxProps, CircularLoading, type CircularLoadingProps, type ContainerBreakpoint, type ContainerBreakpointMap, Divider, DomainStatusBadge, type DomainStatusBadgeProps, FilterBar, type FilterBarProps, FocusNavigationMode, FormActions, type FormActionsProps, FormErrorNavigation, FormGrid, type FormGridProps, type IFilterControl, type IFilterOption, type IFilterProps, type IHeaderItem, type IMobileCardTableExpandableConfig, type IMobileCardTableHeader, type ITableColumnConfig, type ITableExpandableConfig, type ITablePaginationProps, IconProvider, type IconProviderProps, InfoGrid, type InfoGridProps, InfoItem, type InfoItemProps, InputSlider, type InputSliderProps, LoadingDots, MobileCardTable, type MobileCardTableProps, ModalCardView as ModalCard, type ModalCardProps, NoticeView as Notice, type OptionalValuePolicy, PageHeading, type PageHeadingBackAction, type PageHeadingProps, PageState, type PageTabItem, PageTabsHeader, PaginationView as Pagination, type PaginationProps, IconProvider as PortalIconProvider, type ResolvedStatusAppearance, SkipLink, type SkipLinkProps, Slider, type SliderProps, type StatusAppearance, type StatusAppearanceMap, StatusBadge, type StatusBadgeProps, type StatusDomain, type StatusResolverOptions, type StatusTone, Surface, type SurfaceProps, Table, type TableDensity, type TableHeaderVariant, type TableOverflowMode, type TableProps, type TableRowVariant, TextGroup, type TextGroupProps, ThemedImage, type ThemedImageProps, Tooltip, type TooltipProps, Typography, Typography as TypographyComponent, type TypographyProps, type TypographySemanticRole, type UseContainerBreakpointOptions, breakpoints, findFirstInvalidField, getBreakpoint, getStatusBadgeClassName, normalizeStatus, resolveContainerBreakpoint, resolveStatusAppearance, useBreakpoint, useContainerBreakpoint };
package/dist/core.js CHANGED
@@ -34,17 +34,21 @@ import {
34
34
  Typography,
35
35
  findFirstInvalidField,
36
36
  getStatusBadgeClassName,
37
+ normalizeStatus,
38
+ resolveContainerBreakpoint,
39
+ resolveStatusAppearance,
37
40
  typography_default,
38
41
  useContainerBreakpoint
39
- } from "./chunk-PIXRKI25.js";
42
+ } from "./chunk-LTW323JQ.js";
40
43
  import {
41
44
  DocumentItem
42
45
  } from "./chunk-ATWH3MA6.js";
43
46
  import {
44
47
  Tooltip_default,
45
48
  breakpoints,
49
+ getBreakpoint,
46
50
  useBreakpoint
47
- } from "./chunk-ET2BGHTO.js";
51
+ } from "./chunk-FTRF27XF.js";
48
52
  import "./chunk-2NMEKWO5.js";
49
53
  export {
50
54
  Avatar_default as Avatar,
@@ -85,7 +89,11 @@ export {
85
89
  Typography as TypographyComponent,
86
90
  breakpoints,
87
91
  findFirstInvalidField,
92
+ getBreakpoint,
88
93
  getStatusBadgeClassName,
94
+ normalizeStatus,
95
+ resolveContainerBreakpoint,
96
+ resolveStatusAppearance,
89
97
  useBreakpoint,
90
98
  useContainerBreakpoint
91
99
  };
@@ -7,17 +7,33 @@ interface BoletoBarCodeProps {
7
7
  }
8
8
  declare function BoletoBarCode({ linhaDigitavel }: BoletoBarCodeProps): React.JSX.Element;
9
9
 
10
+ type FileValidationReason = "type" | "size" | "count";
10
11
  interface FileRejection {
11
12
  file: File;
12
- reason: "type" | "size" | "count";
13
+ reason: FileValidationReason;
13
14
  message: string;
14
15
  }
16
+ interface FileValidationOptions {
17
+ accept?: string;
18
+ multiple?: boolean;
19
+ maxFiles?: number;
20
+ maxSize?: number;
21
+ }
22
+ interface FileValidationResult {
23
+ accepted: File[];
24
+ rejected: FileRejection[];
25
+ }
26
+ declare function validateFiles(files: readonly File[] | FileList, options?: FileValidationOptions): FileValidationResult;
27
+
15
28
  interface FileDropzoneProps {
16
29
  accept?: string;
17
30
  multiple?: boolean;
18
31
  maxFiles?: number;
19
32
  maxSize?: number;
20
33
  disabled?: boolean;
34
+ id?: string;
35
+ name?: string;
36
+ required?: boolean;
21
37
  label?: ReactNode;
22
38
  hint?: ReactNode;
23
39
  error?: ReactNode;
@@ -25,7 +41,7 @@ interface FileDropzoneProps {
25
41
  onFilesAccepted?: (files: File[]) => void;
26
42
  onFilesRejected?: (rejections: FileRejection[]) => void;
27
43
  }
28
- declare function FileDropzone({ accept, multiple, maxFiles, maxSize, disabled, label, hint, error, className, onFilesAccepted, onFilesRejected, }: FileDropzoneProps): React.JSX.Element;
44
+ declare function FileDropzone({ accept, multiple, maxFiles, maxSize, disabled, id, name, required, label, hint, error, className, onFilesAccepted, onFilesRejected, }: FileDropzoneProps): React.JSX.Element;
29
45
 
30
46
  type FileUploadProgressStatus = "idle" | "uploading" | "success" | "error";
31
47
  interface FileUploadProgressProps {
@@ -52,7 +68,7 @@ interface FileListProps {
52
68
  onRetry?: (item: FileUploadItem, index: number) => void;
53
69
  className?: string;
54
70
  }
55
- declare function FileList({ files, accessibleName, onRemove, onRetry, className }: FileListProps): React.JSX.Element;
71
+ declare function FileList$1({ files, accessibleName, onRemove, onRetry, className }: FileListProps): React.JSX.Element;
56
72
 
57
73
  type FileViewerSource = string | Blob | {
58
74
  url?: string;
@@ -66,15 +82,17 @@ interface FileViewerProps {
66
82
  contentType?: string;
67
83
  loading?: boolean;
68
84
  error?: ReactNode;
85
+ onLoad?: () => void;
86
+ onError?: (error: Error) => void;
69
87
  onDownload?: () => void;
70
88
  fallback?: ReactNode;
71
89
  title?: string;
72
90
  className?: string;
73
91
  }
74
- declare function FileViewer({ source, fileName, contentType, loading, error, onDownload, fallback, title, className }: FileViewerProps): React.JSX.Element;
92
+ declare function FileViewer({ source, fileName, contentType, loading, error, onLoad, onError, onDownload, fallback, title, className, }: FileViewerProps): React.JSX.Element;
75
93
 
76
94
  type QRCodeErrorCorrectionLevel = "L" | "M" | "Q" | "H";
77
- interface QRCodeProps extends Omit<HTMLAttributes<HTMLDivElement>, "color"> {
95
+ interface QRCodeProps extends Omit<HTMLAttributes<HTMLDivElement>, "color" | "onError"> {
78
96
  value: string;
79
97
  size?: number;
80
98
  level?: QRCodeErrorCorrectionLevel;
@@ -83,7 +101,10 @@ interface QRCodeProps extends Omit<HTMLAttributes<HTMLDivElement>, "color"> {
83
101
  bgColor?: string;
84
102
  ariaLabel?: string;
85
103
  description?: string;
104
+ loading?: boolean;
105
+ error?: ReactNode;
106
+ onError?: (error: Error) => void;
86
107
  }
87
- declare function QRCode({ value, size, level, includeMargin, fgColor, bgColor, ariaLabel, description, className, ...rest }: QRCodeProps): React.JSX.Element;
108
+ declare function QRCode({ value, size, level, includeMargin, fgColor, bgColor, ariaLabel, description, loading, error, onError, className, ...rest }: QRCodeProps): React.JSX.Element;
88
109
 
89
- export { BoletoBarCode, type BoletoBarCodeProps, FileDropzone, type FileDropzoneProps, FileList, type FileListProps, type FileRejection, type FileUploadItem, type FileUploadItemStatus, FileUploadProgress, type FileUploadProgressProps, type FileUploadProgressStatus, FileViewer, type FileViewerProps, type FileViewerSource, QRCode, type QRCodeErrorCorrectionLevel, type QRCodeProps };
110
+ export { BoletoBarCode, type BoletoBarCodeProps, FileDropzone, type FileDropzoneProps, FileList$1 as FileList, type FileListProps, type FileRejection, type FileUploadItem, type FileUploadItemStatus, FileUploadProgress, type FileUploadProgressProps, type FileUploadProgressStatus, type FileValidationOptions, type FileValidationReason, type FileValidationResult, FileViewer, type FileViewerProps, type FileViewerSource, QRCode, type QRCodeErrorCorrectionLevel, type QRCodeProps, validateFiles };
package/dist/documents.js CHANGED
@@ -5,8 +5,9 @@ import {
5
5
  FileList_default,
6
6
  FileUploadProgress_default,
7
7
  FileViewer_default,
8
- QRCode_default
9
- } from "./chunk-H4BBKKRZ.js";
8
+ QRCode_default,
9
+ validateFiles
10
+ } from "./chunk-7JI5637G.js";
10
11
  import {
11
12
  DocumentItem
12
13
  } from "./chunk-ATWH3MA6.js";
@@ -18,6 +19,7 @@ export {
18
19
  FileList_default as FileList,
19
20
  FileUploadProgress_default as FileUploadProgress,
20
21
  FileViewer_default as FileViewer,
21
- QRCode_default as QRCode
22
+ QRCode_default as QRCode,
23
+ validateFiles
22
24
  };
23
25
  //# sourceMappingURL=documents.js.map
package/dist/forms.d.ts CHANGED
@@ -133,6 +133,7 @@ interface UnifiedDatePickerProps {
133
133
  placeholder?: string;
134
134
  minDate?: Date;
135
135
  maxDate?: Date;
136
+ /** @deprecated Use `disabled`. Kept as a compatibility alias. */
136
137
  isDisabled?: boolean;
137
138
  disabled?: boolean;
138
139
  name?: string;
@@ -143,6 +144,8 @@ interface UnifiedDatePickerProps {
143
144
  navigationVariant?: DatePickerNavigationVariant;
144
145
  selectionMode?: DatePickerSelectionMode;
145
146
  showAdjacentDays?: boolean;
147
+ /** Accessible name used when no visible label is provided. */
148
+ ariaLabel?: string;
146
149
  className?: string;
147
150
  }
148
151
 
package/dist/forms.js CHANGED
@@ -17,8 +17,8 @@ import {
17
17
  buildPhonePayload,
18
18
  datePicker_default,
19
19
  parsePhonePayload
20
- } from "./chunk-FR5W52XU.js";
21
- import "./chunk-ET2BGHTO.js";
20
+ } from "./chunk-LPLXAKPJ.js";
21
+ import "./chunk-FTRF27XF.js";
22
22
  import "./chunk-YCW3REQK.js";
23
23
  import "./chunk-2NMEKWO5.js";
24
24
  export {
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { Avatar, AvatarProps, BoxProps, Button, ButtonProps, CheckBox, CheckBoxProps, Checkbox, CheckboxProps, CircularLoading, CircularLoadingProps, ContainerBreakpoint, ContainerBreakpointMap, Divider, DomainStatusBadge, DomainStatusBadgeProps, FilterBar, FilterBarProps, FocusNavigationMode, FormActions, FormActionsProps, FormErrorNavigation, FormGrid, FormGridProps, IFilterControl, IFilterOption, IFilterProps, IHeaderItem, IMobileCardTableExpandableConfig, IMobileCardTableHeader, ITableColumnConfig, ITableExpandableConfig, ITablePaginationProps, IconProvider, IconProviderProps, InfoGrid, InfoGridProps, InfoItem, InfoItemProps, InputSlider, InputSliderProps, LoadingDots, MobileCardTable, MobileCardTableProps, ModalCard, ModalCardProps, Notice, OptionalValuePolicy, PageHeading, PageHeadingBackAction, PageHeadingProps, PageState, PageTabItem, PageTabsHeader, Pagination, PaginationProps, IconProvider as PortalIconProvider, ResolvedStatusAppearance, SkipLink, SkipLinkProps, Slider, SliderProps, StatusAppearance, StatusBadge, StatusBadgeProps, StatusDomain, StatusTone, Surface, SurfaceProps, Table, TableDensity, TableHeaderVariant, TableOverflowMode, TableProps, TableRowVariant, TextGroup, TextGroupProps, ThemedImage, ThemedImageProps, Tooltip, TooltipProps, Typography, Typography as TypographyComponent, TypographyProps, TypographySemanticRole, UseContainerBreakpointOptions, breakpoints, findFirstInvalidField, getStatusBadgeClassName, useBreakpoint, useContainerBreakpoint } from './core.js';
2
- export { AccessibilityColorScheme, AccessibilityFontScale, AccessibilityHighContrastTheme, AccessibilityPreferences, AccessibilityPreferencesPanel, AccessibilityPreferencesPanelProps, DEFAULT_ACCESSIBILITY_PREFERENCES, HighContrastToggle, HighContrastToggleProps, InputSwitch, InputSwitchProps, Modal, ModalProps } from './overlays.js';
1
+ export { Avatar, AvatarProps, BoxProps, Breakpoint, Button, ButtonProps, CheckBox, CheckBoxProps, Checkbox, CheckboxProps, CircularLoading, CircularLoadingProps, ContainerBreakpoint, ContainerBreakpointMap, Divider, DomainStatusBadge, DomainStatusBadgeProps, FilterBar, FilterBarProps, FocusNavigationMode, FormActions, FormActionsProps, FormErrorNavigation, FormGrid, FormGridProps, IFilterControl, IFilterOption, IFilterProps, IHeaderItem, IMobileCardTableExpandableConfig, IMobileCardTableHeader, ITableColumnConfig, ITableExpandableConfig, ITablePaginationProps, IconProvider, IconProviderProps, InfoGrid, InfoGridProps, InfoItem, InfoItemProps, InputSlider, InputSliderProps, LoadingDots, MobileCardTable, MobileCardTableProps, ModalCard, ModalCardProps, Notice, OptionalValuePolicy, PageHeading, PageHeadingBackAction, PageHeadingProps, PageState, PageTabItem, PageTabsHeader, Pagination, PaginationProps, IconProvider as PortalIconProvider, ResolvedStatusAppearance, SkipLink, SkipLinkProps, Slider, SliderProps, StatusAppearance, StatusAppearanceMap, StatusBadge, StatusBadgeProps, StatusDomain, StatusResolverOptions, StatusTone, Surface, SurfaceProps, Table, TableDensity, TableHeaderVariant, TableOverflowMode, TableProps, TableRowVariant, TextGroup, TextGroupProps, ThemedImage, ThemedImageProps, Tooltip, TooltipProps, Typography, Typography as TypographyComponent, TypographyProps, TypographySemanticRole, UseContainerBreakpointOptions, breakpoints, findFirstInvalidField, getBreakpoint, getStatusBadgeClassName, normalizeStatus, resolveContainerBreakpoint, resolveStatusAppearance, useBreakpoint, useContainerBreakpoint } from './core.js';
2
+ export { AccessibilityColorScheme, AccessibilityFontScale, AccessibilityHighContrastTheme, AccessibilityPreferences, AccessibilityPreferencesPanel, AccessibilityPreferencesPanelProps, ContrastPreference, ContrastPreferenceProps, DEFAULT_ACCESSIBILITY_PREFERENCES, FontSizePreference, FontSizePreferenceProps, HighContrastToggle, HighContrastToggleProps, InputSwitch, InputSwitchProps, Modal, ModalProps, ReadingPreferences, ReadingPreferencesProps, ThemePreference, ThemePreferenceProps } from './overlays.js';
3
3
  export { CountrySelect, CountrySelectOption, CountrySelectProps, DatePicker, DatePickerNavigationVariant, DatePickerProps, DatePickerSelectionMode, Datepicker, DatepickerNavigationVariant, DatepickerProps, Input, InputPhone, InputPhoneCountryOption, InputPhoneProps, InputPhoneValue, InputProps, InputSelect, InputSelectOption, InputSelectProps, InputStandalone, InputStandaloneProps, MultiSelect, MultiSelectOption, MultiSelectProps, MultiSelectViewProps, OtpCodeInput, OtpCodeInputHandle, OtpCodeInputMask, OtpCodeInputProps, PhoneCountryOption, PhoneInput, PhoneInputProps, PhoneValue, RadioCardGroup, RadioCardGroupProps, RadioCardOption, RadioGroup, RadioGroupProps, SelectCountry, SelectCountryOption, SelectCountryProps, SelectMulti, SelectMultiOption, SelectMultiProps, SelectMultiViewProps, TextArea, TextAreaProps, buildPhonePayload, parsePhonePayload } from './forms.js';
4
- export { BoletoBarCode, BoletoBarCodeProps, FileDropzone, FileDropzoneProps, FileList, FileListProps, FileRejection, FileUploadItem, FileUploadItemStatus, FileUploadProgress, FileUploadProgressProps, FileUploadProgressStatus, FileViewer, FileViewerProps, FileViewerSource, QRCode, QRCodeErrorCorrectionLevel, QRCodeProps } from './documents.js';
4
+ export { BoletoBarCode, BoletoBarCodeProps, FileDropzone, FileDropzoneProps, FileList, FileListProps, FileRejection, FileUploadItem, FileUploadItemStatus, FileUploadProgress, FileUploadProgressProps, FileUploadProgressStatus, FileValidationOptions, FileValidationReason, FileValidationResult, FileViewer, FileViewerProps, FileViewerSource, QRCode, QRCodeErrorCorrectionLevel, QRCodeProps, validateFiles } from './documents.js';
5
5
  export { D as DocumentItem, a as DocumentItemDetail, b as DocumentItemProps } from './DocumentItem-BU0J2QGP.js';
6
6
  export { CountryListFilter, CountryListMode } from './countries.js';
7
7
  export { ApexChartProps, InteractiveDonutChart, InteractiveDonutOptions, InteractiveDonutProps, LazyApexChart, TimeRangeSelector, TimeRangeSelectorProps, TimeSeriesChart, TimeSeriesChartOptions, TimeSeriesChartProps, TimeSeriesTooltipRow, buildTimeSeriesTooltip, escapeDonutTooltipText, escapeTimeSeriesTooltipText, getChartSeriesRecord, getChartTheme, normalizeTimeSeriesTooltipColor, resolveInteractiveDonutColors, resolveRelativeDonutSelection } from './charts.js';
package/dist/index.js CHANGED
@@ -48,17 +48,21 @@ import {
48
48
  Typography,
49
49
  findFirstInvalidField,
50
50
  getStatusBadgeClassName,
51
+ normalizeStatus,
52
+ resolveContainerBreakpoint,
53
+ resolveStatusAppearance,
51
54
  typography_default,
52
55
  useContainerBreakpoint
53
- } from "./chunk-PIXRKI25.js";
56
+ } from "./chunk-LTW323JQ.js";
54
57
  import {
55
58
  BoletoBarCode,
56
59
  FileDropzone_default,
57
60
  FileList_default,
58
61
  FileUploadProgress_default,
59
62
  FileViewer_default,
60
- QRCode_default
61
- } from "./chunk-H4BBKKRZ.js";
63
+ QRCode_default,
64
+ validateFiles
65
+ } from "./chunk-7JI5637G.js";
62
66
  import {
63
67
  DocumentItem
64
68
  } from "./chunk-ATWH3MA6.js";
@@ -80,20 +84,25 @@ import {
80
84
  buildPhonePayload,
81
85
  datePicker_default,
82
86
  parsePhonePayload
83
- } from "./chunk-FR5W52XU.js";
87
+ } from "./chunk-LPLXAKPJ.js";
84
88
  import {
85
89
  Tooltip_default,
86
90
  breakpoints,
91
+ getBreakpoint,
87
92
  useBreakpoint
88
- } from "./chunk-ET2BGHTO.js";
93
+ } from "./chunk-FTRF27XF.js";
89
94
  import "./chunk-YCW3REQK.js";
90
95
  import {
91
96
  AccessibilityPreferencesPanel,
97
+ ContrastPreference,
92
98
  DEFAULT_ACCESSIBILITY_PREFERENCES,
99
+ FontSizePreference,
93
100
  HighContrastToggle,
94
101
  InputSwitch_default,
95
- Modal_default
96
- } from "./chunk-JSPXVXUY.js";
102
+ Modal_default,
103
+ ReadingPreferences,
104
+ ThemePreference
105
+ } from "./chunk-WOD44OEH.js";
97
106
  import "./chunk-2NMEKWO5.js";
98
107
  export {
99
108
  AccessibilityPreferencesPanel,
@@ -103,6 +112,7 @@ export {
103
112
  CheckBox,
104
113
  Checkbox,
105
114
  CircularLoading,
115
+ ContrastPreference,
106
116
  CountrySelect,
107
117
  DEFAULT_ACCESSIBILITY_PREFERENCES,
108
118
  datePicker_default as DatePicker,
@@ -116,6 +126,7 @@ export {
116
126
  FileViewer_default as FileViewer,
117
127
  FilterBar,
118
128
  FocusNavigationMode,
129
+ FontSizePreference,
119
130
  FormActions,
120
131
  FormErrorNavigation,
121
132
  FormGrid,
@@ -147,6 +158,7 @@ export {
147
158
  QRCode_default as QRCode,
148
159
  RadioCardGroup,
149
160
  RadioGroup,
161
+ ReadingPreferences,
150
162
  SelectCountry_default as SelectCountry,
151
163
  SelectMulti_default as SelectMulti,
152
164
  SkipLink,
@@ -156,6 +168,7 @@ export {
156
168
  Table_default as Table,
157
169
  TextArea_default as TextArea,
158
170
  TextGroup,
171
+ ThemePreference,
159
172
  ThemedImage,
160
173
  TimeRangeSelector,
161
174
  TimeSeriesChart,
@@ -168,14 +181,19 @@ export {
168
181
  escapeDonutTooltipText,
169
182
  escapeTimeSeriesTooltipText,
170
183
  findFirstInvalidField,
184
+ getBreakpoint,
171
185
  getChartSeriesRecord,
172
186
  getChartTheme,
173
187
  getStatusBadgeClassName,
188
+ normalizeStatus,
174
189
  normalizeTimeSeriesTooltipColor,
175
190
  parsePhonePayload,
191
+ resolveContainerBreakpoint,
176
192
  resolveInteractiveDonutColors,
177
193
  resolveRelativeDonutSelection,
194
+ resolveStatusAppearance,
178
195
  useBreakpoint,
179
- useContainerBreakpoint
196
+ useContainerBreakpoint,
197
+ validateFiles
180
198
  };
181
199
  //# sourceMappingURL=index.js.map
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@aspprev/versi-ds",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "files": [
5
5
  "DocumentItem-BU0J2QGP.d.ts",
6
6
  "charts.d.ts",
7
7
  "charts.js",
8
8
  "chunk-2NMEKWO5.js",
9
+ "chunk-7JI5637G.js",
9
10
  "chunk-ATWH3MA6.js",
10
- "chunk-ET2BGHTO.js",
11
- "chunk-FR5W52XU.js",
12
- "chunk-H4BBKKRZ.js",
13
- "chunk-JSPXVXUY.js",
14
- "chunk-PIXRKI25.js",
11
+ "chunk-FTRF27XF.js",
12
+ "chunk-LPLXAKPJ.js",
13
+ "chunk-LTW323JQ.js",
15
14
  "chunk-V66QL3TD.js",
15
+ "chunk-WOD44OEH.js",
16
16
  "chunk-YCW3REQK.js",
17
17
  "core.d.ts",
18
18
  "core.js",
@@ -21,7 +21,7 @@ type NativeSwitchProps = {
21
21
  form?: string;
22
22
  autoFocus?: boolean;
23
23
  tabIndex?: number;
24
- } & ({
24
+ } & React__default.AriaAttributes & ({
25
25
  "aria-label": string;
26
26
  "aria-labelledby"?: never;
27
27
  } | {
@@ -52,6 +52,7 @@ interface AccessibilityPreferences {
52
52
  underlineLinks: boolean;
53
53
  }
54
54
  declare const DEFAULT_ACCESSIBILITY_PREFERENCES: AccessibilityPreferences;
55
+
55
56
  type AccessibilityPreferencesPanelProps = {
56
57
  preferences: AccessibilityPreferences;
57
58
  onPreferencesChange: (changes: Partial<AccessibilityPreferences>) => void;
@@ -64,6 +65,34 @@ type AccessibilityPreferencesPanelProps = {
64
65
  };
65
66
  declare function AccessibilityPreferencesPanel({ preferences, onPreferencesChange, onReset, isOpen: controlledOpen, onOpenChange, showTrigger, triggerLabel, className, }: AccessibilityPreferencesPanelProps): React.JSX.Element;
66
67
 
68
+ type ContrastPreferenceProps = {
69
+ checked: boolean;
70
+ onChange: (checked: boolean) => void;
71
+ className?: string;
72
+ };
73
+ declare function ContrastPreference({ checked, onChange, className, }: ContrastPreferenceProps): React.JSX.Element;
74
+
75
+ type FontSizePreferenceProps = {
76
+ value: AccessibilityFontScale;
77
+ onChange: (value: AccessibilityFontScale) => void;
78
+ className?: string;
79
+ };
80
+ declare function FontSizePreference({ value, onChange, className, }: FontSizePreferenceProps): React.JSX.Element;
81
+
82
+ type ReadingPreferenceKey = "reduceMotion" | "emphasizeFocus" | "underlineLinks";
83
+ type ReadingPreferencesProps = Pick<AccessibilityPreferences, ReadingPreferenceKey> & {
84
+ onChange: (changes: Partial<Pick<AccessibilityPreferences, ReadingPreferenceKey>>) => void;
85
+ className?: string;
86
+ };
87
+ declare function ReadingPreferences({ reduceMotion, emphasizeFocus, underlineLinks, onChange, className, }: ReadingPreferencesProps): React.JSX.Element;
88
+
89
+ type ThemePreferenceProps = {
90
+ value: AccessibilityColorScheme;
91
+ onChange: (value: AccessibilityColorScheme) => void;
92
+ className?: string;
93
+ };
94
+ declare function ThemePreference({ value, onChange, className, }: ThemePreferenceProps): React.JSX.Element;
95
+
67
96
  interface HighContrastToggleProps {
68
97
  checked: boolean;
69
98
  onChange: (checked: boolean) => void;
@@ -72,4 +101,4 @@ interface HighContrastToggleProps {
72
101
  }
73
102
  declare function HighContrastToggle({ checked, onChange, label, className, }: HighContrastToggleProps): React.JSX.Element;
74
103
 
75
- export { type AccessibilityColorScheme, type AccessibilityFontScale, type AccessibilityHighContrastTheme, type AccessibilityPreferences, AccessibilityPreferencesPanel, type AccessibilityPreferencesPanelProps, DEFAULT_ACCESSIBILITY_PREFERENCES, HighContrastToggle, type HighContrastToggleProps, InputSwitch, type InputSwitchProps, Modal, type ModalProps };
104
+ export { type AccessibilityColorScheme, type AccessibilityFontScale, type AccessibilityHighContrastTheme, type AccessibilityPreferences, AccessibilityPreferencesPanel, type AccessibilityPreferencesPanelProps, ContrastPreference, type ContrastPreferenceProps, DEFAULT_ACCESSIBILITY_PREFERENCES, FontSizePreference, type FontSizePreferenceProps, HighContrastToggle, type HighContrastToggleProps, InputSwitch, type InputSwitchProps, Modal, type ModalProps, ReadingPreferences, type ReadingPreferencesProps, ThemePreference, type ThemePreferenceProps };
package/dist/overlays.js CHANGED
@@ -1,17 +1,25 @@
1
1
  "use client";
2
2
  import {
3
3
  AccessibilityPreferencesPanel,
4
+ ContrastPreference,
4
5
  DEFAULT_ACCESSIBILITY_PREFERENCES,
6
+ FontSizePreference,
5
7
  HighContrastToggle,
6
8
  InputSwitch_default,
7
- Modal_default
8
- } from "./chunk-JSPXVXUY.js";
9
+ Modal_default,
10
+ ReadingPreferences,
11
+ ThemePreference
12
+ } from "./chunk-WOD44OEH.js";
9
13
  import "./chunk-2NMEKWO5.js";
10
14
  export {
11
15
  AccessibilityPreferencesPanel,
16
+ ContrastPreference,
12
17
  DEFAULT_ACCESSIBILITY_PREFERENCES,
18
+ FontSizePreference,
13
19
  HighContrastToggle,
14
20
  InputSwitch_default as InputSwitch,
15
- Modal_default as Modal
21
+ Modal_default as Modal,
22
+ ReadingPreferences,
23
+ ThemePreference
16
24
  };
17
25
  //# sourceMappingURL=overlays.js.map