dibk-design 9.3.5 → 9.4.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.
package/dist/index.d.ts CHANGED
@@ -3,10 +3,11 @@ import { default as default_2 } from 'react';
3
3
  import { JSX } from 'react/jsx-runtime';
4
4
  import { JSX as JSX_2 } from 'react';
5
5
  import { ReactNode } from 'react';
6
+ import { ReactPortal } from 'react';
6
7
 
7
8
  export declare const Accordion: ({ title, color, expanded: expandedProp, onToggleExpand, buttonProps, noMargin, initialized: initializedProp, children, ...rest }: AccordionProps) => JSX.Element;
8
9
 
9
- declare type AccordionColor = 'default' | 'secondary' | 'info' | 'contrast';
10
+ declare type AccordionColor = "default" | "secondary" | "info" | "contrast";
10
11
 
11
12
  declare interface AccordionProps {
12
13
  title?: string;
@@ -20,13 +21,13 @@ declare interface AccordionProps {
20
21
  [key: string]: any;
21
22
  }
22
23
 
23
- declare type ArrowDirection = 'none' | 'left' | 'right';
24
+ declare type ArrowDirection = "none" | "left" | "right";
24
25
 
25
26
  export declare const Button: ({ content, color, size, arrow, disabled, inputType, defaultChecked, hasErrors, noHover, rounded, noMargin, href, children, iconLeft, iconRight, ...rest }: ButtonProps) => JSX.Element;
26
27
 
27
- declare type ButtonColor = 'primary' | 'secondary';
28
+ declare type ButtonColor = "primary" | "secondary";
28
29
 
29
- declare interface ButtonProps extends Omit<default_2.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
30
+ declare interface ButtonProps extends Omit<default_2.ButtonHTMLAttributes<HTMLButtonElement>, "type"> {
30
31
  content?: string;
31
32
  color?: ButtonColor;
32
33
  size?: ButtonSize;
@@ -36,7 +37,7 @@ declare interface ButtonProps extends Omit<default_2.ButtonHTMLAttributes<HTMLBu
36
37
  defaultChecked?: boolean;
37
38
  required?: boolean;
38
39
  hasErrors?: boolean;
39
- 'aria-describedby'?: string;
40
+ "aria-describedby"?: string;
40
41
  noHover?: boolean;
41
42
  rounded?: boolean;
42
43
  href?: string;
@@ -47,16 +48,18 @@ declare interface ButtonProps extends Omit<default_2.ButtonHTMLAttributes<HTMLBu
47
48
  [key: string]: any;
48
49
  }
49
50
 
50
- declare type ButtonSize = 'small' | 'regular';
51
+ declare type ButtonSize = "small" | "regular";
52
+
53
+ export declare const CheckBoxIcon: ({ size, checked, disabled, showBox, hasErrors, checkmarkCharacter, }: CheckBoxIconProps) => JSX.Element;
51
54
 
52
- export declare const CheckBoxIcon: ({ size, checked, disabled, showBox, hasErrors, checkmarkCharacter, }: {
53
- size?: string | undefined;
54
- checked?: boolean | undefined;
55
- disabled?: boolean | undefined;
56
- showBox?: boolean | undefined;
57
- hasErrors?: boolean | undefined;
58
- checkmarkCharacter?: string | undefined;
59
- }) => JSX.Element;
55
+ declare interface CheckBoxIconProps {
56
+ size?: string;
57
+ checked?: boolean;
58
+ disabled?: boolean;
59
+ showBox?: boolean;
60
+ hasErrors?: boolean;
61
+ checkmarkCharacter?: string;
62
+ }
60
63
 
61
64
  export declare const CheckBoxInput: ({ checked, disabled, required, requiredGroup, id, name, onChange, contentOnly, hasErrors, checkmarkCharacter, tabIndex, children, "aria-controls": ariaControls, "aria-describedby": ariaDescribedBy, value, }: CheckBoxInputProps) => JSX.Element;
62
65
 
@@ -71,8 +74,8 @@ declare interface CheckBoxInputProps {
71
74
  contentOnly?: boolean;
72
75
  hasErrors?: boolean;
73
76
  checkmarkCharacter?: string;
74
- 'aria-controls'?: string;
75
- 'aria-describedby'?: string;
77
+ "aria-controls"?: string;
78
+ "aria-describedby"?: string;
76
79
  tabIndex?: number;
77
80
  children?: default_2.ReactNode;
78
81
  value?: string | number;
@@ -95,8 +98,8 @@ declare interface CheckBoxListItemProps {
95
98
  compact?: boolean;
96
99
  checkmarkCharacter?: string;
97
100
  hasErrors?: boolean;
98
- 'aria-controls'?: string;
99
- 'aria-describedby'?: string;
101
+ "aria-controls"?: string;
102
+ "aria-describedby"?: string;
100
103
  children?: default_2.ReactNode;
101
104
  }
102
105
 
@@ -153,7 +156,7 @@ declare interface DescriptionTermProps {
153
156
  children?: default_2.ReactNode;
154
157
  }
155
158
 
156
- export declare const Dialog: ({ maxWidth, noPadding, closeButton, onClickOutside, modal, attachTo, hidden, children, }: DialogProps) => JSX.Element;
159
+ export declare const Dialog: ({ maxWidth, noPadding, closeButton, onClickOutside, modal, attachTo, hidden, children, }: DialogProps) => ReactPortal | null;
157
160
 
158
161
  declare interface DialogProps {
159
162
  maxWidth?: string;
@@ -161,7 +164,7 @@ declare interface DialogProps {
161
164
  closeButton?: boolean;
162
165
  onClickOutside: () => void;
163
166
  modal?: boolean;
164
- attachTo?: 'left' | 'right' | 'top' | 'bottom' | string;
167
+ attachTo?: "left" | "right" | "top" | "bottom" | string;
165
168
  hidden?: boolean;
166
169
  children?: React.ReactNode;
167
170
  }
@@ -184,13 +187,13 @@ declare interface DragAndDropFileInputProps {
184
187
  errorMessage?: string | (string | JSX_2.Element)[];
185
188
  required?: boolean;
186
189
  children?: default_2.ReactNode;
187
- 'data-transaction-name'?: string;
190
+ "data-transaction-name"?: string;
188
191
  }
189
192
 
190
193
  export declare const ErrorBox: React.FC<ErrorBoxProps>;
191
194
 
192
195
  declare interface ErrorBoxProps {
193
- type?: 'warning' | 'error';
196
+ type?: "warning" | "error";
194
197
  fullScreen?: boolean;
195
198
  children?: React.ReactNode;
196
199
  }
@@ -227,24 +230,25 @@ declare interface InfoBoxProps {
227
230
  children?: default_2.ReactNode;
228
231
  }
229
232
 
230
- export declare const InputField: ({ id, onChange, onBlur, name, type, disabled, required, readOnly, width, value, defaultValue, elementKey, label, contentOnly, buttonColor, buttonContent, selectedFileName, placeholder, defaultContent, min, max, role, "aria-describedby": ariaDescribedBy, "aria-autocomplete": ariaAutocomplete, hasErrors, errorMessage, noMargin, }: InputFieldProps) => JSX.Element;
233
+ export declare const InputField: ({ id, onChange, onBlur, onFocus, name, type, disabled, required, readOnly, width, value, defaultValue, elementKey, label, contentOnly, buttonColor, buttonContent, selectedFileName, placeholder, defaultContent, min, max, role, "aria-describedby": ariaDescribedBy, "aria-autocomplete": ariaAutocomplete, hasErrors, errorMessage, noMargin, }: InputFieldProps) => JSX.Element;
231
234
 
232
235
  declare interface InputFieldProps {
233
236
  id: string;
234
- onChange: (e: default_2.ChangeEvent<HTMLInputElement>) => void;
237
+ onChange?: (e: default_2.ChangeEvent<HTMLInputElement>) => void;
235
238
  onBlur?: (e: default_2.FocusEvent<HTMLInputElement>) => void;
239
+ onFocus?: (e: default_2.FocusEvent<HTMLInputElement>) => void;
236
240
  name?: string;
237
241
  type?: string;
238
242
  disabled?: boolean;
239
243
  required?: boolean;
240
244
  readOnly?: boolean;
241
245
  width?: string;
242
- value?: any;
243
- defaultValue?: any;
246
+ value?: string | number | Date;
247
+ defaultValue?: string | number | Date;
244
248
  elementKey?: string;
245
249
  label?: default_2.ReactNode;
246
250
  contentOnly?: boolean;
247
- buttonColor?: 'primary' | 'secondary';
251
+ buttonColor?: "primary" | "secondary";
248
252
  buttonContent?: string;
249
253
  selectedFileName?: string;
250
254
  placeholder?: string;
@@ -252,14 +256,14 @@ declare interface InputFieldProps {
252
256
  min?: string;
253
257
  max?: string;
254
258
  role?: string;
255
- 'aria-describedby'?: string;
256
- 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both';
259
+ "aria-describedby"?: string;
260
+ "aria-autocomplete"?: "none" | "inline" | "list" | "both";
257
261
  hasErrors?: boolean;
258
262
  errorMessage?: default_2.ReactNode;
259
263
  noMargin?: boolean;
260
264
  }
261
265
 
262
- declare type InputType = 'button' | 'radio';
266
+ declare type InputType = "button" | "radio";
263
267
 
264
268
  export declare const Label: ({ inline, normalCursor, htmlTag, children, id, ...rest }: LabelProps) => default_2.DOMElement<{
265
269
  className: string;
@@ -595,6 +599,13 @@ declare interface LoadingAnimationProps {
595
599
  message?: string;
596
600
  }
597
601
 
602
+ declare interface MultipleSelectProps extends SelectPropsBase {
603
+ multiple: true;
604
+ onChange: (value: (string | number)[]) => void;
605
+ value?: (string | number)[];
606
+ defaultValue?: (string | number)[];
607
+ }
608
+
598
609
  export declare const NavigationBar: ({ primaryListItems, secondaryListItems, logoLink, logoLinkTitle, openLogoLinkInNewTab, theme, compact, mainContentId, preventChildElementStacking, children, }: NavigationBarProps) => JSX.Element;
599
610
 
600
611
  export declare const NavigationBarListItem: ({ listItem }: NavigationBarListItemProps) => JSX.Element | null;
@@ -660,8 +671,8 @@ declare interface RadioButtonInputProps {
660
671
  inputValue: string;
661
672
  tabIndex?: number;
662
673
  children?: default_2.ReactNode;
663
- 'aria-controls'?: string;
664
- 'aria-describedby'?: string;
674
+ "aria-controls"?: string;
675
+ "aria-describedby"?: string;
665
676
  }
666
677
 
667
678
  export declare const RadioButtonList: ({ legend, legendSize, required, compact, children, }: RadioButtonListProps) => JSX.Element;
@@ -693,19 +704,17 @@ declare interface RadioButtonListProps {
693
704
  children?: ReactNode;
694
705
  }
695
706
 
696
- export declare const Select: ({ id, onChange, name, required, disabled, multiple, options, width, value, defaultValue, label, contentOnly, keyAsContent, placeholder, placeholderValue, defaultContent, role, "aria-describedby": ariaDescribedBy, hasErrors, errorMessage, }: SelectProps) => JSX.Element;
707
+ export declare const Select: (props: SelectProps) => JSX.Element;
697
708
 
698
- declare interface SelectProps {
709
+ declare type SelectProps = SingleSelectProps | MultipleSelectProps;
710
+
711
+ declare interface SelectPropsBase {
699
712
  id: string;
700
- onChange: (value: any) => void;
701
713
  name?: string;
702
714
  required?: boolean;
703
715
  disabled?: boolean;
704
- multiple?: boolean;
705
716
  options?: Option_2[];
706
717
  width?: string;
707
- value?: any;
708
- defaultValue?: any;
709
718
  label?: default_2.ReactNode;
710
719
  contentOnly?: boolean;
711
720
  keyAsContent?: boolean;
@@ -713,11 +722,18 @@ declare interface SelectProps {
713
722
  placeholderValue?: string;
714
723
  defaultContent?: string;
715
724
  role?: string;
716
- 'aria-describedby'?: string;
725
+ "aria-describedby"?: string;
717
726
  hasErrors?: boolean;
718
727
  errorMessage?: default_2.ReactNode;
719
728
  }
720
729
 
730
+ declare interface SingleSelectProps extends SelectPropsBase {
731
+ multiple?: false;
732
+ onChange: (value: string | number) => void;
733
+ value?: string | number;
734
+ defaultValue?: string | number;
735
+ }
736
+
721
737
  declare interface StepData {
722
738
  id: string | number;
723
739
  name: string;
@@ -738,12 +754,23 @@ declare interface StepProps {
738
754
  direction?: 'vertical' | 'horizontal';
739
755
  }
740
756
 
741
- export declare const Table: ({ captionAlign, captionSide, children }: TableProps) => JSX.Element;
757
+ export declare const Table: <T extends object>({ columns, data, caption, getRowId, }: TableProps<T>) => JSX.Element;
742
758
 
743
- declare interface TableProps {
744
- captionAlign?: 'left' | 'center' | 'right';
745
- captionSide?: 'top' | 'bottom';
746
- children?: default_2.ReactNode;
759
+ declare type TableColumn<T> = {
760
+ key: string;
761
+ label: string;
762
+ sortable?: boolean;
763
+ accessor?: (item: T) => string | number | null | undefined;
764
+ render?: (item: T) => default_2.ReactNode;
765
+ sortAccessor?: (item: T) => string | number | Date | null | undefined;
766
+ ariaLabel?: string;
767
+ };
768
+
769
+ declare interface TableProps<T> {
770
+ columns: TableColumn<T>[];
771
+ data: T[];
772
+ caption?: string;
773
+ getRowId?: (row: T, index: number) => default_2.Key;
747
774
  }
748
775
 
749
776
  export declare const Textarea: ({ id, onChange, onBlur, name, required, readOnly, disabled, width, resize, value, defaultValue, elementKey, rows, label, contentOnly, placeholder, defaultContent, "aria-describedby": ariaDescribedBy, hasErrors, errorMessage, }: TextareaProps) => JSX.Element;
@@ -757,7 +784,7 @@ declare interface TextareaProps {
757
784
  readOnly?: boolean;
758
785
  disabled?: boolean;
759
786
  width?: string;
760
- resize?: 'both' | 'horizontal' | 'vertical' | 'none';
787
+ resize?: "both" | "horizontal" | "vertical" | "none";
761
788
  value?: string;
762
789
  defaultValue?: string;
763
790
  elementKey?: string;
@@ -766,7 +793,7 @@ declare interface TextareaProps {
766
793
  contentOnly?: boolean;
767
794
  placeholder?: string;
768
795
  defaultContent?: string;
769
- 'aria-describedby'?: string;
796
+ "aria-describedby"?: string;
770
797
  hasErrors?: boolean;
771
798
  errorMessage?: default_2.ReactNode;
772
799
  }