funuicss 3.5.8 → 3.5.9

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/css/fun.css CHANGED
@@ -31,13 +31,9 @@
31
31
  --text-10xl: 9rem;
32
32
 
33
33
  /* Border radius */
34
- --radius-sm: 0.125rem;
35
- --radius: 0.25rem;
36
- --radius-md: 0.375rem;
37
- --radius-lg: 0.5rem;
38
- --radius-xl: 0.75rem;
39
- --radius-2xl: 1rem;
40
- --radius-full: 9999px;
34
+ --radius-sm: 0.25rem;
35
+ --radius: 0.5rem;
36
+
41
37
 
42
38
 
43
39
 
@@ -50,8 +46,8 @@
50
46
  --z-50: 50;
51
47
 
52
48
 
53
- /* Line heights matching Tailwind defaults */
54
- --leading-normal: 1.5rem; /* For base */
49
+
50
+ --leading-normal: 1.5rem;
55
51
  --leading-xl: 1.75rem;
56
52
  --leading-2xl: 2rem;
57
53
  --leading-3xl: 2.25rem;
@@ -62,8 +58,7 @@
62
58
  --leading-8xl: 1;
63
59
  --leading-9xl: 1;
64
60
  --leading-10xl: 1;
65
-
66
- --leading-none: 1;
61
+ --leading-none: 0;
67
62
 
68
63
 
69
64
  /* default colors */
@@ -74,15 +69,16 @@
74
69
  --raiseBackdrop:blur(20px); /* Raised element color */
75
70
  --borderRgb: 204, 204, 204; /* i want to chnage the opacity for someplaces*/
76
71
  --borderColor:rgb(var(--borderRgb)); /* Border color */
77
- --lighter: #fafafa ;
72
+ --lighter: #F1F1F1 ;
78
73
  --hoverable: #fcfcfc ;
79
74
  --muted: #78716c;
80
75
  --dark: #121212;
81
- --cardBg: var(--raiseOpaque);
76
+ --cardBg: var(--page-bg);
82
77
  --card: 8px 8px 10rem -2rem rgba(0, 0 , 0 , 0.1), /* soft shadow */
83
78
  -8px -8px 4rem 0rem #F2F2F2; /* soft highlight */
84
79
  --linkColor:rgb(58, 58, 58);
85
80
 
81
+
86
82
  /* Primary Colors */
87
83
  --primary: #6366f1;
88
84
  --primary50: #eef2ff;
@@ -195,14 +191,14 @@
195
191
  --smallFont: .79rem ;
196
192
  --smallerFont: .7rem;
197
193
  --navHeight: fit-content ;
198
- --border: 0.1rem solid var(--borderColor);
194
+ --borderWidth:0.1rem;
195
+ --border: var(--borderWidth) solid var(--borderColor);
199
196
  --inputBorder:0.12rem;
200
197
  --input_outline_size:0.127rem;
201
198
  --borderRadius:1rem;
202
199
  --borderRadiusSmall:0.5rem;
203
200
  --borderRadiusMax:2rem;
204
- --InputButtonBorderRadius:0.5rem;
205
- --DefaultBorderRadius:0.5rem;
201
+ --radius:0.5rem;
206
202
  --hoverable: brightness(90%);
207
203
  --linkHover:(139, 185, 254;);
208
204
  --sideBarZindex:13;
@@ -211,11 +207,12 @@
211
207
  --loaderZindex:100;
212
208
  --snackBarZindex:20;
213
209
  --notificationZindex:29;
214
- --inputHeight:2.4rem;
210
+ --inputButtonHeight:2.4rem;
215
211
  --inputPadding:0.5rem 0;
216
212
  --inputRoundedPadding:0.5rem 1rem;
217
213
  --shadowMedium:0 0.8rem 2rem 0 rgba(3, 3, 3, 0.1);
218
214
  --raised:0 0.1rem 0.2rem 0rem rgba(0, 0, 0, 0.3);
215
+ --spacingScale:1rem;
219
216
  /* medium Screen body */
220
217
 
221
218
 
@@ -223,6 +220,127 @@
223
220
 
224
221
 
225
222
 
223
+
224
+ :root {
225
+ /* BUTTON VARIABLES */
226
+ --btn-font-size: var(--text-base);
227
+ --btn-font-weight: 500;
228
+ --btn-padding-x: var(--space-4);
229
+ --btn-padding-y: var(--space-2);
230
+ --btn-border-radius: var(--radius-lg);
231
+ --btn-border-width: 1px;
232
+ --btn-min-height: 2.5rem;
233
+ --btn-gap: var(--space-2); /* for icon spacing */
234
+
235
+ /* Button States */
236
+ --btn-hover-scale: 1.02;
237
+ --btn-active-scale: 0.98;
238
+ --btn-disabled-opacity: 0.5;
239
+
240
+ /* Button Variants */
241
+ --btn-primary-bg: var(--primary);
242
+ --btn-primary-text: var(--white);
243
+ --btn-primary-hover: var(--primary600);
244
+
245
+ --btn-secondary-bg: var(--secondary);
246
+ --btn-secondary-text: var(--white);
247
+ --btn-secondary-hover: var(--secondary600);
248
+
249
+ --btn-outlined-border: var(--primary);
250
+ --btn-outlined-text: var(--primary);
251
+ --btn-outlined-hover-bg: var(--primary50);
252
+
253
+ /* INPUT VARIABLES */
254
+ --input-font-size: var(--text-base);
255
+ --input-padding-x: var(--space-4);
256
+ --input-padding-y: var(--space-3);
257
+ --input-border-radius: var(--radius-lg);
258
+ --input-border-width: var(--inputBorder);
259
+ --input-border-color: var(--borderColor);
260
+ --input-bg: var(--white);
261
+ --input-text-color: var(--text-color);
262
+ --input-placeholder-color: var(--muted);
263
+ --input-min-height: var(--inputButtonHeight);
264
+
265
+ /* Input States */
266
+ --input-focus-border: var(--primary);
267
+ --input-focus-ring: 0 0 0 3px var(--primary200);
268
+ --input-error-border: var(--error);
269
+ --input-error-ring: 0 0 0 3px var(--error200);
270
+ --input-disabled-bg: var(--lighter);
271
+ --input-disabled-opacity: 0.6;
272
+
273
+ /* CARD VARIABLES */
274
+ --card-bg: var(--cardBg);
275
+ --card-border: var(--border);
276
+ --card-border-radius: var(--borderRadius);
277
+ --card-padding: var(--space-6);
278
+ --card-shadow: var(--card);
279
+ --card-hover-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
280
+
281
+ /* LINK VARIABLES */
282
+ --link-color: var(--linkColor);
283
+ --link-hover-color: var(--primary);
284
+ --link-underline: none;
285
+ --link-hover-underline: underline;
286
+ --link-font-weight: 400;
287
+
288
+ /* BADGE/TAG VARIABLES */
289
+ --badge-font-size: var(--text-xs);
290
+ --badge-padding-x: var(--space-2);
291
+ --badge-padding-y: var(--space-1);
292
+ --badge-border-radius: var(--radius-full);
293
+ --badge-font-weight: 500;
294
+
295
+ /* MODAL/DIALOG VARIABLES */
296
+ --modal-backdrop: rgba(0, 0, 0, 0.5);
297
+ --modal-bg: var(--white);
298
+ --modal-border-radius: var(--radius-2xl);
299
+ --modal-padding: var(--space-8);
300
+ --modal-max-width: 32rem;
301
+ --modal-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
302
+
303
+ /* DROPDOWN/SELECT VARIABLES */
304
+ --dropdown-bg: var(--white);
305
+ --dropdown-border: var(--border);
306
+ --dropdown-border-radius: var(--radius-lg);
307
+ --dropdown-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
308
+ --dropdown-item-padding: var(--space-3) var(--space-4);
309
+ --dropdown-item-hover-bg: var(--lighter);
310
+
311
+ /* SWITCH/TOGGLE VARIABLES */
312
+ --switch-width: 2.75rem;
313
+ --switch-height: 1.5rem;
314
+ --switch-bg: var(--borderColor);
315
+ --switch-active-bg: var(--primary);
316
+ --switch-thumb-size: 1.25rem;
317
+
318
+ /* CHECKBOX/RADIO VARIABLES */
319
+ --checkbox-size: 1.25rem;
320
+ --checkbox-border: var(--borderColor);
321
+ --checkbox-checked-bg: var(--primary);
322
+ --checkbox-checked-border: var(--primary);
323
+ --checkbox-border-radius: var(--radius);
324
+
325
+ /* TOOLTIP VARIABLES */
326
+ --tooltip-bg: var(--dark);
327
+ --tooltip-text: var(--white);
328
+ --tooltip-padding: var(--space-2) var(--space-3);
329
+ --tooltip-border-radius: var(--radius);
330
+ --tooltip-font-size: var(--text-sm);
331
+
332
+ /* AVATAR VARIABLES */
333
+ --avatar-size: 2.5rem;
334
+ --avatar-border-radius: var(--radius-full);
335
+ --avatar-border: 2px solid var(--white);
336
+
337
+ /* DIVIDER VARIABLES */
338
+ --divider-color: var(--borderColor);
339
+ --divider-width: 1px;
340
+ --divider-margin: var(--space-4) 0;
341
+ }
342
+
343
+
226
344
  /* For WebKit browsers (Chrome, Edge, Brave, Safari) */
