@tabl.io/ui 0.1.0 → 0.2.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.
package/dist/index.d.ts CHANGED
@@ -3,6 +3,49 @@ import { JSX } from 'react/jsx-runtime';
3
3
  import * as React_2 from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
+ /**
7
+ * Header padrão das aplicações Tabl
8
+ * Suporta título, subtítulo, botão de voltar e actions à direita
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * <AppHeader
13
+ * title="Mesa 12"
14
+ * showBack
15
+ * onBack={() => navigate('/tables')}
16
+ * actions={<CartIndicator count={3} total={45.00} />}
17
+ * />
18
+ * ```
19
+ */
20
+ export declare function AppHeader({ title, subtitle, showBack, onBack, actions, className, }: AppHeaderProps): JSX.Element;
21
+
22
+ export declare interface AppHeaderProps {
23
+ /**
24
+ * Título exibido no header
25
+ */
26
+ title: string;
27
+ /**
28
+ * Subtítulo opcional
29
+ */
30
+ subtitle?: string;
31
+ /**
32
+ * Mostra botão de voltar
33
+ */
34
+ showBack?: boolean;
35
+ /**
36
+ * Callback quando clicar em voltar
37
+ */
38
+ onBack?: () => void;
39
+ /**
40
+ * Elementos à direita (ex: CartIndicator)
41
+ */
42
+ actions?: React_2.ReactNode;
43
+ /**
44
+ * Classes adicionais
45
+ */
46
+ className?: string;
47
+ }
48
+
6
49
  export declare function Button({ className, variant, size, asChild, ...props }: React_2.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
7
50
  asChild?: boolean;
8
51
  }): JSX.Element;
@@ -12,4 +55,725 @@ export declare const buttonVariants: (props?: ({
12
55
  size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
13
56
  } & ClassProp) | undefined) => string;
14
57
 
