@hexure/ui 1.7.0 → 1.8.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.
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { MenuItemProps } from '../MoreMenu/MoreMenu';
3
+ export interface ButtonMenuProps {
4
+ disabled?: boolean;
5
+ label: string;
6
+ small?: boolean;
7
+ menuItems: Array<MenuItemProps>;
8
+ maxHeight?: string | number;
9
+ position?: 'left' | 'right';
10
+ }
11
+ declare const ButtonMenu: FC<ButtonMenuProps>;
12
+ export default ButtonMenu;
@@ -0,0 +1 @@
1
+ export { default } from './ButtonMenu';
@@ -1,23 +1,23 @@
1
1
  import { FC } from 'react';
2
- import { AccessibleProps } from '../../utils/Accessibility';
3
- export interface FileUploadProps extends AccessibleProps {
4
- /** It is used to get the array of files. */
5
- onChange: (e: any) => void;
6
- /** It is used to get the delete file. */
7
- onFileDelete: (e: any) => void;
8
- /** It is used to get max file size in MBs. */
9
- maxFileSize: number;
10
- /** It is used to whether the progress bar should be shown or not. */
11
- progress: boolean;
12
- /** It is used to set the upload progress value from 0 to 100. */
13
- UploadProgress?: {
14
- index: number;
15
- progress: number;
16
- };
17
- /** It is used to set the value of multile file upload in boolean. */
18
- multiple: boolean;
19
- /** It is used to set the value of acceptable files. Example ".jpg, .jpeg, .pdf"*/
20
- acceptFiles: string;
2
+ export interface FileUploadProps {
3
+ /** A method to call when files are added/removed. Return the new file or array of files. */
4
+ onChange?: (files: Array<File>) => void;
5
+ /** A method to call when files are rejected. Returns an array of files and their errors */
6
+ onError?: (errors: Array<ErrorObject>) => void;
7
+ /** The maximum number of files that be added. */
8
+ maxFiles?: number;
9
+ /** The maximum file size allowed, in MBs. */
10
+ maxSize?: number;
11
+ /** Display a message in the dropzone area */
12
+ message?: string;
13
+ /** A string of comma separated file types */
14
+ accept?: string;
15
+ /** A method that will be run against each file to determine if it's valid before being added. Must return a boolean. */
16
+ validateFile?: (file: File) => boolean;
17
+ }
18
+ interface ErrorObject {
19
+ file: File;
20
+ message: string;
21
21
  }
22
22
  declare const FileUpload: FC<FileUploadProps>;
23
23
  export default FileUpload;
@@ -1,6 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { AccessibleProps } from '../../utils/Accessibility';
3
- interface MenuItemProps extends AccessibleProps {
3
+ export interface MenuItemProps extends AccessibleProps {
4
4
  icon?: string;
5
5
  label?: string;
6
6
  onClick: (e?: any) => void;
@@ -0,0 +1,24 @@
1
+ import { FC } from 'react';
2
+ import { MenuItemProps } from '../MoreMenu/MoreMenu';
3
+ export interface PageHeaderProps {
4
+ title?: string;
5
+ breadcrumbs?: Array<{
6
+ label: string;
7
+ onClick?: (e: any) => void;
8
+ }>;
9
+ actions?: Array<{
10
+ disabled?: boolean;
11
+ format?: 'primary' | 'secondary' | 'red';
12
+ icon?: string;
13
+ label: string;
14
+ onClick?: (e: any) => void;
15
+ }>;
16
+ buttonMenu?: {
17
+ disabled?: boolean;
18
+ icon?: string;
19
+ label: string;
20
+ menuItems: Array<MenuItemProps>;
21
+ };
22
+ }
23
+ declare const PageHeader: FC<PageHeaderProps>;
24
+ export default PageHeader;
@@ -0,0 +1 @@
1
+ export { default } from './PageHeader';
@@ -3,6 +3,7 @@ export { default as ActionDialog } from './components/ActionDialog';
3
3
  export { default as Alert } from './components/Alert';
4
4
  export { default as BulkActionBar } from './components/BulkActionBar';
5
5
  export { default as Button } from './components/Button';
6
+ export { default as ButtonMenu } from './components/ButtonMenu';
6
7
  export { default as Checkbox } from './components/Checkbox';
7
8
  export { default as Checklist } from './components/Checklist';
8
9
  export { default as Copy } from './components/Copy';
@@ -17,6 +18,7 @@ export { default as Logo } from './components/Logo';
17
18
  export { default as Modal } from './components/Modal';
18
19
  export { default as MoreMenu } from './components/MoreMenu';
19
20
  export { default as MultiSelect } from './components/MultiSelect';
21
+ export { default as PageHeader } from './components/PageHeader';
20
22
  export { default as Pagination } from './components/Pagination';
21
23
  export { default as Radio } from './components/Radio';
22
24
  export { default as RadioList } from './components/RadioList';
package/dist/index.d.ts CHANGED
@@ -100,6 +100,27 @@ interface ButtonProps$2 extends AccessibleProps {
100
100
  }
101
101
  declare const Button: FC<ButtonProps$2>;
102
102
 
103
+ interface MenuItemProps extends AccessibleProps {
104
+ icon?: string;
105
+ label?: string;
106
+ onClick: (e?: any) => void;
107
+ }
108
+ interface MoreMenuProps extends AccessibleProps {
109
+ menuItems: MenuItemProps[];
110
+ maxHeight?: string | number;
111
+ }
112
+ declare const MoreMenu: FC<MoreMenuProps>;
113
+
114
+ interface ButtonMenuProps {
115
+ disabled?: boolean;
116
+ label: string;
117
+ small?: boolean;
118
+ menuItems: Array<MenuItemProps>;
119
+ maxHeight?: string | number;
120
+ position?: 'left' | 'right';
121
+ }
122
+ declare const ButtonMenu: FC<ButtonMenuProps>;
123
+
103
124
  interface CheckboxProps extends AccessibleProps {
104
125
  /** It is used to give label to checkbox. */
105
126
  children?: string;
@@ -222,24 +243,25 @@ interface FieldProps extends AccessibleProps {
222
243
  }
223
244
  declare const Field: FC<FieldProps>;
224
245
 
225
- interface FileUploadProps extends AccessibleProps {
226
- /** It is used to get the array of files. */
227
- onChange: (e: any) => void;
228
- /** It is used to get the delete file. */
229
- onFileDelete: (e: any) => void;
230
- /** It is used to get max file size in MBs. */
231
- maxFileSize: number;
232
- /** It is used to whether the progress bar should be shown or not. */
233
- progress: boolean;
234
- /** It is used to set the upload progress value from 0 to 100. */
235
- UploadProgress?: {
236
- index: number;
237
- progress: number;
238
- };
239
- /** It is used to set the value of multile file upload in boolean. */
240
- multiple: boolean;
241
- /** It is used to set the value of acceptable files. Example ".jpg, .jpeg, .pdf"*/
242
- acceptFiles: string;
246
+ interface FileUploadProps {
247
+ /** A method to call when files are added/removed. Return the new file or array of files. */
248
+ onChange?: (files: Array<File>) => void;
249
+ /** A method to call when files are rejected. Returns an array of files and their errors */
250
+ onError?: (errors: Array<ErrorObject>) => void;
251
+ /** The maximum number of files that be added. */
252
+ maxFiles?: number;
253
+ /** The maximum file size allowed, in MBs. */
254
+ maxSize?: number;
255
+ /** Display a message in the dropzone area */
256
+ message?: string;
257
+ /** A string of comma separated file types */
258
+ accept?: string;
259
+ /** A method that will be run against each file to determine if it's valid before being added. Must return a boolean. */
260
+ validateFile?: (file: File) => boolean;
261
+ }
262
+ interface ErrorObject {
263
+ file: File;
264
+ message: string;
243
265
  }
244
266
  declare const FileUpload: FC<FileUploadProps>;
245
267
 
@@ -344,17 +366,6 @@ interface ModalProps extends AccessibleProps {
344
366
  }
345
367
  declare const Modal: FC<ModalProps>;
346
368
 
347
- interface MenuItemProps extends AccessibleProps {
348
- icon?: string;
349
- label?: string;
350
- onClick: (e?: any) => void;
351
- }
352
- interface MoreMenuProps extends AccessibleProps {
353
- menuItems: MenuItemProps[];
354
- maxHeight?: string | number;
355
- }
356
- declare const MoreMenu: FC<MoreMenuProps>;
357
-
358
369
  interface OptionProps$2 {
359
370
  label?: string;
360
371
  value: string | number;
@@ -374,6 +385,28 @@ interface MultiSelectProps extends AccessibleProps {
374
385
  }
375
386
  declare const MultiSelect: FC<MultiSelectProps>;
376
387
 
388
+ interface PageHeaderProps {
389
+ title?: string;
390
+ breadcrumbs?: Array<{
391
+ label: string;
392
+ onClick?: (e: any) => void;
393
+ }>;
394
+ actions?: Array<{
395
+ disabled?: boolean;
396
+ format?: 'primary' | 'secondary' | 'red';
397
+ icon?: string;
398
+ label: string;
399
+ onClick?: (e: any) => void;
400
+ }>;
401
+ buttonMenu?: {
402
+ disabled?: boolean;
403
+ icon?: string;
404
+ label: string;
405
+ menuItems: Array<MenuItemProps>;
406
+ };
407
+ }
408
+ declare const PageHeader: FC<PageHeaderProps>;
409
+
377
410
  interface PaginationProps extends AccessibleProps {
378
411
  currentPage: number;
379
412
  onClick: (e?: any) => void;
@@ -510,4 +543,4 @@ interface ZeroStateProps extends AccessibleProps {
510
543
  }
511
544
  declare const ZeroState: FC<ZeroStateProps>;
512
545
 
513
- export { Accordion, ActionDialog, Alert, BulkActionBar, Button, Checkbox, Checklist, Copy, DatePicker, Drawer, Field, FileUpload, Heading, Input, Link, Logo, Modal, MoreMenu, MultiSelect, Pagination, Radio, RadioList, Select, Table, Tabs, Tag, Toggle, Tooltip, ZeroState };
546
+ export { Accordion, ActionDialog, Alert, BulkActionBar, Button, ButtonMenu, Checkbox, Checklist, Copy, DatePicker, Drawer, Field, FileUpload, Heading, Input, Link, Logo, Modal, MoreMenu, MultiSelect, PageHeader, Pagination, Radio, RadioList, Select, Table, Tabs, Tag, Toggle, Tooltip, ZeroState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexure/ui",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "description": "A library of shared UI components used within Hexure products.",
5
5
  "scripts": {
6
6
  "rollup": "rollup -c rollup.config.mjs",