@pathscale/ui 1.1.73 → 1.1.74

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.
@@ -27,6 +27,7 @@ export declare const CLASSES: {
27
27
  readonly ghost: "glass-panel--accent-ghost";
28
28
  };
29
29
  readonly flag: {
30
+ readonly liquid: "glass-panel--liquid";
30
31
  readonly transparent: "glass-panel--transparent";
31
32
  readonly glow: "glass-panel--glow";
32
33
  readonly contentCollapsed: "glass-panel__content--collapsed";
@@ -27,6 +27,7 @@ const CLASSES = {
27
27
  ghost: "glass-panel--accent-ghost"
28
28
  },
29
29
  flag: {
30
+ liquid: "glass-panel--liquid",
30
31
  transparent: "glass-panel--transparent",
31
32
  glow: "glass-panel--glow",
32
33
  contentCollapsed: "glass-panel__content--collapsed",
@@ -1,9 +1,11 @@
1
1
  @layer components {
2
2
  .glass-panel {
3
+ position: relative;
3
4
  border-radius: 0.75rem;
4
5
  transition: all 200ms ease-in-out;
5
6
  background: color-mix(in srgb, var(--color-base-300) 45%, transparent);
6
- border: 1px solid color-mix(in srgb, var(--color-base-content) 12%, transparent);
7
+ border: 1px solid
8
+ color-mix(in srgb, var(--color-base-content) 12%, transparent);
7
9
  }
8
10
 
9
11
  .glass-panel--transparent {
@@ -12,7 +14,93 @@
12
14
  }
13
15
 
14
16
  .glass-panel--glow {
15
- box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-base-content) 5%, transparent);
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
+ overflow: hidden;
23
+ background: linear-gradient(
24
+ 135deg,
25
+ color-mix(in srgb, white 18%, transparent),
26
+ transparent 38%,
27
+ color-mix(in srgb, white 10%, transparent) 72%,
28
+ transparent
29
+ ), color-mix(in srgb, var(--color-base-100) 12%, transparent);
30
+ border-color: color-mix(in srgb, var(--color-base-content) 12%, transparent);
31
+ box-shadow: inset 0 1px 0 color-mix(in srgb, white 38%, transparent), inset
32
+ 0 -1px 0 color-mix(in srgb, var(--color-base-content) 5%, transparent);
33
+ backdrop-filter: var(--glass-panel-liquid-filter) blur(10px) saturate(1.12);
34
+ -webkit-backdrop-filter: var(--glass-panel-liquid-filter) blur(10px)
35
+ saturate(1.12);
36
+ }
37
+
38
+ .glass-panel--liquid::before,
39
+ .glass-panel--liquid::after {
40
+ position: absolute;
41
+ inset: 0;
42
+ border-radius: inherit;
43
+ pointer-events: none;
44
+ content: "";
45
+ }
46
+
47
+ .glass-panel--liquid::before {
48
+ z-index: 1;
49
+ background: radial-gradient(
50
+ circle at 18% 0%,
51
+ color-mix(in srgb, white 32%, transparent),
52
+ transparent 38%
53
+ ),
54
+ linear-gradient(
55
+ 120deg,
56
+ color-mix(in srgb, white 20%, transparent),
57
+ transparent 22% 78%,
58
+ color-mix(in srgb, white 8%, transparent)
59
+ );
60
+ mix-blend-mode: screen;
61
+ opacity: 0.32;
62
+ }
63
+
64
+ .glass-panel--liquid::after {
65
+ z-index: 2;
66
+ padding: 1px;
67
+ background: linear-gradient(
68
+ 145deg,
69
+ color-mix(in srgb, white 80%, transparent),
70
+ transparent 24% 72%,
71
+ color-mix(in srgb, var(--color-base-content) 9%, transparent)
72
+ )
73
+ border-box;
74
+ mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
75
+ mask-composite: exclude;
76
+ -webkit-mask: linear-gradient(#000 0 0) content-box,
77
+ linear-gradient(#000 0 0);
78
+ -webkit-mask-composite: xor;
79
+ opacity: 0.5;
80
+ }
81
+
82
+ .glass-panel--liquid > .glass-panel__header-button,
83
+ .glass-panel--liquid > .glass-panel__content {
84
+ position: relative;
85
+ z-index: 3;
86
+ }
87
+
88
+ .glass-panel__liquid-filter {
89
+ position: absolute;
90
+ width: 0;
91
+ height: 0;
92
+ overflow: hidden;
93
+ pointer-events: none;
94
+ }
95
+
96
+ @supports not (
97
+ (backdrop-filter: url("#liquid-glass-filter")) or
98
+ (-webkit-backdrop-filter: url("#liquid-glass-filter"))
99
+ ) {
100
+ .glass-panel--liquid {
101
+ backdrop-filter: blur(10px) saturate(1.12);
102
+ -webkit-backdrop-filter: blur(10px) saturate(1.12);
103
+ }
16
104
  }
17
105
 
18
106
  .glass-panel--blur-none {
@@ -99,9 +187,7 @@
99
187
  color: color-mix(in oklab, var(--color-base-content) 50%, transparent);
100
188
  font-size: 0.875rem;
101
189
  font-weight: 500;
102
- transition:
103
- color 150ms ease,
104
- background-color 150ms ease;
190
+ transition: color 150ms ease, background-color 150ms ease;
105
191
  }
106
192
 
107
193
  .glass-panel__header-button:hover {
@@ -131,9 +217,7 @@
131
217
 
132
218
  .glass-panel__content {
133
219
  display: grid;
134
- transition:
135
- grid-template-rows 200ms ease-in-out,
136
- opacity 200ms ease-in-out;
220
+ transition: grid-template-rows 200ms ease-in-out, opacity 200ms ease-in-out;
137
221
  }
138
222
 
139
223
  .glass-panel__content--collapsible {
@@ -1,9 +1,11 @@
1
1
  import "./GlassPanel.css";
2
2
  import { type JSX } from "solid-js";
3
- import type { IComponentBaseProps, ComponentSize, ComponentColor } from "../types";
3
+ import type { ComponentColor, ComponentSize, IComponentBaseProps } from "../types";
4
4
  export type GlassPanelBlur = "none" | "sm" | "md" | "lg" | "xl" | "2xl";
5
+ export type GlassPanelEffect = "default" | "liquid";
5
6
  export type GlassPanelProps = IComponentBaseProps & JSX.HTMLAttributes<HTMLDivElement> & {
6
7
  blur?: GlassPanelBlur;
8
+ effect?: GlassPanelEffect;
7
9
  collapsible?: boolean;
8
10
  open?: boolean;
9
11
  defaultOpen?: boolean;
@@ -3,10 +3,11 @@ 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>");
6
+ var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<svg class=glass-panel__liquid-filter aria-hidden=true><defs><filter x=-12% y=-12% width=124% height=124% color-interpolation-filters=sRGB><feImage href=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cdefs%3E%3ClinearGradient id='left' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='rgb(56,128,128)'/%3E%3Cstop offset='1' stop-color='rgb(128,128,128)'/%3E%3C/linearGradient%3E%3ClinearGradient id='right' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='rgb(128,128,128)'/%3E%3Cstop offset='1' stop-color='rgb(200,128,128)'/%3E%3C/linearGradient%3E%3ClinearGradient id='top' y1='0' y2='1'%3E%3Cstop offset='0' stop-color='rgb(128,56,128)'/%3E%3Cstop offset='1' stop-color='rgb(128,128,128)'/%3E%3C/linearGradient%3E%3ClinearGradient id='bottom' y1='0' y2='1'%3E%3Cstop offset='0' stop-color='rgb(128,128,128)'/%3E%3Cstop offset='1' stop-color='rgb(128,200,128)'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='512' height='512' fill='rgb(128,128,128)'/%3E%3Crect width='96' height='512' fill='url(%23left)'/%3E%3Crect x='416' width='96' height='512' fill='url(%23right)'/%3E%3Crect width='512' height='96' fill='url(%23top)' opacity='.72'/%3E%3Crect y='416' width='512' height='96' fill='url(%23bottom)' opacity='.72'/%3E%3C/svg%3E\"x=0 y=0 width=100% height=100% preserveAspectRatio=none result=displacement-map></feImage><feDisplacementMap in=SourceGraphic in2=displacement-map scale=14 xChannelSelector=R yChannelSelector=G result=refracted></feDisplacementMap><feColorMatrix in=refracted type=saturate values=1.16>"), _tmpl$2 = /*#__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$3 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div><div><div>");
7
7
  const GlassPanel = (props)=>{
8
8
  const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
9
9
  "blur",
10
+ "effect",
10
11
  "collapsible",
11
12
  "open",
12
13
  "defaultOpen",
@@ -26,38 +27,63 @@ const GlassPanel = (props)=>{
26
27
  "style"
27
28
  ]);
28
29
  const contentId = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createUniqueId)();
30
+ const liquidFilterId = `glass-panel-liquid-${(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createUniqueId)().replace(/[^a-zA-Z0-9_-]/g, "")}`;
29
31
  const blur = ()=>local.blur ?? "none";
30
32
  const size = ()=>local.size ?? "md";
33
+ const isLiquid = ()=>"liquid" === local.effect;
31
34
  const isControlled = ()=>void 0 !== local.open;
32
35
  const [internalOpen, setInternalOpen] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(local.defaultOpen ?? true);
33
- const isOpen = ()=>isControlled() ? local.open : internalOpen();
36
+ const isOpen = ()=>isControlled() ? true === local.open : internalOpen();
34
37
  const accentKey = ()=>local.accent ?? "ghost";
35
38
  const handleToggle = ()=>{
36
39
  const next = !isOpen();
37
40
  if (!isControlled()) setInternalOpen(next);
38
41
  local.onToggle?.(next);
39
42
  };
40
- const containerClasses = ()=>(0, __WEBPACK_EXTERNAL_MODULE_tailwind_merge_e05e3e95__.twMerge)(__WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.base, !local.transparent && __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.blur[blur()], 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);
43
+ 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);
44
+ const containerStyle = ()=>{
45
+ if (!isLiquid()) return local.style;
46
+ const liquidBackdropFilter = `url(#${liquidFilterId}) blur(12px) saturate(1.22)`;
47
+ return Object.assign({}, "object" == typeof local.style ? local.style : void 0, {
48
+ "--glass-panel-liquid-filter": `url(#${liquidFilterId})`,
49
+ "-webkit-backdrop-filter": liquidBackdropFilter,
50
+ "backdrop-filter": liquidBackdropFilter
51
+ });
52
+ };
41
53
  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);
42
54
  return (()=>{
43
- var _el$ = _tmpl$2(), _el$5 = _el$.firstChild, _el$6 = _el$5.firstChild;
55
+ var _el$ = _tmpl$3(), _el$9 = _el$.firstChild, _el$0 = _el$9.firstChild;
44
56
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, ()=>({
45
57
  class: containerClasses()
46
58
  }), {
47
59
  get ["data-theme"] () {
48
60
  return local.dataTheme;
49
61
  },
62
+ get ["data-glass-effect"] () {
63
+ return isLiquid() ? "liquid" : void 0;
64
+ },
50
65
  get style () {
51
- return local.style;
66
+ return containerStyle();
52
67
  }
53
68
  }), false, true);
69
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
70
+ get when () {
71
+ return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.memo)(()=>!local.transparent)() && isLiquid();
72
+ },
73
+ get children () {
74
+ var _el$2 = _tmpl$(), _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild;
75
+ _el$4.firstChild;
76
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$4, "id", liquidFilterId);
77
+ return _el$2;
78
+ }
79
+ }), _el$9);
54
80
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
55
81
  get when () {
56
82
  return local.collapsible && local.title;
57
83
  },
58
84
  get children () {
59
- var _el$2 = _tmpl$(), _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling;
60
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$2, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
85
+ var _el$6 = _tmpl$2(), _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling;
86
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$6, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
61
87
  class: __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.slot.headerButton
62
88
  }), {
63
89
  onClick: handleToggle,
@@ -66,10 +92,10 @@ const GlassPanel = (props)=>{
66
92
  },
67
93
  "aria-controls": contentId
68
94
  }), false, true);
69
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$3, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
95
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$7, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
70
96
  class: __WEBPACK_EXTERNAL_MODULE__GlassPanel_classes_js_5f11fbfd__.CLASSES.slot.headerLabel
71
97
  })), false, true);
72
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$3, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
98
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$7, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
73
99
  get when () {
74
100
  return local.icon;
75
101
  },
@@ -77,20 +103,21 @@ const GlassPanel = (props)=>{
77
103
  return local.icon;
78
104
  }
79
105
  }), null);
80
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$3, ()=>local.title, null);
81
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$4, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
106
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$7, ()=>local.title, null);
107
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$8, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
82
108
  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)
83
109
  }), {
110
+ "aria-hidden": "true",
84
111
  fill: "none",
85
112
  viewBox: "0 0 24 24",
86
113
  stroke: "currentColor",
87
114
  "stroke-width": "1.5"
88
115
  }), true, true);
89
- return _el$2;
116
+ return _el$6;
90
117
  }
91
- }), _el$5);
92
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$5, "id", contentId);
93
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$5, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
118
+ }), _el$9);
119
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$9, "id", contentId);
120
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$9, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
94
121
  class: contentClasses()
95
122
  }), {
96
123
  get style () {
@@ -100,10 +127,10 @@ const GlassPanel = (props)=>{
100
127
  };
101
128
  }
102
129
  }), false, true);
103
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$6, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
130
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$0, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(()=>({
104
131
  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)
105
132
  })), false, true);
106
- (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$6, ()=>local.children);
133
+ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$0, ()=>local.children);
107
134
  return _el$;
108
135
  })();
109
136
  };
@@ -1 +1 @@
1
- export { default, type GlassPanelProps, type GlassPanelBlur } from "./GlassPanel";
1
+ export { default, type GlassPanelBlur, type GlassPanelEffect, type GlassPanelProps, } from "./GlassPanel";