fancy-ui-svelte 0.7.0 → 0.8.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 (28) hide show
  1. package/README.md +8 -0
  2. package/dist/fancy-ui/fluid-cursor/FluidCursor.svelte +1132 -1111
  3. package/dist/fancy-ui/fluid-cursor/FluidCursor.svelte.d.ts +3 -5
  4. package/dist/fancy-ui/fluid-cursor/FluidCursor.test.js +29 -0
  5. package/dist/fancy-ui/fluid-cursor/README.md +57 -6
  6. package/dist/fancy-ui/fluid-cursor/fluid-shared.d.ts +40 -0
  7. package/dist/fancy-ui/fluid-cursor/fluid-shared.js +125 -0
  8. package/dist/fancy-ui/fluid-cursor/fluid-shared.test.d.ts +1 -0
  9. package/dist/fancy-ui/fluid-cursor/fluid-shared.test.js +39 -0
  10. package/dist/fancy-ui/fluid-cursor/webgpu-engine.d.ts +29 -0
  11. package/dist/fancy-ui/fluid-cursor/webgpu-engine.js +847 -0
  12. package/dist/fancy-ui/frosted-glass/FrostedGlass.svelte +5 -3
  13. package/dist/fancy-ui/frosted-glass/README.md +4 -2
  14. package/dist/fancy-ui/index.d.ts +1 -0
  15. package/dist/fancy-ui/index.js +1 -0
  16. package/dist/fancy-ui/liquid-glass/LiquidGlass.svelte +19 -2
  17. package/dist/fancy-ui/liquid-glass/LiquidGlass.svelte.d.ts +4 -0
  18. package/dist/fancy-ui/liquid-glass/LiquidGlass.test.js +14 -0
  19. package/dist/fancy-ui/liquid-glass/README.md +7 -1
  20. package/dist/fancy-ui/liquid-text/LiquidText.svelte +1151 -0
  21. package/dist/fancy-ui/liquid-text/LiquidText.svelte.d.ts +37 -0
  22. package/dist/fancy-ui/liquid-text/LiquidText.test.d.ts +1 -0
  23. package/dist/fancy-ui/liquid-text/LiquidText.test.js +219 -0
  24. package/dist/fancy-ui/liquid-text/README.md +139 -0
  25. package/dist/fancy-ui/liquid-text/index.d.ts +2 -0
  26. package/dist/fancy-ui/liquid-text/index.js +1 -0
  27. package/dist/fancy-ui/registry.js +124 -0
  28. package/package.json +4 -3
@@ -155,11 +155,13 @@
155
155
  }
156
156
  }
157
157
 
