pixelize-design-library 2.2.143 → 2.2.145
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/KanbanBoard/KanbanBoard.js +14 -10
- package/dist/Components/KanbanBoard/KanbanBoardProps.d.ts +8 -1
- package/dist/Components/SideBar/SideBar.d.ts +1 -1
- package/dist/Components/SideBar/SideBar.js +3 -1
- package/dist/Components/SideBar/SideBarProps.d.ts +11 -0
- package/dist/Components/SideBar/components/OtherApps.d.ts +4 -0
- package/dist/Components/SideBar/components/OtherApps.js +38 -0
- package/dist/Components/SideBar/components/OtherApps.test.d.ts +1 -0
- package/dist/Components/SideBar/components/OtherApps.test.js +112 -0
- package/dist/Components/Table/Components/TableFilters.js +4 -2
- package/dist/Constants/Sidebar.js +1 -1
- package/dist/Theme/Default/palette.js +5 -5
- package/dist/Theme/Meadow/palette.d.ts +97 -95
- package/dist/Theme/Meadow/palette.js +97 -332
- package/dist/Theme/Radiant/palette.d.ts +95 -93
- package/dist/Theme/Radiant/palette.js +97 -332
- package/dist/Theme/Skyline/palette.d.ts +97 -95
- package/dist/Theme/Skyline/palette.js +97 -332
- package/dist/Theme/buildBrandTokens.d.ts +15 -0
- package/dist/Theme/buildBrandTokens.js +33 -0
- package/dist/Theme/buildBrandTokens.test.d.ts +1 -0
- package/dist/Theme/buildBrandTokens.test.js +31 -0
- package/dist/Theme/themeProps.d.ts +2 -0
- package/dist/global.css +31 -17
- package/package.json +1 -1
|
@@ -180,10 +180,12 @@ var KanbanBoard = function (_a) {
|
|
|
180
180
|
return (react_1.default.createElement("div", { style: style },
|
|
181
181
|
react_1.default.createElement(MeasuredItem_1.default, { index: index, setSize: function (i, h) { return setSize(i, h, colId); } },
|
|
182
182
|
react_1.default.createElement("div", { style: { marginBottom: 12 } },
|
|
183
|
-
react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id, isDragDisabled: !canDrag }, function (provided) {
|
|
184
|
-
|
|
183
|
+
react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id, isDragDisabled: !canDrag }, function (provided) {
|
|
184
|
+
var _a;
|
|
185
|
+
return (react_1.default.createElement("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: provided.draggableProps.style }), (account === null || account === void 0 ? void 0 : account.customNode) ? (_a = account === null || account === void 0 ? void 0 : account.customNode) === null || _a === void 0 ? void 0 : _a.call(account) : (react_1.default.createElement(AccountCard_1.default, { key: account.id, account: account, index: index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[account.id], onToggleExpand: function () {
|
|
185
186
|
return toggleExpand(account.id, colId, index);
|
|
186
|
-
}, isDeletable: canDelete })));
|
|
187
|
+
}, isDeletable: canDelete }))));
|
|
188
|
+
}))),
|
|
187
189
|
index === items.length - 1 && placeholder));
|
|
188
190
|
};
|
|
189
191
|
var NoItemsTemplate = function (_a) {
|
|
@@ -239,11 +241,11 @@ var KanbanBoard = function (_a) {
|
|
|
239
241
|
: Object.entries(columns).map(function (_a) {
|
|
240
242
|
var colId = _a[0], column = _a[1];
|
|
241
243
|
return (react_1.default.createElement(dnd_1.Droppable, { droppableId: colId, key: colId, mode: virtualization ? "virtual" : "standard", renderClone: function (provided, _snapshot, rubric) {
|
|
244
|
+
var _a;
|
|
242
245
|
var item = column.items[rubric.source.index];
|
|
243
|
-
return (react_1.default.createElement("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: __assign(__assign({}, provided.draggableProps.style), { width: columnWidth, marginBottom: 12 }) }),
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
} })));
|
|
246
|
+
return (react_1.default.createElement("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: __assign(__assign({}, provided.draggableProps.style), { width: columnWidth, marginBottom: 12 }) }), (item === null || item === void 0 ? void 0 : item.customNode) ? (_a = item === null || item === void 0 ? void 0 : item.customNode) === null || _a === void 0 ? void 0 : _a.call(item) : (react_1.default.createElement(AccountCard_1.default, { key: item.id, account: item, index: rubric.source.index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[item.id], onToggleExpand: function () {
|
|
247
|
+
return toggleExpand(item.id, colId, rubric.source.index);
|
|
248
|
+
} }))));
|
|
247
249
|
} }, function (provided, snapshot) {
|
|
248
250
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
249
251
|
return (react_1.default.createElement(react_2.Box, __assign({ ref: provided.innerRef }, provided.droppableProps, { width: columnWidth, borderRadius: "0.5rem", borderWidth: "0.063rem", background: snapshot.isDraggingOver
|
|
@@ -310,10 +312,12 @@ var KanbanBoard = function (_a) {
|
|
|
310
312
|
placeholder: provided.placeholder,
|
|
311
313
|
} }, Row)) : (react_1.default.createElement(react_2.Box, null,
|
|
312
314
|
column.items.map(function (account, index) { return (react_1.default.createElement("div", { key: account.id, style: { marginBottom: 12 } },
|
|
313
|
-
react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id, isDragDisabled: !canDrag }, function (provided) {
|
|
314
|
-
|
|
315
|
+
react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id, isDragDisabled: !canDrag }, function (provided) {
|
|
316
|
+
var _a;
|
|
317
|
+
return (react_1.default.createElement("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: provided.draggableProps.style }), (account === null || account === void 0 ? void 0 : account.customNode) ? (_a = account === null || account === void 0 ? void 0 : account.customNode) === null || _a === void 0 ? void 0 : _a.call(account) : (react_1.default.createElement(AccountCard_1.default, { account: account, index: index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[account.id], onToggleExpand: function () {
|
|
315
318
|
return toggleExpand(account.id, colId, index);
|
|
316
|
-
}, isDeletable: canDelete })))
|
|
319
|
+
}, isDeletable: canDelete }))));
|
|
320
|
+
}))); }),
|
|
317
321
|
provided.placeholder)))));
|
|
318
322
|
}));
|
|
319
323
|
}),
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
1
2
|
import { OptionProp } from "../Select/SelectProps";
|
|
3
|
+
/** Index allows extra scalar fields; known string fields are explicit so they do not widen to `() => ReactNode`. */
|
|
2
4
|
export type Account = {
|
|
3
5
|
id: string;
|
|
4
|
-
|
|
6
|
+
customNode?: () => ReactNode;
|
|
7
|
+
details?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
email?: string;
|
|
10
|
+
rating?: string;
|
|
11
|
+
[key: string]: string | number | null | undefined | (() => ReactNode);
|
|
5
12
|
};
|
|
6
13
|
export type ColumnType = {
|
|
7
14
|
id: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { SidebarProps } from "./SideBarProps";
|
|
3
|
-
export default function Sidebar({ menus, activeMenu, handleMenuClick, handleSecondaryNavClick, toggle, changeToggle, logo, companyName, isDisableAddNew, onAddNewClick, selectedSubMenu, selectedSecondaryItem, isLoading, loadingLines, open, }: SidebarProps): React.JSX.Element;
|
|
3
|
+
export default function Sidebar({ menus, activeMenu, handleMenuClick, handleSecondaryNavClick, toggle, changeToggle, logo, companyName, isDisableAddNew, onAddNewClick, selectedSubMenu, selectedSecondaryItem, isLoading, loadingLines, open, otherApps, }: SidebarProps): React.JSX.Element;
|
|
@@ -57,6 +57,7 @@ var MenuItems_1 = __importDefault(require("./components/MenuItems"));
|
|
|
57
57
|
var defaultLogo_1 = __importDefault(require("../../Assets/defaultLogo"));
|
|
58
58
|
var OverflowTooltipText_1 = __importDefault(require("./components/OverflowTooltipText"));
|
|
59
59
|
var SecondaryBar_1 = __importDefault(require("./SecondaryBar"));
|
|
60
|
+
var OtherApps_1 = __importDefault(require("./components/OtherApps"));
|
|
60
61
|
var SidebarHeader = function (_a) {
|
|
61
62
|
var logo = _a.logo, companyName = _a.companyName, toggle = _a.toggle, isLoading = _a.isLoading;
|
|
62
63
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
@@ -107,7 +108,7 @@ var CollapseButton = function (_a) {
|
|
|
107
108
|
// --- Main Sidebar component ---
|
|
108
109
|
function Sidebar(_a) {
|
|
109
110
|
var _b;
|
|
110
|
-
var menus = _a.menus, activeMenu = _a.activeMenu, handleMenuClick = _a.handleMenuClick, handleSecondaryNavClick = _a.handleSecondaryNavClick, toggle = _a.toggle, changeToggle = _a.changeToggle, logo = _a.logo, companyName = _a.companyName, _c = _a.isDisableAddNew, isDisableAddNew = _c === void 0 ? false : _c, onAddNewClick = _a.onAddNewClick, selectedSubMenu = _a.selectedSubMenu, selectedSecondaryItem = _a.selectedSecondaryItem, isLoading = _a.isLoading, loadingLines = _a.loadingLines, _d = _a.open, open = _d === void 0 ? true : _d;
|
|
111
|
+
var menus = _a.menus, activeMenu = _a.activeMenu, handleMenuClick = _a.handleMenuClick, handleSecondaryNavClick = _a.handleSecondaryNavClick, toggle = _a.toggle, changeToggle = _a.changeToggle, logo = _a.logo, companyName = _a.companyName, _c = _a.isDisableAddNew, isDisableAddNew = _c === void 0 ? false : _c, onAddNewClick = _a.onAddNewClick, selectedSubMenu = _a.selectedSubMenu, selectedSecondaryItem = _a.selectedSecondaryItem, isLoading = _a.isLoading, loadingLines = _a.loadingLines, _d = _a.open, open = _d === void 0 ? true : _d, otherApps = _a.otherApps;
|
|
111
112
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
112
113
|
// Refs let the effects read the latest values without adding them to dep arrays,
|
|
113
114
|
// which would cause infinite toggle loops since changeToggle flips state.
|
|
@@ -143,6 +144,7 @@ function Sidebar(_a) {
|
|
|
143
144
|
: (react_1.default.createElement(MenuItems_1.default, { activeMenu: activeMenu, menus: menus, handleMenuClick: handleMenuClick !== null && handleMenuClick !== void 0 ? handleMenuClick : (function () { }), toggle: toggle, selectedSubMenu: selectedSubMenu }))),
|
|
144
145
|
react_1.default.createElement(react_2.Box, { w: "100%", h: "0.063rem", bg: theme.colors.sidebar.background[200], mb: "0.125rem" }),
|
|
145
146
|
!isDisableAddNew && (react_1.default.createElement(AddNewButton, { toggle: toggle, isLoading: isLoading, onClick: onAddNewClick })),
|
|
147
|
+
react_1.default.createElement(OtherApps_1.default, { toggle: toggle, otherApps: otherApps !== null && otherApps !== void 0 ? otherApps : [] }),
|
|
146
148
|
react_1.default.createElement(CollapseButton, { toggle: toggle, onToggle: changeToggle })))),
|
|
147
149
|
secondaryItems.length > 0 && (react_1.default.createElement(SecondaryBar_1.default, { items: secondaryItems, defaultCollapsed: toggle, collapsedWidth: "3.5rem", expandedWidth: "10rem", selected: selectedSecondaryItem, onItemClick: handleSecondaryNavClick, title: activeTop === null || activeTop === void 0 ? void 0 : activeTop.title }))));
|
|
148
150
|
}
|
|
@@ -14,6 +14,7 @@ export type SidebarProps = {
|
|
|
14
14
|
isLoading?: boolean;
|
|
15
15
|
loadingLines?: number;
|
|
16
16
|
open?: boolean;
|
|
17
|
+
otherApps?: OtherAppsProps['otherApps'];
|
|
17
18
|
};
|
|
18
19
|
export type MenuProps = {
|
|
19
20
|
id: string | number;
|
|
@@ -50,3 +51,13 @@ export type SecondaryBarProps = {
|
|
|
50
51
|
onItemClick?: (item: MenuProps) => void;
|
|
51
52
|
title?: string;
|
|
52
53
|
};
|
|
54
|
+
export type OtherAppsProps = {
|
|
55
|
+
toggle: boolean;
|
|
56
|
+
otherApps: {
|
|
57
|
+
name: string;
|
|
58
|
+
color: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
onClick: () => void;
|
|
61
|
+
icon?: React.ReactNode;
|
|
62
|
+
}[];
|
|
63
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var react_2 = require("@chakra-ui/react");
|
|
8
|
+
var useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
9
|
+
var OtherApps = function (_a) {
|
|
10
|
+
var toggle = _a.toggle, otherApps = _a.otherApps;
|
|
11
|
+
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
12
|
+
if (!otherApps || otherApps.length === 0)
|
|
13
|
+
return null;
|
|
14
|
+
var row = function (app) { return (react_1.default.createElement(react_2.Flex, { alignItems: "center", gap: "0.625rem", px: "0.625rem", py: "0.5rem", w: "100%", cursor: "pointer", justifyContent: toggle ? "center" : "flex-start", _hover: { backgroundColor: theme.colors.primary[500] }, transition: "background 0.15s", onClick: app.onClick, as: "button", type: "button", border: "none", bg: "transparent", color: "inherit" },
|
|
15
|
+
react_1.default.createElement(react_2.Box, { w: "0.5rem", h: "0.5rem", borderRadius: "full", bg: app.color, flexShrink: 0, boxShadow: "0 0 5px ".concat(app.color) }),
|
|
16
|
+
!toggle && (react_1.default.createElement(react_2.Box, { flex: "1", minW: 0, textAlign: "left" },
|
|
17
|
+
react_1.default.createElement(react_2.Text, { fontSize: "0.8125rem", fontWeight: 500, color: theme.colors.white, isTruncated: true }, app.name),
|
|
18
|
+
app.description && (react_1.default.createElement(react_2.Text, { fontSize: "0.6875rem", color: theme.colors.gray[400], isTruncated: true }, app.description)))))); };
|
|
19
|
+
var flyoutBody = function (app) {
|
|
20
|
+
var _a;
|
|
21
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
22
|
+
react_1.default.createElement(react_2.Flex, { alignItems: "center", gap: "0.5rem", mb: "0.25rem", onClick: app.onClick }, (_a = app.icon) !== null && _a !== void 0 ? _a : (react_1.default.createElement(react_2.Box, { w: "0.5rem", h: "0.5rem", borderRadius: "full", bg: app.color, boxShadow: "0 0 5px ".concat(app.color), flexShrink: 0 })),
|
|
23
|
+
react_1.default.createElement(react_2.Text, { fontSize: "0.875rem", fontWeight: 700, color: theme.colors.white }, app.name)),
|
|
24
|
+
app.description && (react_1.default.createElement(react_2.Text, { fontSize: "0.75rem", color: theme.colors.gray[400] }, app.description))));
|
|
25
|
+
};
|
|
26
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
27
|
+
react_1.default.createElement(react_2.Box, { w: "100%", h: "0.063rem", bg: theme.colors.sidebar.background[200], mb: "0.125rem" }),
|
|
28
|
+
!toggle && (react_1.default.createElement(react_2.Text, { fontSize: "0.625rem", fontWeight: 600, color: theme.colors.gray[400], letterSpacing: "0.08em", textTransform: "uppercase", px: "0.625rem", pt: "0.5rem", pb: "0.25rem", w: "100%" }, "Other Apps")),
|
|
29
|
+
otherApps.map(function (app) {
|
|
30
|
+
return toggle ? (react_1.default.createElement(react_2.Popover, { key: app.name, trigger: "hover", placement: "right-start", closeOnBlur: false, isLazy: true },
|
|
31
|
+
react_1.default.createElement(react_2.PopoverTrigger, null,
|
|
32
|
+
react_1.default.createElement(react_2.Box, { w: "100%" }, row(app))),
|
|
33
|
+
react_1.default.createElement(react_2.Portal, null,
|
|
34
|
+
react_1.default.createElement(react_2.PopoverContent, { borderRadius: "0.063rem", bg: theme.colors.primary[700], boxShadow: "lg", minW: "10rem", maxW: "14rem", py: "0.125rem", ml: "-0.5rem", border: "none", cursor: "pointer", zIndex: 1500, color: "white" },
|
|
35
|
+
react_1.default.createElement(react_2.PopoverBody, { p: "0.75rem" }, flyoutBody(app)))))) : (react_1.default.createElement(react_2.Box, { key: app.name, w: "100%" }, row(app)));
|
|
36
|
+
})));
|
|
37
|
+
};
|
|
38
|
+
exports.default = OtherApps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "@testing-library/jest-dom";
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var react_1 = __importDefault(require("react"));
|
|
43
|
+
var react_2 = require("@testing-library/react");
|
|
44
|
+
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
45
|
+
require("@testing-library/jest-dom");
|
|
46
|
+
var react_3 = require("@chakra-ui/react");
|
|
47
|
+
var OtherApps_1 = __importDefault(require("./OtherApps"));
|
|
48
|
+
jest.mock("../../../Theme/useCustomTheme", function () { return ({
|
|
49
|
+
useCustomTheme: function () { return ({
|
|
50
|
+
colors: {
|
|
51
|
+
white: "#fff",
|
|
52
|
+
gray: { 400: "#a0aec0" },
|
|
53
|
+
primary: { 500: "#3182ce", 700: "#2c5282" },
|
|
54
|
+
sidebar: {
|
|
55
|
+
background: {
|
|
56
|
+
200: "#2d3748",
|
|
57
|
+
500: "#1a202c",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
}); },
|
|
62
|
+
}); });
|
|
63
|
+
var sampleApps = [
|
|
64
|
+
{
|
|
65
|
+
name: "Billing",
|
|
66
|
+
color: "#3182ce",
|
|
67
|
+
description: "Billing app",
|
|
68
|
+
onClick: jest.fn(),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: "Tickets",
|
|
72
|
+
color: "#38a169",
|
|
73
|
+
onClick: jest.fn(),
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
var renderWithChakra = function (ui) { return (0, react_2.render)(react_1.default.createElement(react_3.ChakraProvider, null, ui)); };
|
|
77
|
+
describe("OtherApps", function () {
|
|
78
|
+
beforeEach(function () {
|
|
79
|
+
jest.clearAllMocks();
|
|
80
|
+
});
|
|
81
|
+
it("does not render flyout copy when expanded", function () {
|
|
82
|
+
renderWithChakra(react_1.default.createElement(OtherApps_1.default, { toggle: false, otherApps: sampleApps }));
|
|
83
|
+
expect(react_2.screen.getByText("Other Apps")).toBeInTheDocument();
|
|
84
|
+
expect(react_2.screen.getByText("Billing")).toBeInTheDocument();
|
|
85
|
+
expect(react_2.screen.queryByText(/Open Billing/)).not.toBeInTheDocument();
|
|
86
|
+
});
|
|
87
|
+
it("shows flyout with Open label on hover when collapsed", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
88
|
+
var buttons;
|
|
89
|
+
return __generator(this, function (_a) {
|
|
90
|
+
switch (_a.label) {
|
|
91
|
+
case 0:
|
|
92
|
+
renderWithChakra(react_1.default.createElement(OtherApps_1.default, { toggle: true, otherApps: sampleApps }));
|
|
93
|
+
buttons = react_2.screen.getAllByRole("button");
|
|
94
|
+
expect(buttons).toHaveLength(2);
|
|
95
|
+
return [4 /*yield*/, user_event_1.default.hover(buttons[0])];
|
|
96
|
+
case 1:
|
|
97
|
+
_a.sent();
|
|
98
|
+
return [4 /*yield*/, (0, react_2.waitFor)(function () {
|
|
99
|
+
expect(react_2.screen.getByText(/Open Billing/)).toBeInTheDocument();
|
|
100
|
+
})];
|
|
101
|
+
case 2:
|
|
102
|
+
_a.sent();
|
|
103
|
+
return [2 /*return*/];
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}); });
|
|
107
|
+
it("renders no app rows when otherApps is empty", function () {
|
|
108
|
+
renderWithChakra(react_1.default.createElement(OtherApps_1.default, { toggle: true, otherApps: [] }));
|
|
109
|
+
expect(react_2.screen.queryByRole("button")).not.toBeInTheDocument();
|
|
110
|
+
expect(react_2.screen.queryByText("Billing")).not.toBeInTheDocument();
|
|
111
|
+
});
|
|
112
|
+
});
|
|
@@ -38,9 +38,11 @@ var react_2 = require("@chakra-ui/react");
|
|
|
38
38
|
var table_1 = require("../../../Utils/table");
|
|
39
39
|
var lucide_react_1 = require("lucide-react");
|
|
40
40
|
var TableFilters = (0, react_1.memo)(function (_a) {
|
|
41
|
+
var _b, _c;
|
|
41
42
|
var header = _a.header, setColumnsSearch = _a.setColumnsSearch, columnsSearch = _a.columnsSearch, onClose = _a.onClose, isOpen = _a.isOpen, onOpen = _a.onOpen;
|
|
43
|
+
var theme = (0, react_2.useTheme)();
|
|
42
44
|
var searchRef = (0, react_1.useRef)(null);
|
|
43
|
-
var
|
|
45
|
+
var _d = (0, react_1.useState)(false), refreshDataOnOpen = _d[0], setRefreshDataOnOpen = _d[1];
|
|
44
46
|
var debounceRef = (0, table_1.debounce)(function (value) {
|
|
45
47
|
setColumnsSearch(value);
|
|
46
48
|
}, 700);
|
|
@@ -66,7 +68,7 @@ var TableFilters = (0, react_1.memo)(function (_a) {
|
|
|
66
68
|
};
|
|
67
69
|
return (react_1.default.createElement(react_2.Popover, { isOpen: isOpen, onClose: onClose, onOpen: handleOpen },
|
|
68
70
|
react_1.default.createElement(react_2.PopoverTrigger, null,
|
|
69
|
-
react_1.default.createElement(react_2.IconButton, { "aria-label": "Search", icon: react_1.default.createElement(lucide_react_1.EllipsisVertical, { size: 17 }), size: "xs", variant: "ghost", _hover: { bg: "none" } })),
|
|
71
|
+
react_1.default.createElement(react_2.IconButton, { "aria-label": "Search", icon: react_1.default.createElement(lucide_react_1.EllipsisVertical, { size: 17, color: (_c = (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.primary) === null || _c === void 0 ? void 0 : _c[900] }), size: "xs", variant: "ghost", _hover: { bg: "none" } })),
|
|
70
72
|
react_1.default.createElement(react_2.Portal, null,
|
|
71
73
|
react_1.default.createElement(react_2.PopoverContent, { width: "200px" },
|
|
72
74
|
react_1.default.createElement(react_2.PopoverBody, { p: 2 },
|
|
@@ -10,7 +10,7 @@ var palette = {
|
|
|
10
10
|
500: "#9A4FE5", // primary shade
|
|
11
11
|
600: "#8c48d0",
|
|
12
12
|
700: "#6d38a3",
|
|
13
|
-
800: "#
|
|
13
|
+
800: "#55277e",
|
|
14
14
|
900: "#412160",
|
|
15
15
|
opacity: {
|
|
16
16
|
4: "#9A4FE50a",
|
|
@@ -98,7 +98,7 @@ var palette = {
|
|
|
98
98
|
200: "#ffccb7",
|
|
99
99
|
300: "#ffb596",
|
|
100
100
|
400: "#ffa781",
|
|
101
|
-
500: "#
|
|
101
|
+
500: "#ff9162", // Main warning color
|
|
102
102
|
600: "#e88459",
|
|
103
103
|
700: "#b56746",
|
|
104
104
|
800: "#8c5036",
|
|
@@ -110,7 +110,7 @@ var palette = {
|
|
|
110
110
|
200: "#b5e4f0",
|
|
111
111
|
300: "#94d7e9",
|
|
112
112
|
400: "#7fd0e5",
|
|
113
|
-
500: "#
|
|
113
|
+
500: "#5fc4de", // Main info color
|
|
114
114
|
600: "#56b2ea",
|
|
115
115
|
700: "#438b9e",
|
|
116
116
|
800: "#346c78",
|
|
@@ -147,7 +147,7 @@ var palette = {
|
|
|
147
147
|
200: "#ffccb7",
|
|
148
148
|
300: "#ffb596",
|
|
149
149
|
400: "#ffa781",
|
|
150
|
-
500: "#
|
|
150
|
+
500: "#ff9162", // Main warning color
|
|
151
151
|
600: "#e88459",
|
|
152
152
|
700: "#b56746",
|
|
153
153
|
800: "#8c5036",
|
|
@@ -183,7 +183,7 @@ var palette = {
|
|
|
183
183
|
200: "#b5e4f0",
|
|
184
184
|
300: "#94d7e9",
|
|
185
185
|
400: "#7fd0e5",
|
|
186
|
-
500: "#
|
|
186
|
+
500: "#5fc4de", // Main info color
|
|
187
187
|
600: "#56b2ea",
|
|
188
188
|
700: "#438b9e",
|
|
189
189
|
800: "#346c78",
|
|
@@ -20,7 +20,7 @@ declare const palette: {
|
|
|
20
20
|
48: string;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
tertiary: {
|
|
24
24
|
50: string;
|
|
25
25
|
100: string;
|
|
26
26
|
200: string;
|
|
@@ -41,7 +41,102 @@ declare const palette: {
|
|
|
41
41
|
48: string;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
gray: {
|
|
45
|
+
50: string;
|
|
46
|
+
100: string;
|
|
47
|
+
200: string;
|
|
48
|
+
300: string;
|
|
49
|
+
400: string;
|
|
50
|
+
500: string;
|
|
51
|
+
600: string;
|
|
52
|
+
700: string;
|
|
53
|
+
800: string;
|
|
54
|
+
900: string;
|
|
55
|
+
};
|
|
56
|
+
backgroundColor: {
|
|
57
|
+
main: string;
|
|
58
|
+
secondary: string;
|
|
59
|
+
tertiary: string;
|
|
60
|
+
quaternary: string;
|
|
61
|
+
light: string;
|
|
62
|
+
medium: string;
|
|
63
|
+
accent: string;
|
|
64
|
+
subtle: string;
|
|
65
|
+
muted: string;
|
|
66
|
+
neutral: string;
|
|
67
|
+
base: string;
|
|
68
|
+
tableHeader: string;
|
|
69
|
+
};
|
|
70
|
+
background: {
|
|
71
|
+
50: string;
|
|
72
|
+
100: string;
|
|
73
|
+
200: string;
|
|
74
|
+
300: string;
|
|
75
|
+
400: string;
|
|
76
|
+
500: string;
|
|
77
|
+
600: string;
|
|
78
|
+
700: string;
|
|
79
|
+
800: string;
|
|
80
|
+
900: string;
|
|
81
|
+
};
|
|
82
|
+
border: {
|
|
83
|
+
50: string;
|
|
84
|
+
100: string;
|
|
85
|
+
200: string;
|
|
86
|
+
300: string;
|
|
87
|
+
400: string;
|
|
88
|
+
500: string;
|
|
89
|
+
600: string;
|
|
90
|
+
700: string;
|
|
91
|
+
800: string;
|
|
92
|
+
900: string;
|
|
93
|
+
};
|
|
94
|
+
boxborder: {
|
|
95
|
+
50: string;
|
|
96
|
+
100: string;
|
|
97
|
+
200: string;
|
|
98
|
+
300: string;
|
|
99
|
+
400: string;
|
|
100
|
+
500: string;
|
|
101
|
+
600: string;
|
|
102
|
+
700: string;
|
|
103
|
+
800: string;
|
|
104
|
+
900: string;
|
|
105
|
+
};
|
|
106
|
+
table: {
|
|
107
|
+
hover: {
|
|
108
|
+
50: string;
|
|
109
|
+
100: string;
|
|
110
|
+
200: string;
|
|
111
|
+
300: string;
|
|
112
|
+
400: string;
|
|
113
|
+
500: string;
|
|
114
|
+
600: string;
|
|
115
|
+
700: string;
|
|
116
|
+
800: string;
|
|
117
|
+
900: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
sidebar: {
|
|
121
|
+
background: {
|
|
122
|
+
50: string;
|
|
123
|
+
100: string;
|
|
124
|
+
200: string;
|
|
125
|
+
300: string;
|
|
126
|
+
400: string;
|
|
127
|
+
500: string;
|
|
128
|
+
600: string;
|
|
129
|
+
700: string;
|
|
130
|
+
800: string;
|
|
131
|
+
900: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
boxShadow: {
|
|
135
|
+
primary: string;
|
|
136
|
+
error: string;
|
|
137
|
+
default: string;
|
|
138
|
+
};
|
|
139
|
+
secondary: {
|
|
45
140
|
50: string;
|
|
46
141
|
100: string;
|
|
47
142
|
200: string;
|
|
@@ -115,18 +210,6 @@ declare const palette: {
|
|
|
115
210
|
900: string;
|
|
116
211
|
};
|
|
117
212
|
};
|
|
118
|
-
gray: {
|
|
119
|
-
50: string;
|
|
120
|
-
100: string;
|
|
121
|
-
200: string;
|
|
122
|
-
300: string;
|
|
123
|
-
400: string;
|
|
124
|
-
500: string;
|
|
125
|
-
600: string;
|
|
126
|
-
700: string;
|
|
127
|
-
800: string;
|
|
128
|
-
900: string;
|
|
129
|
-
};
|
|
130
213
|
red: {
|
|
131
214
|
50: string;
|
|
132
215
|
100: string;
|
|
@@ -235,30 +318,6 @@ declare const palette: {
|
|
|
235
318
|
800: string;
|
|
236
319
|
900: string;
|
|
237
320
|
};
|
|
238
|
-
background: {
|
|
239
|
-
50: string;
|
|
240
|
-
100: string;
|
|
241
|
-
200: string;
|
|
242
|
-
300: string;
|
|
243
|
-
400: string;
|
|
244
|
-
500: string;
|
|
245
|
-
600: string;
|
|
246
|
-
700: string;
|
|
247
|
-
800: string;
|
|
248
|
-
900: string;
|
|
249
|
-
};
|
|
250
|
-
backgroundColor: {
|
|
251
|
-
main: string;
|
|
252
|
-
secondary: string;
|
|
253
|
-
tertiary: string;
|
|
254
|
-
quaternary: string;
|
|
255
|
-
light: string;
|
|
256
|
-
medium: string;
|
|
257
|
-
accent: string;
|
|
258
|
-
subtle: string;
|
|
259
|
-
muted: string;
|
|
260
|
-
neutral: string;
|
|
261
|
-
};
|
|
262
321
|
text: {
|
|
263
322
|
50: string;
|
|
264
323
|
100: string;
|
|
@@ -295,63 +354,6 @@ declare const palette: {
|
|
|
295
354
|
800: string;
|
|
296
355
|
900: string;
|
|
297
356
|
};
|
|
298
|
-
boxShadow: {
|
|
299
|
-
primary: string;
|
|
300
|
-
error: string;
|
|
301
|
-
default: string;
|
|
302
|
-
};
|
|
303
|
-
sidebar: {
|
|
304
|
-
background: {
|
|
305
|
-
50: string;
|
|
306
|
-
100: string;
|
|
307
|
-
200: string;
|
|
308
|
-
300: string;
|
|
309
|
-
400: string;
|
|
310
|
-
500: string;
|
|
311
|
-
600: string;
|
|
312
|
-
700: string;
|
|
313
|
-
800: string;
|
|
314
|
-
900: string;
|
|
315
|
-
};
|
|
316
|
-
};
|
|
317
|
-
boxborder: {
|
|
318
|
-
50: string;
|
|
319
|
-
100: string;
|
|
320
|
-
200: string;
|
|
321
|
-
300: string;
|
|
322
|
-
400: string;
|
|
323
|
-
500: string;
|
|
324
|
-
600: string;
|
|
325
|
-
700: string;
|
|
326
|
-
800: string;
|
|
327
|
-
900: string;
|
|
328
|
-
};
|
|
329
|
-
border: {
|
|
330
|
-
50: string;
|
|
331
|
-
100: string;
|
|
332
|
-
200: string;
|
|
333
|
-
300: string;
|
|
334
|
-
400: string;
|
|
335
|
-
500: string;
|
|
336
|
-
600: string;
|
|
337
|
-
700: string;
|
|
338
|
-
800: string;
|
|
339
|
-
900: string;
|
|
340
|
-
};
|
|
341
|
-
table: {
|
|
342
|
-
hover: {
|
|
343
|
-
50: string;
|
|
344
|
-
100: string;
|
|
345
|
-
200: string;
|
|
346
|
-
300: string;
|
|
347
|
-
400: string;
|
|
348
|
-
500: string;
|
|
349
|
-
600: string;
|
|
350
|
-
700: string;
|
|
351
|
-
800: string;
|
|
352
|
-
900: string;
|
|
353
|
-
};
|
|
354
|
-
};
|
|
355
357
|
disabled: {
|
|
356
358
|
50: string;
|
|
357
359
|
100: string;
|