ui-svelte 0.2.1 → 0.2.2

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 (61) hide show
  1. package/dist/charts/ArcChart.svelte +3 -3
  2. package/dist/charts/ArcChart.svelte.d.ts +1 -1
  3. package/dist/charts/AreaChart.svelte +3 -3
  4. package/dist/charts/AreaChart.svelte.d.ts +1 -1
  5. package/dist/charts/BarChart.svelte +3 -3
  6. package/dist/charts/BarChart.svelte.d.ts +1 -1
  7. package/dist/charts/Candlestick.svelte +3 -3
  8. package/dist/charts/Candlestick.svelte.d.ts +1 -1
  9. package/dist/charts/LineChart.svelte +3 -3
  10. package/dist/charts/LineChart.svelte.d.ts +1 -1
  11. package/dist/charts/PieChart.svelte +3 -3
  12. package/dist/charts/PieChart.svelte.d.ts +1 -1
  13. package/dist/control/Button.svelte +2 -8
  14. package/dist/control/Button.svelte.d.ts +0 -2
  15. package/dist/control/IconButton.svelte +0 -3
  16. package/dist/control/IconButton.svelte.d.ts +0 -1
  17. package/dist/control/css/btn.css +0 -4
  18. package/dist/css/base.css +262 -45
  19. package/dist/css/utilities.css +0 -4
  20. package/dist/display/Accordion.svelte +3 -3
  21. package/dist/display/Accordion.svelte.d.ts +1 -1
  22. package/dist/display/Alert.svelte +0 -2
  23. package/dist/display/Card.svelte +4 -17
  24. package/dist/display/Card.svelte.d.ts +1 -3
  25. package/dist/display/Carousel.svelte +3 -3
  26. package/dist/display/Carousel.svelte.d.ts +1 -1
  27. package/dist/display/ChatBox.svelte +3 -3
  28. package/dist/display/ChatBox.svelte.d.ts +1 -1
  29. package/dist/display/Collapsible.svelte +3 -3
  30. package/dist/display/Collapsible.svelte.d.ts +1 -1
  31. package/dist/display/Empty.svelte +11 -5
  32. package/dist/display/Marquee.svelte +3 -3
  33. package/dist/display/Marquee.svelte.d.ts +1 -1
  34. package/dist/display/Section.svelte +3 -3
  35. package/dist/display/Section.svelte.d.ts +1 -1
  36. package/dist/display/css/alert.css +1 -1
  37. package/dist/display/css/card.css +7 -126
  38. package/dist/display/css/section.css +5 -1
  39. package/dist/form/Select.svelte +3 -3
  40. package/dist/form/Select.svelte.d.ts +1 -1
  41. package/dist/form/TextField.svelte +4 -6
  42. package/dist/form/TextField.svelte.d.ts +2 -2
  43. package/dist/form/css/control.css +1 -1
  44. package/dist/index.d.ts +3 -2
  45. package/dist/index.js +2 -2
  46. package/dist/layout/AppBar.svelte +3 -3
  47. package/dist/layout/AppBar.svelte.d.ts +1 -1
  48. package/dist/layout/Footer.svelte +3 -3
  49. package/dist/layout/Footer.svelte.d.ts +1 -1
  50. package/dist/layout/Sidebar.svelte +4 -11
  51. package/dist/layout/Sidebar.svelte.d.ts +1 -1
  52. package/dist/navigation/BottomNav.svelte +80 -0
  53. package/dist/navigation/SideNav.svelte +17 -16
  54. package/dist/navigation/SideNav.svelte.d.ts +33 -0
  55. package/dist/navigation/Tabs.svelte +3 -3
  56. package/dist/navigation/Tabs.svelte.d.ts +1 -1
  57. package/dist/navigation/css/bottom-nav.css +134 -0
  58. package/package.json +2 -2
  59. package/dist/navigation/BottomNav.svelte.d.ts +0 -26
  60. /package/dist/{types.d.ts → types.svelte.d.ts} +0 -0
  61. /package/dist/{types.js → types.svelte.js} +0 -0
