@dheerajsingh20aug/my-ui-lib 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 +180 -0
- package/dist/index.mjs +225 -0
- package/dist/index.umd.cjs +6 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# My UI Library
|
|
2
|
+
|
|
3
|
+
A lightweight, reusable React component library with essential UI components.
|
|
4
|
+
|
|
5
|
+
## Components
|
|
6
|
+
|
|
7
|
+
- **Button** - A customizable button component
|
|
8
|
+
- **Card** - A flexible card wrapper component
|
|
9
|
+
- **Input** - A styled input component with support for different types
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @dheeraj/my-ui-lib
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
import { Button, Card, Input } from "@dheeraj/my-ui-lib";
|
|
21
|
+
|
|
22
|
+
export function App() {
|
|
23
|
+
return (
|
|
24
|
+
<div>
|
|
25
|
+
<Card>
|
|
26
|
+
<h1>Welcome</h1>
|
|
27
|
+
<Input placeholder="Enter your name" />
|
|
28
|
+
<Button>Submit</Button>
|
|
29
|
+
</Card>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Component Examples
|
|
36
|
+
|
|
37
|
+
### Button
|
|
38
|
+
|
|
39
|
+
```jsx
|
|
40
|
+
<Button onClick={() => alert("Clicked!")}>Click Me</Button>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Props:**
|
|
44
|
+
- `children` - Button label/content
|
|
45
|
+
- `onClick` - Click handler function
|
|
46
|
+
|
|
47
|
+
### Card
|
|
48
|
+
|
|
49
|
+
```jsx
|
|
50
|
+
<Card>
|
|
51
|
+
<p>Your content here</p>
|
|
52
|
+
</Card>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Props:**
|
|
56
|
+
- `children` - Card content
|
|
57
|
+
|
|
58
|
+
### Input
|
|
59
|
+
|
|
60
|
+
```jsx
|
|
61
|
+
const [value, setValue] = useState("");
|
|
62
|
+
|
|
63
|
+
<Input
|
|
64
|
+
placeholder="Enter text..."
|
|
65
|
+
value={value}
|
|
66
|
+
onChange={(e) => setValue(e.target.value)}
|
|
67
|
+
type="text"
|
|
68
|
+
/>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Props:**
|
|
72
|
+
- `placeholder` - Input placeholder text
|
|
73
|
+
- `value` - Current input value
|
|
74
|
+
- `onChange` - Change handler
|
|
75
|
+
- `type` - Input type (default: "text")
|
|
76
|
+
- All other HTML input attributes supported
|
|
77
|
+
|
|
78
|
+
## Development
|
|
79
|
+
|
|
80
|
+
### Local Testing
|
|
81
|
+
|
|
82
|
+
To test components locally with the demo app:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npm run dev:demo
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
This will start the Vite dev server at http://localhost:5173 with hot module reloading.
|
|
89
|
+
|
|
90
|
+
### Build Library
|
|
91
|
+
|
|
92
|
+
To build the library for distribution:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm run build
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Output will be in the `dist/` folder with:
|
|
99
|
+
- ES module format (`.mjs`)
|
|
100
|
+
- UMD format (`.umd.cjs`)
|
|
101
|
+
- TypeScript declarations (`.d.ts`)
|
|
102
|
+
|
|
103
|
+
## Publishing to NPM
|
|
104
|
+
|
|
105
|
+
### Prerequisites
|
|
106
|
+
|
|
107
|
+
1. Create an account on [npmjs.com](https://www.npmjs.com)
|
|
108
|
+
2. Create a scoped package (if using `@scope/package-name` format)
|
|
109
|
+
|
|
110
|
+
### Steps
|
|
111
|
+
|
|
112
|
+
1. **Update version in package.json:**
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"version": "1.0.0"
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
2. **Login to NPM:**
|
|
120
|
+
```bash
|
|
121
|
+
npm login
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
3. **Publish:**
|
|
125
|
+
```bash
|
|
126
|
+
npm publish --access public
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
For scoped public packages, use `--access public` flag.
|
|
130
|
+
|
|
131
|
+
## Using in Another Project
|
|
132
|
+
|
|
133
|
+
After publishing to NPM, use it in other projects:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
npm install @dheeraj/my-ui-lib
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Then import and use:
|
|
140
|
+
|
|
141
|
+
```jsx
|
|
142
|
+
import React from "react";
|
|
143
|
+
import { Button, Card, Input } from "@dheeraj/my-ui-lib";
|
|
144
|
+
|
|
145
|
+
export default function App() {
|
|
146
|
+
return (
|
|
147
|
+
<Card>
|
|
148
|
+
<Button>My Button</Button>
|
|
149
|
+
</Card>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Project Structure
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
my-ui-lib/
|
|
158
|
+
├── src/
|
|
159
|
+
│ ├── components/
|
|
160
|
+
│ │ ├── Button.jsx
|
|
161
|
+
│ │ ├── Card.jsx
|
|
162
|
+
│ │ └── Input.jsx
|
|
163
|
+
│ └── index.js
|
|
164
|
+
├── demo/
|
|
165
|
+
│ ├── src/
|
|
166
|
+
│ │ ├── App.jsx
|
|
167
|
+
│ │ ├── App.css
|
|
168
|
+
│ │ └── main.jsx
|
|
169
|
+
│ ├── index.html
|
|
170
|
+
│ └── vite.config.js
|
|
171
|
+
├── dist/ (generated after build)
|
|
172
|
+
├── package.json
|
|
173
|
+
├── vite.config.js
|
|
174
|
+
├── tsconfig.json
|
|
175
|
+
└── README.md
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
|
|
180
|
+
ISC
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), t = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
3
|
+
if (typeof require < "u") return require.apply(this, arguments);
|
|
4
|
+
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
5
|
+
}), n = /* @__PURE__ */ e(((e) => {
|
|
6
|
+
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
7
|
+
function r(e, n, r) {
|
|
8
|
+
var i = null;
|
|
9
|
+
if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) for (var a in r = {}, n) a !== "key" && (r[a] = n[a]);
|
|
10
|
+
else r = n;
|
|
11
|
+
return n = r.ref, {
|
|
12
|
+
$$typeof: t,
|
|
13
|
+
type: e,
|
|
14
|
+
key: i,
|
|
15
|
+
ref: n === void 0 ? null : n,
|
|
16
|
+
props: r
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
e.Fragment = n, e.jsx = r, e.jsxs = r;
|
|
20
|
+
})), r = /* @__PURE__ */ e(((e) => {
|
|
21
|
+
process.env.NODE_ENV !== "production" && (function() {
|
|
22
|
+
function n(e) {
|
|
23
|
+
if (e == null) return null;
|
|
24
|
+
if (typeof e == "function") return e.$$typeof === k ? null : e.displayName || e.name || null;
|
|
25
|
+
if (typeof e == "string") return e;
|
|
26
|
+
switch (e) {
|
|
27
|
+
case v: return "Fragment";
|
|
28
|
+
case b: return "Profiler";
|
|
29
|
+
case y: return "StrictMode";
|
|
30
|
+
case w: return "Suspense";
|
|
31
|
+
case T: return "SuspenseList";
|
|
32
|
+
case O: return "Activity";
|
|
33
|
+
}
|
|
34
|
+
if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
|
|
35
|
+
case _: return "Portal";
|
|
36
|
+
case S: return e.displayName || "Context";
|
|
37
|
+
case x: return (e._context.displayName || "Context") + ".Consumer";
|
|
38
|
+
case C:
|
|
39
|
+
var t = e.render;
|
|
40
|
+
return e = e.displayName, e ||= (e = t.displayName || t.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
|
|
41
|
+
case E: return t = e.displayName || null, t === null ? n(e.type) || "Memo" : t;
|
|
42
|
+
case D:
|
|
43
|
+
t = e._payload, e = e._init;
|
|
44
|
+
try {
|
|
45
|
+
return n(e(t));
|
|
46
|
+
} catch {}
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
function r(e) {
|
|
51
|
+
return "" + e;
|
|
52
|
+
}
|
|
53
|
+
function i(e) {
|
|
54
|
+
try {
|
|
55
|
+
r(e);
|
|
56
|
+
var t = !1;
|
|
57
|
+
} catch {
|
|
58
|
+
t = !0;
|
|
59
|
+
}
|
|
60
|
+
if (t) {
|
|
61
|
+
t = console;
|
|
62
|
+
var n = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
63
|
+
return n.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), r(e);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function a(e) {
|
|
67
|
+
if (e === v) return "<>";
|
|
68
|
+
if (typeof e == "object" && e && e.$$typeof === D) return "<...>";
|
|
69
|
+
try {
|
|
70
|
+
var t = n(e);
|
|
71
|
+
return t ? "<" + t + ">" : "<...>";
|
|
72
|
+
} catch {
|
|
73
|
+
return "<...>";
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function o() {
|
|
77
|
+
var e = A.A;
|
|
78
|
+
return e === null ? null : e.getOwner();
|
|
79
|
+
}
|
|
80
|
+
function s() {
|
|
81
|
+
return Error("react-stack-top-frame");
|
|
82
|
+
}
|
|
83
|
+
function c(e) {
|
|
84
|
+
if (j.call(e, "key")) {
|
|
85
|
+
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
86
|
+
if (t && t.isReactWarning) return !1;
|
|
87
|
+
}
|
|
88
|
+
return e.key !== void 0;
|
|
89
|
+
}
|
|
90
|
+
function l(e, t) {
|
|
91
|
+
function n() {
|
|
92
|
+
P || (P = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", t));
|
|
93
|
+
}
|
|
94
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
95
|
+
get: n,
|
|
96
|
+
configurable: !0
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function u() {
|
|
100
|
+
var e = n(this.type);
|
|
101
|
+
return F[e] || (F[e] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")), e = this.props.ref, e === void 0 ? null : e;
|
|
102
|
+
}
|
|
103
|
+
function d(e, t, n, r, i, a) {
|
|
104
|
+
var o = n.ref;
|
|
105
|
+
return e = {
|
|
106
|
+
$$typeof: g,
|
|
107
|
+
type: e,
|
|
108
|
+
key: t,
|
|
109
|
+
props: n,
|
|
110
|
+
_owner: r
|
|
111
|
+
}, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
|
|
112
|
+
enumerable: !1,
|
|
113
|
+
value: null
|
|
114
|
+
}) : Object.defineProperty(e, "ref", {
|
|
115
|
+
enumerable: !1,
|
|
116
|
+
get: u
|
|
117
|
+
}), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
118
|
+
configurable: !1,
|
|
119
|
+
enumerable: !1,
|
|
120
|
+
writable: !0,
|
|
121
|
+
value: 0
|
|
122
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
123
|
+
configurable: !1,
|
|
124
|
+
enumerable: !1,
|
|
125
|
+
writable: !0,
|
|
126
|
+
value: null
|
|
127
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
128
|
+
configurable: !1,
|
|
129
|
+
enumerable: !1,
|
|
130
|
+
writable: !0,
|
|
131
|
+
value: i
|
|
132
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
133
|
+
configurable: !1,
|
|
134
|
+
enumerable: !1,
|
|
135
|
+
writable: !0,
|
|
136
|
+
value: a
|
|
137
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
138
|
+
}
|
|
139
|
+
function f(e, t, r, a, s, u) {
|
|
140
|
+
var f = t.children;
|
|
141
|
+
if (f !== void 0) if (a) if (M(f)) {
|
|
142
|
+
for (a = 0; a < f.length; a++) p(f[a]);
|
|
143
|
+
Object.freeze && Object.freeze(f);
|
|
144
|
+
} else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
145
|
+
else p(f);
|
|
146
|
+
if (j.call(t, "key")) {
|
|
147
|
+
f = n(e);
|
|
148
|
+
var m = Object.keys(t).filter(function(e) {
|
|
149
|
+
return e !== "key";
|
|
150
|
+
});
|
|
151
|
+
a = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", R[f + a] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", a, f, m, f), R[f + a] = !0);
|
|
152
|
+
}
|
|
153
|
+
if (f = null, r !== void 0 && (i(r), f = "" + r), c(t) && (i(t.key), f = "" + t.key), "key" in t) for (var h in r = {}, t) h !== "key" && (r[h] = t[h]);
|
|
154
|
+
else r = t;
|
|
155
|
+
return f && l(r, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), d(e, f, r, o(), s, u);
|
|
156
|
+
}
|
|
157
|
+
function p(e) {
|
|
158
|
+
m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === D && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
159
|
+
}
|
|
160
|
+
function m(e) {
|
|
161
|
+
return typeof e == "object" && !!e && e.$$typeof === g;
|
|
162
|
+
}
|
|
163
|
+
var h = t("react"), g = Symbol.for("react.transitional.element"), _ = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), S = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), k = Symbol.for("react.client.reference"), A = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, j = Object.prototype.hasOwnProperty, M = Array.isArray, N = console.createTask ? console.createTask : function() {
|
|
164
|
+
return null;
|
|
165
|
+
};
|
|
166
|
+
h = { react_stack_bottom_frame: function(e) {
|
|
167
|
+
return e();
|
|
168
|
+
} };
|
|
169
|
+
var P, F = {}, I = h.react_stack_bottom_frame.bind(h, s)(), L = N(a(s)), R = {};
|
|
170
|
+
e.Fragment = v, e.jsx = function(e, t, n) {
|
|
171
|
+
var r = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
172
|
+
return f(e, t, n, !1, r ? Error("react-stack-top-frame") : I, r ? N(a(e)) : L);
|
|
173
|
+
}, e.jsxs = function(e, t, n) {
|
|
174
|
+
var r = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
175
|
+
return f(e, t, n, !0, r ? Error("react-stack-top-frame") : I, r ? N(a(e)) : L);
|
|
176
|
+
};
|
|
177
|
+
})();
|
|
178
|
+
})), i = (/* @__PURE__ */ e(((e, t) => {
|
|
179
|
+
process.env.NODE_ENV === "production" ? t.exports = n() : t.exports = r();
|
|
180
|
+
})))();
|
|
181
|
+
function a({ children: e, onClick: t }) {
|
|
182
|
+
return /* @__PURE__ */ (0, i.jsx)("button", {
|
|
183
|
+
onClick: t,
|
|
184
|
+
style: {
|
|
185
|
+
padding: "8px 12px",
|
|
186
|
+
borderRadius: 8,
|
|
187
|
+
background: "#0f766e",
|
|
188
|
+
color: "#fff",
|
|
189
|
+
border: "none"
|
|
190
|
+
},
|
|
191
|
+
children: e
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/components/Card.jsx
|
|
196
|
+
function o({ children: e }) {
|
|
197
|
+
return /* @__PURE__ */ (0, i.jsx)("div", {
|
|
198
|
+
style: {
|
|
199
|
+
border: "1px solid #ddd",
|
|
200
|
+
padding: 12,
|
|
201
|
+
borderRadius: 8
|
|
202
|
+
},
|
|
203
|
+
children: e
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region src/components/Input.jsx
|
|
208
|
+
function s({ placeholder: e, value: t, onChange: n, type: r = "text", ...a }) {
|
|
209
|
+
return /* @__PURE__ */ (0, i.jsx)("input", {
|
|
210
|
+
type: r,
|
|
211
|
+
placeholder: e,
|
|
212
|
+
value: t,
|
|
213
|
+
onChange: n,
|
|
214
|
+
style: {
|
|
215
|
+
padding: "8px 12px",
|
|
216
|
+
borderRadius: 8,
|
|
217
|
+
border: "1px solid #ddd",
|
|
218
|
+
fontSize: "14px",
|
|
219
|
+
fontFamily: "inherit"
|
|
220
|
+
},
|
|
221
|
+
...a
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
//#endregion
|
|
225
|
+
export { a as Button, o as Card, s as Input };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.MyUILib={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),r=t((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===O?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(typeof e.tag==`number`&&console.error(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var n=e.render;return e=e.displayName,e||=(e=n.displayName||n.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return n=e.displayName||null,n===null?t(e.type)||`Memo`:n;case E:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function n(e){return``+e}function r(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,i=typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`;return r.call(t,`The provided key is an unsupported type %s. This value must be coerced to a string before using it here.`,i),n(e)}}function i(e){if(e===_)return`<>`;if(typeof e==`object`&&e&&e.$$typeof===E)return`<...>`;try{var n=t(e);return n?`<`+n+`>`:`<...>`}catch{return`<...>`}}function a(){var e=k.A;return e===null?null:e.getOwner()}function o(){return Error(`react-stack-top-frame`)}function s(e){if(A.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function c(e,t){function n(){N||(N=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function l(){var e=t(this.type);return P[e]||(P[e]=!0,console.error(`Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.`)),e=this.props.ref,e===void 0?null:e}function u(e,t,n,r,i,a){var o=n.ref;return e={$$typeof:h,type:e,key:t,props:n,_owner:r},(o===void 0?null:o)===null?Object.defineProperty(e,"ref",{enumerable:!1,value:null}):Object.defineProperty(e,"ref",{enumerable:!1,get:l}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function d(e,n,i,o,l,d){var p=n.children;if(p!==void 0)if(o)if(j(p)){for(o=0;o<p.length;o++)f(p[o]);Object.freeze&&Object.freeze(p)}else console.error(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`);else f(p);if(A.call(n,`key`)){p=t(e);var m=Object.keys(n).filter(function(e){return e!==`key`});o=0<m.length?`{key: someKey, `+m.join(`: ..., `)+`: ...}`:`{key: someKey}`,L[p+o]||(m=0<m.length?`{`+m.join(`: ..., `)+`: ...}`:`{}`,console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,o,p,m,p),L[p+o]=!0)}if(p=null,i!==void 0&&(r(i),p=``+i),s(n)&&(r(n.key),p=``+n.key),`key`in n)for(var h in i={},n)h!==`key`&&(i[h]=n[h]);else i=n;return p&&c(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),u(e,p,i,a(),l,d)}function f(e){p(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===E&&(e._payload.status===`fulfilled`?p(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function p(e){return typeof e==`object`&&!!e&&e.$$typeof===h}var m=require("react"),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.client.reference`),k=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=Object.prototype.hasOwnProperty,j=Array.isArray,M=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(e){return e()}};var N,P={},F=m.react_stack_bottom_frame.bind(m,o)(),I=M(i(o)),L={};e.Fragment=_,e.jsx=function(e,t,n){var r=1e4>k.recentlyCreatedOwnerStacks++;return d(e,t,n,!1,r?Error(`react-stack-top-frame`):F,r?M(i(e)):I)},e.jsxs=function(e,t,n){var r=1e4>k.recentlyCreatedOwnerStacks++;return d(e,t,n,!0,r?Error(`react-stack-top-frame`):F,r?M(i(e)):I)}})()})),i=t(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=n():t.exports=r()}))();function a({children:e,onClick:t}){return(0,i.jsx)(`button`,{onClick:t,style:{padding:`8px 12px`,borderRadius:8,background:`#0f766e`,color:`#fff`,border:`none`},children:e})}function o({children:e}){return(0,i.jsx)(`div`,{style:{border:`1px solid #ddd`,padding:12,borderRadius:8},children:e})}function s({placeholder:e,value:t,onChange:n,type:r=`text`,...a}){return(0,i.jsx)(`input`,{type:r,placeholder:e,value:t,onChange:n,style:{padding:`8px 12px`,borderRadius:8,border:`1px solid #ddd`,fontSize:`14px`,fontFamily:`inherit`},...a})}e.Button=a,e.Card=o,e.Input=s});
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dheerajsingh20aug/my-ui-lib",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A reusable React component library with Button, Card, and Input components",
|
|
5
|
+
"main": "dist/index.umd.cjs",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.mjs",
|
|
14
|
+
"require": "./dist/index.umd.cjs",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "vite build",
|
|
20
|
+
"build:demo": "cd demo && vite build",
|
|
21
|
+
"dev:demo": "cd demo && vite",
|
|
22
|
+
"preview": "vite preview",
|
|
23
|
+
"lint": "eslint src --ext .jsx,.js"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/yourusername/my-ui-lib.git"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"react",
|
|
31
|
+
"components",
|
|
32
|
+
"button",
|
|
33
|
+
"card",
|
|
34
|
+
"input",
|
|
35
|
+
"ui-library"
|
|
36
|
+
],
|
|
37
|
+
"author": "Your Name",
|
|
38
|
+
"license": "ISC",
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": "^18 || ^19",
|
|
41
|
+
"react-dom": "^18 || ^19"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"react": "^18 || ^19",
|
|
45
|
+
"react-dom": "^18 || ^19"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/react": "^19.2.17",
|
|
49
|
+
"@types/react-dom": "^19.2.3",
|
|
50
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
51
|
+
"typescript": "^6.0.3",
|
|
52
|
+
"vite": "^8.0.16"
|
|
53
|
+
}
|
|
54
|
+
}
|