@matthiaskrijgsman/mat-ui 0.0.1 → 0.0.3

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 (45) hide show
  1. package/README.md +0 -129
  2. package/dist/{Badge.d.ts → components/Badge.d.ts} +2 -2
  3. package/dist/{Modal.d.ts → components/Modal.d.ts} +4 -2
  4. package/dist/{Button.d.ts → components/button/Button.d.ts} +1 -1
  5. package/dist/{ButtonIconRound.d.ts → components/button-icon-round/ButtonIconRound.d.ts} +1 -1
  6. package/dist/{ButtonIconSquare.d.ts → components/button-icon-square/ButtonIconSquare.d.ts} +1 -1
  7. package/dist/{InputCheck.d.ts → components/inputs/InputCheck.d.ts} +1 -2
  8. package/dist/{InputPassword.d.ts → components/inputs/InputPassword.d.ts} +1 -1
  9. package/dist/{InputSelectOption.d.ts → components/inputs/InputSelectOption.d.ts} +1 -2
  10. package/dist/hooks/use-dismiss.d.ts +1 -0
  11. package/dist/index.d.ts +12 -10
  12. package/dist/index.js +7378 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/index.umd.cjs +114 -0
  15. package/dist/index.umd.cjs.map +1 -0
  16. package/dist/style.css +1 -1
  17. package/dist/types.d.ts +31 -0
  18. package/package.json +11 -12
  19. package/dist/ScrollArea.d.ts +0 -5
  20. package/dist/mat-ui.js +0 -6700
  21. package/dist/mat-ui.js.map +0 -1
  22. package/dist/mat-ui.umd.cjs +0 -80
  23. package/dist/mat-ui.umd.cjs.map +0 -1
  24. package/dist/style.d.ts +0 -2
  25. package/dist/style.js +0 -1
  26. /package/dist/{BadgeColors.d.ts → components/BadgeColors.d.ts} +0 -0
  27. /package/dist/{Divider.d.ts → components/Divider.d.ts} +0 -0
  28. /package/dist/{Panel.d.ts → components/Panel.d.ts} +0 -0
  29. /package/dist/{TabButtons.d.ts → components/TabButtons.d.ts} +0 -0
  30. /package/dist/{Test.d.ts → components/Test.d.ts} +0 -0
  31. /package/dist/{Tooltip.d.ts → components/Tooltip.d.ts} +0 -0
  32. /package/dist/{Input.d.ts → components/inputs/Input.d.ts} +0 -0
  33. /package/dist/{InputDescription.d.ts → components/inputs/InputDescription.d.ts} +0 -0
  34. /package/dist/{InputError.d.ts → components/inputs/InputError.d.ts} +0 -0
  35. /package/dist/{InputErrorIcon.d.ts → components/inputs/InputErrorIcon.d.ts} +0 -0
  36. /package/dist/{InputIconButton.d.ts → components/inputs/InputIconButton.d.ts} +0 -0
  37. /package/dist/{InputIconButtonTray.d.ts → components/inputs/InputIconButtonTray.d.ts} +0 -0
  38. /package/dist/{InputLabel.d.ts → components/inputs/InputLabel.d.ts} +0 -0
  39. /package/dist/{InputRadio.d.ts → components/inputs/InputRadio.d.ts} +0 -0
  40. /package/dist/{InputSelect.d.ts → components/inputs/InputSelect.d.ts} +0 -0
  41. /package/dist/{InputSelectNative.d.ts → components/inputs/InputSelectNative.d.ts} +0 -0
  42. /package/dist/{InputSelectSearchable.d.ts → components/inputs/InputSelectSearchable.d.ts} +0 -0
  43. /package/dist/{InputSelectSearchableAsync.d.ts → components/inputs/InputSelectSearchableAsync.d.ts} +0 -0
  44. /package/dist/{InputTextArea.d.ts → components/inputs/InputTextArea.d.ts} +0 -0
  45. /package/dist/{InputToggle.d.ts → components/inputs/InputToggle.d.ts} +0 -0
