@hexure/ui 1.7.0 → 1.8.0

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';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import React, { FC, ReactNode } from 'react';
2
-
1
+ import React, { FC, ReactNode } from 'react';
2
+
3
3
  interface AccessibleProps {
4
4
  /** Set the css id for the main wrapping html element */
5
5
  id?: string;
@@ -13,8 +13,8 @@ interface AccessibleProps {
13
13
  tabIndex?: number;
14
14
  /** Set a label for an interactive element. See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label */
15
15
  'aria-label'?: string;
16
- }
17
-
16
+ }
17
+
18
18
  interface AccordionProps extends AccessibleProps {
19
19
  title?: string;
20
20
  /** Define the content to be displayed */
@@ -24,8 +24,8 @@ interface AccordionProps extends AccessibleProps {
24
24
  /** Method to call when the header is clicked */
25
25
  onClick: (e?: any) => void;
26
26
  }
27
- declare const Accordion: FC<AccordionProps>;
28
-
27
+ declare const Accordion: FC<AccordionProps>;
28
+
29
29
  interface ButtonProps$4 {
30
30
  children: string;
31
31
  format?: 'primary' | 'red';
@@ -45,8 +45,8 @@ interface ActionDialogProps extends AccessibleProps {
45
45
  /** Set the tertiary action for the dialog. This should only be defined after a secondary action is defined */
46
46
  tertiaryButton?: ButtonProps$4;
47
47
  }
48
- declare const ActionDialog: FC<ActionDialogProps>;
49
-
48
+ declare const ActionDialog: FC<ActionDialogProps>;
49
+
50
50
  interface ActionProps$1 extends AccessibleProps {
51
51
  label: string;
52
52
  onClick: (e?: any) => void;
@@ -60,8 +60,8 @@ interface AlertProps extends AccessibleProps {
60
60
  /** Display a link to display below the description */
61
61
  action?: ActionProps$1;
62
62
  }
63
- declare const Alert: FC<AlertProps>;
64
-
63
+ declare const Alert: FC<AlertProps>;
64
+
65
65
  interface ButtonProps$3 {
66
66
  children: string;
67
67
  onClick: (e?: any) => void;
@@ -74,8 +74,8 @@ interface BulkActionBarProps extends AccessibleProps {
74
74
  onClear: (e?: any) => void;
75
75
  selectedCount?: number;
76
76
  }
77
- declare const BulkActionBar: FC<BulkActionBarProps>;
78
-
77
+ declare const BulkActionBar: FC<BulkActionBarProps>;
78
+
79
79
  interface ButtonProps$2 extends AccessibleProps {
80
80
  /** Display a number badge on the right side of the button */
81
81
  badge?: number;
@@ -98,8 +98,8 @@ interface ButtonProps$2 extends AccessibleProps {
98
98
  /** Define which button format to display. By default the Primary button will be used. */
99
99
  format?: 'primary' | 'secondary' | 'red';
100
100
  }
101
- declare const Button: FC<ButtonProps$2>;
102
-
101
+ declare const Button: FC<ButtonProps$2>;
102
+
103
103
  interface CheckboxProps extends AccessibleProps {
104
104
  /** It is used to give label to checkbox. */
105
105
  children?: string;
@@ -110,8 +110,8 @@ interface CheckboxProps extends AccessibleProps {
110
110
  /** It is used to change value of checkbox. */
111
111
  onChange: (e?: any) => void;
112
112
  }
113
- declare const Checkbox: FC<CheckboxProps>;
114
-
113
+ declare const Checkbox: FC<CheckboxProps>;
114
+
115
115
  interface OptionProps$3 {
116
116
  label?: string;
117
117
  value: string | number;
@@ -123,8 +123,8 @@ interface ChecklistProps extends AccessibleProps {
123
123
  selected: (string | number)[];
124
124
  showSelectAll?: boolean;
125
125
  }
126
- declare const Checklist: FC<ChecklistProps>;
127
-
126
+ declare const Checklist: FC<ChecklistProps>;
127
+
128
128
  interface CopyProps extends AccessibleProps {
129
129
  /** Set the text to be displayed */
130
130
  children: string;
@@ -138,8 +138,8 @@ interface CopyProps extends AccessibleProps {
138
138
  /** Set the color of the copy based on the design system color pallette */
139
139
  color?: 'PRIMARY' | 'GREEN' | 'RED' | 'YELLOW' | 'BLACK' | 'GRAY' | 'MEDIUM_GRAY' | 'LIGHT_GRAY';
140
140
  }
141
- declare const Copy: FC<CopyProps>;
142
-
141
+ declare const Copy: FC<CopyProps>;
142
+
143
143
  interface styleProps$3 {
144
144
  width?: number | string;
145
145
  }
@@ -159,8 +159,8 @@ interface DateProps extends AccessibleProps {
159
159
  /** Override default styles */
160
160
  style?: styleProps$3;
161
161
  }
162
- declare const DatePicker: FC<DateProps>;
163
-
162
+ declare const DatePicker: FC<DateProps>;
163
+
164
164
  interface ButtonProps$1 extends AccessibleProps {
165
165
  disabled: boolean;
166
166
  children: string;
@@ -187,8 +187,8 @@ interface DrawerProps extends AccessibleProps {
187
187
  /** It is used to close drawer. */
188
188
  onClose: (e?: any) => void;
189
189
  }
190
- declare const Drawer: FC<DrawerProps>;
191
-
190
+ declare const Drawer: FC<DrawerProps>;
191
+
192
192
  interface TooltipProps {
193
193
  /** It is used to give label to tag. */
194
194
  children: string;
@@ -197,8 +197,8 @@ interface TooltipProps {
197
197
  /** Override the default content width of 240px */
198
198
  width?: string;
199
199
  }
200
- declare const Tooltip: FC<TooltipProps>;
201
-
200
+ declare const Tooltip: FC<TooltipProps>;
201
+
202
202
  interface ActionProps {
203
203
  label: string;
204
204
  onClick: (e?: any) => void;
@@ -220,29 +220,30 @@ interface FieldProps extends AccessibleProps {
220
220
  /** Display a tooltip next to the label */
221
221
  tooltip?: TooltipProps;
222
222
  }
223
- declare const Field: FC<FieldProps>;
224
-
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;
243
- }
244
- declare const FileUpload: FC<FileUploadProps>;
245
-
223
+ declare const Field: FC<FieldProps>;
224
+
225
+ interface FileUploadProps {
226
+ /** A method to call when files are added/removed. Return the new file or array of files. */
227
+ onChange?: (files: Array<File>) => void;
228
+ /** A method to call when files are rejected. Returns an array of files and their errors */
229
+ onError?: (errors: Array<ErrorObject>) => void;
230
+ /** The maximum number of files that be added. */
231
+ maxFiles?: number;
232
+ /** The maximum file size allowed, in MBs. */
233
+ maxSize?: number;
234
+ /** Display a message in the dropzone area */
235
+ message?: string;
236
+ /** A string of comma separated file types */
237
+ accept?: string;
238
+ /** A method that will be run against each file to determine if it's valid before being added. Must return a boolean. */
239
+ validateFile?: (file: File) => boolean;
240
+ }
241
+ interface ErrorObject {
242
+ file: File;
243
+ message: string;
244
+ }
245
+ declare const FileUpload: FC<FileUploadProps>;
246
+
246
247
  interface HeadingProps extends AccessibleProps {
247
248
  /** Toggle between bold and normal font weights */
248
249
  bold?: boolean;
@@ -255,8 +256,8 @@ interface HeadingProps extends AccessibleProps {
255
256
  /** Set the type of heading to display: primary, secondary, tertiary */
256
257
  type?: 'primary' | 'secondary' | 'tertiary';
257
258
  }
258
- declare const Heading: FC<HeadingProps>;
259
-
259
+ declare const Heading: FC<HeadingProps>;
260
+
260
261
  interface styleProps$2 {
261
262
  width?: number | string;
262
263
  }
@@ -294,8 +295,8 @@ interface InputProps extends AccessibleProps {
294
295
  /** Set the value of the input. This should be used by the parent component to control the input's value. */
295
296
  value?: string;
296
297
  }
297
- declare const Input: FC<InputProps>;
298
-
298
+ declare const Input: FC<InputProps>;
299
+
299
300
  interface LinkProps extends AccessibleProps {
300
301
  /** Set the text to be displayed */
301
302
  children: string;
@@ -304,14 +305,14 @@ interface LinkProps extends AccessibleProps {
304
305
  /** A method to execute when this component is clicked */
305
306
  onClick?: (e?: any) => void;
306
307
  }
307
- declare const Link: FC<LinkProps>;
308
-
308
+ declare const Link: FC<LinkProps>;
309
+
309
310
  interface LogoProps extends AccessibleProps {
310
311
  type?: 'mark_red' | 'mark_white' | 'standard_white' | 'standard_black' | 'standard_full' | 'standard_reversed';
311
312
  height?: string;
312
313
  }
313
- declare const Logo: FC<LogoProps>;
314
-
314
+ declare const Logo: FC<LogoProps>;
315
+
315
316
  interface ButtonProps {
316
317
  disabled?: boolean;
317
318
  children: string;
@@ -342,8 +343,8 @@ interface ModalProps extends AccessibleProps {
342
343
  /** Display steps at the top of the modal */
343
344
  steps?: StepProps[];
344
345
  }
345
- declare const Modal: FC<ModalProps>;
346
-
346
+ declare const Modal: FC<ModalProps>;
347
+
347
348
  interface MenuItemProps extends AccessibleProps {
348
349
  icon?: string;
349
350
  label?: string;
@@ -353,8 +354,8 @@ interface MoreMenuProps extends AccessibleProps {
353
354
  menuItems: MenuItemProps[];
354
355
  maxHeight?: string | number;
355
356
  }
356
- declare const MoreMenu: FC<MoreMenuProps>;
357
-
357
+ declare const MoreMenu: FC<MoreMenuProps>;
358
+
358
359
  interface OptionProps$2 {
359
360
  label?: string;
360
361
  value: string | number;
@@ -372,15 +373,15 @@ interface MultiSelectProps extends AccessibleProps {
372
373
  showSelectAll?: boolean;
373
374
  style?: styleProps$1;
374
375
  }
375
- declare const MultiSelect: FC<MultiSelectProps>;
376
-
376
+ declare const MultiSelect: FC<MultiSelectProps>;
377
+
377
378
  interface PaginationProps extends AccessibleProps {
378
379
  currentPage: number;
379
380
  onClick: (e?: any) => void;
380
381
  pageCount: number;
381
382
  }
382
- declare const Pagination: FC<PaginationProps>;
383
-
383
+ declare const Pagination: FC<PaginationProps>;
384
+
384
385
  interface RadioProps extends AccessibleProps {
385
386
  /** It is used to give label to radio. */
386
387
  children: string | number;
@@ -392,8 +393,8 @@ interface RadioProps extends AccessibleProps {
392
393
  onChange: (e?: any) => void;
393
394
  value: string | number;
394
395
  }
395
- declare const Radio: FC<RadioProps>;
396
-
396
+ declare const Radio: FC<RadioProps>;
397
+
397
398
  interface OptionProps$1 {
398
399
  label?: string;
399
400
  value: string | number;
@@ -404,8 +405,8 @@ interface RadioListProps extends AccessibleProps {
404
405
  options: OptionProps$1[];
405
406
  value: string;
406
407
  }
407
- declare const RadioList: FC<RadioListProps>;
408
-
408
+ declare const RadioList: FC<RadioListProps>;
409
+
409
410
  interface OptionProps {
410
411
  /** It is used to give label to option. */
411
412
  label?: string;
@@ -437,8 +438,8 @@ interface SelectProps extends AccessibleProps {
437
438
  /** It is used to change value when an option is clicked. */
438
439
  onChange: (e: any) => void;
439
440
  }
440
- declare const Select: FC<SelectProps>;
441
-
441
+ declare const Select: FC<SelectProps>;
442
+
442
443
  interface RowObject {
443
444
  [key: string]: any;
444
445
  }
@@ -460,8 +461,8 @@ interface TableProps extends AccessibleProps {
460
461
  onSortChange?: (e?: any) => void;
461
462
  tableLayout?: string;
462
463
  }
463
- declare const Table: FC<TableProps>;
464
-
464
+ declare const Table: FC<TableProps>;
465
+
465
466
  interface TabProps extends AccessibleProps {
466
467
  badgeCount?: number;
467
468
  errorBadge?: boolean;
@@ -472,8 +473,8 @@ interface TabProps extends AccessibleProps {
472
473
  interface TabsProps extends AccessibleProps {
473
474
  tabs: TabProps[];
474
475
  }
475
- declare const Tabs: FC<TabsProps>;
476
-
476
+ declare const Tabs: FC<TabsProps>;
477
+
477
478
  interface TagProps extends AccessibleProps {
478
479
  /** It is used to select tag-type either default or removable. */
479
480
  color?: 'PRIMARY' | 'GREEN' | 'RED' | 'YELLOW' | 'BLACK' | 'SUBTLE_GRAY';
@@ -484,16 +485,16 @@ interface TagProps extends AccessibleProps {
484
485
  /** It is callback function called when user wants to close the tag. */
485
486
  removable?: boolean;
486
487
  }
487
- declare const Tag: FC<TagProps>;
488
-
488
+ declare const Tag: FC<TagProps>;
489
+
489
490
  interface ToggleProps extends AccessibleProps {
490
491
  /** It is used to check whether Toggle is checked or not */
491
492
  on: boolean;
492
493
  /** Pass a callback then fires when user change value */
493
494
  onClick: (e?: any) => void;
494
495
  }
495
- declare const Toggle: FC<ToggleProps>;
496
-
496
+ declare const Toggle: FC<ToggleProps>;
497
+
497
498
  interface ZeroStateProps extends AccessibleProps {
498
499
  /** The SVG path of the icon to show */
499
500
  icon: string;
@@ -508,6 +509,6 @@ interface ZeroStateProps extends AccessibleProps {
508
509
  onClick: (e?: any) => void;
509
510
  };
510
511
  }
511
- declare const ZeroState: FC<ZeroStateProps>;
512
-
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 };
512
+ declare const ZeroState: FC<ZeroStateProps>;
513
+
514
+ 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexure/ui",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "A library of shared UI components used within Hexure products.",
5
5
  "scripts": {
6
6
  "rollup": "rollup -c rollup.config.mjs",