-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8eec281
commit 4ad7a01
Showing
38 changed files
with
787 additions
and
901 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
{ | ||
"$schema": "https://shadcn-svelte.com/schema.json", | ||
"style": "new-york", | ||
"tailwind": { | ||
"config": "tailwind.config.js", | ||
"css": "src/app.css", | ||
"baseColor": "neutral" | ||
}, | ||
"aliases": { | ||
"components": "$lib/components", | ||
"utils": "$lib/utils" | ||
}, | ||
"typescript": true | ||
"$schema": "https://next.shadcn-svelte.com/schema.json", | ||
"style": "new-york", | ||
"tailwind": { | ||
"config": "tailwind.config.js", | ||
"css": "src/app.css", | ||
"baseColor": "neutral" | ||
}, | ||
"aliases": { | ||
"components": "$lib/components", | ||
"utils": "$lib/utils", | ||
"ui": "$lib/components/ui", | ||
"hooks": "$lib/hooks" | ||
}, | ||
"typescript": true, | ||
"registry": "https://next.shadcn-svelte.com/registry" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
%sveltekit.head% | ||
</head> | ||
|
||
<body data-sveltekit-preload-data="hover"> | ||
<div style="display: contents">%sveltekit.body%</div> | ||
</body> | ||
</html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
%sveltekit.head% | ||
<script async src="https://umami.experimentos.nulo.ar/script.js" | ||
data-website-id="3728adc2-6131-4895-9b0c-98f3038d9126"></script> | ||
</head> | ||
|
||
<body data-sveltekit-preload-data="hover"> | ||
<div style="display: contents">%sveltekit.body%</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,80 @@ | ||
<script lang="ts" module> | ||
import type { WithElementRef } from "bits-ui"; | ||
import type { | ||
HTMLAnchorAttributes, | ||
HTMLButtonAttributes, | ||
} from "svelte/elements"; | ||
import { type VariantProps, tv } from "tailwind-variants"; | ||
export const buttonVariants = tv({ | ||
base: "focus-visible:ring-ring inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", | ||
variants: { | ||
variant: { | ||
default: | ||
"bg-primary text-primary-foreground hover:bg-primary/90 shadow", | ||
destructive: | ||
"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm", | ||
outline: | ||
"border-input bg-background hover:bg-accent hover:text-accent-foreground border shadow-sm", | ||
secondary: | ||
"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm", | ||
ghost: "hover:bg-accent hover:text-accent-foreground", | ||
link: "text-primary underline-offset-4 hover:underline", | ||
}, | ||
size: { | ||
default: "h-9 px-4 py-2", | ||
sm: "h-8 rounded-md px-3 text-xs", | ||
lg: "h-10 rounded-md px-8", | ||
icon: "h-9 w-9", | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: "default", | ||
size: "default", | ||
}, | ||
}); | ||
export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"]; | ||
export type ButtonSize = VariantProps<typeof buttonVariants>["size"]; | ||
export type ButtonProps = WithElementRef<HTMLButtonAttributes> & | ||
WithElementRef<HTMLAnchorAttributes> & { | ||
variant?: ButtonVariant; | ||
size?: ButtonSize; | ||
}; | ||
</script> | ||
|
||
<script lang="ts"> | ||
import { Button as ButtonPrimitive } from "bits-ui"; | ||
import { type Events, type Props, buttonVariants } from "./index.js"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = Props; | ||
type $$Events = Events; | ||
let className: $$Props["class"] = undefined; | ||
export let variant: $$Props["variant"] = "default"; | ||
export let size: $$Props["size"] = "default"; | ||
export let builders: $$Props["builders"] = []; | ||
export { className as class }; | ||
let { | ||
class: className, | ||
variant = "default", | ||
size = "default", | ||
ref = $bindable(null), | ||
href = undefined, | ||
type = "button", | ||
children, | ||
...restProps | ||
}: ButtonProps = $props(); | ||
</script> | ||
|
||
<ButtonPrimitive.Root | ||
{builders} | ||
class={cn(buttonVariants({ variant, size, className }))} | ||
type="button" | ||
{...$$restProps} | ||
on:click | ||
on:keydown | ||
> | ||
<slot /> | ||
</ButtonPrimitive.Root> | ||
{#if href} | ||
<a | ||
bind:this={ref} | ||
class={cn(buttonVariants({ variant, size }), className)} | ||
{href} | ||
{...restProps} | ||
> | ||
{@render children?.()} | ||
</a> | ||
{:else} | ||
<button | ||
bind:this={ref} | ||
class={cn(buttonVariants({ variant, size }), className)} | ||
{type} | ||
{...restProps} | ||
> | ||
{@render children?.()} | ||
</button> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,17 @@ | ||
import type { Button as ButtonPrimitive } from "bits-ui"; | ||
import { type VariantProps, tv } from "tailwind-variants"; | ||
import Root from "./button.svelte"; | ||
|
||
const buttonVariants = tv({ | ||
base: "focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 disabled:pointer-events-none disabled:opacity-50", | ||
variants: { | ||
variant: { | ||
default: "bg-primary text-primary-foreground hover:bg-primary/90 shadow", | ||
destructive: | ||
"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm", | ||
outline: | ||
"border-input bg-background hover:bg-accent hover:text-accent-foreground border shadow-sm", | ||
secondary: | ||
"bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm", | ||
ghost: "hover:bg-accent hover:text-accent-foreground", | ||
link: "text-primary underline-offset-4 hover:underline", | ||
}, | ||
size: { | ||
default: "h-9 px-4 py-2", | ||
sm: "h-8 rounded-md px-3 text-xs", | ||
lg: "h-10 rounded-md px-8", | ||
icon: "h-9 w-9", | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: "default", | ||
size: "default", | ||
}, | ||
}); | ||
|
||
type Variant = VariantProps<typeof buttonVariants>["variant"]; | ||
type Size = VariantProps<typeof buttonVariants>["size"]; | ||
|
||
type Props = ButtonPrimitive.Props & { | ||
variant?: Variant; | ||
size?: Size; | ||
}; | ||
|
||
type Events = ButtonPrimitive.Events; | ||
import Root, { | ||
type ButtonProps, | ||
type ButtonSize, | ||
type ButtonVariant, | ||
buttonVariants, | ||
} from "./button.svelte"; | ||
|
||
export { | ||
Root, | ||
type Props, | ||
type Events, | ||
// | ||
Root as Button, | ||
type Props as ButtonProps, | ||
type Events as ButtonEvents, | ||
buttonVariants, | ||
Root, | ||
type ButtonProps as Props, | ||
// | ||
Root as Button, | ||
buttonVariants, | ||
type ButtonProps, | ||
type ButtonSize, | ||
type ButtonVariant, | ||
}; |
30 changes: 14 additions & 16 deletions
30
sitio/src/lib/components/ui/calendar/calendar-cell.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
<script lang="ts"> | ||
import { Calendar as CalendarPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/utils.js"; | ||
import { Calendar as CalendarPrimitive } from "bits-ui"; | ||
import { cn } from "$lib/utils.js"; | ||
type $$Props = CalendarPrimitive.CellProps; | ||
export let date: $$Props["date"]; | ||
let className: $$Props["class"] = undefined; | ||
export { className as class }; | ||
let { | ||
ref = $bindable(null), | ||
class: className, | ||
...restProps | ||
}: CalendarPrimitive.CellProps = $props(); | ||
</script> | ||
|
||
<CalendarPrimitive.Cell | ||
{date} | ||
class={cn( | ||
"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:rounded-md [&:has([data-selected])]:bg-accent [&:has([data-selected][data-outside-month])]:bg-accent/50", | ||
className, | ||
)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</CalendarPrimitive.Cell> | ||
class={cn( | ||
"[&:has([data-selected])]:bg-accent [&:has([data-selected][data-outside-month])]:bg-accent/50 relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:rounded-md", | ||
className | ||
)} | ||
bind:ref | ||
{...restProps} | ||
/> |
Oops, something went wrong.