@r2digisolutions/components 0.25.19 → 0.26.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 (49) hide show
  1. package/README.md +4 -0
  2. package/WORKSPACE.md +48 -0
  3. package/dist/components/molecules/ActionRow/ActionRow.stories.js +9 -0
  4. package/dist/components/molecules/ActionRow/ActionRow.svelte +84 -0
  5. package/dist/components/molecules/ActionRow/ActionRow.svelte.d.ts +31 -0
  6. package/dist/components/molecules/ActionRow/ActionRowStory.svelte +36 -0
  7. package/dist/components/molecules/ActionRow/ActionRowStory.svelte.d.ts +18 -0
  8. package/dist/components/molecules/Card/Card.svelte +4 -0
  9. package/dist/components/molecules/Card/Card.svelte.d.ts +2 -0
  10. package/dist/components/molecules/EmptyState/EmptyState.stories.d.ts +43 -0
  11. package/dist/components/molecules/EmptyState/EmptyState.stories.js +28 -1
  12. package/dist/components/molecules/EmptyState/EmptyState.svelte +72 -5
  13. package/dist/components/molecules/EmptyState/EmptyState.svelte.d.ts +14 -0
  14. package/dist/components/molecules/EmptyState/EmptyStateStory.svelte +29 -2
  15. package/dist/components/molecules/EmptyState/EmptyStateStory.svelte.d.ts +8 -0
  16. package/dist/components/molecules/EntityHero/EntityHero.stories.js +9 -0
  17. package/dist/components/molecules/EntityHero/EntityHero.svelte +162 -0
  18. package/dist/components/molecules/EntityHero/EntityHero.svelte.d.ts +37 -0
  19. package/dist/components/molecules/EntityHero/EntityHeroStory.svelte +28 -0
  20. package/dist/components/molecules/EntityHero/EntityHeroStory.svelte.d.ts +18 -0
  21. package/dist/components/molecules/OrgSwitcher/OrgSwitcher.svelte +68 -23
  22. package/dist/components/molecules/OrgSwitcher/OrgSwitcher.svelte.d.ts +12 -0
  23. package/dist/components/molecules/SectionNav/SectionNav.stories.d.ts +12 -0
  24. package/dist/components/molecules/SectionNav/SectionNav.stories.js +9 -0
  25. package/dist/components/molecules/SectionNav/SectionNav.svelte +139 -0
  26. package/dist/components/molecules/SectionNav/SectionNav.svelte.d.ts +41 -0
  27. package/dist/components/molecules/SectionNav/SectionNavStory.svelte +48 -0
  28. package/dist/components/molecules/SectionNav/SectionNavStory.svelte.d.ts +3 -0
  29. package/dist/components/molecules/StatCard/StatCard.svelte +51 -15
  30. package/dist/components/molecules/StatCard/StatCard.svelte.d.ts +13 -2
  31. package/dist/components/organisms/BottomNav/BottomNav.svelte +93 -53
  32. package/dist/components/organisms/BottomNav/BottomNav.svelte.d.ts +17 -2
  33. package/dist/components/organisms/NavRail/NavRail.svelte +106 -34
  34. package/dist/components/organisms/NavRail/NavRail.svelte.d.ts +12 -0
  35. package/dist/components/organisms/ProfilePicker/ProfilePicker.stories.d.ts +12 -0
  36. package/dist/components/organisms/ProfilePicker/ProfilePicker.stories.js +9 -0
  37. package/dist/components/organisms/ProfilePicker/ProfilePicker.svelte +183 -0
  38. package/dist/components/organisms/ProfilePicker/ProfilePicker.svelte.d.ts +37 -0
  39. package/dist/components/organisms/ProfilePicker/ProfilePickerStory.svelte +18 -0
  40. package/dist/components/organisms/ProfilePicker/ProfilePickerStory.svelte.d.ts +3 -0
  41. package/dist/components/organisms/WorkspaceShell/WorkspaceShell.stories.d.ts +12 -0
  42. package/dist/components/organisms/WorkspaceShell/WorkspaceShell.stories.js +9 -0
  43. package/dist/components/organisms/WorkspaceShell/WorkspaceShell.svelte +75 -0
  44. package/dist/components/organisms/WorkspaceShell/WorkspaceShell.svelte.d.ts +30 -0
  45. package/dist/components/organisms/WorkspaceShell/WorkspaceShellStory.svelte +71 -0
  46. package/dist/components/organisms/WorkspaceShell/WorkspaceShellStory.svelte.d.ts +3 -0
  47. package/dist/index.d.ts +11 -2
  48. package/dist/index.js +5 -0
  49. package/package.json +2 -1
