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/README.md +585 -585
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +29 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import { createContext, useState, useEffect, useRef, useCallback, useContext, useId } from 'react';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
|
-
//
|
|
4
|
+
// #style-inject:#style-inject
|
|
5
|
+
function styleInject(css, { insertAt } = {}) {
|
|
6
|
+
if (typeof document === "undefined") return;
|
|
7
|
+
const head = document.head || document.getElementsByTagName("head")[0];
|
|
8
|
+
const style = document.createElement("style");
|
|
9
|
+
style.type = "text/css";
|
|
10
|
+
if (insertAt === "top") {
|
|
11
|
+
if (head.firstChild) {
|
|
12
|
+
head.insertBefore(style, head.firstChild);
|
|
13
|
+
} else {
|
|
14
|
+
head.appendChild(style);
|
|
15
|
+
}
|
|
16
|
+
} else {
|
|
17
|
+
head.appendChild(style);
|
|
18
|
+
}
|
|
19
|
+
if (style.styleSheet) {
|
|
20
|
+
style.styleSheet.cssText = css;
|
|
21
|
+
} else {
|
|
22
|
+
style.appendChild(document.createTextNode(css));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// src/styles.css
|
|
27
|
+
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");
|
|
5
28
|
function useDarkMode() {
|
|
6
29
|
const [isDark, setIsDark] = useState(false);
|
|
7
30
|
useEffect(() => {
|
|
@@ -932,7 +955,8 @@ function StaffSidebar({
|
|
|
932
955
|
collapsible = false,
|
|
933
956
|
isOpen: controlledIsOpen,
|
|
934
957
|
onToggle,
|
|
935
|
-
onExpandRequest
|
|
958
|
+
onExpandRequest,
|
|
959
|
+
topOffset = 0
|
|
936
960
|
}) {
|
|
937
961
|
const isDark = useDarkMode();
|
|
938
962
|
const [internalOpen, setInternalOpen] = useState(true);
|
|
@@ -966,9 +990,9 @@ function StaffSidebar({
|
|
|
966
990
|
className,
|
|
967
991
|
style: {
|
|
968
992
|
position: "fixed",
|
|
969
|
-
top:
|
|
993
|
+
top: topOffset,
|
|
970
994
|
left: 0,
|
|
971
|
-
height:
|
|
995
|
+
height: `calc(100vh - ${typeof topOffset === "number" ? topOffset + "px" : topOffset})`,
|
|
972
996
|
width: currentWidth,
|
|
973
997
|
background: isDark ? "#1e293b" : "#fff",
|
|
974
998
|
borderRight: `1px solid ${isDark ? "#374151" : "var(--color-border-colors-neutral, #c8cedd)"}`,
|
|
@@ -1041,7 +1065,7 @@ function StaffSidebar({
|
|
|
1041
1065
|
title: sidebarOpen ? "\u0E22\u0E48\u0E2D Sidebar" : "\u0E02\u0E22\u0E32\u0E22 Sidebar",
|
|
1042
1066
|
style: {
|
|
1043
1067
|
position: "fixed",
|
|
1044
|
-
top: "
|
|
1068
|
+
top: `calc(${typeof topOffset === "number" ? topOffset + "px" : topOffset} + 10vh)`,
|
|
1045
1069
|
left: currentWidth,
|
|
1046
1070
|
zIndex: 51,
|
|
1047
1071
|
width: "24px",
|