@codezee/sixtify-brahma 0.2.147 → 0.2.149

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.
Files changed (21) hide show
  1. package/package.json +1 -1
  2. package/packages/shared-components/dist/ActionButtons/ActionButtons.d.ts.map +1 -1
  3. package/packages/shared-components/dist/ActionButtons/ActionButtons.js +29 -8
  4. package/packages/shared-components/dist/AgGrid/hooks/index.d.ts +1 -0
  5. package/packages/shared-components/dist/AgGrid/hooks/index.d.ts.map +1 -1
  6. package/packages/shared-components/dist/AgGrid/hooks/index.js +1 -0
  7. package/packages/shared-components/dist/AgGrid/hooks/useAgGridKeyboardShortcuts.d.ts +8 -0
  8. package/packages/shared-components/dist/AgGrid/hooks/useAgGridKeyboardShortcuts.d.ts.map +1 -0
  9. package/packages/shared-components/dist/AgGrid/hooks/useAgGridKeyboardShortcuts.js +37 -0
  10. package/packages/shared-components/dist/codeSnippetBox/CodeSnippetBox.d.ts +9 -0
  11. package/packages/shared-components/dist/codeSnippetBox/CodeSnippetBox.d.ts.map +1 -0
  12. package/packages/shared-components/dist/codeSnippetBox/CodeSnippetBox.js +9 -0
  13. package/packages/shared-components/dist/codeSnippetBox/CodeSnippetBox.styled.d.ts +4 -0
  14. package/packages/shared-components/dist/codeSnippetBox/CodeSnippetBox.styled.d.ts.map +1 -0
  15. package/packages/shared-components/dist/codeSnippetBox/CodeSnippetBox.styled.js +31 -0
  16. package/packages/shared-components/dist/codeSnippetBox/index.d.ts +2 -0
  17. package/packages/shared-components/dist/codeSnippetBox/index.d.ts.map +1 -0
  18. package/packages/shared-components/dist/codeSnippetBox/index.js +17 -0
  19. package/packages/shared-components/dist/index.d.ts +1 -0
  20. package/packages/shared-components/dist/index.d.ts.map +1 -1
  21. package/packages/shared-components/dist/index.js +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codezee/sixtify-brahma",
