@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifiedsoftware/react-ui",
3
- "version": "1.0.7",
3
+ "version": "1.0.8-beta",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -11,45 +11,36 @@
11
11
  "access": "public"
12
12
  },
13
13
  "scripts": {
14
- "build": "npm run clean && tsup src/index.ts --format esm,cjs --dts --external react",
14
+ "build": "npm run clean && tsup src/index.ts --format cjs --dts --external react",
15
15
  "clean": "rimraf dist",
16
16
  "prepack": "clean-package",
17
17
  "postpack": "clean-package restore"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "react": ">=16",
21
- "react-dom": "^16.0.0 || ^17.0.2 || ^18.2.0",
22
- "react-router-dom": "^6.14.2"
21
+ "react-dom": "^16.0.0 || ^17.0.2 || ^18.2.0"
23
22
  },
24
23
  "dependencies": {
25
- "@progress/kendo-react-dropdowns": "^5.12.1",
26
- "@progress/kendo-react-treeview": "^5.12.1",
27
24
  "clsx": "^2.0.0",
28
- "merge-refs": "^1.2.1",
29
- "react-bootstrap": "^2.8.0",
30
- "react-icons": "^4.11.0",
31
- "styled-components": "^5.3.8"
25
+ "merge-refs": "^1.2.1"
32
26
  },
33
27
  "devDependencies": {
34
28
  "@types/node": "^18.14.6",
35
29
  "@types/react": "^18.2.22",
36
30
  "@types/react-dom": "^18.0.11",
37
- "@types/styled-components": "^5.1.26",
38
31
  "clean-package": "2.2.0",
39
32
  "react": "^18.2.0",
40
33
  "react-dom": "^18.2.0",
41
- "react-router-dom": "^6.14.2",
34
+ "react-icons": "^4.11.0",
42
35
  "rimraf": "^5.0.1",
43
36
  "tsup": "^7.2.0",
44
37
  "typescript": "^4.9.5"
45
38
  },
46
39
  "clean-package": "../../../clean-package.config.json",
47
- "module": "dist/index.mjs",
48
40
  "types": "dist/index.d.ts",
