glasslikeui 0.2.2 → 1.0.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 (79) hide show
  1. package/README.md +214 -0
  2. package/dist/actions/a11ySync.d.ts +9 -0
  3. package/dist/actions/a11ySync.js +49 -0
  4. package/dist/actions/deviceMotion.d.ts +31 -0
  5. package/dist/actions/deviceMotion.js +142 -0
  6. package/dist/actions/dragSnap.d.ts +47 -0
  7. package/dist/actions/dragSnap.js +222 -0
  8. package/dist/actions/index.d.ts +5 -0
  9. package/dist/actions/index.js +5 -0
  10. package/dist/actions/scrollEdge.d.ts +21 -0
  11. package/dist/actions/scrollEdge.js +61 -0
  12. package/dist/actions/viewTransition.d.ts +23 -0
  13. package/dist/actions/viewTransition.js +34 -0
  14. package/dist/components/glass/Glass.svelte +164 -0
  15. package/dist/components/glass/Glass.svelte.d.ts +19 -0
  16. package/dist/components/glass/GlassCard.svelte +12 -5
  17. package/dist/components/glass/GlassCard.svelte.d.ts +4 -2
  18. package/dist/components/glass/GlassDimLayer.svelte +37 -0
  19. package/dist/components/glass/GlassDimLayer.svelte.d.ts +8 -0
  20. package/dist/components/glass/GlassEffectContainer.svelte +58 -0
  21. package/dist/components/glass/GlassEffectContainer.svelte.d.ts +12 -0
  22. package/dist/components/glass/GlassMorph.svelte +42 -0
  23. package/dist/components/glass/GlassMorph.svelte.d.ts +10 -0
  24. package/dist/components/glass/GlassSection.svelte +11 -5
  25. package/dist/components/glass/GlassSection.svelte.d.ts +4 -2
  26. package/dist/components/glass/LensFilters.svelte +41 -0
  27. package/dist/components/glass/LensFilters.svelte.d.ts +18 -0
  28. package/dist/components/glass/Sheet.svelte +70 -40
  29. package/dist/components/glass/Sheet.svelte.d.ts +6 -2
  30. package/dist/components/glass/index.d.ts +5 -5
  31. package/dist/components/glass/index.js +5 -5
  32. package/dist/components/index.d.ts +1 -1
  33. package/dist/components/index.js +1 -1
  34. package/dist/components/interactive/Badge.svelte +3 -11
  35. package/dist/components/interactive/Badge.svelte.d.ts +2 -2
  36. package/dist/components/interactive/Button.svelte +9 -32
  37. package/dist/components/interactive/Button.svelte.d.ts +4 -4
  38. package/dist/components/interactive/IconButton.svelte +3 -14
  39. package/dist/components/interactive/IconButton.svelte.d.ts +4 -4
  40. package/dist/components/interactive/TabView.svelte +5 -4
  41. package/dist/components/interactive/TabView.svelte.d.ts +1 -1
  42. package/dist/components/layout/Divider.svelte.d.ts +1 -1
  43. package/dist/components/layout/Grid.svelte.d.ts +1 -1
  44. package/dist/components/layout/HStack.svelte.d.ts +1 -1
  45. package/dist/components/layout/ScrollView.svelte +27 -4
  46. package/dist/components/layout/ScrollView.svelte.d.ts +5 -1
  47. package/dist/components/layout/Spacer.svelte.d.ts +1 -1
  48. package/dist/components/layout/VStack.svelte.d.ts +1 -1
  49. package/dist/components/layout/ZStack.svelte.d.ts +1 -1
  50. package/dist/components/list/List.svelte +3 -3
  51. package/dist/components/list/List.svelte.d.ts +1 -1
  52. package/dist/components/list/ListRow.svelte.d.ts +1 -1
  53. package/dist/components/media/SymbolImage.svelte.d.ts +1 -1
  54. package/dist/components/navigation/NavigationBar.svelte +113 -24
  55. package/dist/components/navigation/NavigationBar.svelte.d.ts +2 -1
  56. package/dist/components/navigation/NavigationLink.svelte.d.ts +1 -1
  57. package/dist/components/typography/Text.svelte +3 -2
  58. package/dist/components/typography/Text.svelte.d.ts +2 -2
  59. package/dist/constants/colors.js +2 -2
  60. package/dist/constants/index.d.ts +1 -5
  61. package/dist/constants/index.js +1 -5
  62. package/dist/constants/sizes.js +4 -4
  63. package/dist/constants/variants.d.ts +23 -0
  64. package/dist/constants/variants.js +18 -0
  65. package/dist/icons/index.js +10 -7
  66. package/dist/index.d.ts +2 -4
  67. package/dist/index.js +2 -7
  68. package/dist/styles/glasslikeui.css +192 -0
  69. package/dist/styles/lens.css +93 -0
  70. package/dist/styles/squircle.css +17 -0
  71. package/dist/styles/typography.css +27 -0
  72. package/dist/test-setup.d.ts +1 -0
  73. package/dist/test-setup.js +6 -0
  74. package/package.json +19 -7
  75. package/dist/components/glass/LiquidGlass.svelte +0 -123
  76. package/dist/components/glass/LiquidGlass.svelte.d.ts +0 -17
  77. package/dist/constants/materials.d.ts +0 -13
  78. package/dist/constants/materials.js +0 -43
  79. package/dist/styles/liquidglass.css +0 -139
@@ -0,0 +1,58 @@
1
+ <!--
2
+ Groups adjacent glass surfaces so they read as a single merged chrome.
3
+ Children inherit the container's gap spacing and layout direction.
4
+ -->
5
+ <script lang="ts">
6
+ import type { Snippet } from 'svelte';
7
+ import { SPACING, type Spacing } from '../../constants';
8
+
9
+ interface Props {
10
+ children: Snippet;
11
+ spacing?: Spacing;
12
+ direction?: 'horizontal' | 'vertical';
13
+ merge?: boolean;
14
+ class?: string;
15
+ }
16
+
17
+ let {
18
+ children,
19
+ spacing = 'xs',
20
+ direction = 'horizontal',
21
+ merge = true,
22
+ class: className = ''
23
+ }: Props = $props();
24
+ </script>
25
+
26
+ <div
27
+ class="glass-effect-container {direction} {className}"
28
+ class:is-merged={merge}
29
+ style="--container-gap: {SPACING[spacing]};"
30
+ >
31
+ {@render children()}
32
+ </div>
33
+
34
+ <style>
35
+ .glass-effect-container {
36
+ display: inline-flex;
37
+ gap: var(--container-gap);
38
+ position: relative;
39
+ isolation: isolate;
40
+ }
41
+ .glass-effect-container.vertical {
42
+ flex-direction: column;
43
+ }
44
+ .glass-effect-container.horizontal {
45
+ flex-direction: row;
46
+ }
47
+ /* In merged mode, individual children drop their own shadow so the
48
+ container's shared drop shadow reads as one elevated surface. */
49
+ .glass-effect-container.is-merged :global(.glass-surface.has-shadow) {
50
+ box-shadow: none;
51
+ }
52
+ .glass-effect-container.is-merged {
53
+ box-shadow:
54
+ 0 8px 32px -8px var(--glass-shadow),
55
+ 0 2px 8px -2px var(--glass-shadow);
56
+ border-radius: var(--glass-radius-lg);
57
+ }
58
+ </style>
@@ -0,0 +1,12 @@
1
+ import type { Snippet } from 'svelte';
2
+ import { type Spacing } from '../../constants';
3
+ interface Props {
4
+ children: Snippet;
5
+ spacing?: Spacing;
6
+ direction?: 'horizontal' | 'vertical';
7
+ merge?: boolean;
8
+ class?: string;
9
+ }
10
+ declare const GlassEffectContainer: import("svelte").Component<Props, {}, string>;
11
+ type GlassEffectContainer = ReturnType<typeof GlassEffectContainer>;
12
+ export default GlassEffectContainer;
@@ -0,0 +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>
@@ -0,0 +1,10 @@
1
+ import type { Snippet } from 'svelte';
2
+ interface Props {
3
+ id: string;
4
+ children: Snippet;
5
+ tag?: 'div' | 'span' | 'section';
6
+ class?: string;
7
+ }
8
+ declare const GlassMorph: import("svelte").Component<Props, {}, string>;
9
+ type GlassMorph = ReturnType<typeof GlassMorph>;
10
+ export default GlassMorph;
@@ -1,12 +1,17 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
- import LiquidGlass from './LiquidGlass.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.
4
8
 
5
9
  interface Props {
6
10
  children: Snippet;
7
11
  title?: string;
8
12
  subtitle?: string;
9
- material?: 'ultraThin' | 'thin' | 'regular' | 'thick' | 'ultraThick';
13
+ variant?: GlassVariant;
14
+ intensity?: GlassIntensity;
10
15
  fullWidth?: boolean;
11
16
  class?: string;
12
17
  }
