@omer-x/tailwind-ui-kit 1.0.0-alpha.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Omer Mecitoglu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,18 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { IconProp } from '@fortawesome/fontawesome-svg-core';
3
+ import { ComponentProps } from 'react';
4
+
5
+ type ButtonProps = Omit<ComponentProps<"button">, "children" | "onClick"> & {
6
+ color?: "primary" | "secondary" | "success" | "warning" | "danger";
7
+ stretched?: boolean;
8
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
9
+ } & ({
10
+ icon: IconProp;
11
+ text?: string;
12
+ } | {
13
+ icon?: IconProp;
14
+ text: string;
15
+ });
16
+ declare const Button: ({ color, icon, text, stretched, onClick, className, ...otherProps }: ButtonProps) => react_jsx_runtime.JSX.Element;
17
+
18
+ export { Button as default };
@@ -0,0 +1,37 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
3
+ import { cn } from "../utils/cn.js";
4
+ import PulseButton from "./PulseButton.js";
5
+ const Button = ({
6
+ color = "primary",
7
+ icon,
8
+ text,
9
+ stretched = false,
10
+ onClick,
11
+ className,
12
+ ...otherProps
13
+ }) => /* @__PURE__ */ jsxs(
14
+ PulseButton,
15
+ {
16
+ className: cn("relative overflow-hidden inline-flex justify-center items-center transition rounded-lg min-h-9 px-3 py-2 text-sm font-medium text-white focus-visible:outline-2 focus-visible:outline-offset-2 cursor-pointer", {
17
+ "bg-blue-500 hover:bg-blue-600 focus-visible:outline-blue-500": color === "primary",
18
+ "text-slate-900 bg-slate-400 hover:bg-slate-500 focus-visible:outline-slate-400": color === "secondary",
19
+ "bg-green-600 hover:bg-green-700 focus-visible:outline-green-600": color === "success",
20
+ "text-slate-900 bg-yellow-500 hover:bg-yellow-600 focus-visible:outline-yellow-500": color === "warning",
21
+ "bg-red-600 hover:bg-red-700 focus-visible:outline-red-600": color === "danger",
22
+ "gap-2": !stretched,
23
+ "gap-3": stretched
24
+ }, className),
25
+ onClick,
26
+ ...otherProps,
27
+ children: [
28
+ icon && /* @__PURE__ */ jsx(FontAwesomeIcon, { icon, size: "lg" }),
29
+ !icon && !text ? /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }) : /* @__PURE__ */ jsx(Fragment, { children: text }),
30
+ stretched && icon && /* @__PURE__ */ jsx("div", { className: "w-[var(--fa-width,1.25em)]" })
31
+ ]
32
+ }
33
+ );
34
+ var Button_default = Button;
35
+ export {
36
+ Button_default as default
37
+ };
@@ -0,0 +1,15 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ComponentProps, ReactNode } from 'react';
3
+ import { IconProp } from '@fortawesome/fontawesome-svg-core';
4
+
5
+ type ButtonProps<LinkProps> = Omit<ComponentProps<"a">, "children" | "href" | "onClick"> & {
6
+ color?: "primary" | "secondary" | "success" | "warning" | "danger";
7
+ icon?: IconProp;
8
+ text?: string;
9
+ stretched?: boolean;
10
+ as: (props: LinkProps) => ReactNode;
11
+ href: string;
12
+ };
13
+ declare const Button: <LinkProps extends ComponentProps<"a">>({ color, icon, text, stretched, as: Link, href, className, ...otherProps }: ButtonProps<LinkProps>) => react_jsx_runtime.JSX.Element;
14
+
15
+ export { Button as default };
@@ -0,0 +1,43 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
3
+ import {} from "react";
4
+ import { cn } from "../utils/cn.js";
5
+ import PulseButton from "./PulseButton.js";
6
+ const Button = ({
7
+ color,
8
+ icon,
9
+ text,
10
+ stretched = false,
11
+ as: Link,
12
+ href,
13
+ className,
14
+ ...otherProps
15
+ }) => (
16
+ // @ts-expect-error: shut up typescript!
17
+ /* @__PURE__ */ jsxs(
18
+ PulseButton,
19
+ {
20
+ as: Link,
21
+ href,
22
+ className: cn("relative overflow-hidden inline-flex justify-center items-center transition rounded-lg px-3 py-2 text-sm font-medium text-white focus-visible:outline-2 focus-visible:outline-offset-2 cursor-pointer", {
23
+ "bg-blue-500 hover:bg-blue-600 focus-visible:outline-blue-500": color === "primary",
24
+ "bg-slate-400 hover:bg-slate-500 focus-visible:outline-slate-400": color === "secondary",
25
+ "bg-green-600 hover:bg-green-700 focus-visible:outline-green-600": color === "success",
26
+ "bg-yellow-500 hover:bg-yellow-600 focus-visible:outline-yellow-500": color === "warning",
27
+ "bg-red-500 hover:bg-red-600 focus-visible:outline-red-500": color === "danger",
28
+ "gap-2": !stretched,
29
+ "gap-3": stretched
30
+ }, className),
31
+ ...otherProps,
32
+ children: [
33
+ icon && /* @__PURE__ */ jsx(FontAwesomeIcon, { icon, size: "lg" }),
34
+ !icon && !text ? /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }) : /* @__PURE__ */ jsx(Fragment, { children: text }),
35
+ stretched && icon && /* @__PURE__ */ jsx("div", { className: "w-[var(--fa-width,1.25em)]" })
36
+ ]
37
+ }
38
+ )
39
+ );
40
+ var LinkButton_default = Button;
41
+ export {
42
+ LinkButton_default as default
43
+ };
@@ -0,0 +1,11 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ElementType, ReactNode, ComponentPropsWithoutRef } from 'react';
3
+
4
+ type PulseButtonProps<As extends ElementType> = {
5
+ as?: As;
6
+ onClick?: (e: React.MouseEvent<Element>) => void;
7
+ children: ReactNode;
8
+ } & Omit<ComponentPropsWithoutRef<As>, "as" | "onClick" | "children">;
9
+ declare const PulseButton: <As extends ElementType = "button">({ as, onClick, children, className, ...otherProps }: PulseButtonProps<As>) => react_jsx_runtime.JSX.Element;
10
+
11
+ export { PulseButton as default };
@@ -0,0 +1,55 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import styles from "../styles/ripple.module.css";
5
+ import { cn } from "../utils/cn.js";
6
+ const PulseButton = ({
7
+ as,
8
+ onClick,
9
+ children,
10
+ className,
11
+ ...otherProps
12
+ }) => {
13
+ const Component = as ?? "button";
14
+ const [ripples, setRipples] = useState([]);
15
+ const handleClick = (e) => {
16
+ onClick?.(e);
17
+ const rect = e.currentTarget.getBoundingClientRect();
18
+ const size = Math.max(rect.width, rect.height);
19
+ const x = e.clientX - rect.left - size / 2;
20
+ const y = e.clientY - rect.top - size / 2;
21
+ const newRipple = { x, y, size, id: Date.now() };
22
+ setRipples((prev) => [...prev, newRipple]);
23
+ setTimeout(() => {
24
+ setRipples((prev) => prev.filter((r) => r.id !== newRipple.id));
25
+ }, 600);
26
+ };
27
+ return /* @__PURE__ */ jsxs(
28
+ Component,
29
+ {
30
+ onClick: handleClick,
31
+ className: cn("relative overflow-hidden", className),
32
+ ...otherProps,
33
+ children: [
34
+ children,
35
+ ripples.map((ripple) => /* @__PURE__ */ jsx(
36
+ "span",
37
+ {
38
+ className: cn(styles.animation, "absolute rounded-full bg-white opacity-40"),
39
+ style: {
40
+ left: ripple.x,
41
+ top: ripple.y,
42
+ width: ripple.size,
43
+ height: ripple.size
44
+ }
45
+ },
46
+ ripple.id
47
+ ))
48
+ ]
49
+ }
50
+ );
51
+ };
52
+ var PulseButton_default = PulseButton;
53
+ export {
54
+ PulseButton_default as default
55
+ };
@@ -0,0 +1,6 @@
1
+ import * as react from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+
4
+ declare const AnimatedPopup: ({ render, ...otherProps }: useRender.ComponentProps<"div">) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+
6
+ export { AnimatedPopup as default };
@@ -0,0 +1,34 @@
1
+ import { mergeProps } from "@base-ui/react/merge-props";
2
+ import { useRender } from "@base-ui/react/use-render";
3
+ import { cn } from "../../utils/cn.js";
4
+ const AnimatedPopup = ({ render, ...otherProps }) => useRender({
5
+ defaultTagName: "div",
6
+ render,
7
+ props: mergeProps({
8
+ className: cn(
9
+ "fixed",
10
+ "top-[calc(50%+1.25rem*var(--nested-dialogs))]",
11
+ "left-1/2",
12
+ "-mt-8",
13
+ "w-96",
14
+ "max-w-[calc(100vw-3rem)]",
15
+ "-translate-x-1/2",
16
+ "-translate-y-1/2",
17
+ "scale-[calc(1-0.1*var(--nested-dialogs))]",
18
+ "transition-all",
19
+ "duration-150",
20
+ "data-[ending-style]:scale-90",
21
+ "data-[ending-style]:opacity-0",
22
+ "data-[nested-dialog-open]:after:absolute",
23
+ "data-[nested-dialog-open]:after:inset-0",
24
+ "data-[nested-dialog-open]:after:rounded-[inherit]",
25
+ "data-[nested-dialog-open]:after:bg-black/5",
26
+ "data-[starting-style]:scale-90",
27
+ "data-[starting-style]:opacity-0"
28
+ )
29
+ }, otherProps)
30
+ });
31
+ var AnimatedPopup_default = AnimatedPopup;
32
+ export {
33
+ AnimatedPopup_default as default
34
+ };
@@ -0,0 +1,6 @@
1
+ import * as react from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+
4
+ declare const DialogBackdrop: ({ render, ...otherProps }: useRender.ComponentProps<"div">) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+
6
+ export { DialogBackdrop as default };
@@ -0,0 +1,26 @@
1
+ import { mergeProps } from "@base-ui/react/merge-props";
2
+ import { useRender } from "@base-ui/react/use-render";
3
+ import { cn } from "../../utils/cn.js";
4
+ const DialogBackdrop = ({ render, ...otherProps }) => useRender({
5
+ defaultTagName: "div",
6
+ render,
7
+ props: mergeProps({
8
+ className: cn(
9
+ "fixed",
10
+ "inset-0",
11
+ "min-h-dvh",
12
+ "bg-black",
13
+ "opacity-20",
14
+ "transition-all",
15
+ "duration-150",
16
+ "data-[ending-style]:opacity-0",
17
+ "data-[starting-style]:opacity-0",
18
+ "dark:opacity-70",
19
+ "supports-[-webkit-touch-callout:none]:absolute"
20
+ )
21
+ }, otherProps)
22
+ });
23
+ var DialogBackdrop_default = DialogBackdrop;
24
+ export {
25
+ DialogBackdrop_default as default
26
+ };
@@ -0,0 +1,6 @@
1
+ import * as react from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+
4
+ declare const DialogTitle: ({ render, ...otherProps }: useRender.ComponentProps<"h2">) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+
6
+ export { DialogTitle as default };
@@ -0,0 +1,19 @@
1
+ import { mergeProps } from "@base-ui/react/merge-props";
2
+ import { useRender } from "@base-ui/react/use-render";
3
+ import { cn } from "../../utils/cn.js";
4
+ const DialogTitle = ({ render, ...otherProps }) => useRender({
5
+ defaultTagName: "h2",
6
+ render,
7
+ props: mergeProps({
8
+ className: cn(
9
+ "-mt-1.5",
10
+ "mb-1",
11
+ "text-xl",
12
+ "font-semibold"
13
+ )
14
+ }, otherProps)
15
+ });
16
+ var DialogTitle_default = DialogTitle;
17
+ export {
18
+ DialogTitle_default as default
19
+ };
@@ -0,0 +1,5 @@
1
+ export { default as AnimatedPopup } from './AnimatedPopup.js';
2
+ export { default as DialogBackdrop } from './DialogBackdrop.js';
3
+ export { default as DialogTitle } from './DialogTitle.js';
4
+ import 'react';
5
+ import '@base-ui/react/use-render';
@@ -0,0 +1,8 @@
1
+ import { default as default2 } from "./AnimatedPopup.js";
2
+ import { default as default3 } from "./DialogBackdrop.js";
3
+ import { default as default4 } from "./DialogTitle.js";
4
+ export {
5
+ default2 as AnimatedPopup,
6
+ default3 as DialogBackdrop,
7
+ default4 as DialogTitle
8
+ };
@@ -0,0 +1,10 @@
1
+ @keyframes ripple {
2
+ to {
3
+ transform: scale(4);
4
+ opacity: 0;
5
+ }
6
+ }
7
+ .animation {
8
+ animation: ripple 600ms linear;
9
+ transform: scale(0);
10
+ }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,5 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ declare function cn(...inputs: ClassValue[]): string;
4
+
5
+ export { cn };
@@ -0,0 +1,8 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
6
+ export {
7
+ cn
8
+ };
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@omer-x/tailwind-ui-kit",
3
+ "version": "1.0.0-alpha.1",
4
+ "description": "Tailwind CSS-based React component library for building user interfaces",
5
+ "keywords": [
6
+ "typescript"
7
+ ],
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/omermecitoglu/tailwind-ui-kit.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/omermecitoglu/tailwind-ui-kit/issues"
14
+ },
15
+ "homepage": "https://github.com/omermecitoglu/tailwind-ui-kit#readme",
16
+ "private": false,
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "author": {
21
+ "name": "Omer Mecitoglu",
22
+ "email": "omer.mecitoglu@gmail.com",
23
+ "url": "https://omermecitoglu.github.io"
24
+ },
25
+ "license": "MIT",
26
+ "type": "module",
27
+ "files": [
28
+ "dist/"
29
+ ],
30
+ "exports": {
31
+ "./dialog": {
32
+ "types": "./dist/components/dialog/index.d.ts",
33
+ "import": "./dist/components/dialog/index.js"
34
+ },
35
+ "./utils": {
36
+ "types": "./dist/utils/index.d.ts",
37
+ "import": "./dist/utils/index.js"
38
+ }
39
+ },
40
+ "scripts": {
41
+ "lint": "eslint --flag unstable_native_nodejs_ts_config",
42
+ "lint:fix": "eslint --fix --flag unstable_native_nodejs_ts_config",
43
+ "test": "vitest run --coverage",
44
+ "test:watch": "vitest --coverage",
45
+ "dev": "vite --port 3000",
46
+ "build": "tsup"
47
+ },
48
+ "peerDependencies": {
49
+ "@base-ui/react": "^1",
50
+ "@fortawesome/react-fontawesome": "^3",
51
+ "clsx": "^2",
52
+ "react": "^19",
53
+ "react-dom": "^19",
54
+ "tailwind-merge": "^3",
55
+ "tailwindcss": "^4"
56
+ },
57
+ "devDependencies": {
58
+ "@fortawesome/free-brands-svg-icons": "^7.2.0",
59
+ "@fortawesome/free-solid-svg-icons": "^7.2.0",
60
+ "@omer-x/eslint-config": "^2.3.2",
61
+ "@tailwindcss/vite": "^4.3.0",
62
+ "@types/node": "^25.7.0",
63
+ "@types/react": "^19.2.14",
64
+ "@types/react-dom": "^19.2.3",
65
+ "@vitejs/plugin-react": "^6.0.1",
66
+ "@vitest/coverage-v8": "^4.1.6",
67
+ "esbuild-fix-imports-plugin": "^1.0.23",
68
+ "eslint": "^9.37.0",
69
+ "eslint-plugin-jsx-a11y": "^6.10.2",
70
+ "eslint-plugin-react": "^7.37.5",
71
+ "semantic-release": "^25.0.3",
72
+ "tsup": "^8.5.1",
73
+ "typescript": "^5",
74
+ "vite": "^8.0.12",
75
+ "vitest": "^4.1.6"
76
+ }
77
+ }