@paolojulian.dev/design-system 4.5.1 → 4.6.3

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.ts CHANGED
@@ -1,15 +1,20 @@
1
1
  import { AnchorHTMLAttributes } from 'react';
2
2
  import { ButtonHTMLAttributes } from 'react';
3
+ import { ChangeEvent } from 'react';
3
4
  import { ClassProp } from 'class-variance-authority/types';
4
5
  import { CSSProperties } from 'react';
5
6
  import { ElementType } from 'react';
6
7
  import { FC } from 'react';
8
+ import { ForwardedRef } from 'react';
7
9
  import { ForwardRefExoticComponent } from 'react';
8
10
  import { HTMLAttributes } from 'react';
9
11
  import { InputHTMLAttributes } from 'react';
10
12
  import { JSX } from 'react/jsx-runtime';
13
+ import { KeyboardEvent as KeyboardEvent_2 } from 'react';
14
+ import { MouseEvent as MouseEvent_2 } from 'react';
11
15
  import { ReactNode } from 'react';
12
16
  import { RefAttributes } from 'react';
17
+ import { SelectHTMLAttributes } from 'react';
13
18
  import { TextareaHTMLAttributes } from 'react';
14
19
  import { VariantProps } from 'class-variance-authority';
15
20
 
@@ -18,6 +23,7 @@ as?: ElementType;
18
23
  variant?: PBadgeVariant;
19
24
  size?: PBadgeSize;
20
25
  appearance?: PBadgeAppearance;
26
+ isPinging?: boolean;
21
27
  leftIcon?: ReactNode;
22
28
  rightIcon?: ReactNode;
23
29
  children: ReactNode;
