@r2digisolutions/components 0.22.2 → 0.23.1
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/components/atoms/Avatar/Avatar.stories.d.ts +1 -1
- package/dist/components/atoms/Avatar/Avatar.stories.js +1 -1
- package/dist/components/atoms/Avatar/Avatar.svelte +5 -3
- package/dist/components/atoms/Avatar/Avatar.svelte.d.ts +1 -1
- package/dist/components/atoms/Avatar/AvatarStory.svelte +1 -1
- package/dist/components/atoms/Avatar/AvatarStory.svelte.d.ts +1 -1
- package/dist/components/atoms/Container/Container.stories.d.ts +1 -1
- package/dist/components/atoms/Container/ContainerStory.svelte.d.ts +1 -1
- package/dist/components/atoms/Input/Input.svelte +5 -4
- package/dist/components/molecules/AdSlot/AdSlot.stories.js +10 -0
- package/dist/components/molecules/AdSlot/AdSlot.svelte +16 -0
- package/dist/components/molecules/AdSlot/AdSlot.svelte.d.ts +8 -0
- package/dist/components/molecules/AdSlot/AdSlotStory.svelte +23 -0
- package/dist/components/molecules/AdSlot/AdSlotStory.svelte.d.ts +18 -0
- package/dist/components/molecules/AdUnit/AdUnit.stories.js +28 -0
- package/dist/components/molecules/AdUnit/AdUnit.svelte +151 -0
- package/dist/components/molecules/AdUnit/AdUnit.svelte.d.ts +15 -0
- package/dist/components/molecules/AdUnit/AdUnitStory.svelte +36 -0
- package/dist/components/molecules/AdUnit/AdUnitStory.svelte.d.ts +7 -0
- package/dist/components/molecules/AvatarGroup/AvatarGroup.svelte +1 -1
- package/dist/components/molecules/AvatarGroup/AvatarGroup.svelte.d.ts +1 -1
- package/dist/components/molecules/AvatarLabel/AvatarLabel.svelte +1 -1
- package/dist/components/molecules/AvatarLabel/AvatarLabel.svelte.d.ts +1 -1
- package/dist/components/molecules/Card/Card.svelte +6 -15
- package/dist/components/molecules/ChipBar/ChipBar.svelte +18 -5
- package/dist/components/molecules/ChipBar/ChipBar.svelte.d.ts +1 -1
- package/dist/components/molecules/FeatureList/FeatureList.svelte +26 -7
- package/dist/components/molecules/FeatureList/FeatureList.svelte.d.ts +2 -0
- package/dist/components/molecules/KnowledgeCard/KnowledgeCard.stories.js +25 -0
- package/dist/components/molecules/KnowledgeCard/KnowledgeCard.svelte +95 -0
- package/dist/components/molecules/KnowledgeCard/KnowledgeCard.svelte.d.ts +15 -0
- package/dist/components/molecules/KnowledgeCard/KnowledgeCardStory.svelte +56 -0
- package/dist/components/molecules/KnowledgeCard/KnowledgeCardStory.svelte.d.ts +6 -0
- package/dist/components/molecules/LocaleSwitcher/LocaleSwitcher.svelte +5 -5
- package/dist/components/molecules/MediaCard/MediaCard.svelte +101 -24
- package/dist/components/molecules/MediaCard/MediaCard.svelte.d.ts +25 -6
- package/dist/components/molecules/MediaCard/MediaCardStory.svelte +34 -1
- package/dist/components/molecules/SearchBar/SearchBar.svelte +7 -1
- package/dist/components/molecules/SearchInput/SearchInput.svelte +77 -18
- package/dist/components/molecules/SearchInput/SearchInput.svelte.d.ts +4 -0
- package/dist/components/molecules/SearchInput/SearchInputStory.svelte +1 -0
- package/dist/components/molecules/SearchResultRow/SearchResultRow.stories.js +25 -0
- package/dist/components/molecules/SearchResultRow/SearchResultRow.svelte +74 -0
- package/dist/components/molecules/SearchResultRow/SearchResultRow.svelte.d.ts +18 -0
- package/dist/components/molecules/SearchResultRow/SearchResultRowStory.svelte +85 -0
- package/dist/components/molecules/SearchResultRow/SearchResultRowStory.svelte.d.ts +6 -0
- package/dist/components/molecules/StatCard/StatCard.svelte +7 -1
- package/dist/components/molecules/StatCard/StatCard.svelte.d.ts +2 -0
- package/dist/components/organisms/Drawer/Drawer.svelte +120 -37
- package/dist/components/organisms/Drawer/Drawer.svelte.d.ts +6 -0
- package/dist/components/organisms/MapExplorer/MapExplorer.stories.d.ts +12 -0
- package/dist/components/organisms/MapExplorer/MapExplorer.stories.js +11 -0
- package/dist/components/organisms/MapExplorer/MapExplorer.svelte +928 -0
- package/dist/components/organisms/MapExplorer/MapExplorer.svelte.d.ts +96 -0
- package/dist/components/organisms/MapExplorer/MapExplorerStory.svelte +124 -0
- package/dist/components/organisms/MapExplorer/MapExplorerStory.svelte.d.ts +3 -0
- package/dist/components/organisms/Navbar/Navbar.stories.d.ts +1 -1
- package/dist/components/organisms/Navbar/Navbar.stories.js +1 -1
- package/dist/components/organisms/Navbar/Navbar.svelte +137 -64
- package/dist/components/organisms/Navbar/Navbar.svelte.d.ts +5 -1
- package/dist/components/organisms/Navbar/NavbarStory.svelte +1 -1
- package/dist/components/organisms/Navbar/NavbarStory.svelte.d.ts +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +5 -0
- package/package.json +12 -8
|
@@ -5,7 +5,7 @@ declare const meta: {
|
|
|
5
5
|
src?: string;
|
|
6
6
|
alt?: string;
|
|
7
7
|
name?: string;
|
|
8
|
-
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
8
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
|
|
9
9
|
status?: "online" | "offline" | "busy" | "away" | null;
|
|
10
10
|
}, {}, "">;
|
|
11
11
|
tags: string[];
|
|
@@ -9,7 +9,7 @@ const meta = {
|
|
|
9
9
|
alt: { control: 'text', description: 'Alt text for the image' },
|
|
10
10
|
size: {
|
|
11
11
|
control: 'select',
|
|
12
|
-
options: ['xs', 'sm', 'md', 'lg', 'xl', '2xl'],
|
|
12
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl'],
|
|
13
13
|
description: 'Avatar size'
|
|
14
14
|
},
|
|
15
15
|
status: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
2
|
+
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
3
3
|
type AvatarStatus = 'online' | 'offline' | 'busy' | 'away' | null;
|
|
4
4
|
|
|
5
5
|
interface AvatarProps {
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
md: 'h-10 w-10 text-sm',
|
|
32
32
|
lg: 'h-12 w-12 text-base',
|
|
33
33
|
xl: 'h-16 w-16 text-lg',
|
|
34
|
-
'2xl': 'h-20 w-20 text-xl'
|
|
34
|
+
'2xl': 'h-20 w-20 text-xl',
|
|
35
|
+
'3xl': 'h-28 w-28 text-2xl sm:h-32 sm:w-32'
|
|
35
36
|
};
|
|
36
37
|
|
|
37
38
|
const statusDotSizes: Record<AvatarSize, string> = {
|
|
@@ -40,7 +41,8 @@
|
|
|
40
41
|
md: 'h-2.5 w-2.5',
|
|
41
42
|
lg: 'h-3 w-3',
|
|
42
43
|
xl: 'h-3.5 w-3.5',
|
|
43
|
-
'2xl': 'h-4 w-4'
|
|
44
|
+
'2xl': 'h-4 w-4',
|
|
45
|
+
'3xl': 'h-5 w-5'
|
|
44
46
|
};
|
|
45
47
|
|
|
46
48
|
const statusColors: Record<NonNullable<AvatarStatus>, string> = {
|
|
@@ -2,7 +2,7 @@ type $$ComponentProps = {
|
|
|
2
2
|
src?: string;
|
|
3
3
|
alt?: string;
|
|
4
4
|
name?: string;
|
|
5
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
6
6
|
status?: 'online' | 'offline' | 'busy' | 'away' | null;
|
|
7
7
|
};
|
|
8
8
|
declare const AvatarStory: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/svelte';
|
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
4
|
component: import("svelte").Component<{
|
|
5
|
-
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
5
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "4xl" | "5xl" | "6xl" | "7xl";
|
|
6
6
|
padding?: "none" | "sm" | "md" | "lg";
|
|
7
7
|
}, {}, "">;
|
|
8
8
|
tags: string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const ContainerStory: import("svelte").Component<{
|
|
2
|
-
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "
|
|
2
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | "4xl" | "5xl" | "6xl" | "7xl";
|
|
3
3
|
padding?: "none" | "sm" | "md" | "lg";
|
|
4
4
|
}, {}, "">;
|
|
5
5
|
type ContainerStory = ReturnType<typeof ContainerStory>;
|
|
@@ -220,11 +220,12 @@
|
|
|
220
220
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
|
221
221
|
</svg>
|
|
222
222
|
</button>
|
|
223
|
-
{
|
|
224
|
-
|
|
223
|
+
{/if}
|
|
224
|
+
{#if trailIcon}
|
|
225
|
+
<span class={['shrink-0', statusIconClasses[status]]}>
|
|
225
226
|
{@render trailIcon()}
|
|
226
227
|
</span>
|
|
227
|
-
{:else if status === 'error'}
|
|
228
|
+
{:else if !hasClear && status === 'error'}
|
|
228
229
|
<svg
|
|
229
230
|
class="h-4 w-4 text-red-500 shrink-0"
|
|
230
231
|
viewBox="0 0 24 24"
|
|
@@ -237,7 +238,7 @@
|
|
|
237
238
|
clip-rule="evenodd"
|
|
238
239
|
/>
|
|
239
240
|
</svg>
|
|
240
|
-
{:else if status === 'success'}
|
|
241
|
+
{:else if !hasClear && status === 'success'}
|
|
241
242
|
<svg
|
|
242
243
|
class="h-4 w-4 text-green-500 shrink-0"
|
|
243
244
|
viewBox="0 0 24 24"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
4
|
+
interface AdSlotProps {
|
|
5
|
+
class?: string
|
|
6
|
+
children?: Snippet
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { class: className = '', children }: AdSlotProps = $props()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
{#if children}
|
|
13
|
+
<div class={['min-w-0', className]}>
|
|
14
|
+
{@render children()}
|
|
15
|
+
</div>
|
|
16
|
+
{/if}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import AdSlot from './AdSlot.svelte'
|
|
3
|
+
import AdUnit from '../AdUnit/AdUnit.svelte'
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div class="mx-auto w-full max-w-xl space-y-4 p-4">
|
|
7
|
+
<p class="text-[11px] font-medium uppercase tracking-wide text-muted">With content</p>
|
|
8
|
+
<AdSlot>
|
|
9
|
+
<AdUnit
|
|
10
|
+
format="native"
|
|
11
|
+
headline="EvoFact — Facturación inteligente para tu empresa"
|
|
12
|
+
description="Prueba gratis 14 días. Sin tarjeta de crédito."
|
|
13
|
+
href="https://evoteg.com"
|
|
14
|
+
advertiser="evoteg.com"
|
|
15
|
+
/>
|
|
16
|
+
</AdSlot>
|
|
17
|
+
|
|
18
|
+
<p class="text-[11px] font-medium uppercase tracking-wide text-muted">Empty (renders nothing)</p>
|
|
19
|
+
<div class="rounded border border-dashed border-border p-3 text-xs text-muted">
|
|
20
|
+
AdSlot sin children → no renderiza nada:
|
|
21
|
+
<AdSlot />
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const AdSlotStory: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type AdSlotStory = InstanceType<typeof AdSlotStory>;
|
|
18
|
+
export default AdSlotStory;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import AdUnitStory from './AdUnitStory.svelte';
|
|
2
|
+
const meta = {
|
|
3
|
+
title: 'Molecules/AdUnit',
|
|
4
|
+
component: AdUnitStory,
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {
|
|
7
|
+
format: {
|
|
8
|
+
control: 'select',
|
|
9
|
+
options: ['native', 'search', 'horizontal', 'banner', 'vertical']
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
export const Native = {
|
|
15
|
+
args: { format: 'native' }
|
|
16
|
+
};
|
|
17
|
+
export const Search = {
|
|
18
|
+
args: { format: 'search' }
|
|
19
|
+
};
|
|
20
|
+
export const Horizontal = {
|
|
21
|
+
args: { format: 'horizontal' }
|
|
22
|
+
};
|
|
23
|
+
export const Banner = {
|
|
24
|
+
args: { format: 'banner' }
|
|
25
|
+
};
|
|
26
|
+
export const Vertical = {
|
|
27
|
+
args: { format: 'vertical' }
|
|
28
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Image from '../../atoms/Image/Image.svelte'
|
|
3
|
+
|
|
4
|
+
export type AdUnitFormat = 'horizontal' | 'vertical' | 'banner' | 'native' | 'search'
|
|
5
|
+
|
|
6
|
+
interface AdUnitProps {
|
|
7
|
+
format?: AdUnitFormat
|
|
8
|
+
headline: string
|
|
9
|
+
description?: string
|
|
10
|
+
imageUrl?: string
|
|
11
|
+
href: string
|
|
12
|
+
advertiser?: string
|
|
13
|
+
/** Badge label shown on the ad. Defaults to 'Anuncio'. */
|
|
14
|
+
label?: string
|
|
15
|
+
class?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let {
|
|
19
|
+
format = 'native',
|
|
20
|
+
headline,
|
|
21
|
+
description,
|
|
22
|
+
imageUrl,
|
|
23
|
+
href,
|
|
24
|
+
advertiser,
|
|
25
|
+
label = 'Anuncio',
|
|
26
|
+
class: className = ''
|
|
27
|
+
}: AdUnitProps = $props()
|
|
28
|
+
|
|
29
|
+
const hasImage = $derived(!!imageUrl)
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
{#snippet adBadge()}
|
|
33
|
+
<span
|
|
34
|
+
class="inline-flex items-center rounded border border-amber-400/60 bg-amber-50 px-1 py-0.5 text-[10px] font-medium leading-none text-amber-700 dark:border-amber-400/40 dark:bg-amber-400/10 dark:text-amber-400"
|
|
35
|
+
>
|
|
36
|
+
{label}
|
|
37
|
+
</span>
|
|
38
|
+
{/snippet}
|
|
39
|
+
|
|
40
|
+
<a
|
|
41
|
+
{href}
|
|
42
|
+
target="_blank"
|
|
43
|
+
rel="noopener sponsored"
|
|
44
|
+
class={[
|
|
45
|
+
'group block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30',
|
|
46
|
+
(format === 'vertical') && 'max-w-xs',
|
|
47
|
+
className
|
|
48
|
+
]}
|
|
49
|
+
>
|
|
50
|
+
{#if format === 'search'}
|
|
51
|
+
<!-- Google-ads style: title brand, advertiser breadcrumb, description -->
|
|
52
|
+
<div class="flex min-w-0 gap-2 py-2">
|
|
53
|
+
<div class="min-w-0 flex-1">
|
|
54
|
+
<div class="mb-0.5 flex items-center gap-1.5">
|
|
55
|
+
{@render adBadge()}
|
|
56
|
+
{#if advertiser}
|
|
57
|
+
<span class="truncate text-xs text-muted">{advertiser}</span>
|
|
58
|
+
{/if}
|
|
59
|
+
</div>
|
|
60
|
+
<p class="truncate text-lg font-medium leading-snug text-brand-600 group-hover:underline">
|
|
61
|
+
{headline}
|
|
62
|
+
</p>
|
|
63
|
+
{#if description}
|
|
64
|
+
<p class="mt-1 line-clamp-2 text-sm text-secondary">{description}</p>
|
|
65
|
+
{/if}
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
{:else if format === 'native'}
|
|
69
|
+
<!-- Tile-like row with image thumb -->
|
|
70
|
+
<div
|
|
71
|
+
class="flex items-start gap-3 overflow-hidden rounded-xl border border-border bg-surface-elevated p-3 transition-colors hover:border-border-strong hover:bg-surface-overlay/70"
|
|
72
|
+
>
|
|
73
|
+
{#if hasImage}
|
|
74
|
+
<div class="h-16 w-16 shrink-0 overflow-hidden rounded-lg">
|
|
75
|
+
<Image src={imageUrl!} alt={headline} class="h-16 w-16" />
|
|
76
|
+
</div>
|
|
77
|
+
{/if}
|
|
78
|
+
<div class="min-w-0 flex-1">
|
|
79
|
+
<div class="mb-1 flex items-center gap-1.5">
|
|
80
|
+
{@render adBadge()}
|
|
81
|
+
{#if advertiser}
|
|
82
|
+
<span class="truncate text-xs text-muted">{advertiser}</span>
|
|
83
|
+
{/if}
|
|
84
|
+
</div>
|
|
85
|
+
<p class="truncate text-sm font-semibold leading-snug text-primary group-hover:underline">
|
|
86
|
+
{headline}
|
|
87
|
+
</p>
|
|
88
|
+
{#if description}
|
|
89
|
+
<p class="mt-0.5 line-clamp-2 text-xs text-secondary">{description}</p>
|
|
90
|
+
{/if}
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
{:else if format === 'vertical'}
|
|
94
|
+
<!-- Stacked image on top, text below -->
|
|
95
|
+
<div
|
|
96
|
+
class="overflow-hidden rounded-xl border border-border bg-surface-elevated transition-colors hover:border-border-strong"
|
|
97
|
+
>
|
|
98
|
+
{#if hasImage}
|
|
99
|
+
<Image src={imageUrl!} alt={headline} aspectRatio="4/3" class="w-full" />
|
|
100
|
+
{:else}
|
|
101
|
+
<div class="h-32 w-full bg-surface-overlay"></div>
|
|
102
|
+
{/if}
|
|
103
|
+
<div class="p-3">
|
|
104
|
+
<div class="mb-1 flex items-center gap-1.5">
|
|
105
|
+
{@render adBadge()}
|
|
106
|
+
{#if advertiser}
|
|
107
|
+
<span class="truncate text-xs text-muted">{advertiser}</span>
|
|
108
|
+
{/if}
|
|
109
|
+
</div>
|
|
110
|
+
<p class="text-sm font-semibold leading-snug text-primary group-hover:underline">
|
|
111
|
+
{headline}
|
|
112
|
+
</p>
|
|
113
|
+
{#if description}
|
|
114
|
+
<p class="mt-1 text-xs text-secondary">{description}</p>
|
|
115
|
+
{/if}
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
{:else}
|
|
119
|
+
<!-- banner / horizontal: image left or top strip + headline + description, wide -->
|
|
120
|
+
<div
|
|
121
|
+
class={[
|
|
122
|
+
'flex overflow-hidden rounded-xl border border-border bg-surface-elevated transition-colors hover:border-border-strong',
|
|
123
|
+
format === 'banner' ? 'flex-col' : 'flex-row items-center'
|
|
124
|
+
]}
|
|
125
|
+
>
|
|
126
|
+
{#if hasImage}
|
|
127
|
+
{#if format === 'banner'}
|
|
128
|
+
<Image src={imageUrl!} alt={headline} aspectRatio="21/4" class="w-full" />
|
|
129
|
+
{:else}
|
|
130
|
+
<div class="h-full w-36 shrink-0">
|
|
131
|
+
<Image src={imageUrl!} alt={headline} aspectRatio="1/1" class="h-full w-full" />
|
|
132
|
+
</div>
|
|
133
|
+
{/if}
|
|
134
|
+
{/if}
|
|
135
|
+
<div class={['flex-1 p-3', format === 'banner' && hasImage ? 'pt-2' : '']}>
|
|
136
|
+
<div class="mb-1 flex items-center gap-1.5">
|
|
137
|
+
{@render adBadge()}
|
|
138
|
+
{#if advertiser}
|
|
139
|
+
<span class="truncate text-xs text-muted">{advertiser}</span>
|
|
140
|
+
{/if}
|
|
141
|
+
</div>
|
|
142
|
+
<p class="text-sm font-semibold leading-snug text-primary group-hover:underline">
|
|
143
|
+
{headline}
|
|
144
|
+
</p>
|
|
145
|
+
{#if description}
|
|
146
|
+
<p class="mt-0.5 line-clamp-2 text-xs text-secondary">{description}</p>
|
|
147
|
+
{/if}
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
{/if}
|
|
151
|
+
</a>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type AdUnitFormat = 'horizontal' | 'vertical' | 'banner' | 'native' | 'search';
|
|
2
|
+
interface AdUnitProps {
|
|
3
|
+
format?: AdUnitFormat;
|
|
4
|
+
headline: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
imageUrl?: string;
|
|
7
|
+
href: string;
|
|
8
|
+
advertiser?: string;
|
|
9
|
+
/** Badge label shown on the ad. Defaults to 'Anuncio'. */
|
|
10
|
+
label?: string;
|
|
11
|
+
class?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const AdUnit: import("svelte").Component<AdUnitProps, {}, "">;
|
|
14
|
+
type AdUnit = ReturnType<typeof AdUnit>;
|
|
15
|
+
export default AdUnit;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import AdUnit from './AdUnit.svelte'
|
|
3
|
+
import type { AdUnitFormat } from './AdUnit.svelte'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
format?: AdUnitFormat
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
let { format = 'native' }: Props = $props()
|
|
10
|
+
|
|
11
|
+
const demoImage = 'https://images.unsplash.com/photo-1461897104016-0b3b00cc81ee?w=600&q=80'
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div class="mx-auto w-full max-w-xl space-y-4 p-4">
|
|
15
|
+
<p class="text-[11px] font-medium uppercase tracking-wide text-muted">Formato: {format}</p>
|
|
16
|
+
|
|
17
|
+
<AdUnit
|
|
18
|
+
{format}
|
|
19
|
+
headline="EvoFact — Facturación inteligente para tu empresa"
|
|
20
|
+
description="Emite facturas electrónicas con VeriFactu, gestiona clientes y cobra más rápido. Prueba gratis 14 días."
|
|
21
|
+
imageUrl={demoImage}
|
|
22
|
+
href="https://evoteg.com"
|
|
23
|
+
advertiser="evoteg.com"
|
|
24
|
+
/>
|
|
25
|
+
|
|
26
|
+
{#if format === 'native'}
|
|
27
|
+
<AdUnit
|
|
28
|
+
{format}
|
|
29
|
+
headline="Atom — Software para gimnasios"
|
|
30
|
+
description="Gestiona socios, accesos y clases con la plataforma líder en centros deportivos."
|
|
31
|
+
href="https://atom.com"
|
|
32
|
+
advertiser="atom.com"
|
|
33
|
+
label="Patrocinado"
|
|
34
|
+
/>
|
|
35
|
+
{/if}
|
|
36
|
+
</div>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
interface AvatarGroupProps {
|
|
14
14
|
items?: AvatarGroupItem[];
|
|
15
15
|
max?: number;
|
|
16
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
16
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
17
17
|
/** Separator ring color against parent background */
|
|
18
18
|
ring?: AvatarGroupRing;
|
|
19
19
|
class?: string;
|
|
@@ -8,7 +8,7 @@ export type AvatarGroupRing = 'surface' | 'elevated' | 'inverse' | 'transparent'
|
|
|
8
8
|
interface AvatarGroupProps {
|
|
9
9
|
items?: AvatarGroupItem[];
|
|
10
10
|
max?: number;
|
|
11
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
11
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
12
12
|
/** Separator ring color against parent background */
|
|
13
13
|
ring?: AvatarGroupRing;
|
|
14
14
|
class?: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import Avatar from '../../atoms/Avatar/Avatar.svelte';
|
|
3
3
|
import StatusDot from '../../atoms/StatusDot/StatusDot.svelte';
|
|
4
4
|
|
|
5
|
-
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
5
|
+
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
6
6
|
type Status = 'online' | 'offline' | 'busy' | 'away';
|
|
7
7
|
|
|
8
8
|
interface AvatarLabelProps {
|
|
@@ -56,26 +56,20 @@
|
|
|
56
56
|
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
57
57
|
<div
|
|
58
58
|
class={[
|
|
59
|
-
'flex flex-col
|
|
60
|
-
hoverable ? 'overflow-visible' : 'overflow-hidden',
|
|
59
|
+
'rounded-2xl flex flex-col overflow-hidden transition-[box-shadow,transform,border-color] duration-200',
|
|
61
60
|
variantClasses[variant],
|
|
62
|
-
hoverable &&
|
|
63
|
-
'cursor-pointer hover:-translate-y-0.5 hover:border-border-strong hover:shadow-md',
|
|
61
|
+
hoverable && 'hover:-translate-y-0.5 hover:border-border-strong hover:shadow-md cursor-pointer',
|
|
64
62
|
!!onclick && 'cursor-pointer',
|
|
65
63
|
className
|
|
66
64
|
]}
|
|
67
65
|
role={onclick ? 'button' : undefined}
|
|
68
66
|
tabindex={onclick ? 0 : undefined}
|
|
69
|
-
|
|
67
|
+
{onclick}
|
|
70
68
|
onkeydown={onclick ? handleKeydown : undefined}
|
|
71
69
|
>
|
|
72
70
|
{#if header}
|
|
73
71
|
<div
|
|
74
|
-
class={[
|
|
75
|
-
'w-full border-b border-border',
|
|
76
|
-
chrome && 'bg-surface/40',
|
|
77
|
-
paddingClasses[padding]
|
|
78
|
-
]}
|
|
72
|
+
class={['border-border w-full border-b', chrome && 'bg-surface/40', paddingClasses[padding]]}
|
|
79
73
|
>
|
|
80
74
|
{@render header()}
|
|
81
75
|
</div>
|
|
@@ -83,10 +77,7 @@
|
|
|
83
77
|
|
|
84
78
|
{#if children}
|
|
85
79
|
<div
|
|
86
|
-
class={[
|
|
87
|
-
'flex min-w-0 flex-1 flex-col',
|
|
88
|
-
padding !== 'none' ? paddingClasses[padding] : ''
|
|
89
|
-
]}
|
|
80
|
+
class={['min-w-0 flex flex-1 flex-col', padding !== 'none' ? paddingClasses[padding] : '']}
|
|
90
81
|
>
|
|
91
82
|
{@render children()}
|
|
92
83
|
</div>
|
|
@@ -95,7 +86,7 @@
|
|
|
95
86
|
{#if footer}
|
|
96
87
|
<div
|
|
97
88
|
class={[
|
|
98
|
-
'border-
|
|
89
|
+
'border-border border-t',
|
|
99
90
|
chrome ? 'bg-surface/40' : 'bg-surface-overlay/60',
|
|
100
91
|
paddingClasses[padding]
|
|
101
92
|
]}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export type ChipBarSize = 'sm' | 'md';
|
|
15
|
-
export type ChipBarVariant = 'soft' | 'solid' | 'outline';
|
|
15
|
+
export type ChipBarVariant = 'soft' | 'solid' | 'outline' | 'underline';
|
|
16
16
|
|
|
17
17
|
interface ChipBarProps {
|
|
18
18
|
items?: ChipBarItem[];
|
|
@@ -94,12 +94,22 @@
|
|
|
94
94
|
md: 'gap-1.5 px-3 py-1.5 text-sm'
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
+
const underlineSizes: Record<ChipBarSize, string> = {
|
|
98
|
+
sm: 'gap-1.5 px-1 pb-2.5 text-xs',
|
|
99
|
+
md: 'gap-1.5 px-1.5 pb-3 text-sm'
|
|
100
|
+
};
|
|
101
|
+
|
|
97
102
|
const iconSizes: Record<ChipBarSize, string> = {
|
|
98
103
|
sm: 'h-3.5 w-3.5',
|
|
99
104
|
md: 'h-4 w-4'
|
|
100
105
|
};
|
|
101
106
|
|
|
102
107
|
function chipClass(isActive: boolean) {
|
|
108
|
+
if (variant === 'underline') {
|
|
109
|
+
return isActive
|
|
110
|
+
? 'rounded-none border-0 border-b-2 border-brand-500 bg-transparent text-primary'
|
|
111
|
+
: 'rounded-none border-0 border-b-2 border-transparent bg-transparent text-secondary hover:text-primary';
|
|
112
|
+
}
|
|
103
113
|
if (variant === 'solid') {
|
|
104
114
|
return isActive
|
|
105
115
|
? 'border-brand-500 bg-brand-500 text-white shadow-sm'
|
|
@@ -132,7 +142,10 @@
|
|
|
132
142
|
|
|
133
143
|
<div
|
|
134
144
|
bind:this={scroller}
|
|
135
|
-
class=
|
|
145
|
+
class={[
|
|
146
|
+
'flex overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden',
|
|
147
|
+
variant === 'underline' ? 'gap-5 border-b border-border' : 'gap-2 py-0.5'
|
|
148
|
+
]}
|
|
136
149
|
role="listbox"
|
|
137
150
|
aria-label={ariaLabel}
|
|
138
151
|
aria-multiselectable={multi}
|
|
@@ -146,8 +159,8 @@
|
|
|
146
159
|
aria-selected={isActive}
|
|
147
160
|
disabled={item.disabled}
|
|
148
161
|
class={[
|
|
149
|
-
'inline-flex shrink-0 items-center
|
|
150
|
-
sizes[size],
|
|
162
|
+
'inline-flex shrink-0 items-center font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-40',
|
|
163
|
+
variant === 'underline' ? underlineSizes[size] : ['rounded-full border', sizes[size]],
|
|
151
164
|
chipClass(isActive)
|
|
152
165
|
]}
|
|
153
166
|
onclick={() => select(item.id, item.disabled)}
|
|
@@ -157,7 +170,7 @@
|
|
|
157
170
|
<Icon class={iconSizes[size]} aria-hidden="true" />
|
|
158
171
|
{/if}
|
|
159
172
|
<span>{item.label}</span>
|
|
160
|
-
{#if item.count !== undefined}
|
|
173
|
+
{#if item.count !== undefined && variant !== 'underline'}
|
|
161
174
|
<span
|
|
162
175
|
class={[
|
|
163
176
|
'rounded-full px-1.5 py-px text-[10px] font-semibold tabular-nums',
|
|
@@ -8,7 +8,7 @@ export interface ChipBarItem {
|
|
|
8
8
|
icon?: Component;
|
|
9
9
|
}
|
|
10
10
|
export type ChipBarSize = 'sm' | 'md';
|
|
11
|
-
export type ChipBarVariant = 'soft' | 'solid' | 'outline';
|
|
11
|
+
export type ChipBarVariant = 'soft' | 'solid' | 'outline' | 'underline';
|
|
12
12
|
interface ChipBarProps {
|
|
13
13
|
items?: ChipBarItem[];
|
|
14
14
|
value?: string;
|