🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

@isoftdata/svelte-button

Package Overview
Dependencies
Maintainers
11
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@isoftdata/svelte-button - npm Package Compare versions

Comparing version
2.0.5
to
2.1.0
+1
-6
dist/Button.svelte

@@ -8,3 +8,2 @@ <script lang="ts">

import { getIconProps } from '@isoftdata/svelte-icon'
import clsx from 'clsx'

@@ -14,3 +13,2 @@ type IconProps = ComponentProps<Icon>

interface Props extends Omit<HTMLButtonAttributes & HTMLAnchorAttributes, 'class' | 'color' | 'disabled' | 'type' | keyof AriaAttributes | `bind:${string}` | `on:${string}`> {
block?: boolean
button?: HTMLButtonElement | HTMLAnchorElement | undefined

@@ -41,3 +39,2 @@ class?: ClassValue

let {
block = false,
button = $bindable(undefined),

@@ -75,3 +72,3 @@ class: className = '',

let computedSize = $derived(size ? `btn-${size}` : '')
let computedClass = $derived(clsx(`btn ${computedSize} ${computedColor}`, className))
let computedClass = $derived(['btn', computedSize, computedColor, className])

@@ -93,3 +90,2 @@ let computedIcon: IconProps = $derived(

class={computedClass}
class:btn-block={block}
class:disabled={disabled || isLoading}

@@ -113,3 +109,2 @@ class:cursor-not-allowed={disabled || isLoading}

{title}
class:btn-block={block}
class={computedClass}

@@ -116,0 +111,0 @@ disabled={disabled || isLoading}

@@ -8,3 +8,2 @@ import type { ComponentProps, Snippet } from 'svelte';

interface Props extends Omit<HTMLButtonAttributes & HTMLAnchorAttributes, 'class' | 'color' | 'disabled' | 'type' | keyof AriaAttributes | `bind:${string}` | `on:${string}`> {
block?: boolean;
button?: HTMLButtonElement | HTMLAnchorElement | undefined;

@@ -11,0 +10,0 @@ class?: ClassValue;

+2
-1
{
"name": "@isoftdata/svelte-button",
"version": "2.0.5",
"version": "2.1.0",
"scripts": {

@@ -49,2 +49,3 @@ "dev": "vite dev",

"tslib": "^2.4.1",
"type-fest": "^4.39.1",
"typescript": "^5.5.0",

@@ -51,0 +52,0 @@ "vite": "^6.2.0"

@@ -17,2 +17,3 @@ # Svelte Button

- Deprecate `iconClass` prop. The `icon` prop can now accept an icon name or an object
- Removed `block` prop. Bootstrap 5 no longer supports the `btn-block` class. Apply `d-block w-100` classes for the same behavior.

@@ -23,3 +24,2 @@ ## Props

| --- | --- | --- | --- |
| `block` | `boolean` | Render the button as block, spanning the whole width of its parent. | `false` |
| `button` | `HTMLButtonElement \| HTMLAnchorElement` | Either the `<button>` or `<a>`. Useful if you want to fire events directly on it. | (The button or anchor tag) |

@@ -26,0 +26,0 @@ | `color` | `"primary" \| "secondary" \| "success" \| "danger" \| "warning" \| "info" \| "light" \| "dark"` | The bootstrap color of the button. | `"primary"` |