@@ -15,7 +20,8 @@
15
20
  children,
16
21
  title = '',
17
22
  subtitle = '',
18
- material = 'thin',
23
+ variant = 'regular',
24
+ intensity = 'subtle',
19
25
  fullWidth = false,
20
26
  class: className = ''
21
27
  }: Props = $props();
@@ -33,9 +39,9 @@
33
39
  </div>
34
40
  {/if}
35
41
 
36
- <LiquidGlass {material} padding="lg" cornerRadius="xl">
42
+ <Glass {variant} {intensity} padding="lg" cornerRadius="xl">
37
43
  {@render children()}
38
- </LiquidGlass>
44
+ </Glass>
39
45
  </section>
40
46
 
41
47
  <style>
@@ -1,12 +1,14 @@
1
1
  import type { Snippet } from 'svelte';
2
+ import type { GlassVariant, GlassIntensity } from '../../constants/variants';
2
3
  interface Props {
3
4
  children: Snippet;
4
5
  title?: string;
5
6
  subtitle?: string;
6
- material?: 'ultraThin' | 'thin' | 'regular' | 'thick' | 'ultraThick';
7
+ variant?: GlassVariant;
8
+ intensity?: GlassIntensity;
7
9
  fullWidth?: boolean;
8
10
  class?: string;
9
11
  }
10
- declare const GlassSection: import("svelte").Component<Props, {}, "">;
12
+ declare const GlassSection: import("svelte").Component<Props, {}, string>;
11
13
  type GlassSection = ReturnType<typeof GlassSection>;
12
14
  export default GlassSection;
@@ -0,0 +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>
@@ -0,0 +1,18 @@
1
+ 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> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const LensFilters: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, string>;
17
+ type LensFilters = InstanceType<typeof LensFilters>;
18
+ export default LensFilters;
@@ -1,8 +1,12 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
3
  import { HStack, Spacer } from '../layout';
4
+ import {
5
+ dragSnap,
6
+ detentFractions,
7
+ type SheetDetentName
8
+ } from '../../actions/dragSnap';
4
9
 
5
- // Browser detection without SvelteKit dependency
6
10
  const isBrowser = typeof window !== 'undefined';
7
11
 
8
12
  interface Props {
@@ -10,8 +14,11 @@
10
14
  title?: string;
11
15
  children: Snippet;
12
16
  onClose?: () => void;
13
- size?: 'small' | 'medium' | 'large' | 'fullscreen';
17
+ onDetentChange?: (name: SheetDetentName) => void;
18
+ detents?: readonly SheetDetentName[];
19
+ initialDetent?: SheetDetentName;
14
20
  showHandle?: boolean;
21
+ draggable?: boolean;
15
22
  class?: string;
16
23
  }
17
24
 
@@ -20,11 +27,24 @@
20
27
  title = '',
21
28
  children,
22
29
  onClose,
23
- size = 'large',
30
+ onDetentChange,
31
+ detents = ['medium', 'large'],
32
+ initialDetent = 'medium',
24
33
  showHandle = true,
34
+ draggable = true,
25
35
  class: className = ''
26
36
  }: Props = $props();
27
37
 
38
+ const fractions = $derived(detentFractions(detents));
39
+ const initialIndex = $derived(Math.max(0, detents.indexOf(initialDetent)));
40
+
41
+ let currentIndex = $state(0);
42
+ let sheetEl = $state<HTMLElement | undefined>();
43
+
44
+ $effect(() => {
45
+ currentIndex = initialIndex;
46
+ });
47
+
28
48
  function close() {
29
49
  isOpen = false;
30
50
  onClose?.();
@@ -45,6 +65,12 @@
45
65
  }
46
66
  }
47
67
 
