@rishabh-loylty/redemption-portal-ui 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/README.md +187 -0
- package/dist/index.cjs +87 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# Redemption Portal Central UI Library
|
|
2
|
+
|
|
3
|
+
This is a central UI library for use across Redemption Portal applications. It is built using React, TypeScript, and Tailwind CSS, following the patterns established by shadcn/ui.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install the package from npm:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i @rishabh-loylty/redemption-portal-ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Setup
|
|
14
|
+
|
|
15
|
+
This library requires specific configuration in your consuming application's `tailwind.config.js` to work correctly.
|
|
16
|
+
|
|
17
|
+
### 1. Configure Tailwind Content Path
|
|
18
|
+
|
|
19
|
+
Add the path to the library's components in the `content` array of your `tailwind.config.js` file. This ensures Tailwind scans the library's classes and generates the necessary CSS.
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
// tailwind.config.js
|
|
23
|
+
/** @type {import('tailwindcss').Config} */
|
|
24
|
+
module.exports = {
|
|
25
|
+
content: [
|
|
26
|
+
"./app/**/*.{js,ts,jsx,tsx}",
|
|
27
|
+
"./pages/**/*.{js,ts,jsx,tsx}",
|
|
28
|
+
"./components/**/*.{js,ts,jsx,tsx}",
|
|
29
|
+
// Add the library path
|
|
30
|
+
"./node_modules/@rishabh-loylty/redemption-portal-ui/dist/**/*.js",
|
|
31
|
+
],
|
|
32
|
+
theme: {
|
|
33
|
+
// ...
|
|
34
|
+
},
|
|
35
|
+
plugins: [],
|
|
36
|
+
};
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 2. Configure Tailwind Theme
|
|
40
|
+
|
|
41
|
+
The components in this library use custom theme variables inspired by shadcn/ui (e.g., `bg-primary`, `rounded-lg`). You **must** add these to your own `tailwind.config.js` `theme` object.
|
|
42
|
+
|
|
43
|
+
Below is the recommended base configuration. You can modify the color values to match your application's design system.
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
// tailwind.config.js
|
|
47
|
+
/** @type {import('tailwindcss').Config} */
|
|
48
|
+
module.exports = {
|
|
49
|
+
// ... (content array from above)
|
|
50
|
+
theme: {
|
|
51
|
+
container: {
|
|
52
|
+
center: true,
|
|
53
|
+
padding: "2rem",
|
|
54
|
+
screens: {
|
|
55
|
+
"2xl": "1400px",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
extend: {
|
|
59
|
+
colors: {
|
|
60
|
+
border: "hsl(var(--border))",
|
|
61
|
+
input: "hsl(var(--input))",
|
|
62
|
+
ring: "hsl(var(--ring))",
|
|
63
|
+
background: "hsl(var(--background))",
|
|
64
|
+
foreground: "hsl(var(--foreground))",
|
|
65
|
+
primary: {
|
|
66
|
+
DEFAULT: "hsl(var(--primary))",
|
|
67
|
+
foreground: "hsl(var(--primary-foreground))",
|
|
68
|
+
},
|
|
69
|
+
secondary: {
|
|
70
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
71
|
+
foreground: "hsl(var(--secondary-foreground))",
|
|
72
|
+
},
|
|
73
|
+
destructive: {
|
|
74
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
75
|
+
foreground: "hsl(var(--destructive-foreground))",
|
|
76
|
+
},
|
|
77
|
+
muted: {
|
|
78
|
+
DEFAULT: "hsl(var(--muted))",
|
|
79
|
+
foreground: "hsl(var(--muted-foreground))",
|
|
80
|
+
},
|
|
81
|
+
accent: {
|
|
82
|
+
DEFAULT: "hsl(var(--accent))",
|
|
83
|
+
foreground: "hsl(var(--accent-foreground))",
|
|
84
|
+
},
|
|
85
|
+
popover: {
|
|
86
|
+
DEFAULT: "hsl(var(--popover))",
|
|
87
|
+
foreground: "hsl(var(--popover-foreground))",
|
|
88
|
+
},
|
|
89
|
+
card: {
|
|
90
|
+
DEFAULT: "hsl(var(--card))",
|
|
91
|
+
foreground: "hsl(var(--card-foreground))",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
borderRadius: {
|
|
95
|
+
lg: "var(--radius)",
|
|
96
|
+
md: "calc(var(--radius) - 2px)",
|
|
97
|
+
sm: "calc(var(--radius) - 4px)",
|
|
98
|
+
},
|
|
99
|
+
keyframes: {
|
|
100
|
+
"accordion-down": {
|
|
101
|
+
from: { height: "0" },
|
|
102
|
+
to: { height: "var(--radix-accordion-content-height)" },
|
|
103
|
+
},
|
|
104
|
+
"accordion-up": {
|
|
105
|
+
from: { height: "var(--radix-accordion-content-height)" },
|
|
106
|
+
to: { height: "0" },
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
animation: {
|
|
110
|
+
"accordion-down": "accordion-down 0.2s ease-out",
|
|
111
|
+
"accordion-up": "accordion-up 0.2s ease-out",
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
plugins: [require("tailwindcss-animate")],
|
|
116
|
+
};
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
You will also need to define the CSS variables, typically in your global CSS file (e.g., `globals.css`):
|
|
120
|
+
|
|
121
|
+
```css
|
|
122
|
+
/* globals.css */
|
|
123
|
+
@tailwind base;
|
|
124
|
+
@tailwind components;
|
|
125
|
+
@tailwind utilities;
|
|
126
|
+
|
|
127
|
+
@layer base {
|
|
128
|
+
:root {
|
|
129
|
+
--background: 0 0% 100%;
|
|
130
|
+
--foreground: 222.2 84% 4.9%;
|
|
131
|
+
--card: 0 0% 100%;
|
|
132
|
+
--card-foreground: 222.2 84% 4.9%;
|
|
133
|
+
--popover: 0 0% 100%;
|
|
134
|
+
--popover-foreground: 222.2 84% 4.9%;
|
|
135
|
+
--primary: 222.2 47.4% 11.2%;
|
|
136
|
+
--primary-foreground: 210 40% 98%;
|
|
137
|
+
--secondary: 210 40% 96.1%;
|
|
138
|
+
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
139
|
+
--muted: 210 40% 96.1%;
|
|
140
|
+
--muted-foreground: 215.4 16.3% 46.9%;
|
|
141
|
+
--accent: 210 40% 96.1%;
|
|
142
|
+
--accent-foreground: 222.2 47.4% 11.2%;
|
|
143
|
+
--destructive: 0 84.2% 60.2%;
|
|
144
|
+
--destructive-foreground: 210 40% 98%;
|
|
145
|
+
--border: 214.3 31.8% 91.4%;
|
|
146
|
+
--input: 214.3 31.8% 91.4%;
|
|
147
|
+
--ring: 222.2 84% 4.9%;
|
|
148
|
+
--radius: 0.5rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.dark {
|
|
152
|
+
/* ... Define dark mode colors here if needed */
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Finally, you will need to install `tailwindcss-animate`:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npm i tailwindcss-animate
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Usage Example
|
|
164
|
+
|
|
165
|
+
```jsx
|
|
166
|
+
import { Button } from "@rishabh-loylty/redemption-portal-ui";
|
|
167
|
+
|
|
168
|
+
export default function MyPage() {
|
|
169
|
+
return <Button variant="outline">Click Me</Button>;
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## For Library Maintainers
|
|
176
|
+
|
|
177
|
+
### Publishing a New Version
|
|
178
|
+
|
|
179
|
+
1. Increment the version number:
|
|
180
|
+
```bash
|
|
181
|
+
npm version patch # or minor, major
|
|
182
|
+
```
|
|
183
|
+
2. Publish to npm:
|
|
184
|
+
```bash
|
|
185
|
+
npm publish --access public
|
|
186
|
+
```
|
|
187
|
+
The `prepublishOnly` script will automatically build the project.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
5
|
+
var clsx = require('clsx');
|
|
6
|
+
var tailwindMerge = require('tailwind-merge');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
var react = require('@heroui/react');
|
|
9
|
+
|
|
10
|
+
function _interopNamespace(e) {
|
|
11
|
+
if (e && e.__esModule) return e;
|
|
12
|
+
var n = Object.create(null);
|
|
13
|
+
if (e) {
|
|
14
|
+
Object.keys(e).forEach(function (k) {
|
|
15
|
+
if (k !== 'default') {
|
|
16
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () { return e[k]; }
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
n.default = e;
|
|
25
|
+
return Object.freeze(n);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
29
|
+
|
|
30
|
+
// src/components/ui/button.tsx
|
|
31
|
+
function cn(...inputs) {
|
|
32
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
33
|
+
}
|
|
34
|
+
var buttonVariants = classVarianceAuthority.cva(
|
|
35
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
36
|
+
{
|
|
37
|
+
variants: {
|
|
38
|
+
variant: {
|
|
39
|
+
default: "bg-primary text-primary-foreground hover:opacity-90",
|
|
40
|
+
secondary: "bg-secondary text-secondary-foreground hover:opacity-90",
|
|
41
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
42
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
43
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
44
|
+
destructive: "bg-destructive text-destructive-foreground hover:opacity-90"
|
|
45
|
+
},
|
|
46
|
+
size: {
|
|
47
|
+
default: "h-10 px-4 py-2",
|
|
48
|
+
sm: "h-9 rounded-md px-3",
|
|
49
|
+
lg: "h-11 rounded-md px-8",
|
|
50
|
+
icon: "h-10 w-10"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
variant: "default",
|
|
55
|
+
size: "default"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
var Button = React__namespace.forwardRef(
|
|
60
|
+
({ className, variant, size, ...props }, ref) => {
|
|
61
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
+
"button",
|
|
63
|
+
{
|
|
64
|
+
ref,
|
|
65
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
66
|
+
...props
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
Button.displayName = "Button";
|
|
72
|
+
|
|
73
|
+
Object.defineProperty(exports, "HeroUIProvider", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: function () { return react.HeroUIProvider; }
|
|
76
|
+
});
|
|
77
|
+
exports.Button = Button;
|
|
78
|
+
exports.buttonVariants = buttonVariants;
|
|
79
|
+
exports.cn = cn;
|
|
80
|
+
Object.keys(react).forEach(function (k) {
|
|
81
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function () { return react[k]; }
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=index.cjs.map
|
|
87
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/components/ui/button.tsx"],"names":["twMerge","clsx","cva","React","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACDA,IAAM,cAAA,GAAiBC,0BAAA;AAAA,EACrB,qOAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EAAS,qDAAA;AAAA,QACT,SAAA,EAAW,yDAAA;AAAA,QACX,OAAA,EAAS,gFAAA;AAAA,QACT,KAAA,EAAO,8CAAA;AAAA,QACP,IAAA,EAAM,iDAAA;AAAA,QACN,WAAA,EAAa;AAAA,OACf;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,OAAA,EAAS,gBAAA;AAAA,QACT,EAAA,EAAI,qBAAA;AAAA,QACJ,EAAA,EAAI,sBAAA;AAAA,QACJ,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACR;AAEJ;AAMO,IAAM,MAAA,GAAeC,gBAAA,CAAA,UAAA;AAAA,EAC1B,CAAC,EAAE,SAAA,EAAW,OAAA,EAAS,MAAM,GAAG,KAAA,IAAS,GAAA,KAAQ;AAC/C,IAAA,uBACEC,cAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,GAAG,SAAS,CAAA;AAAA,QACzD,GAAG;AAAA;AAAA,KACN;AAAA,EAEJ;AACF;AAEA,MAAA,CAAO,WAAA,GAAc,QAAA","file":"index.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:opacity-90\",\n secondary: \"bg-secondary text-secondary-foreground hover:opacity-90\",\n outline: \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n destructive: \"bg-destructive text-destructive-foreground hover:opacity-90\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, ...props }, ref) => {\n return (\n <button\n ref={ref}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n />\n );\n }\n);\n\nButton.displayName = \"Button\";\n\nexport { buttonVariants };"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { ClassValue } from 'clsx';
|
|
5
|
+
export * from '@heroui/react';
|
|
6
|
+
export { HeroUIProvider } from '@heroui/react';
|
|
7
|
+
|
|
8
|
+
declare const buttonVariants: (props?: ({
|
|
9
|
+
variant?: "default" | "secondary" | "outline" | "ghost" | "link" | "destructive" | null | undefined;
|
|
10
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
13
|
+
}
|
|
14
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
|
|
16
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
17
|
+
|
|
18
|
+
export { Button, buttonVariants, cn };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { ClassValue } from 'clsx';
|
|
5
|
+
export * from '@heroui/react';
|
|
6
|
+
export { HeroUIProvider } from '@heroui/react';
|
|
7
|
+
|
|
8
|
+
declare const buttonVariants: (props?: ({
|
|
9
|
+
variant?: "default" | "secondary" | "outline" | "ghost" | "link" | "destructive" | null | undefined;
|
|
10
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
13
|
+
}
|
|
14
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
|
|
16
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
17
|
+
|
|
18
|
+
export { Button, buttonVariants, cn };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
export * from '@heroui/react';
|
|
7
|
+
export { HeroUIProvider } from '@heroui/react';
|
|
8
|
+
|
|
9
|
+
// src/components/ui/button.tsx
|
|
10
|
+
function cn(...inputs) {
|
|
11
|
+
return twMerge(clsx(inputs));
|
|
12
|
+
}
|
|
13
|
+
var buttonVariants = cva(
|
|
14
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
15
|
+
{
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
default: "bg-primary text-primary-foreground hover:opacity-90",
|
|
19
|
+
secondary: "bg-secondary text-secondary-foreground hover:opacity-90",
|
|
20
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
21
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
22
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
23
|
+
destructive: "bg-destructive text-destructive-foreground hover:opacity-90"
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
default: "h-10 px-4 py-2",
|
|
27
|
+
sm: "h-9 rounded-md px-3",
|
|
28
|
+
lg: "h-11 rounded-md px-8",
|
|
29
|
+
icon: "h-10 w-10"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: {
|
|
33
|
+
variant: "default",
|
|
34
|
+
size: "default"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
var Button = React.forwardRef(
|
|
39
|
+
({ className, variant, size, ...props }, ref) => {
|
|
40
|
+
return /* @__PURE__ */ jsx(
|
|
41
|
+
"button",
|
|
42
|
+
{
|
|
43
|
+
ref,
|
|
44
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
45
|
+
...props
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
Button.displayName = "Button";
|
|
51
|
+
|
|
52
|
+
export { Button, buttonVariants, cn };
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/components/ui/button.tsx"],"names":[],"mappings":";;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACDA,IAAM,cAAA,GAAiB,GAAA;AAAA,EACrB,qOAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EAAS,qDAAA;AAAA,QACT,SAAA,EAAW,yDAAA;AAAA,QACX,OAAA,EAAS,gFAAA;AAAA,QACT,KAAA,EAAO,8CAAA;AAAA,QACP,IAAA,EAAM,iDAAA;AAAA,QACN,WAAA,EAAa;AAAA,OACf;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,OAAA,EAAS,gBAAA;AAAA,QACT,EAAA,EAAI,qBAAA;AAAA,QACJ,EAAA,EAAI,sBAAA;AAAA,QACJ,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACR;AAEJ;AAMO,IAAM,MAAA,GAAe,KAAA,CAAA,UAAA;AAAA,EAC1B,CAAC,EAAE,SAAA,EAAW,OAAA,EAAS,MAAM,GAAG,KAAA,IAAS,GAAA,KAAQ;AAC/C,IAAA,uBACE,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,GAAG,cAAA,CAAe,EAAE,SAAS,IAAA,EAAM,GAAG,SAAS,CAAA;AAAA,QACzD,GAAG;AAAA;AAAA,KACN;AAAA,EAEJ;AACF;AAEA,MAAA,CAAO,WAAA,GAAc,QAAA","file":"index.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:opacity-90\",\n secondary: \"bg-secondary text-secondary-foreground hover:opacity-90\",\n outline: \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n destructive: \"bg-destructive text-destructive-foreground hover:opacity-90\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n sm: \"h-9 rounded-md px-3\",\n lg: \"h-11 rounded-md px-8\",\n icon: \"h-10 w-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, ...props }, ref) => {\n return (\n <button\n ref={ref}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n />\n );\n }\n);\n\nButton.displayName = \"Button\";\n\nexport { buttonVariants };"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rishabh-loylty/redemption-portal-ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
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
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsup",
|
|
22
|
+
"prepublishOnly": "npm run build"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@heroui/react": ">=2.8.8",
|
|
26
|
+
"react": ">=18",
|
|
27
|
+
"react-dom": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/react": "^18",
|
|
31
|
+
"@types/react-dom": "^18",
|
|
32
|
+
"tsup": "^8",
|
|
33
|
+
"typescript": "^5"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"class-variance-authority": "^0.7.1",
|
|
37
|
+
"clsx": "^2.1.1",
|
|
38
|
+
"tailwind-merge": "^3.4.0"
|
|
39
|
+
}
|
|
40
|
+
}
|