-
Notifications
You must be signed in to change notification settings - Fork 8
Style Connect app (WIP) #243
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
22 | ||
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 @@ | ||
routeTree.gen.ts | ||
benface marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* We only use Prettier to sort Tailwind classes; Biome handles the rest. | ||
* When Biome's `useSortedClasses` is on par with `prettier-plugin-tailwindcss`, we can switch to it and remove Prettier completely. | ||
* See https://biomejs.dev/linter/rules/use-sorted-classes/ | ||
*/ | ||
export default { | ||
benface marked this conversation as resolved.
Show resolved
Hide resolved
|
||
singleQuote: true, | ||
printWidth: 120, | ||
plugins: ['prettier-plugin-tailwindcss'], | ||
tailwindPreserveWhitespace: true, | ||
tailwindFunctions: ['cn'], | ||
}; |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
import { Loading } from '@/components/ui/Loading'; | ||
import type { PrivateSpaceData } from '@/hooks/use-private-spaces'; | ||
import type { PublicSpaceData } from '@/hooks/use-public-spaces'; | ||
import { cn } from '@/lib/utils'; | ||
import { Popover } from '@base-ui-components/react/popover'; | ||
|
||
interface SpacesCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> { | ||
spaces: (PublicSpaceData | PrivateSpaceData)[]; | ||
status?: 'loading' | { error: boolean | string } | undefined; | ||
} | ||
|
||
export function SpacesCard({ spaces, status, className, ...props }: SpacesCardProps) { | ||
const error = | ||
typeof status === 'object' && 'error' in status | ||
? typeof status.error === 'boolean' | ||
? status.error | ||
: status.error || true | ||
: false; | ||
return ( | ||
<div | ||
className={cn( | ||
`group/card c-card scroll-y scrollbar-none | ||
has-data-error:bg-error-dark | ||
has-data-error:text-error-light | ||
flex flex-col`, | ||
className, | ||
)} | ||
{...props} | ||
> | ||
<h2 | ||
className={` | ||
c-card-title group-has-data-error/card:text-error-light sticky top-(--offset) shrink-0 | ||
bg-[color-mix(in_oklab,var(--color-foreground)_calc(var(--progress)*0.25),transparent)] | ||
text-[color-mix(in_oklab,var(--color-background)_var(--progress),var(--color-foreground-muted))] | ||
backdrop-blur-sm | ||
[--progress:min(var(--scroll-y)/50*100%,100%)] | ||
`} | ||
> | ||
Spaces | ||
</h2> | ||
<div className="grid shrink-0 grow items-start"> | ||
{(() => { | ||
if (status === 'loading') { | ||
return <Loading className="place-self-center" />; | ||
} | ||
if (error) { | ||
return ( | ||
<p data-error className="place-self-center font-semibold"> | ||
An error has occurred loading spaces{typeof error === 'string' ? `: ${error}` : ''} | ||
</p> | ||
); | ||
} | ||
if (spaces.length === 0) { | ||
return ( | ||
<p data-empty className="text-foreground-muted place-self-center"> | ||
No spaces found | ||
</p> | ||
); | ||
} | ||
return ( | ||
<ul className="grid-cols-auto-fill-36 grid gap-4"> | ||
{spaces.map((space) => ( | ||
<li key={space.id} className="group/list-item"> | ||
<Popover.Root openOnHover delay={50}> | ||
<Popover.Trigger | ||
className={` | ||
group-nth-[5n]/list-item:bg-gradient-violet | ||
group-nth-[5n+1]/list-item:bg-gradient-lavender | ||
group-nth-[5n+2]/list-item:bg-gradient-aqua | ||
group-nth-[5n+3]/list-item:bg-gradient-peach | ||
group-nth-[5n+4]/list-item:bg-gradient-clearmint | ||
flex aspect-video w-full items-end overflow-clip rounded-lg px-3 py-2 | ||
`} | ||
> | ||
<span className="text-sm leading-tight font-semibold">{space.name || space.id}</span> | ||
</Popover.Trigger> | ||
<Popover.Portal> | ||
<Popover.Positioner side="bottom" sideOffset={12}> | ||
<Popover.Popup className="c-popover"> | ||
<Popover.Arrow className="c-popover-arrow"> | ||
<ArrowSvg /> | ||
</Popover.Arrow> | ||
{!('apps' in space) ? ( | ||
<Popover.Title className="font-semibold">Public space</Popover.Title> | ||
) : space.apps.length === 0 ? ( | ||
<Popover.Title className="font-semibold"> | ||
No app has access to this private space | ||
</Popover.Title> | ||
) : ( | ||
<> | ||
<Popover.Title className="font-semibold"> | ||
Apps with access to this private space | ||
</Popover.Title> | ||
<Popover.Description> | ||
<ul className="list-disc"> | ||
{space.apps.map((app) => ( | ||
<li key={app.id}>{app.name || app.id}</li> | ||
))} | ||
</ul> | ||
</Popover.Description> | ||
</> | ||
)} | ||
</Popover.Popup> | ||
</Popover.Positioner> | ||
</Popover.Portal> | ||
</Popover.Root> | ||
</li> | ||
))} | ||
</ul> | ||
); | ||
})()} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
function ArrowSvg(props: React.ComponentProps<'svg'>) { | ||
return ( | ||
<svg width="20" height="10" viewBox="0 0 20 10" role="presentation" {...props}> | ||
<path d="M0 0L20 0L10 10Z" fill="currentColor" /> | ||
</svg> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
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.