@nkanish/liquidglass-ui 0.1.0 → 0.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.
package/README.md CHANGED
@@ -11,25 +11,35 @@ LiquidGlass UI brings Apple's beautiful Liquid Glass design language to the web.
11
11
 
12
12
  ## Screenshots
13
13
 
14
- ### Landing Page (Dark Theme)
15
- ![Landing Page](https://raw.githubusercontent.com/nitinkanish/liquidglass-ui/main/docs/assets/docs-landing-dark.png)
14
+ ### Landing Page with Refraction Effect
15
+ ![Landing Page](https://raw.githubusercontent.com/nitinkanish/liquidglass-ui/main/docs/assets/docs-landing-refraction.png)
16
16
 
17
- ### Component Documentation
18
- ![Component Docs](https://raw.githubusercontent.com/nitinkanish/liquidglass-ui/main/docs/assets/docs-component-page.png)
17
+ ### Side-by-Side Comparison with glisse
18
+ ![Comparison](https://raw.githubusercontent.com/nitinkanish/liquidglass-ui/main/docs/assets/comparison-full.png)
19
19
 
20
- ### Mobile View
21
- ![Mobile](https://raw.githubusercontent.com/nitinkanish/liquidglass-ui/main/docs/assets/docs-mobile.png)
20
+ ### Component Documentation
21
+ ![Component Docs](https://raw.githubusercontent.com/nitinkanish/liquidglass-ui/main/docs/assets/docs-component-button.png)
22
22
 
23
23
  ## Key Features
24
24
 
25
25
  - **57 Components** - Comprehensive UI toolkit with 41 component files
26
- - **Authentic Glass Effect** - Backdrop blur with SVG displacement filters
26
+ - **Authentic Glass Effect** - Glisse-compatible SVG refraction with edge lensing, chromatic aberration, and specular highlights
27
27
  - **Dark Mode** - Automatic light/dark theme switching
28
28
  - **Accessible** - Full ARIA support and keyboard navigation
29
29
  - **TypeScript** - Complete type definitions
30
30
  - **Zero Dependencies** - Only React as peer dependency
31
31
  - **86 Tests** - Comprehensive test coverage
32
32
 
33
+ ## Glass Refraction
34
+
35
+ The glass refraction effect is based on [glisse](https://github.com/0kzh/glisse) (MIT License) by Kelvin Zhang. Enable it on any Glass component:
36
+
37
+ ```tsx
38
+ <Glass refraction refractionDepth={8} refractionDome={4} shine={0.3}>
39
+ Content with edge refraction effect
40
+ </Glass>
41
+ ```
42
+
33
43
  ## Quick Start
34
44
 
35
45
  ```bash
@@ -54,7 +64,7 @@ function App() {
54
64
 
55
65
  ## Documentation
56
66
 
57
- See the full documentation and live demos: [Documentation Site](https://nitinkanish.github.io/liquidglass-ui/)
67
+ See the full documentation and live demos: [Documentation Site](https://liquidglass-ui-docs.vercel.app/)
58
68
 
59
69
  ## Repository Structure
60
70
 
@@ -0,0 +1,41 @@
1
+ # Third Party Notices
2
+
3
+ This file contains attributions for third-party code used in LiquidGlass UI.
4
+
5
+ ## glisse
6
+
7
+ The glass refraction effect implementation is based on [glisse](https://github.com/0kzh/glisse).
8
+
9
+ ```
10
+ MIT License
11
+
12
+ Copyright (c) 2024 Kelvin Zhang
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ ```
32
+
33
+ ### Attribution
34
+
35
+ The following files contain code derived from glisse:
36
+
37
+ - `src/hooks/use-glisse-effect.ts` - SVG displacement map generation and filter chain
38
+ - `src/components/Glass.tsx` - Refraction effect integration
39
+
40
+ The implementation ports glisse's displacement map generation algorithm (lensMap function),
41
+ SVG filter construction (buildFilter), and PNG encoding for feImage elements.