@djangocfg/ui-core 2.1.257 → 2.1.260
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/ui-core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.260",
|
|
4
4
|
"description": "Pure React UI component library without Next.js dependencies - for Electron, Vite, CRA apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui-components",
|
|
@@ -33,6 +33,11 @@
|
|
|
33
33
|
"import": "./src/index.ts",
|
|
34
34
|
"require": "./src/index.ts"
|
|
35
35
|
},
|
|
36
|
+
"./stories": {
|
|
37
|
+
"types": "./src/stories/index.ts",
|
|
38
|
+
"import": "./src/stories/index.ts",
|
|
39
|
+
"require": "./src/stories/index.ts"
|
|
40
|
+
},
|
|
36
41
|
"./components": {
|
|
37
42
|
"types": "./src/components/index.ts",
|
|
38
43
|
"import": "./src/components/index.ts",
|
|
@@ -81,7 +86,7 @@
|
|
|
81
86
|
"playground": "playground dev"
|
|
82
87
|
},
|
|
83
88
|
"peerDependencies": {
|
|
84
|
-
"@djangocfg/i18n": "^2.1.
|
|
89
|
+
"@djangocfg/i18n": "^2.1.260",
|
|
85
90
|
"consola": "^3.4.2",
|
|
86
91
|
"lucide-react": "^0.545.0",
|
|
87
92
|
"moment": "^2.30.1",
|
|
@@ -143,9 +148,9 @@
|
|
|
143
148
|
"vaul": "1.1.2"
|
|
144
149
|
},
|
|
145
150
|
"devDependencies": {
|
|
146
|
-
"@djangocfg/i18n": "^2.1.
|
|
151
|
+
"@djangocfg/i18n": "^2.1.260",
|
|
147
152
|
"@djangocfg/playground": "workspace:*",
|
|
148
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
153
|
+
"@djangocfg/typescript-config": "^2.1.260",
|
|
149
154
|
"@types/node": "^24.7.2",
|
|
150
155
|
"@types/react": "^19.1.0",
|
|
151
156
|
"@types/react-dom": "^19.1.0",
|
|
@@ -32,7 +32,7 @@ export const GlowBackground = React.memo(({ className }: GlowBackgroundProps) =>
|
|
|
32
32
|
}}
|
|
33
33
|
className={className}
|
|
34
34
|
>
|
|
35
|
-
{/*
|
|
35
|
+
{/* Primary-hue blob — top left (follows --primary) */}
|
|
36
36
|
<div style={{
|
|
37
37
|
position: 'absolute',
|
|
38
38
|
top: '-10%',
|
|
@@ -40,7 +40,7 @@ export const GlowBackground = React.memo(({ className }: GlowBackgroundProps) =>
|
|
|
40
40
|
width: 700,
|
|
41
41
|
height: 700,
|
|
42
42
|
borderRadius: '50%',
|
|
43
|
-
background: 'radial-gradient(circle, hsl(
|
|
43
|
+
background: 'radial-gradient(circle, hsl(var(--primary) / 0.45) 0%, transparent 70%)',
|
|
44
44
|
filter: 'blur(80px)',
|
|
45
45
|
animation: 'blob 10s ease-in-out infinite',
|
|
46
46
|
}} />
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI-Core story modules registry.
|
|
3
|
+
*
|
|
4
|
+
* Re-export stories through a package subpath instead of deep importing files from apps.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { StoryModule } from '@djangocfg/playground';
|
|
8
|
+
|
|
9
|
+
import * as Button from '../components/button.story';
|
|
10
|
+
import * as Input from '../components/input.story';
|
|
11
|
+
import * as Select from '../components/select.story';
|
|
12
|
+
import * as Slider from '../components/slider.story';
|
|
13
|
+
import * as Dialog from '../components/dialog.story';
|
|
14
|
+
import * as Tabs from '../components/tabs.story';
|
|
15
|
+
import * as Popover from '../components/popover.story';
|
|
16
|
+
import * as Tooltip from '../components/tooltip.story';
|
|
17
|
+
|
|
18
|
+
export const uiCoreStoryModules: Record<string, StoryModule> = {
|
|
19
|
+
'button.story.tsx': Button,
|
|
20
|
+
'input.story.tsx': Input,
|
|
21
|
+
'select.story.tsx': Select,
|
|
22
|
+
'slider.story.tsx': Slider,
|
|
23
|
+
'dialog.story.tsx': Dialog,
|
|
24
|
+
'tabs.story.tsx': Tabs,
|
|
25
|
+
'popover.story.tsx': Popover,
|
|
26
|
+
'tooltip.story.tsx': Tooltip,
|
|
27
|
+
};
|
|
28
|
+
|
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
* Reads colors directly from document, converting HSL to hex for compatibility
|
|
7
7
|
* with Canvas, SVG, Mermaid, and other tools that don't support CSS variables.
|
|
8
8
|
*
|
|
9
|
+
* **Contrast / semantic pairs:** Filled surfaces (`primary`, `secondary`, `destructive`, …) and
|
|
10
|
+
* their `*-foreground` text colors are defined together in `theme/light.css` and `theme/dark.css`.
|
|
11
|
+
* Components should use `bg-primary text-primary-foreground`, not pick a one-off text color.
|
|
12
|
+
* To change how buttons read, adjust those CSS variables — not per-component styles or hooks.
|
|
13
|
+
*
|
|
9
14
|
* @module ui-core/styles/palette/useThemePalette
|
|
10
15
|
*/
|
|
11
16
|
|
|
@@ -29,16 +34,16 @@ const SSR_FALLBACK: Record<string, string> = {
|
|
|
29
34
|
'muted-foreground': '#737373',
|
|
30
35
|
'border': '#e5e5e5',
|
|
31
36
|
'input': '#e5e5e5',
|
|
32
|
-
'ring': '#
|
|
33
|
-
'primary': '#
|
|
37
|
+
'ring': '#0989aa',
|
|
38
|
+
'primary': '#0989aa',
|
|
34
39
|
'primary-foreground': '#ffffff',
|
|
35
40
|
'secondary': '#f5f5f5',
|
|
36
41
|
'secondary-foreground': '#171717',
|
|
37
|
-
'accent': '#
|
|
42
|
+
'accent': '#eaf7fa',
|
|
38
43
|
'accent-foreground': '#171717',
|
|
39
44
|
'destructive': '#ef4444',
|
|
40
45
|
'destructive-foreground': '#ffffff',
|
|
41
|
-
'chart-1': '#
|
|
46
|
+
'chart-1': '#0989aa',
|
|
42
47
|
'chart-2': '#22c55e',
|
|
43
48
|
'chart-3': '#8b5cf6',
|
|
44
49
|
'chart-4': '#f59e0b',
|
|
@@ -125,7 +130,7 @@ export function useThemePalette(): ThemePalette {
|
|
|
125
130
|
successForeground: '#ffffff',
|
|
126
131
|
warning: getCssColorAsHex('chart-4'), // Orange
|
|
127
132
|
warningForeground: '#ffffff',
|
|
128
|
-
info: getCssColorAsHex('chart-1'), //
|
|
133
|
+
info: getCssColorAsHex('chart-1'), // Brand / primary hue
|
|
129
134
|
infoForeground: '#ffffff',
|
|
130
135
|
|
|
131
136
|
// Chart colors
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Parse HSL string from CSS variable (e.g., "
|
|
7
|
+
* Parse HSL string from CSS variable (e.g., "192 90% 35%" for light `--primary`) to components
|
|
8
8
|
*/
|
|
9
9
|
function parseHslString(hsl: string): { h: number; s: number; l: number } | null {
|
|
10
10
|
const match = hsl.trim().match(/^(\d+)\s+(\d+)%\s+(\d+)%$/);
|
|
@@ -53,8 +53,8 @@ function rgbToHex(r: number, g: number, b: number): string {
|
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Convert CSS HSL variable value to hex
|
|
56
|
-
* Input: "
|
|
57
|
-
* Output: "#
|
|
56
|
+
* Input: "192 90% 35%" (from CSS --primary in light theme)
|
|
57
|
+
* Output: "#0989aa"
|
|
58
58
|
*/
|
|
59
59
|
export function hslToHex(hslString: string): string {
|
|
60
60
|
const parsed = parseHslString(hslString);
|
|
@@ -66,7 +66,7 @@ export function hslToHex(hslString: string): string {
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* Convert CSS HSL variable value to rgb() string
|
|
69
|
-
* Input: "
|
|
69
|
+
* Input: "192 90% 35%"
|
|
70
70
|
* Output: "rgb(59, 130, 246)"
|
|
71
71
|
*/
|
|
72
72
|
export function hslToRgbString(hslString: string): string {
|
|
@@ -79,7 +79,7 @@ export function hslToRgbString(hslString: string): string {
|
|
|
79
79
|
|
|
80
80
|
/**
|
|
81
81
|
* Convert CSS HSL variable value to rgba() string with opacity
|
|
82
|
-
* Input: "
|
|
82
|
+
* Input: "192 90% 35%", 0.2
|
|
83
83
|
* Output: "rgba(59, 130, 246, 0.2)"
|
|
84
84
|
*/
|
|
85
85
|
export function hslToRgba(hslString: string, alpha: number): string {
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Dark Theme Colors
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Same brand as light: #00d9ff → `189 100% 50%`.
|
|
5
|
+
*
|
|
6
|
+
* Semantic pairs (do not split ad hoc in components):
|
|
7
|
+
* - --primary / --primary-foreground — filled CTAs. On dark UI the brand #00d9ff is bright enough
|
|
8
|
+
* that **dark ink** (same as light :root --foreground) reads better than white (WCAG + legibility).
|
|
9
|
+
* - --secondary / --secondary-foreground — neutral filled controls on dark chrome (elevated gray +
|
|
10
|
+
* light text), not a light-theme secondary pasted onto .dark.
|
|
11
|
+
*
|
|
12
|
+
* Tuning contrast: adjust HSL together; avoid setting text color per button in React — use tokens.
|
|
6
13
|
*/
|
|
7
14
|
|
|
8
15
|
.dark {
|
|
@@ -13,37 +20,41 @@
|
|
|
13
20
|
--card-foreground: 0 0% 98%;
|
|
14
21
|
--popover: 0 0% 12%;
|
|
15
22
|
--popover-foreground: 0 0% 98%;
|
|
16
|
-
|
|
17
|
-
--primary
|
|
18
|
-
|
|
19
|
-
--
|
|
23
|
+
/* Exact brand: #00d9ff (same HSL as :root light primary) */
|
|
24
|
+
--primary: 189 100% 50%;
|
|
25
|
+
/* Dark label on bright cyan — stronger contrast than white on #00d9ff */
|
|
26
|
+
--primary-foreground: 0 0% 9%;
|
|
27
|
+
/* Secondary: dark elevated surface + light label (matches typical shadcn dark “secondary” role) */
|
|
28
|
+
--secondary: 0 0% 16%;
|
|
29
|
+
--secondary-foreground: 0 0% 96%;
|
|
20
30
|
--muted: 0 0% 10%;
|
|
21
31
|
--muted-foreground: 0 0% 60%;
|
|
22
|
-
|
|
32
|
+
/* Cyan-tinted elevated surface */
|
|
33
|
+
--accent: 189 18% 17%;
|
|
23
34
|
--accent-foreground: 0 0% 98%;
|
|
24
35
|
--destructive: 0 84% 60%;
|
|
25
36
|
--destructive-foreground: 0 0% 98%;
|
|
26
37
|
--border: 0 0% 15%;
|
|
27
38
|
--input: 0 0% 15%;
|
|
28
|
-
--ring:
|
|
39
|
+
--ring: 189 100% 50%;
|
|
29
40
|
|
|
30
41
|
/* Sidebar Dark Theme - Darker black sidebar */
|
|
31
42
|
--sidebar-background: 0 0% 0%;
|
|
32
43
|
--sidebar-foreground: 0 0% 98%;
|
|
33
|
-
--sidebar-primary:
|
|
34
|
-
--sidebar-primary-foreground: 0 0%
|
|
35
|
-
--sidebar-accent:
|
|
44
|
+
--sidebar-primary: 189 100% 50%;
|
|
45
|
+
--sidebar-primary-foreground: 0 0% 9%;
|
|
46
|
+
--sidebar-accent: 189 14% 12%;
|
|
36
47
|
--sidebar-accent-foreground: 0 0% 98%;
|
|
37
48
|
--sidebar-border: 0 0% 15%;
|
|
38
|
-
--sidebar-ring:
|
|
49
|
+
--sidebar-ring: 189 100% 50%;
|
|
39
50
|
|
|
40
51
|
/* Surface gradient dark */
|
|
41
52
|
--surface-gradient: linear-gradient(to bottom, hsl(var(--background)), hsl(var(--background) / 0.8));
|
|
42
53
|
|
|
43
|
-
/* Chart colors -
|
|
44
|
-
--chart-1:
|
|
45
|
-
--chart-2: 142 76% 36%;
|
|
46
|
-
--chart-3: 262 83% 58%;
|
|
47
|
-
--chart-4: 26 90% 57%;
|
|
48
|
-
--chart-5: 346 77% 50%;
|
|
54
|
+
/* Chart colors — chart-1 aligned with brand */
|
|
55
|
+
--chart-1: 189 100% 50%;
|
|
56
|
+
--chart-2: 142 76% 36%;
|
|
57
|
+
--chart-3: 262 83% 58%;
|
|
58
|
+
--chart-4: 26 90% 57%;
|
|
59
|
+
--chart-5: 346 77% 50%;
|
|
49
60
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Light Theme Colors
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Marketing / dark UI can use bright cyan `#00d9ff`. On **white** backgrounds, that neon with white
|
|
5
|
+
* label fails contrast and looks harsh—so `:root` `--primary` is a **deeper blue-cyan** (same family,
|
|
6
|
+
* lower L + slightly bluer hue) for buttons, links, and `text-primary`. Dark theme keeps the bright
|
|
7
|
+
* swatch via `.dark`.
|
|
8
|
+
*
|
|
9
|
+
* Pairs `--primary` / `--primary-foreground` are tuned together. Prefer editing tokens over ad hoc classes.
|
|
6
10
|
*/
|
|
7
11
|
|
|
8
12
|
:root {
|
|
@@ -13,38 +17,40 @@
|
|
|
13
17
|
--card-foreground: 0 0% 9%;
|
|
14
18
|
--popover: 0 0% 100%;
|
|
15
19
|
--popover-foreground: 0 0% 9%;
|
|
16
|
-
|
|
20
|
+
/* Interactive primary on white (~#0989aa): readable white-on-fill + calmer than neon */
|
|
21
|
+
--primary: 192 90% 35%;
|
|
17
22
|
--primary-foreground: 0 0% 100%;
|
|
18
23
|
--secondary: 0 0% 9%;
|
|
19
24
|
--secondary-foreground: 0 0% 98%;
|
|
20
25
|
--muted: 0 0% 96%;
|
|
21
26
|
--muted-foreground: 0 0% 45%;
|
|
22
|
-
|
|
27
|
+
/* Subtle cyan-tinted hover surface (not gray-only) */
|
|
28
|
+
--accent: 192 18% 94%;
|
|
23
29
|
--accent-foreground: 0 0% 9%;
|
|
24
30
|
--destructive: 0 84% 60%;
|
|
25
31
|
--destructive-foreground: 0 0% 98%;
|
|
26
32
|
--border: 0 0% 90%;
|
|
27
33
|
--input: 0 0% 90%;
|
|
28
|
-
--ring:
|
|
34
|
+
--ring: 192 90% 35%;
|
|
29
35
|
--radius: 0.5rem;
|
|
30
36
|
|
|
31
37
|
/* Sidebar Light Theme - Subtle gray background */
|
|
32
38
|
--sidebar-background: 0 0% 98%;
|
|
33
39
|
--sidebar-foreground: 0 0% 9%;
|
|
34
|
-
--sidebar-primary:
|
|
40
|
+
--sidebar-primary: 192 90% 35%;
|
|
35
41
|
--sidebar-primary-foreground: 0 0% 100%;
|
|
36
|
-
--sidebar-accent:
|
|
42
|
+
--sidebar-accent: 189 16% 95%;
|
|
37
43
|
--sidebar-accent-foreground: 0 0% 9%;
|
|
38
44
|
--sidebar-border: 0 0% 90%;
|
|
39
|
-
--sidebar-ring:
|
|
45
|
+
--sidebar-ring: 192 90% 35%;
|
|
40
46
|
|
|
41
47
|
/* Surface gradient */
|
|
42
48
|
--surface-gradient: linear-gradient(to bottom, hsl(var(--background)), hsl(var(--background) / 0.8));
|
|
43
49
|
|
|
44
|
-
/* Chart colors -
|
|
45
|
-
--chart-1:
|
|
46
|
-
--chart-2: 142 76% 36%;
|
|
47
|
-
--chart-3: 262 83% 58%;
|
|
48
|
-
--chart-4: 26 90% 57%;
|
|
49
|
-
--chart-5: 346 77% 50%;
|
|
50
|
+
/* Chart colors — chart-1 aligned with brand hue */
|
|
51
|
+
--chart-1: 192 90% 35%;
|
|
52
|
+
--chart-2: 142 76% 36%;
|
|
53
|
+
--chart-3: 262 83% 58%;
|
|
54
|
+
--chart-4: 26 90% 57%;
|
|
55
|
+
--chart-5: 346 77% 50%;
|
|
50
56
|
}
|