@@ -16,14 +16,27 @@
16
16
  href?: string;
17
17
  icon?: NavRailIcon;
18
18
  disabled?: boolean;
19
+ /** Small counter on the icon (pending items). Hidden when 0 or empty. */
20
+ badge?: string | number;
19
21
  }
20
22
 
23
+ export type NavRailVariant = 'default' | 'solid';
24
+
21
25
  interface NavRailProps {
22
26
  items?: NavRailItem[];
23
27
  footerItems?: NavRailItem[];
24
28
  value?: string;
29
+ /**
30
+ * default — neutral surface, icon-only with tooltips.
31
+ * solid — brand-coloured bar (workspace apps), works best with `showLabels`.
32
+ */
33
+ variant?: NavRailVariant;
34
+ /** Show the label under each icon (wider rail, no tooltip). */
35
+ showLabels?: boolean;
25
36
  class?: string;
26
37
  brand?: Snippet;
38
+ /** Rendered at the very bottom (avatar, account menu…). */
39
+ footer?: Snippet;
27
40
  onchange?: (id: string) => void;
28
41
  }
29
42
 
@@ -31,75 +44,130 @@
31
44
  items = [],
32
45
  footerItems = [],
33
46
  value = $bindable(''),
47
+ variant = 'default',
48
+ showLabels = false,
34
49
  class: className = '',
35
50
  brand,
51
+ footer,
36
52
  onchange
37
53
  }: NavRailProps = $props();
38
54
 
55
+ const solid = $derived(variant === 'solid');
56
+
39
57
  function select(id: string, disabled?: boolean) {
40
58
  if (disabled) return;
41
59
  value = id;
42
60
  onchange?.(id);
43
61
  }
44
62
 
45
- const itemClass = (item: NavRailItem) => [
46
- 'group relative flex h-10 w-10 items-center justify-center rounded-lg transition-colors',
47
- 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/30',
48
- value === item.id
49
- ? 'bg-brand-500/15 text-brand-500'
50
- : 'text-secondary hover:bg-surface-overlay hover:text-primary',
51
- item.disabled && 'pointer-events-none cursor-not-allowed opacity-40'
52
- ];
53
-
54
- const glyphClass = (item: NavRailItem) => [
55
- 'h-5 w-5',
56
- value === item.id ? 'text-brand-500' : 'text-secondary group-hover:text-primary'
57
- ];
63
+ const hasBadge = (item: NavRailItem) =>
64
+ item.badge !== undefined && item.badge !== '' && item.badge !== 0;
65
+
66
+ const itemClass = (item: NavRailItem) => {
67
+ const active = value === item.id;
68
+ return [
69
+ 'group relative flex items-center justify-center rounded-xl transition-colors',
70
+ 'focus-visible:outline-none focus-visible:ring-2',
71
+ showLabels ? 'w-[4.25rem] flex-col gap-1 px-0.5 pb-1.5 pt-2' : 'h-10 w-10',
72
+ solid
73
+ ? [
74
+ 'focus-visible:ring-white/40',
75
+ active ? 'bg-white/15 text-white' : 'text-white/70 hover:bg-white/10 hover:text-white'
76
+ ]
77
+ : [
78
+ 'focus-visible:ring-brand-500/30',
79
+ active
80
+ ? 'bg-brand-500/15 text-brand-500'
81
+ : 'text-secondary hover:bg-surface-overlay hover:text-primary'
82
+ ],
83
+ item.disabled && 'pointer-events-none cursor-not-allowed opacity-40'
84
+ ];
85
+ };
86
+
87
+ const glyphClass = (item: NavRailItem) =>
88
+ [
89
+ 'h-5 w-5',
90
+ solid
91
+ ? 'text-current'
92
+ : value === item.id
93
+ ? 'text-brand-500'
94
+ : 'text-secondary group-hover:text-primary'
95
+ ].join(' ');
58
96
  </script>
