liqgui 0.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 (51) hide show
  1. package/README.md +190 -0
  2. package/dist/components/glass-accordion.d.ts +15 -0
  3. package/dist/components/glass-accordion.js +173 -0
  4. package/dist/components/glass-avatar.d.ts +9 -0
  5. package/dist/components/glass-avatar.js +98 -0
  6. package/dist/components/glass-badge.d.ts +10 -0
  7. package/dist/components/glass-badge.js +151 -0
  8. package/dist/components/glass-button.d.ts +6 -0
  9. package/dist/components/glass-button.js +124 -0
  10. package/dist/components/glass-card.d.ts +8 -0
  11. package/dist/components/glass-card.js +102 -0
  12. package/dist/components/glass-dropdown.d.ts +12 -0
  13. package/dist/components/glass-dropdown.js +182 -0
  14. package/dist/components/glass-input.d.ts +8 -0
  15. package/dist/components/glass-input.js +151 -0
  16. package/dist/components/glass-modal.d.ts +11 -0
  17. package/dist/components/glass-modal.js +128 -0
  18. package/dist/components/glass-navbar.d.ts +6 -0
  19. package/dist/components/glass-navbar.js +84 -0
  20. package/dist/components/glass-progress.d.ts +12 -0
  21. package/dist/components/glass-progress.js +159 -0
  22. package/dist/components/glass-slider.d.ts +17 -0
  23. package/dist/components/glass-slider.js +168 -0
  24. package/dist/components/glass-tabs.d.ts +7 -0
  25. package/dist/components/glass-tabs.js +102 -0
  26. package/dist/components/glass-toast.d.ts +8 -0
  27. package/dist/components/glass-toast.js +128 -0
  28. package/dist/components/glass-toggle.d.ts +9 -0
  29. package/dist/components/glass-toggle.js +112 -0
  30. package/dist/components/glass-tooltip.d.ts +14 -0
  31. package/dist/components/glass-tooltip.js +214 -0
  32. package/dist/core/base-element.d.ts +4 -0
  33. package/dist/core/base-element.js +9 -0
  34. package/dist/core/curves.d.ts +22 -0
  35. package/dist/core/curves.js +32 -0
  36. package/dist/core/focus-trap.d.ts +1 -0
  37. package/dist/core/focus-trap.js +19 -0
  38. package/dist/core/glow.d.ts +3 -0
  39. package/dist/core/glow.js +57 -0
  40. package/dist/core/motion.d.ts +12 -0
  41. package/dist/core/motion.js +54 -0
  42. package/dist/core/spring-engine.d.ts +12 -0
  43. package/dist/core/spring-engine.js +90 -0
  44. package/dist/core/supports.d.ts +1 -0
  45. package/dist/core/supports.js +1 -0
  46. package/dist/core/theme.d.ts +2 -0
  47. package/dist/core/theme.js +1 -0
  48. package/dist/index.d.ts +39 -0
  49. package/dist/index.js +40 -0
  50. package/package.json +47 -0
  51. package/src/styles/tokens.css +140 -0
