@djangocfg/ui-core 2.1.510 → 2.1.512
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.512",
|
|
4
4
|
"description": "Pure React UI component library without Next.js dependencies - for Electron, Vite, CRA apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui-components",
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"check:contrast": "node scripts/check-preset-contrast.mjs"
|
|
129
129
|
},
|
|
130
130
|
"peerDependencies": {
|
|
131
|
-
"@djangocfg/i18n": "^2.1.
|
|
131
|
+
"@djangocfg/i18n": "^2.1.512",
|
|
132
132
|
"consola": "^3.4.2",
|
|
133
133
|
"lucide-react": "^0.545.0",
|
|
134
134
|
"moment": "^2.30.1",
|
|
@@ -206,8 +206,8 @@
|
|
|
206
206
|
"@chenglou/pretext": "^0.0.8"
|
|
207
207
|
},
|
|
208
208
|
"devDependencies": {
|
|
209
|
-
"@djangocfg/i18n": "^2.1.
|
|
210
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
209
|
+
"@djangocfg/i18n": "^2.1.512",
|
|
210
|
+
"@djangocfg/typescript-config": "^2.1.512",
|
|
211
211
|
"@types/node": "^24.13.3",
|
|
212
212
|
"@types/react": "19.2.15",
|
|
213
213
|
"@types/react-dom": "19.2.3",
|
|
@@ -12,7 +12,14 @@ const Switch = React.forwardRef<
|
|
|
12
12
|
>(({ className, ...props }, ref) => (
|
|
13
13
|
<SwitchPrimitives.Root
|
|
14
14
|
className={cn(
|
|
15
|
-
|
|
15
|
+
// Track: generous Cloudflare-style pill (44×24) with an inset thumb.
|
|
16
|
+
"peer group relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full",
|
|
17
|
+
"p-0.5 outline-none transition-colors duration-200 ease-out",
|
|
18
|
+
// On/off surfaces — all on-token so every preset & theme follows along.
|
|
19
|
+
"data-[state=unchecked]:bg-input data-[state=checked]:bg-primary",
|
|
20
|
+
// Focus ring sits outside the pill with an offset gap (matches Cloudflare's selected state).
|
|
21
|
+
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
22
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
16
23
|
className
|
|
17
24
|
)}
|
|
18
25
|
{...props}
|
|
@@ -20,7 +27,11 @@ const Switch = React.forwardRef<
|
|
|
20
27
|
>
|
|
21
28
|
<SwitchPrimitives.Thumb
|
|
22
29
|
className={cn(
|
|
23
|
-
"pointer-events-none block h-
|
|
30
|
+
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-md ring-0",
|
|
31
|
+
"transition-transform duration-200 ease-out",
|
|
32
|
+
"data-[state=unchecked]:translate-x-0 data-[state=checked]:translate-x-5",
|
|
33
|
+
// Subtle press-in feel on active, like the CF thumb.
|
|
34
|
+
"group-active:scale-95"
|
|
24
35
|
)}
|
|
25
36
|
/>
|
|
26
37
|
</SwitchPrimitives.Root>
|
|
@@ -15,9 +15,24 @@ const PopoverAnchor = PopoverPrimitive.Anchor
|
|
|
15
15
|
const PopoverContent = React.forwardRef<
|
|
16
16
|
React.ElementRef<typeof PopoverPrimitive.Content>,
|
|
17
17
|
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
|
|
18
|
-
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
|
|
19
|
-
|
|
18
|
+
>(({ className, align = "center", sideOffset = 4, forceMount, ...props }, ref) => (
|
|
19
|
+
// `forceMount` must reach BOTH halves, and that is the whole reason it is
|
|
20
|
+
// destructured rather than swept up by `...props` (live 2026-08-15).
|
|
21
|
+
//
|
|
22
|
+
// Radix declares it on `Portal` AND on `Content`, and the Portal is the outer
|
|
23
|
+
// one: with it only on Content, the Portal still unmounts on close and takes
|
|
24
|
+
// the subtree — including any <audio>/<video> element — with it. A cmdop
|
|
25
|
+
// status-bar player mounted in a popover therefore went SILENT the moment the
|
|
26
|
+
// panel closed, and no amount of `forceMount` on the content could stop it,
|
|
27
|
+
// because that content no longer had a portal to live in.
|
|
28
|
+
//
|
|
29
|
+
// Passing it to both keeps the DOM alive while closed; Radix then leaves the
|
|
30
|
+
// `data-state="closed"` attribute for the caller to style (the built-in
|
|
31
|
+
// fade/zoom classes below already key off it), so nothing changes visually for
|
|
32
|
+
// the callers that do not opt in.
|
|
33
|
+
<PopoverPrimitive.Portal forceMount={forceMount}>
|
|
20
34
|
<PopoverPrimitive.Content
|
|
35
|
+
forceMount={forceMount}
|
|
21
36
|
ref={ref}
|
|
22
37
|
aria-describedby={undefined}
|
|
23
38
|
align={align}
|