← All changes
|
backend/views/components/Analytics/components/ui/calendar.jsx
+35
-35
1.4.0
→
1.4.21
View file →
| @@ -21,9 +21,9 @@ | ||
| 21 | 21 | return ( |
| 22 | 22 | <DayPicker |
| 23 | 23 | showOutsideDays={showOutsideDays} |
| 24 | 24 | className={cn( |
| 25 | - "disco-group/calendar disco-bg-background disco-p-2 disco-[--cell-radius:var(--radius-md)] disco-[--cell-size:--spacing(7)] in-data-[slot=card-content]:disco-bg-transparent in-data-[slot=popover-content]:disco-bg-transparent", | |
| 25 | + "disco:group/calendar disco:bg-background disco:p-2 disco:[--cell-radius:var(--radius-md)] disco:[--cell-size:--spacing(7)] disco:in-data-[slot=card-content]:bg-transparent disco:in-data-[slot=popover-content]:bg-transparent", | |
| 26 | 26 | String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, |
| 27 | 27 | String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, |
| 28 | 28 | className |
| 29 | 29 | )} |
| @@ -34,91 +34,91 @@ | ||
| 34 | 34 | date.toLocaleString(locale?.code, { month: "short" }), |
| 35 | 35 | ...formatters, |
| 36 | 36 | }} |
| 37 | 37 | classNames={{ |
| 38 | - root: cn("disco-w-fit", defaultClassNames.root), | |
| 38 | + root: cn("disco:w-fit", defaultClassNames.root), | |
| 39 | 39 | months: cn( |
| 40 | - "disco-relative disco-flex disco-flex-col disco-gap-4 md:disco-flex-row", | |
| 40 | + "disco:relative disco:flex disco:flex-col disco:gap-4 disco:md:flex-row", | |
| 41 | 41 | defaultClassNames.months |
| 42 | 42 | ), |
| 43 | 43 | month: cn( |
| 44 | - "disco-flex disco-w-full disco-flex-col disco-gap-4", | |
| 44 | + "disco:flex disco:w-full disco:flex-col disco:gap-4", | |
| 45 | 45 | defaultClassNames.month |
| 46 | 46 | ), |
| 47 | 47 | nav: cn( |
| 48 | - "disco-absolute disco-inset-x-0 disco-top-0 disco-flex disco-w-full disco-items-center disco-justify-between disco-gap-1", | |
| 48 | + "disco:absolute disco:inset-x-0 disco:top-0 disco:flex disco:w-full disco:items-center disco:justify-between disco:gap-1", | |
| 49 | 49 | defaultClassNames.nav |
| 50 | 50 | ), |
| 51 | 51 | button_previous: cn( |
| 52 | 52 | buttonVariants({ variant: buttonVariant }), |
| 53 | - "disco-size-(--cell-size) disco-p-0 disco-select-none aria-disabled:disco-opacity-50", | |
| 53 | + "disco:size-(--cell-size) disco:p-0 disco:select-none disco:aria-disabled:opacity-50", | |
| 54 | 54 | defaultClassNames.button_previous |
| 55 | 55 | ), |
| 56 | 56 | button_next: cn( |
| 57 | 57 | buttonVariants({ variant: buttonVariant }), |
| 58 | - "disco-size-(--cell-size) disco-p-0 disco-select-none aria-disabled:disco-opacity-50", | |
| 58 | + "disco:size-(--cell-size) disco:p-0 disco:select-none disco:aria-disabled:opacity-50", | |
| 59 | 59 | defaultClassNames.button_next |
| 60 | 60 | ), |
| 61 | 61 | month_caption: cn( |
| 62 | - "disco-flex disco-h-(--cell-size) disco-w-full disco-items-center disco-justify-center disco-px-(--cell-size)", | |
| 62 | + "disco:flex disco:h-(--cell-size) disco:w-full disco:items-center disco:justify-center disco:px-(--cell-size)", | |
| 63 | 63 | defaultClassNames.month_caption |
| 64 | 64 | ), |
| 65 | 65 | dropdowns: cn( |
| 66 | - "disco-flex disco-h-(--cell-size) disco-w-full disco-items-center disco-justify-center disco-gap-1.5 disco-text-sm disco-font-medium", | |
| 66 | + "disco:flex disco:h-(--cell-size) disco:w-full disco:items-center disco:justify-center disco:gap-1.5 disco:text-sm disco:font-medium", | |
| 67 | 67 | defaultClassNames.dropdowns |
| 68 | 68 | ), |
| 69 | 69 | dropdown_root: cn( |
| 70 | - "disco-relative disco-rounded-(--cell-radius)", | |
| 70 | + "disco:relative disco:rounded-(--cell-radius)", | |
| 71 | 71 | defaultClassNames.dropdown_root |
| 72 | 72 | ), |
| 73 | 73 | dropdown: cn( |
| 74 | - "disco-absolute disco-inset-0 disco-bg-popover disco-opacity-0", | |
| 74 | + "disco:absolute disco:inset-0 disco:bg-popover disco:opacity-0", | |
| 75 | 75 | defaultClassNames.dropdown |
| 76 | 76 | ), |
| 77 | - caption_label: cn("disco-font-medium disco-select-none", captionLayout === "label" | |
| 78 | - ? "disco-text-sm" | |
| 79 | - : "disco-flex disco-items-center disco-gap-1 disco-rounded-(--cell-radius) disco-text-sm [&>svg]:disco-size-3.5 [&>svg]:disco-text-muted-foreground", defaultClassNames.caption_label), | |
| 80 | - table: "disco-w-full disco-border-collapse", | |
| 81 | - weekdays: cn("disco-flex", defaultClassNames.weekdays), | |
| 77 | + caption_label: cn("disco:font-medium disco:select-none", captionLayout === "label" | |
| 78 | + ? "disco:text-sm" | |
| 79 | + : "disco:flex disco:items-center disco:gap-1 disco:rounded-(--cell-radius) disco:text-sm disco:[&>svg]:size-3.5 disco:[&>svg]:text-muted-foreground", defaultClassNames.caption_label), | |
| 80 | + table: "disco:w-full disco:border-collapse", | |
| 81 | + weekdays: cn("disco:flex", defaultClassNames.weekdays), | |
| 82 | 82 | weekday: cn( |
| 83 | - "disco-flex-1 disco-rounded-(--cell-radius) disco-text-[0.8rem] disco-font-normal disco-text-muted-foreground disco-select-none", | |
| 83 | + "disco:flex-1 disco:rounded-(--cell-radius) disco:text-[0.8rem] disco:font-normal disco:text-muted-foreground disco:select-none", | |
| 84 | 84 | defaultClassNames.weekday |
| 85 | 85 | ), |
| 86 | - week: cn("disco-mt-2 disco-flex disco-w-full", defaultClassNames.week), | |
| 86 | + week: cn("disco:mt-2 disco:flex disco:w-full", defaultClassNames.week), | |
| 87 | 87 | week_number_header: cn( |
| 88 | - "disco-w-(--cell-size) disco-select-none", | |
| 88 | + "disco:w-(--cell-size) disco:select-none", | |
| 89 | 89 | defaultClassNames.week_number_header |
| 90 | 90 | ), |
| 91 | 91 | week_number: cn( |
| 92 | - "disco-text-[0.8rem] disco-text-muted-foreground disco-select-none", | |
| 92 | + "disco:text-[0.8rem] disco:text-muted-foreground disco:select-none", | |
| 93 | 93 | defaultClassNames.week_number |
| 94 | 94 | ), |
| 95 | 95 | day: cn( |
| 96 | - "disco-group/day disco-relative disco-aspect-square disco-h-full disco-w-full disco-rounded-(--cell-radius) disco-p-0 disco-text-center disco-select-none [&:last-child[data-selected=true]_button]:disco-rounded-r-(--cell-radius)", | |
| 96 | + "disco:group/day disco:relative disco:aspect-square disco:h-full disco:w-full disco:rounded-(--cell-radius) disco:p-0 disco:text-center disco:select-none disco:[&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)", | |
| 97 | 97 | props.showWeekNumber |
| 98 | - ? "[&:nth-child(2)[data-selected=true]_button]:disco-rounded-l-(--cell-radius)" | |
| 99 | - : "[&:first-child[data-selected=true]_button]:disco-rounded-l-(--cell-radius)", | |
| 98 | + ? "disco:[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" | |
| 99 | + : "disco:[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", | |
| 100 | 100 | defaultClassNames.day |
| 101 | 101 | ), |
| 102 | 102 | range_start: cn( |
| 103 | - "disco-relative disco-isolate disco-z-0 disco-rounded-l-(--cell-radius) disco-bg-muted after:disco-absolute after:disco-inset-y-0 after:disco-right-0 after:disco-w-4 after:disco-bg-muted", | |
| 103 | + "disco:relative disco:isolate disco:z-0 disco:rounded-l-(--cell-radius) disco:bg-muted disco:after:absolute disco:after:inset-y-0 disco:after:right-0 disco:after:w-4 disco:after:bg-muted", | |
| 104 | 104 | defaultClassNames.range_start |
| 105 | 105 | ), |
| 106 | - range_middle: cn("disco-rounded-none", defaultClassNames.range_middle), | |
| 106 | + range_middle: cn("disco:rounded-none", defaultClassNames.range_middle), | |
| 107 | 107 | range_end: cn( |
| 108 | - "disco-relative disco-isolate disco-z-0 disco-rounded-r-(--cell-radius) disco-bg-muted after:disco-absolute after:disco-inset-y-0 after:disco-left-0 after:disco-w-4 after:disco-bg-muted", | |
| 108 | + "disco:relative disco:isolate disco:z-0 disco:rounded-r-(--cell-radius) disco:bg-muted disco:after:absolute disco:after:inset-y-0 disco:after:left-0 disco:after:w-4 disco:after:bg-muted", | |
| 109 | 109 | defaultClassNames.range_end |
| 110 | 110 | ), |
| 111 | 111 | today: cn( |
| 112 | - "disco-rounded-(--cell-radius) disco-bg-muted disco-text-foreground data-[selected=true]:disco-rounded-none", | |
| 112 | + "disco:rounded-(--cell-radius) disco:bg-muted disco:text-foreground disco:data-[selected=true]:rounded-none", | |
| 113 | 113 | defaultClassNames.today |
| 114 | 114 | ), |
| 115 | 115 | outside: cn( |
| 116 | - "disco-text-muted-foreground aria-selected:disco-text-muted-foreground", | |
| 116 | + "disco:text-muted-foreground disco:aria-selected:text-muted-foreground", | |
| 117 | 117 | defaultClassNames.outside |
| 118 | 118 | ), |
| 119 | - disabled: cn("disco-text-muted-foreground disco-opacity-50", defaultClassNames.disabled), | |
| 120 | - hidden: cn("disco-invisible", defaultClassNames.hidden), | |
| 119 | + disabled: cn("disco:text-muted-foreground disco:opacity-50", defaultClassNames.disabled), | |
| 120 | + hidden: cn("disco:invisible", defaultClassNames.hidden), | |
| 121 | 121 | ...classNames, |
| 122 | 122 | }} |
| 123 | 123 | components={{ |
| 124 | 124 | Root: ({ className, rootRef, ...props }) => { |
| @@ -125,16 +125,16 @@ | ||
| 125 | 125 | return (<div data-slot="calendar" ref={rootRef} className={cn(className)} {...props} />); |
| 126 | 126 | }, |
| 127 | 127 | Chevron: ({ className, orientation, ...props }) => { |
| 128 | 128 | if (orientation === "left") { |
| 129 | - return (<ChevronLeftIcon className={cn("disco-size-4", className)} {...props} />); | |
| 129 | + return (<ChevronLeftIcon className={cn("disco:size-4", className)} {...props} />); | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (orientation === "right") { |
| 133 | - return (<ChevronRightIcon className={cn("disco-size-4", className)} {...props} />); | |
| 133 | + return (<ChevronRightIcon className={cn("disco:size-4", className)} {...props} />); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - return (<ChevronDownIcon className={cn("disco-size-4", className)} {...props} />); | |
| 136 | + return (<ChevronDownIcon className={cn("disco:size-4", className)} {...props} />); | |
| 137 | 137 | }, |
| 138 | 138 | DayButton: ({ ...props }) => ( |
| 139 | 139 | <CalendarDayButton locale={locale} {...props} /> |
| 140 | 140 | ), |
| @@ -141,9 +141,9 @@ | ||
| 141 | 141 | WeekNumber: ({ children, ...props }) => { |
| 142 | 142 | return ( |
| 143 | 143 | <td {...props}> |
| 144 | 144 | <div |
| 145 | - className="disco-flex disco-size-(--cell-size) disco-items-center disco-justify-center disco-text-center"> | |
| 145 | + className="disco:flex disco:size-(--cell-size) disco:items-center disco:justify-center disco:text-center"> | |
| 146 | 146 | {children} |
| 147 | 147 | </div> |
| 148 | 148 | </td> |
| 149 | 149 | ); |
| @@ -182,9 +182,9 @@ | ||
| 182 | 182 | data-range-start={modifiers.range_start} |
| 183 | 183 | data-range-end={modifiers.range_end} |
| 184 | 184 | data-range-middle={modifiers.range_middle} |
| 185 | 185 | className={cn( |
| 186 | - "disco-relative disco-isolate disco-z-10 disco-flex disco-aspect-square disco-size-auto disco-w-full disco-min-w-(--cell-size) disco-flex-col disco-gap-1 disco-border-0 disco-leading-none disco-font-normal group-data-[focused=true]/day:disco-relative group-data-[focused=true]/day:disco-z-10 group-data-[focused=true]/day:disco-border-ring group-data-[focused=true]/day:disco-ring-[3px] group-data-[focused=true]/day:disco-ring-ring/50 data-[range-end=true]:disco-rounded-(--cell-radius) data-[range-end=true]:disco-rounded-r-(--cell-radius) data-[range-end=true]:disco-bg-primary data-[range-end=true]:disco-text-primary-foreground data-[range-middle=true]:disco-rounded-none data-[range-middle=true]:disco-bg-muted data-[range-middle=true]:disco-text-foreground data-[range-start=true]:disco-rounded-(--cell-radius) data-[range-start=true]:disco-rounded-l-(--cell-radius) data-[range-start=true]:disco-bg-primary data-[range-start=true]:disco-text-primary-foreground data-[selected-single=true]:disco-bg-primary data-[selected-single=true]:disco-text-primary-foreground dark:hover:disco-text-foreground [&>span]:disco-text-xs [&>span]:disco-opacity-70", | |
| 186 | + "disco:relative disco:isolate disco:z-10 disco:flex disco:aspect-square disco:size-auto disco:w-full disco:min-w-(--cell-size) disco:flex-col disco:gap-1 disco:border-0 disco:leading-none disco:font-normal disco:group-data-[focused=true]/day:relative disco:group-data-[focused=true]/day:z-10 disco:group-data-[focused=true]/day:border-ring disco:group-data-[focused=true]/day:ring-[3px] disco:group-data-[focused=true]/day:ring-ring/50 disco:data-[range-end=true]:rounded-(--cell-radius) disco:data-[range-end=true]:rounded-r-(--cell-radius) disco:data-[range-end=true]:bg-primary disco:data-[range-end=true]:text-primary-foreground disco:data-[range-middle=true]:rounded-none disco:data-[range-middle=true]:bg-muted disco:data-[range-middle=true]:text-foreground disco:data-[range-start=true]:rounded-(--cell-radius) disco:data-[range-start=true]:rounded-l-(--cell-radius) disco:data-[range-start=true]:bg-primary disco:data-[range-start=true]:text-primary-foreground disco:data-[selected-single=true]:bg-primary disco:data-[selected-single=true]:text-primary-foreground disco:dark:hover:text-foreground disco:[&>span]:text-xs disco:[&>span]:opacity-70", | |
| 187 | 187 | defaultClassNames.day, |
| 188 | 188 | className |
| 189 | 189 | )} |
| 190 | 190 | {...props} /> |