@pathscale/ui 1.1.80 → 1.1.82
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/dist/components/glass-panel/GlassPanel.css +200 -62
- package/dist/components/glass-panel/GlassPanel.js +17 -189
- package/dist/components/glow-card/GlowCard.css +14 -16
- package/dist/purge-manifest.json +2544 -2544
- package/dist/styles/icons/generated-icons.css +1 -173
- package/dist/styles/themes/dark.css +58 -5
- package/dist/styles/themes/light.css +58 -5
- package/package.json +3 -2
|
@@ -1,115 +1,180 @@
|
|
|
1
1
|
@layer components {
|
|
2
2
|
.glass-panel {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
transition: all 200ms ease-in-out;
|
|
6
|
-
background: color-mix(in srgb, var(--color-base-300) 45%, transparent);
|
|
7
|
-
border: 1px solid
|
|
8
|
-
color-mix(in srgb, var(--color-base-content) 12%, transparent);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.glass-panel--transparent {
|
|
12
|
-
background: transparent;
|
|
13
|
-
border-color: transparent;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.glass-panel--glow {
|
|
17
|
-
box-shadow: inset 0 1px 0
|
|
18
|
-
color-mix(in srgb, var(--color-base-content) 5%, transparent);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.glass-panel--liquid {
|
|
22
|
-
--glass-panel-liquid-bg: color-mix(
|
|
3
|
+
--glass-panel-blur: var(--glass-blur, 11px);
|
|
4
|
+
--glass-panel-background: color-mix(
|
|
23
5
|
in oklab,
|
|
24
|
-
var(--color-
|
|
6
|
+
var(--glass-background-color, white) var(--glass-background-opacity, 38%),
|
|
25
7
|
transparent
|
|
26
8
|
);
|
|
27
|
-
--glass-panel-
|
|
9
|
+
--glass-panel-border: color-mix(
|
|
28
10
|
in oklab,
|
|
29
|
-
var(--color-
|
|
11
|
+
var(--glass-border-color, white) var(--glass-border-opacity, 30%),
|
|
30
12
|
transparent
|
|
31
13
|
);
|
|
32
|
-
--glass-panel-
|
|
14
|
+
--glass-panel-highlight: color-mix(
|
|
33
15
|
in oklab,
|
|
34
|
-
var(--color-
|
|
16
|
+
var(--glass-highlight-color, white) var(--glass-highlight-opacity, 80%),
|
|
35
17
|
transparent
|
|
36
18
|
);
|
|
37
|
-
--glass-panel-
|
|
19
|
+
--glass-panel-bottom-highlight: color-mix(
|
|
38
20
|
in oklab,
|
|
39
|
-
var(--
|
|
21
|
+
var(--glass-highlight-color, white)
|
|
22
|
+
var(--glass-bottom-highlight-opacity, 10%),
|
|
40
23
|
transparent
|
|
41
24
|
);
|
|
42
|
-
--glass-panel-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
-webkit-backdrop-filter: blur(1px) blur(2px)
|
|
55
|
-
brightness(var(--glass-panel-liquid-brightness, 1.08))
|
|
56
|
-
saturate(var(--glass-panel-liquid-saturation, 1.35));
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
[data-theme="dark"] .glass-panel--liquid,
|
|
60
|
-
.glass-panel--liquid[data-theme="dark"] {
|
|
61
|
-
--glass-panel-liquid-bg: color-mix(
|
|
25
|
+
--glass-panel-edge-highlight: color-mix(
|
|
26
|
+
in oklab,
|
|
27
|
+
var(--glass-highlight-color, white)
|
|
28
|
+
var(--glass-edge-highlight-opacity, 30%),
|
|
29
|
+
transparent
|
|
30
|
+
);
|
|
31
|
+
--glass-panel-depth-sheen: color-mix(
|
|
32
|
+
in oklab,
|
|
33
|
+
var(--glass-highlight-color, white) var(--glass-depth-sheen-opacity, 40%),
|
|
34
|
+
transparent
|
|
35
|
+
);
|
|
36
|
+
--glass-panel-rim-start: color-mix(
|
|
62
37
|
in oklab,
|
|
63
|
-
var(--color-
|
|
38
|
+
var(--glass-rim-start-color, var(--glass-border-color, white))
|
|
39
|
+
var(--glass-rim-start-opacity, 21%),
|
|
64
40
|
transparent
|
|
65
41
|
);
|
|
66
|
-
--glass-panel-
|
|
42
|
+
--glass-panel-rim-end: color-mix(
|
|
67
43
|
in oklab,
|
|
68
|
-
var(--color-
|
|
44
|
+
var(--glass-rim-end-color, var(--glass-highlight-color, white))
|
|
45
|
+
var(--glass-rim-end-opacity, 35%),
|
|
69
46
|
transparent
|
|
70
47
|
);
|
|
71
|
-
--glass-panel-
|
|
48
|
+
--glass-panel-inner-glow: rgb(
|
|
49
|
+
var(--glass-inner-glow-rgb, 255 255 255) /
|
|
50
|
+
var(--glass-inner-glow-alpha, 0.5)
|
|
51
|
+
);
|
|
52
|
+
--glass-panel-depth-top-glow: color-mix(
|
|
72
53
|
in oklab,
|
|
73
|
-
var(--
|
|
54
|
+
var(--glass-highlight-color, white)
|
|
55
|
+
var(--glass-depth-top-glow-opacity, 8%),
|
|
74
56
|
transparent
|
|
75
57
|
);
|
|
76
|
-
--glass-panel-
|
|
58
|
+
--glass-panel-depth-bottom-glow: color-mix(
|
|
77
59
|
in oklab,
|
|
78
|
-
var(--
|
|
60
|
+
var(--glass-highlight-color, white)
|
|
61
|
+
var(--glass-depth-bottom-glow-opacity, 12%),
|
|
79
62
|
transparent
|
|
80
63
|
);
|
|
81
|
-
|
|
82
|
-
|
|
64
|
+
position: relative;
|
|
65
|
+
isolation: isolate;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
border-radius: var(--glass-border-radius, 20px);
|
|
68
|
+
transition: background-color 200ms ease-in-out, border-color 200ms
|
|
69
|
+
ease-in-out, box-shadow 200ms ease-in-out, backdrop-filter 200ms
|
|
70
|
+
ease-in-out;
|
|
71
|
+
background: var(--glass-panel-background);
|
|
72
|
+
border: 1px solid var(--glass-panel-border);
|
|
73
|
+
box-shadow: var(--glass-shadow-depth, 0 8px 32px rgb(0 0 0 / 10%)), inset 0
|
|
74
|
+
1px 0 var(--glass-panel-highlight), inset 0 -1px 0
|
|
75
|
+
var(--glass-panel-bottom-highlight);
|
|
76
|
+
backdrop-filter: blur(var(--glass-panel-blur));
|
|
77
|
+
-webkit-backdrop-filter: blur(var(--glass-panel-blur));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.glass-panel::before,
|
|
81
|
+
.glass-panel::after {
|
|
82
|
+
content: "";
|
|
83
|
+
position: absolute;
|
|
84
|
+
pointer-events: none;
|
|
85
|
+
z-index: 1;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.glass-panel::before {
|
|
89
|
+
top: 0;
|
|
90
|
+
right: 12%;
|
|
91
|
+
left: 12%;
|
|
92
|
+
height: 1px;
|
|
93
|
+
background: linear-gradient(
|
|
94
|
+
90deg,
|
|
95
|
+
transparent,
|
|
96
|
+
var(--glass-panel-highlight),
|
|
97
|
+
transparent
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.glass-panel::after {
|
|
102
|
+
top: 0;
|
|
103
|
+
bottom: 0;
|
|
104
|
+
left: 0;
|
|
105
|
+
width: 1px;
|
|
106
|
+
background: linear-gradient(
|
|
107
|
+
180deg,
|
|
108
|
+
var(--glass-panel-highlight),
|
|
109
|
+
transparent 45%,
|
|
110
|
+
var(--glass-panel-edge-highlight)
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.glass-panel--transparent {
|
|
115
|
+
background: transparent;
|
|
116
|
+
border-color: transparent;
|
|
117
|
+
box-shadow: none;
|
|
118
|
+
backdrop-filter: none;
|
|
119
|
+
-webkit-backdrop-filter: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.glass-panel--transparent::before,
|
|
123
|
+
.glass-panel--transparent::after,
|
|
124
|
+
.glass-panel--transparent > .glass-panel__rim,
|
|
125
|
+
.glass-panel--transparent > .glass-panel__depth,
|
|
126
|
+
.glass-panel--transparent > .glass-panel__sheen {
|
|
127
|
+
display: none;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.glass-panel--glow {
|
|
131
|
+
box-shadow: var(--glass-shadow-depth, 0 8px 32px rgb(0 0 0 / 10%)), 0 0 0
|
|
132
|
+
1px
|
|
133
|
+
color-mix(
|
|
134
|
+
in oklab,
|
|
135
|
+
var(--color-primary) var(--glass-glow-ring-opacity, 10%),
|
|
136
|
+
transparent
|
|
137
|
+
), inset 0 1px 0 var(--glass-panel-highlight), inset 0 -1px 0
|
|
138
|
+
var(--glass-panel-bottom-highlight);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.glass-panel--liquid {
|
|
142
|
+
backdrop-filter: blur(var(--glass-panel-blur))
|
|
143
|
+
saturate(var(--glass-saturation, 1.2)) brightness(var(--glass-brightness, 1));
|
|
144
|
+
-webkit-backdrop-filter: blur(var(--glass-panel-blur))
|
|
145
|
+
saturate(var(--glass-saturation, 1.2)) brightness(var(--glass-brightness, 1));
|
|
146
|
+
background-clip: padding-box;
|
|
83
147
|
}
|
|
84
148
|
|
|
85
149
|
.glass-panel--liquid > .glass-panel__header-button,
|
|
86
150
|
.glass-panel--liquid > .glass-panel__content {
|
|
87
151
|
position: relative;
|
|
88
|
-
z-index:
|
|
152
|
+
z-index: 2;
|
|
89
153
|
}
|
|
90
154
|
|
|
91
155
|
.glass-panel--blur-none {
|
|
92
156
|
backdrop-filter: none;
|
|
157
|
+
-webkit-backdrop-filter: none;
|
|
93
158
|
}
|
|
94
159
|
|
|
95
160
|
.glass-panel--blur-sm {
|
|
96
|
-
|
|
161
|
+
--glass-panel-blur: calc(var(--glass-blur, 11px) * 0.5);
|
|
97
162
|
}
|
|
98
163
|
|
|
99
164
|
.glass-panel--blur-md {
|
|
100
|
-
|
|
165
|
+
--glass-panel-blur: var(--glass-blur, 11px);
|
|
101
166
|
}
|
|
102
167
|
|
|
103
168
|
.glass-panel--blur-lg {
|
|
104
|
-
|
|
169
|
+
--glass-panel-blur: calc(var(--glass-blur, 11px) * 1.25);
|
|
105
170
|
}
|
|
106
171
|
|
|
107
172
|
.glass-panel--blur-xl {
|
|
108
|
-
|
|
173
|
+
--glass-panel-blur: calc(var(--glass-blur, 11px) * 1.5);
|
|
109
174
|
}
|
|
110
175
|
|
|
111
176
|
.glass-panel--blur-2xl {
|
|
112
|
-
|
|
177
|
+
--glass-panel-blur: calc(var(--glass-blur, 11px) * 2);
|
|
113
178
|
}
|
|
114
179
|
|
|
115
180
|
.glass-panel--accent-primary,
|
|
@@ -161,6 +226,8 @@
|
|
|
161
226
|
}
|
|
162
227
|
|
|
163
228
|
.glass-panel__header-button {
|
|
229
|
+
position: relative;
|
|
230
|
+
z-index: 2;
|
|
164
231
|
display: flex;
|
|
165
232
|
width: 100%;
|
|
166
233
|
cursor: pointer;
|
|
@@ -200,7 +267,64 @@
|
|
|
200
267
|
transform: rotate(180deg);
|
|
201
268
|
}
|
|
202
269
|
|
|
270
|
+
.glass-panel__rim,
|
|
271
|
+
.glass-panel__depth,
|
|
272
|
+
.glass-panel__sheen {
|
|
273
|
+
position: absolute;
|
|
274
|
+
pointer-events: none;
|
|
275
|
+
z-index: 1;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.glass-panel__rim {
|
|
279
|
+
inset: 0;
|
|
280
|
+
border-radius: inherit;
|
|
281
|
+
padding: 1px;
|
|
282
|
+
background: linear-gradient(
|
|
283
|
+
180deg,
|
|
284
|
+
var(--glass-panel-rim-start) 1%,
|
|
285
|
+
var(--glass-panel-rim-end) 100%
|
|
286
|
+
);
|
|
287
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
288
|
+
mask-composite: exclude;
|
|
289
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box,
|
|
290
|
+
linear-gradient(#fff 0 0);
|
|
291
|
+
-webkit-mask-composite: xor;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.glass-panel__depth {
|
|
295
|
+
inset: 1px;
|
|
296
|
+
border-radius: max(0px, calc(var(--glass-border-radius, 20px) - 1px));
|
|
297
|
+
background: radial-gradient(
|
|
298
|
+
circle at 50% 45%,
|
|
299
|
+
color-mix(
|
|
300
|
+
in oklab,
|
|
301
|
+
var(--glass-highlight-color, white)
|
|
302
|
+
var(--glass-depth-surface-opacity, 8%),
|
|
303
|
+
transparent
|
|
304
|
+
)
|
|
305
|
+
0%,
|
|
306
|
+
transparent var(--glass-depth-surface-size, 82%)
|
|
307
|
+
);
|
|
308
|
+
box-shadow: inset 0 0 var(--glass-inner-glow-blur, 10px)
|
|
309
|
+
var(--glass-inner-glow-spread, 5px) var(--glass-panel-inner-glow), inset 0
|
|
310
|
+
2px 4px 0 var(--glass-panel-depth-top-glow), inset 0 -2px 2px 0
|
|
311
|
+
var(--glass-panel-depth-bottom-glow);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.glass-panel__sheen {
|
|
315
|
+
inset: 2px;
|
|
316
|
+
border-radius: max(0px, calc(var(--glass-border-radius, 20px) - 2px));
|
|
317
|
+
background: radial-gradient(
|
|
318
|
+
circle at 30% 20%,
|
|
319
|
+
var(--glass-panel-depth-sheen) 0%,
|
|
320
|
+
transparent var(--glass-depth-sheen-size, 70%)
|
|
321
|
+
);
|
|
322
|
+
mix-blend-mode: overlay;
|
|
323
|
+
}
|
|
324
|
+
|
|
203
325
|
.glass-panel__content {
|
|
326
|
+
position: relative;
|
|
327
|
+
z-index: 2;
|
|
204
328
|
display: grid;
|
|
205
329
|
transition: grid-template-rows 200ms ease-in-out, opacity 200ms ease-in-out;
|
|
206
330
|
}
|
|
@@ -236,4 +360,18 @@
|
|
|
236
360
|
.glass-panel__content--xl {
|
|
237
361
|
padding: 1.5rem;
|
|
238
362
|
}
|
|
363
|
+
|
|
364
|
+
@supports not (
|
|
365
|
+
(backdrop-filter: blur(1px)) or
|
|
366
|
+
(-webkit-backdrop-filter: blur(1px))
|
|
367
|
+
) {
|
|
368
|
+
.glass-panel {
|
|
369
|
+
background: color-mix(
|
|
370
|
+
in oklab,
|
|
371
|
+
var(--glass-background-color, white)
|
|
372
|
+
var(--glass-fallback-background-opacity, 78%),
|
|
373
|
+
transparent
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
239
377
|
}
|
|
@@ -3,135 +3,7 @@ import "./GlassPanel.css";
|
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__ from "tailwind-merge";
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__ from "./GlassPanel.classes.js";
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<button type=button><span></span><svg><path stroke-linecap=round stroke-linejoin=round d="M19 9l-7 7-7-7">'), _tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div><div><div>");
|
|
7
|
-
const LIQUID_DEPTH_RATIO = 0.05;
|
|
8
|
-
const LIQUID_RADIUS_RATIO = 0.08;
|
|
9
|
-
const LIQUID_STRENGTH_RATIO = 0.5;
|
|
10
|
-
const LIQUID_CHROMATIC_ABERRATION_RATIO = 0.025;
|
|
11
|
-
const LIQUID_BLUR = 2;
|
|
12
|
-
const getDisplacementMap = ({ height, width, radius, depth })=>`data:image/svg+xml;utf8,${encodeURIComponent(`<svg height="${height}" width="${width}" viewBox="0 0 ${width} ${height}" xmlns="http://www.w3.org/2000/svg">
|
|
13
|
-
<style>
|
|
14
|
-
.mix { mix-blend-mode: screen; }
|
|
15
|
-
</style>
|
|
16
|
-
<defs>
|
|
17
|
-
<linearGradient
|
|
18
|
-
id="Y"
|
|
19
|
-
x1="0"
|
|
20
|
-
x2="0"
|
|
21
|
-
y1="${Math.ceil(radius / height * 15)}%"
|
|
22
|
-
y2="${Math.floor(100 - radius / height * 15)}%">
|
|
23
|
-
<stop offset="0%" stop-color="#0F0" />
|
|
24
|
-
<stop offset="100%" stop-color="#000" />
|
|
25
|
-
</linearGradient>
|
|
26
|
-
<linearGradient
|
|
27
|
-
id="X"
|
|
28
|
-
x1="${Math.ceil(radius / width * 15)}%"
|
|
29
|
-
x2="${Math.floor(100 - radius / width * 15)}%"
|
|
30
|
-
y1="0"
|
|
31
|
-
y2="0">
|
|
32
|
-
<stop offset="0%" stop-color="#F00" />
|
|
33
|
-
<stop offset="100%" stop-color="#000" />
|
|
34
|
-
</linearGradient>
|
|
35
|
-
</defs>
|
|
36
|
-
|
|
37
|
-
<rect x="0" y="0" height="${height}" width="${width}" fill="#808080" />
|
|
38
|
-
<g filter="blur(2px)">
|
|
39
|
-
<rect x="0" y="0" height="${height}" width="${width}" fill="#000080" />
|
|
40
|
-
<rect
|
|
41
|
-
x="0"
|
|
42
|
-
y="0"
|
|
43
|
-
height="${height}"
|
|
44
|
-
width="${width}"
|
|
45
|
-
fill="url(#Y)"
|
|
46
|
-
class="mix"
|
|
47
|
-
/>
|
|
48
|
-
<rect
|
|
49
|
-
x="0"
|
|
50
|
-
y="0"
|
|
51
|
-
height="${height}"
|
|
52
|
-
width="${width}"
|
|
53
|
-
fill="url(#X)"
|
|
54
|
-
class="mix"
|
|
55
|
-
/>
|
|
56
|
-
<rect
|
|
57
|
-
x="${depth}"
|
|
58
|
-
y="${depth}"
|
|
59
|
-
height="${height - 2 * depth}"
|
|
60
|
-
width="${width - 2 * depth}"
|
|
61
|
-
fill="#808080"
|
|
62
|
-
rx="${radius}"
|
|
63
|
-
ry="${radius}"
|
|
64
|
-
filter="blur(${depth}px)"
|
|
65
|
-
/>
|
|
66
|
-
</g>
|
|
67
|
-
</svg>`)}`;
|
|
68
|
-
const getDisplacementFilter = ({ height, width, radius, depth, strength, chromaticAberration })=>`data:image/svg+xml;utf8,${encodeURIComponent(`<svg height="${height}" width="${width}" viewBox="0 0 ${width} ${height}" xmlns="http://www.w3.org/2000/svg">
|
|
69
|
-
<defs>
|
|
70
|
-
<filter id="displace" color-interpolation-filters="sRGB">
|
|
71
|
-
<feImage x="0" y="0" height="${height}" width="${width}" href="${getDisplacementMap({
|
|
72
|
-
height,
|
|
73
|
-
width,
|
|
74
|
-
radius,
|
|
75
|
-
depth
|
|
76
|
-
})}" result="displacementMap" />
|
|
77
|
-
<feDisplacementMap
|
|
78
|
-
transform-origin="center"
|
|
79
|
-
in="SourceGraphic"
|
|
80
|
-
in2="displacementMap"
|
|
81
|
-
scale="${strength + 2 * chromaticAberration}"
|
|
82
|
-
xChannelSelector="R"
|
|
83
|
-
yChannelSelector="G"
|
|
84
|
-
/>
|
|
85
|
-
<feColorMatrix
|
|
86
|
-
type="matrix"
|
|
87
|
-
values="1 0 0 0 0
|
|
88
|
-
0 0 0 0 0
|
|
89
|
-
0 0 0 0 0
|
|
90
|
-
0 0 0 1 0"
|
|
91
|
-
result="displacedR"
|
|
92
|
-
/>
|
|
93
|
-
<feDisplacementMap
|
|
94
|
-
in="SourceGraphic"
|
|
95
|
-
in2="displacementMap"
|
|
96
|
-
scale="${strength + chromaticAberration}"
|
|
97
|
-
xChannelSelector="R"
|
|
98
|
-
yChannelSelector="G"
|
|
99
|
-
/>
|
|
100
|
-
<feColorMatrix
|
|
101
|
-
type="matrix"
|
|
102
|
-
values="0 0 0 0 0
|
|
103
|
-
0 1 0 0 0
|
|
104
|
-
0 0 0 0 0
|
|
105
|
-
0 0 0 1 0"
|
|
106
|
-
result="displacedG"
|
|
107
|
-
/>
|
|
108
|
-
<feDisplacementMap
|
|
109
|
-
in="SourceGraphic"
|
|
110
|
-
in2="displacementMap"
|
|
111
|
-
scale="${strength}"
|
|
112
|
-
xChannelSelector="R"
|
|
113
|
-
yChannelSelector="G"
|
|
114
|
-
/>
|
|
115
|
-
<feColorMatrix
|
|
116
|
-
type="matrix"
|
|
117
|
-
values="0 0 0 0 0
|
|
118
|
-
0 0 0 0 0
|
|
119
|
-
0 0 1 0 0
|
|
120
|
-
0 0 0 1 0"
|
|
121
|
-
result="displacedB"
|
|
122
|
-
/>
|
|
123
|
-
<feBlend in="displacedR" in2="displacedG" mode="screen"/>
|
|
124
|
-
<feBlend in2="displacedB" mode="screen"/>
|
|
125
|
-
</filter>
|
|
126
|
-
</defs>
|
|
127
|
-
</svg>`)}#displace`;
|
|
128
|
-
const getPx = (value)=>{
|
|
129
|
-
const parsed = Number.parseFloat(value);
|
|
130
|
-
return Number.isFinite(parsed) ? parsed : 0;
|
|
131
|
-
};
|
|
132
|
-
const callEventHandler = (handler, event)=>{
|
|
133
|
-
if ("function" == typeof handler) handler(event);
|
|
134
|
-
};
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<button type=button><span></span><svg><path stroke-linecap=round stroke-linejoin=round d="M19 9l-7 7-7-7">'), _tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div><span class=glass-panel__rim aria-hidden=true></span><span class=glass-panel__depth aria-hidden=true></span><span class=glass-panel__sheen aria-hidden=true></span><div><div>");
|
|
135
7
|
const GlassPanel = (props)=>{
|
|
136
8
|
let rootRef;
|
|
137
9
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
@@ -156,11 +28,9 @@ const GlassPanel = (props)=>{
|
|
|
156
28
|
"style"
|
|
157
29
|
]);
|
|
158
30
|
const contentId = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createUniqueId)();
|
|
159
|
-
const blur = ()=>local.blur ?? "
|
|
31
|
+
const blur = ()=>local.blur ?? "md";
|
|
160
32
|
const size = ()=>local.size ?? "md";
|
|
161
33
|
const isLiquid = ()=>"liquid" === local.effect;
|
|
162
|
-
const [geometry, setGeometry] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)();
|
|
163
|
-
const [pressed, setPressed] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
|
|
164
34
|
const isControlled = ()=>void 0 !== local.open;
|
|
165
35
|
const [internalOpen, setInternalOpen] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(local.defaultOpen ?? true);
|
|
166
36
|
const isOpen = ()=>isControlled() ? true === local.open : internalOpen();
|
|
@@ -170,52 +40,22 @@ const GlassPanel = (props)=>{
|
|
|
170
40
|
if (!isControlled()) setInternalOpen(next);
|
|
171
41
|
local.onToggle?.(next);
|
|
172
42
|
};
|
|
173
|
-
const syncGeometry = ()=>{
|
|
174
|
-
if (!rootRef) return;
|
|
175
|
-
const rect = rootRef.getBoundingClientRect();
|
|
176
|
-
if (rect.width <= 0 || rect.height <= 0) return;
|
|
177
|
-
const style = window.getComputedStyle(rootRef);
|
|
178
|
-
setGeometry({
|
|
179
|
-
width: Math.round(rect.width),
|
|
180
|
-
height: Math.round(rect.height),
|
|
181
|
-
radius: Math.round(getPx(style.borderTopLeftRadius))
|
|
182
|
-
});
|
|
183
|
-
};
|
|
184
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onMount)(()=>{
|
|
185
|
-
syncGeometry();
|
|
186
|
-
if (!rootRef || "undefined" == typeof ResizeObserver) return;
|
|
187
|
-
const observer = new ResizeObserver(syncGeometry);
|
|
188
|
-
observer.observe(rootRef);
|
|
189
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>observer.disconnect());
|
|
190
|
-
});
|
|
191
43
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
|
|
192
44
|
const element = rootRef;
|
|
193
45
|
if (!element) return;
|
|
194
|
-
if (!isLiquid()) {
|
|
46
|
+
if (!isLiquid() || local.transparent) {
|
|
195
47
|
element.style.removeProperty("backdrop-filter");
|
|
196
48
|
element.style.removeProperty("-webkit-backdrop-filter");
|
|
197
49
|
return;
|
|
198
50
|
}
|
|
199
|
-
const
|
|
200
|
-
if (!nextGeometry) return;
|
|
201
|
-
const minSide = Math.min(nextGeometry.width, nextGeometry.height);
|
|
202
|
-
const maxDepth = Math.max(1, Math.floor(minSide / 2) - 1);
|
|
203
|
-
const depth = Math.min(maxDepth, Math.max(10, Math.round(minSide * LIQUID_DEPTH_RATIO)) / (pressed() ? 0.7 : 1));
|
|
204
|
-
const filter = getDisplacementFilter({
|
|
205
|
-
...nextGeometry,
|
|
206
|
-
radius: Math.max(nextGeometry.radius, Math.round(minSide * LIQUID_RADIUS_RATIO)),
|
|
207
|
-
depth,
|
|
208
|
-
strength: Math.round(minSide * LIQUID_STRENGTH_RATIO),
|
|
209
|
-
chromaticAberration: Math.round(minSide * LIQUID_CHROMATIC_ABERRATION_RATIO)
|
|
210
|
-
});
|
|
211
|
-
const backdropFilter = `blur(${LIQUID_BLUR / 2}px) url('${filter}') blur(${LIQUID_BLUR}px) brightness(var(--glass-panel-liquid-brightness, 1.1)) saturate(var(--glass-panel-liquid-saturation, 1.5))`;
|
|
51
|
+
const backdropFilter = "blur(var(--glass-panel-blur)) saturate(var(--glass-saturation, 1.2)) brightness(var(--glass-brightness, 1))";
|
|
212
52
|
element.style.backdropFilter = backdropFilter;
|
|
213
53
|
element.style.setProperty("-webkit-backdrop-filter", backdropFilter);
|
|
214
54
|
});
|
|
215
55
|
const containerClasses = ()=>(0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)(__WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.base, !local.transparent && !isLiquid() && __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.blur[blur()], !local.transparent && isLiquid() && __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.flag.liquid, local.transparent && __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.flag.transparent, local.glow && __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.flag.glow, local.accent && __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.accent[accentKey()], local.class, local.className);
|
|
216
56
|
const contentClasses = ()=>(0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)(__WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.slot.content, local.collapsible && __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.flag.contentCollapsible, local.collapsible && !isOpen() && __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.flag.contentCollapsed, (!local.collapsible || isOpen()) && !(local.paddingX || local.paddingY) && __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.size[size()], local.paddingX, local.paddingY);
|
|
217
57
|
return (()=>{
|
|
218
|
-
var _el$ = _tmpl$2(), _el$
|
|
58
|
+
var _el$ = _tmpl$2(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.nextSibling, _el$8 = _el$4.nextSibling, _el$9 = _el$8.firstChild;
|
|
219
59
|
var _ref$ = rootRef;
|
|
220
60
|
"function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$) : rootRef = _el$;
|
|
221
61
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, ()=>({
|
|
@@ -227,18 +67,6 @@ const GlassPanel = (props)=>{
|
|
|
227
67
|
get ["data-glass-effect"] () {
|
|
228
68
|
return isLiquid() ? "liquid" : void 0;
|
|
229
69
|
},
|
|
230
|
-
onMouseDown: (event)=>{
|
|
231
|
-
callEventHandler(others.onMouseDown, event);
|
|
232
|
-
setPressed(true);
|
|
233
|
-
},
|
|
234
|
-
onMouseUp: (event)=>{
|
|
235
|
-
callEventHandler(others.onMouseUp, event);
|
|
236
|
-
setPressed(false);
|
|
237
|
-
},
|
|
238
|
-
onMouseLeave: (event)=>{
|
|
239
|
-
callEventHandler(others.onMouseLeave, event);
|
|
240
|
-
setPressed(false);
|
|
241
|
-
},
|
|
242
70
|
get style () {
|
|
243
71
|
return local.style;
|
|
244
72
|
}
|
|
@@ -248,8 +76,8 @@ const GlassPanel = (props)=>{
|
|
|
248
76
|
return local.collapsible && local.title;
|
|
249
77
|
},
|
|
250
78
|
get children () {
|
|
251
|
-
var _el$
|
|
252
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$
|
|
79
|
+
var _el$5 = _tmpl$(), _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
|
|
80
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$5, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
|
|
253
81
|
class: __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.slot.headerButton
|
|
254
82
|
}), {
|
|
255
83
|
onClick: handleToggle,
|
|
@@ -258,10 +86,10 @@ const GlassPanel = (props)=>{
|
|
|
258
86
|
},
|
|
259
87
|
"aria-controls": contentId
|
|
260
88
|
}), false, true);
|
|
261
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$
|
|
89
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$6, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
|
|
262
90
|
class: __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.slot.headerLabel
|
|
263
91
|
})), false, true);
|
|
264
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$
|
|
92
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$6, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
265
93
|
get when () {
|
|
266
94
|
return local.icon;
|
|
267
95
|
},
|
|
@@ -269,8 +97,8 @@ const GlassPanel = (props)=>{
|
|
|
269
97
|
return local.icon;
|
|
270
98
|
}
|
|
271
99
|
}), null);
|
|
272
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$
|
|
273
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$
|
|
100
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$6, ()=>local.title, null);
|
|
101
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$7, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
|
|
274
102
|
class: (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)(__WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.slot.chevron, isOpen() && __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.flag.chevronOpen)
|
|
275
103
|
}), {
|
|
276
104
|
"aria-hidden": "true",
|
|
@@ -279,11 +107,11 @@ const GlassPanel = (props)=>{
|
|
|
279
107
|
stroke: "currentColor",
|
|
280
108
|
"stroke-width": "1.5"
|
|
281
109
|
}), true, true);
|
|
282
|
-
return _el$
|
|
110
|
+
return _el$5;
|
|
283
111
|
}
|
|
284
|
-
}), _el$
|
|
285
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$
|
|
286
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$
|
|
112
|
+
}), _el$8);
|
|
113
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$8, "id", contentId);
|
|
114
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$8, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
|
|
287
115
|
class: contentClasses()
|
|
288
116
|
}), {
|
|
289
117
|
get style () {
|
|
@@ -293,10 +121,10 @@ const GlassPanel = (props)=>{
|
|
|
293
121
|
};
|
|
294
122
|
}
|
|
295
123
|
}), false, true);
|
|
296
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$
|
|
124
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$9, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
|
|
297
125
|
class: (0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)(__WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.slot.contentInner, local.collapsible && __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.flag.contentInnerHidden)
|
|
298
126
|
})), false, true);
|
|
299
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$
|
|
127
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$9, ()=>local.children);
|
|
300
128
|
return _el$;
|
|
301
129
|
})();
|
|
302
130
|
};
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
.glow-card {
|
|
2
|
-
--glow-color-border:
|
|
3
|
-
|
|
2
|
+
--glow-color-border: color-mix(
|
|
3
|
+
in oklab,
|
|
4
|
+
var(--glass-highlight-color, var(--color-base-content))
|
|
5
|
+
var(--glass-border-opacity, 24%),
|
|
6
|
+
transparent
|
|
7
|
+
);
|
|
8
|
+
--glow-color-bg: color-mix(
|
|
9
|
+
in oklab,
|
|
10
|
+
var(--glass-highlight-color, var(--color-base-100))
|
|
11
|
+
var(--glass-background-opacity, 58%),
|
|
12
|
+
transparent
|
|
13
|
+
);
|
|
4
14
|
position: relative;
|
|
5
15
|
border-radius: inherit;
|
|
6
16
|
}
|
|
@@ -28,12 +38,8 @@
|
|
|
28
38
|
);
|
|
29
39
|
z-index: 1;
|
|
30
40
|
inset: -1px;
|
|
31
|
-
-webkit-mask:
|
|
32
|
-
|
|
33
|
-
linear-gradient(#fff 0 0);
|
|
34
|
-
mask:
|
|
35
|
-
linear-gradient(#fff 0 0) content-box,
|
|
36
|
-
linear-gradient(#fff 0 0);
|
|
41
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
42
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
37
43
|
-webkit-mask-composite: xor;
|
|
38
44
|
mask-composite: exclude;
|
|
39
45
|
padding: 1px;
|
|
@@ -53,14 +59,6 @@
|
|
|
53
59
|
opacity: 1;
|
|
54
60
|
}
|
|
55
61
|
|
|
56
|
-
[data-theme="light"] .glow-card::before {
|
|
57
|
-
--glow-color-border: oklch(30% 0.15 260 / 0.4);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
[data-theme="light"] .glow-card::after {
|
|
61
|
-
--glow-color-bg: oklch(30% 0.15 260 / 0.15);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
62
|
@media (prefers-reduced-motion: reduce) {
|
|
65
63
|
.glow-card::before,
|
|
66
64
|
.glow-card::after {
|