PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.4.21
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.4.21
1.4.22 1.4.21 1.4.20 1.4.19 1.4.18 1.4.17 1.4.16 1.4.15 1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 All 185 releases
← All changes | backend/views/components/Analytics/components/ui/badge.jsx +41 -43 1.4.13 → 1.4.21 View file →
@@ -1,49 +1,47 @@
1 -import { mergeProps } from "@base-ui/react/merge-props"
2 -import { useRender } from "@base-ui/react/use-render"
3 -import { cva } from "class-variance-authority";
1 +import { mergeProps } from '@base-ui/react/merge-props';
2 +import { useRender } from '@base-ui/react/use-render';
3 +import { cva } from 'class-variance-authority';
4 4
5 -import { cn } from "@/lib/utils"
5 +import { cn } from '@/lib/utils';
6 6
7 7 const badgeVariants = cva(
8 - "disco-group/badge disco-inline-flex disco-h-5 disco-w-fit disco-shrink-0 disco-items-center disco-justify-center disco-gap-1 disco-overflow-hidden disco-rounded-4xl disco-border disco-border-transparent disco-px-2 disco-py-0.5 disco-text-xs disco-font-medium disco-whitespace-nowrap disco-transition-all focus-visible:disco-border-ring focus-visible:disco-ring-[3px] focus-visible:disco-ring-ring/50 has-data-[icon=inline-end]:disco-pr-1.5 has-data-[icon=inline-start]:disco-pl-1.5 aria-invalid:disco-border-destructive aria-invalid:disco-ring-destructive/20 dark:aria-invalid:disco-ring-destructive/40 [&>svg]:disco-pointer-events-none [&>svg]:disco-size-3!",
9 - {
10 - variants: {
11 - variant: {
12 - default: "disco-bg-primary disco-text-primary-foreground [a]:hover:disco-bg-primary/80",
13 - secondary:
14 - "disco-bg-secondary disco-text-secondary-foreground [a]:hover:disco-bg-secondary/80",
15 - destructive:
16 - "disco-bg-destructive/10 disco-text-destructive focus-visible:disco-ring-destructive/20 dark:disco-bg-destructive/20 dark:focus-visible:disco-ring-destructive/40 [a]:hover:disco-bg-destructive/20",
17 - outline:
18 - "disco-border-border disco-text-foreground [a]:hover:disco-bg-muted [a]:hover:disco-text-muted-foreground",
19 - ghost:
20 - "hover:disco-bg-muted hover:disco-text-muted-foreground dark:hover:disco-bg-muted/50",
21 - link: "disco-text-primary disco-underline-offset-4 hover:disco-underline",
22 - },
23 - },
24 - defaultVariants: {
25 - variant: "default",
26 - },
27 - }
28 -)
8 + 'disco:group/badge disco:inline-flex disco:h-5 disco:w-fit disco:shrink-0 disco:items-center disco:justify-center disco:gap-1 disco:overflow-hidden disco:rounded-4xl disco:border disco:border-transparent disco:px-2 disco:py-0.5 disco:text-xs disco:font-medium disco:whitespace-nowrap disco:transition-all disco:focus-visible:border-ring disco:focus-visible:ring-[3px] disco:focus-visible:ring-ring/50 disco:has-data-[icon=inline-end]:pr-1.5 disco:has-data-[icon=inline-start]:pl-1.5 disco:aria-invalid:border-destructive disco:aria-invalid:ring-destructive/20 disco:dark:aria-invalid:ring-destructive/40 disco:[&>svg]:pointer-events-none disco:[&>svg]:size-3!',
9 + {
10 + variants: {
11 + variant: {
12 + default:
13 + ' disco:text-primary-foreground disco:[a]:hover:bg-primary/80',
14 + secondary:
15 + 'disco:bg-secondary disco:text-secondary-foreground disco:[a]:hover:bg-secondary/80',
16 + destructive:
17 + 'disco:bg-destructive/10 disco:text-destructive disco:focus-visible:ring-destructive/20 disco:dark:bg-destructive/20 disco:dark:focus-visible:ring-destructive/40 disco:[a]:hover:bg-destructive/20',
18 + outline:
19 + 'disco:border-border disco:text-foreground disco:[a]:hover:bg-muted disco:[a]:hover:text-muted-foreground',
20 + ghost: 'disco:hover:bg-muted disco:hover:text-muted-foreground disco:dark:hover:bg-muted/50',
21 + link: 'disco:text-primary disco:underline-offset-4 disco:hover:underline',
22 + },
23 + },
24 + defaultVariants: {
25 + variant: 'default',
26 + },
27 + }
28 +);
29 29
30 -function Badge({
31 - className,
32 - variant = "default",
33 - render,
34 - ...props
35 -}) {
36 - return useRender({
37 - defaultTagName: "span",
38 - props: mergeProps({
39 - className: cn(badgeVariants({ variant }), className),
40 - }, props),
41 - render,
42 - state: {
43 - slot: "badge",
44 - variant,
45 - },
46 - });
30 +function Badge({ className, variant = 'default', render, ...props }) {
31 + return useRender({
32 + defaultTagName: 'span',
33 + props: mergeProps(
34 + {
35 + className: cn(badgeVariants({ variant }), className),
36 + },
37 + props
38 + ),
39 + render,
40 + state: {
41 + slot: 'badge',
42 + variant,
43 + },
44 + });
47 45 }
48 46
49 -export { Badge, badgeVariants }
47 +export { Badge, badgeVariants };