@nyaruka/temba-components 0.123.0 → 0.124.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.
Files changed (146) hide show
  1. package/.github/copilot-instructions.md +22 -4
  2. package/CHANGELOG.md +21 -0
  3. package/TEST_OPTIMIZATION.md +158 -0
  4. package/demo/alert/example.html +65 -0
  5. package/demo/button/example.html +71 -0
  6. package/demo/chart/example.html +56 -0
  7. package/demo/checkbox/example.html +72 -0
  8. package/demo/compose/example.html +72 -0
  9. package/demo/data/images/gus.png +0 -0
  10. package/demo/data/images/purrington.jpg +0 -0
  11. package/demo/data/server/opened-tickets.json +40 -0
  12. package/demo/data/server/response-time.json +27 -0
  13. package/demo/datepicker/example.html +69 -0
  14. package/demo/dialog/example.html +107 -0
  15. package/demo/dropdown/example.html +99 -0
  16. package/demo/index.html +152 -430
  17. package/demo/misc/example.html +72 -0
  18. package/demo/progress/example.html +59 -0
  19. package/demo/select/drag-and-drop.html +142 -0
  20. package/demo/select/example.html +82 -0
  21. package/demo/select/multi.html +73 -0
  22. package/demo/slider/example.html +59 -0
  23. package/demo/sortable-list/example.html +99 -0
  24. package/demo/styles.css +183 -0
  25. package/demo/tabs/example.html +91 -0
  26. package/demo/textinput/completion.html +56 -0
  27. package/demo/textinput/example.html +61 -0
  28. package/dist/temba-components.js +323 -191
  29. package/dist/temba-components.js.map +1 -1
  30. package/out-tsc/src/chart/TembaChart.js +19 -16
  31. package/out-tsc/src/chart/TembaChart.js.map +1 -1
  32. package/out-tsc/src/fields/FieldManager.js +27 -34
  33. package/out-tsc/src/fields/FieldManager.js.map +1 -1
  34. package/out-tsc/src/flow/Editor.js +1 -1
  35. package/out-tsc/src/flow/Editor.js.map +1 -1
  36. package/out-tsc/src/list/SortableList.js +257 -60
  37. package/out-tsc/src/list/SortableList.js.map +1 -1
  38. package/out-tsc/src/omnibox/Omnibox.js +1 -1
  39. package/out-tsc/src/omnibox/Omnibox.js.map +1 -1
  40. package/out-tsc/src/select/Select.js +198 -38
  41. package/out-tsc/src/select/Select.js.map +1 -1
  42. package/out-tsc/src/thumbnail/Thumbnail.js +1 -1
  43. package/out-tsc/src/thumbnail/Thumbnail.js.map +1 -1
  44. package/out-tsc/src/webchat/WebChat.js +5 -2
  45. package/out-tsc/src/webchat/WebChat.js.map +1 -1
  46. package/out-tsc/test/temba-chart.test.js +1 -1
  47. package/out-tsc/test/temba-chart.test.js.map +1 -1
  48. package/out-tsc/test/temba-compose.test.js +6 -30
  49. package/out-tsc/test/temba-compose.test.js.map +1 -1
  50. package/out-tsc/test/temba-contact-chat.test.js +1 -2
  51. package/out-tsc/test/temba-contact-chat.test.js.map +1 -1
  52. package/out-tsc/test/temba-dropdown.test.js +1 -1
  53. package/out-tsc/test/temba-dropdown.test.js.map +1 -1
  54. package/out-tsc/test/temba-flow-editor-node.test.js +273 -0
  55. package/out-tsc/test/temba-flow-editor-node.test.js.map +1 -0
  56. package/out-tsc/test/temba-flow-editor.test.js +244 -0
  57. package/out-tsc/test/temba-flow-editor.test.js.map +1 -0
  58. package/out-tsc/test/temba-flow-plumber.test.js +145 -0
  59. package/out-tsc/test/temba-flow-plumber.test.js.map +1 -0
  60. package/out-tsc/test/temba-flow-render.test.js +171 -0
  61. package/out-tsc/test/temba-flow-render.test.js.map +1 -0
  62. package/out-tsc/test/temba-omnibox.test.js +6 -3
  63. package/out-tsc/test/temba-omnibox.test.js.map +1 -1
  64. package/out-tsc/test/temba-select.test.js +183 -53
  65. package/out-tsc/test/temba-select.test.js.map +1 -1
  66. package/out-tsc/test/temba-sortable-list.test.js +91 -15
  67. package/out-tsc/test/temba-sortable-list.test.js.map +1 -1
  68. package/out-tsc/test/temba-toast.test.js +1 -2
  69. package/out-tsc/test/temba-toast.test.js.map +1 -1
  70. package/out-tsc/test/temba-utils-index.test.js +2 -2
  71. package/out-tsc/test/temba-utils-index.test.js.map +1 -1
  72. package/out-tsc/test/temba-webchat-lightbox-fix.test.js +42 -0
  73. package/out-tsc/test/temba-webchat-lightbox-fix.test.js.map +1 -0
  74. package/out-tsc/test/utils.test.js +58 -0
  75. package/out-tsc/test/utils.test.js.map +1 -1
  76. package/package.json +2 -3
  77. package/screenshots/truth/flow/editor-basic.png +0 -0
  78. package/screenshots/truth/list/fields-dragging.png +0 -0
  79. package/screenshots/truth/list/sortable-dragging.png +0 -0
  80. package/screenshots/truth/list/sortable-dropped.png +0 -0
  81. package/screenshots/truth/list/sortable.png +0 -0
  82. package/screenshots/truth/omnibox/selected.png +0 -0
  83. package/screenshots/truth/select/disabled-multi-selection.png +0 -0
  84. package/screenshots/truth/select/disabled-selection.png +0 -0
  85. package/screenshots/truth/select/disabled.png +0 -0
  86. package/screenshots/truth/select/embedded.png +0 -0
  87. package/screenshots/truth/select/empty-options.png +0 -0
  88. package/screenshots/truth/select/expression-selected.png +0 -0
  89. package/screenshots/truth/select/expressions.png +0 -0
  90. package/screenshots/truth/select/functions.png +0 -0
  91. package/screenshots/truth/select/local-options.png +0 -0
  92. package/screenshots/truth/select/multi-reorder-final.png +0 -0
  93. package/screenshots/truth/select/multi-reorder-initial.png +0 -0
  94. package/screenshots/truth/select/multi-with-endpoint.png +0 -0
  95. package/screenshots/truth/select/multiple-initial-values.png +0 -0
  96. package/screenshots/truth/select/remote-options.png +0 -0
  97. package/screenshots/truth/select/search-enabled.png +0 -0
  98. package/screenshots/truth/select/search-multi-no-matches.png +0 -0
  99. package/screenshots/truth/select/search-selected-focus.png +0 -0
  100. package/screenshots/truth/select/search-selected.png +0 -0
  101. package/screenshots/truth/select/search-with-selected.png +0 -0
  102. package/screenshots/truth/select/searching.png +0 -0
  103. package/screenshots/truth/select/selected-multi-maxitems-reached.png +0 -0
  104. package/screenshots/truth/select/selected-multi.png +0 -0
  105. package/screenshots/truth/select/selected-single.png +0 -0
  106. package/screenshots/truth/select/selection-clearable.png +0 -0
  107. package/screenshots/truth/select/static-initial-value.png +0 -0
  108. package/screenshots/truth/select/static-initial-via-selected.png +0 -0
  109. package/screenshots/truth/select/truncated-selection.png +0 -0
  110. package/screenshots/truth/select/with-placeholder.png +0 -0
  111. package/screenshots/truth/select/without-placeholder.png +0 -0
  112. package/screenshots/truth/templates/default.png +0 -0
  113. package/screenshots/truth/templates/unapproved.png +0 -0
  114. package/screenshots/truth/webchat/connected-state.png +0 -0
  115. package/src/chart/TembaChart.ts +20 -16
  116. package/src/fields/FieldManager.ts +30 -38
  117. package/src/flow/Editor.ts +1 -1
  118. package/src/list/SortableList.ts +291 -67
  119. package/src/omnibox/Omnibox.ts +1 -1
  120. package/src/select/Select.ts +213 -42
  121. package/src/thumbnail/Thumbnail.ts +1 -1
  122. package/src/webchat/WebChat.ts +5 -2
  123. package/test/temba-chart.test.ts +1 -1
  124. package/test/temba-compose.test.ts +11 -38
  125. package/test/temba-contact-chat.test.ts +4 -6
  126. package/test/temba-dropdown.test.ts +1 -1
  127. package/test/temba-flow-editor-node.test.ts +344 -0
  128. package/test/temba-flow-editor.test.ts +301 -0
  129. package/test/temba-flow-plumber.test.ts +189 -0
  130. package/test/temba-flow-render.test.ts +220 -0
  131. package/test/temba-omnibox.test.ts +7 -3
  132. package/test/temba-select.test.ts +247 -79
  133. package/test/temba-sortable-list.test.ts +108 -15
  134. package/test/temba-toast.test.ts +2 -2
  135. package/test/temba-utils-index.test.ts +2 -2
  136. package/test/temba-webchat-lightbox-fix.test.ts +57 -0
  137. package/test/utils.test.ts +88 -0
  138. package/web-test-runner.config.mjs +4 -2
  139. package/.storybook/main.js +0 -14
  140. package/.storybook/preview-head.html +0 -1
  141. package/.storybook/preview.js +0 -17
  142. package/demo/agents.html +0 -147
  143. package/demo/old.html +0 -573
  144. package/demo/remote.html +0 -3
  145. package/screenshots/truth/compose/attachments-with-files-focused.png +0 -0
  146. package/stories/temba-checkbox.stories.md +0 -37
