@pathscale/ui 1.1.79 → 1.1.81
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 +199 -62
- package/dist/components/glass-panel/GlassPanel.js +33 -25
- package/dist/components/glow-card/GlowCard.css +14 -16
- package/dist/motion/index.d.ts +2 -0
- package/dist/motion/index.js +6 -1
- package/dist/motion/solid/AnimatedCollapse.d.ts +35 -0
- package/dist/motion/solid/AnimatedCollapse.js +166 -0
- package/dist/motion/solid/Presence.d.ts +30 -0
- package/dist/motion/solid/Presence.js +65 -0
- package/dist/motion/solid/index.d.ts +4 -0
- package/dist/motion/solid/index.js +8 -1
- package/dist/purge-manifest.json +2544 -2544
- package/dist/styles/icons/generated-icons.css +1 -173
- package/dist/styles/themes/dark.css +62 -5
- package/dist/styles/themes/light.css +62 -5
- package/package.json +3 -2
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__ from "solid-js/web";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__driver_js_6225697c__ from "../driver.js";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__easing_js_1a315be3__ from "../easing.js";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__reduced_motion_js_a60363ae__ from "../reduced-motion.js";
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div><div>");
|
|
7
|
+
const nextCollapsePhase = (prev, open)=>{
|
|
8
|
+
if (open) return "open" === prev || "opening" === prev ? prev : "opening";
|
|
9
|
+
return "closed" === prev || "closing" === prev ? prev : "closing";
|
|
10
|
+
};
|
|
11
|
+
const computeCollapseStyle = (phase, heightPx, animateOpacity)=>{
|
|
12
|
+
const style = {
|
|
13
|
+
overflow: "hidden"
|
|
14
|
+
};
|
|
15
|
+
if ("closed" === phase) {
|
|
16
|
+
style.height = "0px";
|
|
17
|
+
if (animateOpacity) style.opacity = 0;
|
|
18
|
+
return style;
|
|
19
|
+
}
|
|
20
|
+
if ("open" === phase) {
|
|
21
|
+
if (animateOpacity) style.opacity = 1;
|
|
22
|
+
style.overflow = "visible";
|
|
23
|
+
return style;
|
|
24
|
+
}
|
|
25
|
+
if (null !== heightPx) style.height = `${heightPx}px`;
|
|
26
|
+
return style;
|
|
27
|
+
};
|
|
28
|
+
const DEFAULT_DURATION = 0.24;
|
|
29
|
+
const AnimatedCollapse = (props)=>{
|
|
30
|
+
const [phase, setPhase] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(props.open ? "open" : "closed");
|
|
31
|
+
const [heightPx, setHeightPx] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(props.open ? null : 0);
|
|
32
|
+
const [opacity, setOpacity] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(props.open ? 1 : 0);
|
|
33
|
+
let contentEl;
|
|
34
|
+
let activeControl = null;
|
|
35
|
+
let resizeObserver = null;
|
|
36
|
+
const stopActive = ()=>{
|
|
37
|
+
activeControl?.stop();
|
|
38
|
+
activeControl = null;
|
|
39
|
+
};
|
|
40
|
+
const measure = ()=>{
|
|
41
|
+
if (!contentEl) return 0;
|
|
42
|
+
return contentEl.scrollHeight;
|
|
43
|
+
};
|
|
44
|
+
const animateOpacity = ()=>false !== props.animateOpacity;
|
|
45
|
+
const setupObserver = ()=>{
|
|
46
|
+
if ("undefined" == typeof ResizeObserver) return;
|
|
47
|
+
if (!contentEl || resizeObserver) return;
|
|
48
|
+
resizeObserver = new ResizeObserver(()=>{});
|
|
49
|
+
resizeObserver.observe(contentEl);
|
|
50
|
+
};
|
|
51
|
+
const teardownObserver = ()=>{
|
|
52
|
+
resizeObserver?.disconnect();
|
|
53
|
+
resizeObserver = null;
|
|
54
|
+
};
|
|
55
|
+
const runAnimation = (target, fromHeight, toHeight)=>{
|
|
56
|
+
stopActive();
|
|
57
|
+
const reduce = props.reduceMotion ?? (0, __WEBPACK_EXTERNAL_MODULE__reduced_motion_js_a60363ae__.prefersReducedMotion)();
|
|
58
|
+
if (reduce) {
|
|
59
|
+
setHeightPx(toHeight);
|
|
60
|
+
if (animateOpacity()) setOpacity("opening" === target ? 1 : 0);
|
|
61
|
+
finish(target);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const duration = (props.duration ?? DEFAULT_DURATION) * 1000;
|
|
65
|
+
const ease = (0, __WEBPACK_EXTERNAL_MODULE__easing_js_1a315be3__.resolveEase)("ease-out");
|
|
66
|
+
const driver = (0, __WEBPACK_EXTERNAL_MODULE__driver_js_6225697c__.getMotionDriver)();
|
|
67
|
+
const heightControl = driver({
|
|
68
|
+
from: fromHeight,
|
|
69
|
+
to: toHeight,
|
|
70
|
+
duration,
|
|
71
|
+
ease,
|
|
72
|
+
onUpdate: (value)=>setHeightPx(value),
|
|
73
|
+
onComplete: ()=>finish(target)
|
|
74
|
+
});
|
|
75
|
+
if (animateOpacity()) {
|
|
76
|
+
const fromOpacity = "opening" === target ? 0 : 1;
|
|
77
|
+
const toOpacity = "opening" === target ? 1 : 0;
|
|
78
|
+
const opacityControl = driver({
|
|
79
|
+
from: fromOpacity,
|
|
80
|
+
to: toOpacity,
|
|
81
|
+
duration,
|
|
82
|
+
ease,
|
|
83
|
+
onUpdate: (value)=>setOpacity(value)
|
|
84
|
+
});
|
|
85
|
+
activeControl = {
|
|
86
|
+
stop: ()=>{
|
|
87
|
+
heightControl.stop();
|
|
88
|
+
opacityControl.stop();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
} else {
|
|
92
|
+
setOpacity(1);
|
|
93
|
+
activeControl = heightControl;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const finish = (target)=>{
|
|
97
|
+
if ("opening" === target) {
|
|
98
|
+
setPhase("open");
|
|
99
|
+
setHeightPx(null);
|
|
100
|
+
if (animateOpacity()) setOpacity(1);
|
|
101
|
+
} else if ("closing" === target) {
|
|
102
|
+
setPhase("closed");
|
|
103
|
+
setHeightPx(0);
|
|
104
|
+
if (animateOpacity()) setOpacity(0);
|
|
105
|
+
teardownObserver();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
|
|
109
|
+
const open = props.open;
|
|
110
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.untrack)(()=>{
|
|
111
|
+
const target = nextCollapsePhase(phase(), open);
|
|
112
|
+
if (target === phase()) return;
|
|
113
|
+
setPhase(target);
|
|
114
|
+
if ("opening" === target) requestAnimationFrame(()=>{
|
|
115
|
+
const to = measure();
|
|
116
|
+
setupObserver();
|
|
117
|
+
runAnimation("opening", 0, to);
|
|
118
|
+
});
|
|
119
|
+
else if ("closing" === target) {
|
|
120
|
+
const from = measure();
|
|
121
|
+
setHeightPx(from);
|
|
122
|
+
requestAnimationFrame(()=>runAnimation("closing", from, 0));
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
127
|
+
stopActive();
|
|
128
|
+
teardownObserver();
|
|
129
|
+
});
|
|
130
|
+
const shouldRender = ()=>props.unmountOnExit ? "closed" !== phase() : true;
|
|
131
|
+
const wrapperStyle = ()=>computeCollapseStyle(phase(), heightPx(), animateOpacity());
|
|
132
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
133
|
+
get when () {
|
|
134
|
+
return shouldRender();
|
|
135
|
+
},
|
|
136
|
+
get children () {
|
|
137
|
+
var _el$ = _tmpl$(), _el$2 = _el$.firstChild;
|
|
138
|
+
var _ref$ = contentEl;
|
|
139
|
+
"function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$2) : contentEl = _el$2;
|
|
140
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$2, ()=>props.children);
|
|
141
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
|
|
142
|
+
var _v$ = props.id, _v$2 = props.class, _v$3 = {
|
|
143
|
+
...wrapperStyle(),
|
|
144
|
+
...animateOpacity() && "open" !== phase() ? {
|
|
145
|
+
opacity: opacity()
|
|
146
|
+
} : {}
|
|
147
|
+
}, _v$4 = "closed" === phase() ? true : void 0, _v$5 = props.contentClass;
|
|
148
|
+
_v$ !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "id", _p$.e = _v$);
|
|
149
|
+
_v$2 !== _p$.t && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$, _p$.t = _v$2);
|
|
150
|
+
_p$.a = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.style)(_el$, _v$3, _p$.a);
|
|
151
|
+
_v$4 !== _p$.o && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$, "aria-hidden", _p$.o = _v$4);
|
|
152
|
+
_v$5 !== _p$.i && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$2, _p$.i = _v$5);
|
|
153
|
+
return _p$;
|
|
154
|
+
}, {
|
|
155
|
+
e: void 0,
|
|
156
|
+
t: void 0,
|
|
157
|
+
a: void 0,
|
|
158
|
+
o: void 0,
|
|
159
|
+
i: void 0
|
|
160
|
+
});
|
|
161
|
+
return _el$;
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
const solid_AnimatedCollapse = AnimatedCollapse;
|
|
166
|
+
export { AnimatedCollapse, computeCollapseStyle, solid_AnimatedCollapse as default, nextCollapsePhase };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
export type PresenceRenderProp = (isExiting: () => boolean, onExitComplete: () => void) => JSX.Element;
|
|
3
|
+
export interface PresenceProps {
|
|
4
|
+
/** Controls whether the child should be mounted/visible. */
|
|
5
|
+
when: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Render function. Receives an `isExiting` accessor (pass through to
|
|
8
|
+
* MotionDiv's `isExiting`) and an `onExitComplete` callback that must be
|
|
9
|
+
* wired to MotionDiv (or invoked manually when the exit animation ends).
|
|
10
|
+
*/
|
|
11
|
+
children: PresenceRenderProp;
|
|
12
|
+
/**
|
|
13
|
+
* Fallback timeout (ms) after which Presence force-unmounts the child if
|
|
14
|
+
* `onExitComplete` was never called. Prevents stuck-exit states. Default 800.
|
|
15
|
+
*/
|
|
16
|
+
exitTimeout?: number;
|
|
17
|
+
/** Override for prefers-reduced-motion detection. */
|
|
18
|
+
reduceMotion?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface PresenceState {
|
|
21
|
+
mounted: boolean;
|
|
22
|
+
isExiting: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Pure state transition for Presence. Given the previous state and the next
|
|
26
|
+
* `when` value, returns the next state. Exposed for unit testing.
|
|
27
|
+
*/
|
|
28
|
+
export declare const nextPresenceState: (prev: PresenceState, when: boolean) => PresenceState;
|
|
29
|
+
export declare const Presence: (props: PresenceProps) => JSX.Element;
|
|
30
|
+
export default Presence;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__ from "solid-js/web";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__ from "solid-js";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__reduced_motion_js_a60363ae__ from "../reduced-motion.js";
|
|
4
|
+
const nextPresenceState = (prev, when)=>{
|
|
5
|
+
if (when) return {
|
|
6
|
+
mounted: true,
|
|
7
|
+
isExiting: false
|
|
8
|
+
};
|
|
9
|
+
if (prev.mounted && !prev.isExiting) return {
|
|
10
|
+
mounted: true,
|
|
11
|
+
isExiting: true
|
|
12
|
+
};
|
|
13
|
+
return prev.mounted ? prev : {
|
|
14
|
+
mounted: false,
|
|
15
|
+
isExiting: false
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
const DEFAULT_EXIT_TIMEOUT = 800;
|
|
19
|
+
const Presence_Presence = (props)=>{
|
|
20
|
+
const [state, setState] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)({
|
|
21
|
+
mounted: props.when,
|
|
22
|
+
isExiting: false
|
|
23
|
+
});
|
|
24
|
+
let exitTimer = null;
|
|
25
|
+
const clearTimer = ()=>{
|
|
26
|
+
if (null !== exitTimer) {
|
|
27
|
+
clearTimeout(exitTimer);
|
|
28
|
+
exitTimer = null;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const finishExit = ()=>{
|
|
32
|
+
clearTimer();
|
|
33
|
+
setState((prev)=>prev.isExiting ? {
|
|
34
|
+
mounted: false,
|
|
35
|
+
isExiting: false
|
|
36
|
+
} : prev);
|
|
37
|
+
};
|
|
38
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
|
|
39
|
+
const when = props.when;
|
|
40
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.untrack)(()=>{
|
|
41
|
+
const next = nextPresenceState(state(), when);
|
|
42
|
+
if (next === state()) return;
|
|
43
|
+
setState(next);
|
|
44
|
+
if (next.isExiting) {
|
|
45
|
+
const reduce = props.reduceMotion ?? (0, __WEBPACK_EXTERNAL_MODULE__reduced_motion_js_a60363ae__.prefersReducedMotion)();
|
|
46
|
+
if (reduce) return void queueMicrotask(finishExit);
|
|
47
|
+
clearTimer();
|
|
48
|
+
const ms = props.exitTimeout ?? DEFAULT_EXIT_TIMEOUT;
|
|
49
|
+
exitTimer = setTimeout(finishExit, ms);
|
|
50
|
+
} else clearTimer();
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(clearTimer);
|
|
54
|
+
const isExiting = ()=>state().isExiting;
|
|
55
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
56
|
+
get when () {
|
|
57
|
+
return state().mounted;
|
|
58
|
+
},
|
|
59
|
+
get children () {
|
|
60
|
+
return props.children(isExiting, finishExit);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const Presence = Presence_Presence;
|
|
65
|
+
export { Presence_Presence as Presence, Presence as default, nextPresenceState };
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export { default as MotionDiv } from "./MotionDiv";
|
|
2
2
|
export type { MotionDivProps } from "./MotionDiv";
|
|
3
|
+
export { default as Presence, nextPresenceState } from "./Presence";
|
|
4
|
+
export type { PresenceProps, PresenceRenderProp } from "./Presence";
|
|
5
|
+
export { default as AnimatedCollapse, nextCollapsePhase, computeCollapseStyle, } from "./AnimatedCollapse";
|
|
6
|
+
export type { AnimatedCollapseProps } from "./AnimatedCollapse";
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE__MotionDiv_js_142518a8__ from "./MotionDiv.js";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__Presence_js_c85f5127__ from "./Presence.js";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__AnimatedCollapse_js_e9eaa465__ from "./AnimatedCollapse.js";
|
|
4
|
+
var __webpack_exports__AnimatedCollapse = __WEBPACK_EXTERNAL_MODULE__AnimatedCollapse_js_e9eaa465__["default"];
|
|
2
5
|
var __webpack_exports__MotionDiv = __WEBPACK_EXTERNAL_MODULE__MotionDiv_js_142518a8__["default"];
|
|
3
|
-
|
|
6
|
+
var __webpack_exports__Presence = __WEBPACK_EXTERNAL_MODULE__Presence_js_c85f5127__["default"];
|
|
7
|
+
var __webpack_exports__computeCollapseStyle = __WEBPACK_EXTERNAL_MODULE__AnimatedCollapse_js_e9eaa465__.computeCollapseStyle;
|
|
8
|
+
var __webpack_exports__nextCollapsePhase = __WEBPACK_EXTERNAL_MODULE__AnimatedCollapse_js_e9eaa465__.nextCollapsePhase;
|
|
9
|
+
var __webpack_exports__nextPresenceState = __WEBPACK_EXTERNAL_MODULE__Presence_js_c85f5127__.nextPresenceState;
|
|
10
|
+
export { __webpack_exports__AnimatedCollapse as AnimatedCollapse, __webpack_exports__MotionDiv as MotionDiv, __webpack_exports__Presence as Presence, __webpack_exports__computeCollapseStyle as computeCollapseStyle, __webpack_exports__nextCollapsePhase as nextCollapsePhase, __webpack_exports__nextPresenceState as nextPresenceState };
|