glasslikeui 1.1.0 → 1.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.
Files changed (40) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +215 -215
  3. package/dist/components/glass/Glass.svelte +164 -164
  4. package/dist/components/glass/GlassCard.svelte +71 -71
  5. package/dist/components/glass/GlassDimLayer.svelte +37 -37
  6. package/dist/components/glass/GlassEffectContainer.svelte +58 -58
  7. package/dist/components/glass/GlassMorph.svelte +42 -42
  8. package/dist/components/glass/GlassSection.svelte +82 -82
  9. package/dist/components/glass/LensFilters.svelte +41 -41
  10. package/dist/components/glass/Sheet.svelte +266 -266
  11. package/dist/components/index.d.ts +1 -0
  12. package/dist/components/index.js +2 -0
  13. package/dist/components/interactive/Badge.svelte +52 -52
  14. package/dist/components/interactive/Button.svelte +168 -168
  15. package/dist/components/interactive/IconButton.svelte +74 -74
  16. package/dist/components/layout/Divider.svelte +31 -31
  17. package/dist/components/layout/Grid.svelte +52 -52
  18. package/dist/components/layout/HStack.svelte +76 -76
  19. package/dist/components/layout/ScrollView.svelte +83 -83
  20. package/dist/components/layout/Spacer.svelte +18 -18
  21. package/dist/components/layout/VStack.svelte +56 -56
  22. package/dist/components/layout/ZStack.svelte +51 -51
  23. package/dist/components/list/List.svelte +50 -50
  24. package/dist/components/list/ListRow.svelte +181 -181
  25. package/dist/components/media/SymbolImage.svelte +46 -46
  26. package/dist/components/menu/Menu.svelte +206 -0
  27. package/dist/components/menu/Menu.svelte.d.ts +10 -0
  28. package/dist/components/menu/MenuItem.svelte +114 -0
  29. package/dist/components/menu/MenuItem.svelte.d.ts +12 -0
  30. package/dist/components/menu/index.d.ts +6 -0
  31. package/dist/components/menu/index.js +6 -0
  32. package/dist/components/navigation/NavigationBar.svelte +195 -195
  33. package/dist/components/navigation/NavigationLink.svelte +45 -45
  34. package/dist/components/typography/Text.svelte +98 -98
  35. package/dist/icons/index.js +4 -1
  36. package/dist/styles/glasslikeui.css +192 -192
  37. package/dist/styles/lens.css +93 -93
  38. package/dist/styles/squircle.css +17 -17
  39. package/dist/styles/typography.css +27 -27
  40. package/package.json +50 -50
