fiboui 1.0.0

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 (141) hide show
  1. package/README.md +101 -0
  2. package/dist/content/Alert/index.d.ts +878 -0
  3. package/dist/content/Avatar/index.d.ts +886 -0
  4. package/dist/content/Badge/index.d.ts +887 -0
  5. package/dist/content/Image/index.d.ts +893 -0
  6. package/dist/content/Label/index.d.ts +879 -0
  7. package/dist/content/Progress/index.d.ts +898 -0
  8. package/dist/content/Skeleton/index.d.ts +879 -0
  9. package/dist/content/Spinner/index.d.ts +880 -0
  10. package/dist/content/Text/index.d.ts +878 -0
  11. package/dist/content/index.d.ts +9 -0
  12. package/dist/core/StateWrapper.d.ts +28 -0
  13. package/dist/core/builder.d.ts +50 -0
  14. package/dist/core/component.d.ts +7 -0
  15. package/dist/core/effects.d.ts +3 -0
  16. package/dist/core/icons.d.ts +11 -0
  17. package/dist/core/index.d.ts +5 -0
  18. package/dist/core/state.d.ts +37 -0
  19. package/dist/core/types.d.ts +51 -0
  20. package/dist/demo.d.ts +7 -0
  21. package/dist/effects-Co9C_Dyx.mjs +9 -0
  22. package/dist/examples/ScaffoldExamples.d.ts +3 -0
  23. package/dist/examples/StateExamples.d.ts +5 -0
  24. package/dist/index.d.ts +6 -0
  25. package/dist/index.esm.js +4622 -0
  26. package/dist/index.umd.js +251 -0
  27. package/dist/interactive/Button/index.d.ts +897 -0
  28. package/dist/interactive/Checkbox/index.d.ts +884 -0
  29. package/dist/interactive/Combobox/index.d.ts +898 -0
  30. package/dist/interactive/RadioGroup/index.d.ts +888 -0
  31. package/dist/interactive/Select/index.d.ts +895 -0
  32. package/dist/interactive/Switch/index.d.ts +881 -0
  33. package/dist/interactive/TextField/index.d.ts +892 -0
  34. package/dist/interactive/Textarea/index.d.ts +890 -0
  35. package/dist/interactive/index.d.ts +8 -0
  36. package/dist/layout/Center/index.d.ts +869 -0
  37. package/dist/layout/Column/index.d.ts +881 -0
  38. package/dist/layout/Container/index.d.ts +870 -0
  39. package/dist/layout/DashboardLayout/index.d.ts +870 -0
  40. package/dist/layout/Header/index.d.ts +870 -0
  41. package/dist/layout/Line/index.d.ts +872 -0
  42. package/dist/layout/Row/index.d.ts +879 -0
  43. package/dist/layout/Scaffold/index.d.ts +878 -0
  44. package/dist/layout/ScrollView/index.d.ts +879 -0
  45. package/dist/layout/Sidebar/index.d.ts +870 -0
  46. package/dist/layout/Spacer/index.d.ts +875 -0
  47. package/dist/layout/StakentComponents.d.ts +4 -0
  48. package/dist/layout/index.d.ts +11 -0
  49. package/dist/structure/Banner/index.d.ts +879 -0
  50. package/dist/structure/Box/index.d.ts +869 -0
  51. package/dist/structure/Card/index.d.ts +881 -0
  52. package/dist/structure/Collapse/index.d.ts +884 -0
  53. package/dist/structure/Grid/index.d.ts +1757 -0
  54. package/dist/structure/List/index.d.ts +888 -0
  55. package/dist/structure/Table/index.d.ts +895 -0
  56. package/dist/structure/Tags/index.d.ts +876 -0
  57. package/dist/structure/cards/AssetCard/index.d.ts +884 -0
  58. package/dist/structure/cards/CollectionCard/index.d.ts +880 -0
  59. package/dist/structure/cards/ContentCard/index.d.ts +884 -0
  60. package/dist/structure/cards/ProfileCard/index.d.ts +892 -0
  61. package/dist/structure/cards/index.d.ts +5 -0
  62. package/dist/structure/cards/variants/index.d.ts +3490 -0
  63. package/dist/structure/index.d.ts +9 -0
  64. package/dist/style.css +1 -0
  65. package/dist/theme/cupertino.d.ts +3 -0
  66. package/dist/theme/index.d.ts +5 -0
  67. package/dist/theme/material.d.ts +3 -0
  68. package/dist/theme/provider.d.ts +16 -0
  69. package/dist/theme/types.d.ts +57 -0
  70. package/dist/theme/web.d.ts +3 -0
  71. package/package.json +54 -0
  72. package/src/content/Alert/index.ts +110 -0
  73. package/src/content/Avatar/index.ts +116 -0
  74. package/src/content/Badge/index.ts +162 -0
  75. package/src/content/Image/index.ts +137 -0
  76. package/src/content/Label/index.ts +66 -0
  77. package/src/content/Progress/index.ts +378 -0
  78. package/src/content/Skeleton/index.ts +71 -0
  79. package/src/content/Spinner/index.ts +139 -0
  80. package/src/content/Text/index.ts +74 -0
  81. package/src/content/index.ts +9 -0
  82. package/src/core/StateWrapper.tsx +105 -0
  83. package/src/core/builder.ts +259 -0
  84. package/src/core/component.ts +49 -0
  85. package/src/core/effects.ts +27 -0
  86. package/src/core/icons.tsx +57 -0
  87. package/src/core/index.ts +5 -0
  88. package/src/core/state.ts +233 -0
  89. package/src/core/types.ts +62 -0
  90. package/src/demo.tsx +1045 -0
  91. package/src/examples/ScaffoldExamples.tsx +299 -0
  92. package/src/examples/StateExamples.tsx +149 -0
  93. package/src/index.ts +8 -0
  94. package/src/interactive/Button/index.ts +218 -0
  95. package/src/interactive/Checkbox/index.ts +145 -0
  96. package/src/interactive/Combobox/index.ts +278 -0
  97. package/src/interactive/RadioGroup/index.ts +124 -0
  98. package/src/interactive/Select/index.ts +227 -0
  99. package/src/interactive/Switch/index.ts +123 -0
  100. package/src/interactive/TextField/index.ts +200 -0
  101. package/src/interactive/Textarea/index.ts +129 -0
  102. package/src/interactive/index.ts +8 -0
  103. package/src/layout/Center/index.ts +34 -0
  104. package/src/layout/Column/index.ts +101 -0
  105. package/src/layout/Container/index.ts +28 -0
  106. package/src/layout/DashboardLayout/index.ts +106 -0
  107. package/src/layout/Header/index.ts +50 -0
  108. package/src/layout/Line/index.ts +41 -0
  109. package/src/layout/Row/index.ts +93 -0
  110. package/src/layout/Scaffold/index.ts +133 -0
  111. package/src/layout/ScrollView/index.ts +67 -0
  112. package/src/layout/Sidebar/index.ts +56 -0
  113. package/src/layout/Spacer/index.ts +46 -0
  114. package/src/layout/StakentComponents.tsx +57 -0
  115. package/src/layout/index.ts +11 -0
  116. package/src/structure/Banner/index.ts +92 -0
  117. package/src/structure/Box/index.ts +45 -0
  118. package/src/structure/Card/index.ts +113 -0
  119. package/src/structure/Collapse/index.ts +122 -0
  120. package/src/structure/Grid/index.ts +197 -0
  121. package/src/structure/List/index.ts +185 -0
  122. package/src/structure/Table/index.ts +165 -0
  123. package/src/structure/Tags/index.ts +69 -0
  124. package/src/structure/cards/AssetCard/index.ts +158 -0
  125. package/src/structure/cards/CollectionCard/index.ts +95 -0
  126. package/src/structure/cards/ContentCard/index.ts +127 -0
  127. package/src/structure/cards/ProfileCard/index.ts +152 -0
  128. package/src/structure/cards/index.ts +5 -0
  129. package/src/structure/cards/variants/index.ts +301 -0
  130. package/src/structure/index.ts +10 -0
  131. package/src/styles/base.css +186 -0
  132. package/src/styles/core.css +52 -0
  133. package/src/styles/themes/cupertino.css +197 -0
  134. package/src/styles/themes/material.css +322 -0
  135. package/src/styles/themes/web.css +196 -0
  136. package/src/theme/cupertino.ts +85 -0
  137. package/src/theme/index.ts +5 -0
  138. package/src/theme/material.ts +86 -0
  139. package/src/theme/provider.tsx +76 -0
  140. package/src/theme/types.ts +62 -0
  141. package/src/theme/web.ts +82 -0
