@fast-food/design-system 1.33.0 → 1.35.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.
Files changed (38) hide show
  1. package/dist/components/atoms/Icon/iconRegistry.d.ts +1 -0
  2. package/dist/components/molecules/FormSection/FormSection.d.ts +13 -0
  3. package/dist/components/molecules/FormSection/FormSection.style.d.ts +7 -0
  4. package/dist/components/molecules/FormSection/FormSection.type.d.ts +15 -0
  5. package/dist/components/molecules/FormSection/index.d.ts +2 -0
  6. package/dist/components/molecules/ModeToggle/ModeToggle.d.ts +6 -0
  7. package/dist/components/molecules/ModeToggle/ModeToggle.style.d.ts +10 -0
  8. package/dist/components/molecules/ModeToggle/ModeToggle.type.d.ts +21 -0
  9. package/dist/components/molecules/ModeToggle/index.d.ts +2 -0
  10. package/dist/components/molecules/index.d.ts +2 -0
  11. package/dist/components/organisms/ConfirmationModal/ConfirmationModal.d.ts +7 -0
  12. package/dist/components/organisms/ConfirmationModal/ConfirmationModal.style.d.ts +6 -0
  13. package/dist/components/organisms/ConfirmationModal/ConfirmationModal.type.d.ts +24 -0
  14. package/dist/components/organisms/ConfirmationModal/ConfirmationModalHost.d.ts +6 -0
  15. package/dist/components/organisms/ConfirmationModal/confirm.d.ts +11 -0
  16. package/dist/components/organisms/ConfirmationModal/confirmStore.d.ts +19 -0
  17. package/dist/components/organisms/ConfirmationModal/index.d.ts +6 -0
  18. package/dist/components/organisms/ConfirmationModal/useConfirmationModal.d.ts +9 -0
  19. package/dist/components/organisms/Toaster/Toaster.d.ts +10 -0
  20. package/dist/components/organisms/Toaster/Toaster.style.d.ts +4 -0
  21. package/dist/components/organisms/Toaster/index.d.ts +5 -0
  22. package/dist/components/organisms/Toaster/toast.d.ts +27 -0
  23. package/dist/components/organisms/Toaster/toast.type.d.ts +32 -0
  24. package/dist/components/organisms/Toaster/toastStore.d.ts +17 -0
  25. package/dist/components/organisms/index.d.ts +2 -0
  26. package/dist/contexts/index.d.ts +1 -0
  27. package/dist/contexts/theme/ThemeProvider.d.ts +8 -0
  28. package/dist/contexts/theme/index.d.ts +3 -0
  29. package/dist/contexts/theme/theme.context.d.ts +7 -0
  30. package/dist/contexts/theme/theme.type.d.ts +23 -0
  31. package/dist/contexts/theme/useTheme.d.ts +6 -0
  32. package/dist/fast-food-design-system-1.35.0.tgz +0 -0
  33. package/dist/fast-food-design-system.cjs.js +159 -154
  34. package/dist/fast-food-design-system.css +1 -1
  35. package/dist/fast-food-design-system.es.js +13956 -13552
  36. package/dist/index.d.ts +1 -0
  37. package/package.json +1 -1
  38. package/dist/fast-food-design-system-1.33.0.tgz +0 -0
