-
Notifications
You must be signed in to change notification settings - Fork 0
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
fe21dd2
commit 0ccce23
Showing
12 changed files
with
138 additions
and
138 deletions.
There are no files selected for viewing
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,22 +1,22 @@ | ||
<script lang="ts"> | ||
import { cn } from '$lib/utils/utils'; | ||
import {cn} from '../utils/utils'; | ||
export let label: string = ''; | ||
export let href: string = ''; | ||
export let isRound = false; | ||
export let label: string = ''; | ||
export let href: string = ''; | ||
export let isRound = false; | ||
</script> | ||
|
||
<a | ||
aria-label={label} | ||
class={cn( | ||
aria-label={label} | ||
class={cn( | ||
`flex h-f32 w-f32 items-center justify-center bg-black p-1 transition-colors duration-[0.3s] hover:bg-brightBlue`, | ||
isRound ? 'rounded-full' : 'rounded', | ||
$$restProps.class | ||
)} | ||
{href} | ||
target="_blank" | ||
{href} | ||
target="_blank" | ||
> | ||
<div class="h-auto w-full text-white"> | ||
<slot /> | ||
</div> | ||
<div class="h-auto w-full text-white"> | ||
<slot/> | ||
</div> | ||
</a> |
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,24 +1,24 @@ | ||
<script lang="ts"> | ||
import { cn } from '$lib/utils/utils'; | ||
import FormElement from './FormElement.svelte'; | ||
import {cn} from '../utils/utils'; | ||
import FormElement from './FormElement.svelte'; | ||
export let label = ''; | ||
export let isRequired = false; | ||
export let description = ''; | ||
export let value = ''; | ||
export let placeholder = 'Enter some text...'; | ||
export let error: string | undefined; | ||
export let label = ''; | ||
export let isRequired = false; | ||
export let description = ''; | ||
export let value = ''; | ||
export let placeholder = 'Enter some text...'; | ||
export let error: string | undefined; | ||
</script> | ||
|
||
<FormElement {label} {isRequired} {description} {value} {placeholder} {error}> | ||
<input | ||
class={cn( | ||
<input | ||
class={cn( | ||
'border-input aria-[invalid]:border-destructive data-[placeholder]:[&>span]:text-muted-foreground sm flex h-10 w-full max-w-[388px] items-center justify-between rounded-md border bg-cream px-3 py-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', | ||
error ? 'border-2 border-error' : 'border border-gray3', | ||
$$restProps.class | ||
)} | ||
type="text" | ||
{placeholder} | ||
bind:value | ||
/> | ||
type="text" | ||
{placeholder} | ||
bind:value | ||
/> | ||
</FormElement> |
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,22 +1,22 @@ | ||
<script lang="ts"> | ||
import { cn } from '$lib/utils/utils'; | ||
import FormElement from './FormElement.svelte'; | ||
import {cn} from '../utils/utils'; | ||
import FormElement from './FormElement.svelte'; | ||
export let label = ''; | ||
export let isRequired = false; | ||
export let description = ''; | ||
export let value: string = ''; | ||
export let placeholder = 'Enter some text...'; | ||
export let error: string | undefined; | ||
export let label = ''; | ||
export let isRequired = false; | ||
export let description = ''; | ||
export let value: string = ''; | ||
export let placeholder = 'Enter some text...'; | ||
export let error: string | undefined; | ||
</script> | ||
|
||
<FormElement {label} {isRequired} {description} {value} {placeholder} {error}> | ||
<textarea | ||
class={cn( | ||
class={cn( | ||
'border-input aria-[invalid]:border-destructive data-[placeholder]:[&>span]:text-muted-foreground sm flex h-10 w-full max-w-[388px] items-center justify-between rounded-md border bg-cream px-3 py-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', | ||
error ? 'border-2 border-error' : 'border border-gray3' | ||
)} | ||
{placeholder} | ||
bind:value | ||
{placeholder} | ||
bind:value | ||
></textarea> | ||
</FormElement> |
34 changes: 17 additions & 17 deletions
34
src/lib/shadcnComponents/ui/accordion/accordion-content.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,25 +1,25 @@ | ||
<script lang="ts"> | ||
import { Accordion as AccordionPrimitive } from 'bits-ui'; | ||
import { slide } from 'svelte/transition'; | ||
import { cn } from '$lib/utils/utils'; | ||
import {Accordion as AccordionPrimitive} from 'bits-ui'; | ||
import {slide} from 'svelte/transition'; | ||
import {cn} from '../utils/utils'; | ||
type $$Props = AccordionPrimitive.ContentProps; | ||
type $$Props = AccordionPrimitive.ContentProps; | ||
let className: $$Props['class'] = undefined; | ||
export let transition: $$Props['transition'] = slide; | ||
export let transitionConfig: $$Props['transitionConfig'] = { | ||
duration: 200, | ||
}; | ||
export { className as class }; | ||
let className: $$Props['class'] = undefined; | ||
export let transition: $$Props['transition'] = slide; | ||
export let transitionConfig: $$Props['transitionConfig'] = { | ||
duration: 200, | ||
}; | ||
export {className as class}; | ||
</script> | ||
|
||
<AccordionPrimitive.Content | ||
class={cn('sm overflow-hidden transition-all', className)} | ||
{transition} | ||
{transitionConfig} | ||
{...$$restProps} | ||
class={cn('sm overflow-hidden transition-all', className)} | ||
{transition} | ||
{transitionConfig} | ||
{...$$restProps} | ||
> | ||
<div class="pb-4 pt-0 text-normal"> | ||
<slot /> | ||
</div> | ||
<div class="pb-4 pt-0 text-normal"> | ||
<slot/> | ||
</div> | ||
</AccordionPrimitive.Content> |
14 changes: 7 additions & 7 deletions
14
src/lib/shadcnComponents/ui/accordion/accordion-item.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,14 +1,14 @@ | ||
<script lang="ts"> | ||
import { Accordion as AccordionPrimitive } from 'bits-ui'; | ||
import { cn } from '$lib/utils/utils'; | ||
import {Accordion as AccordionPrimitive} from 'bits-ui'; | ||
import {cn} from '../utils/utils'; | ||
type $$Props = AccordionPrimitive.ItemProps; | ||
type $$Props = AccordionPrimitive.ItemProps; | ||
let className: $$Props['class'] = undefined; | ||
export let value: $$Props['value']; | ||
export { className as class }; | ||
let className: $$Props['class'] = undefined; | ||
export let value: $$Props['value']; | ||
export {className as class}; | ||
</script> | ||
|
||
<AccordionPrimitive.Item {value} class={cn('border-b', className)} {...$$restProps}> | ||
<slot /> | ||
<slot/> | ||
</AccordionPrimitive.Item> |
32 changes: 16 additions & 16 deletions
32
src/lib/shadcnComponents/ui/accordion/accordion-trigger.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,26 +1,26 @@ | ||
<script lang="ts"> | ||
import { Accordion as AccordionPrimitive } from 'bits-ui'; | ||
import { Chevron } from '../../../../lib/assets/index'; | ||
import { cn } from '$lib/utils/utils'; | ||
import {Accordion as AccordionPrimitive} from 'bits-ui'; | ||
import {Chevron} from '../../../../lib/assets/index'; | ||
import {cn} from '../utils/utils'; | ||
type $$Props = AccordionPrimitive.TriggerProps; | ||
type $$Events = AccordionPrimitive.TriggerEvents; | ||
type $$Props = AccordionPrimitive.TriggerProps; | ||
type $$Events = AccordionPrimitive.TriggerEvents; | ||
let className: $$Props['class'] = undefined; | ||
export let level: AccordionPrimitive.HeaderProps['level'] = 3; | ||
export { className as class }; | ||
let className: $$Props['class'] = undefined; | ||
export let level: AccordionPrimitive.HeaderProps['level'] = 3; | ||
export {className as class}; | ||
</script> | ||
|
||
<AccordionPrimitive.Header {level} class="flex"> | ||
<AccordionPrimitive.Trigger | ||
class={cn( | ||
<AccordionPrimitive.Trigger | ||
class={cn( | ||
'flex flex-1 items-center justify-between py-4 text-md font-bold transition-all [&[data-state=open]>svg]:rotate-180', | ||
className | ||
)} | ||
{...$$restProps} | ||
on:click | ||
> | ||
<slot /> | ||
<Chevron class="h-5 w-5 bg-black p-1 text-white transition-transform duration-200" /> | ||
</AccordionPrimitive.Trigger> | ||
{...$$restProps} | ||
on:click | ||
> | ||
<slot/> | ||
<Chevron class="h-5 w-5 bg-black p-1 text-white transition-transform duration-200"/> | ||
</AccordionPrimitive.Trigger> | ||
</AccordionPrimitive.Header> |
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,34 +1,34 @@ | ||
<script lang="ts"> | ||
import { Dialog as DialogPrimitive } from 'bits-ui'; | ||
import { Exit } from '../../../assets/index'; | ||
import * as Dialog from './index.js'; | ||
import { cn, flyAndScale } from '$lib/utils/utils'; | ||
import {Dialog as DialogPrimitive} from 'bits-ui'; | ||
import {Exit} from '../../../assets/index'; | ||
import * as Dialog from './index.js'; | ||
import {cn, flyAndScale} from '../utils/utils'; | ||
type $$Props = DialogPrimitive.ContentProps; | ||
type $$Props = DialogPrimitive.ContentProps; | ||
let className: $$Props['class'] = undefined; | ||
export let transition: $$Props['transition'] = flyAndScale; | ||
export let transitionConfig: $$Props['transitionConfig'] = { | ||
duration: 200, | ||
}; | ||
export { className as class }; | ||
let className: $$Props['class'] = undefined; | ||
export let transition: $$Props['transition'] = flyAndScale; | ||
export let transitionConfig: $$Props['transitionConfig'] = { | ||
duration: 200, | ||
}; | ||
export {className as class}; | ||
</script> | ||
|
||
<Dialog.Portal> | ||
<Dialog.Overlay /> | ||
<DialogPrimitive.Content | ||
{transition} | ||
{transitionConfig} | ||
class={cn( | ||
<Dialog.Overlay/> | ||
<DialogPrimitive.Content | ||
{transition} | ||
{transitionConfig} | ||
class={cn( | ||
'normal fixed left-[50%] top-[50%] z-50 grid w-full max-w-[500px] translate-x-[-50%] translate-y-[-50%] gap-f24 rounded-lg bg-cream p-f48 shadow-lg md:w-full', | ||
className | ||
)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
<DialogPrimitive.Close class="absolute right-f24 top-f24 disabled:pointer-events-none"> | ||
<Exit class="h-4 w-4 text-navy" /> | ||
<span class="sr-only">Close</span> | ||
</DialogPrimitive.Close> | ||
</DialogPrimitive.Content> | ||
{...$$restProps} | ||
> | ||
<slot/> | ||
<DialogPrimitive.Close class="absolute right-f24 top-f24 disabled:pointer-events-none"> | ||
<Exit class="h-4 w-4 text-navy"/> | ||
<span class="sr-only">Close</span> | ||
</DialogPrimitive.Close> | ||
</DialogPrimitive.Content> | ||
</Dialog.Portal> |
12 changes: 6 additions & 6 deletions
12
src/lib/shadcnComponents/ui/dialog/dialog-description.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,13 +1,13 @@ | ||
<script lang="ts"> | ||
import { Dialog as DialogPrimitive } from 'bits-ui'; | ||
import { cn } from '$lib/utils/utils.js'; | ||
import {Dialog as DialogPrimitive} from 'bits-ui'; | ||
import {cn} from '../utils/utils.js'; | ||
type $$Props = DialogPrimitive.DescriptionProps; | ||
type $$Props = DialogPrimitive.DescriptionProps; | ||
let className: $$Props['class'] = undefined; | ||
export { className as class }; | ||
let className: $$Props['class'] = undefined; | ||
export {className as class}; | ||
</script> | ||
|
||
<DialogPrimitive.Description class={cn('sm', className)} {...$$restProps}> | ||
<slot /> | ||
<slot/> | ||
</DialogPrimitive.Description> |
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,13 +1,13 @@ | ||
<script lang="ts"> | ||
import type { HTMLAttributes } from 'svelte/elements'; | ||
import { cn } from '$lib/utils/utils.js'; | ||
import type {HTMLAttributes} from 'svelte/elements'; | ||
import {cn} from '../utils/utils.js'; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
let className: $$Props['class'] = undefined; | ||
export { className as class }; | ||
let className: $$Props['class'] = undefined; | ||
export {className as class}; | ||
</script> | ||
|
||
<div class={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...$$restProps}> | ||
<slot /> | ||
<slot/> | ||
</div> |
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,13 +1,13 @@ | ||
<script lang="ts"> | ||
import type { HTMLAttributes } from 'svelte/elements'; | ||
import { cn } from '$lib/utils/utils.js'; | ||
import type {HTMLAttributes} from 'svelte/elements'; | ||
import {cn} from '../utils/utils.js'; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
type $$Props = HTMLAttributes<HTMLDivElement>; | ||
let className: $$Props['class'] = undefined; | ||
export { className as class }; | ||
let className: $$Props['class'] = undefined; | ||
export {className as class}; | ||
</script> | ||
|
||
<div class={cn('flex flex-col space-y-f4', className)} {...$$restProps}> | ||
<slot /> | ||
<slot/> | ||
</div> |
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,21 @@ | ||
<script lang="ts"> | ||
import { Dialog as DialogPrimitive } from 'bits-ui'; | ||
import { fade } from 'svelte/transition'; | ||
import { cn } from '$lib/utils/utils.js'; | ||
import {Dialog as DialogPrimitive} from 'bits-ui'; | ||
import {fade} from 'svelte/transition'; | ||
import {cn} from '../utils/utils.js'; | ||
type $$Props = DialogPrimitive.OverlayProps; | ||
type $$Props = DialogPrimitive.OverlayProps; | ||
let className: $$Props['class'] = undefined; | ||
export let transition: $$Props['transition'] = fade; | ||
export let transitionConfig: $$Props['transitionConfig'] = { | ||
duration: 150, | ||
}; | ||
export { className as class }; | ||
let className: $$Props['class'] = undefined; | ||
export let transition: $$Props['transition'] = fade; | ||
export let transitionConfig: $$Props['transitionConfig'] = { | ||
duration: 150, | ||
}; | ||
export {className as class}; | ||
</script> | ||
|
||
<DialogPrimitive.Overlay | ||
{transition} | ||
{transitionConfig} | ||
class={cn('fixed inset-0 z-50 bg-shadow/5 backdrop-blur-sm', className)} | ||
{...$$restProps} | ||
{transition} | ||
{transitionConfig} | ||
class={cn('fixed inset-0 z-50 bg-shadow/5 backdrop-blur-sm', className)} | ||
{...$$restProps} | ||
/> |
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,13 +1,13 @@ | ||
<script lang="ts"> | ||
import { Dialog as DialogPrimitive } from 'bits-ui'; | ||
import { cn } from '$lib/utils/utils.js'; | ||
import {Dialog as DialogPrimitive} from 'bits-ui'; | ||
import {cn} from '../utils/utils.js'; | ||
type $$Props = DialogPrimitive.TitleProps; | ||
type $$Props = DialogPrimitive.TitleProps; | ||
let className: $$Props['class'] = undefined; | ||
export { className as class }; | ||
let className: $$Props['class'] = undefined; | ||
export {className as class}; | ||
</script> | ||
|
||
<DialogPrimitive.Title class={cn('lg font-bold text-navy', className)} {...$$restProps}> | ||
<slot /> | ||
<slot/> | ||
</DialogPrimitive.Title> |