@@ -1,35 +1,36 @@
1
- <script lang="ts">
2
- import { page } from '$app/state';
3
- import type { IconData } from '../display/Icon.svelte';
4
- import { ChevronRight24RegularIcon } from '../icons/index.js';
5
- import { Icon } from '../index.js';
6
- import { cn } from '../utils/class-names.js';
7
- import type { Snippet } from 'svelte';
8
- import { slide } from 'svelte/transition';
9
-
10
- type SubmenuItem = {
1
+ <script lang="ts" module>
2
+ export type SideNavSubItem = {
11
3
  label: string;
12
4
  href?: string;
13
- onclick?: (item: SubmenuItem) => void;
5
+ onclick?: (item: SideNavSubItem) => void;
14
6
  description?: string;
15
7
  status?: string | Snippet;
16
8
  icon?: IconData;
17
9
  };
18
10
 
19
- type NavItem = {
11
+ export type SideNavItem = {
20
12
  type?: 'item' | 'divider' | 'header' | 'submenu';
21
13
  label?: string;
22
14
  description?: string;
23
15
  href?: string;
24
- onclick?: (item: NavItem) => void;
16
+ onclick?: (item: SideNavItem) => void;
25
17
  status?: string | Snippet;
26
18
  icon?: IconData;
27
- subitems?: SubmenuItem[];
19
+ subitems?: SideNavSubItem[];
28
20
  open?: boolean;
29
21
  };
22
+ </script>
23
+
24
+ <script lang="ts">
25
+ import { page } from '$app/state';
26
+ import { ChevronRight24RegularIcon } from '../icons/index.js';
27
+ import { Icon, type IconData } from '../index.js';
28
+ import { cn } from '../utils/class-names.js';
29
+ import type { Snippet } from 'svelte';
30
+ import { slide } from 'svelte/transition';
30
31
 
31
32
  type Props = {
32
- items: NavItem[];
33
+ items: SideNavItem[];
33
34
  variant?: 'primary' | 'secondary' | 'muted';
34
35
  size?: 'sm' | 'md' | 'lg';
35
36
  class?: string;
@@ -97,7 +98,7 @@
97
98
  }
98
99
  </script>
99
100
 
100
- {#snippet navItemContent(item: NavItem | SubmenuItem, isSubitem = false)}
101
+ {#snippet navItemContent(item: SideNavItem | SideNavSubItem, isSubitem = false)}
101
102
  <div class="sidenav-content">
102
103
  <div class="sidenav-label">{item.label}</div>
103
104
  {#if item.description && (isExpanded || !isCollapsible)}
@@ -0,0 +1,33 @@
1
+ export type SideNavSubItem = {
2
+ label: string;
3
+ href?: string;
4
+ onclick?: (item: SideNavSubItem) => void;
5
+ description?: string;
6
+ status?: string | Snippet;
7
+ icon?: IconData;
8
+ };
9
+ export type SideNavItem = {
10
+ type?: 'item' | 'divider' | 'header' | 'submenu';
11
+ label?: string;
12
+ description?: string;
13
+ href?: string;
14
+ onclick?: (item: SideNavItem) => void;
15
+ status?: string | Snippet;
16
+ icon?: IconData;
17
+ subitems?: SideNavSubItem[];
18
+ open?: boolean;
19
+ };
20
+ import { type IconData } from '../index.js';
21
+ import type { Snippet } from 'svelte';
22
+ type Props = {
23
+ items: SideNavItem[];
24
+ variant?: 'primary' | 'secondary' | 'muted';
25
+ size?: 'sm' | 'md' | 'lg';
26
+ class?: string;
27
+ isWide?: boolean;
28
+ isCompact?: boolean;
29
+ isCollapsible?: boolean;
30
+ };
31
+ declare const SideNav: import("svelte").Component<Props, {}, "">;
32
+ type SideNav = ReturnType<typeof SideNav>;
33
+ export default SideNav;
@@ -12,13 +12,13 @@
12
12
  position?: 'top' | 'bottom' | 'start' | 'end';
13
13
  variant?: 'primary' | 'secondary' | 'muted' | 'outline' | 'line' | 'ghost';
14
14
  pill?: boolean;
15
- class?: string;
15
+ rootClass?: string;
16
16
  tabListClass?: string;
17
17
  tabClass?: string;
18
18
  tabContentClass?: string;
19
19
  };
20
20
  const {
21
- class: className,
21
+ rootClass,
22
22
  tabClass,
23
23
  tabListClass,
24
24
  tabContentClass,
@@ -51,7 +51,7 @@
51
51
  }
52
52
  </script>
53
53
 
54
- <div class={cn('tabs', positionClasses[position], className)}>
54
+ <div class={cn('tabs', positionClasses[position], rootClass)}>
55
55
  <div class={cn('tabs-list', variantClasses[variant], pill && 'is-pill', tabListClass)}>
56
56
  {#each tabs as tab}
57
57
  <!-- svelte-ignore a11y_click_events_have_key_events -->
@@ -9,7 +9,7 @@ type Props = {
9
9
  position?: 'top' | 'bottom' | 'start' | 'end';
10
10
  variant?: 'primary' | 'secondary' | 'muted' | 'outline' | 'line' | 'ghost';
11
11
  pill?: boolean;
12
- class?: string;
12
+ rootClass?: string;
13
13
  tabListClass?: string;
14
14
  tabClass?: string;
15
15
  tabContentClass?: string;
@@ -0,0 +1,134 @@
1
+ @layer components {
2
+ .bottomnav {
3
+ @apply fixed bottom-0 left-0 right-0 z-50;
4
+ @apply flex items-center justify-around;
5
+ @apply bg-background text-on-background;
6
+ @apply border-t border-muted;
7
+ @apply shadow-lg;
8
+ padding-bottom: env(safe-area-inset-bottom);
9
+
10
+ .bottomnav-item {
11
+ @apply flex flex-col items-center justify-center gap-1;
12
+ @apply flex-1 py-2 px-1;
13
+ @apply cursor-pointer select-none outline-none;
14
+ @apply transition-all duration-200;
15
+ @apply relative;
16
+
17
+ .bottomnav-icon {
18
+ @apply h-6 w-6 shrink-0;
19
+ @apply transition-all duration-200;
20
+ }
21
+
22
+ .bottomnav-label {
23
+ @apply text-xs font-medium whitespace-nowrap;
24
+ @apply transition-all duration-200;
25
+ }
26
+
27
+ &:hover {
28
+ @apply bg-muted/50;
29
+ }
30
+
31
+ &.is-active {
32
+ @apply text-primary;
33
+
34
+ .bottomnav-icon {
35
+ @apply text-primary;
36
+ }
37
+ }
38
+ }
39
+
40
+ &.is-sm {
41
+ .bottomnav-item {
42
+ @apply gap-0.5 py-1.5;
43
+
44
+ .bottomnav-icon {
45
+ @apply h-5 w-5;
46
+ }
47
+
48
+ .bottomnav-label {
49
+ @apply text-[10px];
50
+ }
51
+ }
52
+ }
53
+
54
+ &.is-md {
55
+ .bottomnav-item {
56
+ @apply gap-1 py-2;
57
+
58
+ .bottomnav-icon {
59
+ @apply h-6 w-6;
60
+ }
61
+
62
+ .bottomnav-label {
63
+ @apply text-xs;
64
+ }
65
+ }
66
+ }
67
+
68
+ &.is-lg {
69
+ .bottomnav-item {
70
+ @apply gap-1.5 py-3;
71
+
72
+ .bottomnav-icon {
73
+ @apply h-7 w-7;
74
+ }
75
+
76
+ .bottomnav-label {
77
+ @apply text-sm;
78
+ }
79
+ }
80
+ }
81
+
82
+ &.is-icon-only {
83
+ .bottomnav-item {
84
+ @apply gap-0;
85
+
86
+ .bottomnav-icon {
87
+ @apply h-7 w-7;
88
+ }
89
+ }
90
+ }
91
+
92
+ &.bottomnav-primary {
93
+ .bottomnav-item.is-active {
94
+ @apply text-primary;
95
+
96
+ .bottomnav-icon {
97
+ @apply text-primary;
98
+ }
99
+
100
+ .bottomnav-label {
101
+ @apply text-primary;
102
+ }
103
+ }
104
+ }
105
+
106
+ &.bottomnav-secondary {
107
+ .bottomnav-item.is-active {
108
+ @apply text-secondary;
109
+
110
+ .bottomnav-icon {
111
+ @apply text-secondary;
112
+ }
113
+
114
+ .bottomnav-label {
115
+ @apply text-secondary;
116
+ }
117
+ }
118
+ }
119
+
120
+ &.bottomnav-muted {
121
+ .bottomnav-item.is-active {
122
+ @apply bg-muted text-on-muted;
123
+
124
+ .bottomnav-icon {
125
+ @apply text-on-muted;
126
+ }
127
+
128
+ .bottomnav-label {
129
+ @apply text-on-muted;
130
+ }
131
+ }
132
+ }
133
+ }
134
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-svelte",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "author": {
5
5
  "name": "SappsDev",
6
6
  "email": "info@sappsdev.com"
@@ -26,6 +26,7 @@
26
26
  "vite": "^7.1.7"
27
27
  },
28
28
  "peerDependencies": {
29
+ "hls.js": "^1.6.15",
29
30
  "shiki": "^3.14.0",
30
31
  "svelte": "^5.0.0"
31
32
  },
@@ -34,7 +35,6 @@
34
35
  "types": "./dist/index.d.ts",
35
36
  "svelte": "./dist/index.js"
36
37
  },
37
- "./types": "./dist/types.js",
38
38
  "./css": "./dist/index.css"
39
39
  },
40
40
  "css": "./dist/index.css",
@@ -1,26 +0,0 @@
1
- export default BottomNav;
2
- type BottomNav = SvelteComponent<{
3
- [x: string]: never;
4
- }, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> & {
7
- $$bindings?: string | undefined;
8
- };
9
- declare const BottomNav: $$__sveltets_2_IsomorphicComponent<{
10
- [x: string]: never;
11
- }, {
12
- [evt: string]: CustomEvent<any>;
13
- }, {}, {}, string>;
14
- 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> {
15
- new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
16
- $$bindings?: Bindings;
17
- } & Exports;
18
- (internal: unknown, props: {
19
- $$events?: Events;
20
- $$slots?: Slots;
21
- }): Exports & {
22
- $set?: any;
23
- $on?: any;
24
- };
25
- z_$$bindings?: Bindings;
26
- }
File without changes
File without changes