glasslikeui 0.2.2 → 1.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.
Files changed (89) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +215 -1
  3. package/dist/actions/a11ySync.d.ts +9 -0
  4. package/dist/actions/a11ySync.js +49 -0
  5. package/dist/actions/deviceMotion.d.ts +31 -0
  6. package/dist/actions/deviceMotion.js +142 -0
  7. package/dist/actions/dragSnap.d.ts +47 -0
  8. package/dist/actions/dragSnap.js +222 -0
  9. package/dist/actions/index.d.ts +5 -0
  10. package/dist/actions/index.js +5 -0
  11. package/dist/actions/scrollEdge.d.ts +21 -0
  12. package/dist/actions/scrollEdge.js +61 -0
  13. package/dist/actions/viewTransition.d.ts +23 -0
  14. package/dist/actions/viewTransition.js +34 -0
  15. package/dist/components/glass/Glass.svelte +164 -0
  16. package/dist/components/glass/Glass.svelte.d.ts +19 -0
  17. package/dist/components/glass/GlassCard.svelte +71 -64
  18. package/dist/components/glass/GlassCard.svelte.d.ts +4 -2
  19. package/dist/components/glass/GlassDimLayer.svelte +37 -0
  20. package/dist/components/glass/GlassDimLayer.svelte.d.ts +8 -0
  21. package/dist/components/glass/GlassEffectContainer.svelte +58 -0
  22. package/dist/components/glass/GlassEffectContainer.svelte.d.ts +12 -0
  23. package/dist/components/glass/GlassMorph.svelte +42 -0
  24. package/dist/components/glass/GlassMorph.svelte.d.ts +10 -0
  25. package/dist/components/glass/GlassSection.svelte +82 -76
  26. package/dist/components/glass/GlassSection.svelte.d.ts +4 -2
  27. package/dist/components/glass/LensFilters.svelte +41 -0
  28. package/dist/components/glass/LensFilters.svelte.d.ts +18 -0
  29. package/dist/components/glass/Sheet.svelte +266 -236
  30. package/dist/components/glass/Sheet.svelte.d.ts +6 -2
  31. package/dist/components/glass/index.d.ts +5 -5
  32. package/dist/components/glass/index.js +5 -5
  33. package/dist/components/index.d.ts +1 -1
  34. package/dist/components/index.js +1 -1
  35. package/dist/components/interactive/Badge.svelte +52 -60
  36. package/dist/components/interactive/Badge.svelte.d.ts +2 -2
  37. package/dist/components/interactive/Button.svelte +168 -191
  38. package/dist/components/interactive/Button.svelte.d.ts +4 -4
  39. package/dist/components/interactive/IconButton.svelte +74 -85
  40. package/dist/components/interactive/IconButton.svelte.d.ts +4 -4
  41. package/dist/components/interactive/TabView.svelte +112 -22
  42. package/dist/components/interactive/TabView.svelte.d.ts +1 -1
  43. package/dist/components/layout/Divider.svelte +31 -31
  44. package/dist/components/layout/Divider.svelte.d.ts +1 -1
  45. package/dist/components/layout/Grid.svelte +52 -52
  46. package/dist/components/layout/Grid.svelte.d.ts +1 -1
  47. package/dist/components/layout/HStack.svelte +76 -76
  48. package/dist/components/layout/HStack.svelte.d.ts +1 -1
  49. package/dist/components/layout/ScrollView.svelte +83 -60
  50. package/dist/components/layout/ScrollView.svelte.d.ts +5 -1
  51. package/dist/components/layout/Spacer.svelte +18 -18
  52. package/dist/components/layout/Spacer.svelte.d.ts +1 -1
  53. package/dist/components/layout/VStack.svelte +56 -56
  54. package/dist/components/layout/VStack.svelte.d.ts +1 -1
  55. package/dist/components/layout/ZStack.svelte +51 -51
  56. package/dist/components/layout/ZStack.svelte.d.ts +1 -1
  57. package/dist/components/list/List.svelte +50 -50
  58. package/dist/components/list/List.svelte.d.ts +1 -1
  59. package/dist/components/list/ListRow.svelte +181 -181
  60. package/dist/components/list/ListRow.svelte.d.ts +1 -1
  61. package/dist/components/media/SymbolImage.svelte +46 -46
  62. package/dist/components/media/SymbolImage.svelte.d.ts +1 -1
  63. package/dist/components/navigation/NavigationBar.svelte +195 -106
  64. package/dist/components/navigation/NavigationBar.svelte.d.ts +2 -1
  65. package/dist/components/navigation/NavigationLink.svelte +45 -45
  66. package/dist/components/navigation/NavigationLink.svelte.d.ts +1 -1
  67. package/dist/components/typography/Text.svelte +98 -97
  68. package/dist/components/typography/Text.svelte.d.ts +2 -2
  69. package/dist/constants/colors.js +2 -2
  70. package/dist/constants/index.d.ts +1 -5
  71. package/dist/constants/index.js +1 -5
  72. package/dist/constants/sizes.js +4 -4
  73. package/dist/constants/variants.d.ts +23 -0
  74. package/dist/constants/variants.js +18 -0
  75. package/dist/icons/index.js +10 -7
  76. package/dist/index.d.ts +2 -4
  77. package/dist/index.js +2 -7
  78. package/dist/styles/glasslikeui.css +192 -0
  79. package/dist/styles/lens.css +93 -0
  80. package/dist/styles/squircle.css +17 -0
  81. package/dist/styles/typography.css +27 -0
  82. package/dist/test-setup.d.ts +1 -0
  83. package/dist/test-setup.js +6 -0
  84. package/package.json +50 -38
  85. package/dist/components/glass/LiquidGlass.svelte +0 -123
  86. package/dist/components/glass/LiquidGlass.svelte.d.ts +0 -17
  87. package/dist/constants/materials.d.ts +0 -13
  88. package/dist/constants/materials.js +0 -43
  89. package/dist/styles/liquidglass.css +0 -139
