@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,70 @@
|
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
Tabbed navigation with content panels.
|
|
4
|
+
|
|
5
|
+
## HTML/CSS Template
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<!-- Horizontal tabs -->
|
|
9
|
+
<ul class="nav" role="tablist">
|
|
10
|
+
<li role="presentation" class="nav-item">
|
|
11
|
+
<button class="btn btn-link nav-link active" role="tab" aria-selected="true">Tab 1</button>
|
|
12
|
+
</li>
|
|
13
|
+
<li role="presentation" class="nav-item">
|
|
14
|
+
<button class="btn btn-link nav-link" role="tab" aria-selected="false">Tab 2</button>
|
|
15
|
+
</li>
|
|
16
|
+
<li role="presentation" class="nav-item">
|
|
17
|
+
<button class="btn btn-link nav-link" role="tab" disabled>Disabled</button>
|
|
18
|
+
</li>
|
|
19
|
+
</ul>
|
|
20
|
+
<section class="tab-content active" role="tabpanel">
|
|
21
|
+
Content for Tab 1
|
|
22
|
+
</section>
|
|
23
|
+
|
|
24
|
+
<!-- Vertical tabs — wrap in a container with .nav-tabs-vertical -->
|
|
25
|
+
<div class="nav-tabs-vertical">
|
|
26
|
+
<ul class="nav" role="tablist">...</ul>
|
|
27
|
+
<section class="tab-content active" role="tabpanel">...</section>
|
|
28
|
+
</div>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### CSS Classes
|
|
32
|
+
|
|
33
|
+
| Class | Description |
|
|
34
|
+
|-------|-------------|
|
|
35
|
+
| `nav` | Tab list container (required on `ul`) |
|
|
36
|
+
| `nav-item` | Tab item wrapper (`li`) |
|
|
37
|
+
| `nav-link` | Tab button/link |
|
|
38
|
+
| `active` | Active tab indicator (on `nav-link` and `tab-content`) |
|
|
39
|
+
| `tab-content` | Tab panel content |
|
|
40
|
+
| `nav-tabs-vertical` | Vertical tab layout wrapper |
|
|
41
|
+
|
|
42
|
+
## React Component
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { Tabs, TabList, Tab, TabPanel } from '@dtlvmw/react';
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Props
|
|
49
|
+
|
|
50
|
+
**Tabs**: `vertical?: boolean`
|
|
51
|
+
|
|
52
|
+
**Tab**: `active?: boolean`, `disabled?: boolean`
|
|
53
|
+
|
|
54
|
+
**TabPanel**: `active?: boolean`
|
|
55
|
+
|
|
56
|
+
### Example
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
const [active, setActive] = useState(0);
|
|
60
|
+
|
|
61
|
+
<Tabs>
|
|
62
|
+
<TabList>
|
|
63
|
+
<Tab active={active === 0} onClick={() => setActive(0)}>Dashboard</Tab>
|
|
64
|
+
<Tab active={active === 1} onClick={() => setActive(1)}>Settings</Tab>
|
|
65
|
+
<Tab disabled>Reports</Tab>
|
|
66
|
+
</TabList>
|
|
67
|
+
<TabPanel active={active === 0}>Dashboard content</TabPanel>
|
|
68
|
+
<TabPanel active={active === 1}>Settings content</TabPanel>
|
|
69
|
+
</Tabs>
|
|
70
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Timeline
|
|
2
|
+
|
|
3
|
+
Horizontal or vertical step sequence for showing progress through a workflow.
|
|
4
|
+
|
|
5
|
+
## HTML/CSS Template
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<!-- Horizontal timeline -->
|
|
9
|
+
<div class="clr-timeline" role="list">
|
|
10
|
+
<div class="clr-timeline-step" role="listitem">
|
|
11
|
+
<div class="clr-timeline-step-header">11:59 am</div>
|
|
12
|
+
<cds-icon shape="success-standard" status="success"></cds-icon>
|
|
13
|
+
<div class="clr-timeline-step-body">
|
|
14
|
+
<div class="clr-timeline-step-title">Completed</div>
|
|
15
|
+
<div class="clr-timeline-step-description">Step 1 done.</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="clr-timeline-step" role="listitem">
|
|
19
|
+
<div class="clr-timeline-step-header">12:00 pm</div>
|
|
20
|
+
<cds-icon shape="dot-circle" status="info"></cds-icon>
|
|
21
|
+
<div class="clr-timeline-step-body">
|
|
22
|
+
<div class="clr-timeline-step-title">Current</div>
|
|
23
|
+
<div class="clr-timeline-step-description">In progress.</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="clr-timeline-step" role="listitem">
|
|
27
|
+
<div class="clr-timeline-step-header">12:30 pm</div>
|
|
28
|
+
<!-- Processing: use spinner instead of icon -->
|
|
29
|
+
<span class="spinner spinner-md" aria-label="In progress"></span>
|
|
30
|
+
<div class="clr-timeline-step-body">
|
|
31
|
+
<div class="clr-timeline-step-title">Processing</div>
|
|
32
|
+
<div class="clr-timeline-step-description">Working...</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="clr-timeline-step" role="listitem">
|
|
36
|
+
<div class="clr-timeline-step-header">1:00 pm</div>
|
|
37
|
+
<cds-icon shape="circle"></cds-icon>
|
|
38
|
+
<div class="clr-timeline-step-body">
|
|
39
|
+
<div class="clr-timeline-step-title">Not Started</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<!-- Vertical timeline -->
|
|
45
|
+
<div class="clr-timeline clr-timeline-vertical" role="list">
|
|
46
|
+
...
|
|
47
|
+
</div>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### CSS Classes
|
|
51
|
+
|
|
52
|
+
| Class | Description |
|
|
53
|
+
|-------|-------------|
|
|
54
|
+
| `clr-timeline` | Container (required) |
|
|
55
|
+
| `clr-timeline-vertical` | Vertical layout |
|
|
56
|
+
| `clr-timeline-step` | Step item |
|
|
57
|
+
| `clr-timeline-step-header` | Timestamp/header |
|
|
58
|
+
| `clr-timeline-step-body` | Step content |
|
|
59
|
+
| `clr-timeline-step-title` | Step title |
|
|
60
|
+
| `clr-timeline-step-description` | Step description |
|
|
61
|
+
|
|
62
|
+
### Step State Icons
|
|
63
|
+
|
|
64
|
+
| State | Icon |
|
|
65
|
+
|-------|------|
|
|
66
|
+
| Not started | `<cds-icon shape="circle">` |
|
|
67
|
+
| Current | `<cds-icon shape="dot-circle" status="info">` |
|
|
68
|
+
| Processing | `<span class="spinner spinner-md">` |
|
|
69
|
+
| Success | `<cds-icon shape="success-standard" status="success">` |
|
|
70
|
+
| Error | `<cds-icon shape="error-standard" status="danger">` |
|
|
71
|
+
|
|
72
|
+
## React Component
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
import { Timeline, TimelineStep } from '@dtlvmw/react';
|
|
76
|
+
|
|
77
|
+
<Timeline>
|
|
78
|
+
<TimelineStep state="success" header="11:59 am" title="Completed" description="Step 1 done." />
|
|
79
|
+
<TimelineStep state="current" header="12:00 pm" title="Current" description="In progress." />
|
|
80
|
+
<TimelineStep state="processing" header="12:30 pm" title="Processing" description="Working..." />
|
|
81
|
+
<TimelineStep state="not-started" header="1:00 pm" title="Not Started" />
|
|
82
|
+
</Timeline>
|
|
83
|
+
|
|
84
|
+
<Timeline vertical>
|
|
85
|
+
...
|
|
86
|
+
</Timeline>
|
|
87
|
+
```
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Wizard
|
|
2
|
+
|
|
3
|
+
Multi-step modal wizard for guided workflows.
|
|
4
|
+
|
|
5
|
+
## HTML/CSS Template
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<div class="clr-wizard wizard-lg">
|
|
9
|
+
<div class="modal">
|
|
10
|
+
<div class="modal-dialog modal-lg" role="dialog" aria-modal="true">
|
|
11
|
+
<div class="modal-content-wrapper">
|
|
12
|
+
<!-- Step Nav -->
|
|
13
|
+
<div class="modal-nav clr-wizard-stepnav-wrapper" role="region">
|
|
14
|
+
<div class="clr-wizard-title" role="heading" aria-level="1">Wizard Title</div>
|
|
15
|
+
<div class="clr-wizard-stepnav">
|
|
16
|
+
<nav aria-label="Wizard steps">
|
|
17
|
+
<ol class="clr-wizard-stepnav-list">
|
|
18
|
+
<li class="clr-wizard-stepnav-item active" aria-current="step">
|
|
19
|
+
<button type="button" class="btn btn-link clr-wizard-stepnav-link">
|
|
20
|
+
<span class="clr-wizard-stepnav-link-title">Step 1</span>
|
|
21
|
+
</button>
|
|
22
|
+
</li>
|
|
23
|
+
<li class="clr-wizard-stepnav-item">
|
|
24
|
+
<button type="button" class="btn btn-link clr-wizard-stepnav-link" disabled>
|
|
25
|
+
<span class="clr-wizard-stepnav-link-title">Step 2</span>
|
|
26
|
+
</button>
|
|
27
|
+
</li>
|
|
28
|
+
</ol>
|
|
29
|
+
</nav>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<!-- Content -->
|
|
34
|
+
<div class="modal-content">
|
|
35
|
+
<div class="modal-body-wrapper">
|
|
36
|
+
<div class="modal-body">
|
|
37
|
+
<main class="clr-wizard-content">
|
|
38
|
+
<div class="clr-wizard-page active">Page content here.</div>
|
|
39
|
+
</main>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<!-- Footer -->
|
|
44
|
+
<div class="modal-footer clr-wizard-footer">
|
|
45
|
+
<div class="clr-wizard-footer-buttons">
|
|
46
|
+
<div class="clr-wizard-footer-buttons-wrapper">
|
|
47
|
+
<div class="clr-wizard-btn-wrapper">
|
|
48
|
+
<button type="button" class="btn clr-wizard-btn btn-link clr-wizard-btn--tertiary">Cancel</button>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="clr-wizard-btn-wrapper">
|
|
51
|
+
<button type="button" class="btn clr-wizard-btn btn-primary clr-wizard-btn--primary">Next</button>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="modal-backdrop" aria-hidden="true"></div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### CSS Classes
|
|
65
|
+
|
|
66
|
+
| Class | Description |
|
|
67
|
+
|-------|-------------|
|
|
68
|
+
| `clr-wizard` | Wizard container (required) |
|
|
69
|
+
| `wizard-md`, `wizard-lg`, `wizard-xl` | Size variants |
|
|
70
|
+
| `clr-wizard-title` | Title in the step nav sidebar |
|
|
71
|
+
| `clr-wizard-stepnav-wrapper` | Step nav sidebar container |
|
|
72
|
+
| `clr-wizard-stepnav-list` | Ordered list of steps |
|
|
73
|
+
| `clr-wizard-stepnav-item` | Individual step item |
|
|
74
|
+
| `clr-wizard-stepnav-item active` | Currently active step |
|
|
75
|
+
| `clr-wizard-stepnav-item complete` | Completed step |
|
|
76
|
+
| `clr-wizard-stepnav-item disabled` | Disabled/unreachable step |
|
|
77
|
+
| `clr-wizard-stepnav-link` | Clickable step button |
|
|
78
|
+
| `clr-wizard-content` | Page content area |
|
|
79
|
+
| `clr-wizard-page` | Individual page container |
|
|
80
|
+
| `clr-wizard-page active` | Visible page |
|
|
81
|
+
| `clr-wizard-footer` | Footer with navigation buttons |
|
|
82
|
+
| `clr-wizard-btn--tertiary` | Cancel button style |
|
|
83
|
+
| `clr-wizard-btn--secondary` | Back button style |
|
|
84
|
+
| `clr-wizard-btn--primary` | Next/Finish button style |
|
|
85
|
+
|
|
86
|
+
## React Component
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
import { Wizard, WizardPage } from '@dtlvmw/react';
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Wizard Props
|
|
93
|
+
|
|
94
|
+
| Prop | Type | Default | Description |
|
|
95
|
+
|------|------|---------|-------------|
|
|
96
|
+
| `open` | `boolean` | — | Controls visibility |
|
|
97
|
+
| `title` | `string` | `'Wizard'` | Wizard title in step nav |
|
|
98
|
+
| `size` | `'md' \| 'lg' \| 'xl'` | `'lg'` | Wizard size |
|
|
99
|
+
| `closable` | `boolean` | `true` | Show close button |
|
|
100
|
+
| `onFinish` | `() => void` | — | Called when Finish is clicked |
|
|
101
|
+
| `onCancel` | `() => void` | — | Called when Cancel or close is clicked |
|
|
102
|
+
|
|
103
|
+
### WizardPage Props
|
|
104
|
+
|
|
105
|
+
| Prop | Type | Default | Description |
|
|
106
|
+
|------|------|---------|-------------|
|
|
107
|
+
| `title` | `string` | — | Step title (shown in nav) |
|
|
108
|
+
| `nextDisabled` | `boolean` | — | Disables the Next/Finish button |
|
|
109
|
+
|
|
110
|
+
### Example
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
const [open, setOpen] = useState(false);
|
|
114
|
+
|
|
115
|
+
<Button onClick={() => setOpen(true)}>Open Wizard</Button>
|
|
116
|
+
|
|
117
|
+
<Wizard
|
|
118
|
+
open={open}
|
|
119
|
+
title="Setup Wizard"
|
|
120
|
+
size="lg"
|
|
121
|
+
onFinish={() => { console.log('done'); setOpen(false); }}
|
|
122
|
+
onCancel={() => setOpen(false)}
|
|
123
|
+
>
|
|
124
|
+
<WizardPage title="User Info">
|
|
125
|
+
<Input label="Full Name" placeholder="Enter your name" />
|
|
126
|
+
<Input label="Email" placeholder="Enter your email" />
|
|
127
|
+
</WizardPage>
|
|
128
|
+
<WizardPage title="Preferences">
|
|
129
|
+
<Checkbox label="Enable notifications" />
|
|
130
|
+
<Select label="Theme">
|
|
131
|
+
<option>Light</option>
|
|
132
|
+
<option>Dark</option>
|
|
133
|
+
</Select>
|
|
134
|
+
</WizardPage>
|
|
135
|
+
<WizardPage title="Review">
|
|
136
|
+
<p>Please review your settings and click Finish.</p>
|
|
137
|
+
</WizardPage>
|
|
138
|
+
</Wizard>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Composability
|
|
142
|
+
|
|
143
|
+
`WizardPage` children accept arbitrary React JSX. Nest any Tier 1 or Tier 2 component as page content:
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
<WizardPage title="Data">
|
|
147
|
+
<Datagrid columns={cols} data={rows} />
|
|
148
|
+
</WizardPage>
|
|
149
|
+
|
|
150
|
+
<WizardPage title="Steps">
|
|
151
|
+
<Stepper steps={stepDefs} />
|
|
152
|
+
</WizardPage>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Navigation
|
|
156
|
+
|
|
157
|
+
- Navigation between pages is managed automatically.
|
|
158
|
+
- Users can click completed steps in the step nav to go back.
|
|
159
|
+
- The Next button is disabled when `nextDisabled` is set on the current page.
|
|
160
|
+
- Pressing Escape closes the wizard (when `closable` is true).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Colors
|
|
2
|
+
|
|
3
|
+
Clarity uses CSS custom properties for theming. The default theme provides these semantic colors:
|
|
4
|
+
|
|
5
|
+
## Status Colors
|
|
6
|
+
- `--clr-color-action-600` — Primary blue
|
|
7
|
+
- `--clr-color-success-700` — Green for success states
|
|
8
|
+
- `--clr-color-warning-900` — Yellow/orange for warnings
|
|
9
|
+
- `--clr-color-danger-700` — Red for errors and danger
|
|
10
|
+
|
|
11
|
+
## Component Colors
|
|
12
|
+
Components accept a `color` or `btnType` prop with these values:
|
|
13
|
+
- `primary` (default) — Blue
|
|
14
|
+
- `success` — Green
|
|
15
|
+
- `warning` — Orange/Yellow
|
|
16
|
+
- `danger` — Red
|
|
17
|
+
|
|
18
|
+
## Badge/Label Colors
|
|
19
|
+
Additional named colors for badges and labels:
|
|
20
|
+
- `info`, `success`, `warning`, `danger`
|
|
21
|
+
- `gray`, `blue`, `light-blue`, `orange`, `purple`
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Spacing
|
|
2
|
+
|
|
3
|
+
Clarity uses a 6px base spacing unit. Components handle internal spacing automatically.
|
|
4
|
+
|
|
5
|
+
## Common Spacing Values
|
|
6
|
+
- `4px` — Tight spacing (within compact elements)
|
|
7
|
+
- `6px` — Base unit
|
|
8
|
+
- `12px` — Standard gap between inline elements
|
|
9
|
+
- `24px` — Section spacing
|
|
10
|
+
- `48px` — Large section spacing
|
|
11
|
+
|
|
12
|
+
## Layout
|
|
13
|
+
- Use `display: flex` with `gap` for component spacing
|
|
14
|
+
- Cards: Use `16px` gap between cards
|
|
15
|
+
- Form controls: Spaced automatically by Clarity CSS
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Typography
|
|
2
|
+
|
|
3
|
+
Clarity uses the Metropolis font family. Components inherit typography from the global CSS.
|
|
4
|
+
|
|
5
|
+
## Headings
|
|
6
|
+
- `h1` through `h6` are styled by Clarity CSS
|
|
7
|
+
- Modal titles should use `<h3 className="modal-title">`
|
|
8
|
+
|
|
9
|
+
## Body Text
|
|
10
|
+
- Default body font size is 14px (0.7rem in Clarity's rem scale)
|
|
11
|
+
- Use `.p1` through `.p8` utility classes for different text sizes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Component Overview
|
|
2
|
+
|
|
3
|
+
## Tier 1: CSS-Only Components
|
|
4
|
+
|
|
5
|
+
These components use Clarity CSS classes on standard HTML elements. No Angular runtime is required. They are pure React components.
|
|
6
|
+
|
|
7
|
+
| Component | File | Key CSS Classes |
|
|
8
|
+
|-----------|------|----------------|
|
|
9
|
+
| Button | `button/Button.tsx` | `.btn`, `.btn-primary`, `.btn-*-outline`, `.btn-link` |
|
|
10
|
+
| Alert | `alert/Alert.tsx` | `.alert`, `.alert-info`, `.alert-sm`, `.alert-lightweight` |
|
|
11
|
+
| Badge | `badge/Badge.tsx` | `.badge`, `.badge-info`, `.badge-success` |
|
|
12
|
+
| Label | `label/Label.tsx` | `.label`, `.label-info`, `.solid`, `.clickable` |
|
|
13
|
+
| Card | `card/Card.tsx` | `.card`, `.card-header`, `.card-block`, `.card-footer` |
|
|
14
|
+
| Modal | `modal/Modal.tsx` | `.modal`, `.modal-dialog`, `.modal-body`, `.modal-backdrop` |
|
|
15
|
+
| Input | `input/Input.tsx` | `.clr-form-control`, `.clr-input-wrapper`, `.clr-input` |
|
|
16
|
+
| Select | `select/Select.tsx` | `.clr-select-wrapper`, `.clr-select` |
|
|
17
|
+
| Checkbox | `checkbox/Checkbox.tsx` | `.clr-checkbox-wrapper`, `.clr-checkbox` |
|
|
18
|
+
| Toggle | `toggle/Toggle.tsx` | `.clr-toggle-wrapper`, `.clr-toggle` |
|
|
19
|
+
| Tabs | `tabs/Tabs.tsx` | `.nav`, `.nav-item`, `.nav-link`, `.tab-content` |
|
|
20
|
+
| Dropdown | `dropdown/Dropdown.tsx` | `.dropdown`, `.dropdown-menu`, `.dropdown-item` |
|
|
21
|
+
| Accordion | `accordion/Accordion.tsx` | `.clr-accordion`, `.clr-accordion-panel` |
|
|
22
|
+
| Spinner | `spinner/Spinner.tsx` | `.spinner`, `.spinner-sm`, `.spinner-inline` |
|
|
23
|
+
| ProgressBar | `progress/ProgressBar.tsx` | `.progress`, `.compact`, `.labeled` |
|
|
24
|
+
| Timeline | `timeline/Timeline.tsx` | `.clr-timeline`, `.clr-timeline-step` |
|
|
25
|
+
| StackView | `stack-view/StackView.tsx` | `.stack-view`, `.stack-block` |
|
|
26
|
+
| Header | `header/Header.tsx` | `.header`, `.branding`, `.header-nav` |
|
|
27
|
+
| Table | `table/Table.tsx` | `.table`, `.table-compact`, `.table-noborder` |
|
|
28
|
+
| Login | `login/Login.tsx` | `.login-wrapper`, `.login` |
|
|
29
|
+
| Wizard | `wizard/Wizard.tsx` | `.clr-wizard`, `.clr-wizard-stepnav`, `.clr-wizard-page` |
|
|
30
|
+
| CdsIcon | `internal/CdsIcon.tsx` | Inline SVG — reads from Clarity icon registry |
|
|
31
|
+
|
|
32
|
+
## Tier 2: Angular Element Components
|
|
33
|
+
|
|
34
|
+
These components wrap actual Angular components via `@angular/elements`. They require the `@dtlvmw/elements` bundle to be imported.
|
|
35
|
+
|
|
36
|
+
| Component | Custom Element | Description |
|
|
37
|
+
|-----------|---------------|-------------|
|
|
38
|
+
| Datagrid | `<clr-wc-datagrid>` | Full-featured data grid with sorting, filtering, pagination |
|
|
39
|
+
| Tree View | `<clr-wc-tree>` | Recursive tree with keyboard navigation |
|
|
40
|
+
| Stepper | `<clr-wc-stepper>` | Form-integrated step flow |
|
|
41
|
+
| Datepicker | `<clr-wc-datepicker>` | Calendar date picker |
|
|
42
|
+
| Date Range Picker | `<clr-wc-date-range-picker>` | Date range selector |
|
|
43
|
+
| Combobox | `<clr-wc-combobox>` | Autocomplete select |
|
|
44
|
+
| Signpost | `<clr-wc-signpost>` | Positioned info popover |
|
|
45
|
+
| Tooltip | `<clr-wc-tooltip>` | Hover tooltip |
|
|
46
|
+
| Dropdown (Angular) | `<clr-wc-dropdown-angular>` | Keyboard-navigable dropdown |
|
|
47
|
+
| Vertical Nav | `<clr-wc-vertical-nav>` | Collapsible side navigation |
|
|
48
|
+
| Breadcrumbs | `<clr-wc-breadcrumbs>` | Navigation breadcrumbs |
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Combobox (Tier 2 — Angular Element)
|
|
2
|
+
|
|
3
|
+
Autocomplete dropdown with filtering. Wraps `ClrCombobox`.
|
|
4
|
+
|
|
5
|
+
## React Component
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Combobox } from '@dtlvmw/react';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Default | Description |
|
|
14
|
+
|------|------|---------|-------------|
|
|
15
|
+
| `label` | `string` | — | Input label |
|
|
16
|
+
| `placeholder` | `string` | — | Input placeholder |
|
|
17
|
+
| `options` | `ComboboxOption[]` | `[]` | Available options |
|
|
18
|
+
| `selected` | `string` | — | Currently selected value |
|
|
19
|
+
| `onSelectionChange` | `(value: string) => void` | — | Selection callback |
|
|
20
|
+
|
|
21
|
+
### ComboboxOption
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
interface ComboboxOption {
|
|
25
|
+
value: string;
|
|
26
|
+
label: string;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Example
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
const options = [
|
|
34
|
+
{ value: 'us', label: 'United States' },
|
|
35
|
+
{ value: 'ca', label: 'Canada' },
|
|
36
|
+
{ value: 'uk', label: 'United Kingdom' },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
const [country, setCountry] = useState('');
|
|
40
|
+
|
|
41
|
+
<Combobox
|
|
42
|
+
label="Country"
|
|
43
|
+
placeholder="Search countries..."
|
|
44
|
+
options={options}
|
|
45
|
+
selected={country}
|
|
46
|
+
onSelectionChange={setCountry}
|
|
47
|
+
/>
|
|
48
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Datagrid (Tier 2 — Angular Element)
|
|
2
|
+
|
|
3
|
+
Full-featured data grid with sorting, filtering, and pagination. Wraps the actual `ClrDatagrid` Angular component.
|
|
4
|
+
|
|
5
|
+
## React Component
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import '@dtlvmw/elements'; // once in entry point
|
|
9
|
+
import { Datagrid } from '@dtlvmw/react';
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Props
|
|
13
|
+
|
|
14
|
+
| Prop | Type | Default | Description |
|
|
15
|
+
|------|------|---------|-------------|
|
|
16
|
+
| `columns` | `DatagridColumn[]` | `[]` | Column definitions |
|
|
17
|
+
| `data` | `any[]` | `[]` | Row data |
|
|
18
|
+
| `loading` | `boolean` | — | Shows loading state |
|
|
19
|
+
| `paginate` | `boolean` | — | Enable pagination |
|
|
20
|
+
| `pageSize` | `number` | `10` | Items per page |
|
|
21
|
+
| `onRefresh` | `(state) => void` | — | Grid state change callback |
|
|
22
|
+
| `onSelectedChange` | `(selected) => void` | — | Selection change callback |
|
|
23
|
+
|
|
24
|
+
### DatagridColumn
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
interface DatagridColumn {
|
|
28
|
+
field: string; // Property key in data objects
|
|
29
|
+
label: string; // Column header text
|
|
30
|
+
sortable?: boolean;
|
|
31
|
+
filterable?: boolean;
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Example
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
const columns = [
|
|
39
|
+
{ field: 'name', label: 'Name', sortable: true, filterable: true },
|
|
40
|
+
{ field: 'role', label: 'Role', sortable: true },
|
|
41
|
+
{ field: 'status', label: 'Status' },
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
const data = [
|
|
45
|
+
{ name: 'Alice', role: 'Admin', status: 'Active' },
|
|
46
|
+
{ name: 'Bob', role: 'User', status: 'Inactive' },
|
|
47
|
+
{ name: 'Carol', role: 'Editor', status: 'Active' },
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
<Datagrid columns={columns} data={data} paginate pageSize={10} />
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Web Component Usage
|
|
54
|
+
|
|
55
|
+
```html
|
|
56
|
+
<clr-wc-datagrid
|
|
57
|
+
columns='[{"field":"name","label":"Name","sortable":true}]'
|
|
58
|
+
data='[{"name":"Alice","role":"Admin"}]'
|
|
59
|
+
paginate
|
|
60
|
+
page-size="10"
|
|
61
|
+
></clr-wc-datagrid>
|
|
62
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Datepicker (Tier 2 — Angular Element)
|
|
2
|
+
|
|
3
|
+
Calendar date picker with popover. Wraps `ClrDateContainer` + `clrDate`.
|
|
4
|
+
|
|
5
|
+
## React Component
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { Datepicker } from '@dtlvmw/react';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Default | Description |
|
|
14
|
+
|------|------|---------|-------------|
|
|
15
|
+
| `label` | `string` | — | Input label |
|
|
16
|
+
| `value` | `string` | — | Date value |
|
|
17
|
+
| `placeholder` | `string` | `'MM/DD/YYYY'` | Input placeholder |
|
|
18
|
+
| `onChange` | `(value: string) => void` | — | Value change callback |
|
|
19
|
+
|
|
20
|
+
### Example
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
const [date, setDate] = useState('');
|
|
24
|
+
|
|
25
|
+
<Datepicker label="Start Date" value={date} onChange={setDate} />
|
|
26
|
+
```
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Tier 2: Angular Element Components
|
|
2
|
+
|
|
3
|
+
These components wrap actual Clarity Angular components via `@angular/elements`. They contain complex interactive logic (sorting, filtering, pagination, keyboard navigation, popover positioning, etc.) that cannot be replicated with CSS alone.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
// 1. Import Clarity CSS
|
|
9
|
+
import '@dtlvmw/ui/clr-ui.min.css';
|
|
10
|
+
|
|
11
|
+
// 2. Import Angular Elements bundle (registers all custom elements)
|
|
12
|
+
import '@dtlvmw/elements';
|
|
13
|
+
|
|
14
|
+
// 3. Import React wrappers
|
|
15
|
+
import { Datagrid, TreeView, Stepper } from '@dtlvmw/react';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The `@dtlvmw/elements` import bootstraps the Angular runtime and registers all Tier 2 web components. It only needs to be imported once in your application's entry point.
|
|
19
|
+
|
|
20
|
+
## Bundle Size Note
|
|
21
|
+
|
|
22
|
+
The Angular Elements bundle includes the Angular runtime (~200-300 KB gzipped). Only import it if you need Tier 2 components. Tier 1 CSS-only components have zero Angular overhead.
|
|
23
|
+
|
|
24
|
+
## Available Tier 2 Components
|
|
25
|
+
|
|
26
|
+
| Component | Custom Element | React Wrapper | Description |
|
|
27
|
+
|-----------|---------------|---------------|-------------|
|
|
28
|
+
| Datagrid | `<clr-wc-datagrid>` | `<Datagrid>` | Full-featured data grid |
|
|
29
|
+
| Tree View | `<clr-wc-tree>` | `<TreeView>` | Recursive tree with selection |
|
|
30
|
+
| Stepper | `<clr-wc-stepper>` | `<Stepper>` | Form-integrated step flow |
|
|
31
|
+
| Datepicker | `<clr-wc-datepicker>` | `<Datepicker>` | Calendar date picker |
|
|
32
|
+
| Date Range Picker | `<clr-wc-date-range-picker>` | `<DateRangePicker>` | Date range selector |
|
|
33
|
+
| Combobox | `<clr-wc-combobox>` | `<Combobox>` | Autocomplete select |
|
|
34
|
+
| Signpost | `<clr-wc-signpost>` | `<Signpost>` | Positioned info popover |
|
|
35
|
+
| Tooltip | `<clr-wc-tooltip>` | `<Tooltip>` | Hover tooltip |
|
|
36
|
+
| Dropdown (Angular) | `<clr-wc-dropdown-angular>` | `<DropdownAngular>` | Keyboard-navigable dropdown |
|
|
37
|
+
| Vertical Nav | `<clr-wc-vertical-nav>` | `<VerticalNav>` | Collapsible side navigation |
|
|
38
|
+
| Breadcrumbs | `<clr-wc-breadcrumbs>` | `<Breadcrumbs>` | Navigation breadcrumbs |
|
|
39
|
+
|
|
40
|
+
## Data Passing
|
|
41
|
+
|
|
42
|
+
Complex data (arrays, objects) is passed to web components as JSON strings. The React wrappers handle this serialization automatically:
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
// React wrapper handles JSON.stringify internally
|
|
46
|
+
<Datagrid
|
|
47
|
+
columns={[{ field: 'name', label: 'Name', sortable: true }]}
|
|
48
|
+
data={[{ name: 'John' }]}
|
|
49
|
+
/>
|
|
50
|
+
|
|
51
|
+
// Equivalent raw web component usage
|
|
52
|
+
<clr-wc-datagrid
|
|
53
|
+
columns='[{"field":"name","label":"Name","sortable":true}]'
|
|
54
|
+
data='[{"name":"John"}]'
|
|
55
|
+
/>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Event Handling
|
|
59
|
+
|
|
60
|
+
Events from web components are dispatched as `CustomEvent`. The React wrappers listen for these and call your callback props:
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
<Datagrid
|
|
64
|
+
columns={columns}
|
|
65
|
+
data={data}
|
|
66
|
+
onRefresh={(state) => console.log('Grid refresh:', state)}
|
|
67
|
+
onSelectedChange={(selected) => console.log('Selected:', selected)}
|
|
68
|
+
/>
|
|
69
|
+
```
|