Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion platforms/metagram/src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,22 @@
--color-black: #1f1f1f;
--color-black-800: #4c4c4c;
--color-black-600: #797979;
--color-black-400: #a9a9a9;
--color-black-400: #a5a5a5;
--color-black-200: #d2d2d2;

--color-grey: #f5f5f5;

--color-brand-burnt-orange: #da4a11;
--color-brand-burnt-orange-100: #f8dbcf;
--color-brand-burnt-orange-200: #f3c3b0;
--color-brand-burnt-orange-300: #eca488;
--color-brand-burnt-orange-400: #e68660;
--color-brand-burnt-orange-500: #e06839;
--color-brand-burnt-orange-600: #91310b;
--color-brand-burnt-orange-700: #6d2509;
--color-brand-burnt-orange-800: #491906;
--color-brand-burnt-orange-900: #2c0f03;

--color-brand-gradient: linear-gradient(
91.82deg,
#4d44ef -36.17%,
Expand Down
11 changes: 9 additions & 2 deletions platforms/metagram/src/lib/ui/Button/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ export const Primary = {
args: { variant: 'primary', children: ButtonText }
};

export const Danger = {
args: { variant: 'danger', children: ButtonText }
export const Secondary = {
args: {
variant: 'secondary',
blockingClick: true,
children: ButtonText,
callback: async () => {
await new Promise((resolve) => setTimeout(resolve, 2000));
}
}
};

export const Loading = {
Expand Down
30 changes: 25 additions & 5 deletions platforms/metagram/src/lib/ui/Button/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type { HTMLButtonAttributes } from 'svelte/elements';
interface IButtonProps extends HTMLButtonAttributes {
variant?: 'primary' | 'danger';
variant?: 'primary' | 'secondary';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Variant name changed from 'danger' to 'secondary'

This is a breaking change that will require updates in all places where the Button component is used with the 'danger' variant. Make sure all consuming components have been updated accordingly.


🏁 Script executed:

#!/bin/bash
# Search for any remaining usages of the 'danger' variant in the codebase
echo "Searching for places where the Button component is used with danger variant..."
rg "variant\s*=\s*['\"]danger['\"]" --type svelte --type ts --type jsx --type tsx

Length of output: 285


Let's re-run the search across all relevant file extensions without relying on missing type definitions:


🏁 Script executed:

#!/bin/bash
echo "Searching for any remaining `danger` variant usages..."
rg --glob '*.svelte' --glob '*.ts' --glob '*.tsx' --glob '*.jsx' "variant\s*=\s*['\"]danger['\"]"

Length of output: 570


Update remaining ‘danger’ variants to ‘secondary’

We’ve identified two leftover usages of the now-removed danger variant. Please update these to variant="secondary" (or adjust as needed for your design system):

• infrastructure/eid-wallet/src/routes/+page.svelte
<Button.Action class="w-full" variant="danger" callback={clearPin}>

• infrastructure/eid-wallet/src/routes/(auth)/login/+page.svelte
<Button.Action class="w-full" variant="danger" callback={clearPin}>

After making these changes, rerun a search for variant="danger" to ensure no breaks remain.

isLoading?: boolean;
callback?: () => Promise<void> | void;
blockingClick?: boolean;
Expand Down Expand Up @@ -39,13 +39,29 @@
};
const variantClasses = {
primary: { background: 'bg-grey', text: 'text-black-800' },
danger: { background: 'bg-red-500', text: 'text-white' }
primary: {
background: 'bg-grey',
text: 'text-black-800',
border: 'border border-black-400'
},
secondary: {
background: 'bg-brand-burnt-orange',
text: 'text-white',
border: 'border border-brand-burnt-orange-600'
}
};
const disabledVariantClasses = {
primary: { background: 'bg-grey/50', text: 'text-black-800/50' },
danger: { background: 'bg-red-500/50', text: 'text-white/50' }
primary: {
background: 'bg-grey/50',
text: 'text-black-800/50',
border: 'border border-black-400/50'
},
secondary: {
background: 'bg-brand-burnt-orange/50',
text: 'text-white/50',
border: 'border border-brand-burnt-orange-600/50'
}
};
const sizeVariant = {
Expand All @@ -64,6 +80,9 @@
text: disabled
? disabledVariantClasses[variant].text || variantClasses[variant].text
: variantClasses[variant].text,
border: disabled
? disabledVariantClasses[variant].border || variantClasses[variant].border
: variantClasses[variant].border,
disabled: 'cursor-not-allowed'
});
</script>
Expand All @@ -75,6 +94,7 @@
classes.common,
classes.background,
classes.text,
classes.border,
disabled && classes.disabled,
restProps.class
].join(' ')
Expand Down
Loading