Release 1.0.4
This commit is contained in:
parent
6646d3b075
commit
7dd26608d2
9 changed files with 54 additions and 61 deletions
|
@ -2,7 +2,7 @@
|
||||||
"name": "main-site",
|
"name": "main-site",
|
||||||
"author": "Neshura",
|
"author": "Neshura",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Button as ButtonPrimitive } from "bits-ui";
|
import { Button as ButtonPrimitive } from 'bits-ui';
|
||||||
import { type Events, type Props, buttonVariants } from "./index.js";
|
import { type Events, type Props, buttonVariants } from './index.js';
|
||||||
import { cn } from "$lib/utils.js";
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = Props;
|
type $$Props = Props;
|
||||||
type $$Events = Events;
|
type $$Events = Events;
|
||||||
|
|
||||||
let className: $$Props["class"] = undefined;
|
let className: $$Props['class'] = undefined;
|
||||||
export let variant: $$Props["variant"] = "default";
|
export let variant: $$Props['variant'] = 'default';
|
||||||
export let size: $$Props["size"] = "default";
|
export let size: $$Props['size'] = 'default';
|
||||||
export let builders: $$Props["builders"] = [];
|
export let builders: $$Props['builders'] = [];
|
||||||
export { className as class };
|
export { className as class };
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,35 +1,34 @@
|
||||||
import type { Button as ButtonPrimitive } from "bits-ui";
|
import type { Button as ButtonPrimitive } from 'bits-ui';
|
||||||
import { type VariantProps, tv } from "tailwind-variants";
|
import { type VariantProps, tv } from 'tailwind-variants';
|
||||||
import Root from "./button.svelte";
|
import Root from './button.svelte';
|
||||||
|
|
||||||
const buttonVariants = tv({
|
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",
|
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: {
|
variants: {
|
||||||
variant: {
|
variant: {
|
||||||
default: "bg-primary text-primary-foreground hover:bg-primary/90 shadow",
|
default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow',
|
||||||
destructive:
|
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm',
|
||||||
"bg-destructive text-destructive-foreground hover:bg-destructive/90 shadow-sm",
|
|
||||||
outline:
|
outline:
|
||||||
"border-input bg-background hover:bg-accent hover:text-accent-foreground border shadow-sm",
|
'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",
|
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-sm',
|
||||||
ghost: "hover:bg-accent hover:text-accent-foreground",
|
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
||||||
link: "text-primary underline-offset-4 hover:underline",
|
link: 'text-primary underline-offset-4 hover:underline'
|
||||||
},
|
},
|
||||||
size: {
|
size: {
|
||||||
default: "h-9 px-4 py-2",
|
default: 'h-9 px-4 py-2',
|
||||||
sm: "h-8 rounded-md px-3 text-xs",
|
sm: 'h-8 rounded-md px-3 text-xs',
|
||||||
lg: "h-10 rounded-md px-8",
|
lg: 'h-10 rounded-md px-8',
|
||||||
icon: "h-9 w-9",
|
icon: 'h-9 w-9'
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
variant: "default",
|
variant: 'default',
|
||||||
size: "default",
|
size: 'default'
|
||||||
},
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
type Variant = VariantProps<typeof buttonVariants>["variant"];
|
type Variant = VariantProps<typeof buttonVariants>['variant'];
|
||||||
type Size = VariantProps<typeof buttonVariants>["size"];
|
type Size = VariantProps<typeof buttonVariants>['size'];
|
||||||
|
|
||||||
type Props = ButtonPrimitive.Props & {
|
type Props = ButtonPrimitive.Props & {
|
||||||
variant?: Variant;
|
variant?: Variant;
|
||||||
|
@ -46,5 +45,5 @@ export {
|
||||||
Root as Button,
|
Root as Button,
|
||||||
type Props as ButtonProps,
|
type Props as ButtonProps,
|
||||||
type Events as ButtonEvents,
|
type Events as ButtonEvents,
|
||||||
buttonVariants,
|
buttonVariants
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import Root from "./separator.svelte";
|
import Root from './separator.svelte';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
//
|
//
|
||||||
Root as Separator,
|
Root as Separator
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Separator as SeparatorPrimitive } from "bits-ui";
|
import { Separator as SeparatorPrimitive } from 'bits-ui';
|
||||||
import { cn } from "$lib/utils.js";
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = SeparatorPrimitive.Props;
|
type $$Props = SeparatorPrimitive.Props;
|
||||||
|
|
||||||
let className: $$Props["class"] = undefined;
|
let className: $$Props['class'] = undefined;
|
||||||
export let orientation: $$Props["orientation"] = "horizontal";
|
export let orientation: $$Props['orientation'] = 'horizontal';
|
||||||
export let decorative: $$Props["decorative"] = undefined;
|
export let decorative: $$Props['decorative'] = undefined;
|
||||||
export { className as class };
|
export { className as class };
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<SeparatorPrimitive.Root
|
<SeparatorPrimitive.Root
|
||||||
class={cn(
|
class={cn(
|
||||||
"bg-border shrink-0",
|
'shrink-0 bg-border',
|
||||||
orientation === "horizontal" ? "h-[1px] w-full" : "min-h-full w-[1px]",
|
orientation === 'horizontal' ? 'h-[1px] w-full' : 'min-h-full w-[1px]',
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
{orientation}
|
{orientation}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import Root from "./skeleton.svelte";
|
import Root from './skeleton.svelte';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Root,
|
Root,
|
||||||
//
|
//
|
||||||
Root as Skeleton,
|
Root as Skeleton
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { HTMLAttributes } from "svelte/elements";
|
import type { HTMLAttributes } from 'svelte/elements';
|
||||||
import { cn } from "$lib/utils.js";
|
import { cn } from '$lib/utils.js';
|
||||||
|
|
||||||
type $$Props = HTMLAttributes<HTMLDivElement>;
|
type $$Props = HTMLAttributes<HTMLDivElement>;
|
||||||
|
|
||||||
let className: $$Props["class"] = undefined;
|
let className: $$Props['class'] = undefined;
|
||||||
export { className as class };
|
export { className as class };
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class={cn("bg-primary/10 animate-pulse rounded-md", className)} {...$$restProps}></div>
|
<div class={cn('animate-pulse rounded-md bg-primary/10', className)} {...$$restProps}></div>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { type ClassValue, clsx } from "clsx";
|
import { type ClassValue, clsx } from 'clsx';
|
||||||
import { twMerge } from "tailwind-merge";
|
import { twMerge } from 'tailwind-merge';
|
||||||
import { cubicOut } from "svelte/easing";
|
import { cubicOut } from 'svelte/easing';
|
||||||
import type { TransitionConfig } from "svelte/transition";
|
import type { TransitionConfig } from 'svelte/transition';
|
||||||
|
|
||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs));
|
return twMerge(clsx(inputs));
|
||||||
|
@ -19,13 +19,9 @@ export const flyAndScale = (
|
||||||
params: FlyAndScaleParams = { y: -8, x: 0, start: 0.95, duration: 150 }
|
params: FlyAndScaleParams = { y: -8, x: 0, start: 0.95, duration: 150 }
|
||||||
): TransitionConfig => {
|
): TransitionConfig => {
|
||||||
const style = getComputedStyle(node);
|
const style = getComputedStyle(node);
|
||||||
const transform = style.transform === "none" ? "" : style.transform;
|
const transform = style.transform === 'none' ? '' : style.transform;
|
||||||
|
|
||||||
const scaleConversion = (
|
const scaleConversion = (valueA: number, scaleA: [number, number], scaleB: [number, number]) => {
|
||||||
valueA: number,
|
|
||||||
scaleA: [number, number],
|
|
||||||
scaleB: [number, number]
|
|
||||||
) => {
|
|
||||||
const [minA, maxA] = scaleA;
|
const [minA, maxA] = scaleA;
|
||||||
const [minB, maxB] = scaleB;
|
const [minB, maxB] = scaleB;
|
||||||
|
|
||||||
|
@ -35,13 +31,11 @@ export const flyAndScale = (
|
||||||
return valueB;
|
return valueB;
|
||||||
};
|
};
|
||||||
|
|
||||||
const styleToString = (
|
const styleToString = (style: Record<string, number | string | undefined>): string => {
|
||||||
style: Record<string, number | string | undefined>
|
|
||||||
): string => {
|
|
||||||
return Object.keys(style).reduce((str, key) => {
|
return Object.keys(style).reduce((str, key) => {
|
||||||
if (style[key] === undefined) return str;
|
if (style[key] === undefined) return str;
|
||||||
return str + `${key}:${style[key]};`;
|
return str + `${key}:${style[key]};`;
|
||||||
}, "");
|
}, '');
|
||||||
};
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -59,4 +53,4 @@ export const flyAndScale = (
|
||||||
},
|
},
|
||||||
easing: cubicOut
|
easing: cubicOut
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@ export default {
|
||||||
site: 'http://localhost:8000',
|
site: 'http://localhost:8000',
|
||||||
ci: {
|
ci: {
|
||||||
budget: {
|
budget: {
|
||||||
performance: 90,
|
performance: 70,
|
||||||
accessibility: 100,
|
accessibility: 100,
|
||||||
'best-practices': 90,
|
'best-practices': 90,
|
||||||
seo: 90
|
seo: 90
|
||||||
|
|
Loading…
Add table
Reference in a new issue