@@ -0,0 +1,85 @@
1
+ import { FiboTheme } from './types';
2
+
3
+ export const cupertinoTheme: FiboTheme = {
4
+ name: 'cupertino',
5
+ colors: {
6
+ primary: '#007AFF',
7
+ secondary: '#AF52DE',
8
+ background: '#FFFFFF',
9
+ surface: '#F2F2F7',
10
+ error: '#FF3B30',
11
+ success: '#34C759',
12
+ warning: '#FF9500',
13
+ info: '#5AC8FA',
14
+ onPrimary: '#FFFFFF',
15
+ onSecondary: '#FFFFFF',
16
+ onBackground: '#000000',
17
+ onSurface: '#000000',
18
+ onError: '#FFFFFF',
19
+ },
20
+ typography: {
21
+ h1: {
22
+ fontSize: '34px',
23
+ fontWeight: 700,
24
+ letterSpacing: '0.37px',
25
+ },
26
+ h2: {
27
+ fontSize: '28px',
28
+ fontWeight: 700,
29
+ letterSpacing: '0.36px',
30
+ },
31
+ h3: {
32
+ fontSize: '22px',
33
+ fontWeight: 600,
34
+ letterSpacing: '0.35px',
35
+ },
36
+ h4: {
37
+ fontSize: '20px',
38
+ fontWeight: 600,
39
+ },
40
+ h5: {
41
+ fontSize: '17px',
42
+ fontWeight: 600,
43
+ letterSpacing: '-0.41px',
44
+ },
45
+ h6: {
46
+ fontSize: '15px',
47
+ fontWeight: 600,
48
+ letterSpacing: '-0.24px',
49
+ },
50
+ body: {
51
+ fontSize: '17px',
52
+ fontWeight: 400,
53
+ letterSpacing: '-0.41px',
54
+ },
55
+ caption: {
56
+ fontSize: '13px',
57
+ fontWeight: 400,
58
+ letterSpacing: '-0.08px',
59
+ },
60
+ label: {
61
+ fontSize: '15px',
62
+ fontWeight: 500,
63
+ letterSpacing: '-0.24px',
64
+ },
65
+ },
66
+ spacing: {
67
+ xs: '4px',
68
+ sm: '8px',
69
+ md: '12px',
70
+ lg: '20px',
71
+ xl: '32px',
72
+ },
73
+ borderRadius: {
74
+ sm: '8px',
75
+ md: '12px',
76
+ lg: '20px',
77
+ full: '9999px',
78
+ },
79
+ shadows: {
80
+ sm: '0 1px 3px rgba(0,0,0,0.08)',
81
+ md: '0 2px 8px rgba(0,0,0,0.1)',
82
+ lg: '0 4px 16px rgba(0,0,0,0.12)',
83
+ },
84
+ fontFamily: '-apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif',
85
+ };
@@ -0,0 +1,5 @@
1
+ export * from './types';
2
+ export * from './material';
3
+ export * from './cupertino';
4
+ export * from './web';
5
+ export * from './provider';
@@ -0,0 +1,86 @@
1
+ import { FiboTheme } from './types';
2
+
3
+ export const materialTheme: FiboTheme = {
4
+ name: 'material',
5
+ colors: {
6
+ primary: '#6200EE',
7
+ primaryVariant: '#3700B3',
8
+ secondary: '#03DAC6',
9
+ secondaryVariant: '#018786',
10
+ background: '#FFFFFF',
11
+ surface: '#FFFFFF',
12
+ error: '#B00020',
13
+ success: '#4CAF50',
14
+ warning: '#FF9800',
15
+ info: '#2196F3',
16
+ onPrimary: '#FFFFFF',
17
+ onSecondary: '#000000',
18
+ onBackground: '#000000',
19
+ onSurface: '#000000',
20
+ onError: '#FFFFFF',
21
+ },
22
+ typography: {
23
+ h1: {
24
+ fontSize: '96px',
25
+ fontWeight: 300,
26
+ letterSpacing: '-1.5px',
27
+ },
28
+ h2: {
29
+ fontSize: '60px',
30
+ fontWeight: 300,
31
+ letterSpacing: '-0.5px',
32
+ },
33
+ h3: {
34
+ fontSize: '48px',
35
+ fontWeight: 400,
36
+ },
37
+ h4: {
38
+ fontSize: '34px',
39
+ fontWeight: 400,
40
+ letterSpacing: '0.25px',
41
+ },
42
+ h5: {
43
+ fontSize: '24px',
44
+ fontWeight: 400,
45
+ },
46
+ h6: {
47
+ fontSize: '20px',
48
+ fontWeight: 500,
49
+ letterSpacing: '0.15px',
50
+ },
51
+ body: {
52
+ fontSize: '16px',
53
+ fontWeight: 400,
54
+ letterSpacing: '0.5px',
55
+ },
56
+ caption: {
57
+ fontSize: '12px',
58
+ fontWeight: 400,
59
+ letterSpacing: '0.4px',
60
+ },
61
+ label: {
62
+ fontSize: '14px',
63
+ fontWeight: 500,
64
+ letterSpacing: '1.25px',
65
+ },
66
+ },
67
+ spacing: {
68
+ xs: '4px',
69
+ sm: '8px',
70
+ md: '16px',
71
+ lg: '24px',
72
+ xl: '32px',
73
+ },
74
+ borderRadius: {
75
+ sm: '4px',
76
+ md: '8px',
77
+ lg: '16px',
78
+ full: '9999px',
79
+ },
80
+ shadows: {
81
+ sm: '0 2px 4px rgba(0,0,0,0.1)',
82
+ md: '0 4px 8px rgba(0,0,0,0.12)',
83
+ lg: '0 8px 16px rgba(0,0,0,0.14)',
84
+ },
85
+ fontFamily: 'Roboto, sans-serif',
86
+ };
@@ -0,0 +1,76 @@
1
+ import { createContext, useContext, useState, useEffect, ReactNode } from 'react';
2
+ import { FiboTheme } from './types';
3
+ import { FiboThemeName } from '../core/types';
4
+ import { materialTheme } from './material';
5
+ import { cupertinoTheme } from './cupertino';
6
+ import { webTheme } from './web';
7
+
8
+ interface FiboThemeContextValue {
9
+ theme: FiboTheme;
10
+ themeName: FiboThemeName;
11
+ setTheme: (name: FiboThemeName) => void;
12
+ }
13
+
14
+ const FiboThemeContext = createContext<FiboThemeContextValue | undefined>(undefined);
15
+
16
+ const themes: Record<FiboThemeName, FiboTheme> = {
17
+ material: materialTheme,
18
+ cupertino: cupertinoTheme,
19
+ web: webTheme,
20
+ };
21
+
22
+ interface FiboThemeProviderProps {
23
+ theme?: FiboThemeName;
24
+ children: ReactNode;
25
+ }
26
+
27
+ export function FiboThemeProvider({
28
+ theme: initialTheme = 'material',
29
+ children
30
+ }: FiboThemeProviderProps) {
31
+ const [themeName, setThemeName] = useState<FiboThemeName>(initialTheme);
32
+ const [theme, setThemeObject] = useState<FiboTheme>(themes[initialTheme]);
33
+
34
+ useEffect(() => {
35
+ const newTheme = themes[themeName];
36
+ setThemeObject(newTheme);
37
+
38
+ if (typeof document !== 'undefined') {
39
+ const root = document.documentElement;
40
+
41
+
42
+ root.classList.remove('fibo-theme-material', 'fibo-theme-cupertino', 'fibo-theme-web');
43
+
44
+
45
+ root.classList.add(`fibo-theme-${themeName}`);
46
+
47
+
48
+ root.style.setProperty('--fibo-primary', newTheme.colors.primary);
49
+ root.style.setProperty('--fibo-secondary', newTheme.colors.secondary);
50
+ root.style.setProperty('--fibo-background', newTheme.colors.background);
51
+ root.style.setProperty('--fibo-surface', newTheme.colors.surface);
52
+ root.style.setProperty('--fibo-error', newTheme.colors.error);
53
+ root.style.setProperty('--fibo-font-family', newTheme.fontFamily);
54
+ }
55
+ }, [themeName]);
56
+
57
+ const value: FiboThemeContextValue = {
58
+ theme,
59
+ themeName,
60
+ setTheme: setThemeName,
61
+ };
62
+
63
+ return (
64
+ <FiboThemeContext.Provider value={value}>
65
+ {children}
66
+ </FiboThemeContext.Provider>
67
+ );
68
+ }
69
+
70
+ export function useFiboTheme(): FiboThemeContextValue {
71
+ const context = useContext(FiboThemeContext);
72
+ if (!context) {
73
+ throw new Error('useFiboTheme must be used within a FiboThemeProvider');
74
+ }
75
+ return context;
76
+ }
@@ -0,0 +1,62 @@
1
+ import { FiboThemeName, TextStyle } from '../core/types';
2
+
3
+ export interface ThemeColors {
4
+ primary: string;
5
+ primaryVariant?: string;
6
+ secondary: string;
7
+ secondaryVariant?: string;
8
+ background: string;
9
+ surface: string;
10
+ error: string;
11
+ success?: string;
12
+ warning?: string;
13
+ info?: string;
14
+ onPrimary: string;
15
+ onSecondary: string;
16
+ onBackground: string;
17
+ onSurface: string;
18
+ onError: string;
19
+ }
20
+
21
+ export interface ThemeTypography {
22
+ h1: TextStyle;
23
+ h2: TextStyle;
24
+ h3: TextStyle;
25
+ h4: TextStyle;
26
+ h5: TextStyle;
27
+ h6: TextStyle;
28
+ body: TextStyle;
29
+ caption: TextStyle;
30
+ label: TextStyle;
31
+ }
32
+
33
+ export interface ThemeSpacing {
34
+ xs: string;
35
+ sm: string;
36
+ md: string;
37
+ lg: string;
38
+ xl: string;
39
+ }
40
+
41
+ export interface ThemeBorderRadius {
42
+ sm: string;
43
+ md: string;
44
+ lg: string;
45
+ full: string;
46
+ }
47
+
48
+ export interface ThemeShadows {
49
+ sm: string;
50
+ md: string;
51
+ lg: string;
52
+ }
53
+
54
+ export interface FiboTheme {
55
+ name: FiboThemeName;
56
+ colors: ThemeColors;
57
+ typography: ThemeTypography;
58
+ spacing: ThemeSpacing;
59
+ borderRadius: ThemeBorderRadius;
60
+ shadows: ThemeShadows;
61
+ fontFamily: string;
62
+ }
@@ -0,0 +1,82 @@
1
+ import { FiboTheme } from './types';
2
+
3
+ export const webTheme: FiboTheme = {
4
+ name: 'web',
5
+ colors: {
6
+ primary: '#3B82F6',
7
+ secondary: '#8B5CF6',
8
+ background: '#FFFFFF',
9
+ surface: '#F9FAFB',
10
+ error: '#EF4444',
11
+ success: '#10B981',
12
+ warning: '#F59E0B',
13
+ info: '#06B6D4',
14
+ onPrimary: '#FFFFFF',
15
+ onSecondary: '#FFFFFF',
16
+ onBackground: '#111827',
17
+ onSurface: '#374151',
18
+ onError: '#FFFFFF',
19
+ },
20
+ typography: {
21
+ h1: {
22
+ fontSize: '60px',
23
+ fontWeight: 800,
24
+ letterSpacing: '-0.02em',
25
+ },
26
+ h2: {
27
+ fontSize: '48px',
28
+ fontWeight: 700,
29
+ letterSpacing: '-0.01em',
30
+ },
31
+ h3: {
32
+ fontSize: '36px',
33
+ fontWeight: 700,
34
+ },
35
+ h4: {
36
+ fontSize: '30px',
37
+ fontWeight: 600,
38
+ },
39
+ h5: {
40
+ fontSize: '24px',
41
+ fontWeight: 600,
42
+ },
43
+ h6: {
44
+ fontSize: '20px',
45
+ fontWeight: 600,
46
+ },
47
+ body: {
48
+ fontSize: '16px',
49
+ fontWeight: 400,
50
+ lineHeight: '1.5',
51
+ },
52
+ caption: {
53
+ fontSize: '14px',
54
+ fontWeight: 400,
55
+ lineHeight: '1.4',
56
+ },
57
+ label: {
58
+ fontSize: '14px',
59
+ fontWeight: 500,
60
+ letterSpacing: '0.01em',
61
+ },
62
+ },
63
+ spacing: {
64
+ xs: '4px',
65
+ sm: '8px',
66
+ md: '16px',
67
+ lg: '24px',
68
+ xl: '32px',
69
+ },
70
+ borderRadius: {
71
+ sm: '6px',
72
+ md: '8px',
73
+ lg: '12px',
74
+ full: '9999px',
75
+ },
76
+ shadows: {
77
+ sm: '0 1px 2px rgba(0,0,0,0.05)',
78
+ md: '0 4px 6px rgba(0,0,0,0.07)',
79
+ lg: '0 10px 15px rgba(0,0,0,0.1)',
80
+ },
81
+ fontFamily: 'Inter, system-ui, sans-serif',
82
+ };