Skip to content

Commit 7214a5c

Browse files
committed
refactor(list): move radio button template from list folder to radio-button-group folder
Move radio button template and styles from `list/radio-button/` to `radio-button-group/` to better organize radio button related code in a single location. Also added a comprehensive documentation to radio button template and marked it as `@internal` since it's not for direct consumer use.
1 parent 6d0c688 commit 7214a5c

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed

src/components/list/list-renderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { MenuItem } from '../menu/menu.types';
44
import { h } from '@stencil/core';
55
import { CheckboxTemplate } from '../checkbox/checkbox.template';
66
import { ListRendererConfig } from './list-renderer-config';
7-
import { RadioButtonTemplate } from './radio-button/radio-button.template';
7+
import { RadioButtonTemplate } from '../radio-button-group/radio-button.template';
88
import {
99
getIconColor,
1010
getIconName,

src/components/list/list.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ img {
310310

311311
@import '../checkbox/checkbox.scss';
312312

313-
@import './radio-button/radio-button.scss';
313+
@import '../radio-button-group/radio-button.scss';
314314

315315
@import './partial-styles/custom-styles.scss';
316316
@import './partial-styles/enable-multiline-text.scss';

src/components/radio-button-group/radio-button-group.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { LimelListCustomEvent } from '@limetech/lime-elements';
2929
*/
3030
@Component({
3131
tag: 'limel-radio-button-group',
32-
shadow: true,
32+
shadow: false,
3333
})
3434
export class RadioButtonGroup {
3535
/**
File renamed without changes.

src/components/list/radio-button/radio-button.template.tsx renamed to src/components/radio-button-group/radio-button.template.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
import { FunctionalComponent, h } from '@stencil/core';
22

3+
/**
4+
* Radio Button Template
5+
*
6+
* This is a low-level template component that renders individual radio button elements
7+
* using Material Design Components (MDC) styling and structure. It's used internally
8+
* by the list component to render radio buttons when `type="radio"` is specified.
9+
*
10+
* ## Usage in the Library
11+
*
12+
* This template is primarily used by:
13+
* - `limel-list` component when `type="radio"`
14+
* - `limel-radio-button-group` component (which wraps `limel-list`)
15+
*
16+
* ## Why This Exists
17+
*
18+
* While we have `limel-radio-button-group` for most use cases, this template provides
19+
* the actual radio button HTML structure with proper MDC classes and accessibility
20+
* attributes. It ensures consistent styling and behavior across all radio button
21+
* implementations in the library.
22+
*
23+
* ## Design Philosophy
24+
*
25+
* This follows the principle that individual radio buttons should not be standalone
26+
* components, as a single radio button is never useful in a UI. Instead, this template
27+
* is used to build groups of radio buttons through higher-level components.
28+
*
29+
* @internal
30+
*/
331
interface RadioButtonTemplateProps {
432
disabled?: boolean;
533
id: string;

0 commit comments

Comments
 (0)