@loadsmart/loadsmart-ui 8.0.4 → 8.0.6

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 (43) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +4 -3
  2. package/dist/components/Calendar/Calendar.types.d.ts +19 -19
  3. package/dist/components/Calendar/index.d.ts +1 -1
  4. package/dist/components/DatePicker/DatePicker.types.d.ts +19 -19
  5. package/dist/components/Dialog/useDialog.d.ts +3 -3
  6. package/dist/components/DragDropFile/types.d.ts +27 -27
  7. package/dist/components/Drawer/Drawer.d.ts +13 -10
  8. package/dist/components/Dropdown/Dropdown.types.d.ts +19 -19
  9. package/dist/components/Dropdown/useDropdown.d.ts +6 -6
  10. package/dist/components/EmptyState/EmptyState.types.d.ts +18 -18
  11. package/dist/components/HighlightMatch/HighlightMatch.d.ts +2 -2
  12. package/dist/components/Modal/Modal.d.ts +12 -10
  13. package/dist/components/Pagination/Pagination.types.d.ts +20 -20
  14. package/dist/components/Popover/Popover.types.d.ts +6 -5
  15. package/dist/components/Select/Select.types.d.ts +32 -32
  16. package/dist/components/SideNavigation/Logo/Logo.d.ts +4 -3
  17. package/dist/components/SideNavigation/Menu/Menu.d.ts +3 -2
  18. package/dist/components/SideNavigation/Menu/MenuBaseItem.d.ts +2 -2
  19. package/dist/components/SideNavigation/Menu/MenuExpandable.d.ts +4 -3
  20. package/dist/components/SideNavigation/Menu/MenuLink.d.ts +2 -2
  21. package/dist/components/SideNavigation/SideNavigation.d.ts +2 -10
  22. package/dist/components/SideNavigation/useSideNavigation.d.ts +4 -4
  23. package/dist/components/Steps/ProgressSteps/ProgressStep.d.ts +2 -2
  24. package/dist/components/Steps/Steps.d.ts +3 -2
  25. package/dist/components/Steps/Steps.types.d.ts +3 -3
  26. package/dist/components/Steps/StepsStep.d.ts +3 -2
  27. package/dist/components/Steps/useSteps.d.ts +4 -4
  28. package/dist/components/Table/Selection.d.ts +9 -8
  29. package/dist/components/Table/Table.types.d.ts +33 -32
  30. package/dist/components/Table/index.d.ts +1 -0
  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.d.ts +5 -4
  41. package/dist/index.js +10 -9
  42. package/dist/index.js.map +1 -1
  43. package/package.json +9 -9
@@ -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 {};
@@ -1,3 +1,4 @@
1
1
  export { default as Table } from './Table';
2
2
  export type { TableProps, TableCellProps, TableRowProps, TableSectionProps, TableCaptionProps, TableSelectionProps, SelectionCellProps, ExpandableTableRowProps, } from './Table.types';
3
3
  export type { TableSelectableRow, TableSelectionSelectable, TableSelectionConfig, TableSelectionCore, } from './Selection';
4
+ export type { SortDirection, SortState, TableRowGroup, ColumnGroup, SortableColumn, } from './useSortBy.types';
@@ -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
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export type { Selectable, SelectableKeyType, SelectableAdapter, SelectableState, SelectableType, SelectableStrategy, SelectableAction, useSelectableReturn, useSelectableProps, } from './hooks/useSelectable';
2
2
  export type { default as EventLike, EventLikeTarget } from './utils/types/EventLike';
3
+ export { default as Status } from './utils/types/Status';
3
4
  export { Button, BaseButton, SelectorButton, IconButton, Caret } from './components/Button';
4
5
  export { default as CloseButton } from './common/CloseButton';
5
6
  export { default as BackButton } from './common/BackButton';
