@djangocfg/ui-core 2.1.463 → 2.1.465
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 +44 -44
- package/src/components/navigation/menu/render-items.tsx +5 -0
- package/src/components/navigation/menu/types.ts +5 -0
- package/src/styles/README.md +82 -1
- package/src/styles/css/sources.css +2 -1
- package/src/styles/css/theme/dark.css +2 -0
- package/src/styles/css/theme/light.css +4 -0
- package/src/styles/css/theme/tokens.css +1 -0
- package/src/styles/css/utilities/controls.css +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/ui-core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.465",
|
|
4
4
|
"description": "Pure React UI component library without Next.js dependencies - for Electron, Vite, CRA apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui-components",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"check": "tsc --noEmit"
|
|
128
128
|
},
|
|
129
129
|
"peerDependencies": {
|
|
130
|
-
"@djangocfg/i18n": "^2.1.
|
|
130
|
+
"@djangocfg/i18n": "^2.1.465",
|
|
131
131
|
"consola": "^3.4.2",
|
|
132
132
|
"lucide-react": "^0.545.0",
|
|
133
133
|
"moment": "^2.30.1",
|
|
@@ -150,68 +150,68 @@
|
|
|
150
150
|
}
|
|
151
151
|
},
|
|
152
152
|
"dependencies": {
|
|
153
|
-
"@hookform/resolvers": "^5.
|
|
154
|
-
"@radix-ui/react-accordion": "^1.2.
|
|
155
|
-
"@radix-ui/react-alert-dialog": "^1.1.
|
|
156
|
-
"@radix-ui/react-aspect-ratio": "^1.1.
|
|
157
|
-
"@radix-ui/react-avatar": "^1.
|
|
158
|
-
"@radix-ui/react-checkbox": "^1.3.
|
|
159
|
-
"@radix-ui/react-collapsible": "^1.1.
|
|
160
|
-
"@radix-ui/react-context-menu": "^2.
|
|
161
|
-
"@radix-ui/react-dialog": "^1.1.
|
|
162
|
-
"@radix-ui/react-dropdown-menu": "^2.1.
|
|
163
|
-
"@radix-ui/react-hover-card": "^1.1.
|
|
153
|
+
"@hookform/resolvers": "^5.4.0",
|
|
154
|
+
"@radix-ui/react-accordion": "^1.2.16",
|
|
155
|
+
"@radix-ui/react-alert-dialog": "^1.1.19",
|
|
156
|
+
"@radix-ui/react-aspect-ratio": "^1.1.11",
|
|
157
|
+
"@radix-ui/react-avatar": "^1.2.2",
|
|
158
|
+
"@radix-ui/react-checkbox": "^1.3.7",
|
|
159
|
+
"@radix-ui/react-collapsible": "^1.1.16",
|
|
160
|
+
"@radix-ui/react-context-menu": "^2.3.3",
|
|
161
|
+
"@radix-ui/react-dialog": "^1.1.19",
|
|
162
|
+
"@radix-ui/react-dropdown-menu": "^2.1.20",
|
|
163
|
+
"@radix-ui/react-hover-card": "^1.1.19",
|
|
164
164
|
"@radix-ui/react-icons": "^1.3.2",
|
|
165
|
-
"@radix-ui/react-label": "^2.1.
|
|
166
|
-
"@radix-ui/react-menubar": "^1.1.
|
|
167
|
-
"@radix-ui/react-navigation-menu": "^1.2.
|
|
168
|
-
"@radix-ui/react-popover": "^1.1.
|
|
169
|
-
"@radix-ui/react-progress": "^1.1.
|
|
170
|
-
"@radix-ui/react-radio-group": "^1.3
|
|
171
|
-
"@radix-ui/react-scroll-area": "^1.2.
|
|
172
|
-
"@radix-ui/react-select": "^2.
|
|
173
|
-
"@radix-ui/react-separator": "^1.1.
|
|
174
|
-
"@radix-ui/react-slider": "^1.3
|
|
175
|
-
"@radix-ui/react-slot": "^1.
|
|
176
|
-
"@radix-ui/react-switch": "^1.
|
|
177
|
-
"@radix-ui/react-tabs": "^1.1.
|
|
178
|
-
"@radix-ui/react-toast": "^1.2.
|
|
179
|
-
"@radix-ui/react-toggle": "^1.1.
|
|
180
|
-
"@radix-ui/react-toggle-group": "^1.1.
|
|
181
|
-
"@radix-ui/react-tooltip": "^1.2.
|
|
182
|
-
"@web3icons/react": "^4.
|
|
165
|
+
"@radix-ui/react-label": "^2.1.11",
|
|
166
|
+
"@radix-ui/react-menubar": "^1.1.20",
|
|
167
|
+
"@radix-ui/react-navigation-menu": "^1.2.18",
|
|
168
|
+
"@radix-ui/react-popover": "^1.1.19",
|
|
169
|
+
"@radix-ui/react-progress": "^1.1.12",
|
|
170
|
+
"@radix-ui/react-radio-group": "^1.4.3",
|
|
171
|
+
"@radix-ui/react-scroll-area": "^1.2.14",
|
|
172
|
+
"@radix-ui/react-select": "^2.3.3",
|
|
173
|
+
"@radix-ui/react-separator": "^1.1.11",
|
|
174
|
+
"@radix-ui/react-slider": "^1.4.3",
|
|
175
|
+
"@radix-ui/react-slot": "^1.3.0",
|
|
176
|
+
"@radix-ui/react-switch": "^1.3.3",
|
|
177
|
+
"@radix-ui/react-tabs": "^1.1.17",
|
|
178
|
+
"@radix-ui/react-toast": "^1.2.19",
|
|
179
|
+
"@radix-ui/react-toggle": "^1.1.14",
|
|
180
|
+
"@radix-ui/react-toggle-group": "^1.1.15",
|
|
181
|
+
"@radix-ui/react-tooltip": "^1.2.12",
|
|
182
|
+
"@web3icons/react": "^4.1.17",
|
|
183
183
|
"class-variance-authority": "^0.7.1",
|
|
184
184
|
"clsx": "^2.1.1",
|
|
185
185
|
"cmdk": "1.1.1",
|
|
186
|
-
"countries-list": "^3.
|
|
187
|
-
"country-flag-icons": "^1.6.
|
|
188
|
-
"date-fns": "^4.
|
|
186
|
+
"countries-list": "^3.4.0",
|
|
187
|
+
"country-flag-icons": "^1.6.20",
|
|
188
|
+
"date-fns": "^4.4.0",
|
|
189
189
|
"embla-carousel-react": "8.6.0",
|
|
190
190
|
"i18n-iso-countries": "^7.14.0",
|
|
191
191
|
"input-otp": "1.4.2",
|
|
192
|
-
"libphonenumber-js": "^1.
|
|
192
|
+
"libphonenumber-js": "^1.13.8",
|
|
193
193
|
"next-themes": "^0.4.6",
|
|
194
194
|
"nextjs-toploader": "^3.9.17",
|
|
195
195
|
"react-day-picker": "9.11.1",
|
|
196
|
-
"react-hotkeys-hook": "^4.6.
|
|
196
|
+
"react-hotkeys-hook": "^4.6.2",
|
|
197
197
|
"react-resizable-panels": "3.0.6",
|
|
198
198
|
"react-sticky-box": "^2.0.5",
|
|
199
199
|
"recharts": "2.15.4",
|
|
200
200
|
"sonner": "2.0.7",
|
|
201
|
-
"tailwind-merge": "^3.
|
|
201
|
+
"tailwind-merge": "^3.6.0",
|
|
202
202
|
"vaul": "1.1.2"
|
|
203
203
|
},
|
|
204
204
|
"optionalDependencies": {
|
|
205
|
-
"@chenglou/pretext": "
|
|
205
|
+
"@chenglou/pretext": "^0.0.8"
|
|
206
206
|
},
|
|
207
207
|
"devDependencies": {
|
|
208
|
-
"@djangocfg/i18n": "^2.1.
|
|
209
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
210
|
-
"@types/node": "^25.
|
|
211
|
-
"@types/react": "
|
|
212
|
-
"@types/react-dom": "
|
|
208
|
+
"@djangocfg/i18n": "^2.1.465",
|
|
209
|
+
"@djangocfg/typescript-config": "^2.1.465",
|
|
210
|
+
"@types/node": "^25.9.5",
|
|
211
|
+
"@types/react": "19.2.15",
|
|
212
|
+
"@types/react-dom": "19.2.3",
|
|
213
213
|
"lucide-react": "^0.545.0",
|
|
214
|
-
"next": "^16.2.
|
|
214
|
+
"next": "^16.2.10",
|
|
215
215
|
"typescript": "^5.9.3"
|
|
216
216
|
},
|
|
217
217
|
"publishConfig": {
|
|
@@ -123,6 +123,11 @@ export function renderItems(
|
|
|
123
123
|
key={option.id}
|
|
124
124
|
value={option.value}
|
|
125
125
|
disabled={option.disabled}
|
|
126
|
+
onSelect={(event) => {
|
|
127
|
+
// closeOnSelect=false → keep the menu open so the selection
|
|
128
|
+
// can reveal more of the same menu (e.g. an engine preview).
|
|
129
|
+
if (item.closeOnSelect === false) event.preventDefault();
|
|
130
|
+
}}
|
|
126
131
|
>
|
|
127
132
|
<MenuIndicatorRow
|
|
128
133
|
icon={option.icon}
|
|
@@ -66,6 +66,11 @@ export interface MenuRadioGroup {
|
|
|
66
66
|
value: string;
|
|
67
67
|
onValueChange: (value: string) => void;
|
|
68
68
|
options: MenuRadioOption[];
|
|
69
|
+
/** Keep the menu OPEN after a selection (default: false = close, Radix's
|
|
70
|
+
* default). Use for a radio group whose pick reveals more of the SAME menu
|
|
71
|
+
* (e.g. an engine row that previews that engine's models below it) rather
|
|
72
|
+
* than being a terminal choice. */
|
|
73
|
+
closeOnSelect?: boolean;
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
/** Visual divider. */
|
package/src/styles/README.md
CHANGED
|
@@ -37,6 +37,9 @@ styles/
|
|
|
37
37
|
There are deliberately no TypeScript color maps and no runtime CSS generator.
|
|
38
38
|
Do not add a second palette in React or TypeScript.
|
|
39
39
|
|
|
40
|
+
`styles/presets/` contains only the TypeScript preset names and ordering used by
|
|
41
|
+
the public API. The actual values always live in `styles/css/presets/*.css`.
|
|
42
|
+
|
|
40
43
|
## Consumer contract
|
|
41
44
|
|
|
42
45
|
Import the golden path first, then exactly one product preset:
|
|
@@ -62,6 +65,69 @@ For a product-specific adjustment, add a small override after the preset:
|
|
|
62
65
|
Do not create a `theme-preset.ts`, append a `<style>` tag, or call a token
|
|
63
66
|
builder during application startup.
|
|
64
67
|
|
|
68
|
+
### Import order
|
|
69
|
+
|
|
70
|
+
Keep the application entrypoint minimal and deterministic:
|
|
71
|
+
|
|
72
|
+
```css
|
|
73
|
+
@import "@djangocfg/ui-core/styles/full";
|
|
74
|
+
@plugin "tailwindcss-animate";
|
|
75
|
+
@import "@djangocfg/ui-core/styles/presets/macos";
|
|
76
|
+
@import "@djangocfg/layouts/styles";
|
|
77
|
+
@import "@djangocfg/ui-tools/styles";
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`full.css` already imports Tailwind, the theme tokens, base styles, and
|
|
81
|
+
ui-core utilities. Do not add a second `@import "tailwindcss"`, `base.css`,
|
|
82
|
+
or `utilities.css` in the consumer. Load the preset after `full.css`, so its
|
|
83
|
+
`:root` and `.dark` variables win over defaults. Keep application overrides
|
|
84
|
+
after the preset.
|
|
85
|
+
|
|
86
|
+
The `tailwindcss-animate` plugin is registered once by the consumer. It
|
|
87
|
+
provides classes such as `animate-in`, `fade-in-0`, and `zoom-in-95`; the
|
|
88
|
+
package's component source uses those classes but does not register the
|
|
89
|
+
plugin itself.
|
|
90
|
+
|
|
91
|
+
### Tailwind source scanning
|
|
92
|
+
|
|
93
|
+
`css/sources.css` is part of the `full` entry and must scan the package source
|
|
94
|
+
root from its own location:
|
|
95
|
+
|
|
96
|
+
```css
|
|
97
|
+
@source "../../**/*.{ts,tsx}";
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
This is important. Scanning only `../` scans `src/styles` and silently drops
|
|
101
|
+
utilities used by components, including `bg-overlay` and state/animation
|
|
102
|
+
utilities. A consumer may add extra `@source` directives for local packages,
|
|
103
|
+
but should not replace the ui-core source directive.
|
|
104
|
+
|
|
105
|
+
### Overlays and glass surfaces
|
|
106
|
+
|
|
107
|
+
Dialog, alert-dialog, sheet, and drawer backdrops use the semantic
|
|
108
|
+
`bg-overlay` class. The class gets its color from `--overlay` and its frosting
|
|
109
|
+
from `--overlay-blur` (the default is `5px`):
|
|
110
|
+
|
|
111
|
+
```css
|
|
112
|
+
.bg-overlay {
|
|
113
|
+
background: var(--overlay);
|
|
114
|
+
backdrop-filter: blur(var(--overlay-blur));
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Glass surfaces must have a translucent background; an opaque `bg-card` or
|
|
119
|
+
`bg-popover` makes the blur invisible. A dropdown rendered inside an ancestor
|
|
120
|
+
that already has `backdrop-filter` is also unable to blur the page behind that
|
|
121
|
+
ancestor because it becomes a backdrop root. PublicLayout desktop dropdowns
|
|
122
|
+
are therefore rendered through a body portal and positioned from the trigger.
|
|
123
|
+
Use the same pattern for new floating surfaces that must blur content outside
|
|
124
|
+
their parent stacking context.
|
|
125
|
+
|
|
126
|
+
For custom glass utilities, prefer a Tailwind utility such as
|
|
127
|
+
`backdrop-blur-[5px]` when the consuming build must emit the standard
|
|
128
|
+
`backdrop-filter` declaration. Keep the visual token (`--overlay-blur`) in
|
|
129
|
+
CSS rather than duplicating a pixel value in React.
|
|
130
|
+
|
|
65
131
|
## Token format
|
|
66
132
|
|
|
67
133
|
Color variables are complete CSS colors, never bare HSL triplets:
|
|
@@ -86,7 +152,7 @@ Typography variables are ordinary CSS values:
|
|
|
86
152
|
|
|
87
153
|
## Preset rules
|
|
88
154
|
|
|
89
|
-
- Presets are authored directly in `
|
|
155
|
+
- Presets are authored directly in `styles/css/presets/`.
|
|
90
156
|
- Every preset must define valid `hsl(...)`, `color-mix(...)`, or other complete
|
|
91
157
|
CSS color values.
|
|
92
158
|
- Keep light and dark pairs together in the same file.
|
|
@@ -104,3 +170,18 @@ pnpm check
|
|
|
104
170
|
At the consumer, build the app that imports the preset and verify both modes.
|
|
105
171
|
The important invariant is that changing a preset requires editing one CSS
|
|
106
172
|
file, and no React runtime code is involved in applying it.
|
|
173
|
+
|
|
174
|
+
For a local cross-repository change, use the consumer's sync command and
|
|
175
|
+
restart its dev server afterward:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
pnpm sync:cfg:one ui-core
|
|
179
|
+
pnpm sync:cfg:one layouts
|
|
180
|
+
pnpm sync:cfg:one i18n # required peer when ui-core is synced locally
|
|
181
|
+
rm -rf apps/web/.next
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Do not delete `pnpm-lock.yaml` to force a package update. Update the package
|
|
185
|
+
range with pnpm, then let the lockfile record the resolved version. A clean
|
|
186
|
+
install restores published packages and therefore requires publishing a new
|
|
187
|
+
package version for source changes to survive.
|
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
/* Recessed surface — below the page (Claude bg-200), for input rest / chips. */
|
|
35
35
|
--muted: hsl(30 3.3% 11.8%);
|
|
36
36
|
--muted-foreground: hsl(48 5% 59%);
|
|
37
|
+
/* Neutral interaction surface: a quiet lift above the current dark page. */
|
|
38
|
+
--surface-hover: color-mix(in oklab, var(--card) 96%, var(--foreground));
|
|
37
39
|
/* Hover/active surface (rails, menus, tabs) — a quiet warm lift above the page. */
|
|
38
40
|
--accent: hsl(48 3% 24%);
|
|
39
41
|
--accent-foreground: hsl(48 33% 97%);
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
--secondary-foreground: hsl(0 0% 98%);
|
|
25
25
|
--muted: hsl(0 0% 96%);
|
|
26
26
|
--muted-foreground: hsl(0 0% 45%);
|
|
27
|
+
/* Neutral interaction surface: a quiet step below the current light canvas.
|
|
28
|
+
* It deliberately keys off --background, not white --card, so hover remains
|
|
29
|
+
* visible on translucent menus and on plain pages alike. */
|
|
30
|
+
--surface-hover: color-mix(in oklab, var(--background) 96%, var(--foreground));
|
|
27
31
|
/* Neutral hover/active surface — quiet gray lift, no hue tint
|
|
28
32
|
* (Claude/macOS settings convention). */
|
|
29
33
|
--accent: hsl(0 0% 94%);
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
--color-secondary-foreground: var(--secondary-foreground);
|
|
39
39
|
--color-muted: var(--muted);
|
|
40
40
|
--color-muted-foreground: var(--muted-foreground);
|
|
41
|
+
--color-surface-hover: var(--surface-hover);
|
|
41
42
|
--color-accent: var(--accent);
|
|
42
43
|
--color-accent-foreground: var(--accent-foreground);
|
|
43
44
|
--color-destructive: var(--destructive);
|