@@ -47,6 +47,7 @@ export declare const iconRegistry: {
47
47
  readonly menu: import('react').ForwardRefExoticComponent<Omit<import('lucide-react').LucideProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
48
48
  readonly 'message-circle': import('react').ForwardRefExoticComponent<Omit<import('lucide-react').LucideProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
49
49
  readonly minus: import('react').ForwardRefExoticComponent<Omit<import('lucide-react').LucideProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
50
+ readonly monitor: import('react').ForwardRefExoticComponent<Omit<import('lucide-react').LucideProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
50
51
  readonly moon: import('react').ForwardRefExoticComponent<Omit<import('lucide-react').LucideProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
51
52
  readonly 'more-vertical': import('react').ForwardRefExoticComponent<Omit<import('lucide-react').LucideProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
52
53
  readonly package: import('react').ForwardRefExoticComponent<Omit<import('lucide-react').LucideProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { FormSectionProps } from './FormSection.type';
3
+ /**
4
+ * Agrupa campos de um formulário sob um título discreto, padronizando o
5
+ * espaçamento e a divisória entre seções (substitui agrupamentos ad-hoc).
6
+ *
7
+ * @example
8
+ * <FormSection title="Endereço" description="Onde a filial atende">
9
+ * <TextField ... />
10
+ * </FormSection>
11
+ */
12
+ export declare const FormSection: React.FC<FormSectionProps>;
13
+ export default FormSection;
@@ -0,0 +1,7 @@
1
+ export declare const formSectionStyles: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
2
+ export declare const formSectionHeaderStyles: (props?: ({
3
+ divider?: boolean | null | undefined;
4
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
5
+ export declare const formSectionTitleStyles: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
6
+ export declare const formSectionDescriptionStyles: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
7
+ export declare const formSectionBodyStyles: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ export interface FormSectionProps {
3
+ /** Título da seção (renderizado em caixa-alta discreta). */
4
+ title?: string;
5
+ /** Texto de apoio abaixo do título. */
6
+ description?: ReactNode;
7
+ /** Conteúdo opcional alinhado à direita do cabeçalho (ex.: switch, botão). */
8
+ actions?: ReactNode;
9
+ /** Campos da seção. */
10
+ children: ReactNode;
11
+ /** Remove a divisória sob o cabeçalho. */
12
+ hideDivider?: boolean;
13
+ /** Classe adicional no container. */
14
+ className?: string;
15
+ }
@@ -0,0 +1,2 @@
1
+ export * from './FormSection';
2
+ export * from './FormSection.type';
@@ -0,0 +1,6 @@
1
+ import { ModeToggleProps } from './ModeToggle.type';
2
+ /**
3
+ * Controle de troca de tema. Deve estar dentro de um `<ThemeProvider>`.
4
+ */
5
+ export declare const ModeToggle: ({ variant, size, includeSystem, className, "aria-label": ariaLabel }: ModeToggleProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default ModeToggle;
@@ -0,0 +1,10 @@
1
+ export declare const modeToggleGroupStyles: (props?: ({
2
+ size?: "sm" | "md" | null | undefined;
3
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
4
+ export declare const modeToggleOptionStyles: (props?: ({
5
+ size?: "sm" | "md" | null | undefined;
6
+ active?: boolean | null | undefined;
7
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
+ export declare const modeToggleIconButtonStyles: (props?: ({
9
+ size?: "sm" | "md" | null | undefined;
10
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -0,0 +1,21 @@
1
+ import { Theme } from '../../../contexts/theme/theme.type';
2
+ export interface ModeToggleProps {
3
+ /**
4
+ * `segmented` mostra os três modos (claro/escuro/sistema) lado a lado.
5
+ * `icon` mostra um único botão que alterna entre os modos.
6
+ */
7
+ variant?: 'segmented' | 'icon';
8
+ /** Tamanho do controle. */
9
+ size?: 'sm' | 'md';
10
+ /** Inclui a opção "Sistema". Padrão: true. */
11
+ includeSystem?: boolean;
12
+ /** Classe adicional no container. */
13
+ className?: string;
14
+ /** Rótulo acessível do controle. Padrão: "Alternar tema". */
15
+ 'aria-label'?: string;
16
+ }
17
+ export interface ThemeOptionMeta {
18
+ value: Theme;
19
+ label: string;
20
+ icon: 'sun' | 'moon' | 'monitor';
21
+ }
@@ -0,0 +1,2 @@
1
+ export * from './ModeToggle';
2
+ export * from './ModeToggle.type';
@@ -12,9 +12,11 @@ export * from './FilterBar';
12
12
  export * from './FilterForm';
13
13
  export * from './FormFields';
14
14
  export * from './FormField';
15
+ export * from './FormSection';
15
16
  export * from './Form';
16
17
  export * from './Grid';
17
18
  export * from './ListingTable';
19
+ export * from './ModeToggle';
18
20
  export * from './PageLoadingSkeleton';
19
21
  export * from './PageHeader';
20
22
  export * from './Pagination';
@@ -0,0 +1,7 @@
1
+ import { ConfirmationModalProps } from './ConfirmationModal.type';
2
+ /**
3
+ * Diálogo de confirmação controlado. Para uso imperativo, prefira
4
+ * `confirm()` / `useConfirmationModal()` com o `<ConfirmationModalHost />`.
5
+ */
6
+ export declare const ConfirmationModal: ({ isOpen, title, description, confirmLabel, cancelLabel, tone, loading, onConfirm, onCancel }: ConfirmationModalProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default ConfirmationModal;
@@ -0,0 +1,6 @@
1
+ export declare const confirmationIconStyles: (props?: ({
2
+ tone?: "default" | "warning" | "danger" | null | undefined;
3
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
4
+ export declare const confirmationBodyStyles: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
5
+ export declare const confirmationDescriptionStyles: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
6
+ export declare const confirmationFooterStyles: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
@@ -0,0 +1,24 @@
1
+ import { ReactNode } from 'react';
2
+ export type ConfirmationTone = 'default' | 'danger' | 'warning';
3
+ export interface ConfirmationOptions {
4
+ /** Título do diálogo. */
5
+ title: string;
6
+ /** Texto explicativo (string ou nó React). */
7
+ description?: ReactNode;
8
+ /** Rótulo do botão de confirmação. Padrão: "Confirmar". */
9
+ confirmLabel?: string;
10
+ /** Rótulo do botão de cancelamento. Padrão: "Cancelar". */
11
+ cancelLabel?: string;
12
+ /** Tom visual — `danger` usa o botão destrutivo. Padrão: `default`. */
13
+ tone?: ConfirmationTone;
14
+ }
15
+ export interface ConfirmationModalProps extends ConfirmationOptions {
16
+ /** Controla a visibilidade. */
17
+ isOpen: boolean;
18
+ /** Chamado ao confirmar. */
19
+ onConfirm: () => void;
20
+ /** Chamado ao cancelar / fechar. */
21
+ onCancel: () => void;
22
+ /** Mostra estado de carregamento no botão de confirmação. */
23
+ loading?: boolean;
24
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Renderiza a confirmação ativa disparada por `confirm()` / `useConfirmationModal()`.
3
+ * Monte uma única vez próximo da raiz da aplicação.
4
+ */
5
+ export declare const ConfirmationModalHost: () => import("react/jsx-runtime").JSX.Element | null;
6
+ export default ConfirmationModalHost;
@@ -0,0 +1,11 @@
1
+ import { ConfirmationOptions } from './ConfirmationModal.type';
2
+ /**
3
+ * Abre um diálogo de confirmação e resolve `true`/`false` conforme a escolha.
4
+ * Requer um `<ConfirmationModalHost />` montado na árvore.
5
+ *
6
+ * @example
7
+ * if (await confirm({ title: 'Excluir pedido?', tone: 'danger' })) {
8
+ * await remove();
9
+ * }
10
+ */
11
+ export declare const confirm: (options: ConfirmationOptions) => Promise<boolean>;
@@ -0,0 +1,19 @@
1
+ import { ConfirmationOptions } from './ConfirmationModal.type';
2
+ export interface ConfirmRequest extends ConfirmationOptions {
3
+ id: number;
4
+ }
5
+ interface ConfirmState {
6
+ current: ConfirmRequest | null;
7
+ }
8
+ type Listener = (state: ConfirmState) => void;
9
+ /**
10
+ * Store da confirmação imperativa. Mantém uma única requisição ativa;
11
+ * uma nova chamada antes da anterior resolver cancela a anterior (resolve `false`).
12
+ */
13
+ export declare const confirmStore: {
14
+ subscribe(listener: Listener): () => void;
15
+ getSnapshot(): ConfirmState;
16
+ request(options: ConfirmationOptions): Promise<boolean>;
17
+ resolve(value: boolean): void;
18
+ };
19
+ export {};
@@ -0,0 +1,6 @@
1
+ export * from './ConfirmationModal';
2
+ export * from './ConfirmationModal.type';
3
+ export * from './ConfirmationModalHost';
4
+ export * from './confirm';
5
+ export * from './useConfirmationModal';
6
+ export { confirmStore } from './confirmStore';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Retorna a função `confirm` para abrir confirmações dentro de componentes.
3
+ * Requer um `<ConfirmationModalHost />` montado na árvore.
4
+ *
5
+ * @example
6
+ * const confirm = useConfirmationModal();
7
+ * const ok = await confirm({ title: 'Inativar?', tone: 'warning' });
8
+ */
9
+ export declare const useConfirmationModal: () => (options: import('./ConfirmationModal.type').ConfirmationOptions) => Promise<boolean>;
@@ -0,0 +1,10 @@
1
+ import { ToasterProps } from './toast.type';
2
+ /**
3
+ * Renderiza os toasts disparados pela API imperativa `toast.*`.
4
+ * Monte uma única vez próximo da raiz da aplicação.
5
+ *
6
+ * @example
7
+ * <Toaster position="top-right" />
8
+ */
9
+ export declare const Toaster: ({ position, duration, max, className, zIndex }: ToasterProps) => import("react/jsx-runtime").JSX.Element | null;
10
+ export default Toaster;
@@ -0,0 +1,4 @@
1
+ export declare const toasterViewportStyles: (props?: ({
2
+ position?: "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | null | undefined;
3
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
4
+ export declare const toasterItemStyles: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
@@ -0,0 +1,5 @@
1
+ export * from './Toaster';
2
+ export * from './toast';
3
+ export * from './toast.type';
4
+ export * from './useToast';
5
+ export { toastStore } from './toastStore';
@@ -0,0 +1,27 @@
1
+ import { ToastItem, ToastOptions } from './toast.type';
2
+ interface ToastFn {
3
+ (message: string, options?: ToastOptions): string;
4
+ success: (message: string, options?: ToastOptions) => string;
5
+ error: (message: string, options?: ToastOptions) => string;
6
+ warning: (message: string, options?: ToastOptions) => string;
7
+ info: (message: string, options?: ToastOptions) => string;
8
+ /** Cria um toast com controle total do payload. */
9
+ show: (toast: Omit<ToastItem, 'id'> & {
10
+ id?: string;
11
+ }) => string;
12
+ /** Fecha um toast específico. */
13
+ dismiss: (id: string) => void;
14
+ /** Fecha todos os toasts. */
15
+ clear: () => void;
16
+ }
17
+ /**
18
+ * API imperativa de toasts — pode ser chamada de qualquer lugar
19
+ * (services, handlers, etc.), sem hooks. Requer um `<Toaster />`
20
+ * montado uma vez na árvore para renderizar.
21
+ *
22
+ * @example
23
+ * toast.success('Pedido criado!');
24
+ * toast.error('Falha ao salvar', { title: 'Erro' });
25
+ */
26
+ export declare const toast: ToastFn;
27
+ export {};
@@ -0,0 +1,32 @@
1
+ export type ToastVariant = 'success' | 'error' | 'warning' | 'info';
2
+ export interface ToastAction {
3
+ label: string;
4
+ onClick: () => void;
5
+ }
6
+ export interface ToastItem {
7
+ id: string;
8
+ variant: ToastVariant;
9
+ title?: string;
10
+ message: string;
11
+ /** Duração em ms (0 = não fecha sozinho). Padrão: 5000. */
12
+ duration?: number;
13
+ icon?: React.ReactNode;
14
+ action?: ToastAction;
15
+ }
16
+ /** Opções aceitas pelos atalhos (`toast.success`, etc.). */
17
+ export type ToastOptions = Partial<Omit<ToastItem, 'id' | 'message' | 'variant'>> & {
18
+ id?: string;
19
+ };
20
+ export type ToasterPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
21
+ export interface ToasterProps {
22
+ /** Posição do empilhamento na tela. Padrão: `top-right`. */
23
+ position?: ToasterPosition;
24
+ /** Duração padrão aplicada quando o toast não define a sua. */
25
+ duration?: number;
26
+ /** Máximo de toasts visíveis ao mesmo tempo (mais antigos são descartados). */
27
+ max?: number;
28
+ /** Classe adicional no viewport. */
29
+ className?: string;
30
+ /** z-index do viewport. Padrão: 9999. */
31
+ zIndex?: number;
32
+ }
@@ -0,0 +1,17 @@
1
+ import { ToastItem } from './toast.type';
2
+ type Listener = (toasts: ToastItem[]) => void;
3
+ /**
4
+ * Store externo dos toasts. Consumido pelo `<Toaster />` via
5
+ * `useSyncExternalStore`. Independente de React para permitir a API
6
+ * imperativa `toast.*` fora de componentes.
7
+ */
8
+ export declare const toastStore: {
9
+ subscribe(listener: Listener): () => void;
10
+ getSnapshot(): ToastItem[];
11
+ add(toast: Omit<ToastItem, "id"> & {
12
+ id?: string;
13
+ }): string;
14
+ dismiss(id: string): void;
15
+ clear(): void;
16
+ };
17
+ export {};
@@ -2,3 +2,5 @@ export * from './Header';
2
2
  export * from './Layout';
3
3
  export * from './Footer';
4
4
  export * from './HeroSection';
5
+ export * from './Toaster';
6
+ export * from './ConfirmationModal';
@@ -0,0 +1 @@
1
+ export * from './theme';
@@ -0,0 +1,8 @@
1
+ import { ThemeProviderProps } from './theme.type';
2
+ /**
3
+ * Provedor de tema (light / dark / system) com persistência em localStorage.
4
+ * Alterna a classe `dark` em `<html>` — os tokens de cor do design system
5
+ * já reagem a essa classe (ver `styles/colors.css`).
6
+ */
7
+ export declare const ThemeProvider: ({ children, defaultTheme, storageKey, disableTransitionOnChange }: ThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default ThemeProvider;
@@ -0,0 +1,3 @@
1
+ export * from './ThemeProvider';
2
+ export * from './useTheme';
3
+ export * from './theme.type';
@@ -0,0 +1,7 @@
1
+ import { ThemeContextValue } from './theme.type';
2
+ /**
3
+ * Contexto interno do tema. Exposto via `useTheme()`.
4
+ * Mantido em arquivo separado para evitar avisos de fast-refresh
5
+ * (arquivos de componente devem exportar apenas componentes).
6
+ */
7
+ export declare const ThemeContext: import('react').Context<ThemeContextValue | undefined>;
@@ -0,0 +1,23 @@
1
+ /** Temas suportados. `system` segue a preferência do sistema operacional. */
2
+ export type Theme = 'light' | 'dark' | 'system';
3
+ /** Tema efetivamente aplicado no DOM (nunca `system`). */
4
+ export type ResolvedTheme = 'light' | 'dark';
5
+ export interface ThemeProviderProps {
6
+ children: React.ReactNode;
7
+ /** Tema inicial quando não há nada persistido. Padrão: `system`. */
8
+ defaultTheme?: Theme;
9
+ /** Chave usada no localStorage. Padrão: `fast-food-ui-theme`. */
10
+ storageKey?: string;
11
+ /** Desabilita as transições de cor no instante da troca de tema (evita flash). */
12
+ disableTransitionOnChange?: boolean;
13
+ }
14
+ export interface ThemeContextValue {
15
+ /** Tema escolhido pelo usuário (`light` | `dark` | `system`). */
16
+ theme: Theme;
17
+ /** Tema realmente aplicado (resolve `system` para `light`/`dark`). */
18
+ resolvedTheme: ResolvedTheme;
19
+ /** Define o tema. */
20
+ setTheme: (theme: Theme) => void;
21
+ /** Alterna entre `light` e `dark` (com base no tema resolvido atual). */
22
+ toggleTheme: () => void;
23
+ }
@@ -0,0 +1,6 @@
1
+ import { ThemeContextValue } from './theme.type';
2
+ /**
3
+ * Acessa o tema atual e as ações de troca.
4
+ * Precisa estar dentro de um `<ThemeProvider>`.
5
+ */
6
+ export declare const useTheme: () => ThemeContextValue;