selftune 0.2.9 → 0.2.12
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/README.md +35 -35
- package/apps/local-dashboard/dist/assets/index-4_dAY17K.js +16 -0
- package/apps/local-dashboard/dist/assets/index-BxV5WZHc.css +2 -0
- package/apps/local-dashboard/dist/assets/rolldown-runtime-Dw2cE7zH.js +1 -0
- package/apps/local-dashboard/dist/assets/vendor-react-CKkiCskZ.js +11 -0
- package/apps/local-dashboard/dist/assets/vendor-table-pHbDxq36.js +8 -0
- package/apps/local-dashboard/dist/assets/vendor-ui-7xD7fNEU.js +12 -0
- package/apps/local-dashboard/dist/index.html +16 -15
- package/bin/selftune.cjs +1 -1
- package/cli/selftune/activation-rules.ts +1 -0
- package/cli/selftune/alpha-upload/build-payloads.ts +18 -2
- package/cli/selftune/alpha-upload/stage-canonical.ts +94 -0
- package/cli/selftune/auth/device-code.ts +32 -0
- package/cli/selftune/auto-update.ts +12 -0
- package/cli/selftune/badge/badge.ts +1 -0
- package/cli/selftune/canonical-export.ts +5 -0
- package/cli/selftune/claude-agents.ts +154 -0
- package/cli/selftune/contribute/bundle.ts +1 -0
- package/cli/selftune/contribute/contribute.ts +1 -0
- package/cli/selftune/cron/setup.ts +2 -2
- package/cli/selftune/dashboard-server.ts +1 -0
- package/cli/selftune/eval/hooks-to-evals.ts +1 -0
- package/cli/selftune/eval/import-skillsbench.ts +1 -0
- package/cli/selftune/eval/synthetic-evals.ts +2 -3
- package/cli/selftune/eval/unit-test.ts +1 -0
- package/cli/selftune/evolution/deploy-proposal.ts +9 -238
- package/cli/selftune/evolution/evolve-body.ts +93 -6
- package/cli/selftune/evolution/evolve.ts +3 -7
- package/cli/selftune/evolution/propose-body.ts +3 -2
- package/cli/selftune/evolution/propose-routing.ts +3 -2
- package/cli/selftune/evolution/refine-body.ts +3 -2
- package/cli/selftune/evolution/rollback.ts +1 -1
- package/cli/selftune/export.ts +1 -0
- package/cli/selftune/grading/grade-session.ts +8 -0
- package/cli/selftune/hooks/auto-activate.ts +1 -0
- package/cli/selftune/hooks/evolution-guard.ts +1 -1
- package/cli/selftune/hooks/prompt-log.ts +1 -0
- package/cli/selftune/hooks/session-stop.ts +34 -40
- package/cli/selftune/hooks/skill-change-guard.ts +1 -0
- package/cli/selftune/hooks/skill-eval.ts +1 -1
- package/cli/selftune/index.ts +23 -14
- package/cli/selftune/ingestors/claude-replay.ts +1 -0
- package/cli/selftune/ingestors/codex-rollout.ts +1 -0
- package/cli/selftune/ingestors/codex-wrapper.ts +1 -0
- package/cli/selftune/ingestors/openclaw-ingest.ts +1 -0
- package/cli/selftune/ingestors/opencode-ingest.ts +1 -0
- package/cli/selftune/init.ts +121 -29
- package/cli/selftune/localdb/db.ts +1 -0
- package/cli/selftune/localdb/direct-write.ts +39 -0
- package/cli/selftune/localdb/materialize.ts +2 -0
- package/cli/selftune/localdb/queries.ts +53 -0
- package/cli/selftune/localdb/schema.ts +28 -0
- package/cli/selftune/normalization.ts +1 -0
- package/cli/selftune/observability.ts +1 -0
- package/cli/selftune/repair/skill-usage.ts +1 -0
- package/cli/selftune/routes/orchestrate-runs.ts +1 -0
- package/cli/selftune/routes/overview.ts +1 -0
- package/cli/selftune/routes/report.ts +1 -1
- package/cli/selftune/routes/skill-report.ts +2 -1
- package/cli/selftune/status.ts +1 -1
- package/cli/selftune/sync.ts +30 -1
- package/cli/selftune/uninstall.ts +412 -0
- package/cli/selftune/utils/canonical-log.ts +2 -0
- package/cli/selftune/utils/frontmatter.ts +50 -7
- package/cli/selftune/utils/jsonl.ts +1 -0
- package/cli/selftune/utils/llm-call.ts +131 -3
- package/cli/selftune/utils/skill-log.ts +1 -0
- package/cli/selftune/utils/transcript.ts +1 -0
- package/cli/selftune/utils/trigger-check.ts +1 -1
- package/cli/selftune/workflows/skill-md-writer.ts +5 -5
- package/cli/selftune/workflows/workflows.ts +1 -0
- package/package.json +37 -33
- package/packages/telemetry-contract/fixtures/golden.test.ts +1 -0
- package/packages/telemetry-contract/package.json +1 -1
- package/packages/telemetry-contract/src/schemas.ts +1 -0
- package/packages/telemetry-contract/tests/compatibility.test.ts +1 -0
- package/packages/ui/README.md +35 -34
- package/packages/ui/package.json +3 -3
- package/packages/ui/src/components/ActivityTimeline.tsx +50 -43
- package/packages/ui/src/components/EvidenceViewer.tsx +306 -182
- package/packages/ui/src/components/EvolutionTimeline.tsx +83 -72
- package/packages/ui/src/components/InfoTip.tsx +4 -3
- package/packages/ui/src/components/OrchestrateRunsPanel.tsx +60 -53
- package/packages/ui/src/components/section-cards.tsx +20 -25
- package/packages/ui/src/components/skill-health-grid.tsx +213 -193
- package/packages/ui/src/lib/constants.tsx +1 -0
- package/packages/ui/src/primitives/badge.tsx +12 -15
- package/packages/ui/src/primitives/button.tsx +7 -7
- package/packages/ui/src/primitives/card.tsx +15 -26
- package/packages/ui/src/primitives/checkbox.tsx +7 -8
- package/packages/ui/src/primitives/collapsible.tsx +5 -5
- package/packages/ui/src/primitives/dropdown-menu.tsx +45 -55
- package/packages/ui/src/primitives/label.tsx +6 -6
- package/packages/ui/src/primitives/select.tsx +28 -37
- package/packages/ui/src/primitives/table.tsx +17 -44
- package/packages/ui/src/primitives/tabs.tsx +14 -21
- package/packages/ui/src/primitives/tooltip.tsx +10 -22
- package/skill/SKILL.md +70 -57
- package/skill/Workflows/AlphaUpload.md +4 -4
- package/skill/Workflows/AutoActivation.md +11 -6
- package/skill/Workflows/Badge.md +22 -16
- package/skill/Workflows/Baseline.md +34 -36
- package/skill/Workflows/Composability.md +16 -11
- package/skill/Workflows/Contribute.md +26 -21
- package/skill/Workflows/Cron.md +23 -22
- package/skill/Workflows/Dashboard.md +32 -27
- package/skill/Workflows/Doctor.md +33 -27
- package/skill/Workflows/Evals.md +48 -47
- package/skill/Workflows/EvolutionMemory.md +31 -21
- package/skill/Workflows/Evolve.md +84 -82
- package/skill/Workflows/EvolveBody.md +58 -47
- package/skill/Workflows/Grade.md +16 -13
- package/skill/Workflows/ImportSkillsBench.md +9 -6
- package/skill/Workflows/Ingest.md +36 -21
- package/skill/Workflows/Initialize.md +108 -40
- package/skill/Workflows/Orchestrate.md +22 -16
- package/skill/Workflows/Replay.md +12 -7
- package/skill/Workflows/Rollback.md +13 -6
- package/skill/Workflows/Schedule.md +6 -6
- package/skill/Workflows/Sync.md +18 -11
- package/skill/Workflows/UnitTest.md +28 -17
- package/skill/Workflows/Watch.md +28 -21
- package/skill/agents/diagnosis-analyst.md +11 -0
- package/skill/agents/evolution-reviewer.md +15 -1
- package/skill/agents/integration-guide.md +10 -0
- package/skill/agents/pattern-analyst.md +12 -1
- package/skill/references/grading-methodology.md +23 -24
- package/skill/references/interactive-config.md +7 -7
- package/skill/references/invocation-taxonomy.md +22 -20
- package/skill/references/logs.md +14 -6
- package/skill/references/setup-patterns.md +4 -2
- package/.claude/agents/diagnosis-analyst.md +0 -156
- package/.claude/agents/evolution-reviewer.md +0 -180
- package/.claude/agents/integration-guide.md +0 -212
- package/.claude/agents/pattern-analyst.md +0 -160
- package/apps/local-dashboard/dist/assets/index-Bs3Y4ixf.css +0 -1
- package/apps/local-dashboard/dist/assets/index-C4UYGWKr.js +0 -15
- package/apps/local-dashboard/dist/assets/vendor-react-BQH_6WrG.js +0 -60
- package/apps/local-dashboard/dist/assets/vendor-table-dK1QMLq9.js +0 -26
- package/apps/local-dashboard/dist/assets/vendor-ui-CO2mrx6e.js +0 -341
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { mergeProps } from "@base-ui/react/merge-props"
|
|
2
|
-
import { useRender } from "@base-ui/react/use-render"
|
|
3
|
-
import { cva, type VariantProps } 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, type VariantProps } 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
8
|
"group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
|
|
@@ -10,22 +10,19 @@ const badgeVariants = cva(
|
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
12
|
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
13
|
-
secondary:
|
|
14
|
-
"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
13
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
15
14
|
destructive:
|
|
16
15
|
"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
17
|
-
outline:
|
|
18
|
-
|
|
19
|
-
ghost:
|
|
20
|
-
"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
16
|
+
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
17
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
21
18
|
link: "text-primary underline-offset-4 hover:underline",
|
|
22
19
|
},
|
|
23
20
|
},
|
|
24
21
|
defaultVariants: {
|
|
25
22
|
variant: "default",
|
|
26
23
|
},
|
|
27
|
-
}
|
|
28
|
-
)
|
|
24
|
+
},
|
|
25
|
+
);
|
|
29
26
|
|
|
30
27
|
function Badge({
|
|
31
28
|
className,
|
|
@@ -39,14 +36,14 @@ function Badge({
|
|
|
39
36
|
{
|
|
40
37
|
className: cn(badgeVariants({ variant }), className),
|
|
41
38
|
},
|
|
42
|
-
props
|
|
39
|
+
props,
|
|
43
40
|
),
|
|
44
41
|
render,
|
|
45
42
|
state: {
|
|
46
43
|
slot: "badge",
|
|
47
44
|
variant,
|
|
48
45
|
},
|
|
49
|
-
})
|
|
46
|
+
});
|
|
50
47
|
}
|
|
51
48
|
|
|
52
|
-
export { Badge, badgeVariants }
|
|
49
|
+
export { Badge, badgeVariants };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Button as ButtonPrimitive } from "@base-ui/react/button"
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
1
|
+
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
3
|
|
|
4
|
-
import { cn } from "../lib/utils"
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
5
|
|
|
6
6
|
const buttonVariants = cva(
|
|
7
7
|
"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
@@ -37,8 +37,8 @@ const buttonVariants = cva(
|
|
|
37
37
|
variant: "default",
|
|
38
38
|
size: "default",
|
|
39
39
|
},
|
|
40
|
-
}
|
|
41
|
-
)
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
42
|
|
|
43
43
|
function Button({
|
|
44
44
|
className,
|
|
@@ -52,7 +52,7 @@ function Button({
|
|
|
52
52
|
className={cn(buttonVariants({ variant, size, className }))}
|
|
53
53
|
{...props}
|
|
54
54
|
/>
|
|
55
|
-
)
|
|
55
|
+
);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
export { Button, buttonVariants }
|
|
58
|
+
export { Button, buttonVariants };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from "react"
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
import { cn } from "../lib/utils"
|
|
3
|
+
import { cn } from "../lib/utils";
|
|
4
4
|
|
|
5
5
|
function Card({
|
|
6
6
|
className,
|
|
@@ -13,11 +13,11 @@ function Card({
|
|
|
13
13
|
data-size={size}
|
|
14
14
|
className={cn(
|
|
15
15
|
"group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
|
|
16
|
-
className
|
|
16
|
+
className,
|
|
17
17
|
)}
|
|
18
18
|
{...props}
|
|
19
19
|
/>
|
|
20
|
-
)
|
|
20
|
+
);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -26,11 +26,11 @@ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
26
26
|
data-slot="card-header"
|
|
27
27
|
className={cn(
|
|
28
28
|
"group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",
|
|
29
|
-
className
|
|
29
|
+
className,
|
|
30
30
|
)}
|
|
31
31
|
{...props}
|
|
32
32
|
/>
|
|
33
|
-
)
|
|
33
|
+
);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -39,11 +39,11 @@ function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
39
39
|
data-slot="card-title"
|
|
40
40
|
className={cn(
|
|
41
41
|
"text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",
|
|
42
|
-
className
|
|
42
|
+
className,
|
|
43
43
|
)}
|
|
44
44
|
{...props}
|
|
45
45
|
/>
|
|
46
|
-
)
|
|
46
|
+
);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -53,20 +53,17 @@ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
53
53
|
className={cn("text-sm text-muted-foreground", className)}
|
|
54
54
|
{...props}
|
|
55
55
|
/>
|
|
56
|
-
)
|
|
56
|
+
);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
60
60
|
return (
|
|
61
61
|
<div
|
|
62
62
|
data-slot="card-action"
|
|
63
|
-
className={cn(
|
|
64
|
-
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
65
|
-
className
|
|
66
|
-
)}
|
|
63
|
+
className={cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className)}
|
|
67
64
|
{...props}
|
|
68
65
|
/>
|
|
69
|
-
)
|
|
66
|
+
);
|
|
70
67
|
}
|
|
71
68
|
|
|
72
69
|
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -76,7 +73,7 @@ function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
76
73
|
className={cn("px-4 group-data-[size=sm]/card:px-3", className)}
|
|
77
74
|
{...props}
|
|
78
75
|
/>
|
|
79
|
-
)
|
|
76
|
+
);
|
|
80
77
|
}
|
|
81
78
|
|
|
82
79
|
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -85,19 +82,11 @@ function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
85
82
|
data-slot="card-footer"
|
|
86
83
|
className={cn(
|
|
87
84
|
"flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3",
|
|
88
|
-
className
|
|
85
|
+
className,
|
|
89
86
|
)}
|
|
90
87
|
{...props}
|
|
91
88
|
/>
|
|
92
|
-
)
|
|
89
|
+
);
|
|
93
90
|
}
|
|
94
91
|
|
|
95
|
-
export {
|
|
96
|
-
Card,
|
|
97
|
-
CardHeader,
|
|
98
|
-
CardFooter,
|
|
99
|
-
CardTitle,
|
|
100
|
-
CardAction,
|
|
101
|
-
CardDescription,
|
|
102
|
-
CardContent,
|
|
103
|
-
}
|
|
92
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox"
|
|
1
|
+
import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox";
|
|
2
|
+
import { CheckIcon } from "lucide-react";
|
|
2
3
|
|
|
3
|
-
import { cn } from "../lib/utils"
|
|
4
|
-
import { CheckIcon } from "lucide-react"
|
|
4
|
+
import { cn } from "../lib/utils";
|
|
5
5
|
|
|
6
6
|
function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
|
|
7
7
|
return (
|
|
@@ -9,7 +9,7 @@ function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
|
|
|
9
9
|
data-slot="checkbox"
|
|
10
10
|
className={cn(
|
|
11
11
|
"peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
|
|
12
|
-
className
|
|
12
|
+
className,
|
|
13
13
|
)}
|
|
14
14
|
{...props}
|
|
15
15
|
>
|
|
@@ -17,11 +17,10 @@ function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
|
|
|
17
17
|
data-slot="checkbox-indicator"
|
|
18
18
|
className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
|
|
19
19
|
>
|
|
20
|
-
<CheckIcon
|
|
21
|
-
/>
|
|
20
|
+
<CheckIcon />
|
|
22
21
|
</CheckboxPrimitive.Indicator>
|
|
23
22
|
</CheckboxPrimitive.Root>
|
|
24
|
-
)
|
|
23
|
+
);
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
export { Checkbox }
|
|
26
|
+
export { Checkbox };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible"
|
|
1
|
+
import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
|
|
2
2
|
|
|
3
|
-
const Collapsible = CollapsiblePrimitive.Root
|
|
4
|
-
const CollapsibleTrigger = CollapsiblePrimitive.Trigger
|
|
5
|
-
const CollapsibleContent = CollapsiblePrimitive.Panel
|
|
3
|
+
const Collapsible = CollapsiblePrimitive.Root;
|
|
4
|
+
const CollapsibleTrigger = CollapsiblePrimitive.Trigger;
|
|
5
|
+
const CollapsibleContent = CollapsiblePrimitive.Panel;
|
|
6
6
|
|
|
7
|
-
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|
|
7
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
2
|
+
import { ChevronRightIcon, CheckIcon } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
3
4
|
|
|
4
|
-
import { cn } from "../lib/utils"
|
|
5
|
-
import { ChevronRightIcon, CheckIcon } from "lucide-react"
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
6
|
|
|
7
7
|
function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
|
|
8
|
-
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props}
|
|
8
|
+
return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {
|
|
12
|
-
return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props}
|
|
12
|
+
return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {
|
|
16
|
-
return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props}
|
|
16
|
+
return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function DropdownMenuContent({
|
|
@@ -24,10 +24,7 @@ function DropdownMenuContent({
|
|
|
24
24
|
className,
|
|
25
25
|
...props
|
|
26
26
|
}: MenuPrimitive.Popup.Props &
|
|
27
|
-
Pick<
|
|
28
|
-
MenuPrimitive.Positioner.Props,
|
|
29
|
-
"align" | "alignOffset" | "side" | "sideOffset"
|
|
30
|
-
>) {
|
|
27
|
+
Pick<MenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">) {
|
|
31
28
|
return (
|
|
32
29
|
<MenuPrimitive.Portal>
|
|
33
30
|
<MenuPrimitive.Positioner
|
|
@@ -39,16 +36,19 @@ function DropdownMenuContent({
|
|
|
39
36
|
>
|
|
40
37
|
<MenuPrimitive.Popup
|
|
41
38
|
data-slot="dropdown-menu-content"
|
|
42
|
-
className={cn(
|
|
39
|
+
className={cn(
|
|
40
|
+
"z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
41
|
+
className,
|
|
42
|
+
)}
|
|
43
43
|
{...props}
|
|
44
44
|
/>
|
|
45
45
|
</MenuPrimitive.Positioner>
|
|
46
46
|
</MenuPrimitive.Portal>
|
|
47
|
-
)
|
|
47
|
+
);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {
|
|
51
|
-
return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props}
|
|
51
|
+
return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
function DropdownMenuLabel({
|
|
@@ -56,7 +56,7 @@ function DropdownMenuLabel({
|
|
|
56
56
|
inset,
|
|
57
57
|
...props
|
|
58
58
|
}: MenuPrimitive.GroupLabel.Props & {
|
|
59
|
-
inset?: boolean
|
|
59
|
+
inset?: boolean;
|
|
60
60
|
}) {
|
|
61
61
|
return (
|
|
62
62
|
<MenuPrimitive.GroupLabel
|
|
@@ -64,11 +64,11 @@ function DropdownMenuLabel({
|
|
|
64
64
|
data-inset={inset}
|
|
65
65
|
className={cn(
|
|
66
66
|
"px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",
|
|
67
|
-
className
|
|
67
|
+
className,
|
|
68
68
|
)}
|
|
69
69
|
{...props}
|
|
70
70
|
/>
|
|
71
|
-
)
|
|
71
|
+
);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
function DropdownMenuItem({
|
|
@@ -77,8 +77,8 @@ function DropdownMenuItem({
|
|
|
77
77
|
variant = "default",
|
|
78
78
|
...props
|
|
79
79
|
}: MenuPrimitive.Item.Props & {
|
|
80
|
-
inset?: boolean
|
|
81
|
-
variant?: "default" | "destructive"
|
|
80
|
+
inset?: boolean;
|
|
81
|
+
variant?: "default" | "destructive";
|
|
82
82
|
}) {
|
|
83
83
|
return (
|
|
84
84
|
<MenuPrimitive.Item
|
|
@@ -87,15 +87,15 @@ function DropdownMenuItem({
|
|
|
87
87
|
data-variant={variant}
|
|
88
88
|
className={cn(
|
|
89
89
|
"group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:[&_svg]:text-destructive",
|
|
90
|
-
className
|
|
90
|
+
className,
|
|
91
91
|
)}
|
|
92
92
|
{...props}
|
|
93
93
|
/>
|
|
94
|
-
)
|
|
94
|
+
);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {
|
|
98
|
-
return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props}
|
|
98
|
+
return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
function DropdownMenuSubTrigger({
|
|
@@ -104,7 +104,7 @@ function DropdownMenuSubTrigger({
|
|
|
104
104
|
children,
|
|
105
105
|
...props
|
|
106
106
|
}: MenuPrimitive.SubmenuTrigger.Props & {
|
|
107
|
-
inset?: boolean
|
|
107
|
+
inset?: boolean;
|
|
108
108
|
}) {
|
|
109
109
|
return (
|
|
110
110
|
<MenuPrimitive.SubmenuTrigger
|
|
@@ -112,14 +112,14 @@ function DropdownMenuSubTrigger({
|
|
|
112
112
|
data-inset={inset}
|
|
113
113
|
className={cn(
|
|
114
114
|
"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
115
|
-
className
|
|
115
|
+
className,
|
|
116
116
|
)}
|
|
117
117
|
{...props}
|
|
118
118
|
>
|
|
119
119
|
{children}
|
|
120
120
|
<ChevronRightIcon className="ml-auto" />
|
|
121
121
|
</MenuPrimitive.SubmenuTrigger>
|
|
122
|
-
)
|
|
122
|
+
);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
function DropdownMenuSubContent({
|
|
@@ -133,14 +133,17 @@ function DropdownMenuSubContent({
|
|
|
133
133
|
return (
|
|
134
134
|
<DropdownMenuContent
|
|
135
135
|
data-slot="dropdown-menu-sub-content"
|
|
136
|
-
className={cn(
|
|
136
|
+
className={cn(
|
|
137
|
+
"w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
138
|
+
className,
|
|
139
|
+
)}
|
|
137
140
|
align={align}
|
|
138
141
|
alignOffset={alignOffset}
|
|
139
142
|
side={side}
|
|
140
143
|
sideOffset={sideOffset}
|
|
141
144
|
{...props}
|
|
142
145
|
/>
|
|
143
|
-
)
|
|
146
|
+
);
|
|
144
147
|
}
|
|
145
148
|
|
|
146
149
|
function DropdownMenuCheckboxItem({
|
|
@@ -150,7 +153,7 @@ function DropdownMenuCheckboxItem({
|
|
|
150
153
|
inset,
|
|
151
154
|
...props
|
|
152
155
|
}: MenuPrimitive.CheckboxItem.Props & {
|
|
153
|
-
inset?: boolean
|
|
156
|
+
inset?: boolean;
|
|
154
157
|
}) {
|
|
155
158
|
return (
|
|
156
159
|
<MenuPrimitive.CheckboxItem
|
|
@@ -158,7 +161,7 @@ function DropdownMenuCheckboxItem({
|
|
|
158
161
|
data-inset={inset}
|
|
159
162
|
className={cn(
|
|
160
163
|
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
161
|
-
className
|
|
164
|
+
className,
|
|
162
165
|
)}
|
|
163
166
|
checked={checked}
|
|
164
167
|
{...props}
|
|
@@ -168,22 +171,16 @@ function DropdownMenuCheckboxItem({
|
|
|
168
171
|
data-slot="dropdown-menu-checkbox-item-indicator"
|
|
169
172
|
>
|
|
170
173
|
<MenuPrimitive.CheckboxItemIndicator>
|
|
171
|
-
<CheckIcon
|
|
172
|
-
/>
|
|
174
|
+
<CheckIcon />
|
|
173
175
|
</MenuPrimitive.CheckboxItemIndicator>
|
|
174
176
|
</span>
|
|
175
177
|
{children}
|
|
176
178
|
</MenuPrimitive.CheckboxItem>
|
|
177
|
-
)
|
|
179
|
+
);
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
|
|
181
|
-
return
|
|
182
|
-
<MenuPrimitive.RadioGroup
|
|
183
|
-
data-slot="dropdown-menu-radio-group"
|
|
184
|
-
{...props}
|
|
185
|
-
/>
|
|
186
|
-
)
|
|
183
|
+
return <MenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />;
|
|
187
184
|
}
|
|
188
185
|
|
|
189
186
|
function DropdownMenuRadioItem({
|
|
@@ -192,7 +189,7 @@ function DropdownMenuRadioItem({
|
|
|
192
189
|
inset,
|
|
193
190
|
...props
|
|
194
191
|
}: MenuPrimitive.RadioItem.Props & {
|
|
195
|
-
inset?: boolean
|
|
192
|
+
inset?: boolean;
|
|
196
193
|
}) {
|
|
197
194
|
return (
|
|
198
195
|
<MenuPrimitive.RadioItem
|
|
@@ -200,7 +197,7 @@ function DropdownMenuRadioItem({
|
|
|
200
197
|
data-inset={inset}
|
|
201
198
|
className={cn(
|
|
202
199
|
"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
203
|
-
className
|
|
200
|
+
className,
|
|
204
201
|
)}
|
|
205
202
|
{...props}
|
|
206
203
|
>
|
|
@@ -209,42 +206,35 @@ function DropdownMenuRadioItem({
|
|
|
209
206
|
data-slot="dropdown-menu-radio-item-indicator"
|
|
210
207
|
>
|
|
211
208
|
<MenuPrimitive.RadioItemIndicator>
|
|
212
|
-
<CheckIcon
|
|
213
|
-
/>
|
|
209
|
+
<CheckIcon />
|
|
214
210
|
</MenuPrimitive.RadioItemIndicator>
|
|
215
211
|
</span>
|
|
216
212
|
{children}
|
|
217
213
|
</MenuPrimitive.RadioItem>
|
|
218
|
-
)
|
|
214
|
+
);
|
|
219
215
|
}
|
|
220
216
|
|
|
221
|
-
function DropdownMenuSeparator({
|
|
222
|
-
className,
|
|
223
|
-
...props
|
|
224
|
-
}: MenuPrimitive.Separator.Props) {
|
|
217
|
+
function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props) {
|
|
225
218
|
return (
|
|
226
219
|
<MenuPrimitive.Separator
|
|
227
220
|
data-slot="dropdown-menu-separator"
|
|
228
221
|
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
229
222
|
{...props}
|
|
230
223
|
/>
|
|
231
|
-
)
|
|
224
|
+
);
|
|
232
225
|
}
|
|
233
226
|
|
|
234
|
-
function DropdownMenuShortcut({
|
|
235
|
-
className,
|
|
236
|
-
...props
|
|
237
|
-
}: React.ComponentProps<"span">) {
|
|
227
|
+
function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">) {
|
|
238
228
|
return (
|
|
239
229
|
<span
|
|
240
230
|
data-slot="dropdown-menu-shortcut"
|
|
241
231
|
className={cn(
|
|
242
232
|
"ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",
|
|
243
|
-
className
|
|
233
|
+
className,
|
|
244
234
|
)}
|
|
245
235
|
{...props}
|
|
246
236
|
/>
|
|
247
|
-
)
|
|
237
|
+
);
|
|
248
238
|
}
|
|
249
239
|
|
|
250
240
|
export {
|
|
@@ -263,4 +253,4 @@ export {
|
|
|
263
253
|
DropdownMenuSub,
|
|
264
254
|
DropdownMenuSubTrigger,
|
|
265
255
|
DropdownMenuSubContent,
|
|
266
|
-
}
|
|
256
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import * as React from "react"
|
|
3
|
+
import * as React from "react";
|
|
4
4
|
|
|
5
|
-
import { cn } from "../lib/utils"
|
|
5
|
+
import { cn } from "../lib/utils";
|
|
6
6
|
|
|
7
7
|
function Label({ className, ...props }: React.ComponentProps<"label">) {
|
|
8
8
|
return (
|
|
@@ -10,11 +10,11 @@ function Label({ className, ...props }: React.ComponentProps<"label">) {
|
|
|
10
10
|
data-slot="label"
|
|
11
11
|
className={cn(
|
|
12
12
|
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
13
|
-
className
|
|
13
|
+
className,
|
|
14
14
|
)}
|
|
15
15
|
{...props}
|
|
16
16
|
/>
|
|
17
|
-
)
|
|
17
|
+
);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export { Label }
|
|
20
|
+
export { Label };
|