@vendure-io/ui 2.0.0-beta.19 → 2.0.0-beta.20
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": "@vendure-io/ui",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.20",
|
|
4
4
|
"description": "React component library for Vendure, built on shadcn/ui and Tailwind v4",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"homepage": "https://github.com/vendurehq/design/tree/main/packages/ui",
|
|
@@ -72,7 +72,7 @@ function ToggleGroupItem({
|
|
|
72
72
|
data-size={context.size || size}
|
|
73
73
|
data-spacing={context.spacing}
|
|
74
74
|
className={cn(
|
|
75
|
-
// Base UI's Toggle emits data-pressed, never Radix's data-[state=on] — the pressed style comes from toggleVariants via its aria-pressed
|
|
75
|
+
// Base UI's Toggle emits data-pressed, never Radix's data-[state=on] — the pressed style comes from toggleVariants via its aria-pressed and data-pressed rules
|
|
76
76
|
"shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-[spacing=0]/toggle-group:shadow-none focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",
|
|
77
77
|
toggleVariants({
|
|
78
78
|
variant: context.variant || variant,
|
|
@@ -6,12 +6,15 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
|
6
6
|
import { cn } from "@vendure-io/ui/lib/utils"
|
|
7
7
|
|
|
8
8
|
const toggleVariants = cva(
|
|
9
|
-
|
|
9
|
+
// Pressed uses the solid primary pair, like checked Checkbox, Radio and
|
|
10
|
+
// Switch: bg-muted was the hover shade and nearly vanished on dark overlays.
|
|
11
|
+
// Base UI sets both aria-pressed and data-pressed; both are styled.
|
|
12
|
+
"hover:text-foreground aria-pressed:bg-primary aria-pressed:text-primary-foreground aria-pressed:hover:bg-primary/80 aria-pressed:hover:text-primary-foreground data-pressed:bg-primary data-pressed:text-primary-foreground data-pressed:hover:bg-primary/80 data-pressed:hover:text-primary-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive gap-1 rounded-md text-sm font-medium transition-[color,box-shadow] [&_svg:not([class*='size-'])]:size-4 group/toggle hover:bg-muted inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
10
13
|
{
|
|
11
14
|
variants: {
|
|
12
15
|
variant: {
|
|
13
16
|
default: "bg-transparent",
|
|
14
|
-
outline: "border-input hover:bg-muted border bg-transparent",
|
|
17
|
+
outline: "border-input hover:bg-muted aria-pressed:border-primary data-pressed:border-primary border bg-transparent",
|
|
15
18
|
},
|
|
16
19
|
size: {
|
|
17
20
|
default: "h-9 min-w-9 px-2",
|