@scripso-homepad/ui 0.4.28 → 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 +23 -6
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +3 -1
- package/dist/web/index.d.ts +3 -1
- package/dist/web/index.js +23 -6
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
- package/src/web/components/ConfirmModal.tsx +1 -1
- package/src/web/components/Drawer.tsx +25 -3
- package/src/web/layout/AppHeader.tsx +5 -0
package/dist/web/index.d.cts
CHANGED
|
@@ -63,6 +63,8 @@ type AppHeaderProps = {
|
|
|
63
63
|
notificationsIcon?: ReactNode;
|
|
64
64
|
searchIcon?: ReactNode;
|
|
65
65
|
buildingChevronIcon?: ReactNode;
|
|
66
|
+
/** Rendered before the building select (e.g. month period control). */
|
|
67
|
+
actions?: ReactNode;
|
|
66
68
|
buildingSelectDisabled?: boolean;
|
|
67
69
|
searchDisabled?: boolean;
|
|
68
70
|
notificationsDisabled?: boolean;
|
|
@@ -70,7 +72,7 @@ type AppHeaderProps = {
|
|
|
70
72
|
onNotificationsClick?: () => void;
|
|
71
73
|
onSearchChange?: (value: string) => void;
|
|
72
74
|
};
|
|
73
|
-
declare function AppHeader({ title, labels, hasBuildingSelect, showSearch, buildingOptions, selectedBuildingId, className, buildingSelectClassName, searchClassName, notificationsButtonClassName, searchValue, searchFieldStyle, buildingIcon, notificationsIcon, searchIcon, buildingChevronIcon, buildingSelectDisabled, searchDisabled, notificationsDisabled, onBuildingChange, onNotificationsClick, onSearchChange, }: AppHeaderProps): react.JSX.Element;
|
|
75
|
+
declare function AppHeader({ title, labels, hasBuildingSelect, showSearch, buildingOptions, selectedBuildingId, className, buildingSelectClassName, searchClassName, notificationsButtonClassName, searchValue, searchFieldStyle, buildingIcon, notificationsIcon, searchIcon, buildingChevronIcon, actions, buildingSelectDisabled, searchDisabled, notificationsDisabled, onBuildingChange, onNotificationsClick, onSearchChange, }: AppHeaderProps): react.JSX.Element;
|
|
74
76
|
|
|
75
77
|
type BuildingSelectProps = {
|
|
76
78
|
options: AdminBuildingOption[];
|
package/dist/web/index.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ type AppHeaderProps = {
|
|
|
63
63
|
notificationsIcon?: ReactNode;
|
|
64
64
|
searchIcon?: ReactNode;
|
|
65
65
|
buildingChevronIcon?: ReactNode;
|
|
66
|
+
/** Rendered before the building select (e.g. month period control). */
|
|
67
|
+
actions?: ReactNode;
|
|
66
68
|
buildingSelectDisabled?: boolean;
|
|
67
69
|
searchDisabled?: boolean;
|
|
68
70
|
notificationsDisabled?: boolean;
|
|
@@ -70,7 +72,7 @@ type AppHeaderProps = {
|
|
|
70
72
|
onNotificationsClick?: () => void;
|
|
71
73
|
onSearchChange?: (value: string) => void;
|
|
72
74
|
};
|
|
73
|
-
declare function AppHeader({ title, labels, hasBuildingSelect, showSearch, buildingOptions, selectedBuildingId, className, buildingSelectClassName, searchClassName, notificationsButtonClassName, searchValue, searchFieldStyle, buildingIcon, notificationsIcon, searchIcon, buildingChevronIcon, buildingSelectDisabled, searchDisabled, notificationsDisabled, onBuildingChange, onNotificationsClick, onSearchChange, }: AppHeaderProps): react.JSX.Element;
|
|
75
|
+
declare function AppHeader({ title, labels, hasBuildingSelect, showSearch, buildingOptions, selectedBuildingId, className, buildingSelectClassName, searchClassName, notificationsButtonClassName, searchValue, searchFieldStyle, buildingIcon, notificationsIcon, searchIcon, buildingChevronIcon, actions, buildingSelectDisabled, searchDisabled, notificationsDisabled, onBuildingChange, onNotificationsClick, onSearchChange, }: AppHeaderProps): react.JSX.Element;
|
|
74
76
|
|
|
75
77
|
type BuildingSelectProps = {
|
|
76
78
|
options: AdminBuildingOption[];
|
package/dist/web/index.js
CHANGED
|
@@ -28821,6 +28821,7 @@ function AppHeader({
|
|
|
28821
28821
|
notificationsIcon,
|
|
28822
28822
|
searchIcon,
|
|
28823
28823
|
buildingChevronIcon,
|
|
28824
|
+
actions,
|
|
28824
28825
|
buildingSelectDisabled = false,
|
|
28825
28826
|
searchDisabled = false,
|
|
28826
28827
|
notificationsDisabled = false,
|
|
@@ -28838,6 +28839,7 @@ function AppHeader({
|
|
|
28838
28839
|
children: [
|
|
28839
28840
|
/* @__PURE__ */ jsx("h1", { className: "truncate typography-title text-slate-blue", children: title }),
|
|
28840
28841
|
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-3", children: [
|
|
28842
|
+
actions,
|
|
28841
28843
|
hasBuildingSelect ? /* @__PURE__ */ jsx(
|
|
28842
28844
|
BuildingSelect,
|
|
28843
28845
|
{
|
|
@@ -30505,23 +30507,36 @@ function Drawer({
|
|
|
30505
30507
|
}) {
|
|
30506
30508
|
const [isPresent, setIsPresent] = useState(open);
|
|
30507
30509
|
const [isAnimatedIn, setIsAnimatedIn] = useState(false);
|
|
30510
|
+
const [isTransformSettled, setIsTransformSettled] = useState(open);
|
|
30508
30511
|
useEffect(() => {
|
|
30509
30512
|
if (open) {
|
|
30510
30513
|
setIsPresent(true);
|
|
30511
|
-
|
|
30514
|
+
setIsTransformSettled(false);
|
|
30515
|
+
const frame2 = window.requestAnimationFrame(() => {
|
|
30512
30516
|
window.requestAnimationFrame(() => {
|
|
30513
30517
|
setIsAnimatedIn(true);
|
|
30514
30518
|
});
|
|
30515
30519
|
});
|
|
30520
|
+
const settleTimeout = window.setTimeout(() => {
|
|
30521
|
+
setIsTransformSettled(true);
|
|
30522
|
+
}, DRAWER_TRANSITION_MS);
|
|
30516
30523
|
return () => {
|
|
30517
|
-
window.cancelAnimationFrame(
|
|
30524
|
+
window.cancelAnimationFrame(frame2);
|
|
30525
|
+
window.clearTimeout(settleTimeout);
|
|
30518
30526
|
};
|
|
30519
30527
|
}
|
|
30520
|
-
|
|
30528
|
+
setIsTransformSettled(false);
|
|
30529
|
+
setIsAnimatedIn(true);
|
|
30530
|
+
const frame = window.requestAnimationFrame(() => {
|
|
30531
|
+
window.requestAnimationFrame(() => {
|
|
30532
|
+
setIsAnimatedIn(false);
|
|
30533
|
+
});
|
|
30534
|
+
});
|
|
30521
30535
|
const timeout = window.setTimeout(() => {
|
|
30522
30536
|
setIsPresent(false);
|
|
30523
30537
|
}, DRAWER_TRANSITION_MS);
|
|
30524
30538
|
return () => {
|
|
30539
|
+
window.cancelAnimationFrame(frame);
|
|
30525
30540
|
window.clearTimeout(timeout);
|
|
30526
30541
|
};
|
|
30527
30542
|
}, [open]);
|
|
@@ -30570,8 +30585,10 @@ function Drawer({
|
|
|
30570
30585
|
"aria-labelledby": "homepad-drawer-title",
|
|
30571
30586
|
...subtitle ? { "aria-describedby": "homepad-drawer-subtitle" } : {},
|
|
30572
30587
|
className: cn(
|
|
30573
|
-
"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
|
|
30574
|
-
|
|
30588
|
+
"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",
|
|
30589
|
+
// Keep GPU transform only while animating — settled translate-x-0 blurs text.
|
|
30590
|
+
!isTransformSettled && "will-change-transform",
|
|
30591
|
+
isAnimatedIn ? isTransformSettled ? "transform-none" : "translate-x-0" : "translate-x-full",
|
|
30575
30592
|
widthClassName,
|
|
30576
30593
|
className
|
|
30577
30594
|
),
|
|
@@ -30928,7 +30945,7 @@ function ConfirmModal({
|
|
|
30928
30945
|
"aria-labelledby": "homepad-confirm-modal-title",
|
|
30929
30946
|
"aria-describedby": "homepad-confirm-modal-description",
|
|
30930
30947
|
className: cn(
|
|
30931
|
-
"flex w-full max-w-md flex-col gap-8 rounded-
|
|
30948
|
+
"flex w-full max-w-md flex-col gap-8 rounded-3xl bg-white p-6 opacity-100 md:p-8",
|
|
30932
30949
|
containerClassName
|
|
30933
30950
|
),
|
|
30934
30951
|
onClick: (event) => {
|