mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-20 16:09:25 +02:00
🔥 remove: delete Picture Button/Card duplicates, use @manacore/shared-ui
- Delete unused Card.svelte (21 LOC) - Migrate Button imports to @manacore/shared-ui (53 LOC) - Update CONSOLIDATION_OPPORTUNITIES.md Savings: ~74 LOC
This commit is contained in:
parent
2d16f7c9ff
commit
c4483e2c0b
7 changed files with 15 additions and 92 deletions
|
|
@ -17,7 +17,7 @@
|
|||
deselectAll,
|
||||
} from '$lib/stores/canvas';
|
||||
import { boardSettings } from '$lib/stores/boards';
|
||||
import Button from '$lib/components/ui/Button.svelte';
|
||||
import { Button } from '@manacore/shared-ui';
|
||||
import Konva from 'konva';
|
||||
import {
|
||||
CaretLeft,
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@
|
|||
import { canvasItems, addCanvasItem } from '$lib/stores/canvas';
|
||||
import { getImages } from '$lib/api/images';
|
||||
import { addBoardItem } from '$lib/api/boardItems';
|
||||
import { toastStore } from '@manacore/shared-ui';
|
||||
import Modal from '$lib/components/ui/Modal.svelte';
|
||||
import Button from '$lib/components/ui/Button.svelte';
|
||||
import { toastStore, Modal, Button } from '@manacore/shared-ui';
|
||||
import { MagnifyingGlass, Image as ImageIcon, Check } from '@manacore/shared-icons';
|
||||
|
||||
interface Props {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { selectedItems, updateCanvasItem, removeSelectedItems } from '$lib/stores/canvas';
|
||||
import { updateBoardItem, changeBoardItemZIndex, isImageItem } from '$lib/api/boardItems';
|
||||
import Button from '$lib/components/ui/Button.svelte';
|
||||
import { toastStore } from '@manacore/shared-ui';
|
||||
import { Button, toastStore } from '@manacore/shared-ui';
|
||||
import {
|
||||
Image,
|
||||
CaretDoubleUp,
|
||||
|
|
|
|||
|
|
@ -1,52 +0,0 @@
|
|||
<script lang="ts">
|
||||
import type { Snippet } from 'svelte';
|
||||
import { CircleNotch } from '@manacore/shared-icons';
|
||||
|
||||
interface Props {
|
||||
variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger';
|
||||
size?: 'sm' | 'md' | 'lg';
|
||||
type?: 'button' | 'submit' | 'reset';
|
||||
disabled?: boolean;
|
||||
loading?: boolean;
|
||||
class?: string;
|
||||
onclick?: () => void;
|
||||
children: Snippet;
|
||||
}
|
||||
|
||||
let {
|
||||
variant = 'primary',
|
||||
size = 'md',
|
||||
type = 'button',
|
||||
disabled = false,
|
||||
loading = false,
|
||||
class: className = '',
|
||||
onclick,
|
||||
children,
|
||||
}: Props = $props();
|
||||
|
||||
const baseStyles =
|
||||
'inline-flex items-center justify-center font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50';
|
||||
|
||||
const variants = {
|
||||
primary: 'bg-blue-600 text-white hover:bg-blue-700 focus-visible:ring-blue-600',
|
||||
secondary: 'bg-gray-200 text-gray-900 hover:bg-gray-300 focus-visible:ring-gray-400',
|
||||
outline: 'border border-gray-300 bg-transparent hover:bg-gray-100 focus-visible:ring-gray-400',
|
||||
ghost: 'hover:bg-gray-100 focus-visible:ring-gray-400',
|
||||
danger: 'bg-red-600 text-white hover:bg-red-700 focus-visible:ring-red-600',
|
||||
};
|
||||
|
||||
const sizes = {
|
||||
sm: 'h-9 px-3 text-sm rounded-md',
|
||||
md: 'h-10 px-4 py-2 rounded-md',
|
||||
lg: 'h-11 px-8 text-lg rounded-md',
|
||||
};
|
||||
|
||||
const buttonClass = `${baseStyles} ${variants[variant]} ${sizes[size]} ${className}`;
|
||||
</script>
|
||||
|
||||
<button {type} class={buttonClass} disabled={disabled || loading} {onclick}>
|
||||
{#if loading}
|
||||
<CircleNotch size={16} weight="bold" class="mr-2 animate-spin" />
|
||||
{/if}
|
||||
{@render children()}
|
||||
</button>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<script lang="ts">
|
||||
import type { Snippet } from 'svelte';
|
||||
|
||||
interface Props {
|
||||
class?: string;
|
||||
padding?: boolean;
|
||||
children: Snippet;
|
||||
}
|
||||
|
||||
let { class: className = '', padding = true, children }: Props = $props();
|
||||
|
||||
const baseStyles =
|
||||
'rounded-lg border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-900';
|
||||
const paddingStyles = padding ? 'p-6' : '';
|
||||
const cardClass = `${baseStyles} ${paddingStyles} ${className}`;
|
||||
</script>
|
||||
|
||||
<div class={cardClass}>
|
||||
{@render children()}
|
||||
</div>
|
||||
|
|
@ -14,10 +14,7 @@
|
|||
removeBoardFromList,
|
||||
} from '$lib/stores/boards';
|
||||
import { getBoards, deleteBoard, duplicateBoard } from '$lib/api/boards';
|
||||
import { PageHeader } from '@manacore/shared-ui';
|
||||
import Button from '$lib/components/ui/Button.svelte';
|
||||
import Modal from '$lib/components/ui/Modal.svelte';
|
||||
import { toastStore } from '@manacore/shared-ui';
|
||||
import { PageHeader, Button, Modal, toastStore } from '@manacore/shared-ui';
|
||||
import { Plus, SquaresFour, Image, Trash } from '@manacore/shared-icons';
|
||||
|
||||
let loadingMore = $state(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue