-
Notifications
You must be signed in to change notification settings - Fork 2
Migarate from Flowbite avatar into Shadcn avatar #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shkelqim627
wants to merge
9
commits into
synergyai-nl:migrate-button-component-slg-55
Choose a base branch
from
shkelqim627:Migrate-Avatar-Component-#118
base: migrate-button-component-slg-55
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+417
−138
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9f1f1af
Add Tooltip UI component
aryadhruv 01fc2c9
formatting
aryadhruv 76b8749
Merge branch 'migrate-button-component-slg-55' into migrate-tooltip-c…
aryadhruv ac94674
Migrate AI Action tooltip - Clipboard, Regenerate
aryadhruv b85ce58
Migrate Feedback Action tooltip
aryadhruv 0f3b3c9
Migrate User Action tooltip - Edit
aryadhruv ff7807c
Fix invalid prop for Tooltip
aryadhruv b326f45
Update AIMessageActions.svelte
aryadhruv 14e9167
# This is a combination of 2 commits.
shkelqim627 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
17 changes: 17 additions & 0 deletions
17
apps/frontend/src/lib/components/ui/avatar/avatar-fallback.svelte
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <script lang="ts"> | ||
| import { Avatar as AvatarPrimitive } from 'bits-ui'; | ||
| import { cn } from '$lib/utils.js'; | ||
|
|
||
| let { | ||
| ref = $bindable(null), | ||
| class: className, | ||
| ...restProps | ||
| }: AvatarPrimitive.FallbackProps = $props(); | ||
| </script> | ||
|
|
||
| <AvatarPrimitive.Fallback | ||
| bind:ref | ||
| data-slot="avatar-fallback" | ||
| class={cn('bg-muted flex size-full items-center justify-center rounded-full', className)} | ||
| {...restProps} | ||
| /> |
17 changes: 17 additions & 0 deletions
17
apps/frontend/src/lib/components/ui/avatar/avatar-image.svelte
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <script lang="ts"> | ||
| import { Avatar as AvatarPrimitive } from 'bits-ui'; | ||
| import { cn } from '$lib/utils.js'; | ||
|
|
||
| let { | ||
| ref = $bindable(null), | ||
| class: className, | ||
| ...restProps | ||
| }: AvatarPrimitive.ImageProps = $props(); | ||
| </script> | ||
|
|
||
| <AvatarPrimitive.Image | ||
| bind:ref | ||
| data-slot="avatar-image" | ||
| class={cn('aspect-square h-full w-full', className)} | ||
| {...restProps} | ||
| /> |
aryadhruv marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <script lang="ts"> | ||
| import { Avatar as AvatarPrimitive } from 'bits-ui'; | ||
| import { cn } from '$lib/utils.js'; | ||
|
|
||
| let { | ||
| ref = $bindable(null), | ||
| loadingStatus = $bindable('loading'), | ||
| class: className, | ||
| ...restProps | ||
| }: AvatarPrimitive.RootProps = $props(); | ||
| </script> | ||
|
|
||
| <AvatarPrimitive.Root | ||
| bind:ref | ||
| bind:loadingStatus | ||
| data-slot="avatar" | ||
| class={cn('relative flex size-8 shrink-0 overflow-hidden rounded-full', className)} | ||
| {...restProps} | ||
| /> |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import Root from './avatar.svelte'; | ||
| import Image from './avatar-image.svelte'; | ||
| import Fallback from './avatar-fallback.svelte'; | ||
|
|
||
| export { | ||
| Root, | ||
| Image, | ||
| Fallback, | ||
| // | ||
| Root as Avatar, | ||
| Image as AvatarImage, | ||
| Fallback as AvatarFallback | ||
| }; |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import Root from './tooltip.svelte'; | ||
| import Trigger from './tooltip-trigger.svelte'; | ||
| import Content from './tooltip-content.svelte'; | ||
| import Provider from './tooltip-provider.svelte'; | ||
| import Portal from './tooltip-portal.svelte'; | ||
|
|
||
| export { | ||
| Root, | ||
| Trigger, | ||
| Content, | ||
| Provider, | ||
| Portal, | ||
| // | ||
| Root as Tooltip, | ||
| Content as TooltipContent, | ||
| Trigger as TooltipTrigger, | ||
| Provider as TooltipProvider, | ||
| Portal as TooltipPortal | ||
| }; |
52 changes: 52 additions & 0 deletions
52
apps/frontend/src/lib/components/ui/tooltip/tooltip-content.svelte
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| <script lang="ts"> | ||
| import { Tooltip as TooltipPrimitive } from 'bits-ui'; | ||
| import { cn } from '$lib/utils.js'; | ||
| import TooltipPortal from './tooltip-portal.svelte'; | ||
| import type { ComponentProps } from 'svelte'; | ||
| import type { WithoutChildrenOrChild } from '$lib/utils.js'; | ||
|
|
||
| let { | ||
| ref = $bindable(null), | ||
| class: className, | ||
| sideOffset = 0, | ||
| side = 'top', | ||
| children, | ||
| arrowClasses, | ||
| portalProps, | ||
| ...restProps | ||
| }: TooltipPrimitive.ContentProps & { | ||
| arrowClasses?: string; | ||
| portalProps?: WithoutChildrenOrChild<ComponentProps<typeof TooltipPortal>>; | ||
| } = $props(); | ||
| </script> | ||
|
|
||
| <TooltipPortal {...portalProps}> | ||
| <TooltipPrimitive.Content | ||
| bind:ref | ||
| data-slot="tooltip-content" | ||
| {sideOffset} | ||
| {side} | ||
| class={cn( | ||
| 'bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--bits-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance', | ||
| className | ||
| )} | ||
| {...restProps} | ||
| > | ||
| {@render children?.()} | ||
| <TooltipPrimitive.Arrow> | ||
| {#snippet child({ props })} | ||
| <div | ||
| class={cn( | ||
| 'bg-primary z-50 size-2.5 rotate-45 rounded-[2px]', | ||
| 'data-[side=top]:translate-x-1/2 data-[side=top]:translate-y-[calc(-50%_+_2px)]', | ||
| 'data-[side=bottom]:-translate-x-1/2 data-[side=bottom]:-translate-y-[calc(-50%_+_1px)]', | ||
| 'data-[side=right]:translate-x-[calc(50%_+_2px)] data-[side=right]:translate-y-1/2', | ||
| 'data-[side=left]:-translate-y-[calc(50%_-_3px)]', | ||
| arrowClasses | ||
| )} | ||
| {...props} | ||
| ></div> | ||
| {/snippet} | ||
| </TooltipPrimitive.Arrow> | ||
| </TooltipPrimitive.Content> | ||
| </TooltipPortal> |
7 changes: 7 additions & 0 deletions
7
apps/frontend/src/lib/components/ui/tooltip/tooltip-portal.svelte
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <script lang="ts"> | ||
| import { Tooltip as TooltipPrimitive } from 'bits-ui'; | ||
|
|
||
| let { ...restProps }: TooltipPrimitive.PortalProps = $props(); | ||
| </script> | ||
|
|
||
| <TooltipPrimitive.Portal {...restProps} /> |
7 changes: 7 additions & 0 deletions
7
apps/frontend/src/lib/components/ui/tooltip/tooltip-provider.svelte
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <script lang="ts"> | ||
| import { Tooltip as TooltipPrimitive } from 'bits-ui'; | ||
|
|
||
| let { ...restProps }: TooltipPrimitive.ProviderProps = $props(); | ||
| </script> | ||
|
|
||
| <TooltipPrimitive.Provider {...restProps} /> |
7 changes: 7 additions & 0 deletions
7
apps/frontend/src/lib/components/ui/tooltip/tooltip-trigger.svelte
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <script lang="ts"> | ||
| import { Tooltip as TooltipPrimitive } from 'bits-ui'; | ||
|
|
||
| let { ref = $bindable(null), ...restProps }: TooltipPrimitive.TriggerProps = $props(); | ||
| </script> | ||
|
|
||
| <TooltipPrimitive.Trigger bind:ref data-slot="tooltip-trigger" {...restProps} /> |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <script lang="ts"> | ||
| import { Tooltip as TooltipPrimitive } from 'bits-ui'; | ||
|
|
||
| let { open = $bindable(false), ...restProps }: TooltipPrimitive.RootProps = $props(); | ||
| </script> | ||
|
|
||
| <TooltipPrimitive.Root bind:open {...restProps} /> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.