omui-lib 1.0.1 → 1.0.3

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.
Files changed (40) hide show
  1. package/dist/chunk-57QJO5RD.mjs +83 -0
  2. package/dist/chunk-5LA6VVEY.mjs +56 -0
  3. package/dist/chunk-EWRW432G.mjs +39 -0
  4. package/dist/chunk-FGTNFYFJ.mjs +114 -0
  5. package/dist/chunk-MQOZXOBV.mjs +93 -0
  6. package/dist/chunk-NJSJATQ6.mjs +128 -0
  7. package/dist/chunk-SJ4MEFAG.mjs +103 -0
  8. package/dist/chunk-UVOXBLXP.mjs +38 -0
  9. package/dist/chunk-VA6HDMVP.mjs +50 -0
  10. package/dist/chunk-XD6E2QQI.mjs +143 -0
  11. package/dist/chunk-XGVKPI3O.mjs +23 -0
  12. package/dist/components/AnimatedProgressBar/AnimatedProgressBar.js +83 -0
  13. package/dist/components/AnimatedProgressBar/AnimatedProgressBar.mjs +6 -0
  14. package/dist/components/Box/Box.js +71 -0
  15. package/dist/components/Box/Box.mjs +6 -0
  16. package/dist/components/Button/Button.js +89 -0
  17. package/dist/components/Button/Button.mjs +6 -0
  18. package/dist/components/CommentCard/CommentCard.js +72 -0
  19. package/dist/components/CommentCard/CommentCard.mjs +6 -0
  20. package/dist/components/Graph/Graph.js +136 -0
  21. package/dist/components/Graph/Graph.mjs +6 -0
  22. package/dist/components/HoverCard/HoverCard.js +126 -0
  23. package/dist/components/HoverCard/HoverCard.mjs +6 -0
  24. package/dist/components/Loader/Loader.js +56 -0
  25. package/dist/components/Loader/Loader.mjs +6 -0
  26. package/dist/components/PricingCard/PricingCard.js +147 -0
  27. package/dist/components/PricingCard/PricingCard.mjs +6 -0
  28. package/dist/components/SliderCard/SliderCard.js +161 -0
  29. package/dist/components/SliderCard/SliderCard.mjs +6 -0
  30. package/dist/components/SwipeCard/SwipeCard.js +176 -0
  31. package/dist/components/SwipeCard/SwipeCard.mjs +6 -0
  32. package/dist/components/ThumbnailCard/ThumbnailCard.js +116 -0
  33. package/dist/components/ThumbnailCard/ThumbnailCard.mjs +6 -0
  34. package/dist/components/ToggleButton/ToggleButton.js +100 -0
  35. package/dist/components/ToggleButton/ToggleButton.mjs +66 -0
  36. package/dist/components/Toolbox/Toolbox.js +102 -0
  37. package/dist/components/Toolbox/Toolbox.mjs +68 -0
  38. package/dist/index.js +811 -405
  39. package/dist/index.mjs +43 -448
  40. package/package.json +4 -3
