-
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
c819093
commit 7ada22e
Showing
14 changed files
with
477 additions
and
307 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
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 +1,3 @@ | ||
export const buttonStyle = "p-2 rounded border"; | ||
export const simpleTooltipRowStyle = | ||
"text-left px-2 hover:bg-stone-300 cursor-pointer"; |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<script lang="ts"> | ||
import type { LintProgram } from "color-buddy-palette-lint"; | ||
import ChevDown from "virtual:icons/fa6-solid/angle-down"; | ||
import store from "../stores/store"; | ||
import Tooltip from "../components/Tooltip.svelte"; | ||
import { simpleTooltipRowStyle, buttonStyle } from "../lib/styles"; | ||
$: lintGroups = $store.lints.reduce( | ||
(acc, row) => { | ||
acc[row.group] = (acc[row.group] || []).concat(row); | ||
return acc; | ||
}, | ||
{} as Record<string, LintProgram[]> | ||
); | ||
</script> | ||
|
||
<Tooltip positionAlongRightEdge={true}> | ||
<div class="flex flex-col text-sm" slot="content"> | ||
{#each Object.entries(lintGroups) as [groupName, items]} | ||
{#each items || [] as lint} | ||
<button | ||
class={simpleTooltipRowStyle} | ||
on:click={() => { | ||
store.setFocusedLint(lint.id); | ||
}} | ||
> | ||
{lint.name} | ||
</button> | ||
{/each} | ||
<div class="my-3 border-t border-black"></div> | ||
{/each} | ||
</div> | ||
<button | ||
slot="target" | ||
let:toggle | ||
on:click={toggle} | ||
class="{buttonStyle} flex items-center" | ||
> | ||
Select a different lint | ||
<ChevDown class="ml-2 text-sm" /> | ||
</button> | ||
</Tooltip> |
Oops, something went wrong.