227
345
  ::-webkit-scrollbar {
228
346
  width: 10px;
@@ -257,6 +375,7 @@
257
375
  transition: 0.3s ease-in-out all !important;
258
376
  }
259
377
 
378
+
260
379
  .card,
261
380
  .input,
262
381
  .navigation-bar ,
@@ -1844,6 +1963,7 @@ link:hover {
1844
1963
 
1845
1964
 
1846
1965
 
1966
+
1847
1967
  input:disabled,
1848
1968
  select:disabled,
1849
1969
  button:disabled {
@@ -1861,7 +1981,8 @@ button:disabled {
1861
1981
 
1862
1982
  body {
1863
1983
  font-size: var(--text-base);
1864
- line-height: 1.5rem;
1984
+ font-weight: var(--bd-font-weight) !important;
1985
+ line-height: var(--leading-normal) !important;
1865
1986
  letter-spacing: normal;
1866
1987
  background-color: var(--page-bg) !important;
1867
1988
  color: var(--text-color) !important;
@@ -2462,7 +2583,7 @@ h6, .h6 {
2462
2583
  border: none;
2463
2584
  padding:0.7rem 1rem;
2464
2585
  background-color: inherit;
2465
- border-radius: var(--InputButtonBorderRadius);
2586
+ border-radius: var(--radius);
2466
2587
  transition: all 0.5s linear;
2467
2588
  cursor: pointer;
2468
2589
  font-size: var(--minifiedFontSize);
@@ -2471,6 +2592,7 @@ h6, .h6 {
2471
2592
  font-weight: 500;
2472
2593
  z-index: 1;
2473
2594
  line-height: 1 !important;
2595
+ height: var(--inputButtonHeight);
2474
2596
  }
2475
2597
 
2476
2598
 
@@ -2582,7 +2704,8 @@ h6, .h6 {
2582
2704
  }
2583
2705
  .button.smallBtn {
2584
2706
  padding: 0.3rem 0.6rem !important;
2585
- font-size: var(--smallFont) ;
2707
+ font-size: var(--smallerFont) ;
2708
+ height: fit-content !important;
2586
2709
  }
2587
2710
  .smallBtn.roundBtn{
2588
2711
  padding: 0.3rem 0.8rem !important;
@@ -2623,6 +2746,7 @@ box-shadow: var(--card);
2623
2746
  transition: 0.3s;
2624
2747
  backdrop-filter: var(--raiseBackdrop) ;
2625
2748
  color: var(--text-color);
2749
+ border-radius: var(--borderRadius);
2626
2750
  }
2627
2751
  .card.xl{
2628
2752
  box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 50px !important;
@@ -3132,7 +3256,7 @@ color: var(--text-color);
3132
3256
  flex-direction: row;
3133
3257
  align-items: center !important;
3134
3258
  padding: 0.4rem 1rem;
3135
- border-radius: var(--DefaultBorderRadius);
3259
+ border-radius: var(--radius);
3136
3260
  gap: 0.3rem;
3137
3261
  font-size: var(--minifiedFontSize) ;
3138
3262
  width: fit-content;
@@ -3378,7 +3502,7 @@ color: var(--text-color);
3378
3502
  border-bottom: var(--inputBorder) solid var(--borderColor);
3379
3503
  color: var(--text-color);
3380
3504
  font-size: var(--minifiedFontSize);
3381
- background-color: transparent;
3505
+ background-color: var(--page-bg);
3382
3506
  font-weight: 500;
3383
3507
  }
3384
3508
  .smallInput {
@@ -3452,7 +3576,8 @@ color: var(--text-color);
3452
3576
  {
3453
3577
  outline: none !important;
3454
3578
  }
3455
- input , select{height: var(--inputHeight);}
3579
+ input , select {height: var(--inputButtonHeight); border-radius: var(--radius);}
3580
+ textarea{border-radius: var(--radius) !important; height: fit-content !important;}
3456
3581
  .input.flat{border-radius: 0;}
3457
3582
 
3458
3583
  .input:focus {
@@ -3470,7 +3595,6 @@ select:focus {
3470
3595
  }
3471
3596
  .input.borderedInput {
3472
3597
  border: var(--border);
3473
- border-radius: var(--InputButtonBorderRadius);
3474
3598
  transition: 0.1s linear;
3475
3599
  padding: 0.6rem 0.5rem;
3476
3600
  }
@@ -3522,10 +3646,8 @@ background-color: rgba(var(--borderRgb), 0.3);
3522
3646
  .custom-select {
3523
3647
  position: relative;
3524
3648
  width: 100%;
3525
- border-radius: var(--InputButtonBorderRadius);
3526
- /* FIX: Create a new stacking context and ensure proper layering */
3527
- z-index: 999;
3528
- isolation: isolate;
3649
+ border-radius: var(--radius);
3650
+
3529
3651
  }
3530
3652
 
3531
3653
  .custom-select.fullWidth {max-width: none;}
@@ -3535,9 +3657,9 @@ display: flex;
3535
3657
  align-items: center;
3536
3658
  justify-content: space-between;
3537
3659
  padding: var(--inputRoundedPadding);
3538
- background: inherit;
3660
+ background: var(--page-bg);
3539
3661
  border: var(--border);
3540
- border-radius: var(--InputButtonBorderRadius);
3662
+ border-radius: var(--radius);
3541
3663
  cursor: pointer;
3542
3664
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
3543
3665
  font-size: 14px;
@@ -3558,7 +3680,7 @@ border-bottom-right-radius: 0;
3558
3680
 
3559
3681
  .select-trigger.borderless {
3560
3682
  border: none !important;
3561
- background: transparent;
3683
+ background: var(--lighter);
3562
3684
  }
3563
3685
 
3564
3686
 
@@ -3827,7 +3949,7 @@ padding-right: 2.5rem;
3827
3949
  /* Base input styles */
3828
3950
  .searchable-input {
3829
3951
  width: 100%;
3830
- height: var(--inputHeight);
3952
+ height: var(--inputButtonHeight);
3831
3953
  padding: 0.6rem 0.8rem;
3832
3954
  font-size: inherit;
3833
3955
  line-height: 1.5;
@@ -3875,7 +3997,7 @@ padding-right: 2.5rem;
3875
3997
  /* Bordered input styles */
3876
3998
  .searchable-input.borderedInput {
3877
3999
  border: var(--border);
3878
- border-radius: var(--InputButtonBorderRadius);
4000
+ border-radius: var(--radius);
3879
4001
  transition: 0.1s linear;
3880
4002
  padding: 0.6rem 0.5rem;
3881
4003
  }
@@ -4053,7 +4175,7 @@ padding-right: 2.5rem;
4053
4175
  background-color: var(--raiseThemes);
4054
4176
  backdrop-filter: var(--raiseBackdrop);
4055
4177
  border: var(--border);
4056
- border-radius: var(--InputButtonBorderRadius);
4178
+ border-radius: var(--radius);
4057
4179
  box-shadow: var(--shadow);
4058
4180
  overflow: hidden;
4059
4181
  animation: dropdown-appear 0.15s ease-out;
@@ -4183,7 +4305,7 @@ padding-right: 2.5rem;
4183
4305
  }
4184
4306
 
4185
4307
  .searchable-input {
4186
- min-height: var(--inputHeight);
4308
+ min-height: var(--inputButtonHeight);
4187
4309
  font-size: 1rem; /* Prevents zoom on iOS */
4188
4310
  }
4189
4311
 
@@ -5121,7 +5243,7 @@ filter: brightness(90%);
5121
5243
  backdrop-filter: var(--raiseBackdrop);
5122
5244
  color: var(--white);
5123
5245
  text-align: center;
5124
- border-radius: var(--DefaultBorderRadius);
5246
+ border-radius: var(--radius);
5125
5247
  padding: 0.2rem 0.5rem !important;
5126
5248
  font-weight: 500 !important;
5127
5249
  position: absolute;
@@ -5211,7 +5333,7 @@ filter: brightness(90%);
5211
5333
  position: fixed !important;
5212
5334
  background-color: var(--dark) !important;
5213
5335
  color: var(--white) !important;
5214
- border-radius: var(--DefaultBorderRadius);
5336
+ border-radius: var(--radius);
5215
5337
  max-width: 90vw;
5216
5338
  width: fit-content;
5217
5339
  max-height: 2.5rem;
@@ -6621,6 +6743,7 @@ background-color: rgba(0, 0, 0, 0.2);
6621
6743
  }
6622
6744
 
6623
6745
  /* --------- MARGIN --------- */
6746
+ .margin , .m{margin: var(--spacingScale) !important;}
6624
6747
  .m-0 { margin: var(--space-0) !important; }
6625
6748
  .m-1 { margin: var(--space-1) !important; }
6626
6749
  .m-2 { margin: var(--space-2) !important; }
@@ -6741,7 +6864,7 @@ background-color: rgba(0, 0, 0, 0.2);
6741
6864
  /*padding*/
6742
6865
 
6743
6866
  /* --------- PADDING --------- */
6744
- .padding{padding:var(--padding)}
6867
+ .padding , .p{padding:var(--spacingScale)}
6745
6868
  .p-0 { padding: var(--space-0) !important; }
6746
6869
  .p-1 { padding: var(--space-1) !important; }
6747
6870
  .p-2 { padding: var(--space-2) !important; }
@@ -7333,12 +7456,6 @@ background-color: rgba(0, 0, 0, 0.2);
7333
7456
 
7334
7457
 
7335
7458
 
7336
-
7337
-
7338
-
7339
-
7340
-
7341
-
7342
7459
  /* Text Area */
7343
7460
 
7344
7461
  .ql-container {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.5.8",
2
+ "version": "3.5.9",
3
3
  "name": "funuicss",
4
4
  "description": "React and Next.js component UI Library for creating Easy and good looking websites with fewer lines of code. Elevate your web development experience with our cutting-edge React/Next.js component UI Library. Craft stunning websites effortlessly, boasting both seamless functionality and aesthetic appeal—all achieved with minimal lines of code. Unleash the power of simplicity and style in your projects!",
5
5
  "main": "index.js",
package/ui/card/Card.js CHANGED
@@ -31,9 +31,11 @@ var react_1 = __importDefault(require("react"));
31
31
  var CardHeader_1 = __importDefault(require("./CardHeader"));
32
32
  var CardBody_1 = __importDefault(require("./CardBody"));
33
33
  var CardFooter_1 = __importDefault(require("./CardFooter"));
34
+ var theme_1 = require("../theme/theme");
34
35
  function Card(_a) {
35
36
  var color = _a.color, bg = _a.bg, width = _a.width, height = _a.height, minHeight = _a.minHeight, minWidth = _a.minWidth, margin = _a.margin, padding = _a.padding, funcss = _a.funcss, children = _a.children, roundEdge = _a.roundEdge, maxHeight = _a.maxHeight, maxWidth = _a.maxWidth, horizontal = _a.horizontal, id = _a.id, header = _a.header, body = _a.body, footer = _a.footer, noGap = _a.noGap, fab = _a.fab, image = _a.image, shadowless = _a.shadowless, flat = _a.flat, responsiveMedium = _a.responsiveMedium, xl = _a.xl, responsiveSmall = _a.responsiveSmall, style = _a.style, rest = __rest(_a, ["color", "bg", "width", "height", "minHeight", "minWidth", "margin", "padding", "funcss", "children", "roundEdge", "maxHeight", "maxWidth", "horizontal", "id", "header", "body", "footer", "noGap", "fab", "image", "shadowless", "flat", "responsiveMedium", "xl", "responsiveSmall", "style"]);
36
- return (react_1.default.createElement("div", __assign({ id: id || '', className: "\n card \n card_flex\n ".concat(noGap ? 'no-gap' : '', " \n ").concat(xl ? 'xl' : '', " \n text-").concat(color || '', " \n ").concat(bg || '', " \n ").concat(funcss || '', " \n ").concat(roundEdge ? 'round-edge' : '', " \n ").concat(shadowless ? 'shadowless' : '', " \n ").concat(flat ? 'flat' : '', " \n ").concat(horizontal ? 'horizontalCard' : '', "\n ").concat(responsiveMedium ? 'responsiveMedium' : '', "\n ").concat(responsiveSmall ? 'responsiveSmall' : '', "\n \n "), style: __assign({ width: "".concat(width || ''), height: "".concat(height || ''), minHeight: "".concat(minHeight || ''), minWidth: "".concat(minWidth || ''), maxHeight: maxHeight || '', maxWidth: maxWidth || '', margin: "".concat(margin || ''), padding: "".concat(padding || '') }, style) }, rest),
37
+ var variant = (0, theme_1.useVariant)().variant;
38
+ return (react_1.default.createElement("div", __assign({ id: id || '', className: "\n card \n card_flex\n ".concat(noGap ? 'no-gap' : '', " \n ").concat(xl ? 'xl' : '', " \n text-").concat(color || '', " \n ").concat(bg || '', " \n ").concat(funcss || '', " \n ").concat(roundEdge ? 'round-edge' : '', " \n ").concat(shadowless ? 'shadowless' : '', " \n ").concat(flat ? 'flat' : '', " \n ").concat(horizontal ? 'horizontalCard' : '', "\n ").concat(responsiveMedium ? 'responsiveMedium' : '', "\n ").concat(responsiveSmall ? 'responsiveSmall' : '', "\n ").concat(variant === "standard" ? "border" : "", "\n \n "), style: __assign({ width: "".concat(width || ''), height: "".concat(height || ''), minHeight: "".concat(minHeight || ''), minWidth: "".concat(minWidth || ''), maxHeight: maxHeight || '', maxWidth: maxWidth || '', margin: "".concat(margin || ''), padding: "".concat(padding || '') }, style) }, rest),
37
39
  image ? react_1.default.createElement("div", { className: "".concat(fab ? 'relative' : '') },
38
40
  image,
39
41
  " ",
package/ui/input/Input.js CHANGED
@@ -63,6 +63,7 @@ exports.FileInput = exports.TextareaInput = exports.SelectInput = exports.TextIn
63
63
  var react_1 = __importStar(require("react"));
64
64
  var pi_1 = require("react-icons/pi");
65
65
  var Button_1 = __importDefault(require("../button/Button"));
66
+ var theme_1 = require("../theme/theme");
66
67
  // Utility function to generate CSS classes
67
68
  var generateInputClasses = function (_a) {
68
69
  var status = _a.status, rounded = _a.rounded, bg = _a.bg, funcss = _a.funcss, flat = _a.flat, leftRounded = _a.leftRounded, rightRounded = _a.rightRounded, bordered = _a.bordered, borderless = _a.borderless, _b = _a.additionalClasses, additionalClasses = _b === void 0 ? '' : _b;
@@ -89,6 +90,7 @@ var TextInput = function (_a) {
89
90
  borderless: borderless
90
91
  });
91
92
  var style = fullWidth ? { width: '100%' } : undefined;
93
+ "";
92
94
  return (react_1.default.createElement("input", __assign({ id: id, name: name, className: className, onChange: onChange, defaultValue: defaultValue, type: type, placeholder: label, style: style, value: value }, rest)));
93
95
  };
94
96
  exports.TextInput = TextInput;
@@ -176,7 +178,8 @@ exports.FileInput = FileInput;
176
178
  var Input = function (_a) {
177
179
  var select = _a.select, multiline = _a.multiline, file = _a.file, noBorder = _a.noBorder, props = __rest(_a, ["select", "multiline", "file", "noBorder"]);
178
180
  // Handle legacy noBorder prop
179
- var inputProps = __assign(__assign({}, props), { borderless: noBorder || props.borderless });
181
+ var variant = (0, theme_1.useVariant)().variant;
182
+ var inputProps = __assign(__assign({}, props), { bordered: variant === 'standard' ? true : props.bordered, borderless: variant === 'minimal' ? true : noBorder || props.borderless });
180
183
  if (select) {
181
184
  return react_1.default.createElement(exports.SelectInput, __assign({}, inputProps));
182
185
  }
@@ -34,6 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  var react_1 = __importStar(require("react"));
37
+ var theme_1 = require("../theme/theme");
37
38
  var Select = function (_a) {
38
39
  var id = _a.id, name = _a.name, value = _a.value, defaultValue = _a.defaultValue, _b = _a.label, label = _b === void 0 ? 'Select an option' : _b, _c = _a.options, options = _c === void 0 ? [] : _c, onChange = _a.onChange, onBlur = _a.onBlur, _d = _a.searchable, searchable = _d === void 0 ? true : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.bordered, bordered = _f === void 0 ? false : _f, _g = _a.borderless, borderless = _g === void 0 ? false : _g, _h = _a.rounded, rounded = _h === void 0 ? false : _h, _j = _a.flat, flat = _j === void 0 ? false : _j, _k = _a.fullWidth, fullWidth = _k === void 0 ? false : _k, _l = _a.status, status = _l === void 0 ? '' : _l, _m = _a.className, className = _m === void 0 ? '' : _m, _o = _a.funcss, funcss = _o === void 0 ? '' : _o, _p = _a.style, style = _p === void 0 ? {} : _p, _q = _a.searchAutoFocus, searchAutoFocus = _q === void 0 ? false : _q;
39
40
  var _r = (0, react_1.useState)(false), isOpen = _r[0], setIsOpen = _r[1];
@@ -44,6 +45,7 @@ var Select = function (_a) {
44
45
  var containerRef = (0, react_1.useRef)(null);
45
46
  var triggerRef = (0, react_1.useRef)(null);
46
47
  var searchInputRef = (0, react_1.useRef)(null);
48
+ var variant = (0, theme_1.useVariant)().variant;
47
49
  // Initialize selected option
48
50
  (0, react_1.useEffect)(function () {
49
51
  var initialValue = value || defaultValue;
@@ -161,8 +163,8 @@ var Select = function (_a) {
161
163
  var classes = [
162
164
  'select-trigger',
163
165
  isOpen && 'open',
164
- bordered && 'bordered',
165
- borderless && 'borderless',
166
+ variant === 'standard' ? 'bordered' : bordered && 'bordered',
167
+ variant === 'minimal' ? 'borderless' : borderless && 'borderless',
166
168
  flat && 'flat',
167
169
  status && status,
168
170
  disabled && 'disabled'
@@ -1,9 +1,10 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  interface SideBarLink {
3
3
  uri: string;
4
- icon: React.ReactNode;
4
+ icon?: React.ReactNode;
5
5
  text: string;
6
6
  section: string;
7
+ onClick?: () => void;
7
8
  }
8
9
  interface SideBarProps {
9
10
  funcss?: string;
@@ -42,7 +42,7 @@ var react_1 = __importStar(require("react"));
42
42
  var RowFlex_1 = __importDefault(require("../specials/RowFlex"));
43
43
  var Text_1 = __importDefault(require("../text/Text"));
44
44
  var navigation_1 = require("next/navigation");
45
- var link_1 = __importDefault(require("next/link"));
45
+ var theme_1 = require("../theme/theme");
46
46
  function SideBar(_a) {
47
47
  var _b;
48
48
  var _c = _a.funcss, funcss = _c === void 0 ? '' : _c, _d = _a.position, position = _d === void 0 ? 'left' : _d, _e = _a.open, open = _e === void 0 ? false : _e, header = _a.header, content = _a.content, footer = _a.footer, _f = _a.top, top = _f === void 0 ? 0 : _f, _g = _a.sidebarWidth, sidebarWidth = _g === void 0 ? 250 : _g, _h = _a.iconCSS, iconCSS = _h === void 0 ? '' : _h, _j = _a.sidebarCss, sidebarCss = _j === void 0 ? '' : _j, activeCss = _a.activeCss, _k = _a.bodyCss, bodyCss = _k === void 0 ? '' : _k, _l = _a.popIcon, popIcon = _l === void 0 ? false : _l, _m = _a.dividers, dividers = _m === void 0 ? false : _m, _o = _a.links, links = _o === void 0 ? [] : _o, children = _a.children, onClose = _a.onClose;
@@ -51,6 +51,8 @@ function SideBar(_a) {
51
51
  var _r = (0, react_1.useState)('0px'), appBarHeight = _r[0], setAppBarHeight = _r[1];
52
52
  var pathname = (0, navigation_1.usePathname)();
53
53
  var sidebarRef = (0, react_1.useRef)(null);
54
+ var variant = (0, theme_1.useVariant)().variant;
55
+ var _s = (0, react_1.useState)(""), selectedOption = _s[0], setselectedOption = _s[1];
54
56
  var updateIsMobile = (0, react_1.useCallback)(function () {
55
57
  setIsMobile(window.innerWidth <= 992);
56
58
  }, []);
@@ -110,15 +112,22 @@ function SideBar(_a) {
110
112
  var section = _a[0], sectionLinks = _a[1];
111
113
  return (react_1.default.createElement("div", { key: section, className: "sidebar-section ".concat(dividers ? "bt" : "", " pt-2 pb-2") },
112
114
  react_1.default.createElement(Text_1.default, { size: "sm", funcss: "opacity-6 p-1 pl-2 pr-2" }, section),
113
- sectionLinks.map(function (link) {
114
- var isActive = pathname === link.uri;
115
- return (react_1.default.createElement(link_1.default, { onClick: function () {
115
+ sectionLinks.map(function (link, index) {
116
+ var isActive = link.onClick ? index.toString() === selectedOption : pathname === link.uri;
117
+ return (react_1.default.createElement("div", { onClick: function () {
116
118
  if (isMobile) {
117
119
  handleClose();
118
120
  }
119
- }, key: link.uri, href: link.uri },
120
- react_1.default.createElement("div", { className: "p-1 pl-2 pr-2 sidebar-link ".concat(isActive ? "primary50 outline-primary200 ".concat(activeCss || '') : 'hoverable') },
121
- react_1.default.createElement("span", { className: "".concat(iconCSS || '', " ").concat(popIcon ? "p-1 border lighter central" : ""), style: { lineHeight: 0, borderRadius: "0.4rem" } }, link.icon),
121
+ if (link === null || link === void 0 ? void 0 : link.onClick) {
122
+ link.onClick();
123
+ setselectedOption(index.toString());
124
+ }
125
+ else {
126
+ window.location.href = link.uri;
127
+ }
128
+ }, key: link.uri },
129
+ react_1.default.createElement("div", { className: "p-1 pl-2 pr-2 button sidebar-link ".concat(isActive ? "primary ".concat(activeCss || '') : 'hoverable') },
130
+ react_1.default.createElement("span", { className: "".concat(iconCSS || '', " \n ").concat((variant === 'standard' || popIcon) ? "p-1 ".concat(isActive ? "primary" : "lighter border", " central") : (variant === "minimal" && !isActive) ? "p1 central lighter " : ""), style: { lineHeight: 0, borderRadius: "0.4rem" } }, link.icon),
122
131
  react_1.default.createElement(Text_1.default, { text: link.text, size: "sm", weight: 400 }))));
123
132
  })));
124
133
  }))),
package/ui/text/Text.js CHANGED
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
28
  var react_1 = __importDefault(require("react"));
29
29
  var pi_1 = require("react-icons/pi");
30
+ var getCssVariable_1 = require("../../utils/getCssVariable");
30
31
  var Text = function (_a) {
31
32
  var id = _a.id, bg = _a.bg, color = _a.color, children = _a.children, hoverBg = _a.hoverBg, hoverText = _a.hoverText, text = _a.text, funcss = _a.funcss, emp = _a.emp, bold = _a.bold, block = _a.block, body = _a.body, article = _a.article, light = _a.light, lighter = _a.lighter, italic = _a.italic, weight = _a.weight, underline = _a.underline, align = _a.align, lineHeight = _a.lineHeight, letterSpacing = _a.letterSpacing, uppercase = _a.uppercase, lowercase = _a.lowercase, capitalize = _a.capitalize, textDecoration = _a.textDecoration, textTransform = _a.textTransform, whiteSpace = _a.whiteSpace, wordBreak = _a.wordBreak, fontFamily = _a.fontFamily, truncate = _a.truncate, textShadow = _a.textShadow, textAlign = _a.textAlign, customStyles = _a.customStyles, monospace = _a.monospace, quote = _a.quote, opacity = _a.opacity, _b = _a.size, size = _b === void 0 ? 'base' : _b, // default
32
33
  rest = __rest(_a, ["id", "bg", "color", "children", "hoverBg", "hoverText", "text", "funcss", "emp", "bold", "block", "body", "article", "light", "lighter", "italic", "weight", "underline", "align", "lineHeight", "letterSpacing", "uppercase", "lowercase", "capitalize", "textDecoration", "textTransform", "whiteSpace", "wordBreak", "fontFamily", "truncate", "textShadow", "textAlign", "customStyles", "monospace", "quote", "opacity", "size"]);
@@ -38,7 +39,8 @@ var Text = function (_a) {
38
39
  size === 'h5' ? "h5" :
39
40
  size === 'h6' ? "h6" :
40
41
  "text-".concat(size));
41
- var mergedStyles = __assign(__assign({ display: block ? 'block' : undefined, fontWeight: bold ? 'bold' : weight ? weight : undefined, lineHeight: lineHeight, letterSpacing: letterSpacing, textTransform: textTransform, textDecoration: textDecoration, fontFamily: fontFamily, textShadow: textShadow, textAlign: textAlign, whiteSpace: whiteSpace, wordBreak: wordBreak, transform: customStyles === null || customStyles === void 0 ? void 0 : customStyles.transform }, customStyles), (truncate
42
+ var bdFontWeight = (0, getCssVariable_1.getCssVariableValue)('bd-font-weight');
43
+ var mergedStyles = __assign(__assign({ display: block ? 'block' : undefined, fontWeight: bold ? 'bold' : weight ? weight : Number(bdFontWeight), lineHeight: lineHeight, letterSpacing: letterSpacing, textTransform: textTransform, textDecoration: textDecoration, fontFamily: fontFamily, textShadow: textShadow, textAlign: textAlign, whiteSpace: whiteSpace, wordBreak: wordBreak, transform: customStyles === null || customStyles === void 0 ? void 0 : customStyles.transform }, customStyles), (truncate
42
44
  ? {
43
45
  display: '-webkit-box',
44
46
  WebkitBoxOrient: 'vertical',
@@ -1,7 +1,15 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
+ export type ThemeVariant = 'standard' | 'minimal';
3
+ export type ThemeName = 'light' | 'dark' | 'dark-blue' | 'light-gray' | 'pastel-green' | 'warm-orange' | 'frosted-glass' | 'midnight-purple' | 'cyber-metal';
2
4
  interface ThemeProviderProps {
3
- theme: 'light' | 'dark' | 'dark-blue' | 'light-gray' | 'pastel-green' | 'warm-orange' | 'frosted-glass' | 'midnight-purple' | 'cyber-metal';
4
- children: React.ReactNode;
5
+ theme: ThemeName;
6
+ projectId: string;
7
+ children: ReactNode;
5
8
  }
9
+ interface VariantContextType {
10
+ variant: ThemeVariant;
11
+ setVariant: React.Dispatch<React.SetStateAction<ThemeVariant>>;
12
+ }
13
+ export declare const useVariant: () => VariantContextType;
6
14
  declare const ThemeProvider: React.FC<ThemeProviderProps>;
7
15
  export default ThemeProvider;
package/ui/theme/theme.js CHANGED
@@ -33,24 +33,43 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  return result;
34
34
  };
35
35
  })();
36
+ var __importDefault = (this && this.__importDefault) || function (mod) {
37
+ return (mod && mod.__esModule) ? mod : { "default": mod };
38
+ };
36
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.useVariant = void 0;
37
41
  var react_1 = __importStar(require("react"));
38
42
  var themes_1 = require("./themes");
39
43
  var darkenUtils_1 = require("./darkenUtils");
44
+ var firestore_1 = require("firebase/firestore");
45
+ var Firebase_1 = __importDefault(require("../../utils/Firebase"));
46
+ var VariantContext = (0, react_1.createContext)({
47
+ variant: 'standard',
48
+ setVariant: function () {
49
+ /** noop */
50
+ },
51
+ });
52
+ var useVariant = function () { return (0, react_1.useContext)(VariantContext); };
53
+ exports.useVariant = useVariant;
54
+ /* -------------------------------------------------------------------------- */
55
+ /* COMPONENT */
56
+ /* -------------------------------------------------------------------------- */
40
57
  var ThemeProvider = function (_a) {
41
- var theme = _a.theme, children = _a.children;
58
+ var theme = _a.theme, children = _a.children, projectId = _a.projectId;
59
+ var _b = (0, react_1.useState)('standard'), variant = _b[0], setVariant = _b[1];
60
+ /* -------------------------- Apply base theme --------------------------- */
42
61
  (0, react_1.useEffect)(function () {
43
62
  var root = document.documentElement;
44
63
  var selectedTheme = themes_1.themes[theme] || themes_1.themes.light;
45
- // Apply selected theme variables
46
64
  Object.entries(selectedTheme).forEach(function (_a) {
47
65
  var key = _a[0], value = _a[1];
48
66
  root.style.setProperty(key, value);
49
67
  });
50
- // Apply darkened RGBA versions (for dark themes only)
51
- if (theme === 'dark' || theme === 'dark-blue' || theme === 'midnight-purple' || theme === 'cyber-metal') {
68
+ if (['dark', 'dark-blue', 'midnight-purple', 'cyber-metal'].includes(theme)) {
52
69
  themes_1.colorVarsToDarken.forEach(function (varName) {
53
- var original = getComputedStyle(root).getPropertyValue(varName).trim();
70
+ var original = getComputedStyle(root)
71
+ .getPropertyValue(varName)
72
+ .trim();
54
73
  if (original) {
55
74
  var darkAmount = (0, darkenUtils_1.getDarkenAmount)(varName);
56
75
  var rgba = (0, darkenUtils_1.darkenToRgba)(original, darkAmount, 0.9);
@@ -59,10 +78,35 @@ var ThemeProvider = function (_a) {
59
78
  });
60
79
  }
61
80
  }, [theme]);
62
- return (react_1.default.createElement("div", { className: "theme-".concat(theme), style: {
63
- backgroundColor: 'var(--page-bg)',
64
- color: 'var(--text-color)',
65
- minHeight: '100vh',
66
- } }, children));
81
+ /* ---------------------- Real-time Firestore sync ----------------------- */
82
+ (0, react_1.useEffect)(function () {
83
+ if (!projectId)
84
+ return;
85
+ var root = document.documentElement;
86
+ var docRef = (0, firestore_1.doc)(Firebase_1.default, 'Projects', projectId);
87
+ var unsubscribe = (0, firestore_1.onSnapshot)(docRef, function (snapshot) {
88
+ var _a;
89
+ var data = snapshot.data();
90
+ if (!data)
91
+ return;
92
+ var config = (_a = data.theme_config) !== null && _a !== void 0 ? _a : {};
93
+ var newVariant = data.default_variation || 'standard';
94
+ setVariant(newVariant);
95
+ Object.entries(config).forEach(function (_a) {
96
+ var key = _a[0], value = _a[1];
97
+ root.style.setProperty(key.startsWith('--') ? key : "--".concat(key), String(value));
98
+ });
99
+ }, function (error) {
100
+ console.error('Realtime theme listener error:', error);
101
+ });
102
+ return function () { return unsubscribe(); };
103
+ }, [projectId]);
104
+ /* ------------------------------- Render ------------------------------- */
105
+ return (react_1.default.createElement(VariantContext.Provider, { value: { variant: variant, setVariant: setVariant } },
106
+ react_1.default.createElement("div", { className: "theme-".concat(theme), style: {
107
+ backgroundColor: 'var(--page-bg)',
108
+ color: 'var(--text-color)',
109
+ minHeight: '100vh',
110
+ } }, children)));
67
111
  };
68
112
  exports.default = ThemeProvider;
@@ -0,0 +1,10 @@
1
+ export namespace Requests {
2
+ export function getDocs(collectionName: any, docs_limit: any, extraQueries?: any[]): Promise<any>;
3
+ export function getDoc(collectionName: any, id: any): Promise<any>;
4
+ export function query(collectionName: any, queriesArr: any[] | undefined, docs_limit: any): Promise<any>;
5
+ export function add_document(cName: any, data: any, dbCollection?: string): Promise<any>;
6
+ export function set_doc(cName: any, doc_id: any, data: any): Promise<any>;
7
+ export function update(cName: any, doc_id: any, data: any): Promise<any>;
8
+ export function _delete(cName: any, doc_id: any): Promise<any>;
9
+ export { _delete as delete };
10
+ }
@@ -0,0 +1,273 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
50
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
51
+ if (ar || !(i in from)) {
52
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
53
+ ar[i] = from[i];
54
+ }
55
+ }
56
+ return to.concat(ar || Array.prototype.slice.call(from));
57
+ };
58
+ var __importDefault = (this && this.__importDefault) || function (mod) {
59
+ return (mod && mod.__esModule) ? mod : { "default": mod };
60
+ };
61
+ Object.defineProperty(exports, "__esModule", { value: true });
62
+ exports.Requests = void 0;
63
+ var Firebase_1 = __importDefault(require("./Firebase"));
64
+ var firestore_1 = require("firebase/firestore");
65
+ // ⏳ Convert timestamp to "x time ago"
66
+ function timeAgo(timestamp) {
67
+ if (!timestamp)
68
+ return "";
69
+ var now = new Date();
70
+ var date = timestamp.toDate ? timestamp.toDate() : new Date(timestamp);
71
+ var seconds = Math.floor((now - date) / 1000);
72
+ var intervals = {
73
+ year: 31536000,
74
+ month: 2592000,
75
+ week: 604800,
76
+ day: 86400,
77
+ hour: 3600,
78
+ minute: 60,
79
+ second: 1,
80
+ };
81
+ for (var key in intervals) {
82
+ var value = intervals[key];
83
+ if (seconds >= value) {
84
+ var count = Math.floor(seconds / value);
85
+ return "".concat(count, " ").concat(key).concat(count > 1 ? "s" : "", " ago");
86
+ }
87
+ }
88
+ return "just now";
89
+ }
90
+ // ⏳ Apply timeAgo to createdAt & updatedAt fields
91
+ function formatTimestamps(docData) {
92
+ return __assign(__assign({}, docData), { createdAt: docData.createdAt ? timeAgo(docData.createdAt) : null, updatedAt: docData.updatedAt ? timeAgo(docData.updatedAt) : null });
93
+ }
94
+ exports.Requests = {
95
+ // 📥 Get all docs
96
+ getDocs: function (collectionName, docs_limit, extraQueries) {
97
+ if (extraQueries === void 0) { extraQueries = []; }
98
+ return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
99
+ var Resourceq, snapshot, data, err_1;
100
+ return __generator(this, function (_a) {
101
+ switch (_a.label) {
102
+ case 0:
103
+ _a.trys.push([0, 2, , 3]);
104
+ Resourceq = firestore_1.query.apply(void 0, __spreadArray(__spreadArray([(0, firestore_1.collection)(Firebase_1.default, collectionName)], extraQueries, false), (docs_limit ? [(0, firestore_1.limit)(docs_limit)] : []), false));
105
+ return [4 /*yield*/, (0, firestore_1.getDocs)(Resourceq)];
106
+ case 1:
107
+ snapshot = _a.sent();
108
+ if (snapshot.docs.length > 0) {
109
+ data = snapshot.docs.map(function (d) { return (__assign({ id: d.id }, formatTimestamps(d.data()))); });
110
+ resolve(data);
111
+ }
112
+ else {
113
+ resolve([]);
114
+ }
115
+ return [3 /*break*/, 3];
116
+ case 2:
117
+ err_1 = _a.sent();
118
+ reject("Error fetching documents: ".concat(err_1.message));
119
+ return [3 /*break*/, 3];
120
+ case 3: return [2 /*return*/];
121
+ }
122
+ });
123
+ }); });
124
+ },
125
+ // 📥 Get single doc
126
+ getDoc: function (collectionName, id) {
127
+ return new Promise(function (resolve, reject) {
128
+ (0, firestore_1.onSnapshot)((0, firestore_1.doc)(Firebase_1.default, collectionName, id), function (gdoc) {
129
+ var data = gdoc.data();
130
+ if (data) {
131
+ resolve({ data: formatTimestamps(data), id: gdoc.id });
132
+ }
133
+ else {
134
+ resolve({ message: "No data found", data: "" });
135
+ }
136
+ }, function (err) { return reject("Error fetching document: ".concat(err.message)); });
137
+ });
138
+ },
139
+ // 🔎 Flexible query (add more queries)
140
+ query: function (collectionName, queriesArr, docs_limit) {
141
+ if (queriesArr === void 0) { queriesArr = []; }
142
+ return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
143
+ var Resourceq, snapshot, data, err_2;
144
+ return __generator(this, function (_a) {
145
+ switch (_a.label) {
146
+ case 0:
147
+ _a.trys.push([0, 2, , 3]);
148
+ Resourceq = firestore_1.query.apply(void 0, __spreadArray(__spreadArray([(0, firestore_1.collection)(Firebase_1.default, collectionName)], queriesArr, false), (docs_limit ? [(0, firestore_1.limit)(docs_limit)] : []), false));
149
+ return [4 /*yield*/, (0, firestore_1.getDocs)(Resourceq)];
150
+ case 1:
151
+ snapshot = _a.sent();
152
+ if (snapshot.docs.length > 0) {
153
+ data = snapshot.docs.map(function (d) { return (__assign({ id: d.id }, formatTimestamps(d.data()))); });
154
+ resolve({ data: data });
155
+ }
156
+ else {
157
+ resolve({ message: "No data", data: [] });
158
+ }
159
+ return [3 /*break*/, 3];
160
+ case 2:
161
+ err_2 = _a.sent();
162
+ reject("Error querying documents: ".concat(err_2.message));
163
+ console.log(err_2);
164
+ return [3 /*break*/, 3];
165
+ case 3: return [2 /*return*/];
166
+ }
167
+ });
168
+ }); });
169
+ },
170
+ // ➕ Add new doc with createdAt + updatedAt
171
+ add_document: function (cName, data, dbCollection) {
172
+ if (dbCollection === void 0) { dbCollection = ''; }
173
+ return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
174
+ var docRef, err_3;
175
+ return __generator(this, function (_a) {
176
+ switch (_a.label) {
177
+ case 0:
178
+ _a.trys.push([0, 3, , 4]);
179
+ return [4 /*yield*/, (0, firestore_1.addDoc)((0, firestore_1.collection)(Firebase_1.default, cName), __assign(__assign({}, data), { createdAt: (0, firestore_1.serverTimestamp)(), updatedAt: (0, firestore_1.serverTimestamp)() }))];
180
+ case 1:
181
+ docRef = _a.sent();
182
+ // Then update the same doc with its ID
183
+ return [4 /*yield*/, (0, firestore_1.updateDoc)(docRef, dbCollection === 'users' ? { uid: docRef.id } : { id: docRef.id })];
184
+ case 2:
185
+ // Then update the same doc with its ID
186
+ _a.sent();
187
+ resolve(docRef);
188
+ return [3 /*break*/, 4];
189
+ case 3:
190
+ err_3 = _a.sent();
191
+ reject("Error adding document: ".concat(err_3.message));
192
+ return [3 /*break*/, 4];
193
+ case 4: return [2 /*return*/];
194
+ }
195
+ });
196
+ }); });
197
+ },
198
+ // ✍️ Set/merge doc with updatedAt
199
+ set_doc: function (cName, doc_id, data) {
200
+ return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
201
+ var res, err_4;
202
+ return __generator(this, function (_a) {
203
+ switch (_a.label) {
204
+ case 0:
205
+ _a.trys.push([0, 2, , 3]);
206
+ return [4 /*yield*/, (0, firestore_1.setDoc)((0, firestore_1.doc)(Firebase_1.default, cName, doc_id), __assign(__assign({}, data), { updatedAt: (0, firestore_1.serverTimestamp)(), createdAt: (0, firestore_1.serverTimestamp)() }), { merge: true })];
207
+ case 1:
208
+ res = _a.sent();
209
+ resolve(res);
210
+ return [3 /*break*/, 3];
211
+ case 2:
212
+ err_4 = _a.sent();
213
+ reject("Error setting document: ".concat(err_4.message));
214
+ return [3 /*break*/, 3];
215
+ case 3: return [2 /*return*/];
216
+ }
217
+ });
218
+ }); });
219
+ },
220
+ // 🔄 Update doc with updatedAt
221
+ update: function (cName, doc_id, data) {
222
+ return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
223
+ var res, err_5;
224
+ return __generator(this, function (_a) {
225
+ switch (_a.label) {
226
+ case 0:
227
+ _a.trys.push([0, 2, , 3]);
228
+ return [4 /*yield*/, (0, firestore_1.updateDoc)((0, firestore_1.doc)(Firebase_1.default, cName, doc_id), __assign(__assign({}, data), { updatedAt: (0, firestore_1.serverTimestamp)() }))];
229
+ case 1:
230
+ res = _a.sent();
231
+ resolve(res);
232
+ return [3 /*break*/, 3];
233
+ case 2:
234
+ err_5 = _a.sent();
235
+ reject("Error updating document: ".concat(err_5.message));
236
+ return [3 /*break*/, 3];
237
+ case 3: return [2 /*return*/];
238
+ }
239
+ });
240
+ }); });
241
+ },
242
+ // ❌ Delete doc
243
+ delete: function (cName, doc_id) {
244
+ return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
245
+ var err_6;
246
+ return __generator(this, function (_a) {
247
+ switch (_a.label) {
248
+ case 0:
249
+ _a.trys.push([0, 2, , 3]);
250
+ return [4 /*yield*/, (0, firestore_1.deleteDoc)((0, firestore_1.doc)(Firebase_1.default, cName, doc_id))];
251
+ case 1:
252
+ _a.sent();
253
+ resolve("Document ".concat(doc_id, " successfully deleted"));
254
+ return [3 /*break*/, 3];
255
+ case 2:
256
+ err_6 = _a.sent();
257
+ reject("Error deleting document: ".concat(err_6.message));
258
+ return [3 /*break*/, 3];
259
+ case 3: return [2 /*return*/];
260
+ }
261
+ });
262
+ }); });
263
+ },
264
+ };
265
+ // // Add document
266
+ // Requests.add_document("users", { name: "John Doe", email: "john@example.com" });
267
+ // // Update document
268
+ // Requests.update("users", "docID123", { name: "Jane Doe" });
269
+ // // Query with multiple conditions
270
+ // Requests.query("users", [
271
+ // where("status", "==", "active"),
272
+ // where("level", "==", "admin"),
273
+ // ], 10).then(res => console.log(res.data));
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@firebase/firestore").Firestore;
2
+ export default _default;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var app_1 = require("firebase/app");
4
+ var firestore_1 = require("firebase/firestore");
5
+ var firebaseConfig = {
6
+ apiKey: "AIzaSyBi6mv2y56aKgJOv-MTHhwL1OaKnXlRNxE",
7
+ authDomain: "funui-4bcd1.firebaseapp.com",
8
+ projectId: "funui-4bcd1",
9
+ storageBucket: "funui-4bcd1.firebasestorage.app",
10
+ messagingSenderId: "321671406212",
11
+ appId: "1:321671406212:web:344738ff231449368f18d1",
12
+ measurementId: "G-PDMZ8J0R37"
13
+ };
14
+ // Initialize Firebase app
15
+ var db = (0, app_1.initializeApp)(firebaseConfig);
16
+ exports.default = (0, firestore_1.getFirestore)();
@@ -0,0 +1,8 @@
1
+ export interface ThemeConfig {
2
+ colors?: Record<string, string>;
3
+ }
4
+ /**
5
+ * Applies color variables from a theme config to the :root element.
6
+ * Example: { primary: "#8B5CF6" } → --color-primary: #8B5CF6
7
+ */
8
+ export declare const applyThemeConfig: (themeConfig: ThemeConfig) => void;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyThemeConfig = void 0;
4
+ /**
5
+ * Applies color variables from a theme config to the :root element.
6
+ * Example: { primary: "#8B5CF6" } → --color-primary: #8B5CF6
7
+ */
8
+ var applyThemeConfig = function (themeConfig) {
9
+ if (typeof window === "undefined")
10
+ return; // For SSR safety
11
+ var root = document.documentElement;
12
+ var colors = themeConfig.colors || {};
13
+ Object.entries(colors).forEach(function (_a) {
14
+ var key = _a[0], value = _a[1];
15
+ var varName = "--".concat(key);
16
+ root.style.setProperty(varName, String(value));
17
+ });
18
+ };
19
+ exports.applyThemeConfig = applyThemeConfig;