diff --git a/LICENSE b/LICENSE index bb1f02c..450e070 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 inkonchain +Copyright (c) 2024-2025 inkonchain Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index dc2906d..a9174ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@inkonchain/ink-kit", - "version": "0.6.1", + "version": "0.7.0", "description": "", "main": "dist/index.cjs.js", "module": "dist/index.es.js", diff --git a/src/components/Alert/Alert.stories.tsx b/src/components/Alert/Alert.stories.tsx index 1083ba4..2abd434 100644 --- a/src/components/Alert/Alert.stories.tsx +++ b/src/components/Alert/Alert.stories.tsx @@ -61,7 +61,7 @@ export const Dismissable: Story = { title: "This alert can be dismissed", description: "Click the X to dismiss. The state will persist across refreshes.", - dismissable: true, + dismissible: true, id: "example-alert", onDismiss: fn(), }, diff --git a/src/components/Alert/Alert.tsx b/src/components/Alert/Alert.tsx index d3bb41f..191535a 100644 --- a/src/components/Alert/Alert.tsx +++ b/src/components/Alert/Alert.tsx @@ -9,13 +9,13 @@ export interface AlertProps { icon?: React.ReactNode; className?: string; /** - * Unique identifier for the alert. Required if dismissable is true. + * Unique identifier for the alert. Required if dismissible is true. */ id?: string; /** * Whether the alert can be dismissed. If true, id is required. */ - dismissable?: boolean; + dismissible?: boolean; /** * Callback fired when the alert is dismissed */ @@ -29,17 +29,17 @@ export const Alert: React.FC = ({ icon, className, id, - dismissable, + dismissible, onDismiss, }) => { const [isDismissed, setIsDismissed] = useState(false); useEffect(() => { - if (dismissable && id) { + if (dismissible && id) { const isDismissedStored = localStorage.getItem(`ink-alert-${id}`); setIsDismissed(isDismissedStored === "true"); } - }, [dismissable, id]); + }, [dismissible, id]); if (isDismissed) { return null; @@ -53,7 +53,7 @@ export const Alert: React.FC = ({ }[variant]; const handleDismiss = () => { - if (dismissable && id) { + if (dismissible && id) { localStorage.setItem(`ink-alert-${id}`, "true"); setIsDismissed(true); onDismiss?.(); @@ -80,7 +80,7 @@ export const Alert: React.FC = ({
{description}
)} - {dismissable && ( + {dismissible && (