@6thbridge/hexa 0.0.57 → 0.0.59

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.
@@ -0,0 +1,32 @@
1
+
2
+  WARN  Issue while reading "/Users/joachim/.nvm/versions/node/v20.17.0/lib/node_modules/npmrc". EISDIR: illegal operation on a directory, read
3
+
4
+ > @6thbridge/hexa@0.0.11 build /Users/joachim/Documents/dev/payfusion/payfusion-component-library/packages/6thbridge-hexa
5
+ > tsup src/index.ts --format=esm,cjs --dts --clean --minify --sourcemap && pnpm run build:style
6
+
7
+ CLI Building entry: src/index.ts
8
+ CLI Using tsconfig: tsconfig.json
9
+ CLI tsup v8.3.5
10
+ CLI Target: es2020
11
+ CLI Cleaning output folder
12
+ ESM Build start
13
+ CJS Build start
14
+ CJS dist/index.js 42.23 KB
15
+ CJS dist/index.js.map 117.76 KB
16
+ CJS ⚡️ Build success in 36ms
17
+ ESM dist/index.mjs 40.07 KB
18
+ ESM dist/index.mjs.map 117.97 KB
19
+ ESM ⚡️ Build success in 36ms
20
+ DTS Build start
21
+ DTS ⚡️ Build success in 2886ms
22
+ DTS dist/index.d.mts 10.41 KB
23
+ DTS dist/index.d.ts 10.41 KB
24
+  WARN  Issue while reading "/Users/joachim/.nvm/versions/node/v20.17.0/lib/node_modules/npmrc". EISDIR: illegal operation on a directory, read
25
+
26
+ > @6thbridge/hexa@0.0.11 build:style /Users/joachim/Documents/dev/payfusion/payfusion-component-library/packages/6thbridge-hexa
27
+ > tailwindcss -i ./src/styles/input.css -o ./dist/output.css
28
+
29
+ 
30
+ Rebuilding...
31
+ 
32
+ Done in 191ms.
@@ -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.57 lint /Users/joachim/Documents/dev/payfusion/ev-payfusion-component-library/packages/6thbridge-hexa
3
+ > @6thbridge/hexa@0.0.59 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
@@ -12,6 +12,7 @@ import { OTPInputProps as OTPInputProps$1 } from 'react-otp-input';
12
12
  import * as PopoverPrimitive from '@radix-ui/react-popover';
13
13
  import { Drawer as Drawer$1 } from 'vaul';
14
14
  import { RowData, Row, Table as Table$1 } from '@tanstack/react-table';
15
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
15
16
  import dayjs from 'dayjs';
16
17
  import { ClassValue } from 'clsx';
17
18
 
