@djangocfg/ui-core 1.0.1

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 (88) hide show
  1. package/README.md +135 -0
  2. package/package.json +111 -0
  3. package/src/components/accordion.tsx +56 -0
  4. package/src/components/alert-dialog.tsx +142 -0
  5. package/src/components/alert.tsx +59 -0
  6. package/src/components/aspect-ratio.tsx +7 -0
  7. package/src/components/avatar.tsx +50 -0
  8. package/src/components/badge.tsx +36 -0
  9. package/src/components/button-group.tsx +85 -0
  10. package/src/components/button.tsx +111 -0
  11. package/src/components/calendar.tsx +213 -0
  12. package/src/components/card.tsx +76 -0
  13. package/src/components/carousel.tsx +261 -0
  14. package/src/components/chart.tsx +369 -0
  15. package/src/components/checkbox.tsx +29 -0
  16. package/src/components/collapsible.tsx +11 -0
  17. package/src/components/combobox.tsx +182 -0
  18. package/src/components/command.tsx +170 -0
  19. package/src/components/context-menu.tsx +200 -0
  20. package/src/components/copy.tsx +144 -0
  21. package/src/components/dialog.tsx +122 -0
  22. package/src/components/drawer.tsx +137 -0
  23. package/src/components/empty.tsx +104 -0
  24. package/src/components/field.tsx +244 -0
  25. package/src/components/form.tsx +178 -0
  26. package/src/components/hover-card.tsx +29 -0
  27. package/src/components/image-with-fallback.tsx +170 -0
  28. package/src/components/index.ts +86 -0
  29. package/src/components/input-group.tsx +170 -0
  30. package/src/components/input-otp.tsx +81 -0
  31. package/src/components/input.tsx +22 -0
  32. package/src/components/item.tsx +195 -0
  33. package/src/components/kbd.tsx +28 -0
  34. package/src/components/label.tsx +26 -0
  35. package/src/components/multi-select.tsx +222 -0
  36. package/src/components/og-image.tsx +47 -0
  37. package/src/components/popover.tsx +33 -0
  38. package/src/components/portal.tsx +106 -0
  39. package/src/components/preloader.tsx +250 -0
  40. package/src/components/progress.tsx +28 -0
  41. package/src/components/radio-group.tsx +43 -0
  42. package/src/components/resizable.tsx +111 -0
  43. package/src/components/scroll-area.tsx +102 -0
  44. package/src/components/section.tsx +58 -0
  45. package/src/components/select.tsx +158 -0
  46. package/src/components/separator.tsx +31 -0
  47. package/src/components/sheet.tsx +140 -0
  48. package/src/components/skeleton.tsx +15 -0
  49. package/src/components/slider.tsx +28 -0
  50. package/src/components/spinner.tsx +16 -0
  51. package/src/components/sticky.tsx +117 -0
  52. package/src/components/switch.tsx +29 -0
  53. package/src/components/table.tsx +120 -0
  54. package/src/components/tabs.tsx +238 -0
  55. package/src/components/textarea.tsx +22 -0
  56. package/src/components/toast.tsx +129 -0
  57. package/src/components/toaster.tsx +41 -0
  58. package/src/components/toggle-group.tsx +61 -0
  59. package/src/components/toggle.tsx +45 -0
  60. package/src/components/token-icon.tsx +156 -0
  61. package/src/components/tooltip-provider-safe.tsx +43 -0
  62. package/src/components/tooltip.tsx +32 -0
  63. package/src/hooks/index.ts +15 -0
  64. package/src/hooks/useCopy.ts +41 -0
  65. package/src/hooks/useCountdown.ts +73 -0
  66. package/src/hooks/useDebounce.ts +25 -0
  67. package/src/hooks/useDebouncedCallback.ts +58 -0
  68. package/src/hooks/useDebugTools.ts +52 -0
  69. package/src/hooks/useEventsBus.ts +53 -0
  70. package/src/hooks/useImageLoader.ts +95 -0
  71. package/src/hooks/useMediaQuery.ts +40 -0
  72. package/src/hooks/useMobile.tsx +22 -0
  73. package/src/hooks/useToast.ts +194 -0
  74. package/src/index.ts +14 -0
  75. package/src/lib/index.ts +2 -0
  76. package/src/lib/og-image.ts +151 -0
  77. package/src/lib/utils.ts +6 -0
  78. package/src/styles/base.css +20 -0
  79. package/src/styles/globals.css +12 -0
  80. package/src/styles/index.css +25 -0
  81. package/src/styles/sources.css +11 -0
  82. package/src/styles/theme/animations.css +65 -0
  83. package/src/styles/theme/dark.css +49 -0
  84. package/src/styles/theme/light.css +50 -0
  85. package/src/styles/theme/tokens.css +134 -0
  86. package/src/styles/theme.css +22 -0
  87. package/src/styles/utilities.css +187 -0
  88. package/src/types/index.ts +0 -0
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Tailwind CSS v4 Theme Tokens
3
+ *
4
+ * Defines custom properties that Tailwind utilities can use
5
+ * @theme directive registers these for Tailwind v4
6
+ */
7
+
8
+ @theme {
9
+ /* Default breakpoints - mobile-first responsive design */
10
+ --breakpoint-sm: 40rem; /* 640px */
11
+ --breakpoint-md: 48rem; /* 768px */
12
+ --breakpoint-lg: 64rem; /* 1024px */
13
+ --breakpoint-xl: 80rem; /* 1280px */
14
+ --breakpoint-2xl: 96rem; /* 1536px */
15
+
16
+ /* Register semantic color tokens for Tailwind utilities */
17
+ --color-background: hsl(var(--background));
18
+ --color-foreground: hsl(var(--foreground));
19
+ --color-card: hsl(var(--card));
20
+ --color-card-foreground: hsl(var(--card-foreground));
21
+ --color-popover: hsl(var(--popover));
22
+ --color-popover-foreground: hsl(var(--popover-foreground));
23
+ --color-primary: hsl(var(--primary));
24
+ --color-primary-foreground: hsl(var(--primary-foreground));
25
+ --color-secondary: hsl(var(--secondary));
26
+ --color-secondary-foreground: hsl(var(--secondary-foreground));
27
+ --color-muted: hsl(var(--muted));
28
+ --color-muted-foreground: hsl(var(--muted-foreground));
29
+ --color-accent: hsl(var(--accent));
30
+ --color-accent-foreground: hsl(var(--accent-foreground));
31
+ --color-destructive: hsl(var(--destructive));
32
+ --color-destructive-foreground: hsl(var(--destructive-foreground));
33
+ --color-border: hsl(var(--border));
34
+ --color-input: hsl(var(--input));
35
+ --color-ring: hsl(var(--ring));
36
+ --color-black: #000000;
37
+ --color-white: #ffffff;
38
+ --color-warning: hsl(var(--warning));
39
+
40
+ /* Sidebar colors */
41
+ --color-sidebar-background: hsl(var(--sidebar-background));
42
+ --color-sidebar-foreground: hsl(var(--sidebar-foreground));
43
+ --color-sidebar-primary: hsl(var(--sidebar-primary));
44
+ --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));
45
+ --color-sidebar-accent: hsl(var(--sidebar-accent));
46
+ --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
47
+ --color-sidebar-border: hsl(var(--sidebar-border));
48
+ --color-sidebar-ring: hsl(var(--sidebar-ring));
49
+
50
+ /* Spacing scale - required for all spacing utilities to work */
51
+ --spacing: 0.25rem; /* Base unit: 4px */
52
+ --spacing-0: 0;
53
+ --spacing-px: 1px;
54
+ --spacing-0\.5: 0.125rem; /* 2px */
55
+ --spacing-1: 0.25rem; /* 4px */
56
+ --spacing-1\.5: 0.375rem; /* 6px */
57
+ --spacing-2: 0.5rem; /* 8px */
58
+ --spacing-2\.5: 0.625rem; /* 10px */
59
+ --spacing-3: 0.75rem; /* 12px */
60
+ --spacing-3\.5: 0.875rem; /* 14px */
61
+ --spacing-4: 1rem; /* 16px */
62
+ --spacing-5: 1.25rem; /* 20px */
63
+ --spacing-6: 1.5rem; /* 24px */
64
+ --spacing-7: 1.75rem; /* 28px */
65
+ --spacing-8: 2rem; /* 32px */
66
+ --spacing-9: 2.25rem; /* 36px */
67
+ --spacing-10: 2.5rem; /* 40px */
68
+ --spacing-11: 2.75rem; /* 44px */
69
+ --spacing-12: 3rem; /* 48px */
70
+ --spacing-14: 3.5rem; /* 56px */
71
+ --spacing-16: 4rem; /* 64px */
72
+ --spacing-20: 5rem; /* 80px */
73
+ --spacing-24: 6rem; /* 96px */
74
+ --spacing-28: 7rem; /* 112px */
75
+ --spacing-32: 8rem; /* 128px */
76
+ --spacing-36: 9rem; /* 144px */
77
+ --spacing-40: 10rem; /* 160px */
78
+ --spacing-44: 11rem; /* 176px */
79
+ --spacing-48: 12rem; /* 192px */
80
+ --spacing-52: 13rem; /* 208px */
81
+ --spacing-56: 14rem; /* 224px */
82
+ --spacing-60: 15rem; /* 240px */
83
+ --spacing-64: 16rem; /* 256px */
84
+ --spacing-72: 18rem; /* 288px */
85
+ --spacing-80: 20rem; /* 320px */
86
+ --spacing-96: 24rem; /* 384px */
87
+
88
+ /* Gap utilities - required for gap-* classes to work */
89
+ --gap-9: 2.25rem; /* 36px */
90
+ --gap-10: 2.5rem; /* 40px */
91
+ --gap-11: 2.75rem; /* 44px */
92
+ --gap-12: 3rem; /* 48px */
93
+ --gap-14: 3.5rem; /* 56px */
94
+ --gap-16: 4rem; /* 64px */
95
+ --gap-20: 5rem; /* 80px */
96
+ --gap-24: 6rem; /* 96px */
97
+
98
+ /* Blur utilities - required for backdrop-blur-* classes to work */
99
+ --blur-xs: 4px;
100
+ --blur-sm: 8px;
101
+ --blur-md: 12px;
102
+ --blur-lg: 16px;
103
+ --blur-xl: 24px;
104
+ --blur-2xl: 40px;
105
+ --blur-3xl: 64px;
106
+
107
+ /* Custom width utilities */
108
+ --width-dropdown: 500px;
109
+
110
+ /* Z-index scale for stacking context */
111
+ --z-index-0: 0;
112
+ --z-index-10: 10;
113
+ --z-index-20: 20;
114
+ --z-index-30: 30;
115
+ --z-index-40: 40;
116
+ --z-index-50: 50;
117
+ --z-index-100: 100;
118
+ --z-index-150: 150;
119
+ --z-index-200: 200;
120
+ --z-index-500: 500;
121
+ --z-index-600: 600;
122
+ --z-index-9995: 9995;
123
+ --z-index-9996: 9996;
124
+ --z-index-9999: 9999;
125
+ --z-index-auto: auto;
126
+
127
+ /* Custom animations for smooth floating effects */
128
+ --animate-float: float 20s ease-in-out infinite;
129
+ --animate-float-slow: float 25s ease-in-out infinite;
130
+ --animate-float-x: float-x 18s ease-in-out infinite;
131
+ --animate-float-diagonal: float-diagonal 22s ease-in-out infinite;
132
+ --animate-morph: morph 15s ease-in-out infinite;
133
+ --animate-gradient-shift: gradient-shift 10s ease-in-out infinite;
134
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Theme System
3
+ *
4
+ * Main entry point for theme configuration
5
+ * Aggregates all theme-related styles in logical order:
6
+ * 1. Tailwind tokens (@theme)
7
+ * 2. Custom animations (@keyframes)
8
+ * 3. Light theme colors (:root)
9
+ * 4. Dark theme colors (.dark)
10
+ */
11
+
12
+ /* 1. Tailwind v4 theme tokens - MUST be first */
13
+ @import "./theme/tokens.css";
14
+
15
+ /* 2. Custom animations */
16
+ @import "./theme/animations.css";
17
+
18
+ /* 3. Light theme (default) */
19
+ @import "./theme/light.css";
20
+
21
+ /* 4. Dark theme */
22
+ @import "./theme/dark.css";
@@ -0,0 +1,187 @@
1
+ /**
2
+ * Custom Utilities
3
+ * Utility classes that extend Tailwind CSS
4
+ * Compatible with Tailwind CSS v4
5
+ */
6
+
7
+ /**
8
+ * Screen Reader Only
9
+ * Hides content visually but keeps it accessible to screen readers
10
+ * Note: Using clip for better browser compatibility (clip-path may have issues)
11
+ */
12
+ .sr-only {
13
+ position: absolute;
14
+ width: 1px;
15
+ height: 1px;
16
+ padding: 0;
17
+ margin: -1px;
18
+ overflow: hidden;
19
+ clip: rect(0, 0, 0, 0);
20
+ white-space: nowrap;
21
+ border-width: 0;
22
+ }
23
+
24
+ /**
25
+ * Step Counter Utility
26
+ * Used for numbered step indicators in documentation/tutorials
27
+ */
28
+ .step {
29
+ counter-increment: step;
30
+ }
31
+
32
+ .step:before {
33
+ position: absolute;
34
+ width: 2.25rem;
35
+ height: 2.25rem;
36
+ background-color: hsl(var(--muted));
37
+ border-radius: 9999px;
38
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
39
+ font-weight: 500;
40
+ text-align: center;
41
+ font-size: 1rem;
42
+ display: inline-flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ text-indent: -1px;
46
+ border: 4px solid hsl(var(--background));
47
+ content: counter(step);
48
+ }
49
+
50
+ /**
51
+ * MultiSelectPro Animation Classes
52
+ * Custom animations for the MultiSelectPro component
53
+ */
54
+
55
+ /* Badge Animations */
56
+ @keyframes wiggle {
57
+ 0%, 100% { transform: rotate(-3deg); }
58
+ 50% { transform: rotate(3deg); }
59
+ }
60
+
61
+ .animate-wiggle {
62
+ animation: wiggle 0.5s ease-in-out;
63
+ }
64
+
65
+ @keyframes fadeIn {
66
+ from { opacity: 0; }
67
+ to { opacity: 1; }
68
+ }
69
+
70
+ .animate-fadeIn {
71
+ animation: fadeIn 0.3s ease-in-out;
72
+ }
73
+
74
+ @keyframes slideIn {
75
+ from {
76
+ opacity: 0;
77
+ transform: translateY(-10px);
78
+ }
79
+ to {
80
+ opacity: 1;
81
+ transform: translateY(0);
82
+ }
83
+ }
84
+
85
+ .animate-slideIn {
86
+ animation: slideIn 0.3s ease-out;
87
+ }
88
+
89
+ /* Popover Animations */
90
+ @keyframes scaleIn {
91
+ from {
92
+ opacity: 0;
93
+ transform: scale(0.95);
94
+ }
95
+ to {
96
+ opacity: 1;
97
+ transform: scale(1);
98
+ }
99
+ }
100
+
101
+ .animate-scaleIn {
102
+ animation: scaleIn 0.2s ease-out;
103
+ }
104
+
105
+ @keyframes scaleOut {
106
+ from {
107
+ opacity: 1;
108
+ transform: scale(1);
109
+ }
110
+ to {
111
+ opacity: 0;
112
+ transform: scale(0.95);
113
+ }
114
+ }
115
+
116
+ .animate-scaleOut {
117
+ animation: scaleOut 0.2s ease-in;
118
+ }
119
+
120
+ @keyframes slideDown {
121
+ from {
122
+ opacity: 0;
123
+ transform: translateY(-10px);
124
+ }
125
+ to {
126
+ opacity: 1;
127
+ transform: translateY(0);
128
+ }
129
+ }
130
+
131
+ .animate-slideDown {
132
+ animation: slideDown 0.3s ease-out;
133
+ }
134
+
135
+ @keyframes slideUp {
136
+ from {
137
+ opacity: 1;
138
+ transform: translateY(0);
139
+ }
140
+ to {
141
+ opacity: 0;
142
+ transform: translateY(-10px);
143
+ }
144
+ }
145
+
146
+ .animate-slideUp {
147
+ animation: slideUp 0.3s ease-in;
148
+ }
149
+
150
+ @keyframes fadeOut {
151
+ from { opacity: 1; }
152
+ to { opacity: 0; }
153
+ }
154
+
155
+ .animate-fadeOut {
156
+ animation: fadeOut 0.2s ease-in;
157
+ }
158
+
159
+ @keyframes flipIn {
160
+ from {
161
+ opacity: 0;
162
+ transform: rotateX(-90deg);
163
+ }
164
+ to {
165
+ opacity: 1;
166
+ transform: rotateX(0);
167
+ }
168
+ }
169
+
170
+ .animate-flipIn {
171
+ animation: flipIn 0.3s ease-out;
172
+ }
173
+
174
+ @keyframes flipOut {
175
+ from {
176
+ opacity: 1;
177
+ transform: rotateX(0);
178
+ }
179
+ to {
180
+ opacity: 0;
181
+ transform: rotateX(90deg);
182
+ }
183
+ }
184
+
185
+ .animate-flipOut {
186
+ animation: flipOut 0.3s ease-in;
187
+ }
File without changes