gov-layout 1.3.4 → 1.3.5

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/index.d.mts CHANGED
@@ -53,7 +53,9 @@ interface StaffSidebarProps {
53
53
  onExpandRequest?: () => void;
54
54
  }
55
55
 
56
- declare function StaffSidebar({ orgLogo, orgName, orgSubtitle, menuItems, bottomMenuItems, user, roleLabel, onNavigate, onLogout, onProfile, currentPath, width, className, collapsible, isOpen: controlledIsOpen, onToggle, onExpandRequest, }: StaffSidebarProps): react_jsx_runtime.JSX.Element;
56
+ declare function StaffSidebar({ orgLogo, orgName, orgSubtitle, menuItems, bottomMenuItems, user, roleLabel, onNavigate, onLogout, onProfile, currentPath, width, className, collapsible, isOpen: controlledIsOpen, onToggle, onExpandRequest, topOffset, }: StaffSidebarProps & {
57
+ topOffset?: number | string;
58
+ }): react_jsx_runtime.JSX.Element;
57
59
 
58
60
  interface SidebarHeaderProps {
59
61
  orgLogo?: string;
package/dist/index.d.ts CHANGED
@@ -53,7 +53,9 @@ interface StaffSidebarProps {
53
53
  onExpandRequest?: () => void;
54
54
  }
55
55
 
56
- declare function StaffSidebar({ orgLogo, orgName, orgSubtitle, menuItems, bottomMenuItems, user, roleLabel, onNavigate, onLogout, onProfile, currentPath, width, className, collapsible, isOpen: controlledIsOpen, onToggle, onExpandRequest, }: StaffSidebarProps): react_jsx_runtime.JSX.Element;
56
+ declare function StaffSidebar({ orgLogo, orgName, orgSubtitle, menuItems, bottomMenuItems, user, roleLabel, onNavigate, onLogout, onProfile, currentPath, width, className, collapsible, isOpen: controlledIsOpen, onToggle, onExpandRequest, topOffset, }: StaffSidebarProps & {
57
+ topOffset?: number | string;
58
+ }): react_jsx_runtime.JSX.Element;
57
59
 
58
60
  interface SidebarHeaderProps {
59
61
  orgLogo?: string;
package/dist/index.js CHANGED
@@ -3,7 +3,30 @@
3
3
  var react = require('react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
 
6
- // src/sidebar/StaffSidebar.tsx
6
+ // #style-inject:#style-inject
7
+ function styleInject(css, { insertAt } = {}) {
8
+ if (typeof document === "undefined") return;
9
+ const head = document.head || document.getElementsByTagName("head")[0];
10
+ const style = document.createElement("style");
11
+ style.type = "text/css";
12
+ if (insertAt === "top") {
13
+ if (head.firstChild) {
14
+ head.insertBefore(style, head.firstChild);
15
+ } else {
16
+ head.appendChild(style);
17
+ }
18
+ } else {
19
+ head.appendChild(style);
20
+ }
21
+ if (style.styleSheet) {
22
+ style.styleSheet.cssText = css;
23
+ } else {
24
+ style.appendChild(document.createTextNode(css));
25
+ }
26
+ }
27
+
28
+ // src/styles.css
29
+ styleInject(".text-primary,\n.text-text-primary {\n color: var(--color-alias-text-colors-primary, #060d26);\n}\n.text-secondary,\n.text-text-secondary {\n color: var(--color-alias-text-colors-secondary, #1e7d55);\n}\n.text-tertiary,\n.text-text-tertiary {\n color: var(--color-alias-text-colors-tertiary, #475272);\n}\n.text-placeholder,\n.text-text-placeholder {\n color: var(--color-alias-text-colors-placeholder, #707993);\n}\n.text-critical,\n.text-text-critical {\n color: var(--color-alias-text-colors-critical, #f21515);\n}\n");
7
30
  function useDarkMode() {
8
31
  const [isDark, setIsDark] = react.useState(false);
9
32
  react.useEffect(() => {
@@ -934,7 +957,8 @@ function StaffSidebar({
934
957
  collapsible = false,
935
958
  isOpen: controlledIsOpen,
936
959
  onToggle,
937
- onExpandRequest
960
+ onExpandRequest,
961
+ topOffset = 0
938
962
  }) {
939
963
  const isDark = useDarkMode();
940
964
  const [internalOpen, setInternalOpen] = react.useState(true);
@@ -968,9 +992,9 @@ function StaffSidebar({
968
992
  className,
969
993
  style: {
970
994
  position: "fixed",
971
- top: 0,
995
+ top: topOffset,
972
996
  left: 0,
973
- height: "100vh",
997
+ height: `calc(100vh - ${typeof topOffset === "number" ? topOffset + "px" : topOffset})`,
974
998
  width: currentWidth,
975
999
  background: isDark ? "#1e293b" : "#fff",
976
1000
  borderRight: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
@@ -1043,7 +1067,7 @@ function StaffSidebar({
1043
1067
  title: sidebarOpen ? "\u0E22\u0E48\u0E2D Sidebar" : "\u0E02\u0E22\u0E32\u0E22 Sidebar",
1044
1068
  style: {
1045
1069
  position: "fixed",
1046
- top: "10%",
1070
+ top: `calc(${typeof topOffset === "number" ? topOffset + "px" : topOffset} + 10vh)`,
1047
1071
  left: currentWidth,
1048
1072
  zIndex: 51,
1049
1073
  width: "24px",