@dtlvmw/react 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +457 -0
- package/dist/index.js +772 -0
- package/guidelines/Guidelines.md +53 -0
- package/guidelines/components/accordion.md +109 -0
- package/guidelines/components/alert.md +107 -0
- package/guidelines/components/badge-label.md +100 -0
- package/guidelines/components/breadcrumbs.md +45 -0
- package/guidelines/components/button.md +77 -0
- package/guidelines/components/card.md +78 -0
- package/guidelines/components/dropdown.md +75 -0
- package/guidelines/components/forms.md +133 -0
- package/guidelines/components/header.md +59 -0
- package/guidelines/components/icon.md +64 -0
- package/guidelines/components/login.md +59 -0
- package/guidelines/components/modal.md +87 -0
- package/guidelines/components/progress.md +75 -0
- package/guidelines/components/spinner.md +52 -0
- package/guidelines/components/stack-view.md +57 -0
- package/guidelines/components/table.md +76 -0
- package/guidelines/components/tabs.md +70 -0
- package/guidelines/components/timeline.md +87 -0
- package/guidelines/components/wizard.md +160 -0
- package/guidelines/design-tokens/colors.md +21 -0
- package/guidelines/design-tokens/spacing.md +15 -0
- package/guidelines/design-tokens/typography.md +11 -0
- package/guidelines/overview-components.md +48 -0
- package/guidelines/tier2/combobox.md +48 -0
- package/guidelines/tier2/datagrid.md +62 -0
- package/guidelines/tier2/datepicker.md +26 -0
- package/guidelines/tier2/overview.md +69 -0
- package/guidelines/tier2/popovers.md +81 -0
- package/guidelines/tier2/stepper.md +39 -0
- package/guidelines/tier2/tree-view.md +45 -0
- package/guidelines/tier2/vertical-nav.md +52 -0
- package/package.json +52 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Forms
|
|
2
|
+
|
|
3
|
+
Standard HTML form elements styled with Clarity CSS.
|
|
4
|
+
|
|
5
|
+
## HTML/CSS Template
|
|
6
|
+
|
|
7
|
+
### Text Input
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<div class="clr-form-control">
|
|
11
|
+
<label class="clr-control-label">Username</label>
|
|
12
|
+
<div class="clr-control-container">
|
|
13
|
+
<div class="clr-input-wrapper">
|
|
14
|
+
<input type="text" class="clr-input" placeholder="Enter username" />
|
|
15
|
+
</div>
|
|
16
|
+
<span class="clr-subtext">Helper text here</span>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<!-- Error state -->
|
|
21
|
+
<div class="clr-form-control clr-error">
|
|
22
|
+
<label class="clr-control-label">Email</label>
|
|
23
|
+
<div class="clr-control-container">
|
|
24
|
+
<div class="clr-input-wrapper">
|
|
25
|
+
<input type="email" class="clr-input" />
|
|
26
|
+
</div>
|
|
27
|
+
<span class="clr-subtext">Invalid email address</span>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<!-- Success state -->
|
|
32
|
+
<div class="clr-form-control clr-success">
|
|
33
|
+
<label class="clr-control-label">Name</label>
|
|
34
|
+
<div class="clr-control-container">
|
|
35
|
+
<div class="clr-input-wrapper">
|
|
36
|
+
<input type="text" class="clr-input" />
|
|
37
|
+
</div>
|
|
38
|
+
<span class="clr-subtext">Looks good!</span>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Select
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<div class="clr-form-control">
|
|
47
|
+
<label class="clr-control-label">Country</label>
|
|
48
|
+
<div class="clr-control-container">
|
|
49
|
+
<div class="clr-select-wrapper">
|
|
50
|
+
<select class="clr-select">
|
|
51
|
+
<option>USA</option>
|
|
52
|
+
<option>Canada</option>
|
|
53
|
+
</select>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Checkbox
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<div class="clr-form-control">
|
|
63
|
+
<div class="clr-control-container">
|
|
64
|
+
<div class="clr-checkbox-wrapper">
|
|
65
|
+
<input type="checkbox" class="clr-checkbox" id="cb1" />
|
|
66
|
+
<label class="clr-control-label" for="cb1">Accept terms</label>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<!-- Inline checkboxes -->
|
|
72
|
+
<div class="clr-form-control">
|
|
73
|
+
<div class="clr-control-container clr-control-inline">
|
|
74
|
+
<div class="clr-checkbox-wrapper">
|
|
75
|
+
<input type="checkbox" class="clr-checkbox" id="cb2" />
|
|
76
|
+
<label class="clr-control-label" for="cb2">Option A</label>
|
|
77
|
+
</div>
|
|
78
|
+
<div class="clr-checkbox-wrapper">
|
|
79
|
+
<input type="checkbox" class="clr-checkbox" id="cb3" />
|
|
80
|
+
<label class="clr-control-label" for="cb3">Option B</label>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Toggle
|
|
87
|
+
|
|
88
|
+
```html
|
|
89
|
+
<div class="clr-form-control">
|
|
90
|
+
<div class="clr-control-container">
|
|
91
|
+
<div class="clr-toggle-wrapper">
|
|
92
|
+
<input type="checkbox" class="clr-toggle" id="tg1" />
|
|
93
|
+
<label class="clr-control-label" for="tg1">Enable notifications</label>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### CSS Classes
|
|
100
|
+
|
|
101
|
+
| Class | Description |
|
|
102
|
+
|-------|-------------|
|
|
103
|
+
| `clr-form-control` | Outer form control wrapper |
|
|
104
|
+
| `clr-control-label` | Label text |
|
|
105
|
+
| `clr-control-container` | Inner container |
|
|
106
|
+
| `clr-input-wrapper` | Wraps text input |
|
|
107
|
+
| `clr-input` | Text input element |
|
|
108
|
+
| `clr-select-wrapper` | Wraps select element |
|
|
109
|
+
| `clr-select` | Select element |
|
|
110
|
+
| `clr-checkbox-wrapper` | Wraps checkbox |
|
|
111
|
+
| `clr-checkbox` | Checkbox input |
|
|
112
|
+
| `clr-toggle-wrapper` | Wraps toggle switch |
|
|
113
|
+
| `clr-toggle` | Toggle input |
|
|
114
|
+
| `clr-subtext` | Helper/error text |
|
|
115
|
+
| `clr-error` | Error state (on `clr-form-control`) |
|
|
116
|
+
| `clr-success` | Success state (on `clr-form-control`) |
|
|
117
|
+
| `clr-control-inline` | Inline layout for checkboxes/radios |
|
|
118
|
+
|
|
119
|
+
## React Components
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
import { Input, Select, Checkbox, Toggle } from '@dtlvmw/react';
|
|
123
|
+
|
|
124
|
+
<Input label="Username" placeholder="Enter username" helperText="Required" />
|
|
125
|
+
<Input label="Email" state="error" errorText="Invalid email" />
|
|
126
|
+
<Select label="Country">
|
|
127
|
+
<option>USA</option>
|
|
128
|
+
<option>Canada</option>
|
|
129
|
+
</Select>
|
|
130
|
+
<Checkbox label="Accept terms" />
|
|
131
|
+
<Checkbox label="Option A" inline />
|
|
132
|
+
<Toggle label="Enable notifications" />
|
|
133
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Header
|
|
2
|
+
|
|
3
|
+
Application header with branding, navigation, and actions.
|
|
4
|
+
|
|
5
|
+
## HTML/CSS Template
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<header class="header header-6">
|
|
9
|
+
<div class="branding">
|
|
10
|
+
<a href="#" class="nav-link">
|
|
11
|
+
<cds-icon shape="vm-bug"></cds-icon>
|
|
12
|
+
<span class="title">App Name</span>
|
|
13
|
+
</a>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="header-nav">
|
|
16
|
+
<a href="#" class="nav-link active"><span class="nav-text">Dashboard</span></a>
|
|
17
|
+
<a href="#" class="nav-link"><span class="nav-text">Settings</span></a>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="header-actions">
|
|
20
|
+
<a href="#" class="nav-link">
|
|
21
|
+
<cds-icon shape="user"></cds-icon>
|
|
22
|
+
</a>
|
|
23
|
+
</div>
|
|
24
|
+
</header>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### CSS Classes
|
|
28
|
+
|
|
29
|
+
| Class | Description |
|
|
30
|
+
|-------|-------------|
|
|
31
|
+
| `header` | Base header (required) |
|
|
32
|
+
| `header-1` through `header-8` | Color variants |
|
|
33
|
+
| `branding` | Logo/title section |
|
|
34
|
+
| `header-nav` | Navigation links |
|
|
35
|
+
| `header-actions` | Action buttons (right side) |
|
|
36
|
+
| `nav-link` | Navigation link |
|
|
37
|
+
| `nav-text` | Link text |
|
|
38
|
+
| `active` | Active nav indicator |
|
|
39
|
+
|
|
40
|
+
## React Component
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { Header, HeaderBranding, HeaderNav, HeaderActions } from '@dtlvmw/react';
|
|
44
|
+
|
|
45
|
+
<Header color={6}>
|
|
46
|
+
<HeaderBranding>
|
|
47
|
+
<a className="nav-link">
|
|
48
|
+
<span className="title">My App</span>
|
|
49
|
+
</a>
|
|
50
|
+
</HeaderBranding>
|
|
51
|
+
<HeaderNav>
|
|
52
|
+
<a className="nav-link active"><span className="nav-text">Dashboard</span></a>
|
|
53
|
+
<a className="nav-link"><span className="nav-text">Settings</span></a>
|
|
54
|
+
</HeaderNav>
|
|
55
|
+
<HeaderActions>
|
|
56
|
+
<a className="nav-link"><cds-icon shape="user" /></a>
|
|
57
|
+
</HeaderActions>
|
|
58
|
+
</Header>
|
|
59
|
+
```
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Icon (CdsIcon)
|
|
2
|
+
|
|
3
|
+
Pure React SVG icon component. Reads icon shapes from the Clarity icon registry at runtime. No Angular runtime required — icons are rendered as inline SVG.
|
|
4
|
+
|
|
5
|
+
## React Component
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { CdsIcon } from '@dtlvmw/react';
|
|
9
|
+
|
|
10
|
+
// Or use the `Icon` alias (same component)
|
|
11
|
+
import { Icon } from '@dtlvmw/react';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Props
|
|
15
|
+
|
|
16
|
+
| Prop | Type | Default | Description |
|
|
17
|
+
|------|------|---------|-------------|
|
|
18
|
+
| `shape` | `string` | — | Icon name (required) |
|
|
19
|
+
| `size` | `string` | — | Size: `'xs'`, `'sm'`, `'md'`, `'lg'`, `'xl'`, `'xxl'`, or pixel string like `'24'` |
|
|
20
|
+
| `direction` | `'up' \| 'down' \| 'left' \| 'right'` | — | Rotation direction |
|
|
21
|
+
| `status` | `'success' \| 'danger' \| 'warning' \| 'info' \| 'neutral'` | — | Status color |
|
|
22
|
+
| `solid` | `boolean` | — | Solid fill variant |
|
|
23
|
+
| `className` | `string` | — | Additional CSS class |
|
|
24
|
+
| `role` | `string` | — | ARIA role |
|
|
25
|
+
| `aria-label` | `string` | — | Accessible label |
|
|
26
|
+
|
|
27
|
+
### Examples
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
<CdsIcon shape="home" size="24" />
|
|
31
|
+
<CdsIcon shape="check-circle" status="success" />
|
|
32
|
+
<CdsIcon shape="exclamation-triangle" status="warning" size="lg" />
|
|
33
|
+
<CdsIcon shape="cog" solid />
|
|
34
|
+
<CdsIcon shape="angle" direction="down" />
|
|
35
|
+
<CdsIcon shape="user" size="36" />
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Available Icon Shapes
|
|
39
|
+
|
|
40
|
+
Common shapes registered by the elements bundle:
|
|
41
|
+
|
|
42
|
+
- **Navigation**: `home`, `cog`, `user`, `users`, `search`, `bars`
|
|
43
|
+
- **Status**: `check-circle`, `exclamation-circle`, `exclamation-triangle`, `info-circle`, `success-standard`, `error-standard`
|
|
44
|
+
- **Actions**: `times`, `window-close`, `check`
|
|
45
|
+
- **Arrows**: `angle`, `arrow`, `angle-double`
|
|
46
|
+
- **Files**: `file`, `file-group`, `folder`, `folder-open`
|
|
47
|
+
- **Misc**: `dot-circle`, `circle`, `calendar`, `event`, `node`, `tree-view`, `ellipsis-horizontal`, `ellipsis-vertical`, `filter-grid`, `filter-grid-circle`, `view-columns`, `step-forward-2`, `info-standard`
|
|
48
|
+
|
|
49
|
+
### How It Works
|
|
50
|
+
|
|
51
|
+
`CdsIcon` reads SVG path data from the global Clarity icon registry (`window.CDS._state.iconRegistry`) which is populated when `@dtlvmw/elements` is imported. The component renders the SVG inline as a `<span>` containing an `<svg>` element.
|
|
52
|
+
|
|
53
|
+
### Sizing
|
|
54
|
+
|
|
55
|
+
| Size prop | Pixels |
|
|
56
|
+
|-----------|--------|
|
|
57
|
+
| `xs` | 12px |
|
|
58
|
+
| `sm` | 16px |
|
|
59
|
+
| `md` | 20px |
|
|
60
|
+
| `lg` | 24px |
|
|
61
|
+
| `xl` | 28px |
|
|
62
|
+
| `xxl` | 32px |
|
|
63
|
+
| `'24'` (numeric string) | 24px |
|
|
64
|
+
| (none) | 16px (1rem) |
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Login Page
|
|
2
|
+
|
|
3
|
+
Full-page login layout with branding and form.
|
|
4
|
+
|
|
5
|
+
## HTML/CSS Template
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<div class="login-wrapper">
|
|
9
|
+
<div class="login">
|
|
10
|
+
<div class="login-group">
|
|
11
|
+
<div class="clr-form-control">
|
|
12
|
+
<label class="clr-control-label">Username</label>
|
|
13
|
+
<div class="clr-control-container">
|
|
14
|
+
<div class="clr-input-wrapper">
|
|
15
|
+
<input type="text" class="clr-input" placeholder="Username" />
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="clr-form-control">
|
|
20
|
+
<label class="clr-control-label">Password</label>
|
|
21
|
+
<div class="clr-control-container">
|
|
22
|
+
<div class="clr-input-wrapper">
|
|
23
|
+
<input type="password" class="clr-input" placeholder="Password" />
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<button class="btn btn-primary">Login</button>
|
|
28
|
+
<a href="#" class="signup">Sign up</a>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### CSS Classes
|
|
35
|
+
|
|
36
|
+
| Class | Description |
|
|
37
|
+
|-------|-------------|
|
|
38
|
+
| `login-wrapper` | Full-page wrapper |
|
|
39
|
+
| `login` | Login form area |
|
|
40
|
+
| `login-group` | Form group container |
|
|
41
|
+
| `signup` | Sign-up link |
|
|
42
|
+
|
|
43
|
+
## React Component
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
import { LoginWrapper, Login } from '@dtlvmw/react';
|
|
47
|
+
import { Input, Button } from '@dtlvmw/react';
|
|
48
|
+
|
|
49
|
+
<LoginWrapper>
|
|
50
|
+
<Login>
|
|
51
|
+
<div className="login-group">
|
|
52
|
+
<Input label="Username" placeholder="Username" />
|
|
53
|
+
<Input label="Password" type="password" placeholder="Password" />
|
|
54
|
+
<Button>Login</Button>
|
|
55
|
+
<a className="signup" href="#">Sign up</a>
|
|
56
|
+
</div>
|
|
57
|
+
</Login>
|
|
58
|
+
</LoginWrapper>
|
|
59
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Modal
|
|
2
|
+
|
|
3
|
+
Overlay dialog with backdrop, header, body, and footer.
|
|
4
|
+
|
|
5
|
+
## HTML/CSS Template
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<!-- Modal (visible when both .modal and .modal-backdrop exist) -->
|
|
9
|
+
<div class="modal">
|
|
10
|
+
<div class="modal-dialog" role="dialog" aria-modal="true">
|
|
11
|
+
<div class="modal-content-wrapper">
|
|
12
|
+
<div class="modal-content">
|
|
13
|
+
<div class="modal-header">
|
|
14
|
+
<h3 class="modal-title">Dialog Title</h3>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="modal-body">
|
|
17
|
+
<p>Dialog content.</p>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="modal-footer">
|
|
20
|
+
<button class="btn btn-outline">Cancel</button>
|
|
21
|
+
<button class="btn btn-primary">OK</button>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="modal-backdrop" aria-hidden="true"></div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<!-- Size variants: add to .modal-dialog -->
|
|
30
|
+
<!-- modal-sm, modal-lg, modal-xl, modal-full-screen -->
|
|
31
|
+
<div class="modal-dialog modal-lg" role="dialog">...</div>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### CSS Classes
|
|
35
|
+
|
|
36
|
+
| Class | Description |
|
|
37
|
+
|-------|-------------|
|
|
38
|
+
| `modal` | Root modal container |
|
|
39
|
+
| `modal-dialog` | Dialog wrapper |
|
|
40
|
+
| `modal-content-wrapper` | Content wrapper |
|
|
41
|
+
| `modal-content` | Inner content |
|
|
42
|
+
| `modal-header` | Header section |
|
|
43
|
+
| `modal-title` | Title text |
|
|
44
|
+
| `modal-body` | Body content |
|
|
45
|
+
| `modal-footer` | Footer with actions |
|
|
46
|
+
| `modal-backdrop` | Semi-transparent overlay |
|
|
47
|
+
| `modal-sm` | Small modal |
|
|
48
|
+
| `modal-lg` | Large modal |
|
|
49
|
+
| `modal-xl` | Extra large modal |
|
|
50
|
+
| `modal-full-screen` | Full-screen modal |
|
|
51
|
+
|
|
52
|
+
## React Component
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
import { Modal, ModalHeader, ModalBody, ModalFooter } from '@dtlvmw/react';
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Props
|
|
59
|
+
|
|
60
|
+
| Prop | Type | Default | Description |
|
|
61
|
+
|------|------|---------|-------------|
|
|
62
|
+
| `open` | `boolean` | — | Controls visibility |
|
|
63
|
+
| `closable` | `boolean` | `true` | Shows close button |
|
|
64
|
+
| `size` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full-screen'` | `'md'` | Dialog size |
|
|
65
|
+
| `staticBackdrop` | `boolean` | `true` | Prevent close on backdrop click |
|
|
66
|
+
| `onClose` | `() => void` | — | Close callback |
|
|
67
|
+
|
|
68
|
+
### Examples
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
const [open, setOpen] = useState(false);
|
|
72
|
+
|
|
73
|
+
<Button onClick={() => setOpen(true)}>Open Modal</Button>
|
|
74
|
+
|
|
75
|
+
<Modal open={open} onClose={() => setOpen(false)} size="lg">
|
|
76
|
+
<ModalHeader>
|
|
77
|
+
<h3 className="modal-title">Title</h3>
|
|
78
|
+
</ModalHeader>
|
|
79
|
+
<ModalBody>
|
|
80
|
+
<p>Modal body content.</p>
|
|
81
|
+
</ModalBody>
|
|
82
|
+
<ModalFooter>
|
|
83
|
+
<Button btnStyle="outline" onClick={() => setOpen(false)}>Cancel</Button>
|
|
84
|
+
<Button>OK</Button>
|
|
85
|
+
</ModalFooter>
|
|
86
|
+
</Modal>
|
|
87
|
+
```
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Progress Bar
|
|
2
|
+
|
|
3
|
+
Determinate or indeterminate progress indicator.
|
|
4
|
+
|
|
5
|
+
## HTML/CSS Template
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<!-- Basic progress bar -->
|
|
9
|
+
<div class="progress">
|
|
10
|
+
<progress max="100" value="55"></progress>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<!-- Labeled -->
|
|
14
|
+
<div class="progress labeled">
|
|
15
|
+
<progress max="100" value="55" data-displayval="55%"></progress>
|
|
16
|
+
<span>55%</span>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<!-- Compact -->
|
|
20
|
+
<div class="progress compact">
|
|
21
|
+
<progress max="100" value="40"></progress>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<!-- Looping (indeterminate) -->
|
|
25
|
+
<div class="progress loop">
|
|
26
|
+
<progress></progress>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<!-- Color variants — add to .progress -->
|
|
30
|
+
<div class="progress success"><progress max="100" value="100"></progress></div>
|
|
31
|
+
<div class="progress warning"><progress max="100" value="70"></progress></div>
|
|
32
|
+
<div class="progress danger"><progress max="100" value="30"></progress></div>
|
|
33
|
+
|
|
34
|
+
<!-- Fade (animation) -->
|
|
35
|
+
<div class="progress progress-fade">
|
|
36
|
+
<progress max="100" value="80"></progress>
|
|
37
|
+
</div>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### CSS Classes
|
|
41
|
+
|
|
42
|
+
| Class | Description |
|
|
43
|
+
|-------|-------------|
|
|
44
|
+
| `progress` | Container (required) |
|
|
45
|
+
| `compact` | Thin bar variant |
|
|
46
|
+
| `labeled` | Shows percentage label |
|
|
47
|
+
| `loop` | Indeterminate/looping animation |
|
|
48
|
+
| `progress-fade` | Fade animation |
|
|
49
|
+
| `success` | Green color |
|
|
50
|
+
| `warning` | Yellow color |
|
|
51
|
+
| `danger` | Red color |
|
|
52
|
+
|
|
53
|
+
## React Component
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
import { ProgressBar } from '@dtlvmw/react';
|
|
57
|
+
|
|
58
|
+
<ProgressBar value={55} />
|
|
59
|
+
<ProgressBar value={55} labeled />
|
|
60
|
+
<ProgressBar value={100} color="success" />
|
|
61
|
+
<ProgressBar compact value={40} />
|
|
62
|
+
<ProgressBar loop />
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Props
|
|
66
|
+
|
|
67
|
+
| Prop | Type | Default | Description |
|
|
68
|
+
|------|------|---------|-------------|
|
|
69
|
+
| `value` | `number` | `0` | Current value |
|
|
70
|
+
| `max` | `number` | `100` | Maximum value |
|
|
71
|
+
| `color` | `'success' \| 'warning' \| 'danger'` | — | Bar color |
|
|
72
|
+
| `labeled` | `boolean` | — | Show percentage label |
|
|
73
|
+
| `compact` | `boolean` | — | Thin bar |
|
|
74
|
+
| `loop` | `boolean` | — | Indeterminate animation |
|
|
75
|
+
| `fade` | `boolean` | — | Fade animation |
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Spinner
|
|
2
|
+
|
|
3
|
+
Loading indicator for asynchronous operations.
|
|
4
|
+
|
|
5
|
+
## HTML/CSS Template
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<!-- Default (large) spinner -->
|
|
9
|
+
<span class="spinner" aria-busy="true">Loading...</span>
|
|
10
|
+
|
|
11
|
+
<!-- Medium spinner -->
|
|
12
|
+
<span class="spinner spinner-md" aria-busy="true">Loading...</span>
|
|
13
|
+
|
|
14
|
+
<!-- Small spinner -->
|
|
15
|
+
<span class="spinner spinner-sm" aria-busy="true">Loading...</span>
|
|
16
|
+
|
|
17
|
+
<!-- Inline spinner (for use within text/buttons) -->
|
|
18
|
+
<span class="spinner spinner-inline" aria-busy="true"></span>
|
|
19
|
+
|
|
20
|
+
<!-- Inverse (for dark backgrounds) -->
|
|
21
|
+
<span class="spinner spinner-inverse" aria-busy="true">Loading...</span>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### CSS Classes
|
|
25
|
+
|
|
26
|
+
| Class | Description |
|
|
27
|
+
|-------|-------------|
|
|
28
|
+
| `spinner` | Base spinner (required) |
|
|
29
|
+
| `spinner-sm` | Small size |
|
|
30
|
+
| `spinner-md` | Medium size |
|
|
31
|
+
| `spinner-inline` | Inline (for text/button context) |
|
|
32
|
+
| `spinner-inverse` | White spinner for dark backgrounds |
|
|
33
|
+
|
|
34
|
+
## React Component
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { Spinner } from '@dtlvmw/react';
|
|
38
|
+
|
|
39
|
+
<Spinner />
|
|
40
|
+
<Spinner size="sm" />
|
|
41
|
+
<Spinner size="md" />
|
|
42
|
+
<Spinner inline />
|
|
43
|
+
<Spinner inverse />
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Props
|
|
47
|
+
|
|
48
|
+
| Prop | Type | Default | Description |
|
|
49
|
+
|------|------|---------|-------------|
|
|
50
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | — | Spinner size |
|
|
51
|
+
| `inline` | `boolean` | — | Inline mode |
|
|
52
|
+
| `inverse` | `boolean` | — | White for dark backgrounds |
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Stack View
|
|
2
|
+
|
|
3
|
+
Expandable key-value block layout for displaying metadata or configuration details.
|
|
4
|
+
|
|
5
|
+
## HTML/CSS Template
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<div class="stack-view">
|
|
9
|
+
<!-- Simple stack block -->
|
|
10
|
+
<div class="stack-block">
|
|
11
|
+
<div class="stack-block-label">Property</div>
|
|
12
|
+
<div class="stack-block-content">Value</div>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<!-- Expandable stack block -->
|
|
16
|
+
<div class="stack-block stack-block-expandable stack-block-expanded">
|
|
17
|
+
<div class="stack-block-label">Expandable Section</div>
|
|
18
|
+
<div class="stack-block-content">Summary</div>
|
|
19
|
+
<!-- Nested blocks (children shown when expanded) -->
|
|
20
|
+
<div class="stack-block">
|
|
21
|
+
<div class="stack-block-label">Sub-property</div>
|
|
22
|
+
<div class="stack-block-content">Sub-value</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<!-- Collapsed expandable -->
|
|
27
|
+
<div class="stack-block stack-block-expandable">
|
|
28
|
+
<div class="stack-block-label">Collapsed Section</div>
|
|
29
|
+
<div class="stack-block-content">Click to expand</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### CSS Classes
|
|
35
|
+
|
|
36
|
+
| Class | Description |
|
|
37
|
+
|-------|-------------|
|
|
38
|
+
| `stack-view` | Container (required) |
|
|
39
|
+
| `stack-block` | Block row |
|
|
40
|
+
| `stack-block-label` | Key/label column |
|
|
41
|
+
| `stack-block-content` | Value column |
|
|
42
|
+
| `stack-block-expandable` | Marks block as expandable |
|
|
43
|
+
| `stack-block-expanded` | Expanded state |
|
|
44
|
+
|
|
45
|
+
## React Component
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
import { StackView, StackBlock } from '@dtlvmw/react';
|
|
49
|
+
|
|
50
|
+
<StackView>
|
|
51
|
+
<StackBlock label="Name" content="John Doe" />
|
|
52
|
+
<StackBlock label="Details" content="Summary" expandable expanded onToggle={() => {}}>
|
|
53
|
+
<StackBlock label="Email" content="john@example.com" />
|
|
54
|
+
<StackBlock label="Role" content="Admin" />
|
|
55
|
+
</StackBlock>
|
|
56
|
+
</StackView>
|
|
57
|
+
```
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Table
|
|
2
|
+
|
|
3
|
+
Styled data table with variants.
|
|
4
|
+
|
|
5
|
+
## HTML/CSS Template
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<!-- Basic table -->
|
|
9
|
+
<table class="table">
|
|
10
|
+
<thead>
|
|
11
|
+
<tr>
|
|
12
|
+
<th>Name</th>
|
|
13
|
+
<th>Status</th>
|
|
14
|
+
<th>Role</th>
|
|
15
|
+
</tr>
|
|
16
|
+
</thead>
|
|
17
|
+
<tbody>
|
|
18
|
+
<tr>
|
|
19
|
+
<td>John</td>
|
|
20
|
+
<td>Active</td>
|
|
21
|
+
<td>Admin</td>
|
|
22
|
+
</tr>
|
|
23
|
+
<tr>
|
|
24
|
+
<td>Jane</td>
|
|
25
|
+
<td>Inactive</td>
|
|
26
|
+
<td>User</td>
|
|
27
|
+
</tr>
|
|
28
|
+
</tbody>
|
|
29
|
+
</table>
|
|
30
|
+
|
|
31
|
+
<!-- Compact table -->
|
|
32
|
+
<table class="table table-compact">...</table>
|
|
33
|
+
|
|
34
|
+
<!-- No border -->
|
|
35
|
+
<table class="table table-noborder">...</table>
|
|
36
|
+
|
|
37
|
+
<!-- Vertical (key-value layout) -->
|
|
38
|
+
<table class="table table-vertical">
|
|
39
|
+
<tbody>
|
|
40
|
+
<tr><th>Name</th><td>John Doe</td></tr>
|
|
41
|
+
<tr><th>Email</th><td>john@example.com</td></tr>
|
|
42
|
+
</tbody>
|
|
43
|
+
</table>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### CSS Classes
|
|
47
|
+
|
|
48
|
+
| Class | Description |
|
|
49
|
+
|-------|-------------|
|
|
50
|
+
| `table` | Base table style (required) |
|
|
51
|
+
| `table-compact` | Reduced row height |
|
|
52
|
+
| `table-noborder` | No border lines |
|
|
53
|
+
| `table-vertical` | Key-value vertical layout |
|
|
54
|
+
|
|
55
|
+
## React Component
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { Table } from '@dtlvmw/react';
|
|
59
|
+
|
|
60
|
+
<Table>
|
|
61
|
+
<thead><tr><th>Name</th><th>Status</th></tr></thead>
|
|
62
|
+
<tbody><tr><td>John</td><td>Active</td></tr></tbody>
|
|
63
|
+
</Table>
|
|
64
|
+
|
|
65
|
+
<Table compact noBorder>
|
|
66
|
+
...
|
|
67
|
+
</Table>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Props
|
|
71
|
+
|
|
72
|
+
| Prop | Type | Default | Description |
|
|
73
|
+
|------|------|---------|-------------|
|
|
74
|
+
| `compact` | `boolean` | — | Compact row height |
|
|
75
|
+
| `vertical` | `boolean` | — | Vertical key-value layout |
|
|
76
|
+
| `noBorder` | `boolean` | — | No border lines |
|