tokka-ui 0.2.0 → 0.2.2
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/dist/badge.js +1 -1
- package/dist/calendar.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chunk-HHN2GS4U.js +72 -0
- package/dist/date-picker.js +1 -1
- package/dist/sheet.d.ts +1 -1
- package/dist/switch.js +1 -1
- package/package.json +3 -3
- package/src/badge.tsx +1 -1
- package/src/calendar.tsx +25 -19
- package/src/checkbox.tsx +1 -1
- package/src/switch.tsx +1 -1
- package/dist/chunk-A4HW2TQU.js +0 -66
package/dist/badge.js
CHANGED
|
@@ -14,7 +14,7 @@ var badgeVariants = cva(
|
|
|
14
14
|
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
15
15
|
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
16
16
|
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
17
|
-
outline: "text-foreground"
|
|
17
|
+
outline: "text-foreground border-border"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
defaultVariants: {
|
package/dist/calendar.js
CHANGED
package/dist/checkbox.js
CHANGED
|
@@ -12,7 +12,7 @@ var Checkbox = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
12
12
|
{
|
|
13
13
|
ref,
|
|
14
14
|
className: cn(
|
|
15
|
-
"peer size-4 shrink-0 rounded-sm border border-
|
|
15
|
+
"peer size-4 shrink-0 rounded-sm border border-input ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
16
16
|
className
|
|
17
17
|
),
|
|
18
18
|
...props,
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buttonVariants
|
|
3
|
+
} from "./chunk-DVPPDIDA.js";
|
|
4
|
+
import {
|
|
5
|
+
cn
|
|
6
|
+
} from "./chunk-RQHJBTEU.js";
|
|
7
|
+
|
|
8
|
+
// src/calendar.tsx
|
|
9
|
+
import "react";
|
|
10
|
+
import { DayPicker } from "react-day-picker";
|
|
11
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
function Calendar({
|
|
14
|
+
className,
|
|
15
|
+
classNames,
|
|
16
|
+
showOutsideDays = true,
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
DayPicker,
|
|
21
|
+
{
|
|
22
|
+
showOutsideDays,
|
|
23
|
+
className: cn("p-3", className),
|
|
24
|
+
classNames: {
|
|
25
|
+
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
26
|
+
month: "space-y-4",
|
|
27
|
+
caption: "flex justify-center pt-1 relative items-center",
|
|
28
|
+
caption_label: "text-sm font-medium",
|
|
29
|
+
nav: "space-x-1 flex items-center",
|
|
30
|
+
button_previous: cn(
|
|
31
|
+
buttonVariants({ variant: "outline" }),
|
|
32
|
+
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100 absolute left-1"
|
|
33
|
+
),
|
|
34
|
+
button_next: cn(
|
|
35
|
+
buttonVariants({ variant: "outline" }),
|
|
36
|
+
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100 absolute right-1"
|
|
37
|
+
),
|
|
38
|
+
month_grid: "w-full border-collapse space-y-1",
|
|
39
|
+
weekdays: "flex",
|
|
40
|
+
weekday: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
|
|
41
|
+
week: "flex w-full mt-2",
|
|
42
|
+
day: "size-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
|
43
|
+
day_button: cn(
|
|
44
|
+
buttonVariants({ variant: "ghost" }),
|
|
45
|
+
"size-9 p-0 font-normal aria-selected:opacity-100"
|
|
46
|
+
),
|
|
47
|
+
range_end: "day-range-end",
|
|
48
|
+
selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
|
|
49
|
+
today: "bg-accent text-accent-foreground",
|
|
50
|
+
outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
|
|
51
|
+
disabled: "text-muted-foreground opacity-50",
|
|
52
|
+
range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
|
|
53
|
+
hidden: "invisible",
|
|
54
|
+
...classNames
|
|
55
|
+
},
|
|
56
|
+
components: {
|
|
57
|
+
Chevron: (props2) => {
|
|
58
|
+
if (props2.orientation === "left") {
|
|
59
|
+
return /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" });
|
|
60
|
+
}
|
|
61
|
+
return /* @__PURE__ */ jsx(ChevronRight, { className: "size-4" });
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
Calendar.displayName = "Calendar";
|
|
69
|
+
|
|
70
|
+
export {
|
|
71
|
+
Calendar
|
|
72
|
+
};
|
package/dist/date-picker.js
CHANGED
package/dist/sheet.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare const SheetClose: React.ForwardRefExoticComponent<DialogPrimitive.Dialog
|
|
|
10
10
|
declare const SheetPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
11
11
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
declare const sheetVariants: (props?: ({
|
|
13
|
-
side?: "
|
|
13
|
+
side?: "left" | "right" | "top" | "bottom" | null | undefined;
|
|
14
14
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
15
|
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
16
16
|
}
|
package/dist/switch.js
CHANGED
|
@@ -10,7 +10,7 @@ var Switch = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
10
10
|
SwitchPrimitives.Root,
|
|
11
11
|
{
|
|
12
12
|
className: cn(
|
|
13
|
-
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-
|
|
13
|
+
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted",
|
|
14
14
|
className
|
|
15
15
|
),
|
|
16
16
|
...props,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tokka-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React UI components for tokka with design token support",
|
|
6
6
|
"keywords": [
|
|
@@ -276,13 +276,13 @@
|
|
|
276
276
|
"embla-carousel-react": "^8.0.0",
|
|
277
277
|
"input-otp": "^1.0.0",
|
|
278
278
|
"lucide-react": "^0.563.0",
|
|
279
|
-
"react-day-picker": "^
|
|
279
|
+
"react-day-picker": "^9.0.0",
|
|
280
280
|
"react-hook-form": "^7.0.0",
|
|
281
281
|
"react-resizable-panels": "^2.0.0",
|
|
282
282
|
"recharts": "^2.0.0",
|
|
283
283
|
"sonner": "^1.0.0",
|
|
284
284
|
"tailwind-merge": "^2.2.1",
|
|
285
|
-
"vaul": "^
|
|
285
|
+
"vaul": "^1.1.1"
|
|
286
286
|
},
|
|
287
287
|
"devDependencies": {
|
|
288
288
|
"@types/react": "^18.2.65",
|
package/src/badge.tsx
CHANGED
|
@@ -13,7 +13,7 @@ const badgeVariants = cva(
|
|
|
13
13
|
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
14
14
|
destructive:
|
|
15
15
|
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
16
|
-
outline: "text-foreground",
|
|
16
|
+
outline: "text-foreground border-border",
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
defaultVariants: {
|
package/src/calendar.tsx
CHANGED
|
@@ -22,37 +22,43 @@ function Calendar({
|
|
|
22
22
|
caption: "flex justify-center pt-1 relative items-center",
|
|
23
23
|
caption_label: "text-sm font-medium",
|
|
24
24
|
nav: "space-x-1 flex items-center",
|
|
25
|
-
|
|
25
|
+
button_previous: cn(
|
|
26
26
|
buttonVariants({ variant: "outline" }),
|
|
27
|
-
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
27
|
+
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100 absolute left-1"
|
|
28
28
|
),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
button_next: cn(
|
|
30
|
+
buttonVariants({ variant: "outline" }),
|
|
31
|
+
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100 absolute right-1"
|
|
32
|
+
),
|
|
33
|
+
month_grid: "w-full border-collapse space-y-1",
|
|
34
|
+
weekdays: "flex",
|
|
35
|
+
weekday:
|
|
34
36
|
"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
week: "flex w-full mt-2",
|
|
38
|
+
day: "size-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
|
39
|
+
day_button: cn(
|
|
38
40
|
buttonVariants({ variant: "ghost" }),
|
|
39
41
|
"size-9 p-0 font-normal aria-selected:opacity-100"
|
|
40
42
|
),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
range_end: "day-range-end",
|
|
44
|
+
selected:
|
|
43
45
|
"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
today: "bg-accent text-accent-foreground",
|
|
47
|
+
outside:
|
|
46
48
|
"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
disabled: "text-muted-foreground opacity-50",
|
|
50
|
+
range_middle:
|
|
49
51
|
"aria-selected:bg-accent aria-selected:text-accent-foreground",
|
|
50
|
-
|
|
52
|
+
hidden: "invisible",
|
|
51
53
|
...classNames,
|
|
52
54
|
}}
|
|
53
55
|
components={{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
Chevron: (props) => {
|
|
57
|
+
if (props.orientation === "left") {
|
|
58
|
+
return <ChevronLeft className="size-4" />
|
|
59
|
+
}
|
|
60
|
+
return <ChevronRight className="size-4" />
|
|
61
|
+
},
|
|
56
62
|
}}
|
|
57
63
|
{...props}
|
|
58
64
|
/>
|
package/src/checkbox.tsx
CHANGED
|
@@ -10,7 +10,7 @@ const Checkbox = React.forwardRef<
|
|
|
10
10
|
<CheckboxPrimitive.Root
|
|
11
11
|
ref={ref}
|
|
12
12
|
className={cn(
|
|
13
|
-
"peer size-4 shrink-0 rounded-sm border border-
|
|
13
|
+
"peer size-4 shrink-0 rounded-sm border border-input ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
14
14
|
className
|
|
15
15
|
)}
|
|
16
16
|
{...props}
|
package/src/switch.tsx
CHANGED
|
@@ -8,7 +8,7 @@ const Switch = React.forwardRef<
|
|
|
8
8
|
>(({ className, ...props }, ref) => (
|
|
9
9
|
<SwitchPrimitives.Root
|
|
10
10
|
className={cn(
|
|
11
|
-
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-
|
|
11
|
+
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-muted",
|
|
12
12
|
className
|
|
13
13
|
)}
|
|
14
14
|
{...props}
|
package/dist/chunk-A4HW2TQU.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
buttonVariants
|
|
3
|
-
} from "./chunk-DVPPDIDA.js";
|
|
4
|
-
import {
|
|
5
|
-
cn
|
|
6
|
-
} from "./chunk-RQHJBTEU.js";
|
|
7
|
-
|
|
8
|
-
// src/calendar.tsx
|
|
9
|
-
import "react";
|
|
10
|
-
import { DayPicker } from "react-day-picker";
|
|
11
|
-
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
12
|
-
import { jsx } from "react/jsx-runtime";
|
|
13
|
-
function Calendar({
|
|
14
|
-
className,
|
|
15
|
-
classNames,
|
|
16
|
-
showOutsideDays = true,
|
|
17
|
-
...props
|
|
18
|
-
}) {
|
|
19
|
-
return /* @__PURE__ */ jsx(
|
|
20
|
-
DayPicker,
|
|
21
|
-
{
|
|
22
|
-
showOutsideDays,
|
|
23
|
-
className: cn("p-3", className),
|
|
24
|
-
classNames: {
|
|
25
|
-
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
26
|
-
month: "space-y-4",
|
|
27
|
-
caption: "flex justify-center pt-1 relative items-center",
|
|
28
|
-
caption_label: "text-sm font-medium",
|
|
29
|
-
nav: "space-x-1 flex items-center",
|
|
30
|
-
nav_button: cn(
|
|
31
|
-
buttonVariants({ variant: "outline" }),
|
|
32
|
-
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
33
|
-
),
|
|
34
|
-
nav_button_previous: "absolute left-1",
|
|
35
|
-
nav_button_next: "absolute right-1",
|
|
36
|
-
table: "w-full border-collapse space-y-1",
|
|
37
|
-
head_row: "flex",
|
|
38
|
-
head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
|
|
39
|
-
row: "flex w-full mt-2",
|
|
40
|
-
cell: "size-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
|
41
|
-
day: cn(
|
|
42
|
-
buttonVariants({ variant: "ghost" }),
|
|
43
|
-
"size-9 p-0 font-normal aria-selected:opacity-100"
|
|
44
|
-
),
|
|
45
|
-
day_range_end: "day-range-end",
|
|
46
|
-
day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
|
|
47
|
-
day_today: "bg-accent text-accent-foreground",
|
|
48
|
-
day_outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
|
|
49
|
-
day_disabled: "text-muted-foreground opacity-50",
|
|
50
|
-
day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
|
|
51
|
-
day_hidden: "invisible",
|
|
52
|
-
...classNames
|
|
53
|
-
},
|
|
54
|
-
components: {
|
|
55
|
-
IconLeft: () => /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" }),
|
|
56
|
-
IconRight: () => /* @__PURE__ */ jsx(ChevronRight, { className: "size-4" })
|
|
57
|
-
},
|
|
58
|
-
...props
|
|
59
|
-
}
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
Calendar.displayName = "Calendar";
|
|
63
|
-
|
|
64
|
-
export {
|
|
65
|
-
Calendar
|
|
66
|
-
};
|