@homebound/beam 2.275.2 → 2.276.1

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.
@@ -129,7 +129,7 @@ exports.Icons = {
129
129
  floorPlan: ((0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.60712 4.5C3.60712 4.08579 3.9429 3.75 4.35712 3.75H12.2143H16.1428H20.0714C20.4856 3.75 20.8214 4.08579 20.8214 4.5V20.2143C20.8214 20.6285 20.4856 20.9643 20.0714 20.9643H15.5512C15.4788 20.9876 15.4015 21.0002 15.3214 21.0002C15.2412 21.0002 15.1639 20.9876 15.0915 20.9643H4.35712C3.9429 20.9643 3.60712 20.6285 3.60712 20.2143V12.3571C3.60712 11.9429 3.9429 11.6071 4.35712 11.6071C4.77133 11.6071 5.10712 11.9429 5.10712 12.3571V19.4643H14.5714V17.8216C14.5714 17.4074 14.9071 17.0716 15.3214 17.0716C15.7356 17.0716 16.0714 17.4074 16.0714 17.8216V19.4643H19.3214V13.0716H19.3214L11.3571 13.0716V13.9643C11.3571 14.3785 11.0213 14.7143 10.6071 14.7143C10.1929 14.7143 9.85712 14.3785 9.85712 13.9643V12.3305L9.85707 12.3216L9.85712 12.3127V10.75C9.85712 10.3358 10.1929 10 10.6071 10C11.0213 10 11.3571 10.3358 11.3571 10.75V11.5716L19.3214 11.5716H19.3214V5.25H16.1428L16.0714 5.25V7.67857C16.0714 8.09279 15.7356 8.42857 15.3214 8.42857C14.9071 8.42857 14.5714 8.09278 14.5714 7.67857V5.25H12.2143H5.10712V6.46429C5.10712 6.8785 4.77133 7.21429 4.35712 7.21429C3.9429 7.21429 3.60712 6.8785 3.60712 6.46429V4.5Z" })),
130
130
  chair: ((0, jsx_runtime_1.jsx)("path", { d: "M17.25 12.8V5.6C17.25 4.7176 16.5773 4 15.75 4H8.25C7.42275 4 6.75 4.7176 6.75 5.6V12.8C6.33525 12.8 6 13.1576 6 13.6V20H7.5V16H16.5V20H18V13.6C18 13.1576 17.6648 12.8 17.25 12.8ZM15.75 5.6V12.8H14.25V5.6H15.75ZM12.75 5.6V12.8H11.25V5.6H12.75ZM8.25 5.6H9.75V12.8H8.25V5.6Z" })),
131
131
  bolt: ((0, jsx_runtime_1.jsx)("path", { d: "M17.168 8H13L13.806 3.165C13.907 2.555 13.438 2 12.819 2H7.66702C7.17802 2 6.76102 2.354 6.68102 2.835L5.01402 12.835C4.91202 13.445 5.38202 14 6.00002 14H10V22L18.01 9.541C18.438 8.875 17.96 8 17.168 8Z" })),
132
- checklistComplete: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M6.40005 19.6H17.6C18.4824 19.6 19.2 18.8824 19.2 18V6C19.2 5.1176 18.4824 4.4 17.6 4.4H16C16 3.9576 15.6424 3.6 15.2 3.6H8.80005C8.35765 3.6 8.00005 3.9576 8.00005 4.4H6.40005C5.51765 4.4 4.80005 5.1176 4.80005 6V18C4.80005 18.8824 5.51765 19.6 6.40005 19.6ZM6.40005 6H8.00005V7.6H16V6H17.6V18H6.40005V6Z" }), (0, jsx_runtime_1.jsx)("path", { css: Css_1.Css.green600.$, d: "M11.2 12.8688L9.7656 11.4344L8.6344 12.5656L11.2 15.1312L15.3656 10.9656L14.2344 9.83438L11.2 12.8688Z" })] })),
132
+ checklistComplete: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M6.40005 19.6H17.6C18.4824 19.6 19.2 18.8824 19.2 18V6C19.2 5.1176 18.4824 4.4 17.6 4.4H16C16 3.9576 15.6424 3.6 15.2 3.6H8.80005C8.35765 3.6 8.00005 3.9576 8.00005 4.4H6.40005C5.51765 4.4 4.80005 5.1176 4.80005 6V18C4.80005 18.8824 5.51765 19.6 6.40005 19.6ZM6.40005 6H8.00005V7.6H16V6H17.6V18H6.40005V6Z" }), (0, jsx_runtime_1.jsx)("path", { css: Css_1.Css.green500.$, d: "M11.2 12.8688L9.7656 11.4344L8.6344 12.5656L11.2 15.1312L15.3656 10.9656L14.2344 9.83438L11.2 12.8688Z" })] })),
133
133
  checklistNotComplete: ((0, jsx_runtime_1.jsx)("path", { d: "M6.40005 19.6H17.6C18.4824 19.6 19.2 18.8824 19.2 18V6C19.2 5.1176 18.4824 4.4 17.6 4.4H16C16 3.9576 15.6424 3.6 15.2 3.6H8.80005C8.35765 3.6 8.00005 3.9576 8.00005 4.4H6.40005C5.51765 4.4 4.80005 5.1176 4.80005 6V18C4.80005 18.8824 5.51765 19.6 6.40005 19.6ZM6.40005 6H8.00005V7.6H16V6H17.6V18H6.40005V6Z" })),
134
134
  // Navigation
135
135
  projects: ((0, jsx_runtime_1.jsx)("path", { d: "M4 6H6V8H4V6ZM4 11H6V13H4V11ZM4 16H6V18H4V16ZM20 8V6H18.8H9.2H8.023V8H9.2H18.8H20ZM8 11H20V13H8V11ZM8 16H20V18H8V16Z" })),
@@ -14,14 +14,22 @@ function ScrollShadows(props) {
14
14
  if (!bgColor.includes("rgba")) {
15
15
  throw new Error("ScrollShadows: bgColor prop must be in the format 'rgba(255, 255, 255, 1)'");
16
16
  }
17
- const transparentBgColor = bgColor.replace(/,1\)$/, ",0)");
18
- const startShadowStyles = !horizontal ? src_1.Css.top0.left0.right0.hPx(40).$ : src_1.Css.left0.top0.bottom0.wPx(25).$;
19
- const endShadowStyles = !horizontal ? src_1.Css.bottom0.left0.right0.hPx(40).$ : src_1.Css.right0.top0.bottom0.wPx(25).$;
20
- const startGradientDeg = !horizontal ? 180 : 90;
21
- const endGradientDeg = !horizontal ? 0 : 270;
22
17
  const [showStartShadow, setShowStartShadow] = (0, react_1.useState)(false);
23
18
  const [showEndShadow, setShowEndShadow] = (0, react_1.useState)(false);
24
19
  const scrollRef = (0, react_1.useRef)(null);
20
+ // The shadow styles will rarely every change. Memoize them to avoid recomputing them when we don't have to.
21
+ const [startShadowStyles, endShadowStyles] = (0, react_1.useMemo)(() => {
22
+ const transparentBgColor = bgColor.replace(/,1\)$/, ",0)");
23
+ const commonStyles = src_1.Css.absolute.z3.$;
24
+ const startShadowStyles = !horizontal ? src_1.Css.top0.left0.right0.hPx(40).$ : src_1.Css.left0.top0.bottom0.wPx(25).$;
25
+ const endShadowStyles = !horizontal ? src_1.Css.bottom0.left0.right0.hPx(40).$ : src_1.Css.right0.top0.bottom0.wPx(25).$;
26
+ const startGradient = `linear-gradient(${!horizontal ? 180 : 90}deg, ${bgColor} 0%, ${transparentBgColor} 92%);`;
27
+ const endGradient = `linear-gradient(${!horizontal ? 0 : 270}deg, ${bgColor} 0%, ${transparentBgColor} 92%);`;
28
+ return [
29
+ { ...commonStyles, ...startShadowStyles, ...src_1.Css.add("background", startGradient).$ },
30
+ { ...commonStyles, ...endShadowStyles, ...src_1.Css.add("background", endGradient).$ },
31
+ ];
32
+ }, [horizontal, bgColor]);
25
33
  const updateScrollProps = (0, react_1.useCallback)((el) => {
26
34
  const { scrollTop, scrollHeight, clientHeight, scrollWidth, scrollLeft, clientWidth } = el;
27
35
  const start = horizontal ? scrollLeft : scrollTop;
@@ -37,13 +45,7 @@ function ScrollShadows(props) {
37
45
  return ((0, jsx_runtime_1.jsxs)("div", { css: src_1.Css.relative.overflowHidden
38
46
  .h(height)
39
47
  .w(width)
40
- .df.fd(!horizontal ? "column" : "row").$, ...tid, children: [showStartShadow && ((0, jsx_runtime_1.jsx)("div", { css: {
41
- ...startShadowStyles,
42
- ...src_1.Css.absolute.add("background", `linear-gradient(${startGradientDeg}deg, ${bgColor} 0%, ${transparentBgColor} 92%);`).$,
43
- } })), showEndShadow && ((0, jsx_runtime_1.jsx)("div", { css: {
44
- ...endShadowStyles,
45
- ...src_1.Css.absolute.add("background", `linear-gradient(${endGradientDeg}deg, ${bgColor} 0%, ${transparentBgColor} 92%)`).$,
46
- } })), (0, jsx_runtime_1.jsx)("div", { css: {
48
+ .df.fd(!horizontal ? "column" : "row").$, ...tid, children: [showStartShadow && (0, jsx_runtime_1.jsx)("div", { css: startShadowStyles }), showEndShadow && (0, jsx_runtime_1.jsx)("div", { css: endShadowStyles }), (0, jsx_runtime_1.jsx)("div", { css: {
47
49
  ...xss,
48
50
  ...src_1.Css.overflowAuto.fg1.addIn("&::-webkit-scrollbar", { display: "none" }).add("scrollbarWidth", "none").$,
49
51
  }, onScroll: (e) => updateScrollProps(e.currentTarget), ref: scrollRef, children: children })] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/beam",
3
- "version": "2.275.2",
3
+ "version": "2.276.1",
4
4
  "author": "Homebound",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",