@unifiedsoftware/react-ui 1.0.7 → 1.0.8-beta

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,51 +1,93 @@
1
1
  import * as react from 'react';
2
- import react__default, { ReactNode, FC, Dispatch, SetStateAction } from 'react';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import * as styled_components from 'styled-components';
5
- import * as react_router_dom from 'react-router-dom';
2
+ import react__default, { Dispatch, SetStateAction } from 'react';
6
3
 
7
4
  type BadgePlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
8
5
 
9
- interface Props$c {
6
+ interface Props$6 {
7
+ /**
8
+ * The placement of the badge relative to its content.
9
+ */
10
10
  placement?: BadgePlacement;
11
+ /**
12
+ * The content to display within the badge.
13
+ */
11
14
  content?: React.ReactNode;
12
15
  }
13
- type NativeAttrs$6 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$c>;
14
- type BadgeProps = Props$c & NativeAttrs$6;
16
+ type NativeAttrs$6 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$6>;
17
+ type BadgeProps = Props$6 & NativeAttrs$6;
15
18
  declare const Badge: React.FC<BadgeProps>;
16
19
 
17
20
  type ButtonVariant = 'filled' | 'outlined' | 'text' | 'plain';
18
21
  type ButtonColor = 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger';
19
22
  type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
20
23
 
21
- interface Props$b {
24
+ interface Props$5 {
25
+ /**
26
+ * The HTML element type or React component to render as the button.
27
+ */
22
28
  as?: React.ElementType;
29
+ /**
30
+ * The variant style of the button.
31
+ */
23
32
  variant?: ButtonVariant;
33
+ /**
34
+ * The color of the button.
35
+ */
24
36
  color?: ButtonColor;
37
+ /**
38
+ * The size of the button.
39
+ */
25
40
  size?: ButtonSize;
41
+ /**
42
+ * Content to display as an icon within the button. Typically an icon component.
43
+ */
26
44
  iconOnly?: React.ReactNode;
45
+ /**
46
+ * Content to display at the start of the button, before the button's text.
47
+ */
27
48
  startContent?: React.ReactNode;
49
+ /**
50
+ * Content to display at the end of the button, after the button's text.
51
+ */
28
52
  endContent?: React.ReactNode;
53
+ /**
54
+ * Whether the button is in a loading state.
55
+ */
29
56
  loading?: boolean;
57
+ /**
58
+ * Whether the button is disabled.
59
+ */
30
60
  disabled?: boolean;
31
61
  }
32
- type NativeAttrs$5 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$b>;
33
- type ButtonProps = Props$b & NativeAttrs$5;
34
- declare const Button: react.ForwardRefExoticComponent<Props$b & NativeAttrs$5 & react.RefAttributes<HTMLButtonElement>>;
62
+ type NativeAttrs$5 = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof Props$5>;
63
+ type ButtonProps = Props$5 & NativeAttrs$5;
64
+ declare const Button: react.ForwardRefExoticComponent<Props$5 & NativeAttrs$5 & react.RefAttributes<HTMLButtonElement>>;
35
65
 
36
66
  type ChipVariant = 'filled' | 'outlined' | 'text';
37
67
  type ChipColor = 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger';
38
68
  type ChipSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
39
69
 
40
- interface Props$a {
70
+ interface Props$4 {
71
+ /**
72
+ * The HTML element type or React component to render as the chip.
73
+ */
41
74
  as?: React.ElementType;
75
+ /**
76
+ * The variant style of the chip.
77
+ */
42
78
  variant?: ChipVariant;
79
+ /**
80
+ * The color of the chip.
81
+ */
43
82
  color?: ChipColor;
83
+ /**
84
+ * The size of the chip.
85
+ */
44
86
  size?: ChipSize;
45
87
  }
46
- type NativeAttrs$4 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$a>;
47
- type ChipProps = Props$a & NativeAttrs$4;
48
- declare const Chip: react.ForwardRefExoticComponent<Props$a & NativeAttrs$4 & react.RefAttributes<HTMLDivElement>>;
88
+ type NativeAttrs$4 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$4>;
89
+ type ChipProps = Props$4 & NativeAttrs$4;
90
+ declare const Chip: react.ForwardRefExoticComponent<Props$4 & NativeAttrs$4 & react.RefAttributes<HTMLDivElement>>;
49
91
 
50
92
  interface CollapseProps {
51
93
  children: React.ReactNode;
@@ -77,31 +119,56 @@ interface CollapseTriggerProps {
77
119
  }
78
120
  declare const CollapseTrigger: react__default.FC<CollapseTriggerProps>;
79
121
 
80
- interface Props$9 {
122
+ interface IconProps {
123
+ children: React.ReactNode;
124
+ color?: 'primary' | 'secondary';
125
+ size?: 'sm' | 'md' | 'lg';
126
+ }
127
+ declare const Icon: react.ForwardRefExoticComponent<IconProps & react.RefAttributes<unknown>>;
128
+
129
+ interface Props$3 {
130
+ /**
131
+ * The HTML element type or React component to render as the menu item.
132
+ */
81
133
  as?: React.ElementType;
134
+ /**
135
+ * The value associated with the menu item.
136
+ */
82
137
  value?: any;
138
+ /**
139
+ * The title to display for the menu item.
140
+ */
83
141
  title: string;
142
+ /**
143
+ * Optional icon to display with the menu item.
144
+ */
84
145
  icon?: React.ReactNode;
146
+ /**
147
+ * The nesting level of the menu item, for hierarchical menus.
148
+ */
85
149
  level?: number;
150
+ /**
151
+ * Whether the item is disabled.
152
+ */
86
153
  disabled?: boolean;
87
154
  }
88
- type NativeAttrs$3 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$9 | 'items'>;
89
- type MenuItemProps$1 = Props$9 & NativeAttrs$3;
90
- declare const MenuItem$1: react.ForwardRefExoticComponent<Props$9 & NativeAttrs$3 & {
155
+ type NativeAttrs$3 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$3 | 'items'>;
156
+ type MenuItemProps = Props$3 & NativeAttrs$3;
157
+ declare const MenuItem: react.ForwardRefExoticComponent<Props$3 & NativeAttrs$3 & {
91
158
  children?: react.ReactNode;
92
159
  } & react.RefAttributes<HTMLDivElement>>;
93
160
 
94
- type MenuSubmenuProps = Omit<MenuItemProps$1, 'items'> & {
161
+ type MenuSubmenuProps = Omit<MenuItemProps, 'items'> & {
95
162
  items?: MenuItemType[];
96
163
  };
97
164
  declare const MenuSubmenu: React.FC<MenuSubmenuProps>;
98
165
 
99
- type MenuGroupItemType = (MenuItemProps$1 & {
166
+ type MenuGroupItemType = (MenuItemProps & {
100
167
  type?: 'item';
101
168
  }) | (MenuSubmenuProps & {
102
169
  type?: 'submenu';
103
170
  });
104
- type MenuGroupProps = Omit<MenuItemProps$1, 'items'> & {
171
+ type MenuGroupProps = Omit<MenuItemProps, 'items'> & {
105
172
  items?: MenuGroupItemType[];
106
173
  };
107
174
  declare const MenuGroup: React.FC<MenuGroupProps>;
@@ -110,21 +177,47 @@ type MenuItemType = (MenuGroupProps & {
110
177
  type?: 'group';
111
178
  }) | (MenuSubmenuProps & {
112
179
  type?: 'submenu';
113
- }) | (MenuItemProps$1 & {
180
+ }) | (MenuItemProps & {
114
181
  type?: 'item';
115
182
  });
116
- interface Props$8 {
117
- value?: any | any[];
118
- defaultValue?: any | any[];
183
+ interface Props$2 {
184
+ /**
185
+ * The currently selected value of the menu.
186
+ */
187
+ value?: any[];
188
+ /**
189
+ * The default value of the menu when initially rendered.
190
+ */
191
+ defaultValue?: any[];
192
+ /**
193
+ * An array of values that represent open submenus in the menu.
194
+ */
119
195
  openValues?: any[];
120
- expandMode?: 'single' | 'multiple';
196
+ /**
197
+ * The expand mode of the menu, which can be 'single' or 'multiple'.
198
+ */
199
+ navMode?: 'single' | 'multiple';
200
+ /**
201
+ * The nav mode of the menu, which can be 'manual' or 'automatic'.
202
+ * Search for the last level of the menu and validate if the value matches.
203
+ */
121
204
  openMode?: 'manual' | 'automatic';
122
- onChange?: (value: any | any[]) => void;
205
+ /**
206
+ * A callback function called when the selected values of the menu change.
207
+ */
208
+ onChange?: (value: any[]) => void;
209
+ /**
210
+ * A callback function called when submenus are opened.
211
+ */
123
212
  onOpen?: (values: any[]) => void;
124
- onItemSelect?: (props: MenuItemProps$1) => void;
125
- }
126
- type NativeAttrs$2 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$8 | 'items'>;
127
- type MenuProps = Props$8 & NativeAttrs$2 & {
213
+ /**
214
+ * A callback function called when a menu item is selected.
215
+ * @param {MenuItemProps} props - The properties of the selected menu item.
216
+ */
217
+ onItemSelect?: (props: MenuItemProps) => void;
218
+ }
219
+ type NativeAttrs$2 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$2 | 'items'>;
220
+ type MenuProps = Props$2 & NativeAttrs$2 & {
128
221
  items: MenuItemType[];
129
222
  };
130
223
  declare const Menu: React.FC<MenuProps>;
@@ -133,11 +226,11 @@ interface MenuContextValue {
133
226
  value: any;
134
227
  originalValue: any;
135
228
  openValues: any[];
136
- expandMode: 'single' | 'multiple';
229
+ navMode: 'single' | 'multiple';
137
230
  openMode: 'manual' | 'automatic';
138
231
  onChange: (value: any) => void;
139
232
  onOpen: (values: any) => void;
140
- onItemSelect: (props: MenuItemProps$1) => void;
233
+ onItemSelect: (props: MenuItemProps) => void;
141
234
  }
142
235
  declare const MenuContext: react.Context<MenuContextValue | null>;
143
236
  declare const useMenu: () => MenuContextValue;
@@ -147,104 +240,58 @@ declare const useMenuItemValue: () => string[];
147
240
 
148
241
  declare const getOpenValuesByPathname: (pathname: string) => string[];
149
242
 
150
- interface Props$7 {
243
+ interface Props$1 {
244
+ /**
245
+ * The HTML element type or React component to render as the tab.
246
+ */
151
247
  as?: React.ElementType;
248
+ /**
249
+ * The value associated with the tab.
250
+ */
152
251
  value?: any;
252
+ /**
253
+ * Whether the tab can be closed.
254
+ */
153
255
  closable?: boolean;
256
+ /**
257
+ * Whether the tab is disabled.
258
+ */
154
259
  disabled?: boolean;
155
260
  }
156
- type NativeAttrs$1 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$7>;
157
- type TabProps = Props$7 & NativeAttrs$1;
158
- declare const Tab: react.ForwardRefExoticComponent<Props$7 & NativeAttrs$1 & {
261
+ type NativeAttrs$1 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$1>;
262
+ type TabProps = Props$1 & NativeAttrs$1;
263
+ declare const Tab: react.ForwardRefExoticComponent<Props$1 & NativeAttrs$1 & {
159
264
  children?: react.ReactNode;
160
265
  } & react.RefAttributes<HTMLDivElement>>;
161
266
 
162
267
  type TabsAlignmet = 'start' | 'center' | 'end' | 'stretch';
163
268
 
164
- interface Props$6 {
269
+ interface Props {
270
+ /**
271
+ * The currently selected value of the tabs.
272
+ */
165
273
  value?: any;
274
+ /**
275
+ * The default value of the tabs when initially rendered.
276
+ */
166
277
  defaultValue?: any;
278
+ /**
279
+ * The alignment of the tabs.
280
+ */
167
281
  alignment?: TabsAlignmet;
282
+ /**
283
+ * A callback function called when the selected tab value changes.
284
+ */
168
285
  onChange?: (value: any) => void;
286
+ /**
287
+ * A callback function called when a tab is closed.
288
+ */
169
289
  onClose?: (value: any) => void;
170
290
  }
171
- type NativeAttrs = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$6>;
172
- type TabsProps = Props$6 & NativeAttrs;
291
+ type NativeAttrs = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props>;
292
+ type TabsProps = Props & NativeAttrs;
173
293
  declare const Tabs: React.FC<TabsProps>;
174
294
 
175
- interface IDropEnumList {
176
- dataEnum: object;
177
- description: Map<any, Map<number, string>>;
178
- width: number;
179
- defaultValue: number;
180
- onChange: (number: any) => void;
181
- }
182
- declare const DropEnumList: React.FC<IDropEnumList>;
183
-
184
- interface IBreadCrumbContext {
185
- active: string;
186
- setActive: (value: string) => void;
187
- path: string;
188
- setPath: (value: string) => void;
189
- routes: {
190
- route: string | -1;
191
- title: string;
192
- }[];
193
- setRoutes: (value: {
194
- route: string | -1;
195
- title: string;
196
- }[]) => void;
197
- pathChild: string;
198
- setPathChild: (value: string) => void;
199
- goBack: boolean;
200
- setGoBack: (value: boolean) => void;
201
- }
202
- declare const BreadCrumbContext: react.Context<IBreadCrumbContext>;
203
- interface Props$5 {
204
- children: ReactNode;
205
- }
206
- declare const BreadCrumbContextProvider: ({ children }: Props$5) => react_jsx_runtime.JSX.Element;
207
-
208
- interface IDrawerContext {
209
- active: boolean;
210
- setActive: (value: boolean) => void;
211
- }
212
- declare const DrawerContext: react.Context<IDrawerContext>;
213
- interface Props$4 {
214
- children: ReactNode;
215
- }
216
- declare const DrawerContextProvider: FC<Props$4>;
217
-
218
- interface GlobalProps {
219
- children: ReactNode;
220
- }
221
- declare function GlobalProvider({ children }: GlobalProps): react_jsx_runtime.JSX.Element;
222
-
223
- interface HistoryPath {
224
- path: string;
225
- name: string;
226
- date?: Date;
227
- }
228
- interface IHistoryContext {
229
- list: HistoryPath[];
230
- updateList: (list: HistoryPath) => void;
231
- }
232
- declare const HistoryContext: react.Context<IHistoryContext>;
233
- interface Props$3 {
234
- children: React.ReactNode;
235
- }
236
- declare const HistoryContextProvider: ({ children }: Props$3) => react_jsx_runtime.JSX.Element;
237
-
238
- interface ISidebarMainContext {
239
- open: boolean;
240
- setOpen: (value: boolean) => void;
241
- }
242
- declare const SidebarMainContext: react.Context<ISidebarMainContext>;
243
- interface Props$2 {
244
- children: ReactNode;
245
- }
246
- declare const SidebarMainContextProvider: ({ children }: Props$2) => react_jsx_runtime.JSX.Element;
247
-
248
295
  declare global {
249
296
  interface WindowEventMap {
250
297
  'local-storage': CustomEvent;
@@ -283,109 +330,4 @@ interface Helpers {
283
330
  */
284
331
  declare const useStep: (maxStep: number) => [number, Helpers];
285
332
 
286
- interface Props$1 {
287
- title?: string;
288
- paths?: {
289
- route: string | -1;
290
- title: string;
291
- }[];
292
- }
293
- declare const AppBreadCrumb: ({ title, paths }: Props$1) => react_jsx_runtime.JSX.Element;
294
- declare const AppBreadCrumbNav: ({ paths, onPush, }: {
295
- paths?: {
296
- route: string;
297
- title: string;
298
- }[] | undefined;
299
- onPush: (to: string | number) => void;
300
- }) => react_jsx_runtime.JSX.Element;
301
-
302
- type LoadingType = 'window' | 'page' | 'grid' | 'button' | 'card' | 'div' | 'none';
303
- /**
304
- * If the gridContent exists, render the loader in the gridContent, otherwise, if the reportContent
305
- * exists, render the loader in the reportContent, otherwise, render the loader in the current
306
- * component.
307
- * @returns A React component that is a portal.
308
- */
309
- declare const LoaderGrid: () => react_jsx_runtime.JSX.Element;
310
- interface ILoaderProps {
311
- type?: LoadingType;
312
- parent?: string;
313
- minDuration?: number;
314
- }
315
- /**
316
- * It's a React component that renders a loading indicator in a parent element.
317
- * @param props - {type?: LoadingType; parent?: string; minDuration?: number;}
318
- * @returns A React component that is a function.
319
- */
320
- declare const AppLoader: FC<ILoaderProps>;
321
-
322
- interface CustomBtns {
323
- title?: string;
324
- render?: React.ReactNode;
325
- Icon?: ({ className }: {
326
- className: string;
327
- }) => JSX.Element;
328
- onAction?: () => void;
329
- }
330
- interface CustomExcel {
331
- title: string;
332
- classNameIcon: string;
333
- onAction: () => void;
334
- }
335
- interface ICustomizeColumns {
336
- disabled?: boolean;
337
- className?: string;
338
- entityType: number;
339
- data: any[];
340
- onFetched: (columns: any[]) => void;
341
- }
342
- interface NavOptionsProps {
343
- exportExcel?: CustomExcel[];
344
- customButtons?: CustomBtns[];
345
- onCreate?: () => void;
346
- onRefresh?: () => void;
347
- onSelect?: () => void;
348
- onClear?: () => void;
349
- onExpandScreen?: () => void;
350
- }
351
- declare const NavOptions: FC<NavOptionsProps>;
352
-
353
- interface Props {
354
- title?: string;
355
- }
356
- declare const Title: ({ title }: Props) => react_jsx_runtime.JSX.Element;
357
-
358
- declare const Breadcrumb: styled_components.StyledComponent<"div", any, {}, never>;
359
- declare const BreadCrumbTitle: styled_components.StyledComponent<"div", any, {}, never>;
360
-
361
- interface MenuItemProps {
362
- type?: 'row' | 'col';
363
- width?: string;
364
- }
365
- declare const MenuItem: styled_components.StyledComponent<react.ForwardRefExoticComponent<react_router_dom.LinkProps & react.RefAttributes<HTMLAnchorElement>>, any, MenuItemProps, never>;
366
- declare const MenuTitle: styled_components.StyledComponent<"p", any, {}, never>;
367
-
368
- interface NavbarProps {
369
- gradient?: boolean;
370
- }
371
- declare const Navbar: styled_components.StyledComponent<"nav", any, NavbarProps, never>;
372
-
373
- declare const MenuOptions: styled_components.StyledComponent<"div", any, {}, never>;
374
-
375
- interface SidebarProps {
376
- width?: string;
377
- active?: boolean;
378
- fixed?: boolean;
379
- shadow?: boolean;
380
- }
381
- declare const ItemSidebar: styled_components.StyledComponent<"div", any, {}, never>;
382
- declare const SidebarNavigation: styled_components.StyledComponent<"nav", any, SidebarProps, never>;
383
- declare const ItemLinkSidebar: styled_components.StyledComponent<react.ForwardRefExoticComponent<react_router_dom.LinkProps & react.RefAttributes<HTMLAnchorElement>>, any, {}, never>;
384
-
385
- interface MainProps {
386
- activeDrawer: boolean;
387
- }
388
- declare const Main: styled_components.StyledComponent<"main", any, MainProps, never>;
389
- declare const CloseIcon: styled_components.StyledComponent<"button", any, {}, never>;
390
-
391
- export { AppBreadCrumb, AppBreadCrumbNav, AppLoader, Badge, BadgeProps, BreadCrumbContext, BreadCrumbContextProvider, BreadCrumbTitle, Breadcrumb, Button, ButtonColor, ButtonProps, ButtonSize, ButtonVariant, Chip, ChipProps, CloseIcon, Collapse, CollapseContent, CollapseContentProps, CollapseContext, CollapseContextValue, CollapseProps, CollapseTrigger, CollapseTriggerProps, CustomBtns, CustomExcel, DrawerContext, DrawerContextProvider, DropEnumList, GlobalProps, GlobalProvider, HistoryContext, HistoryContextProvider, IBreadCrumbContext, ICustomizeColumns, ILoaderProps, ItemLinkSidebar, ItemSidebar, LoaderGrid, LoadingType, Main, Menu, MenuContext, MenuContextValue, MenuGroup, MenuGroupItemType, MenuGroupProps, MenuItem$1 as MenuItem, MenuItemProps$1 as MenuItemProps, MenuItemType, MenuItem as MenuItems, MenuOptions, MenuProps, MenuSubmenu, MenuSubmenuProps, MenuTitle, MenuValueContext, NavOptions, NavOptionsProps, Navbar, SidebarMainContext, SidebarMainContextProvider, SidebarNavigation, Tab, TabProps, Tabs, TabsAlignmet, TabsProps, Title, getOpenValuesByPathname, useCollapse, useLocalStorage, useMenu, useMenuItemValue, usePrevious, useStep };
333
+ export { Badge, BadgeProps, Button, ButtonColor, ButtonProps, ButtonSize, ButtonVariant, Chip, ChipProps, Collapse, CollapseContent, CollapseContentProps, CollapseContext, CollapseContextValue, CollapseProps, CollapseTrigger, CollapseTriggerProps, Icon, IconProps, Menu, MenuContext, MenuContextValue, MenuGroup, MenuGroupItemType, MenuGroupProps, MenuItem, MenuItemProps, MenuItemType, MenuProps, MenuSubmenu, MenuSubmenuProps, MenuValueContext, Tab, TabProps, Tabs, TabsAlignmet, TabsProps, getOpenValuesByPathname, useCollapse, useLocalStorage, useMenu, useMenuItemValue, usePrevious, useStep };