@sunaina-dev/ui-library 1.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.
- package/README.md +46 -0
- package/dist/components/Button/Button.d.ts +9 -0
- package/dist/components/Card/Card.d.ts +8 -0
- package/dist/components/Carousel/Carousel.d.ts +9 -0
- package/dist/components/Chart/Chart.d.ts +15 -0
- package/dist/components/Heading/Heading.d.ts +12 -0
- package/dist/components/Input/Input.d.ts +10 -0
- package/dist/components/Navbar/Navbar.d.ts +19 -0
- package/dist/components/Table/Table.d.ts +16 -0
- package/dist/components/Video/Video.d.ts +13 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.mjs +347 -0
- package/dist/index.umd.js +1 -0
- package/dist/style.css +1 -0
- package/package.json +59 -0
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Custom UI Component Library
|
|
2
|
+
|
|
3
|
+
This is a reusable UI component library built using React, TypeScript, and Tailwind CSS.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
* Reusable UI components (Button, Card, Input, etc.)
|
|
8
|
+
* Styled using Tailwind CSS
|
|
9
|
+
* Type-safe with TypeScript
|
|
10
|
+
* Simple and modular structure
|
|
11
|
+
|
|
12
|
+
## Project Structure
|
|
13
|
+
|
|
14
|
+
* src/components — contains all UI components
|
|
15
|
+
* src/index.tsx — main entry point
|
|
16
|
+
* src/index.css — global styles
|
|
17
|
+
|
|
18
|
+
## Tech Stack
|
|
19
|
+
|
|
20
|
+
* React
|
|
21
|
+
* TypeScript
|
|
22
|
+
* Tailwind CSS
|
|
23
|
+
|
|
24
|
+
## Getting Started
|
|
25
|
+
|
|
26
|
+
Install dependencies:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Run the development server:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm run dev
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Run Storybook (for individual component preview):
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm run storybook
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Author
|
|
45
|
+
|
|
46
|
+
Sunaina
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ChartDataPoint {
|
|
4
|
+
label: string;
|
|
5
|
+
value: number;
|
|
6
|
+
color?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ChartProps {
|
|
9
|
+
data: ChartDataPoint[];
|
|
10
|
+
type?: 'bar' | 'line';
|
|
11
|
+
height?: number;
|
|
12
|
+
title?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const Chart: React.FC<ChartProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
4
|
+
interface HeadingProps {
|
|
5
|
+
title: string;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
level?: HeadingLevel | `${HeadingLevel}`;
|
|
8
|
+
align?: 'left' | 'center' | 'right';
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const Heading: React.FC<HeadingProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface InputProps {
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
type?: 'text' | 'email' | 'password';
|
|
8
|
+
}
|
|
9
|
+
export declare const Input: React.FC<InputProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface NavItem {
|
|
4
|
+
label: string;
|
|
5
|
+
active?: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface NavbarProps {
|
|
9
|
+
logo?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
items: NavItem[];
|
|
13
|
+
actionLabel?: string;
|
|
14
|
+
onActionClick?: () => void;
|
|
15
|
+
className?: string;
|
|
16
|
+
containerClassName?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const Navbar: React.FC<NavbarProps>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface TableColumn<Row> {
|
|
4
|
+
header: string;
|
|
5
|
+
accessor: keyof Row;
|
|
6
|
+
align?: 'left' | 'center' | 'right';
|
|
7
|
+
render?: (value: Row[keyof Row], row: Row) => React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
interface TableProps<Row> {
|
|
10
|
+
columns: TableColumn<Row>[];
|
|
11
|
+
data: Row[];
|
|
12
|
+
zebra?: boolean;
|
|
13
|
+
rowKey?: (row: Row) => string | number;
|
|
14
|
+
}
|
|
15
|
+
export declare const Table: <Row>({ columns, data, rowKey, zebra }: TableProps<Row>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
interface VideoProps {
|
|
4
|
+
src: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
poster?: string;
|
|
7
|
+
autoPlay?: boolean;
|
|
8
|
+
muted?: boolean;
|
|
9
|
+
loop?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Video: React.FC<VideoProps>;
|
|
13
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
export { Button } from './components/Button/Button';
|
|
3
|
+
export { Card } from './components/Card/Card';
|
|
4
|
+
export { Carousel } from './components/Carousel/Carousel';
|
|
5
|
+
export { Chart } from './components/Chart/Chart';
|
|
6
|
+
export { Heading } from './components/Heading/Heading';
|
|
7
|
+
export { Input } from './components/Input/Input';
|
|
8
|
+
export { Navbar } from './components/Navbar/Navbar';
|
|
9
|
+
export { Table } from './components/Table/Table';
|
|
10
|
+
export { Video } from './components/Video/Video';
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { jsx as e, jsxs as a, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useMemo as g } from "react";
|
|
3
|
+
const C = ({ children: t, onClick: l, variant: s = "primary" }) => /* @__PURE__ */ e(
|
|
4
|
+
"button",
|
|
5
|
+
{
|
|
6
|
+
onClick: l,
|
|
7
|
+
className: `px-4 py-2 rounded font-medium focus:outline-none focus:ring-2 focus:ring-offset-2 ${s === "primary" ? "bg-blue-500 text-white hover:bg-blue-600 focus:ring-blue-500" : "bg-gray-500 text-white hover:bg-gray-600 focus:ring-gray-500"}`,
|
|
8
|
+
children: t
|
|
9
|
+
}
|
|
10
|
+
), j = ({ children: t, title: l }) => /* @__PURE__ */ a("div", { className: "bg-white shadow-md rounded-lg p-6 max-w-sm", children: [
|
|
11
|
+
l && /* @__PURE__ */ e("h3", { className: "text-lg font-semibold mb-4", children: l }),
|
|
12
|
+
/* @__PURE__ */ e("div", { children: t })
|
|
13
|
+
] }), S = ({
|
|
14
|
+
images: t,
|
|
15
|
+
orientation: l = "horizontal",
|
|
16
|
+
className: s = ""
|
|
17
|
+
}) => {
|
|
18
|
+
const [c, n] = f(0), d = t.length, o = t[c], i = l === "vertical", m = i ? "flex-col" : "flex-row", u = g(
|
|
19
|
+
() => /* @__PURE__ */ a("div", { className: `flex ${i ? "flex-col gap-3" : "items-center gap-3"}`, children: [
|
|
20
|
+
/* @__PURE__ */ e(
|
|
21
|
+
"button",
|
|
22
|
+
{
|
|
23
|
+
type: "button",
|
|
24
|
+
onClick: () => n((r) => (r - 1 + d) % d),
|
|
25
|
+
className: "inline-flex items-center justify-center rounded-2xl border border-slate-200 bg-white px-5 py-3 text-sm font-medium text-slate-700 shadow-sm transition hover:border-slate-300 hover:bg-slate-50",
|
|
26
|
+
children: "Previous"
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ e(
|
|
30
|
+
"button",
|
|
31
|
+
{
|
|
32
|
+
type: "button",
|
|
33
|
+
onClick: () => n((r) => (r + 1) % d),
|
|
34
|
+
className: "inline-flex items-center justify-center rounded-2xl border border-slate-200 bg-white px-5 py-3 text-sm font-medium text-slate-700 shadow-sm transition hover:border-slate-300 hover:bg-slate-50",
|
|
35
|
+
children: "Next"
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
] }),
|
|
39
|
+
[i, d]
|
|
40
|
+
);
|
|
41
|
+
return t.length === 0 ? /* @__PURE__ */ e("div", { className: `rounded-3xl border border-slate-200 bg-white p-8 text-center text-slate-500 shadow-sm ${s}`, children: "No images available." }) : /* @__PURE__ */ e("div", { className: `rounded-3xl border border-slate-200 bg-white p-5 shadow-xl ${s}`, children: /* @__PURE__ */ a("div", { className: `flex flex-wrap gap-5 ${i ? "flex-col" : "flex-row"}`, children: [
|
|
42
|
+
/* @__PURE__ */ a("div", { className: `relative overflow-hidden rounded-3xl bg-slate-950 shadow-inner ${i ? "w-full" : "flex-1"}`, children: [
|
|
43
|
+
/* @__PURE__ */ e(
|
|
44
|
+
"img",
|
|
45
|
+
{
|
|
46
|
+
src: o,
|
|
47
|
+
alt: `Slide ${c + 1}`,
|
|
48
|
+
className: "h-80 w-full object-cover transition duration-500 ease-out sm:h-[420px]"
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ e("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-slate-950/90 to-transparent px-5 py-4 text-sm text-white", children: /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-3", children: [
|
|
52
|
+
/* @__PURE__ */ e("span", { children: `Slide ${c + 1} of ${d}` }),
|
|
53
|
+
/* @__PURE__ */ e("span", { className: "rounded-full bg-slate-900/70 px-3 py-1 text-xs uppercase tracking-[0.18em] text-slate-300", children: l })
|
|
54
|
+
] }) })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ a("div", { className: `flex ${i ? "flex-row flex-wrap justify-center gap-3" : "flex-col justify-between"} items-center ${i ? "" : "w-40"}`, children: [
|
|
57
|
+
u,
|
|
58
|
+
/* @__PURE__ */ e("div", { className: `flex ${m} flex-wrap items-center justify-center gap-3 ${i ? "" : "mt-4"}`, children: t.map((r, x) => /* @__PURE__ */ e(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
type: "button",
|
|
62
|
+
onClick: () => n(x),
|
|
63
|
+
className: `overflow-hidden rounded-2xl border shadow-sm transition duration-200 ${x === c ? "border-blue-500 ring-2 ring-blue-200" : "border-slate-200 hover:border-slate-300"} ${i ? "h-20 w-24" : "h-20 w-full"} `,
|
|
64
|
+
children: /* @__PURE__ */ e("img", { src: r, alt: `Preview ${x + 1}`, className: "h-full w-full object-cover" })
|
|
65
|
+
},
|
|
66
|
+
r
|
|
67
|
+
)) })
|
|
68
|
+
] })
|
|
69
|
+
] }) });
|
|
70
|
+
}, M = ({
|
|
71
|
+
data: t,
|
|
72
|
+
type: l = "bar",
|
|
73
|
+
height: s = 320,
|
|
74
|
+
title: c,
|
|
75
|
+
className: n = ""
|
|
76
|
+
}) => {
|
|
77
|
+
const d = Math.max(...t.map((r) => r.value), 1), o = 40, i = 700, m = i - o * 2, u = m / Math.max(t.length - 1, 1);
|
|
78
|
+
return /* @__PURE__ */ a("div", { className: `rounded-3xl border border-slate-200 bg-white p-6 shadow-sm ${n}`, children: [
|
|
79
|
+
c && /* @__PURE__ */ e("h3", { className: "mb-4 text-xl font-semibold text-slate-900", children: c }),
|
|
80
|
+
/* @__PURE__ */ e("div", { className: "overflow-hidden rounded-3xl border border-slate-100 bg-slate-50/80 p-4 shadow-sm", children: /* @__PURE__ */ a("svg", { viewBox: `0 0 ${i} ${s}`, className: "h-full w-full", children: [
|
|
81
|
+
/* @__PURE__ */ e("defs", { children: /* @__PURE__ */ a("linearGradient", { id: "chartGradient", x1: "0", x2: "0", y1: "0", y2: "1", children: [
|
|
82
|
+
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: "#0ea5e9", stopOpacity: "0.85" }),
|
|
83
|
+
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: "#0ea5e9", stopOpacity: "0.12" })
|
|
84
|
+
] }) }),
|
|
85
|
+
/* @__PURE__ */ a("g", { transform: `translate(${o}, ${o})`, children: [
|
|
86
|
+
Array.from({ length: 5 }).map((r, x) => {
|
|
87
|
+
const h = (s - o * 2) / 4 * x;
|
|
88
|
+
return /* @__PURE__ */ a("g", { children: [
|
|
89
|
+
/* @__PURE__ */ e(
|
|
90
|
+
"line",
|
|
91
|
+
{
|
|
92
|
+
x1: 0,
|
|
93
|
+
y1: h,
|
|
94
|
+
x2: m,
|
|
95
|
+
y2: h,
|
|
96
|
+
stroke: "#e2e8f0",
|
|
97
|
+
strokeWidth: "1"
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ e("text", { x: -10, y: h + 5, textAnchor: "end", fontSize: "10", fill: "#64748b", children: Math.round(d - d / 4 * x) })
|
|
101
|
+
] }, x);
|
|
102
|
+
}),
|
|
103
|
+
l === "bar" ? t.map((r, x) => {
|
|
104
|
+
const h = (s - o * 2) * r.value / d, b = x * (u * 0.9 + 10);
|
|
105
|
+
return /* @__PURE__ */ a("g", { children: [
|
|
106
|
+
/* @__PURE__ */ e(
|
|
107
|
+
"rect",
|
|
108
|
+
{
|
|
109
|
+
x: b,
|
|
110
|
+
y: s - o * 2 - h,
|
|
111
|
+
width: u * 0.3,
|
|
112
|
+
height: h,
|
|
113
|
+
rx: "10",
|
|
114
|
+
fill: r.color || "#0ea5e9"
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
/* @__PURE__ */ e("text", { x: b + u * 0.15, y: s - o * 2 + 18, textAnchor: "middle", fontSize: "10", fill: "#334155", children: r.label })
|
|
118
|
+
] }, r.label);
|
|
119
|
+
}) : /* @__PURE__ */ a(p, { children: [
|
|
120
|
+
/* @__PURE__ */ e(
|
|
121
|
+
"path",
|
|
122
|
+
{
|
|
123
|
+
d: t.map((r, x) => {
|
|
124
|
+
const h = x * u, b = s - o * 2 - (s - o * 2) * r.value / d;
|
|
125
|
+
return `${x === 0 ? "M" : "L"} ${h} ${b}`;
|
|
126
|
+
}).join(" "),
|
|
127
|
+
fill: "none",
|
|
128
|
+
stroke: "#0ea5e9",
|
|
129
|
+
strokeWidth: "4",
|
|
130
|
+
strokeLinecap: "round",
|
|
131
|
+
strokeLinejoin: "round"
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
t.map((r, x) => {
|
|
135
|
+
const h = x * u, b = s - o * 2 - (s - o * 2) * r.value / d;
|
|
136
|
+
return /* @__PURE__ */ e(
|
|
137
|
+
"circle",
|
|
138
|
+
{
|
|
139
|
+
cx: h,
|
|
140
|
+
cy: b,
|
|
141
|
+
r: "6",
|
|
142
|
+
fill: r.color || "#0ea5e9",
|
|
143
|
+
stroke: "#ffffff",
|
|
144
|
+
strokeWidth: "2"
|
|
145
|
+
},
|
|
146
|
+
r.label
|
|
147
|
+
);
|
|
148
|
+
})
|
|
149
|
+
] })
|
|
150
|
+
] })
|
|
151
|
+
] }) })
|
|
152
|
+
] });
|
|
153
|
+
}, v = {
|
|
154
|
+
1: "text-5xl md:text-6xl",
|
|
155
|
+
2: "text-4xl md:text-5xl",
|
|
156
|
+
3: "text-3xl md:text-4xl",
|
|
157
|
+
4: "text-2xl md:text-3xl",
|
|
158
|
+
5: "text-xl md:text-2xl",
|
|
159
|
+
6: "text-lg md:text-xl"
|
|
160
|
+
}, w = {
|
|
161
|
+
left: "text-left",
|
|
162
|
+
center: "text-center",
|
|
163
|
+
right: "text-right"
|
|
164
|
+
}, y = (t) => {
|
|
165
|
+
if (typeof t == "number")
|
|
166
|
+
return t;
|
|
167
|
+
if (typeof t == "string") {
|
|
168
|
+
const l = Number(t);
|
|
169
|
+
if ([1, 2, 3, 4, 5, 6].includes(l))
|
|
170
|
+
return l;
|
|
171
|
+
}
|
|
172
|
+
return 1;
|
|
173
|
+
}, I = ({
|
|
174
|
+
title: t,
|
|
175
|
+
subtitle: l,
|
|
176
|
+
level: s = 1,
|
|
177
|
+
align: c = "left",
|
|
178
|
+
className: n = ""
|
|
179
|
+
}) => {
|
|
180
|
+
const d = y(s), o = `h${d}`;
|
|
181
|
+
return /* @__PURE__ */ a("div", { className: `max-w-3xl rounded-3xl border border-slate-200 bg-slate-50/80 p-6 shadow-sm ${w[c]} ${n}`, children: [
|
|
182
|
+
/* @__PURE__ */ e(o, { className: `${v[d]} font-semibold tracking-tight text-slate-900`, children: t }),
|
|
183
|
+
l && /* @__PURE__ */ e("p", { className: "mt-3 max-w-2xl text-base leading-7 text-slate-600", children: l }),
|
|
184
|
+
/* @__PURE__ */ e("div", { className: "mt-6 h-1 w-24 rounded-full bg-gradient-to-r from-sky-500 to-indigo-500" })
|
|
185
|
+
] });
|
|
186
|
+
}, L = ({ placeholder: t, value: l, onChange: s, type: c = "text" }) => /* @__PURE__ */ e(
|
|
187
|
+
"input",
|
|
188
|
+
{
|
|
189
|
+
type: c,
|
|
190
|
+
placeholder: t,
|
|
191
|
+
value: l,
|
|
192
|
+
onChange: s,
|
|
193
|
+
className: "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
|
194
|
+
}
|
|
195
|
+
), z = ({
|
|
196
|
+
logo: t,
|
|
197
|
+
title: l,
|
|
198
|
+
subtitle: s = "Modern UI navigation",
|
|
199
|
+
items: c,
|
|
200
|
+
actionLabel: n,
|
|
201
|
+
onActionClick: d,
|
|
202
|
+
className: o = "",
|
|
203
|
+
containerClassName: i = ""
|
|
204
|
+
}) => {
|
|
205
|
+
const [m, u] = f(!1);
|
|
206
|
+
return /* @__PURE__ */ a("header", { className: `w-full border-b bg-white shadow-sm ${o}`, children: [
|
|
207
|
+
/* @__PURE__ */ a("div", { className: "flex w-full max-w-7xl mx-auto items-center justify-between px-4 sm:px-6 py-4", children: [
|
|
208
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
|
|
209
|
+
t && /* @__PURE__ */ e(
|
|
210
|
+
"img",
|
|
211
|
+
{
|
|
212
|
+
src: t,
|
|
213
|
+
alt: "Logo",
|
|
214
|
+
className: "h-10 w-10 rounded-xl object-cover"
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
/* @__PURE__ */ a("div", { children: [
|
|
218
|
+
l && /* @__PURE__ */ e("p", { className: "text-lg font-semibold text-slate-900", children: l }),
|
|
219
|
+
s && /* @__PURE__ */ e("p", { className: "text-sm text-slate-500", children: s })
|
|
220
|
+
] })
|
|
221
|
+
] }),
|
|
222
|
+
/* @__PURE__ */ e("nav", { className: "hidden md:flex items-center gap-2", children: c.map((r) => /* @__PURE__ */ e(
|
|
223
|
+
"button",
|
|
224
|
+
{
|
|
225
|
+
onClick: r.onClick,
|
|
226
|
+
className: `rounded-full px-4 py-2 text-sm font-medium transition ${r.active ? "bg-slate-900 text-white" : "text-slate-600 hover:bg-slate-100"}`,
|
|
227
|
+
children: r.label
|
|
228
|
+
},
|
|
229
|
+
r.label
|
|
230
|
+
)) }),
|
|
231
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
|
|
232
|
+
n && /* @__PURE__ */ e(
|
|
233
|
+
"button",
|
|
234
|
+
{
|
|
235
|
+
onClick: d,
|
|
236
|
+
className: "rounded-full bg-slate-900 px-5 py-2 text-sm text-white hover:bg-slate-800",
|
|
237
|
+
children: n
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
/* @__PURE__ */ e(
|
|
241
|
+
"button",
|
|
242
|
+
{
|
|
243
|
+
onClick: () => u(!m),
|
|
244
|
+
className: "md:hidden border px-3 py-2 rounded",
|
|
245
|
+
children: "Menu"
|
|
246
|
+
}
|
|
247
|
+
)
|
|
248
|
+
] })
|
|
249
|
+
] }),
|
|
250
|
+
m && /* @__PURE__ */ e("div", { className: "md:hidden px-6 pb-4 space-y-2", children: c.map((r) => /* @__PURE__ */ e(
|
|
251
|
+
"button",
|
|
252
|
+
{
|
|
253
|
+
onClick: () => {
|
|
254
|
+
var x;
|
|
255
|
+
(x = r.onClick) == null || x.call(r), u(!1);
|
|
256
|
+
},
|
|
257
|
+
className: "block w-full text-left px-4 py-2 rounded hover:bg-gray-100",
|
|
258
|
+
children: r.label
|
|
259
|
+
},
|
|
260
|
+
r.label
|
|
261
|
+
)) })
|
|
262
|
+
] });
|
|
263
|
+
}, W = ({ columns: t, data: l, rowKey: s, zebra: c }) => /* @__PURE__ */ e("div", { className: "rounded-xl border bg-white shadow-sm overflow-hidden", children: /* @__PURE__ */ a("table", { className: "w-full text-sm border-collapse", children: [
|
|
264
|
+
/* @__PURE__ */ e("thead", { className: "bg-slate-100 border-b", children: /* @__PURE__ */ e("tr", { children: t.map((n) => /* @__PURE__ */ e(
|
|
265
|
+
"th",
|
|
266
|
+
{
|
|
267
|
+
className: `px-6 py-3 text-xs font-semibold text-slate-500 uppercase ${n.align === "center" ? "text-center" : n.align === "right" ? "text-right" : "text-left"}`,
|
|
268
|
+
children: n.header
|
|
269
|
+
},
|
|
270
|
+
String(n.accessor)
|
|
271
|
+
)) }) }),
|
|
272
|
+
/* @__PURE__ */ e("tbody", { children: l.map((n, d) => {
|
|
273
|
+
const o = s ? s(n) : d, i = d % 2 === 0;
|
|
274
|
+
return /* @__PURE__ */ e(
|
|
275
|
+
"tr",
|
|
276
|
+
{
|
|
277
|
+
className: `border-b hover:bg-slate-50 transition-colors ${c && i ? "bg-slate-50" : ""}`,
|
|
278
|
+
children: t.map((m) => {
|
|
279
|
+
const u = n[m.accessor];
|
|
280
|
+
return /* @__PURE__ */ e(
|
|
281
|
+
"td",
|
|
282
|
+
{
|
|
283
|
+
className: `px-6 py-4 ${m.align === "center" ? "text-center" : m.align === "right" ? "text-right" : "text-left"}`,
|
|
284
|
+
children: m.render ? m.render(u, n) : u
|
|
285
|
+
},
|
|
286
|
+
String(m.accessor)
|
|
287
|
+
);
|
|
288
|
+
})
|
|
289
|
+
},
|
|
290
|
+
o
|
|
291
|
+
);
|
|
292
|
+
}) })
|
|
293
|
+
] }) }), N = (t) => {
|
|
294
|
+
const l = t.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&\n?#]+)/);
|
|
295
|
+
return l ? `https://www.youtube.com/embed/${l[1]}?rel=0` : t;
|
|
296
|
+
}, A = ({
|
|
297
|
+
src: t,
|
|
298
|
+
title: l,
|
|
299
|
+
poster: s,
|
|
300
|
+
autoPlay: c = !1,
|
|
301
|
+
muted: n = !1,
|
|
302
|
+
loop: d = !1,
|
|
303
|
+
className: o = ""
|
|
304
|
+
}) => {
|
|
305
|
+
const i = t.includes("youtube.com") || t.includes("youtu.be"), m = i ? N(t) : "";
|
|
306
|
+
return t ? /* @__PURE__ */ a("div", { className: `max-w-4xl rounded-3xl border border-slate-200 bg-slate-950/5 p-6 shadow-xl ${o}`, children: [
|
|
307
|
+
/* @__PURE__ */ a("div", { className: "mb-4 flex flex-wrap items-center justify-between gap-3", children: [
|
|
308
|
+
/* @__PURE__ */ a("div", { children: [
|
|
309
|
+
l && /* @__PURE__ */ e("h3", { className: "text-2xl font-semibold tracking-tight text-slate-900", children: l }),
|
|
310
|
+
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-slate-500", children: "Responsive video component for YouTube or direct sources." })
|
|
311
|
+
] }),
|
|
312
|
+
i && /* @__PURE__ */ e("span", { className: "rounded-full bg-slate-900 px-3 py-1 text-xs uppercase tracking-[0.24em] text-slate-100", children: "YouTube" })
|
|
313
|
+
] }),
|
|
314
|
+
/* @__PURE__ */ e("div", { className: "overflow-hidden rounded-[28px] border border-slate-200 bg-slate-900 shadow-inner", children: i ? /* @__PURE__ */ e(
|
|
315
|
+
"iframe",
|
|
316
|
+
{
|
|
317
|
+
src: m,
|
|
318
|
+
title: l || "Embedded video",
|
|
319
|
+
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
|
|
320
|
+
allowFullScreen: !0,
|
|
321
|
+
className: "h-[420px] w-full sm:h-[520px]"
|
|
322
|
+
}
|
|
323
|
+
) : /* @__PURE__ */ e(
|
|
324
|
+
"video",
|
|
325
|
+
{
|
|
326
|
+
controls: !0,
|
|
327
|
+
poster: s,
|
|
328
|
+
src: t,
|
|
329
|
+
autoPlay: c,
|
|
330
|
+
muted: n,
|
|
331
|
+
loop: d,
|
|
332
|
+
className: "h-[420px] w-full bg-black object-cover"
|
|
333
|
+
}
|
|
334
|
+
) })
|
|
335
|
+
] }) : /* @__PURE__ */ e("div", { className: `rounded-3xl border border-slate-200 bg-white p-6 shadow-sm ${o}`, children: /* @__PURE__ */ e("p", { className: "text-center text-sm text-slate-500", children: "No video source provided." }) });
|
|
336
|
+
};
|
|
337
|
+
export {
|
|
338
|
+
C as Button,
|
|
339
|
+
j as Card,
|
|
340
|
+
S as Carousel,
|
|
341
|
+
M as Chart,
|
|
342
|
+
I as Heading,
|
|
343
|
+
L as Input,
|
|
344
|
+
z as Navbar,
|
|
345
|
+
W as Table,
|
|
346
|
+
A as Video
|
|
347
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(x,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],e):(x=typeof globalThis<"u"?globalThis:x||self,e(x.UILibrary={},x.jsxRuntime,x.React))})(this,function(x,e,u){"use strict";const g=({children:t,onClick:s,variant:l="primary"})=>{const n="px-4 py-2 rounded font-medium focus:outline-none focus:ring-2 focus:ring-offset-2",a=l==="primary"?"bg-blue-500 text-white hover:bg-blue-600 focus:ring-blue-500":"bg-gray-500 text-white hover:bg-gray-600 focus:ring-gray-500";return e.jsx("button",{onClick:s,className:`${n} ${a}`,children:t})},m=({children:t,title:s})=>e.jsxs("div",{className:"bg-white shadow-md rounded-lg p-6 max-w-sm",children:[s&&e.jsx("h3",{className:"text-lg font-semibold mb-4",children:s}),e.jsx("div",{children:t})]}),v=({images:t,orientation:s="horizontal",className:l=""})=>{const[n,a]=u.useState(0),d=t.length,o=t[n],c=s==="vertical",h=c?"flex-col":"flex-row",b=u.useMemo(()=>e.jsxs("div",{className:`flex ${c?"flex-col gap-3":"items-center gap-3"}`,children:[e.jsx("button",{type:"button",onClick:()=>a(r=>(r-1+d)%d),className:"inline-flex items-center justify-center rounded-2xl border border-slate-200 bg-white px-5 py-3 text-sm font-medium text-slate-700 shadow-sm transition hover:border-slate-300 hover:bg-slate-50",children:"Previous"}),e.jsx("button",{type:"button",onClick:()=>a(r=>(r+1)%d),className:"inline-flex items-center justify-center rounded-2xl border border-slate-200 bg-white px-5 py-3 text-sm font-medium text-slate-700 shadow-sm transition hover:border-slate-300 hover:bg-slate-50",children:"Next"})]}),[c,d]);return t.length===0?e.jsx("div",{className:`rounded-3xl border border-slate-200 bg-white p-8 text-center text-slate-500 shadow-sm ${l}`,children:"No images available."}):e.jsx("div",{className:`rounded-3xl border border-slate-200 bg-white p-5 shadow-xl ${l}`,children:e.jsxs("div",{className:`flex flex-wrap gap-5 ${c?"flex-col":"flex-row"}`,children:[e.jsxs("div",{className:`relative overflow-hidden rounded-3xl bg-slate-950 shadow-inner ${c?"w-full":"flex-1"}`,children:[e.jsx("img",{src:o,alt:`Slide ${n+1}`,className:"h-80 w-full object-cover transition duration-500 ease-out sm:h-[420px]"}),e.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 bg-gradient-to-t from-slate-950/90 to-transparent px-5 py-4 text-sm text-white",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{children:`Slide ${n+1} of ${d}`}),e.jsx("span",{className:"rounded-full bg-slate-900/70 px-3 py-1 text-xs uppercase tracking-[0.18em] text-slate-300",children:s})]})})]}),e.jsxs("div",{className:`flex ${c?"flex-row flex-wrap justify-center gap-3":"flex-col justify-between"} items-center ${c?"":"w-40"}`,children:[b,e.jsx("div",{className:`flex ${h} flex-wrap items-center justify-center gap-3 ${c?"":"mt-4"}`,children:t.map((r,i)=>e.jsx("button",{type:"button",onClick:()=>a(i),className:`overflow-hidden rounded-2xl border shadow-sm transition duration-200 ${i===n?"border-blue-500 ring-2 ring-blue-200":"border-slate-200 hover:border-slate-300"} ${c?"h-20 w-24":"h-20 w-full"} `,children:e.jsx("img",{src:r,alt:`Preview ${i+1}`,className:"h-full w-full object-cover"})},r))})]})]})})},w=({data:t,type:s="bar",height:l=320,title:n,className:a=""})=>{const d=Math.max(...t.map(r=>r.value),1),o=40,c=700,h=c-o*2,b=h/Math.max(t.length-1,1);return e.jsxs("div",{className:`rounded-3xl border border-slate-200 bg-white p-6 shadow-sm ${a}`,children:[n&&e.jsx("h3",{className:"mb-4 text-xl font-semibold text-slate-900",children:n}),e.jsx("div",{className:"overflow-hidden rounded-3xl border border-slate-100 bg-slate-50/80 p-4 shadow-sm",children:e.jsxs("svg",{viewBox:`0 0 ${c} ${l}`,className:"h-full w-full",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"chartGradient",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#0ea5e9",stopOpacity:"0.85"}),e.jsx("stop",{offset:"100%",stopColor:"#0ea5e9",stopOpacity:"0.12"})]})}),e.jsxs("g",{transform:`translate(${o}, ${o})`,children:[Array.from({length:5}).map((r,i)=>{const f=(l-o*2)/4*i;return e.jsxs("g",{children:[e.jsx("line",{x1:0,y1:f,x2:h,y2:f,stroke:"#e2e8f0",strokeWidth:"1"}),e.jsx("text",{x:-10,y:f+5,textAnchor:"end",fontSize:"10",fill:"#64748b",children:Math.round(d-d/4*i)})]},i)}),s==="bar"?t.map((r,i)=>{const f=(l-o*2)*r.value/d,p=i*(b*.9+10);return e.jsxs("g",{children:[e.jsx("rect",{x:p,y:l-o*2-f,width:b*.3,height:f,rx:"10",fill:r.color||"#0ea5e9"}),e.jsx("text",{x:p+b*.15,y:l-o*2+18,textAnchor:"middle",fontSize:"10",fill:"#334155",children:r.label})]},r.label)}):e.jsxs(e.Fragment,{children:[e.jsx("path",{d:t.map((r,i)=>{const f=i*b,p=l-o*2-(l-o*2)*r.value/d;return`${i===0?"M":"L"} ${f} ${p}`}).join(" "),fill:"none",stroke:"#0ea5e9",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),t.map((r,i)=>{const f=i*b,p=l-o*2-(l-o*2)*r.value/d;return e.jsx("circle",{cx:f,cy:p,r:"6",fill:r.color||"#0ea5e9",stroke:"#ffffff",strokeWidth:"2"},r.label)})]})]})]})})]})},y={1:"text-5xl md:text-6xl",2:"text-4xl md:text-5xl",3:"text-3xl md:text-4xl",4:"text-2xl md:text-3xl",5:"text-xl md:text-2xl",6:"text-lg md:text-xl"},N={left:"text-left",center:"text-center",right:"text-right"},$=t=>{if(typeof t=="number")return t;if(typeof t=="string"){const s=Number(t);if([1,2,3,4,5,6].includes(s))return s}return 1},k=({title:t,subtitle:s,level:l=1,align:n="left",className:a=""})=>{const d=$(l),o=`h${d}`;return e.jsxs("div",{className:`max-w-3xl rounded-3xl border border-slate-200 bg-slate-50/80 p-6 shadow-sm ${N[n]} ${a}`,children:[e.jsx(o,{className:`${y[d]} font-semibold tracking-tight text-slate-900`,children:t}),s&&e.jsx("p",{className:"mt-3 max-w-2xl text-base leading-7 text-slate-600",children:s}),e.jsx("div",{className:"mt-6 h-1 w-24 rounded-full bg-gradient-to-r from-sky-500 to-indigo-500"})]})},C=({placeholder:t,value:s,onChange:l,type:n="text"})=>e.jsx("input",{type:n,placeholder:t,value:s,onChange:l,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"}),j=({logo:t,title:s,subtitle:l="Modern UI navigation",items:n,actionLabel:a,onActionClick:d,className:o="",containerClassName:c=""})=>{const[h,b]=u.useState(!1);return e.jsxs("header",{className:`w-full border-b bg-white shadow-sm ${o}`,children:[e.jsxs("div",{className:"flex w-full max-w-7xl mx-auto items-center justify-between px-4 sm:px-6 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[t&&e.jsx("img",{src:t,alt:"Logo",className:"h-10 w-10 rounded-xl object-cover"}),e.jsxs("div",{children:[s&&e.jsx("p",{className:"text-lg font-semibold text-slate-900",children:s}),l&&e.jsx("p",{className:"text-sm text-slate-500",children:l})]})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-2",children:n.map(r=>e.jsx("button",{onClick:r.onClick,className:`rounded-full px-4 py-2 text-sm font-medium transition ${r.active?"bg-slate-900 text-white":"text-slate-600 hover:bg-slate-100"}`,children:r.label},r.label))}),e.jsxs("div",{className:"flex items-center gap-3",children:[a&&e.jsx("button",{onClick:d,className:"rounded-full bg-slate-900 px-5 py-2 text-sm text-white hover:bg-slate-800",children:a}),e.jsx("button",{onClick:()=>b(!h),className:"md:hidden border px-3 py-2 rounded",children:"Menu"})]})]}),h&&e.jsx("div",{className:"md:hidden px-6 pb-4 space-y-2",children:n.map(r=>e.jsx("button",{onClick:()=>{var i;(i=r.onClick)==null||i.call(r),b(!1)},className:"block w-full text-left px-4 py-2 rounded hover:bg-gray-100",children:r.label},r.label))})]})},S=({columns:t,data:s,rowKey:l,zebra:n})=>e.jsx("div",{className:"rounded-xl border bg-white shadow-sm overflow-hidden",children:e.jsxs("table",{className:"w-full text-sm border-collapse",children:[e.jsx("thead",{className:"bg-slate-100 border-b",children:e.jsx("tr",{children:t.map(a=>e.jsx("th",{className:`px-6 py-3 text-xs font-semibold text-slate-500 uppercase ${a.align==="center"?"text-center":a.align==="right"?"text-right":"text-left"}`,children:a.header},String(a.accessor)))})}),e.jsx("tbody",{children:s.map((a,d)=>{const o=l?l(a):d,c=d%2===0;return e.jsx("tr",{className:`border-b hover:bg-slate-50 transition-colors ${n&&c?"bg-slate-50":""}`,children:t.map(h=>{const b=a[h.accessor];return e.jsx("td",{className:`px-6 py-4 ${h.align==="center"?"text-center":h.align==="right"?"text-right":"text-left"}`,children:h.render?h.render(b,a):b},String(h.accessor))})},o)})})]})}),M=t=>{const s=t.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&\n?#]+)/);return s?`https://www.youtube.com/embed/${s[1]}?rel=0`:t},I=({src:t,title:s,poster:l,autoPlay:n=!1,muted:a=!1,loop:d=!1,className:o=""})=>{const c=t.includes("youtube.com")||t.includes("youtu.be"),h=c?M(t):"";return t?e.jsxs("div",{className:`max-w-4xl rounded-3xl border border-slate-200 bg-slate-950/5 p-6 shadow-xl ${o}`,children:[e.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[s&&e.jsx("h3",{className:"text-2xl font-semibold tracking-tight text-slate-900",children:s}),e.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"Responsive video component for YouTube or direct sources."})]}),c&&e.jsx("span",{className:"rounded-full bg-slate-900 px-3 py-1 text-xs uppercase tracking-[0.24em] text-slate-100",children:"YouTube"})]}),e.jsx("div",{className:"overflow-hidden rounded-[28px] border border-slate-200 bg-slate-900 shadow-inner",children:c?e.jsx("iframe",{src:h,title:s||"Embedded video",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"h-[420px] w-full sm:h-[520px]"}):e.jsx("video",{controls:!0,poster:l,src:t,autoPlay:n,muted:a,loop:d,className:"h-[420px] w-full bg-black object-cover"})})]}):e.jsx("div",{className:`rounded-3xl border border-slate-200 bg-white p-6 shadow-sm ${o}`,children:e.jsx("p",{className:"text-center text-sm text-slate-500",children:"No video source provided."})})};x.Button=g,x.Card=m,x.Carousel=v,x.Chart=w,x.Heading=k,x.Input=C,x.Navbar=j,x.Table=S,x.Video=I,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-x-0{left:0;right:0}.bottom-0{bottom:0}.mx-auto{margin-left:auto;margin-right:auto}.mb-4{margin-bottom:1rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.hidden{display:none}.h-1{height:.25rem}.h-10{height:2.5rem}.h-20{height:5rem}.h-80{height:20rem}.h-\[420px\]{height:420px}.h-full{height:100%}.w-10{width:2.5rem}.w-24{width:6rem}.w-40{width:10rem}.w-full{width:100%}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-7xl{max-width:80rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.border-collapse{border-collapse:collapse}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-5{gap:1.25rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\[28px\]{border-radius:28px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-blue-500{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity))}.border-slate-100{--tw-border-opacity: 1;border-color:rgb(241 245 249 / var(--tw-border-opacity))}.border-slate-200{--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}.bg-slate-50\/80{background-color:#f8fafccc}.bg-slate-900{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity))}.bg-slate-900\/70{background-color:#0f172ab3}.bg-slate-950{--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity))}.bg-slate-950\/5{background-color:#0206170d}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-sky-500{--tw-gradient-from: #0ea5e9 var(--tw-gradient-from-position);--tw-gradient-to: rgb(14 165 233 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-slate-950\/90{--tw-gradient-from: rgb(2 6 23 / .9) var(--tw-gradient-from-position);--tw-gradient-to: rgb(2 6 23 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-indigo-500{--tw-gradient-to: #6366f1 var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.object-cover{-o-object-fit:cover;object-fit:cover}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-4{padding-bottom:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-7{line-height:1.75rem}.tracking-\[0\.18em\]{letter-spacing:.18em}.tracking-\[0\.24em\]{letter-spacing:.24em}.tracking-tight{letter-spacing:-.025em}.text-slate-100{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity))}.text-slate-300{--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-blue-200{--tw-ring-opacity: 1;--tw-ring-color: rgb(191 219 254 / var(--tw-ring-opacity))}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-500{transition-duration:.5s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.hover\:border-slate-300:hover{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity))}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity))}.hover\:bg-slate-100:hover{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))}.hover\:bg-slate-50:hover{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}.hover\:bg-slate-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}.focus\:border-transparent:focus{border-color:transparent}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(59 130 246 / var(--tw-ring-opacity))}.focus\:ring-gray-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(107 114 128 / var(--tw-ring-opacity))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}@media (min-width: 640px){.sm\:h-\[420px\]{height:420px}.sm\:h-\[520px\]{height:520px}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}}@media (min-width: 768px){.md\:flex{display:flex}.md\:hidden{display:none}.md\:text-2xl{font-size:1.5rem;line-height:2rem}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\:text-4xl{font-size:2.25rem;line-height:2.5rem}.md\:text-5xl{font-size:3rem;line-height:1}.md\:text-6xl{font-size:3.75rem;line-height:1}.md\:text-xl{font-size:1.25rem;line-height:1.75rem}}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sunaina-dev/ui-library",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "React component library",
|
|
6
|
+
"author": "Sunaina",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "./dist/index.umd.js",
|
|
9
|
+
"module": "./dist/index.mjs",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.mjs",
|
|
18
|
+
"require": "./dist/index.umd.js"
|
|
19
|
+
},
|
|
20
|
+
"./style.css": "./dist/style.css"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/sunaina1996/ui-component-library.git"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"dev": "vite",
|
|
28
|
+
"build": "vite build",
|
|
29
|
+
"storybook": "storybook dev -p 6006",
|
|
30
|
+
"storybook:build": "storybook build",
|
|
31
|
+
"build-storybook": "storybook build",
|
|
32
|
+
"prepublishOnly": "npm run build"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": "^18.2.0",
|
|
36
|
+
"react-dom": "^18.2.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@storybook/addon-a11y": "^8.6.18",
|
|
40
|
+
"@storybook/addon-essentials": "^8.6.18",
|
|
41
|
+
"@storybook/addon-links": "^8.6.18",
|
|
42
|
+
"@storybook/react": "^8.6.18",
|
|
43
|
+
"@storybook/react-vite": "^8.6.18",
|
|
44
|
+
"@storybook/test": "^8.6.18",
|
|
45
|
+
"@types/node": "^20.2.3",
|
|
46
|
+
"@types/react": "^18.2.12",
|
|
47
|
+
"@types/react-dom": "^18.2.4",
|
|
48
|
+
"@vitejs/plugin-react": "^4.2.0",
|
|
49
|
+
"autoprefixer": "^10.4.27",
|
|
50
|
+
"postcss": "^8.5.8",
|
|
51
|
+
"react": "^18.2.0",
|
|
52
|
+
"react-dom": "^18.2.0",
|
|
53
|
+
"storybook": "^8.6.18",
|
|
54
|
+
"tailwindcss": "^3.4.1",
|
|
55
|
+
"typescript": "^5.1.6",
|
|
56
|
+
"vite": "^5.4.21",
|
|
57
|
+
"vite-plugin-dts": "^3.9.0"
|
|
58
|
+
}
|
|
59
|
+
}
|