package/dist/index.mjs CHANGED
@@ -1,451 +1,46 @@
1
- // src/components/Button/Button.jsx
2
- import React, { useState } from "react";
3
- var Button = ({
4
- text = "Button",
5
- variant = "solid",
6
- // solid | outline | ghost
7
- size = "md",
8
- // sm | md | lg
9
- palette = "primary",
10
- // primary | secondary | danger | success
11
- disabled = false,
12
- fullWidth = false,
13
- onClick = () => {
14
- }
15
- }) => {
16
- const [isHovered, setIsHovered] = useState(false);
17
- const [isActive, setIsActive] = useState(false);
18
- const palettes = {
19
- primary: {
20
- bg: "#4CAF50",
21
- text: "#ffffff",
22
- border: "#4CAF50",
23
- hover: "#45a049",
24
- active: "#3e8e41"
25
- },
26
- secondary: {
27
- bg: "#2196F3",
28
- text: "#ffffff",
29
- border: "#2196F3",
30
- hover: "#1976d2",
31
- active: "#1565c0"
32
- },
33
- danger: {
34
- bg: "#f44336",
35
- text: "#ffffff",
36
- border: "#f44336",
37
- hover: "#d32f2f",
38
- active: "#b71c1c"
39
- },
40
- success: {
41
- bg: "#00897b",
42
- text: "#ffffff",
43
- border: "#00897b",
44
- hover: "#00695c",
45
- active: "#004d40"
46
- }
47
- };
48
- const sizes = {
49
- sm: {
50
- padding: "6px 12px",
51
- fontSize: "12px"
52
- },
53
- md: {
54
- padding: "10px 18px",
55
- fontSize: "14px"
56
- },
57
- lg: {
58
- padding: "14px 26px",
59
- fontSize: "16px"
60
- }
61
- };
62
- const selectedPalette = palettes[palette] || palettes.primary;
63
- const selectedSize = sizes[size] || sizes.md;
64
- const getVariantStyles = () => {
65
- if (variant === "outline") {
66
- return {
67
- backgroundColor: "transparent",
68
- color: selectedPalette.border,
69
- border: `2px solid ${selectedPalette.border}`
70
- };
71
- }
72
- if (variant === "ghost") {
73
- return {
74
- backgroundColor: "transparent",
75
- color: selectedPalette.border,
76
- border: "none"
77
- };
78
- }
79
- return {
80
- backgroundColor: selectedPalette.bg,
81
- color: selectedPalette.text,
82
- border: "none"
83
- };
84
- };
85
- const getStateStyles = () => {
86
- if (disabled) {
87
- return {
88
- backgroundColor: "#ccc",
89
- color: "#666",
90
- cursor: "not-allowed"
91
- };
92
- }
93
- if (isActive) {
94
- return {
95
- backgroundColor: variant === "solid" ? selectedPalette.active : "#e0e0e0",
96
- transform: "scale(0.96)"
97
- };
98
- }
99
- if (isHovered) {
100
- return {
101
- backgroundColor: variant === "solid" ? selectedPalette.hover : "#f5f5f5"
102
- };
103
- }
104
- return {};
105
- };
106
- const baseStyles = {
107
- display: "inline-block",
108
- width: fullWidth ? "100%" : "auto",
109
- borderRadius: "8px",
110
- fontWeight: "600",
111
- transition: "all 0.25s ease",
112
- cursor: disabled ? "not-allowed" : "pointer",
113
- outline: "none",
114
- userSelect: "none"
115
- };
116
- const combinedStyles = {
117
- ...baseStyles,
118
- ...selectedSize,
119
- ...getVariantStyles(),
120
- ...getStateStyles()
121
- };
122
- return /* @__PURE__ */ React.createElement(
123
- "button",
124
- {
125
- style: combinedStyles,
126
- disabled,
127
- onClick: (e) => !disabled && onClick(e),
128
- onMouseEnter: () => setIsHovered(true),
129
- onMouseLeave: () => {
130
- setIsHovered(false);
131
- setIsActive(false);
132
- },
133
- onMouseDown: () => setIsActive(true),
134
- onMouseUp: () => setIsActive(false)
135
- },
136
- text
137
- );
138
- };
139
-
140
- // src/components/Card/Card.jsx
141
- import React2, { useState as useState2 } from "react";
142
- var Card = ({
143
- title = "Card Title",
144
- description = "This is a simple card description.",
145
- image = "",
146
- variant = "elevated",
147
- // elevated | outlined | flat
148
- size = "md",
149
- // sm | md | lg
150
- palette = "primary",
151
- // primary | secondary | danger | success
152
- hoverable = true,
153
- clickable = false,
154
- fullWidth = false,
155
- onClick = () => {
156
- }
157
- }) => {
158
- const [isHovered, setIsHovered] = useState2(false);
159
- const palettes = {
160
- primary: {
161
- bg: "#ffffff",
162
- border: "#4CAF50",
163
- title: "#333",
164
- text: "#555"
165
- },
166
- secondary: {
167
- bg: "#ffffff",
168
- border: "#2196F3",
169
- title: "#333",
170
- text: "#555"
171
- },
172
- danger: {
173
- bg: "#ffffff",
174
- border: "#f44336",
175
- title: "#333",
176
- text: "#555"
177
- },
178
- success: {
179
- bg: "#ffffff",
180
- border: "#00897b",
181
- title: "#333",
182
- text: "#555"
183
- }
184
- };
185
- const sizes = {
186
- sm: {
187
- padding: "10px",
188
- titleSize: "14px",
189
- textSize: "12px"
190
- },
191
- md: {
192
- padding: "16px",
193
- titleSize: "18px",
194
- textSize: "14px"
195
- },
196
- lg: {
197
- padding: "20px",
198
- titleSize: "22px",
199
- textSize: "16px"
200
- }
201
- };
202
- const selectedPalette = palettes[palette] || palettes.primary;
203
- const selectedSize = sizes[size] || sizes.md;
204
- const getVariantStyles = () => {
205
- switch (variant) {
206
- case "outlined":
207
- return {
208
- border: `2px solid ${selectedPalette.border}`,
209
- boxShadow: "none"
210
- };
211
- case "flat":
212
- return {
213
- border: "none",
214
- boxShadow: "none"
215
- };
216
- default:
217
- return {
218
- border: "none",
219
- boxShadow: "0 4px 10px rgba(0,0,0,0.15)"
220
- };
221
- }
222
- };
223
- const hoverStyles = hoverable && isHovered ? {
224
- transform: "translateY(-5px)",
225
- boxShadow: "0 8px 18px rgba(0,0,0,0.2)"
226
- } : {};
227
- const baseStyles = {
228
- width: fullWidth ? "100%" : "280px",
229
- backgroundColor: selectedPalette.bg,
230
- borderRadius: "12px",
231
- overflow: "hidden",
232
- cursor: clickable ? "pointer" : "default",
233
- transition: "all 0.3s ease"
234
- };
235
- const containerStyles = {
236
- ...baseStyles,
237
- ...getVariantStyles(),
238
- ...hoverStyles
239
- };
240
- const contentStyles = {
241
- padding: selectedSize.padding
242
- };
243
- const titleStyles = {
244
- fontSize: selectedSize.titleSize,
245
- fontWeight: "600",
246
- marginBottom: "8px",
247
- color: selectedPalette.title
248
- };
249
- const textStyles = {
250
- fontSize: selectedSize.textSize,
251
- color: selectedPalette.text,
252
- lineHeight: "1.5"
253
- };
254
- const imageStyles = {
255
- width: "100%",
256
- height: "160px",
257
- objectFit: "cover"
258
- };
259
- return /* @__PURE__ */ React2.createElement(
260
- "div",
261
- {
262
- style: containerStyles,
263
- onMouseEnter: () => setIsHovered(true),
264
- onMouseLeave: () => setIsHovered(false),
265
- onClick: (e) => clickable && onClick(e)
266
- },
267
- image && /* @__PURE__ */ React2.createElement("img", { src: image, alt: "card", style: imageStyles }),
268
- /* @__PURE__ */ React2.createElement("div", { style: contentStyles }, /* @__PURE__ */ React2.createElement("div", { style: titleStyles }, title), /* @__PURE__ */ React2.createElement("div", { style: textStyles }, description))
269
- );
270
- };
271
-
272
- // src/components/ProfileCard/ProfileCard.jsx
273
- import React3, { useState as useState3 } from "react";
274
- var ProfileCard = ({
275
- name = "John Doe",
276
- role = "Frontend Developer",
277
- bio = "Passionate developer who loves building clean UI components.",
278
- avatar = "https://via.placeholder.com/150",
279
- variant = "elevated",
280
- // elevated | outlined | flat
281
- size = "md",
282
- // sm | md | lg
283
- palette = "primary",
284
- // primary | secondary | danger | success
285
- clickable = false,
286
- hoverable = true,
287
- fullWidth = false,
288
- onFollow = () => {
289
- },
290
- onMessage = () => {
291
- }
292
- }) => {
293
- const [isHovered, setIsHovered] = useState3(false);
294
- const [isFollowing, setIsFollowing] = useState3(false);
295
- const palettes = {
296
- primary: {
297
- border: "#4CAF50",
298
- accent: "#4CAF50",
299
- text: "#333",
300
- subText: "#666",
301
- bg: "#ffffff"
302
- },
303
- secondary: {
304
- border: "#2196F3",
305
- accent: "#2196F3",
306
- text: "#333",
307
- subText: "#666",
308
- bg: "#ffffff"
309
- },
310
- danger: {
311
- border: "#f44336",
312
- accent: "#f44336",
313
- text: "#333",
314
- subText: "#666",
315
- bg: "#ffffff"
316
- },
317
- success: {
318
- border: "#00897b",
319
- accent: "#00897b",
320
- text: "#333",
321
- subText: "#666",
322
- bg: "#ffffff"
323
- }
324
- };
325
- const sizes = {
326
- sm: {
327
- padding: "12px",
328
- name: "14px",
329
- role: "12px",
330
- bio: "12px",
331
- avatar: "60px"
332
- },
333
- md: {
334
- padding: "16px",
335
- name: "18px",
336
- role: "14px",
337
- bio: "13px",
338
- avatar: "80px"
339
- },
340
- lg: {
341
- padding: "20px",
342
- name: "22px",
343
- role: "16px",
344
- bio: "14px",
345
- avatar: "100px"
346
- }
347
- };
348
- const selectedPalette = palettes[palette] || palettes.primary;
349
- const selectedSize = sizes[size] || sizes.md;
350
- const getVariantStyles = () => {
351
- switch (variant) {
352
- case "outlined":
353
- return {
354
- border: `2px solid ${selectedPalette.border}`,
355
- boxShadow: "none"
356
- };
357
- case "flat":
358
- return {
359
- border: "none",
360
- boxShadow: "none"
361
- };
362
- default:
363
- return {
364
- border: "none",
365
- boxShadow: "0 6px 16px rgba(0,0,0,0.15)"
366
- };
367
- }
368
- };
369
- const hoverStyles = hoverable && isHovered ? {
370
- transform: "translateY(-6px)",
371
- boxShadow: "0 10px 22px rgba(0,0,0,0.2)"
372
- } : {};
373
- const containerStyles = {
374
- width: fullWidth ? "100%" : "300px",
375
- backgroundColor: selectedPalette.bg,
376
- borderRadius: "14px",
377
- textAlign: "center",
378
- padding: selectedSize.padding,
379
- cursor: clickable ? "pointer" : "default",
380
- transition: "all 0.3s ease",
381
- ...getVariantStyles(),
382
- ...hoverStyles
383
- };
384
- const avatarStyles = {
385
- width: selectedSize.avatar,
386
- height: selectedSize.avatar,
387
- borderRadius: "50%",
388
- objectFit: "cover",
389
- marginBottom: "12px",
390
- border: `3px solid ${selectedPalette.border}`
391
- };
392
- const nameStyles = {
393
- fontSize: selectedSize.name,
394
- fontWeight: "600",
395
- color: selectedPalette.text
396
- };
397
- const roleStyles = {
398
- fontSize: selectedSize.role,
399
- color: selectedPalette.accent,
400
- marginBottom: "8px"
401
- };
402
- const bioStyles = {
403
- fontSize: selectedSize.bio,
404
- color: selectedPalette.subText,
405
- marginBottom: "12px",
406
- lineHeight: "1.4"
407
- };
408
- const buttonBase = {
409
- padding: "8px 14px",
410
- margin: "4px",
411
- borderRadius: "6px",
412
- border: "none",
413
- cursor: "pointer",
414
- fontSize: "12px",
415
- fontWeight: "500",
416
- transition: "0.2s"
417
- };
418
- const followBtn = {
419
- ...buttonBase,
420
- backgroundColor: isFollowing ? "#ccc" : selectedPalette.accent,
421
- color: isFollowing ? "#333" : "#fff"
422
- };
423
- const messageBtn = {
424
- ...buttonBase,
425
- backgroundColor: "transparent",
426
- border: `1px solid ${selectedPalette.accent}`,
427
- color: selectedPalette.accent
428
- };
429
- const handleFollow = () => {
430
- setIsFollowing(!isFollowing);
431
- onFollow();
432
- };
433
- return /* @__PURE__ */ React3.createElement(
434
- "div",
435
- {
436
- style: containerStyles,
437
- onMouseEnter: () => setIsHovered(true),
438
- onMouseLeave: () => setIsHovered(false)
439
- },
440
- /* @__PURE__ */ React3.createElement("img", { src: avatar, alt: "avatar", style: avatarStyles }),
441
- /* @__PURE__ */ React3.createElement("div", { style: nameStyles }, name),
442
- /* @__PURE__ */ React3.createElement("div", { style: roleStyles }, role),
443
- /* @__PURE__ */ React3.createElement("div", { style: bioStyles }, bio),
444
- /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement("button", { style: followBtn, onClick: handleFollow }, isFollowing ? "Following" : "Follow"), /* @__PURE__ */ React3.createElement("button", { style: messageBtn, onClick: onMessage }, "Message"))
445
- );
446
- };
1
+ import {
2
+ PricingCard
3
+ } from "./chunk-FGTNFYFJ.mjs";
4
+ import {
5
+ SliderCard
6
+ } from "./chunk-NJSJATQ6.mjs";
7
+ import {
8
+ SwipeCard
9
+ } from "./chunk-XD6E2QQI.mjs";
10
+ import {
11
+ ThumbnailCard
12
+ } from "./chunk-57QJO5RD.mjs";
13
+ import {
14
+ AnimatedProgressBar
15
+ } from "./chunk-VA6HDMVP.mjs";
16
+ import {
17
+ Box
18
+ } from "./chunk-UVOXBLXP.mjs";
19
+ import {
20
+ Button
21
+ } from "./chunk-5LA6VVEY.mjs";
22
+ import {
23
+ CommentCard
24
+ } from "./chunk-EWRW432G.mjs";
25
+ import {
26
+ Graph
27
+ } from "./chunk-SJ4MEFAG.mjs";
28
+ import {
29
+ HoverCard
30
+ } from "./chunk-MQOZXOBV.mjs";
31
+ import {
32
+ Loader
33
+ } from "./chunk-XGVKPI3O.mjs";
447
34
  export {
35
+ AnimatedProgressBar,
36
+ Box,
448
37
  Button,
449
- Card,
450
- ProfileCard
38
+ CommentCard,
39
+ Graph,
40
+ HoverCard,
41
+ Loader,
42
+ PricingCard,
43
+ SliderCard,
44
+ SwipeCard,
45
+ ThumbnailCard
451
46
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omui-lib",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "omUI react component library",
5
5
  "license": "ISC",
6
6
  "author": "Om Mohanty",
@@ -13,10 +13,11 @@
13
13
  "build": "tsup"
14
14
  },
15
15
  "peerDependencies": {
16
- "react": ">=18"
16
+ "react": ">=18",
17
+ "react-dom": ">=18"
17
18
  },
18
19
  "devDependencies": {
19
20
  "tsup": "^8.5.1",
20
21
  "typescript": "^6.0.3"
21
22
  }
22
- }
23
+ }