@6thbridge/hexa 0.0.0-pr88-188 → 0.0.0-pr89-187

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,9 +458,11 @@ type ResourcePermission = {
458
458
  action: string;
459
459
  };
460
460
  type ResourcePermissions = ResourcePermission[];
461
- type ResourcePermissionInput = ResourcePermission | ResourcePermission[];
462
461
  type ResourcePermissionProps = {
463
- permission?: ResourcePermissionInput;
462
+ permission?: {
463
+ resource?: string;
464
+ action?: string;
465
+ };
464
466
  children: ReactNode;
465
467
  };
466
468
 
@@ -470,7 +472,7 @@ type SingleLinkType = {
470
472
  isHidden?: boolean;
471
473
  icon?: ReactNode;
472
474
  badge?: ReactNode;
473
- permission?: ResourcePermissionInput;
475
+ permission?: ResourcePermissionProps["permission"];
474
476
  key?: string;
475
477
  id: string;
476
478
  };
@@ -701,9 +703,15 @@ declare const PermissionsProvider: ({ permissions, children, }: {
701
703
  }) => React$1.JSX.Element;
702
704
 
703
705
  declare const usePermissions: () => ResourcePermissions | undefined;
704
- declare const useHasPermission: (permission?: ResourcePermissionInput) => {
706
+ declare const useHasPermission: (permission: {
707
+ resource?: string;
708
+ action?: string;
709
+ }) => {
705
710
  hasPermission: boolean;
706
- validatePermission: (permissionToCheck?: ResourcePermissionInput) => boolean;
711
+ validatePermission: (permission: {
712
+ resource?: string;
713
+ action?: string;
714
+ }) => boolean;
707
715
  };
708
716
 
709
717
  declare const HasResourcePermission: ({ permission, children, }: ResourcePermissionProps) => React$1.JSX.Element;
@@ -976,4 +984,4 @@ declare const TagsInput: ({ value, onChange, options, label, error, placeholder,
976
984
 
977
985
  declare function cn(...inputs: ClassValue[]): string;
978
986
 
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 };
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 };
package/dist/index.d.ts CHANGED
@@ -458,9 +458,11 @@ type ResourcePermission = {
458
458
  action: string;
459
459
  };
460
460
  type ResourcePermissions = ResourcePermission[];
461
- type ResourcePermissionInput = ResourcePermission | ResourcePermission[];
462
461
  type ResourcePermissionProps = {
463
- permission?: ResourcePermissionInput;
462
+ permission?: {
463
+ resource?: string;
464
+ action?: string;
465
+ };
464
466
  children: ReactNode;
465
467
  };
466
468
 
@@ -470,7 +472,7 @@ type SingleLinkType = {
470
472
  isHidden?: boolean;
471
473
  icon?: ReactNode;
472
474
  badge?: ReactNode;
473
- permission?: ResourcePermissionInput;
475
+ permission?: ResourcePermissionProps["permission"];
474
476
  key?: string;
475
477
  id: string;
476
478
  };
@@ -701,9 +703,15 @@ declare const PermissionsProvider: ({ permissions, children, }: {
701
703
  }) => React$1.JSX.Element;
702
704
 
703
705
  declare const usePermissions: () => ResourcePermissions | undefined;
704
- declare const useHasPermission: (permission?: ResourcePermissionInput) => {
706
+ declare const useHasPermission: (permission: {
707
+ resource?: string;
708
+ action?: string;
709
+ }) => {
705
710
  hasPermission: boolean;
706
- validatePermission: (permissionToCheck?: ResourcePermissionInput) => boolean;
711
+ validatePermission: (permission: {
712
+ resource?: string;
713
+ action?: string;
714
+ }) => boolean;
707
715
  };
708
716
 
709
717
  declare const HasResourcePermission: ({ permission, children, }: ResourcePermissionProps) => React$1.JSX.Element;
@@ -976,4 +984,4 @@ declare const TagsInput: ({ value, onChange, options, label, error, placeholder,
976
984
 
977
985
  declare function cn(...inputs: ClassValue[]): string;
978
986
 
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 };
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 };