@adatechnology/notification-ui 0.1.0-rc.1 → 0.1.0-rc.2

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.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/NotificationProvider.tsx","../src/locales/pt-BR.json","../src/locales/en.json","../src/locales/index.ts","../src/hooks/useNotifications.ts","../src/hooks/queryKeys.ts","../src/hooks/useNotificationStream.ts","../src/hooks/usePreferences.ts","../src/components/NotificationBell.tsx","../src/components/NotificationList.tsx","../src/components/NotificationItem.tsx","../src/components/PreferencesPanel.tsx"],"sourcesContent":["/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n *\n * Provider do pacote. **Não instancia `QueryClient`** — usa o do host (regra de módulos\n * plugáveis §4.2). Instanciar o próprio criaria dois caches na mesma página: a inbox invalidaria\n * um, e a tela do produto continuaria lendo o outro.\n */\n\nimport { createContext, useContext, useMemo, type ReactNode } from 'react'\nimport type { NotificationClient } from '@adatechnology/notification-client'\n\nimport { DEFAULT_LOCALE, resolveMessages, type NotificationLocale, type NotificationMessages } from './locales'\n\nexport type NotificationTheme = {\n /** Classe aplicada na raiz de cada componente — é por onde o host injeta os tokens dele. */\n readonly rootClassName?: string\n readonly components?: Partial<Record<string, string>>\n}\n\nexport type NotificationContextValue = {\n readonly client: NotificationClient\n readonly messages: NotificationMessages\n readonly theme: NotificationTheme\n /** Polling de fallback quando o SSE não está disponível (segundos); `0` desliga. */\n readonly pollIntervalSeconds: number\n}\n\nconst NotificationContext = createContext<NotificationContextValue | null>(null)\n\nexport type NotificationProviderProps = {\n readonly client: NotificationClient\n readonly locale?: NotificationLocale\n /** Sobrescreve textos pontuais sem trocar o locale inteiro. */\n readonly messageOverrides?: Partial<NotificationMessages>\n readonly theme?: NotificationTheme\n readonly pollIntervalSeconds?: number\n readonly children: ReactNode\n}\n\nexport function NotificationProvider({\n client,\n locale = DEFAULT_LOCALE,\n messageOverrides,\n theme = {},\n pollIntervalSeconds = 60,\n children,\n}: NotificationProviderProps) {\n const value = useMemo<NotificationContextValue>(\n () => ({\n client,\n messages: { ...resolveMessages(locale), ...messageOverrides },\n theme,\n pollIntervalSeconds,\n }),\n [client, locale, messageOverrides, theme, pollIntervalSeconds],\n )\n\n return <NotificationContext.Provider value={value}>{children}</NotificationContext.Provider>\n}\n\nexport function useNotificationContext(): NotificationContextValue {\n const context = useContext(NotificationContext)\n if (!context) throw new Error('notification-ui: componente usado fora de <NotificationProvider>')\n return context\n}\n","{\n \"bell.label\": \"Notificações\",\n \"bell.unreadSuffix\": \"não lidas\",\n \"list.title\": \"Notificações\",\n \"list.empty\": \"Nenhuma notificação por aqui.\",\n \"list.loading\": \"Carregando…\",\n \"list.error\": \"Não foi possível carregar suas notificações.\",\n \"list.retry\": \"Tentar de novo\",\n \"list.loadMore\": \"Carregar mais\",\n \"list.markAllAsRead\": \"Marcar todas como lidas\",\n \"item.markAsRead\": \"Marcar como lida\",\n \"item.delete\": \"Excluir\",\n \"item.unread\": \"Não lida\",\n \"preferences.title\": \"Preferências de notificação\",\n \"preferences.description\": \"Escolha por onde você quer ser avisado em cada assunto.\",\n \"preferences.save\": \"Salvar preferências\",\n \"preferences.saved\": \"Preferências salvas.\",\n \"preferences.error\": \"Não foi possível salvar. Tente de novo.\",\n \"preferences.empty\": \"Nenhuma preferência configurada ainda.\",\n \"preferences.quietHours\": \"Silêncio entre\",\n \"preferences.quietHoursTo\": \"e\",\n \"channel.inbox\": \"No app\",\n \"channel.push\": \"Push\",\n \"channel.email\": \"E-mail\",\n \"channel.whatsapp\": \"WhatsApp\",\n \"channel.sms\": \"SMS\"\n}\n","{\n \"bell.label\": \"Notifications\",\n \"bell.unreadSuffix\": \"unread\",\n \"list.title\": \"Notifications\",\n \"list.empty\": \"Nothing here yet.\",\n \"list.loading\": \"Loading…\",\n \"list.error\": \"We couldn't load your notifications.\",\n \"list.retry\": \"Try again\",\n \"list.loadMore\": \"Load more\",\n \"list.markAllAsRead\": \"Mark all as read\",\n \"item.markAsRead\": \"Mark as read\",\n \"item.delete\": \"Delete\",\n \"item.unread\": \"Unread\",\n \"preferences.title\": \"Notification preferences\",\n \"preferences.description\": \"Choose how you want to be notified about each topic.\",\n \"preferences.save\": \"Save preferences\",\n \"preferences.saved\": \"Preferences saved.\",\n \"preferences.error\": \"Couldn't save. Try again.\",\n \"preferences.empty\": \"No preferences configured yet.\",\n \"preferences.quietHours\": \"Quiet between\",\n \"preferences.quietHoursTo\": \"and\",\n \"channel.inbox\": \"In app\",\n \"channel.push\": \"Push\",\n \"channel.email\": \"Email\",\n \"channel.whatsapp\": \"WhatsApp\",\n \"channel.sms\": \"SMS\"\n}\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n *\n * Nenhum texto visível vive em tag ou prop (`web.md` §6). O host sobrescreve chaves pontuais via\n * `messageOverrides` sem precisar fornecer um locale inteiro.\n */\n\nimport ptBR from './pt-BR.json'\nimport en from './en.json'\n\nexport type NotificationMessages = typeof ptBR\nexport type NotificationLocale = 'pt-BR' | 'en'\n\nexport const DEFAULT_LOCALE: NotificationLocale = 'pt-BR'\n\nconst MESSAGES_BY_LOCALE: Record<NotificationLocale, NotificationMessages> = {\n 'pt-BR': ptBR,\n en: en as NotificationMessages,\n}\n\nexport function resolveMessages(locale: NotificationLocale): NotificationMessages {\n return MESSAGES_BY_LOCALE[locale] ?? MESSAGES_BY_LOCALE[DEFAULT_LOCALE]\n}\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n *\n * Camada headless — a válvula de escape do item 4 da §4 da regra de módulos plugáveis: quando a\n * tela default não serve, o produto monta a própria sobre estes mesmos hooks e continua herdando\n * upgrades de lógica.\n */\n\nimport { useInfiniteQuery, useMutation, useQuery, useQueryClient } from '@tanstack/react-query'\nimport type { NotificationSummary } from '@adatechnology/notification-contracts'\n\nimport { useNotificationContext } from '../NotificationProvider'\nimport { NOTIFICATION_QUERY_KEYS } from './queryKeys'\n\nexport type UseNotificationsOptions = {\n readonly category?: string\n readonly read?: boolean\n readonly perPage?: number\n}\n\nexport function useNotifications(options: UseNotificationsOptions = {}) {\n const { client } = useNotificationContext()\n\n return useInfiniteQuery({\n queryKey: NOTIFICATION_QUERY_KEYS.list({ category: options.category, read: options.read }),\n initialPageParam: undefined as string | undefined,\n queryFn: ({ pageParam }) =>\n client.listNotifications({\n category: options.category,\n read: options.read,\n cursor: pageParam,\n perPage: options.perPage,\n }),\n getNextPageParam: (lastPage) => lastPage.nextCursor,\n })\n}\n\nexport function useUnreadCount() {\n const { client, pollIntervalSeconds } = useNotificationContext()\n\n return useQuery({\n queryKey: NOTIFICATION_QUERY_KEYS.unreadCount(),\n queryFn: () => client.countUnread(),\n // Polling é o fallback de quem não ligou o SSE. Com o stream ativo,\n // `useNotificationStream` invalida esta chave e o refetch acontece na hora.\n refetchInterval: pollIntervalSeconds > 0 ? pollIntervalSeconds * 1000 : false,\n })\n}\n\nexport function useMarkAsRead() {\n const { client } = useNotificationContext()\n const queryClient = useQueryClient()\n\n return useMutation({\n mutationFn: (id: string) => client.markAsRead(id),\n async onMutate(id: string) {\n // Atualização otimista: marcar como lida é ação de um clique, e esperar o round-trip para\n // o badge cair faz a interface parecer travada.\n await queryClient.cancelQueries({ queryKey: NOTIFICATION_QUERY_KEYS.all })\n const previousCount = queryClient.getQueryData<number>(NOTIFICATION_QUERY_KEYS.unreadCount())\n\n queryClient.setQueryData<number>(NOTIFICATION_QUERY_KEYS.unreadCount(), (current) =>\n current === undefined ? current : Math.max(0, current - 1),\n )\n return { previousCount, id }\n },\n onError(_error, _id, context) {\n // Rollback: sem isto o badge ficaria mentindo até o próximo refetch.\n if (context?.previousCount !== undefined) {\n queryClient.setQueryData(NOTIFICATION_QUERY_KEYS.unreadCount(), context.previousCount)\n }\n },\n onSettled() {\n void queryClient.invalidateQueries({ queryKey: NOTIFICATION_QUERY_KEYS.all })\n },\n })\n}\n\nexport function useMarkAllAsRead() {\n const { client } = useNotificationContext()\n const queryClient = useQueryClient()\n\n return useMutation({\n mutationFn: () => client.markAllAsRead(),\n onSettled() {\n void queryClient.invalidateQueries({ queryKey: NOTIFICATION_QUERY_KEYS.all })\n },\n })\n}\n\nexport function useDeleteNotification() {\n const { client } = useNotificationContext()\n const queryClient = useQueryClient()\n\n return useMutation({\n mutationFn: (id: string) => client.deleteNotification(id),\n onSettled() {\n void queryClient.invalidateQueries({ queryKey: NOTIFICATION_QUERY_KEYS.all })\n },\n })\n}\n\n/** Achata as páginas do infinite query — a lista quase sempre quer o array direto. */\nexport function flattenNotificationPages(\n pages: readonly { data: readonly NotificationSummary[] }[] | undefined,\n): readonly NotificationSummary[] {\n return pages?.flatMap((page) => page.data) ?? []\n}\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n *\n * Chaves centralizadas: o sino e a lista leem o mesmo `unreadCount`, e uma invalidação precisa\n * atingir os dois. Chave montada inline em cada hook é como badge e lista passam a mostrar\n * números diferentes.\n */\n\nexport const NOTIFICATION_QUERY_KEYS = {\n all: ['notifications'] as const,\n list: (filters: { category?: string; read?: boolean }) => ['notifications', 'list', filters] as const,\n unreadCount: () => ['notifications', 'unread-count'] as const,\n preferences: () => ['notifications', 'preferences'] as const,\n templates: () => ['notifications', 'templates'] as const,\n} as const\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n */\n\nimport { useEffect } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { subscribeToNotificationStream } from '@adatechnology/notification-client'\n\nimport { useNotificationContext } from '../NotificationProvider'\nimport { NOTIFICATION_QUERY_KEYS } from './queryKeys'\n\nexport type UseNotificationStreamOptions = {\n /** Desligado por omissão: abrir SSE é decisão do host, que sabe se o backend expõe a rota. */\n readonly enabled?: boolean\n readonly onEvent?: (event: { event: string; data: unknown }) => void\n}\n\n/**\n * Liga o SSE do inbox ao cache do TanStack: cada evento invalida as chaves, e o badge e a lista\n * atualizam juntos. `useEffect` aqui é o uso correto do hook — sincronizar com um sistema externo\n * (`react.md`, \"useEffect só para sincronizar com sistemas externos\"), não transformar dado.\n */\nexport function useNotificationStream(options: UseNotificationStreamOptions = {}): void {\n const { client } = useNotificationContext()\n const queryClient = useQueryClient()\n const enabled = options.enabled ?? false\n const onEvent = options.onEvent\n\n useEffect(() => {\n if (!enabled) return\n\n let subscription: { close(): void } | undefined\n let cancelled = false\n\n void client.resolveStreamRequest().then(({ url, headers }) => {\n // A resolução do token é assíncrona; se o componente desmontou nesse meio-tempo, não abre\n // conexão nenhuma — senão sobraria um stream órfão a cada navegação rápida.\n if (cancelled) return\n\n subscription = subscribeToNotificationStream({\n url,\n headers,\n onEvent: (event) => {\n onEvent?.(event)\n void queryClient.invalidateQueries({ queryKey: NOTIFICATION_QUERY_KEYS.all })\n },\n })\n })\n\n return () => {\n cancelled = true\n subscription?.close()\n }\n }, [client, queryClient, enabled, onEvent])\n}\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'\nimport type { NotificationPreference } from '@adatechnology/notification-contracts'\n\nimport { useNotificationContext } from '../NotificationProvider'\nimport { NOTIFICATION_QUERY_KEYS } from './queryKeys'\n\nexport function usePreferences() {\n const { client } = useNotificationContext()\n\n return useQuery({\n queryKey: NOTIFICATION_QUERY_KEYS.preferences(),\n queryFn: () => client.getPreferences(),\n })\n}\n\nexport function useUpdatePreferences() {\n const { client } = useNotificationContext()\n const queryClient = useQueryClient()\n\n return useMutation({\n mutationFn: (preferences: readonly NotificationPreference[]) => client.updatePreferences(preferences),\n onSuccess(saved) {\n // A resposta já é o estado persistido — usar direto evita um refetch e o piscar do painel\n // entre o valor otimista e o confirmado.\n queryClient.setQueryData(NOTIFICATION_QUERY_KEYS.preferences(), saved)\n },\n })\n}\n\nexport function useTemplates() {\n const { client } = useNotificationContext()\n\n return useQuery({\n queryKey: NOTIFICATION_QUERY_KEYS.templates(),\n queryFn: () => client.listTemplates(),\n })\n}\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n */\n\nimport { Bell } from 'lucide-react'\nimport clsx from 'clsx'\n\nimport { useNotificationContext } from '../NotificationProvider'\nimport { useUnreadCount } from '../hooks/useNotifications'\n\nexport type NotificationBellProps = {\n readonly onClick?: () => void\n readonly className?: string\n /** Acima disso o badge mostra `99+`; um número de 4 dígitos estoura o desenho do badge. */\n readonly maxBadgeCount?: number\n}\n\nconst DEFAULT_MAX_BADGE_COUNT = 99\n\nexport function NotificationBell({ onClick, className, maxBadgeCount = DEFAULT_MAX_BADGE_COUNT }: NotificationBellProps) {\n const { messages, theme } = useNotificationContext()\n const { data: unreadCount = 0 } = useUnreadCount()\n\n const hasUnread = unreadCount > 0\n const badgeLabel = unreadCount > maxBadgeCount ? `${maxBadgeCount}+` : String(unreadCount)\n const accessibleLabel = hasUnread\n ? `${messages['bell.label']}: ${unreadCount} ${messages['bell.unreadSuffix']}`\n : messages['bell.label']\n\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={clsx('adn-bell', theme.rootClassName, className)}\n // Botão só-ícone exige rótulo acessível (regra de ícones, `web.md` §9).\n aria-label={accessibleLabel}\n >\n {/* Decorativo: o rótulo acessível já está no botão, e anunciar o ícone repetiria a ação. */}\n <Bell className=\"adn-bell__icon\" aria-hidden=\"true\" />\n {hasUnread ? (\n // `aria-live` para leitor de tela anunciar a mudança do contador sem o usuário reabrir\n // o menu; `polite` porque notificação nova não deve interromper o que ele está lendo.\n <span className=\"adn-bell__badge\" aria-live=\"polite\">\n {badgeLabel}\n </span>\n ) : null}\n </button>\n )\n}\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n */\n\nimport { CheckCheck, Inbox, RotateCw } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { NotificationSummary } from '@adatechnology/notification-contracts'\n\nimport { useNotificationContext } from '../NotificationProvider'\nimport { flattenNotificationPages, useMarkAllAsRead, useNotifications, useUnreadCount } from '../hooks/useNotifications'\nimport { NotificationItem } from './NotificationItem'\n\nexport type NotificationListProps = {\n readonly category?: string\n readonly onSelect?: (notification: NotificationSummary) => void\n readonly className?: string\n /** Slot: o host troca a linha sem reimplementar a lista (regra §4.3, slots e overrides). */\n readonly components?: { readonly Item?: typeof NotificationItem }\n}\n\nexport function NotificationList({ category, onSelect, className, components }: NotificationListProps) {\n const { messages, theme } = useNotificationContext()\n const query = useNotifications({ category })\n const { data: unreadCount = 0 } = useUnreadCount()\n const markAllAsRead = useMarkAllAsRead()\n\n const Item = components?.Item ?? NotificationItem\n const notifications = flattenNotificationPages(query.data?.pages)\n\n return (\n <section className={clsx('adn-list', theme.rootClassName, className)} aria-label={messages['list.title']}>\n <header className=\"adn-list__header\">\n <h2 className=\"adn-list__title\">{messages['list.title']}</h2>\n {unreadCount > 0 ? (\n <button\n type=\"button\"\n className=\"adn-list__bulk-action\"\n onClick={() => markAllAsRead.mutate()}\n disabled={markAllAsRead.isPending}\n >\n <CheckCheck className=\"adn-list__bulk-icon\" aria-hidden=\"true\" />\n {messages['list.markAllAsRead']}\n </button>\n ) : null}\n </header>\n\n {query.isPending ? <p className=\"adn-list__state\">{messages['list.loading']}</p> : null}\n\n {query.isError ? (\n <div className=\"adn-list__state adn-list__state--error\">\n <p>{messages['list.error']}</p>\n <button type=\"button\" className=\"adn-list__retry\" onClick={() => void query.refetch()}>\n <RotateCw className=\"adn-list__retry-icon\" aria-hidden=\"true\" />\n {messages['list.retry']}\n </button>\n </div>\n ) : null}\n\n {!query.isPending && !query.isError && notifications.length === 0 ? (\n <div className=\"adn-list__state adn-list__state--empty\">\n <Inbox className=\"adn-list__empty-icon\" aria-hidden=\"true\" />\n <p>{messages['list.empty']}</p>\n </div>\n ) : null}\n\n {notifications.length > 0 ? (\n <ul className=\"adn-list__items\">\n {notifications.map((notification) => (\n <Item key={notification.id} notification={notification} onSelect={onSelect} />\n ))}\n </ul>\n ) : null}\n\n {query.hasNextPage ? (\n <button\n type=\"button\"\n className=\"adn-list__load-more\"\n onClick={() => void query.fetchNextPage()}\n disabled={query.isFetchingNextPage}\n >\n {messages['list.loadMore']}\n </button>\n ) : null}\n </section>\n )\n}\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n */\n\nimport { Check, Trash2 } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { NotificationSummary } from '@adatechnology/notification-contracts'\n\nimport { useNotificationContext } from '../NotificationProvider'\nimport { useDeleteNotification, useMarkAsRead } from '../hooks/useNotifications'\n\nexport type NotificationItemProps = {\n readonly notification: NotificationSummary\n readonly onSelect?: (notification: NotificationSummary) => void\n readonly className?: string\n}\n\nexport function NotificationItem({ notification, onSelect, className }: NotificationItemProps) {\n const { messages } = useNotificationContext()\n const markAsRead = useMarkAsRead()\n const deleteNotification = useDeleteNotification()\n\n const isUnread = notification.readAt === undefined\n\n function handleSelect(): void {\n if (isUnread) markAsRead.mutate(notification.id)\n onSelect?.(notification)\n }\n\n return (\n <li className={clsx('adn-item', isUnread && 'adn-item--unread', className)}>\n {/* Semântico: a linha inteira é clicável e precisa ser alcançável por teclado — `button`\n entrega Enter, Espaço e foco de graça, e um `div` com onClick não (web.md §Acessibilidade). */}\n <button type=\"button\" className=\"adn-item__main\" onClick={handleSelect}>\n <span className=\"adn-item__title\">{notification.title}</span>\n <span className=\"adn-item__body\">{notification.body}</span>\n {isUnread ? <span className=\"adn-item__unread-dot\" aria-label={messages['item.unread']} /> : null}\n </button>\n\n <div className=\"adn-item__actions\">\n {isUnread ? (\n <button\n type=\"button\"\n className=\"adn-item__action\"\n onClick={() => markAsRead.mutate(notification.id)}\n disabled={markAsRead.isPending}\n aria-label={messages['item.markAsRead']}\n title={messages['item.markAsRead']}\n >\n <Check className=\"adn-item__action-icon\" aria-hidden=\"true\" />\n </button>\n ) : null}\n\n <button\n type=\"button\"\n className=\"adn-item__action adn-item__action--danger\"\n onClick={() => deleteNotification.mutate(notification.id)}\n disabled={deleteNotification.isPending}\n aria-label={messages['item.delete']}\n title={messages['item.delete']}\n >\n {/* Ação destrutiva: ícone reforça o peso antes do clique (regra de ícones). */}\n <Trash2 className=\"adn-item__action-icon\" aria-hidden=\"true\" />\n </button>\n </div>\n </li>\n )\n}\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n */\n\nimport { useState } from 'react'\nimport { Save } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { NotificationPreference } from '@adatechnology/notification-contracts'\n\nimport { useNotificationContext } from '../NotificationProvider'\nimport { usePreferences, useUpdatePreferences } from '../hooks/usePreferences'\n\nexport type PreferencesPanelProps = {\n readonly className?: string\n}\n\nfunction channelLabelKey(channel: string): string {\n return `channel.${channel}`\n}\n\nexport function PreferencesPanel({ className }: PreferencesPanelProps) {\n const { messages, theme } = useNotificationContext()\n const { data: saved = [], isPending } = usePreferences()\n const updatePreferences = useUpdatePreferences()\n\n // Rascunho local só existe entre abrir e salvar: `undefined` significa \"ainda não mexeu\", e é o\n // que faz o painel refletir o servidor sem sobrescrever edição em andamento a cada refetch.\n const [draft, setDraft] = useState<NotificationPreference[] | undefined>(undefined)\n const preferences = draft ?? saved\n\n function toggleChannel(target: NotificationPreference): void {\n setDraft(\n preferences.map((preference) =>\n preference.category === target.category && preference.channel === target.channel\n ? { ...preference, enabled: !preference.enabled }\n : preference,\n ),\n )\n }\n\n function handleSave(): void {\n updatePreferences.mutate(preferences, { onSuccess: () => setDraft(undefined) })\n }\n\n if (isPending) return <p className=\"adn-preferences__state\">{messages['list.loading']}</p>\n\n return (\n <section className={clsx('adn-preferences', theme.rootClassName, className)}>\n <header className=\"adn-preferences__header\">\n <h2 className=\"adn-preferences__title\">{messages['preferences.title']}</h2>\n <p className=\"adn-preferences__description\">{messages['preferences.description']}</p>\n </header>\n\n {preferences.length === 0 ? (\n <p className=\"adn-preferences__state\">{messages['preferences.empty']}</p>\n ) : (\n <ul className=\"adn-preferences__items\">\n {preferences.map((preference) => {\n const inputId = `adn-pref-${preference.category}-${preference.channel}`\n return (\n <li key={inputId} className=\"adn-preferences__item\">\n {/* `label` associado por `htmlFor`: aumenta a área de toque e é o que faz o\n leitor de tela anunciar canal e estado juntos. */}\n <label className=\"adn-preferences__label\" htmlFor={inputId}>\n <input\n id={inputId}\n type=\"checkbox\"\n className=\"adn-preferences__checkbox\"\n checked={preference.enabled}\n onChange={() => toggleChannel(preference)}\n />\n <span className=\"adn-preferences__category\">{preference.category}</span>\n <span className=\"adn-preferences__channel\">\n {messages[channelLabelKey(preference.channel) as keyof typeof messages] ?? preference.channel}\n </span>\n </label>\n\n {preference.quietHoursStart && preference.quietHoursEnd ? (\n <span className=\"adn-preferences__quiet-hours\">\n {messages['preferences.quietHours']} {preference.quietHoursStart}{' '}\n {messages['preferences.quietHoursTo']} {preference.quietHoursEnd}\n </span>\n ) : null}\n </li>\n )\n })}\n </ul>\n )}\n\n <footer className=\"adn-preferences__footer\">\n {/* Ação primária de formulário com convenção clara → ícone (regra de ícones, web.md §9). */}\n <button\n type=\"button\"\n className=\"adn-preferences__save\"\n onClick={handleSave}\n disabled={updatePreferences.isPending || draft === undefined}\n >\n <Save className=\"adn-preferences__save-icon\" aria-hidden=\"true\" />\n {messages['preferences.save']}\n </button>\n\n {updatePreferences.isSuccess && draft === undefined ? (\n <span className=\"adn-preferences__feedback\" role=\"status\">\n {messages['preferences.saved']}\n </span>\n ) : null}\n {updatePreferences.isError ? (\n <span className=\"adn-preferences__feedback adn-preferences__feedback--error\" role=\"alert\">\n {messages['preferences.error']}\n </span>\n ) : null}\n </footer>\n </section>\n )\n}\n"],"mappings":";;;;AAQA,SAASA,eAAeC,YAAYC,eAA+B;;;ACRnE;AAAA,EACE,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,mBAAmB;AAAA,EACnB,eAAe;AAAA,EACf,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,2BAA2B;AAAA,EAC3B,oBAAoB;AAAA,EACpB,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AAO7C,WAAU;KAEhB,sBAAA,cAAC8C,UAAAA;IACCP,MAAK;IACLvC,WAAU;IACV+C,SAAS1B;IACT2B,UAAUxC,kBAAkBF,aAAaI,UAAUG;KAEnD,sBAAA,cAACoC,MAAAA;IAAKjD,WAAU;IAA6BkD,eAAY;MACxDjD,SAAS,kBAAA,CAAmB,GAG9BO,kBAAkB2C,aAAazC,UAAUG,SACxC,sBAAA,cAAC6B,QAAAA;IAAK1C,WAAU;IAA4BoD,MAAK;KAC9CnD,SAAS,mBAAA,CAAoB,IAE9B,MACHO,kBAAkB6C,UACjB,sBAAA,cAACX,QAAAA;IAAK1C,WAAU;IAA6DoD,MAAK;KAC/EnD,SAAS,mBAAA,CAAoB,IAE9B,IAAA,CAAA;AAIZ;AA9FgBF;","names":["createContext","useContext","useMemo","DEFAULT_LOCALE","MESSAGES_BY_LOCALE","ptBR","en","resolveMessages","locale","NotificationContext","createContext","NotificationProvider","client","locale","DEFAULT_LOCALE","messageOverrides","theme","pollIntervalSeconds","children","value","useMemo","messages","resolveMessages","Provider","useNotificationContext","context","useContext","Error","useInfiniteQuery","useMutation","useQuery","useQueryClient","NOTIFICATION_QUERY_KEYS","all","list","filters","unreadCount","preferences","templates","useNotifications","options","client","useNotificationContext","useInfiniteQuery","queryKey","NOTIFICATION_QUERY_KEYS","list","category","read","initialPageParam","undefined","queryFn","pageParam","listNotifications","cursor","perPage","getNextPageParam","lastPage","nextCursor","useUnreadCount","pollIntervalSeconds","useQuery","unreadCount","countUnread","refetchInterval","useMarkAsRead","queryClient","useQueryClient","useMutation","mutationFn","id","markAsRead","onMutate","cancelQueries","all","previousCount","getQueryData","setQueryData","current","Math","max","onError","_error","_id","context","onSettled","invalidateQueries","useMarkAllAsRead","markAllAsRead","useDeleteNotification","deleteNotification","flattenNotificationPages","pages","flatMap","page","data","useEffect","useQueryClient","subscribeToNotificationStream","useNotificationStream","options","client","useNotificationContext","queryClient","useQueryClient","enabled","onEvent","useEffect","subscription","cancelled","resolveStreamRequest","then","url","headers","subscribeToNotificationStream","event","invalidateQueries","queryKey","NOTIFICATION_QUERY_KEYS","all","close","useMutation","useQuery","useQueryClient","usePreferences","client","useNotificationContext","useQuery","queryKey","NOTIFICATION_QUERY_KEYS","preferences","queryFn","getPreferences","useUpdatePreferences","queryClient","useQueryClient","useMutation","mutationFn","updatePreferences","onSuccess","saved","setQueryData","useTemplates","templates","listTemplates","Bell","clsx","DEFAULT_MAX_BADGE_COUNT","NotificationBell","onClick","className","maxBadgeCount","messages","theme","useNotificationContext","data","unreadCount","useUnreadCount","hasUnread","badgeLabel","String","accessibleLabel","button","type","clsx","rootClassName","aria-label","Bell","aria-hidden","span","aria-live","CheckCheck","Inbox","RotateCw","clsx","Check","Trash2","clsx","NotificationItem","notification","onSelect","className","messages","useNotificationContext","markAsRead","useMarkAsRead","deleteNotification","useDeleteNotification","isUnread","readAt","undefined","handleSelect","mutate","id","li","clsx","button","type","onClick","span","title","body","aria-label","div","disabled","isPending","Check","aria-hidden","Trash2","NotificationList","category","onSelect","className","components","messages","theme","useNotificationContext","query","useNotifications","data","unreadCount","useUnreadCount","markAllAsRead","useMarkAllAsRead","Item","NotificationItem","notifications","flattenNotificationPages","pages","section","clsx","rootClassName","aria-label","header","h2","button","type","onClick","mutate","disabled","isPending","CheckCheck","aria-hidden","p","isError","div","refetch","RotateCw","length","Inbox","ul","map","notification","key","id","hasNextPage","fetchNextPage","isFetchingNextPage","useState","Save","clsx","channelLabelKey","channel","PreferencesPanel","className","messages","theme","useNotificationContext","data","saved","isPending","usePreferences","updatePreferences","useUpdatePreferences","draft","setDraft","useState","undefined","preferences","toggleChannel","target","map","preference","category","enabled","handleSave","mutate","onSuccess","p","section","clsx","rootClassName","header","h2","length","ul","inputId","li","key","label","htmlFor","input","id","type","checked","onChange","span","quietHoursStart","quietHoursEnd","footer","button","onClick","disabled","Save","aria-hidden","isSuccess","role","isError"]}
1
+ {"version":3,"sources":["../src/components/NotificationBell.tsx","../src/components/NotificationList.tsx","../src/components/NotificationItem.tsx","../src/components/PreferencesPanel.tsx","../src/components/NotificationsWorkspace.tsx","../src/components/NotificationSettingsWorkspace.tsx"],"sourcesContent":["/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n */\n\nimport { Bell } from 'lucide-react'\nimport clsx from 'clsx'\n\nimport { useNotificationContext } from '../NotificationProvider'\nimport { useUnreadCount } from '../hooks/useNotifications'\n\nexport type NotificationBellProps = {\n readonly onClick?: () => void\n readonly className?: string\n /** Acima disso o badge mostra `99+`; um número de 4 dígitos estoura o desenho do badge. */\n readonly maxBadgeCount?: number\n}\n\nconst DEFAULT_MAX_BADGE_COUNT = 99\n\nexport function NotificationBell({ onClick, className, maxBadgeCount = DEFAULT_MAX_BADGE_COUNT }: NotificationBellProps) {\n const { messages, theme } = useNotificationContext()\n const { data: unreadCount = 0 } = useUnreadCount()\n\n const hasUnread = unreadCount > 0\n const badgeLabel = unreadCount > maxBadgeCount ? `${maxBadgeCount}+` : String(unreadCount)\n const accessibleLabel = hasUnread\n ? `${messages['bell.label']}: ${unreadCount} ${messages['bell.unreadSuffix']}`\n : messages['bell.label']\n\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={clsx('adn-bell', theme.rootClassName, className)}\n // Botão só-ícone exige rótulo acessível (regra de ícones, `web.md` §9).\n aria-label={accessibleLabel}\n >\n {/* Decorativo: o rótulo acessível já está no botão, e anunciar o ícone repetiria a ação. */}\n <Bell className=\"adn-bell__icon\" aria-hidden=\"true\" />\n {hasUnread ? (\n // `aria-live` para leitor de tela anunciar a mudança do contador sem o usuário reabrir\n // o menu; `polite` porque notificação nova não deve interromper o que ele está lendo.\n <span className=\"adn-bell__badge\" aria-live=\"polite\">\n {badgeLabel}\n </span>\n ) : null}\n </button>\n )\n}\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n */\n\nimport { CheckCheck, Inbox, RotateCw } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { NotificationSummary } from '@adatechnology/notification-contracts'\n\nimport { useNotificationContext } from '../NotificationProvider'\nimport { flattenNotificationPages, useMarkAllAsRead, useNotifications, useUnreadCount } from '../hooks/useNotifications'\nimport { NotificationItem } from './NotificationItem'\n\nexport type NotificationListProps = {\n readonly category?: string\n readonly onSelect?: (notification: NotificationSummary) => void\n readonly className?: string\n /** Slot: o host troca a linha sem reimplementar a lista (regra §4.3, slots e overrides). */\n readonly components?: { readonly Item?: typeof NotificationItem }\n}\n\nexport function NotificationList({ category, onSelect, className, components }: NotificationListProps) {\n const { messages, theme } = useNotificationContext()\n const query = useNotifications({ category })\n const { data: unreadCount = 0 } = useUnreadCount()\n const markAllAsRead = useMarkAllAsRead()\n\n const Item = components?.Item ?? NotificationItem\n const notifications = flattenNotificationPages(query.data?.pages)\n\n return (\n <section className={clsx('adn-list', theme.rootClassName, className)} aria-label={messages['list.title']}>\n <header className=\"adn-list__header\">\n <h2 className=\"adn-list__title\">{messages['list.title']}</h2>\n {unreadCount > 0 ? (\n <button\n type=\"button\"\n className=\"adn-list__bulk-action\"\n onClick={() => markAllAsRead.mutate()}\n disabled={markAllAsRead.isPending}\n >\n <CheckCheck className=\"adn-list__bulk-icon\" aria-hidden=\"true\" />\n {messages['list.markAllAsRead']}\n </button>\n ) : null}\n </header>\n\n {query.isPending ? <p className=\"adn-list__state\">{messages['list.loading']}</p> : null}\n\n {query.isError ? (\n <div className=\"adn-list__state adn-list__state--error\">\n <p>{messages['list.error']}</p>\n <button type=\"button\" className=\"adn-list__retry\" onClick={() => void query.refetch()}>\n <RotateCw className=\"adn-list__retry-icon\" aria-hidden=\"true\" />\n {messages['list.retry']}\n </button>\n </div>\n ) : null}\n\n {!query.isPending && !query.isError && notifications.length === 0 ? (\n <div className=\"adn-list__state adn-list__state--empty\">\n <Inbox className=\"adn-list__empty-icon\" aria-hidden=\"true\" />\n <p>{messages['list.empty']}</p>\n </div>\n ) : null}\n\n {notifications.length > 0 ? (\n <ul className=\"adn-list__items\">\n {notifications.map((notification) => (\n <Item key={notification.id} notification={notification} onSelect={onSelect} />\n ))}\n </ul>\n ) : null}\n\n {query.hasNextPage ? (\n <button\n type=\"button\"\n className=\"adn-list__load-more\"\n onClick={() => void query.fetchNextPage()}\n disabled={query.isFetchingNextPage}\n >\n {messages['list.loadMore']}\n </button>\n ) : null}\n </section>\n )\n}\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n */\n\nimport { Check, Trash2 } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { NotificationSummary } from '@adatechnology/notification-contracts'\n\nimport { useNotificationContext } from '../NotificationProvider'\nimport { useDeleteNotification, useMarkAsRead } from '../hooks/useNotifications'\n\nexport type NotificationItemProps = {\n readonly notification: NotificationSummary\n readonly onSelect?: (notification: NotificationSummary) => void\n readonly className?: string\n}\n\nexport function NotificationItem({ notification, onSelect, className }: NotificationItemProps) {\n const { messages } = useNotificationContext()\n const markAsRead = useMarkAsRead()\n const deleteNotification = useDeleteNotification()\n\n const isUnread = notification.readAt === undefined\n\n function handleSelect(): void {\n if (isUnread) markAsRead.mutate(notification.id)\n onSelect?.(notification)\n }\n\n return (\n <li className={clsx('adn-item', isUnread && 'adn-item--unread', className)}>\n {/* Semântico: a linha inteira é clicável e precisa ser alcançável por teclado — `button`\n entrega Enter, Espaço e foco de graça, e um `div` com onClick não (web.md §Acessibilidade). */}\n <button type=\"button\" className=\"adn-item__main\" onClick={handleSelect}>\n <span className=\"adn-item__title\">{notification.title}</span>\n <span className=\"adn-item__body\">{notification.body}</span>\n {isUnread ? <span className=\"adn-item__unread-dot\" aria-label={messages['item.unread']} /> : null}\n </button>\n\n <div className=\"adn-item__actions\">\n {isUnread ? (\n <button\n type=\"button\"\n className=\"adn-item__action\"\n onClick={() => markAsRead.mutate(notification.id)}\n disabled={markAsRead.isPending}\n aria-label={messages['item.markAsRead']}\n title={messages['item.markAsRead']}\n >\n <Check className=\"adn-item__action-icon\" aria-hidden=\"true\" />\n </button>\n ) : null}\n\n <button\n type=\"button\"\n className=\"adn-item__action adn-item__action--danger\"\n onClick={() => deleteNotification.mutate(notification.id)}\n disabled={deleteNotification.isPending}\n aria-label={messages['item.delete']}\n title={messages['item.delete']}\n >\n {/* Ação destrutiva: ícone reforça o peso antes do clique (regra de ícones). */}\n <Trash2 className=\"adn-item__action-icon\" aria-hidden=\"true\" />\n </button>\n </div>\n </li>\n )\n}\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n */\n\nimport { useState } from 'react'\nimport { Save } from 'lucide-react'\nimport clsx from 'clsx'\nimport type { NotificationPreference } from '@adatechnology/notification-contracts'\n\nimport { useNotificationContext } from '../NotificationProvider'\nimport { usePreferences, useUpdatePreferences } from '../hooks/usePreferences'\n\nexport type PreferencesPanelProps = {\n readonly className?: string\n}\n\nfunction channelLabelKey(channel: string): string {\n return `channel.${channel}`\n}\n\nexport function PreferencesPanel({ className }: PreferencesPanelProps) {\n const { messages, theme } = useNotificationContext()\n const { data: saved = [], isPending } = usePreferences()\n const updatePreferences = useUpdatePreferences()\n\n // Rascunho local só existe entre abrir e salvar: `undefined` significa \"ainda não mexeu\", e é o\n // que faz o painel refletir o servidor sem sobrescrever edição em andamento a cada refetch.\n const [draft, setDraft] = useState<NotificationPreference[] | undefined>(undefined)\n const preferences = draft ?? saved\n\n function toggleChannel(target: NotificationPreference): void {\n setDraft(\n preferences.map((preference) =>\n preference.category === target.category && preference.channel === target.channel\n ? { ...preference, enabled: !preference.enabled }\n : preference,\n ),\n )\n }\n\n function handleSave(): void {\n updatePreferences.mutate(preferences, { onSuccess: () => setDraft(undefined) })\n }\n\n if (isPending) return <p className=\"adn-preferences__state\">{messages['list.loading']}</p>\n\n return (\n <section className={clsx('adn-preferences', theme.rootClassName, className)}>\n <header className=\"adn-preferences__header\">\n <h2 className=\"adn-preferences__title\">{messages['preferences.title']}</h2>\n <p className=\"adn-preferences__description\">{messages['preferences.description']}</p>\n </header>\n\n {preferences.length === 0 ? (\n <p className=\"adn-preferences__state\">{messages['preferences.empty']}</p>\n ) : (\n <ul className=\"adn-preferences__items\">\n {preferences.map((preference) => {\n const inputId = `adn-pref-${preference.category}-${preference.channel}`\n return (\n <li key={inputId} className=\"adn-preferences__item\">\n {/* `label` associado por `htmlFor`: aumenta a área de toque e é o que faz o\n leitor de tela anunciar canal e estado juntos. */}\n <label className=\"adn-preferences__label\" htmlFor={inputId}>\n <input\n id={inputId}\n type=\"checkbox\"\n className=\"adn-preferences__checkbox\"\n checked={preference.enabled}\n onChange={() => toggleChannel(preference)}\n />\n <span className=\"adn-preferences__category\">{preference.category}</span>\n <span className=\"adn-preferences__channel\">\n {messages[channelLabelKey(preference.channel) as keyof typeof messages] ?? preference.channel}\n </span>\n </label>\n\n {preference.quietHoursStart && preference.quietHoursEnd ? (\n <span className=\"adn-preferences__quiet-hours\">\n {messages['preferences.quietHours']} {preference.quietHoursStart}{' '}\n {messages['preferences.quietHoursTo']} {preference.quietHoursEnd}\n </span>\n ) : null}\n </li>\n )\n })}\n </ul>\n )}\n\n <footer className=\"adn-preferences__footer\">\n {/* Ação primária de formulário com convenção clara → ícone (regra de ícones, web.md §9). */}\n <button\n type=\"button\"\n className=\"adn-preferences__save\"\n onClick={handleSave}\n disabled={updatePreferences.isPending || draft === undefined}\n >\n <Save className=\"adn-preferences__save-icon\" aria-hidden=\"true\" />\n {messages['preferences.save']}\n </button>\n\n {updatePreferences.isSuccess && draft === undefined ? (\n <span className=\"adn-preferences__feedback\" role=\"status\">\n {messages['preferences.saved']}\n </span>\n ) : null}\n {updatePreferences.isError ? (\n <span className=\"adn-preferences__feedback adn-preferences__feedback--error\" role=\"alert\">\n {messages['preferences.error']}\n </span>\n ) : null}\n </footer>\n </section>\n )\n}\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n *\n * A tela de notificações COMPOSTA, no molde do `ConversationsWorkspace`.\n *\n * O pacote exportava só as peças (`NotificationList`, `PreferencesPanel`), e o primeiro consumidor\n * remontou o grid à mão — 56 linhas na página da inbox e 221 na de configuração, contra 35 da página\n * de Documentos, que consome workspace. É exatamente o que a regra de módulos plugáveis (§4) rejeita:\n * cada produto remontando o layout é como as telas divergiram antes.\n *\n * Customização por contrato, nunca por fork:\n * - vocabulário → `labels`\n * - UI do produto → slots `renderHeaderActions`, `renderAboveList`, `renderEmpty`\n * - regra de negócio → callbacks (`onSelectNotification`)\n * - **capacidade por ausência**: sem `settingsHref` não aparece link de configuração, sem\n * `showPreferences` não aparece a coluna. Nunca flag `hasX`.\n */\n\nimport type { ReactNode } from 'react'\nimport type { NotificationSummary } from '@adatechnology/notification-contracts'\n\nimport { useNotificationContext } from '../NotificationProvider'\nimport { NotificationList } from './NotificationList'\nimport { PreferencesPanel } from './PreferencesPanel'\n\nexport type NotificationsWorkspaceProps = {\n /** Sobrescreve textos pontuais sem trocar o locale inteiro. */\n readonly labels?: Partial<Record<string, string>>\n /** Filtra a inbox por assunto. Ausente, mostra tudo. */\n readonly category?: string\n /**\n * Coluna de preferências ao lado da inbox.\n *\n * Ligada por padrão porque é o caso comum; um produto que gerencia preferência noutra tela passa\n * `false` e fica só com a inbox, em largura cheia.\n */\n readonly showPreferences?: boolean\n /** Ausente, o link de configuração não aparece — o produto pode não ter essa tela. */\n readonly settingsHref?: string | undefined\n /** Clique numa notificação. Ausente, a linha não é clicável. */\n readonly onSelectNotification?: (notification: NotificationSummary) => void\n /** Ações do produto no cabeçalho, ao lado do link de configuração. */\n readonly renderHeaderActions?: () => ReactNode\n /** Aviso ou filtro do produto, entre o cabeçalho e a lista. */\n readonly renderAboveList?: () => ReactNode\n /** Substitui o vazio padrão — útil quando o produto sabe explicar por que está vazio. */\n readonly renderEmpty?: () => ReactNode\n readonly className?: string\n}\n\nexport function NotificationsWorkspace({\n labels: labelsOverride,\n category,\n showPreferences = true,\n settingsHref,\n onSelectNotification,\n renderHeaderActions,\n renderAboveList,\n renderEmpty,\n className,\n}: NotificationsWorkspaceProps) {\n const { messages } = useNotificationContext()\n const label = (key: string): string => labelsOverride?.[key] ?? (messages as Record<string, string>)[key] ?? key\n\n return (\n <div className={`adn-workspace ${className ?? ''}`}>\n <header className=\"adn-workspace__header\">\n <div>\n <h1 className=\"adn-workspace__title\">{label('workspace.title')}</h1>\n <p className=\"adn-workspace__description\">{label('workspace.description')}</p>\n </div>\n\n <div className=\"adn-workspace__actions\">\n {renderHeaderActions?.()}\n {/* Capacidade por ausência: sem href, sem link. */}\n {settingsHref && (\n <a href={settingsHref} className=\"adn-button adn-button--outline\">\n {label('workspace.settingsLink')}\n </a>\n )}\n </div>\n </header>\n\n {renderAboveList?.()}\n\n <div className={showPreferences ? 'adn-workspace__grid' : 'adn-workspace__grid--single'}>\n <section className=\"adn-workspace__inbox\">\n <NotificationList\n {...(category ? { category } : {})}\n {...(onSelectNotification ? { onSelect: onSelectNotification } : {})}\n />\n {renderEmpty?.()}\n </section>\n\n {showPreferences && (\n <aside className=\"adn-workspace__aside\">\n <PreferencesPanel />\n </aside>\n )}\n </div>\n </div>\n )\n}\n","/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n *\n * A tela de configuração COMPOSTA: canais por assunto e editor de mensagem com preview.\n *\n * Substitui as 221 linhas de página + 207 de hook que o primeiro consumidor escreveu. O que sobra\n * para o produto é dizer quais canais e assuntos existem — o resto é layout, e layout duplicado é\n * como as telas divergem.\n *\n * `channels` e `categories` são OBRIGATÓRIOS e vêm do produto porque o pacote não tem opinião sobre\n * eles: uma loja avisa status de pedido por WhatsApp, um banco avisa vencimento por e-mail, e o\n * `hint` de cada canal (\"exige template aprovado\", \"exige aparelho registrado\") é conhecimento do\n * produto sobre a própria operação.\n */\n\nimport type { ReactNode } from 'react'\nimport type { NotificationPreference, NotificationTemplate } from '@adatechnology/notification-contracts'\n\nimport { useNotificationContext } from '../NotificationProvider'\nimport { usePreferences, useUpdatePreferences } from '../hooks/usePreferences'\nimport { useTemplateEditor } from '../hooks/useTemplateEditor'\n\nexport type NotificationChannelOption = {\n readonly id: string\n readonly label: string\n /** O custo do canal, em uma linha. É o que faz alguém decidir em vez de chutar. */\n readonly hint?: string\n}\n\nexport type NotificationCategoryOption = {\n readonly id: string\n readonly label: string\n readonly hint?: string\n}\n\nexport type NotificationSettingsWorkspaceProps = {\n readonly labels?: Partial<Record<string, string>>\n /** Os canais que ESTE produto oferece — o pacote despacha em cinco e não opina sobre quais usar. */\n readonly channels: readonly NotificationChannelOption[]\n /** Os assuntos que este produto dispara. */\n readonly categories: readonly NotificationCategoryOption[]\n /**\n * Valores de exemplo do preview, por assunto do template. Ausente, o preview mostra campo vazio —\n * que é honesto, mas menos útil para quem está escrevendo o texto.\n */\n readonly previewPayload?: Readonly<Record<string, unknown>>\n /** Traduz `order.status.preparing` no rótulo que o produto usa. Ausente, mostra a chave crua. */\n readonly templateLabelOf?: (template: NotificationTemplate) => string\n /**\n * Campo extra por canal — é onde entra o nome do template aprovado na Meta, que só o WhatsApp tem.\n * Ausente, nenhum campo extra aparece.\n */\n readonly renderChannelFields?: (params: {\n readonly channel: string\n readonly value: string\n readonly onChange: (value: string) => void\n }) => ReactNode\n /** Ações do produto no cabeçalho. */\n readonly renderHeaderActions?: () => ReactNode\n readonly className?: string\n}\n\nexport function NotificationSettingsWorkspace({\n labels: labelsOverride,\n channels,\n categories,\n previewPayload,\n templateLabelOf,\n renderChannelFields,\n renderHeaderActions,\n className,\n}: NotificationSettingsWorkspaceProps) {\n const { messages } = useNotificationContext()\n const label = (key: string): string => labelsOverride?.[key] ?? (messages as Record<string, string>)[key] ?? key\n\n const preferencesQuery = usePreferences()\n const updatePreferences = useUpdatePreferences()\n const editor = useTemplateEditor(previewPayload ? { previewPayload } : {})\n\n /**\n * Preferência ausente é o estado inicial normal — o módulo devolve só o que foi gravado. O default\n * é ligado: comportamento de fábrica é avisar, e um destinatário que não recebeu porque a linha não\n * existia é pior que um que recebeu demais.\n */\n function isEnabled(category: string, channel: string): boolean {\n const row = (preferencesQuery.data ?? []).find(\n (preference) => preference.category === category && preference.channel === channel,\n )\n return row?.enabled ?? true\n }\n\n function toggle(category: string, channel: string): void {\n // Conjunto inteiro: a rota é `PUT` em lote, e enviar só o que mudou apagaria o resto.\n const next: NotificationPreference[] = categories.flatMap((eachCategory) =>\n channels.map((eachChannel) => ({\n category: eachCategory.id,\n channel: eachChannel.id as NotificationPreference['channel'],\n enabled:\n eachCategory.id === category && eachChannel.id === channel\n ? !isEnabled(category, channel)\n : isEnabled(eachCategory.id, eachChannel.id),\n })),\n )\n updatePreferences.mutate(next)\n }\n\n return (\n <div className={`adn-settings ${className ?? ''}`}>\n <header className=\"adn-settings__header\">\n <div>\n <h1 className=\"adn-settings__title\">{label('settings.title')}</h1>\n <p className=\"adn-settings__description\">{label('settings.description')}</p>\n </div>\n {renderHeaderActions?.()}\n </header>\n\n <section className=\"adn-settings__channels\">\n <h2 className=\"adn-settings__section-title\">{label('settings.channelsTitle')}</h2>\n <p className=\"adn-settings__hint\">{label('settings.channelsHint')}</p>\n\n {categories.map((category) => (\n <div key={category.id} className=\"adn-settings__category\">\n <p className=\"adn-settings__category-label\">{category.label}</p>\n {category.hint && <p className=\"adn-settings__hint\">{category.hint}</p>}\n\n <div className=\"adn-settings__channel-grid\">\n {channels.map((channel) => (\n <label key={channel.id} className=\"adn-settings__channel\">\n <input\n type=\"checkbox\"\n checked={isEnabled(category.id, channel.id)}\n disabled={updatePreferences.isPending}\n onChange={() => toggle(category.id, channel.id)}\n />\n <span>\n <span className=\"adn-settings__channel-label\">{channel.label}</span>\n {channel.hint && <span className=\"adn-settings__hint\">{channel.hint}</span>}\n </span>\n </label>\n ))}\n </div>\n </div>\n ))}\n </section>\n\n <div className=\"adn-settings__templates\">\n <section className=\"adn-settings__template-list\">\n <header>\n <h2 className=\"adn-settings__section-title\">{label('settings.templatesTitle')}</h2>\n <p className=\"adn-settings__hint\">{label('settings.templatesHint')}</p>\n </header>\n\n {editor.isLoading && <p className=\"adn-settings__hint\">{label('list.loading')}</p>}\n {!editor.isLoading && editor.templates.length === 0 && (\n <p className=\"adn-settings__hint\">{label('settings.templatesEmpty')}</p>\n )}\n\n <ul>\n {editor.templates.map((template) => (\n <li key={template.id}>\n <button\n type=\"button\"\n onClick={() => editor.select(template)}\n className={editor.selected?.id === template.id ? 'adn-settings__row--active' : undefined}\n >\n <span className=\"adn-settings__row-main\">\n <span className=\"adn-settings__row-title\">{templateLabelOf?.(template) ?? template.key}</span>\n <span className=\"adn-settings__row-body\">{template.body}</span>\n </span>\n <span className={`adn-settings__badge adn-settings__badge--${template.channel}`}>\n {label(`channel.${template.channel}`)}\n </span>\n <span className=\"adn-settings__version\">\n {label('settings.version')}\n {template.version}\n </span>\n </button>\n </li>\n ))}\n </ul>\n </section>\n\n <section className=\"adn-settings__editor\">\n {!editor.draft && <p className=\"adn-settings__hint\">{label('settings.pickTemplate')}</p>}\n\n {editor.draft && (\n <>\n <header className=\"adn-settings__editor-header\">\n <div>\n <h2 className=\"adn-settings__section-title\">\n {editor.selected ? (templateLabelOf?.(editor.selected) ?? editor.selected.key) : ''}\n </h2>\n <p className=\"adn-settings__hint\">\n {editor.draft.channel} · {editor.draft.locale} · {label('settings.version')}\n {editor.selected?.version}\n </p>\n </div>\n <button type=\"button\" onClick={editor.clear}>\n {label('settings.close')}\n </button>\n </header>\n\n <label className=\"adn-settings__field\">\n <span className=\"adn-settings__field-label\">{label('settings.subject')}</span>\n <span className=\"adn-settings__hint\">{label('settings.subjectHint')}</span>\n <input value={editor.draft.subject} onChange={(event) => editor.update({ subject: event.target.value })} />\n </label>\n\n <label className=\"adn-settings__field\">\n <span className=\"adn-settings__field-label\">{label('settings.body')}</span>\n <textarea\n rows={4}\n value={editor.draft.body}\n onChange={(event) => editor.update({ body: event.target.value })}\n />\n </label>\n\n {/* Slot: campo que só um canal tem, e que o pacote não deve conhecer por nome. */}\n {renderChannelFields?.({\n channel: editor.draft.channel,\n value: editor.draft.whatsappTemplateName,\n onChange: (value) => editor.update({ whatsappTemplateName: value }),\n })}\n\n {editor.preview && (\n <div className=\"adn-settings__preview\">\n <p className=\"adn-settings__preview-title\">{label('settings.previewTitle')}</p>\n <p className=\"adn-settings__preview-subject\">{editor.preview.title}</p>\n <p className=\"adn-settings__preview-body\">{editor.preview.body}</p>\n </div>\n )}\n\n {editor.error && <p className=\"adn-settings__error\">{editor.error}</p>}\n\n <div className=\"adn-settings__actions\">\n <button type=\"button\" onClick={editor.save} disabled={!editor.isDirty || editor.isSaving}>\n {editor.isSaving ? label('settings.saving') : label('settings.save')}\n </button>\n {/* Diz por que está desabilitado, em vez de deixar o botão inerte sem explicação. */}\n {!editor.isDirty && <span className=\"adn-settings__hint\">{label('settings.unchanged')}</span>}\n </div>\n </>\n )}\n </section>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIA,SAAS,YAAY;AACrB,OAAO,UAAU;AAyBb,SAQE,KARF;AAbJ,IAAM,0BAA0B;AAEzB,SAAS,iBAAiB,EAAE,SAAS,WAAW,gBAAgB,wBAAwB,GAA0B;AACvH,QAAM,EAAE,UAAU,MAAM,IAAI,uBAAuB;AACnD,QAAM,EAAE,MAAM,cAAc,EAAE,IAAI,eAAe;AAEjD,QAAM,YAAY,cAAc;AAChC,QAAM,aAAa,cAAc,gBAAgB,GAAG,aAAa,MAAM,OAAO,WAAW;AACzF,QAAM,kBAAkB,YACpB,GAAG,SAAS,YAAY,CAAC,KAAK,WAAW,IAAI,SAAS,mBAAmB,CAAC,KAC1E,SAAS,YAAY;AAEzB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL;AAAA,MACA,WAAW,KAAK,YAAY,MAAM,eAAe,SAAS;AAAA,MAE1D,cAAY;AAAA,MAGZ;AAAA,4BAAC,QAAK,WAAU,kBAAiB,eAAY,QAAO;AAAA,QACnD;AAAA;AAAA;AAAA,UAGC,oBAAC,UAAK,WAAU,mBAAkB,aAAU,UACzC,sBACH;AAAA,YACE;AAAA;AAAA;AAAA,EACN;AAEJ;;;AC5CA,SAAS,YAAY,OAAO,gBAAgB;AAC5C,OAAOA,WAAU;;;ACDjB,SAAS,OAAO,cAAc;AAC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@ -1,7 +1,9 @@
1
1
  /* src/styles.css */
2
2
  .adn-bell,
3
3
  .adn-list,
4
- .adn-preferences {
4
+ .adn-preferences,
5
+ .adn-workspace,
6
+ .adn-settings {
5
7
  --adn-color-surface: var(--adn-surface, #ffffff);
6
8
  --adn-color-text: var(--adn-text, #111827);
7
9
  --adn-color-muted: var(--adn-muted, #6b7280);
@@ -310,4 +312,259 @@
310
312
  transition: none;
311
313
  }
312
314
  }
315
+ .adn-workspace,
316
+ .adn-settings {
317
+ display: flex;
318
+ flex-direction: column;
319
+ gap: var(--adn-space-4, 16px);
320
+ color: inherit;
321
+ }
322
+ .adn-workspace__header,
323
+ .adn-settings__header,
324
+ .adn-settings__editor-header {
325
+ display: flex;
326
+ flex-wrap: wrap;
327
+ align-items: flex-start;
328
+ justify-content: space-between;
329
+ gap: var(--adn-space-3, 12px);
330
+ }
331
+ .adn-workspace__title,
332
+ .adn-settings__title {
333
+ margin: 0;
334
+ font-size: 1.25rem;
335
+ font-weight: 600;
336
+ }
337
+ .adn-workspace__description,
338
+ .adn-settings__description,
339
+ .adn-settings__hint {
340
+ display: block;
341
+ margin: 2px 0 0;
342
+ font-size: 0.8125rem;
343
+ color: var(--adn-color-muted);
344
+ }
345
+ .adn-workspace__actions {
346
+ display: flex;
347
+ align-items: center;
348
+ gap: var(--adn-space-2, 8px);
349
+ }
350
+ .adn-button {
351
+ display: inline-flex;
352
+ align-items: center;
353
+ gap: var(--adn-space-2, 8px);
354
+ min-height: 44px;
355
+ padding: 0 var(--adn-space-3, 12px);
356
+ border-radius: var(--adn-radius);
357
+ font-size: 0.875rem;
358
+ font-weight: 500;
359
+ text-decoration: none;
360
+ color: inherit;
361
+ background: transparent;
362
+ border: 1px solid transparent;
363
+ cursor: pointer;
364
+ }
365
+ .adn-button--outline {
366
+ border-color: var(--adn-color-border);
367
+ background: var(--adn-surface, transparent);
368
+ }
369
+ .adn-workspace__grid,
370
+ .adn-settings__templates {
371
+ display: grid;
372
+ grid-template-columns: 1fr;
373
+ gap: var(--adn-space-4, 16px);
374
+ }
375
+ .adn-workspace__grid--single {
376
+ display: grid;
377
+ grid-template-columns: 1fr;
378
+ }
379
+ @media (min-width: 1024px) {
380
+ .adn-workspace__grid {
381
+ grid-template-columns: 2fr 1fr;
382
+ }
383
+ .adn-settings__templates {
384
+ grid-template-columns: 2fr 3fr;
385
+ }
386
+ .adn-button {
387
+ min-height: 36px;
388
+ }
389
+ }
390
+ .adn-settings__channels,
391
+ .adn-settings__template-list,
392
+ .adn-settings__editor {
393
+ background: var(--adn-surface, transparent);
394
+ border: 1px solid var(--adn-color-border);
395
+ border-radius: var(--adn-radius);
396
+ padding: var(--adn-space-4, 16px);
397
+ }
398
+ .adn-settings__section-title {
399
+ margin: 0;
400
+ font-size: 0.9375rem;
401
+ font-weight: 600;
402
+ }
403
+ .adn-settings__category {
404
+ margin-top: var(--adn-space-4, 16px);
405
+ }
406
+ .adn-settings__category-label {
407
+ margin: 0;
408
+ font-size: 0.875rem;
409
+ font-weight: 500;
410
+ }
411
+ .adn-settings__channel-grid {
412
+ display: grid;
413
+ grid-template-columns: 1fr;
414
+ gap: var(--adn-space-2, 8px);
415
+ margin-top: var(--adn-space-2, 8px);
416
+ }
417
+ @media (min-width: 640px) {
418
+ .adn-settings__channel-grid {
419
+ grid-template-columns: 1fr 1fr;
420
+ }
421
+ }
422
+ .adn-settings__channel {
423
+ display: flex;
424
+ align-items: flex-start;
425
+ gap: var(--adn-space-2, 8px);
426
+ padding: var(--adn-space-2, 8px);
427
+ border: 1px solid var(--adn-color-border);
428
+ border-radius: var(--adn-radius);
429
+ cursor: pointer;
430
+ min-height: 44px;
431
+ }
432
+ .adn-settings__channel input {
433
+ width: 20px;
434
+ height: 20px;
435
+ flex-shrink: 0;
436
+ margin-top: 2px;
437
+ accent-color: var(--adn-color-accent);
438
+ }
439
+ .adn-settings__channel-label {
440
+ display: block;
441
+ font-size: 0.875rem;
442
+ font-weight: 500;
443
+ }
444
+ .adn-settings__template-list ul {
445
+ list-style: none;
446
+ margin: var(--adn-space-3, 12px) 0 0;
447
+ padding: 0;
448
+ }
449
+ .adn-settings__template-list li + li {
450
+ border-top: 1px solid var(--adn-color-border);
451
+ }
452
+ .adn-settings__template-list button {
453
+ display: flex;
454
+ align-items: center;
455
+ gap: var(--adn-space-2, 8px);
456
+ width: 100%;
457
+ min-height: 44px;
458
+ padding: var(--adn-space-2, 8px);
459
+ background: transparent;
460
+ border: 0;
461
+ text-align: left;
462
+ color: inherit;
463
+ cursor: pointer;
464
+ }
465
+ .adn-settings__row--active {
466
+ background: color-mix(in srgb, var(--adn-color-accent) 8%, transparent);
467
+ }
468
+ .adn-settings__row-main {
469
+ flex: 1;
470
+ min-width: 0;
471
+ }
472
+ .adn-settings__row-title,
473
+ .adn-settings__row-body {
474
+ display: block;
475
+ overflow: hidden;
476
+ text-overflow: ellipsis;
477
+ white-space: nowrap;
478
+ }
479
+ .adn-settings__row-title {
480
+ font-size: 0.875rem;
481
+ font-weight: 500;
482
+ }
483
+ .adn-settings__row-body,
484
+ .adn-settings__version {
485
+ font-size: 0.75rem;
486
+ color: var(--adn-color-muted);
487
+ }
488
+ .adn-settings__badge {
489
+ flex-shrink: 0;
490
+ padding: 2px var(--adn-space-2, 8px);
491
+ border-radius: 999px;
492
+ font-size: 0.75rem;
493
+ font-weight: 500;
494
+ background: color-mix(in srgb, var(--adn-color-accent) 12%, transparent);
495
+ }
496
+ .adn-settings__field {
497
+ display: block;
498
+ margin-top: var(--adn-space-3, 12px);
499
+ }
500
+ .adn-settings__field-label {
501
+ font-size: 0.875rem;
502
+ font-weight: 500;
503
+ }
504
+ .adn-settings__field input,
505
+ .adn-settings__field textarea {
506
+ display: block;
507
+ width: 100%;
508
+ margin-top: 4px;
509
+ padding: var(--adn-space-2, 8px);
510
+ font: inherit;
511
+ font-size: 0.875rem;
512
+ color: inherit;
513
+ background: var(--adn-surface, transparent);
514
+ border: 1px solid var(--adn-color-border);
515
+ border-radius: var(--adn-radius);
516
+ }
517
+ .adn-settings__preview {
518
+ margin-top: var(--adn-space-3, 12px);
519
+ padding: var(--adn-space-3, 12px);
520
+ border: 1px solid var(--adn-color-border);
521
+ border-radius: var(--adn-radius);
522
+ background: color-mix(in srgb, var(--adn-color-muted) 8%, transparent);
523
+ }
524
+ .adn-settings__preview-title {
525
+ margin: 0;
526
+ font-size: 0.6875rem;
527
+ font-weight: 600;
528
+ letter-spacing: 0.04em;
529
+ text-transform: uppercase;
530
+ color: var(--adn-color-muted);
531
+ }
532
+ .adn-settings__preview-subject {
533
+ margin: 6px 0 0;
534
+ font-size: 0.875rem;
535
+ font-weight: 500;
536
+ }
537
+ .adn-settings__preview-body {
538
+ margin: 0;
539
+ font-size: 0.875rem;
540
+ white-space: pre-wrap;
541
+ }
542
+ .adn-settings__error {
543
+ margin-top: var(--adn-space-2, 8px);
544
+ font-size: 0.875rem;
545
+ font-weight: 500;
546
+ color: var(--adn-color-danger);
547
+ }
548
+ .adn-settings__actions {
549
+ display: flex;
550
+ align-items: center;
551
+ gap: var(--adn-space-2, 8px);
552
+ margin-top: var(--adn-space-3, 12px);
553
+ }
554
+ .adn-settings__actions button {
555
+ min-height: 44px;
556
+ padding: 0 var(--adn-space-4, 16px);
557
+ font: inherit;
558
+ font-size: 0.875rem;
559
+ font-weight: 500;
560
+ color: #ffffff;
561
+ background: var(--adn-color-accent);
562
+ border: 0;
563
+ border-radius: var(--adn-radius);
564
+ cursor: pointer;
565
+ }
566
+ .adn-settings__actions button:disabled {
567
+ opacity: 0.5;
568
+ cursor: default;
569
+ }
313
570
  /*# sourceMappingURL=styles.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/styles.css"],"sourcesContent":["/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n *\n * O pacote não tem cor própria (regra de módulos plugáveis §4.1): tudo sai de custom properties\n * com fallback neutro. O host sobrescreve `--adn-*` no escopo dele e a mesma tela ganha a cara do\n * produto — sem fork, sem prop de cor, sem valor hexadecimal aqui dentro que não seja fallback.\n */\n\n.adn-bell,\n.adn-list,\n.adn-preferences {\n --adn-color-surface: var(--adn-surface, #ffffff);\n --adn-color-text: var(--adn-text, #111827);\n --adn-color-muted: var(--adn-muted, #6b7280);\n --adn-color-accent: var(--adn-accent, #3b82f6);\n --adn-color-danger: var(--adn-danger, #dc2626);\n --adn-color-border: var(--adn-border, #e5e7eb);\n --adn-radius: var(--adn-radius-md, 8px);\n /* Grade base de 4px (web.md §8) — múltiplos, nunca pixel mágico. */\n --adn-space-1: 4px;\n --adn-space-2: 8px;\n --adn-space-3: 12px;\n --adn-space-4: 16px;\n /* 44px: alvo mínimo de toque em mobile (web.md §10). */\n --adn-touch-target: 44px;\n\n color: var(--adn-color-text);\n font-family: inherit;\n}\n\n/* ── Sino ─────────────────────────────────────────────────────────────────────── */\n\n.adn-bell {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--adn-touch-target);\n min-height: var(--adn-touch-target);\n padding: var(--adn-space-2);\n background: transparent;\n border: none;\n border-radius: var(--adn-radius);\n cursor: pointer;\n color: inherit;\n}\n\n.adn-bell:hover {\n background: var(--adn-color-border);\n}\n\n/* Foco visível é requisito de teclado — remover outline sem repor indicador quebra navegação. */\n.adn-bell:focus-visible,\n.adn-list__bulk-action:focus-visible,\n.adn-list__retry:focus-visible,\n.adn-list__load-more:focus-visible,\n.adn-item__main:focus-visible,\n.adn-item__action:focus-visible,\n.adn-preferences__save:focus-visible {\n outline: 2px solid var(--adn-color-accent);\n outline-offset: 2px;\n}\n\n.adn-bell__icon {\n width: 20px;\n height: 20px;\n /* Herda a cor do botão, para acompanhar hover e estado desabilitado sem regra extra. */\n color: currentColor;\n}\n\n.adn-bell__badge {\n position: absolute;\n top: var(--adn-space-1);\n right: var(--adn-space-1);\n min-width: 18px;\n padding: 0 var(--adn-space-1);\n background: var(--adn-color-danger);\n color: #ffffff;\n border-radius: 9999px;\n font-size: 11px;\n line-height: 18px;\n text-align: center;\n}\n\n/* ── Lista ────────────────────────────────────────────────────────────────────── */\n\n.adn-list {\n display: flex;\n flex-direction: column;\n gap: var(--adn-space-2);\n background: var(--adn-color-surface);\n border-radius: var(--adn-radius);\n}\n\n.adn-list__header {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: var(--adn-space-2);\n padding: var(--adn-space-3);\n border-bottom: 1px solid var(--adn-color-border);\n}\n\n.adn-list__title {\n margin: 0;\n font-size: 1rem;\n font-weight: 600;\n}\n\n.adn-list__bulk-action,\n.adn-list__retry,\n.adn-list__load-more {\n display: inline-flex;\n align-items: center;\n gap: var(--adn-space-2);\n min-height: var(--adn-touch-target);\n padding: var(--adn-space-2) var(--adn-space-3);\n background: transparent;\n border: 1px solid var(--adn-color-border);\n border-radius: var(--adn-radius);\n color: var(--adn-color-accent);\n cursor: pointer;\n font: inherit;\n}\n\n.adn-list__bulk-action:disabled,\n.adn-list__load-more:disabled,\n.adn-item__action:disabled,\n.adn-preferences__save:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.adn-list__bulk-icon,\n.adn-list__retry-icon,\n.adn-preferences__save-icon {\n width: 16px;\n height: 16px;\n color: currentColor;\n}\n\n.adn-list__items {\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.adn-list__state {\n padding: var(--adn-space-4);\n color: var(--adn-color-muted);\n text-align: center;\n}\n\n.adn-list__state--error {\n color: var(--adn-color-danger);\n}\n\n.adn-list__state--empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--adn-space-2);\n}\n\n.adn-list__empty-icon {\n width: 32px;\n height: 32px;\n color: var(--adn-color-muted);\n}\n\n/* ── Item ─────────────────────────────────────────────────────────────────────── */\n\n.adn-item {\n display: flex;\n align-items: stretch;\n gap: var(--adn-space-2);\n border-bottom: 1px solid var(--adn-color-border);\n}\n\n.adn-item--unread {\n background: color-mix(in srgb, var(--adn-color-accent) 6%, transparent);\n}\n\n.adn-item__main {\n position: relative;\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--adn-space-1);\n min-height: var(--adn-touch-target);\n padding: var(--adn-space-3);\n background: transparent;\n border: none;\n cursor: pointer;\n font: inherit;\n color: inherit;\n text-align: left;\n}\n\n.adn-item__title {\n font-weight: 600;\n}\n\n.adn-item__body {\n color: var(--adn-color-muted);\n font-size: 0.875rem;\n}\n\n.adn-item__unread-dot {\n position: absolute;\n top: var(--adn-space-3);\n right: var(--adn-space-2);\n width: 8px;\n height: 8px;\n background: var(--adn-color-accent);\n border-radius: 9999px;\n}\n\n.adn-item__actions {\n display: flex;\n align-items: center;\n gap: var(--adn-space-1);\n padding-right: var(--adn-space-2);\n}\n\n.adn-item__action {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--adn-touch-target);\n min-height: var(--adn-touch-target);\n background: transparent;\n border: none;\n border-radius: var(--adn-radius);\n color: var(--adn-color-muted);\n cursor: pointer;\n}\n\n.adn-item__action:hover {\n background: var(--adn-color-border);\n color: var(--adn-color-text);\n}\n\n.adn-item__action--danger:hover {\n color: var(--adn-color-danger);\n}\n\n.adn-item__action-icon {\n width: 18px;\n height: 18px;\n color: currentColor;\n}\n\n/* ── Preferências ─────────────────────────────────────────────────────────────── */\n\n.adn-preferences {\n display: flex;\n flex-direction: column;\n gap: var(--adn-space-3);\n padding: var(--adn-space-3);\n background: var(--adn-color-surface);\n border-radius: var(--adn-radius);\n}\n\n.adn-preferences__title {\n margin: 0;\n font-size: 1rem;\n font-weight: 600;\n}\n\n.adn-preferences__description,\n.adn-preferences__state {\n margin: 0;\n color: var(--adn-color-muted);\n font-size: 0.875rem;\n}\n\n.adn-preferences__items {\n display: flex;\n flex-direction: column;\n gap: var(--adn-space-2);\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.adn-preferences__item {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: var(--adn-space-2);\n min-height: var(--adn-touch-target);\n}\n\n.adn-preferences__label {\n display: inline-flex;\n align-items: center;\n gap: var(--adn-space-2);\n cursor: pointer;\n}\n\n.adn-preferences__checkbox {\n width: 18px;\n height: 18px;\n accent-color: var(--adn-color-accent);\n}\n\n.adn-preferences__channel,\n.adn-preferences__quiet-hours {\n color: var(--adn-color-muted);\n font-size: 0.875rem;\n}\n\n.adn-preferences__footer {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--adn-space-3);\n}\n\n.adn-preferences__save {\n display: inline-flex;\n align-items: center;\n gap: var(--adn-space-2);\n min-height: var(--adn-touch-target);\n padding: var(--adn-space-2) var(--adn-space-4);\n background: var(--adn-color-accent);\n border: none;\n border-radius: var(--adn-radius);\n color: #ffffff;\n cursor: pointer;\n font: inherit;\n}\n\n.adn-preferences__feedback {\n font-size: 0.875rem;\n color: var(--adn-color-muted);\n}\n\n.adn-preferences__feedback--error {\n color: var(--adn-color-danger);\n}\n\n/* ── Responsivo ───────────────────────────────────────────────────────────────── */\n\n/* Mobile-first: `min-width` para adicionar, nunca `max-` para remover (web.md §10). */\n@media (min-width: 640px) {\n .adn-list__header {\n padding: var(--adn-space-3) var(--adn-space-4);\n }\n\n .adn-item__main {\n padding: var(--adn-space-3) var(--adn-space-4);\n }\n}\n\n@media (prefers-color-scheme: dark) {\n .adn-bell,\n .adn-list,\n .adn-preferences {\n --adn-color-surface: var(--adn-surface, #111827);\n --adn-color-text: var(--adn-text, #f9fafb);\n --adn-color-muted: var(--adn-muted, #9ca3af);\n --adn-color-border: var(--adn-border, #374151);\n }\n}\n\n/* Respeita quem pediu menos movimento no sistema. */\n@media (prefers-reduced-motion: reduce) {\n .adn-bell,\n .adn-item__action,\n .adn-list__bulk-action {\n transition: none;\n }\n}\n"],"mappings":";AAQA,CAAC;AACD,CAAC;AACD,CAAC;AACC,uBAAqB,IAAI,aAAa,EAAE;AACxC,oBAAkB,IAAI,UAAU,EAAE;AAClC,qBAAmB,IAAI,WAAW,EAAE;AACpC,sBAAoB,IAAI,YAAY,EAAE;AACtC,sBAAoB,I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AAI;AACb;AAKA,QAAO,WAAY;AACjB,GAjQD;AAkQG,aAAS,IAAI,eAAe,IAAI;AAClC;AAEA,GA3SD;AA4SG,aAAS,IAAI,eAAe,IAAI;AAClC;AACF;AAEA,QAAO,sBAAuB;AAC5B,GAjWD;AAAA,EAkWC,CAjWD;AAAA,EAkWC,CAjWD;AAkWG,yBAAqB,IAAI,aAAa,EAAE;AACxC,sBAAkB,IAAI,UAAU,EAAE;AAClC,uBAAmB,IAAI,WAAW,EAAE;AACpC,wBAAoB,IAAI,YAAY,EAAE;AACxC;AACF;AAGA,QAAO,wBAAyB;AAC9B,GA7WD;AAAA,EA8WC,CA7TD;AAAA,EA8TC,CAlUD;AAmUG,gBAAY;AACd;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/styles.css"],"sourcesContent":["/**\n * Copyright (c) 2026 Ada Technology. MIT License.\n *\n * O pacote não tem cor própria (regra de módulos plugáveis §4.1): tudo sai de custom properties\n * com fallback neutro. O host sobrescreve `--adn-*` no escopo dele e a mesma tela ganha a cara do\n * produto — sem fork, sem prop de cor, sem valor hexadecimal aqui dentro que não seja fallback.\n */\n\n.adn-bell,\n.adn-list,\n.adn-preferences,\n.adn-workspace,\n.adn-settings {\n --adn-color-surface: var(--adn-surface, #ffffff);\n --adn-color-text: var(--adn-text, #111827);\n --adn-color-muted: var(--adn-muted, #6b7280);\n --adn-color-accent: var(--adn-accent, #3b82f6);\n --adn-color-danger: var(--adn-danger, #dc2626);\n --adn-color-border: var(--adn-border, #e5e7eb);\n --adn-radius: var(--adn-radius-md, 8px);\n /* Grade base de 4px (web.md §8) — múltiplos, nunca pixel mágico. */\n --adn-space-1: 4px;\n --adn-space-2: 8px;\n --adn-space-3: 12px;\n --adn-space-4: 16px;\n /* 44px: alvo mínimo de toque em mobile (web.md §10). */\n --adn-touch-target: 44px;\n\n color: var(--adn-color-text);\n font-family: inherit;\n}\n\n/* ── Sino ─────────────────────────────────────────────────────────────────────── */\n\n.adn-bell {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--adn-touch-target);\n min-height: var(--adn-touch-target);\n padding: var(--adn-space-2);\n background: transparent;\n border: none;\n border-radius: var(--adn-radius);\n cursor: pointer;\n color: inherit;\n}\n\n.adn-bell:hover {\n background: var(--adn-color-border);\n}\n\n/* Foco visível é requisito de teclado — remover outline sem repor indicador quebra navegação. */\n.adn-bell:focus-visible,\n.adn-list__bulk-action:focus-visible,\n.adn-list__retry:focus-visible,\n.adn-list__load-more:focus-visible,\n.adn-item__main:focus-visible,\n.adn-item__action:focus-visible,\n.adn-preferences__save:focus-visible {\n outline: 2px solid var(--adn-color-accent);\n outline-offset: 2px;\n}\n\n.adn-bell__icon {\n width: 20px;\n height: 20px;\n /* Herda a cor do botão, para acompanhar hover e estado desabilitado sem regra extra. */\n color: currentColor;\n}\n\n.adn-bell__badge {\n position: absolute;\n top: var(--adn-space-1);\n right: var(--adn-space-1);\n min-width: 18px;\n padding: 0 var(--adn-space-1);\n background: var(--adn-color-danger);\n color: #ffffff;\n border-radius: 9999px;\n font-size: 11px;\n line-height: 18px;\n text-align: center;\n}\n\n/* ── Lista ────────────────────────────────────────────────────────────────────── */\n\n.adn-list {\n display: flex;\n flex-direction: column;\n gap: var(--adn-space-2);\n background: var(--adn-color-surface);\n border-radius: var(--adn-radius);\n}\n\n.adn-list__header {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: var(--adn-space-2);\n padding: var(--adn-space-3);\n border-bottom: 1px solid var(--adn-color-border);\n}\n\n.adn-list__title {\n margin: 0;\n font-size: 1rem;\n font-weight: 600;\n}\n\n.adn-list__bulk-action,\n.adn-list__retry,\n.adn-list__load-more {\n display: inline-flex;\n align-items: center;\n gap: var(--adn-space-2);\n min-height: var(--adn-touch-target);\n padding: var(--adn-space-2) var(--adn-space-3);\n background: transparent;\n border: 1px solid var(--adn-color-border);\n border-radius: var(--adn-radius);\n color: var(--adn-color-accent);\n cursor: pointer;\n font: inherit;\n}\n\n.adn-list__bulk-action:disabled,\n.adn-list__load-more:disabled,\n.adn-item__action:disabled,\n.adn-preferences__save:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.adn-list__bulk-icon,\n.adn-list__retry-icon,\n.adn-preferences__save-icon {\n width: 16px;\n height: 16px;\n color: currentColor;\n}\n\n.adn-list__items {\n display: flex;\n flex-direction: column;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.adn-list__state {\n padding: var(--adn-space-4);\n color: var(--adn-color-muted);\n text-align: center;\n}\n\n.adn-list__state--error {\n color: var(--adn-color-danger);\n}\n\n.adn-list__state--empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: var(--adn-space-2);\n}\n\n.adn-list__empty-icon {\n width: 32px;\n height: 32px;\n color: var(--adn-color-muted);\n}\n\n/* ── Item ─────────────────────────────────────────────────────────────────────── */\n\n.adn-item {\n display: flex;\n align-items: stretch;\n gap: var(--adn-space-2);\n border-bottom: 1px solid var(--adn-color-border);\n}\n\n.adn-item--unread {\n background: color-mix(in srgb, var(--adn-color-accent) 6%, transparent);\n}\n\n.adn-item__main {\n position: relative;\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--adn-space-1);\n min-height: var(--adn-touch-target);\n padding: var(--adn-space-3);\n background: transparent;\n border: none;\n cursor: pointer;\n font: inherit;\n color: inherit;\n text-align: left;\n}\n\n.adn-item__title {\n font-weight: 600;\n}\n\n.adn-item__body {\n color: var(--adn-color-muted);\n font-size: 0.875rem;\n}\n\n.adn-item__unread-dot {\n position: absolute;\n top: var(--adn-space-3);\n right: var(--adn-space-2);\n width: 8px;\n height: 8px;\n background: var(--adn-color-accent);\n border-radius: 9999px;\n}\n\n.adn-item__actions {\n display: flex;\n align-items: center;\n gap: var(--adn-space-1);\n padding-right: var(--adn-space-2);\n}\n\n.adn-item__action {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--adn-touch-target);\n min-height: var(--adn-touch-target);\n background: transparent;\n border: none;\n border-radius: var(--adn-radius);\n color: var(--adn-color-muted);\n cursor: pointer;\n}\n\n.adn-item__action:hover {\n background: var(--adn-color-border);\n color: var(--adn-color-text);\n}\n\n.adn-item__action--danger:hover {\n color: var(--adn-color-danger);\n}\n\n.adn-item__action-icon {\n width: 18px;\n height: 18px;\n color: currentColor;\n}\n\n/* ── Preferências ─────────────────────────────────────────────────────────────── */\n\n.adn-preferences {\n display: flex;\n flex-direction: column;\n gap: var(--adn-space-3);\n padding: var(--adn-space-3);\n background: var(--adn-color-surface);\n border-radius: var(--adn-radius);\n}\n\n.adn-preferences__title {\n margin: 0;\n font-size: 1rem;\n font-weight: 600;\n}\n\n.adn-preferences__description,\n.adn-preferences__state {\n margin: 0;\n color: var(--adn-color-muted);\n font-size: 0.875rem;\n}\n\n.adn-preferences__items {\n display: flex;\n flex-direction: column;\n gap: var(--adn-space-2);\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.adn-preferences__item {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: var(--adn-space-2);\n min-height: var(--adn-touch-target);\n}\n\n.adn-preferences__label {\n display: inline-flex;\n align-items: center;\n gap: var(--adn-space-2);\n cursor: pointer;\n}\n\n.adn-preferences__checkbox {\n width: 18px;\n height: 18px;\n accent-color: var(--adn-color-accent);\n}\n\n.adn-preferences__channel,\n.adn-preferences__quiet-hours {\n color: var(--adn-color-muted);\n font-size: 0.875rem;\n}\n\n.adn-preferences__footer {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--adn-space-3);\n}\n\n.adn-preferences__save {\n display: inline-flex;\n align-items: center;\n gap: var(--adn-space-2);\n min-height: var(--adn-touch-target);\n padding: var(--adn-space-2) var(--adn-space-4);\n background: var(--adn-color-accent);\n border: none;\n border-radius: var(--adn-radius);\n color: #ffffff;\n cursor: pointer;\n font: inherit;\n}\n\n.adn-preferences__feedback {\n font-size: 0.875rem;\n color: var(--adn-color-muted);\n}\n\n.adn-preferences__feedback--error {\n color: var(--adn-color-danger);\n}\n\n/* ── Responsivo ───────────────────────────────────────────────────────────────── */\n\n/* Mobile-first: `min-width` para adicionar, nunca `max-` para remover (web.md §10). */\n@media (min-width: 640px) {\n .adn-list__header {\n padding: var(--adn-space-3) var(--adn-space-4);\n }\n\n .adn-item__main {\n padding: var(--adn-space-3) var(--adn-space-4);\n }\n}\n\n@media (prefers-color-scheme: dark) {\n /* Só as peças herdam o palpite por sistema — as telas compostas herdam do host, que é quem sabe. */\n .adn-bell,\n .adn-list,\n .adn-preferences {\n --adn-color-surface: var(--adn-surface, #111827);\n --adn-color-text: var(--adn-text, #f9fafb);\n --adn-color-muted: var(--adn-muted, #9ca3af);\n --adn-color-border: var(--adn-border, #374151);\n }\n}\n\n/* Respeita quem pediu menos movimento no sistema. */\n@media (prefers-reduced-motion: reduce) {\n .adn-bell,\n .adn-item__action,\n .adn-list__bulk-action {\n transition: none;\n }\n}\n\n/* ---------------------------------------------------------------------------\n Telas compostas.\n\n SUPERFÍCIE TRANSPARENTE por padrão, e a borda é que delineia o card.\n\n As peças (`adn-list`, `adn-preferences`) pintavam fundo próprio, e passava porque o host as punha\n dentro de um `Card` dele — o fundo do host vencia. O workspace É o card, então o fundo do pacote\n aparece: com o sistema em modo escuro, o pacote pintava escuro enquanto o Tailwind do host\n renderizava claro. O pacote lê `prefers-color-scheme`, o host lê o tema DELE, e os dois discordam.\n Herdar é a única resposta que funciona nos dois casos; quem quiser fundo sólido define\n `--adn-surface`.\n\n Grid mobile-first: uma coluna, e a segunda entra a partir de 1024px. Área de toque de 44px nos\n controles (`web.md` §10) — checkbox nativo mede 13px, e configuração é tela que se ajusta no\n celular tanto quanto no monitor.\n --------------------------------------------------------------------------- */\n\n.adn-workspace,\n.adn-settings {\n display: flex;\n flex-direction: column;\n gap: var(--adn-space-4, 16px);\n /* `inherit` e não o token: a cor de texto do host já está no elemento pai. */\n color: inherit;\n}\n\n.adn-workspace__header,\n.adn-settings__header,\n.adn-settings__editor-header {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n justify-content: space-between;\n gap: var(--adn-space-3, 12px);\n}\n\n.adn-workspace__title,\n.adn-settings__title {\n margin: 0;\n font-size: 1.25rem;\n font-weight: 600;\n}\n\n.adn-workspace__description,\n.adn-settings__description,\n.adn-settings__hint {\n /* `block` porque o hint é <span> dentro de <label>: inline, ele colava no rótulo e a tela mostrava\n \"TítuloO que aparece na lista\". */\n display: block;\n margin: 2px 0 0;\n font-size: 0.8125rem;\n color: var(--adn-color-muted);\n}\n\n.adn-workspace__actions {\n display: flex;\n align-items: center;\n gap: var(--adn-space-2, 8px);\n}\n\n.adn-button {\n display: inline-flex;\n align-items: center;\n gap: var(--adn-space-2, 8px);\n min-height: 44px;\n padding: 0 var(--adn-space-3, 12px);\n border-radius: var(--adn-radius);\n font-size: 0.875rem;\n font-weight: 500;\n text-decoration: none;\n color: inherit;\n background: transparent;\n border: 1px solid transparent;\n cursor: pointer;\n}\n\n.adn-button--outline {\n border-color: var(--adn-color-border);\n background: var(--adn-surface, transparent);\n}\n\n.adn-workspace__grid,\n.adn-settings__templates {\n display: grid;\n grid-template-columns: 1fr;\n gap: var(--adn-space-4, 16px);\n}\n\n.adn-workspace__grid--single {\n display: grid;\n grid-template-columns: 1fr;\n}\n\n@media (min-width: 1024px) {\n .adn-workspace__grid {\n grid-template-columns: 2fr 1fr;\n }\n\n .adn-settings__templates {\n grid-template-columns: 2fr 3fr;\n }\n\n /* Botão volta ao tamanho de mouse: 44px existe para o dedo. */\n .adn-button {\n min-height: 36px;\n }\n}\n\n.adn-settings__channels,\n.adn-settings__template-list,\n.adn-settings__editor {\n background: var(--adn-surface, transparent);\n border: 1px solid var(--adn-color-border);\n border-radius: var(--adn-radius);\n padding: var(--adn-space-4, 16px);\n}\n\n.adn-settings__section-title {\n margin: 0;\n font-size: 0.9375rem;\n font-weight: 600;\n}\n\n.adn-settings__category {\n margin-top: var(--adn-space-4, 16px);\n}\n\n.adn-settings__category-label {\n margin: 0;\n font-size: 0.875rem;\n font-weight: 500;\n}\n\n.adn-settings__channel-grid {\n display: grid;\n grid-template-columns: 1fr;\n gap: var(--adn-space-2, 8px);\n margin-top: var(--adn-space-2, 8px);\n}\n\n@media (min-width: 640px) {\n .adn-settings__channel-grid {\n grid-template-columns: 1fr 1fr;\n }\n}\n\n.adn-settings__channel {\n display: flex;\n align-items: flex-start;\n gap: var(--adn-space-2, 8px);\n padding: var(--adn-space-2, 8px);\n border: 1px solid var(--adn-color-border);\n border-radius: var(--adn-radius);\n cursor: pointer;\n /* Alvo de toque inteiro na linha, não só no quadradinho. */\n min-height: 44px;\n}\n\n.adn-settings__channel input {\n width: 20px;\n height: 20px;\n flex-shrink: 0;\n margin-top: 2px;\n accent-color: var(--adn-color-accent);\n}\n\n.adn-settings__channel-label {\n display: block;\n font-size: 0.875rem;\n font-weight: 500;\n}\n\n.adn-settings__template-list ul {\n list-style: none;\n margin: var(--adn-space-3, 12px) 0 0;\n padding: 0;\n}\n\n.adn-settings__template-list li + li {\n border-top: 1px solid var(--adn-color-border);\n}\n\n.adn-settings__template-list button {\n display: flex;\n align-items: center;\n gap: var(--adn-space-2, 8px);\n width: 100%;\n min-height: 44px;\n padding: var(--adn-space-2, 8px);\n background: transparent;\n border: 0;\n text-align: left;\n color: inherit;\n cursor: pointer;\n}\n\n.adn-settings__row--active {\n background: color-mix(in srgb, var(--adn-color-accent) 8%, transparent);\n}\n\n.adn-settings__row-main {\n flex: 1;\n min-width: 0;\n}\n\n.adn-settings__row-title,\n.adn-settings__row-body {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.adn-settings__row-title {\n font-size: 0.875rem;\n font-weight: 500;\n}\n\n.adn-settings__row-body,\n.adn-settings__version {\n font-size: 0.75rem;\n color: var(--adn-color-muted);\n}\n\n.adn-settings__badge {\n flex-shrink: 0;\n padding: 2px var(--adn-space-2, 8px);\n border-radius: 999px;\n font-size: 0.75rem;\n font-weight: 500;\n background: color-mix(in srgb, var(--adn-color-accent) 12%, transparent);\n}\n\n.adn-settings__field {\n display: block;\n margin-top: var(--adn-space-3, 12px);\n}\n\n.adn-settings__field-label {\n font-size: 0.875rem;\n font-weight: 500;\n}\n\n.adn-settings__field input,\n.adn-settings__field textarea {\n display: block;\n width: 100%;\n margin-top: 4px;\n padding: var(--adn-space-2, 8px);\n font: inherit;\n font-size: 0.875rem;\n color: inherit;\n background: var(--adn-surface, transparent);\n border: 1px solid var(--adn-color-border);\n border-radius: var(--adn-radius);\n}\n\n.adn-settings__preview {\n margin-top: var(--adn-space-3, 12px);\n padding: var(--adn-space-3, 12px);\n border: 1px solid var(--adn-color-border);\n border-radius: var(--adn-radius);\n background: color-mix(in srgb, var(--adn-color-muted) 8%, transparent);\n}\n\n.adn-settings__preview-title {\n margin: 0;\n font-size: 0.6875rem;\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--adn-color-muted);\n}\n\n.adn-settings__preview-subject {\n margin: 6px 0 0;\n font-size: 0.875rem;\n font-weight: 500;\n}\n\n.adn-settings__preview-body {\n margin: 0;\n font-size: 0.875rem;\n /* Quebra de linha do template é conteúdo: o destinatário vê os parágrafos. */\n white-space: pre-wrap;\n}\n\n.adn-settings__error {\n margin-top: var(--adn-space-2, 8px);\n font-size: 0.875rem;\n font-weight: 500;\n color: var(--adn-color-danger);\n}\n\n.adn-settings__actions {\n display: flex;\n align-items: center;\n gap: var(--adn-space-2, 8px);\n margin-top: var(--adn-space-3, 12px);\n}\n\n.adn-settings__actions button {\n min-height: 44px;\n padding: 0 var(--adn-space-4, 16px);\n font: inherit;\n font-size: 0.875rem;\n font-weight: 500;\n color: #ffffff;\n background: var(--adn-color-accent);\n border: 0;\n border-radius: var(--adn-radius);\n cursor: pointer;\n}\n\n.adn-settings__actions button:disabled {\n opacity: 0.5;\n cursor: default;\n}\n"],"mappings":";AAQA,CAAC;AACD,CAAC;AACD,CAAC;AACD,CAAC;AACD,CAAC;AACC,uBAAqB,IA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CAAC;AACC,UAAQ;AACR,aAAW;AACX,eAAa;AACb,kBAAgB;AAChB,kBAAgB;AAChB,SAAO,IAAI;AACb;AAEA,CAAC;AACC,UAAQ,IAAI,EAAE;AACd,aAAW;AACX,eAAa;AACf;AAEA,CAAC;AACC,UAAQ;AACR,aAAW;AAEX,eAAa;AACf;AAEA,CAAC;AACC,cAAY,IAAI,aAAa,EAAE;AAC/B,aAAW;AACX,eAAa;AACb,SAAO,IAAI;AACb;AAEA,CAAC;AACC,WAAS;AACT,eAAa;AACb,OAAK,IAAI,aAAa,EAAE;AACxB,cAAY,IAAI,aAAa,EAAE;AACjC;AAEA,CAPC,sBAOsB;AACrB,cAAY;AACZ,WAAS,EAAE,IAAI,aAAa,EAAE;AAC9B,QAAM;AACN,aAAW;AACX,eAAa;AACb,SAAO;AACP,cAAY,IAAI;AAChB,UAAQ;AACR,iBAAe,IAAI;AACnB,UAAQ;AACV;AAEA,CApBC,sBAoBsB,MAAM;AAC3B,WAAS;AACT,UAAQ;AACV;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adatechnology/notification-ui",
3
- "version": "0.1.0-rc.1",
3
+ "version": "0.1.0-rc.2",
4
4
  "license": "MIT",
5
5
  "description": "Notification UI — headless hooks + componentes de inbox, sino e preferências",
6
6
  "publishConfig": {
@@ -26,8 +26,8 @@
26
26
  "dependencies": {
27
27
  "clsx": "^2.1.1",
28
28
  "lucide-react": "^1.21.0",
29
- "@adatechnology/notification-client": "0.1.0-rc.1",
30
- "@adatechnology/notification-contracts": "0.1.0-rc.1"
29
+ "@adatechnology/notification-client": "0.1.0-rc.2",
30
+ "@adatechnology/notification-contracts": "0.1.0-rc.2"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@tanstack/react-query": "^5",