Skip to content

Commit

Permalink
cleaned up
Browse files Browse the repository at this point in the history
  • Loading branch information
smmr-dn committed Aug 15, 2024
1 parent 58223be commit 811c4af
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
21 changes: 11 additions & 10 deletions apps/css-workshop/src/components/Radio.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@ type Props = {
name: string;
} & astroHTML.JSX.HTMLAttributes;
const { status, class: className, disabled, name, ...props } = Astro.props;
const inputProps = {
['class:list']: ['iui-radio', className],
type: 'radio',
disabled,
name,
...props,
} as astroHTML.JSX.InputHTMLAttributes;
const { status, class: className, disabled, name, checked, ...props } = Astro.props;
---

<label
Expand All @@ -27,7 +19,16 @@ const inputProps = {
},
]}
>
<input {...inputProps} />
<input
class:list={['iui-radio', className]}
,
type='radio'
,
disabled={disabled}
,
name,
checked={checked}
/>
<span class='iui-radio-label'>
<slot />
</span>
Expand Down
8 changes: 4 additions & 4 deletions apps/css-workshop/src/pages/radio.astro
Original file line number Diff line number Diff line change
Expand Up @@ -226,19 +226,19 @@ import Radio_ from '../components/Radio.astro';
</label>
<label class='iui-radio-wrapper'>
<span class='iui-radio-label'>Option 2</span>
<input class='iui-radio' type='radio' name='radio-demo-12' value='option-2' checked />
<input class='iui-radio' type='radio' name='radio-demo-12' value='option-2' />
</label>
<label class='iui-radio-wrapper iui-positive'>
<span class='iui-radio-label'>Option 3</span>
<input class='iui-radio' type='radio' name='radio-demo-12' value='option-3' checked />
<input class='iui-radio' type='radio' name='radio-demo-12' value='option-3' />
</label>
<label class='iui-radio-wrapper iui-warning'>
<span class='iui-radio-label'>Option 4</span>
<input class='iui-radio' type='radio' name='radio-demo-12' value='option-4' checked />
<input class='iui-radio' type='radio' name='radio-demo-12' value='option-4' />
</label>
<label class='iui-radio-wrapper iui-negative'>
<span class='iui-radio-label'>Option 5</span>
<input class='iui-radio' type='radio' name='radio-demo-12' value='option-5' checked />
<input class='iui-radio' type='radio' name='radio-demo-12' value='option-5' />
</label>
</div>

Expand Down
1 change: 0 additions & 1 deletion apps/css-workshop/src/pages/toast.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import Layout from './_layout.astro';
import Anchor_ from '../components/Anchor.astro';
import IconButton_ from '../components/IconButton.astro';
import Radio_ from '../components/Radio.astro';
---

<Layout title='Toast notification'>
Expand Down

0 comments on commit 811c4af

Please sign in to comment.