### Start Development Server with Storybook
Source: https://github.com/warp-ds/elements/blob/next/CONTRIBUTING.md
Start a local development server using Storybook to preview components and test changes.
```sh
pnpm run storybook
```
--------------------------------
### Install Project Dependencies
Source: https://github.com/warp-ds/elements/blob/next/CONTRIBUTING.md
Install all necessary project dependencies using the pnpm package manager.
```sh
pnpm install
```
--------------------------------
### Install pnpm Package Manager
Source: https://github.com/warp-ds/elements/blob/next/CONTRIBUTING.md
Install the pnpm package manager globally using npm, or prepare it using corepack.
```sh
npm install -g pnpm
```
```sh
corepack prepare --activate
```
--------------------------------
### Textarea with Help Text Example (Storybook)
Source: https://github.com/warp-ds/elements/blob/next/packages/textarea/Textarea.mdx
Demonstrates the use of the 'help-text' property to display descriptive guidance below the Textarea. This enhances usability by providing context or instructions.
```javascript
### Help text
You can use the `help-text` property to show a descriptive message below the textarea.
```
--------------------------------
### Install @warp-ds/elements via pnpm
Source: https://github.com/warp-ds/elements/blob/next/docs/@warp-ds/Elements.mdx
Installs the @warp-ds/elements package using pnpm. Similar to npm installation, this aids in developer experience without bundling components into client-side code.
```sh
pnpm add @warp-ds/elements
```
--------------------------------
### WarpModal Detailed Example HTML
Source: https://github.com/warp-ds/elements/blob/next/packages/modal/README.md
A comprehensive HTML example of the WarpModal component, showcasing the use of various props like 'show', 'content-id', and 'ignore-backdrop-clicks'. It also demonstrates nesting a 'w-modal-header' with an image in the 'top' slot and a 'w-modal-footer' with a button.
```html
Open a modal
This is the main content of the modal. You can add any HTML content here.
OK
```
--------------------------------
### Attention Component Visual Examples
Source: https://github.com/warp-ds/elements/blob/next/pages/components/attention.html
Illustrations of the Attention component in various configurations like Popover, Tooltip, Callout, and Highlight.
```APIDOC
## Attention Component Visual Examples
### Description
Visual demonstrations of the Attention component's different display modes.
### Method
N/A (Visual Examples)
### Endpoint
N/A (Visual Examples)
### Parameters
None
### Visual Options
#### Popover
Click to toggle a popover I'm a popover
Click to toggle a popover I'm a popover
#### Popover with icon as target element
I'm a popover on bottom-end
I'm a popover on bottom-end
#### Tooltip
Hover or focus to show a tooltip I'm a tooltip
Hover or focus to show a tooltip I'm a tooltip
#### Callout
This is a target to callout attention element
Callout on right
This is a target to callout attention element
Callout on right
#### Highlight
Click to toggle a highlight I'm a highlight
Click to toggle a highlight I'm a highlight
```
--------------------------------
### Select Component Help Text Example
Source: https://github.com/warp-ds/elements/blob/next/packages/select/Select.mdx
Shows how to incorporate help text within the Select component to provide additional guidance to the user.
```javascript
### Help text
```
--------------------------------
### Alert Component HTML Example
Source: https://github.com/warp-ds/elements/blob/next/packages/alert/Alert.mdx
An example of the Alert component in HTML, demonstrating its structure, attributes like 'variant', 'show', and 'role', and content including a heading with an ARIA role and a paragraph. It also shows a nested button to control the alert's visibility.
```html
This is a "info" variant of the alert element
You see this warning because you did something wrong
Hide and show alert
```
--------------------------------
### Textarea with Placeholder Example (Storybook)
Source: https://github.com/warp-ds/elements/blob/next/packages/textarea/Textarea.mdx
Illustrates how to use placeholder text within a Textarea. Placeholder text offers a hint about expected input but should not replace a visible label.
```javascript
### Placeholder
Placeholder text can be used to describe the expected value or formatting for the w-textarea. Placeholder text will only appear when the w-textarea is empty, and should not be used as a substitute for labeling the element with a visible label.
```
--------------------------------
### Install @warp-ds/elements via npm
Source: https://github.com/warp-ds/elements/blob/next/docs/@warp-ds/Elements.mdx
Installs the @warp-ds/elements package using npm. This is useful for improved developer experience like types and intellisense, but the components should not be bundled into client-side application code.
```sh
npm install @warp-ds/elements
```
--------------------------------
### Install Playwright for Automated Tests
Source: https://github.com/warp-ds/elements/blob/next/CONTRIBUTING.md
Install Playwright, a tool for end-to-end testing, to run automated tests.
```sh
pnpm exec playwright install
```
--------------------------------
### Textarea Optional Field Example (Storybook)
Source: https://github.com/warp-ds/elements/blob/next/packages/textarea/Textarea.mdx
Shows how to mark a Textarea as optional. This indicates to the user that the field does not require input.
```javascript
Textareas can be marked optional.
```
--------------------------------
### W-textfield: Basic and Advanced Text Input Examples
Source: https://context7.com/warp-ds/elements/llms.txt
Demonstrates various configurations of the w-textfield component, including basic input, help text, validation states, read-only/disabled states, numeric input with constraints, prefix/suffix slots, and value formatting (masking).
```html
$.00
```
--------------------------------
### Textarea Controlled Size Example (Storybook)
Source: https://github.com/warp-ds/elements/blob/next/packages/textarea/Textarea.mdx
Demonstrates how to control the height of the Textarea by setting minimum and maximum rows. Setting a maximum row count disables user resizing.
```javascript
### Control the textarea height
By default the textarea is user-resizable, and adjusts its height to fit the content.
You can control the height of the textarea should you need to by setting both the minimum and maximum number of allowed rows.
Setting a maximum number of rows turns off the ability for the user to resize.
```
--------------------------------
### Storybook Canvas for Tabs - With Icons Example
Source: https://github.com/warp-ds/elements/blob/next/packages/tabs/Tabs.mdx
Displays the Tabs component with icon support in a Storybook canvas. This example demonstrates how icons can be integrated alongside tab labels to enhance usability and visual appeal.
```javascript
import { Canvas } from '@storybook/addon-docs/blocks';
import * as TabsStories from './tabs.stories';
```
--------------------------------
### W-select: Dropdown Selection Examples
Source: https://context7.com/warp-ds/elements/llms.txt
Illustrates the usage of the w-select component for single value selection from a list. Covers basic dropdowns, pre-selected values, help text, optional indicators, invalid states, disabled options, and handling change events.
```html
```
--------------------------------
### Select Component Validation Example
Source: https://github.com/warp-ds/elements/blob/next/packages/select/Select.mdx
Demonstrates how to implement input validation for the Select component. It shows how to use the `invalid` prop, often paired with `hint` for user feedback.
```javascript
## Validation
Inputs can communicate to the user whether the current value is invalid. Implement your own validation logic in your app and set the `invalid` prop to display it as invalid. `invalid` is often paired with `hint` to provide feedback to the user about the error.
```
--------------------------------
### Link Component Storybook Setup (TypeScript)
Source: https://github.com/warp-ds/elements/blob/next/packages/link/Link.mdx
Sets up the Storybook metadata for the Link component stories using TypeScript. It imports necessary blocks from '@storybook/addon-docs/blocks' and the specific stories for the Link component.
```typescript
import { Canvas, Meta } from '@storybook/addon-docs/blocks';
import * as LinkStories from './link.stories.ts';
```
--------------------------------
### Select Component Optional State Example
Source: https://github.com/warp-ds/elements/blob/next/packages/select/Select.mdx
Demonstrates the 'optional' state for the Select component, indicating that user input is not strictly required.
```javascript
### Optional
```
--------------------------------
### Implement collapsible content with w-expandable
Source: https://context7.com/warp-ds/elements/llms.txt
Shows how to use the w-expandable component for creating collapsible content sections with animated transitions. Examples cover basic usage, initially expanded states, animated transitions, box styling, custom title slots, and disabling the chevron indicator. An FAQ accordion pattern is also demonstrated.
```html
Hidden content is revealed when the title is clicked.
This section starts expanded.
Content slides in smoothly when expanded.
Box style adds a background container around the content.
Custom TitleNew
Content with custom title markup.
The expand indicator is hidden.
Click "Forgot Password" on the login page and follow the instructions.
We accept Visa, Mastercard, and PayPal.
Email us at support@example.com or use the chat widget.
```
--------------------------------
### Textarea Component Default Usage (Storybook)
Source: https://github.com/warp-ds/elements/blob/next/packages/textarea/Textarea.mdx
Demonstrates the default usage of the Textarea component within a Storybook environment. This serves as a basic example for integrating the component.
```javascript
import { Canvas, Meta } from '@storybook/addon-docs/blocks';
import * as TextareaStories from './textarea.stories';
# Textarea
Used to capture extended user input, such as messages, item descriptions, comments, or reviews. Unlike the Textfield component, Textarea offers a multiline, spacious input experience.
```
--------------------------------
### Storybook Canvas for Tabs - Many Tabs Example
Source: https://github.com/warp-ds/elements/blob/next/packages/tabs/Tabs.mdx
Showcases the Tabs component configured to handle a large number of tabs within a Storybook canvas. This example is useful for testing performance and layout when dealing with extensive tab content.
```javascript
import { Canvas } from '@storybook/addon-docs/blocks';
import * as TabsStories from './tabs.stories';
```
--------------------------------
### Create and style w-card components
Source: https://context7.com/warp-ds/elements/llms.txt
Illustrates the usage of the w-card component for content separation and navigation. Examples include basic elevated cards, flat cards with borders, and selectable cards. It also shows how to integrate cards into a grid layout.
```html
Product Name
Product description goes here.
Simple Card
Flat cards have a subtle border instead of elevation.
Premium Plan
$29/month - All features included
Option A
First choice
Option B
Second choice
Option C
Third choice
```
--------------------------------
### Generate Styles with UNO
Source: https://github.com/warp-ds/elements/blob/next/build/README.md
A temporary build script to generate a `styles.ts` file in each component folder based on UNO classes used in the component file. This is part of the ongoing transition to BEM for styling.
```shell
pnpm run build:styles
```
--------------------------------
### Textarea Disabled State Example (Storybook)
Source: https://github.com/warp-ds/elements/blob/next/packages/textarea/Textarea.mdx
Illustrates the disabled state of the Textarea. It advises against using 'disabled' due to potential accessibility issues and suggests alternatives. Disabled textareas cannot be resized.
```javascript
### Disabled
Keep in mind that using disabled in its current form is an anti-pattern. There will ALWAYS be users who don't understand why an element is disabled, or users who can't even see that it is disabled because of poor lighting conditions or other reasons. Please consider more informative alternatives before choosing to use disabled on an element.
A disabled textarea can not be resized by the user.
```
--------------------------------
### Create Production Bundle for Eik CDN
Source: https://github.com/warp-ds/elements/blob/next/build/README.md
Packages all components into a single, optimized file for upload to the Eik CDN. This bundle includes template minification and tersification for efficient delivery and consumption by all applications.
```shell
pnpm run build:bundle
```
--------------------------------
### Textarea without Visual Label Example (Storybook)
Source: https://github.com/warp-ds/elements/blob/next/packages/textarea/Textarea.mdx
Shows how to implement a Textarea without a visible label, relying on 'aria-label' for accessibility. This approach requires careful consideration of the surrounding context for clarity.
```javascript
### Without visual label
Take care to give the textarea an accessible label with `aria-label`. It should be obvious for sighted users what the textarea is for given its context.
```
--------------------------------
### Checkbox Component Examples (Storybook)
Source: https://github.com/warp-ds/elements/blob/next/packages/checkbox/Checkbox.mdx
Demonstrates various states and configurations of the Checkbox component using Storybook's Canvas block. This includes default, disabled, invalid, and indeterminate states, as well as checkbox group configurations with labels, help text, and validation.
```jsx
import { Canvas, Meta } from '@storybook/addon-docs/blocks';
import * as CheckboxStories from './checkbox.stories';
# Checkbox
Use checkboxes when a user can select one or more options from a list. Checkboxes can be used
individually or grouped under a shared label and help text using `w-checkbox-group`.
## Visual options
### States
### Indeterminate
Use the indeterminate state when a parent option represents a mixed set of child selections.
## Checkbox group
Use `w-checkbox-group` to add a shared label, help text, optional indicator, and required validation
that enforces at least one selection.
### Form association
Both `w-checkbox` and `w-checkbox-group` are form associated. The group is used for validation only.
Individual checkboxes provide the submitted values.
```
--------------------------------
### Select Component Read Only Example
Source: https://github.com/warp-ds/elements/blob/next/packages/select/Select.mdx
Illustrates the 'read-only' state for the Select component, making the selection immutable while allowing the field to remain focusable.
```javascript
### Read only
The read-only boolean attribute makes the selection immutable. Unlike disabled the field remains focusable.
```
--------------------------------
### Select Component No Label Example
Source: https://github.com/warp-ds/elements/blob/next/packages/select/Select.mdx
Shows how to handle the 'no label' scenario for the Select component, recommending the use of `aria-label` or an external `