3
- "version": "0.2.147",
3
+ "version": "0.2.149",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hardikranpariya/sixtify-brahma.git"
@@ -1 +1 @@
1
- {"version":3,"file":"ActionButtons.d.ts","sourceRoot":"","sources":["../../src/ActionButtons/ActionButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKzD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC9C,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,cAAsB,EACtB,EAAE,EACF,QAAQ,EACR,wBAAgC,EAChC,OAAe,EACf,WAAiB,GAClB,EAAE,kBAAkB,2CA2IpB"}
1
+ {"version":3,"file":"ActionButtons.d.ts","sourceRoot":"","sources":["../../src/ActionButtons/ActionButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAKzD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC9C,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,cAAsB,EACtB,EAAE,EACF,QAAQ,EACR,wBAAgC,EAChC,OAAe,EACf,WAAiB,GAClB,EAAE,kBAAkB,2CA8KpB"}
@@ -13,6 +13,7 @@ function ActionButtons({ buttons, justifyContent = "end", sx, buttonSx, shouldOp
13
13
  const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
14
14
  const [openMenuKey, setOpenMenuKey] = (0, react_1.useState)(null);
15
15
  const buttonRefs = (0, react_1.useRef)({});
16
+ const uniqueId = (0, react_1.useId)();
16
17
  const handleMenuOpen = (event, key) => {
17
18
  const element = event instanceof HTMLElement ? event : event.currentTarget;
18
19
  setAnchorEl(element);
@@ -22,19 +23,39 @@ function ActionButtons({ buttons, justifyContent = "end", sx, buttonSx, shouldOp
22
23
  setAnchorEl(null);
23
24
  setOpenMenuKey(null);
24
25
  };
26
+ const hasValidButton = buttons.some((button) => {
27
+ const hasVisibleMenuItems = button.menuItems?.some((item) => !item.hidden);
28
+ return (!!button.menuItems?.length &&
29
+ !button.hidden &&
30
+ !button.disabled &&
31
+ hasVisibleMenuItems);
32
+ });
33
+ const shouldRegisterShortcut = shouldOpenMenuOnShortcut && hasValidButton && !disable;
34
+ const effectiveShortcutKey = shouldRegisterShortcut
35
+ ? shortcutKey
36
+ : `disabled-${uniqueId}`;
25
37
  (0, utils_1.useGlobalKeyboardShortcut)({
26
- key: shortcutKey,
38
+ key: effectiveShortcutKey,
27
39
  modifierKeys: ["ctrl", "shift"],
28
40
  onTrigger: () => {
29
- if (shouldOpenMenuOnShortcut && !disable) {
30
- const buttonWithMenu = buttons.find((button) => !!button.menuItems?.length && !button.hidden);
31
- if (buttonWithMenu) {
32
- const buttonElement = buttonRefs.current[buttonWithMenu.key];
33
- if (buttonElement) {
34
- handleMenuOpen(buttonElement, buttonWithMenu.key);
35
- }
41
+ if (!shouldRegisterShortcut) {
42
+ return false;
43
+ }
44
+ const buttonWithMenu = buttons.find((button) => {
45
+ const hasVisibleMenuItems = button.menuItems?.some((item) => !item.hidden);
46
+ return (!!button.menuItems?.length &&
47
+ !button.hidden &&
48
+ !button.disabled &&
49
+ hasVisibleMenuItems);
50
+ });
51
+ if (buttonWithMenu) {
52
+ const buttonElement = buttonRefs.current[buttonWithMenu.key];
53
+ if (buttonElement && document.contains(buttonElement)) {
54
+ handleMenuOpen(buttonElement, buttonWithMenu.key);
55
+ return true;
36
56
  }
37
57
  }
58
+ return false;
38
59
  },
39
60
  });
40
61
  return ((0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", sx: sx, gap: "1.6rem", justifyContent: justifyContent, children: buttons
@@ -3,4 +3,5 @@ export * from "./useAgGridSummaryRow";
3
3
  export * from "./useAgGridSummaryRowUpdate";
4
4
  export * from "./useAgGridRowSelectionConfig";
5
5
  export * from "./useAgGridFilteredData";
6
+ export * from "./useAgGridKeyboardShortcuts";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC"}
@@ -19,3 +19,4 @@ __exportStar(require("./useAgGridSummaryRow"), exports);
19
19
  __exportStar(require("./useAgGridSummaryRowUpdate"), exports);
20
20
  __exportStar(require("./useAgGridRowSelectionConfig"), exports);
21
21
  __exportStar(require("./useAgGridFilteredData"), exports);
22
+ __exportStar(require("./useAgGridKeyboardShortcuts"), exports);
@@ -0,0 +1,8 @@
1
+ import type { AgGridReact } from "ag-grid-react";
2
+ import type { RefObject } from "react";
3
+ type UseAgGridKeyboardShortcutsArgs<T = unknown> = {
4
+ gridRef: RefObject<AgGridReact<T>>;
5
+ };
6
+ export declare const useAgGridKeyboardShortcuts: <T = unknown>({ gridRef, }: UseAgGridKeyboardShortcutsArgs<T>) => void;
7
+ export {};
8
+ //# sourceMappingURL=useAgGridKeyboardShortcuts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAgGridKeyboardShortcuts.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/useAgGridKeyboardShortcuts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,KAAK,8BAA8B,CAAC,CAAC,GAAG,OAAO,IAAI;IACjD,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,CAAC,GAAG,OAAO,EAAE,cAErD,8BAA8B,CAAC,CAAC,CAAC,SAoCnC,CAAC"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useAgGridKeyboardShortcuts = void 0;
4
+ const utils_1 = require("../../utils");
5
+ const useAgGridKeyboardShortcuts = ({ gridRef, }) => {
6
+ (0, utils_1.useGlobalKeyboardShortcut)({
7
+ key: "a",
8
+ modifierKeys: "ctrl",
9
+ onTrigger: () => {
10
+ if (!gridRef.current?.api) {
11
+ return;
12
+ }
13
+ const api = gridRef.current.api;
14
+ api.forEachNodeAfterFilterAndSort((node) => {
15
+ if (node.displayed && node.data) {
16
+ node.setSelected(true);
17
+ }
18
+ });
19
+ },
20
+ });
21
+ (0, utils_1.useGlobalKeyboardShortcut)({
22
+ key: "a",
23
+ modifierKeys: "alt",
24
+ onTrigger: () => {
25
+ if (!gridRef.current?.api) {
26
+ return;
27
+ }
28
+ const api = gridRef.current.api;
29
+ api.forEachNodeAfterFilterAndSort((node) => {
30
+ if (node.displayed && node.data) {
31
+ node.setSelected(false);
32
+ }
33
+ });
34
+ },
35
+ });
36
+ };
37
+ exports.useAgGridKeyboardShortcuts = useAgGridKeyboardShortcuts;
@@ -0,0 +1,9 @@
1
+ import type { BoxProps } from "@mui/material";
2
+ import type { ReactNode } from "react";
3
+ type CodeSnippetBoxProps = {
4
+ children: ReactNode;
5
+ component?: BoxProps["component"];
6
+ };
7
+ export declare const CodeSnippetBox: ({ children, component, }: CodeSnippetBoxProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=CodeSnippetBox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeSnippetBox.d.ts","sourceRoot":"","sources":["../../src/codeSnippetBox/CodeSnippetBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,KAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,0BAG5B,mBAAmB,4CAMrB,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CodeSnippetBox = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const CodeSnippetBox_styled_1 = require("./CodeSnippetBox.styled");
6
+ const CodeSnippetBox = ({ children, component = "pre", }) => {
7
+ return ((0, jsx_runtime_1.jsx)(CodeSnippetBox_styled_1.StyledCodeSnippetBox, { component: component, children: children }));
8
+ };
9
+ exports.CodeSnippetBox = CodeSnippetBox;
@@ -0,0 +1,4 @@
1
+ import type { StyledComponent } from "@emotion/styled";
2
+ import { type BoxProps } from "@mui/material";
3
+ export declare const StyledCodeSnippetBox: StyledComponent<BoxProps>;
4
+ //# sourceMappingURL=CodeSnippetBox.styled.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeSnippetBox.styled.d.ts","sourceRoot":"","sources":["../../src/codeSnippetBox/CodeSnippetBox.styled.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGnD,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC,QAAQ,CA+BzD,CAAC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StyledCodeSnippetBox = void 0;
4
+ const material_1 = require("@mui/material");
5
+ const styles_1 = require("@mui/material/styles");
6
+ exports.StyledCodeSnippetBox = (0, styles_1.styled)(material_1.Box)(({ theme, }) => {
7
+ const { app: { color }, } = theme.palette;
8
+ const { slate, iron, claude } = color;
9
+ return {
10
+ backgroundColor: slate[900],
11
+ borderRadius: "4px",
12
+ boxShadow: `0 4px 16px ${slate[800]}40`,
13
+ color: iron[600],
14
+ padding: theme.spacing(2),
15
+ fontSize: "0.85rem",
16
+ overflow: "auto",
17
+ fontFamily: "SFMono-Regular, Menlo, Monaco, Consolas, monospace",
18
+ lineHeight: 1.5,
19
+ "& code": {
20
+ fontFamily: "inherit",
21
+ },
22
+ "& pre": {
23
+ margin: 0,
24
+ fontFamily: "inherit",
25
+ },
26
+ "& ::selection": {
27
+ backgroundColor: claude[300],
28
+ color: slate[900],
29
+ },
30
+ };
31
+ });
@@ -0,0 +1,2 @@
1
+ export * from "./CodeSnippetBox";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/codeSnippetBox/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,17 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./CodeSnippetBox"), exports);
@@ -8,6 +8,7 @@ export * from "./Button";
8
8
  export * from "./Card";
9
9
  export * from "./CellSelectionTable";
10
10
  export * from "./Charts";
11
+ export * from "./codeSnippetBox";
11
12
  export * from "./Chips";
12
13
  export * from "./ColumnArranger";
13
14
  export * from "./ContentBox";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AAC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,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
@@ -24,6 +24,7 @@ __exportStar(require("./Button"), exports);
24
24
  __exportStar(require("./Card"), exports);
25
25
  __exportStar(require("./CellSelectionTable"), exports);
26
26
  __exportStar(require("./Charts"), exports);
27
+ __exportStar(require("./codeSnippetBox"), exports);
27
28
  __exportStar(require("./Chips"), exports);
28
29
  __exportStar(require("./ColumnArranger"), exports);
29
30
  __exportStar(require("./ContentBox"), exports);