gbs-add-block 1.0.28 → 1.0.30

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 (47) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/source/components/bargraph/index.tsx +1 -1
  4. package/source/components/breadcrumb/index.tsx +1 -1
  5. package/source/components/button/index.tsx +1 -1
  6. package/source/components/card/index.tsx +1 -1
  7. package/source/components/checkbox/index.tsx +1 -1
  8. package/source/components/contextmenu/ContextMenu.tsx +1 -1
  9. package/source/components/contextmenu/ContextMenuItem.tsx +1 -1
  10. package/source/components/contextmenu/types.ts +1 -1
  11. package/source/components/datagrid/context/GridContext.tsx +2 -2
  12. package/source/components/datagrid/hooks/useFiltering.ts +1 -1
  13. package/source/components/datagrid/index.tsx +1 -0
  14. package/source/components/datagrid/layout/GridBody.tsx +1 -1
  15. package/source/components/datagrid/type.ts +1 -1
  16. package/source/components/formrenderer/componentHandles/CheckBoxHandles.tsx +1 -1
  17. package/source/components/formrenderer/componentHandles/DatePickerHandles.tsx +1 -1
  18. package/source/components/formrenderer/componentHandles/InputHandles.tsx +1 -1
  19. package/source/components/formrenderer/componentHandles/MultiHandles.tsx +1 -1
  20. package/source/components/formrenderer/componentHandles/SelectHandles.tsx +1 -1
  21. package/source/components/formrenderer/helperFunctions.ts +1 -1
  22. package/source/components/formrenderer/index.tsx +1 -1
  23. package/source/components/input/types.ts +1 -1
  24. package/source/components/materialInput/index.tsx +1 -1
  25. package/source/components/materialInput/types.ts +1 -1
  26. package/source/components/modal/index.tsx +1 -1
  27. package/source/components/navbar/AuthSection.tsx +1 -1
  28. package/source/components/navbar/MobileToggle.tsx +1 -1
  29. package/source/components/navbar/NavItemComponent.tsx +1 -1
  30. package/source/components/navbar/SearchBar.tsx +1 -1
  31. package/source/components/navbar/index.tsx +1 -1
  32. package/source/components/sidebar/components/MenuItem.tsx +1 -1
  33. package/source/components/sidebar/components/MenuSection.tsx +1 -1
  34. package/source/components/sidebar/components/SidebarFooter.tsx +1 -1
  35. package/source/components/sidebar/components/SidebarLogo.tsx +1 -1
  36. package/source/components/sidebar/components/SidebarMenu.tsx +1 -1
  37. package/source/components/sidebar/components/UserProfile.tsx +1 -1
  38. package/source/components/sidebar/hooks/useSidebarState.ts +1 -1
  39. package/source/components/sidebar/index.tsx +1 -1
  40. package/source/components/tabs/index.tsx +1 -1
  41. package/source/components/tabs/types.ts +1 -1
  42. package/source/components/toast/ToastComponent.tsx +1 -1
  43. package/source/components/toast/ToastIcon.tsx +1 -1
  44. package/source/components/toast/index.tsx +1 -1
  45. package/source/components/toast/toastStore.ts +1 -1
  46. package/source/components/toast/useToast.ts +1 -1
  47. package/source/icon/iconPaths.ts +21 -0
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # GBS Building Blocks 2.0 (v1.0.28)
1
+ # GBS Building Blocks 2.0 (v1.0.30)
2
2
 
3
3
  Latest and upgraded version of GBS building blocks with headless UI and removed dependencies.
4
4
 
@@ -6,9 +6,9 @@ Latest and upgraded version of GBS building blocks with headless UI and removed
6
6
 
