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