@@ -29,12 +29,29 @@ To check for coverage, use:
29
29
  yarn test --coverage
30
30
  ```
31
31
 
32
- You also can run an idividual test to speed up development
32
+
33
+ ### Isolating Tests for Quicker Development ###
34
+ You also can run an idividual test file to speed up development:
33
35
 
34
36
  ```bash
35
37
  yarn test test/temba-textinput.test.ts
36
38
  ```
37
39
 
40
+ You can isolate a specific test within a file you are working to speed things up by updating the method in the file from it(...) to it.only(...)
41
+
42
+ For example:
43
+ ```typescript
44
+ it('can select a single option', async () => {...});
45
+ ```
46
+ becomes..
47
+ ```typescript
48
+ it.only('can select a single option', async () => {...});
49
+ ```
50
+
51
+ By doing this and only running the individual test file, you can drastically speed up iteration while running tests.
52
+
53
+ ### Validation ###
54
+
38
55
  Before a PR is ready it must pass validation checks for linting, formatting, and tests. This will also report coverage and you need to manually verify coverage does not drop.
39
56
 
40
57
  ```bash
@@ -133,9 +150,10 @@ This ordering ensures:
133
150
 
134
151
  1. **Install dependencies:** `yarn install`
135
152
  2. **Start development server:** `yarn start`