@@ -59,13 +60,13 @@ export type { PopoverProps, PopoverAlign, PopoverPosition, PopoverFloatingProps,
59
60
  export { Dropdown, useDropdown, DropdownContext } from './components/Dropdown';
60
61
  export type { DropdownProps, useDropdownProps, useDropdownReturn, GenericDropdownProps, DropdownTriggerProps, DropdownMenuProps, DropdownMenuItemProps, DropdownMenuSectionProps, DropdownContextReturn, } from './components/Dropdown';
61
62
  export { Select, useSelect } from './components/Select';
62
- export type { SelectProps, useSelectReturn, SelectOptionProps, SelectEmptyProps, GenericOption, Option, SelectableOption, SelectableOptionProps, CreatableProps, OptionKeyType, SelectValue, SelectAdapter, Adapters, SelectDatasource, } from './components/Select';
63
+ export type { SelectProps, useSelectReturn, SelectOptionProps, SelectEmptyProps, SelectOption, SelectOnChange, SelectOnCreate, SelectOnQueryChange, GenericOption, SelectableOption, SelectableOptionProps, CreatableProps, OptionKeyType, SelectValue, SelectAdapter, Adapters, SelectDatasource, Option, } from './components/Select';
63
64
  export { SideNavigation, useSideNavigation } from './components/SideNavigation';
64
65
  export type { SideNavigationProps, useSideNavigationProps } from './components/SideNavigation';
65
66
  export { Drawer, useDrawer } from './components/Drawer';
66
67
  export type { DrawerProps, DrawerBodyProps, DrawerFooterProps, DrawerHeaderProps, } from './components/Drawer';
67
68
  export { Table } from './components/Table';
68
- export type { TableProps, TableCellProps, TableRowProps, TableSectionProps, TableCaptionProps, TableSelectionProps, SelectionCellProps, ExpandableTableRowProps, TableSelectableRow, TableSelectionSelectable, TableSelectionConfig, TableSelectionCore, } from './components/Table';
69
+ export type { TableProps, TableCellProps, TableRowProps, TableSectionProps, TableCaptionProps, TableSelectionProps, SelectionCellProps, ExpandableTableRowProps, TableSelectableRow, TableSelectionSelectable, TableSelectionConfig, TableSelectionCore, SortDirection, SortState, TableRowGroup, ColumnGroup, SortableColumn, } from './components/Table';
69
70
  export { Text } from './components/Text';
70
71
  export type { TextProps } from './components/Text';
71
72
  export { TopNavigation } from './components/TopNavigation';
@@ -81,7 +82,7 @@ export type { SwitcherProps } from './components/Layout/Switcher';
81
82
  export type { GridProps } from './components/Layout/Grid';
82
83
  export type { Spacing, JustifyValue, AlignValue } from './components/Layout/Layout.types';
83
84
  export { Calendar, DateHelper, DateFormatHelper } from './components/Calendar';
84
- export type { CalendarProps, CalendarDate, CalendarDateRange, CalendarConstraint, DateFormat, CalendarMonth, CalendarMonthAlias, useCalendarProps, GenericCalendarProps, } from './components/Calendar';
85
+ export type { CalendarProps, CalendarDate, CalendarDateRange, CalendarConstraint, DateFormat, CalendarMonth, CalendarMonthAlias, useCalendarProps, GenericCalendarProps, InputDate, } from './components/Calendar';
85
86
  export { DatePicker, DateRangePicker } from './components/DatePicker';
86
87
  export type { DatePickerProps, DateRangePickerProps } from './components/DatePicker';
87
88
  export { Spinner } from './components/Loaders';
@@ -96,7 +97,7 @@ export { ErrorMessage } from './components/ErrorMessage';
96
97
  export type { ErrorMessageProps } from './components/ErrorMessage';
97
98
  export { DragDropFileProvider, useDragDropFileContext, } from './components/DragDropFile/DragDropFile.context';
98
99
  export { default as DragDropFile } from './components/DragDropFile/DragDropFile';
99
- export type { FileStatus, FileWithStatus, DropZoneProps, DragDropFileProviderProps, DragDropFileContextValue, } from './components/DragDropFile/types';
100
+ export type { FileStatus, FileWithStatus, DropZoneProps, DragDropFileProviderProps, DragDropFileContextValue, WrapperProps as DragDropFileWrapperProps, } from './components/DragDropFile/types';
100
101
  export { TablePagination } from './components/TablePagination';
101
102
  export type { TablePaginationProps } from './components/TablePagination';
102
103
  export { VisuallyHidden } from './components/VisuallyHidden';
package/dist/index.js CHANGED
@@ -14,6 +14,13 @@ import ReactDOM from "react-dom";
14
14
  import { useFloating, autoUpdate, offset, flip, shift, arrow } from "@floating-ui/react-dom";
15
15
  import { u as useDragDropFileContext } from "./DragDropFile.context-oKnUu6d3.js";
16
16
  import { a } from "./DragDropFile.context-oKnUu6d3.js";
17
+ var Status = /* @__PURE__ */ ((Status2) => {
18
+ Status2["Success"] = "success";
19
+ Status2["Danger"] = "danger";
20
+ Status2["Warn"] = "warn";
21
+ Status2["Neutral"] = "neutral";
22
+ return Status2;
23
+ })(Status || {});
17
24
  function transitionStyle(options) {
18
25
  return `
19
26
  transition-property: ${options?.property || "background, border-color, box-shadow, color, fill, left, stroke, transform, opacity"};
@@ -1471,13 +1478,6 @@ function useFocusWithin(props = {}) {
1471
1478
  focused
1472
1479
  };
1473
1480
  }
1474
- var Status = /* @__PURE__ */ ((Status2) => {
1475
- Status2["Success"] = "success";
1476
- Status2["Danger"] = "danger";
1477
- Status2["Warn"] = "warn";
1478
- Status2["Neutral"] = "neutral";
1479
- return Status2;
1480
- })(Status || {});
1481
1481
  const InputWrapper = styled.div.withConfig({
1482
1482
  displayName: "InputWrapper",
1483
1483
  componentId: "ls-ui__sc-zve05l-0"
@@ -5496,13 +5496,13 @@ function useDropdown({
5496
5496
  }
5497
5497
  setExpanded((isExpanded) => !isExpanded);
5498
5498
  }, [disabled, expandDisabled]);
5499
- const expand = useCallback(function toggle2() {
5499
+ const expand = useCallback(function expand2() {
5500
5500
  if (disabled || expandDisabled) {
5501
5501
  return;
5502
5502
  }
5503
5503
  setExpanded(true);
5504
5504
  }, [disabled, expandDisabled]);
5505
- const collapse = useCallback(function toggle2() {
5505
+ const collapse = useCallback(function collapse2() {
5506
5506
  if (disabled || expandDisabled) {
5507
5507
  return;
5508
5508
  }
@@ -9222,6 +9222,7 @@ export {
9222
9222
  SelectorButton,
9223
9223
  SideNavigation,
9224
9224
  Spinner,
9225
+ Status,
9225
9226
  Steps,
9226
9227
  Switch,
9227
9228
  Table,