negodesign 0.0.74 → 0.0.75

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 (93) hide show
  1. package/dist/components/pages/security/login/02/ui/LoginCard02.svelte +15 -4
  2. package/dist/components/pages/security/login/03/ui/LoginCard03.svelte +34 -16
  3. package/dist/components/ui/form/Form.svelte +171 -0
  4. package/dist/components/ui/form/Form.svelte.d.ts +4 -0
  5. package/dist/components/ui/form/types.d.ts +78 -0
  6. package/dist/components/ui/form/types.js +1 -0
  7. package/dist/components/ui/form/ui/input-badges.svelte +214 -0
  8. package/dist/components/ui/form/ui/input-badges.svelte.d.ts +14 -0
  9. package/dist/components/ui/form/ui/input-checkbox.svelte +86 -0
  10. package/dist/components/ui/form/ui/input-checkbox.svelte.d.ts +17 -0
  11. package/dist/components/ui/form/ui/input-radio.svelte +82 -0
  12. package/dist/components/ui/form/ui/input-radio.svelte.d.ts +17 -0
  13. package/dist/components/ui/form/ui/input-select.svelte +195 -0
  14. package/dist/components/ui/form/ui/input-select.svelte.d.ts +17 -0
  15. package/dist/components/ui/form/ui/input-textarea.svelte +61 -0
  16. package/dist/components/ui/form/ui/input-textarea.svelte.d.ts +13 -0
  17. package/dist/components/ui/form/ui/input-toggle.svelte +89 -0
  18. package/dist/components/ui/form/ui/input-toggle.svelte.d.ts +11 -0
  19. package/dist/components/ui/modal/badge/index.d.ts +3 -0
  20. package/dist/components/ui/modal/badge/index.js +2 -0
  21. package/dist/components/ui/modal/badge/types.d.ts +35 -0
  22. package/dist/components/ui/modal/badge/types.js +1 -0
  23. package/dist/components/ui/modal/badge/ui/ModalBadgeSelection.svelte +87 -0
  24. package/dist/components/ui/modal/badge/ui/ModalBadgeSelection.svelte.d.ts +4 -0
  25. package/dist/components/ui/modal/core/index.d.ts +3 -0
  26. package/dist/components/ui/modal/core/index.js +2 -0
  27. package/dist/components/ui/modal/core/types.d.ts +82 -0
  28. package/dist/components/ui/modal/core/types.js +1 -0
  29. package/dist/components/ui/modal/core/ui/ModalCore.svelte +129 -0
  30. package/dist/components/ui/modal/core/ui/ModalCore.svelte.d.ts +4 -0
  31. package/dist/components/ui/modal/feedback/index.d.ts +3 -0
  32. package/dist/components/ui/modal/feedback/index.js +2 -0
  33. package/dist/components/ui/modal/feedback/types.d.ts +32 -0
  34. package/dist/components/ui/modal/feedback/types.js +1 -0
  35. package/dist/components/ui/modal/feedback/ui/ModalFeedback.svelte +135 -0
  36. package/dist/components/ui/modal/feedback/ui/ModalFeedback.svelte.d.ts +4 -0
  37. package/dist/components/ui/modal/form/index.d.ts +3 -0
  38. package/dist/components/ui/modal/form/index.js +2 -0
  39. package/dist/components/ui/modal/form/types.d.ts +38 -0
  40. package/dist/components/ui/modal/form/types.js +1 -0
  41. package/dist/components/ui/modal/form/ui/ModalForm.svelte +67 -0
  42. package/dist/components/ui/modal/form/ui/ModalForm.svelte.d.ts +4 -0
  43. package/dist/components/ui/modal/grid/index.d.ts +5 -0
  44. package/dist/components/ui/modal/grid/index.js +4 -0
  45. package/dist/components/ui/modal/grid/types.d.ts +51 -0
  46. package/dist/components/ui/modal/grid/types.js +1 -0
  47. package/dist/components/ui/modal/grid/ui/01/ModalGridSelection01.svelte +83 -0
  48. package/dist/components/ui/modal/grid/ui/01/ModalGridSelection01.svelte.d.ts +4 -0
  49. package/dist/components/ui/modal/grid/ui/02/ModalGridSelection02.svelte +142 -0
  50. package/dist/components/ui/modal/grid/ui/02/ModalGridSelection02.svelte.d.ts +4 -0
  51. package/dist/components/ui/modal/grid/ui/ModalGridSelection.svelte +60 -0
  52. package/dist/components/ui/modal/grid/ui/ModalGridSelection.svelte.d.ts +4 -0
  53. package/dist/components/ui/modal/map/index.d.ts +3 -0
  54. package/dist/components/ui/modal/map/index.js +2 -0
  55. package/dist/components/ui/modal/map/types.d.ts +48 -0
  56. package/dist/components/ui/modal/map/types.js +1 -0
  57. package/dist/components/ui/modal/map/ui/ModalMap.svelte +187 -0
  58. package/dist/components/ui/modal/map/ui/ModalMap.svelte.d.ts +4 -0
  59. package/dist/components/ui/modal/notification/index.d.ts +3 -0
  60. package/dist/components/ui/modal/notification/index.js +2 -0
  61. package/dist/components/ui/modal/notification/types.d.ts +26 -0
  62. package/dist/components/ui/modal/notification/types.js +1 -0
  63. package/dist/components/ui/modal/notification/ui/ModalNotification.svelte +65 -0
  64. package/dist/components/ui/modal/notification/ui/ModalNotification.svelte.d.ts +4 -0
  65. package/dist/components/ui/modal/share/index.d.ts +3 -0
  66. package/dist/components/ui/modal/share/index.js +2 -0
  67. package/dist/components/ui/modal/share/types.d.ts +32 -0
  68. package/dist/components/ui/modal/share/types.js +1 -0
  69. package/dist/components/ui/modal/share/ui/ModalShareSelection.svelte +103 -0
  70. package/dist/components/ui/modal/share/ui/ModalShareSelection.svelte.d.ts +4 -0
  71. package/dist/components/ui/modal/upload/index.d.ts +3 -0
  72. package/dist/components/ui/modal/upload/index.js +2 -0
  73. package/dist/components/ui/modal/upload/types.d.ts +79 -0
  74. package/dist/components/ui/modal/upload/types.js +1 -0
  75. package/dist/components/ui/modal/upload/ui/ModalUpload.svelte +268 -0
  76. package/dist/components/ui/modal/upload/ui/ModalUpload.svelte.d.ts +4 -0
  77. package/dist/components/ui/section/Section01.svelte +90 -0
  78. package/dist/components/ui/section/Section01.svelte.d.ts +4 -0
  79. package/dist/components/ui/section/Section02.svelte +68 -0
  80. package/dist/components/ui/section/Section02.svelte.d.ts +4 -0
  81. package/dist/components/ui/section/Section03.svelte +52 -0
  82. package/dist/components/ui/section/Section03.svelte.d.ts +4 -0
  83. package/dist/components/ui/section/index.d.ts +4 -0
  84. package/dist/components/ui/section/index.js +3 -0
  85. package/dist/components/ui/section/types.d.ts +46 -0
  86. package/dist/components/ui/section/types.js +1 -0
  87. package/dist/docs/components.d.ts +1 -1
  88. package/dist/docs/components.js +882 -0
  89. package/dist/globals.css +443 -0
  90. package/dist/index.d.ts +169 -0
  91. package/dist/index.js +169 -0
  92. package/dist/types/index.d.ts +46 -0
  93. package/package.json +1 -1
