@6thbridge/hexa 0.0.52 → 0.0.54

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.
@@ -1,5 +1,5 @@
1
1
   WARN  Issue while reading "/Users/joachim/.nvm/versions/node/v20.17.0/lib/node_modules/npmrc". EISDIR: illegal operation on a directory, read
2
2
 
3
- > @6thbridge/hexa@0.0.51 lint /Users/joachim/Documents/dev/payfusion/payfusion-component-library/packages/6thbridge-hexa
3
+ > @6thbridge/hexa@0.0.54 lint /Users/joachim/Documents/dev/payfusion/payfusion-component-library/packages/6thbridge-hexa
4
4
  > eslint . --max-warnings 0
5
5
 
package/dist/index.d.mts CHANGED
@@ -1,7 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import * as React$1 from 'react';
2
3
  import React__default, { DetailedHTMLProps, ButtonHTMLAttributes, ReactNode } from 'react';
4
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
3
5
  import * as LabelPrimitive from '@radix-ui/react-label';
4
- import * as react_jsx_runtime from 'react/jsx-runtime';
5
6
  import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
6
7
  import { VariantProps } from 'class-variance-authority';
7
8
  import * as RPNInput from 'react-phone-number-input';
@@ -14,6 +15,29 @@ import { RowData, Row, Table as Table$1 } from '@tanstack/react-table';
14
15
  import dayjs from 'dayjs';
15
16
  import { ClassValue } from 'clsx';
16
17
 
