Skip to content

Commit

Permalink
refactor(icons): update icon imports in various components
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammed-Rahif committed Dec 26, 2024
1 parent eaadc64 commit e134eab
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions src/lib/components/FindDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import * as Dialog from '@/components/ui/dialog';
import { Input } from '@/components/ui/input';
import { Notpad } from '@/helpers/notpad';
import ChevronDown from '@/components/icons/ChevronDown.svelte';
import ChevronUp from '@/components/icons/ChevronUp.svelte';
import ChevronDownIcon from '@/components/icons/ChevronDown.svelte';
import ChevronUpIcon from '@/components/icons/ChevronUp.svelte';
import { Checkbox } from '@/components/ui/checkbox';
import Label from '@/components/ui/label/label.svelte';
Expand Down Expand Up @@ -61,7 +61,7 @@
size="icon"
type="button"
>
<ChevronUp />
<ChevronUpIcon />
</Button>
<Button
onclick={() => {
Expand All @@ -77,7 +77,7 @@
size="icon"
type="button"
>
<ChevronDown />
<ChevronDownIcon />
</Button>
</div>
<Input
Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/ui/checkbox/checkbox.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import { Checkbox as CheckboxPrimitive, type WithoutChildrenOrChild } from 'bits-ui';
import { cn } from '@/utils.js';
import Check from '@/components/icons/Check.svelte';
import Minus from '@/components/icons/Minus.svelte';
import CheckIcon from '@/components/icons/Check.svelte';
import MinusIcon from '@/components/icons/Minus.svelte';
let {
ref = $bindable(null),
Expand All @@ -26,9 +26,9 @@
{#snippet children({ checked, indeterminate })}
<span class="flex items-center justify-center text-current">
{#if indeterminate}
<Minus class="size-4" />
<MinusIcon class="size-4" />
{:else}
<Check class={cn('size-4', !checked && 'text-transparent')} />
<CheckIcon class={cn('size-4', !checked && 'text-transparent')} />
{/if}
</span>
{/snippet}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/ui/command/command-input.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { Command as CommandPrimitive } from 'bits-ui';
import Search from '@/components/icons/Search.svelte';
import SearchIcon from '@/components/icons/Search.svelte';
import { cn } from '@/utils.js';
let {
Expand All @@ -12,7 +12,7 @@
</script>

<div class="flex items-center border-b px-3" data-command-input-wrapper="">
<Search class="mr-2 size-4 shrink-0 opacity-50" />
<SearchIcon class="mr-2 size-4 shrink-0 opacity-50" />
<CommandPrimitive.Input
class={cn(
'flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { ContextMenu as ContextMenuPrimitive, type WithoutChildrenOrChild } from 'bits-ui';
import Check from '@/components/icons/Check.svelte';
import Minus from '@/components/icons/Minus.svelte';
import CheckIcon from '@/components/icons/Check.svelte';
import MinusIcon from '@/components/icons/Minus.svelte';
import type { Snippet } from 'svelte';
import { cn } from '@/utils.js';
Expand Down Expand Up @@ -30,9 +30,9 @@
{#snippet children({ checked, indeterminate })}
<span class="absolute left-2 flex size-3.5 items-center justify-center">
{#if indeterminate}
<Minus class="size-4" />
<MinusIcon class="size-4" />
{:else}
<Check class={cn('size-4', !checked && 'text-transparent')} />
<CheckIcon class={cn('size-4', !checked && 'text-transparent')} />
{/if}
</span>
{@render childrenProp?.()}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { ContextMenu as ContextMenuPrimitive, type WithoutChild } from 'bits-ui';
import Circle from '@/components/icons/Circle.svelte';
import CircleIcon from '@/components/icons/Circle.svelte';
import { cn } from '@/utils.js';
let {
Expand All @@ -22,7 +22,7 @@
{#snippet children({ checked })}
<span class="absolute left-2 flex size-3.5 items-center justify-center">
{#if checked}
<Circle class="size-2 fill-current" />
<CircleIcon class="size-2 fill-current" />
{/if}
</span>
{@render childrenProp?.({ checked })}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { ContextMenu as ContextMenuPrimitive, type WithoutChild } from 'bits-ui';
import ChevronRight from '@/components/icons/ChevronRight.svelte';
import ChevronRightIcon from '@/components/icons/ChevronRight.svelte';
import { cn } from '@/utils.js';
let {
Expand All @@ -24,5 +24,5 @@
{...restProps}
>
{@render children?.()}
<ChevronRight class="ml-auto size-4" />
<ChevronRightIcon class="ml-auto size-4" />
</ContextMenuPrimitive.SubTrigger>
4 changes: 2 additions & 2 deletions src/lib/components/ui/dialog/dialog-content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { type Snippet } from 'svelte';
import * as Dialog from './index.js';
import { cn } from '@/utils.js';
import Close from '@/components/icons/Close.svelte';
import CloseIcon from '@/components/icons/Close.svelte';
import { draggable } from '@neodrag/svelte';
let {
Expand Down Expand Up @@ -44,7 +44,7 @@
<DialogPrimitive.Close
class="absolute right-5 top-5 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none"
>
<Close class="size-4" />
<CloseIcon class="size-4" />
<span class="sr-only">Close</span>
</DialogPrimitive.Close>
</DialogPrimitive.Content>
Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/ui/menubar/menubar-checkbox-item.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { Menubar as MenubarPrimitive, type WithoutChildrenOrChild } from 'bits-ui';
import Check from '@/components/icons/Check.svelte';
import Minus from '@/components/icons/Minus.svelte';
import CheckIcon from '@/components/icons/Check.svelte';
import MinusIcon from '@/components/icons/Minus.svelte';
import { cn } from '@/utils.js';
import type { Snippet } from 'svelte';
Expand Down Expand Up @@ -30,9 +30,9 @@
{#snippet children({ checked, indeterminate })}
<span class="absolute left-2 flex size-3.5 items-center justify-center">
{#if indeterminate}
<Minus class="size-4" />
<MinusIcon class="size-4" />
{:else}
<Check class={cn('size-4', !checked && 'text-transparent')} />
<CheckIcon class={cn('size-4', !checked && 'text-transparent')} />
{/if}
</span>
{@render childrenProp?.()}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/ui/menubar/menubar-radio-item.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { Menubar as MenubarPrimitive, type WithoutChild } from 'bits-ui';
import Circle from '@/components/icons/Circle.svelte';
import CircleIcon from '@/components/icons/Circle.svelte';
import { cn } from '@/utils.js';
let {
Expand All @@ -22,7 +22,7 @@
{#snippet children({ checked })}
<span class="absolute left-2 flex size-3.5 items-center justify-center">
{#if checked}
<Circle class="size-2 fill-current" />
<CircleIcon class="size-2 fill-current" />
{/if}
</span>
{@render childrenProp?.({ checked })}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/ui/menubar/menubar-sub-trigger.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { Menubar as MenubarPrimitive } from 'bits-ui';
import { cn } from '@/utils.js';
import ChevronRight from '@/components/icons/ChevronRight.svelte';
import ChevronRightIcon from '@/components/icons/ChevronRight.svelte';
let {
ref = $bindable(null),
Expand All @@ -24,5 +24,5 @@
{...restProps}
>
{@render children?.()}
<ChevronRight class="ml-auto size-4" />
<ChevronRightIcon class="ml-auto size-4" />
</MenubarPrimitive.SubTrigger>

0 comments on commit e134eab

Please sign in to comment.