49
41
  "exports": {
50
42
  ".": {
51
43
  "types": "./dist/index.d.ts",
52
- "import": "./dist/index.mjs",
53
44
  "require": "./dist/index.js"
54
45
  },
55
46
  "./package.json": "./package.json"
package/dist/index.d.mts DELETED
@@ -1,391 +0,0 @@
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';
6
-
7
- type BadgePlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
8
-
9
- interface Props$c {
10
- placement?: BadgePlacement;
11
- content?: React.ReactNode;
12
- }
13
- type NativeAttrs$6 = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$c>;
14
- type BadgeProps = Props$c & NativeAttrs$6;
15
- declare const Badge: React.FC<BadgeProps>;
16
-
17
- type ButtonVariant = 'filled' | 'outlined' | 'text' | 'plain';
18
- type ButtonColor = 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger';
19
- type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
20
-
21
- interface Props$b {
22
- as?: React.ElementType;
23
- variant?: ButtonVariant;
24
- color?: ButtonColor;
25
- size?: ButtonSize;
26
- iconOnly?: React.ReactNode;
27
- startContent?: React.ReactNode;
28
- endContent?: React.ReactNode;
29
- loading?: boolean;
30
- disabled?: boolean;
31
- }
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>>;
35
-
36
- type ChipVariant = 'filled' | 'outlined' | 'text';
37
- type ChipColor = 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger';
38
- type ChipSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
39
-
40
- interface Props$a {
41
- as?: React.ElementType;
42
- variant?: ChipVariant;
43
- color?: ChipColor;
44
- size?: ChipSize;
45
- }
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>>;
49
-
50
- interface CollapseProps {
51
- children: React.ReactNode;
52
- isOpen?: boolean;
53
- onOpen?: () => void;
54
- onClose?: () => void;
55
- onToggle?: () => void;
56
- }
57
- declare const Collapse: React.FC<CollapseProps>;
58
-
59
- interface CollapseContentProps {
60
- children: React.ReactNode;
61
- }
62
- declare const CollapseContent: React.FC<CollapseContentProps>;
63
-
64
- interface CollapseContextValue {
65
- collapseRef: React.MutableRefObject<HTMLDivElement | null>;
66
- isOpen: boolean;
67
- heightAuto: boolean;
68
- onOpen: () => void;
69
- onClose: () => void;
70
- onToggle: () => void;
71
- }
72
- declare const CollapseContext: react.Context<CollapseContextValue | null>;
73
- declare const useCollapse: () => CollapseContextValue;
74
-
75
- interface CollapseTriggerProps {
76
- children: react__default.ReactNode;
77
- }
78
- declare const CollapseTrigger: react__default.FC<CollapseTriggerProps>;
79
-
80
- interface Props$9 {
81
- as?: React.ElementType;
82
- value?: any;
83
- title: string;
84
- icon?: React.ReactNode;
85
- level?: number;
86
- disabled?: boolean;
87
- }
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 & {
91
- children?: react.ReactNode;
92
- } & react.RefAttributes<HTMLDivElement>>;
93
-
94
- type MenuSubmenuProps = Omit<MenuItemProps$1, 'items'> & {
95
- items?: MenuItemType[];
96
- };
97
- declare const MenuSubmenu: React.FC<MenuSubmenuProps>;
98
-
99
- type MenuGroupItemType = (MenuItemProps$1 & {
100
- type?: 'item';
101
- }) | (MenuSubmenuProps & {
102
- type?: 'submenu';
103
- });
104
- type MenuGroupProps = Omit<MenuItemProps$1, 'items'> & {
105
- items?: MenuGroupItemType[];
106
- };
107
- declare const MenuGroup: React.FC<MenuGroupProps>;
108
-
109
- type MenuItemType = (MenuGroupProps & {
110
- type?: 'group';
111
- }) | (MenuSubmenuProps & {
112
- type?: 'submenu';
113
- }) | (MenuItemProps$1 & {
114
- type?: 'item';
115
- });
116
- interface Props$8 {
117
- value?: any | any[];
118
- defaultValue?: any | any[];
119
- openValues?: any[];
120
- expandMode?: 'single' | 'multiple';
121
- openMode?: 'manual' | 'automatic';
122
- onChange?: (value: any | any[]) => void;
123
- 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 & {
128
- items: MenuItemType[];
129
- };
130
- declare const Menu: React.FC<MenuProps>;
131
-
132
- interface MenuContextValue {
133
- value: any;
134
- originalValue: any;
135
- openValues: any[];
136
- expandMode: 'single' | 'multiple';
137
- openMode: 'manual' | 'automatic';
138
- onChange: (value: any) => void;
139
- onOpen: (values: any) => void;
140
- onItemSelect: (props: MenuItemProps$1) => void;
141
- }
142
- declare const MenuContext: react.Context<MenuContextValue | null>;
143
- declare const useMenu: () => MenuContextValue;
144
-
145
- declare const MenuValueContext: react.Context<string[]>;
146
- declare const useMenuItemValue: () => string[];
147
-
148
- declare const getOpenValuesByPathname: (pathname: string) => string[];
149
-
150
- interface Props$7 {
151
- as?: React.ElementType;
152
- value?: any;
153
- closable?: boolean;
154
- disabled?: boolean;
155
- }
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 & {
159
- children?: react.ReactNode;
160
- } & react.RefAttributes<HTMLDivElement>>;
161
-
162
- type TabsAlignmet = 'start' | 'center' | 'end' | 'stretch';
163
-
164
- interface Props$6 {
165
- value?: any;
166
- defaultValue?: any;
167
- alignment?: TabsAlignmet;
168
- onChange?: (value: any) => void;
169
- onClose?: (value: any) => void;
170
- }
171
- type NativeAttrs = Omit<React.HTMLAttributes<HTMLDivElement>, keyof Props$6>;
172
- type TabsProps = Props$6 & NativeAttrs;
173
- declare const Tabs: React.FC<TabsProps>;
174
-
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
- declare global {
249
- interface WindowEventMap {
250
- 'local-storage': CustomEvent;
251
- }
252
- }
253
- type SetValue<T> = Dispatch<SetStateAction<T>>;
254
- /**
255
- * It's a React hook that allows you to store and retrieve data from localStorage
256
- * @param {string} key - string
257
- * @param {T} initialValue - The initial value to use if the key doesn't exist in localStorage.
258
- * @returns An array of two items. The first item is the value of the local storage key. The second
259
- * item is a function that can be used to set the value of the local storage key.
260
- */
261
- declare function useLocalStorage<T>(key: string, initialValue: T): [T, SetValue<T>];
262
-
263
- /**
264
- * It returns the previous value of the given value
265
- * @param {any} value - any - The value to track.
266
- * @returns The previous value of the variable.
267
- */
268
- declare const usePrevious: (value: any) => undefined;
269
-
270
- interface Helpers {
271
- goToNextStep: () => void;
272
- goToPrevStep: () => void;
273
- reset: () => void;
274
- canGoToNextStep: boolean;
275
- canGoToPrevStep: boolean;
276
- setStep: Dispatch<SetStateAction<number>>;
277
- }
278
- /**
279
- * It returns a tuple with the current step and an object with functions to manipulate the step
280
- * @param {number} maxStep - number - The maximum number of steps in the stepper.
281
- * @returns An array with two elements. The first element is the current step. The second element is an
282
- * object with the following properties:
283
- */
284
- declare const useStep: (maxStep: number) => [number, Helpers];
285
-
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 };