158
- /* Safari can't combine filter:url() with backdrop-filter — fall back to
159
- plain frosted blur */
160
- @supports (-webkit-hyphens: none) {
158
+ /* Safari can't combine filter:url() with backdrop-filter, so it needs a plain-blur
159
+ fallback. -webkit-named-image is a WebKit-only feature query (Chromium and Firefox
160
+ return false). Ship the -webkit- prefixed backdrop-filter too for Safari and iOS 17 and older. */
161
+ @supports (background: -webkit-named-image(i)) {
161
162
  .frosted-glass-filter {
162
163
  filter: none !important;
164
+ -webkit-backdrop-filter: blur(var(--fg-fallback-blur)) saturate(var(--fg-fallback-saturation));
163
165
  backdrop-filter: blur(var(--fg-fallback-blur)) saturate(var(--fg-fallback-saturation));
164
166
  }
165
167
 
@@ -13,8 +13,6 @@ The effect stacks four layers inside a rounded container:
13
13
 
14
14
  An optional conic-gradient border (`border` prop) frames the container.
15
15
 
16
- Safari cannot combine `filter: url()` with `backdrop-filter`, so it falls back to a plain `blur() saturate()` frosted look (tunable via `fallbackBlur` / `fallbackSaturation`).
17
-
18
16
  ## Usage
19
17
 
20
18
  ```svelte
@@ -57,3 +55,7 @@ Safari cannot combine `filter: url()` with `backdrop-filter`, so it falls back t
57
55
  ## Notes
58
56
 
59
57
  - The displacement only shows over content that scrolls or moves behind the glass; over a flat background the effect reads as a subtle frost.
58
+
59
+ ## Browser support
60
+
61
+ Safari (WebKit) cannot combine an SVG `filter: url(#…)` with `backdrop-filter`, so the turbulence displacement silently disappears there. To keep the component usable, FrostedGlass automatically detects Safari (via a WebKit-only `@supports` feature query) and falls back to a plain frosted `blur()` + `saturate()` (both `-webkit-` prefixed and unprefixed), tunable via the `fallbackBlur` and `fallbackSaturation` props. Chromium and Firefox get the full turbulence refraction.
@@ -58,4 +58,5 @@ export * from "./terminal-text/index.js";
58
58
  export * from "./noise-reveal/index.js";
59
59
  export * from "./line-reveal/index.js";
60
60
  export * from "./editorial-engine/index.js";
61
+ export * from "./liquid-text/index.js";
61
62
  export { registry, categories, categoryLabels, categoryDescriptions, getAllComponents, getComponent, getComponentsByStatus, getComponentsByCategory, getComponentsGroupedByCategory, getComponentsGroupedByStatus, searchComponents, getStats, hasComponent, getComponentCategory, } from "./registry.js";
@@ -63,6 +63,7 @@ export * from "./terminal-text/index.js";
63
63
  export * from "./noise-reveal/index.js";
64
64
  export * from "./line-reveal/index.js";
65
65
  export * from "./editorial-engine/index.js";
66
+ export * from "./liquid-text/index.js";
66
67
  // =============================================================================
67
68
  // Registry
68
69
  // =============================================================================
@@ -18,6 +18,10 @@
18
18
  bOffset?: number;
19
19
  scale?: number;
20
20
  frost?: number;
21
+ /** Backdrop blur in pixels for the Safari fallback */
22
+ fallbackBlur?: number;
23
+ /** Backdrop saturation percentage for the Safari fallback */
24
+ fallbackSaturation?: number;
21
25
  class?: string;
22
26
  containerClass?: string;
23
27
  children?: Snippet;
@@ -38,6 +42,8 @@
38
42
  bOffset = 20,
39
43
  scale = -180,
40
44
  frost = 0.05,
45
+ fallbackBlur = 20,
46
+ fallbackSaturation = 180,
41
47
  class: className = "",
42
48
  containerClass = "",
43
49
  children,
@@ -57,8 +63,8 @@
57
63
 
58
64
  let backdropStyle = $derived(
59
65
  filterId
60
- ? `--frost:${frost};border-radius:${radius}px;backdrop-filter:url(#displacementFilter-${filterId});`
61
- : `--frost:${frost};border-radius:${radius}px;`
66
+ ? `--frost:${frost};border-radius:${radius}px;backdrop-filter:url(#displacementFilter-${filterId});--lg-fallback-blur:${fallbackBlur}px;--lg-fallback-saturation:${fallbackSaturation}%;`
67
+ : `--frost:${frost};border-radius:${radius}px;--lg-fallback-blur:${fallbackBlur}px;--lg-fallback-saturation:${fallbackSaturation}%;`
62
68
  );
63
69
 
64
70
  onMount(() => {
@@ -187,6 +193,17 @@
187
193
  0px 16px 56px rgba(17, 17, 26, 0.05) inset;
188
194
  }
189
195
 
196
+ /* Safari cannot resolve SVG url() references inside backdrop-filter, so it needs a
197
+ plain-blur fallback. -webkit-named-image is a WebKit-only feature query (Chromium
198
+ and Firefox return false), so this never overrides Chromium's working SVG filter.
199
+ Ship the -webkit- prefixed backdrop-filter too for Safari and iOS 17 and older. */
200
+ @supports (background: -webkit-named-image(i)) {
201
+ .liquid-glass-effect {
202
+ -webkit-backdrop-filter: blur(var(--lg-fallback-blur)) saturate(var(--lg-fallback-saturation)) !important;
203
+ backdrop-filter: blur(var(--lg-fallback-blur)) saturate(var(--lg-fallback-saturation)) !important;
204
+ }
205
+ }
206
+
190
207
  .liquid-glass-slot {
191
208
  width: 100%;
192
209
  height: 100%;
@@ -14,6 +14,10 @@ interface Props {
14
14
  bOffset?: number;
15
15
  scale?: number;
16
16
  frost?: number;
17
+ /** Backdrop blur in pixels for the Safari fallback */
18
+ fallbackBlur?: number;
19
+ /** Backdrop saturation percentage for the Safari fallback */
20
+ fallbackSaturation?: number;
17
21
  class?: string;
18
22
  containerClass?: string;
19
23
  children?: Snippet;
@@ -45,4 +45,18 @@ describe("LiquidGlass", () => {
45
45
  expect(wrapper.getAttribute("style")).toContain("border-radius");
46
46
  expect(wrapper.getAttribute("style")).toContain("24px");
47
47
  });
48
+ it("exposes Safari fallback CSS variables from props", () => {
49
+ const { container: defaultContainer } = render(LiquidGlass);
50
+ const defaultWrapper = defaultContainer.querySelector(".liquid-glass-effect");
51
+ const defaultStyle = defaultWrapper.getAttribute("style") ?? "";
52
+ expect(defaultStyle).toMatch(/--lg-fallback-blur:\s*20px/);
53
+ expect(defaultStyle).toMatch(/--lg-fallback-saturation:\s*180%/);
54
+ const { container: customContainer } = render(LiquidGlass, {
55
+ props: { fallbackBlur: 8, fallbackSaturation: 120 },
56
+ });
57
+ const customWrapper = customContainer.querySelector(".liquid-glass-effect");
58
+ const customStyle = customWrapper.getAttribute("style") ?? "";
59
+ expect(customStyle).toMatch(/--lg-fallback-blur:\s*8px/);
60
+ expect(customStyle).toMatch(/--lg-fallback-saturation:\s*120%/);
61
+ });
48
62
  });
@@ -20,6 +20,8 @@ A glass-like visual effect using SVG filters for chromatic displacement, creatin
20
20
  | `bOffset` | `number` | `20` | Blue channel offset |
21
21
  | `scale` | `number` | `-180` | Displacement scale |
22
22
  | `frost` | `number` | `0.05` | Frosted overlay opacity |
23
+ | `fallbackBlur` | `number` | `20` | Backdrop blur in pixels for the Safari fallback |
24
+ | `fallbackSaturation` | `number` | `180` | Backdrop saturation percentage for the Safari fallback |
23
25
  | `class` | `string` | `""` | CSS classes for inner container |
24
26
  | `containerClass` | `string` | `""` | CSS classes for outer container |
25
27
 
@@ -31,4 +33,8 @@ A glass-like visual effect using SVG filters for chromatic displacement, creatin
31
33
  </LiquidGlass>
32
34
  ```
33
35
 
34
- **Note**: This component uses `position: fixed` and `backdrop-filter` with SVG filters. Place it over content to see the refraction effect.
36
+ **Note**: This component uses `position: relative` and `backdrop-filter` with SVG filters. Place it over content to see the refraction effect.
37
+
38
+ ## Browser support
39
+
40
+ Safari (WebKit) cannot resolve an SVG `url(#…)` filter reference inside `backdrop-filter`, so the chromatic displacement silently disappears there. To keep the component usable, LiquidGlass automatically detects Safari (via a WebKit-only `@supports` feature query) and falls back to a plain frosted `blur()` + `saturate()` (both `-webkit-` prefixed and unprefixed), tunable via the `fallbackBlur` and `fallbackSaturation` props. Chromium and Firefox get the full chromatic refraction.