From 33d51a6e51b8e6e04cdbc3f7b0ef8f97af1e8be2 Mon Sep 17 00:00:00 2001 From: Jaied Al Sabid <87969327+jaieds@users.noreply.github.com> Date: Thu, 6 Mar 2025 14:51:23 +0600 Subject: [PATCH 1/3] style: Update Radio button padding and gap --- src/components/radio-button/radio-button.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/components/radio-button/radio-button.tsx b/src/components/radio-button/radio-button.tsx index b3c02468..5b59b312 100644 --- a/src/components/radio-button/radio-button.tsx +++ b/src/components/radio-button/radio-button.tsx @@ -336,14 +336,17 @@ export const RadioButtonComponent = ( return (
{ icon && <>{ icon } } -
+

Date: Thu, 6 Mar 2025 14:54:50 +0600 Subject: [PATCH 2/3] Add a new story for the radio button --- .../radio-button/radio-button.stories.tsx | 224 +++++++++++++++++- 1 file changed, 223 insertions(+), 1 deletion(-) diff --git a/src/components/radio-button/radio-button.stories.tsx b/src/components/radio-button/radio-button.stories.tsx index 49fcee0f..50948e22 100644 --- a/src/components/radio-button/radio-button.stories.tsx +++ b/src/components/radio-button/radio-button.stories.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import RadioButton, { RadioButtonGroupProps } from './radio-button'; -import { Plus } from 'lucide-react'; +import { AppWindow, ChartNoAxesGantt, House, Infinity, Instagram, LogIn, Map, Newspaper, PanelLeftClose, PictureInPicture, Plus, Share2, UserPlus } from 'lucide-react'; import { Meta, StoryFn } from '@storybook/react'; import Badge from '../badge'; @@ -142,3 +142,225 @@ export const RadioWithBorderSmallSize = RadioWithBorderTemplate.bind( {} ); RadioWithBorderSmallSize.args = { size: 'sm', }; + +const defaultRadioButtonGroupData = [ + { + id: '1', + value: 'analytics', + icon: , + label: 'Login Form', + description: 'Demo', + toggleLabel: 'Enable', + hideSelection: true, + useSwitch: false, + bagde: ( + + ), + }, + { + id: '2', + value: 'notifications', + icon: , + label: 'Registration Form', + description: 'Demo', + toggleLabel: 'Disable', + hideSelection: true, + useSwitch: false, + bagde: ( + + ), + }, + { + id: '3', + value: 'settings', + icon: , + label: 'Instagram Feed', + description: 'Demo', + toggleLabel: 'Settings', + hideSelection: true, + useSwitch: false, + bagde: ( + + ), + }, + { + id: '4', + value: 'security', + icon: , + label: 'Loop Builder', + description: 'Demo', + toggleLabel: 'Security', + hideSelection: true, + useSwitch: false, + bagde: ( + + ), + }, + { + id: '5', + value: 'marketing', + icon: , + label: 'Marketing Button', + description: 'Demo', + toggleLabel: 'Billing', + hideSelection: false, + useSwitch: true, + }, + { + id: '6', + value: 'modal', + icon: , + label: 'Modal', + description: 'Demo', + toggleLabel: 'modal', + hideSelection: false, + useSwitch: true, + }, + { + id: '7', + value: 'socialshare', + icon: , + label: 'Social Share', + description: 'Demo', + toggleLabel: 'socialshare', + hideSelection: false, + useSwitch: true, + }, + { + id: '8', + value: 'Blockquote', + icon: , + label: 'Blockquote', + description: 'Demo', + toggleLabel: 'blockquote', + hideSelection: false, + useSwitch: true, + }, + { + id: '9', + value: 'contenttimeline', + icon: , + label: 'Content Timeline', + description: 'Demo', + toggleLabel: 'contenttimeline', + hideSelection: false, + useSwitch: true, + }, + { + id: '10', + value: 'googlemaps', + icon: , + label: 'Google Maps', + description: 'Demo', + toggleLabel: 'googlemaps', + hideSelection: false, + useSwitch: true, + bagde: ( + + ), + }, + { + id: '11', + value: 'lottieanimation', + icon: , + label: 'Lottie Animation', + description: 'Demo', + toggleLabel: 'lottieanimation', + hideSelection: false, + useSwitch: true, + }, + { + id: '12', + value: 'animations', + icon: , + label: 'Animations', + description: 'Documentation', + toggleLabel: 'animations', + hideSelection: false, + useSwitch: true, + bagde: ( + + ), + }, +]; + +const RadioButtonTileTemplate: StoryFn = () => { + return ( + { + return value; + } } + className="w-full gap-1" + > + { defaultRadioButtonGroupData.map( + ( option ) => ( + + ) + ) } + + ); +}; + +export const RadioButtonTile = RadioButtonTileTemplate.bind( {} ); From 61043b2c9586bf283c415c992b980343d110563a Mon Sep 17 00:00:00 2001 From: Jaied Al Sabid <87969327+jaieds@users.noreply.github.com> Date: Thu, 6 Mar 2025 15:01:56 +0600 Subject: [PATCH 3/3] Update radio-button.stories.tsx --- src/components/radio-button/radio-button.stories.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/radio-button/radio-button.stories.tsx b/src/components/radio-button/radio-button.stories.tsx index 50948e22..4493eed9 100644 --- a/src/components/radio-button/radio-button.stories.tsx +++ b/src/components/radio-button/radio-button.stories.tsx @@ -290,7 +290,7 @@ const defaultRadioButtonGroupData = [ icon={ null } variant="green" closable={ false } - className="py-0 mr-2" + className="py-0" /> ), }, @@ -320,7 +320,7 @@ const defaultRadioButtonGroupData = [ icon={ null } variant="yellow" closable={ false } - className="py-0 mr-2" + className="py-0" /> ), },