@@ -1,181 +1,181 @@
1
- <script lang="ts">
2
- import type { Snippet } from 'svelte';
3
- import { HStack } from '../layout';
4
- import { VStack } from '../layout';
5
- import { SymbolImage } from '../media';
6
-
7
- interface Props {
8
- children: Snippet;
9
- leading?: Snippet;
10
- trailing?: Snippet;
11
- subtitle?: string;
12
- showDivider?: boolean;
13
- interactive?: boolean;
14
- href?: string;
15
- onclick?: () => void;
16
- class?: string;
17
- }
18
-
19
- let {
20
- children,
21
- leading,
22
- trailing,
23
- subtitle = '',
24
- showDivider = true,
25
- interactive = false,
26
- href,
27
- onclick,
28
- class: className = ''
29
- }: Props = $props();
30
-
31
- const isInteractive = $derived(interactive || !!href || !!onclick);
32
- </script>
33
-
34
- {#if href}
35
- <a {href} class="list-row {className}" class:interactive={isInteractive} class:has-divider={showDivider}>
36
- <HStack spacing="sm" alignment="center" class="row-content">
37
- {#if leading}
38
- <div class="row-leading">
39
- {@render leading()}
40
- </div>
41
- {/if}
42
-
43
- <VStack spacing="none" alignment="leading" class="row-main">
44
- <div class="row-title">
45
- {@render children()}
46
- </div>
47
- {#if subtitle}
48
- <div class="row-subtitle">{subtitle}</div>
49
- {/if}
50
- </VStack>
51
-
52
- {#if trailing}
53
- <div class="row-trailing">
54
- {@render trailing()}
55
- </div>
56
- {:else if isInteractive}
57
- <SymbolImage name="chevron.right" size="sm" color="tertiary" />
58
- {/if}
59
- </HStack>
60
- </a>
61
- {:else if onclick}
62
- <button class="list-row {className}" class:interactive={isInteractive} class:has-divider={showDivider} {onclick}>
63
- <HStack spacing="sm" alignment="center" class="row-content">
64
- {#if leading}
65
- <div class="row-leading">
66
- {@render leading()}
67
- </div>
68
- {/if}
69
-
70
- <VStack spacing="none" alignment="leading" class="row-main">
71
- <div class="row-title">
72
- {@render children()}
73
- </div>
74
- {#if subtitle}
75
- <div class="row-subtitle">{subtitle}</div>
76
- {/if}
77
- </VStack>
78
-
79
- {#if trailing}
80
- <div class="row-trailing">
81
- {@render trailing()}
82
- </div>
83
- {:else if isInteractive}
84
- <SymbolImage name="chevron.right" size="sm" color="tertiary" />
85
- {/if}
86
- </HStack>
87
- </button>
88
- {:else}
89
- <div class="list-row {className}" class:has-divider={showDivider}>
90
- <HStack spacing="sm" alignment="center" class="row-content">
91
- {#if leading}
92
- <div class="row-leading">
93
- {@render leading()}
94
- </div>
95
- {/if}
96
-
97
- <VStack spacing="none" alignment="leading" class="row-main">
98
- <div class="row-title">
99
- {@render children()}
100
- </div>
101
- {#if subtitle}
102
- <div class="row-subtitle">{subtitle}</div>
103
- {/if}
104
- </VStack>
105
-
106
- {#if trailing}
107
- <div class="row-trailing">
108
- {@render trailing()}
109
- </div>
110
- {/if}
111
- </HStack>
112
- </div>
113
- {/if}
114
-
115
- <style>
116
- .list-row {
117
- display: block;
118
- width: 100%;
119
- padding: 0;
120
- background: transparent;
121
- border: none;
122
- text-decoration: none;
123
- color: inherit;
124
- text-align: left;
125
- font-family: inherit;
126
- cursor: default;
127
- }
128
-
129
- .list-row.interactive {
130
- cursor: pointer;
131
- }
132
-
133
- .list-row.interactive:hover {
134
- background: var(--glass-hover-subtle);
135
- }
136
-
137
- .list-row.interactive:active {
138
- background: var(--glass-active-subtle);
139
- }
140
-
141
- :global(.row-content) {
142
- padding: var(--spacing-sm) var(--spacing-md);
143
- min-height: 44px;
144
- }
145
-
146
- .list-row.has-divider {
147
- border-bottom: 1px solid var(--glass-divider);
148
- }
149
-
150
- .list-row:last-child {
151
- border-bottom: none;
152
- }
153
-
154
- .row-leading {
155
- display: flex;
156
- align-items: center;
157
- justify-content: center;
158
- }
159
-
160
- :global(.row-main) {
161
- flex: 1;
162
- min-width: 0;
163
- }
164
-
165
- .row-title {
166
- font-size: 1rem;
167
- color: var(--color-text);
168
- }
169
-
170
- .row-subtitle {
171
- font-size: 0.8125rem;
172
- color: var(--color-text-secondary);
173
- margin-top: 2px;
174
- }
175
-
176
- .row-trailing {
177
- display: flex;
178
- align-items: center;
179
- color: var(--color-text-tertiary);
180
- }
181
- </style>
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import { HStack } from '../layout';
4
+ import { VStack } from '../layout';
5
+ import { SymbolImage } from '../media';
6
+
7
+ interface Props {
8
+ children: Snippet;
9
+ leading?: Snippet;
10
+ trailing?: Snippet;
11
+ subtitle?: string;
12
+ showDivider?: boolean;
13
+ interactive?: boolean;
14
+ href?: string;
15
+ onclick?: () => void;
16
+ class?: string;
17
+ }
18
+
19
+ let {
20
+ children,
21
+ leading,
22
+ trailing,
23
+ subtitle = '',
24
+ showDivider = true,
25
+ interactive = false,
26
+ href,
27
+ onclick,
28
+ class: className = ''
29
+ }: Props = $props();
30
+
31
+ const isInteractive = $derived(interactive || !!href || !!onclick);
32
+ </script>
33
+
34
+ {#if href}
35
+ <a {href} class="list-row {className}" class:interactive={isInteractive} class:has-divider={showDivider}>
36
+ <HStack spacing="sm" alignment="center" class="row-content">
37
+ {#if leading}
38
+ <div class="row-leading">
39
+ {@render leading()}
40
+ </div>
41
+ {/if}
42
+
43
+ <VStack spacing="none" alignment="leading" class="row-main">
44
+ <div class="row-title">
45
+ {@render children()}
46
+ </div>
47
+ {#if subtitle}
48
+ <div class="row-subtitle">{subtitle}</div>
49
+ {/if}
50
+ </VStack>
51
+
52
+ {#if trailing}
53
+ <div class="row-trailing">
54
+ {@render trailing()}
55
+ </div>
56
+ {:else if isInteractive}
57
+ <SymbolImage name="chevron.right" size="sm" color="tertiary" />
58
+ {/if}
59
+ </HStack>
60
+ </a>
61
+ {:else if onclick}
62
+ <button class="list-row {className}" class:interactive={isInteractive} class:has-divider={showDivider} {onclick}>
63
+ <HStack spacing="sm" alignment="center" class="row-content">
64
+ {#if leading}
65
+ <div class="row-leading">
66
+ {@render leading()}
67
+ </div>
68
+ {/if}
69
+
70
+ <VStack spacing="none" alignment="leading" class="row-main">
71
+ <div class="row-title">
72
+ {@render children()}
73
+ </div>
74
+ {#if subtitle}
75
+ <div class="row-subtitle">{subtitle}</div>
76
+ {/if}
77
+ </VStack>
78
+
79
+ {#if trailing}
80
+ <div class="row-trailing">
81
+ {@render trailing()}
82
+ </div>
83
+ {:else if isInteractive}
84
+ <SymbolImage name="chevron.right" size="sm" color="tertiary" />
85
+ {/if}
86
+ </HStack>
87
+ </button>
88
+ {:else}
89
+ <div class="list-row {className}" class:has-divider={showDivider}>
90
+ <HStack spacing="sm" alignment="center" class="row-content">
91
+ {#if leading}
92
+ <div class="row-leading">
93
+ {@render leading()}
94
+ </div>
95
+ {/if}
96
+
97
+ <VStack spacing="none" alignment="leading" class="row-main">
98
+ <div class="row-title">
99
+ {@render children()}
100
+ </div>
101
+ {#if subtitle}
102
+ <div class="row-subtitle">{subtitle}</div>
103
+ {/if}
104
+ </VStack>
105
+
106
+ {#if trailing}
107
+ <div class="row-trailing">
108
+ {@render trailing()}
109
+ </div>
110
+ {/if}
111
+ </HStack>
112
+ </div>
113
+ {/if}
114
+
115
+ <style>
116
+ .list-row {
117
+ display: block;
118
+ width: 100%;
119
+ padding: 0;
120
+ background: transparent;
121
+ border: none;
122
+ text-decoration: none;
123
+ color: inherit;
124
+ text-align: left;
125
+ font-family: inherit;
126
+ cursor: default;
127
+ }
128
+
129
+ .list-row.interactive {
130
+ cursor: pointer;
131
+ }
132
+
133
+ .list-row.interactive:hover {
134
+ background: var(--glass-hover-subtle);
135
+ }
136
+
137
+ .list-row.interactive:active {
138
+ background: var(--glass-active-subtle);
139
+ }
140
+
141
+ :global(.row-content) {
142
+ padding: var(--spacing-sm) var(--spacing-md);
143
+ min-height: 44px;
144
+ }
145
+
146
+ .list-row.has-divider {
147
+ border-bottom: 1px solid var(--glass-divider);
148
+ }
149
+
150
+ .list-row:last-child {
151
+ border-bottom: none;
152
+ }
153
+
154
+ .row-leading {
155
+ display: flex;
156
+ align-items: center;
157
+ justify-content: center;
158
+ }
159
+
160
+ :global(.row-main) {
161
+ flex: 1;
162
+ min-width: 0;
163
+ }
164
+
165
+ .row-title {
166
+ font-size: 1rem;
167
+ color: var(--color-text);
168
+ }
169
+
170
+ .row-subtitle {
171
+ font-size: 0.8125rem;
172
+ color: var(--color-text-secondary);
173
+ margin-top: 2px;
174
+ }
175
+
176
+ .row-trailing {
177
+ display: flex;
178
+ align-items: center;
179
+ color: var(--color-text-tertiary);
180
+ }
181
+ </style>
@@ -10,6 +10,6 @@ interface Props {
10
10
  onclick?: () => void;
11
11
  class?: string;
12
12
  }
13
- declare const ListRow: import("svelte").Component<Props, {}, "">;
13
+ declare const ListRow: import("svelte").Component<Props, {}, string>;
14
14
  type ListRow = ReturnType<typeof ListRow>;
15
15
  export default ListRow;
@@ -1,46 +1,46 @@
1
- <script lang="ts">
2
- import { ICON_SIZES, TEXT_COLORS } from '../../constants';
3
- import { getIconPath } from '../../icons';
4
- import type { IconSize, TextColor } from '../../constants';
5
-
6
- interface Props {
7
- name: string;
8
- size?: IconSize;
9
- color?: TextColor;
10
- class?: string;
11
- }
12
-
13
- let {
14
- name,
15
- size = 'md',
16
- color = 'primary',
17
- class: className = ''
18
- }: Props = $props();
19
-
20
- // Security Note: iconPath is always from hardcoded ICONS map, never user input
21
- const iconPath = $derived(getIconPath(name));
22
- const pixelSize = $derived(ICON_SIZES[size]);
23
- const colorValue = $derived(TEXT_COLORS[color]);
24
- </script>
25
-
26
- <svg
27
- class="symbol-image {className}"
28
- xmlns="http://www.w3.org/2000/svg"
29
- width={pixelSize}
30
- height={pixelSize}
31
- viewBox="0 0 24 24"
32
- fill="none"
33
- stroke={colorValue}
34
- stroke-width="2"
35
- stroke-linecap="round"
36
- stroke-linejoin="round"
37
- style="color: {colorValue}"
38
- >
39
- {@html iconPath}
40
- </svg>
41
-
42
- <style>
43
- .symbol-image {
44
- flex-shrink: 0;
45
- }
46
- </style>
1
+ <script lang="ts">
2
+ import { ICON_SIZES, TEXT_COLORS } from '../../constants';
3
+ import { getIconPath } from '../../icons';
4
+ import type { IconSize, TextColor } from '../../constants';
5
+
6
+ interface Props {
7
+ name: string;
8
+ size?: IconSize;
9
+ color?: TextColor;
10
+ class?: string;
11
+ }
12
+
13
+ let {
14
+ name,
15
+ size = 'md',
16
+ color = 'primary',
17
+ class: className = ''
18
+ }: Props = $props();
19
+
20
+ // Security Note: iconPath is always from hardcoded ICONS map, never user input
21
+ const iconPath = $derived(getIconPath(name));
22
+ const pixelSize = $derived(ICON_SIZES[size]);
23
+ const colorValue = $derived(TEXT_COLORS[color]);
24
+ </script>
25
+
26
+ <svg
27
+ class="symbol-image {className}"
28
+ xmlns="http://www.w3.org/2000/svg"
29
+ width={pixelSize}
30
+ height={pixelSize}
31
+ viewBox="0 0 24 24"
32
+ fill="none"
33
+ stroke={colorValue}
34
+ stroke-width="2"
35
+ stroke-linecap="round"
36
+ stroke-linejoin="round"
37
+ style="color: {colorValue}"
38
+ >
39
+ {@html iconPath}
40
+ </svg>
41
+
42
+ <style>
43
+ .symbol-image {
44
+ flex-shrink: 0;
45
+ }
46
+ </style>
@@ -5,6 +5,6 @@ interface Props {
5
5
  color?: TextColor;
6
6
  class?: string;
7
7
  }
8
- declare const SymbolImage: import("svelte").Component<Props, {}, "">;
8
+ declare const SymbolImage: import("svelte").Component<Props, {}, string>;
9
9
  type SymbolImage = ReturnType<typeof SymbolImage>;
10
10
  export default SymbolImage;