components-library-mtx 0.0.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 Vachagan Achoyan
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.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # components-library
2
+
3
+ To install dependencies:
4
+
5
+ ```bash
6
+ bun install
7
+ ```
8
+
9
+ To run:
10
+
11
+ ```bash
12
+ bun run index.ts
13
+ ```
14
+
15
+ This project was created using `bun init` in bun v1.3.4. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+
3
+ //#region src/components/Button.d.ts
4
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5
+ variant?: "primary" | "destructive" | "outline" | "ghost";
6
+ size?: "sm" | "md" | "lg";
7
+ }
8
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
9
+ //#endregion
10
+ export { Button, ButtonProps };
@@ -0,0 +1,39 @@
1
+ import { cn } from "../utils/index.js";
2
+ import React from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { cva } from "class-variance-authority";
5
+
6
+ //#region src/components/Button.tsx
7
+ const buttonVariants = cva("inline-flex items-center cursor-pointer justify-center rounded-md text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 active:scale-95", {
8
+ variants: {
9
+ variant: {
10
+ primary: "bg-blue-600 text-white hover:bg-blue-700",
11
+ destructive: "bg-red-600 text-white hover:bg-red-700",
12
+ outline: "border border-gray-300 bg-transparent hover:bg-gray-100 text-gray-900",
13
+ ghost: "hover:bg-gray-100 text-gray-700"
14
+ },
15
+ size: {
16
+ sm: "h-8 px-3 text-xs",
17
+ md: "h-10 px-4",
18
+ lg: "h-12 px-8 text-base"
19
+ }
20
+ },
21
+ defaultVariants: {
22
+ variant: "primary",
23
+ size: "md"
24
+ }
25
+ });
26
+ const Button = React.forwardRef(({ className, variant, size, ...props }, ref) => {
27
+ return /* @__PURE__ */ jsx("button", {
28
+ ref,
29
+ className: cn(buttonVariants({
30
+ variant,
31
+ size
32
+ }), className),
33
+ ...props
34
+ });
35
+ });
36
+ Button.displayName = "Button";
37
+
38
+ //#endregion
39
+ export { Button };
@@ -0,0 +1,6 @@
1
+ import { LibraryConfig } from "../providers/types.js";
2
+
3
+ //#region src/config/defineConfig.d.ts
4
+ declare const defineConfig: (config: LibraryConfig) => LibraryConfig;
5
+ //#endregion
6
+ export { defineConfig };
@@ -0,0 +1,23 @@
1
+ //#region src/config/defineConfig.ts
2
+ const DEFAULT_CONFIG = {
3
+ theme: "light",
4
+ rippleEffect: true,
5
+ components: {
6
+ Link: "a",
7
+ Image: "img"
8
+ }
9
+ };
10
+ const defineConfig = (config) => {
11
+ return {
12
+ ...DEFAULT_CONFIG,
13
+ ...config,
14
+ components: {
15
+ ...DEFAULT_CONFIG.components,
16
+ ...config.components
17
+ },
18
+ router: config.router
19
+ };
20
+ };
21
+
22
+ //#endregion
23
+ export { defineConfig };
package/dist/index.css ADDED
@@ -0,0 +1,2 @@
1
+ /*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial;--tw-outline-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-900:oklch(21% .034 264.665);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height:calc(1.5/1);--font-weight-medium:500;--radius-md:.375rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.contents{display:contents}.flex{display:flex}.inline-flex{display:inline-flex}.h-8{height:calc(var(--spacing)*8)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.cursor-pointer{cursor:pointer}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-4{gap:calc(var(--spacing)*4)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-gray-300{border-color:var(--color-gray-300)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-red-600{background-color:var(--color-red-600)}.bg-transparent{background-color:#0000}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-8{padding-inline:calc(var(--spacing)*8)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-gray-700{color:var(--color-gray-700)}.text-gray-900{color:var(--color-gray-900)}.text-white{color:var(--color-white)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (hover:hover){.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x)var(--tw-scale-y)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:opacity-50:disabled{opacity:.5}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}
@@ -0,0 +1,4 @@
1
+ import { Components, LibraryConfig, Router } from "./providers/types.js";
2
+ import { LibraryProvider, useLibConfig } from "./providers/LibraryProvider.js";
3
+ import { defineConfig } from "./config/defineConfig.js";
4
+ export { Components, LibraryConfig, LibraryProvider, Router, defineConfig, useLibConfig };
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import { LibraryProvider, useLibConfig } from "./providers/LibraryProvider.js";
2
+ import { defineConfig } from "./config/defineConfig.js";
3
+
4
+ export { LibraryProvider, defineConfig, useLibConfig };
@@ -0,0 +1,15 @@
1
+ import { LibraryConfig } from "./types.js";
2
+ import React from "react";
3
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region src/providers/LibraryProvider.d.ts
6
+ declare const LibraryProvider: ({
7
+ children,
8
+ config
9
+ }: {
10
+ children: React.ReactNode;
11
+ config: LibraryConfig;
12
+ }) => react_jsx_runtime0.JSX.Element;
13
+ declare const useLibConfig: () => LibraryConfig;
14
+ //#endregion
15
+ export { LibraryProvider, useLibConfig };
@@ -0,0 +1,21 @@
1
+ "use client";
2
+
3
+ import React, { createContext, useContext } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+
6
+ //#region src/providers/LibraryProvider.tsx
7
+ const LibraryContext = createContext(null);
8
+ const LibraryProvider = ({ children, config }) => {
9
+ return /* @__PURE__ */ jsx(LibraryContext.Provider, {
10
+ value: config,
11
+ children
12
+ });
13
+ };
14
+ const useLibConfig = () => {
15
+ const context = useContext(LibraryContext);
16
+ if (context === null) throw new Error("useLibraryConfig must be used within a LibraryProvider");
17
+ return context;
18
+ };
19
+
20
+ //#endregion
21
+ export { LibraryProvider, useLibConfig };
@@ -0,0 +1,18 @@
1
+ //#region src/providers/types.d.ts
2
+ interface LibraryConfig {
3
+ theme?: "light" | "dark";
4
+ rippleEffect?: boolean;
5
+ components?: Partial<Components>;
6
+ router: Router;
7
+ }
8
+ interface Components {
9
+ Link: React.ElementType;
10
+ Image: React.ElementType;
11
+ }
12
+ interface Router {
13
+ push: (url: string) => void;
14
+ replace: (url: string) => void;
15
+ back: () => void;
16
+ }
17
+ //#endregion
18
+ export { Components, LibraryConfig, Router };
@@ -0,0 +1,6 @@
1
+ import { ClassValue } from "clsx";
2
+
3
+ //#region src/utils/index.d.ts
4
+ declare function cn(...inputs: ClassValue[]): string;
5
+ //#endregion
6
+ export { cn };
@@ -0,0 +1,10 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ //#region src/utils/index.ts
5
+ function cn(...inputs) {
6
+ return twMerge(clsx(inputs));
7
+ }
8
+
9
+ //#endregion
10
+ export { cn };
package/package.json ADDED
@@ -0,0 +1,98 @@
1
+ {
2
+ "name": "components-library-mtx",
3
+ "version": "0.0.1",
4
+ "description": "A premium components library built with React, Tailwind CSS, and Framer Motion.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ },
14
+ "./button": {
15
+ "types": "./dist/components/Button.d.ts",
16
+ "import": "./dist/components/Button.js"
17
+ },
18
+ "./utils": {
19
+ "types": "./dist/utils/index.d.ts",
20
+ "import": "./dist/utils/index.js"
21
+ },
22
+ "./providers": {
23
+ "types": "./dist/providers/LibraryProvider.d.ts",
24
+ "import": "./dist/providers/LibraryProvider.js"
25
+ },
26
+ "./style.css": "./dist/index.css"
27
+ },
28
+ "sideEffects": [
29
+ "**/*.css"
30
+ ],
31
+ "files": [
32
+ "dist"
33
+ ],
34
+ "scripts": {
35
+ "dev": "tsdown --watch",
36
+ "build:js": "tsdown",
37
+ "build:css": "bunx @tailwindcss/cli -i ./src/index.css -o ./dist/index.css --minify",
38
+ "build": "bun run build:js && bun run build:css",
39
+ "prepare": "bun run build",
40
+ "prepublishOnly": "bun run build",
41
+ "test": "bun test",
42
+ "storybook": "storybook dev -p 6006",
43
+ "build-storybook": "storybook build",
44
+ "chromatic": "bunx chromatic --exit-zero-on-changes"
45
+ },
46
+ "devDependencies": {
47
+ "@chromatic-com/storybook": "^4.1.3",
48
+ "@storybook/addon-a11y": "^10.1.10",
49
+ "@storybook/addon-docs": "^10.1.10",
50
+ "@storybook/addon-vitest": "^10.1.10",
51
+ "@storybook/react-vite": "^10.1.10",
52
+ "@tailwindcss/postcss": "^4.0.0",
53
+ "@tailwindcss/vite": "^4.1.18",
54
+ "@types/react": "^19.0.0",
55
+ "@types/react-dom": "^19.0.0",
56
+ "@vitest/browser-playwright": "^4.0.16",
57
+ "@vitest/coverage-v8": "^4.0.16",
58
+ "chromatic": "^13.3.4",
59
+ "playwright": "^1.57.0",
60
+ "postcss": "^8.4.0",
61
+ "react": "^19.0.0",
62
+ "react-dom": "^19.0.0",
63
+ "storybook": "^10.1.10",
64
+ "tailwindcss": "^4.0.0",
65
+ "tsdown": "^0.18.3",
66
+ "vite-tsconfig-paths": "^6.0.3",
67
+ "vitest": "^4.0.16"
68
+ },
69
+ "peerDependencies": {
70
+ "react": "^19.0.0",
71
+ "react-dom": "^19.0.0"
72
+ },
73
+ "dependencies": {
74
+ "class-variance-authority": "^0.7.1",
75
+ "clsx": "^2.1.1",
76
+ "tailwind-merge": "^3.4.0"
77
+ },
78
+ "engines": {
79
+ "bun": "^1.3"
80
+ },
81
+ "license": "MIT",
82
+ "author": "Metax",
83
+ "repository": {
84
+ "type": "git",
85
+ "url": "git+https://github.com/Metax7/components-library.git"
86
+ },
87
+ "bugs": {
88
+ "url": "https://github.com/Metax7/components-library/issues"
89
+ },
90
+ "homepage": "https://github.com/Metax7/components-library#readme",
91
+ "keywords": [
92
+ "react",
93
+ "components",
94
+ "ui-library",
95
+ "tailwind",
96
+ "framer-motion"
97
+ ]
98
+ }