cortex-react-ui 0.2.30 → 0.2.32

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/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import * as React$1 from 'react';
2
2
  import React__default, { CSSProperties } from 'react';
3
3
  import { IDetectedBarcode, IScannerProps } from '@yudiel/react-qr-scanner';
4
4
  import { WebcamProps } from 'react-webcam';
@@ -79,6 +79,67 @@ interface ButtonProps {
79
79
  }
80
80
  declare const Button: React__default.FC<ButtonProps>;
81
81
 
82
+ interface ChipProps {
83
+ label: string;
84
+ chipColor?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark';
85
+ chipRadius?: 'low' | 'medium' | 'hight';
86
+ size?: 'small' | 'medium' | 'large';
87
+ deletable: boolean;
88
+ onDelete?: () => void;
89
+ chipStyle?: React__default.CSSProperties;
90
+ icon?: React__default.ReactElement;
91
+ }
92
+ declare const Chip: React__default.FC<ChipProps>;
93
+
94
+ interface CellSegment {
95
+ value: React.ReactNode;
96
+ span: number;
97
+ }
98
+ interface ColumnBase<T> {
99
+ key: string;
100
+ header: React.ReactNode;
101
+ icon?: React.ReactElement;
102
+ width?: number | string;
103
+ align?: 'left' | 'center' | 'right';
104
+ verticalAlign?: 'top' | 'middle' | 'bottom';
105
+ whiteSpace?: 'normal' | 'nowrap' | 'pre-wrap' | 'break-spaces';
106
+ getSegments?: (row: T) => CellSegment[];
107
+ }
108
+ type ColumnDef<T> = ColumnBase<T> & {
109
+ columns?: readonly ColumnBase<T>[];
110
+ };
111
+
112
+ type DataGridProps<T> = {
113
+ rows: readonly T[];
114
+ getRowId: (row: T) => string;
115
+ columns: readonly ColumnDef<T>[];
116
+ loading?: boolean;
117
+ dataEmptyLabel?: React__default.ReactNode;
118
+ linePerPageLabel?: string;
119
+ tableContainer?: React__default.CSSProperties;
120
+ tableStyle?: React__default.CSSProperties;
121
+ headerCellStyle?: React__default.CSSProperties;
122
+ cellStyle?: React__default.CSSProperties;
123
+ footerCellStyle?: React__default.CSSProperties;
124
+ contextMenuStyle?: React__default.CSSProperties;
125
+ primaryRowColor?: string;
126
+ secondaryRowColor?: string;
127
+ hoverRowColor?: string;
128
+ selectedRowColor?: string;
129
+ defaultRowsPerPage?: number;
130
+ rowsPerPageOptions?: number[];
131
+ hoverableRows?: boolean;
132
+ selectableRows?: boolean;
133
+ onSelectedRowChange?: (row: T | null) => void;
134
+ onClickRow?: (row: T) => void;
135
+ onContextMenuRow?: (row: T) => void;
136
+ renderContextMenu?: (row: T, close: () => void) => React__default.ReactNode;
137
+ conditionnalRowStyle?: (row: T) => React__default.CSSProperties | undefined;
138
+ conditionnalColumnStyle?: (column: ColumnBase<T>, row: T) => React__default.CSSProperties | undefined;
139
+ conditionnalColumnHeaderStyle?: (column: ColumnBase<T>) => React__default.CSSProperties | undefined;
140
+ };
141
+ declare function DataGrid<T>(props: DataGridProps<T>): React__default.JSX.Element;
142
+
82
143
  type TScanConfirmDialogLabels = {
83
144
  title?: string;
84
145
  message?: string;
@@ -415,12 +476,12 @@ declare const CrossIcon: React__default.FC<Props>;
415
476
  * En React 18, ref est passé séparément via forwardRef
416
477
  */
417
478
  type ForwardRefProps<T, P = object> = P & {
418
- ref?: React.Ref<T>;
479
+ ref?: React$1.Ref<T>;
419
480
  };
420
481
  /**
421
482
  * Type pour la fonction de rendu compatible React 18/19
422
483
  */
423
- type ForwardRefRenderFunction<T, P> = (props: P, ref: React.ForwardedRef<T>) => React.ReactElement | null;
484
+ type ForwardRefRenderFunction<T, P> = (props: P, ref: React$1.ForwardedRef<T>) => React$1.ReactElement | null;
424
485
  /**
425
486
  * Composant wrapper compatible React 18 et React 19
426
487
  *
@@ -441,7 +502,7 @@ type ForwardRefRenderFunction<T, P> = (props: P, ref: React.ForwardedRef<T>) =>
441
502
  * );
442
503
  * ```
443
504
  */
444
- declare function forwardRef<T, P>(render: ForwardRefRenderFunction<T, P>): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>>;
505
+ declare function forwardRef<T, P>(render: ForwardRefRenderFunction<T, P>): React$1.ForwardRefExoticComponent<React$1.PropsWithoutRef<P> & React$1.RefAttributes<T>>;
445
506
 
446
- export { AuthDownloadLink, BarLoader, Button, Camera, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ConfirmDialog, ContextMenu, CrossIcon, Dialog, DialogActions, DialogContent, DialogFooter, DialogHeader, DialogTitle, Divider, DomContainer, ErrorDialog, Map, Menu, MenuGroup, MenuItem, Popper, PopupMenu, Scanner, Selected, Spinner, TagInput, ToggleButton, Tooltip, WarningDialog, forwardRef };
507
+ export { AuthDownloadLink, BarLoader, Button, Camera, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, Chip, ConfirmDialog, ContextMenu, CrossIcon, DataGrid, Dialog, DialogActions, DialogContent, DialogFooter, DialogHeader, DialogTitle, Divider, DomContainer, ErrorDialog, Map, Menu, MenuGroup, MenuItem, Popper, PopupMenu, Scanner, Selected, Spinner, TagInput, ToggleButton, Tooltip, WarningDialog, forwardRef };
447
508
  export type { ForwardRefProps, ForwardRefRenderFunction };
@@ -10,6 +10,8 @@
10
10
  @use "Dialog";
11
11
  @use "Scanner";
12
12
  @use "Button";
13
+ @use "Chip";
14
+ @use "DataGrid";
13
15
  @use "ToggleButton";
14
16
  @use "Selected";
15
17
  @use "BarLoader";
@@ -26,6 +28,8 @@
26
28
  @include Scanner.scanner();
27
29
  @include Dialog.dialog();
28
30
  @include Button.button();
31
+ @include DataGrid.datagrid();
32
+ @include Chip.chip();
29
33
  @include ToggleButton.toggleButton();
30
34
  @include Selected.selected();
31
35
  @include BarLoader.barLoader();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortex-react-ui",
3
- "version": "0.2.30",
3
+ "version": "0.2.32",
4
4
  "description": "React UI",
5
5
  "author": "Anthony",
6
6
  "license": "MIT",
@@ -64,6 +64,17 @@
64
64
  "react-icons": "^5.4.0",
65
65
  "react-webcam": "^7.2.0"
66
66
  },
67
+ "peerDependenciesMeta": {
68
+ "react-webcam": {
69
+ "optional": true
70
+ },
71
+ "@yudiel/react-qr-scanner": {
72
+ "optional": true
73
+ },
74
+ "react-icons": {
75
+ "optional": true
76
+ }
77
+ },
67
78
  "devDependencies": {
68
79
  "@babel/core": "^7.26.0",
69
80
  "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",