glasslikeui 0.1.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/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/components/glass/GlassCard.svelte +64 -0
- package/dist/components/glass/GlassCard.svelte.d.ts +13 -0
- package/dist/components/glass/GlassSection.svelte +76 -0
- package/dist/components/glass/GlassSection.svelte.d.ts +12 -0
- package/dist/components/glass/LiquidGlass.svelte +123 -0
- package/dist/components/glass/LiquidGlass.svelte.d.ts +17 -0
- package/dist/components/glass/Sheet.svelte +236 -0
- package/dist/components/glass/Sheet.svelte.d.ts +13 -0
- package/dist/components/glass/index.d.ts +8 -0
- package/dist/components/glass/index.js +8 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.js +18 -0
- package/dist/components/interactive/Badge.svelte +60 -0
- package/dist/components/interactive/Badge.svelte.d.ts +9 -0
- package/dist/components/interactive/Button.svelte +156 -0
- package/dist/components/interactive/Button.svelte.d.ts +14 -0
- package/dist/components/interactive/IconButton.svelte +85 -0
- package/dist/components/interactive/IconButton.svelte.d.ts +12 -0
- package/dist/components/interactive/TabView.svelte +118 -0
- package/dist/components/interactive/TabView.svelte.d.ts +16 -0
- package/dist/components/interactive/index.d.ts +8 -0
- package/dist/components/interactive/index.js +8 -0
- package/dist/components/layout/Divider.svelte +31 -0
- package/dist/components/layout/Divider.svelte.d.ts +7 -0
- package/dist/components/layout/Grid.svelte +52 -0
- package/dist/components/layout/Grid.svelte.d.ts +11 -0
- package/dist/components/layout/HStack.svelte +76 -0
- package/dist/components/layout/HStack.svelte.d.ts +13 -0
- package/dist/components/layout/ScrollView.svelte +60 -0
- package/dist/components/layout/ScrollView.svelte.d.ts +10 -0
- package/dist/components/layout/Spacer.svelte +18 -0
- package/dist/components/layout/Spacer.svelte.d.ts +7 -0
- package/dist/components/layout/VStack.svelte +56 -0
- package/dist/components/layout/VStack.svelte.d.ts +11 -0
- package/dist/components/layout/ZStack.svelte +51 -0
- package/dist/components/layout/ZStack.svelte.d.ts +9 -0
- package/dist/components/layout/index.d.ts +11 -0
- package/dist/components/layout/index.js +11 -0
- package/dist/components/list/List.svelte +50 -0
- package/dist/components/list/List.svelte.d.ts +9 -0
- package/dist/components/list/ListRow.svelte +181 -0
- package/dist/components/list/ListRow.svelte.d.ts +15 -0
- package/dist/components/list/index.d.ts +6 -0
- package/dist/components/list/index.js +6 -0
- package/dist/components/media/SymbolImage.svelte +46 -0
- package/dist/components/media/SymbolImage.svelte.d.ts +10 -0
- package/dist/components/media/index.d.ts +5 -0
- package/dist/components/media/index.js +5 -0
- package/dist/components/navigation/NavigationBar.svelte +106 -0
- package/dist/components/navigation/NavigationBar.svelte.d.ts +12 -0
- package/dist/components/navigation/NavigationLink.svelte +45 -0
- package/dist/components/navigation/NavigationLink.svelte.d.ts +10 -0
- package/dist/components/navigation/index.d.ts +6 -0
- package/dist/components/navigation/index.js +6 -0
- package/dist/components/typography/Text.svelte +96 -0
- package/dist/components/typography/Text.svelte.d.ts +14 -0
- package/dist/components/typography/index.d.ts +5 -0
- package/dist/components/typography/index.js +5 -0
- package/dist/constants/colors.d.ts +22 -0
- package/dist/constants/colors.js +20 -0
- package/dist/constants/index.d.ts +7 -0
- package/dist/constants/index.js +7 -0
- package/dist/constants/materials.d.ts +13 -0
- package/dist/constants/materials.js +43 -0
- package/dist/constants/sizes.d.ts +44 -0
- package/dist/constants/sizes.js +40 -0
- package/dist/icons/index.d.ts +17 -0
- package/dist/icons/index.js +51 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +12 -0
- package/dist/styles/liquidglass.css +125 -0
- package/package.json +38 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
children: Snippet;
|
|
4
|
+
href: string;
|
|
5
|
+
active?: boolean;
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const NavigationLink: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type NavigationLink = ReturnType<typeof NavigationLink>;
|
|
10
|
+
export default NavigationLink;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
children: Snippet;
|
|
6
|
+
size?: 'xs' | 'sm' | 'body' | 'callout' | 'headline' | 'title1' | 'title2' | 'title3' | 'largeTitle' | 'hero';
|
|
7
|
+
weight?: 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy';
|
|
8
|
+
color?: 'primary' | 'secondary' | 'tertiary' | 'accent' | 'white';
|
|
9
|
+
alignment?: 'leading' | 'center' | 'trailing';
|
|
10
|
+
gradient?: boolean;
|
|
11
|
+
class?: string;
|
|
12
|
+
id?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
children,
|
|
17
|
+
size = 'body',
|
|
18
|
+
weight = 'regular',
|
|
19
|
+
color = 'primary',
|
|
20
|
+
alignment = 'leading',
|
|
21
|
+
gradient = false,
|
|
22
|
+
class: className = '',
|
|
23
|
+
id
|
|
24
|
+
}: Props = $props();
|
|
25
|
+
|
|
26
|
+
const sizeMap = {
|
|
27
|
+
xs: { fontSize: '0.6875rem', lineHeight: '1.4' },
|
|
28
|
+
sm: { fontSize: '0.8125rem', lineHeight: '1.4' },
|
|
29
|
+
body: { fontSize: '1rem', lineHeight: '1.6' },
|
|
30
|
+
callout: { fontSize: '1.0625rem', lineHeight: '1.5' },
|
|
31
|
+
headline: { fontSize: '1.125rem', lineHeight: '1.4' },
|
|
32
|
+
title3: { fontSize: '1.25rem', lineHeight: '1.3' },
|
|
33
|
+
title2: { fontSize: '1.5rem', lineHeight: '1.25' },
|
|
34
|
+
title1: { fontSize: 'clamp(1.75rem, 4vw, 2rem)', lineHeight: '1.2' },
|
|
35
|
+
largeTitle: { fontSize: 'clamp(2rem, 5vw, 3rem)', lineHeight: '1.1' },
|
|
36
|
+
hero: { fontSize: 'clamp(3rem, 12vw, 6rem)', lineHeight: '1' }
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const weightMap = {
|
|
40
|
+
regular: 400,
|
|
41
|
+
medium: 500,
|
|
42
|
+
semibold: 600,
|
|
43
|
+
bold: 700,
|
|
44
|
+
heavy: 800
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const colorMap = {
|
|
48
|
+
primary: 'var(--color-text)',
|
|
49
|
+
secondary: 'var(--color-text-secondary)',
|
|
50
|
+
tertiary: 'var(--color-text-tertiary)',
|
|
51
|
+
accent: 'var(--color-accent)',
|
|
52
|
+
white: '#ffffff'
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const alignmentMap = {
|
|
56
|
+
leading: 'left',
|
|
57
|
+
center: 'center',
|
|
58
|
+
trailing: 'right'
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const styles = $derived(sizeMap[size]);
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<span
|
|
65
|
+
{id}
|
|
66
|
+
class="text {className}"
|
|
67
|
+
class:gradient
|
|
68
|
+
style="
|
|
69
|
+
--text-size: {styles.fontSize};
|
|
70
|
+
--text-line-height: {styles.lineHeight};
|
|
71
|
+
--text-weight: {weightMap[weight]};
|
|
72
|
+
--text-color: {colorMap[color]};
|
|
73
|
+
--text-align: {alignmentMap[alignment]};
|
|
74
|
+
"
|
|
75
|
+
>
|
|
76
|
+
{@render children()}
|
|
77
|
+
</span>
|
|
78
|
+
|
|
79
|
+
<style>
|
|
80
|
+
.text {
|
|
81
|
+
display: block;
|
|
82
|
+
font-size: var(--text-size);
|
|
83
|
+
line-height: var(--text-line-height);
|
|
84
|
+
font-weight: var(--text-weight);
|
|
85
|
+
color: var(--text-color);
|
|
86
|
+
text-align: var(--text-align);
|
|
87
|
+
letter-spacing: -0.01em;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.text.gradient {
|
|
91
|
+
background: var(--glass-text-gradient);
|
|
92
|
+
-webkit-background-clip: text;
|
|
93
|
+
-webkit-text-fill-color: transparent;
|
|
94
|
+
background-clip: text;
|
|
95
|
+
}
|
|
96
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
interface Props {
|
|
3
|
+
children: Snippet;
|
|
4
|
+
size?: 'xs' | 'sm' | 'body' | 'callout' | 'headline' | 'title1' | 'title2' | 'title3' | 'largeTitle' | 'hero';
|
|
5
|
+
weight?: 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy';
|
|
6
|
+
color?: 'primary' | 'secondary' | 'tertiary' | 'accent' | 'white';
|
|
7
|
+
alignment?: 'leading' | 'center' | 'trailing';
|
|
8
|
+
gradient?: boolean;
|
|
9
|
+
class?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const Text: import("svelte").Component<Props, {}, "">;
|
|
13
|
+
type Text = ReturnType<typeof Text>;
|
|
14
|
+
export default Text;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color design tokens
|
|
3
|
+
* Centralized color constants for consistent theming
|
|
4
|
+
*/
|
|
5
|
+
/** Text color CSS values */
|
|
6
|
+
export declare const TEXT_COLORS: {
|
|
7
|
+
readonly primary: "var(--color-text)";
|
|
8
|
+
readonly secondary: "var(--color-text-secondary)";
|
|
9
|
+
readonly tertiary: "var(--color-text-tertiary)";
|
|
10
|
+
readonly accent: "var(--color-accent)";
|
|
11
|
+
readonly white: "#ffffff";
|
|
12
|
+
};
|
|
13
|
+
/** Background color variants */
|
|
14
|
+
export declare const BG_COLORS: {
|
|
15
|
+
readonly primary: "var(--color-bg)";
|
|
16
|
+
readonly secondary: "var(--color-bg-secondary)";
|
|
17
|
+
readonly tertiary: "var(--color-bg-tertiary)";
|
|
18
|
+
readonly accent: "var(--color-accent)";
|
|
19
|
+
readonly transparent: "transparent";
|
|
20
|
+
};
|
|
21
|
+
export type TextColor = keyof typeof TEXT_COLORS;
|
|
22
|
+
export type BgColor = keyof typeof BG_COLORS;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color design tokens
|
|
3
|
+
* Centralized color constants for consistent theming
|
|
4
|
+
*/
|
|
5
|
+
/** Text color CSS values */
|
|
6
|
+
export const TEXT_COLORS = {
|
|
7
|
+
primary: 'var(--color-text)',
|
|
8
|
+
secondary: 'var(--color-text-secondary)',
|
|
9
|
+
tertiary: 'var(--color-text-tertiary)',
|
|
10
|
+
accent: 'var(--color-accent)',
|
|
11
|
+
white: '#ffffff'
|
|
12
|
+
};
|
|
13
|
+
/** Background color variants */
|
|
14
|
+
export const BG_COLORS = {
|
|
15
|
+
primary: 'var(--color-bg)',
|
|
16
|
+
secondary: 'var(--color-bg-secondary)',
|
|
17
|
+
tertiary: 'var(--color-bg-tertiary)',
|
|
18
|
+
accent: 'var(--color-accent)',
|
|
19
|
+
transparent: 'transparent'
|
|
20
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Glass material design tokens
|
|
3
|
+
* Configurations for LiquidGlass component materials
|
|
4
|
+
*/
|
|
5
|
+
export interface MaterialConfig {
|
|
6
|
+
blur: number;
|
|
7
|
+
saturation: number;
|
|
8
|
+
bgOpacity: number;
|
|
9
|
+
borderOpacity: number;
|
|
10
|
+
}
|
|
11
|
+
/** Glass material presets */
|
|
12
|
+
export declare const MATERIAL_CONFIG: Record<string, MaterialConfig>;
|
|
13
|
+
export type MaterialType = keyof typeof MATERIAL_CONFIG;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Glass material design tokens
|
|
3
|
+
* Configurations for LiquidGlass component materials
|
|
4
|
+
*/
|
|
5
|
+
/** Glass material presets */
|
|
6
|
+
export const MATERIAL_CONFIG = {
|
|
7
|
+
ultraThin: {
|
|
8
|
+
blur: 8,
|
|
9
|
+
saturation: 1.2,
|
|
10
|
+
bgOpacity: 0.15,
|
|
11
|
+
borderOpacity: 0.08
|
|
12
|
+
},
|
|
13
|
+
thin: {
|
|
14
|
+
blur: 16,
|
|
15
|
+
saturation: 1.4,
|
|
16
|
+
bgOpacity: 0.25,
|
|
17
|
+
borderOpacity: 0.12
|
|
18
|
+
},
|
|
19
|
+
regular: {
|
|
20
|
+
blur: 24,
|
|
21
|
+
saturation: 1.8,
|
|
22
|
+
bgOpacity: 0.4,
|
|
23
|
+
borderOpacity: 0.18
|
|
24
|
+
},
|
|
25
|
+
thick: {
|
|
26
|
+
blur: 40,
|
|
27
|
+
saturation: 2.0,
|
|
28
|
+
bgOpacity: 0.55,
|
|
29
|
+
borderOpacity: 0.25
|
|
30
|
+
},
|
|
31
|
+
ultraThick: {
|
|
32
|
+
blur: 60,
|
|
33
|
+
saturation: 2.2,
|
|
34
|
+
bgOpacity: 0.7,
|
|
35
|
+
borderOpacity: 0.3
|
|
36
|
+
},
|
|
37
|
+
chrome: {
|
|
38
|
+
blur: 30,
|
|
39
|
+
saturation: 2.5,
|
|
40
|
+
bgOpacity: 0.3,
|
|
41
|
+
borderOpacity: 0.4
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Size and spacing design tokens
|
|
3
|
+
* Centralized constants for consistent sizing across components
|
|
4
|
+
*/
|
|
5
|
+
/** Icon/symbol pixel sizes */
|
|
6
|
+
export declare const ICON_SIZES: {
|
|
7
|
+
readonly xs: 12;
|
|
8
|
+
readonly sm: 16;
|
|
9
|
+
readonly md: 20;
|
|
10
|
+
readonly lg: 24;
|
|
11
|
+
readonly xl: 32;
|
|
12
|
+
};
|
|
13
|
+
/** Corner radius CSS values */
|
|
14
|
+
export declare const CORNER_RADIUS: {
|
|
15
|
+
readonly none: "0";
|
|
16
|
+
readonly sm: "var(--glass-radius-sm)";
|
|
17
|
+
readonly md: "var(--glass-radius-md)";
|
|
18
|
+
readonly lg: "var(--glass-radius-lg)";
|
|
19
|
+
readonly xl: "var(--glass-radius-xl)";
|
|
20
|
+
readonly full: "var(--glass-radius-full)";
|
|
21
|
+
};
|
|
22
|
+
/** Padding CSS values */
|
|
23
|
+
export declare const PADDING: {
|
|
24
|
+
readonly none: "0";
|
|
25
|
+
readonly xs: "var(--spacing-xs)";
|
|
26
|
+
readonly sm: "var(--spacing-sm)";
|
|
27
|
+
readonly md: "var(--spacing-md)";
|
|
28
|
+
readonly lg: "var(--spacing-lg)";
|
|
29
|
+
readonly xl: "var(--spacing-xl)";
|
|
30
|
+
};
|
|
31
|
+
/** Gap/spacing CSS values */
|
|
32
|
+
export declare const SPACING: {
|
|
33
|
+
readonly none: "0";
|
|
34
|
+
readonly xs: "var(--spacing-xs)";
|
|
35
|
+
readonly sm: "var(--spacing-sm)";
|
|
36
|
+
readonly md: "var(--spacing-md)";
|
|
37
|
+
readonly lg: "var(--spacing-lg)";
|
|
38
|
+
readonly xl: "var(--spacing-xl)";
|
|
39
|
+
readonly '2xl': "var(--spacing-2xl)";
|
|
40
|
+
};
|
|
41
|
+
export type IconSize = keyof typeof ICON_SIZES;
|
|
42
|
+
export type CornerRadius = keyof typeof CORNER_RADIUS;
|
|
43
|
+
export type Padding = keyof typeof PADDING;
|
|
44
|
+
export type Spacing = keyof typeof SPACING;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Size and spacing design tokens
|
|
3
|
+
* Centralized constants for consistent sizing across components
|
|
4
|
+
*/
|
|
5
|
+
/** Icon/symbol pixel sizes */
|
|
6
|
+
export const ICON_SIZES = {
|
|
7
|
+
xs: 12,
|
|
8
|
+
sm: 16,
|
|
9
|
+
md: 20,
|
|
10
|
+
lg: 24,
|
|
11
|
+
xl: 32
|
|
12
|
+
};
|
|
13
|
+
/** Corner radius CSS values */
|
|
14
|
+
export const CORNER_RADIUS = {
|
|
15
|
+
none: '0',
|
|
16
|
+
sm: 'var(--glass-radius-sm)',
|
|
17
|
+
md: 'var(--glass-radius-md)',
|
|
18
|
+
lg: 'var(--glass-radius-lg)',
|
|
19
|
+
xl: 'var(--glass-radius-xl)',
|
|
20
|
+
full: 'var(--glass-radius-full)'
|
|
21
|
+
};
|
|
22
|
+
/** Padding CSS values */
|
|
23
|
+
export const PADDING = {
|
|
24
|
+
none: '0',
|
|
25
|
+
xs: 'var(--spacing-xs)',
|
|
26
|
+
sm: 'var(--spacing-sm)',
|
|
27
|
+
md: 'var(--spacing-md)',
|
|
28
|
+
lg: 'var(--spacing-lg)',
|
|
29
|
+
xl: 'var(--spacing-xl)'
|
|
30
|
+
};
|
|
31
|
+
/** Gap/spacing CSS values */
|
|
32
|
+
export const SPACING = {
|
|
33
|
+
none: '0',
|
|
34
|
+
xs: 'var(--spacing-xs)',
|
|
35
|
+
sm: 'var(--spacing-sm)',
|
|
36
|
+
md: 'var(--spacing-md)',
|
|
37
|
+
lg: 'var(--spacing-lg)',
|
|
38
|
+
xl: 'var(--spacing-xl)',
|
|
39
|
+
'2xl': 'var(--spacing-2xl)'
|
|
40
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG Icon Library
|
|
3
|
+
* SF Symbol-inspired icons for consistent iconography
|
|
4
|
+
*
|
|
5
|
+
* Security Note: All SVG paths are hardcoded and do not accept user input.
|
|
6
|
+
* This prevents XSS attacks through SVG injection.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ICONS: Record<string, string>;
|
|
9
|
+
/** Default fallback icon name */
|
|
10
|
+
export declare const DEFAULT_ICON = "star";
|
|
11
|
+
/** Get icon path by name with fallback */
|
|
12
|
+
export declare function getIconPath(name: string): string;
|
|
13
|
+
/** Check if icon exists */
|
|
14
|
+
export declare function hasIcon(name: string): boolean;
|
|
15
|
+
/** Get all available icon names */
|
|
16
|
+
export declare function getIconNames(): string[];
|
|
17
|
+
export type IconName = keyof typeof ICONS;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG Icon Library
|
|
3
|
+
* SF Symbol-inspired icons for consistent iconography
|
|
4
|
+
*
|
|
5
|
+
* Security Note: All SVG paths are hardcoded and do not accept user input.
|
|
6
|
+
* This prevents XSS attacks through SVG injection.
|
|
7
|
+
*/
|
|
8
|
+
export const ICONS = {
|
|
9
|
+
'chevron.left': '<polyline points="15 18 9 12 15 6"></polyline>',
|
|
10
|
+
'chevron.right': '<polyline points="9 18 15 12 9 6"></polyline>',
|
|
11
|
+
'chevron.up': '<polyline points="18 15 12 9 6 15"></polyline>',
|
|
12
|
+
'chevron.down': '<polyline points="6 9 12 15 18 9"></polyline>',
|
|
13
|
+
'xmark': '<line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line>',
|
|
14
|
+
'plus': '<line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line>',
|
|
15
|
+
'minus': '<line x1="5" y1="12" x2="19" y2="12"></line>',
|
|
16
|
+
'sun.max': '<circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>',
|
|
17
|
+
'moon': '<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>',
|
|
18
|
+
'display': '<rect x="2" y="3" width="20" height="14" rx="2" ry="2"></rect><line x1="8" y1="21" x2="16" y2="21"></line><line x1="12" y1="17" x2="12" y2="21"></line>',
|
|
19
|
+
'link': '<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line>',
|
|
20
|
+
'arrow.up.right': '<line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"></polyline>',
|
|
21
|
+
'envelope': '<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline>',
|
|
22
|
+
'phone': '<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>',
|
|
23
|
+
'star': '<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon>',
|
|
24
|
+
'star.fill': '<polygon fill="currentColor" stroke="currentColor" points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon>',
|
|
25
|
+
'heart': '<path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path>',
|
|
26
|
+
'house': '<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline>',
|
|
27
|
+
'person': '<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle>',
|
|
28
|
+
'gear': '<circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path>',
|
|
29
|
+
'folder': '<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path>',
|
|
30
|
+
'doc': '<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline>',
|
|
31
|
+
'magnifyingglass': '<circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line>',
|
|
32
|
+
'menu': '<line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line>',
|
|
33
|
+
'check': '<polyline points="20 6 9 17 4 12"></polyline>',
|
|
34
|
+
'info': '<circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line>',
|
|
35
|
+
'warning': '<path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"></path><line x1="12" y1="9" x2="12" y2="13"></line><line x1="12" y1="17" x2="12.01" y2="17"></line>',
|
|
36
|
+
'error': '<circle cx="12" cy="12" r="10"></circle><line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line>'
|
|
37
|
+
};
|
|
38
|
+
/** Default fallback icon name */
|
|
39
|
+
export const DEFAULT_ICON = 'star';
|
|
40
|
+
/** Get icon path by name with fallback */
|
|
41
|
+
export function getIconPath(name) {
|
|
42
|
+
return ICONS[name] ?? ICONS[DEFAULT_ICON];
|
|
43
|
+
}
|
|
44
|
+
/** Check if icon exists */
|
|
45
|
+
export function hasIcon(name) {
|
|
46
|
+
return name in ICONS;
|
|
47
|
+
}
|
|
48
|
+
/** Get all available icon names */
|
|
49
|
+
export function getIconNames() {
|
|
50
|
+
return Object.keys(ICONS);
|
|
51
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LiquidGlass Component Library
|
|
3
|
+
* Component library for Svelte with liquid glass effects
|
|
4
|
+
*
|
|
5
|
+
* @packageDocumentation
|
|
6
|
+
*/
|
|
7
|
+
// Components
|
|
8
|
+
export * from './components';
|
|
9
|
+
// Design Tokens
|
|
10
|
+
export * from './constants';
|
|
11
|
+
// Icons
|
|
12
|
+
export * from './icons';
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/* LiquidGlass Design System
|
|
2
|
+
* Liquid glass (glassmorphism) effect
|
|
3
|
+
*
|
|
4
|
+
* This CSS file provides all the CSS custom properties needed for the LiquidGlass components.
|
|
5
|
+
* Import this file in your app's global styles to use the glass effects.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
:root {
|
|
9
|
+
/* ========================================
|
|
10
|
+
Liquid Glass System - Dark Mode (Default)
|
|
11
|
+
======================================== */
|
|
12
|
+
|
|
13
|
+
/* Glass backgrounds */
|
|
14
|
+
--glass-bg: rgba(28, 28, 30, 0.65);
|
|
15
|
+
--glass-bg-thin: rgba(28, 28, 30, 0.45);
|
|
16
|
+
--glass-bg-thick: rgba(28, 28, 30, 0.85);
|
|
17
|
+
|
|
18
|
+
/* Glass effects */
|
|
19
|
+
--glass-border: rgba(255, 255, 255, 0.12);
|
|
20
|
+
--glass-highlight: rgba(255, 255, 255, 0.08);
|
|
21
|
+
--glass-shadow: rgba(0, 0, 0, 0.5);
|
|
22
|
+
--glass-shadow-inner: rgba(0, 0, 0, 0.2);
|
|
23
|
+
--glass-divider: rgba(255, 255, 255, 0.08);
|
|
24
|
+
--glass-handle: rgba(255, 255, 255, 0.3);
|
|
25
|
+
|
|
26
|
+
/* Glass chrome effect */
|
|
27
|
+
--glass-chrome-border: rgba(255, 255, 255, 0.25);
|
|
28
|
+
--glass-chrome-outer: rgba(255, 255, 255, 0.08);
|
|
29
|
+
|
|
30
|
+
/* Glass interactions */
|
|
31
|
+
--glass-hover-bg: rgba(255, 255, 255, 0.08);
|
|
32
|
+
--glass-hover-subtle: rgba(255, 255, 255, 0.04);
|
|
33
|
+
--glass-active-bg: rgba(255, 255, 255, 0.12);
|
|
34
|
+
--glass-active-subtle: rgba(255, 255, 255, 0.06);
|
|
35
|
+
|
|
36
|
+
/* Glass buttons */
|
|
37
|
+
--glass-button-bg: rgba(255, 255, 255, 0.1);
|
|
38
|
+
--glass-button-hover: rgba(255, 255, 255, 0.15);
|
|
39
|
+
|
|
40
|
+
/* Glass badges */
|
|
41
|
+
--glass-badge-bg: rgba(255, 255, 255, 0.08);
|
|
42
|
+
|
|
43
|
+
/* Glass navigation */
|
|
44
|
+
--glass-nav-bg: rgba(0, 0, 0, 0.7);
|
|
45
|
+
--glass-nav-blur: 24px;
|
|
46
|
+
|
|
47
|
+
/* Glass sheet */
|
|
48
|
+
--glass-sheet-bg: rgba(28, 28, 30, 0.95);
|
|
49
|
+
|
|
50
|
+
/* ========================================
|
|
51
|
+
Glass Radius System
|
|
52
|
+
======================================== */
|
|
53
|
+
--glass-radius-sm: 12px;
|
|
54
|
+
--glass-radius-md: 18px;
|
|
55
|
+
--glass-radius-lg: 24px;
|
|
56
|
+
--glass-radius-xl: 32px;
|
|
57
|
+
--glass-radius-2xl: 44px;
|
|
58
|
+
--glass-radius-full: 9999px;
|
|
59
|
+
|
|
60
|
+
/* ========================================
|
|
61
|
+
Spacing System (used by glass components)
|
|
62
|
+
======================================== */
|
|
63
|
+
--spacing-xs: 0.5rem; /* 8px */
|
|
64
|
+
--spacing-sm: 1rem; /* 16px */
|
|
65
|
+
--spacing-md: 1.5rem; /* 24px */
|
|
66
|
+
--spacing-lg: 2.5rem; /* 40px */
|
|
67
|
+
--spacing-xl: 4rem; /* 64px */
|
|
68
|
+
|
|
69
|
+
/* ========================================
|
|
70
|
+
Transitions
|
|
71
|
+
======================================== */
|
|
72
|
+
--transition: 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* ========================================
|
|
76
|
+
Light Mode Overrides
|
|
77
|
+
======================================== */
|
|
78
|
+
:root[data-theme="light"] {
|
|
79
|
+
/* Glass backgrounds */
|
|
80
|
+
--glass-bg: rgba(255, 255, 255, 0.72);
|
|
81
|
+
--glass-bg-thin: rgba(255, 255, 255, 0.55);
|
|
82
|
+
--glass-bg-thick: rgba(255, 255, 255, 0.88);
|
|
83
|
+
|
|
84
|
+
/* Glass effects */
|
|
85
|
+
--glass-border: rgba(0, 0, 0, 0.06);
|
|
86
|
+
--glass-highlight: rgba(255, 255, 255, 0.8);
|
|
87
|
+
--glass-shadow: rgba(0, 0, 0, 0.12);
|
|
88
|
+
--glass-shadow-inner: rgba(0, 0, 0, 0.04);
|
|
89
|
+
--glass-divider: rgba(0, 0, 0, 0.06);
|
|
90
|
+
--glass-handle: rgba(0, 0, 0, 0.2);
|
|
91
|
+
|
|
92
|
+
/* Glass chrome */
|
|
93
|
+
--glass-chrome-border: rgba(255, 255, 255, 0.9);
|
|
94
|
+
--glass-chrome-outer: rgba(0, 0, 0, 0.05);
|
|
95
|
+
|
|
96
|
+
/* Glass interactions */
|
|
97
|
+
--glass-hover-bg: rgba(0, 0, 0, 0.04);
|
|
98
|
+
--glass-hover-subtle: rgba(0, 0, 0, 0.02);
|
|
99
|
+
--glass-active-bg: rgba(0, 0, 0, 0.08);
|
|
100
|
+
--glass-active-subtle: rgba(0, 0, 0, 0.04);
|
|
101
|
+
|
|
102
|
+
/* Glass buttons */
|
|
103
|
+
--glass-button-bg: rgba(0, 0, 0, 0.05);
|
|
104
|
+
--glass-button-hover: rgba(0, 0, 0, 0.08);
|
|
105
|
+
|
|
106
|
+
/* Glass badges */
|
|
107
|
+
--glass-badge-bg: rgba(0, 0, 0, 0.04);
|
|
108
|
+
|
|
109
|
+
/* Glass navigation */
|
|
110
|
+
--glass-nav-bg: rgba(255, 255, 255, 0.85);
|
|
111
|
+
|
|
112
|
+
/* Glass sheet */
|
|
113
|
+
--glass-sheet-bg: rgba(255, 255, 255, 0.98);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/* ========================================
|
|
117
|
+
Performance Optimizations
|
|
118
|
+
======================================== */
|
|
119
|
+
|
|
120
|
+
/* Reduce blur on mobile for better GPU performance */
|
|
121
|
+
@media (max-width: 768px) {
|
|
122
|
+
:root {
|
|
123
|
+
--glass-nav-blur: 16px;
|
|
124
|
+
}
|
|
125
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "glasslikeui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Component library for Svelte with liquid glass effects",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"svelte": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"svelte": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./liquidglass.css": "./dist/styles/liquidglass.css"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"package": "svelte-package",
|
|
22
|
+
"prepublishOnly": "npm run package"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"svelte": "^5.0.0"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/DeveloperBeau/GlassLikeUI.git"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@sveltejs/package": "^2.5.7",
|
|
33
|
+
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
34
|
+
"svelte": "^5.55.1",
|
|
35
|
+
"typescript": "^5.9.3",
|
|
36
|
+
"vite": "^8.0.3"
|
|
37
|
+
}
|
|
38
|
+
}
|