@matthiaskrijgsman/mat-ui 0.0.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.
Files changed (44) hide show
  1. package/README.md +69 -0
  2. package/dist/Badge.d.ts +12 -0
  3. package/dist/BadgeColors.d.ts +27 -0
  4. package/dist/Button.d.ts +15 -0
  5. package/dist/ButtonIconRound.d.ts +16 -0
  6. package/dist/ButtonIconSquare.d.ts +16 -0
  7. package/dist/Divider.d.ts +5 -0
  8. package/dist/Input.d.ts +10 -0
  9. package/dist/InputCheck.d.ts +8 -0
  10. package/dist/InputDescription.d.ts +5 -0
  11. package/dist/InputError.d.ts +5 -0
  12. package/dist/InputErrorIcon.d.ts +1 -0
  13. package/dist/InputIconButton.d.ts +6 -0
  14. package/dist/InputIconButtonTray.d.ts +6 -0
  15. package/dist/InputLabel.d.ts +5 -0
  16. package/dist/InputPassword.d.ts +5 -0
  17. package/dist/InputRadio.d.ts +8 -0
  18. package/dist/InputSelect.d.ts +20 -0
  19. package/dist/InputSelectNative.d.ts +13 -0
  20. package/dist/InputSelectOption.d.ts +9 -0
  21. package/dist/InputSelectSearchable.d.ts +21 -0
  22. package/dist/InputSelectSearchableAsync.d.ts +22 -0
  23. package/dist/InputTextArea.d.ts +7 -0
  24. package/dist/InputToggle.d.ts +7 -0
  25. package/dist/Modal.d.ts +10 -0
  26. package/dist/Panel.d.ts +7 -0
  27. package/dist/ScrollArea.d.ts +5 -0
  28. package/dist/TabButtons.d.ts +14 -0
  29. package/dist/Test.d.ts +1 -0
  30. package/dist/Tooltip.d.ts +11 -0
  31. package/dist/hooks/use-debounce.d.ts +1 -0
  32. package/dist/index.d.ts +11 -0
  33. package/dist/mat-ui.js +6700 -0
  34. package/dist/mat-ui.js.map +1 -0
  35. package/dist/mat-ui.umd.cjs +80 -0
  36. package/dist/mat-ui.umd.cjs.map +1 -0
  37. package/dist/popover/PopoverBase.d.ts +4 -0
  38. package/dist/popover/PopoverButton.d.ts +12 -0
  39. package/dist/popover/PopoverPanel.d.ts +6 -0
  40. package/dist/popover/use-popover.d.ts +25 -0
  41. package/dist/spinner/Spinner.d.ts +5 -0
  42. package/dist/table/Table.d.ts +11 -0
  43. package/dist/util/classnames.util.d.ts +1 -0
  44. package/package.json +73 -0
