@google-psat/design-system 0.10.2 → 0.11.0
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/components/breadcrumbs/index.jsx +52 -0
- package/dist/components/breadcrumbs/index.jsx.map +1 -0
- package/dist/components/bulletList/listRow.jsx +32 -4
- package/dist/components/bulletList/listRow.jsx.map +1 -1
- package/dist/components/index.js +9 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/internalNavigationForAnchor/index.jsx +91 -0
- package/dist/components/internalNavigationForAnchor/index.jsx.map +1 -0
- package/dist/components/landingPage/constants.js +8 -3
- package/dist/components/landingPage/constants.js.map +1 -1
- package/dist/components/landingPage/contentPanel.jsx +1 -1
- package/dist/components/landingPage/contentPanel.jsx.map +1 -1
- package/dist/components/landingPage/index.jsx +11 -5
- package/dist/components/landingPage/index.jsx.map +1 -1
- package/dist/components/sidebar/collapsedSidebar.jsx +114 -0
- package/dist/components/sidebar/collapsedSidebar.jsx.map +1 -0
- package/dist/components/sidebar/expandedSidebar.jsx +99 -0
- package/dist/components/sidebar/expandedSidebar.jsx.map +1 -0
- package/dist/components/sidebar/sidebar.jsx +12 -49
- package/dist/components/sidebar/sidebar.jsx.map +1 -1
- package/dist/components/sidebar/sidebarChild.jsx +3 -5
- package/dist/components/sidebar/sidebarChild.jsx.map +1 -1
- package/dist/components/sidebar/useSidebar/constants.js +3 -2
- package/dist/components/sidebar/useSidebar/constants.js.map +1 -1
- package/dist/components/sidebar/useSidebar/context.js +5 -0
- package/dist/components/sidebar/useSidebar/context.js.map +1 -1
- package/dist/components/sidebar/useSidebar/provider.jsx +38 -1
- package/dist/components/sidebar/useSidebar/provider.jsx.map +1 -1
- package/dist/components/sidebar/useSidebar/utils/findNextItem.js +4 -1
- package/dist/components/sidebar/useSidebar/utils/findNextItem.js.map +1 -1
- package/dist/components/sidebar/useSidebar/utils/findPrevItem.js +1 -1
- package/dist/components/sidebar/useSidebar/utils/findPrevItem.js.map +1 -1
- package/dist/components/table/components/tableTopBar/index.jsx +1 -1
- package/dist/components/table/components/tableTopBar/index.jsx.map +1 -1
- package/dist/components/tabs/index.jsx +90 -0
- package/dist/components/tabs/index.jsx.map +1 -0
- package/dist/icons/index.jsx +19 -1
- package/dist/icons/index.jsx.map +1 -1
- package/dist-types/components/breadcrumbs/index.d.ts +12 -0
- package/dist-types/components/index.d.ts +4 -0
- package/dist-types/components/internalNavigationForAnchor/index.d.ts +11 -0
- package/dist-types/components/landingPage/constants.d.ts +11 -2
- package/dist-types/components/landingPage/index.d.ts +2 -1
- package/dist-types/components/sidebar/collapsedSidebar.d.ts +6 -0
- package/dist-types/components/sidebar/expandedSidebar.d.ts +9 -0
- package/dist-types/components/sidebar/useSidebar/constants.d.ts +3 -2
- package/dist-types/components/sidebar/useSidebar/context.d.ts +9 -1
- package/dist-types/components/sidebar/useSidebar/provider.d.ts +1 -1
- package/dist-types/components/sidebar/useSidebar/types.d.ts +10 -0
- package/dist-types/components/table/useTable/types.d.ts +2 -2
- package/dist-types/components/tabs/index.d.ts +12 -0
- package/dist-types/icons/index.d.ts +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/*
|
|
7
|
+
* Copyright 2024 Google LLC
|
|
8
|
+
*
|
|
9
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
* you may not use this file except in compliance with the License.
|
|
11
|
+
* You may obtain a copy of the License at
|
|
12
|
+
*
|
|
13
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
* See the License for the specific language governing permissions and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* External dependencies.
|
|
23
|
+
*/
|
|
24
|
+
const react_1 = __importDefault(require("react"));
|
|
25
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
26
|
+
/**
|
|
27
|
+
* Internal dependencies.
|
|
28
|
+
*/
|
|
29
|
+
const sidebar_1 = require("../sidebar");
|
|
30
|
+
const icons_1 = require("../../icons");
|
|
31
|
+
const Breadcrumbs = ({ items }) => {
|
|
32
|
+
const updateSelectedItemKey = (0, sidebar_1.useSidebar)(({ actions }) => actions.updateSelectedItemKey);
|
|
33
|
+
if (items.length === 1) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
return (<div className={(0, classnames_1.default)('w-full flex items-center h-fit pt-1')}>
|
|
37
|
+
<div className="flex items-center">
|
|
38
|
+
{items.map((item, index) => (<div key={item.key} onClick={() => updateSelectedItemKey(item.key)} className={(0, classnames_1.default)('text-xs flex items-center text-raisin-black dark:text-bright-gray', {
|
|
39
|
+
'font-bold': index === items.length - 1,
|
|
40
|
+
}, {
|
|
41
|
+
'cursor-pointer hover:text-blue-500 hover:dark:text-blue-400 active:opacity-70': index !== items.length - 1,
|
|
42
|
+
})}>
|
|
43
|
+
{item.title}
|
|
44
|
+
{index < items.length - 1 && (<span className="mx-2">
|
|
45
|
+
<icons_1.ChevronRight className="w-3 h-3"/>
|
|
46
|
+
</span>)}
|
|
47
|
+
</div>))}
|
|
48
|
+
</div>
|
|
49
|
+
</div>);
|
|
50
|
+
};
|
|
51
|
+
exports.default = Breadcrumbs;
|
|
52
|
+
//# sourceMappingURL=index.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../../src/components/breadcrumbs/index.tsx"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;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AA,EAAE,GAAG,CACP;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC"}
|
|
@@ -14,25 +14,53 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var
|
|
18
|
-
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
19
39
|
};
|
|
20
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
41
|
/**
|
|
22
42
|
* External dependencies.
|
|
23
43
|
*/
|
|
24
|
-
const react_1 =
|
|
44
|
+
const react_1 = __importStar(require("react"));
|
|
25
45
|
/**
|
|
26
46
|
* Internal dependencies.
|
|
27
47
|
*/
|
|
28
48
|
const icons_1 = require("../../icons");
|
|
49
|
+
const sidebar_1 = require("../sidebar");
|
|
29
50
|
const ListRow = ({ row }) => {
|
|
30
51
|
var _a;
|
|
52
|
+
const navigateTo = (0, sidebar_1.useSidebar)(({ actions }) => actions.updateSelectedItemKey);
|
|
53
|
+
const handleClick = (0, react_1.useCallback)((event) => {
|
|
54
|
+
if (row === null || row === void 0 ? void 0 : row.sidebarKey) {
|
|
55
|
+
navigateTo(row.sidebarKey);
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
}
|
|
58
|
+
}, [navigateTo, row === null || row === void 0 ? void 0 : row.sidebarKey]);
|
|
31
59
|
return (<div className="flex gap-4 items-baseline" key={(_a = row === null || row === void 0 ? void 0 : row.key) !== null && _a !== void 0 ? _a : row.title}>
|
|
32
60
|
<span>
|
|
33
61
|
<icons_1.Ellipse />
|
|
34
62
|
</span>
|
|
35
|
-
{(row === null || row === void 0 ? void 0 : row.link) ? (<a title={row.link} href={row.link} target="_blank" rel="noreferrer" className="text-sm text-bright-navy-blue dark:text-jordy-blue font-medium leading-6">
|
|
63
|
+
{(row === null || row === void 0 ? void 0 : row.link) ? (<a title={row.link} href={row.link} target="_blank" onClick={handleClick} rel="noreferrer" className="text-sm text-bright-navy-blue dark:text-jordy-blue font-medium leading-6">
|
|
36
64
|
{row.title}
|
|
37
65
|
</a>) : (<p className="text-sm font-medium leading-6">{row.title}</p>)}
|
|
38
66
|
</div>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listRow.jsx","sourceRoot":"","sources":["../../../src/components/bulletList/listRow.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"listRow.jsx","sourceRoot":"","sources":["../../../src/components/bulletList/listRow.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH;;GAEG;AACH,+CAA2C;AAE3C;;GAEG;AACH,uCAAsC;AACtC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K,CAAC,EAAE,CAAC,CAAC,CAC7D,CACH;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -32,7 +32,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.useGlobalFiltering = exports.useFiltersMapping = exports.MenuBar = exports.MatrixContainer = exports.CookiesLandingWrapper = exports.ToastMessage = exports.InspectButton = exports.SearchInput = exports.ExtensionReloadNotification = exports.ErrorFallback = exports.ContentPanel = exports.InfoCard = exports.LandingPage = exports.CookieTable = exports.Details = exports.CookieDetails = exports.CookiesMatrix = exports.CookiesLanding = exports.MatrixComponentHorizontal = exports.Matrix = exports.CirclePieChart = exports.Circle = exports.MessageBox = exports.ToggleSwitch = exports.BorderProgressBar = exports.ProgressBar = exports.ExportButton = exports.RefreshButton = exports.Button = void 0;
|
|
35
|
+
exports.InternalNavigationForAnchor = exports.Breadcrumbs = exports.QuickLinksList = exports.Tabs = exports.useGlobalFiltering = exports.useFiltersMapping = exports.MenuBar = exports.MatrixContainer = exports.CookiesLandingWrapper = exports.ToastMessage = exports.InspectButton = exports.SearchInput = exports.ExtensionReloadNotification = exports.ErrorFallback = exports.ContentPanel = exports.InfoCard = exports.LandingPage = exports.CookieTable = exports.Details = exports.CookieDetails = exports.CookiesMatrix = exports.CookiesLanding = exports.MatrixComponentHorizontal = exports.Matrix = exports.CirclePieChart = exports.Circle = exports.MessageBox = exports.ToggleSwitch = exports.BorderProgressBar = exports.ProgressBar = exports.ExportButton = exports.RefreshButton = exports.Button = void 0;
|
|
36
36
|
var button_1 = require("./button");
|
|
37
37
|
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return __importDefault(button_1).default; } });
|
|
38
38
|
var refreshButton_1 = require("./refreshButton");
|
|
@@ -96,4 +96,12 @@ var useFiltersMapping_1 = require("./cookiesLanding/useFiltersMapping");
|
|
|
96
96
|
Object.defineProperty(exports, "useFiltersMapping", { enumerable: true, get: function () { return __importDefault(useFiltersMapping_1).default; } });
|
|
97
97
|
var useGlobalFiltering_1 = require("./cookiesLanding/useGlobalFiltering");
|
|
98
98
|
Object.defineProperty(exports, "useGlobalFiltering", { enumerable: true, get: function () { return __importDefault(useGlobalFiltering_1).default; } });
|
|
99
|
+
var tabs_1 = require("./tabs");
|
|
100
|
+
Object.defineProperty(exports, "Tabs", { enumerable: true, get: function () { return __importDefault(tabs_1).default; } });
|
|
101
|
+
var quickLinksList_1 = require("./landingPage/quickLinksList");
|
|
102
|
+
Object.defineProperty(exports, "QuickLinksList", { enumerable: true, get: function () { return __importDefault(quickLinksList_1).default; } });
|
|
103
|
+
var breadcrumbs_1 = require("./breadcrumbs");
|
|
104
|
+
Object.defineProperty(exports, "Breadcrumbs", { enumerable: true, get: function () { return __importDefault(breadcrumbs_1).default; } });
|
|
105
|
+
var internalNavigationForAnchor_1 = require("./internalNavigationForAnchor");
|
|
106
|
+
Object.defineProperty(exports, "InternalNavigationForAnchor", { enumerable: true, get: function () { return __importDefault(internalNavigationForAnchor_1).default; } });
|
|
99
107
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;AAEH,mCAA6C;AAApC,iHAAA,OAAO,OAAU;AAC1B,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB;AACjC,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,6CAAuD;AAA9C,2HAAA,OAAO,OAAe;AAC/B,qEAA+E;AAAtE,uIAAA,OAAO,OAAqB;AACrC,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,2CAAqD;AAA5C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OAAO,OAAQ;AACxB,+DAAyE;AAAhE,iIAAA,OAAO,OAAkB;AAClC,6CAAuD;AAA9C,2HAAA,OAAO,OAAe;AAC/B,6EAAuF;AAA9E,2JAAA,OAAO,OAA+B"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
/**
|
|
42
|
+
* External dependencies.
|
|
43
|
+
*/
|
|
44
|
+
const react_1 = __importStar(require("react"));
|
|
45
|
+
/**
|
|
46
|
+
* Internal dependencies.
|
|
47
|
+
*/
|
|
48
|
+
const sidebar_1 = require("../sidebar");
|
|
49
|
+
const InternalNavigationForAnchor = ({ text, to, queries, }) => {
|
|
50
|
+
const updateSelectedItemKey = (0, sidebar_1.useSidebar)(({ actions }) => actions.updateSelectedItemKey);
|
|
51
|
+
const navigateTo = (0, react_1.useCallback)((key, query) => {
|
|
52
|
+
return () => updateSelectedItemKey(key, query);
|
|
53
|
+
}, [updateSelectedItemKey]);
|
|
54
|
+
const processDescription = (0, react_1.useCallback)((textToProcess) => {
|
|
55
|
+
let anchorIdxToNavigate = 0;
|
|
56
|
+
const elements = [];
|
|
57
|
+
let stringStart = 0, stringEnd = 0;
|
|
58
|
+
// Use two pointers to find anchor tags in the description string and replace them with buttons
|
|
59
|
+
// stringStart and stringEnd are used to keep track of the start and end of the current string
|
|
60
|
+
// The anchor tags should not have any attributes
|
|
61
|
+
while (stringEnd < textToProcess.length) {
|
|
62
|
+
if (textToProcess[stringEnd] === '<' &&
|
|
63
|
+
stringEnd + 1 < textToProcess.length) {
|
|
64
|
+
if (textToProcess[stringEnd + 1] === 'a') {
|
|
65
|
+
elements.push(<span>{textToProcess.slice(stringStart, stringEnd)}</span>);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const button = (<button onClick={navigateTo(to[anchorIdxToNavigate], (queries === null || queries === void 0 ? void 0 : queries[anchorIdxToNavigate]) || '')} className="text-bright-navy-blue dark:text-jordy-blue">
|
|
69
|
+
{textToProcess.slice(stringStart, stringEnd)}
|
|
70
|
+
</button>);
|
|
71
|
+
elements.push(button);
|
|
72
|
+
stringEnd++;
|
|
73
|
+
anchorIdxToNavigate++;
|
|
74
|
+
}
|
|
75
|
+
stringEnd += 2;
|
|
76
|
+
stringStart = stringEnd + 1;
|
|
77
|
+
}
|
|
78
|
+
stringEnd++;
|
|
79
|
+
}
|
|
80
|
+
// Add the remaining string to the elements array
|
|
81
|
+
if (stringStart < textToProcess.length) {
|
|
82
|
+
elements.push(<span>{textToProcess.slice(stringStart)}</span>);
|
|
83
|
+
}
|
|
84
|
+
return elements;
|
|
85
|
+
}, [navigateTo, queries, to]);
|
|
86
|
+
return (<>
|
|
87
|
+
{processDescription(text).map((element, index) => (<react_1.default.Fragment key={index}>{element}</react_1.default.Fragment>))}
|
|
88
|
+
</>);
|
|
89
|
+
};
|
|
90
|
+
exports.default = InternalNavigationForAnchor;
|
|
91
|
+
//# sourceMappingURL=index.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../../src/components/internalNavigationForAnchor/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH;;GAEG;AACH,+CAA2C;AAE3C;;GAEG;AACH,wCAAwC;AAQxC,MAAM,2BAA2B,GAAG,CAAC,EACnC,IAAI,EACJ,EAAE,EACF,OAAO,GAC0B,EAAE,EAAE;IACrC,MAAM,qBAAqB,GAAG,IAAA,oBAAU,EACtC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,qBAAqB,CAC/C,CAAC;IAEF,MAAM,UAAU,GAAG,IAAA,mBAAW,EAC5B,CAAC,GAAW,EAAE,KAAa,EAAE,EAAE;QAC7B,OAAO,GAAG,EAAE,CAAC,qBAAqB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACj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AED,SAAS,EAAE,CAAC;QACd,CAAC;QAED,iDAAiD;QACjD,IAAI,WAAW,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC;YACvC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;QACjE,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,EACD,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC,CAC1B,CAAC;IAEF,OAAO,CACL,EACE;MAAA,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAChD,CAAC,eAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,eAAK,CAAC,QAAQ,CAAC,CACvD,CAAC,CACJ;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,2BAA2B,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QUICK_LINKS = void 0;
|
|
2
4
|
/*
|
|
3
5
|
* Copyright 2023 Google LLC
|
|
4
6
|
*
|
|
@@ -14,12 +16,15 @@
|
|
|
14
16
|
* See the License for the specific language governing permissions and
|
|
15
17
|
* limitations under the License.
|
|
16
18
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Internal dependencies.
|
|
21
|
+
*/
|
|
22
|
+
const sidebar_1 = require("../sidebar");
|
|
19
23
|
exports.QUICK_LINKS = [
|
|
20
24
|
{
|
|
21
25
|
title: 'learnMore',
|
|
22
|
-
link: '
|
|
26
|
+
link: '#wiki',
|
|
27
|
+
sidebarKey: sidebar_1.SIDEBAR_ITEMS_KEYS.WIKI,
|
|
23
28
|
},
|
|
24
29
|
{
|
|
25
30
|
title: 'joinDiscussions',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/landingPage/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/components/landingPage/constants.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,wCAAgD;AAEnC,QAAA,WAAW,GAAG;IACzB;QACE,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,4BAAkB,CAAC,IAAI;KACpC;IACD;QACE,KAAK,EAAE,iBAAiB;QACxB,IAAI,EAAE,kEAAkE;KACzE;IACD;QACE,KAAK,EAAE,WAAW;QAClB,IAAI,EAAE,4HAA4H;KACnI;IACD;QACE,KAAK,EAAE,gBAAgB;QACvB,IAAI,EAAE,mCAAmC;KAC1C;CACF,CAAC"}
|
|
@@ -29,7 +29,7 @@ const ContentPanel = ({ title, content, titleStyles = '', counterStyles = '', })
|
|
|
29
29
|
{title}
|
|
30
30
|
</h3>
|
|
31
31
|
<div className="flex gap-5 flex-wrap">
|
|
32
|
-
{content.map((item, index) => (<a key={index} href={(0, common_1.addUTMParams)(item.url)} target="_blank" rel="noreferrer" className="w-72 h-80 bg-[#FDFDFD] dark:bg-charleston-green hover:bg-[#FAFAFA] rounded-xl border border-bright-gray dark:border-quartz p-5 hover:shadow hover:scale-[1.03] transition-all duration-150 ease-in-out ">
|
|
32
|
+
{content.map((item, index) => (<a key={index} href={(0, common_1.addUTMParams)(item.url)} target="_blank" rel="noreferrer" className="w-72 min-h-80 bg-[#FDFDFD] dark:bg-charleston-green hover:bg-[#FAFAFA] rounded-xl border border-bright-gray dark:border-quartz p-5 hover:shadow hover:scale-[1.03] transition-all duration-150 ease-in-out ">
|
|
33
33
|
<div className="w-16 h-16 flex justify-center items-center rounded-full bg-bright-gray mb-5">
|
|
34
34
|
<div className={`w-9 h-9 flex justify-center items-center rounded-md ${counterStyles}`}>
|
|
35
35
|
<span className="text-xxl text-white dark:black font-extrabold">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentPanel.jsx","sourceRoot":"","sources":["../../../src/components/landingPage/contentPanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;AAEH;;GAEG;AACH,kDAA0B;AAC1B,gDAAmD;AASnD,MAAM,YAAY,GAAG,CAAC,EACpB,KAAK,EACL,OAAO,EACP,WAAW,GAAG,EAAE,EAChB,aAAa,GAAG,EAAE,GACA,EAAE,EAAE;IACtB,OAAO,CACL,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CACnB;MAAA,CAAC,EAAE,CAAC,SAAS,CAAC,wDAAwD,CACpE;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,EAAE,CACJ;MAAA,CAAC,GAAG,CAAC,SAAS,CAAC,sBAAsB,CACnC;QAAA,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5B,CAAC,CAAC,CACA,GAAG,CAAC,CAAC,KAAK,CAAC,CACX,IAAI,CAAC,CAAC,IAAA,qBAAY,EAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAC7B,MAAM,CAAC,QAAQ,CACf,GAAG,CAAC,YAAY,CAChB,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"contentPanel.jsx","sourceRoot":"","sources":["../../../src/components/landingPage/contentPanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;AAEH;;GAEG;AACH,kDAA0B;AAC1B,gDAAmD;AASnD,MAAM,YAAY,GAAG,CAAC,EACpB,KAAK,EACL,OAAO,EACP,WAAW,GAAG,EAAE,EAChB,aAAa,GAAG,EAAE,GACA,EAAE,EAAE;IACtB,OAAO,CACL,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CACnB;MAAA,CAAC,EAAE,CAAC,SAAS,CAAC,wDAAwD,CACpE;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,EAAE,CACJ;MAAA,CAAC,GAAG,CAAC,SAAS,CAAC,sBAAsB,CACnC;QAAA,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5B,CAAC,CAAC,CACA,GAAG,CAAC,CAAC,KAAK,CAAC,CACX,IAAI,CAAC,CAAC,IAAA,qBAAY,EAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAC7B,MAAM,CAAC,QAAQ,CACf,GAAG,CAAC,YAAY,CAChB,SAAS,CAAC,6MAA6M,CAEvN;YAAA,CAAC,GAAG,CAAC,SAAS,CAAC,6EAA6E,CAC1F;cAAA,CAAC,GAAG,CACF,SAAS,CAAC,CAAC,uDAAuD,aAAa,EAAE,CAAC,CAElF;gBAAA,CAAC,IAAI,CAAC,SAAS,CAAC,+CAA+C,CAC7D;kBAAA,CAAC,KAAK,GAAG,CAAC,CACZ;gBAAA,EAAE,IAAI,CACR;cAAA,EAAE,GAAG,CACP;YAAA,EAAE,GAAG,CACL;YAAA,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,4BAA4B,WAAW,EAAE,CAAC,CACvD;cAAA,CAAC,IAAI,CAAC,KAAK,EAAE,CACf;YAAA,EAAE,EAAE,CACJ;YAAA,CAAC,CAAC,CAAC,SAAS,CAAC,mDAAmD,CAC9D;cAAA,CAAC,IAAI,CAAC,WAAW,EAAE,CACrB;YAAA,EAAE,CAAC,CACL;UAAA,EAAE,CAAC,CAAC,CACL,CAAC,CACJ;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC"}
|
|
@@ -53,19 +53,25 @@ const icons_1 = require("../../icons");
|
|
|
53
53
|
const progressBar_1 = __importDefault(require("../progressBar"));
|
|
54
54
|
const quickLinksList_1 = __importDefault(require("./quickLinksList"));
|
|
55
55
|
const infoCard_1 = __importDefault(require("./infoCard"));
|
|
56
|
-
const
|
|
56
|
+
const breadcrumbs_1 = __importDefault(require("../breadcrumbs"));
|
|
57
|
+
const sidebar_1 = require("../sidebar");
|
|
58
|
+
const LandingPage = ({ title, psInfoKey, iframeSrc, iframeBorderClass, children, extraClasses, contentPanel, showQuickLinks = true, }) => {
|
|
57
59
|
const [loading, setLoading] = (0, react_1.useState)(iframeSrc ? true : false);
|
|
58
60
|
const [open, setOpen] = (0, react_1.useState)(true);
|
|
59
|
-
|
|
61
|
+
const { extractSelectedItemKeyTitles } = (0, sidebar_1.useSidebar)(({ actions }) => ({
|
|
62
|
+
extractSelectedItemKeyTitles: actions.extractSelectedItemKeyTitles,
|
|
63
|
+
}));
|
|
64
|
+
return (<div className="w-full h-full">
|
|
60
65
|
{loading && <progressBar_1.default additionalStyles="w-1/3 mx-auto h-full"/>}
|
|
61
66
|
<div className={(0, classnames_1.default)({ hidden: loading }, 'divide-y divide-hex-gray dark:divide-quartz')}>
|
|
62
|
-
<div className="p-4">
|
|
67
|
+
<div className="p-4 flex flex-col gap-1">
|
|
63
68
|
<button className="flex gap-2 text-2xl font-bold items-baseline text-raisin-black dark:text-bright-gray cursor-pointer" onClick={() => setOpen((prevOpen) => !prevOpen)}>
|
|
64
69
|
{title && <h1 className="text-left">{title}</h1>}
|
|
65
70
|
<div>
|
|
66
71
|
<icons_1.ArrowUp className={(0, classnames_1.default)(open && 'rotate-180 -translate-y-1')}/>
|
|
67
72
|
</div>
|
|
68
73
|
</button>
|
|
74
|
+
<breadcrumbs_1.default items={extractSelectedItemKeyTitles()}/>
|
|
69
75
|
</div>
|
|
70
76
|
<div className={(0, classnames_1.default)({ hidden: !open && !children })}>
|
|
71
77
|
<div id="#__psat-collapsible-content" className={(0, classnames_1.default)({ hidden: !open }, 'flex flex-col gap-6 divide-y divide-american-silver dark:divide-quartz px-4 py-6', {
|
|
@@ -75,14 +81,14 @@ const LandingPage = ({ title, psInfoKey, iframeSrc, iframeBorderClass, children,
|
|
|
75
81
|
setLoading(false);
|
|
76
82
|
}} className={(0, classnames_1.default)('w-full md:w-[95%] md:m-auto rounded-xl', iframeBorderClass)}/>)}
|
|
77
83
|
{psInfoKey && <infoCard_1.default infoKey={psInfoKey}/>}
|
|
78
|
-
{contentPanel &&
|
|
84
|
+
{contentPanel && <>{contentPanel}</>}
|
|
79
85
|
</div>
|
|
80
86
|
|
|
81
87
|
{children && (<div id="#__psat-main-content" className={(0, classnames_1.default)('flex flex-col gap-6 divide-y divide-american-silver dark:divide-quartz px-4 py-6', extraClasses)}>
|
|
82
88
|
{children}
|
|
83
89
|
</div>)}
|
|
84
90
|
</div>
|
|
85
|
-
<quickLinksList_1.default />
|
|
91
|
+
{showQuickLinks && <quickLinksList_1.default />}
|
|
86
92
|
</div>
|
|
87
93
|
</div>);
|
|
88
94
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../../src/components/landingPage/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH;;GAEG;AACH,+CAAmD;AACnD,4DAAoC;AAEpC;;GAEG;AACH,uCAAsC;AACtC,iEAAyC;AACzC,sEAA8C;AAE9C,0DAAkC;
|
|
1
|
+
{"version":3,"file":"index.jsx","sourceRoot":"","sources":["../../../src/components/landingPage/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH;;GAEG;AACH,+CAAmD;AACnD,4DAAoC;AAEpC;;GAEG;AACH,uCAAsC;AACtC,iEAAyC;AACzC,sEAA8C;AAE9C,0DAAkC;AAClC,iEAAyC;AACzC,wCAAwC;AAaxC,MAAM,WAAW,GAAG,CAAC,EACnB,KAAK,EACL,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,YAA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C"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
/*
|
|
30
|
+
* Copyright 2024 Google LLC
|
|
31
|
+
*
|
|
32
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
33
|
+
* you may not use this file except in compliance with the License.
|
|
34
|
+
* You may obtain a copy of the License at
|
|
35
|
+
*
|
|
36
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
37
|
+
*
|
|
38
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
39
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
40
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
41
|
+
* See the License for the specific language governing permissions and
|
|
42
|
+
* limitations under the License.
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* External dependencies.
|
|
46
|
+
*/
|
|
47
|
+
const react_1 = __importStar(require("react"));
|
|
48
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
49
|
+
/**
|
|
50
|
+
* Internal dependencies.
|
|
51
|
+
*/
|
|
52
|
+
const icons_1 = require("../../icons");
|
|
53
|
+
const useSidebar_1 = require("./useSidebar");
|
|
54
|
+
const CollapsedSidebar = () => {
|
|
55
|
+
const { collapsedSidebarItems, updateSelectedItemKey, currentSelectedItemKey, toggleSidebarCollapse, sidebarItems, selectedItemKey, } = (0, useSidebar_1.useSidebar)(({ state, actions }) => ({
|
|
56
|
+
collapsedSidebarItems: state.collapsedSidebarItems,
|
|
57
|
+
updateSelectedItemKey: actions.updateSelectedItemKey,
|
|
58
|
+
currentSelectedItemKey: state.currentItemKey,
|
|
59
|
+
toggleSidebarCollapse: actions.toggleSidebarCollapse,
|
|
60
|
+
sidebarItems: state.sidebarItems,
|
|
61
|
+
selectedItemKey: state.selectedItemKey,
|
|
62
|
+
}));
|
|
63
|
+
const handleFooterElementClick = (0, react_1.useCallback)((e, key) => {
|
|
64
|
+
e.stopPropagation();
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
updateSelectedItemKey(key);
|
|
67
|
+
}, [updateSelectedItemKey]);
|
|
68
|
+
return (<div className={(0, classnames_1.default)('flex flex-col justify-between items-center p-2 w-full h-full')}>
|
|
69
|
+
<div className="flex flex-col gap-2 justify-center items-center">
|
|
70
|
+
<button className="cursor-pointer hover:opacity-60" title="Expand Sidebar Menu" onClick={toggleSidebarCollapse}>
|
|
71
|
+
<icons_1.MenuOpenIcon className="dark:fill-bright-gray fill-granite-gray w-5 h-5 rotate-180"/>
|
|
72
|
+
</button>
|
|
73
|
+
{Object.keys(sidebarItems).map((itemKey) => {
|
|
74
|
+
var _a;
|
|
75
|
+
if (Object.keys((collapsedSidebarItems === null || collapsedSidebarItems === void 0 ? void 0 : collapsedSidebarItems.footerElements) || {}).includes(itemKey)) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const sidebarItem = sidebarItems[itemKey];
|
|
79
|
+
const Icon = sidebarItem.icon ? sidebarItem.icon.Element : null;
|
|
80
|
+
const props = ((_a = sidebarItem === null || sidebarItem === void 0 ? void 0 : sidebarItem.icon) === null || _a === void 0 ? void 0 : _a.props) || {};
|
|
81
|
+
const title = typeof sidebarItem.title === 'function'
|
|
82
|
+
? sidebarItem.title()
|
|
83
|
+
: sidebarItem.title;
|
|
84
|
+
const isCurrent = itemKey === selectedItemKey;
|
|
85
|
+
const buttonClassNames = (0, classnames_1.default)({
|
|
86
|
+
'cursor-auto opacity-70 dark:opacity-40': isCurrent,
|
|
87
|
+
'hover:opacity-60': !isCurrent,
|
|
88
|
+
});
|
|
89
|
+
return (<button key={title} title={title} className={buttonClassNames} onClick={() => updateSelectedItemKey(itemKey)}>
|
|
90
|
+
{Icon && <Icon className="dark:fill-bright-gray" {...props}/>}
|
|
91
|
+
</button>);
|
|
92
|
+
})}
|
|
93
|
+
</div>
|
|
94
|
+
<div className="flex flex-col justify-center items-center gap-4">
|
|
95
|
+
{Object.keys((collapsedSidebarItems === null || collapsedSidebarItems === void 0 ? void 0 : collapsedSidebarItems.footerElements) || {}).map((key) => {
|
|
96
|
+
const Icon = collapsedSidebarItems === null || collapsedSidebarItems === void 0 ? void 0 : collapsedSidebarItems.footerElements[key].icon.Element;
|
|
97
|
+
if (Icon === undefined) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
const props = collapsedSidebarItems === null || collapsedSidebarItems === void 0 ? void 0 : collapsedSidebarItems.footerElements[key].icon.props;
|
|
101
|
+
const title = collapsedSidebarItems === null || collapsedSidebarItems === void 0 ? void 0 : collapsedSidebarItems.footerElements[key].title;
|
|
102
|
+
const isCurrent = key === currentSelectedItemKey;
|
|
103
|
+
return (<button key={key} title={typeof title === 'function' ? title() : title} className={(0, classnames_1.default)('rounded-full p-1', {
|
|
104
|
+
'opacity-70 cursor-auto dark:opacity-40': isCurrent,
|
|
105
|
+
'hover:opacity-70': !isCurrent,
|
|
106
|
+
})} onClick={(e) => handleFooterElementClick(e, key)}>
|
|
107
|
+
<Icon width="20" height="20" className="dark:fill-bright-gray" {...props}/>
|
|
108
|
+
</button>);
|
|
109
|
+
})}
|
|
110
|
+
</div>
|
|
111
|
+
</div>);
|
|
112
|
+
};
|
|
113
|
+
exports.default = CollapsedSidebar;
|
|
114
|
+
//# sourceMappingURL=collapsedSidebar.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsedSidebar.jsx","sourceRoot":"","sources":["../../../src/components/sidebar/collapsedSidebar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,+CAA2C;AAC3C,4DAAoC;AAEpC;;GAEG;AACH,uCAA2C;AAC3C,6CAAiE;AAEjE,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,MAAM,EACJ,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,eAAe,GAChB,GAAG,IAAA,uBAAU,EAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;QACtC,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;QAClD,qBAAqB,EAAE,OAAO,CAAC,qBAAqB;QACpD,sBAAsB,EAAE,KAAK,CAAC,cAAc;QAC5C,qBAAqB,EAAE,OAAO,CAAC,qBAAqB;QACpD,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,eAAe,EAAE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qB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC;YAC/D,MAAM,SAAS,GAAG,GAAG,KAAK,sBAAsB,CAAC;YAEjD,OAAO,CACL,CAAC,MAAM,CACL,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,KAAK,CAAC,CAAC,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CACrD,SAAS,CAAC,CAAC,IAAA,oBAAU,EAAC,kBAAkB,EAAE;oBACxC,wCAAwC,EAAE,SAAS;oBACnD,kBAAkB,EAAE,CAAC,SAAS;iBAC/B,CAAC,CAAC,CACH,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,wBAAwB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAEjD;cAAA,CAAC,IAAI,CACH,KAAK,CAAC,IAAI,CACV,MAAM,CAAC,IAAI,CACX,SAAS,CAAC,uBAAuB,CACjC,IAAI,KAAK,CAAC,EAEd;YAAA,EAAE,MAAM,CAAC,CACV,CAAC;QACJ,CAAC,CAAC,CACJ;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
/*
|
|
30
|
+
* Copyright 2024 Google LLC
|
|
31
|
+
*
|
|
32
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
33
|
+
* you may not use this file except in compliance with the License.
|
|
34
|
+
* You may obtain a copy of the License at
|
|
35
|
+
*
|
|
36
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
37
|
+
*
|
|
38
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
39
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
40
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
41
|
+
* See the License for the specific language governing permissions and
|
|
42
|
+
* limitations under the License.
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* External dependencies.
|
|
46
|
+
*/
|
|
47
|
+
const react_1 = __importStar(require("react"));
|
|
48
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
49
|
+
/**
|
|
50
|
+
* Internal dependencies.
|
|
51
|
+
*/
|
|
52
|
+
const icons_1 = require("../../icons");
|
|
53
|
+
const sidebarChild_1 = __importDefault(require("./sidebarChild"));
|
|
54
|
+
const useSidebar_1 = require("./useSidebar");
|
|
55
|
+
const ExpandedSidebar = ({ visibleWidth }) => {
|
|
56
|
+
const { sidebarItems, setIsSidebarFocused, toggleSidebarCollapse, isSidebarCollapsible, isSidebarFocused, isKeySelected, } = (0, useSidebar_1.useSidebar)(({ state, actions }) => ({
|
|
57
|
+
sidebarItems: state.sidebarItems,
|
|
58
|
+
setIsSidebarFocused: actions.setIsSidebarFocused,
|
|
59
|
+
toggleSidebarCollapse: actions.toggleSidebarCollapse,
|
|
60
|
+
isSidebarCollapsible: state.isSidebarCollapsible,
|
|
61
|
+
isSidebarFocused: state.isSidebarFocused,
|
|
62
|
+
isKeySelected: actions.isKeySelected,
|
|
63
|
+
}));
|
|
64
|
+
const [isResizing, setIsResizing] = (0, react_1.useState)(true);
|
|
65
|
+
(0, react_1.useEffect)(() => {
|
|
66
|
+
setIsResizing(true);
|
|
67
|
+
setTimeout(() => {
|
|
68
|
+
setIsResizing(false);
|
|
69
|
+
}, 180);
|
|
70
|
+
}, []);
|
|
71
|
+
const [didUserInteract, setDidUserInteract] = (0, react_1.useState)(false);
|
|
72
|
+
const sidebarContainerRef = (0, react_1.useRef)(null);
|
|
73
|
+
(0, react_1.useEffect)(() => {
|
|
74
|
+
var _a;
|
|
75
|
+
const handleClickOutside = (event) => {
|
|
76
|
+
var _a;
|
|
77
|
+
if (sidebarContainerRef.current &&
|
|
78
|
+
!((_a = sidebarContainerRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
|
|
79
|
+
setIsSidebarFocused(false);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
(_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.addEventListener('click', handleClickOutside);
|
|
83
|
+
return () => {
|
|
84
|
+
var _a;
|
|
85
|
+
(_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', handleClickOutside);
|
|
86
|
+
};
|
|
87
|
+
}, [setIsSidebarFocused]);
|
|
88
|
+
const isFirstElementSelected = (0, react_1.useMemo)(() => isKeySelected(Object.keys(sidebarItems)[0]), [isKeySelected, sidebarItems]);
|
|
89
|
+
return (<div ref={sidebarContainerRef} className="min-w-fit">
|
|
90
|
+
{isSidebarCollapsible && !isResizing && (<button onClick={toggleSidebarCollapse} className="cursor-pointer hover:opacity-70 absolute right-0 z-20" title="Collapse Sidebar Menu">
|
|
91
|
+
<icons_1.MenuOpenIcon className={(0, classnames_1.default)('w-5 h-5 fill-granite-gray dark:fill-bright-gray', isFirstElementSelected && isSidebarFocused
|
|
92
|
+
? 'fill-white'
|
|
93
|
+
: 'fill-granite-gray')}/>
|
|
94
|
+
</button>)}
|
|
95
|
+
{Object.entries(sidebarItems).map(([itemKey, sidebarItem]) => (<sidebarChild_1.default didUserInteract={didUserInteract} setDidUserInteract={setDidUserInteract} itemKey={itemKey} sidebarItem={sidebarItem} key={itemKey} visibleWidth={visibleWidth}/>))}
|
|
96
|
+
</div>);
|
|
97
|
+
};
|
|
98
|
+
exports.default = ExpandedSidebar;
|
|
99
|
+
//# sourceMappingURL=expandedSidebar.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expandedSidebar.jsx","sourceRoot":"","sources":["../../../src/components/sidebar/expandedSidebar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH;;GAEG;AACH,+CAAoE;AACpE,4DAAoC;AAEpC;;GAEG;AACH,uCAA2C;AAC3C,kEAA0C;AAC1C,6CAA0C;AAM1C,MAAM,eAAe,GAAG,CAAC,EAAE,YAAY,EAAwB,EAAE,EAAE;IACjE,MAAM,EACJ,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,GACd,GAAG,IAAA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