@seip/blue-bird 0.4.4 → 0.4.6

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 (53) hide show
  1. package/.env_example +26 -25
  2. package/AGENTS.md +199 -199
  3. package/LICENSE +21 -0
  4. package/README.md +79 -79
  5. package/backend/index.js +13 -13
  6. package/backend/routes/api.js +31 -31
  7. package/backend/routes/frontend.js +41 -41
  8. package/backend/routes/seo.js +39 -39
  9. package/core/app.js +328 -325
  10. package/core/auth.js +114 -83
  11. package/core/cache.js +44 -44
  12. package/core/cli/component.js +42 -42
  13. package/core/cli/init.js +119 -118
  14. package/core/cli/react.js +435 -435
  15. package/core/cli/route.js +42 -42
  16. package/core/cli/scaffolding-auth.js +1037 -0
  17. package/core/config.js +48 -47
  18. package/core/debug.js +248 -248
  19. package/core/logger.js +100 -100
  20. package/core/middleware.js +27 -27
  21. package/core/router.js +333 -333
  22. package/core/seo.js +95 -100
  23. package/core/swagger.js +40 -25
  24. package/core/template.js +472 -462
  25. package/core/upload.js +76 -76
  26. package/core/validate.js +380 -380
  27. package/frontend/index.html +26 -26
  28. package/frontend/landing.html +69 -69
  29. package/frontend/resources/css/tailwind.css +17 -17
  30. package/frontend/resources/js/App.jsx +70 -70
  31. package/frontend/resources/js/Main.jsx +18 -18
  32. package/frontend/resources/js/blue-bird/components/Button.jsx +67 -67
  33. package/frontend/resources/js/blue-bird/components/Card.jsx +18 -18
  34. package/frontend/resources/js/blue-bird/components/DataTable.jsx +126 -126
  35. package/frontend/resources/js/blue-bird/components/Input.jsx +21 -21
  36. package/frontend/resources/js/blue-bird/components/Label.jsx +12 -12
  37. package/frontend/resources/js/blue-bird/components/LanguageButton.jsx +23 -23
  38. package/frontend/resources/js/blue-bird/components/Link.jsx +15 -15
  39. package/frontend/resources/js/blue-bird/components/Modal.jsx +27 -27
  40. package/frontend/resources/js/blue-bird/components/Skeleton.jsx +44 -44
  41. package/frontend/resources/js/blue-bird/components/Translate.jsx +12 -12
  42. package/frontend/resources/js/blue-bird/components/Typography.jsx +69 -69
  43. package/frontend/resources/js/blue-bird/contexts/LanguageContext.jsx +41 -41
  44. package/frontend/resources/js/blue-bird/contexts/SPAContext.jsx +239 -237
  45. package/frontend/resources/js/blue-bird/contexts/SnackbarContext.jsx +38 -38
  46. package/frontend/resources/js/blue-bird/contexts/ThemeContext.jsx +49 -49
  47. package/frontend/resources/js/blue-bird/locales/en.json +47 -47
  48. package/frontend/resources/js/blue-bird/locales/es.json +47 -47
  49. package/frontend/resources/js/components/Header.jsx +55 -55
  50. package/frontend/resources/js/pages/About.jsx +31 -31
  51. package/frontend/resources/js/pages/Home.jsx +82 -82
  52. package/package.json +57 -57
  53. package/vite.config.js +22 -22