@@ -31,6 +37,7 @@ export declare type PBadgeProps = {
31
37
  variant?: PBadgeVariant;
32
38
  size?: PBadgeSize;
33
39
  appearance?: PBadgeAppearance;
40
+ isPinging?: boolean;
34
41
  leftIcon?: ReactNode;
35
42
  rightIcon?: ReactNode;
36
43
  children: ReactNode;
@@ -61,6 +68,7 @@ declare type PButtonBaseProps = {
61
68
  fullWidth?: boolean;
62
69
  isActive?: boolean;
63
70
  isLoading?: boolean;
71
+ isPinging?: boolean;
64
72
  leftIcon?: ReactNode;
65
73
  rightIcon?: ReactNode;
66
74
  children: ReactNode;
@@ -105,6 +113,38 @@ declare type PCardBaseProps = {
105
113
 
106
114
  declare type PCardDensity = 'compact' | 'default' | 'spacious';
107
115
 
116
+ export declare const PCardGrid: ForwardRefExoticComponent< {
117
+ as?: ElementType;
118
+ columns?: PCardGridColumns | PCardGridResponsiveColumns;
119
+ minCardWidth?: CSSProperties["width"];
120
+ gap?: PCardGridGap;
121
+ align?: "stretch" | "start";
122
+ className?: string;
123
+ children: ReactNode;
124
+ } & Omit<HTMLAttributes<HTMLElement>, "children" | "className"> & RefAttributes<HTMLElement>>;
125
+
126
+ export declare type PCardGridColumns = 1 | 2 | 3 | 4;
127
+
128
+ export declare type PCardGridGap = 'none' | 'sm' | 'md' | 'lg';
129
+
130
+ export declare type PCardGridProps = {
131
+ as?: ElementType;
132
+ columns?: PCardGridColumns | PCardGridResponsiveColumns;
133
+ minCardWidth?: CSSProperties['width'];
134
+ gap?: PCardGridGap;
135
+ align?: 'stretch' | 'start';
136
+ className?: string;
137
+ children: ReactNode;
138
+ } & Omit<HTMLAttributes<HTMLElement>, 'className' | 'children'>;
139
+
140
+ export declare type PCardGridRef = HTMLElement;
141
+
142
+ export declare type PCardGridResponsiveColumns = {
143
+ mobile?: PCardGridColumns;
144
+ tablet?: PCardGridColumns;
145
+ desktop?: PCardGridColumns;
146
+ };
147
+
108
148
  export declare type PCardProps = PCardArticleProps | PCardAnchorProps;
109
149
 
110
150
  export declare type PCardRef = HTMLElement;
@@ -488,11 +528,182 @@ export declare type PHorizontalSliderProps = {
488
528
 
489
529
  export declare type PHorizontalSliderRef = HTMLDivElement;
490
530
 
491
- declare interface Props {
531
+ export declare const PPagination: ForwardRefExoticComponent< {
532
+ page: number;
533
+ pageCount?: number;
534
+ totalItems?: number;
535
+ pageSize?: number;
536
+ pageSizeOptions?: number[];
537
+ itemLabel?: string;
538
+ density?: PPaginationDensity;
539
+ siblingCount?: number;
540
+ boundaryCount?: number;
541
+ disabled?: boolean;
542
+ isLoading?: boolean;
543
+ hasPreviousPage?: boolean;
544
+ hasNextPage?: boolean;
545
+ showRowsPerPage?: boolean;
546
+ onPageChange?: (page: number) => void;
547
+ onPageSizeChange?: (pageSize: number) => void;
548
+ className?: string;
549
+ summary?: ReactNode;
550
+ } & Omit<HTMLAttributes<HTMLElement>, "children" | "className" | "onChange"> & RefAttributes<HTMLElement>>;
551
+
552
+ export declare type PPaginationDensity = 'standard' | 'compact';
553
+
554
+ export declare type PPaginationItem = number | 'ellipsis';
555
+
556
+ export declare type PPaginationProps = {
557
+ page: number;
558
+ pageCount?: number;
559
+ totalItems?: number;
560
+ pageSize?: number;
561
+ pageSizeOptions?: number[];
562
+ itemLabel?: string;
563
+ density?: PPaginationDensity;
564
+ siblingCount?: number;
565
+ boundaryCount?: number;
566
+ disabled?: boolean;
567
+ isLoading?: boolean;
568
+ hasPreviousPage?: boolean;
569
+ hasNextPage?: boolean;
570
+ showRowsPerPage?: boolean;
571
+ onPageChange?: (page: number) => void;
572
+ onPageSizeChange?: (pageSize: number) => void;
573
+ className?: string;
574
+ summary?: ReactNode;
575
+ } & Omit<HTMLAttributes<HTMLElement>, 'children' | 'className' | 'onChange'>;
576
+
577
+ export declare type PPaginationRef = HTMLElement;
578
+
579
+ export declare function PSectionHeader({ title, index, variant, className, }: PSectionHeaderProps): JSX.Element;
580
+
581
+ export declare interface PSectionHeaderProps {
492
582
  title: string;
583
+ index?: string | number;
584
+ variant?: PSectionHeaderVariant;
585
+ className?: string;
493
586
  }
494
587
 
495
- export declare function PSectionHeader({ title }: Props): JSX.Element;
588
+ export declare type PSectionHeaderVariant = "default" | "indexed";
589
+
590
+ export declare const PSelect: ForwardRefExoticComponent< {
591
+ className?: string;
592
+ selectClassName?: string;
593
+ label: string;
594
+ options: PSelectOption[];
595
+ placeholder?: string;
596
+ helperText?: string;
597
+ isError?: boolean;
598
+ errorMessage?: string;
599
+ density?: PSelectDensity;
600
+ variant?: PSelectVariant;
601
+ hideLabel?: boolean;
602
+ onValueChange?: (value: string, option: PSelectOption | null) => void;
603
+ } & Omit<SelectHTMLAttributes<HTMLSelectElement>, "children" | "className" | "aria-describedby" | "aria-label" | "onChange"> & {
604
+ onChange?: (event: ChangeEvent<HTMLSelectElement>) => void;
605
+ } & RefAttributes<HTMLSelectElement>>;
606
+
607
+ export declare type PSelectDensity = 'standard' | 'compact';
608
+
609
+ export declare type PSelectOption = {
610
+ value: string | number;
611
+ label: ReactNode;
612
+ disabled?: boolean;
613
+ group?: string;
614
+ };
615
+
616
+ export declare type PSelectProps = {
617
+ className?: string;
618
+ selectClassName?: string;
619
+ label: string;
620
+ options: PSelectOption[];
621
+ placeholder?: string;
622
+ helperText?: string;
623
+ isError?: boolean;
624
+ errorMessage?: string;
625
+ density?: PSelectDensity;
626
+ variant?: PSelectVariant;
627
+ hideLabel?: boolean;
628
+ onValueChange?: (value: string, option: PSelectOption | null) => void;
629
+ } & Omit<SelectHTMLAttributes<HTMLSelectElement>, 'aria-describedby' | 'aria-label' | 'children' | 'className' | 'onChange'> & {
630
+ onChange?: (event: ChangeEvent<HTMLSelectElement>) => void;
631
+ };
632
+
633
+ export declare type PSelectRef = HTMLSelectElement;
634
+
635
+ export declare type PSelectVariant = 'floating' | 'inline';
636
+
637
+ export declare const PTable: PTableComponentType;
638
+
639
+ export declare type PTableAlign = 'start' | 'center' | 'end';
640
+
641
+ export declare type PTableColumn<RowData extends PTableRecord = PTableRecord> = {
642
+ id: string;
643
+ header: ReactNode;
644
+ label?: string;
645
+ accessor?: keyof RowData | ((row: RowData) => ReactNode);
646
+ cell?: (row: RowData, rowIndex: number) => ReactNode;
647
+ mobileLabel?: string;
648
+ width?: string;
649
+ align?: PTableAlign;
650
+ priority?: PTableColumnPriority;
651
+ hideOnTablet?: boolean;
652
+ hideOnMobile?: boolean;
653
+ sortable?: boolean;
654
+ sortDirection?: PTableSortDirection | null;
655
+ };
656
+
657
+ export declare type PTableColumnPriority = 'primary' | 'secondary' | 'tertiary';
658
+
659
+ declare function PTableComponent<RowData extends PTableRecord>({ columns, rows, caption, captionHidden, summary, density, stickyHeader, stickyFirstColumn, isLoading, loadingLabel, emptyState, errorState, getRowId, getRowTone, onRowClick, renderRowActions, onSortChange, className, tableClassName, ...props }: PTableProps<RowData>, ref: ForwardedRef<PTableRef>): JSX.Element;
660
+
661
+ declare type PTableComponentType = (<RowData extends PTableRecord = PTableRecord>(props: PTableProps<RowData> & {
662
+ ref?: ForwardedRef<PTableRef>;
663
+ }) => ReturnType<typeof PTableComponent>) & {
664
+ displayName?: string;
665
+ };
666
+
667
+ export declare type PTableDensity = 'compact' | 'standard' | 'spacious';
668
+
669
+ export declare type PTableProps<RowData extends PTableRecord = PTableRecord> = {
670
+ columns: PTableColumn<RowData>[];
671
+ rows: RowData[];
672
+ caption: string;
673
+ captionHidden?: boolean;
674
+ summary?: ReactNode;
675
+ density?: PTableDensity;
676
+ stickyHeader?: boolean;
677
+ stickyFirstColumn?: boolean;
678
+ isLoading?: boolean;
679
+ loadingLabel?: ReactNode;
680
+ emptyState?: PTableState;
681
+ errorState?: PTableState;
682
+ getRowId?: (row: RowData, rowIndex: number) => string;
683
+ getRowTone?: (row: RowData, rowIndex: number) => PTableRowTone | undefined;
684
+ onRowClick?: (row: RowData, rowIndex: number, event: MouseEvent_2<HTMLTableRowElement | HTMLLIElement> | KeyboardEvent_2<HTMLTableRowElement | HTMLLIElement>) => void;
685
+ renderRowActions?: (row: RowData, rowIndex: number) => ReactNode;
686
+ onSortChange?: (columnId: string, direction: PTableSortDirection) => void;
687
+ className?: string;
688
+ tableClassName?: string;
689
+ } & Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'className'>;
690
+
691
+ export declare type PTableRecord = Record<string, unknown>;
692
+
693
+ export declare type PTableRef = HTMLDivElement;
694
+
695
+ export declare type PTableRowTone = 'neutral' | 'success' | 'warning' | 'danger' | 'info';
696
+
697
+ export declare type PTableSortDirection = 'ascending' | 'descending';
698
+
699
+ export declare type PTableState = {
700
+ title: ReactNode;
701
+ description?: ReactNode;
702
+ action?: ReactNode;
703
+ tone?: PTableStateTone;
704
+ };
705
+
706
+ export declare type PTableStateTone = 'neutral' | 'danger';
496
707
 
497
708
  export declare const PTextArea: ForwardRefExoticComponent< {
498
709
  /**
@@ -580,7 +791,7 @@ export declare interface PTypographyProps extends VariantProps<typeof PTypograph
580
791
  }
581
792
 
582
793
  declare const PTypographyVariants: (props?: ({
583
- variant?: "body" | "heading" | "serif" | "body-wide" | "heading-lg" | "heading-xl" | null | undefined;
794
+ variant?: "body" | "heading" | "serif" | "body-medium" | "body-wide" | "heading-lg" | "heading-xl" | null | undefined;
584
795
  } & ClassProp) | undefined) => string;
585
796
 
586
797
  export declare const Row: FC<RowProps>;