@loadsmart/loadsmart-ui 8.0.5 → 8.0.7

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.
Files changed (64) hide show
  1. package/dist/DragDropFile.context.js +29 -0
  2. package/dist/DragDropFile.context.js.map +1 -0
  3. package/dist/components/Accordion/Accordion.d.ts +4 -3
  4. package/dist/components/Calendar/Calendar.types.d.ts +19 -19
  5. package/dist/components/DatePicker/DatePicker.types.d.ts +19 -19
  6. package/dist/components/Dialog/useDialog.d.ts +3 -3
  7. package/dist/components/DragDropFile/types.d.ts +27 -27
  8. package/dist/components/Drawer/Drawer.d.ts +13 -10
  9. package/dist/components/Dropdown/Dropdown.types.d.ts +19 -19
  10. package/dist/components/Dropdown/useDropdown.d.ts +6 -6
  11. package/dist/components/EmptyState/EmptyState.types.d.ts +18 -18
  12. package/dist/components/HighlightMatch/HighlightMatch.d.ts +2 -2
  13. package/dist/components/Modal/Modal.d.ts +12 -10
  14. package/dist/components/Pagination/Pagination.types.d.ts +20 -20
  15. package/dist/components/Popover/Popover.types.d.ts +6 -5
  16. package/dist/components/Select/Select.types.d.ts +32 -32
  17. package/dist/components/SideNavigation/Logo/Logo.d.ts +4 -3
  18. package/dist/components/SideNavigation/Menu/Menu.d.ts +3 -2
  19. package/dist/components/SideNavigation/Menu/MenuBaseItem.d.ts +2 -2
  20. package/dist/components/SideNavigation/Menu/MenuExpandable.d.ts +4 -3
  21. package/dist/components/SideNavigation/Menu/MenuLink.d.ts +2 -2
  22. package/dist/components/SideNavigation/SideNavigation.d.ts +2 -10
  23. package/dist/components/SideNavigation/useSideNavigation.d.ts +4 -4
  24. package/dist/components/Steps/ProgressSteps/ProgressStep.d.ts +2 -2
  25. package/dist/components/Steps/Steps.d.ts +3 -2
  26. package/dist/components/Steps/Steps.types.d.ts +3 -3
  27. package/dist/components/Steps/StepsStep.d.ts +3 -2
  28. package/dist/components/Steps/useSteps.d.ts +4 -4
  29. package/dist/components/Table/Selection.d.ts +9 -8
  30. package/dist/components/Table/Table.types.d.ts +33 -32
  31. package/dist/components/TablePagination/TablePagination.types.d.ts +17 -17
  32. package/dist/components/Tabs/Tabs.types.d.ts +2 -2
  33. package/dist/components/Tooltip/Tooltip.d.ts +3 -2
  34. package/dist/components/TopNavigation/Logo/Logo.d.ts +4 -3
  35. package/dist/components/TopNavigation/Menu/Menu.d.ts +7 -5
  36. package/dist/components/TopNavigation/Menu/MenuItemDropdown.d.ts +6 -5
  37. package/dist/hooks/useFocusTrap/useFocusTrap.d.ts +3 -3
  38. package/dist/hooks/useFocusWithin/useFocusWithin.d.ts +2 -2
  39. package/dist/hooks/useSelectable/useSelectable.types.d.ts +4 -4
  40. package/dist/index.js +7545 -8177
  41. package/dist/index.js.map +1 -1
  42. package/dist/styles/typography.d.ts +1 -1
  43. package/dist/testing/index.js +318 -219
  44. package/dist/testing/index.js.map +1 -1
  45. package/dist/themes.js +2322 -0
  46. package/dist/themes.js.map +1 -0
  47. package/dist/theming/index.js +10 -18
  48. package/dist/theming/index.js.map +1 -1
  49. package/dist/toArray.js +16 -0
  50. package/dist/toArray.js.map +1 -0
  51. package/dist/tools/index.js +2 -7
  52. package/dist/tools/vite-plugin-replace-jsx-runtime.d.ts +7 -0
  53. package/dist/tools.js +98 -0
  54. package/dist/tools.js.map +1 -0
  55. package/package.json +12 -11
  56. package/dist/DragDropFile.context-oKnUu6d3.js +0 -33
  57. package/dist/DragDropFile.context-oKnUu6d3.js.map +0 -1
  58. package/dist/miranda-compatibility.theme-CIu9fa89.js +0 -2528
  59. package/dist/miranda-compatibility.theme-CIu9fa89.js.map +0 -1
  60. package/dist/prop-Fs2axl9W.js +0 -75
  61. package/dist/prop-Fs2axl9W.js.map +0 -1
  62. package/dist/toArray-BJJzFRD1.js +0 -13
  63. package/dist/toArray-BJJzFRD1.js.map +0 -1
  64. package/dist/tools/index.js.map +0 -1