58
+ /**
59
+ * Estado vazio do carrinho
60
+ * Exibe ícone e mensagem quando não há itens
61
+ *
62
+ * @example
63
+ * ```tsx
64
+ * {items.length === 0 && <CartEmptyState />}
65
+ * ```
66
+ */
67
+ export declare function CartEmptyState({ className }: CartEmptyStateProps): JSX.Element;
68
+
69
+ export declare interface CartEmptyStateProps {
70
+ /**
71
+ * Classes adicionais
72
+ */
73
+ className?: string;
74
+ }
75
+
76
+ /**
77
+ * Indicador visual do carrinho de compras
78
+ * Exibe quantidade de itens e valor total com badge
79
+ *
80
+ * @example
81
+ * ```tsx
82
+ * <CartIndicator
83
+ * count={3}
84
+ * total={45.50}
85
+ * onClick={() => setCartOpen(true)}
86
+ * />
87
+ * ```
88
+ */
89
+ export declare function CartIndicator({ count, total, onClick, className, }: CartIndicatorProps): JSX.Element | null;
90
+
91
+ export declare interface CartIndicatorProps {
92
+ /**
93
+ * Quantidade de itens no carrinho
94
+ */
95
+ count: number;
96
+ /**
97
+ * Valor total do carrinho
98
+ */
99
+ total: number;
100
+ /**
101
+ * Callback ao clicar no indicador
102
+ */
103
+ onClick?: () => void;
104
+ /**
105
+ * Classes adicionais
106
+ */
107
+ className?: string;
108
+ }
109
+
110
+ /**
111
+ * Item individual no carrinho
112
+ * Exibe produto, customizações, preço e controles
113
+ *
114
+ * @example
115
+ * ```tsx
116
+ * <CartItem
117
+ * item={cartItem}
118
+ * onQuantityChange={handleUpdateQuantity}
119
+ * onRemove={handleRemoveItem}
120
+ * />
121
+ * ```
122
+ */
123
+ export declare function CartItem({ item, onQuantityChange, onRemove, className, }: CartItemProps): JSX.Element;
124
+
125
+ export declare interface CartItemData {
126
+ id: string;
127
+ productName: string;
128
+ quantity: number;
129
+ unitPrice: number;
130
+ additionalPrice: number;
131
+ removedIngredients?: string[];
132
+ addedExtras?: string[];
133
+ notes?: string;
134
+ }
135
+
136
+ export declare interface CartItemProps {
137
+ /**
138
+ * Dados do item
139
+ */
140
+ item: CartItemData;
141
+ /**
142
+ * Callback ao alterar quantidade
143
+ */
144
+ onQuantityChange: (itemId: string, quantity: number) => void;
145
+ /**
146
+ * Callback ao remover item
147
+ */
148
+ onRemove: (itemId: string) => void;
149
+ /**
150
+ * Classes adicionais
151
+ */
152
+ className?: string;
153
+ }
154
+
155
+ /**
156
+ * Sheet lateral completo do carrinho
157
+ * Exibe lista de itens, resumo e ações
158
+ *
159
+ * @example
160
+ * ```tsx
161
+ * <CartSheet
162
+ * open={isOpen}
163
+ * onOpenChange={setIsOpen}
164
+ * items={cartItems}
165
+ * onQuantityChange={handleUpdateQuantity}
166
+ * onRemoveItem={handleRemoveItem}
167
+ * onConfirmOrder={handleConfirmOrder}
168
+ * loading={isSubmitting}
169
+ * />
170
+ * ```
171
+ */
172
+ export declare function CartSheet({ open, onOpenChange, items, onQuantityChange, onRemoveItem, onConfirmOrder, loading, className, }: CartSheetProps): JSX.Element;
173
+
174
+ export declare interface CartSheetProps {
175
+ /**
176
+ * Se o sheet está aberto
177
+ */
178
+ open: boolean;
179
+ /**
180
+ * Callback para abrir/fechar
181
+ */
182
+ onOpenChange: (open: boolean) => void;
183
+ /**
184
+ * Itens no carrinho
185
+ */
186
+ items: CartItemData[];
187
+ /**
188
+ * Callback ao alterar quantidade
189
+ */
190
+ onQuantityChange: (itemId: string, quantity: number) => void;
191
+ /**
192
+ * Callback ao remover item
193
+ */
194
+ onRemoveItem: (itemId: string) => void;
195
+ /**
196
+ * Callback ao confirmar pedido
197
+ */
198
+ onConfirmOrder: () => void;
199
+ /**
200
+ * Se está processando o pedido
201
+ */
202
+ loading?: boolean;
203
+ /**
204
+ * Classes adicionais
205
+ */
206
+ className?: string;
207
+ }
208
+
209
+ /**
210
+ * Resumo do carrinho com totais e botão de confirmação
211
+ * Usado no footer do CartSheet
212
+ *
213
+ * @example
214
+ * ```tsx
215
+ * <CartSummary
216
+ * subtotal={45.50}
217
+ * itemCount={3}
218
+ * onConfirm={handleConfirmOrder}
219
+ * loading={isSubmitting}
220
+ * />
221
+ * ```
222
+ */
223
+ export declare function CartSummary({ subtotal, itemCount, onConfirm, loading, className, }: CartSummaryProps): JSX.Element;
224
+
225
+ export declare interface CartSummaryProps {
226
+ /**
227
+ * Valor subtotal
228
+ */
229
+ subtotal: number;
230
+ /**
231
+ * Quantidade total de itens
232
+ */
233
+ itemCount: number;
234
+ /**
235
+ * Callback ao confirmar pedido
236
+ */
237
+ onConfirm: () => void;
238
+ /**
239
+ * Se está processando o pedido
240
+ */
241
+ loading?: boolean;
242
+ /**
243
+ * Classes adicionais
244
+ */
245
+ className?: string;
246
+ }
247
+
248
+ export declare interface Category {
249
+ id: string;
250
+ name: string;
251
+ }
252
+
253
+ /**
254
+ * Pill de categoria individual
255
+ * Muda visual quando ativa
256
+ *
257
+ * @example
258
+ * ```tsx
259
+ * <CategoryPill
260
+ * name="Hambúrgueres"
261
+ * isActive={true}
262
+ * onClick={() => setCategory('hamburgueres')}
263
+ * />
264
+ * ```
265
+ */
266
+ export declare function CategoryPill({ name, isActive, onClick, className, }: CategoryPillProps): JSX.Element;
267
+
268
+ export declare interface CategoryPillProps {
269
+ /**
270
+ * Nome da categoria
271
+ */
272
+ name: string;
273
+ /**
274
+ * Se está ativa
275
+ */
276
+ isActive?: boolean;
277
+ /**
278
+ * Callback ao clicar
279
+ */
280
+ onClick?: () => void;
281
+ /**
282
+ * Classes adicionais
283
+ */
284
+ className?: string;
285
+ }
286
+
287
+ /**
288
+ * Navegação horizontal de categorias com scroll
289
+ * Primeira opção sempre é "Todos"
290
+ *
291
+ * @example
292
+ * ```tsx
293
+ * <CategoryTabs
294
+ * categories={categories}
295
+ * activeCategory={activeCategoryId}
296
+ * onSelectCategory={setActiveCategoryId}
297
+ * />
298
+ * ```
299
+ */
300
+ export declare function CategoryTabs({ categories, activeCategory, onSelectCategory, className, }: CategoryTabsProps): JSX.Element;
301
+
302
+ export declare interface CategoryTabsProps {
303
+ /**
304
+ * Lista de categorias
305
+ */
306
+ categories: Category[];
307
+ /**
308
+ * ID da categoria ativa
309
+ */
310
+ activeCategory?: string;
311
+ /**
312
+ * Callback ao selecionar categoria
313
+ */
314
+ onSelectCategory: (categoryId: string) => void;
315
+ /**
316
+ * Classes adicionais
317
+ */
318
+ className?: string;
319
+ }
320
+
321
+ export declare interface Extra {
322
+ id: string;
323
+ name: string;
324
+ price: number;
325
+ }
326
+
327
+ /**
328
+ * Checkbox para adicionar ingredientes extras (pagos)
329
+ * Usado na seção "Adicionar extras?"
330
+ *
331
+ * @example
332
+ * ```tsx
333
+ * <ExtraCheckbox
334
+ * extra={{ id: '1', name: 'Queijo Cheddar', price: 3.00 }}
335
+ * checked={selectedExtras.includes('1')}
336
+ * onCheckedChange={(checked) => handleAddExtra('1', checked)}
337
+ * />
338
+ * ```
339
+ */
340
+ export declare function ExtraCheckbox({ extra, checked, onCheckedChange, className, }: ExtraCheckboxProps): JSX.Element;
341
+
342
+ export declare interface ExtraCheckboxProps {
343
+ /**
344
+ * Dados do extra
345
+ */
346
+ extra: Extra;
347
+ /**
348
+ * Se está selecionado
349
+ */
350
+ checked: boolean;
351
+ /**
352
+ * Callback quando estado muda
353
+ */
354
+ onCheckedChange: (checked: boolean) => void;
355
+ /**
356
+ * Classes adicionais
357
+ */
358
+ className?: string;
359
+ }
360
+
361
+ export declare interface Ingredient {
362
+ id: string;
363
+ name: string;
364
+ quantity: number;
365
+ unit?: string;
366
+ }
367
+
368
+ /**
369
+ * Checkbox para remover ingredientes da receita base
370
+ * Usado na seção "Remover ingredientes?"
371
+ *
372
+ * @example
373
+ * ```tsx
374
+ * <IngredientCheckbox
375
+ * ingredient={{ id: '1', name: 'Cebola Roxa', quantity: 1, unit: 'fatia' }}
376
+ * checked={removedIngredients.includes('1')}
377
+ * onCheckedChange={(checked) => handleRemove('1', checked)}
378
+ * />
379
+ * ```
380
+ */
381
+ export declare function IngredientCheckbox({ ingredient, checked, onCheckedChange, className, }: IngredientCheckboxProps): JSX.Element;
382
+
383
+ export declare interface IngredientCheckboxProps {
384
+ /**
385
+ * Dados do ingrediente
386
+ */
387
+ ingredient: Ingredient;
388
+ /**
389
+ * Se está selecionado para remoção
390
+ */
391
+ checked: boolean;
392
+ /**
393
+ * Callback quando estado muda
394
+ */
395
+ onCheckedChange: (checked: boolean) => void;
396
+ /**
397
+ * Classes adicionais
398
+ */
399
+ className?: string;
400
+ }
401
+
402
+ /**
403
+ * Wrapper para listas de ingredientes
404
+ * Fornece título, descrição e layout consistente
405
+ *
406
+ * @example
407
+ * ```tsx
408
+ * <IngredientList
409
+ * title="Remover ingredientes?"
410
+ * description="Selecione os ingredientes que deseja remover"
411
+ * >
412
+ * <IngredientCheckbox ... />
413
+ * <IngredientCheckbox ... />
414
+ * </IngredientList>
415
+ * ```
416
+ */
417
+ export declare function IngredientList({ title, description, children, className, }: IngredientListProps): JSX.Element;
418
+
419
+ export declare interface IngredientListProps {
420
+ /**
421
+ * Título da seção (ex: "Remover ingredientes?")
422
+ */
423
+ title: string;
424
+ /**
425
+ * Descrição opcional
426
+ */
427
+ description?: string;
428
+ /**
429
+ * Elementos filhos (IngredientCheckbox ou ExtraCheckbox)
430
+ */
431
+ children: React_2.ReactNode;
432
+ /**
433
+ * Classes adicionais
434
+ */
435
+ className?: string;
436
+ }
437
+
438
+ /**
439
+ * Modal de confirmação após pedido enviado com sucesso
440
+ * Exibe ícone de sucesso, ID do pedido e valor total
441
+ *
442
+ * @example
443
+ * ```tsx
444
+ * <OrderConfirmationModal
445
+ * open={showConfirmation}
446
+ * onOpenChange={setShowConfirmation}
447
+ * orderId={createdOrderId}
448
+ * totalValue={45.50}
449
+ * onClose={handleReturnToTables}
450
+ * />
451
+ * ```
452
+ */
453
+ export declare function OrderConfirmationModal({ open, onOpenChange, orderId, totalValue, onClose, className, }: OrderConfirmationModalProps): JSX.Element;
454
+
455
+ export declare interface OrderConfirmationModalProps {
456
+ /**
457
+ * Se o modal está aberto
458
+ */
459
+ open: boolean;
460
+ /**
461
+ * Callback para fechar
462
+ */
463
+ onOpenChange: (open: boolean) => void;
464
+ /**
465
+ * ID do pedido criado
466
+ */
467
+ orderId?: string;
468
+ /**
469
+ * Valor total do pedido
470
+ */
471
+ totalValue: number;
472
+ /**
473
+ * Callback ao confirmar e voltar
474
+ */
475
+ onClose: () => void;
476
+ /**
477
+ * Classes adicionais
478
+ */
479
+ className?: string;
480
+ }
481
+
482
+ /**
483
+ * Estado de loading durante envio do pedido
484
+ * Exibe spinner e mensagem
485
+ *
486
+ * @example
487
+ * ```tsx
488
+ * {isSubmitting && (
489
+ * <OrderLoadingState message="Enviando pedido..." />
490
+ * )}
491
+ * ```
492
+ */
493
+ export declare function OrderLoadingState({ message, className, }: OrderLoadingStateProps): JSX.Element;
494
+
495
+ export declare interface OrderLoadingStateProps {
496
+ /**
497
+ * Mensagem customizada
498
+ */
499
+ message?: string;
500
+ /**
501
+ * Classes adicionais
502
+ */
503
+ className?: string;
504
+ }
505
+
506
+ export declare interface Product {
507
+ id: string;
508
+ name: string;
509
+ description?: string;
510
+ price: number;
511
+ imageUrl?: string;
512
+ isActive: boolean;
513
+ }
514
+
515
+ /**
516
+ * Card de produto com imagem, nome, descrição e preço
517
+ * Exibe estado de indisponível quando isActive = false
518
+ *
519
+ * @example
520
+ * ```tsx
521
+ * <ProductCard
522
+ * product={product}
523
+ * onClick={() => handleSelectProduct(product)}
524
+ * />
525
+ * ```
526
+ */
527
+ export declare function ProductCard({ product, onClick, className, }: ProductCardProps): JSX.Element;
528
+
529
+ export declare interface ProductCardProps {
530
+ /**
531
+ * Dados do produto
532
+ */
533
+ product: Product;
534
+ /**
535
+ * Callback ao clicar no card
536
+ */
537
+ onClick?: () => void;
538
+ /**
539
+ * Classes adicionais
540
+ */
541
+ className?: string;
542
+ }
543
+
544
+ /**
545
+ * Modal completo de customização de produto
546
+ * Permite remover ingredientes, adicionar extras e escolher quantidade
547
+ *
548
+ * @example
549
+ * ```tsx
550
+ * <ProductDetailModal
551
+ * open={isOpen}
552
+ * onOpenChange={setIsOpen}
553
+ * product={selectedProduct}
554
+ * removableIngredients={ingredients}
555
+ * availableExtras={extras}
556
+ * onAddToCart={handleAddToCart}
557
+ * />
558
+ * ```
559
+ */
560
+ export declare function ProductDetailModal({ open, onOpenChange, product, removableIngredients, availableExtras, onAddToCart, className, }: ProductDetailModalProps): JSX.Element;
561
+
562
+ export declare interface ProductDetailModalProps {
563
+ /**
564
+ * Se o modal está aberto
565
+ */
566
+ open: boolean;
567
+ /**
568
+ * Callback para fechar
569
+ */
570
+ onOpenChange: (open: boolean) => void;
571
+ /**
572
+ * Dados do produto
573
+ */
574
+ product: {
575
+ id: string;
576
+ name: string;
577
+ description?: string;
578
+ price: number;
579
+ imageUrl?: string;
580
+ };
581
+ /**
582
+ * Ingredientes removíveis da receita base
583
+ */
584
+ removableIngredients?: Ingredient[];
585
+ /**
586
+ * Extras disponíveis
587
+ */
588
+ availableExtras?: Extra[];
589
+ /**
590
+ * Callback ao adicionar ao carrinho
591
+ */
592
+ onAddToCart: (data: {
593
+ productId: string;
594
+ quantity: number;
595
+ removedIngredients: string[];
596
+ addedExtras: string[];
597
+ notes?: string;
598
+ }) => void;
599
+ /**
600
+ * Classes adicionais
601
+ */
602
+ className?: string;
603
+ }
604
+
605
+ /**
606
+ * Grid responsivo para exibir cards de produtos
607
+ * Adapta automaticamente o número de colunas baseado no viewport
608
+ *
609
+ * @example
610
+ * ```tsx
611
+ * <ProductGrid>
612
+ * <ProductCard product={product1} />
613
+ * <ProductCard product={product2} />
614
+ * </ProductGrid>
615
+ * ```
616
+ */
617
+ export declare function ProductGrid({ children, className, ...props }: ProductGridProps): JSX.Element;
618
+
619
+ export declare interface ProductGridProps extends React_2.HTMLAttributes<HTMLDivElement> {
620
+ /**
621
+ * Elementos filhos (ProductCard)
622
+ */
623
+ children: React_2.ReactNode;
624
+ }
625
+
626
+ /**
627
+ * Exibe o cálculo de preço do produto em tempo real
628
+ * Mostra base + extras = total
629
+ *
630
+ * @example
631
+ * ```tsx
632
+ * <ProductPriceDisplay
633
+ * basePrice={25.00}
634
+ * additionalPrice={5.00}
635
+ * />
636
+ * // Exibe: R$ 25,00 + R$ 5,00 = R$ 30,00
637
+ * ```
638
+ */
639
+ export declare function ProductPriceDisplay({ basePrice, additionalPrice, className, }: ProductPriceDisplayProps): JSX.Element;
640
+
641
+ export declare interface ProductPriceDisplayProps {
642
+ /**
643
+ * Preço base do produto
644
+ */
645
+ basePrice: number;
646
+ /**
647
+ * Preço adicional dos extras
648
+ */
649
+ additionalPrice: number;
650
+ /**
651
+ * Classes adicionais
652
+ */
653
+ className?: string;
654
+ }
655
+
656
+ /**
657
+ * Controle de quantidade com botões - e +
658
+ * Respeita limites min e max
659
+ *
660
+ * @example
661
+ * ```tsx
662
+ * <QuantityStepper
663
+ * value={quantity}
664
+ * onChange={setQuantity}
665
+ * min={1}
666
+ * max={10}
667
+ * />
668
+ * ```
669
+ */
670
+ export declare function QuantityStepper({ value, onChange, min, max, size, className, }: QuantityStepperProps): JSX.Element;
671
+
672
+ export declare interface QuantityStepperProps {
673
+ /**
674
+ * Quantidade atual
675
+ */
676
+ value: number;
677
+ /**
678
+ * Callback quando quantidade muda
679
+ */
680
+ onChange: (value: number) => void;
681
+ /**
682
+ * Valor mínimo (padrão: 1)
683
+ */
684
+ min?: number;
685
+ /**
686
+ * Valor máximo
687
+ */
688
+ max?: number;
689
+ /**
690
+ * Tamanho do componente
691
+ */
692
+ size?: "sm" | "default" | "lg";
693
+ /**
694
+ * Classes adicionais
695
+ */
696
+ className?: string;
697
+ }
698
+
699
+ /**
700
+ * Badge que indica o status de uma mesa
701
+ * Cores e labels automáticos baseados no status
702
+ *
703
+ * @example
704
+ * ```tsx
705
+ * <TableBadge status="occupied" />
706
+ * <TableBadge status="available" />
707
+ * ```
708
+ */
709
+ export declare function TableBadge({ status, className }: TableBadgeProps): JSX.Element;
710
+
711
+ export declare interface TableBadgeProps {
712
+ /**
713
+ * Status da mesa
714
+ */
715
+ status: TableStatus;
716
+ /**
717
+ * Classes adicionais
718
+ */
719
+ className?: string;
720
+ }
721
+
722
+ /**
723
+ * Card visual de uma mesa
724
+ * Exibe número grande e badge de status
725
+ *
726
+ * @example
727
+ * ```tsx
728
+ * <TableCard
729
+ * number={12}
730
+ * status="occupied"
731
+ * onClick={() => handleSelectTable(12)}
732
+ * />
733
+ * ```
734
+ */
735
+ export declare function TableCard({ number, status, onClick, className, }: TableCardProps): JSX.Element;
736
+
737
+ export declare interface TableCardProps {
738
+ /**
739
+ * Número da mesa
740
+ */
741
+ number: number;
742
+ /**
743
+ * Status da mesa
744
+ */
745
+ status: TableStatus;
746
+ /**
747
+ * Callback ao clicar na mesa
748
+ */
749
+ onClick?: () => void;
750
+ /**
751
+ * Classes adicionais
752
+ */
753
+ className?: string;
754
+ }
755
+
756
+ /**
757
+ * Grid responsivo para exibir cards de mesas
758
+ * Adapta automaticamente o número de colunas baseado no viewport
759
+ *
760
+ * @example
761
+ * ```tsx
762
+ * <TableGrid>
763
+ * <TableCard number={1} status="available" />
764
+ * <TableCard number={2} status="occupied" />
765
+ * </TableGrid>
766
+ * ```
767
+ */
768
+ export declare function TableGrid({ children, className, ...props }: TableGridProps): JSX.Element;
769
+
770
+ export declare interface TableGridProps extends React_2.HTMLAttributes<HTMLDivElement> {
771
+ /**
772
+ * Elementos filhos (TableCard)
773
+ */
774
+ children: React_2.ReactNode;
775
+ }
776
+
777
+ export declare type TableStatus = "available" | "occupied" | "reserved";
778
+
15
779
  export { }