@pathscale/ui 0.0.153 → 0.0.155

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.
@@ -13,6 +13,8 @@ export type GlassPanelProps = IComponentBaseProps & JSX.HTMLAttributes<HTMLDivEl
13
13
  transparent?: boolean;
14
14
  glow?: boolean;
15
15
  accent?: ComponentColor;
16
+ paddingX?: string;
17
+ paddingY?: string;
16
18
  };
17
19
  declare const GlassPanel: (props: GlassPanelProps) => JSX.Element;
18
20
  export default GlassPanel;
package/dist/index.js CHANGED
@@ -10405,10 +10405,14 @@ function createSpring(initial, opts = {}) {
10405
10405
  velocity = 0;
10406
10406
  return;
10407
10407
  }
10408
- const force = -stiffness * (current - target);
10409
- const accel = (force - damping * velocity) / mass;
10410
- velocity += accel * dt;
10411
- current += velocity * dt;
10408
+ const substeps = Math.ceil(dt / 0.004);
10409
+ const subDt = dt / substeps;
10410
+ for(let i = 0; i < substeps; i++){
10411
+ const force = -stiffness * (current - target);
10412
+ const accel = (force - damping * velocity) / mass;
10413
+ velocity += accel * subDt;
10414
+ current += velocity * subDt;
10415
+ }
10412
10416
  if (Math.abs(current - target) < 0.01 && Math.abs(velocity) < 0.01) {
10413
10417
  current = target;
10414
10418
  velocity = 0;
@@ -10617,14 +10621,16 @@ const FloatingDockDesktop = (props)=>{
10617
10621
  s.sIH.step(dt);
10618
10622
  if (allSettled && !(s.sW.settled() && s.sH.settled() && s.sIW.settled() && s.sIH.settled())) allSettled = false;
10619
10623
  }
10624
+ const maxScale = cfg.hoverSize / cfg.baseSize;
10625
+ const maxIconScale = cfg.hoverIconSize / cfg.iconSize;
10620
10626
  for(let i = 0; i < itemSprings.length; i++){
10621
10627
  const s = itemSprings[i];
10622
10628
  if (s.wrapRef) {
10623
- const scale = s.sW.get() / cfg.baseSize;
10629
+ const scale = Math.max(0.8, Math.min(s.sW.get() / cfg.baseSize, maxScale));
10624
10630
  s.wrapRef.style.transform = `scale(${scale})`;
10625
10631
  }
10626
10632
  if (s.iconRef) {
10627
- const iconScale = s.sIW.get() / cfg.iconSize;
10633
+ const iconScale = Math.max(0.8, Math.min(s.sIW.get() / cfg.iconSize, maxIconScale));
10628
10634
  s.iconRef.style.transform = `scale(${iconScale})`;
10629
10635
  }
10630
10636
  }
@@ -10918,7 +10924,7 @@ const floating_dock_FloatingDock = FloatingDock;
10918
10924
  "click",
10919
10925
  "mousemove"
10920
10926
  ]);
10921
- var GlassPanel_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<button type=button class="flex w-full items-center justify-between gap-2 px-4 py-3 text-sm font-medium cursor-pointer select-none transition-colors duration-150 text-base-content/50 hover:text-base-content/80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"><span class="flex items-center gap-2"></span><svg fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=1.5><path stroke-linecap=round stroke-linejoin=round d="M19 9l-7 7-7-7">'), GlassPanel_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div><div class="grid transition-[grid-template-rows] duration-200 ease-in-out"><div>');
10927
+ var GlassPanel_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<button type=button class="flex w-full items-center justify-between gap-2 px-4 py-3 text-sm font-medium cursor-pointer select-none transition-colors duration-150 text-base-content/50 hover:text-base-content/80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"><span class="flex items-center gap-2"></span><svg fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=1.5><path stroke-linecap=round stroke-linejoin=round d="M19 9l-7 7-7-7">'), GlassPanel_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div><div><div class=overflow-hidden>");
10922
10928
  const BLUR_MAP = {
10923
10929
  none: "",
10924
10930
  sm: "backdrop-blur-sm",
@@ -10958,6 +10964,8 @@ const GlassPanel = (props)=>{
10958
10964
  "transparent",
10959
10965
  "glow",
10960
10966
  "accent",
10967
+ "paddingX",
10968
+ "paddingY",
10961
10969
  "children",
10962
10970
  "class",
10963
10971
  "className",
@@ -10992,7 +11000,7 @@ const GlassPanel = (props)=>{
10992
11000
  if (local.glow) base["box-shadow"] = "inset 0 1px 0 color-mix(in srgb, var(--color-base-content) 5%, transparent)";
10993
11001
  return base;
10994
11002
  };
10995
- const contentClasses = ()=>twMerge(SIZE_PADDING[size()]);
11003
+ const contentClasses = ()=>twMerge(local.paddingX || local.paddingY ? "" : SIZE_PADDING[size()], local.paddingX, local.paddingY);
10996
11004
  return (()=>{
10997
11005
  var _el$ = GlassPanel_tmpl$2(), _el$5 = _el$.firstChild, _el$6 = _el$5.firstChild;
10998
11006
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
@@ -11040,13 +11048,15 @@ const GlassPanel = (props)=>{
11040
11048
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.setAttribute)(_el$5, "id", contentId);
11041
11049
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$6, ()=>local.children);
11042
11050
  (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)((_p$)=>{
11043
- var _v$3 = !local.collapsible || isOpen() ? "1fr" : "0fr", _v$4 = `${!local.collapsible || isOpen() ? "overflow-visible" : "overflow-hidden"} ${contentClasses()}`;
11044
- _v$3 !== _p$.e && (null != (_p$.e = _v$3) ? _el$5.style.setProperty("grid-template-rows", _v$3) : _el$5.style.removeProperty("grid-template-rows"));
11045
- _v$4 !== _p$.t && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$6, _p$.t = _v$4);
11051
+ var _v$3 = `grid transition-[grid-template-rows,opacity] duration-200 ease-in-out overflow-hidden ${local.collapsible && !isOpen() ? "" : contentClasses()}`, _v$4 = !local.collapsible || isOpen() ? "1fr" : "0fr", _v$5 = !local.collapsible || isOpen() ? "1" : "0";
11052
+ _v$3 !== _p$.e && (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$5, _p$.e = _v$3);
11053
+ _v$4 !== _p$.t && (null != (_p$.t = _v$4) ? _el$5.style.setProperty("grid-template-rows", _v$4) : _el$5.style.removeProperty("grid-template-rows"));
11054
+ _v$5 !== _p$.a && (null != (_p$.a = _v$5) ? _el$5.style.setProperty("opacity", _v$5) : _el$5.style.removeProperty("opacity"));
11046
11055
  return _p$;
11047
11056
  }, {
11048
11057
  e: void 0,
11049
- t: void 0
11058
+ t: void 0,
11059
+ a: void 0
11050
11060
  });
11051
11061
  return _el$;
11052
11062
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathscale/ui",
3
- "version": "0.0.153",
3
+ "version": "0.0.155",
4
4
  "author": "pathscale",
5
5
  "repository": {
6
6
  "type": "git",
@@ -57,7 +57,7 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@iconify/tailwind4": "^1.2.1",
60
- "@pathscale/ui": "0.0.152",
60
+ "@pathscale/ui": "0.0.153",
61
61
  "rsbuild-plugin-iconify": "^1.0.3"
62
62
  },
63
63
  "peerDependencies": {