glasslikeui 1.1.0 → 1.2.1
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 -21
- package/README.md +215 -215
- package/dist/components/glass/Glass.svelte +165 -164
- package/dist/components/glass/GlassCard.svelte +71 -71
- package/dist/components/glass/GlassDimLayer.svelte +37 -37
- package/dist/components/glass/GlassEffectContainer.svelte +58 -58
- package/dist/components/glass/GlassMorph.svelte +42 -42
- package/dist/components/glass/GlassSection.svelte +82 -82
- package/dist/components/glass/LensFilters.svelte +41 -41
- package/dist/components/glass/Sheet.svelte +261 -266
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/interactive/Badge.svelte +52 -52
- package/dist/components/interactive/Button.svelte +168 -168
- package/dist/components/interactive/IconButton.svelte +74 -74
- package/dist/components/interactive/TabView.svelte +1 -1
- package/dist/components/layout/Divider.svelte +31 -31
- package/dist/components/layout/Grid.svelte +52 -52
- package/dist/components/layout/HStack.svelte +76 -76
- package/dist/components/layout/ScrollView.svelte +84 -83
- package/dist/components/layout/Spacer.svelte +18 -18
- package/dist/components/layout/VStack.svelte +56 -56
- package/dist/components/layout/ZStack.svelte +51 -51
- package/dist/components/list/List.svelte +50 -50
- package/dist/components/list/ListRow.svelte +181 -181
- package/dist/components/media/SymbolImage.svelte +46 -46
- package/dist/components/menu/Menu.svelte +189 -0
- package/dist/components/menu/Menu.svelte.d.ts +10 -0
- package/dist/components/menu/MenuItem.svelte +114 -0
- package/dist/components/menu/MenuItem.svelte.d.ts +12 -0
- package/dist/components/menu/index.d.ts +6 -0
- package/dist/components/menu/index.js +6 -0
- package/dist/components/navigation/NavigationBar.svelte +195 -195
- package/dist/components/navigation/NavigationLink.svelte +45 -45
- package/dist/components/typography/Text.svelte +98 -98
- package/dist/icons/index.js +4 -1
- package/dist/styles/glasslikeui.css +192 -192
- package/dist/styles/lens.css +93 -93
- package/dist/styles/squircle.css +17 -17
- package/dist/styles/typography.css +27 -27
- package/package.json +50 -50
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Marks a subtree with a view-transition-name so that calls to
|
|
3
|
-
withGlassTransition() animate matched glassIds across route or state
|
|
4
|
-
changes. A no-op on browsers without View Transitions API.
|
|
5
|
-
-->
|
|
6
|
-
<script lang="ts">
|
|
7
|
-
import type { Snippet } from 'svelte';
|
|
8
|
-
|
|
9
|
-
interface Props {
|
|
10
|
-
id: string;
|
|
11
|
-
children: Snippet;
|
|
12
|
-
tag?: 'div' | 'span' | 'section';
|
|
13
|
-
class?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
let { id, children, tag = 'div', class: className = '' }: Props = $props();
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
{#if tag === 'span'}
|
|
20
|
-
<span class="glass-morph {className}" style="view-transition-name: glass-{id};">
|
|
21
|
-
{@render children()}
|
|
22
|
-
</span>
|
|
23
|
-
{:else if tag === 'section'}
|
|
24
|
-
<section class="glass-morph {className}" style="view-transition-name: glass-{id};">
|
|
25
|
-
{@render children()}
|
|
26
|
-
</section>
|
|
27
|
-
{:else}
|
|
28
|
-
<div class="glass-morph {className}" style="view-transition-name: glass-{id};">
|
|
29
|
-
{@render children()}
|
|
30
|
-
</div>
|
|
31
|
-
{/if}
|
|
32
|
-
|
|
33
|
-
<style>
|
|
34
|
-
.glass-morph {
|
|
35
|
-
/* View Transitions needs a rendered box, so no display: contents here.
|
|
36
|
-
Keep this wrapper transparent to layout by inheriting flow. */
|
|
37
|
-
display: inline;
|
|
38
|
-
}
|
|
39
|
-
.glass-morph:where(div, section) {
|
|
40
|
-
display: block;
|
|
41
|
-
}
|
|
42
|
-
</style>
|
|
1
|
+
<!--
|
|
2
|
+
Marks a subtree with a view-transition-name so that calls to
|
|
3
|
+
withGlassTransition() animate matched glassIds across route or state
|
|
4
|
+
changes. A no-op on browsers without View Transitions API.
|
|
5
|
+
-->
|
|
6
|
+
<script lang="ts">
|
|
7
|
+
import type { Snippet } from 'svelte';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
id: string;
|
|
11
|
+
children: Snippet;
|
|
12
|
+
tag?: 'div' | 'span' | 'section';
|
|
13
|
+
class?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let { id, children, tag = 'div', class: className = '' }: Props = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
{#if tag === 'span'}
|
|
20
|
+
<span class="glass-morph {className}" style="view-transition-name: glass-{id};">
|
|
21
|
+
{@render children()}
|
|
22
|
+
</span>
|
|
23
|
+
{:else if tag === 'section'}
|
|
24
|
+
<section class="glass-morph {className}" style="view-transition-name: glass-{id};">
|
|
25
|
+
{@render children()}
|
|
26
|
+
</section>
|
|
27
|
+
{:else}
|
|
28
|
+
<div class="glass-morph {className}" style="view-transition-name: glass-{id};">
|
|
29
|
+
{@render children()}
|
|
30
|
+
</div>
|
|
31
|
+
{/if}
|
|
32
|
+
|
|
33
|
+
<style>
|
|
34
|
+
.glass-morph {
|
|
35
|
+
/* View Transitions needs a rendered box, so no display: contents here.
|
|
36
|
+
Keep this wrapper transparent to layout by inheriting flow. */
|
|
37
|
+
display: inline;
|
|
38
|
+
}
|
|
39
|
+
.glass-morph:where(div, section) {
|
|
40
|
+
display: block;
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Snippet } from 'svelte';
|
|
3
|
-
import Glass from './Glass.svelte';
|
|
4
|
-
import type { GlassVariant, GlassIntensity } from '../../constants/variants';
|
|
5
|
-
|
|
6
|
-
// Prefer reserving glass for navigation-layer chrome. Content-heavy
|
|
7
|
-
// sections usually read better with a solid or tonal background.
|
|
8
|
-
|
|
9
|
-
interface Props {
|
|
10
|
-
children: Snippet;
|
|
11
|
-
title?: string;
|
|
12
|
-
subtitle?: string;
|
|
13
|
-
variant?: GlassVariant;
|
|
14
|
-
intensity?: GlassIntensity;
|
|
15
|
-
fullWidth?: boolean;
|
|
16
|
-
class?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
let {
|
|
20
|
-
children,
|
|
21
|
-
title = '',
|
|
22
|
-
subtitle = '',
|
|
23
|
-
variant = 'regular',
|
|
24
|
-
intensity = 'subtle',
|
|
25
|
-
fullWidth = false,
|
|
26
|
-
class: className = ''
|
|
27
|
-
}: Props = $props();
|
|
28
|
-
</script>
|
|
29
|
-
|
|
30
|
-
<section class="glass-section {className}" class:full-width={fullWidth}>
|
|
31
|
-
{#if title || subtitle}
|
|
32
|
-
<div class="section-header">
|
|
33
|
-
{#if title}
|
|
34
|
-
<h2 class="section-title">{title}</h2>
|
|
35
|
-
{/if}
|
|
36
|
-
{#if subtitle}
|
|
37
|
-
<p class="section-subtitle">{subtitle}</p>
|
|
38
|
-
{/if}
|
|
39
|
-
</div>
|
|
40
|
-
{/if}
|
|
41
|
-
|
|
42
|
-
<Glass {variant} {intensity} padding="lg" cornerRadius="xl">
|
|
43
|
-
{@render children()}
|
|
44
|
-
</Glass>
|
|
45
|
-
</section>
|
|
46
|
-
|
|
47
|
-
<style>
|
|
48
|
-
.glass-section {
|
|
49
|
-
padding: var(--spacing-xl) var(--spacing-md);
|
|
50
|
-
max-width: var(--max-width-wide);
|
|
51
|
-
margin: 0 auto;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.glass-section.full-width {
|
|
55
|
-
max-width: none;
|
|
56
|
-
padding-left: 0;
|
|
57
|
-
padding-right: 0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.section-header {
|
|
61
|
-
text-align: center;
|
|
62
|
-
margin-bottom: var(--spacing-lg);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.section-title {
|
|
66
|
-
font-size: clamp(2rem, 5vw, 3rem);
|
|
67
|
-
font-weight: 600;
|
|
68
|
-
letter-spacing: -0.02em;
|
|
69
|
-
margin-bottom: var(--spacing-xs);
|
|
70
|
-
background: var(--glass-text-gradient);
|
|
71
|
-
-webkit-background-clip: text;
|
|
72
|
-
-webkit-text-fill-color: transparent;
|
|
73
|
-
background-clip: text;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.section-subtitle {
|
|
77
|
-
font-size: 1.125rem;
|
|
78
|
-
color: var(--color-text-secondary);
|
|
79
|
-
max-width: 600px;
|
|
80
|
-
margin: 0 auto;
|
|
81
|
-
}
|
|
82
|
-
</style>
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import Glass from './Glass.svelte';
|
|
4
|
+
import type { GlassVariant, GlassIntensity } from '../../constants/variants';
|
|
5
|
+
|
|
6
|
+
// Prefer reserving glass for navigation-layer chrome. Content-heavy
|
|
7
|
+
// sections usually read better with a solid or tonal background.
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
children: Snippet;
|
|
11
|
+
title?: string;
|
|
12
|
+
subtitle?: string;
|
|
13
|
+
variant?: GlassVariant;
|
|
14
|
+
intensity?: GlassIntensity;
|
|
15
|
+
fullWidth?: boolean;
|
|
16
|
+
class?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let {
|
|
20
|
+
children,
|
|
21
|
+
title = '',
|
|
22
|
+
subtitle = '',
|
|
23
|
+
variant = 'regular',
|
|
24
|
+
intensity = 'subtle',
|
|
25
|
+
fullWidth = false,
|
|
26
|
+
class: className = ''
|
|
27
|
+
}: Props = $props();
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<section class="glass-section {className}" class:full-width={fullWidth}>
|
|
31
|
+
{#if title || subtitle}
|
|
32
|
+
<div class="section-header">
|
|
33
|
+
{#if title}
|
|
34
|
+
<h2 class="section-title">{title}</h2>
|
|
35
|
+
{/if}
|
|
36
|
+
{#if subtitle}
|
|
37
|
+
<p class="section-subtitle">{subtitle}</p>
|
|
38
|
+
{/if}
|
|
39
|
+
</div>
|
|
40
|
+
{/if}
|
|
41
|
+
|
|
42
|
+
<Glass {variant} {intensity} padding="lg" cornerRadius="xl">
|
|
43
|
+
{@render children()}
|
|
44
|
+
</Glass>
|
|
45
|
+
</section>
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
.glass-section {
|
|
49
|
+
padding: var(--spacing-xl) var(--spacing-md);
|
|
50
|
+
max-width: var(--max-width-wide);
|
|
51
|
+
margin: 0 auto;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.glass-section.full-width {
|
|
55
|
+
max-width: none;
|
|
56
|
+
padding-left: 0;
|
|
57
|
+
padding-right: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.section-header {
|
|
61
|
+
text-align: center;
|
|
62
|
+
margin-bottom: var(--spacing-lg);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.section-title {
|
|
66
|
+
font-size: clamp(2rem, 5vw, 3rem);
|
|
67
|
+
font-weight: 600;
|
|
68
|
+
letter-spacing: -0.02em;
|
|
69
|
+
margin-bottom: var(--spacing-xs);
|
|
70
|
+
background: var(--glass-text-gradient);
|
|
71
|
+
-webkit-background-clip: text;
|
|
72
|
+
-webkit-text-fill-color: transparent;
|
|
73
|
+
background-clip: text;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.section-subtitle {
|
|
77
|
+
font-size: 1.125rem;
|
|
78
|
+
color: var(--color-text-secondary);
|
|
79
|
+
max-width: 600px;
|
|
80
|
+
margin: 0 auto;
|
|
81
|
+
}
|
|
82
|
+
</style>
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Mount once at app root. Provides SVG filter defs used by .glass-surface.has-lensing
|
|
3
|
-
for edge refraction on the frosted backdrop layer.
|
|
4
|
-
-->
|
|
5
|
-
<script lang="ts"></script>
|
|
6
|
-
|
|
7
|
-
<svg class="glass-lens-defs" aria-hidden="true" focusable="false" width="0" height="0">
|
|
8
|
-
<defs>
|
|
9
|
-
<filter id="glass-lens-refract" x="-10%" y="-10%" width="120%" height="120%">
|
|
10
|
-
<feTurbulence
|
|
11
|
-
type="fractalNoise"
|
|
12
|
-
baseFrequency="0.01 0.01"
|
|
13
|
-
numOctaves="2"
|
|
14
|
-
seed="3"
|
|
15
|
-
result="noise"
|
|
16
|
-
/>
|
|
17
|
-
<feGaussianBlur in="noise" stdDeviation="2" result="softNoise" />
|
|
18
|
-
<feDisplacementMap
|
|
19
|
-
in="SourceGraphic"
|
|
20
|
-
in2="softNoise"
|
|
21
|
-
scale="8"
|
|
22
|
-
xChannelSelector="R"
|
|
23
|
-
yChannelSelector="G"
|
|
24
|
-
/>
|
|
25
|
-
</filter>
|
|
26
|
-
|
|
27
|
-
<clipPath id="glass-squircle-path" clipPathUnits="objectBoundingBox">
|
|
28
|
-
<path d="M 0,0.5 C 0,0.08 0.08,0 0.5,0 C 0.92,0 1,0.08 1,0.5 C 1,0.92 0.92,1 0.5,1 C 0.08,1 0,0.92 0,0.5 Z" />
|
|
29
|
-
</clipPath>
|
|
30
|
-
</defs>
|
|
31
|
-
</svg>
|
|
32
|
-
|
|
33
|
-
<style>
|
|
34
|
-
.glass-lens-defs {
|
|
35
|
-
position: absolute;
|
|
36
|
-
width: 0;
|
|
37
|
-
height: 0;
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
pointer-events: none;
|
|
40
|
-
}
|
|
41
|
-
</style>
|
|
1
|
+
<!--
|
|
2
|
+
Mount once at app root. Provides SVG filter defs used by .glass-surface.has-lensing
|
|
3
|
+
for edge refraction on the frosted backdrop layer.
|
|
4
|
+
-->
|
|
5
|
+
<script lang="ts"></script>
|
|
6
|
+
|
|
7
|
+
<svg class="glass-lens-defs" aria-hidden="true" focusable="false" width="0" height="0">
|
|
8
|
+
<defs>
|
|
9
|
+
<filter id="glass-lens-refract" x="-10%" y="-10%" width="120%" height="120%">
|
|
10
|
+
<feTurbulence
|
|
11
|
+
type="fractalNoise"
|
|
12
|
+
baseFrequency="0.01 0.01"
|
|
13
|
+
numOctaves="2"
|
|
14
|
+
seed="3"
|
|
15
|
+
result="noise"
|
|
16
|
+
/>
|
|
17
|
+
<feGaussianBlur in="noise" stdDeviation="2" result="softNoise" />
|
|
18
|
+
<feDisplacementMap
|
|
19
|
+
in="SourceGraphic"
|
|
20
|
+
in2="softNoise"
|
|
21
|
+
scale="8"
|
|
22
|
+
xChannelSelector="R"
|
|
23
|
+
yChannelSelector="G"
|
|
24
|
+
/>
|
|
25
|
+
</filter>
|
|
26
|
+
|
|
27
|
+
<clipPath id="glass-squircle-path" clipPathUnits="objectBoundingBox">
|
|
28
|
+
<path d="M 0,0.5 C 0,0.08 0.08,0 0.5,0 C 0.92,0 1,0.08 1,0.5 C 1,0.92 0.92,1 0.5,1 C 0.08,1 0,0.92 0,0.5 Z" />
|
|
29
|
+
</clipPath>
|
|
30
|
+
</defs>
|
|
31
|
+
</svg>
|
|
32
|
+
|
|
33
|
+
<style>
|
|
34
|
+
.glass-lens-defs {
|
|
35
|
+
position: absolute;
|
|
36
|
+
width: 0;
|
|
37
|
+
height: 0;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
pointer-events: none;
|
|
40
|
+
}
|
|
41
|
+
</style>
|