@@ -0,0 +1,54 @@
1
+ import { liquidCurves, durations } from "./curves.js";
2
+ export const motion = {
3
+ animate(element, keyframes, options) {
4
+ return element.animate(keyframes, options);
5
+ },
6
+ fadeIn(element, duration = durations.normal) {
7
+ return element.animate([{ opacity: 0 }, { opacity: 1 }], { duration, easing: liquidCurves.decelerate, fill: "forwards" });
8
+ },
9
+ fadeOut(element, duration = durations.normal) {
10
+ return element.animate([{ opacity: 1 }, { opacity: 0 }], { duration, easing: liquidCurves.accelerate, fill: "forwards" });
11
+ },
12
+ scaleIn(element, duration = durations.normal) {
13
+ return element.animate([
14
+ { opacity: 0, transform: "scale(0.9)" },
15
+ { opacity: 1, transform: "scale(1)" }
16
+ ], { duration, easing: liquidCurves.glassIn, fill: "forwards" });
17
+ },
18
+ scaleOut(element, duration = durations.normal) {
19
+ return element.animate([
20
+ { opacity: 1, transform: "scale(1)" },
21
+ { opacity: 0, transform: "scale(0.9)" }
22
+ ], { duration, easing: liquidCurves.glassOut, fill: "forwards" });
23
+ },
24
+ slideInUp(element, duration = durations.slow) {
25
+ return element.animate([
26
+ { opacity: 0, transform: "translateY(20px)" },
27
+ { opacity: 1, transform: "translateY(0)" }
28
+ ], { duration, easing: liquidCurves.glassIn, fill: "forwards" });
29
+ },
30
+ slideOutDown(element, duration = durations.slow) {
31
+ return element.animate([
32
+ { opacity: 1, transform: "translateY(0)" },
33
+ { opacity: 0, transform: "translateY(20px)" }
34
+ ], { duration, easing: liquidCurves.glassOut, fill: "forwards" });
35
+ },
36
+ blurIn(element, duration = durations.slow) {
37
+ return element.animate([
38
+ { opacity: 0, filter: "blur(10px)" },
39
+ { opacity: 1, filter: "blur(0px)" }
40
+ ], { duration, easing: liquidCurves.decelerate, fill: "forwards" });
41
+ },
42
+ shimmer(element) {
43
+ return element.animate([
44
+ { backgroundPosition: "-200% 0" },
45
+ { backgroundPosition: "200% 0" }
46
+ ], { duration: 1500, iterations: Infinity, easing: "linear" });
47
+ },
48
+ pulseGlow(element) {
49
+ return element.animate([
50
+ { boxShadow: "0 0 0 0 rgba(90, 200, 250, 0.4)" },
51
+ { boxShadow: "0 0 0 10px rgba(90, 200, 250, 0)" }
52
+ ], { duration: 1000, iterations: Infinity, easing: liquidCurves.standard });
53
+ }
54
+ };
@@ -0,0 +1,12 @@
1
+ export interface SpringConfig {
2
+ stiffness: number;
3
+ damping: number;
4
+ mass: number;
5
+ }
6
+ export declare const liquidSpring: SpringConfig;
7
+ export declare const bouncySpring: SpringConfig;
8
+ export declare const gentleSpring: SpringConfig;
9
+ export declare const snappySpring: SpringConfig;
10
+ export declare const sleekSpring: SpringConfig;
11
+ export declare function springAnimate(from: number, to: number, onUpdate: (v: number) => void, config?: SpringConfig, onComplete?: () => void): () => void;
12
+ export declare function springAnimateMulti(from: number[], to: number[], onUpdate: (values: number[]) => void, config?: SpringConfig, onComplete?: () => void): () => void;
@@ -0,0 +1,90 @@
1
+ // Spring presets
2
+ export const liquidSpring = {
3
+ stiffness: 170,
4
+ damping: 26,
5
+ mass: 1
6
+ };
7
+ export const bouncySpring = {
8
+ stiffness: 180,
9
+ damping: 12,
10
+ mass: 1
11
+ };
12
+ export const gentleSpring = {
13
+ stiffness: 120,
14
+ damping: 20,
15
+ mass: 1
16
+ };
17
+ export const snappySpring = {
18
+ stiffness: 400,
19
+ damping: 30,
20
+ mass: 1
21
+ };
22
+ export const sleekSpring = {
23
+ stiffness: 200,
24
+ damping: 24,
25
+ mass: 0.8
26
+ };
27
+ export function springAnimate(from, to, onUpdate, config = liquidSpring, onComplete) {
28
+ let velocity = 0;
29
+ let value = from;
30
+ const dt = 1 / 60;
31
+ let rafId;
32
+ let stopped = false;
33
+ function step() {
34
+ if (stopped)
35
+ return;
36
+ const force = -config.stiffness * (value - to);
37
+ const dampingForce = -config.damping * velocity;
38
+ velocity += (force + dampingForce) / config.mass * dt;
39
+ value += velocity * dt;
40
+ onUpdate(value);
41
+ if (Math.abs(velocity) > 0.01 || Math.abs(value - to) > 0.01) {
42
+ rafId = requestAnimationFrame(step);
43
+ }
44
+ else {
45
+ onUpdate(to);
46
+ onComplete === null || onComplete === void 0 ? void 0 : onComplete();
47
+ }
48
+ }
49
+ rafId = requestAnimationFrame(step);
50
+ // Return cancel function
51
+ return () => {
52
+ stopped = true;
53
+ cancelAnimationFrame(rafId);
54
+ };
55
+ }
56
+ // Multi-value spring
57
+ export function springAnimateMulti(from, to, onUpdate, config = liquidSpring, onComplete) {
58
+ const values = [...from];
59
+ const velocities = from.map(() => 0);
60
+ const dt = 1 / 60;
61
+ let rafId;
62
+ let stopped = false;
63
+ function step() {
64
+ if (stopped)
65
+ return;
66
+ let allSettled = true;
67
+ for (let i = 0; i < values.length; i++) {
68
+ const force = -config.stiffness * (values[i] - to[i]);
69
+ const dampingForce = -config.damping * velocities[i];
70
+ velocities[i] += (force + dampingForce) / config.mass * dt;
71
+ values[i] += velocities[i] * dt;
72
+ if (Math.abs(velocities[i]) > 0.01 || Math.abs(values[i] - to[i]) > 0.01) {
73
+ allSettled = false;
74
+ }
75
+ }
76
+ onUpdate([...values]);
77
+ if (!allSettled) {
78
+ rafId = requestAnimationFrame(step);
79
+ }
80
+ else {
81
+ onUpdate([...to]);
82
+ onComplete === null || onComplete === void 0 ? void 0 : onComplete();
83
+ }
84
+ }
85
+ rafId = requestAnimationFrame(step);
86
+ return () => {
87
+ stopped = true;
88
+ cancelAnimationFrame(rafId);
89
+ };
90
+ }
@@ -0,0 +1 @@
1
+ export declare const supportsBlur: () => boolean;
@@ -0,0 +1 @@
1
+ export const supportsBlur = () => CSS.supports("backdrop-filter", "blur(10px)");
@@ -0,0 +1,2 @@
1
+ export type Theme = "light" | "dark";
2
+ export declare const setTheme: (t: Theme) => Theme;
@@ -0,0 +1 @@
1
+ export const setTheme = (t) => document.documentElement.dataset.theme = t;
@@ -0,0 +1,39 @@
1
+ import "./components/glass-card.js";
2
+ import "./components/glass-button.js";
3
+ import "./components/glass-input.js";
4
+ import "./components/glass-modal.js";
5
+ import "./components/glass-tabs.js";
6
+ import "./components/glass-navbar.js";
7
+ import "./components/glass-toast.js";
8
+ import "./components/glass-toggle.js";
9
+ import "./components/glass-slider.js";
10
+ import "./components/glass-dropdown.js";
11
+ import "./components/glass-tooltip.js";
12
+ import "./components/glass-progress.js";
13
+ import "./components/glass-avatar.js";
14
+ import "./components/glass-badge.js";
15
+ import "./components/glass-accordion.js";
16
+ export { springAnimate, springAnimateMulti, liquidSpring, bouncySpring, gentleSpring, snappySpring, sleekSpring } from "./core/spring-engine.js";
17
+ export type { SpringConfig } from "./core/spring-engine.js";
18
+ export { liquidCurves, durations, createTransition } from "./core/curves.js";
19
+ export { glowCSS, createRipple } from "./core/glow.js";
20
+ export { motion } from "./core/motion.js";
21
+ export { trapFocus } from "./core/focus-trap.js";
22
+ export { supportsBlur } from "./core/supports.js";
23
+ export { setTheme } from "./core/theme.js";
24
+ export type { Theme } from "./core/theme.js";
25
+ export { GlassButton } from "./components/glass-button.js";
26
+ export { GlassCard } from "./components/glass-card.js";
27
+ export { GlassInput } from "./components/glass-input.js";
28
+ export { GlassModal } from "./components/glass-modal.js";
29
+ export { GlassTabs } from "./components/glass-tabs.js";
30
+ export { GlassNavbar } from "./components/glass-navbar.js";
31
+ export { GlassToast } from "./components/glass-toast.js";
32
+ export { GlassToggle } from "./components/glass-toggle.js";
33
+ export { GlassSlider } from "./components/glass-slider.js";
34
+ export { GlassDropdown } from "./components/glass-dropdown.js";
35
+ export { GlassTooltip, GlassPopover } from "./components/glass-tooltip.js";
36
+ export { GlassProgress } from "./components/glass-progress.js";
37
+ export { GlassAvatar, GlassAvatarGroup } from "./components/glass-avatar.js";
38
+ export { GlassBadge, GlassBadgeWrapper } from "./components/glass-badge.js";
39
+ export { GlassAccordion, GlassAccordionItem } from "./components/glass-accordion.js";
package/dist/index.js ADDED
@@ -0,0 +1,40 @@
1
+ // Components
2
+ import "./components/glass-card.js";
3
+ import "./components/glass-button.js";
4
+ import "./components/glass-input.js";
5
+ import "./components/glass-modal.js";
6
+ import "./components/glass-tabs.js";
7
+ import "./components/glass-navbar.js";
8
+ import "./components/glass-toast.js";
9
+ import "./components/glass-toggle.js";
10
+ import "./components/glass-slider.js";
11
+ import "./components/glass-dropdown.js";
12
+ import "./components/glass-tooltip.js";
13
+ import "./components/glass-progress.js";
14
+ import "./components/glass-avatar.js";
15
+ import "./components/glass-badge.js";
16
+ import "./components/glass-accordion.js";
17
+ // Core exports
18
+ export { springAnimate, springAnimateMulti, liquidSpring, bouncySpring, gentleSpring, snappySpring, sleekSpring } from "./core/spring-engine.js";
19
+ export { liquidCurves, durations, createTransition } from "./core/curves.js";
20
+ export { glowCSS, createRipple } from "./core/glow.js";
21
+ export { motion } from "./core/motion.js";
22
+ export { trapFocus } from "./core/focus-trap.js";
23
+ export { supportsBlur } from "./core/supports.js";
24
+ export { setTheme } from "./core/theme.js";
25
+ // Component exports
26
+ export { GlassButton } from "./components/glass-button.js";
27
+ export { GlassCard } from "./components/glass-card.js";
28
+ export { GlassInput } from "./components/glass-input.js";
29
+ export { GlassModal } from "./components/glass-modal.js";
30
+ export { GlassTabs } from "./components/glass-tabs.js";
31
+ export { GlassNavbar } from "./components/glass-navbar.js";
32
+ export { GlassToast } from "./components/glass-toast.js";
33
+ export { GlassToggle } from "./components/glass-toggle.js";
34
+ export { GlassSlider } from "./components/glass-slider.js";
35
+ export { GlassDropdown } from "./components/glass-dropdown.js";
36
+ export { GlassTooltip, GlassPopover } from "./components/glass-tooltip.js";
37
+ export { GlassProgress } from "./components/glass-progress.js";
38
+ export { GlassAvatar, GlassAvatarGroup } from "./components/glass-avatar.js";
39
+ export { GlassBadge, GlassBadgeWrapper } from "./components/glass-badge.js";
40
+ export { GlassAccordion, GlassAccordionItem } from "./components/glass-accordion.js";
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "liqgui",
3
+ "version": "0.1.0",
4
+ "description": "Premium glassmorphism component library with spring physics animations",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ },
13
+ "./styles": "./src/styles/tokens.css"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "src/styles"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "prepublishOnly": "npm run build"
22
+ },
23
+ "keywords": [
24
+ "glassmorphism",
25
+ "ui",
26
+ "components",
27
+ "web-components",
28
+ "spring-physics",
29
+ "animations",
30
+ "glass",
31
+ "css",
32
+ "typescript"
33
+ ],
34
+ "author": "bymehul",
35
+ "license": "MIT",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "https://github.com/bymehul/liqgui"
39
+ },
40
+ "homepage": "https://bymehul.github.io/liqgui/docs/index.html",
41
+ "bugs": {
42
+ "url": "https://github.com/bymehul/liqgui/issues"
43
+ },
44
+ "devDependencies": {
45
+ "typescript": "^5.9.3"
46
+ }
47
+ }
@@ -0,0 +1,140 @@
1
+ /*
2
+ CSS
3
+ */
4
+
5
+ :root {
6
+ /* Blur & Radius */
7
+ --lg-blur: 20px;
8
+ --lg-radius: 20px;
9
+ --lg-radius-sm: 12px;
10
+ --lg-radius-lg: 28px;
11
+
12
+ /* Background Colors */
13
+ --lg-bg-light: rgba(255, 255, 255, 0.18);
14
+ --lg-bg-dark: rgba(18, 18, 22, 0.65);
15
+ --lg-bg: var(--lg-bg-dark);
16
+
17
+ /* Border */
18
+ --lg-border: rgba(255, 255, 255, 0.18);
19
+ --lg-border-hover: rgba(255, 255, 255, 0.35);
20
+
21
+ /* Shadows */
22
+ --lg-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
23
+ --lg-shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.25);
24
+ --lg-shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.45);
25
+
26
+ /* Accent Gradients */
27
+ --lg-accent-blue: linear-gradient(135deg, #5ac8fa 0%, #007aff 100%);
28
+ --lg-accent-purple: linear-gradient(135deg, #bf5af2 0%, #5856d6 100%);
29
+ --lg-accent-green: linear-gradient(135deg, #30d158 0%, #34c759 100%);
30
+ --lg-accent-orange: linear-gradient(135deg, #ff9f0a 0%, #ff6b00 100%);
31
+ --lg-accent-pink: linear-gradient(135deg, #ff375f 0%, #ff2d55 100%);
32
+ --lg-accent-teal: linear-gradient(135deg, #64d2ff 0%, #00c7be 100%);
33
+
34
+ /* Default accent */
35
+ --lg-accent: var(--lg-accent-blue);
36
+ --lg-accent-focus: #5ac8fa;
37
+
38
+ /* Typography */
39
+ --lg-font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
40
+ --lg-font-mono: 'SF Mono', 'Fira Code', monospace;
41
+
42
+ /* Spacing */
43
+ --lg-space-xs: 0.25rem;
44
+ --lg-space-sm: 0.5rem;
45
+ --lg-space-md: 1rem;
46
+ --lg-space-lg: 1.5rem;
47
+ --lg-space-xl: 2rem;
48
+
49
+ /* Transitions */
50
+ --lg-transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
51
+ --lg-transition: 250ms cubic-bezier(0.16, 1, 0.3, 1);
52
+ --lg-transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
53
+ }
54
+
55
+ /* Light theme */
56
+ :root[data-theme="light"] {
57
+ --lg-bg: var(--lg-bg-light);
58
+ --lg-border: rgba(0, 0, 0, 0.1);
59
+ --lg-border-hover: rgba(0, 0, 0, 0.2);
60
+ }
61
+
62
+ /* Dark theme (default) */
63
+ :root[data-theme="dark"] {
64
+ --lg-bg: var(--lg-bg-dark);
65
+ }
66
+
67
+ /* Accessibility: Reduced motion */
68
+ @media (prefers-reduced-motion: reduce) {
69
+ :root {
70
+ --lg-transition-fast: 0ms;
71
+ --lg-transition: 0ms;
72
+ --lg-transition-slow: 0ms;
73
+ }
74
+ }
75
+
76
+ /* Accessibility: Reduced transparency */
77
+ @media (prefers-reduced-transparency: reduce) {
78
+ :root {
79
+ --lg-blur: 0px;
80
+ --lg-bg-light: rgba(255, 255, 255, 0.95);
81
+ --lg-bg-dark: rgba(18, 18, 22, 0.95);
82
+ }
83
+ }
84
+
85
+ /* Global keyframes */
86
+ @keyframes lg-fade-in {
87
+ from {
88
+ opacity: 0;
89
+ }
90
+
91
+ to {
92
+ opacity: 1;
93
+ }
94
+ }
95
+
96
+ @keyframes lg-scale-in {
97
+ from {
98
+ opacity: 0;
99
+ transform: scale(0.9);
100
+ }
101
+
102
+ to {
103
+ opacity: 1;
104
+ transform: scale(1);
105
+ }
106
+ }
107
+
108
+ @keyframes lg-slide-up {
109
+ from {
110
+ opacity: 0;
111
+ transform: translateY(20px);
112
+ }
113
+
114
+ to {
115
+ opacity: 1;
116
+ transform: translateY(0);
117
+ }
118
+ }
119
+
120
+ @keyframes lg-shimmer {
121
+ from {
122
+ background-position: -200% 0;
123
+ }
124
+
125
+ to {
126
+ background-position: 200% 0;
127
+ }
128
+ }
129
+
130
+ @keyframes lg-pulse {
131
+
132
+ 0%,
133
+ 100% {
134
+ opacity: 1;
135
+ }
136
+
137
+ 50% {
138
+ opacity: 0.5;
139
+ }
140
+ }