68
+ function handleSnap(index: number) {
69
+ currentIndex = index;
70
+ const name = detents[index];
71
+ if (name) onDetentChange?.(name);
72
+ }
73
+
48
74
  $effect(() => {
49
75
  if (isBrowser && isOpen) {
50
76
  document.body.style.overflow = 'hidden';
@@ -67,9 +93,22 @@
67
93
  onkeydown={(e) => e.key === 'Escape' && close()}
68
94
  role="presentation"
69
95
  >
70
- <div class="sheet-container {className} size-{size}" class:open={isOpen}>
96
+ <div
97
+ bind:this={sheetEl}
98
+ class="sheet-container {className}"
99
+ class:open={isOpen}
100
+ >
71
101
  {#if showHandle}
72
- <div class="sheet-handle-container">
102
+ <div
103
+ class="sheet-handle-container"
104
+ use:dragSnap={{
105
+ target: sheetEl,
106
+ detents: fractions,
107
+ initial: currentIndex,
108
+ disabled: !draggable || fractions.length < 2,
109
+ onSnap: handleSnap
110
+ }}
111
+ >
73
112
  <div class="sheet-handle"></div>
74
113
  </div>
75
114
  {/if}
@@ -78,7 +117,17 @@
78
117
  <header class="sheet-header">
79
118
  <HStack alignment="center">
80
119
  <button class="sheet-close-btn" onclick={close} aria-label="Close">
81
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
120
+ <svg
121
+ xmlns="http://www.w3.org/2000/svg"
122
+ width="20"
123
+ height="20"
124
+ viewBox="0 0 24 24"
125
+ fill="none"
126
+ stroke="currentColor"
127
+ stroke-width="2"
128
+ stroke-linecap="round"
129
+ stroke-linejoin="round"
130
+ >
82
131
  <polyline points="15 18 9 12 15 6"></polyline>
83
132
  </svg>
84
133
  <span>Back</span>
@@ -117,51 +166,38 @@
117
166
  }
118
167
 
119
168
  .sheet-container {
169
+ --sheet-y: 100vh;
120
170
  position: fixed;
121
171
  left: 0;
122
172
  right: 0;
123
- bottom: 0;
173
+ top: 0;
174
+ height: 100vh;
175
+ margin: 0 auto;
124
176
  background: var(--glass-sheet-bg);
125
- backdrop-filter: blur(60px) saturate(2);
126
- -webkit-backdrop-filter: blur(60px) saturate(2);
177
+ backdrop-filter: blur(var(--glass-blur-nav)) saturate(var(--glass-saturation));
178
+ -webkit-backdrop-filter: blur(var(--glass-blur-nav)) saturate(var(--glass-saturation));
127
179
  border-radius: var(--glass-radius-xl) var(--glass-radius-xl) 0 0;
128
180
  overflow: hidden;
129
181
  display: flex;
130
182
  flex-direction: column;
131
- transform: translateY(100%);
183
+ transform: translateY(var(--sheet-y));
132
184
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
133
185
  z-index: 1001;
134
186
  border-top: 1px solid var(--glass-border);
135
187
  box-shadow:
136
188
  0 -8px 32px -8px var(--glass-shadow),
137
189
  inset 0 1px 0 0 var(--glass-highlight);
138
- }
139
-
140
- .sheet-container.open {
141
- transform: translateY(0);
142
- }
143
-
144
- .sheet-container.size-small {
145
- top: 60%;
146
- }
147
-
148
- .sheet-container.size-medium {
149
- top: 40%;
150
- }
151
-
152
- .sheet-container.size-large {
153
- top: 10%;
154
- }
155
-
156
- .sheet-container.size-fullscreen {
157
- top: 0;
158
- border-radius: 0;
190
+ touch-action: none;
159
191
  }
160
192
 
161
193
  .sheet-handle-container {
162
194
  display: flex;
163
195
  justify-content: center;
164
196
  padding: 8px 0;
197
+ cursor: grab;
198
+ }
199
+ .sheet-handle-container:active {
200
+ cursor: grabbing;
165
201
  }
166
202
 
167
203
  .sheet-handle {
@@ -191,6 +227,7 @@
191
227
  cursor: pointer;
192
228
  padding: 8px 0;
193
229
  transition: opacity var(--transition-fast);
230
+ font-family: var(--font-system);
194
231
  }
195
232
 
196
233
  .sheet-close-btn:hover {
@@ -206,6 +243,7 @@
206
243
  font-weight: 600;
207
244
  color: var(--color-text);
208
245
  text-align: center;
246
+ font-family: var(--font-system);
209
247
  }
210
248
 
211
249
  .sheet-spacer {
@@ -217,20 +255,12 @@
217
255
  overflow-y: auto;
218
256
  overflow-x: hidden;
219
257
  -webkit-overflow-scrolling: touch;
258
+ font-family: var(--font-system);
220
259
  }
221
260
 
222
261
  @media (min-width: 769px) {
223
262
  .sheet-container {
224
- left: 50%;
225
- right: auto;
226
- transform: translateX(-50%) translateY(100%);
227
- width: 100%;
228
263
  max-width: 900px;
229
- border-radius: var(--glass-radius-xl) var(--glass-radius-xl) 0 0;
230
- }
231
-
232
- .sheet-container.open {
233
- transform: translateX(-50%) translateY(0);
234
264
  }
235
265
  }
236
266
  </style>
@@ -1,13 +1,17 @@
1
1
  import type { Snippet } from 'svelte';
2
+ import { type SheetDetentName } from '../../actions/dragSnap';
2
3
  interface Props {
3
4
  isOpen?: boolean;
4
5
  title?: string;
5
6
  children: Snippet;
6
7
  onClose?: () => void;
7
- size?: 'small' | 'medium' | 'large' | 'fullscreen';
8
+ onDetentChange?: (name: SheetDetentName) => void;
9
+ detents?: readonly SheetDetentName[];
10
+ initialDetent?: SheetDetentName;
8
11
  showHandle?: boolean;
12
+ draggable?: boolean;
9
13
  class?: string;
10
14
  }
11
- declare const Sheet: import("svelte").Component<Props, {}, "isOpen">;
15
+ declare const Sheet: import("svelte").Component<Props, {}, string>;
12
16
  type Sheet = ReturnType<typeof Sheet>;
13
17
  export default Sheet;
@@ -1,8 +1,8 @@
1
- /**
2
- * Glass Effect Components
3
- * Components with iOS-style liquid glass morphism effects
4
- */
5
- export { default as LiquidGlass } from './LiquidGlass.svelte';
1
+ export { default as Glass } from './Glass.svelte';
6
2
  export { default as GlassCard } from './GlassCard.svelte';
7
3
  export { default as GlassSection } from './GlassSection.svelte';
8
4
  export { default as Sheet } from './Sheet.svelte';
5
+ export { default as LensFilters } from './LensFilters.svelte';
6
+ export { default as GlassDimLayer } from './GlassDimLayer.svelte';
7
+ export { default as GlassEffectContainer } from './GlassEffectContainer.svelte';
8
+ export { default as GlassMorph } from './GlassMorph.svelte';
@@ -1,8 +1,8 @@
1
- /**
2
- * Glass Effect Components
3
- * Components with iOS-style liquid glass morphism effects
4
- */
5
- export { default as LiquidGlass } from './LiquidGlass.svelte';
1
+ export { default as Glass } from './Glass.svelte';
6
2
  export { default as GlassCard } from './GlassCard.svelte';
7
3
  export { default as GlassSection } from './GlassSection.svelte';
8
4
  export { default as Sheet } from './Sheet.svelte';
5
+ export { default as LensFilters } from './LensFilters.svelte';
6
+ export { default as GlassDimLayer } from './GlassDimLayer.svelte';
7
+ export { default as GlassEffectContainer } from './GlassEffectContainer.svelte';
8
+ export { default as GlassMorph } from './GlassMorph.svelte';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * LiquidGlass Components
2
+ * Glass Components
3
3
  * All component exports
4
4
  */
5
5
  export * from './layout';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * LiquidGlass Components
2
+ * Glass Components
3
3
  * All component exports
4
4
  */
5
5
  // Layout
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  interface Props {
3
3
  label: string;
4
- variant?: 'default' | 'accent' | 'glass';
4
+ variant?: 'default' | 'accent';
5
5
  size?: 'sm' | 'md';
6
6
  class?: string;
7
7
  }
@@ -45,16 +45,8 @@
45
45
  }
46
46
 
47
47
  .badge.variant-accent {
48
- background: rgba(0, 113, 227, 0.15);
48
+ background: var(--color-accent-15);
49
49
  color: var(--color-accent);
50
- border: 1px solid rgba(0, 113, 227, 0.2);
51
- }
52
-
53
- .badge.variant-glass {
54
- background: var(--glass-button-bg);
55
- backdrop-filter: blur(8px);
56
- -webkit-backdrop-filter: blur(8px);
57
- color: var(--color-text);
58
- border: 1px solid var(--glass-border);
50
+ border: 1px solid var(--color-accent-25);
59
51
  }
60
52
  </style>
@@ -1,9 +1,9 @@
1
1
  interface Props {
2
2
  label: string;
3
- variant?: 'default' | 'accent' | 'glass';
3
+ variant?: 'default' | 'accent';
4
4
  size?: 'sm' | 'md';
5
5
  class?: string;
6
6
  }
7
- declare const Badge: import("svelte").Component<Props, {}, "">;
7
+ declare const Badge: import("svelte").Component<Props, {}, string>;
8
8
  type Badge = ReturnType<typeof Badge>;
9
9
  export default Badge;
@@ -3,12 +3,12 @@
3
3
 
4
4
  interface Props {
5
5
  children: Snippet;
6
- variant?: 'filled' | 'glass' | 'outlined' | 'plain' | 'tinted' | 'destructive';
6
+ variant?: 'filled' | 'outlined' | 'plain' | 'tinted' | 'destructive';
7
7
  size?: 'sm' | 'md' | 'lg';
8
8
  fullWidth?: boolean;
9
9
  disabled?: boolean;
10
- href?: string;
11
- onclick?: (e: MouseEvent) => void;
10
+ href?: string | undefined;
11
+ onclick?: ((e: MouseEvent) => void) | undefined;
12
12
  class?: string;
13
13
  }
14
14
 
@@ -106,29 +106,6 @@
106
106
  box-shadow: 0 2px 10px -4px var(--color-accent-50);
107
107
  }
108
108
 
109
- /* Glass variant */
110
- .button.variant-glass {
111
- background: var(--glass-button-bg);
112
- backdrop-filter: blur(20px) saturate(1.8);
113
- -webkit-backdrop-filter: blur(20px) saturate(1.8);
114
- color: var(--color-text);
115
- border: 1px solid var(--glass-border);
116
- box-shadow:
117
- inset 0 1px 0 0 var(--glass-highlight),
118
- 0 4px 16px -4px var(--glass-shadow);
119
- }
120
-
121
- .button.variant-glass:hover {
122
- background: var(--glass-button-hover);
123
- box-shadow:
124
- inset 0 1px 0 0 var(--glass-highlight),
125
- 0 8px 24px -6px var(--glass-shadow);
126
- }
127
-
128
- .button.variant-glass:active {
129
- background: var(--glass-active-bg);
130
- }
131
-
132
109
  /* Outlined variant */
133
110
  .button.variant-outlined {
134
111
  background: transparent;
@@ -174,18 +151,18 @@
174
151
 
175
152
  /* Destructive variant */
176
153
  .button.variant-destructive {
177
- background: var(--color-danger, #ef4444);
154
+ background: var(--color-danger);
178
155
  color: white;
179
- box-shadow: 0 4px 16px -4px color-mix(in srgb, var(--color-danger, #ef4444) 50%, transparent);
156
+ box-shadow: 0 4px 16px -4px color-mix(in srgb, var(--color-danger) 50%, transparent);
180
157
  }
181
158
 
182
159
  .button.variant-destructive:hover {
183
- background: var(--color-danger-hover, #dc2626);
184
- box-shadow: 0 8px 28px -6px color-mix(in srgb, var(--color-danger, #ef4444) 50%, transparent);
160
+ background: var(--color-danger-hover);
161
+ box-shadow: 0 8px 28px -6px color-mix(in srgb, var(--color-danger) 50%, transparent);
185
162
  }
186
163
 
187
164
  .button.variant-destructive:active {
188
- background: color-mix(in srgb, var(--color-danger, #ef4444) 85%, black);
189
- box-shadow: 0 2px 10px -4px color-mix(in srgb, var(--color-danger, #ef4444) 50%, transparent);
165
+ background: var(--color-danger-active);
166
+ box-shadow: 0 2px 10px -4px color-mix(in srgb, var(--color-danger) 50%, transparent);
190
167
  }
191
168
  </style>
@@ -1,14 +1,14 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  interface Props {
3
3
  children: Snippet;
4
- variant?: 'filled' | 'glass' | 'outlined' | 'plain' | 'tinted' | 'destructive';
4
+ variant?: 'filled' | 'outlined' | 'plain' | 'tinted' | 'destructive';
5
5
  size?: 'sm' | 'md' | 'lg';
6
6
  fullWidth?: boolean;
7
7
  disabled?: boolean;
8
- href?: string;
9
- onclick?: (e: MouseEvent) => void;
8
+ href?: string | undefined;
9
+ onclick?: ((e: MouseEvent) => void) | undefined;
10
10
  class?: string;
11
11
  }
12
- declare const Button: import("svelte").Component<Props, {}, "">;
12
+ declare const Button: import("svelte").Component<Props, {}, string>;
13
13
  type Button = ReturnType<typeof Button>;
14
14
  export default Button;