7
7
  For detailed documentation on usage and props, Please visit: [Building Block Documentation v2.0](https://gramprokit.vercel.app)
8
8
 
9
- ## What's New 🎉 (Ver 1.0.28)
9
+ ## What's New 🎉 (Ver 1.0.30)
10
10
 
11
- - General Bug Fix
11
+ - Type Import Update
12
12
 
13
13
  ## Authors
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gbs-add-block",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "React Component Library",
5
5
  "type": "module",
6
6
  "files": [
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { useState } from "react";
3
- import { BarChartProps } from "./type";
3
+ import type { BarChartProps } from "./type";
4
4
 
5
5
  export const BarChart: React.FC<BarChartProps> = ({
6
6
  data,
@@ -9,7 +9,7 @@ import React from "react";
9
9
  import { useLocation } from "@grampro/headless-helpers";
10
10
  import Icon from "../icon/Icon";
11
11
  import { rightArrow } from "../icon/iconPaths";
12
- import { BreadcrumbsProps } from "./types";
12
+ import type { BreadcrumbsProps } from "./types";
13
13
 
14
14
  export const Breadcrumb = ({
15
15
  showHome = true,
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import React, { ButtonHTMLAttributes, ReactNode } from "react";
8
+ import React, { type ButtonHTMLAttributes, type ReactNode } from "react";
9
9
 
10
10
  interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
11
11
  children?: ReactNode;
@@ -1,4 +1,4 @@
1
- import React, { ReactNode } from "react";
1
+ import React, { type ReactNode } from "react";
2
2
 
3
3
  interface CardProps {
4
4
  children?: ReactNode;
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import React, { InputHTMLAttributes } from "react";
8
+ import React, { type InputHTMLAttributes } from "react";
9
9
 
10
10
  export const Checkbox = ({
11
11
  ...props
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect, useCallback, MouseEvent } from "react";
2
- import { ContextMenuProps, Position } from "./types";
2
+ import type { ContextMenuProps, Position } from "./types";
3
3
 
4
4
  export const ContextMenu: React.FC<ContextMenuProps> = ({ children }) => {
5
5
  const [isVisible, setIsVisible] = useState<boolean>(false);
@@ -1,4 +1,4 @@
1
- import { ContextMenuItemProps } from "./types";
1
+ import type { ContextMenuItemProps } from "./types";
2
2
 
3
3
  export const ContextMenuItem: React.FC<ContextMenuItemProps> = ({
4
4
  onClick,
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import type { ReactNode } from "react";
2
2
 
3
3
  interface Position {
4
4
  x: number;
@@ -110,8 +110,8 @@ export const GridProvider: React.FC<{
110
110
  const { selectedRows, handleSelectAll, handleSelect, isRowSelected } =
111
111
  useRowSelection(workingDataSource, onSelectRow);
112
112
 
113
- // Page status reporting
114
- usePageStatus(currentPage, totalPages, pageStatus);
113
+ // Page status reporting - Bug Report - causes re-rendering when currentPage or totalPages change
114
+ // usePageStatus(currentPage, totalPages, pageStatus);
115
115
 
116
116
  // Context value
117
117
  const contextValue: GridContextType = {
@@ -3,7 +3,7 @@ import {
3
3
  clearFilterHelper,
4
4
  handleApplyFilterHelper,
5
5
  } from "@grampro/headless-helpers";
6
- import { ActiveFilterArrayValue } from "../type";
6
+ import type { ActiveFilterArrayValue } from "../type";
7
7
 
8
8
  interface UseFilteringProps {
9
9
  columns: any[];
@@ -8,6 +8,7 @@
8
8
  * https://psychedelic-step-e70.notion.site/Data-GRID-by-GBS-R-D-20ff97c899d24bc590215a6196435fa3
9
9
  */
10
10
 
11
+ import React from "react";
11
12
  import { GridMemoised as GridComponent } from "./layout";
12
13
  import { memo } from "react";
13
14
 
@@ -3,7 +3,7 @@ import { useGridContext } from "../context/GridContext";
3
3
  import FilterPopup from "./FilterPopup";
4
4
  import Icon from "../../icon/Icon";
5
5
  import { listFilter } from "../../icon/iconPaths";
6
- import { Column } from "../type";
6
+ import type { Column } from "../type";
7
7
 
8
8
  const GridBody = () => {
9
9
  const {
@@ -1,4 +1,4 @@
1
- import { ChangeEvent } from "react";
1
+ import type { ChangeEvent } from "react";
2
2
 
3
3
  interface PageSettingsProps {
4
4
  pageNumber: number;
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState } from "react";
2
- import { CheckboxHandlesProps } from "../types";
2
+ import type { CheckboxHandlesProps } from "../types";
3
3
 
4
4
  const CheckboxHandles = ({
5
5
  item,
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useEffect, useState } from "react";
2
2
  import { DatePicker } from "../../datepicker";
3
- import { DatePickerHandlesProps } from "../types";
3
+ import type { DatePickerHandlesProps } from "../types";
4
4
  import { evaluateExpression } from "@grampro/headless-helpers";
5
5
 
6
6
  export default function DatePickerHandles({
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useState, useCallback } from "react";
2
2
  import { validateInput } from "../helperFunctions";
3
3
  import { Input } from "../../input";
4
- import { InputHandlesProps } from "../types";
4
+ import type { InputHandlesProps } from "../types";
5
5
  import { evaluateExpression } from "@grampro/headless-helpers";
6
6
  import { twMerge } from "tailwind-merge";
7
7
 
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useEffect, useState } from "react";
2
- import { MultiSelectHandlesProps } from "../types";
2
+ import type { MultiSelectHandlesProps } from "../types";
3
3
  import { MultiSelect } from "../../multiselect";
4
4
  import { evaluateExpression } from "@grampro/headless-helpers";
5
5
 
@@ -1,6 +1,6 @@
1
1
  import React, { useCallback, useEffect, useState } from "react";
2
2
  import { Select } from "../../select";
3
- import { Option, SelectHandlesProps } from "../types";
3
+ import type { Option, SelectHandlesProps } from "../types";
4
4
  import { evaluateExpression } from "@grampro/headless-helpers";
5
5
 
6
6
  export default function SelectHandles({
@@ -3,7 +3,7 @@ import SelectHandles from "./componentHandles/SelectHandles";
3
3
  import MultiHandles from "./componentHandles/MultiHandles";
4
4
  import DatePickerHandles from "./componentHandles/DatePickerHandles";
5
5
  import CheckboxHandles from "./componentHandles/CheckBoxHandles";
6
- import { FormItem } from "./types";
6
+ import type { FormItem } from "./types";
7
7
 
8
8
  // Component Map
9
9
  export const COMPONENT_MAP = {
@@ -7,7 +7,7 @@
7
7
 
8
8
  import React, { useRef, useState, FormEvent } from "react";
9
9
  import { useFormContext } from "@grampro/headless-helpers";
10
- import { FormItem, FormRendererProps } from "./types";
10
+ import type { FormItem, FormRendererProps } from "./types";
11
11
  import { COMPONENT_MAP, validateField } from "./helperFunctions";
12
12
 
13
13
  const FormRenderer: React.FC<FormRendererProps> = ({
@@ -1,4 +1,4 @@
1
- import { InputHTMLAttributes } from "react";
1
+ import type { InputHTMLAttributes } from "react";
2
2
 
3
3
  export type InputProps = {
4
4
  OTPField?: boolean;
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import React, { useState, useRef } from "react";
9
- import { MaterialInputProps } from "./types";
9
+ import type { MaterialInputProps } from "./types";
10
10
 
11
11
  const MaterialInput = ({
12
12
  label,
@@ -1,4 +1,4 @@
1
- import { InputHTMLAttributes } from "react";
1
+ import type { InputHTMLAttributes } from "react";
2
2
 
3
3
  export type MaterialInputProps = {
4
4
  label?: string;
@@ -9,7 +9,7 @@ import React, { useEffect, useCallback, memo, useRef } from "react";
9
9
  import { twMerge } from "tailwind-merge";
10
10
  import Icon from "../icon/Icon";
11
11
  import { x } from "../icon/iconPaths";
12
- import { ModalProps } from "./types";
12
+ import type { ModalProps } from "./types";
13
13
 
14
14
  const defaultClasses = {
15
15
  modal:
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { AuthSectionProps } from "./types";
2
+ import type { AuthSectionProps } from "./types";
3
3
 
4
4
  const AuthSection: React.FC<AuthSectionProps> = ({
5
5
  showAuthButtons,
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { MobileToggleProps } from "./types";
2
+ import type { MobileToggleProps } from "./types";
3
3
 
4
4
  const MobileToggle: React.FC<MobileToggleProps> = ({ isOpen, toggleMenu }) => {
5
5
  return (
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { NavItem, NavItemComponentProps } from "./types";
2
+ import type { NavItem, NavItemComponentProps } from "./types";
3
3
 
4
4
  const NavItemComponent: React.FC<NavItemComponentProps> = ({
5
5
  items,
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback } from "react";
2
- import { SearchBarProps } from "./types";
2
+ import type { SearchBarProps } from "./types";
3
3
 
4
4
  const SearchBar: React.FC<SearchBarProps> = ({
5
5
  variant,
@@ -10,7 +10,7 @@ import NavItemComponent from "./NavItemComponent";
10
10
  import SearchBar from "./SearchBar";
11
11
  import AuthSection from "./AuthSection";
12
12
  import MobileToggle from "./MobileToggle";
13
- import { NavbarProps } from "./types";
13
+ import type { NavbarProps } from "./types";
14
14
  import {
15
15
  getContainerClasses,
16
16
  getPositionClasses,
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from "react";
2
- import { MenuItem, IconComponent } from "../type";
2
+ import type { MenuItem, IconComponent } from "../type";
3
3
 
4
4
  type MenuItemProps = {
5
5
  item: MenuItem;
@@ -1,4 +1,4 @@
1
- import { MenuSection as MenuSectionType, IconComponent } from "../type";
1
+ import type { MenuSection as MenuSectionType, IconComponent } from "../type";
2
2
  import { MenuItemComponent } from "./MenuItem";
3
3
 
4
4
  type MenuSectionProps = {
@@ -1,4 +1,4 @@
1
- import { MenuItem, IconComponent } from "../type";
1
+ import type { MenuItem, IconComponent } from "../type";
2
2
 
3
3
  type SidebarFooterProps = {
4
4
  footerItems?: MenuItem[];
@@ -1,4 +1,4 @@
1
- import { MenuData } from "../type";
1
+ import type { MenuData } from "../type";
2
2
 
3
3
  type SidebarLogoProps = {
4
4
  logo: MenuData["logo"];
@@ -1,4 +1,4 @@
1
- import { IconComponent, MenuSection } from "../type";
1
+ import type { IconComponent, MenuSection } from "../type";
2
2
  import { MenuSection as MenuSectionComponent } from "./MenuSection";
3
3
 
4
4
  type SidebarMenuProps = {
@@ -1,4 +1,4 @@
1
- import { MenuData } from "../type";
1
+ import type { MenuData } from "../type";
2
2
 
3
3
  type UserProfileProps = {
4
4
  profile: MenuData["profile"];
@@ -1,5 +1,5 @@
1
1
  import { useState } from "react";
2
- import { MenuData } from "../type";
2
+ import type { MenuData } from "../type";
3
3
 
4
4
  export const useSidebarState = (menuData: MenuData) => {
5
5
  const [sidebarData, setSidebarData] = useState<MenuData>(menuData);
@@ -1,4 +1,4 @@
1
- import { SidebarProps } from "./type";
1
+ import type { SidebarProps } from "./type";
2
2
  import { useSidebarState } from "./hooks/useSidebarState";
3
3
  import { SidebarLogo } from "./components/SidebarLogo";
4
4
  import { SidebarMenu } from "./components/SidebarMenu";
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { useState } from "react";
9
- import { TabsProps } from "./types";
9
+ import type { TabsProps } from "./types";
10
10
 
11
11
  export function Tabs({
12
12
  tabs,
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import type { ReactNode } from "react";
2
2
 
3
3
  export interface TabItem {
4
4
  id: string;
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect } from "react";
2
- import { Toast } from "./types";
2
+ import type { Toast } from "./types";
3
3
  import { useToastStore } from "./toastStore";
4
4
  import ToastIcon from "./ToastIcon";
5
5
 
@@ -1,4 +1,4 @@
1
- import { Toast } from "./types";
1
+ import type { Toast } from "./types";
2
2
 
3
3
  const ToastIcon = ({ type }: { type: Toast["type"] }) => {
4
4
  if (!type) return null;
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React, { useEffect } from "react";
4
4
  import { createPortal } from "react-dom";
5
- import { ToastPosition } from "./types";
5
+ import type { ToastPosition } from "./types";
6
6
  import { useToastStore } from "./toastStore";
7
7
  import { ToastComponent } from "./ToastComponent";
8
8
 
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Toast } from "./types";
2
+ import type { Toast } from "./types";
3
3
 
4
4
  type ToastState = {
5
5
  toasts: Toast[];
@@ -1,4 +1,4 @@
1
- import { Toast } from "./types";
1
+ import type { Toast } from "./types";
2
2
  import { useToastStore } from "./toastStore";
3
3
 
4
4
  export function useToast() {
@@ -177,3 +177,24 @@ export const cloudDownload: any = [
177
177
  key: "ui1hmy",
178
178
  },
179
179
  ];
180
+
181
+ export const plus: any = [
182
+ { type: "path", d: "M12 5v14", key: "vertical" },
183
+ { type: "path", d: "M5 12h14", key: "horizontal" },
184
+ ];
185
+
186
+ export const trash: any = [
187
+ {
188
+ type: "path",
189
+ d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",
190
+ key: "bin",
191
+ fill: "none",
192
+ },
193
+ { type: "path", d: "M3 6h18", key: "lid", fill: "none" },
194
+ {
195
+ type: "path",
196
+ d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
197
+ key: "handle",
198
+ fill: "none",
199
+ },
200
+ ];