59
97
 
98
+ {#snippet inner(item: NavRailItem)}
99
+ <span class="relative inline-flex">
100
+ {#if item.icon}
101
+ <item.icon class={glyphClass(item)} strokeWidth={1.75} />
102
+ {:else}
103
+ <span class={['text-xs font-semibold', !solid && value === item.id && 'text-brand-500']}>
104
+ {item.label.slice(0, 1)}
105
+ </span>
106
+ {/if}
107
+ {#if hasBadge(item)}
108
+ <span
109
+ class={[
110
+ '-right-2.5 -top-1.5 h-4 min-w-4 px-1 font-bold absolute flex items-center justify-center rounded-full text-[9.5px] leading-none',
111
+ solid ? 'bg-amber-400 text-amber-950' : 'bg-red-500 text-white'
112
+ ]}
113
+ >
114
+ {item.badge}
115
+ </span>
116
+ {/if}
117
+ </span>
118
+ {#if showLabels}
119
+ <span class="font-semibold leading-tight max-w-full truncate text-[10.5px]">{item.label}</span>
120
+ {/if}
121
+ {/snippet}
122
+
60
123
  {#snippet railButton(item: NavRailItem)}
61
- <Tooltip content={item.label} side="right" class="relative w-full justify-center">
62
- <RailMark active={value === item.id} length="full" class="z-10" />
124
+ {#snippet control()}
125
+ {#if showLabels && solid && value === item.id}
126
+ <span
127
+ class="-left-2 bottom-3 top-3 w-1 bg-brand-200 absolute rounded-r-full"
128
+ aria-hidden="true"
129
+ ></span>
130
+ {/if}
63
131
  {#if item.href && !item.disabled}
64
132
  <a
65
133
  href={item.href}
66
- aria-label={item.label}
134
+ aria-label={showLabels ? undefined : item.label}
67
135
  aria-current={value === item.id ? 'page' : undefined}
68
136
  class={itemClass(item)}
69
137
  onclick={() => select(item.id, item.disabled)}
70
138
  >
71
- {#if item.icon}
72
- <item.icon class={glyphClass(item)} strokeWidth={1.75} />
73
- {:else}
74
- <span class={['text-xs font-semibold', value === item.id && 'text-brand-500']}>
75
- {item.label.slice(0, 1)}
76
- </span>
77
- {/if}
139
+ {@render inner(item)}
78
140
  </a>
79
141
  {:else}
80
142
  <button
81
143
  type="button"
82
- aria-label={item.label}
144
+ aria-label={showLabels ? undefined : item.label}
83
145
  aria-current={value === item.id ? 'page' : undefined}
84
146
  disabled={item.disabled}
85
147
  class={itemClass(item)}
86
148
  onclick={() => select(item.id, item.disabled)}
87
149
  >
88
- {#if item.icon}
89
- <item.icon class={glyphClass(item)} strokeWidth={1.75} />
90
- {:else}
91
- <span class={['text-xs font-semibold', value === item.id && 'text-brand-500']}>
92
- {item.label.slice(0, 1)}
93
- </span>
94
- {/if}
150
+ {@render inner(item)}
95
151
  </button>
96
152
  {/if}
97
- </Tooltip>
153
+ {/snippet}
154
+ {#if showLabels}
155
+ <div class="relative flex w-full justify-center">{@render control()}</div>
156
+ {:else}
157
+ <Tooltip content={item.label} side="right" class="relative w-full justify-center">
158
+ {#if !solid}<RailMark active={value === item.id} length="full" class="z-10" />{/if}
159
+ {@render control()}
160
+ </Tooltip>
161
+ {/if}
98
162
  {/snippet}
99
163
 
100
164
  <aside
101
165
  class={[
102
- 'w-14 border-border bg-surface-elevated py-3 flex h-full shrink-0 flex-col items-center border-r',
166
+ 'py-3 flex h-full shrink-0 flex-col items-center',
167
+ showLabels ? 'w-[5rem]' : 'w-14',
168
+ solid
169
+ ? 'from-brand-700 to-brand-800 text-white bg-gradient-to-b'
170
+ : 'border-border bg-surface-elevated border-r',
103
171
  className
104
172
  ]}
105
173
  >
@@ -116,11 +184,15 @@
116
184
  </nav>
117
185
 
118
186
  {#if footerItems.length > 0}
119
- <div class="w-8 py-2"><Divider /></div>
187
+ {#if !solid}<div class="w-8 py-2"><Divider /></div>{/if}
120
188
  <nav class="gap-1 flex w-full flex-col items-center" aria-label="Rail footer">
121
189
  {#each footerItems as item (item.id)}
122
190
  {@render railButton(item)}
123
191
  {/each}
124
192
  </nav>
125
193
  {/if}
194
+
195
+ {#if footer}
196
+ <div class="mt-2 flex items-center justify-center">{@render footer()}</div>
197
+ {/if}
126
198
  </aside>
@@ -10,13 +10,25 @@ export interface NavRailItem {
10
10
  href?: string;
11
11
  icon?: NavRailIcon;
12
12
  disabled?: boolean;
13
+ /** Small counter on the icon (pending items). Hidden when 0 or empty. */
14
+ badge?: string | number;
13
15
  }
16
+ export type NavRailVariant = 'default' | 'solid';
14
17
  interface NavRailProps {
15
18
  items?: NavRailItem[];
16
19
  footerItems?: NavRailItem[];
17
20
  value?: string;
21
+ /**
22
+ * default — neutral surface, icon-only with tooltips.
23
+ * solid — brand-coloured bar (workspace apps), works best with `showLabels`.
24
+ */
25
+ variant?: NavRailVariant;
26
+ /** Show the label under each icon (wider rail, no tooltip). */
27
+ showLabels?: boolean;
18
28
  class?: string;
19
29
  brand?: Snippet;
30
+ /** Rendered at the very bottom (avatar, account menu…). */
31
+ footer?: Snippet;
20
32
  onchange?: (id: string) => void;
21
33
  }
22
34
  declare const NavRail: Component<NavRailProps, {}, "value">;
@@ -0,0 +1,12 @@
1
+ import type { StoryObj } from '@storybook/svelte';
2
+ declare const meta: {
3
+ title: string;
4
+ component: import("svelte").Component<Record<string, never>, {}, "">;
5
+ tags: string[];
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Default: Story;
@@ -0,0 +1,9 @@
1
+ import ProfilePickerStory from './ProfilePickerStory.svelte';
2
+ const meta = {
3
+ title: 'Organisms/ProfilePicker',
4
+ component: ProfilePickerStory,
5
+ tags: ['autodocs'],
6
+ parameters: { layout: 'fullscreen' }
7
+ };
8
+ export default meta;
9
+ export const Default = {};
@@ -0,0 +1,183 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import Plus from '@lucide/svelte/icons/plus';
4
+
5
+ export interface ProfilePickerItem {
6
+ id: string;
7
+ name: string;
8
+ /** Role, plan, category… */
9
+ subtitle?: string;
10
+ src?: string;
11
+ initials?: string;
12
+ /** Tile colour (any CSS colour). Defaults to the brand colour. */
13
+ color?: string;
14
+ /** Pending count on the corner. Hidden when 0. */
15
+ badge?: string | number;
16
+ href?: string;
17
+ }
18
+
19
+ interface ProfilePickerProps {
20
+ /** Big question at the top («¿Qué empresa quieres gestionar?»). */
21
+ title?: string;
22
+ profiles?: ProfilePickerItem[];
23
+ /** The current one gets a ring. */
24
+ value?: string;
25
+ createLabel?: string;
26
+ createSubtitle?: string;
27
+ /** Small note under everything (e.g. linked account). */
28
+ note?: string;
29
+ /** `screen` fills the viewport with the brand background; `inline` is a plain block. */
30
+ variant?: 'screen' | 'inline';
31
+ class?: string;
32
+ /** Logo above the title. */
33
+ brand?: Snippet;
34
+ /** Extra buttons under the grid («Gestionar empresas»). */
35
+ footer?: Snippet;
36
+ onselect?: (profile: ProfilePickerItem) => void;
37
+ oncreate?: () => void;
38
+ }
39
+
40
+ let {
41
+ title = '¿Quién eres?',
42
+ profiles = [],
43
+ value = $bindable(''),
44
+ createLabel = 'Añadir',
45
+ createSubtitle,
46
+ note,
47
+ variant = 'screen',
48
+ class: className = '',
49
+ brand,
50
+ footer,
51
+ onselect,
52
+ oncreate
53
+ }: ProfilePickerProps = $props();
54
+
55
+ const screen = $derived(variant === 'screen');
56
+ const initialsOf = (p: ProfilePickerItem) =>
57
+ p.initials ??
58
+ p.name
59
+ .split(/\s+/)
60
+ .filter(Boolean)
61
+ .slice(0, 2)
62
+ .map((w) => w[0]?.toUpperCase() ?? '')
63
+ .join('');
64
+ const hasBadge = (p: ProfilePickerItem) =>
65
+ p.badge !== undefined && p.badge !== '' && p.badge !== 0;
66
+
67
+ function pick(p: ProfilePickerItem) {
68
+ value = p.id;
69
+ onselect?.(p);
70
+ }
71
+ </script>
72
+
73
+ {#snippet tile(p: ProfilePickerItem)}
74
+ <span
75
+ class={[
76
+ 'text-3xl font-bold text-white sm:text-4xl relative flex aspect-square w-full items-center justify-center rounded-[1.75rem] transition-transform duration-200 group-hover:scale-[1.04]',
77
+ value === p.id &&
78
+ (screen
79
+ ? 'ring-brand-200 ring-offset-brand-800 ring-[3px] ring-offset-4'
80
+ : 'ring-brand-500 ring-offset-surface ring-[3px] ring-offset-4')
81
+ ]}
82
+ style={`background:${p.color ?? 'var(--color-brand-600)'}`}
83
+ >
84
+ {#if p.src}<img
85
+ src={p.src}
86
+ alt=""
87
+ class="h-full w-full rounded-[1.75rem] object-cover"
88
+ />{:else}{initialsOf(p)}{/if}
89
+ {#if hasBadge(p)}
90
+ <span
91
+ class="-right-2 -top-2 bg-amber-400 px-2 py-0.5 text-xs font-bold text-amber-950 shadow absolute rounded-full"
92
+ >{p.badge}</span
93
+ >
94
+ {/if}
95
+ </span>
96
+ <span
97
+ class={[
98
+ 'mt-2.5 font-semibold block truncate text-center text-[15px]',
99
+ screen ? 'text-white' : 'text-primary'
100
+ ]}>{p.name}</span
101
+ >
102
+ {#if p.subtitle}
103
+ <span
104
+ class={['text-xs block truncate text-center', screen ? 'text-brand-200/80' : 'text-muted']}
105
+ >{p.subtitle}</span
106
+ >
107
+ {/if}
108
+ {/snippet}
109
+
110
+ <div
111
+ class={[
112
+ 'px-6 py-10 flex flex-col items-center',
113
+ screen && 'from-brand-800 to-brand-950 text-white min-h-dvh justify-center bg-gradient-to-b',
114
+ className
115
+ ]}
116
+ >
117
+ {#if brand}<div class="mb-8">{@render brand()}</div>{/if}
118
+ <h1
119
+ class={[
120
+ 'max-w-md text-2xl font-bold tracking-tight sm:text-3xl text-center',
121
+ !screen && 'text-primary'
122
+ ]}
123
+ >
124
+ {title}
125
+ </h1>
126
+ <ul class="mt-10 max-w-2xl gap-x-6 gap-y-8 sm:grid-cols-3 md:grid-cols-4 grid w-full grid-cols-2">
127
+ {#each profiles as p (p.id)}
128
+ <li class="min-w-0">
129
+ {#if p.href}
130
+ <a
131
+ href={p.href}
132
+ class="group rounded-3xl focus-visible:ring-brand-300 block focus-visible:ring-2 focus-visible:outline-none"
133
+ onclick={() => pick(p)}>{@render tile(p)}</a
134
+ >
135
+ {:else}
136
+ <button
137
+ type="button"
138
+ class="group rounded-3xl focus-visible:ring-brand-300 block w-full focus-visible:ring-2 focus-visible:outline-none"
139
+ onclick={() => pick(p)}>{@render tile(p)}</button
140
+ >
141
+ {/if}
142
+ </li>
143
+ {/each}
144
+ {#if oncreate}
145
+ <li class="min-w-0">
146
+ <button
147
+ type="button"
148
+ class="group rounded-3xl focus-visible:ring-brand-300 block w-full focus-visible:ring-2 focus-visible:outline-none"
149
+ onclick={() => oncreate?.()}
150
+ >
151
+ <span
152
+ class={[
153
+ 'flex aspect-square w-full items-center justify-center rounded-[1.75rem] border-2 border-dashed transition-colors',
154
+ screen
155
+ ? 'border-brand-400/70 text-brand-200 group-hover:bg-white/5'
156
+ : 'border-border-strong text-muted group-hover:bg-surface-overlay'
157
+ ]}
158
+ >
159
+ <Plus class="h-10 w-10" strokeWidth={1.75} />
160
+ </span>
161
+ <span
162
+ class={[
163
+ 'mt-2.5 font-semibold block truncate text-center text-[15px]',
164
+ screen ? 'text-white' : 'text-primary'
165
+ ]}>{createLabel}</span
166
+ >
167
+ {#if createSubtitle}
168
+ <span
169
+ class={[
170
+ 'text-xs block truncate text-center',
171
+ screen ? 'text-brand-200/80' : 'text-muted'
172
+ ]}>{createSubtitle}</span
173
+ >
174
+ {/if}
175
+ </button>
176
+ </li>
177
+ {/if}
178
+ </ul>
179
+ {#if footer}<div class="mt-10 gap-3 flex flex-wrap justify-center">{@render footer()}</div>{/if}
180
+ {#if note}<p class={['mt-5 text-xs text-center', screen ? 'text-brand-200/70' : 'text-muted']}>
181
+ {note}
182
+ </p>{/if}
183
+ </div>
@@ -0,0 +1,37 @@
1
+ import type { Snippet } from 'svelte';
2
+ export interface ProfilePickerItem {
3
+ id: string;
4
+ name: string;
5
+ /** Role, plan, category… */
6
+ subtitle?: string;
7
+ src?: string;
8
+ initials?: string;
9
+ /** Tile colour (any CSS colour). Defaults to the brand colour. */
10
+ color?: string;
11
+ /** Pending count on the corner. Hidden when 0. */
12
+ badge?: string | number;
13
+ href?: string;
14
+ }
15
+ interface ProfilePickerProps {
16
+ /** Big question at the top («¿Qué empresa quieres gestionar?»). */
17
+ title?: string;
18
+ profiles?: ProfilePickerItem[];
19
+ /** The current one gets a ring. */
20
+ value?: string;
21
+ createLabel?: string;
22
+ createSubtitle?: string;
23
+ /** Small note under everything (e.g. linked account). */
24
+ note?: string;
25
+ /** `screen` fills the viewport with the brand background; `inline` is a plain block. */
26
+ variant?: 'screen' | 'inline';
27
+ class?: string;
28
+ /** Logo above the title. */
29
+ brand?: Snippet;
30
+ /** Extra buttons under the grid («Gestionar empresas»). */
31
+ footer?: Snippet;
32
+ onselect?: (profile: ProfilePickerItem) => void;
33
+ oncreate?: () => void;
34
+ }
35
+ declare const ProfilePicker: import("svelte").Component<ProfilePickerProps, {}, "value">;
36
+ type ProfilePicker = ReturnType<typeof ProfilePicker>;
37
+ export default ProfilePicker;
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import ProfilePicker from './ProfilePicker.svelte';
3
+ let value = $state('bl');
4
+ </script>
5
+
6
+ <ProfilePicker
7
+ title="¿Qué empresa quieres gestionar?"
8
+ bind:value
9
+ profiles={[
10
+ { id: 'bl', name: 'Bar La Plaza', subtitle: 'Propietario' },
11
+ { id: 'rp', name: 'Reformas Plaza', subtitle: 'Propietario', color: '#8a5a2b', badge: 2 },
12
+ { id: 'fc', name: 'Fontanería Centro', subtitle: 'Gestor', color: '#2b5f8a' }
13
+ ]}
14
+ createLabel="Añadir empresa"
15
+ createSubtitle="Crear o vincular"
16
+ note="Conectado con tu cuenta"
17
+ oncreate={() => {}}
18
+ />
@@ -0,0 +1,3 @@
1
+ declare const ProfilePickerStory: import("svelte").Component<Record<string, never>, {}, "">;
2
+ type ProfilePickerStory = ReturnType<typeof ProfilePickerStory>;
3
+ export default ProfilePickerStory;
@@ -0,0 +1,12 @@
1
+ import type { StoryObj } from '@storybook/svelte';
2
+ declare const meta: {
3
+ title: string;
4
+ component: import("svelte").Component<Record<string, never>, {}, "">;
5
+ tags: string[];
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Default: Story;
@@ -0,0 +1,9 @@
1
+ import WorkspaceShellStory from './WorkspaceShellStory.svelte';
2
+ const meta = {
3
+ title: 'Organisms/WorkspaceShell',
4
+ component: WorkspaceShellStory,
5
+ tags: ['autodocs'],
6
+ parameters: { layout: 'fullscreen' }
7
+ };
8
+ export default meta;
9
+ export const Default = {};
@@ -0,0 +1,75 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ /**
5
+ * Two-level workspace layout (rail + section menu) that turns into
6
+ * header + bottom bar on phones. Every region is a snippet so any app
7
+ * can plug its own NavRail, SectionNav, search, BottomNav…
8
+ *
9
+ * Desktop (≥ lg): rail | secondary | (topbar / content)
10
+ * Tablet (md): rail | (topbar / content) — secondary hidden
11
+ * Phone: mobileHeader / content / bottomNav
12
+ */
13
+ interface WorkspaceShellProps {
14
+ /** Narrow icon rail (NavRail variant="solid" showLabels). */
15
+ rail?: Snippet;
16
+ /** Section menu next to the rail (SectionNav). */
17
+ secondary?: Snippet;
18
+ /** Top bar over the content on tablet/desktop (breadcrumb, search, actions). */
19
+ topbar?: Snippet;
20
+ /** Header on phones (switcher, search button, section tabs). */
21
+ mobileHeader?: Snippet;
22
+ /** Bottom bar on phones (BottomNav). */
23
+ bottomNav?: Snippet;
24
+ children?: Snippet;
25
+ /** Max width of the content column. */
26
+ contentWidth?: 'full' | 'xl' | '2xl';
27
+ class?: string;
28
+ contentClass?: string;
29
+ }
30
+
31
+ const {
32
+ rail,
33
+ secondary,
34
+ topbar,
35
+ mobileHeader,
36
+ bottomNav,
37
+ children,
38
+ contentWidth = 'full',
39
+ class: className = '',
40
+ contentClass = ''
41
+ }: WorkspaceShellProps = $props();
42
+
43
+ const WIDTH = { full: '', xl: 'max-w-7xl', '2xl': 'max-w-[96rem]' } as const;
44
+ </script>
45
+
46
+ <div class={['bg-surface text-primary flex min-h-dvh', className]}>
47
+ {#if rail}
48
+ <div class="top-0 md:flex sticky hidden h-dvh">{@render rail()}</div>
49
+ {/if}
50
+ {#if secondary}
51
+ <div class="top-0 lg:flex sticky hidden h-dvh">{@render secondary()}</div>
52
+ {/if}
53
+ <div class="min-w-0 flex flex-1 flex-col">
54
+ {#if mobileHeader}
55
+ <div class="top-0 md:hidden sticky z-30">{@render mobileHeader()}</div>
56
+ {/if}
57
+ {#if topbar}
58
+ <div class="top-0 bg-surface/90 backdrop-blur md:block sticky z-30 hidden">
59
+ {@render topbar()}
60
+ </div>
61
+ {/if}
62
+ <main
63
+ class={[
64
+ 'min-w-0 px-4 pb-28 pt-4 md:px-6 md:pb-10 md:pt-2 mx-auto w-full flex-1',
65
+ WIDTH[contentWidth],
66
+ contentClass
67
+ ]}
68
+ >
69
+ {@render children?.()}
70
+ </main>
71
+ </div>
72
+ {#if bottomNav}
73
+ <div class="inset-x-0 bottom-0 md:hidden fixed z-40">{@render bottomNav()}</div>
74
+ {/if}
75
+ </div>
@@ -0,0 +1,30 @@
1
+ import type { Snippet } from 'svelte';
2
+ /**
3
+ * Two-level workspace layout (rail + section menu) that turns into
4
+ * header + bottom bar on phones. Every region is a snippet so any app
5
+ * can plug its own NavRail, SectionNav, search, BottomNav…
6
+ *
7
+ * Desktop (≥ lg): rail | secondary | (topbar / content)
8
+ * Tablet (md): rail | (topbar / content) — secondary hidden
9
+ * Phone: mobileHeader / content / bottomNav
10
+ */
11
+ interface WorkspaceShellProps {
12
+ /** Narrow icon rail (NavRail variant="solid" showLabels). */
13
+ rail?: Snippet;
14
+ /** Section menu next to the rail (SectionNav). */
15
+ secondary?: Snippet;
16
+ /** Top bar over the content on tablet/desktop (breadcrumb, search, actions). */
17
+ topbar?: Snippet;
18
+ /** Header on phones (switcher, search button, section tabs). */
19
+ mobileHeader?: Snippet;
20
+ /** Bottom bar on phones (BottomNav). */
21
+ bottomNav?: Snippet;
22
+ children?: Snippet;
23
+ /** Max width of the content column. */
24
+ contentWidth?: 'full' | 'xl' | '2xl';
25
+ class?: string;
26
+ contentClass?: string;
27
+ }
28
+ declare const WorkspaceShell: import("svelte").Component<WorkspaceShellProps, {}, "">;
29
+ type WorkspaceShell = ReturnType<typeof WorkspaceShell>;
30
+ export default WorkspaceShell;