18
+ declare const TooltipProvider: React$1.FC<TooltipPrimitive.TooltipProviderProps>;
19
+ declare const TooltipRoot: React$1.FC<TooltipPrimitive.TooltipProps>;
20
+ declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
21
+ declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
22
+ type TooltipPropsType = {
23
+ trigger: React$1.ReactNode;
24
+ children: React$1.ReactNode;
25
+ contentClassName?: string;
26
+ triggerClassName?: string;
27
+ asChild?: boolean;
28
+ side?: TooltipPrimitive.TooltipContentProps["side"];
29
+ sideOffset?: number;
30
+ align?: TooltipPrimitive.TooltipContentProps["align"];
31
+ alignOffset?: number;
32
+ delayDuration?: number;
33
+ hasArrow?: boolean;
34
+ arrowClassName?: string;
35
+ };
36
+ declare const Tooltip: {
37
+ ({ trigger, children, contentClassName, triggerClassName, asChild, side, sideOffset, align, alignOffset, delayDuration, hasArrow, arrowClassName, ...props }: TooltipPropsType & React$1.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
38
+ displayName: string;
39
+ };
40
+
17
41
  declare const FormLabel: React__default.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React__default.RefAttributes<HTMLLabelElement>, "ref"> & {
18
42
  showAsterisk?: boolean;
19
43
  error?: string;
@@ -292,6 +316,69 @@ declare const LocaleSelector: ({ locale, onChange, locales, }: {
292
316
  locales?: LocaleOption[];
293
317
  }) => react_jsx_runtime.JSX.Element;
294
318
 
319
+ type BusinessType = {
320
+ clientId?: string;
321
+ email?: string;
322
+ name?: string;
323
+ updatedAt?: string;
324
+ phoneNumber?: string;
325
+ logo?: string;
326
+ currencyCode?: string;
327
+ countryCode?: string;
328
+ currencyIcon?: string;
329
+ countryFlag?: string;
330
+ isKYCCompleted?: boolean;
331
+ parentClientId?: string;
332
+ supportedCountryCodes?: string[];
333
+ status?: string;
334
+ access?: string;
335
+ };
336
+
337
+ type SingleLinkType = {
338
+ to: string;
339
+ name: string;
340
+ isHidden?: boolean;
341
+ icon?: ReactNode;
342
+ badge?: ReactNode;
343
+ permission?: string;
344
+ key?: string;
345
+ id: string;
346
+ };
347
+ type BusinessProps = {
348
+ businessList: BusinessType[];
349
+ activeBusiness: BusinessType;
350
+ isBusinessDrawerActive: boolean;
351
+ toggleAddBusinessDrawer: () => void;
352
+ handleSetActiveBusiness: (clientId: string) => void;
353
+ };
354
+ type LinksType = {
355
+ children?: SingleLinkType[];
356
+ } & SingleLinkType;
357
+ type SidebarProps = {
358
+ isSidebarCollapsed: boolean;
359
+ collapseType: CollapseType;
360
+ links: LinksType[];
361
+ onToggleSideBar: (isOpen: boolean) => void;
362
+ isMobile: boolean;
363
+ businessProps: BusinessProps;
364
+ currentPath: string;
365
+ onNavigate: (path: string) => void;
366
+ appConfig?: IAppConfig & {
367
+ [key: string]: unknown;
368
+ };
369
+ onLogoutClick: () => void;
370
+ openSidebarIcon?: ReactNode;
371
+ closedSidebarIcon?: ReactNode;
372
+ nodeAfterSideBarLogo?: ReactNode;
373
+ };
374
+ interface IAppConfig {
375
+ appName: string;
376
+ hiddenRoutes?: string[];
377
+ }
378
+ type CollapseType = "icons" | "hidden";
379
+
380
+ declare const Sidebar: ({ isSidebarCollapsed, onToggleSideBar, isMobile, links, businessProps, currentPath, onNavigate, appConfig, collapseType: propCollapseType, onLogoutClick, openSidebarIcon, closedSidebarIcon, nodeAfterSideBarLogo, }: SidebarProps) => react_jsx_runtime.JSX.Element;
381
+
295
382
  type Variant = "success" | "failed" | "pending" | "abandoned";
296
383
  declare const Status: ({ status, variant, className, }: {
297
384
  status: string;
@@ -358,6 +445,39 @@ type PageDataToolbarProps = {
358
445
  };
359
446
  declare const PageDataToolbar: ({ onRefetch, search, FilterMenu, ExtraNode, onExport, download, isRefetching, }: PageDataToolbarProps) => react_jsx_runtime.JSX.Element;
360
447
 
448
+ type ResourcePermission = {
449
+ resource: string;
450
+ action: string;
451
+ };
452
+ type ResourcePermissions = ResourcePermission[];
453
+ type ResourcePermissionProps = {
454
+ permission?: {
455
+ resource?: string;
456
+ action?: string;
457
+ };
458
+ children: ReactNode;
459
+ };
460
+
461
+ declare const PermissionsContext: React$1.Context<ResourcePermissions | undefined>;
462
+ declare const PermissionsProvider: ({ permissions, children, }: {
463
+ permissions: ResourcePermissions;
464
+ children: ReactNode;
465
+ }) => react_jsx_runtime.JSX.Element;
466
+
467
+ declare const usePermissions: () => ResourcePermissions | undefined;
468
+ declare const useHasPermission: (permission: {
469
+ resource?: string;
470
+ action?: string;
471
+ }) => {
472
+ hasPermission: boolean;
473
+ validatePermission: (permission: {
474
+ resource?: string;
475
+ action?: string;
476
+ }) => boolean;
477
+ };
478
+
479
+ declare const HasResourcePermission: ({ permission, children, }: ResourcePermissionProps) => react_jsx_runtime.JSX.Element;
480
+
361
481
  declare const CurrencySymbolMap: Record<string, string>;
362
482
  interface FormatCurrencyOptions {
363
483
  convertToMajorCurrency?: boolean;
@@ -379,4 +499,4 @@ declare class DateAction {
379
499
 
380
500
  declare function cn(...inputs: ClassValue[]): string;
381
501
 
382
- export { AmountAction, Banner, Button, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, FlagComponent, FormLabel, type FormatCurrencyOptions, Input, Loader, LocaleSelector, OTPInput, PageDataToolbar, Pagination, PasswordInput, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, Select, Status, Table, type TablePaginationProps, Textarea, buttonVariants, cn };
502
+ export { AmountAction, Banner, Button, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, Select, Sidebar, Status, Table, type TablePaginationProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useHasPermission, usePermissions };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import * as React$1 from 'react';
2
3
  import React__default, { DetailedHTMLProps, ButtonHTMLAttributes, ReactNode } from 'react';
4
+ import * as TooltipPrimitive from '@radix-ui/react-tooltip';
3
5
  import * as LabelPrimitive from '@radix-ui/react-label';
4
- import * as react_jsx_runtime from 'react/jsx-runtime';
5
6
  import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
6
7
  import { VariantProps } from 'class-variance-authority';
7
8
  import * as RPNInput from 'react-phone-number-input';
@@ -14,6 +15,29 @@ import { RowData, Row, Table as Table$1 } from '@tanstack/react-table';
14
15
  import dayjs from 'dayjs';
15
16
  import { ClassValue } from 'clsx';
16
17
 
18
+ declare const TooltipProvider: React$1.FC<TooltipPrimitive.TooltipProviderProps>;
19
+ declare const TooltipRoot: React$1.FC<TooltipPrimitive.TooltipProps>;
20
+ declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
21
+ declare const TooltipContent: React$1.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
22
+ type TooltipPropsType = {
23
+ trigger: React$1.ReactNode;
24
+ children: React$1.ReactNode;
25
+ contentClassName?: string;
26
+ triggerClassName?: string;
27
+ asChild?: boolean;
28
+ side?: TooltipPrimitive.TooltipContentProps["side"];
29
+ sideOffset?: number;
30
+ align?: TooltipPrimitive.TooltipContentProps["align"];
31
+ alignOffset?: number;
32
+ delayDuration?: number;
33
+ hasArrow?: boolean;
34
+ arrowClassName?: string;
35
+ };
36
+ declare const Tooltip: {
37
+ ({ trigger, children, contentClassName, triggerClassName, asChild, side, sideOffset, align, alignOffset, delayDuration, hasArrow, arrowClassName, ...props }: TooltipPropsType & React$1.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
38
+ displayName: string;
39
+ };
40
+
17
41
  declare const FormLabel: React__default.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React__default.RefAttributes<HTMLLabelElement>, "ref"> & {
18
42
  showAsterisk?: boolean;
19
43
  error?: string;
@@ -292,6 +316,69 @@ declare const LocaleSelector: ({ locale, onChange, locales, }: {
292
316
  locales?: LocaleOption[];
293
317
  }) => react_jsx_runtime.JSX.Element;
294
318
 
319
+ type BusinessType = {
320
+ clientId?: string;
321
+ email?: string;
322
+ name?: string;
323
+ updatedAt?: string;
324
+ phoneNumber?: string;
325
+ logo?: string;
326
+ currencyCode?: string;
327
+ countryCode?: string;
328
+ currencyIcon?: string;
329
+ countryFlag?: string;
330
+ isKYCCompleted?: boolean;
331
+ parentClientId?: string;
332
+ supportedCountryCodes?: string[];
333
+ status?: string;
334
+ access?: string;
335
+ };
336
+
337
+ type SingleLinkType = {
338
+ to: string;
339
+ name: string;
340
+ isHidden?: boolean;
341
+ icon?: ReactNode;
342
+ badge?: ReactNode;
343
+ permission?: string;
344
+ key?: string;
345
+ id: string;
346
+ };
347
+ type BusinessProps = {
348
+ businessList: BusinessType[];
349
+ activeBusiness: BusinessType;
350
+ isBusinessDrawerActive: boolean;
351
+ toggleAddBusinessDrawer: () => void;
352
+ handleSetActiveBusiness: (clientId: string) => void;
353
+ };
354
+ type LinksType = {
355
+ children?: SingleLinkType[];
356
+ } & SingleLinkType;
357
+ type SidebarProps = {
358
+ isSidebarCollapsed: boolean;
359
+ collapseType: CollapseType;
360
+ links: LinksType[];
361
+ onToggleSideBar: (isOpen: boolean) => void;
362
+ isMobile: boolean;
363
+ businessProps: BusinessProps;
364
+ currentPath: string;
365
+ onNavigate: (path: string) => void;
366
+ appConfig?: IAppConfig & {
367
+ [key: string]: unknown;
368
+ };
369
+ onLogoutClick: () => void;
370
+ openSidebarIcon?: ReactNode;
371
+ closedSidebarIcon?: ReactNode;
372
+ nodeAfterSideBarLogo?: ReactNode;
373
+ };
374
+ interface IAppConfig {
375
+ appName: string;
376
+ hiddenRoutes?: string[];
377
+ }
378
+ type CollapseType = "icons" | "hidden";
379
+
380
+ declare const Sidebar: ({ isSidebarCollapsed, onToggleSideBar, isMobile, links, businessProps, currentPath, onNavigate, appConfig, collapseType: propCollapseType, onLogoutClick, openSidebarIcon, closedSidebarIcon, nodeAfterSideBarLogo, }: SidebarProps) => react_jsx_runtime.JSX.Element;
381
+
295
382
  type Variant = "success" | "failed" | "pending" | "abandoned";
296
383
  declare const Status: ({ status, variant, className, }: {
297
384
  status: string;
@@ -358,6 +445,39 @@ type PageDataToolbarProps = {
358
445
  };
359
446
  declare const PageDataToolbar: ({ onRefetch, search, FilterMenu, ExtraNode, onExport, download, isRefetching, }: PageDataToolbarProps) => react_jsx_runtime.JSX.Element;
360
447
 
448
+ type ResourcePermission = {
449
+ resource: string;
450
+ action: string;
451
+ };
452
+ type ResourcePermissions = ResourcePermission[];
453
+ type ResourcePermissionProps = {
454
+ permission?: {
455
+ resource?: string;
456
+ action?: string;
457
+ };
458
+ children: ReactNode;
459
+ };
460
+
461
+ declare const PermissionsContext: React$1.Context<ResourcePermissions | undefined>;
462
+ declare const PermissionsProvider: ({ permissions, children, }: {
463
+ permissions: ResourcePermissions;
464
+ children: ReactNode;
465
+ }) => react_jsx_runtime.JSX.Element;
466
+
467
+ declare const usePermissions: () => ResourcePermissions | undefined;
468
+ declare const useHasPermission: (permission: {
469
+ resource?: string;
470
+ action?: string;
471
+ }) => {
472
+ hasPermission: boolean;
473
+ validatePermission: (permission: {
474
+ resource?: string;
475
+ action?: string;
476
+ }) => boolean;
477
+ };
478
+
479
+ declare const HasResourcePermission: ({ permission, children, }: ResourcePermissionProps) => react_jsx_runtime.JSX.Element;
480
+
361
481
  declare const CurrencySymbolMap: Record<string, string>;
362
482
  interface FormatCurrencyOptions {
363
483
  convertToMajorCurrency?: boolean;
@@ -379,4 +499,4 @@ declare class DateAction {
379
499
 
380
500
  declare function cn(...inputs: ClassValue[]): string;
381
501
 
382
- export { AmountAction, Banner, Button, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, FlagComponent, FormLabel, type FormatCurrencyOptions, Input, Loader, LocaleSelector, OTPInput, PageDataToolbar, Pagination, PasswordInput, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, Select, Status, Table, type TablePaginationProps, Textarea, buttonVariants, cn };
502
+ export { AmountAction, Banner, Button, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, Select, Sidebar, Status, Table, type TablePaginationProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useHasPermission, usePermissions };