manikkam-react-library 1.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.
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="46" fill="none" viewBox="0 0 48 46"><path fill="#863bff" d="M25.946 44.938c-.664.845-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.287c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.497 0-3.578-1.842-3.578H1.237c-.92 0-1.456-1.04-.92-1.788L10.013.474c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.579 1.842 3.579h11.377c.943 0 1.473 1.088.89 1.83L25.947 44.94z" style="fill:#863bff;fill:color(display-p3 .5252 .23 1);fill-opacity:1"/><mask id="a" width="48" height="46" x="0" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M25.842 44.938c-.664.844-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.183c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.498 0-3.579-1.842-3.579H1.133c-.92 0-1.456-1.04-.92-1.787L9.91.473c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.578 1.842 3.578h11.377c.943 0 1.473 1.088.89 1.832L25.843 44.94z" style="fill:#000;fill-opacity:1"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#ede6ff" rx="5.508" ry="14.704" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -4.47 31.516)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#ede6ff" rx="10.399" ry="29.851" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -39.328 7.883)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#7e14ff" rx="5.508" ry="30.487" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -25.913 -14.639)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.814 -32.644 -3.334)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#7e14ff" rx="5.508" ry="30.599" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="matrix(.00324 1 1 -.00324 -34.34 30.47)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#ede6ff" rx="14.072" ry="22.078" style="fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1" transform="rotate(93.35 24.506 48.493)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#7e14ff" rx="3.47" ry="21.501" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(89.009 28.708 47.59)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx=".387" cy="8.972" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(39.51 .387 8.972)"/></g><g filter="url(#k)"><ellipse cx="47.523" cy="-6.092" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 47.523 -6.092)"/></g><g filter="url(#l)"><ellipse cx="41.412" cy="6.333" fill="#47bfff" rx="5.971" ry="9.665" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 41.412 6.333)"/></g><g filter="url(#m)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#n)"><ellipse cx="-1.879" cy="38.332" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 -1.88 38.332)"/></g><g filter="url(#o)"><ellipse cx="35.651" cy="29.907" fill="#7e14ff" rx="4.407" ry="29.108" style="fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1" transform="rotate(37.892 35.651 29.907)"/></g><g filter="url(#p)"><ellipse cx="38.418" cy="32.4" fill="#47bfff" rx="5.971" ry="15.297" style="fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1" transform="rotate(37.892 38.418 32.4)"/></g></g><defs><filter id="b" width="60.045" height="41.654" x="-19.77" y="16.149" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-54.613" y="-7.533" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-49.64" y="2.03" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-45.045" y="20.029" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-43.513" y="21.178" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="15.756" y="-17.901" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="23.548" y="2.284" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-27.636" y="-22.853" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="20.116" y="-38.415" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="24.641" y="-11.323" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-29.286" y="6.009" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="8.244" y="-2.416" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="18.713" y="10.588" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17158" stdDeviation="4.596"/></filter></defs></svg>
@@ -0,0 +1,278 @@
1
+ import { useEffect as e, useMemo as t, useRef as n, useState as r } from "react";
2
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
3
+ //#region src/components/dropDown/dropDown.jsx
4
+ var o = ({ options: t = [], value: o, onChange: s, placeholder: c = "Select option", disabled: l = !1, size: u = "md", shape: d = "rounded", width: f = "100%", buttonColor: p = "#ffffff", fontColor: m = "#4f4f4f", borderColor: h = "#cbd5e1", className: g = "", style: _ = {}, ...v }) => {
5
+ let [y, b] = r(!1), x = n(null), S = {
6
+ sm: "6px 12px",
7
+ md: "10px 16px",
8
+ lg: "14px 22px"
9
+ }, C = {
10
+ sm: "0.8rem",
11
+ md: "0.9rem",
12
+ lg: "1rem"
13
+ }, w = {
14
+ square: "0px",
15
+ rounded: "4px",
16
+ pill: "50px"
17
+ }, T = t.find((e) => e.value === o);
18
+ e(() => {
19
+ let e = (e) => {
20
+ x.current && !x.current.contains(e.target) && b(!1);
21
+ };
22
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
23
+ }, []);
24
+ let E = () => {
25
+ l || b(!y);
26
+ }, D = (e) => {
27
+ s && s(e), b(!1);
28
+ }, O = {
29
+ display: "flex",
30
+ alignItems: "center",
31
+ justifyContent: "between",
32
+ width: "100%",
33
+ padding: S[u],
34
+ fontSize: C[u],
35
+ borderRadius: w[d],
36
+ backgroundColor: p,
37
+ color: m,
38
+ border: `1px solid ${h}`,
39
+ cursor: l ? "not-allowed" : "pointer",
40
+ opacity: l ? .6 : 1,
41
+ boxShadow: "0 2px 5px 0 rgba(0,0,0,0.05)",
42
+ transition: "all 0.2s ease-in-out",
43
+ textAlign: "left",
44
+ outline: "none",
45
+ ..._
46
+ }, k = {
47
+ position: "absolute",
48
+ top: "100%",
49
+ left: 0,
50
+ zIndex: 1e3,
51
+ display: y ? "block" : "none",
52
+ width: "100%",
53
+ padding: "0.5rem 0",
54
+ marginTop: "4px",
55
+ fontSize: C[u],
56
+ backgroundColor: "#ffffff",
57
+ border: "none",
58
+ borderRadius: "4px",
59
+ boxShadow: "0 4px 12px 0 rgba(0,0,0,0.1), 0 2px 4px 0 rgba(0,0,0,0.05)",
60
+ maxHeight: "200px",
61
+ overflowY: "auto"
62
+ };
63
+ return /* @__PURE__ */ a("div", {
64
+ ref: x,
65
+ className: `position-relative ${g}`.trim(),
66
+ style: { width: f },
67
+ ...v,
68
+ children: [/* @__PURE__ */ a("button", {
69
+ type: "button",
70
+ style: O,
71
+ onClick: E,
72
+ disabled: l,
73
+ children: [/* @__PURE__ */ i("span", {
74
+ className: "flex-grow-1",
75
+ children: T ? T.label : c
76
+ }), /* @__PURE__ */ i("span", {
77
+ className: "ms-2",
78
+ style: {
79
+ transform: y ? "rotate(180deg)" : "none",
80
+ transition: "transform 0.2s"
81
+ },
82
+ children: "▾"
83
+ })]
84
+ }), /* @__PURE__ */ i("ul", {
85
+ className: "list-unstyled m-0",
86
+ style: k,
87
+ children: t.length > 0 ? t.map((e) => {
88
+ let t = e.value === o;
89
+ return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i("button", {
90
+ type: "button",
91
+ onClick: () => D(e.value),
92
+ className: "w-100 border-0 bg-transparent text-start px-3 py-2 dropdown-item-node",
93
+ style: {
94
+ fontSize: C[u],
95
+ color: t ? "#1266f1" : "#4f4f4f",
96
+ backgroundColor: t ? "#f5f7fa" : "transparent",
97
+ fontWeight: t ? "600" : "normal",
98
+ transition: "background-color 0.15s"
99
+ },
100
+ children: e.label
101
+ }) }, e.value);
102
+ }) : /* @__PURE__ */ i("li", {
103
+ className: "px-3 py-2 text-muted small text-center",
104
+ children: "No choices detected."
105
+ })
106
+ })]
107
+ });
108
+ }, s = ({ label: e = "Button", onClick: t, disabled: n = !1, variant: r = "primary", size: a = "md", shape: o = "rounded", width: s, height: c, buttonColor: l, fontColor: u, className: d = "", style: f = {}, ...p }) => /* @__PURE__ */ i("button", {
109
+ className: `btn btn-${r} ${a === "sm" ? "btn-sm" : a === "lg" ? "btn-lg" : ""} ${o === "square" ? "rounded-0" : o === "pill" ? "rounded-pill" : "rounded"} ${d}`.trim(),
110
+ style: {
111
+ width: s || "auto",
112
+ height: c || "auto",
113
+ backgroundColor: l || void 0,
114
+ color: u || void 0,
115
+ ...f
116
+ },
117
+ onClick: n ? void 0 : t,
118
+ disabled: n,
119
+ ...p,
120
+ children: e
121
+ }), c = ({ type: e = "text", placeholder: t = "", value: n, onChange: r, disabled: a = !1, error: o = !1, min: s, max: c, minLength: l, maxLength: u, size: d = "md", width: f = "100%", backgroundColor: p, borderColor: m, fontColor: h, className: g = "", style: _ = {}, ...v }) => {
122
+ let y = e === "email" && n && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n);
123
+ return /* @__PURE__ */ i("input", {
124
+ type: e,
125
+ value: n,
126
+ onChange: r,
127
+ disabled: a,
128
+ placeholder: t,
129
+ className: `form-control ${d === "sm" ? "form-control-sm" : d === "lg" ? "form-control-lg" : ""} ${o || y ? "is-invalid" : ""} ${g}`.trim(),
130
+ style: {
131
+ width: f,
132
+ backgroundColor: p || void 0,
133
+ borderColor: m || void 0,
134
+ color: h || void 0,
135
+ ..._
136
+ },
137
+ min: s,
138
+ max: c,
139
+ minLength: l,
140
+ maxLength: u,
141
+ ...v
142
+ });
143
+ }, l = ({ headers: e = [], data: n = [], maxHeight: o = "500px", fixedHeader: s = !0, pagination: c = !1, rowsToShow: l = 1, striped: u = !1, hover: d = !0, borderColor: f, theme: p = "light", className: m = "", style: h = {}, ...g }) => {
144
+ let [_, v] = r(1), y = Number(l), b = `table ${u ? "table-striped" : ""} ${d ? "table-hover" : ""} ${p === "dark" ? "table-dark" : ""} ${m}`.trim(), x = y === 0 ? 1 : Math.ceil(n.length / y), S = _;
145
+ S > x && x > 0 && (S = x, v(x));
146
+ let C = t(() => {
147
+ if (!c || y === 0) return n;
148
+ let e = (S - 1) * y;
149
+ return n.slice(e, e + y);
150
+ }, [
151
+ n,
152
+ c,
153
+ S,
154
+ y
155
+ ]), w = {
156
+ maxHeight: o || "none",
157
+ overflowY: o ? "auto" : "visible",
158
+ overflowX: "auto",
159
+ position: "relative",
160
+ boxShadow: "0 2px 5px 0 rgba(0,0,0,0.05), 0 2px 10px 0 rgba(0,0,0,0.02)",
161
+ borderRadius: "4px",
162
+ backgroundColor: p === "dark" ? "#212529" : "#ffffff"
163
+ }, T = {
164
+ position: s ? "sticky" : "static",
165
+ top: 0,
166
+ backgroundColor: p === "dark" ? "#2e3135" : "#f5f7fa",
167
+ color: p === "dark" ? "#ffffff" : "#4f4f4f",
168
+ zIndex: 1,
169
+ fontWeight: "600",
170
+ fontSize: "0.9rem",
171
+ textTransform: "uppercase",
172
+ letterSpacing: "0.5px",
173
+ padding: "1rem 1.5rem",
174
+ borderBottom: "2px solid #e0e0e0"
175
+ }, E = {
176
+ padding: "1rem 1.5rem",
177
+ fontSize: "0.9rem",
178
+ color: p === "dark" ? "#e0e0e0" : "#4f4f4f",
179
+ borderBottom: f ? `1px solid ${f}` : "1px solid #f0f0f0",
180
+ verticalAlign: "middle"
181
+ };
182
+ return /* @__PURE__ */ a("div", {
183
+ className: "w-100",
184
+ style: { fontFamily: "Roboto, sans-serif" },
185
+ children: [
186
+ c && /* @__PURE__ */ i("div", {
187
+ className: "d-flex justify-content-between align-items-center mb-3 px-2",
188
+ children: /* @__PURE__ */ i("span", {
189
+ className: "text-muted small",
190
+ children: y === 0 ? `Showing ${n.length} of ${n.length}` : `Showing ${Math.min((S - 1) * y + 1, n.length)}-${Math.min(S * y, n.length)} of ${n.length}`
191
+ })
192
+ }),
193
+ /* @__PURE__ */ i("div", {
194
+ style: w,
195
+ children: /* @__PURE__ */ a("table", {
196
+ className: b,
197
+ style: {
198
+ margin: 0,
199
+ ...h
200
+ },
201
+ ...g,
202
+ children: [/* @__PURE__ */ i("thead", { children: /* @__PURE__ */ i("tr", { children: e.map((e, t) => /* @__PURE__ */ i("th", {
203
+ scope: "col",
204
+ style: T,
205
+ children: e.label
206
+ }, e.key || t)) }) }), /* @__PURE__ */ i("tbody", { children: C.length > 0 ? C.map((t, n) => /* @__PURE__ */ i("tr", { children: e.map((e, r) => /* @__PURE__ */ i("td", {
207
+ style: E,
208
+ children: e.render ? e.render(t[e.key], t) : t[e.key]
209
+ }, `${n}-${e.key || r}`)) }, t.id || n)) : /* @__PURE__ */ i("tr", { children: /* @__PURE__ */ i("td", {
210
+ colSpan: e.length,
211
+ className: "text-center text-muted py-5",
212
+ style: E,
213
+ children: "No matching data entries found."
214
+ }) }) })]
215
+ })
216
+ }),
217
+ c && y !== 0 && x > 1 && /* @__PURE__ */ i("nav", {
218
+ className: "d-flex justify-content-end align-items-center mt-3 px-2",
219
+ "aria-label": "Table navigation",
220
+ children: /* @__PURE__ */ a("ul", {
221
+ className: "pagination pagination-circle m-0 gap-1",
222
+ children: [
223
+ /* @__PURE__ */ i("li", {
224
+ className: `page-item ${S === 1 ? "disabled" : ""}`,
225
+ children: /* @__PURE__ */ i("button", {
226
+ className: "page-link border-0 bg-transparent text-dark shadow-none",
227
+ type: "button",
228
+ onClick: () => v((e) => Math.max(e - 1, 1)),
229
+ style: {
230
+ fontSize: "1.2rem",
231
+ padding: "0.25rem 0.75rem"
232
+ },
233
+ children: "‹"
234
+ })
235
+ }),
236
+ Array.from({ length: x }, (e, t) => {
237
+ let n = t + 1, r = S === n;
238
+ return /* @__PURE__ */ i("li", {
239
+ className: `page-item ${r ? "active" : ""}`,
240
+ children: /* @__PURE__ */ i("button", {
241
+ className: "page-link border-0 rounded-circle text-center",
242
+ type: "button",
243
+ onClick: () => v(n),
244
+ style: {
245
+ width: "32px",
246
+ height: "32px",
247
+ padding: 0,
248
+ lineHeight: "32px",
249
+ backgroundColor: r ? "#1266f1" : "transparent",
250
+ color: r ? "#ffffff" : "#4f4f4f",
251
+ boxShadow: r ? "0 2px 5px 0 rgba(0,0,0,0.2)" : "none",
252
+ fontWeight: r ? "600" : "normal"
253
+ },
254
+ children: n
255
+ })
256
+ }, n);
257
+ }),
258
+ /* @__PURE__ */ i("li", {
259
+ className: `page-item ${S === x ? "disabled" : ""}`,
260
+ children: /* @__PURE__ */ i("button", {
261
+ className: "page-link border-0 bg-transparent text-dark shadow-none",
262
+ type: "button",
263
+ onClick: () => v((e) => Math.min(e + 1, x)),
264
+ style: {
265
+ fontSize: "1.2rem",
266
+ padding: "0.25rem 0.75rem"
267
+ },
268
+ children: "›"
269
+ })
270
+ })
271
+ ]
272
+ })
273
+ })
274
+ ]
275
+ });
276
+ };
277
+ //#endregion
278
+ export { s as HCSButton, o as HCSDropDown, c as HCSInput, l as HCSTable };
@@ -0,0 +1 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("react/jsx-runtime")):typeof define==`function`&&define.amd?define([`exports`,`react`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.HcsLibrary={},e.React,e.JSXRuntime))})(this,function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),e.HCSButton=({label:e=`Button`,onClick:t,disabled:r=!1,variant:i=`primary`,size:a=`md`,shape:o=`rounded`,width:s,height:c,buttonColor:l,fontColor:u,className:d=``,style:f={},...p})=>(0,n.jsx)(`button`,{className:`btn btn-${i} ${a===`sm`?`btn-sm`:a===`lg`?`btn-lg`:``} ${o===`square`?`rounded-0`:o===`pill`?`rounded-pill`:`rounded`} ${d}`.trim(),style:{width:s||`auto`,height:c||`auto`,backgroundColor:l||void 0,color:u||void 0,...f},onClick:r?void 0:t,disabled:r,...p,children:e}),e.HCSDropDown=({options:e=[],value:r,onChange:i,placeholder:a=`Select option`,disabled:o=!1,size:s=`md`,shape:c=`rounded`,width:l=`100%`,buttonColor:u=`#ffffff`,fontColor:d=`#4f4f4f`,borderColor:f=`#cbd5e1`,className:p=``,style:m={},...h})=>{let[g,_]=(0,t.useState)(!1),v=(0,t.useRef)(null),y={sm:`6px 12px`,md:`10px 16px`,lg:`14px 22px`},b={sm:`0.8rem`,md:`0.9rem`,lg:`1rem`},x={square:`0px`,rounded:`4px`,pill:`50px`},S=e.find(e=>e.value===r);(0,t.useEffect)(()=>{let e=e=>{v.current&&!v.current.contains(e.target)&&_(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let C=()=>{o||_(!g)},w=e=>{i&&i(e),_(!1)},T={display:`flex`,alignItems:`center`,justifyContent:`between`,width:`100%`,padding:y[s],fontSize:b[s],borderRadius:x[c],backgroundColor:u,color:d,border:`1px solid ${f}`,cursor:o?`not-allowed`:`pointer`,opacity:o?.6:1,boxShadow:`0 2px 5px 0 rgba(0,0,0,0.05)`,transition:`all 0.2s ease-in-out`,textAlign:`left`,outline:`none`,...m},E={position:`absolute`,top:`100%`,left:0,zIndex:1e3,display:g?`block`:`none`,width:`100%`,padding:`0.5rem 0`,marginTop:`4px`,fontSize:b[s],backgroundColor:`#ffffff`,border:`none`,borderRadius:`4px`,boxShadow:`0 4px 12px 0 rgba(0,0,0,0.1), 0 2px 4px 0 rgba(0,0,0,0.05)`,maxHeight:`200px`,overflowY:`auto`};return(0,n.jsxs)(`div`,{ref:v,className:`position-relative ${p}`.trim(),style:{width:l},...h,children:[(0,n.jsxs)(`button`,{type:`button`,style:T,onClick:C,disabled:o,children:[(0,n.jsx)(`span`,{className:`flex-grow-1`,children:S?S.label:a}),(0,n.jsx)(`span`,{className:`ms-2`,style:{transform:g?`rotate(180deg)`:`none`,transition:`transform 0.2s`},children:`▾`})]}),(0,n.jsx)(`ul`,{className:`list-unstyled m-0`,style:E,children:e.length>0?e.map(e=>{let t=e.value===r;return(0,n.jsx)(`li`,{children:(0,n.jsx)(`button`,{type:`button`,onClick:()=>w(e.value),className:`w-100 border-0 bg-transparent text-start px-3 py-2 dropdown-item-node`,style:{fontSize:b[s],color:t?`#1266f1`:`#4f4f4f`,backgroundColor:t?`#f5f7fa`:`transparent`,fontWeight:t?`600`:`normal`,transition:`background-color 0.15s`},children:e.label})},e.value)}):(0,n.jsx)(`li`,{className:`px-3 py-2 text-muted small text-center`,children:`No choices detected.`})})]})},e.HCSInput=({type:e=`text`,placeholder:t=``,value:r,onChange:i,disabled:a=!1,error:o=!1,min:s,max:c,minLength:l,maxLength:u,size:d=`md`,width:f=`100%`,backgroundColor:p,borderColor:m,fontColor:h,className:g=``,style:_={},...v})=>{let y=e===`email`&&r&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r);return(0,n.jsx)(`input`,{type:e,value:r,onChange:i,disabled:a,placeholder:t,className:`form-control ${d===`sm`?`form-control-sm`:d===`lg`?`form-control-lg`:``} ${o||y?`is-invalid`:``} ${g}`.trim(),style:{width:f,backgroundColor:p||void 0,borderColor:m||void 0,color:h||void 0,..._},min:s,max:c,minLength:l,maxLength:u,...v})},e.HCSTable=({headers:e=[],data:r=[],maxHeight:i=`500px`,fixedHeader:a=!0,pagination:o=!1,rowsToShow:s=1,striped:c=!1,hover:l=!0,borderColor:u,theme:d=`light`,className:f=``,style:p={},...m})=>{let[h,g]=(0,t.useState)(1),_=Number(s),v=`table ${c?`table-striped`:``} ${l?`table-hover`:``} ${d===`dark`?`table-dark`:``} ${f}`.trim(),y=_===0?1:Math.ceil(r.length/_),b=h;b>y&&y>0&&(b=y,g(y));let x=(0,t.useMemo)(()=>{if(!o||_===0)return r;let e=(b-1)*_;return r.slice(e,e+_)},[r,o,b,_]),S={maxHeight:i||`none`,overflowY:i?`auto`:`visible`,overflowX:`auto`,position:`relative`,boxShadow:`0 2px 5px 0 rgba(0,0,0,0.05), 0 2px 10px 0 rgba(0,0,0,0.02)`,borderRadius:`4px`,backgroundColor:d===`dark`?`#212529`:`#ffffff`},C={position:a?`sticky`:`static`,top:0,backgroundColor:d===`dark`?`#2e3135`:`#f5f7fa`,color:d===`dark`?`#ffffff`:`#4f4f4f`,zIndex:1,fontWeight:`600`,fontSize:`0.9rem`,textTransform:`uppercase`,letterSpacing:`0.5px`,padding:`1rem 1.5rem`,borderBottom:`2px solid #e0e0e0`},w={padding:`1rem 1.5rem`,fontSize:`0.9rem`,color:d===`dark`?`#e0e0e0`:`#4f4f4f`,borderBottom:u?`1px solid ${u}`:`1px solid #f0f0f0`,verticalAlign:`middle`};return(0,n.jsxs)(`div`,{className:`w-100`,style:{fontFamily:`Roboto, sans-serif`},children:[o&&(0,n.jsx)(`div`,{className:`d-flex justify-content-between align-items-center mb-3 px-2`,children:(0,n.jsx)(`span`,{className:`text-muted small`,children:_===0?`Showing ${r.length} of ${r.length}`:`Showing ${Math.min((b-1)*_+1,r.length)}-${Math.min(b*_,r.length)} of ${r.length}`})}),(0,n.jsx)(`div`,{style:S,children:(0,n.jsxs)(`table`,{className:v,style:{margin:0,...p},...m,children:[(0,n.jsx)(`thead`,{children:(0,n.jsx)(`tr`,{children:e.map((e,t)=>(0,n.jsx)(`th`,{scope:`col`,style:C,children:e.label},e.key||t))})}),(0,n.jsx)(`tbody`,{children:x.length>0?x.map((t,r)=>(0,n.jsx)(`tr`,{children:e.map((e,i)=>(0,n.jsx)(`td`,{style:w,children:e.render?e.render(t[e.key],t):t[e.key]},`${r}-${e.key||i}`))},t.id||r)):(0,n.jsx)(`tr`,{children:(0,n.jsx)(`td`,{colSpan:e.length,className:`text-center text-muted py-5`,style:w,children:`No matching data entries found.`})})})]})}),o&&_!==0&&y>1&&(0,n.jsx)(`nav`,{className:`d-flex justify-content-end align-items-center mt-3 px-2`,"aria-label":`Table navigation`,children:(0,n.jsxs)(`ul`,{className:`pagination pagination-circle m-0 gap-1`,children:[(0,n.jsx)(`li`,{className:`page-item ${b===1?`disabled`:``}`,children:(0,n.jsx)(`button`,{className:`page-link border-0 bg-transparent text-dark shadow-none`,type:`button`,onClick:()=>g(e=>Math.max(e-1,1)),style:{fontSize:`1.2rem`,padding:`0.25rem 0.75rem`},children:`‹`})}),Array.from({length:y},(e,t)=>{let r=t+1,i=b===r;return(0,n.jsx)(`li`,{className:`page-item ${i?`active`:``}`,children:(0,n.jsx)(`button`,{className:`page-link border-0 rounded-circle text-center`,type:`button`,onClick:()=>g(r),style:{width:`32px`,height:`32px`,padding:0,lineHeight:`32px`,backgroundColor:i?`#1266f1`:`transparent`,color:i?`#ffffff`:`#4f4f4f`,boxShadow:i?`0 2px 5px 0 rgba(0,0,0,0.2)`:`none`,fontWeight:i?`600`:`normal`},children:r})},r)}),(0,n.jsx)(`li`,{className:`page-item ${b===y?`disabled`:``}`,children:(0,n.jsx)(`button`,{className:`page-link border-0 bg-transparent text-dark shadow-none`,type:`button`,onClick:()=>g(e=>Math.min(e+1,y)),style:{fontSize:`1.2rem`,padding:`0.25rem 0.75rem`},children:`›`})})]})})]})}});
package/dist/icons.svg ADDED
@@ -0,0 +1,24 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg">
2
+ <symbol id="bluesky-icon" viewBox="0 0 16 17">
3
+ <g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
4
+ <defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
5
+ </symbol>
6
+ <symbol id="discord-icon" viewBox="0 0 20 19">
7
+ <path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
8
+ </symbol>
9
+ <symbol id="documentation-icon" viewBox="0 0 21 20">
10
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
11
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
12
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
13
+ </symbol>
14
+ <symbol id="github-icon" viewBox="0 0 19 19">
15
+ <path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
16
+ </symbol>
17
+ <symbol id="social-icon" viewBox="0 0 20 20">
18
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
19
+ <path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
20
+ </symbol>
21
+ <symbol id="x-icon" viewBox="0 0 19 19">
22
+ <path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
23
+ </symbol>
24
+ </svg>
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "manikkam-react-library",
3
+ "private": false,
4
+ "version": "1.0.1",
5
+ "type": "module",
6
+ "main": "./dist/hcs-react-kit.umd.js",
7
+ "module": "./dist/hcs-react-kit.es.js",
8
+ "exports":{
9
+ ".": {
10
+ "import": "./dist/hcs-react-kit.es.js",
11
+ "require": "./dist/hcs-react-kit.umd.js"
12
+ }
13
+
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "peerDependencies": {
19
+ "react": "^18.0.0 || ^19.0.0",
20
+ "react-dom": "^18.0.0 || ^19.0.0"
21
+ },
22
+ "scripts": {
23
+ "dev": "vite",
24
+ "build": "vite build",
25
+ "lint": "eslint .",
26
+ "preview": "vite preview"
27
+ },
28
+ "dependencies": {
29
+ "bootstrap": "^5.3.8",
30
+ "react-bootstrap": "^2.10.10"
31
+ },
32
+ "devDependencies": {
33
+ "@eslint/js": "^10.0.1",
34
+ "@types/react": "^19.2.14",
35
+ "@types/react-dom": "^19.2.3",
36
+ "@vitejs/plugin-react": "^6.0.1",
37
+ "eslint": "^10.3.0",
38
+ "eslint-plugin-react-hooks": "^7.1.1",
39
+ "eslint-plugin-react-refresh": "^0.5.2",
40
+ "globals": "^17.6.0",
41
+ "vite": "^8.0.12"
42
+ }
43
+ }