ui-svelte 0.2.2 → 0.2.4

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 (36) hide show
  1. package/dist/control/Audio.svelte +8 -12
  2. package/dist/control/css/btn.css +1 -1
  3. package/dist/display/Code.svelte +28 -11
  4. package/dist/display/Code.svelte.d.ts +5 -3
  5. package/dist/display/css/card.css +0 -10
  6. package/dist/display/css/code.css +7 -1
  7. package/dist/form/ComboBox.svelte +17 -17
  8. package/dist/form/ComboBox.svelte.d.ts +2 -2
  9. package/dist/hooks/use-search.svelte.d.ts +2 -1
  10. package/dist/index.css +2 -1
  11. package/dist/index.d.ts +3 -2
  12. package/dist/index.js +3 -2
  13. package/dist/layout/AppBar.svelte +28 -1
  14. package/dist/layout/AppBar.svelte.d.ts +2 -0
  15. package/dist/layout/Footer.svelte +25 -1
  16. package/dist/layout/Footer.svelte.d.ts +1 -0
  17. package/dist/layout/Sidebar.svelte +33 -3
  18. package/dist/layout/Sidebar.svelte.d.ts +1 -0
  19. package/dist/layout/css/app-bar.css +63 -0
  20. package/dist/layout/css/bottom-bar.css +63 -0
  21. package/dist/layout/css/footer.css +63 -0
  22. package/dist/layout/css/sidebar.css +63 -0
  23. package/dist/navigation/FooterGroup.svelte +51 -0
  24. package/dist/navigation/FooterGroup.svelte.d.ts +15 -0
  25. package/dist/{layout/FooterLinks.svelte → navigation/FooterNav.svelte} +2 -2
  26. package/dist/navigation/FooterNav.svelte.d.ts +11 -0
  27. package/dist/navigation/NavMenu.svelte +2 -9
  28. package/dist/navigation/SideNav.svelte +0 -9
  29. package/dist/navigation/SideNav.svelte.d.ts +0 -1
  30. package/dist/navigation/css/footer-group.css +26 -0
  31. package/dist/{layout/css/footer-links.css → navigation/css/footer-nav.css} +3 -3
  32. package/dist/navigation/css/nav-menu.css +9 -39
  33. package/dist/navigation/css/side-nav.css +127 -66
  34. package/dist/overlay/css/modal.css +2 -2
  35. package/package.json +1 -1
  36. package/dist/layout/FooterLinks.svelte.d.ts +0 -11
@@ -9,4 +9,67 @@
9
9
  @apply overflow-hidden;
10
10
  }
11
11
  }
12
+ .dock.is-primary {
13
+ @apply bg-on-primary text-primary;
14
+ }
15
+
16
+ .dock.is-primary.is-solid {
17
+ @apply bg-primary text-on-primary;
18
+ }
19
+
20
+ .dock.is-secondary {
21
+ @apply bg-on-secondary text-secondary;
22
+ }
23
+
24
+ .dock.is-secondary.is-solid {
25
+ @apply bg-secondary text-on-secondary;
26
+ }
27
+
28
+ .dock.is-success {
29
+ @apply bg-on-success text-success;
30
+ }
31
+
32
+ .dock.is-success.is-solid {
33
+ @apply bg-success text-on-success;
34
+ }
35
+
36
+ .dock.is-info {
37
+ @apply bg-on-info text-info;
38
+ }
39
+
40
+ .dock.is-info.is-solid {
41
+ @apply bg-info text-on-info;
42
+ }
43
+
44
+ .dock.is-warning {
45
+ @apply bg-on-warning text-warning;
46
+ }
47
+
48
+ .dock.is-warning.is-solid {
49
+ @apply bg-warning text-on-warning;
50
+ }
51
+
52
+ .dock.is-danger {
53
+ @apply bg-on-danger text-danger;
54
+ }
55
+
56
+ .dock.is-danger.is-solid {
57
+ @apply bg-danger text-on-danger;
58
+ }
59
+
60
+ .dock.is-muted {
61
+ @apply bg-muted text-on-muted;
62
+ }
63
+
64
+ .dock.is-muted.is-solid {
65
+ @apply bg-on-muted text-muted;
66
+ }
67
+
68
+ .dock.is-ghost {
69
+ @apply bg-background text-on-background;
70
+ }
71
+
72
+ .dock.is-surface {
73
+ @apply bg-surface text-on-surface;
74
+ }
12
75
  }