@@ -296,6 +297,7 @@ type DrawerPropsType = {
296
297
  footer?: React$1.ReactNode;
297
298
  hideCloseButton?: boolean;
298
299
  contentClassName?: string;
300
+ drawerContentClassName?: string;
299
301
  headerClassName?: string;
300
302
  titleClassName?: string;
301
303
  descriptionClassName?: string;
@@ -304,7 +306,7 @@ type DrawerPropsType = {
304
306
  onOpenAutoFocus?: (e: Event) => void;
305
307
  onCloseAutoFocus?: (e: Event) => void;
306
308
  };
307
- declare const Drawer: ({ trigger, children, open, onOpenChange, hideCloseButton, footer, title, description, contentClassName, headerClassName, titleClassName, descriptionClassName, footerClassName, asChild, onOpenAutoFocus, onCloseAutoFocus, }: Omit<DrawerRootType, "value"> & DrawerPropsType) => react_jsx_runtime.JSX.Element;
309
+ declare const Drawer: ({ trigger, children, open, onOpenChange, hideCloseButton, footer, title, description, contentClassName, headerClassName, titleClassName, descriptionClassName, footerClassName, asChild, onOpenAutoFocus, drawerContentClassName, onCloseAutoFocus, }: Omit<DrawerRootType, "value"> & DrawerPropsType) => react_jsx_runtime.JSX.Element;
308
310
 
309
311
  type LocaleOption = {
310
312
  key: string;
@@ -402,6 +404,35 @@ type PaginationProps = {
402
404
  */
403
405
  declare const Pagination: ({ currentPage, totalPages, onPageChange, itemsPerPage, totalItems, }: PaginationProps) => react_jsx_runtime.JSX.Element;
404
406
 
407
+ type SelectOption = {
408
+ value: string;
409
+ label: string;
410
+ };
411
+ type Base = {
412
+ type: "input" | "drop-down" | "date-range" | "multi" | "date" | "radio";
413
+ key: string;
414
+ label: string;
415
+ placeholder?: string;
416
+ };
417
+ type FilterListOption = {
418
+ type: "input";
419
+ } & Exclude<InputProps, "value" | "onChange">;
420
+ type FilterListDate = {
421
+ type: "date";
422
+ date?: string | Date;
423
+ };
424
+ type FilterListInputDropDown = {
425
+ type: "drop-down" | "multi" | "radio";
426
+ options: SelectOption[];
427
+ };
428
+ type FilterListItem = Base & (FilterListOption | FilterListInputDropDown | FilterListDate);
429
+ type FilterContentProps = {
430
+ filters: FilterListItem[];
431
+ values?: Record<string, any>;
432
+ setAppliedFilters?: (values: Record<string, any>) => void;
433
+ };
434
+ type FilterListOptions = FilterListItem[];
435
+
405
436
  type TableSearchProps = {
406
437
  enabled: boolean;
407
438
  debounceRate?: number;
@@ -418,7 +449,18 @@ type TablePaginationProps = {
418
449
  } & PaginationProps;
419
450
  type TableProps<T extends RowData> = {
420
451
  ExtraNode?: ReactNode;
452
+ /**
453
+ * @deprecated Use the `filterListOptions` prop instead.
454
+ *
455
+ * The `FilterMenu` prop is deprecated in favor of `filterListOptions`, which provides a more flexible and structured way to define filter options for the table.
456
+ *
457
+ * To manage the state of applied filters, use the `setAppliedFilters` callback. This function can be used to collect and update the current filter state based on user interactions with the filter list options.
458
+ *
459
+ * The `filterListOptions` prop accepts an array of filter configuration objects, allowing you to define available filters, their types, and possible values. This approach enables dynamic filter rendering and better state management compared to the static `FilterMenu` node.
460
+ */
421
461
  FilterMenu?: ReactNode;
462
+ setAppliedFilters?: () => void;
463
+ filterListOptions?: FilterListItem[];
422
464
  buttonClassName?: string;
423
465
  download?: TableDownloadProps;
424
466
  id?: string;
@@ -432,7 +474,7 @@ type TableProps<T extends RowData> = {
432
474
  search?: TableSearchProps;
433
475
  table: Table$1<T>;
434
476
  };
435
- declare const Table: <T extends RowData>({ table, isMobile, onRowClick, id, onRefetch, isRefetching, FilterMenu, ExtraNode, onExport, search, download, isLoading, pagination, }: TableProps<T>) => react_jsx_runtime.JSX.Element;
477
+ declare const Table: <T extends RowData>({ table, isMobile, onRowClick, id, onRefetch, isRefetching, FilterMenu, ExtraNode, onExport, search, download, isLoading, pagination, filterListOptions, setAppliedFilters, }: TableProps<T>) => react_jsx_runtime.JSX.Element;
436
478
 
437
479
  type PageDataToolbarProps = {
438
480
  onRefetch?: () => void;
@@ -442,8 +484,10 @@ type PageDataToolbarProps = {
442
484
  onExport?: () => void;
443
485
  download?: TableDownloadProps;
444
486
  isRefetching?: boolean;
487
+ setAppliedFilters?: () => void;
488
+ filterListOptions?: FilterListItem[];
445
489
  };
446
- declare const PageDataToolbar: ({ onRefetch, search, FilterMenu, ExtraNode, onExport, download, isRefetching, }: PageDataToolbarProps) => react_jsx_runtime.JSX.Element;
490
+ declare const PageDataToolbar: ({ onRefetch, search, FilterMenu, ExtraNode, onExport, download, isRefetching, filterListOptions, setAppliedFilters, }: PageDataToolbarProps) => react_jsx_runtime.JSX.Element;
447
491
 
448
492
  type ResourcePermission = {
449
493
  resource: string;
@@ -478,6 +522,29 @@ declare const useHasPermission: (permission: {
478
522
 
479
523
  declare const HasResourcePermission: ({ permission, children, }: ResourcePermissionProps) => react_jsx_runtime.JSX.Element;
480
524
 
525
+ type FilterPopoverProps = FilterContentProps & {
526
+ isOpen?: boolean;
527
+ trigger?: ReactNode;
528
+ };
529
+ declare const FilterPopover: ({ filters, setAppliedFilters, isOpen, }: FilterPopoverProps) => react_jsx_runtime.JSX.Element | null;
530
+
531
+ type CalendarInputProps = {
532
+ label?: string;
533
+ helpText?: string | React$1.ReactNode;
534
+ error?: string;
535
+ optional?: boolean;
536
+ onChange: (value: string | null) => void;
537
+ value?: string;
538
+ };
539
+ declare const CalendarInput: ({ label, optional, onChange, error, helpText, value, }: CalendarInputProps) => react_jsx_runtime.JSX.Element;
540
+
541
+ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
542
+ className?: string;
543
+ } & React$1.RefAttributes<HTMLDivElement>>;
544
+ declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & {
545
+ className?: string;
546
+ } & React$1.RefAttributes<HTMLButtonElement>>;
547
+
481
548
  declare const CurrencySymbolMap: Record<string, string>;
482
549
  interface FormatCurrencyOptions {
483
550
  convertToMajorCurrency?: boolean;
@@ -499,4 +566,4 @@ declare class DateAction {
499
566
 
500
567
  declare function cn(...inputs: ClassValue[]): string;
501
568
 
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 };
569
+ export { AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, 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
@@ -12,6 +12,7 @@ import { OTPInputProps as OTPInputProps$1 } from 'react-otp-input';
12
12
  import * as PopoverPrimitive from '@radix-ui/react-popover';
13
13
  import { Drawer as Drawer$1 } from 'vaul';
14
14
  import { RowData, Row, Table as Table$1 } from '@tanstack/react-table';
15
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
15
16
  import dayjs from 'dayjs';
16
17
  import { ClassValue } from 'clsx';
17
18
 
@@ -296,6 +297,7 @@ type DrawerPropsType = {
296
297
  footer?: React$1.ReactNode;
297
298
  hideCloseButton?: boolean;
298
299
  contentClassName?: string;
300
+ drawerContentClassName?: string;
299
301
  headerClassName?: string;
300
302
  titleClassName?: string;
301
303
  descriptionClassName?: string;
@@ -304,7 +306,7 @@ type DrawerPropsType = {
304
306
  onOpenAutoFocus?: (e: Event) => void;
305
307
  onCloseAutoFocus?: (e: Event) => void;
306
308
  };
307
- declare const Drawer: ({ trigger, children, open, onOpenChange, hideCloseButton, footer, title, description, contentClassName, headerClassName, titleClassName, descriptionClassName, footerClassName, asChild, onOpenAutoFocus, onCloseAutoFocus, }: Omit<DrawerRootType, "value"> & DrawerPropsType) => react_jsx_runtime.JSX.Element;
309
+ declare const Drawer: ({ trigger, children, open, onOpenChange, hideCloseButton, footer, title, description, contentClassName, headerClassName, titleClassName, descriptionClassName, footerClassName, asChild, onOpenAutoFocus, drawerContentClassName, onCloseAutoFocus, }: Omit<DrawerRootType, "value"> & DrawerPropsType) => react_jsx_runtime.JSX.Element;
308
310
 
309
311
  type LocaleOption = {
310
312
  key: string;
@@ -402,6 +404,35 @@ type PaginationProps = {
402
404
  */
403
405
  declare const Pagination: ({ currentPage, totalPages, onPageChange, itemsPerPage, totalItems, }: PaginationProps) => react_jsx_runtime.JSX.Element;
404
406
 
407
+ type SelectOption = {
408
+ value: string;
409
+ label: string;
410
+ };
411
+ type Base = {
412
+ type: "input" | "drop-down" | "date-range" | "multi" | "date" | "radio";
413
+ key: string;
414
+ label: string;
415
+ placeholder?: string;
416
+ };
417
+ type FilterListOption = {
418
+ type: "input";
419
+ } & Exclude<InputProps, "value" | "onChange">;
420
+ type FilterListDate = {
421
+ type: "date";
422
+ date?: string | Date;
423
+ };
424
+ type FilterListInputDropDown = {
425
+ type: "drop-down" | "multi" | "radio";
426
+ options: SelectOption[];
427
+ };
428
+ type FilterListItem = Base & (FilterListOption | FilterListInputDropDown | FilterListDate);
429
+ type FilterContentProps = {
430
+ filters: FilterListItem[];
431
+ values?: Record<string, any>;
432
+ setAppliedFilters?: (values: Record<string, any>) => void;
433
+ };
434
+ type FilterListOptions = FilterListItem[];
435
+
405
436
  type TableSearchProps = {
406
437
  enabled: boolean;
407
438
  debounceRate?: number;
@@ -418,7 +449,18 @@ type TablePaginationProps = {
418
449
  } & PaginationProps;
419
450
  type TableProps<T extends RowData> = {
420
451
  ExtraNode?: ReactNode;
452
+ /**
453
+ * @deprecated Use the `filterListOptions` prop instead.
454
+ *
455
+ * The `FilterMenu` prop is deprecated in favor of `filterListOptions`, which provides a more flexible and structured way to define filter options for the table.
456
+ *
457
+ * To manage the state of applied filters, use the `setAppliedFilters` callback. This function can be used to collect and update the current filter state based on user interactions with the filter list options.
458
+ *
459
+ * The `filterListOptions` prop accepts an array of filter configuration objects, allowing you to define available filters, their types, and possible values. This approach enables dynamic filter rendering and better state management compared to the static `FilterMenu` node.
460
+ */
421
461
  FilterMenu?: ReactNode;
462
+ setAppliedFilters?: () => void;
463
+ filterListOptions?: FilterListItem[];
422
464
  buttonClassName?: string;
423
465
  download?: TableDownloadProps;
424
466
  id?: string;
@@ -432,7 +474,7 @@ type TableProps<T extends RowData> = {
432
474
  search?: TableSearchProps;
433
475
  table: Table$1<T>;
434
476
  };
435
- declare const Table: <T extends RowData>({ table, isMobile, onRowClick, id, onRefetch, isRefetching, FilterMenu, ExtraNode, onExport, search, download, isLoading, pagination, }: TableProps<T>) => react_jsx_runtime.JSX.Element;
477
+ declare const Table: <T extends RowData>({ table, isMobile, onRowClick, id, onRefetch, isRefetching, FilterMenu, ExtraNode, onExport, search, download, isLoading, pagination, filterListOptions, setAppliedFilters, }: TableProps<T>) => react_jsx_runtime.JSX.Element;
436
478
 
437
479
  type PageDataToolbarProps = {
438
480
  onRefetch?: () => void;
@@ -442,8 +484,10 @@ type PageDataToolbarProps = {
442
484
  onExport?: () => void;
443
485
  download?: TableDownloadProps;
444
486
  isRefetching?: boolean;
487
+ setAppliedFilters?: () => void;
488
+ filterListOptions?: FilterListItem[];
445
489
  };
446
- declare const PageDataToolbar: ({ onRefetch, search, FilterMenu, ExtraNode, onExport, download, isRefetching, }: PageDataToolbarProps) => react_jsx_runtime.JSX.Element;
490
+ declare const PageDataToolbar: ({ onRefetch, search, FilterMenu, ExtraNode, onExport, download, isRefetching, filterListOptions, setAppliedFilters, }: PageDataToolbarProps) => react_jsx_runtime.JSX.Element;
447
491
 
448
492
  type ResourcePermission = {
449
493
  resource: string;
@@ -478,6 +522,29 @@ declare const useHasPermission: (permission: {
478
522
 
479
523
  declare const HasResourcePermission: ({ permission, children, }: ResourcePermissionProps) => react_jsx_runtime.JSX.Element;
480
524
 
525
+ type FilterPopoverProps = FilterContentProps & {
526
+ isOpen?: boolean;
527
+ trigger?: ReactNode;
528
+ };
529
+ declare const FilterPopover: ({ filters, setAppliedFilters, isOpen, }: FilterPopoverProps) => react_jsx_runtime.JSX.Element | null;
530
+
531
+ type CalendarInputProps = {
532
+ label?: string;
533
+ helpText?: string | React$1.ReactNode;
534
+ error?: string;
535
+ optional?: boolean;
536
+ onChange: (value: string | null) => void;
537
+ value?: string;
538
+ };
539
+ declare const CalendarInput: ({ label, optional, onChange, error, helpText, value, }: CalendarInputProps) => react_jsx_runtime.JSX.Element;
540
+
541
+ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
542
+ className?: string;
543
+ } & React$1.RefAttributes<HTMLDivElement>>;
544
+ declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & {
545
+ className?: string;
546
+ } & React$1.RefAttributes<HTMLButtonElement>>;
547
+
481
548
  declare const CurrencySymbolMap: Record<string, string>;
482
549
  interface FormatCurrencyOptions {
483
550
  convertToMajorCurrency?: boolean;
@@ -499,4 +566,4 @@ declare class DateAction {
499
566
 
500
567
  declare function cn(...inputs: ClassValue[]): string;
501
568
 
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 };
569
+ export { AmountAction, Banner, Button, CalendarInput, CopyableLabel, Country, CurrencySymbolMap, DateAction, DebouncedInput, DevBanner, Dialog, Drawer, DrawerClose, type DrawerPropsType, DrawerRoot, type FilterListItem, type FilterListOptions, FilterPopover, FlagComponent, FormLabel, type FormatCurrencyOptions, HasResourcePermission, Input, Loader, LocaleSelector, OTPInput, PageDataToolbar, Pagination, PasswordInput, PermissionsContext, PermissionsProvider, PhoneInput, Popover, PopoverContent, PopoverRoot, PopoverTrigger, RadioGroup, RadioGroupItem, type ResourcePermission, type ResourcePermissionProps, type ResourcePermissions, Select, Sidebar, Status, Table, type TablePaginationProps, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, buttonVariants, cn, useHasPermission, usePermissions };