package/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # React + TypeScript + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
+
10
+ ## Expanding the ESLint configuration
11
+
12
+ If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13
+
14
+ ```js
15
+ export default tseslint.config([
16
+ globalIgnores(['dist']),
17
+ {
18
+ files: ['**/*.{ts,tsx}'],
19
+ extends: [
20
+ // Other configs...
21
+
22
+ // Remove tseslint.configs.recommended and replace with this
23
+ ...tseslint.configs.recommendedTypeChecked,
24
+ // Alternatively, use this for stricter rules
25
+ ...tseslint.configs.strictTypeChecked,
26
+ // Optionally, add this for stylistic rules
27
+ ...tseslint.configs.stylisticTypeChecked,
28
+
29
+ // Other configs...
30
+ ],
31
+ languageOptions: {
32
+ parserOptions: {
33
+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
34
+ tsconfigRootDir: import.meta.dirname,
35
+ },
36
+ // other options...
37
+ },
38
+ },
39
+ ])
40
+ ```
41
+
42
+ You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
43
+
44
+ ```js
45
+ // eslint.config.js
46
+ import reactX from 'eslint-plugin-react-x'
47
+ import reactDom from 'eslint-plugin-react-dom'
48
+
49
+ export default tseslint.config([
50
+ globalIgnores(['dist']),
51
+ {
52
+ files: ['**/*.{ts,tsx}'],
53
+ extends: [
54
+ // Other configs...
55
+ // Enable lint rules for React
56
+ reactX.configs['recommended-typescript'],
57
+ // Enable lint rules for React DOM
58
+ reactDom.configs.recommended,
59
+ ],
60
+ languageOptions: {
61
+ parserOptions: {
62
+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
63
+ tsconfigRootDir: import.meta.dirname,
64
+ },
65
+ // other options...
66
+ },
67
+ },
68
+ ])
69
+ ```
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import { type BadgeColorKey } from "./BadgeColors";
3
+ import { type TablerIcon } from "@tabler/icons-react";
4
+ export type BadgeProps = {
5
+ className?: string;
6
+ children?: React.ReactNode;
7
+ color?: BadgeColorKey;
8
+ onClick?: () => void;
9
+ showCloseIcon?: boolean;
10
+ Icon?: TablerIcon;
11
+ };
12
+ export declare const Badge: (props: BadgeProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ export declare const BadgeColor: {
2
+ readonly red: "bg-red-100 text-red-700 ring-red-200";
3
+ readonly orange: "bg-orange-100 text-orange-700 ring-orange-200";
4
+ readonly amber: "bg-amber-100 text-amber-700 ring-amber-200";
5
+ readonly yellow: "bg-yellow-100 text-yellow-700 ring-yellow-200";
6
+ readonly lime: "bg-lime-100 text-lime-700 ring-lime-200";
7
+ readonly green: "bg-green-100 text-green-700 ring-green-200";
8
+ readonly emerald: "bg-emerald-100 text-emerald-700 ring-emerald-200";
9
+ readonly teal: "bg-teal-100 text-teal-700 ring-teal-200";
10
+ readonly cyan: "bg-cyan-100 text-cyan-700 ring-cyan-200";
11
+ readonly sky: "bg-sky-100 text-sky-700 ring-sky-200";
12
+ readonly blue: "bg-blue-100 text-blue-700 ring-blue-200";
13
+ readonly indigo: "bg-indigo-100 text-indigo-700 ring-indigo-200";
14
+ readonly violet: "bg-violet-100 text-violet-700 ring-violet-200";
15
+ readonly purple: "bg-purple-100 text-purple-700 ring-purple-200";
16
+ readonly fuchsia: "bg-fuchsia-100 text-fuchsia-700 ring-fuchsia-200";
17
+ readonly pink: "bg-pink-100 text-pink-700 ring-pink-200";
18
+ readonly rose: "bg-rose-100 text-rose-700 ring-rose-200";
19
+ readonly slate: "bg-slate-100 text-slate-700 ring-slate-200";
20
+ readonly gray: "bg-gray-100 text-gray-700 ring-gray-200";
21
+ readonly zinc: "bg-zinc-100 text-zinc-700 ring-zinc-200";
22
+ readonly neutral: "bg-neutral-100 text-neutral-700 ring-neutral-200";
23
+ readonly stone: "bg-stone-100 text-stone-700 ring-stone-200";
24
+ readonly white: "bg-white text-gray-900 ring-stone-200";
25
+ readonly black: "bg-black text-white ring-stone-200";
26
+ };
27
+ export type BadgeColorKey = keyof typeof BadgeColor;
@@ -0,0 +1,15 @@
1
+ import * as React from "react";
2
+ export type Variant = 'primary' | 'white' | 'black' | 'transparent';
3
+ export type Size = 'sm' | 'md' | 'lg';
4
+ export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
5
+ variant?: Variant;
6
+ size?: Size;
7
+ loading?: boolean;
8
+ children?: React.ReactNode;
9
+ };
10
+ export declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
11
+ variant?: Variant;
12
+ size?: Size;
13
+ loading?: boolean;
14
+ children?: React.ReactNode;
15
+ } & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ export type Variant = 'primary' | 'white' | 'black' | 'transparent';
3
+ export type Size = 'sm' | 'md' | 'lg';
4
+ import type { TablerIcon } from '@tabler/icons-react';
5
+ export type ButtonIconRoundProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
6
+ variant?: Variant;
7
+ size?: Size;
8
+ loading?: boolean;
9
+ Icon: TablerIcon;
10
+ };
11
+ export declare const ButtonIconRound: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
12
+ variant?: Variant;
13
+ size?: Size;
14
+ loading?: boolean;
15
+ Icon: TablerIcon;
16
+ } & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ export type Variant = 'primary' | 'white' | 'black' | 'transparent';
3
+ export type Size = 'sm' | 'md' | 'lg';
4
+ import type { TablerIcon } from '@tabler/icons-react';
5
+ export type ButtonIconSquareProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
6
+ variant?: Variant;
7
+ size?: Size;
8
+ loading?: boolean;
9
+ Icon: TablerIcon;
10
+ };
11
+ export declare const ButtonIconSquare: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
12
+ variant?: Variant;
13
+ size?: Size;
14
+ loading?: boolean;
15
+ Icon: TablerIcon;
16
+ } & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ export type DividerProps = {
3
+ vertical?: boolean;
4
+ } & React.HTMLAttributes<HTMLHRElement>;
5
+ export declare const Divider: (props: DividerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { type TablerIcon } from "@tabler/icons-react";
3
+ export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {
4
+ label?: string | React.ReactNode;
5
+ description?: string | React.ReactNode;
6
+ error?: string | React.ReactNode;
7
+ Icon?: TablerIcon;
8
+ buttonTray?: React.ReactNode;
9
+ };
10
+ export declare const Input: (props: InputProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ interface InputCheckProps extends React.HTMLAttributes<HTMLInputElement> {
3
+ label?: string | React.ReactNode;
4
+ description?: string | React.ReactNode;
5
+ error?: string | React.ReactNode;
6
+ }
7
+ export declare const InputCheck: (props: InputCheckProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ export type InputDescriptionProps = {
3
+ children?: React.ReactNode;
4
+ };
5
+ export declare const InputDescription: (props: InputDescriptionProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ export type InputErrorProps = {
3
+ children?: React.ReactNode;
4
+ };
5
+ export declare const InputError: (props: InputErrorProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1 @@
1
+ export declare const InputErrorIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { type TablerIcon } from "@tabler/icons-react";
2
+ export type InputIconButtonProps = {
3
+ onClick?: () => void;
4
+ Icon: TablerIcon;
5
+ };
6
+ export declare const InputIconButton: (props: InputIconButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ export type InputIconButtonTrayProps = {
3
+ children?: React.ReactNode;
4
+ className?: string;
5
+ };
6
+ export declare const InputIconButtonTray: (props: InputIconButtonTrayProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ export type InputLabelProps = {
3
+ children?: React.ReactNode;
4
+ };
5
+ export declare const InputLabel: (props: InputLabelProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,5 @@
1
+ import { type InputProps } from "@/Input.tsx";
2
+ export type InputPasswordProps = InputProps & {
3
+ enableShowPasswordToggle?: boolean;
4
+ };
5
+ export declare const InputPassword: (props: InputPasswordProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ export type InputRadioProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> & {
3
+ name?: string;
4
+ label?: string | React.ReactNode;
5
+ description?: string | React.ReactNode;
6
+ error?: string | React.ReactNode;
7
+ };
8
+ export declare const InputRadio: (props: InputRadioProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ export type InputSelectProps<T> = {
3
+ name?: string;
4
+ id?: string;
5
+ className?: string;
6
+ label?: string | React.ReactNode;
7
+ description?: string | React.ReactNode;
8
+ options: Option<T>[];
9
+ value: T | null;
10
+ onChange: (value: T | null) => void;
11
+ placeholder?: string;
12
+ maxHeight?: number;
13
+ error?: string | React.ReactNode;
14
+ };
15
+ export type Option<T> = {
16
+ label: string | React.ReactNode;
17
+ value: T;
18
+ disabled?: boolean;
19
+ };
20
+ export declare const InputSelect: <T>(props: InputSelectProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ export type InputSelectNativeProps = React.InputHTMLAttributes<HTMLSelectElement> & {
3
+ label?: string | React.ReactNode;
4
+ description?: string | React.ReactNode;
5
+ options?: OptionNative[];
6
+ error?: string | React.ReactNode;
7
+ };
8
+ export type OptionNative = {
9
+ label: string;
10
+ value: string;
11
+ disabled?: boolean;
12
+ };
13
+ export declare const InputSelectNative: (props: InputSelectNativeProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ interface InputSelectOptionProps {
3
+ children: React.ReactNode;
4
+ selected: boolean;
5
+ disabled?: boolean;
6
+ onClick?: () => void;
7
+ }
8
+ export declare const InputSelectOption: (props: InputSelectOptionProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,21 @@
1
+ import * as React from "react";
2
+ export type InputSelectSearchableProps<T> = {
3
+ name?: string;
4
+ id?: string;
5
+ className?: string;
6
+ label?: string | React.ReactNode;
7
+ description?: string | React.ReactNode;
8
+ options: Option<T>[];
9
+ onSearch: (search: string) => Option<T>[];
10
+ value: T | null;
11
+ onChange: (value: T | null) => void;
12
+ placeholder?: string;
13
+ maxHeight?: number;
14
+ error?: string | React.ReactNode;
15
+ };
16
+ export type Option<T> = {
17
+ label: string | React.ReactNode;
18
+ value: T;
19
+ disabled?: boolean;
20
+ };
21
+ export declare const InputSelectSearchable: <T>(props: InputSelectSearchableProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ export type InputSelectSearchableAsyncProps<T> = {
3
+ name?: string;
4
+ id?: string;
5
+ className?: string;
6
+ label?: string | React.ReactNode;
7
+ description?: string | React.ReactNode;
8
+ fetchOptionsByQuery: (search: string) => Promise<Option<T>[]>;
9
+ fetchOptionByValue: (value: T) => Promise<Option<T>>;
10
+ onSearchDebounceMs?: number;
11
+ value: T | null;
12
+ onChange: (value: T | null) => void;
13
+ placeholder?: string;
14
+ maxHeight?: number;
15
+ error?: string | React.ReactNode;
16
+ };
17
+ export type Option<T> = {
18
+ label: string | React.ReactNode;
19
+ value: T;
20
+ disabled?: boolean;
21
+ };
22
+ export declare const InputSelectSearchableAsync: <T>(props: InputSelectSearchableAsyncProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ export type InputTextAreaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {
3
+ label?: string | React.ReactNode;
4
+ description?: string | React.ReactNode;
5
+ error?: string | React.ReactNode;
6
+ };
7
+ export declare const InputTextArea: (props: InputTextAreaProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ export type InputToggleProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> & {
3
+ label?: string | React.ReactNode;
4
+ description?: string | React.ReactNode;
5
+ error?: string | React.ReactNode;
6
+ };
7
+ export declare const InputToggle: (props: InputToggleProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ export type ModalProps = {
3
+ open: boolean;
4
+ className?: string;
5
+ onOutsideClick?: () => void;
6
+ onClose?: () => void;
7
+ children?: React.ReactNode;
8
+ maxWidth?: number;
9
+ };
10
+ export declare const Modal: (props: ModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ export type PanelProps = React.HTMLAttributes<HTMLDivElement> & {
3
+ children?: React.ReactNode;
4
+ };
5
+ export declare const Panel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
6
+ children?: React.ReactNode;
7
+ } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ export type ScrollAreaProps = {
3
+ children?: React.ReactNode;
4
+ };
5
+ export declare const ScrollArea: (props: ScrollAreaProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import type { TablerIcon } from "@tabler/icons-react";
3
+ export type TabButton = {
4
+ label: string | React.ReactNode;
5
+ active?: boolean;
6
+ onClick?: () => void;
7
+ href?: string;
8
+ Icon?: TablerIcon;
9
+ };
10
+ export type TabButtonsProps = {
11
+ className?: string;
12
+ tabs: TabButton[];
13
+ };
14
+ export declare const TabButtons: (props: TabButtonsProps) => import("react/jsx-runtime").JSX.Element;
package/dist/Test.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const Test: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import type { Placement } from "@floating-ui/react";
3
+ export type TooltipProps = {
4
+ children?: React.ReactNode;
5
+ content: React.ReactNode;
6
+ className?: string;
7
+ placement?: Placement;
8
+ minWidth?: number;
9
+ maxWidth?: number;
10
+ };
11
+ export declare const Tooltip: (props: TooltipProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const useDebounce: <T>(value: T, delay: number) => T;
@@ -0,0 +1,11 @@
1
+ import { Button } from "./Button.tsx";
2
+ import { ButtonIconSquare } from "./ButtonIconSquare.tsx";
3
+ import { ButtonIconRound } from "./ButtonIconRound.tsx";
4
+ import { Input } from "./Input.tsx";
5
+ import { InputCheck } from "./InputCheck.tsx";
6
+ import { InputSelect } from "./InputSelect.tsx";
7
+ import { InputSelectNative } from "./InputSelectNative.tsx";
8
+ import { Panel } from "./Panel.tsx";
9
+ import { Divider } from "./Divider.tsx";
10
+ import { Test } from "./Test.tsx";
11
+ export { Button, Input, InputSelectNative, InputSelect, InputCheck, Panel, ButtonIconSquare, ButtonIconRound, Divider, Test };