@midwest-diesel/mwd-ui 1.0.4 → 1.1.1

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,12 +1,240 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
2
+ import * as react from 'react';
3
+ import react__default, { CSSProperties, MouseEvent, ReactElement, ReactNode } from 'react';
3
4
 
4
- interface Props extends React.HTMLProps<HTMLButtonElement> {
5
+ interface Props$k extends React.HTMLProps<HTMLButtonElement> {
5
6
  children: any;
6
7
  className?: string;
7
8
  variant?: ('no-style' | 'small' | 'x-small' | 'xx-small' | 'large' | 'no-hover-color' | 'hover-move' | 'search' | 'X' | 'circle' | 'center' | 'plain' | 'save' | 'blue' | 'green' | 'red-color' | 'link' | 'fit' | 'danger')[];
8
9
  type?: 'submit' | 'reset' | 'button';
9
10
  }
10
- declare function Button({ children, className, variant, type, ...props }: Props): react_jsx_runtime.JSX.Element;
11
+ declare function Button({ children, className, variant, type, ...props }: Props$k): react_jsx_runtime.JSX.Element;
11
12
 
12
- export { Button };
13
+ type DialogEntry = {
14
+ id: string;
15
+ element: HTMLDivElement | null;
16
+ };
17
+ type DialogContextType = {
18
+ dialogs: DialogEntry[];
19
+ register: (id: string, element: HTMLDivElement | null) => void;
20
+ bringToFront: (id: string) => void;
21
+ };
22
+ declare function useDialogContext(): DialogContextType;
23
+ declare function DialogProvider({ children }: {
24
+ children: React.ReactNode;
25
+ }): react_jsx_runtime.JSX.Element;
26
+
27
+ interface Props$j {
28
+ children: react__default.ReactNode;
29
+ className?: string;
30
+ variant?: ('default')[];
31
+ title?: string;
32
+ closeOnOutsideClick?: boolean;
33
+ exitWithEsc?: boolean;
34
+ hasCloseBtn?: boolean;
35
+ width?: number;
36
+ minWidth?: number;
37
+ height?: number;
38
+ maxHeight?: string;
39
+ open?: boolean;
40
+ setOpen?: (open: boolean) => void;
41
+ x?: number;
42
+ y?: number;
43
+ }
44
+ declare function Dialog({ children, className, variant, title, closeOnOutsideClick, exitWithEsc, hasCloseBtn, width, minWidth, height, maxHeight, open, setOpen, x, y, ...props }: Props$j): react_jsx_runtime.JSX.Element;
45
+
46
+ interface Props$i {
47
+ children: any;
48
+ className?: string;
49
+ variant?: ('small' | 'label-space-between' | 'label-stack' | 'label-inline' | 'label-full-width' | 'large' | 'no-margin' | 'label-full-height' | 'fill' | 'gap' | 'label-bold')[];
50
+ label?: string;
51
+ value?: string;
52
+ onChange?: (value?: any, data?: any) => void;
53
+ onBlur?: (value: string) => void;
54
+ maxHeight?: string;
55
+ minWidth?: string;
56
+ }
57
+ declare function Dropdown({ children, className, variant, label, value, onChange, onBlur, maxHeight, minWidth }: Props$i): react_jsx_runtime.JSX.Element;
58
+
59
+ interface Props$h {
60
+ children: any;
61
+ value: string | number;
62
+ className?: string;
63
+ onClick?: () => void;
64
+ disabled?: boolean;
65
+ }
66
+ declare function DropdownOption({ children, value, className, onClick, disabled }: Props$h): react_jsx_runtime.JSX.Element;
67
+
68
+ interface Props$g {
69
+ children: any;
70
+ label: string;
71
+ className?: string;
72
+ }
73
+ declare function NavDropdown({ children, className, label, ...props }: Props$g): react_jsx_runtime.JSX.Element;
74
+
75
+ interface Props$f {
76
+ variant?: ('default')[];
77
+ children: React.ReactNode;
78
+ className?: string;
79
+ }
80
+ declare function Grid({ children, className, variant }: Props$f): react_jsx_runtime.JSX.Element;
81
+
82
+ interface Props$e {
83
+ variant?: ('no-style' | 'low-opacity-bg' | 'sub-table-item')[];
84
+ children: React.ReactNode;
85
+ className?: string;
86
+ colSpan?: number;
87
+ style?: CSSProperties;
88
+ }
89
+ declare function GridItem({ children, className, colSpan, variant, style }: Props$e): react_jsx_runtime.JSX.Element;
90
+
91
+ interface Props$d extends React.InputHTMLAttributes<HTMLSelectElement> {
92
+ children: any;
93
+ className?: string;
94
+ labelClass?: string;
95
+ variant?: ('label-inline' | 'label-space-between' | 'label-full-width' | 'label-stack' | 'large' | 'label-bold')[];
96
+ label?: string;
97
+ }
98
+ declare function Select({ children, className, labelClass, variant, label, ...props }: Props$d): react_jsx_runtime.JSX.Element;
99
+
100
+ interface Props$c {
101
+ value: string;
102
+ width?: number;
103
+ height?: number;
104
+ }
105
+ declare function Barcode({ value, width, height }: Props$c): react_jsx_runtime.JSX.Element;
106
+
107
+ interface Props$b extends React.InputHTMLAttributes<HTMLInputElement> {
108
+ className?: string;
109
+ labelClass?: string;
110
+ variant?: ('label-thin' | 'label-space-between' | 'label-full-width' | 'label-bold' | 'dark-bg' | 'label-stack' | 'label-content-center' | 'label-align-center' | 'label-fit' | 'label-vertical-align')[];
111
+ label?: string;
112
+ disabled?: boolean;
113
+ }
114
+ declare function Checkbox({ className, labelClass, variant, label, disabled, ...props }: Props$b): react_jsx_runtime.JSX.Element;
115
+
116
+ interface Props$a {
117
+ open: boolean;
118
+ setOpen: (value: boolean) => void;
119
+ targetClass: string;
120
+ notTargetClass?: string;
121
+ list: {
122
+ name: string;
123
+ fn: (e?: MouseEvent) => void;
124
+ }[];
125
+ }
126
+ declare function ContextMenu({ open, setOpen, targetClass, notTargetClass, list }: Props$a): react_jsx_runtime.JSX.Element;
127
+
128
+ interface Props$9 {
129
+ children: React.ReactElement;
130
+ handle?: string;
131
+ nodeRef?: React.RefObject<HTMLElement | null>;
132
+ defaultPosition?: {
133
+ x: number;
134
+ y: number;
135
+ };
136
+ }
137
+ declare function Draggable({ children, handle, nodeRef, defaultPosition }: Props$9): react_jsx_runtime.JSX.Element;
138
+
139
+ interface Props$8 extends React.InputHTMLAttributes<HTMLInputElement> {
140
+ children?: any;
141
+ className?: string;
142
+ labelClass?: string;
143
+ variant?: ('thin' | 'small' | 'x-small' | 'search' | 'label-stack' | 'label-no-stack' | 'label-space-between' | 'md-text' | 'label-full-width' | 'label-bold' | 'label-inline' | 'label-no-margin' | 'no-style' | 'label-fit-content' | 'autofill-input' | 'no-arrows')[];
144
+ label?: string;
145
+ autofill?: string;
146
+ onAutofill?: (value: string) => void;
147
+ }
148
+ declare const Input: react.ForwardRefExoticComponent<Props$8 & react.RefAttributes<HTMLInputElement>>;
149
+
150
+ interface DropdownOptionProps {
151
+ value: string;
152
+ data?: any;
153
+ children: string;
154
+ onClick?: () => void;
155
+ className?: string;
156
+ }
157
+ interface Props$7 {
158
+ children: ReactElement<DropdownOptionProps>[];
159
+ className?: string;
160
+ variant?: ('small' | 'label-space-between' | 'label-stack' | 'label-inline' | 'label-full-width' | 'large' | 'no-margin' | 'label-full-height' | 'fill' | 'gap' | 'label-bold')[];
161
+ label?: string;
162
+ value?: string;
163
+ onChange?: (value: string, data?: any) => void;
164
+ onBlur?: (value: string) => void;
165
+ maxHeight?: string;
166
+ minWidth?: string;
167
+ }
168
+ declare function InputDropdown({ children, className, variant, label, value, onChange, onBlur, maxHeight, minWidth }: Props$7): react_jsx_runtime.JSX.Element;
169
+
170
+ interface Props$6 {
171
+ size?: number;
172
+ }
173
+ declare function Loading({ size }: Props$6): react_jsx_runtime.JSX.Element;
174
+
175
+ interface Props$5 {
176
+ children: react__default.ReactNode;
177
+ style?: any;
178
+ className?: string;
179
+ variant?: ('default')[];
180
+ title?: string;
181
+ closeOnOutsideClick?: boolean;
182
+ exitWithEsc?: boolean;
183
+ showCloseBtn?: boolean;
184
+ width?: number;
185
+ height?: number;
186
+ maxHeight?: string;
187
+ open?: boolean;
188
+ setOpen?: (open: boolean) => void;
189
+ onClose?: () => void;
190
+ }
191
+ declare function Modal({ children, className, variant, title, closeOnOutsideClick, exitWithEsc, showCloseBtn, width, height, maxHeight, open, setOpen, onClose, ...props }: Props$5): react_jsx_runtime.JSX.Element;
192
+
193
+ interface ModalListProps {
194
+ children: ReactNode;
195
+ initialPage?: number;
196
+ onClose?: () => void;
197
+ }
198
+ declare function ModalList({ children, initialPage, onClose }: ModalListProps): react_jsx_runtime.JSX.Element | null;
199
+
200
+ interface Props$4 {
201
+ className?: string;
202
+ variant?: ('default')[];
203
+ data: any[];
204
+ setData: (data: any[], page: number) => void;
205
+ buttonsDisplayed?: number;
206
+ page?: number;
207
+ pageSize: number;
208
+ pageCount?: number;
209
+ }
210
+ declare function Pagination({ className, variant, data, setData, buttonsDisplayed, page, pageSize, pageCount }: Props$4): react_jsx_runtime.JSX.Element;
211
+
212
+ interface Props$3 extends React.HTMLProps<HTMLTableElement> {
213
+ children: any;
214
+ variant?: ('plain' | 'row-details' | 'edit-row-details' | 'fit')[];
215
+ }
216
+ declare function Table({ children, className, variant, ...props }: Props$3): react_jsx_runtime.JSX.Element;
217
+
218
+ interface Props$2 {
219
+ children: any;
220
+ className?: string;
221
+ variant?: ('no-top-margin')[];
222
+ }
223
+ declare function Tabs({ children, className, variant, ...props }: Props$2): react_jsx_runtime.JSX.Element;
224
+
225
+ interface Props$1 extends React.InputHTMLAttributes<HTMLInputElement> {
226
+ className?: string;
227
+ labelClass?: string;
228
+ variant?: ('auto-size' | 'label-stack' | 'label-bold' | 'label-stack' | 'label-no-stack' | 'label-space-between' | 'md-text' | 'label-full-width' | 'label-bold' | 'label-inline' | 'label-no-margin' | 'no-style' | 'label-fit-content')[];
229
+ label?: string;
230
+ cols?: number;
231
+ rows?: number;
232
+ }
233
+ declare function TextArea({ className, labelClass, variant, label, cols, rows, value, defaultValue, ...props }: Props$1): react_jsx_runtime.JSX.Element;
234
+
235
+ interface Props {
236
+ msg: string;
237
+ }
238
+ declare function Tooltip({ msg }: Props): react_jsx_runtime.JSX.Element | null;
239
+
240
+ export { Barcode, Button, Checkbox, ContextMenu, Dialog, DialogProvider, Draggable, Dropdown, DropdownOption, Grid, GridItem, Input, InputDropdown, Loading, Modal, ModalList, NavDropdown, Pagination, Select, Table, Tabs, TextArea, Tooltip, useDialogContext };