@@ -32,4 +32,67 @@
32
32
  }
33
33
  }
34
34
  }
35
+ .footer.is-primary {
36
+ @apply bg-on-primary text-primary;
37
+ }
38
+
39
+ .footer.is-primary.is-solid {
40
+ @apply bg-primary text-on-primary;
41
+ }
42
+
43
+ .footer.is-secondary {
44
+ @apply bg-on-secondary text-secondary;
45
+ }
46
+
47
+ .footer.is-secondary.is-solid {
48
+ @apply bg-secondary text-on-secondary;
49
+ }
50
+
51
+ .footer.is-success {
52
+ @apply bg-on-success text-success;
53
+ }
54
+
55
+ .footer.is-success.is-solid {
56
+ @apply bg-success text-on-success;
57
+ }
58
+
59
+ .footer.is-info {
60
+ @apply bg-on-info text-info;
61
+ }
62
+
63
+ .footer.is-info.is-solid {
64
+ @apply bg-info text-on-info;
65
+ }
66
+
67
+ .footer.is-warning {
68
+ @apply bg-on-warning text-warning;
69
+ }
70
+
71
+ .footer.is-warning.is-solid {
72
+ @apply bg-warning text-on-warning;
73
+ }
74
+
75
+ .footer.is-danger {
76
+ @apply bg-on-danger text-danger;
77
+ }
78
+
79
+ .footer.is-danger.is-solid {
80
+ @apply bg-danger text-on-danger;
81
+ }
82
+
83
+ .footer.is-muted {
84
+ @apply bg-muted text-on-muted;
85
+ }
86
+
87
+ .footer.is-muted.is-solid {
88
+ @apply bg-on-muted text-muted;
89
+ }
90
+
91
+ .footer.is-ghost {
92
+ @apply bg-background text-on-background;
93
+ }
94
+
95
+ .footer.is-surface {
96
+ @apply bg-surface text-on-surface;
97
+ }
35
98
  }
@@ -14,4 +14,67 @@
14
14
  @apply relative flex min-h-0 w-full flex-col gap-3 p-3 overflow-hidden hover:overflow-y-auto;
15
15
  }
16
16
  }
17
+ .sidebar.is-primary {
18
+ @apply bg-on-primary text-primary;
19
+ }
20
+
21
+ .sidebar.is-primary.is-solid {
22
+ @apply bg-primary text-on-primary;
23
+ }
24
+
25
+ .sidebar.is-secondary {
26
+ @apply bg-on-secondary text-secondary;
27
+ }
28
+
29
+ .sidebar.is-secondary.is-solid {
30
+ @apply bg-secondary text-on-secondary;
31
+ }
32
+
33
+ .sidebar.is-success {
34
+ @apply bg-on-success text-success;
35
+ }
36
+
37
+ .sidebar.is-success.is-solid {
38
+ @apply bg-success text-on-success;
39
+ }
40
+
41
+ .sidebar.is-info {
42
+ @apply bg-on-info text-info;
43
+ }
44
+
45
+ .sidebar.is-info.is-solid {
46
+ @apply bg-info text-on-info;
47
+ }
48
+
49
+ .sidebar.is-warning {
50
+ @apply bg-on-warning text-warning;
51
+ }
52
+
53
+ .sidebar.is-warning.is-solid {
54
+ @apply bg-warning text-on-warning;
55
+ }
56
+
57
+ .sidebar.is-danger {
58
+ @apply bg-on-danger text-danger;
59
+ }
60
+
61
+ .sidebar.is-danger.is-solid {
62
+ @apply bg-danger text-on-danger;
63
+ }
64
+
65
+ .sidebar.is-muted {
66
+ @apply bg-muted text-on-muted;
67
+ }
68
+
69
+ .sidebar.is-muted.is-solid {
70
+ @apply bg-on-muted text-muted;
71
+ }
72
+
73
+ .sidebar.is-ghost {
74
+ @apply bg-background text-on-background;
75
+ }
76
+
77
+ .sidebar.is-surface {
78
+ @apply bg-surface text-on-surface;
79
+ }
17
80
  }