@@ -6,43 +6,43 @@ import { useSelectableReturn } from '../../hooks/useSelectable/useSelectable.typ
6
6
  import { ChangeEvent, ComponentType, FocusEvent, HTMLAttributes, ReactNode } from 'react';
7
7
  export type Option = Selectable;
8
8
  export interface GenericOption {
9
- label: string;
10
- value: SelectableKeyType;
9
+ readonly label: string;
10
+ readonly value: SelectableKeyType;
11
11
  }
12
12
  export interface SelectableOption extends GenericOption {
13
- checked: boolean;
13
+ readonly checked: boolean;
14
14
  }
15
15
  export interface SelectableOptionProps {
16
- role: string;
17
- 'aria-selected': boolean;
18
- id: string;
19
- onClick: () => boolean | undefined;
20
- tabIndex: number;
16
+ readonly role: string;
17
+ readonly 'aria-selected': boolean;
18
+ readonly id: string;
19
+ readonly onClick: () => boolean | undefined;
20
+ readonly tabIndex: number;
21
21
  }
22
22
  export interface CreatableProps {
23
- onClick: () => void;
24
- tabIndex: number;
23
+ readonly onClick: () => void;
24
+ readonly tabIndex: number;
25
25
  }
26
26
  export type OptionKeyType = SelectableKeyType;
27
27
  export type SelectValue = SelectableState<Option>;
28
28
  export interface SelectAdapter<T> extends SelectableAdapter<T> {
29
- getLabel: (o: T) => string;
29
+ readonly getLabel: (o: T) => string;
30
30
  }
31
31
  export type Adapters = Record<string, SelectAdapter<any>>;