@@ -1,168 +1,168 @@
1
- <script lang="ts">
2
- import type { Snippet } from 'svelte';
3
-
4
- interface Props {
5
- children: Snippet;
6
- variant?: 'filled' | 'outlined' | 'plain' | 'tinted' | 'destructive';
7
- size?: 'sm' | 'md' | 'lg';
8
- fullWidth?: boolean;
9
- disabled?: boolean;
10
- href?: string | undefined;
11
- onclick?: ((e: MouseEvent) => void) | undefined;
12
- class?: string;
13
- }
14
-
15
- let {
16
- children,
17
- variant = 'filled',
18
- size = 'md',
19
- fullWidth = false,
20
- disabled = false,
21
- href,
22
- onclick,
23
- class: className = ''
24
- }: Props = $props();
25
-
26
- const sizeStyles = {
27
- sm: { padding: '8px 16px', fontSize: '0.875rem' },
28
- md: { padding: '12px 24px', fontSize: '1rem' },
29
- lg: { padding: '16px 32px', fontSize: '1.0625rem' }
30
- };
31
-
32
- const styles = $derived(sizeStyles[size]);
33
- </script>
34
-
35
- {#if href}
36
- <a
37
- {href}
38
- class="button variant-{variant} size-{size} {className}"
39
- class:full-width={fullWidth}
40
- class:disabled
41
- onclick={onclick}
42
- style="
43
- --btn-padding: {styles.padding};
44
- --btn-font-size: {styles.fontSize};
45
- "
46
- >
47
- {@render children()}
48
- </a>
49
- {:else}
50
- <button
51
- class="button variant-{variant} size-{size} {className}"
52
- class:full-width={fullWidth}
53
- {disabled}
54
- {onclick}
55
- style="
56
- --btn-padding: {styles.padding};
57
- --btn-font-size: {styles.fontSize};
58
- "
59
- >
60
- {@render children()}
61
- </button>
62
- {/if}
63
-
64
- <style>
65
- .button {
66
- display: inline-flex;
67
- align-items: center;
68
- justify-content: center;
69
- gap: 8px;
70
- padding: var(--btn-padding);
71
- font-size: var(--btn-font-size);
72
- font-weight: 500;
73
- font-family: inherit;
74
- border: none;
75
- border-radius: var(--glass-radius-full);
76
- cursor: pointer;
77
- text-decoration: none;
78
- transition: all var(--transition-fast);
79
- position: relative;
80
- overflow: hidden;
81
- }
82
-
83
- .button.full-width {
84
- width: 100%;
85
- }
86
-
87
- .button.disabled {
88
- opacity: 0.5;
89
- pointer-events: none;
90
- }
91
-
92
- /* Filled variant */
93
- .button.variant-filled {
94
- background: var(--color-accent);
95
- color: white;
96
- box-shadow: 0 4px 16px -4px var(--color-accent-50);
97
- }
98
-
99
- .button.variant-filled:hover {
100
- background: var(--color-accent-hover);
101
- box-shadow: 0 8px 28px -6px var(--color-accent-50);
102
- }
103
-
104
- .button.variant-filled:active {
105
- background: var(--color-accent-active);
106
- box-shadow: 0 2px 10px -4px var(--color-accent-50);
107
- }
108
-
109
- /* Outlined variant */
110
- .button.variant-outlined {
111
- background: transparent;
112
- color: var(--color-accent);
113
- border: 1.5px solid var(--color-accent);
114
- }
115
-
116
- .button.variant-outlined:hover {
117
- background: var(--color-accent-10);
118
- border-color: var(--color-accent-hover);
119
- color: var(--color-accent-hover);
120
- }
121
-
122
- .button.variant-outlined:active {
123
- background: var(--color-accent-15);
124
- }
125
-
126
- /* Plain variant */
127
- .button.variant-plain {
128
- background: transparent;
129
- color: var(--color-accent);
130
- }
131
-
132
- .button.variant-plain:hover {
133
- color: var(--color-accent-hover);
134
- text-decoration: underline;
135
- }
136
-
137
- /* Tinted variant */
138
- .button.variant-tinted {
139
- background: var(--color-accent-15);
140
- color: var(--color-accent);
141
- }
142
-
143
- .button.variant-tinted:hover {
144
- background: var(--color-accent-25);
145
- color: var(--color-accent-hover);
146
- }
147
-
148
- .button.variant-tinted:active {
149
- background: var(--color-accent-10);
150
- }
151
-
152
- /* Destructive variant */
153
- .button.variant-destructive {
154
- background: var(--color-danger);
155
- color: white;
156
- box-shadow: 0 4px 16px -4px color-mix(in srgb, var(--color-danger) 50%, transparent);
157
- }
158
-
159
- .button.variant-destructive:hover {
160
- background: var(--color-danger-hover);
161
- box-shadow: 0 8px 28px -6px color-mix(in srgb, var(--color-danger) 50%, transparent);
162
- }
163
-
164
- .button.variant-destructive:active {
165
- background: var(--color-danger-active);
166
- box-shadow: 0 2px 10px -4px color-mix(in srgb, var(--color-danger) 50%, transparent);
167
- }
168
- </style>
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ interface Props {
5
+ children: Snippet;
6
+ variant?: 'filled' | 'outlined' | 'plain' | 'tinted' | 'destructive';
7
+ size?: 'sm' | 'md' | 'lg';
8
+ fullWidth?: boolean;
9
+ disabled?: boolean;
10
+ href?: string | undefined;
11
+ onclick?: ((e: MouseEvent) => void) | undefined;
12
+ class?: string;
13
+ }
14
+
15
+ let {
16
+ children,
17
+ variant = 'filled',
18
+ size = 'md',
19
+ fullWidth = false,
20
+ disabled = false,
21
+ href,
22
+ onclick,
23
+ class: className = ''
24
+ }: Props = $props();
25
+
26
+ const sizeStyles = {
27
+ sm: { padding: '8px 16px', fontSize: '0.875rem' },
28
+ md: { padding: '12px 24px', fontSize: '1rem' },
29
+ lg: { padding: '16px 32px', fontSize: '1.0625rem' }
30
+ };
31
+
32
+ const styles = $derived(sizeStyles[size]);
33
+ </script>
34
+
35
+ {#if href}
36
+ <a
37
+ {href}
38
+ class="button variant-{variant} size-{size} {className}"
39
+ class:full-width={fullWidth}
40
+ class:disabled
41
+ onclick={onclick}
42
+ style="
43
+ --btn-padding: {styles.padding};
44
+ --btn-font-size: {styles.fontSize};
45
+ "
46
+ >
47
+ {@render children()}
48
+ </a>
49
+ {:else}
50
+ <button
51
+ class="button variant-{variant} size-{size} {className}"
52
+ class:full-width={fullWidth}
53
+ {disabled}
54
+ {onclick}
55
+ style="
56
+ --btn-padding: {styles.padding};
57
+ --btn-font-size: {styles.fontSize};
58
+ "
59
+ >
60
+ {@render children()}
61
+ </button>
62
+ {/if}
63
+
64
+ <style>
65
+ .button {
66
+ display: inline-flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+ gap: 8px;
70
+ padding: var(--btn-padding);
71
+ font-size: var(--btn-font-size);
72
+ font-weight: 500;
73
+ font-family: inherit;
74
+ border: none;
75
+ border-radius: var(--glass-radius-full);
76
+ cursor: pointer;
77
+ text-decoration: none;
78
+ transition: all var(--transition-fast);
79
+ position: relative;
80
+ overflow: hidden;
81
+ }
82
+
83
+ .button.full-width {
84
+ width: 100%;
85
+ }
86
+
87
+ .button.disabled {
88
+ opacity: 0.5;
89
+ pointer-events: none;
90
+ }
91
+
92
+ /* Filled variant */
93
+ .button.variant-filled {
94
+ background: var(--color-accent);
95
+ color: white;
96
+ box-shadow: 0 4px 16px -4px var(--color-accent-50);
97
+ }
98
+
99
+ .button.variant-filled:hover {
100
+ background: var(--color-accent-hover);
101
+ box-shadow: 0 8px 28px -6px var(--color-accent-50);
102
+ }
103
+
104
+ .button.variant-filled:active {
105
+ background: var(--color-accent-active);
106
+ box-shadow: 0 2px 10px -4px var(--color-accent-50);
107
+ }
108
+
109
+ /* Outlined variant */
110
+ .button.variant-outlined {
111
+ background: transparent;
112
+ color: var(--color-accent);
113
+ border: 1.5px solid var(--color-accent);
114
+ }
115
+
116
+ .button.variant-outlined:hover {
117
+ background: var(--color-accent-10);
118
+ border-color: var(--color-accent-hover);
119
+ color: var(--color-accent-hover);
120
+ }
121
+
122
+ .button.variant-outlined:active {
123
+ background: var(--color-accent-15);
124
+ }
125
+
126
+ /* Plain variant */
127
+ .button.variant-plain {
128
+ background: transparent;
129
+ color: var(--color-accent);
130
+ }
131
+
132
+ .button.variant-plain:hover {
133
+ color: var(--color-accent-hover);
134
+ text-decoration: underline;
135
+ }
136
+
137
+ /* Tinted variant */
138
+ .button.variant-tinted {
139
+ background: var(--color-accent-15);
140
+ color: var(--color-accent);
141
+ }
142
+
143
+ .button.variant-tinted:hover {
144
+ background: var(--color-accent-25);
145
+ color: var(--color-accent-hover);
146
+ }
147
+
148
+ .button.variant-tinted:active {
149
+ background: var(--color-accent-10);
150
+ }
151
+
152
+ /* Destructive variant */
153
+ .button.variant-destructive {
154
+ background: var(--color-danger);
155
+ color: white;
156
+ box-shadow: 0 4px 16px -4px color-mix(in srgb, var(--color-danger) 50%, transparent);
157
+ }
158
+
159
+ .button.variant-destructive:hover {
160
+ background: var(--color-danger-hover);
161
+ box-shadow: 0 8px 28px -6px color-mix(in srgb, var(--color-danger) 50%, transparent);
162
+ }
163
+
164
+ .button.variant-destructive:active {
165
+ background: var(--color-danger-active);
166
+ box-shadow: 0 2px 10px -4px color-mix(in srgb, var(--color-danger) 50%, transparent);
167
+ }
168
+ </style>
@@ -1,74 +1,74 @@
1
- <script lang="ts">
2
- import type { Snippet } from 'svelte';
3
-
4
- interface Props {
5
- children: Snippet;
6
- variant?: 'plain' | 'filled';
7
- size?: 'sm' | 'md' | 'lg';
8
- label?: string | undefined;
9
- onclick?: ((e: MouseEvent) => void) | undefined;
10
- class?: string;
11
- }
12
-
13
- let {
14
- children,
15
- variant = 'plain',
16
- size = 'md',
17
- label = '',
18
- onclick,
19
- class: className = ''
20
- }: Props = $props();
21
-
22
- const sizeMap = {
23
- sm: 32,
24
- md: 40,
25
- lg: 48
26
- };
27
- </script>
28
-
29
- <button
30
- class="icon-button variant-{variant} size-{size} {className}"
31
- aria-label={label}
32
- title={label}
33
- {onclick}
34
- style="--btn-size: {sizeMap[size]}px"
35
- >
36
- {@render children()}
37
- </button>
38
-
39
- <style>
40
- .icon-button {
41
- display: flex;
42
- align-items: center;
43
- justify-content: center;
44
- width: var(--btn-size);
45
- height: var(--btn-size);
46
- border: none;
47
- border-radius: var(--glass-radius-full);
48
- cursor: pointer;
49
- transition: all var(--transition-fast);
50
- background: transparent;
51
- color: var(--color-text-secondary);
52
- }
53
-
54
- .icon-button:hover {
55
- color: var(--color-text);
56
- }
57
-
58
- .icon-button.variant-plain {
59
- background: transparent;
60
- }
61
-
62
- .icon-button.variant-plain:hover {
63
- background: var(--glass-hover-subtle);
64
- }
65
-
66
- .icon-button.variant-filled {
67
- background: var(--color-accent);
68
- color: white;
69
- }
70
-
71
- .icon-button.variant-filled:hover {
72
- background: var(--color-accent-hover);
73
- }
74
- </style>
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ interface Props {
5
+ children: Snippet;
6
+ variant?: 'plain' | 'filled';
7
+ size?: 'sm' | 'md' | 'lg';
8
+ label?: string | undefined;
9
+ onclick?: ((e: MouseEvent) => void) | undefined;
10
+ class?: string;
11
+ }
12
+
13
+ let {
14
+ children,
15
+ variant = 'plain',
16
+ size = 'md',
17
+ label = '',
18
+ onclick,
19
+ class: className = ''
20
+ }: Props = $props();
21
+
22
+ const sizeMap = {
23
+ sm: 32,
24
+ md: 40,
25
+ lg: 48
26
+ };
27
+ </script>
28
+
29
+ <button
30
+ class="icon-button variant-{variant} size-{size} {className}"
31
+ aria-label={label}
32
+ title={label}
33
+ {onclick}
34
+ style="--btn-size: {sizeMap[size]}px"
35
+ >
36
+ {@render children()}
37
+ </button>
38
+
39
+ <style>
40
+ .icon-button {
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ width: var(--btn-size);
45
+ height: var(--btn-size);
46
+ border: none;
47
+ border-radius: var(--glass-radius-full);
48
+ cursor: pointer;
49
+ transition: all var(--transition-fast);
50
+ background: transparent;
51
+ color: var(--color-text-secondary);
52
+ }
53
+
54
+ .icon-button:hover {
55
+ color: var(--color-text);
56
+ }
57
+
58
+ .icon-button.variant-plain {
59
+ background: transparent;
60
+ }
61
+
62
+ .icon-button.variant-plain:hover {
63
+ background: var(--glass-hover-subtle);
64
+ }
65
+
66
+ .icon-button.variant-filled {
67
+ background: var(--color-accent);
68
+ color: white;
69
+ }
70
+
71
+ .icon-button.variant-filled:hover {
72
+ background: var(--color-accent-hover);
73
+ }
74
+ </style>
@@ -1,31 +1,31 @@
1
- <script lang="ts">
2
- interface Props {
3
- orientation?: 'horizontal' | 'vertical';
4
- class?: string;
5
- }
6
-
7
- let {
8
- orientation = 'horizontal',
9
- class: className = ''
10
- }: Props = $props();
11
- </script>
12
-
13
- <div class="divider {orientation} {className}"></div>
14
-
15
- <style>
16
- .divider {
17
- background: var(--glass-divider);
18
- flex-shrink: 0;
19
- }
20
-
21
- .divider.horizontal {
22
- width: 100%;
23
- height: 1px;
24
- }
25
-
26
- .divider.vertical {
27
- width: 1px;
28
- height: 100%;
29
- min-height: 16px;
30
- }
31
- </style>
1
+ <script lang="ts">
2
+ interface Props {
3
+ orientation?: 'horizontal' | 'vertical';
4
+ class?: string;
5
+ }
6
+
7
+ let {
8
+ orientation = 'horizontal',
9
+ class: className = ''
10
+ }: Props = $props();
11
+ </script>
12
+
13
+ <div class="divider {orientation} {className}"></div>
14
+
15
+ <style>
16
+ .divider {
17
+ background: var(--glass-divider);
18
+ flex-shrink: 0;
19
+ }
20
+
21
+ .divider.horizontal {
22
+ width: 100%;
23
+ height: 1px;
24
+ }
25
+
26
+ .divider.vertical {
27
+ width: 1px;
28
+ height: 100%;
29
+ min-height: 16px;
30
+ }
31
+ </style>
@@ -1,52 +1,52 @@
1
- <script lang="ts">
2
- import type { Snippet } from 'svelte';
3
-
4
- interface Props {
5
- children: Snippet;
6
- columns?: number | 'auto';
7
- minItemWidth?: string;
8
- spacing?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
9
- class?: string;
10
- }
11
-
12
- let {
13
- children,
14
- columns = 'auto',
15
- minItemWidth = '300px',
16
- spacing = 'md',
17
- class: className = ''
18
- }: Props = $props();
19
-
20
- const spacingMap = {
21
- none: '0',
22
- xs: 'var(--spacing-xs)',
23
- sm: 'var(--spacing-sm)',
24
- md: 'var(--spacing-md)',
25
- lg: 'var(--spacing-lg)',
26
- xl: 'var(--spacing-xl)'
27
- };
28
-
29
- const gridTemplate = $derived(
30
- columns === 'auto'
31
- ? `repeat(auto-fit, minmax(${minItemWidth}, 1fr))`
32
- : `repeat(${columns}, 1fr)`
33
- );
34
- </script>
35
-
36
- <div
37
- class="grid {className}"
38
- style="
39
- --grid-template: {gridTemplate};
40
- --grid-spacing: {spacingMap[spacing]};
41
- "
42
- >
43
- {@render children()}
44
- </div>
45
-
46
- <style>
47
- .grid {
48
- display: grid;
49
- grid-template-columns: var(--grid-template);
50
- gap: var(--grid-spacing);
51
- }
52
- </style>
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ interface Props {
5
+ children: Snippet;
6
+ columns?: number | 'auto';
7
+ minItemWidth?: string;
8
+ spacing?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
9
+ class?: string;
10
+ }
11
+
12
+ let {
13
+ children,
14
+ columns = 'auto',
15
+ minItemWidth = '300px',
16
+ spacing = 'md',
17
+ class: className = ''
18
+ }: Props = $props();
19
+
20
+ const spacingMap = {
21
+ none: '0',
22
+ xs: 'var(--spacing-xs)',
23
+ sm: 'var(--spacing-sm)',
24
+ md: 'var(--spacing-md)',
25
+ lg: 'var(--spacing-lg)',
26
+ xl: 'var(--spacing-xl)'
27
+ };
28
+
29
+ const gridTemplate = $derived(
30
+ columns === 'auto'
31
+ ? `repeat(auto-fit, minmax(${minItemWidth}, 1fr))`
32
+ : `repeat(${columns}, 1fr)`
33
+ );
34
+ </script>
35
+
36
+ <div
37
+ class="grid {className}"
38
+ style="
39
+ --grid-template: {gridTemplate};
40
+ --grid-spacing: {spacingMap[spacing]};
41
+ "
42
+ >
43
+ {@render children()}
44
+ </div>
45
+
46
+ <style>
47
+ .grid {
48
+ display: grid;
49
+ grid-template-columns: var(--grid-template);
50
+ gap: var(--grid-spacing);
51
+ }
52
+ </style>