@@ -1,69 +1,69 @@
1
- import React from 'react';
2
-
3
- export default function Typography({ variant = 'p', children, className = '', gradient = false, ...props }) {
4
- const variants = {
5
- h1: "scroll-m-20 font-extrabold tracking-tight",
6
- h2: "scroll-m-20 border-b pb-2 font-semibold tracking-tight first:mt-0",
7
- h3: "scroll-m-20 font-semibold tracking-tight",
8
- h4: "scroll-m-20 font-semibold tracking-tight",
9
- p: "leading-7 [&:not(:first-child)]:mt-6",
10
- blockquote: "mt-6 border-l-2 pl-6 italic",
11
- lead: "text-xl text-slate-700 dark:text-slate-300",
12
- large: "text-lg font-semibold",
13
- small: "text-sm font-medium leading-none",
14
- muted: "text-sm text-slate-500 dark:text-slate-400",
15
- };
16
-
17
- const fromColors = {
18
- blue: 'from-blue-500',
19
- sky: 'from-sky-500',
20
- indigo: 'from-indigo-500',
21
- violet: 'from-violet-500',
22
- purple: 'from-purple-500',
23
- fuchsia: 'from-fuchsia-500',
24
- pink: 'from-pink-500',
25
- rose: 'from-rose-500',
26
- red: 'from-red-500',
27
- orange: 'from-orange-500',
28
- amber: 'from-amber-500',
29
- yellow: 'from-yellow-500',
30
- lime: 'from-lime-500',
31
- green: 'from-green-500',
32
- emerald: 'from-emerald-500',
33
- teal: 'from-teal-500',
34
- cyan: 'from-cyan-500',
35
- };
36
-
37
- const toColors = {
38
- blue: 'to-blue-600',
39
- sky: 'to-sky-600',
40
- indigo: 'to-indigo-600',
41
- violet: 'to-violet-600',
42
- purple: 'to-purple-600',
43
- fuchsia: 'to-fuchsia-600',
44
- pink: 'to-pink-600',
45
- rose: 'to-rose-600',
46
- red: 'to-red-600',
47
- orange: 'to-orange-600',
48
- amber: 'to-amber-600',
49
- yellow: 'to-yellow-600',
50
- lime: 'to-lime-600',
51
- green: 'to-green-600',
52
- emerald: 'to-emerald-600',
53
- teal: 'to-teal-600',
54
- cyan: 'to-cyan-600',
55
- };
56
-
57
- const fromClass = gradient ? (fromColors[gradient.from] || `from-${gradient.from}-400`) : '';
58
- const toClass = gradient ? (toColors[gradient.to] || `to-${gradient.to}-600`) : '';
59
- const gradientText = gradient ? `bg-gradient-to-r ${fromClass} ${toClass} bg-clip-text text-transparent` : '';
60
-
61
- const Component = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p'].includes(variant) ? variant : 'p';
62
- const style = `${variants[variant]} ${className} ${gradientText}`;
63
-
64
- return (
65
- <Component className={style} {...props}>
66
- {children}
67
- </Component>
68
- );
69
- }
1
+ import React from 'react';
2
+
3
+ export default function Typography({ variant = 'p', children, className = '', gradient = false, ...props }) {
4
+ const variants = {
5
+ h1: "scroll-m-20 font-extrabold tracking-tight",
6
+ h2: "scroll-m-20 border-b pb-2 font-semibold tracking-tight first:mt-0",
7
+ h3: "scroll-m-20 font-semibold tracking-tight",
8
+ h4: "scroll-m-20 font-semibold tracking-tight",
9
+ p: "leading-7 [&:not(:first-child)]:mt-6",
10
+ blockquote: "mt-6 border-l-2 pl-6 italic",
11
+ lead: "text-xl text-slate-700 dark:text-slate-300",
12
+ large: "text-lg font-semibold",
13
+ small: "text-sm font-medium leading-none",
14
+ muted: "text-sm text-slate-500 dark:text-slate-400",
15
+ };
16
+
17
+ const fromColors = {
18
+ blue: 'from-blue-500',
19
+ sky: 'from-sky-500',
20
+ indigo: 'from-indigo-500',
21
+ violet: 'from-violet-500',
22
+ purple: 'from-purple-500',
23
+ fuchsia: 'from-fuchsia-500',
24
+ pink: 'from-pink-500',
25
+ rose: 'from-rose-500',
26
+ red: 'from-red-500',
27
+ orange: 'from-orange-500',
28
+ amber: 'from-amber-500',
29
+ yellow: 'from-yellow-500',
30
+ lime: 'from-lime-500',
31
+ green: 'from-green-500',
32
+ emerald: 'from-emerald-500',
33
+ teal: 'from-teal-500',
34
+ cyan: 'from-cyan-500',
35
+ };
36
+
37
+ const toColors = {
38
+ blue: 'to-blue-600',
39
+ sky: 'to-sky-600',
40
+ indigo: 'to-indigo-600',
41
+ violet: 'to-violet-600',
42
+ purple: 'to-purple-600',
43
+ fuchsia: 'to-fuchsia-600',
44
+ pink: 'to-pink-600',
45
+ rose: 'to-rose-600',
46
+ red: 'to-red-600',
47
+ orange: 'to-orange-600',
48
+ amber: 'to-amber-600',
49
+ yellow: 'to-yellow-600',
50
+ lime: 'to-lime-600',
51
+ green: 'to-green-600',
52
+ emerald: 'to-emerald-600',
53
+ teal: 'to-teal-600',
54
+ cyan: 'to-cyan-600',
55
+ };
56
+
57
+ const fromClass = gradient ? (fromColors[gradient.from] || `from-${gradient.from}-400`) : '';
58
+ const toClass = gradient ? (toColors[gradient.to] || `to-${gradient.to}-600`) : '';
59
+ const gradientText = gradient ? `bg-gradient-to-r ${fromClass} ${toClass} bg-clip-text text-transparent` : '';
60
+
61
+ const Component = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p'].includes(variant) ? variant : 'p';
62
+ const style = `${variants[variant]} ${className} ${gradientText}`;
63
+
64
+ return (
65
+ <Component className={style} {...props}>
66
+ {children}
67
+ </Component>
68
+ );
69
+ }
@@ -1,41 +1,41 @@
1
- import React, { createContext, useState, useEffect, useContext } from 'react';
2
- import en from '../locales/en.json';
3
- import es from '../locales/es.json';
4
-
5
- const translations = { en, es };
6
- export const LanguageContext = createContext();
7
-
8
- export const LanguageProvider = ({ children, initialLang }) => {
9
-
10
- const [lang, setLang] = useState(() => localStorage.getItem('blue_bird_lang') || initialLang || 'en');
11
-
12
- useEffect(() => {
13
- localStorage.setItem('blue_bird_lang', lang);
14
- }, [lang]);
15
-
16
- /**
17
- * Translate key into configured language text
18
- * @param {string} key - the string config key
19
- * @returns {string} The translated text
20
- */
21
- const t = (key) => {
22
- const keys = key.split('.');
23
- let value = translations[lang];
24
- for (const k of keys) {
25
- if (value && typeof value === 'object' && value !== null && k in value) {
26
- value = value[k];
27
- } else {
28
- return key;
29
- }
30
- }
31
- return value !== undefined ? value : key;
32
- };
33
-
34
- return (
35
- <LanguageContext.Provider value={{ lang, setLang, t }}>
36
- {children}
37
- </LanguageContext.Provider>
38
- );
39
- };
40
-
41
- export const useLanguage = () => useContext(LanguageContext);
1
+ import React, { createContext, useState, useEffect, useContext } from 'react';
2
+ import en from '../locales/en.json';
3
+ import es from '../locales/es.json';
4
+
5
+ const translations = { en, es };
6
+ export const LanguageContext = createContext();
7
+
8
+ export const LanguageProvider = ({ children, initialLang }) => {
9
+
10
+ const [lang, setLang] = useState(() => localStorage.getItem('blue_bird_lang') || initialLang || 'en');
11
+
12
+ useEffect(() => {
13
+ localStorage.setItem('blue_bird_lang', lang);
14
+ }, [lang]);
15
+
16
+ /**
17
+ * Translate key into configured language text
18
+ * @param {string} key - the string config key
19
+ * @returns {string} The translated text
20
+ */
21
+ const t = (key) => {
22
+ const keys = key.split('.');
23
+ let value = translations[lang];
24
+ for (const k of keys) {
25
+ if (value && typeof value === 'object' && value !== null && k in value) {
26
+ value = value[k];
27
+ } else {
28
+ return key;
29
+ }
30
+ }
31
+ return value !== undefined ? value : key;
32
+ };
33
+
34
+ return (
35
+ <LanguageContext.Provider value={{ lang, setLang, t }}>
36
+ {children}
37
+ </LanguageContext.Provider>
38
+ );
39
+ };
40
+
41
+ export const useLanguage = () => useContext(LanguageContext);