@@ -0,0 +1,51 @@
1
+ export type { ModelGridCard } from "../core/types";
2
+ /**
3
+ * Modelo de dados para uma categoria/selecção no topo do modal (variante 2).
4
+ * Cada categoria filtra ou indica o contexto dos cards.
5
+ * @property label - Texto visível da categoria.
6
+ * @property value - Valor identificador da categoria.
7
+ */
8
+ export type ModelGridCategory = {
9
+ label: string;
10
+ value: string;
11
+ };
12
+ /**
13
+ * Props do componente ModalGridSelection — modal de seleção em grid.
14
+ * Suporta duas variantes visuais: 1 (centrado 3 colunas) e 2 (dark 2 colunas + categorias).
15
+ * @property variant - Variante visual do modal (1 ou 2).
16
+ * @property title - Título principal do modal.
17
+ * @property subtitle - Subtítulo/descrição abaixo do título.
18
+ * @property categories - Lista de categorias no topo (apenas variante 2).
19
+ * @property selectedCategory - Categoria seleccionada (apenas variante 2).
20
+ * @property cards - Lista de cards seleccionáveis.
21
+ * @property selectedCard - Card actualmente seleccionado.
22
+ * @property selectedCards - Cards seleccionados (modo múltiplo, variante 2).
23
+ * @property multiple - Permite seleção múltipla (variante 2).
24
+ * @property totalSteps - Número total de passos (para pagination dots).
25
+ * @property currentStep - Passo actual (para pagination dots).
26
+ * @property isOpen - Controla a visibilidade do modal.
27
+ * @property onSelect - Chamado ao seleccionar um card.
28
+ * @property onSelectCategory - Chamado ao seleccionar uma categoria (variante 2).
29
+ * @property onBack - Chamado ao clicar no botão "Back".
30
+ * @property onContinue - Chamado ao clicar no botão "Continue".
31
+ * @property class - Classe CSS extra no container do modal.
32
+ */
33
+ export type ModalGridSelectionProps = {
34
+ variant?: 1 | 2;
35
+ title: string;
36
+ subtitle?: string;
37
+ categories?: ModelGridCategory[];
38
+ selectedCategory?: ModelGridCategory | null;
39
+ cards: import("../core/types").ModelGridCard[];
40
+ selectedCard?: import("../core/types").ModelGridCard | null;
41
+ selectedCards?: import("../core/types").ModelGridCard[];
42
+ multiple?: boolean;
43
+ totalSteps?: number;
44
+ currentStep?: number;
45
+ isOpen?: boolean;
46
+ onSelect?: (card: import("../core/types").ModelGridCard) => void;
47
+ onSelectCategory?: (category: ModelGridCategory) => void;
48
+ onBack?: () => void;
49
+ onContinue?: () => void;
50
+ class?: string;
51
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,83 @@
1
+ <script lang="ts">
2
+ import { cn } from "../../../../../../utils";
3
+ import { HugeiconsIcon } from "@hugeicons/svelte";
4
+ import ModalCore from "../../../core/ui/ModalCore.svelte";
5
+ import type { ModalGridSelectionProps, ModelGridCard } from "../../types";
6
+
7
+ let {
8
+ title,
9
+ subtitle,
10
+ cards = [],
11
+ selectedCard = $bindable(null),
12
+ totalSteps = 1,
13
+ currentStep = 1,
14
+ isOpen = $bindable(false),
15
+ onSelect,
16
+ onBack,
17
+ onContinue,
18
+ class: className,
19
+ }: ModalGridSelectionProps = $props();
20
+
21
+ let hoveredIndex = $state<number | null>(null);
22
+
23
+ function handleSelect(card: ModelGridCard) {
24
+ selectedCard = card;
25
+ onSelect?.(card);
26
+ }
27
+
28
+ function isSelected(card: ModelGridCard): boolean {
29
+ return selectedCard?.title === card.title;
30
+ }
31
+ </script>
32
+
33
+ <ModalCore
34
+ bind:isOpen
35
+ {title}
36
+ {subtitle}
37
+ {totalSteps}
38
+ {currentStep}
39
+ showProgress={false}
40
+ showBack={currentStep > 1}
41
+ {onBack}
42
+ {onContinue}
43
+ class={className}
44
+ >
45
+ {#snippet content()}
46
+ <div class="grid grid-cols-2 gap-4 md:grid-cols-3">
47
+ {#each cards as card, i (i)}
48
+ {@const selected = isSelected(card)}
49
+ {@const hovered = hoveredIndex === i}
50
+ <button
51
+ type="button"
52
+ class={cn(
53
+ "flex flex-col items-center gap-3 rounded-xl border-2 p-6 text-center transition-all duration-200",
54
+ selected
55
+ ? "border-primary bg-primary/5 shadow-md"
56
+ : "border-border hover:border-primary/50 hover:shadow-sm",
57
+ hovered && !selected && "border-primary/30"
58
+ )}
59
+ onclick={() => handleSelect(card)}
60
+ onmouseenter={() => (hoveredIndex = i)}
61
+ onmouseleave={() => (hoveredIndex = null)}
62
+ >
63
+ {#if typeof card.icon === "string"}
64
+ <i class="{card.icon} text-4xl text-muted-foreground md:text-5xl"></i>
65
+ {:else}
66
+ <HugeiconsIcon
67
+ icon={card.icon}
68
+ class="size-10 text-muted-foreground md:size-12"
69
+ />
70
+ {/if}
71
+
72
+ <p class="text-sm font-bold md:text-base">{card.title}</p>
73
+
74
+ {#if card.description}
75
+ <p class="line-clamp-2 text-xs text-muted-foreground md:text-sm">
76
+ {card.description}
77
+ </p>
78
+ {/if}
79
+ </button>
80
+ {/each}
81
+ </div>
82
+ {/snippet}
83
+ </ModalCore>
@@ -0,0 +1,4 @@
1
+ import type { ModalGridSelectionProps } from "../../types";
2
+ declare const ModalGridSelection01: import("svelte").Component<ModalGridSelectionProps, {}, "isOpen" | "selectedCard">;
3
+ type ModalGridSelection01 = ReturnType<typeof ModalGridSelection01>;
4
+ export default ModalGridSelection01;
@@ -0,0 +1,142 @@
1
+ <script lang="ts">
2
+ import { cn } from "../../../../../../utils";
3
+ import { HugeiconsIcon } from "@hugeicons/svelte";
4
+ import { CheckmarkCircle02Icon } from "@hugeicons/core-free-icons";
5
+ import ModalCore from "../../../core/ui/ModalCore.svelte";
6
+ import type { ModalGridSelectionProps, ModelGridCard, ModelGridCategory } from "../../types";
7
+
8
+ let {
9
+ title,
10
+ subtitle,
11
+ categories = [],
12
+ selectedCategory = $bindable(null),
13
+ cards = [],
14
+ selectedCard = $bindable(null),
15
+ selectedCards = $bindable([]),
16
+ multiple = false,
17
+ totalSteps = 1,
18
+ currentStep = 1,
19
+ isOpen = $bindable(false),
20
+ onSelect,
21
+ onSelectCategory,
22
+ onBack,
23
+ onContinue,
24
+ class: className,
25
+ }: ModalGridSelectionProps = $props();
26
+
27
+ function handleSelectCard(card: ModelGridCard) {
28
+ if (multiple) {
29
+ const exists = selectedCards.some((c: ModelGridCard) => c.title === card.title);
30
+ if (exists) {
31
+ selectedCards = selectedCards.filter((c: ModelGridCard) => c.title !== card.title);
32
+ } else {
33
+ selectedCards = [...selectedCards, card];
34
+ }
35
+ onSelect?.(card);
36
+ } else {
37
+ selectedCard = card;
38
+ onSelect?.(card);
39
+ }
40
+ }
41
+
42
+ function handleSelectCategory(category: ModelGridCategory) {
43
+ selectedCategory = category;
44
+ onSelectCategory?.(category);
45
+ }
46
+
47
+ function isSelectedCard(card: ModelGridCard): boolean {
48
+ if (multiple) {
49
+ return selectedCards.some((c: ModelGridCard) => c.title === card.title);
50
+ }
51
+ return selectedCard?.title === card.title;
52
+ }
53
+
54
+ function isSelectedCategory(category: ModelGridCategory): boolean {
55
+ return selectedCategory?.value === category.value;
56
+ }
57
+ </script>
58
+
59
+ <ModalCore
60
+ bind:isOpen
61
+ {title}
62
+ {subtitle}
63
+ {totalSteps}
64
+ {currentStep}
65
+ showProgress={false}
66
+ showBack={currentStep > 1}
67
+ {onBack}
68
+ {onContinue}
69
+ class={cn("dark", className)}
70
+ >
71
+ {#snippet content()}
72
+ <!-- Categories -->
73
+ {#if categories.length > 0}
74
+ <div class="mb-6 flex flex-wrap gap-2">
75
+ {#each categories as cat (cat.value)}
76
+ {@const active = isSelectedCategory(cat)}
77
+ <button
78
+ type="button"
79
+ class={cn(
80
+ "rounded-full border px-4 py-1.5 text-sm font-medium transition-all duration-200",
81
+ active
82
+ ? "border-white/20 bg-white/10 text-white"
83
+ : "border-white/10 bg-transparent text-white/60 hover:border-white/20 hover:text-white/80"
84
+ )}
85
+ onclick={() => handleSelectCategory(cat)}
86
+ >
87
+ {cat.label}
88
+ </button>
89
+ {/each}
90
+ </div>
91
+ {/if}
92
+
93
+ <!-- Cards Grid -->
94
+ <div class="grid grid-cols-1 gap-3 md:grid-cols-2">
95
+ {#each cards as card, i (i)}
96
+ {@const selected = isSelectedCard(card)}
97
+ <button
98
+ type="button"
99
+ class={cn(
100
+ "relative flex items-center gap-4 rounded-xl border p-4 text-left transition-all duration-200",
101
+ selected
102
+ ? "border-primary/50 bg-primary/10"
103
+ : "border-white/10 bg-white/5 hover:border-white/20 hover:bg-white/8"
104
+ )}
105
+ onclick={() => handleSelectCard(card)}
106
+ >
107
+ <!-- Icon -->
108
+ <div
109
+ class={cn(
110
+ "flex size-10 shrink-0 items-center justify-center rounded-lg",
111
+ selected ? "bg-primary/20" : "bg-white/10"
112
+ )}
113
+ >
114
+ {#if typeof card.icon === "string"}
115
+ <i class="{card.icon} text-lg text-white/70"></i>
116
+ {:else}
117
+ <HugeiconsIcon icon={card.icon} class="size-5 text-white/70" />
118
+ {/if}
119
+ </div>
120
+
121
+ <!-- Text -->
122
+ <div class="min-w-0 flex-1">
123
+ <p class="text-sm font-bold text-white">{card.title}</p>
124
+ {#if card.description}
125
+ <p class="mt-0.5 line-clamp-1 text-xs text-white/50">
126
+ {card.description}
127
+ </p>
128
+ {/if}
129
+ </div>
130
+
131
+ <!-- Checkmark -->
132
+ {#if selected}
133
+ <HugeiconsIcon
134
+ icon={CheckmarkCircle02Icon}
135
+ class="size-5 shrink-0 text-primary"
136
+ />
137
+ {/if}
138
+ </button>
139
+ {/each}
140
+ </div>
141
+ {/snippet}
142
+ </ModalCore>
@@ -0,0 +1,4 @@
1
+ import type { ModalGridSelectionProps } from "../../types";
2
+ declare const ModalGridSelection02: import("svelte").Component<ModalGridSelectionProps, {}, "isOpen" | "selectedCard" | "selectedCategory" | "selectedCards">;
3
+ type ModalGridSelection02 = ReturnType<typeof ModalGridSelection02>;
4
+ export default ModalGridSelection02;
@@ -0,0 +1,60 @@
1
+ <script lang="ts">
2
+ import type { ModalGridSelectionProps } from "../types";
3
+ import ModalGridSelection01 from "./01/ModalGridSelection01.svelte";
4
+ import ModalGridSelection02 from "./02/ModalGridSelection02.svelte";
5
+
6
+ let {
7
+ variant = 1,
8
+ title,
9
+ subtitle,
10
+ categories = [],
11
+ selectedCategory = $bindable(null),
12
+ cards = [],
13
+ selectedCard = $bindable(null),
14
+ selectedCards = $bindable([]),
15
+ multiple = false,
16
+ totalSteps = 1,
17
+ currentStep = 1,
18
+ isOpen = $bindable(false),
19
+ onSelect,
20
+ onSelectCategory,
21
+ onBack,
22
+ onContinue,
23
+ class: className,
24
+ }: ModalGridSelectionProps = $props();
25
+ </script>
26
+
27
+ {#if variant === 2}
28
+ <ModalGridSelection02
29
+ bind:isOpen
30
+ bind:selectedCard
31
+ bind:selectedCards
32
+ bind:selectedCategory
33
+ {title}
34
+ {subtitle}
35
+ {categories}
36
+ {cards}
37
+ {multiple}
38
+ {totalSteps}
39
+ {currentStep}
40
+ {onSelect}
41
+ {onSelectCategory}
42
+ {onBack}
43
+ {onContinue}
44
+ class={className}
45
+ />
46
+ {:else}
47
+ <ModalGridSelection01
48
+ bind:isOpen
49
+ bind:selectedCard
50
+ {title}
51
+ {subtitle}
52
+ {cards}
53
+ {totalSteps}
54
+ {currentStep}
55
+ {onSelect}
56
+ {onBack}
57
+ {onContinue}
58
+ class={className}
59
+ />
60
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { ModalGridSelectionProps } from "../types";
2
+ declare const ModalGridSelection: import("svelte").Component<ModalGridSelectionProps, {}, "isOpen" | "selectedCard" | "selectedCategory" | "selectedCards">;
3
+ type ModalGridSelection = ReturnType<typeof ModalGridSelection>;
4
+ export default ModalGridSelection;
@@ -0,0 +1,3 @@
1
+ import Root from "./ui/ModalMap.svelte";
2
+ export { Root, Root as ModalMap, };
3
+ export type { ModalMapProps } from "./types";
@@ -0,0 +1,2 @@
1
+ import Root from "./ui/ModalMap.svelte";
2
+ export { Root, Root as ModalMap, };
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Props do componente ModalMap — modal de seleção de localização com mapa.
3
+ * Sexta variação do sistema de modais do NegoDesign.
4
+ * @property title - Título do popup de localização (ex: "Location").
5
+ * @property searchPlaceholder - Texto placeholder da barra de pesquisa.
6
+ * @property address - Endereço actual.
7
+ * @property addressLabel - Label do campo de endereço (ex: "Address").
8
+ * @property description - Descrição/notas da localização.
9
+ * @property descriptionLabel - Label do campo de descrição (ex: "Description").
10
+ * @property editButtonText - Texto do botão "Edit" do endereço.
11
+ * @property useLocationText - Texto da checkbox de usar localização actual.
12
+ * @property useLocationChecked - Estado da checkbox.
13
+ * @property cancelText - Texto do botão cancelar.
14
+ * @property applyText - Texto do botão aplicar.
15
+ * @property isLoading - Estado de carregamento.
16
+ * @property isOpen - Controla a visibilidade do modal.
17
+ * @property onSearch - Chamado ao pesquisar um endereço.
18
+ * @property onEdit - Chamado ao clicar no botão Edit.
19
+ * @property onApply - Chamado ao clicar no botão Apply.
20
+ * @property onCancel - Chamado ao clicar no botão Cancel.
21
+ * @property onToggleLocation - Chamado ao alterar a checkbox.
22
+ * @property onClose - Chamado ao fechar o modal.
23
+ * @property mapSlot - Snippet personalizado para o conteúdo do mapa.
24
+ * @property class - Classe CSS extra no container do modal.
25
+ */
26
+ export type ModalMapProps = {
27
+ title?: string;
28
+ searchPlaceholder?: string;
29
+ address?: string;
30
+ addressLabel?: string;
31
+ description?: string;
32
+ descriptionLabel?: string;
33
+ editButtonText?: string;
34
+ useLocationText?: string;
35
+ useLocationChecked?: boolean;
36
+ cancelText?: string;
37
+ applyText?: string;
38
+ isLoading?: boolean;
39
+ isOpen?: boolean;
40
+ onSearch?: (query: string) => void;
41
+ onEdit?: () => void;
42
+ onApply?: (address: string, description: string) => void;
43
+ onCancel?: () => void;
44
+ onToggleLocation?: (checked: boolean) => void;
45
+ onClose?: () => void;
46
+ mapSlot?: import("svelte").Snippet;
47
+ class?: string;
48
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,187 @@
1
+ <script lang="ts">
2
+ import { cn } from "../../../../../utils";
3
+ import { Search01Icon, Cancel01Icon } from "@hugeicons/core-free-icons";
4
+ import { HugeiconsIcon } from "@hugeicons/svelte";
5
+ import ModalCore from "../../core/ui/ModalCore.svelte";
6
+ import type { ModalMapProps } from "../types";
7
+
8
+ let {
9
+ title = "Location",
10
+ searchPlaceholder = "Search address...",
11
+ address = "",
12
+ addressLabel = "Address",
13
+ description = "",
14
+ descriptionLabel = "Description",
15
+ editButtonText = "Edit",
16
+ useLocationText = "Use your business location",
17
+ useLocationChecked = $bindable(false),
18
+ cancelText = "Cancel",
19
+ applyText = "Apply",
20
+ isLoading = false,
21
+ isOpen = $bindable(false),
22
+ onSearch,
23
+ onEdit,
24
+ onApply,
25
+ onCancel,
26
+ onToggleLocation,
27
+ onClose,
28
+ mapSlot,
29
+ class: className,
30
+ }: ModalMapProps = $props();
31
+
32
+ let searchQuery = $state("");
33
+ let localDescription = $state("");
34
+
35
+ $effect(() => {
36
+ searchQuery = address;
37
+ localDescription = description;
38
+ });
39
+
40
+ function handleSearch() {
41
+ onSearch?.(searchQuery);
42
+ }
43
+
44
+ function handleKeydown(e: KeyboardEvent) {
45
+ if (e.key === "Enter") handleSearch();
46
+ }
47
+
48
+ function handleApply() {
49
+ onApply?.(searchQuery, localDescription);
50
+ }
51
+
52
+ function handleCancel() {
53
+ isOpen = false;
54
+ onCancel?.();
55
+ }
56
+
57
+ function handleToggle(e: Event) {
58
+ const checked = (e.target as HTMLInputElement).checked;
59
+ useLocationChecked = checked;
60
+ onToggleLocation?.(checked);
61
+ }
62
+ </script>
63
+
64
+ <ModalCore
65
+ bind:isOpen
66
+ title=""
67
+ showProgress={false}
68
+ showBack={false}
69
+ {onClose}
70
+ class={cn("max-w-2xl overflow-hidden p-0!", className)}
71
+ >
72
+ {#snippet content()}
73
+ <div class="-mx-8 -mt-6 mb-0 flex flex-col">
74
+ <!-- Map Area -->
75
+ <div class="relative h-72 w-full bg-muted md:h-96">
76
+ {#if mapSlot}
77
+ {@render mapSlot()}
78
+ {:else}
79
+ <!-- Placeholder map with grid pattern -->
80
+ <div class="absolute inset-0 bg-[linear-gradient(to_right,#e5e7eb_1px,transparent_1px),linear-gradient(to_bottom,#e5e7eb_1px,transparent_1px)] bg-size-[20px_20px] opacity-50"></div>
81
+ <div class="absolute inset-0 flex items-center justify-center">
82
+ <div class="flex size-10 items-center justify-center rounded-full bg-primary shadow-lg">
83
+ <div class="size-3 rounded-full bg-white"></div>
84
+ </div>
85
+ </div>
86
+ {/if}
87
+
88
+ <!-- Search Bar -->
89
+ <div class="absolute left-4 right-4 top-4">
90
+ <div class="flex items-center gap-2 rounded-xl border border-border bg-card shadow-lg">
91
+ <HugeiconsIcon icon={Search01Icon} class="ml-3 size-4 text-muted-foreground" />
92
+ <input
93
+ type="text"
94
+ bind:value={searchQuery}
95
+ placeholder={searchPlaceholder}
96
+ class="flex-1 bg-transparent py-3 pr-4 text-sm text-foreground outline-none placeholder:text-muted-foreground"
97
+ onkeydown={handleKeydown}
98
+ />
99
+ </div>
100
+ </div>
101
+
102
+ <!-- Location Popup Card -->
103
+ <div class="absolute bottom-4 left-4 right-4 rounded-xl border border-border bg-card p-5 shadow-lg md:left-auto md:right-4 md:w-80">
104
+ <div class="mb-4 flex items-center justify-between">
105
+ <h3 class="text-lg font-bold">{title}</h3>
106
+ <button
107
+ type="button"
108
+ class="text-muted-foreground transition hover:text-foreground"
109
+ onclick={() => (isOpen = false)}
110
+ >
111
+ <HugeiconsIcon icon={Cancel01Icon} class="size-4" />
112
+ </button>
113
+ </div>
114
+
115
+ <!-- Address -->
116
+ <div class="mb-4">
117
+ <!-- svelte-ignore a11y_label_has_associated_control -->
118
+ <label class="mb-1.5 block text-sm font-medium text-muted-foreground">
119
+ {addressLabel}
120
+ </label>
121
+ <div class="flex items-center gap-2">
122
+ <input
123
+ type="text"
124
+ bind:value={searchQuery}
125
+ class="flex-1 rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/20"
126
+ />
127
+ <button
128
+ type="button"
129
+ class="shrink-0 rounded-lg border border-border px-3 py-2 text-sm font-medium text-muted-foreground transition hover:bg-muted"
130
+ onclick={onEdit}
131
+ >
132
+ {editButtonText}
133
+ </button>
134
+ </div>
135
+ </div>
136
+
137
+ <!-- Description -->
138
+ <div>
139
+ <!-- svelte-ignore a11y_label_has_associated_control -->
140
+ <label class="mb-1.5 block text-sm font-medium text-muted-foreground">
141
+ {descriptionLabel}
142
+ </label>
143
+ <textarea
144
+ bind:value={localDescription}
145
+ rows={3}
146
+ class="w-full resize-none rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/20"
147
+ ></textarea>
148
+ </div>
149
+ </div>
150
+ </div>
151
+ </div>
152
+ {/snippet}
153
+
154
+ {#snippet footer()}
155
+ <div class="flex items-center justify-between">
156
+ <!-- Use Location Checkbox -->
157
+ <label class="flex cursor-pointer items-center gap-2.5">
158
+ <input
159
+ type="checkbox"
160
+ checked={useLocationChecked}
161
+ onchange={handleToggle}
162
+ class="size-4 rounded border-border text-primary accent-primary"
163
+ />
164
+ <span class="text-sm font-medium text-muted-foreground">{useLocationText}</span>
165
+ </label>
166
+
167
+ <!-- Actions -->
168
+ <div class="flex items-center gap-3">
169
+ <button
170
+ type="button"
171
+ class="rounded-lg border border-border px-5 py-2.5 text-sm font-semibold transition hover:bg-muted"
172
+ onclick={handleCancel}
173
+ >
174
+ {cancelText}
175
+ </button>
176
+ <button
177
+ type="button"
178
+ disabled={isLoading}
179
+ class="rounded-lg bg-primary px-6 py-2.5 text-sm font-semibold text-primary-foreground transition hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50"
180
+ onclick={handleApply}
181
+ >
182
+ {applyText}
183
+ </button>
184
+ </div>
185
+ </div>
186
+ {/snippet}
187
+ </ModalCore>
@@ -0,0 +1,4 @@
1
+ import type { ModalMapProps } from "../types";
2
+ declare const ModalMap: import("svelte").Component<ModalMapProps, {}, "isOpen" | "useLocationChecked">;
3
+ type ModalMap = ReturnType<typeof ModalMap>;
4
+ export default ModalMap;
@@ -0,0 +1,3 @@
1
+ import Root from "./ui/ModalNotification.svelte";
2
+ export { Root, Root as ModalNotification, };
3
+ export type { ModalNotificationProps } from "./types";
@@ -0,0 +1,2 @@
1
+ import Root from "./ui/ModalNotification.svelte";
2
+ export { Root, Root as ModalNotification, };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Props do componente ModalNotification — modal de subscrição/notificação por email.
3
+ * Quarta variação do sistema de modais do NegoDesign.
4
+ * @property title - Título principal do modal (ex: "Be the first to know").
5
+ * @property description - Texto descritivo abaixo do título.
6
+ * @property placeholder - Texto placeholder do input de email.
7
+ * @property buttonText - Texto do botão de submissão.
8
+ * @property buttonLoadingText - Texto exibido durante o carregamento.
9
+ * @property isLoading - Estado de carregamento do botão.
10
+ * @property isOpen - Controla a visibilidade do modal.
11
+ * @property onSubmit - Chamado ao submeter o email.
12
+ * @property onClose - Chamado ao fechar o modal.
13
+ * @property class - Classe CSS extra no container do modal.
14
+ */
15
+ export type ModalNotificationProps = {
16
+ title: string;
17
+ description?: string;
18
+ placeholder?: string;
19
+ buttonText?: string;
20
+ buttonLoadingText?: string;
21
+ isLoading?: boolean;
22
+ isOpen?: boolean;
23
+ onSubmit?: (email: string) => void;
24
+ onClose?: () => void;
25
+ class?: string;
26
+ };
@@ -0,0 +1 @@
1
+ export {};