negodesign 0.0.42 → 0.0.43

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.
@@ -86,6 +86,12 @@
86
86
  onerror={(e) =>
87
87
  ((e.target as HTMLImageElement).src = ImgPlaceHolderGallery)}
88
88
  />
89
+ {:else}
90
+ <img
91
+ src={ImgPlaceHolderGallery}
92
+ alt="Not Found"
93
+ class="rounded-lg h-36 md:h-44 w-full object-cover object-center"
94
+ />
89
95
  {/if}
90
96
  <div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
91
97
  </aside>
@@ -85,6 +85,12 @@
85
85
  onerror={(e) =>
86
86
  ((e.target as HTMLImageElement).src = ImgPlaceHolderGallery)}
87
87
  />
88
+ {:else}
89
+ <img
90
+ src={ImgPlaceHolderGallery}
91
+ alt="Not Found"
92
+ class="rounded-lg h-36 md:h-44 w-full object-cover object-center"
93
+ />
88
94
  {/if}
89
95
  <div class="absolute inset-0 bg-black/5 rounded-sm h-full w-full"></div>
90
96
  </aside>
@@ -2,7 +2,7 @@ import { GlobalIcon, MapPin, NecklaceIcon } from "@hugeicons/core-free-icons";
2
2
  const items = [
3
3
  {
4
4
  id: 1,
5
- imageUrl: "https://images.unsplash.com/photo-1507525428034-b723cf961d3e?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
5
+ //imageUrl: "https://images.unsplash.com/photo-1507525428034-b723cf961d3e?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
6
6
  title: "Hotel Baía Azul",
7
7
  content: "Acomodação premium de frente para o mar com quartos luxuosos, restaurante internacional, piscina aquecida e serviço de transfer exclusivo para hóspedes.",
8
8
  isFavorite: true,
@@ -16,16 +16,7 @@
16
16
  onSubscribe,
17
17
  }: FooterProps = $props();
18
18
 
19
- let email = $state("");
20
19
  const year = new Date().getFullYear();
21
-
22
- function handleSubscribe(e: SubmitEvent) {
23
- e.preventDefault();
24
- const value = email.trim();
25
- if (!value) return;
26
- onSubscribe?.(value);
27
- email = "";
28
- }
29
20
  </script>
30
21
 
31
22
  <footer class="p-10">
@@ -12,16 +12,23 @@
12
12
  </script>
13
13
 
14
14
  <script lang="ts">
15
- import type { DocPageData } from "../types";
16
15
  import { buildToc } from "../shared/toc";
17
16
  import PrivacyPolicyOrTermsOfUseBreadcrumb from "../shared/PrivacyPolicyOrTermsOfUseBreadcrumb.svelte";
18
17
  import DocSectionView from "../shared/DocSectionView.svelte";
19
18
  import DocsSidebar from "./DocsSidebar.svelte";
20
19
  import TableOfContents from "./TableOfContents.svelte";
20
+ import type { PrivacyPolicyOrTermsOfUseProps } from "../types";
21
21
 
22
- let { data }: { data: DocPageData } = $props();
22
+ let {
23
+ breadcrumb,
24
+ sections,
25
+ title,
26
+ lastUpdated,
27
+ isVisibleMenuLeft = true,
28
+ isVisibleMenuRight,
29
+ }: PrivacyPolicyOrTermsOfUseProps = $props();
23
30
 
24
- const toc = $derived(buildToc(data.sections));
31
+ const toc = $derived(buildToc(sections));
25
32
 
26
33
  /** Currently visible section, for highlighting in the TOC (simple scroll-spy). */
27
34
  let activeId = $state<string | undefined>(undefined);
@@ -48,26 +55,29 @@
48
55
 
49
56
  <div class="mx-auto max-w-7xl px-6 py-10">
50
57
  <div class="flex gap-10">
51
- <DocsSidebar sections={data.sections} {activeId} />
58
+ {#if isVisibleMenuLeft}
59
+ <DocsSidebar {sections} {activeId} />
60
+ {/if}
52
61
 
53
62
  <main class="min-w-0 flex-1 flex flex-col gap-8">
54
63
  <header class="flex flex-col gap-4">
55
64
  <div>
56
- <h1 class="text-3xl font-bold tracking-tight">{data.title}</h1>
65
+ <h1 class="text-3xl font-bold tracking-tight">{title}</h1>
57
66
  <p class="mt-1 text-sm text-muted-foreground">
58
- Latest update: {data.lastUpdated}
67
+ Latest update: {lastUpdated}
59
68
  </p>
60
69
  </div>
61
- <PrivacyPolicyOrTermsOfUseBreadcrumb items={data.breadcrumb} />
70
+ <PrivacyPolicyOrTermsOfUseBreadcrumb items={breadcrumb} />
62
71
  </header>
63
72
 
64
73
  <div class="flex flex-col gap-10">
65
- {#each data.sections as section (section.id)}
74
+ {#each sections as section (section.id)}
66
75
  <DocSectionView {section} />
67
76
  {/each}
68
77
  </div>
69
78
  </main>
70
-
71
- <TableOfContents items={toc} {activeId} />
79
+ {#if isVisibleMenuRight}
80
+ <TableOfContents items={toc} {activeId} />
81
+ {/if}
72
82
  </div>
73
83
  </div>
@@ -1,7 +1,4 @@
1
- import type { DocPageData } from "../types";
2
- type $$ComponentProps = {
3
- data: DocPageData;
4
- };
5
- declare const PrivacyPolicyOrTermsOfUse01: import("svelte").Component<$$ComponentProps, {}, "">;
1
+ import type { PrivacyPolicyOrTermsOfUseProps } from "../types";
2
+ declare const PrivacyPolicyOrTermsOfUse01: import("svelte").Component<PrivacyPolicyOrTermsOfUseProps, {}, "">;
6
3
  type PrivacyPolicyOrTermsOfUse01 = ReturnType<typeof PrivacyPolicyOrTermsOfUse01>;
7
4
  export default PrivacyPolicyOrTermsOfUse01;
@@ -11,14 +11,14 @@
11
11
  </script>
12
12
 
13
13
  <script lang="ts">
14
- import type { DocPageData } from "../types";
15
14
  import DocsPageHero from "./DocsPageHero.svelte";
15
+ import type { PrivacyPolicyOrTermsOfUseProps } from "../types";
16
16
 
17
- let { data }: { data: DocPageData } = $props();
17
+ let { ...data }: PrivacyPolicyOrTermsOfUseProps = $props();
18
18
  </script>
19
19
 
20
20
  <svelte:head>
21
21
  <title>{data.title}</title>
22
22
  </svelte:head>
23
23
 
24
- <DocsPageHero data={data} />
24
+ <DocsPageHero {data} />
@@ -1,7 +1,4 @@
1
- import type { DocPageData } from "../types";
2
- type $$ComponentProps = {
3
- data: DocPageData;
4
- };
5
- declare const PrivacyPolicyOrTermsOfUse02: import("svelte").Component<$$ComponentProps, {}, "">;
1
+ import type { PrivacyPolicyOrTermsOfUseProps } from "../types";
2
+ declare const PrivacyPolicyOrTermsOfUse02: import("svelte").Component<PrivacyPolicyOrTermsOfUseProps, {}, "">;
6
3
  type PrivacyPolicyOrTermsOfUse02 = ReturnType<typeof PrivacyPolicyOrTermsOfUse02>;
7
4
  export default PrivacyPolicyOrTermsOfUse02;
@@ -8,10 +8,10 @@
8
8
  * @component
9
9
  * @example
10
10
  * ```svelte
11
- * <!-- Variant 1 (default) — docs layout with sidebar -->
11
+ * <!-- Variant 1 (default) — docs layout with sidebar -->
12
12
  * <PrivacyPolicyOrTermsOfUse variant={1} data={pageData} />
13
13
  *
14
- * <!-- Variant 2 — layout with hero -->
14
+ * <!-- Variant 2 — layout with hero -->
15
15
  * <PrivacyPolicyOrTermsOfUse variant={2} data={pageData} />
16
16
  * ```
17
17
  */
@@ -22,11 +22,11 @@
22
22
  import PrivacyPolicyOrTermsOfUse01 from "./01/PrivacyPolicyOrTermsOfUse01.svelte";
23
23
  import PrivacyPolicyOrTermsOfUse02 from "./02/PrivacyPolicyOrTermsOfUse02.svelte";
24
24
 
25
- let { variant = 1, data }: PrivacyPolicyOrTermsOfUseProps = $props();
25
+ let { variant = 1, ...data }: PrivacyPolicyOrTermsOfUseProps = $props();
26
26
  </script>
27
27
 
28
28
  {#if variant === 2}
29
- <PrivacyPolicyOrTermsOfUse02 {data} />
29
+ <PrivacyPolicyOrTermsOfUse02 {...data} />
30
30
  {:else}
31
- <PrivacyPolicyOrTermsOfUse01 {data} />
31
+ <PrivacyPolicyOrTermsOfUse01 {...data} />
32
32
  {/if}
@@ -37,17 +37,6 @@ export interface DocSection {
37
37
  /** subsecções aninhadas */
38
38
  subsections?: DocSection[];
39
39
  }
40
- /** Dados completos de uma página de documentação/política. */
41
- export interface DocPageData {
42
- /** título da página */
43
- title: string;
44
- /** data da última atualização */
45
- lastUpdated: string;
46
- /** itens do breadcrumb */
47
- breadcrumb: BreadcrumbItem[];
48
- /** secções de conteúdo (usadas pela sidebar, TOC e renderização) */
49
- sections: DocSection[];
50
- }
51
40
  /** Item derivado automaticamente das secções, para a tabela de conteúdos (TOC). */
52
41
  export interface TocItem {
53
42
  id: string;
@@ -57,6 +46,14 @@ export interface TocItem {
57
46
  export interface PrivacyPolicyOrTermsOfUseProps {
58
47
  /** Variante do layout: 1 = sidebar+TOC, 2 = hero+coluna. */
59
48
  variant?: 1 | 2;
60
- /** Dados completos da página de documento. */
61
- data: DocPageData;
49
+ /** título da página */
50
+ title: string;
51
+ /** data da última atualização */
52
+ lastUpdated: string;
53
+ /** itens do breadcrumb */
54
+ breadcrumb: BreadcrumbItem[];
55
+ /** secções de conteúdo (usadas pela sidebar, TOC e renderização) */
56
+ sections: DocSection[];
57
+ isVisibleMenuLeft?: boolean;
58
+ isVisibleMenuRight?: boolean;
62
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "negodesign",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "sideEffects": [