@@ -0,0 +1,51 @@
1
+ <script lang="ts">
2
+ import { cn } from '../utils/class-names.js';
3
+ import type { Snippet } from 'svelte';
4
+
5
+ type FooterLink = {
6
+ label: string;
7
+ href: string;
8
+ external?: boolean;
9
+ };
10
+
11
+ type Props = {
12
+ title?: string;
13
+ links?: FooterLink[];
14
+ children?: Snippet;
15
+ class?: string;
16
+ };
17
+
18
+ const { title, links = [], children, class: className }: Props = $props();
19
+ </script>
20
+
21
+ <div class={cn('footer-group', className)}>
22
+ {#if title}
23
+ <h3 class="footer-group-title">{title}</h3>
24
+ {/if}
25
+
26
+ {#if links.length > 0}
27
+ <ul class="footer-group-links">
28
+ {#each links as link}
29
+ <li>
30
+ <a
31
+ href={link.href}
32
+ class="footer-group-link"
33
+ target={link.external ? '_blank' : undefined}
34
+ rel={link.external ? 'noopener noreferrer' : undefined}
35
+ >
36
+ {link.label}
37
+ {#if link.external}
38
+ <span class="sr-only">(abre en nueva ventana)</span>
39
+ {/if}
40
+ </a>
41
+ </li>
42
+ {/each}
43
+ </ul>
44
+ {/if}
45
+
46
+ {#if children}
47
+ <div class="footer-group-content">
48
+ {@render children()}
49
+ </div>
50
+ {/if}
51
+ </div>
@@ -0,0 +1,15 @@
1
+ import type { Snippet } from 'svelte';
2
+ type FooterLink = {
3
+ label: string;
4
+ href: string;
5
+ external?: boolean;
6
+ };
7
+ type Props = {
8
+ title?: string;
9
+ links?: FooterLink[];
10
+ children?: Snippet;
11
+ class?: string;
12
+ };
13
+ declare const FooterGroup: import("svelte").Component<Props, {}, "">;
14
+ type FooterGroup = ReturnType<typeof FooterGroup>;
15
+ export default FooterGroup;
@@ -19,9 +19,9 @@
19
19
  }
20
20
  </script>
21
21
 
22
- <div class={cn('footer-links', className)}>
22
+ <div class={cn('footer-nav', className)}>
23
23
  {#each links as link}
24
- <a href={link.href} class={cn('footer-link', isLinkActive(link.href) && 'is-active')}>
24
+ <a href={link.href} class={cn('footer-nav-link', isLinkActive(link.href) && 'is-active')}>
25
25
  {link.label}
26
26
  </a>
27
27
  {/each}
@@ -0,0 +1,11 @@
1
+ type FooterLink = {
2
+ label: string;
3
+ href: string;
4
+ };
5
+ type Props = {
6
+ links: FooterLink[];
7
+ class?: string;
8
+ };
9
+ declare const FooterNav: import("svelte").Component<Props, {}, "">;
10
+ type FooterNav = ReturnType<typeof FooterNav>;
11
+ export default FooterNav;
@@ -25,12 +25,11 @@
25
25
 
26
26
  type Props = {
27
27
  items: MenuItem[];
28
- variant?: 'primary' | 'secondary' | 'muted';
29
28
  size?: 'sm' | 'md' | 'lg';
30
29
  class?: string;
31
30
  };
32
31
 
33
- const { items = [], class: className, variant = 'primary', size = 'md' }: Props = $props();
32
+ const { items = [], class: className, size = 'md' }: Props = $props();
34
33
 
35
34
  let openSubmenuIndex = $state<number | null>(null);
36
35
  let triggerElements = $state<Record<number, HTMLElement>>({});
@@ -43,12 +42,6 @@
43
42
  isMegamenu: false
44
43
  });
45
44
 
46
- const variantClasses = {
47
- primary: 'navmenu-primary',
48
- secondary: 'navmenu-secondary',
49
- muted: 'navmenu-muted'
50
- };
51
-
52
45
  const sizeClasses = {
53
46
  sm: 'is-sm',
54
47
  md: 'is-md',
@@ -172,7 +165,7 @@
172
165
  });
173
166
  </script>
174
167
 
175
- <nav class={cn('navmenu', variantClasses[variant], sizeClasses[size], className)}>
168
+ <nav class={cn('navmenu', sizeClasses[size], className)}>
176
169
  {#each items as item, index}
177
170
  {#if item.href && !item.subitems && !item.megamenu}
178
171
  <a href={item.href} class={cn('navmenu-item', isItemActive(item.href) && 'is-active')}>
@@ -31,7 +31,6 @@
31
31
 
32
32
  type Props = {
33
33
  items: SideNavItem[];
34
- variant?: 'primary' | 'secondary' | 'muted';
35
34
  size?: 'sm' | 'md' | 'lg';
36
35
  class?: string;
37
36
  isWide?: boolean;
@@ -42,7 +41,6 @@
42
41
  const {
43
42
  items = [],
44
43
  class: className,
45
- variant = 'primary',
46
44
  size = 'md',
47
45
  isWide,
48
46
  isCompact,
@@ -70,12 +68,6 @@
70
68
  isExpanded = !isCollapsible;
71
69
  });
72
70
 
73
- const variantClasses = {
74
- primary: 'sidenav-primary',
75
- secondary: 'sidenav-secondary',
76
- muted: 'sidenav-muted'
77
- };
78
-
79
71
  const sizeClasses = {
80
72
  sm: 'is-sm',
81
73
  md: 'is-md',
@@ -119,7 +111,6 @@
119
111
  <nav
120
112
  class={cn(
121
113
  'sidenav',
122
- variantClasses[variant],
123
114
  sizeClasses[size],
124
115
  isCompact && 'is-compact',
125
116
  isCollapsible && 'is-collapsible',
@@ -21,7 +21,6 @@ import { type IconData } from '../index.js';
21
21
  import type { Snippet } from 'svelte';
22
22
  type Props = {
23
23
  items: SideNavItem[];
24
- variant?: 'primary' | 'secondary' | 'muted';
25
24
  size?: 'sm' | 'md' | 'lg';
26
25
  class?: string;
27
26
  isWide?: boolean;
@@ -0,0 +1,26 @@
1
+ @layer components {
2
+ .footer-group {
3
+ @apply flex flex-col gap-2;
4
+
5
+ .footer-group-title {
6
+ @apply text-base font-semibold;
7
+ @apply mb-2;
8
+ }
9
+
10
+ .footer-group-links {
11
+ @apply flex flex-col gap-2;
12
+ @apply list-none p-0 m-0;
13
+
14
+ .footer-group-link {
15
+ @apply text-sm;
16
+ @apply transition-colors duration-200;
17
+ @apply hover:underline;
18
+ @apply inline-flex items-center gap-1;
19
+ }
20
+ }
21
+
22
+ .footer-group-content {
23
+ @apply flex flex-col gap-2;
24
+ }
25
+ }
26
+ }
@@ -1,11 +1,11 @@
1
1
  @layer components {
2
- .footer-links {
2
+ .footer-nav {
3
3
  @apply column md:row items-start md:items-center gap-3 md:gap-6;
4
4
 
5
- .footer-link {
5
+ .footer-nav-link {
6
6
  @apply text-sm opacity-70;
7
7
  @apply transition-all duration-200;
8
- @apply hover:opacity-100;
8
+ @apply hover:underline;
9
9
  @apply focus:outline-none;
10
10
  @apply cursor-pointer select-none;
11
11
 
@@ -1,19 +1,19 @@
1
1
  @layer components {
2
2
  .navmenu {
3
- @apply flex items-center gap-1 text-on-background;
3
+ @apply flex items-center gap-1;
4
4
 
5
5
  .navmenu-item {
6
6
  @apply relative flex items-center gap-2 rounded-ui px-4 py-2;
7
7
  @apply cursor-pointer select-none outline-none;
8
8
  @apply transition-all duration-200;
9
- @apply hover:bg-muted;
10
9
 
11
10
  .navmenu-icon {
12
11
  @apply h-5 w-5 shrink-0;
13
12
  }
14
13
 
15
14
  .navmenu-label {
16
- @apply font-medium text-sm whitespace-nowrap;
15
+ @apply text-sm whitespace-nowrap;
16
+ @apply font-light hover:font-semibold;
17
17
  }
18
18
 
19
19
  .navmenu-arrow {
@@ -24,8 +24,8 @@
24
24
  }
25
25
  }
26
26
 
27
- &.is-active {
28
- @apply bg-muted;
27
+ &.is-active .navmenu-label {
28
+ @apply font-semibold;
29
29
  }
30
30
  }
31
31
 
@@ -76,43 +76,13 @@
76
76
  }
77
77
  }
78
78
  }
79
-
80
- &.navmenu-primary {
81
- .navmenu-item.is-active {
82
- @apply bg-on-primary text-primary;
83
-
84
- .navmenu-icon {
85
- @apply text-primary;
86
- }
87
- }
88
- }
89
-
90
- &.navmenu-secondary {
91
- .navmenu-item.is-active {
92
- @apply bg-on-secondary text-secondary;
93
-
94
- .navmenu-icon {
95
- @apply text-secondary;
96
- }
97
- }
98
- }
99
-
100
- &.navmenu-muted {
101
- .navmenu-item.is-active {
102
- @apply bg-muted text-on-muted;
103
-
104
- .navmenu-icon {
105
- @apply text-on-muted;
106
- }
107
- }
108
- }
109
79
  }
110
80
 
111
81
  .navmenu-popover {
112
82
  @apply flex flex-col gap-2 p-2 my-1;
113
83
  @apply bg-background text-on-background rounded-ui;
114
84
  @apply invisible opacity-0 transition-opacity duration-300 ease-in-out;
115
- @apply shadow-sm shadow-muted border border-muted;
85
+ @apply shadow-sm shadow-muted;
116
86
  position: fixed;
117
87
  z-index: 9999;
118
88
  max-height: 80vh;
@@ -134,7 +104,7 @@
134
104
  @apply flex items-center gap-2 rounded-ui px-3 py-2;
135
105
  @apply cursor-pointer select-none outline-none;
136
106
  @apply transition-all duration-200;
137
- @apply hover:bg-muted;
107
+ @apply font-light hover:font-medium;
138
108
 
139
109
  .navmenu-submenu-icon {
140
110
  @apply h-5 w-5 shrink-0;
@@ -153,7 +123,7 @@
153
123
  }
154
124
 
155
125
  &.is-active {
156
- @apply bg-muted;
126
+ @apply font-medium;
157
127
  }
158
128
  }
159
129
 
@@ -162,7 +132,7 @@
162
132
  }
163
133
 
164
134
  .navmenu-header {
165
- @apply px-3 py-2 text-xs font-semibold text-on-muted/70 uppercase tracking-wide;
135
+ @apply px-3 py-2 text-xs font-semibold uppercase tracking-wide;
166
136
  }
167
137
  }
168
138
  }