@matthiaskrijgsman/mat-ui 0.0.28 → 0.0.29
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/components/inputs/InputIconButtonTray.d.ts +1 -1
- package/dist/components/inputs/InputSelect.d.ts +3 -6
- package/dist/components/inputs/InputSelectDivider.d.ts +3 -0
- package/dist/components/inputs/InputSelectGroupHeader.d.ts +5 -0
- package/dist/components/inputs/InputSelectMultiple.d.ts +22 -0
- package/dist/components/inputs/InputSelectOption.d.ts +3 -2
- package/dist/components/inputs/InputSelectSearchable.d.ts +4 -7
- package/dist/components/inputs/InputSelectSearchableAsync.d.ts +3 -6
- package/dist/components/inputs/select-item.d.ts +15 -0
- package/dist/control-size/control-size.util.d.ts +1 -0
- package/dist/hooks/use-overflow-fit.d.ts +12 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5488 -4394
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +39 -39
- package/dist/index.umd.cjs.map +1 -1
- package/dist/popover/PopoverBase.d.ts +3 -1
- package/dist/popover/use-select-popover.d.ts +28 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +4 -1
- package/package.json +2 -1
|
@@ -3,4 +3,4 @@ export type InputIconButtonTrayProps = {
|
|
|
3
3
|
children?: React.ReactNode;
|
|
4
4
|
className?: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const InputIconButtonTray:
|
|
6
|
+
export declare const InputIconButtonTray: React.ForwardRefExoticComponent<InputIconButtonTrayProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type SelectItem } from "@/components/inputs/select-item.ts";
|
|
2
3
|
export type Size = 'sm' | 'md' | 'lg';
|
|
3
4
|
export type InputSelectProps<T> = {
|
|
4
5
|
name?: string;
|
|
@@ -6,7 +7,7 @@ export type InputSelectProps<T> = {
|
|
|
6
7
|
className?: string;
|
|
7
8
|
label?: string | React.ReactNode;
|
|
8
9
|
description?: string | React.ReactNode;
|
|
9
|
-
options:
|
|
10
|
+
options: SelectItem<T>[];
|
|
10
11
|
value: T | null;
|
|
11
12
|
onChange: (value: T | null) => void;
|
|
12
13
|
placeholder?: string;
|
|
@@ -14,9 +15,5 @@ export type InputSelectProps<T> = {
|
|
|
14
15
|
error?: string | React.ReactNode;
|
|
15
16
|
size?: Size;
|
|
16
17
|
};
|
|
17
|
-
export type Option
|
|
18
|
-
label: string | React.ReactNode;
|
|
19
|
-
value: T;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
};
|
|
18
|
+
export type { Option, SelectGroupHeader, SelectDivider, SelectItem } from "@/components/inputs/select-item.ts";
|
|
22
19
|
export declare const InputSelect: <T>(props: InputSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface InputSelectGroupHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare const InputSelectGroupHeader: React.ForwardRefExoticComponent<InputSelectGroupHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type BadgeColorKey } from "@/components/BadgeColors.tsx";
|
|
3
|
+
import { type SelectItem } from "@/components/inputs/select-item.ts";
|
|
4
|
+
export type Size = 'sm' | 'md' | 'lg';
|
|
5
|
+
export type InputSelectMultipleProps<T> = {
|
|
6
|
+
name?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
label?: string | React.ReactNode;
|
|
10
|
+
description?: string | React.ReactNode;
|
|
11
|
+
options: SelectItem<T>[];
|
|
12
|
+
onSearch?: (search: string) => SelectItem<T>[];
|
|
13
|
+
value: T[];
|
|
14
|
+
onChange: (value: T[]) => void;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
maxHeight?: number;
|
|
17
|
+
error?: string | React.ReactNode;
|
|
18
|
+
size?: Size;
|
|
19
|
+
singleLine?: boolean;
|
|
20
|
+
color?: BadgeColorKey;
|
|
21
|
+
};
|
|
22
|
+
export declare const InputSelectMultiple: <T>(props: InputSelectMultipleProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export interface InputSelectOptionProps {
|
|
2
|
+
export interface InputSelectOptionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'> {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
selected: boolean;
|
|
5
5
|
disabled?: boolean;
|
|
6
|
+
active?: boolean;
|
|
6
7
|
onClick?: () => void;
|
|
7
8
|
}
|
|
8
|
-
export declare const InputSelectOption:
|
|
9
|
+
export declare const InputSelectOption: React.ForwardRefExoticComponent<InputSelectOptionProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type SelectItem } from "@/components/inputs/select-item.ts";
|
|
3
|
+
export type { Option } from "@/components/inputs/select-item.ts";
|
|
2
4
|
export type Size = 'sm' | 'md' | 'lg';
|
|
3
5
|
export type InputSelectSearchableProps<T> = {
|
|
4
6
|
name?: string;
|
|
@@ -6,8 +8,8 @@ export type InputSelectSearchableProps<T> = {
|
|
|
6
8
|
className?: string;
|
|
7
9
|
label?: string | React.ReactNode;
|
|
8
10
|
description?: string | React.ReactNode;
|
|
9
|
-
options:
|
|
10
|
-
onSearch: (search: string) =>
|
|
11
|
+
options: SelectItem<T>[];
|
|
12
|
+
onSearch: (search: string) => SelectItem<T>[];
|
|
11
13
|
value: T | null;
|
|
12
14
|
onChange: (value: T | null) => void;
|
|
13
15
|
placeholder?: string;
|
|
@@ -15,9 +17,4 @@ export type InputSelectSearchableProps<T> = {
|
|
|
15
17
|
error?: string | React.ReactNode;
|
|
16
18
|
size?: Size;
|
|
17
19
|
};
|
|
18
|
-
export type Option<T> = {
|
|
19
|
-
label: string | React.ReactNode;
|
|
20
|
-
value: T;
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
};
|
|
23
20
|
export declare const InputSelectSearchable: <T>(props: InputSelectSearchableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type Option, type SelectItem } from "@/components/inputs/select-item.ts";
|
|
3
|
+
export type { Option } from "@/components/inputs/select-item.ts";
|
|
2
4
|
export type Size = 'sm' | 'md' | 'lg';
|
|
3
5
|
export type InputSelectSearchableAsyncProps<T> = {
|
|
4
6
|
name?: string;
|
|
@@ -6,7 +8,7 @@ export type InputSelectSearchableAsyncProps<T> = {
|
|
|
6
8
|
className?: string;
|
|
7
9
|
label?: string | React.ReactNode;
|
|
8
10
|
description?: string | React.ReactNode;
|
|
9
|
-
fetchOptionsByQuery: (search: string) => Promise<
|
|
11
|
+
fetchOptionsByQuery: (search: string) => Promise<SelectItem<T>[]>;
|
|
10
12
|
fetchOptionByValue: (value: T) => Promise<Option<T>>;
|
|
11
13
|
onSearchDebounceMs?: number;
|
|
12
14
|
value: T | null;
|
|
@@ -16,9 +18,4 @@ export type InputSelectSearchableAsyncProps<T> = {
|
|
|
16
18
|
error?: string | React.ReactNode;
|
|
17
19
|
size?: Size;
|
|
18
20
|
};
|
|
19
|
-
export type Option<T> = {
|
|
20
|
-
label: string | React.ReactNode;
|
|
21
|
-
value: T;
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
};
|
|
24
21
|
export declare const InputSelectSearchableAsync: <T>(props: InputSelectSearchableAsyncProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type Option<T> = {
|
|
3
|
+
label: string | React.ReactNode;
|
|
4
|
+
value: T;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type SelectGroupHeader = {
|
|
8
|
+
kind: 'header';
|
|
9
|
+
label: string | React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export type SelectDivider = {
|
|
12
|
+
kind: 'divider';
|
|
13
|
+
};
|
|
14
|
+
export type SelectItem<T> = Option<T> | SelectGroupHeader | SelectDivider;
|
|
15
|
+
export declare const isSelectOption: <T>(item: SelectItem<T>) => item is Option<T>;
|
|
@@ -7,6 +7,7 @@ export declare const sizePaddingXClasses: Record<ControlSize, string>;
|
|
|
7
7
|
export declare const sizePaddingLeftClasses: Record<ControlSize, string>;
|
|
8
8
|
export declare const sizePaddingRightClasses: Record<ControlSize, string>;
|
|
9
9
|
export declare const sizePaddingRightWithTrayClasses: Record<ControlSize, string>;
|
|
10
|
+
export declare const sizePaddingRightWithTrayTwoClasses: Record<ControlSize, string>;
|
|
10
11
|
export declare const sizePaddingLeftWithIconClasses: Record<ControlSize, string>;
|
|
11
12
|
export declare const sizeIconLeftPositionClasses: Record<ControlSize, string>;
|
|
12
13
|
export declare const sizeTrayRightPositionClasses: Record<ControlSize, string>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
type UseOverflowFitOptions = {
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
triggerRef: RefObject<HTMLElement | null>;
|
|
5
|
+
measureRef: RefObject<HTMLElement | null>;
|
|
6
|
+
trayRef?: RefObject<HTMLElement | null>;
|
|
7
|
+
itemCount: number;
|
|
8
|
+
deps?: ReadonlyArray<unknown>;
|
|
9
|
+
gap?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function useOverflowFit(options: UseOverflowFitOptions): number;
|
|
12
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -22,7 +22,11 @@ export { InputSelectNative } from "./components/inputs/InputSelectNative.tsx";
|
|
|
22
22
|
export { InputSelect } from "./components/inputs/InputSelect.tsx";
|
|
23
23
|
export { InputSelectSearchable } from "./components/inputs/InputSelectSearchable.tsx";
|
|
24
24
|
export { InputSelectSearchableAsync } from "./components/inputs/InputSelectSearchableAsync.tsx";
|
|
25
|
+
export { InputSelectMultiple } from "./components/inputs/InputSelectMultiple.tsx";
|
|
25
26
|
export { InputSelectOption } from "./components/inputs/InputSelectOption.tsx";
|
|
27
|
+
export { InputSelectGroupHeader } from "./components/inputs/InputSelectGroupHeader.tsx";
|
|
28
|
+
export { InputSelectDivider } from "./components/inputs/InputSelectDivider.tsx";
|
|
29
|
+
export { isSelectOption } from "./components/inputs/select-item.ts";
|
|
26
30
|
export { Panel } from "./components/panel/Panel.tsx";
|
|
27
31
|
export { PanelStack } from "./components/panel/PanelStack.tsx";
|
|
28
32
|
export { PanelField } from "./components/panel/PanelField.tsx";
|
|
@@ -43,6 +47,7 @@ export { DropdownButtonGroup } from "./components/dropdown-menu/DropdownButtonGr
|
|
|
43
47
|
export { DropdownPanel } from "./components/dropdown-menu/DropdownPanel.tsx";
|
|
44
48
|
export { DropdownMenu } from "./components/dropdown-menu/DropdownMenu.tsx";
|
|
45
49
|
export { usePopover } from "./popover/use-popover.tsx";
|
|
50
|
+
export { useSelectPopover } from "./popover/use-select-popover.tsx";
|
|
46
51
|
export { PopoverBase } from "./popover/PopoverBase.tsx";
|
|
47
52
|
export { Test } from "./components/Test.tsx";
|
|
48
53
|
export * from "./types.ts";
|