UNPKG

standards-ui

Version:

A foundational design system built with native Web Components. Includes comprehensive TypeScript types, JSDoc documentation, and component examples.

3,166 lines (1,005 loc) 50.6 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Home</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Home</h1> <h3> </h3> <section> <header> <h2>base-component.js</h2> </header> <article> <div class="container-overview"> <div class="description">Provides common functionality for all design system components including shadow DOM setup, event handling, and attribute management.</div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="base-component.js.html">base-component.js</a>, <a href="base-component.js.html#line1">line 1</a> </li></ul></dd> </dl> </div> </article> </section> <section> <header> <h2>ds-button.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-button` component provides a styled and functional button element. It supports various button types and variants while maintaining accessibility and proper event handling. The content inside `<ds-button>...</ds-button>` is rendered as the button label via the default slot. Allowed `variant` values: `primary`, `secondary`, `danger`. These control the button's visual style. Can be used inside a `<form>`. When `type="submit"`, it will submit the form like a native button. `name` and `value` attributes are included in form data. You can listen for standard events (`click`, `focus`, `blur`) on `<ds-button>` just like a native button, e.g. `addEventListener('click', ...)`. If no accessible name is provided (text content or ARIA), the component will warn in the console for accessibility compliance. The button is fully keyboard accessible and focusable by default. The native button uses `part="button"` for styling via the Shadow DOM: you can use `::part(button)` in your CSS.</div> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the type of the button.</td> </tr> <tr> <td class="name"><code>disabled</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the disabled state of the button.</td> </tr> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the name of the button.</td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the value of the button.</td> </tr> <tr> <td class="name"><code>variant</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the variant of the button.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-button.js.html">ds-button.js</a>, <a href="ds-button.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- Basic button --> &lt;ds-button>Click me&lt;/ds-button></code></pre> <pre class="prettyprint"><code>&lt;!-- Submit button with variant --> &lt;ds-button type="submit" variant="primary">Submit Form&lt;/ds-button></code></pre> <pre class="prettyprint"><code>&lt;!-- Disabled button --> &lt;ds-button disabled variant="secondary">Disabled Button&lt;/ds-button></code></pre> <pre class="prettyprint"><code>&lt;!-- Button with ARIA label --> &lt;ds-button aria-label="Close dialog">&lt;/ds-button></code></pre> <pre class="prettyprint"><code>&lt;!-- Listening for click event --> &lt;ds-button id="myBtn">Save&lt;/ds-button> &lt;script> document.getElementById('myBtn').addEventListener('click', () => alert('Clicked!')); &lt;/script></code></pre> </div> <h3 class="subsection-title">Extends</h3> <ul> <li><a href="BaseComponent.html">BaseComponent</a></li> </ul> </article> </section> <section> <header> <h2>ds-card.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-card` component displays its content in a styled card. It can be used as a static card or as a clickable card link. - The content inside `<ds-card>...</ds-card>` is rendered via the default slot. - If the `href` attribute is present, the card renders as a clickable link (`<a>`) with keyboard accessibility (Enter/Space to activate). - If `href` is not present, the card renders as a static `<div>`. - The card is always focusable and accessible by keyboard. - Uses CSS custom properties for background, border, radius, shadow, padding, and text color. - The card is styled via Shadow DOM; no `part` attribute is exposed.</div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-card.js.html">ds-card.js</a>, <a href="ds-card.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- Static card --> &lt;ds-card> &lt;h2>Card Title&lt;/h2> &lt;p>Some description or content.&lt;/p> &lt;/ds-card></code></pre> <pre class="prettyprint"><code>&lt;!-- Clickable card link --> &lt;ds-card href="https://example.com"> &lt;h2>Go to Example&lt;/h2> &lt;p>This card acts as a link.&lt;/p> &lt;/ds-card></code></pre> </div> </article> </section> <section> <header> <h2>ds-checkbox.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-checkbox` component provides a styled and functional checkbox. It supports both single checkboxes and groups of checkboxes for multiple selections.</div> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>checked</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the checked state of the checkbox.</td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the value of the checkbox.</td> </tr> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the name of the checkbox.</td> </tr> <tr> <td class="name"><code>disabled</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the disabled state of the checkbox.</td> </tr> <tr> <td class="name"><code>readonly</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the readonly state of the checkbox.</td> </tr> <tr> <td class="name"><code>required</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the required state of the checkbox.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-checkbox.js.html">ds-checkbox.js</a>, <a href="ds-checkbox.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- Basic checkbox --> &lt;ds-checkbox name="agree" value="yes" id="agree-terms">I agree to the terms&lt;/ds-checkbox></code></pre> <pre class="prettyprint"><code>&lt;!-- Checkbox with default selection --> &lt;ds-checkbox name="newsletter" value="subscribe" checked>Subscribe to newsletter&lt;/ds-checkbox></code></pre> <pre class="prettyprint"><code>&lt;!-- Multiple checkboxes for preferences --> &lt;ds-checkbox name="preferences" value="email">Email notifications&lt;/ds-checkbox> &lt;ds-checkbox name="preferences" value="sms">SMS notifications&lt;/ds-checkbox> &lt;ds-checkbox name="preferences" value="push">Push notifications&lt;/ds-checkbox></code></pre> </div> <h3 class="subsection-title">Extends</h3> <ul> <li><a href="BaseComponent.html">BaseComponent</a></li> </ul> </article> </section> <section> <header> <h2>ds-col.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-col` component serves dual purposes: as a flex item within a row and as a flex container for its own children. It exposes both flex item properties (for positioning within parent rows) and flex container properties (for its own children). - The content inside `<ds-col>...</ds-col>` is rendered via the default slot. - The column is a flex item (relative to its parent) and a flex container (`display: flex; flex-direction: column`) for its children. - Supports ARIA attributes: `aria-label`, `aria-describedby` for accessibility. - No role is set by default; set ARIA attributes as needed for context. - The component is styled via Shadow DOM; no `part` attribute is exposed. - No custom events are fired.</div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-col.js.html">ds-col.js</a>, <a href="ds-col.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- A basic column with default flex properties --> &lt;ds-row> &lt;ds-col> &lt;div>Content 1&lt;/div> &lt;div>Content 2&lt;/div> &lt;/ds-col> &lt;/ds-row></code></pre> <pre class="prettyprint"><code>&lt;!-- A column that takes up 2/3 of available space with centered content --> &lt;ds-row> &lt;ds-col flex-grow="2" justify-content="center" align-items="center"> &lt;div>Main Content&lt;/div> &lt;/ds-col> &lt;ds-col flex-grow="1"> &lt;div>Sidebar&lt;/div> &lt;/ds-col> &lt;/ds-row></code></pre> <pre class="prettyprint"><code>&lt;!-- A column with specific width and gap between items --> &lt;ds-col flex-basis="300px" gap="16px"> &lt;div>Item A&lt;/div> &lt;div>Item B&lt;/div> &lt;div>Item C&lt;/div> &lt;/ds-col></code></pre> </div> </article> </section> <section> <header> <h2>ds-fieldset.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-fieldset` component provides a styled and functional fieldset element for grouping related form controls together. It creates a visual and semantic grouping that improves form organization and accessibility. - The content inside `<ds-fieldset>...</ds-fieldset>` is rendered via the default slot as the fieldset content. - Should contain a `<ds-legend>` or native `<legend>` as the first child for accessibility. - Supports ARIA attributes: `aria-label`, `aria-describedby` for accessibility. - Uses `part="fieldset"` for styling via Shadow DOM. - Warns in the console if no accessible name (legend or `aria-label`) is provided. - No custom events are fired.</div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-fieldset.js.html">ds-fieldset.js</a>, <a href="ds-fieldset.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- Basic fieldset --> &lt;ds-fieldset> &lt;ds-legend>Personal Information&lt;/ds-legend> &lt;ds-label for="first-name">First Name&lt;/ds-label> &lt;ds-text-input id="first-name" name="firstName">&lt;/ds-text-input> &lt;ds-label for="last-name">Last Name&lt;/ds-label> &lt;ds-text-input id="last-name" name="lastName">&lt;/ds-text-input> &lt;/ds-fieldset></code></pre> <pre class="prettyprint"><code>&lt;!-- Fieldset with radio buttons --> &lt;ds-fieldset> &lt;ds-legend>Gender&lt;/ds-legend> &lt;ds-radio name="gender" value="male" id="male">Male&lt;/ds-radio> &lt;ds-radio name="gender" value="female" id="female">Female&lt;/ds-radio> &lt;ds-radio name="gender" value="other" id="other">Other&lt;/ds-radio> &lt;/ds-fieldset></code></pre> <pre class="prettyprint"><code>&lt;!-- Fieldset with checkboxes --> &lt;ds-fieldset> &lt;ds-legend>Interests&lt;/ds-legend> &lt;ds-checkbox name="interests" value="sports" id="sports">Sports&lt;/ds-checkbox> &lt;ds-checkbox name="interests" value="music" id="music">Music&lt;/ds-checkbox> &lt;ds-checkbox name="interests" value="reading" id="reading">Reading&lt;/ds-checkbox> &lt;/ds-fieldset></code></pre> </div> </article> </section> <section> <header> <h2>ds-form.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-form` component provides a styled and functional form element with enhanced accessibility features, validation support, and error state management. It wraps a native form element to maintain full HTML form semantics while adding design system styling and ARIA compliance features.</div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-form.js.html">ds-form.js</a>, <a href="ds-form.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- Basic form --> &lt;ds-form action="/api/login" method="post"> &lt;ds-fieldset> &lt;ds-legend>Login Information&lt;/ds-legend> &lt;ds-label for="username">Username&lt;/ds-label> &lt;ds-text-input id="username" name="username" required>&lt;/ds-text-input> &lt;ds-label for="password">Password&lt;/ds-label> &lt;ds-text-input id="password" name="password" type="password" required>&lt;/ds-text-input> &lt;/ds-fieldset> &lt;ds-button type="submit">Login&lt;/ds-button> &lt;/ds-form></code></pre> <pre class="prettyprint"><code>&lt;!-- Form with ARIA attributes --> &lt;ds-form action="/api/register" method="post" aria-label="User registration form" aria-describedby="form-instructions"> &lt;div id="form-instructions">Please fill out all required fields marked with an asterisk (*)&lt;/div> &lt;ds-fieldset> &lt;ds-legend>Personal Information&lt;/ds-legend> &lt;ds-label for="firstName">First Name *&lt;/ds-label> &lt;ds-text-input id="firstName" name="firstName" required>&lt;/ds-text-input> &lt;/ds-fieldset> &lt;ds-button type="submit">Register&lt;/ds-button> &lt;/ds-form></code></pre> <pre class="prettyprint"><code>&lt;!-- Form with custom validation --> &lt;ds-form action="/api/contact" method="post" novalidate data-validation="custom"> &lt;ds-fieldset> &lt;ds-legend>Contact Information&lt;/ds-legend> &lt;ds-label for="email">Email Address&lt;/ds-label> &lt;ds-text-input id="email" name="email" type="email" required>&lt;/ds-text-input> &lt;/ds-fieldset> &lt;ds-button type="submit">Send Message&lt;/ds-button> &lt;/ds-form></code></pre> </div> <h3 class="subsection-title">Extends</h3> <ul> <li><a href="BaseComponent.html">BaseComponent</a></li> </ul> </article> </section> <section> <header> <h2>ds-label.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-label` component provides a styled and functional label element for associating text with form controls. It supports the `for` attribute to create explicit associations with form elements. - The content inside `<ds-label>...</ds-label>` is rendered via the default slot as the label text. - Supports the `for` attribute to associate the label with a form control by ID (like native `<label>`). - Supports ARIA attributes: `aria-label`, `aria-describedby` for accessibility. - Uses `part="label"` for styling via Shadow DOM. - Fires a `click` event when the label is clicked (native label behavior). - Warns in the console if no accessible name is provided, or if `for` references a missing element.</div> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>htmlFor</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the ID of the associated form control.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-label.js.html">ds-label.js</a>, <a href="ds-label.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- Basic label --> &lt;ds-label>Username&lt;/ds-label></code></pre> <pre class="prettyprint"><code>&lt;!-- Label with explicit association --> &lt;ds-label for="username-input">Username&lt;/ds-label> &lt;ds-text-input id="username-input">&lt;/ds-text-input></code></pre> <pre class="prettyprint"><code>&lt;!-- Label with form control --> &lt;ds-label for="email-field">Email Address&lt;/ds-label> &lt;ds-text-input type="email" id="email-field" required>&lt;/ds-text-input></code></pre> <pre class="prettyprint"><code>&lt;!-- Label with checkbox --> &lt;ds-label for="agree-terms">I agree to the terms and conditions&lt;/ds-label> &lt;ds-checkbox id="agree-terms" name="agree" value="yes">&lt;/ds-checkbox></code></pre> </div> </article> </section> <section> <header> <h2>ds-legend.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-legend` component provides a styled and functional legend element for providing a caption or title for a fieldset. It should be used within `<ds-fieldset>` components to describe the group of form controls. - The content inside `<ds-legend>...</ds-legend>` is rendered via the default slot as the legend text. - Should be used as the first child of a `<ds-fieldset>` for proper semantics. - Supports ARIA attributes: `aria-label`, `aria-describedby` for accessibility. - Uses `part="legend"` for styling via Shadow DOM. - Warns in the console if no accessible name (text or `aria-label`) is provided. - No custom events are fired.</div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-legend.js.html">ds-legend.js</a>, <a href="ds-legend.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- Basic legend within fieldset --> &lt;ds-fieldset> &lt;ds-legend>Contact Information&lt;/ds-legend> &lt;ds-label for="email">Email&lt;/ds-label> &lt;ds-text-input type="email" id="email" name="email">&lt;/ds-text-input> &lt;/ds-fieldset></code></pre> <pre class="prettyprint"><code>&lt;!-- Legend with form controls --> &lt;ds-fieldset> &lt;ds-legend>Shipping Address&lt;/ds-legend> &lt;ds-label for="street">Street Address&lt;/ds-label> &lt;ds-text-input id="street" name="street">&lt;/ds-text-input> &lt;ds-label for="city">City&lt;/ds-label> &lt;ds-text-input id="city" name="city">&lt;/ds-text-input> &lt;ds-label for="zip">ZIP Code&lt;/ds-label> &lt;ds-text-input id="zip" name="zip">&lt;/ds-text-input> &lt;/ds-fieldset></code></pre> <pre class="prettyprint"><code>&lt;!-- Legend with radio button group --> &lt;ds-fieldset> &lt;ds-legend>Preferred Contact Method&lt;/ds-legend> &lt;ds-radio name="contact" value="email" id="contact-email">Email&lt;/ds-radio> &lt;ds-radio name="contact" value="phone" id="contact-phone">Phone&lt;/ds-radio> &lt;ds-radio name="contact" value="mail" id="contact-mail">Mail&lt;/ds-radio> &lt;/ds-fieldset></code></pre> </div> </article> </section> <section> <header> <h2>ds-option.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-option` component provides a styled and functional option element for use within `<ds-select>` components. It maintains proper option behavior and can be used as an alternative to native `<option>` elements.</div> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the value of the option.</td> </tr> <tr> <td class="name"><code>selected</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the selected state of the option.</td> </tr> <tr> <td class="name"><code>disabled</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the disabled state of the option.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-option.js.html">ds-option.js</a>, <a href="ds-option.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- Basic option --> &lt;ds-option value="option1">Option 1&lt;/ds-option></code></pre> <pre class="prettyprint"><code>&lt;!-- Pre-selected option --> &lt;ds-option value="default" selected>Default Option&lt;/ds-option></code></pre> <pre class="prettyprint"><code>&lt;!-- Disabled option --> &lt;ds-option value="disabled" disabled>Disabled Option&lt;/ds-option></code></pre> <pre class="prettyprint"><code>&lt;!-- Usage within ds-select --> &lt;ds-select name="category"> &lt;ds-option value="electronics">Electronics&lt;/ds-option> &lt;ds-option value="clothing">Clothing&lt;/ds-option> &lt;ds-option value="books">Books&lt;/ds-option> &lt;/ds-select></code></pre> </div> <h3 class="subsection-title">Extends</h3> <ul> <li><a href="BaseComponent.html">BaseComponent</a></li> </ul> </article> </section> <section> <header> <h2>ds-page.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-page` component handles page-level layout and margins, providing a consistent foundation for application pages. It uses CSS custom properties for customization and ensures proper viewport handling. - The content inside `<ds-page>...</ds-page>` is rendered via the default slot. - Uses a `<main>` element for the page container, providing a landmark for accessibility/screen readers. - Uses CSS custom properties for layout customization: - `--ds-spacing-page-padding` (default: 20px) — padding for the page container - `--ds-page-max-width` (default: 1200px) — max width for the content - The component is styled via Shadow DOM; no `part` attribute is exposed. - No custom events are fired.</div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-page.js.html">ds-page.js</a>, <a href="ds-page.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- Basic page wrapper --> &lt;ds-page> &lt;h1>Welcome to My App&lt;/h1> &lt;p>This content is wrapped in a consistent page layout.&lt;/p> &lt;/ds-page></code></pre> <pre class="prettyprint"><code>&lt;!-- Page with nested layout components --> &lt;ds-page> &lt;ds-row justify-content="space-between" align-items="center"> &lt;ds-col> &lt;h1>Page Title&lt;/h1> &lt;/ds-col> &lt;ds-col> &lt;ds-button>Action&lt;/ds-button> &lt;/ds-col> &lt;/ds-row> &lt;ds-row> &lt;ds-col> &lt;p>Main content area&lt;/p> &lt;/ds-col> &lt;/ds-row> &lt;/ds-page></code></pre> </div> </article> </section> <section> <header> <h2>ds-radio.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-radio` component provides a styled and functional radio button. It maintains proper radio button behavior where only one option in a group can be selected.</div> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>checked</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the checked state of the radio button.</td> </tr> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the value of the radio button.</td> </tr> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the name of the radio button.</td> </tr> <tr> <td class="name"><code>disabled</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the disabled state of the radio button.</td> </tr> <tr> <td class="name"><code>readonly</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the readonly state of the radio button.</td> </tr> <tr> <td class="name"><code>required</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the required state of the radio button.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-radio.js.html">ds-radio.js</a>, <a href="ds-radio.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- Basic radio button group --> &lt;ds-radio name="gender" value="male" id="male">Male&lt;/ds-radio> &lt;ds-radio name="gender" value="female" id="female">Female&lt;/ds-radio> &lt;ds-radio name="gender" value="other" id="other">Other&lt;/ds-radio></code></pre> <pre class="prettyprint"><code>&lt;!-- Radio button with default selection --> &lt;ds-radio name="preference" value="option1" checked>Option 1&lt;/ds-radio> &lt;ds-radio name="preference" value="option2">Option 2&lt;/ds-radio></code></pre> <pre class="prettyprint"><code>&lt;!-- Disabled radio button --> &lt;ds-radio name="status" value="inactive" disabled>Inactive&lt;/ds-radio></code></pre> </div> <h3 class="subsection-title">Extends</h3> <ul> <li><a href="BaseComponent.html">BaseComponent</a></li> </ul> </article> </section> <section> <header> <h2>ds-row.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-row` component provides a flexible container for arranging items in a row. It leverages CSS Flexbox properties, exposing them as attributes for easy configuration. - The content inside `<ds-row>...</ds-row>` is rendered via the default slot. - The row is a flex container (`display: flex; flex-direction: row`). - Supports ARIA attributes: `aria-label`, `aria-describedby` for accessibility. - No role is set by default; set ARIA attributes as needed for context. - The component is styled via Shadow DOM; no `part` attribute is exposed. - No custom events are fired.</div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-row.js.html">ds-row.js</a>, <a href="ds-row.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- A basic row with default alignment and spacing --> &lt;ds-row> &lt;div>Item 1&lt;/div> &lt;div>Item 2&lt;/div> &lt;/ds-row></code></pre> <pre class="prettyprint"><code>&lt;!-- A row with items centered and a specific gap --> &lt;ds-row justify-content="center" align-items="center" gap="20px"> &lt;div>Centered Item A&lt;/div> &lt;div>Centered Item B&lt;/div> &lt;/ds-row></code></pre> <pre class="prettyprint"><code>&lt;!-- A wrapping row with space between items --> &lt;ds-row justify-content="space-between" wrap> &lt;div>Long Item 1&lt;/div> &lt;div>Item 2&lt;/div> &lt;div>Another Item 3&lt;/div> &lt;div>Short Item 4&lt;/div> &lt;/ds-row></code></pre> </div> </article> </section> <section> <header> <h2>ds-select.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-select` component provides a styled and functional select dropdown. It supports both single and multiple selection, and can work with both native `<option>` elements and custom `<ds-option>` components.</div> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the currently selected option's value.</td> </tr> <tr> <td class="name"><code>disabled</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the disabled state of the select.</td> </tr> <tr> <td class="name"><code>required</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the required state of the select.</td> </tr> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the name of the select.</td> </tr> <tr> <td class="name"><code>multiple</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the multiple selection state.</td> </tr> <tr> <td class="name"><code>size</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Gets or sets the number of visible options.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-select.js.html">ds-select.js</a>, <a href="ds-select.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- Basic select with native options --> &lt;ds-select name="country"> &lt;option value="us">United States&lt;/option> &lt;option value="ca">Canada&lt;/option> &lt;option value="uk">United Kingdom&lt;/option> &lt;/ds-select></code></pre> <pre class="prettyprint"><code>&lt;!-- Select with custom ds-option components --> &lt;ds-select name="category" required> &lt;ds-option value="electronics">Electronics&lt;/ds-option> &lt;ds-option value="clothing">Clothing&lt;/ds-option> &lt;ds-option value="books">Books&lt;/ds-option> &lt;/ds-select></code></pre> <pre class="prettyprint"><code>&lt;!-- Multiple selection select --> &lt;ds-select name="interests" multiple size="4"> &lt;ds-option value="sports">Sports&lt;/ds-option> &lt;ds-option value="music">Music&lt;/ds-option> &lt;ds-option value="reading">Reading&lt;/ds-option> &lt;ds-option value="travel">Travel&lt;/ds-option> &lt;/ds-select></code></pre> </div> <h3 class="subsection-title">Extends</h3> <ul> <li><a href="BaseComponent.html">BaseComponent</a></li> </ul> </article> </section> <section> <header> <h2>ds-text-input.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-text-input` component provides a styled and functional text input field. It mirrors common `<input>` attributes and properties, making it easy to use within forms while leveraging the design system's styling.</div> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the current value of the input.</td> </tr> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the type of the input.</td> </tr> <tr> <td class="name"><code>disabled</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the disabled state of the input.</td> </tr> <tr> <td class="name"><code>readonly</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the readonly state of the input.</td> </tr> <tr> <td class="name"><code>required</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the required state of the input.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-text-input.js.html">ds-text-input.js</a>, <a href="ds-text-input.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- Basic text input --> &lt;ds-text-input placeholder="Enter your name" id="username-input">&lt;/ds-text-input> &lt;ds-label for="username-input">Username&lt;/ds-label></code></pre> <pre class="prettyprint"><code>&lt;!-- Password input that is required --> &lt;ds-text-input type="password" required placeholder="Your password">&lt;/ds-text-input></code></pre> <pre class="prettyprint"><code>&lt;!-- Disabled email input with a pre-filled value --> &lt;ds-text-input type="email" value="example@domain.com" disabled>&lt;/ds-text-input></code></pre> </div> <h3 class="subsection-title">Extends</h3> <ul> <li><a href="BaseComponent.html">BaseComponent</a></li> </ul> </article> </section> <section> <header> <h2>ds-textarea.js</h2> </header> <article> <div class="container-overview"> <div class="description">The `ds-textarea` component provides a styled and functional textarea for multi-line text input. It supports various textarea attributes and properties while maintaining accessibility and proper event handling.</div> <h5 class="subsection-title">Properties:</h5> <table class="props"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the current value of the textarea.</td> </tr> <tr> <td class="name"><code>placeholder</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the placeholder text of the textarea.</td> </tr> <tr> <td class="name"><code>rows</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Gets or sets the number of rows in the textarea.</td> </tr> <tr> <td class="name"><code>cols</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Gets or sets the number of columns in the textarea.</td> </tr> <tr> <td class="name"><code>disabled</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the disabled state of the textarea.</td> </tr> <tr> <td class="name"><code>readonly</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the readonly state of the textarea.</td> </tr> <tr> <td class="name"><code>required</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Gets or sets the required state of the textarea.</td> </tr> <tr> <td class="name"><code>name</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Gets or sets the name of the textarea.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="ds-textarea.js.html">ds-textarea.js</a>, <a href="ds-textarea.js.html#line1">line 1</a> </li></ul></dd> </dl> <h3>Examples</h3> <pre class="prettyprint"><code>&lt;!-- Basic textarea --> &lt;ds-textarea placeholder="Enter your message" rows="4" cols="50">&lt;/ds-textarea></code></pre> <pre class="prettyprint"><code>&lt;!-- Required textarea with pre-filled value --> &lt;ds-textarea value="Default text" required rows="6">Enter description&lt;/ds-textarea></code></pre> <pre class="prettyprint"><code>&lt;!-- Disabled textarea --> &lt;ds-textarea value="Read-only content" disabled rows="3">&lt;/ds-textarea></code></pre> </div> <h3 class="subsection-title">Extends</h3>