package/README.md CHANGED
@@ -1,129 +0,0 @@
1
- # Mat UI
2
-
3
- Reusable React UI components built with TypeScript, Vite, and Tailwind.
4
-
5
- ## Installation
6
-
7
- ```
8
- pnpm add mat-ui
9
- ```
10
-
11
- ## Using with Tailwind
12
-
13
- This library uses Tailwind utility classes inside its components. When you consume it in another project, make sure your Tailwind build scans the library so those classes are included in your consumer’s CSS output.
14
-
15
- - Tailwind v4 (with `@tailwindcss/vite`): add an `@source` directive in your Tailwind entry CSS (the file that contains `@import "tailwindcss";`). Adjust the path if your setup differs.
16
-
17
- ```css
18
- /* e.g. src/styles/tailwind.css in your app */
19
- @import "tailwindcss";
20
- @source "./node_modules/mat-ui/dist/**/*.{js,jsx,ts,tsx}";
21
- ```
22
-
23
- - Tailwind v3 (classic config): include `mat-ui` in your `content` globs so the scanner sees class names inside the library.
24
-
25
- ```ts
26
- // tailwind.config.{js,ts}
27
- export default {
28
- content: [
29
- "./src/**/*.{js,jsx,ts,tsx}",
30
- "./node_modules/mat-ui/dist/**/*.{js,jsx,ts,tsx}",
31
- ],
32
- // ...rest
33
- }
34
- ```
35
-
36
- Notes
37
-
38
- - The classes in this library are static strings (no dynamic `pl-${n}` patterns), so Tailwind will pick them up as long as your scanner points at the files.
39
- - If your app does NOT use Tailwind but you still want to use these components, open an issue. We can expose an optional compiled CSS you can import, but see the theming note below.
40
-
41
- ## Theming (future-friendly)
42
-
43
- To support consumer-driven theming, prefer the scanning approach above so the consumer’s Tailwind config remains the source of truth for tokens (colors, spacing, etc.). This allows:
44
-
45
- - Tailwind v4 tokens via `@theme` in the consumer’s CSS to affect all utilities (including those used by `mat-ui`).
46
- - Tailwind v3 theme customization via the consumer’s `tailwind.config`.
47
-
48
- Why CSS isn’t auto-shipped by default: bundling compiled Tailwind CSS inside the library locks in the generated values and can conflict with the consumer’s theme. By letting the consumer generate the utilities, they stay in control of colors, spacing, radii, etc.
49
-
50
- Optional path (on request): we can add an opt-in CSS artifact (e.g., `mat-ui/dist/style.css`) for non-Tailwind consumers to import:
51
-
52
- ```ts
53
- // Consumer app
54
- import '@matthiaskrijgsman/mat-ui/style.css';
55
- ```
56
-
57
- This is convenient but won’t reflect the consumer’s Tailwind theme tokens.
58
-
59
- ---
60
-
61
- # React + TypeScript + Vite
62
-
63
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
64
-
65
- Currently, two official plugins are available:
66
-
67
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
68
- - [@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
69
-
70
- ## Expanding the ESLint configuration
71
-
72
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
73
-
74
- ```js
75
- export default tseslint.config([
76
- globalIgnores(['dist']),
77
- {
78
- files: ['**/*.{ts,tsx}'],
79
- extends: [
80
- // Other configs...
81
-
82
- // Remove tseslint.configs.recommended and replace with this
83
- ...tseslint.configs.recommendedTypeChecked,
84
- // Alternatively, use this for stricter rules
85
- ...tseslint.configs.strictTypeChecked,
86
- // Optionally, add this for stylistic rules
87
- ...tseslint.configs.stylisticTypeChecked,
88
-
89
- // Other configs...
90
- ],
91
- languageOptions: {
92
- parserOptions: {
93
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
94
- tsconfigRootDir: import.meta.dirname,
95
- },
96
- // other options...
97
- },
98
- },
99
- ])
100
- ```
101
-
102
- 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:
103
-
104
- ```js
105
- // eslint.config.js
106
- import reactX from 'eslint-plugin-react-x'
107
- import reactDom from 'eslint-plugin-react-dom'
108
-
109
- export default tseslint.config([
110
- globalIgnores(['dist']),
111
- {
112
- files: ['**/*.{ts,tsx}'],
113
- extends: [
114
- // Other configs...
115
- // Enable lint rules for React
116
- reactX.configs['recommended-typescript'],
117
- // Enable lint rules for React DOM
118
- reactDom.configs.recommended,
119
- ],
120
- languageOptions: {
121
- parserOptions: {
122
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
123
- tsconfigRootDir: import.meta.dirname,
124
- },
125
- // other options...
126
- },
127
- },
128
- ])
129
- ```
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import { type BadgeColorKey } from "./BadgeColors";
2
+ import { type BadgeColorKey } from "./BadgeColors.tsx";
3
3
  import { type TablerIcon } from "@tabler/icons-react";
4
4
  export type BadgeProps = {
5
5
  className?: string;
@@ -9,4 +9,4 @@ export type BadgeProps = {
9
9
  showCloseIcon?: boolean;
10
10
  Icon?: TablerIcon;
11
11
  };
12
- export declare const Badge: (props: BadgeProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLDivElement>>;
@@ -2,8 +2,10 @@ import * as React from "react";
2
2
  export type ModalProps = {
3
3
  open: boolean;
4
4
  className?: string;
5
- onOutsideClick?: () => void;
6
- onClose?: () => void;
5
+ onDismiss?: () => void;
6
+ enableDismissOnOutsideClick?: boolean;
7
+ enableDismissOnEscKey?: boolean;
8
+ enableDismissButton?: boolean;
7
9
  children?: React.ReactNode;
8
10
  maxWidth?: number;
9
11
  };
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- export type Variant = 'primary' | 'white' | 'black' | 'transparent';
2
+ export type Variant = 'primary' | 'secondary' | 'tertiary' | 'white' | 'black' | 'transparent';
3
3
  export type Size = 'sm' | 'md' | 'lg';
4
4
  export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
5
5
  variant?: Variant;
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- export type Variant = 'primary' | 'white' | 'black' | 'transparent';
2
+ export type Variant = 'primary' | 'secondary' | 'tertiary' | 'white' | 'black' | 'transparent';
3
3
  export type Size = 'sm' | 'md' | 'lg';
4
4
  import type { TablerIcon } from '@tabler/icons-react';
5
5
  export type ButtonIconRoundProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- export type Variant = 'primary' | 'white' | 'black' | 'transparent';
2
+ export type Variant = 'primary' | 'secondary' | 'tertiary' | 'white' | 'black' | 'transparent';
3
3
  export type Size = 'sm' | 'md' | 'lg';
4
4
  import type { TablerIcon } from '@tabler/icons-react';
5
5
  export type ButtonIconSquareProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
@@ -1,8 +1,7 @@
1
1
  import * as React from "react";
2
- interface InputCheckProps extends React.HTMLAttributes<HTMLInputElement> {
2
+ export interface InputCheckProps extends React.HTMLAttributes<HTMLInputElement> {
3
3
  label?: string | React.ReactNode;
4
4
  description?: string | React.ReactNode;
5
5
  error?: string | React.ReactNode;
6
6
  }
7
7
  export declare const InputCheck: (props: InputCheckProps) => import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,4 +1,4 @@
1
- import { type InputProps } from "@/Input.tsx";
1
+ import { type InputProps } from "@/components/inputs/Input.tsx";
2
2
  export type InputPasswordProps = InputProps & {
3
3
  enableShowPasswordToggle?: boolean;
4
4
  };
@@ -1,9 +1,8 @@
1
1
  import * as React from "react";
2
- interface InputSelectOptionProps {
2
+ export interface InputSelectOptionProps {
3
3
  children: React.ReactNode;
4
4
  selected: boolean;
5
5
  disabled?: boolean;
6
6
  onClick?: () => void;
7
7
  }
8
8
  export declare const InputSelectOption: (props: InputSelectOptionProps) => import("react/jsx-runtime").JSX.Element;
9
- export {};
@@ -0,0 +1 @@
1
+ export declare const useDismiss: (active: boolean, onDismiss: () => void) => void;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,13 @@
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";
1
+ import "./style.css";
2
+ import { Button } from "./components/button/Button.tsx";
3
+ import { ButtonIconSquare } from "./components/button-icon-square/ButtonIconSquare.tsx";
4
+ import { ButtonIconRound } from "./components/button-icon-round/ButtonIconRound.tsx";
5
+ import { Input } from "./components/inputs/Input.tsx";
6
+ import { InputCheck } from "./components/inputs/InputCheck.tsx";
7
+ import { InputSelect } from "./components/inputs/InputSelect.tsx";
8
+ import { InputSelectNative } from "./components/inputs/InputSelectNative.tsx";
9
+ import { Panel } from "./components/Panel.tsx";
10
+ import { Divider } from "./components/Divider.tsx";
11
+ import { Test } from "./components/Test.tsx";
11
12
  export { Button, Input, InputSelectNative, InputSelect, InputCheck, Panel, ButtonIconSquare, ButtonIconRound, Divider, Test };
13
+ export * from "./types.ts";