@nyaruka/temba-components 0.124.0 → 0.124.2
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/CHANGELOG.md +16 -0
- package/TEST_OPTIMIZATION.md +158 -0
- package/demo/alert/example.html +65 -0
- package/demo/button/example.html +71 -0
- package/demo/chart/example.html +56 -0
- package/demo/checkbox/example.html +72 -0
- package/demo/compose/example.html +72 -0
- package/demo/data/images/gus.png +0 -0
- package/demo/data/images/purrington.jpg +0 -0
- package/demo/data/server/opened-tickets.json +40 -0
- package/demo/data/server/response-time.json +27 -0
- package/demo/datepicker/example.html +69 -0
- package/demo/dialog/example.html +107 -0
- package/demo/dropdown/example.html +99 -0
- package/demo/index.html +152 -445
- package/demo/misc/example.html +72 -0
- package/demo/progress/example.html +59 -0
- package/demo/{drag-drop-demo.html → select/drag-and-drop.html} +2 -1
- package/demo/select/example.html +82 -0
- package/demo/select/multi.html +73 -0
- package/demo/slider/example.html +59 -0
- package/demo/sortable-list/example.html +99 -0
- package/demo/styles.css +183 -0
- package/demo/tabs/example.html +91 -0
- package/demo/textinput/completion.html +56 -0
- package/demo/textinput/example.html +61 -0
- package/dist/temba-components.js +23 -26
- package/dist/temba-components.js.map +1 -1
- package/out-tsc/src/chart/TembaChart.js +27 -22
- package/out-tsc/src/chart/TembaChart.js.map +1 -1
- package/out-tsc/src/flow/Editor.js +1 -1
- package/out-tsc/src/flow/Editor.js.map +1 -1
- package/out-tsc/src/select/Select.js +1 -1
- package/out-tsc/src/select/Select.js.map +1 -1
- package/out-tsc/src/thumbnail/Thumbnail.js +1 -1
- package/out-tsc/src/thumbnail/Thumbnail.js.map +1 -1
- package/out-tsc/test/temba-chart.test.js +1 -1
- package/out-tsc/test/temba-chart.test.js.map +1 -1
- package/out-tsc/test/temba-compose.test.js +6 -30
- package/out-tsc/test/temba-compose.test.js.map +1 -1
- package/out-tsc/test/temba-contact-chat.test.js +1 -2
- package/out-tsc/test/temba-contact-chat.test.js.map +1 -1
- package/out-tsc/test/temba-dropdown.test.js +1 -1
- package/out-tsc/test/temba-dropdown.test.js.map +1 -1
- package/out-tsc/test/temba-omnibox.test.js +4 -0
- package/out-tsc/test/temba-omnibox.test.js.map +1 -1
- package/out-tsc/test/temba-select.test.js +49 -0
- package/out-tsc/test/temba-select.test.js.map +1 -1
- package/out-tsc/test/temba-toast.test.js +1 -2
- package/out-tsc/test/temba-toast.test.js.map +1 -1
- package/out-tsc/test/temba-utils-index.test.js +2 -2
- package/out-tsc/test/temba-utils-index.test.js.map +1 -1
- package/out-tsc/test/utils.test.js +31 -3
- package/out-tsc/test/utils.test.js.map +1 -1
- package/package.json +2 -3
- package/screenshots/truth/webchat/connected-state.png +0 -0
- package/src/chart/TembaChart.ts +29 -22
- package/src/flow/Editor.ts +1 -1
- package/src/select/Select.ts +1 -1
- package/src/thumbnail/Thumbnail.ts +1 -1
- package/test/temba-chart.test.ts +1 -1
- package/test/temba-compose.test.ts +11 -38
- package/test/temba-contact-chat.test.ts +4 -6
- package/test/temba-dropdown.test.ts +1 -1
- package/test/temba-omnibox.test.ts +5 -0
- package/test/temba-select.test.ts +67 -0
- package/test/temba-toast.test.ts +2 -2
- package/test/temba-utils-index.test.ts +2 -2
- package/test/utils.test.ts +39 -3
- package/web-test-runner.config.mjs +4 -2
- package/.storybook/main.js +0 -14
- package/.storybook/preview-head.html +0 -1
- package/.storybook/preview.js +0 -17
- package/demo/agents.html +0 -147
- package/demo/old.html +0 -573
- package/demo/remote.html +0 -3
- package/demo/test-drag-drop.html +0 -94
- package/screenshots/truth/compose/attachments-with-files-focused.png +0 -0
- package/stories/temba-checkbox.stories.md +0 -37
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,24 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
+
#### [v0.124.2](https://github.com/nyaruka/temba-components/compare/v0.124.1...v0.124.2)
|
|
8
|
+
|
|
9
|
+
- Add showAll attribute for temba-chart [`#558`](https://github.com/nyaruka/temba-components/pull/558)
|
|
10
|
+
|
|
11
|
+
#### [v0.124.1](https://github.com/nyaruka/temba-components/compare/v0.124.0...v0.124.1)
|
|
12
|
+
|
|
13
|
+
> 11 June 2025
|
|
14
|
+
|
|
15
|
+
- Fix display issue with Select using tags - preserve selected item text in multi-select mode [`#557`](https://github.com/nyaruka/temba-components/pull/557)
|
|
16
|
+
- Break out component demos into separate pages and remove storybook [`#551`](https://github.com/nyaruka/temba-components/pull/551)
|
|
17
|
+
- Final validation completed - Select tags display issue resolved [`e8fbccd`](https://github.com/nyaruka/temba-components/commit/e8fbccd28f317d6a3658fb105db8beb7915a6891)
|
|
18
|
+
- Initial plan for issue [`7ea25d1`](https://github.com/nyaruka/temba-components/commit/7ea25d126f3048efeb47181ff428f2e142f79f07)
|
|
19
|
+
- Merge pull request #553 from nyaruka/copilot/fix-bb017bcf-1d98-4d9d-bb9c-4d985d422ad6 [`79bd1c5`](https://github.com/nyaruka/temba-components/commit/79bd1c594eade8028bef3415851eaa8754718238)
|
|
20
|
+
|
|
7
21
|
#### [v0.124.0](https://github.com/nyaruka/temba-components/compare/v0.123.0...v0.124.0)
|
|
8
22
|
|
|
23
|
+
> 6 June 2025
|
|
24
|
+
|
|
9
25
|
- Add drag and drop reordering to multi-select components [`#546`](https://github.com/nyaruka/temba-components/pull/546)
|
|
10
26
|
- Add comprehensive test coverage for flow components [`#548`](https://github.com/nyaruka/temba-components/pull/548)
|
|
11
27
|
- Not sure this addresses the intermittent WebChat test failure, but I fundamentally agree with the changes anyways. [`#544`](https://github.com/nyaruka/temba-components/pull/544)
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Test Suite Optimization Guide
|
|
2
|
+
|
|
3
|
+
This document outlines strategies for running tests efficiently and optimizing developer feedback cycles.
|
|
4
|
+
|
|
5
|
+
## Quick Test Commands
|
|
6
|
+
|
|
7
|
+
### Fast Test Execution
|
|
8
|
+
```bash
|
|
9
|
+
# Run tests in fast mode (skips network idle waits)
|
|
10
|
+
yarn test:fast
|
|
11
|
+
|
|
12
|
+
# Run only unit tests (excludes visual regression tests)
|
|
13
|
+
yarn test:unit
|
|
14
|
+
|
|
15
|
+
# Watch mode for iterative development
|
|
16
|
+
yarn test:watch
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Coverage and Validation
|
|
20
|
+
```bash
|
|
21
|
+
# Full test suite with coverage
|
|
22
|
+
yarn test --coverage
|
|
23
|
+
|
|
24
|
+
# Complete validation (formatting, build, tests)
|
|
25
|
+
yarn validate
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Test Categories
|
|
29
|
+
|
|
30
|
+
### Unit Tests
|
|
31
|
+
- Fast execution (< 1s per test)
|
|
32
|
+
- No visual screenshots
|
|
33
|
+
- Focus on component logic and behavior
|
|
34
|
+
|
|
35
|
+
### Visual Regression Tests
|
|
36
|
+
- Screenshot comparisons
|
|
37
|
+
- Slower execution due to image processing
|
|
38
|
+
- Use `assertScreenshot()` helper
|
|
39
|
+
|
|
40
|
+
## Performance Optimizations
|
|
41
|
+
|
|
42
|
+
### 1. Timeout Configurations
|
|
43
|
+
- Default test timeout: 5s (reduced from 10s)
|
|
44
|
+
- Concurrency: 4 parallel browsers
|
|
45
|
+
- Network idle wait: 100ms + 1s timeout (when enabled)
|
|
46
|
+
|
|
47
|
+
### 2. Fast Mode Features
|
|
48
|
+
- Pass `--fast` flag to skip network idle waits
|
|
49
|
+
- Reduced screenshot comparison timeouts
|
|
50
|
+
- Optimized clock tick intervals in fake timer tests
|
|
51
|
+
|
|
52
|
+
### 3. Helper Function Optimizations
|
|
53
|
+
- `openSelect()`: 25ms wait (reduced from 100ms)
|
|
54
|
+
- `openAndClick()`: 25ms clock tick (reduced from 50ms)
|
|
55
|
+
- Toast test timeouts: 75ms (reduced from 150ms)
|
|
56
|
+
|
|
57
|
+
### 4. Development Best Practices
|
|
58
|
+
|
|
59
|
+
#### Use Minimal Waits
|
|
60
|
+
```typescript
|
|
61
|
+
// Good: Use updateComplete when possible
|
|
62
|
+
await component.updateComplete;
|
|
63
|
+
|
|
64
|
+
// Acceptable: Short timeouts when necessary
|
|
65
|
+
await new Promise(resolve => setTimeout(resolve, 25));
|
|
66
|
+
|
|
67
|
+
// Avoid: Long arbitrary waits
|
|
68
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Optimize Clock Usage
|
|
72
|
+
```typescript
|
|
73
|
+
// Good: Run all pending timers
|
|
74
|
+
clock.runAll();
|
|
75
|
+
|
|
76
|
+
// Good: Minimal specific ticks
|
|
77
|
+
clock.tick(25);
|
|
78
|
+
|
|
79
|
+
// Avoid: Large clock advances
|
|
80
|
+
clock.tick(1000);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
#### Efficient Screenshot Testing
|
|
84
|
+
```typescript
|
|
85
|
+
// Good: Test behavior first, then screenshot
|
|
86
|
+
expect(component.property).to.equal(expectedValue);
|
|
87
|
+
await assertScreenshot('component/state', getClip(component));
|
|
88
|
+
|
|
89
|
+
// Good: Group related visual states
|
|
90
|
+
await assertScreenshot('select/open', getClipWithOptions(select));
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Running Subsets of Tests
|
|
94
|
+
|
|
95
|
+
### Individual Test Files
|
|
96
|
+
```bash
|
|
97
|
+
# Run specific test file
|
|
98
|
+
yarn test test/temba-select.test.ts
|
|
99
|
+
|
|
100
|
+
# Run multiple specific files
|
|
101
|
+
yarn test test/temba-select.test.ts test/temba-list.test.ts
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Isolating Tests During Development
|
|
105
|
+
Use `it.only()` to focus on specific tests:
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
// Run only this test
|
|
109
|
+
it.only('should handle specific case', async () => {
|
|
110
|
+
// test implementation
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// Skip this test
|
|
114
|
+
it.skip('should handle edge case', async () => {
|
|
115
|
+
// test implementation
|
|
116
|
+
});
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Environment-Specific Behavior
|
|
120
|
+
|
|
121
|
+
### Copilot Environment
|
|
122
|
+
- Higher screenshot comparison thresholds (1.0 vs 0.1)
|
|
123
|
+
- Automatic detection via environment variables
|
|
124
|
+
- Adaptive timeout handling
|
|
125
|
+
|
|
126
|
+
### CI Environment
|
|
127
|
+
- Standard screenshot comparison
|
|
128
|
+
- Full network idle waits
|
|
129
|
+
- Complete test suite execution
|
|
130
|
+
|
|
131
|
+
## Performance Monitoring
|
|
132
|
+
|
|
133
|
+
### Timing Analysis
|
|
134
|
+
Monitor test execution times to identify slow tests:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Time full test suite
|
|
138
|
+
time yarn test
|
|
139
|
+
|
|
140
|
+
# Profile individual test files
|
|
141
|
+
time yarn test test/specific-file.test.ts
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Common Performance Issues
|
|
145
|
+
1. **Excessive timeouts**: Replace with `updateComplete` where possible
|
|
146
|
+
2. **Redundant screenshots**: Group similar visual states
|
|
147
|
+
3. **Network waits**: Use fast mode for unit-focused testing
|
|
148
|
+
4. **Large clock advances**: Use minimal tick values
|
|
149
|
+
|
|
150
|
+
## Best Practices Summary
|
|
151
|
+
|
|
152
|
+
1. **Start with fast mode** during development
|
|
153
|
+
2. **Use unit tests** for rapid iteration
|
|
154
|
+
3. **Reserve full suite** for final validation
|
|
155
|
+
4. **Group visual tests** by component/feature
|
|
156
|
+
5. **Minimize wait times** in test helpers
|
|
157
|
+
6. **Leverage concurrency** with parallel execution
|
|
158
|
+
7. **Monitor and profile** slow tests regularly
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en-GB">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Alert Examples</title>
|
|
6
|
+
<link
|
|
7
|
+
href="/static/css/temba-components.css"
|
|
8
|
+
rel="stylesheet"
|
|
9
|
+
type="text/css"
|
|
10
|
+
/>
|
|
11
|
+
<link
|
|
12
|
+
href="https://fonts.googleapis.com/css?family=Roboto+Mono:300|Roboto:300,400,500"
|
|
13
|
+
rel="stylesheet"
|
|
14
|
+
/>
|
|
15
|
+
<link
|
|
16
|
+
href="../styles.css"
|
|
17
|
+
rel="stylesheet"
|
|
18
|
+
type="text/css"
|
|
19
|
+
/>
|
|
20
|
+
</head>
|
|
21
|
+
<body>
|
|
22
|
+
<h1>Alert Examples</h1>
|
|
23
|
+
<p><a href="../index.html">← Back to main demo</a></p>
|
|
24
|
+
|
|
25
|
+
<div class="example">
|
|
26
|
+
<h3>Basic Alert</h3>
|
|
27
|
+
<p>A simple alert component</p>
|
|
28
|
+
<temba-alert>This is a basic alert message.</temba-alert>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="example">
|
|
32
|
+
<h3>Success Alert</h3>
|
|
33
|
+
<p>An alert for successful actions</p>
|
|
34
|
+
<temba-alert level="success">Your changes have been saved successfully!</temba-alert>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div class="example">
|
|
38
|
+
<h3>Warning Alert</h3>
|
|
39
|
+
<p>An alert for warning messages</p>
|
|
40
|
+
<temba-alert level="warning">Please review your input before proceeding.</temba-alert>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="example">
|
|
44
|
+
<h3>Error Alert</h3>
|
|
45
|
+
<p>An alert for error messages</p>
|
|
46
|
+
<temba-alert level="error">An error occurred while processing your request.</temba-alert>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div class="example">
|
|
50
|
+
<h3>Info Alert</h3>
|
|
51
|
+
<p>An alert for informational messages</p>
|
|
52
|
+
<temba-alert level="info">This feature is currently in beta testing.</temba-alert>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div class="example">
|
|
56
|
+
<h3>Dismissible Alert</h3>
|
|
57
|
+
<p>An alert that can be closed</p>
|
|
58
|
+
<temba-alert dismissible>This alert can be dismissed by clicking the X button.</temba-alert>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<script type="module">
|
|
62
|
+
import '../../out-tsc/temba-modules.js';
|
|
63
|
+
</script>
|
|
64
|
+
</body>
|
|
65
|
+
</html>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en-GB">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Button Examples</title>
|
|
6
|
+
<link
|
|
7
|
+
href="/static/css/temba-components.css"
|
|
8
|
+
rel="stylesheet"
|
|
9
|
+
type="text/css"
|
|
10
|
+
/>
|
|
11
|
+
<link
|
|
12
|
+
href="https://fonts.googleapis.com/css?family=Roboto+Mono:300|Roboto:300,400,500"
|
|
13
|
+
rel="stylesheet"
|
|
14
|
+
/>
|
|
15
|
+
<link href="../styles.css" rel="stylesheet" type="text/css" />
|
|
16
|
+
</head>
|
|
17
|
+
<body>
|
|
18
|
+
<h1>Button Examples</h1>
|
|
19
|
+
<p><a href="../index.html">← Back to main demo</a></p>
|
|
20
|
+
|
|
21
|
+
<div class="example">
|
|
22
|
+
<h3>Basic Button</h3>
|
|
23
|
+
<p>A simple button component</p>
|
|
24
|
+
<temba-button name="Click Me"></temba-button>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div class="example">
|
|
28
|
+
<h3>Primary Button</h3>
|
|
29
|
+
<p>A primary styled button</p>
|
|
30
|
+
<temba-button primary name="Primary Action"></temba-button>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="example">
|
|
34
|
+
<h3>Secondary Button</h3>
|
|
35
|
+
<p>A secondary styled button</p>
|
|
36
|
+
<temba-button secondary name="Secondary Action"></temba-button>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="example">
|
|
40
|
+
<h3>Small Button</h3>
|
|
41
|
+
<p>A smaller button variant</p>
|
|
42
|
+
<temba-button small name="Small Button"></temba-button>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div class="example">
|
|
46
|
+
<h3>Disabled Button</h3>
|
|
47
|
+
<p>A button that cannot be clicked</p>
|
|
48
|
+
<temba-button disabled name="Disabled Button"></temba-button>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div class="example">
|
|
52
|
+
<h3>Multiple Buttons</h3>
|
|
53
|
+
<p>Several buttons in a row with proper constraints</p>
|
|
54
|
+
<div style="display: flex; gap: 10px; flex-wrap: wrap; max-width: 400px">
|
|
55
|
+
<div style="flex: 0 0 auto; max-width: 100px">
|
|
56
|
+
<temba-button name="Save"></temba-button>
|
|
57
|
+
</div>
|
|
58
|
+
<div style="flex: 0 0 auto; max-width: 100px">
|
|
59
|
+
<temba-button secondary name="Cancel"></temba-button>
|
|
60
|
+
</div>
|
|
61
|
+
<div style="flex: 0 0 auto; max-width: 100px">
|
|
62
|
+
<temba-button primary name="Submit"></temba-button>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<script type="module">
|
|
68
|
+
import '../../out-tsc/temba-modules.js';
|
|
69
|
+
</script>
|
|
70
|
+
</body>
|
|
71
|
+
</html>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en-GB">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Chart Examples</title>
|
|
6
|
+
<link
|
|
7
|
+
href="/static/css/temba-components.css"
|
|
8
|
+
rel="stylesheet"
|
|
9
|
+
type="text/css"
|
|
10
|
+
/>
|
|
11
|
+
<link
|
|
12
|
+
href="https://fonts.googleapis.com/css?family=Roboto+Mono:300|Roboto:300,400,500"
|
|
13
|
+
rel="stylesheet"
|
|
14
|
+
/>
|
|
15
|
+
<link
|
|
16
|
+
href="../styles.css"
|
|
17
|
+
rel="stylesheet"
|
|
18
|
+
type="text/css"
|
|
19
|
+
/>
|
|
20
|
+
</head>
|
|
21
|
+
<body>
|
|
22
|
+
<temba-store></temba-store>
|
|
23
|
+
<h1>Chart Examples</h1>
|
|
24
|
+
<p><a href="../index.html">← Back to main demo</a></p>
|
|
25
|
+
|
|
26
|
+
<div class="example">
|
|
27
|
+
<h3>Summation Chart</h3>
|
|
28
|
+
<p>A basic chart, summing all datasets</p>
|
|
29
|
+
<temba-chart url="../data/server/opened-tickets.json"></temba-chart>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="example">
|
|
33
|
+
<h3>Summation with Splits</h3>
|
|
34
|
+
<p>Normal summation, but with optional splits in the config options </p>
|
|
35
|
+
<temba-chart url="../data/server/opened-tickets.json" dataname="Tickets" config legend></temba-chart>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="example">
|
|
39
|
+
<h3>Summation with Configured Splits</h3>
|
|
40
|
+
<p>Normal summation, but with configured splits</p>
|
|
41
|
+
<temba-chart url="../data/server/opened-tickets.json" dataname="Tickets" splits="Tracking,Orders" hideother legend></temba-chart>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div class="example">
|
|
45
|
+
<h3>Duration Formatted Chart</h3>
|
|
46
|
+
<p>This chart expects series data in seconds and displays them as durations on the y axis and in tooltips.</p>
|
|
47
|
+
<temba-chart single dataname="Average Response" formatDuration header="Response Time" url="../data/server/response-time.json"></temba-chart>
|
|
48
|
+
<p>Here is the same duration chart, but as a line chart</p>
|
|
49
|
+
<temba-chart style="margin:2em" chartType="line" single dataName="Average Response" formatDuration url="../data/server/response-time.json"></temba-chart>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<script type="module">
|
|
53
|
+
import '../../out-tsc/temba-modules.js';
|
|
54
|
+
</script>
|
|
55
|
+
</body>
|
|
56
|
+
</html>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en-GB">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Checkbox Examples</title>
|
|
6
|
+
<link
|
|
7
|
+
href="/static/css/temba-components.css"
|
|
8
|
+
rel="stylesheet"
|
|
9
|
+
type="text/css"
|
|
10
|
+
/>
|
|
11
|
+
<link
|
|
12
|
+
href="https://fonts.googleapis.com/css?family=Roboto+Mono:300|Roboto:300,400,500"
|
|
13
|
+
rel="stylesheet"
|
|
14
|
+
/>
|
|
15
|
+
<link
|
|
16
|
+
href="../styles.css"
|
|
17
|
+
rel="stylesheet"
|
|
18
|
+
type="text/css"
|
|
19
|
+
/>
|
|
20
|
+
</head>
|
|
21
|
+
<body>
|
|
22
|
+
<h1>Checkbox Examples</h1>
|
|
23
|
+
<p><a href="../index.html">← Back to main demo</a></p>
|
|
24
|
+
|
|
25
|
+
<div class="example">
|
|
26
|
+
<h3>Basic Checkbox</h3>
|
|
27
|
+
<p>A simple checkbox component</p>
|
|
28
|
+
<temba-checkbox label="Check this out" checked></temba-checkbox>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="example">
|
|
32
|
+
<h3>Unchecked Checkbox</h3>
|
|
33
|
+
<p>A checkbox that starts unchecked</p>
|
|
34
|
+
<temba-checkbox label="This is not checked"></temba-checkbox>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div class="example">
|
|
38
|
+
<h3>Checkbox with Help Text</h3>
|
|
39
|
+
<p>A checkbox with additional help text</p>
|
|
40
|
+
<temba-checkbox
|
|
41
|
+
name="schedule"
|
|
42
|
+
label="Schedule for later delivery"
|
|
43
|
+
help_text="This is something you should think long and hard about"
|
|
44
|
+
></temba-checkbox>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div class="example">
|
|
48
|
+
<h3>Disabled Checkbox</h3>
|
|
49
|
+
<p>A checkbox that cannot be changed</p>
|
|
50
|
+
<temba-checkbox
|
|
51
|
+
name="disabled"
|
|
52
|
+
label="You can't check this one"
|
|
53
|
+
help_text="It is disabled, don't click it"
|
|
54
|
+
disabled
|
|
55
|
+
></temba-checkbox>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div class="example">
|
|
59
|
+
<h3>Multiple Checkboxes</h3>
|
|
60
|
+
<p>Several checkboxes in a row</p>
|
|
61
|
+
<div style="display: flex; flex-wrap: wrap; gap: 20px;">
|
|
62
|
+
<temba-checkbox label="Option 1" checked></temba-checkbox>
|
|
63
|
+
<temba-checkbox label="Option 2"></temba-checkbox>
|
|
64
|
+
<temba-checkbox label="Option 3" checked></temba-checkbox>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<script type="module">
|
|
69
|
+
import '../../out-tsc/temba-modules.js';
|
|
70
|
+
</script>
|
|
71
|
+
</body>
|
|
72
|
+
</html>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en-GB">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Compose Examples</title>
|
|
6
|
+
<link
|
|
7
|
+
href="/static/css/temba-components.css"
|
|
8
|
+
rel="stylesheet"
|
|
9
|
+
type="text/css"
|
|
10
|
+
/>
|
|
11
|
+
<link
|
|
12
|
+
href="https://fonts.googleapis.com/css?family=Roboto+Mono:300|Roboto:300,400,500"
|
|
13
|
+
rel="stylesheet"
|
|
14
|
+
/>
|
|
15
|
+
<link
|
|
16
|
+
href="../styles.css"
|
|
17
|
+
rel="stylesheet"
|
|
18
|
+
type="text/css"
|
|
19
|
+
/>
|
|
20
|
+
</head>
|
|
21
|
+
<body>
|
|
22
|
+
<h1>Compose Examples</h1>
|
|
23
|
+
<p><a href="../index.html">← Back to main demo</a></p>
|
|
24
|
+
|
|
25
|
+
<div class="example">
|
|
26
|
+
<h3>Basic Compose</h3>
|
|
27
|
+
<p>A simple compose component for text input</p>
|
|
28
|
+
<temba-compose placeholder="Type your message here..."></temba-compose>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="example">
|
|
32
|
+
<h3>Compose with Counter</h3>
|
|
33
|
+
<p>A compose component with character counting</p>
|
|
34
|
+
<temba-compose
|
|
35
|
+
placeholder="Enter your message (max 160 characters)..."
|
|
36
|
+
counter
|
|
37
|
+
maxlength="160">
|
|
38
|
+
</temba-compose>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div class="example">
|
|
42
|
+
<h3>Compose with Attachments</h3>
|
|
43
|
+
<p>A compose component that supports file attachments</p>
|
|
44
|
+
<temba-compose
|
|
45
|
+
placeholder="Write your message and attach files..."
|
|
46
|
+
attachments>
|
|
47
|
+
</temba-compose>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div class="example">
|
|
51
|
+
<h3>Rich Text Compose</h3>
|
|
52
|
+
<p>A compose component with rich text formatting</p>
|
|
53
|
+
<temba-compose
|
|
54
|
+
placeholder="Format your text with rich editing..."
|
|
55
|
+
rich-text>
|
|
56
|
+
</temba-compose>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div class="example">
|
|
60
|
+
<h3>Multi-line Compose</h3>
|
|
61
|
+
<p>A compose component with multiple lines</p>
|
|
62
|
+
<temba-compose
|
|
63
|
+
placeholder="Enter a longer message..."
|
|
64
|
+
rows="4">
|
|
65
|
+
</temba-compose>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<script type="module">
|
|
69
|
+
import '../../out-tsc/temba-modules.js';
|
|
70
|
+
</script>
|
|
71
|
+
</body>
|
|
72
|
+
</html>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"period": ["2025-03-08", "2025-06-07"],
|
|
3
|
+
"data": {
|
|
4
|
+
"labels": [
|
|
5
|
+
"2025-05-27",
|
|
6
|
+
"2025-05-28",
|
|
7
|
+
"2025-05-29",
|
|
8
|
+
"2025-05-30",
|
|
9
|
+
"2025-05-31",
|
|
10
|
+
"2025-06-01",
|
|
11
|
+
"2025-06-02",
|
|
12
|
+
"2025-06-03",
|
|
13
|
+
"2025-06-04",
|
|
14
|
+
"2025-06-05",
|
|
15
|
+
"2025-06-06"
|
|
16
|
+
],
|
|
17
|
+
"datasets": [
|
|
18
|
+
{
|
|
19
|
+
"label": "General",
|
|
20
|
+
"data": [1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"label": "VIPs",
|
|
24
|
+
"data": [2, 7, 5, 5, 2, 1, 8, 5, 0, 1, 3]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"label": "Orders",
|
|
28
|
+
"data": [51, 84, 71, 78, 44, 45, 106, 114, 138, 125, 83]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"label": "Survey",
|
|
32
|
+
"data": [7, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"label": "Tracking",
|
|
36
|
+
"data": [10, 26, 28, 43, 16, 10, 36, 24, 18, 26, 9]
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"period": ["2025-03-08", "2025-06-07"],
|
|
3
|
+
"data": {
|
|
4
|
+
"labels": [
|
|
5
|
+
"2025-05-27",
|
|
6
|
+
"2025-05-28",
|
|
7
|
+
"2025-05-29",
|
|
8
|
+
"2025-05-30",
|
|
9
|
+
"2025-05-31",
|
|
10
|
+
"2025-06-01",
|
|
11
|
+
"2025-06-02",
|
|
12
|
+
"2025-06-03",
|
|
13
|
+
"2025-06-04",
|
|
14
|
+
"2025-06-05",
|
|
15
|
+
"2025-06-06"
|
|
16
|
+
],
|
|
17
|
+
"datasets": [
|
|
18
|
+
{
|
|
19
|
+
"label": "Response Time",
|
|
20
|
+
"data": [
|
|
21
|
+
101257, 109886, 93681, 78496, 106132, 84003, 74701, 71462, 61138,
|
|
22
|
+
31112, 7231
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en-GB">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Date Picker Examples</title>
|
|
6
|
+
<link
|
|
7
|
+
href="/static/css/temba-components.css"
|
|
8
|
+
rel="stylesheet"
|
|
9
|
+
type="text/css"
|
|
10
|
+
/>
|
|
11
|
+
<link
|
|
12
|
+
href="https://fonts.googleapis.com/css?family=Roboto+Mono:300|Roboto:300,400,500"
|
|
13
|
+
rel="stylesheet"
|
|
14
|
+
/>
|
|
15
|
+
<link
|
|
16
|
+
href="../styles.css"
|
|
17
|
+
rel="stylesheet"
|
|
18
|
+
type="text/css"
|
|
19
|
+
/>
|
|
20
|
+
</head>
|
|
21
|
+
<body>
|
|
22
|
+
<h1>Date Picker Examples</h1>
|
|
23
|
+
<p><a href="../index.html">← Back to main demo</a></p>
|
|
24
|
+
|
|
25
|
+
<div class="example">
|
|
26
|
+
<h3>Date and Time Picker</h3>
|
|
27
|
+
<p>A date picker that includes time selection</p>
|
|
28
|
+
<temba-datepicker
|
|
29
|
+
time
|
|
30
|
+
value="2020-01-20T14:00+00:00"
|
|
31
|
+
timezone="UTC"
|
|
32
|
+
></temba-datepicker>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div class="example">
|
|
36
|
+
<h3>Date Only Picker</h3>
|
|
37
|
+
<p>A date picker without time selection</p>
|
|
38
|
+
<temba-datepicker
|
|
39
|
+
value="2022-10-09"
|
|
40
|
+
></temba-datepicker>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="example">
|
|
44
|
+
<h3>Date Picker with Timezone</h3>
|
|
45
|
+
<p>A date picker with a specific timezone</p>
|
|
46
|
+
<temba-datepicker
|
|
47
|
+
time
|
|
48
|
+
value="2022-10-02 01:00:00+00:00"
|
|
49
|
+
timezone="Africa/Lagos"
|
|
50
|
+
></temba-datepicker>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div class="example">
|
|
54
|
+
<h3>Empty Date Picker</h3>
|
|
55
|
+
<p>A date picker with no initial value</p>
|
|
56
|
+
<temba-datepicker></temba-datepicker>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<script>
|
|
60
|
+
function handleDateChange(event) {
|
|
61
|
+
console.log('Date changed:', event.target.value);
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<script type="module">
|
|
66
|
+
import '../../out-tsc/temba-modules.js';
|
|
67
|
+
</script>
|
|
68
|
+
</body>
|
|
69
|
+
</html>
|