funuicss 2.5.3 → 2.5.5

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.
@@ -45,359 +45,25 @@ var __rest = (this && this.__rest) || function (s, e) {
45
45
  return t;
46
46
  };
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.colors = void 0;
49
48
  var React = __importStar(require("react"));
50
49
  var pi_1 = require("react-icons/pi");
51
- exports.colors = {
52
- primary: "#6366f1",
53
- primary50: "#eef2ff",
54
- primary100: "#e0e7ff",
55
- primary200: "#c7d2fe",
56
- primary300: "#a5b4fc",
57
- primary400: "#818cf8",
58
- primary500: "#6366f1",
59
- primary600: "#4f46e5",
60
- primary700: "#4338ca",
61
- primary800: "#3730a3",
62
- primary900: "#312e81",
63
- secondary: "#ec4899",
64
- secondary50: "#fdf2f8",
65
- secondary100: "#fce7f3",
66
- secondary200: "#fbcfe8",
67
- secondary300: "#f9a8d4",
68
- secondary400: "#f472b6",
69
- secondary500: "#ec4899",
70
- secondary600: "#db2777",
71
- secondary700: "#be185d",
72
- secondary800: "#9d174d",
73
- secondary900: "#831843",
74
- error: "#ef4444",
75
- error50: "#fef2f2",
76
- error100: "#fee2e2",
77
- error200: "#fecaca",
78
- error300: "#fca5a5",
79
- error400: "#f87171",
80
- error500: "#ef4444",
81
- error600: "#dc2626",
82
- error700: "#b91c1c",
83
- error800: "#991b1b",
84
- error900: "#7f1d1d",
85
- success: "#22c55e",
86
- success50: "#f0fdf4",
87
- success100: "#dcfce7",
88
- success200: "#bbf7d0",
89
- success300: "#86efac",
90
- success400: "#4ade80",
91
- success500: "#22c55e",
92
- success600: "#16a34a",
93
- success700: "#15803d",
94
- success800: "#166534",
95
- success900: "#14532d",
96
- warning: "#fb923c",
97
- warning50: "#fff7ed",
98
- warning100: "#ffedd5",
99
- warning200: "#fed7aa",
100
- warning300: "#fdba74",
101
- warning400: "#fb923c",
102
- warning500: "#f97316",
103
- warning600: "#ea580c",
104
- warning700: "#c2410c",
105
- warning800: "#9a3412",
106
- warning900: "#7c2d12",
107
- muted: "#78716c",
108
- muted50: "#fafafa",
109
- muted100: "#f5f5f5",
110
- muted200: "#e5e5e5",
111
- muted300: "#d4d4d4",
112
- muted400: "#a3a3a3",
113
- muted500: "#737373",
114
- muted600: "#525252",
115
- muted700: "#404040",
116
- muted800: "#262626",
117
- muted900: "#171717",
118
- info: "#0ea5e9",
119
- info50: "#f0f9ff",
120
- info100: "#e0f2fe",
121
- info200: "#bae6fd",
122
- info300: "#7dd3fc",
123
- info400: "#38bdf8",
124
- info500: "#0ea5e9",
125
- info600: "#0284c7",
126
- info700: "#0369a1",
127
- info800: "#075985",
128
- info900: "#0c4a6e",
129
- light: "#f5f5f4",
130
- light50: "#fafaf9",
131
- light100: "#f5f5f4",
132
- light200: "#e7e5e4",
133
- light300: "#d6d3d1",
134
- light400: "#a8a29e",
135
- light500: "#78716c",
136
- light600: "#57534e",
137
- light700: "#44403c",
138
- light800: "#292524",
139
- light900: "#1c1917",
140
- rose: "#f43f5e",
141
- rose50: "#fff1f2",
142
- rose100: "#ffe4e6",
143
- rose200: "#fecdd3",
144
- rose300: "#fda4af",
145
- rose400: "#fb7185",
146
- rose500: "#f43f5e",
147
- rose600: "#e11d48",
148
- rose700: "#be123c",
149
- rose800: "#9f1239",
150
- rose900: "#881337",
151
- pink: "#ec4899",
152
- pink50: "#fdf2f8",
153
- pink100: "#fce7f3",
154
- pink200: "#fbcfe8",
155
- pink300: "#f9a8d4",
156
- pink400: "#f472b6",
157
- pink500: "#ec4899",
158
- pink600: "#db2777",
159
- pink700: "#be185d",
160
- pink800: "#9d174d",
161
- pink900: "#831843",
162
- fuchsia: "#d946ef",
163
- fuchsia50: "#fdf4ff",
164
- fuchsia100: "#fae8ff",
165
- fuchsia200: "#f5d0fe",
166
- fuchsia300: "#f0abfc",
167
- fuchsia400: "#e879f9",
168
- fuchsia500: "#d946ef",
169
- fuchsia600: "#c026d3",
170
- fuchsia700: "#a21caf",
171
- fuchsia800: "#86198f",
172
- fuchsia900: "#701a75",
173
- purple: "#a855f7",
174
- purple50: "#faf5ff",
175
- purple100: "#f3e8ff",
176
- purple200: "#e9d5ff",
177
- purple300: "#d8b4fe",
178
- purple400: "#c084fc",
179
- purple500: "#a855f7",
180
- purple600: "#9333ea",
181
- purple700: "#7e22ce",
182
- purple800: "#6b21a8",
183
- purple900: "#581c87",
184
- violet: "#8b5cf6",
185
- violet50: "#f5f3ff",
186
- violet100: "#ede9fe",
187
- violet200: "#ddd6fe",
188
- violet300: "#c4b5fd",
189
- violet400: "#a78bfa",
190
- violet500: "#8b5cf6",
191
- violet600: "#7c3aed",
192
- violet700: "#6d28d9",
193
- violet800: "#5b21b6",
194
- violet900: "#4c1d95",
195
- indigo: "#6366f1",
196
- indigo50: "#eef2ff",
197
- indigo100: "#e0e7ff",
198
- indigo200: "#c7d2fe",
199
- indigo300: "#a5b4fc",
200
- indigo400: "#818cf8",
201
- indigo500: "#6366f1",
202
- indigo600: "#4f46e5",
203
- indigo700: "#4338ca",
204
- indigo800: "#3730a3",
205
- indigo900: "#312e81",
206
- blue: "#3b82f6",
207
- blue50: "#eff6ff",
208
- blue100: "#dbeafe",
209
- blue200: "#bfdbfe",
210
- blue300: "#93c5fd",
211
- blue400: "#60a5fa",
212
- blue500: "#3b82f6",
213
- blue600: "#2563eb",
214
- blue700: "#1d4ed8",
215
- blue800: "#1e40af",
216
- blue900: "#1e3a8a",
217
- lightBlue: "#0ea5e9",
218
- lightBlue50: "#f0f9ff",
219
- lightBlue100: "#e0f2fe",
220
- lightBlue200: "#bae6fd",
221
- lightBlue300: "#7dd3fc",
222
- lightBlue400: "#38bdf8",
223
- lightBlue500: "#0ea5e9",
224
- lightBlue600: "#0284c7",
225
- lightBlue700: "#0369a1",
226
- lightBlue800: "#075985",
227
- lightBlue900: "#0c4a6e",
228
- darkBlue: "#0077e6",
229
- darkBlue50: "#dbf4ff",
230
- darkBlue100: "#addbff",
231
- darkBlue200: "#7cc2ff",
232
- darkBlue300: "#4aa9ff",
233
- darkBlue400: "#1a91ff",
234
- darkBlue500: "#0077e6",
235
- darkBlue600: "#005db4",
236
- darkBlue700: "#004282",
237
- darkBlue800: "#002851",
238
- darkBlue900: "#000e21",
239
- cyan: "#06b6d4",
240
- cyan50: "#ecfeff",
241
- cyan100: "#cffafe",
242
- cyan200: "#a5f3fc",
243
- cyan300: "#67e8f9",
244
- cyan400: "#22d3ee",
245
- cyan500: "#06b6d4",
246
- cyan600: "#0891b2",
247
- cyan700: "#0e7490",
248
- cyan800: "#155e75",
249
- cyan900: "#164e63",
250
- teal: "#14b8a6",
251
- teal50: "#f0fdfa",
252
- teal100: "#ccfbf1",
253
- teal200: "#99f6e4",
254
- teal300: "#5eead4",
255
- teal400: "#2dd4bf",
256
- teal500: "#14b8a6",
257
- teal600: "#0d9488",
258
- teal700: "#0f766e",
259
- teal800: "#115e59",
260
- teal900: "#134e4a",
261
- emerald: "#10b981",
262
- emerald50: "#ecfdf5",
263
- emerald100: "#d1fae5",
264
- emerald200: "#a7f3d0",
265
- emerald300: "#6ee7b7",
266
- emerald400: "#34d399",
267
- emerald500: "#10b981",
268
- emerald600: "#059669",
269
- emerald700: "#047857",
270
- emerald800: "#065f46",
271
- emerald900: "#064e3b",
272
- green: "#22c55e",
273
- green50: "#f0fdf4",
274
- green100: "#dcfce7",
275
- green200: "#bbf7d0",
276
- green300: "#86efac",
277
- green400: "#4ade80",
278
- green500: "#22c55e",
279
- green600: "#16a34a",
280
- green700: "#15803d",
281
- green800: "#166534",
282
- green900: "#14532d",
283
- lime: "#84cc16",
284
- lime50: "#f7fee7",
285
- lime100: "#ecfccb",
286
- lime200: "#d9f99d",
287
- lime300: "#bef264",
288
- lime400: "#a3e635",
289
- lime500: "#84cc16",
290
- lime600: "#65a30d",
291
- lime700: "#4d7c0f",
292
- lime800: "#3f6212",
293
- lime900: "#365314",
294
- yellow: "#eab308",
295
- yellow50: "#fefce8",
296
- yellow100: "#fef9c3",
297
- yellow200: "#fef08a",
298
- yellow300: "#fde047",
299
- yellow400: "#facc15",
300
- yellow500: "#eab308",
301
- yellow600: "#ca8a04",
302
- yellow700: "#a16207",
303
- yellow800: "#854d0e",
304
- yellow900: "#713f12",
305
- amber: "#f59e0b",
306
- amber50: "#fffbeb",
307
- amber100: "#fef3c7",
308
- amber200: "#fde68a",
309
- amber300: "#fcd34d",
310
- amber400: "#fbbf24",
311
- amber500: "#f59e0b",
312
- amber600: "#d97706",
313
- amber700: "#b45309",
314
- amber800: "#92400e",
315
- amber900: "#78350f",
316
- orange: "#f97316",
317
- orange50: "#fff7ed",
318
- orange100: "#ffedd5",
319
- orange200: "#fed7aa",
320
- orange300: "#fdba74",
321
- orange400: "#fb923c",
322
- orange500: "#f97316",
323
- orange600: "#ea580c",
324
- orange700: "#c2410c",
325
- orange800: "#9a3412",
326
- orange900: "#7c2d12",
327
- red: "#ef4444",
328
- red50: "#fef2f2",
329
- red100: "#fee2e2",
330
- red200: "#fecaca",
331
- red300: "#fca5a5",
332
- red400: "#f87171",
333
- red500: "#ef4444",
334
- red600: "#dc2626",
335
- red700: "#b91c1c",
336
- red800: "#991b1b",
337
- red900: "#7f1d1d",
338
- warmGray: "#78716c",
339
- warmGray50: "#fafaf9",
340
- warmGray100: "#f5f5f4",
341
- warmGray200: "#e7e5e4",
342
- warmGray300: "#d6d3d1",
343
- warmGray400: "#a8a29e",
344
- warmGray500: "#78716c",
345
- warmGray600: "#57534e",
346
- warmGray700: "#44403c",
347
- warmGray800: "#292524",
348
- warmGray900: "#1c1917",
349
- trueGray: "#737373",
350
- trueGray50: "#fafafa",
351
- trueGray100: "#f5f5f5",
352
- trueGray200: "#e5e5e5",
353
- trueGray300: "#d4d4d4",
354
- trueGray400: "#a3a3a3",
355
- trueGray500: "#737373",
356
- trueGray600: "#525252",
357
- trueGray700: "#404040",
358
- trueGray800: "#262626",
359
- trueGray900: "#171717",
360
- coolGray: "#6b7280",
361
- coolGray50: "#f9fafb",
362
- coolGray100: "#f3f4f6",
363
- coolGray200: "#e5e7eb",
364
- coolGray300: "#d1d5db",
365
- coolGray400: "#9ca3af",
366
- coolGray500: "#6b7280",
367
- coolGray600: "#4b5563",
368
- coolGray700: "#374151",
369
- coolGray800: "#1f2937",
370
- coolGray900: "#111827",
371
- blueGray: "#64748b",
372
- blueGray50: "#f8fafc",
373
- blueGray100: "#f1f5f9",
374
- blueGray200: "#e2e8f0",
375
- blueGray300: "#cbd5e1",
376
- blueGray400: "#94a3b8",
377
- blueGray500: "#64748b",
378
- blueGray600: "#475569",
379
- blueGray700: "#334155",
380
- blueGray800: "#1e293b",
381
- blueGray900: "#0f172a",
382
- dark: "#71717a",
383
- dark50: "#18181b",
384
- dark100: "#27272a",
385
- dark200: "#3f3f46",
386
- dark300: "#52525b",
387
- dark400: "#71717a",
388
- dark500: "#a1a1aa",
389
- dark600: "#d4d4d8",
390
- dark700: "#e4e4e7",
391
- dark800: "#f4f4f5",
392
- dark900: "#fafafa",
393
- white: "#FFFFFF",
394
- black: "#000000",
395
- };
396
50
  function Button(_a) {
397
51
  var color = _a.color, bg = _a.bg, funcss = _a.funcss, startIcon = _a.startIcon, endIcon = _a.endIcon, text = _a.text, rounded = _a.rounded, raised = _a.raised, height = _a.height, width = _a.width, float = _a.float, hoverUp = _a.hoverUp, fullWidth = _a.fullWidth, outlined = _a.outlined, small = _a.small, hoverless = _a.hoverless, smaller = _a.smaller, big = _a.big, bigger = _a.bigger, jumbo = _a.jumbo, flat = _a.flat, hoverNone = _a.hoverNone, fillAnimation = _a.fillAnimation, fillDirection = _a.fillDirection, fillTextColor = _a.fillTextColor, outlineSize = _a.outlineSize, isLoading = _a.isLoading, status = _a.status, children = _a.children, bold = _a.bold, style = _a.style, onClick = _a.onClick, rest = __rest(_a, ["color", "bg", "funcss", "startIcon", "endIcon", "text", "rounded", "raised", "height", "width", "float", "hoverUp", "fullWidth", "outlined", "small", "hoverless", "smaller", "big", "bigger", "jumbo", "flat", "hoverNone", "fillAnimation", "fillDirection", "fillTextColor", "outlineSize", "isLoading", "status", "children", "bold", "style", "onClick"]);
52
+ function removeNumbers(text) {
53
+ return text.replace(/[0-9]/g, '');
54
+ }
55
+ function hasNumberAbove(text) {
56
+ var matches = text.match(/\d+/g); // find all numbers in the string
57
+ if (!matches)
58
+ return false;
59
+ return matches.some(function (num) { return parseInt(num) >= 700; });
60
+ }
61
+ function hasNumber(text) {
62
+ return /\d/.test(text);
63
+ }
398
64
  var classNames = [
399
65
  'button',
400
- "text-".concat(color),
66
+ "text-".concat(color ? color : !hasNumber(bg) && !outlined ? "white" : hasNumberAbove(bg) && !outlined ? "white" : removeNumbers(bg)),
401
67
  funcss || '',
402
68
  rounded ? 'roundBtn' : '',
403
69
  hoverless ? 'hoverless' : '',
@@ -412,23 +78,23 @@ function Button(_a) {
412
78
  big ? 'bigBtn' : '',
413
79
  bigger ? 'biggerBtn' : '',
414
80
  jumbo ? 'jumboBtn' : '',
415
- outlined ? "outlined text-".concat(color ? color : bg) : bg || '',
81
+ outlined ? "outlined outline-".concat(bg || '', " text-").concat(color ? color : removeNumbers(bg)) : bg || '',
416
82
  "".concat(fillAnimation ? "".concat(fillTextColor ? "hover-text-".concat(fillTextColor) : '', " button-fill fill-").concat(fillDirection ? fillDirection : 'left') : '')
417
83
  ].join(' ');
418
84
  return (React.createElement("span", null,
419
- React.createElement("button", __assign({ className: "".concat(classNames, " ").concat(startIcon || endIcon || status || isLoading ? 'iconic' : ''), style: __assign({ height: height || '', width: fullWidth ? '100%' : width || '', borderRadius: flat ? '0rem' : '', border: "".concat(outlined ? outlineSize ? "".concat(outlineSize, "rem solid ").concat(exports.colors[bg]) : "0.1rem solid ".concat(exports.colors[bg]) : '') }, style), onClick: onClick }, rest),
85
+ React.createElement("button", __assign({ className: "".concat(classNames, " ").concat(startIcon || endIcon || status || isLoading ? 'iconic' : ''), style: __assign({ height: height || '', width: fullWidth ? '100%' : width || '', borderRadius: flat ? '0rem' : '' }, style), onClick: onClick }, rest),
420
86
  isLoading &&
421
- React.createElement("span", { className: 'rotate btn_left_icon' },
87
+ React.createElement("span", { className: 'rotate btn_left_icon', style: { lineHeight: "0" } },
422
88
  React.createElement(pi_1.PiSpinner, null)),
423
89
  status &&
424
- React.createElement("span", { className: ' btn_left_icon' },
90
+ React.createElement("span", { className: ' btn_left_icon', style: { lineHeight: "0" } },
425
91
  status === "success" && React.createElement(pi_1.PiCheck, null),
426
92
  status === "info" && React.createElement(pi_1.PiInfo, null),
427
93
  status === "warning" && React.createElement(pi_1.PiWarning, null),
428
94
  status === "danger" && React.createElement(pi_1.PiX, null)),
429
95
  fillAnimation ? React.createElement("span", { className: "button_fill_span ".concat(bg) }) : '',
430
- startIcon && React.createElement("span", { className: "btn_left_icon" }, startIcon),
96
+ startIcon && React.createElement("span", { className: "btn_left_icon", style: { lineHeight: "0" } }, startIcon),
431
97
  text ? text : children,
432
- endIcon && React.createElement("span", { className: "btn_right_icon" }, endIcon))));
98
+ endIcon && React.createElement("span", { className: "btn_right_icon", style: { lineHeight: "0" } }, endIcon))));
433
99
  }
434
100
  exports.default = Button;