32
32
  export interface SelectDatasource<T> {
33
- type: string;
34
- adapter: SelectAdapter<T>;
35
- fetch: ({ query, regex }: {
33
+ readonly type: string;
34
+ readonly adapter: SelectAdapter<T>;
35
+ readonly fetch: ({ query, regex }: {
36
36
  query: string;
37
37
  regex: RegExp;
38
38
  }) => T[] | Promise<T[]>;
39
39
  }
40
40
  export type SelectDatasourceFunction<T> = () => SelectDatasource<T>;
41
41
  export interface SelectComponentsOptionProps {
42
- value: SelectOptionProps['value'];
42
+ readonly value: SelectOptionProps['value'];
43
43
  }
44
44
  export interface SelectComponentsEmptyProps {
45
- children: SelectEmptyProps['children'];
45
+ readonly children: SelectEmptyProps['children'];
46
46
  }
47
47
  export type CreatableOptionType = () => ReactNode | null;
48
48
  export interface Components {
@@ -55,27 +55,27 @@ export type OnChange = (event: EventLike<Option | Option[] | null>) => void;
55
55
  export type OnCreate = (query: string) => Promise<void | Option> | void | Option;
56
56
  export type OnQueryChange = (e: ChangeEvent<HTMLInputElement>) => void;
57
57
  export interface SelectProps extends DropdownProps {
58
- name: string;
59
- placeholder?: string;
60
- value?: Option | Option[] | null;
61
- multiple?: boolean;
62
- autoFocus?: boolean;
63
- datasources?: SelectDatasourceFunction<any>[];
64
- options?: GenericOption[];
65
- components?: Components;
66
- onChange?: OnChange;
67
- onCreate?: OnCreate;
68
- onQueryChange?: OnQueryChange;
69
- getInputProps?: () => Partial<TextFieldProps>;
70
- isValidNewOption?: ((query: string) => boolean) | boolean;
71
- createOptionPosition?: CreateOptionPosition;
58
+ readonly name: string;
59
+ readonly placeholder?: string;
60
+ readonly value?: Option | Option[] | null;
61
+ readonly multiple?: boolean;
62
+ readonly autoFocus?: boolean;
63
+ readonly datasources?: SelectDatasourceFunction<any>[];
64
+ readonly options?: GenericOption[];
65
+ readonly components?: Components;
66
+ readonly onChange?: OnChange;
67
+ readonly onCreate?: OnCreate;
68
+ readonly onQueryChange?: OnQueryChange;
69
+ readonly getInputProps?: () => Partial<TextFieldProps>;
70
+ readonly isValidNewOption?: ((query: string) => boolean) | boolean;
71
+ readonly createOptionPosition?: CreateOptionPosition;
72
72
  /**
73
73
  * Hide the clear button on the Single Select.
74
74
  */
75
- hideClear?: boolean;
75
+ readonly hideClear?: boolean;
76
76
  }
77
77
  export type SelectOptionProps = {
78
- value: SelectableKeyType;
78
+ readonly value: SelectableKeyType;
79
79
  } & Omit<DropdownMenuItemProps, keyof SelectableOptionProps | 'value'>;
80
80
  export type SelectEmptyProps = HTMLAttributes<HTMLDivElement>;
81
81
  export type SelectCreatableOptionProps = Omit<DropdownMenuItemProps, keyof CreatableProps>;
@@ -1,9 +1,10 @@
1
- import { default as React, PropsWithChildren } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  import { StyledComponent } from 'styled-components';
3
- export type LogoProps = PropsWithChildren<{
3
+ export interface LogoProps {
4
4
  readonly url: string;
5
5
  readonly className?: string;
6
- }>;
6
+ readonly children?: ReactNode;
7
+ }
7
8
  declare function Logo({ className, url, children }: LogoProps): React.JSX.Element;
8
9
  declare const _default: StyledComponent<typeof Logo, any, LogoProps, never>;
9
10
  export default _default;
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren, default as React } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  import { MenuExpandableProps } from './MenuExpandable';
3
3
  import { MenuLinkProps } from './MenuLink';
4
4
  import { StyledComponentBase, StyledComponent } from 'styled-components';
@@ -9,7 +9,8 @@ export interface MenuProps extends React.HTMLAttributes<HTMLDivElement> {
9
9
  declare function Menu({ label, children, ...props }: MenuProps): React.JSX.Element;
10
10
  type MenuItemProps = {
11
11
  readonly active?: boolean;
12
- } & PropsWithChildren<MenuLinkProps & MenuExpandableProps>;
12
+ readonly children?: ReactNode;
13
+ } & MenuLinkProps & MenuExpandableProps;
13
14
  declare function MenuItem(props: MenuItemProps): React.JSX.Element;
14
15
  declare const _default: string & StyledComponentBase<typeof Menu, any, {}, never> & NonReactStatics<typeof Menu, {}> & {
15
16
  Item: typeof MenuItem;
@@ -1,11 +1,11 @@
1
1
  import { default as React, ReactNode, HTMLAttributes } from 'react';
2
2
  import { MenuLinkProps } from './MenuLink';
3
- export type MenuBaseItemProps = HTMLAttributes<HTMLElement> & {
3
+ export interface MenuBaseItemProps extends HTMLAttributes<HTMLElement> {
4
4
  readonly label: string;
5
5
  readonly leading?: ReactNode;
6
6
  readonly trailing?: ReactNode;
7
7
  readonly url?: string;
8
8
  readonly subItems?: MenuLinkProps[];
9
- };
9
+ }
10
10
  declare function MenuBaseItem({ label, leading, trailing, ...props }: MenuBaseItemProps): React.JSX.Element;
11
11
  export default MenuBaseItem;
@@ -1,6 +1,7 @@
1
- import { default as React, PropsWithChildren, HTMLAttributes } from 'react';
2
- export type MenuExpandableProps = HTMLAttributes<HTMLDivElement> & PropsWithChildren<{
1
+ import { default as React, ReactNode, HTMLAttributes } from 'react';
2
+ export interface MenuExpandableProps extends HTMLAttributes<HTMLDivElement> {
3
3
  readonly label: string;
4
- }>;
4
+ readonly children?: ReactNode;
5
+ }
5
6
  declare function MenuExpandable({ label, children, ...props }: MenuExpandableProps): React.JSX.Element;
6
7
  export default MenuExpandable;
@@ -1,11 +1,11 @@
1
1
  import { default as React, ReactNode } from 'react';
2
2
  import { StyledComponent } from 'styled-components';
3
- export type MenuLinkProps = React.HTMLAttributes<HTMLAnchorElement> & {
3
+ export interface MenuLinkProps extends React.HTMLAttributes<HTMLAnchorElement> {
4
4
  readonly label: string;
5
5
  readonly leading?: ReactNode;
6
6
  readonly trailing?: ReactNode;
7
7
  readonly url?: string;
8
- };
8
+ }
9
9
  declare function MenuLink({ url, ...props }: MenuLinkProps): React.JSX.Element;
10
10
  declare const _default: StyledComponent<typeof MenuLink, any, {}, never>;
11
11
  export default _default;
@@ -9,16 +9,8 @@ declare namespace SideNavigation {
9
9
  var Menu: string & import("styled-components").StyledComponentBase<({ label, children, ...props }: import("./Menu/Menu").MenuProps) => React.JSX.Element, any, {}, never> & import("hoist-non-react-statics").NonReactStatics<({ label, children, ...props }: import("./Menu/Menu").MenuProps) => React.JSX.Element, {}> & {
10
10
  Item: (props: {
11
11
  readonly active?: boolean;
12
- } & React.HTMLAttributes<HTMLAnchorElement> & {
13
- readonly label: string;
14
- readonly leading?: ReactNode;
15
- readonly trailing?: ReactNode;
16
- readonly url?: string;
17
- } & React.HTMLAttributes<HTMLDivElement> & {
18
- readonly label: string;
19
- } & {
20
- children?: ReactNode | undefined;
21
- }) => React.JSX.Element;
12
+ readonly children?: ReactNode;
13
+ } & import("./Menu/MenuLink").MenuLinkProps & import("./Menu/MenuExpandable").MenuExpandableProps) => React.JSX.Element;
22
14
  SubItem: import("styled-components").StyledComponent<({ url, ...props }: import("./Menu/MenuLink").MenuLinkProps) => React.JSX.Element, any, {}, never>;
23
15
  };
24
16
  var Separator: typeof import("./Separator").Separator;
@@ -1,8 +1,8 @@
1
1
  export interface useSideNavigationProps {
2
- open: boolean;
3
- show: () => void;
4
- hide: () => void;
5
- toggle: () => void;
2
+ readonly open: boolean;
3
+ readonly show: () => void;
4
+ readonly hide: () => void;
5
+ readonly toggle: () => void;
6
6
  }
7
7
  declare function useSideNavigation(): useSideNavigationProps;
8
8
  export default useSideNavigation;
@@ -1,8 +1,8 @@
1
1
  import { ReactNode, default as React } from 'react';
2
2
  import { Step } from '../Steps.types';
3
3
  export interface StepsProgressProps {
4
- steps: Array<Step>;
5
- current: number | string;
4
+ readonly steps: Array<Step>;
5
+ readonly current: number | string;
6
6
  }
7
7
  declare function ProgressStep(props: {
8
8
  readonly step: Step;
@@ -1,4 +1,4 @@
1
- import { default as React, PropsWithChildren } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  import { default as StepsStep } from './StepsStep';
3
3
  import { ColorScheme } from '../../utils/types/ColorScheme';
4
4
  import { Step } from './Steps.types';
@@ -8,8 +8,9 @@ export interface StepsProps {
8
8
  readonly steps: Array<Step>;
9
9
  readonly className?: string;
10
10
  readonly scheme?: ColorScheme;
11
+ readonly children?: ReactNode;
11
12
  }
12
- declare function Steps({ id, children, current, steps, ...others }: PropsWithChildren<StepsProps>): React.JSX.Element;
13
+ declare function Steps({ id, children, current, steps, ...others }: StepsProps): React.JSX.Element;
13
14
  declare namespace Steps {
14
15
  var Step: typeof StepsStep;
15
16
  }
@@ -1,5 +1,5 @@
1
1
  export interface Step {
2
- id: number | string;
3
- label: string;
4
- complete: boolean;
2
+ readonly id: number | string;
3
+ readonly label: string;
4
+ readonly complete: boolean;
5
5
  }
@@ -1,9 +1,10 @@
1
- import { default as React, PropsWithChildren } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  import { StyledComponent } from 'styled-components';
3
3
  export interface StepsStepProps {
4
4
  readonly id: number | string;
5
5
  readonly className?: string;
6
+ readonly children?: ReactNode;
6
7
  }
7
8
  export declare const StepWrapper: StyledComponent<"article", any, {}, never>;
8
- declare function StepsStep({ children, id, ...others }: PropsWithChildren<StepsStepProps>): React.JSX.Element;
9
+ declare function StepsStep({ children, id, ...others }: StepsStepProps): React.JSX.Element;
9
10
  export default StepsStep;
@@ -1,12 +1,12 @@
1
1
  import { Dispatch } from 'react';
2
2
  import { Step } from './Steps.types';
3
3
  export interface useStepsProps {
4
- steps: Array<Step>;
5
- current?: number | string;
4
+ readonly steps: Array<Step>;
5
+ readonly current?: number | string;
6
6
  }
7
7
  interface State {
8
- current: number | string;
9
- steps: Array<Step>;
8
+ readonly current: number | string;
9
+ readonly steps: Array<Step>;
10
10
  }
11
11
  type Action = {
12
12
  type: 'navigate';
@@ -1,12 +1,12 @@
1
- import { default as React, PropsWithChildren } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  import { Selectable, SelectableState } from '../../hooks/useSelectable';
3
3
  import { useSelectableProps } from '../../hooks/useSelectable/useSelectable.types';
4
- export type TableSelectableRow = Selectable & {
4
+ export interface TableSelectableRow extends Selectable {
5
5
  value?: string | number | boolean;
6
- };
7
- export type TableSelectionSelectable<T extends Selectable = TableSelectableRow> = Omit<useSelectableProps<T>, 'onChange'> & {
6
+ }
7
+ export interface TableSelectionSelectable<T extends Selectable = TableSelectableRow> extends Omit<useSelectableProps<T>, 'onChange'> {
8
8
  onChange: (selected: T[]) => void;
9
- };
9
+ }
10
10
  export type TableSelectionConfig<T extends Selectable = TableSelectableRow> = boolean | Partial<TableSelectionSelectable<T>>;
11
11
  export interface TableSelectionCore<T extends Selectable = TableSelectableRow> {
12
12
  selected?: SelectableState<T>;
@@ -18,10 +18,11 @@ export interface TableSelectionCore<T extends Selectable = TableSelectableRow> {
18
18
  register: (key?: T) => void;
19
19
  }
20
20
  export declare function useTableSelectionCore<T extends Selectable>(config?: TableSelectionConfig<T>): TableSelectionCore<T>;
21
- export declare const TableSelectionContext: React.Context<TableSelectionCore<any>>;
22
- type TableSelectionProviderProps = PropsWithChildren<{
21
+ export declare const TableSelectionContext: React.Context<TableSelectionCore<TableSelectableRow>>;
22
+ interface TableSelectionProviderProps {
23
23
  readonly selection?: TableSelectionConfig;
24
- }>;
24
+ readonly children?: ReactNode;
25
+ }
25
26
  export declare function TableSelectionProvider({ children, selection }: TableSelectionProviderProps): React.JSX.Element;
26
27
  export declare function useTableSelection<T extends Selectable = TableSelectableRow>(): TableSelectionCore<T>;
27
28
  interface TableSelectionHook<T extends Selectable = TableSelectableRow> {
@@ -1,72 +1,73 @@
1
1
  import { Selectable } from '../../hooks/useSelectable';
2
- import { ComponentType, HTMLAttributes, PropsWithChildren, ReactNode } from 'react';
2
+ import { ComponentType, HTMLAttributes, ReactNode } from 'react';
3
3
  import { DropdownMenuItemProps, DropdownMenuProps } from '../Dropdown';
4
4
  import { DropdownTriggerButtonProps } from '../Dropdown/DropdownTrigger';
5
5
  import { TableSelectableRow, TableSelectionConfig } from './Selection';
6
6
  type Scale = 'default' | 'small' | 'large';
7
7
  export interface TableProps<T extends Selectable = TableSelectableRow> extends HTMLAttributes<HTMLTableElement> {
8
- scale?: Scale;
9
- selection?: TableSelectionConfig<T>;
8
+ readonly scale?: Scale;
9
+ readonly selection?: TableSelectionConfig<T>;
10
10
  }
11
11
  export interface TableCaptionProps extends HTMLAttributes<HTMLTableCaptionElement> {
12
- position?: 'top' | 'bottom';
13
- height?: number;
12
+ readonly position?: 'top' | 'bottom';
13
+ readonly height?: number;
14
14
  }
15
15
  export interface TableSelectionProps extends HTMLAttributes<HTMLDivElement> {
16
- buttons: ComponentType<{
16
+ readonly buttons: ComponentType<{
17
17
  values: TableSelectableRow[];
18
18
  }>[];
19
19
  }
20
20
  export interface SelectionCellProps<T extends TableSelectableRow = TableSelectableRow> extends Omit<HTMLAttributes<HTMLTableCellElement>, 'children'> {
21
- value?: T;
22
- children?: (props: {
21
+ readonly value?: T;
22
+ readonly children?: (props: {
23
23
  selected: boolean;
24
24
  toggle: () => void;
25
25
  }) => ReactNode;
26
26
  }
27
27
  export interface TableSectionProps extends HTMLAttributes<HTMLTableSectionElement> {
28
- scale?: Scale;
28
+ readonly scale?: Scale;
29
29
  }
30
30
  export type TableRowProps = HTMLAttributes<HTMLTableRowElement>;
31
- export type ExpandableTableRowProps = TableRowProps & {
32
- expandableContent?: ReactNode;
33
- leading?: ReactNode | ((expanded: boolean) => ReactNode);
34
- initialExpanded?: boolean;
35
- expanded?: boolean;
36
- onExpandedChange?: (expanded: boolean) => void;
37
- };
31
+ export interface ExpandableTableRowProps extends TableRowProps {
32
+ readonly expandableContent?: ReactNode;
33
+ readonly leading?: ReactNode | ((expanded: boolean) => ReactNode);
34
+ readonly initialExpanded?: boolean;
35
+ readonly expanded?: boolean;
36
+ readonly onExpandedChange?: (expanded: boolean) => void;
37
+ }
38
38
  export interface TableCellProps extends HTMLAttributes<HTMLTableCellElement> {
39
- alignment?: 'left' | 'right';
40
- format?: 'default' | 'number' | 'currency';
41
- columnWidth?: string;
42
- scale?: Scale;
43
- selected?: boolean;
39
+ readonly alignment?: 'left' | 'right';
40
+ readonly format?: 'default' | 'number' | 'currency';
41
+ readonly columnWidth?: string;
42
+ readonly scale?: Scale;
43
+ readonly selected?: boolean;
44
44
  }
45
45
  export interface TableColumn<T = Record<string, unknown>> {
46
46
  /**
47
47
  * The accessor of you entry interface
48
48
  */
49
- key: Exclude<keyof T, symbol>;
49
+ readonly key: Exclude<keyof T, symbol>;
50
50
  /**
51
51
  * The label that should go in the Header cell
52
52
  */
53
- title: ReactNode;
53
+ readonly title: ReactNode;
54
54
  /**
55
55
  * The text of the Dropdown.Item
56
56
  * If omitted, `title` is used
57
57
  */
58
- option?: string;
58
+ readonly option?: string;
59
59
  }
60
60
  export type TableColumns<T> = Array<TableColumn<T>>;
61
61
  export interface TablePickerItemProps<T> extends DropdownMenuItemProps {
62
- option?: TableColumn<T>;
63
- checked?: boolean;
62
+ readonly option?: TableColumn<T>;
63
+ readonly checked?: boolean;
64
64
  }
65
- export interface TablePickerProps<T> extends PropsWithChildren<Partial<Omit<DropdownTriggerButtonProps, 'onChange' | 'value' | 'children'>>> {
66
- value?: TableColumn<T>;
67
- onChange?: (value: TableColumn<T>) => void;
68
- options?: TableColumns<T>;
69
- trigger?: ReactNode | ((expanded: boolean) => ReactNode);
70
- align?: DropdownMenuProps['align'];
65
+ export interface TablePickerProps<T> extends Partial<Omit<DropdownTriggerButtonProps, 'onChange' | 'value' | 'children'>> {
66
+ readonly value?: TableColumn<T>;
67
+ readonly onChange?: (value: TableColumn<T>) => void;
68
+ readonly options?: TableColumns<T>;
69
+ readonly trigger?: ReactNode | ((expanded: boolean) => ReactNode);
70
+ readonly align?: DropdownMenuProps['align'];
71
+ readonly children?: ReactNode;
71
72
  }
72
73
  export {};
@@ -5,55 +5,55 @@ export interface TablePaginationProps extends GroupProps {
5
5
  * The pagination variant
6
6
  * @default 'default'
7
7
  */
8
- variant?: 'compact' | 'default';
8
+ readonly variant?: 'compact' | 'default';
9
9
  /**
10
10
  * The total number of paginated items
11
11
  */
12
- count: number;
12
+ readonly count: number;
13
13
  /**
14
14
  * Customize the rows per page label.
15
15
  * @default 'Rows per page:'
16
16
  */
17
- labelRowsPerPage?: string;
17
+ readonly labelRowsPerPage?: string;
18
18
  /**
19
19
  * Callback fired when the page is changed.
20
20
  */
21
- onPageChange: (page: number) => void;
21
+ readonly onPageChange: (page: number) => void;
22
22
  /**
23
23
  * Callback fired when the number of rows per page is changed.
24
24
  *
25
25
  * Note: Resetting the page to zero after the number of rows per page is changed isn't part of
26
26
  * the component and has to be implemented where it's necessary
27
27
  */
28
- onRowsPerPageChange: (rowsPerPage: number) => void;
28
+ readonly onRowsPerPageChange: (rowsPerPage: number) => void;
29
29
  /**
30
30
  * The number of rows per page.
31
31
  * @default 50
32
32
  */
33
- rowsPerPage?: number;
33
+ readonly rowsPerPage?: number;
34
34
  /**
35
35
  * The zero-based index of the current page.
36
36
  */
37
- page: number;
37
+ readonly page: number;
38
38
  /**
39
39
  * Customizes the options of the rows per page select field.
40
40
  * @default [10, 25, 50, 100]
41
41
  */
42
- rowsPerPageOptions?: number[];
42
+ readonly rowsPerPageOptions?: number[];
43
43
  /**
44
44
  * Disable all the pagination actions
45
45
  */
46
- disabled?: boolean;
46
+ readonly disabled?: boolean;
47
47
  /**
48
48
  * Customizes the placement of the rows per page select field.
49
49
  * @default { position: 'bottom', align: 'start' }
50
50
  */
51
- rowsPerPagePlacement?: PopoverPlacement;
51
+ readonly rowsPerPagePlacement?: PopoverPlacement;
52
+ }
53
+ export interface TablePaginationActionsProps extends Omit<TablePaginationProps, 'labelRowsPerPage' | 'onRowsPerPageChange' | 'rowsPerPageOptions' | 'rowsPerPage'> {
54
+ readonly rowsPerPage: number;
55
+ }
56
+ export interface RowsPerPageProps extends Omit<TablePaginationProps, 'rowsPerPageOptions' | 'onPageChange' | 'rowsPerPage' | 'align'>, PopoverPlacement {
57
+ readonly rowsPerPageOptions: number[];
58
+ readonly rowsPerPage: number;
52
59
  }
53
- export type TablePaginationActionsProps = Omit<TablePaginationProps, 'labelRowsPerPage' | 'onRowsPerPageChange' | 'rowsPerPageOptions' | 'rowsPerPage'> & {
54
- rowsPerPage: number;
55
- };
56
- export type RowsPerPageProps = Omit<TablePaginationProps, 'rowsPerPageOptions' | 'onPageChange' | 'rowsPerPage' | 'align'> & PopoverPlacement & {
57
- rowsPerPageOptions: number[];
58
- rowsPerPage: number;
59
- };
@@ -1,6 +1,6 @@
1
1
  export interface WithDirectionProps {
2
- direction?: 'horizontal' | 'vertical';
2
+ readonly direction?: 'horizontal' | 'vertical';
3
3
  }
4
4
  export interface WithActiveProps {
5
- $active?: boolean;
5
+ readonly $active?: boolean;
6
6
  }
@@ -1,4 +1,4 @@
1
- import { default as React, PropsWithChildren, HTMLAttributes, ReactNode } from 'react';
1
+ import { default as React, HTMLAttributes, ReactNode } from 'react';
2
2
  import { ColorScheme } from '../../utils/types/ColorScheme';
3
3
  import { PopoverAlign, PopoverPosition } from '../Popover';
4
4
  export declare enum TooltipPosition {
@@ -17,6 +17,7 @@ export interface TooltipProps extends HTMLAttributes<HTMLDivElement> {
17
17
  readonly scheme?: ColorScheme;
18
18
  readonly position?: TooltipPosition | PopoverPosition;
19
19
  readonly align?: TooltipAlign | PopoverAlign;
20
+ readonly children?: ReactNode;
20
21
  }
21
- declare function Tooltip({ children, message, scheme, position, align, ...rest }: PropsWithChildren<TooltipProps>): React.JSX.Element;
22
+ declare function Tooltip({ children, message, scheme, position, align, ...rest }: TooltipProps): React.JSX.Element;
22
23
  export default Tooltip;
@@ -1,9 +1,10 @@
1
- import { default as React, PropsWithChildren } from 'react';
1
+ import { default as React, ReactNode } from 'react';
2
2
  import { StyledComponent } from 'styled-components';
3
- export type LogoProps = PropsWithChildren<{
3
+ export interface LogoProps {
4
4
  readonly url: string;
5
5
  readonly className?: string;
6
- }>;
6
+ readonly children?: ReactNode;
7
+ }
7
8
  declare function Logo({ url, className, children }: LogoProps): React.JSX.Element;
8
9
  declare const _default: StyledComponent<typeof Logo, any, LogoProps, never>;
9
10
  export default _default;
@@ -1,13 +1,15 @@
1
- import { default as React, PropsWithChildren, ReactNode, HTMLAttributes } from 'react';
1
+ import { default as React, ReactNode, HTMLAttributes } from 'react';
2
2
  import { MenuDropdownSubItem } from './MenuItemDropdown';
3
- type MenuItemProps = HTMLAttributes<HTMLElement> & PropsWithChildren<{
3
+ interface MenuItemProps extends HTMLAttributes<HTMLElement> {
4
4
  readonly label: string;
5
5
  readonly icon?: ReactNode;
6
6
  readonly url?: string;
7
- }>;
8
- export type MenuProps = PropsWithChildren<{
7
+ readonly children?: ReactNode;
8
+ }
9
+ export interface MenuProps {
9
10
  readonly align?: 'left' | 'right';
10
- }>;
11
+ readonly children?: ReactNode;
12
+ }
11
13
  declare function MenuItem({ children, ...props }: MenuItemProps): React.JSX.Element;
12
14
  declare function Menu({ align, children }: MenuProps): React.JSX.Element;
13
15
  declare namespace Menu {
@@ -1,17 +1,18 @@
1
- import { default as React, PropsWithChildren, ReactNode, HTMLAttributes } from 'react';
1
+ import { default as React, ReactNode, HTMLAttributes } from 'react';
2
2
  import { StyledComponent } from 'styled-components';
3
3
  export declare const MenuDropdown: StyledComponent<any, any, any, any>;
4
4
  export declare const MenuDropdownSeparator: StyledComponent<"hr", any, {}, never>;
5
5
  export declare const MenuDropdownLabel: StyledComponent<"label", any, {}, never>;
6
- type MenuDropdownSubItemProps = HTMLAttributes<HTMLElement> & {
6
+ interface MenuDropdownSubItemProps extends HTMLAttributes<HTMLElement> {
7
7
  readonly label: string;
8
8
  readonly url?: string;
9
9
  readonly icon?: ReactNode;
10
10
  readonly separator?: boolean;
11
- };
11
+ }
12
12
  export declare function MenuDropdownSubItem({ icon, label, url, ...rest }: MenuDropdownSubItemProps): React.JSX.Element;
13
- export type MenuItemDropdownProps = PropsWithChildren<{
13
+ export interface MenuItemDropdownProps {
14
14
  readonly label: string;
15
- }>;
15
+ readonly children?: ReactNode;
16
+ }
16
17
  declare function MenuItemDropdown(props: MenuItemDropdownProps): React.JSX.Element;
17
18
  export { MenuItemDropdown };
@@ -1,8 +1,8 @@
1
1
  import { SupportedKey } from '../../utils/toolset/keyboard';
2
2
  export interface useFocusTrapProps {
3
- onActivate?: () => void;
4
- onDeactivate?: () => void;
5
- keys?: SupportedKey[];
3
+ readonly onActivate?: () => void;
4
+ readonly onDeactivate?: () => void;
5
+ readonly keys?: readonly SupportedKey[];
6
6
  }
7
7
  /**
8
8
  * Custom hook that limits the focusable elements within a container, when activated.
@@ -1,7 +1,7 @@
1
1
  import { RefObject } from 'react';
2
2
  export interface useFocusWithinProps {
3
- onFocus?: () => void;
4
- onBlur?: () => void;
3
+ readonly onFocus?: () => void;
4
+ readonly onBlur?: () => void;
5
5
  }
6
6
  /**
7
7
  * As CSS's focus-within is not fully supported, this hook
@@ -39,8 +39,8 @@ export interface useSelectableReturn<T extends Selectable> {
39
39
  clear: () => void;
40
40
  }
41
41
  export interface useSelectableProps<T extends Selectable> {
42
- selected: T | T[];
43
- multiple?: boolean;
44
- onChange?: (selected: SelectableState<T>) => void;
45
- adapters?: Record<string, SelectableAdapter<T>>;
42
+ readonly selected: T | T[];
43
+ readonly multiple?: boolean;
44
+ readonly onChange?: (selected: SelectableState<T>) => void;
45
+ readonly adapters?: Record<string, SelectableAdapter<T>>;
46
46
  }