@scripso-homepad/ui 0.4.27 → 0.4.29
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/web/index.cjs +37 -13
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +6 -2
- package/dist/web/index.d.ts +6 -2
- package/dist/web/index.js +37 -13
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/src/web/components/ConfirmModal.tsx +6 -3
- package/src/web/components/Drawer.tsx +25 -3
- package/src/web/components/Modal.tsx +11 -5
- package/src/web/layout/AppHeader.tsx +5 -0
package/dist/web/index.cjs
CHANGED
|
@@ -29434,6 +29434,7 @@ function AppHeader({
|
|
|
29434
29434
|
notificationsIcon,
|
|
29435
29435
|
searchIcon,
|
|
29436
29436
|
buildingChevronIcon,
|
|
29437
|
+
actions,
|
|
29437
29438
|
buildingSelectDisabled = false,
|
|
29438
29439
|
searchDisabled = false,
|
|
29439
29440
|
notificationsDisabled = false,
|
|
@@ -29451,6 +29452,7 @@ function AppHeader({
|
|
|
29451
29452
|
children: [
|
|
29452
29453
|
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "truncate typography-title text-slate-blue", children: title }),
|
|
29453
29454
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-3", children: [
|
|
29455
|
+
actions,
|
|
29454
29456
|
hasBuildingSelect ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
29455
29457
|
BuildingSelect,
|
|
29456
29458
|
{
|
|
@@ -31129,6 +31131,8 @@ function Modal({
|
|
|
31129
31131
|
subtitle,
|
|
31130
31132
|
icon,
|
|
31131
31133
|
iconContainerClassName,
|
|
31134
|
+
titleClassName,
|
|
31135
|
+
subtitleClassName,
|
|
31132
31136
|
children,
|
|
31133
31137
|
cancelText,
|
|
31134
31138
|
confirmText,
|
|
@@ -31165,9 +31169,8 @@ function Modal({
|
|
|
31165
31169
|
return null;
|
|
31166
31170
|
}
|
|
31167
31171
|
const sharedButtonClassName = cn(
|
|
31168
|
-
"btn h-13 w-full justify-center!",
|
|
31169
|
-
|
|
31170
|
-
footerLayout !== "split" && buttonClassName
|
|
31172
|
+
"btn h-13 w-full! min-w-0! justify-center!",
|
|
31173
|
+
buttonClassName
|
|
31171
31174
|
);
|
|
31172
31175
|
const modal = /* @__PURE__ */ jsxRuntime.jsx(
|
|
31173
31176
|
"div",
|
|
@@ -31210,7 +31213,7 @@ function Modal({
|
|
|
31210
31213
|
"h2",
|
|
31211
31214
|
{
|
|
31212
31215
|
id: "homepad-modal-title",
|
|
31213
|
-
className: "typography-title-sm tracking-normal text-black",
|
|
31216
|
+
className: cn("typography-title-sm tracking-normal text-black", titleClassName),
|
|
31214
31217
|
children: title
|
|
31215
31218
|
}
|
|
31216
31219
|
),
|
|
@@ -31218,7 +31221,10 @@ function Modal({
|
|
|
31218
31221
|
"p",
|
|
31219
31222
|
{
|
|
31220
31223
|
id: "homepad-modal-subtitle",
|
|
31221
|
-
className:
|
|
31224
|
+
className: cn(
|
|
31225
|
+
"typography-caption tracking-normal text-storm-gray-400",
|
|
31226
|
+
subtitleClassName
|
|
31227
|
+
),
|
|
31222
31228
|
children: subtitle
|
|
31223
31229
|
}
|
|
31224
31230
|
) : null
|
|
@@ -31308,23 +31314,36 @@ function Drawer({
|
|
|
31308
31314
|
}) {
|
|
31309
31315
|
const [isPresent, setIsPresent] = react.useState(open);
|
|
31310
31316
|
const [isAnimatedIn, setIsAnimatedIn] = react.useState(false);
|
|
31317
|
+
const [isTransformSettled, setIsTransformSettled] = react.useState(open);
|
|
31311
31318
|
react.useEffect(() => {
|
|
31312
31319
|
if (open) {
|
|
31313
31320
|
setIsPresent(true);
|
|
31314
|
-
|
|
31321
|
+
setIsTransformSettled(false);
|
|
31322
|
+
const frame2 = window.requestAnimationFrame(() => {
|
|
31315
31323
|
window.requestAnimationFrame(() => {
|
|
31316
31324
|
setIsAnimatedIn(true);
|
|
31317
31325
|
});
|
|
31318
31326
|
});
|
|
31327
|
+
const settleTimeout = window.setTimeout(() => {
|
|
31328
|
+
setIsTransformSettled(true);
|
|
31329
|
+
}, DRAWER_TRANSITION_MS);
|
|
31319
31330
|
return () => {
|
|
31320
|
-
window.cancelAnimationFrame(
|
|
31331
|
+
window.cancelAnimationFrame(frame2);
|
|
31332
|
+
window.clearTimeout(settleTimeout);
|
|
31321
31333
|
};
|
|
31322
31334
|
}
|
|
31323
|
-
|
|
31335
|
+
setIsTransformSettled(false);
|
|
31336
|
+
setIsAnimatedIn(true);
|
|
31337
|
+
const frame = window.requestAnimationFrame(() => {
|
|
31338
|
+
window.requestAnimationFrame(() => {
|
|
31339
|
+
setIsAnimatedIn(false);
|
|
31340
|
+
});
|
|
31341
|
+
});
|
|
31324
31342
|
const timeout = window.setTimeout(() => {
|
|
31325
31343
|
setIsPresent(false);
|
|
31326
31344
|
}, DRAWER_TRANSITION_MS);
|
|
31327
31345
|
return () => {
|
|
31346
|
+
window.cancelAnimationFrame(frame);
|
|
31328
31347
|
window.clearTimeout(timeout);
|
|
31329
31348
|
};
|
|
31330
31349
|
}, [open]);
|
|
@@ -31373,8 +31392,10 @@ function Drawer({
|
|
|
31373
31392
|
"aria-labelledby": "homepad-drawer-title",
|
|
31374
31393
|
...subtitle ? { "aria-describedby": "homepad-drawer-subtitle" } : {},
|
|
31375
31394
|
className: cn(
|
|
31376
|
-
"relative z-10 flex h-[calc(100dvh-16px)] min-h-0 flex-col overflow-hidden rounded-[16px] bg-white shadow-2xl transition-transform duration-300 ease-in-out
|
|
31377
|
-
|
|
31395
|
+
"relative z-10 flex h-[calc(100dvh-16px)] min-h-0 flex-col overflow-hidden rounded-[16px] bg-white shadow-2xl transition-transform duration-300 ease-in-out max-md:h-dvh max-md:rounded-none",
|
|
31396
|
+
// Keep GPU transform only while animating — settled translate-x-0 blurs text.
|
|
31397
|
+
!isTransformSettled && "will-change-transform",
|
|
31398
|
+
isAnimatedIn ? isTransformSettled ? "transform-none" : "translate-x-0" : "translate-x-full",
|
|
31378
31399
|
widthClassName,
|
|
31379
31400
|
className
|
|
31380
31401
|
),
|
|
@@ -31713,7 +31734,10 @@ function ConfirmModal({
|
|
|
31713
31734
|
if (!open) {
|
|
31714
31735
|
return null;
|
|
31715
31736
|
}
|
|
31716
|
-
const sharedButtonClassName = cn(
|
|
31737
|
+
const sharedButtonClassName = cn(
|
|
31738
|
+
"btn h-10! w-full! min-w-0! justify-center!",
|
|
31739
|
+
buttonClassName
|
|
31740
|
+
);
|
|
31717
31741
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
31718
31742
|
"div",
|
|
31719
31743
|
{
|
|
@@ -31728,7 +31752,7 @@ function ConfirmModal({
|
|
|
31728
31752
|
"aria-labelledby": "homepad-confirm-modal-title",
|
|
31729
31753
|
"aria-describedby": "homepad-confirm-modal-description",
|
|
31730
31754
|
className: cn(
|
|
31731
|
-
"flex w-full max-w-md flex-col gap-8 rounded-
|
|
31755
|
+
"flex w-full max-w-md flex-col gap-8 rounded-3xl bg-white p-6 opacity-100 md:p-8",
|
|
31732
31756
|
containerClassName
|
|
31733
31757
|
),
|
|
31734
31758
|
onClick: (event) => {
|
|
@@ -31754,7 +31778,7 @@ function ConfirmModal({
|
|
|
31754
31778
|
}
|
|
31755
31779
|
)
|
|
31756
31780
|
] }),
|
|
31757
|
-
/* @__PURE__ */ jsxRuntime.jsxs("footer", { className: "
|
|
31781
|
+
/* @__PURE__ */ jsxRuntime.jsxs("footer", { className: "grid w-full grid-cols-2 gap-4", children: [
|
|
31758
31782
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31759
31783
|
Button,
|
|
31760
31784
|
{
|