@6thbridge/hexa 0.0.104 → 0.0.105

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/index.d.mts CHANGED
@@ -458,11 +458,9 @@ type ResourcePermission = {
458
458
  action: string;
459
459
  };
460
460
  type ResourcePermissions = ResourcePermission[];
461
+ type ResourcePermissionInput = ResourcePermission | ResourcePermission[];
461
462
  type ResourcePermissionProps = {
462
- permission?: {
463
- resource?: string;
464
- action?: string;
465
- };
463
+ permission?: ResourcePermissionInput;
466
464
  children: ReactNode;
467
465
  };
468
466
 
@@ -472,7 +470,7 @@ type SingleLinkType = {
472
470
  isHidden?: boolean;
473
471
  icon?: ReactNode;
474
472
  badge?: ReactNode;
475
- permission?: ResourcePermissionProps["permission"];
473
+ permission?: ResourcePermissionInput;
476
474
  key?: string;
477
475
  id: string;
478
476
  };
@@ -703,15 +701,9 @@ declare const PermissionsProvider: ({ permissions, children, }: {
703
701
  }) => React$1.JSX.Element;
704
702
 
705
703
  declare const usePermissions: () => ResourcePermissions | undefined;
706
- declare const useHasPermission: (permission: {
707
- resource?: string;
708
- action?: string;
709
- }) => {
704
+ declare const useHasPermission: (permission?: ResourcePermissionInput) => {
710
705
  hasPermission: boolean;
711
- validatePermission: (permission: {
712
- resource?: string;
713
- action?: string;
714
- }) => boolean;
706
+ validatePermission: (permissionToCheck?: ResourcePermissionInput) => boolean;
715
707
  };
716
708
 
717
709
  declare const HasResourcePermission: ({ permission, children, }: ResourcePermissionProps) => React$1.JSX.Element;
@@ -984,4 +976,4 @@ declare const TagsInput: ({ value, onChange, options, label, error, placeholder,
984
976
 
985
977
  declare function cn(...inputs: ClassValue[]): string;
986
978
 
987
- export { Accordion, type AccordionItemType, type AccordionProps, AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, type CountryProps, type CountrySelectOption$1 as CountrySelectOption, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, FeatureBanner, type FilterFieldProps, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, MultiSelect, type MultiSelectDataType, MultiSelectTrigger, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, RichTextEditor, ScrollArea, Select, Sidebar, SplitButton, type SplitButtonItem, type SplitButtonProps, Status, StringAction, Table, type TableBulkRowActionsProps, type TablePaginationProps, Tabs, type TagOption, TagsInput, type TagsInputProps, TextOverflow, type TextOverflowProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useFilterStore, useHasPermission, usePermissions };
979
+ export { Accordion, type AccordionItemType, type AccordionProps, AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, type CountryProps, type CountrySelectOption$1 as CountrySelectOption, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, FeatureBanner, type FilterFieldProps, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, MultiSelect, type MultiSelectDataType, MultiSelectTrigger, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionInput, type ResourcePermissionProps, type ResourcePermissions, RichTextEditor, ScrollArea, Select, Sidebar, SplitButton, type SplitButtonItem, type SplitButtonProps, Status, StringAction, Table, type TableBulkRowActionsProps, type TablePaginationProps, Tabs, type TagOption, TagsInput, type TagsInputProps, TextOverflow, type TextOverflowProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useFilterStore, useHasPermission, usePermissions };
package/dist/index.d.ts CHANGED
@@ -458,11 +458,9 @@ type ResourcePermission = {
458
458
  action: string;
459
459
  };
460
460
  type ResourcePermissions = ResourcePermission[];
461
+ type ResourcePermissionInput = ResourcePermission | ResourcePermission[];
461
462
  type ResourcePermissionProps = {
462
- permission?: {
463
- resource?: string;
464
- action?: string;
465
- };
463
+ permission?: ResourcePermissionInput;
466
464
  children: ReactNode;
467
465
  };
468
466
 
@@ -472,7 +470,7 @@ type SingleLinkType = {
472
470
  isHidden?: boolean;
473
471
  icon?: ReactNode;
474
472
  badge?: ReactNode;
475
- permission?: ResourcePermissionProps["permission"];
473
+ permission?: ResourcePermissionInput;
476
474
  key?: string;
477
475
  id: string;
478
476
  };
@@ -703,15 +701,9 @@ declare const PermissionsProvider: ({ permissions, children, }: {
703
701
  }) => React$1.JSX.Element;
704
702
 
705
703
  declare const usePermissions: () => ResourcePermissions | undefined;
706
- declare const useHasPermission: (permission: {
707
- resource?: string;
708
- action?: string;
709
- }) => {
704
+ declare const useHasPermission: (permission?: ResourcePermissionInput) => {
710
705
  hasPermission: boolean;
711
- validatePermission: (permission: {
712
- resource?: string;
713
- action?: string;
714
- }) => boolean;
706
+ validatePermission: (permissionToCheck?: ResourcePermissionInput) => boolean;
715
707
  };
716
708
 
717
709
  declare const HasResourcePermission: ({ permission, children, }: ResourcePermissionProps) => React$1.JSX.Element;
@@ -984,4 +976,4 @@ declare const TagsInput: ({ value, onChange, options, label, error, placeholder,
984
976
 
985
977
  declare function cn(...inputs: ClassValue[]): string;
986
978
 
987
- export { Accordion, type AccordionItemType, type AccordionProps, AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, type CountryProps, type CountrySelectOption$1 as CountrySelectOption, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, FeatureBanner, type FilterFieldProps, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, MultiSelect, type MultiSelectDataType, MultiSelectTrigger, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, RichTextEditor, ScrollArea, Select, Sidebar, SplitButton, type SplitButtonItem, type SplitButtonProps, Status, StringAction, Table, type TableBulkRowActionsProps, type TablePaginationProps, Tabs, type TagOption, TagsInput, type TagsInputProps, TextOverflow, type TextOverflowProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useFilterStore, useHasPermission, usePermissions };
979
+ export { Accordion, type AccordionItemType, type AccordionProps, AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, type CountryProps, type CountrySelectOption$1 as CountrySelectOption, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, FeatureBanner, type FilterFieldProps, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, MultiSelect, type MultiSelectDataType, MultiSelectTrigger, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionInput, type ResourcePermissionProps, type ResourcePermissions, RichTextEditor, ScrollArea, Select, Sidebar, SplitButton, type SplitButtonItem, type SplitButtonProps, Status, StringAction, Table, type TableBulkRowActionsProps, type TablePaginationProps, Tabs, type TagOption, TagsInput, type TagsInputProps, TextOverflow, type TextOverflowProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useFilterStore, useHasPermission, usePermissions };