omui-lib 1.0.0 → 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 +820 -236
  39. package/dist/index.mjs +43 -271
  40. package/package.json +7 -4
package/dist/index.mjs CHANGED
@@ -1,274 +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
- };
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";
271
34
  export {
35
+ AnimatedProgressBar,
36
+ Box,
272
37
  Button,
273
- Card
38
+ CommentCard,
39
+ Graph,
40
+ HoverCard,
41
+ Loader,
42
+ PricingCard,
43
+ SliderCard,
44
+ SwipeCard,
45
+ ThumbnailCard
274
46
  };
package/package.json CHANGED
@@ -1,20 +1,23 @@
1
1
  {
2
2
  "name": "omui-lib",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "omUI react component library",
5
5
  "license": "ISC",
6
6
  "author": "Om Mohanty",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.mjs",
9
- "files": ["dist"],
9
+ "files": [
10
+ "dist"
11
+ ],
10
12
  "scripts": {
11
13
  "build": "tsup"
12
14
  },
13
15
  "peerDependencies": {
14
- "react": ">=18"
16
+ "react": ">=18",
17
+ "react-dom": ">=18"
15
18
  },
16
19
  "devDependencies": {
17
20
  "tsup": "^8.5.1",
18
21
  "typescript": "^6.0.3"
19
22
  }
20
- }
23
+ }