@getcoherent/core 0.3.4 → 0.3.5
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/index.d.ts +1 -0
- package/dist/index.js +32 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1970,7 +1970,8 @@ var ComponentGenerator = class {
|
|
|
1970
1970
|
dialog: () => this.generateFullDialog(),
|
|
1971
1971
|
"alert-dialog": () => this.generateFullAlertDialog(),
|
|
1972
1972
|
"dropdown-menu": () => this.generateFullDropdownMenu(),
|
|
1973
|
-
accordion: () => this.generateFullAccordion()
|
|
1973
|
+
accordion: () => this.generateFullAccordion(),
|
|
1974
|
+
progress: () => this.generateProgress()
|
|
1974
1975
|
};
|
|
1975
1976
|
return map[id] ?? null;
|
|
1976
1977
|
}
|
|
@@ -2775,7 +2776,7 @@ import { cn } from '@/lib/utils'
|
|
|
2775
2776
|
import { cva, type VariantProps } from 'class-variance-authority'
|
|
2776
2777
|
|
|
2777
2778
|
const badgeVariants = cva(
|
|
2778
|
-
'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
|
2779
|
+
'inline-flex items-center whitespace-nowrap rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
|
2779
2780
|
{
|
|
2780
2781
|
variants: {
|
|
2781
2782
|
variant: {
|
|
@@ -2800,6 +2801,31 @@ function Badge({ className, variant, ...props }: BadgeProps) {
|
|
|
2800
2801
|
}
|
|
2801
2802
|
|
|
2802
2803
|
export { Badge, badgeVariants }
|
|
2804
|
+
`;
|
|
2805
|
+
}
|
|
2806
|
+
generateProgress() {
|
|
2807
|
+
return `import * as React from 'react'
|
|
2808
|
+
import { cn } from '@/lib/utils'
|
|
2809
|
+
|
|
2810
|
+
export interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2811
|
+
value?: number
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
export const Progress = React.forwardRef<HTMLDivElement, ProgressProps>(
|
|
2815
|
+
({ className, value = 0, ...props }, ref) => (
|
|
2816
|
+
<div
|
|
2817
|
+
ref={ref}
|
|
2818
|
+
className={cn('relative h-4 w-full overflow-hidden rounded-full bg-secondary', className)}
|
|
2819
|
+
{...props}
|
|
2820
|
+
>
|
|
2821
|
+
<div
|
|
2822
|
+
className="h-full w-full flex-1 bg-primary transition-all"
|
|
2823
|
+
style={{ transform: \`translateX(-\${100 - (value || 0)}%)\` }}
|
|
2824
|
+
/>
|
|
2825
|
+
</div>
|
|
2826
|
+
),
|
|
2827
|
+
)
|
|
2828
|
+
Progress.displayName = 'Progress'
|
|
2803
2829
|
`;
|
|
2804
2830
|
}
|
|
2805
2831
|
generateCheckbox() {
|
|
@@ -5755,8 +5781,10 @@ export function AppNav() {
|
|
|
5755
5781
|
"/forgot-password",
|
|
5756
5782
|
"/reset-password"
|
|
5757
5783
|
]);
|
|
5758
|
-
const visibleItems = navItems.filter(
|
|
5759
|
-
|
|
5784
|
+
const visibleItems = navItems.filter(
|
|
5785
|
+
(item) => item.route !== "/" && !authRoutes.has(item.route) && !item.route.includes("[")
|
|
5786
|
+
);
|
|
5787
|
+
const hasMultipleItems = visibleItems.length > 0;
|
|
5760
5788
|
const items = visibleItems.map(
|
|
5761
5789
|
(item) => `<Link href="${item.route}" className={\`text-sm font-medium px-3 py-2 rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring \${pathname === "${item.route}" ? 'bg-muted text-foreground' : 'text-muted-foreground hover:text-foreground hover:bg-muted/50'}\`}>${item.label}</Link>`
|
|
5762
5790
|
).join("\n ");
|