136
- 3. **Run tests during development:** `yarn test:watch`
137
- 4. **Lint code:** `yarn lint`
138
- 5. **Build for production:** `yarn build`
153
+ 3. **Run tests during development:** `yarn test`
154
+ 4. **Pre-commit checks before committing:** `yarn pre-commit`
155
+ 5. **Validate changes:** `yarn validate`
156
+ 6. **Check Coverage:** Once validated, check for 100% coverage
139
157
 
140
158
  ## Code Quality
141
159
 
package/CHANGELOG.md CHANGED
@@ -4,8 +4,29 @@ 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.1](https://github.com/nyaruka/temba-components/compare/v0.124.0...v0.124.1)
8
+
9
+ - Fix display issue with Select using tags - preserve selected item text in multi-select mode [`#557`](https://github.com/nyaruka/temba-components/pull/557)
10
+ - Break out component demos into separate pages and remove storybook [`#551`](https://github.com/nyaruka/temba-components/pull/551)
11
+ - Final validation completed - Select tags display issue resolved [`e8fbccd`](https://github.com/nyaruka/temba-components/commit/e8fbccd28f317d6a3658fb105db8beb7915a6891)
12
+ - Initial plan for issue [`7ea25d1`](https://github.com/nyaruka/temba-components/commit/7ea25d126f3048efeb47181ff428f2e142f79f07)
13
+ - Merge pull request #553 from nyaruka/copilot/fix-bb017bcf-1d98-4d9d-bb9c-4d985d422ad6 [`79bd1c5`](https://github.com/nyaruka/temba-components/commit/79bd1c594eade8028bef3415851eaa8754718238)
14
+
15
+ #### [v0.124.0](https://github.com/nyaruka/temba-components/compare/v0.123.0...v0.124.0)
16
+
17
+ > 6 June 2025
18
+
19
+ - Add drag and drop reordering to multi-select components [`#546`](https://github.com/nyaruka/temba-components/pull/546)
20
+ - Add comprehensive test coverage for flow components [`#548`](https://github.com/nyaruka/temba-components/pull/548)
21
+ - 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)
22
+ - Add comprehensive tests for flow components achieving 93.97% coverage [`3261100`](https://github.com/nyaruka/temba-components/commit/32611005a53f5ccac36b88cd50d88ed507605b6b)
23
+ - Implement new drag and drop behavior as requested - hide dragged items and fire events on drop only [`f7daecf`](https://github.com/nyaruka/temba-components/commit/f7daecf0c6737ddbecf85a4f3f726d94ffee08b8)
24
+ - Refactor SortableList to fix drag and drop reordering logic [`4b0a901`](https://github.com/nyaruka/temba-components/commit/4b0a901c7223dcefbed9eec888493b8e322c561f)
25
+
7
26
  #### [v0.123.0](https://github.com/nyaruka/temba-components/compare/v0.122.0...v0.123.0)
8
27
 
28
+ > 4 June 2025
29
+
9
30
  - Update commands for test and validate [`#543`](https://github.com/nyaruka/temba-components/pull/543)
10
31
  - Add comprehensive test coverage for RunList component [`#531`](https://github.com/nyaruka/temba-components/pull/531)
11
32
  - Fix screenshot tests for Copilot environment with adaptive threshold [`#538`](https://github.com/nyaruka/temba-components/pull/538)
@@ -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
+ }