glasslikeui 0.1.0 → 0.2.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.
- package/dist/components/interactive/Button.svelte +18 -1
- package/dist/components/interactive/Button.svelte.d.ts +1 -1
- package/dist/components/interactive/TabView.svelte +32 -7
- package/dist/components/interactive/TabView.svelte.d.ts +3 -1
- package/dist/components/typography/Text.svelte +3 -2
- package/dist/components/typography/Text.svelte.d.ts +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
5
|
children: Snippet;
|
|
6
|
-
variant?: 'filled' | 'glass' | 'outlined' | 'plain' | 'tinted';
|
|
6
|
+
variant?: 'filled' | 'glass' | 'outlined' | 'plain' | 'tinted' | 'destructive';
|
|
7
7
|
size?: 'sm' | 'md' | 'lg';
|
|
8
8
|
fullWidth?: boolean;
|
|
9
9
|
disabled?: boolean;
|
|
@@ -153,4 +153,21 @@
|
|
|
153
153
|
.button.variant-tinted:hover {
|
|
154
154
|
background: rgba(0, 113, 227, 0.25);
|
|
155
155
|
}
|
|
156
|
+
|
|
157
|
+
/* Destructive variant */
|
|
158
|
+
.button.variant-destructive {
|
|
159
|
+
background: var(--color-danger, #ef4444);
|
|
160
|
+
color: white;
|
|
161
|
+
box-shadow: 0 4px 16px -4px rgba(239, 68, 68, 0.5);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.button.variant-destructive:hover {
|
|
165
|
+
background: var(--color-danger-hover, #dc2626);
|
|
166
|
+
transform: translateY(-2px);
|
|
167
|
+
box-shadow: 0 8px 24px -4px rgba(239, 68, 68, 0.5);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.button.variant-destructive:active {
|
|
171
|
+
transform: translateY(0);
|
|
172
|
+
}
|
|
156
173
|
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
interface Props {
|
|
3
3
|
children: Snippet;
|
|
4
|
-
variant?: 'filled' | 'glass' | 'outlined' | 'plain' | 'tinted';
|
|
4
|
+
variant?: 'filled' | 'glass' | 'outlined' | 'plain' | 'tinted' | 'destructive';
|
|
5
5
|
size?: 'sm' | 'md' | 'lg';
|
|
6
6
|
fullWidth?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
@@ -12,8 +12,10 @@
|
|
|
12
12
|
interface Props {
|
|
13
13
|
tabs: Tab[];
|
|
14
14
|
activeTab?: string;
|
|
15
|
-
children
|
|
15
|
+
children?: Snippet<[string]>;
|
|
16
16
|
position?: 'top' | 'bottom';
|
|
17
|
+
inline?: boolean;
|
|
18
|
+
onchange?: (id: string) => void;
|
|
17
19
|
class?: string;
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -22,20 +24,34 @@
|
|
|
22
24
|
activeTab = $bindable(tabs[0]?.id || ''),
|
|
23
25
|
children,
|
|
24
26
|
position = 'bottom',
|
|
27
|
+
inline = false,
|
|
28
|
+
onchange,
|
|
25
29
|
class: className = ''
|
|
26
30
|
}: Props = $props();
|
|
27
31
|
|
|
28
32
|
function selectTab(tabId: string) {
|
|
29
33
|
activeTab = tabId;
|
|
34
|
+
onchange?.(tabId);
|
|
30
35
|
}
|
|
31
36
|
</script>
|
|
32
37
|
|
|
33
|
-
<div
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
<div
|
|
39
|
+
class="tab-view {className}"
|
|
40
|
+
class:position-bottom={position === 'bottom' && !inline}
|
|
41
|
+
class:inline
|
|
42
|
+
>
|
|
43
|
+
{#if children}
|
|
44
|
+
<div class="tab-content">
|
|
45
|
+
{@render children(activeTab)}
|
|
46
|
+
</div>
|
|
47
|
+
{/if}
|
|
48
|
+
|
|
49
|
+
<LiquidGlass
|
|
50
|
+
material="thick"
|
|
51
|
+
cornerRadius="full"
|
|
52
|
+
padding="xs"
|
|
53
|
+
class={inline ? 'tab-bar-container-inline' : 'tab-bar-container'}
|
|
54
|
+
>
|
|
39
55
|
<HStack spacing="xs" justify="center" class="tab-bar">
|
|
40
56
|
{#each tabs as tab}
|
|
41
57
|
<button
|
|
@@ -77,6 +93,15 @@
|
|
|
77
93
|
z-index: 50;
|
|
78
94
|
}
|
|
79
95
|
|
|
96
|
+
:global(.tab-bar-container-inline) {
|
|
97
|
+
display: block;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.tab-view.inline {
|
|
101
|
+
display: block;
|
|
102
|
+
min-height: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
80
105
|
:global(.tab-bar) {
|
|
81
106
|
min-width: 0;
|
|
82
107
|
}
|
|
@@ -7,8 +7,10 @@ interface Tab {
|
|
|
7
7
|
interface Props {
|
|
8
8
|
tabs: Tab[];
|
|
9
9
|
activeTab?: string;
|
|
10
|
-
children
|
|
10
|
+
children?: Snippet<[string]>;
|
|
11
11
|
position?: 'top' | 'bottom';
|
|
12
|
+
inline?: boolean;
|
|
13
|
+
onchange?: (id: string) => void;
|
|
12
14
|
class?: string;
|
|
13
15
|
}
|
|
14
16
|
declare const TabView: import("svelte").Component<Props, {}, "activeTab">;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
children: Snippet;
|
|
6
6
|
size?: 'xs' | 'sm' | 'body' | 'callout' | 'headline' | 'title1' | 'title2' | 'title3' | 'largeTitle' | 'hero';
|
|
7
7
|
weight?: 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy';
|
|
8
|
-
color?: 'primary' | 'secondary' | 'tertiary' | 'accent' | 'white';
|
|
8
|
+
color?: 'primary' | 'secondary' | 'tertiary' | 'accent' | 'white' | 'danger';
|
|
9
9
|
alignment?: 'leading' | 'center' | 'trailing';
|
|
10
10
|
gradient?: boolean;
|
|
11
11
|
class?: string;
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
secondary: 'var(--color-text-secondary)',
|
|
50
50
|
tertiary: 'var(--color-text-tertiary)',
|
|
51
51
|
accent: 'var(--color-accent)',
|
|
52
|
-
white: '#ffffff'
|
|
52
|
+
white: '#ffffff',
|
|
53
|
+
danger: 'var(--color-danger, #ef4444)'
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
const alignmentMap = {
|
|
@@ -3,7 +3,7 @@ interface Props {
|
|
|
3
3
|
children: Snippet;
|
|
4
4
|
size?: 'xs' | 'sm' | 'body' | 'callout' | 'headline' | 'title1' | 'title2' | 'title3' | 'largeTitle' | 'hero';
|
|
5
5
|
weight?: 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy';
|
|
6
|
-
color?: 'primary' | 'secondary' | 'tertiary' | 'accent' | 'white';
|
|
6
|
+
color?: 'primary' | 'secondary' | 'tertiary' | 'accent' | 'white' | 'danger';
|
|
7
7
|
alignment?: 'leading' | 'center' | 'trailing';
|
|
8
8
|
gradient?: boolean;
|
|
9
9
|
class?: string;
|