@genspectrum/dashboard-components 0.1.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 (186) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +109 -0
  3. package/custom-elements.json +1587 -0
  4. package/dist/dashboard-components.js +7322 -0
  5. package/dist/dashboard-components.js.map +1 -0
  6. package/dist/genspectrum-components.d.ts +298 -0
  7. package/dist/style.css +2930 -0
  8. package/package.json +109 -0
  9. package/src/constants.ts +6 -0
  10. package/src/index.ts +1 -0
  11. package/src/lapisApi/ReferenceGenome.ts +30 -0
  12. package/src/lapisApi/__mockData__/referenceGenome.json +58 -0
  13. package/src/lapisApi/lapisApi.ts +99 -0
  14. package/src/lapisApi/lapisTypes.ts +51 -0
  15. package/src/operator/Dataset.ts +3 -0
  16. package/src/operator/DivisionOperator.spec.ts +27 -0
  17. package/src/operator/DivisionOperator.ts +60 -0
  18. package/src/operator/FetchAggregatedOperator.ts +44 -0
  19. package/src/operator/FetchInsertionsOperator.ts +24 -0
  20. package/src/operator/FetchSubstitutionsOrDeletionsOperator.ts +49 -0
  21. package/src/operator/FillMissingOperator.spec.ts +26 -0
  22. package/src/operator/FillMissingOperator.ts +30 -0
  23. package/src/operator/GroupByAndSumOperator.spec.ts +26 -0
  24. package/src/operator/GroupByAndSumOperator.ts +26 -0
  25. package/src/operator/GroupByOperator.spec.ts +43 -0
  26. package/src/operator/GroupByOperator.ts +32 -0
  27. package/src/operator/MapOperator.spec.ts +13 -0
  28. package/src/operator/MapOperator.ts +16 -0
  29. package/src/operator/MockOperator.spec.ts +11 -0
  30. package/src/operator/MockOperator.ts +12 -0
  31. package/src/operator/Operator.ts +5 -0
  32. package/src/operator/SlidingOperator.spec.ts +52 -0
  33. package/src/operator/SlidingOperator.ts +23 -0
  34. package/src/operator/SortOperator.spec.ts +13 -0
  35. package/src/operator/SortOperator.ts +16 -0
  36. package/src/preact/LapisUrlContext.ts +3 -0
  37. package/src/preact/ReferenceGenomeContext.ts +5 -0
  38. package/src/preact/components/SegmentSelector.tsx +62 -0
  39. package/src/preact/components/chart.stories.tsx +42 -0
  40. package/src/preact/components/chart.tsx +32 -0
  41. package/src/preact/components/checkbox-selector.stories.tsx +56 -0
  42. package/src/preact/components/checkbox-selector.tsx +46 -0
  43. package/src/preact/components/confidence-interval-selector.tsx +45 -0
  44. package/src/preact/components/csv-download-button.stories.tsx +25 -0
  45. package/src/preact/components/csv-download-button.tsx +51 -0
  46. package/src/preact/components/error-display.stories.tsx +22 -0
  47. package/src/preact/components/error-display.tsx +5 -0
  48. package/src/preact/components/headline.stories.tsx +29 -0
  49. package/src/preact/components/headline.tsx +16 -0
  50. package/src/preact/components/info.stories.tsx +22 -0
  51. package/src/preact/components/info.tsx +16 -0
  52. package/src/preact/components/loading-display.stories.tsx +20 -0
  53. package/src/preact/components/loading-display.tsx +5 -0
  54. package/src/preact/components/min-max-percent-slider.css +40 -0
  55. package/src/preact/components/min-max-range-slider.tsx +95 -0
  56. package/src/preact/components/mutation-type-selector.tsx +30 -0
  57. package/src/preact/components/no-data-display.stories.tsx +20 -0
  58. package/src/preact/components/no-data-display.tsx +5 -0
  59. package/src/preact/components/percent-intput.tsx +49 -0
  60. package/src/preact/components/proportion-selector-dropdown.stories.tsx +66 -0
  61. package/src/preact/components/proportion-selector-dropdown.tsx +33 -0
  62. package/src/preact/components/proportion-selector.stories.tsx +81 -0
  63. package/src/preact/components/proportion-selector.tsx +43 -0
  64. package/src/preact/components/scaling-selector.stories.tsx +25 -0
  65. package/src/preact/components/scaling-selector.tsx +36 -0
  66. package/src/preact/components/select.stories.tsx +42 -0
  67. package/src/preact/components/select.tsx +21 -0
  68. package/src/preact/components/table.stories.tsx +24 -0
  69. package/src/preact/components/table.tsx +51 -0
  70. package/src/preact/components/tabs.stories.tsx +60 -0
  71. package/src/preact/components/tabs.tsx +49 -0
  72. package/src/preact/dateRangeSelector/date-range-selector.stories.tsx +32 -0
  73. package/src/preact/dateRangeSelector/date-range-selector.tsx +228 -0
  74. package/src/preact/dateRangeSelector/dateConversion.ts +8 -0
  75. package/src/preact/locationFilter/__mockData__/aggregated.json +775 -0
  76. package/src/preact/locationFilter/fetchAutocompletionList.spec.ts +36 -0
  77. package/src/preact/locationFilter/fetchAutocompletionList.ts +43 -0
  78. package/src/preact/locationFilter/location-filter.stories.tsx +50 -0
  79. package/src/preact/locationFilter/location-filter.tsx +112 -0
  80. package/src/preact/mutationComparison/__mockData__/nucleotideMutationsOtherVariant.json +295 -0
  81. package/src/preact/mutationComparison/__mockData__/nucleotideMutationsSomeVariant.json +304 -0
  82. package/src/preact/mutationComparison/fetchMutationData.spec.ts +118 -0
  83. package/src/preact/mutationComparison/getMutationComparisonTableData.spec.ts +125 -0
  84. package/src/preact/mutationComparison/getMutationComparisonTableData.ts +40 -0
  85. package/src/preact/mutationComparison/mutation-comparison-table.tsx +43 -0
  86. package/src/preact/mutationComparison/mutation-comparison-venn.tsx +122 -0
  87. package/src/preact/mutationComparison/mutation-comparison.stories.tsx +152 -0
  88. package/src/preact/mutationComparison/mutation-comparison.tsx +179 -0
  89. package/src/preact/mutationComparison/queryMutationData.ts +53 -0
  90. package/src/preact/mutationFilter/mutation-filter.stories.tsx +164 -0
  91. package/src/preact/mutationFilter/mutation-filter.tsx +268 -0
  92. package/src/preact/mutationFilter/parseAndValidateMutation.ts +54 -0
  93. package/src/preact/mutationFilter/parseMutation.spec.ts +150 -0
  94. package/src/preact/mutationFilter/sequenceTypeFromSegment.spec.ts +66 -0
  95. package/src/preact/mutationFilter/sequenceTypeFromSegment.ts +20 -0
  96. package/src/preact/mutations/__mockData__/nucleotideInsertions.json +252 -0
  97. package/src/preact/mutations/__mockData__/nucleotideMutations.json +880 -0
  98. package/src/preact/mutations/getInsertionsTableData.spec.ts +36 -0
  99. package/src/preact/mutations/getInsertionsTableData.ts +10 -0
  100. package/src/preact/mutations/getMutationsGridData.spec.ts +135 -0
  101. package/src/preact/mutations/getMutationsGridData.ts +92 -0
  102. package/src/preact/mutations/getMutationsTableData.spec.ts +94 -0
  103. package/src/preact/mutations/getMutationsTableData.ts +17 -0
  104. package/src/preact/mutations/mutations-grid.tsx +84 -0
  105. package/src/preact/mutations/mutations-insertions-table.tsx +33 -0
  106. package/src/preact/mutations/mutations-table.tsx +47 -0
  107. package/src/preact/mutations/mutations.stories.tsx +95 -0
  108. package/src/preact/mutations/mutations.tsx +192 -0
  109. package/src/preact/mutations/queryMutations.ts +55 -0
  110. package/src/preact/prevalenceOverTime/__mockData__/denominator.json +1700 -0
  111. package/src/preact/prevalenceOverTime/__mockData__/denominatorOneVariant.json +608 -0
  112. package/src/preact/prevalenceOverTime/__mockData__/numeratorEG.json +1560 -0
  113. package/src/preact/prevalenceOverTime/__mockData__/numeratorJN1.json +592 -0
  114. package/src/preact/prevalenceOverTime/__mockData__/numeratorOneVariant.json +604 -0
  115. package/src/preact/prevalenceOverTime/getPrevalenceOverTimeTableData.spec.ts +67 -0
  116. package/src/preact/prevalenceOverTime/getPrevalenceOverTimeTableData.ts +18 -0
  117. package/src/preact/prevalenceOverTime/prevalence-over-time-bar-chart.tsx +105 -0
  118. package/src/preact/prevalenceOverTime/prevalence-over-time-bubble-chart.tsx +86 -0
  119. package/src/preact/prevalenceOverTime/prevalence-over-time-line-chart.tsx +141 -0
  120. package/src/preact/prevalenceOverTime/prevalence-over-time-table.tsx +46 -0
  121. package/src/preact/prevalenceOverTime/prevalence-over-time.stories.tsx +165 -0
  122. package/src/preact/prevalenceOverTime/prevalence-over-time.tsx +202 -0
  123. package/src/preact/relativeGrowthAdvantage/__mockData__/denominator.json +376 -0
  124. package/src/preact/relativeGrowthAdvantage/__mockData__/numerator.json +332 -0
  125. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage-chart.tsx +138 -0
  126. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.stories.tsx +71 -0
  127. package/src/preact/relativeGrowthAdvantage/relative-growth-advantage.tsx +136 -0
  128. package/src/preact/shared/charts/LogitScale.ts +48 -0
  129. package/src/preact/shared/charts/colors.ts +26 -0
  130. package/src/preact/shared/charts/confideceInterval.ts +29 -0
  131. package/src/preact/shared/charts/getYAxisScale.ts +16 -0
  132. package/src/preact/shared/charts/scales.ts +16 -0
  133. package/src/preact/shared/icons/DeleteIcon.tsx +17 -0
  134. package/src/preact/shared/sort/sortInsertions.spec.ts +47 -0
  135. package/src/preact/shared/sort/sortInsertions.ts +21 -0
  136. package/src/preact/shared/sort/sortMutationPositions.spec.ts +31 -0
  137. package/src/preact/shared/sort/sortMutationPositions.ts +14 -0
  138. package/src/preact/shared/sort/sortSubstitutionsAndDeletions.spec.ts +47 -0
  139. package/src/preact/shared/sort/sortSubstitutionsAndDeletions.ts +17 -0
  140. package/src/preact/shared/table/formatProportion.ts +3 -0
  141. package/src/preact/textInput/__mockData__/aggregated_hosts.json +24 -0
  142. package/src/preact/textInput/fetchAutocompleteList.ts +9 -0
  143. package/src/preact/textInput/text-input.stories.tsx +49 -0
  144. package/src/preact/textInput/text-input.tsx +73 -0
  145. package/src/preact/useQuery.ts +27 -0
  146. package/src/query/queryInsertions.ts +14 -0
  147. package/src/query/queryPrevalenceOverTime.ts +126 -0
  148. package/src/query/queryRelativeGrowthAdvantage.ts +131 -0
  149. package/src/query/querySubstitutionsOrDeletions.ts +19 -0
  150. package/src/styles/tailwind.css +3 -0
  151. package/src/styles/tailwind.d.ts +3 -0
  152. package/src/types.ts +23 -0
  153. package/src/utils/mutations.spec.ts +64 -0
  154. package/src/utils/mutations.ts +165 -0
  155. package/src/utils/temporal.spec.ts +97 -0
  156. package/src/utils/temporal.ts +348 -0
  157. package/src/utils/test-utils.ts +5 -0
  158. package/src/utils/type-utils.ts +15 -0
  159. package/src/utils/utils.spec.ts +16 -0
  160. package/src/utils/utils.ts +38 -0
  161. package/src/web-components/PreactLitAdapter.tsx +62 -0
  162. package/src/web-components/PreactLitAdapterWithGridJsStyles.tsx +12 -0
  163. package/src/web-components/app.ts +51 -0
  164. package/src/web-components/display/index.ts +4 -0
  165. package/src/web-components/display/mutation-comparison-component.stories.ts +138 -0
  166. package/src/web-components/display/mutation-comparison-component.tsx +31 -0
  167. package/src/web-components/display/mutations-component.stories.ts +107 -0
  168. package/src/web-components/display/mutations-component.tsx +27 -0
  169. package/src/web-components/display/prevalence-over-time-component.stories.ts +205 -0
  170. package/src/web-components/display/prevalence-over-time-component.tsx +46 -0
  171. package/src/web-components/display/relative-growth-advantage-component.stories.ts +89 -0
  172. package/src/web-components/display/relative-growth-advantage-component.tsx +37 -0
  173. package/src/web-components/index.ts +3 -0
  174. package/src/web-components/input/date-range-selector-component.stories.ts +53 -0
  175. package/src/web-components/input/date-range-selector-component.tsx +33 -0
  176. package/src/web-components/input/index.ts +4 -0
  177. package/src/web-components/input/location-filter-component.stories.ts +184 -0
  178. package/src/web-components/input/location-filter-component.tsx +68 -0
  179. package/src/web-components/input/location-filter.mdx +25 -0
  180. package/src/web-components/input/mutation-filter-component.stories.ts +97 -0
  181. package/src/web-components/input/mutation-filter-component.tsx +27 -0
  182. package/src/web-components/input/text-input-component.stories.ts +92 -0
  183. package/src/web-components/input/text-input-component.tsx +30 -0
  184. package/src/web-components/lapis-context.ts +3 -0
  185. package/src/web-components/reference-genome-context.ts +5 -0
  186. package/src/web-components/withinShadowRoot.story.ts +34 -0
@@ -0,0 +1,1587 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "readme": "",
4
+ "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "src/web-components/PreactLitAdapter.tsx",
8
+ "declarations": [
9
+ {
10
+ "kind": "class",
11
+ "description": "",
12
+ "name": "PreactLitAdapter",
13
+ "members": [],
14
+ "superclass": {
15
+ "name": "ReactiveElement",
16
+ "package": "@lit/reactive-element"
17
+ }
18
+ }
19
+ ],
20
+ "exports": [
21
+ {
22
+ "kind": "js",
23
+ "name": "PreactLitAdapter",
24
+ "declaration": {
25
+ "name": "PreactLitAdapter",
26
+ "module": "src/web-components/PreactLitAdapter.tsx"
27
+ }
28
+ }
29
+ ]
30
+ },
31
+ {
32
+ "kind": "javascript-module",
33
+ "path": "src/web-components/PreactLitAdapterWithGridJsStyles.tsx",
34
+ "declarations": [
35
+ {
36
+ "kind": "class",
37
+ "description": "",
38
+ "name": "PreactLitAdapterWithGridJsStyles",
39
+ "members": [],
40
+ "superclass": {
41
+ "name": "PreactLitAdapter",
42
+ "module": "/src/web-components/PreactLitAdapter"
43
+ }
44
+ }
45
+ ],
46
+ "exports": [
47
+ {
48
+ "kind": "js",
49
+ "name": "PreactLitAdapterWithGridJsStyles",
50
+ "declaration": {
51
+ "name": "PreactLitAdapterWithGridJsStyles",
52
+ "module": "src/web-components/PreactLitAdapterWithGridJsStyles.tsx"
53
+ }
54
+ }
55
+ ]
56
+ },
57
+ {
58
+ "kind": "javascript-module",
59
+ "path": "src/web-components/app.ts",
60
+ "declarations": [
61
+ {
62
+ "kind": "class",
63
+ "description": "",
64
+ "name": "App",
65
+ "members": [
66
+ {
67
+ "kind": "field",
68
+ "name": "lapis",
69
+ "type": {
70
+ "text": "string"
71
+ },
72
+ "default": "''",
73
+ "attribute": "lapis"
74
+ },
75
+ {
76
+ "kind": "field",
77
+ "name": "referenceGenome",
78
+ "type": {
79
+ "text": "ReferenceGenome"
80
+ },
81
+ "default": "{\n nucleotideSequences: [],\n genes: [],\n }"
82
+ },
83
+ {
84
+ "kind": "field",
85
+ "name": "updateReferenceGenome",
86
+ "privacy": "private",
87
+ "default": "new Task(this, {\n task: async () => {\n this.referenceGenome = await fetchReferenceGenome(this.lapis);\n },\n args: () => [this.lapis],\n })"
88
+ },
89
+ {
90
+ "kind": "method",
91
+ "name": "createRenderRoot"
92
+ }
93
+ ],
94
+ "attributes": [
95
+ {
96
+ "name": "lapis",
97
+ "type": {
98
+ "text": "string"
99
+ },
100
+ "default": "''",
101
+ "fieldName": "lapis"
102
+ }
103
+ ],
104
+ "superclass": {
105
+ "name": "LitElement",
106
+ "package": "lit"
107
+ },
108
+ "tagName": "gs-app",
109
+ "customElement": true
110
+ }
111
+ ],
112
+ "exports": [
113
+ {
114
+ "kind": "js",
115
+ "name": "App",
116
+ "declaration": {
117
+ "name": "App",
118
+ "module": "src/web-components/app.ts"
119
+ }
120
+ },
121
+ {
122
+ "kind": "custom-element-definition",
123
+ "name": "gs-app",
124
+ "declaration": {
125
+ "name": "App",
126
+ "module": "src/web-components/app.ts"
127
+ }
128
+ }
129
+ ]
130
+ },
131
+ {
132
+ "kind": "javascript-module",
133
+ "path": "src/web-components/display/index.ts",
134
+ "declarations": [],
135
+ "exports": [
136
+ {
137
+ "kind": "js",
138
+ "name": "MutationComparisonComponent",
139
+ "declaration": {
140
+ "name": "MutationComparisonComponent",
141
+ "module": "./mutation-comparison-component"
142
+ }
143
+ },
144
+ {
145
+ "kind": "js",
146
+ "name": "MutationsComponent",
147
+ "declaration": {
148
+ "name": "MutationsComponent",
149
+ "module": "./mutations-component"
150
+ }
151
+ },
152
+ {
153
+ "kind": "js",
154
+ "name": "PrevalenceOverTimeComponent",
155
+ "declaration": {
156
+ "name": "PrevalenceOverTimeComponent",
157
+ "module": "./prevalence-over-time-component"
158
+ }
159
+ },
160
+ {
161
+ "kind": "js",
162
+ "name": "RelativeGrowthAdvantageComponent",
163
+ "declaration": {
164
+ "name": "RelativeGrowthAdvantageComponent",
165
+ "module": "./relative-growth-advantage-component"
166
+ }
167
+ }
168
+ ]
169
+ },
170
+ {
171
+ "kind": "javascript-module",
172
+ "path": "src/web-components/display/mutation-comparison-component.stories.ts",
173
+ "declarations": [
174
+ {
175
+ "kind": "variable",
176
+ "name": "meta",
177
+ "type": {
178
+ "text": "Meta<MutationComparisonProps>"
179
+ },
180
+ "default": "{\n title: 'Visualization/Mutation comparison',\n component: 'gs-mutation-comparison-component',\n argTypes: {\n variants: { control: 'object' },\n sequenceType: {\n options: ['nucleotide', 'amino acid'],\n control: { type: 'radio' },\n },\n views: {\n options: ['table', 'venn'],\n control: { type: 'check' },\n },\n },\n}"
181
+ },
182
+ {
183
+ "kind": "variable",
184
+ "name": "Default",
185
+ "type": {
186
+ "text": "StoryObj<MutationComparisonProps>"
187
+ },
188
+ "default": "{\n ...Template,\n args: {\n variants: [\n {\n displayName: 'Some variant',\n lapisFilter: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo },\n },\n {\n displayName: 'Other variant',\n lapisFilter: {\n country: 'Switzerland',\n pangoLineage: 'B.1.1.7',\n dateFrom,\n dateTo,\n },\n },\n ],\n sequenceType: 'nucleotide',\n views: ['table', 'venn'],\n },\n parameters: {\n fetchMock: {\n mocks: [\n {\n matcher: {\n name: 'nucleotideMutationsSomeVariant',\n url: NUCLEOTIDE_MUTATIONS_ENDPOINT,\n body: {\n country: 'Switzerland',\n pangoLineage: 'B.1.1.7',\n dateTo,\n minProportion: 0,\n },\n },\n response: {\n status: 200,\n body: nucleotideMutationsSomeVariant,\n },\n },\n {\n matcher: {\n name: 'nucleotideMutationsOtherVariant',\n url: NUCLEOTIDE_MUTATIONS_ENDPOINT,\n body: {\n country: 'Switzerland',\n pangoLineage: 'B.1.1.7',\n dateFrom,\n dateTo,\n minProportion: 0,\n },\n },\n response: {\n status: 200,\n body: nucleotideMutationsOtherVariant,\n },\n },\n ],\n },\n },\n play: async ({ canvasElement, step }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-mutation-comparison-component');\n\n await step('Min and max proportions should be 50% and 100%', async () => {\n const minInput = () => canvas.getAllByLabelText('%')[0];\n const maxInput = () => canvas.getAllByLabelText('%')[1];\n\n await waitFor(() => expect(minInput()).toHaveValue(50));\n await waitFor(() => expect(maxInput()).toHaveValue(100));\n });\n },\n}"
189
+ },
190
+ {
191
+ "kind": "variable",
192
+ "name": "VennDiagram",
193
+ "type": {
194
+ "text": "StoryObj<MutationComparisonProps>"
195
+ },
196
+ "default": "{\n ...Default,\n play: async ({ canvasElement, step }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-mutation-comparison-component');\n\n await step('Switch to Venn diagram view', async () => {\n await waitFor(() => expect(canvas.getByLabelText('Venn', { selector: 'input' })).toBeInTheDocument());\n\n await fireEvent.click(canvas.getByLabelText('Venn', { selector: 'input' }));\n\n await waitFor(() =>\n expect(\n canvas.getByText('You have no elements selected. Click in the venn diagram to select.'),\n ).toBeVisible(),\n );\n });\n },\n}"
197
+ }
198
+ ],
199
+ "exports": [
200
+ {
201
+ "kind": "js",
202
+ "name": "default",
203
+ "declaration": {
204
+ "name": "meta",
205
+ "module": "src/web-components/display/mutation-comparison-component.stories.ts"
206
+ }
207
+ },
208
+ {
209
+ "kind": "js",
210
+ "name": "Default",
211
+ "declaration": {
212
+ "name": "Default",
213
+ "module": "src/web-components/display/mutation-comparison-component.stories.ts"
214
+ }
215
+ },
216
+ {
217
+ "kind": "js",
218
+ "name": "VennDiagram",
219
+ "declaration": {
220
+ "name": "VennDiagram",
221
+ "module": "src/web-components/display/mutation-comparison-component.stories.ts"
222
+ }
223
+ }
224
+ ]
225
+ },
226
+ {
227
+ "kind": "javascript-module",
228
+ "path": "src/web-components/display/mutation-comparison-component.tsx",
229
+ "declarations": [
230
+ {
231
+ "kind": "class",
232
+ "description": "",
233
+ "name": "MutationComparisonComponent",
234
+ "members": [
235
+ {
236
+ "kind": "field",
237
+ "name": "variants",
238
+ "type": {
239
+ "text": "MutationComparisonVariant[]"
240
+ },
241
+ "default": "[]",
242
+ "attribute": "variants"
243
+ },
244
+ {
245
+ "kind": "field",
246
+ "name": "sequenceType",
247
+ "type": {
248
+ "text": "SequenceType"
249
+ },
250
+ "default": "'nucleotide'",
251
+ "attribute": "sequenceType"
252
+ },
253
+ {
254
+ "kind": "field",
255
+ "name": "views",
256
+ "type": {
257
+ "text": "View[]"
258
+ },
259
+ "default": "['table']",
260
+ "attribute": "views"
261
+ }
262
+ ],
263
+ "attributes": [
264
+ {
265
+ "name": "variants",
266
+ "type": {
267
+ "text": "MutationComparisonVariant[]"
268
+ },
269
+ "default": "[]",
270
+ "fieldName": "variants"
271
+ },
272
+ {
273
+ "name": "sequenceType",
274
+ "type": {
275
+ "text": "SequenceType"
276
+ },
277
+ "default": "'nucleotide'",
278
+ "fieldName": "sequenceType"
279
+ },
280
+ {
281
+ "name": "views",
282
+ "type": {
283
+ "text": "View[]"
284
+ },
285
+ "default": "['table']",
286
+ "fieldName": "views"
287
+ }
288
+ ],
289
+ "superclass": {
290
+ "name": "PreactLitAdapterWithGridJsStyles",
291
+ "module": "/src/web-components/PreactLitAdapterWithGridJsStyles"
292
+ },
293
+ "tagName": "gs-mutation-comparison-component",
294
+ "customElement": true
295
+ }
296
+ ],
297
+ "exports": [
298
+ {
299
+ "kind": "js",
300
+ "name": "MutationComparisonComponent",
301
+ "declaration": {
302
+ "name": "MutationComparisonComponent",
303
+ "module": "src/web-components/display/mutation-comparison-component.tsx"
304
+ }
305
+ },
306
+ {
307
+ "kind": "custom-element-definition",
308
+ "name": "gs-mutation-comparison-component",
309
+ "declaration": {
310
+ "name": "MutationComparisonComponent",
311
+ "module": "src/web-components/display/mutation-comparison-component.tsx"
312
+ }
313
+ }
314
+ ]
315
+ },
316
+ {
317
+ "kind": "javascript-module",
318
+ "path": "src/web-components/display/mutations-component.stories.ts",
319
+ "declarations": [
320
+ {
321
+ "kind": "variable",
322
+ "name": "meta",
323
+ "type": {
324
+ "text": "Meta<MutationsProps>"
325
+ },
326
+ "default": "{\n title: 'Visualization/Mutations',\n component: 'gs-mutations',\n argTypes: {\n variant: { control: 'object' },\n sequenceType: {\n options: ['nucleotide', 'amino acid'],\n control: { type: 'radio' },\n },\n views: {\n options: ['table', 'grid', 'insertions'],\n control: { type: 'check' },\n },\n },\n}"
327
+ },
328
+ {
329
+ "kind": "variable",
330
+ "name": "Default",
331
+ "type": {
332
+ "text": "StoryObj<MutationsProps>"
333
+ },
334
+ "default": "{\n ...Template,\n args: {\n variant: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo: '2022-01-01' },\n sequenceType: 'nucleotide',\n views: ['grid', 'table', 'insertions'],\n },\n parameters: {\n fetchMock: {\n mocks: [\n {\n matcher: {\n name: 'nucleotideMutations',\n url: NUCLEOTIDE_MUTATIONS_ENDPOINT,\n body: {\n country: 'Switzerland',\n pangoLineage: 'B.1.1.7',\n dateTo: '2022-01-01',\n minProportion: 0,\n },\n },\n response: {\n status: 200,\n body: nucleotideMutations,\n },\n },\n {\n matcher: {\n name: 'nucleotideInsertions',\n url: NUCLEOTIDE_INSERTIONS_ENDPOINT,\n body: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateTo: '2022-01-01' },\n },\n response: {\n status: 200,\n body: nucleotideInsertions,\n },\n },\n ],\n },\n },\n}"
335
+ },
336
+ {
337
+ "kind": "variable",
338
+ "name": "OnTableTab",
339
+ "type": {
340
+ "text": "StoryObj<MutationsProps>"
341
+ },
342
+ "default": "{\n ...Default,\n play: async ({ canvasElement }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-mutations-component');\n\n await waitFor(() => expect(canvas.getByLabelText('Table', { selector: 'input' })).toBeInTheDocument());\n\n await fireEvent.click(canvas.getByLabelText('Table', { selector: 'input' }));\n },\n}"
343
+ },
344
+ {
345
+ "kind": "variable",
346
+ "name": "OnInsertionsTab",
347
+ "type": {
348
+ "text": "StoryObj<MutationsProps>"
349
+ },
350
+ "default": "{\n ...Default,\n play: async ({ canvasElement }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-mutations-component');\n\n await waitFor(() => expect(canvas.getByLabelText('Insertions', { selector: 'input' })).toBeInTheDocument());\n\n await fireEvent.click(canvas.getByLabelText('Insertions', { selector: 'input' }));\n },\n}"
351
+ }
352
+ ],
353
+ "exports": [
354
+ {
355
+ "kind": "js",
356
+ "name": "default",
357
+ "declaration": {
358
+ "name": "meta",
359
+ "module": "src/web-components/display/mutations-component.stories.ts"
360
+ }
361
+ },
362
+ {
363
+ "kind": "js",
364
+ "name": "Default",
365
+ "declaration": {
366
+ "name": "Default",
367
+ "module": "src/web-components/display/mutations-component.stories.ts"
368
+ }
369
+ },
370
+ {
371
+ "kind": "js",
372
+ "name": "OnTableTab",
373
+ "declaration": {
374
+ "name": "OnTableTab",
375
+ "module": "src/web-components/display/mutations-component.stories.ts"
376
+ }
377
+ },
378
+ {
379
+ "kind": "js",
380
+ "name": "OnInsertionsTab",
381
+ "declaration": {
382
+ "name": "OnInsertionsTab",
383
+ "module": "src/web-components/display/mutations-component.stories.ts"
384
+ }
385
+ }
386
+ ]
387
+ },
388
+ {
389
+ "kind": "javascript-module",
390
+ "path": "src/web-components/display/mutations-component.tsx",
391
+ "declarations": [
392
+ {
393
+ "kind": "class",
394
+ "description": "",
395
+ "name": "MutationsComponent",
396
+ "members": [
397
+ {
398
+ "kind": "field",
399
+ "name": "variant",
400
+ "type": {
401
+ "text": "LapisFilter"
402
+ },
403
+ "default": "{ displayName: '' }",
404
+ "attribute": "variant"
405
+ },
406
+ {
407
+ "kind": "field",
408
+ "name": "sequenceType",
409
+ "type": {
410
+ "text": "SequenceType"
411
+ },
412
+ "default": "'nucleotide'",
413
+ "attribute": "sequenceType"
414
+ },
415
+ {
416
+ "kind": "field",
417
+ "name": "views",
418
+ "type": {
419
+ "text": "View[]"
420
+ },
421
+ "default": "['table', 'grid']",
422
+ "attribute": "views"
423
+ }
424
+ ],
425
+ "attributes": [
426
+ {
427
+ "name": "variant",
428
+ "type": {
429
+ "text": "LapisFilter"
430
+ },
431
+ "default": "{ displayName: '' }",
432
+ "fieldName": "variant"
433
+ },
434
+ {
435
+ "name": "sequenceType",
436
+ "type": {
437
+ "text": "SequenceType"
438
+ },
439
+ "default": "'nucleotide'",
440
+ "fieldName": "sequenceType"
441
+ },
442
+ {
443
+ "name": "views",
444
+ "type": {
445
+ "text": "View[]"
446
+ },
447
+ "default": "['table', 'grid']",
448
+ "fieldName": "views"
449
+ }
450
+ ],
451
+ "superclass": {
452
+ "name": "PreactLitAdapterWithGridJsStyles",
453
+ "module": "/src/web-components/PreactLitAdapterWithGridJsStyles"
454
+ },
455
+ "tagName": "gs-mutations-component",
456
+ "customElement": true
457
+ }
458
+ ],
459
+ "exports": [
460
+ {
461
+ "kind": "js",
462
+ "name": "MutationsComponent",
463
+ "declaration": {
464
+ "name": "MutationsComponent",
465
+ "module": "src/web-components/display/mutations-component.tsx"
466
+ }
467
+ },
468
+ {
469
+ "kind": "custom-element-definition",
470
+ "name": "gs-mutations-component",
471
+ "declaration": {
472
+ "name": "MutationsComponent",
473
+ "module": "src/web-components/display/mutations-component.tsx"
474
+ }
475
+ }
476
+ ]
477
+ },
478
+ {
479
+ "kind": "javascript-module",
480
+ "path": "src/web-components/display/prevalence-over-time-component.stories.ts",
481
+ "declarations": [
482
+ {
483
+ "kind": "variable",
484
+ "name": "meta",
485
+ "type": {
486
+ "text": "Meta<PrevalenceOverTimeProps>"
487
+ },
488
+ "default": "{\n title: 'Visualization/Prevalence over time',\n component: 'gs-prevalence-over-time',\n argTypes: {\n numerator: { control: 'object' },\n denominator: { control: 'object' },\n granularity: {\n options: ['day', 'week', 'month', 'year'],\n control: { type: 'radio' },\n },\n smoothingWindow: { control: 'number' },\n views: {\n options: ['bar', 'line', 'bubble', 'table'],\n control: { type: 'check' },\n },\n confidenceIntervalMethods: {\n options: ['wilson'],\n control: { type: 'check' },\n },\n },\n}"
489
+ },
490
+ {
491
+ "kind": "variable",
492
+ "name": "TwoVariants",
493
+ "type": {
494
+ "text": "StoryObj<PrevalenceOverTimeProps>"
495
+ },
496
+ "default": "{\n ...Template,\n args: {\n numerator: [\n { displayName: 'EG', country: 'USA', pangoLineage: 'EG*', dateFrom: '2023-01-01' },\n { displayName: 'JN.1', country: 'USA', pangoLineage: 'JN.1*', dateFrom: '2023-01-01' },\n ],\n denominator: { country: 'USA', dateFrom: '2023-01-01', displayName: 'All' },\n granularity: 'month',\n smoothingWindow: 0,\n views: ['bar', 'line', 'bubble', 'table'],\n confidenceIntervalMethods: ['wilson'],\n },\n parameters: {\n fetchMock: {\n mocks: [\n {\n matcher: {\n name: 'numeratorEG',\n url: AGGREGATED_ENDPOINT,\n body: {\n country: 'USA',\n pangoLineage: 'EG*',\n dateFrom: '2023-01-01',\n fields: ['date'],\n },\n },\n response: {\n status: 200,\n body: numeratorEG,\n },\n },\n {\n matcher: {\n name: 'numeratorJN1',\n url: AGGREGATED_ENDPOINT,\n body: {\n country: 'USA',\n pangoLineage: 'JN.1*',\n dateFrom: '2023-01-01',\n fields: ['date'],\n },\n },\n response: {\n status: 200,\n body: numeratorJN1,\n },\n },\n {\n matcher: {\n name: 'denominator',\n url: AGGREGATED_ENDPOINT,\n body: {\n country: 'USA',\n dateFrom: '2023-01-01',\n fields: ['date'],\n },\n },\n response: {\n status: 200,\n body: denominator,\n },\n },\n ],\n },\n },\n}"
497
+ },
498
+ {
499
+ "kind": "variable",
500
+ "name": "OneVariant",
501
+ "type": {
502
+ "text": "StoryObj<PrevalenceOverTimeProps>"
503
+ },
504
+ "default": "{\n ...Template,\n args: {\n numerator: { displayName: 'EG', country: 'USA', pangoLineage: 'BA.2.86*', dateFrom: '2023-10-01' },\n denominator: { country: 'USA', dateFrom: '2023-10-01', displayName: 'All' },\n granularity: 'day',\n smoothingWindow: 7,\n views: ['bar', 'line', 'bubble', 'table'],\n confidenceIntervalMethods: ['wilson'],\n },\n parameters: {\n fetchMock: {\n mocks: [\n {\n matcher: {\n name: 'numeratorOneVariant',\n url: AGGREGATED_ENDPOINT,\n body: {\n country: 'USA',\n pangoLineage: 'BA.2.86*',\n dateFrom: '2023-10-01',\n fields: ['date'],\n },\n },\n response: {\n status: 200,\n body: numeratorOneVariant,\n },\n },\n {\n matcher: {\n name: 'denominatorOneVariant',\n url: AGGREGATED_ENDPOINT,\n body: {\n country: 'USA',\n dateFrom: '2023-10-01',\n fields: ['date'],\n },\n },\n response: {\n status: 200,\n body: denominatorOneVariant,\n },\n },\n ],\n },\n },\n}"
505
+ },
506
+ {
507
+ "kind": "variable",
508
+ "name": "OneVariantOnLineTab",
509
+ "type": {
510
+ "text": "StoryObj<PrevalenceOverTimeProps>"
511
+ },
512
+ "default": "{\n ...OneVariant,\n play: async ({ canvasElement }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-prevalence-over-time');\n\n await waitFor(() => expect(canvas.getByLabelText('Line', { selector: 'input' })).toBeInTheDocument());\n\n await fireEvent.click(canvas.getByLabelText('Line', { selector: 'input' }));\n },\n}"
513
+ },
514
+ {
515
+ "kind": "variable",
516
+ "name": "OneVariantOnBubbleTab",
517
+ "type": {
518
+ "text": "StoryObj<PrevalenceOverTimeProps>"
519
+ },
520
+ "default": "{\n ...OneVariant,\n play: async ({ canvasElement }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-prevalence-over-time');\n\n await waitFor(() => expect(canvas.getByLabelText('Bubble', { selector: 'input' })).toBeInTheDocument());\n\n await fireEvent.click(canvas.getByLabelText('Bubble', { selector: 'input' }));\n },\n}"
521
+ },
522
+ {
523
+ "kind": "variable",
524
+ "name": "OneVariantOnTableTab",
525
+ "type": {
526
+ "text": "StoryObj<PrevalenceOverTimeProps>"
527
+ },
528
+ "default": "{\n ...OneVariant,\n play: async ({ canvasElement }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-prevalence-over-time');\n\n await waitFor(() => expect(canvas.getByLabelText('Table', { selector: 'input' })).toBeInTheDocument());\n\n await fireEvent.click(canvas.getByLabelText('Table', { selector: 'input' }));\n },\n}"
529
+ }
530
+ ],
531
+ "exports": [
532
+ {
533
+ "kind": "js",
534
+ "name": "default",
535
+ "declaration": {
536
+ "name": "meta",
537
+ "module": "src/web-components/display/prevalence-over-time-component.stories.ts"
538
+ }
539
+ },
540
+ {
541
+ "kind": "js",
542
+ "name": "TwoVariants",
543
+ "declaration": {
544
+ "name": "TwoVariants",
545
+ "module": "src/web-components/display/prevalence-over-time-component.stories.ts"
546
+ }
547
+ },
548
+ {
549
+ "kind": "js",
550
+ "name": "OneVariant",
551
+ "declaration": {
552
+ "name": "OneVariant",
553
+ "module": "src/web-components/display/prevalence-over-time-component.stories.ts"
554
+ }
555
+ },
556
+ {
557
+ "kind": "js",
558
+ "name": "OneVariantOnLineTab",
559
+ "declaration": {
560
+ "name": "OneVariantOnLineTab",
561
+ "module": "src/web-components/display/prevalence-over-time-component.stories.ts"
562
+ }
563
+ },
564
+ {
565
+ "kind": "js",
566
+ "name": "OneVariantOnBubbleTab",
567
+ "declaration": {
568
+ "name": "OneVariantOnBubbleTab",
569
+ "module": "src/web-components/display/prevalence-over-time-component.stories.ts"
570
+ }
571
+ },
572
+ {
573
+ "kind": "js",
574
+ "name": "OneVariantOnTableTab",
575
+ "declaration": {
576
+ "name": "OneVariantOnTableTab",
577
+ "module": "src/web-components/display/prevalence-over-time-component.stories.ts"
578
+ }
579
+ }
580
+ ]
581
+ },
582
+ {
583
+ "kind": "javascript-module",
584
+ "path": "src/web-components/display/prevalence-over-time-component.tsx",
585
+ "declarations": [
586
+ {
587
+ "kind": "class",
588
+ "description": "",
589
+ "name": "PrevalenceOverTimeComponent",
590
+ "members": [
591
+ {
592
+ "kind": "field",
593
+ "name": "numerator",
594
+ "type": {
595
+ "text": "NamedLapisFilter | NamedLapisFilter[]"
596
+ },
597
+ "default": "{ displayName: '' }",
598
+ "attribute": "numerator"
599
+ },
600
+ {
601
+ "kind": "field",
602
+ "name": "denominator",
603
+ "type": {
604
+ "text": "NamedLapisFilter"
605
+ },
606
+ "default": "{ displayName: '' }",
607
+ "attribute": "denominator"
608
+ },
609
+ {
610
+ "kind": "field",
611
+ "name": "granularity",
612
+ "type": {
613
+ "text": "TemporalGranularity"
614
+ },
615
+ "default": "'day'",
616
+ "attribute": "granularity"
617
+ },
618
+ {
619
+ "kind": "field",
620
+ "name": "smoothingWindow",
621
+ "type": {
622
+ "text": "number"
623
+ },
624
+ "default": "0",
625
+ "attribute": "smoothingWindow"
626
+ },
627
+ {
628
+ "kind": "field",
629
+ "name": "views",
630
+ "type": {
631
+ "text": "View[]"
632
+ },
633
+ "default": "['bar', 'line', 'bubble', 'table']",
634
+ "attribute": "views"
635
+ },
636
+ {
637
+ "kind": "field",
638
+ "name": "confidenceIntervalMethods",
639
+ "type": {
640
+ "text": "ConfidenceIntervalMethod[]"
641
+ },
642
+ "default": "['wilson']",
643
+ "attribute": "confidenceIntervalMethods"
644
+ }
645
+ ],
646
+ "attributes": [
647
+ {
648
+ "name": "numerator",
649
+ "type": {
650
+ "text": "NamedLapisFilter | NamedLapisFilter[]"
651
+ },
652
+ "default": "{ displayName: '' }",
653
+ "fieldName": "numerator"
654
+ },
655
+ {
656
+ "name": "denominator",
657
+ "type": {
658
+ "text": "NamedLapisFilter"
659
+ },
660
+ "default": "{ displayName: '' }",
661
+ "fieldName": "denominator"
662
+ },
663
+ {
664
+ "name": "granularity",
665
+ "type": {
666
+ "text": "TemporalGranularity"
667
+ },
668
+ "default": "'day'",
669
+ "fieldName": "granularity"
670
+ },
671
+ {
672
+ "name": "smoothingWindow",
673
+ "type": {
674
+ "text": "number"
675
+ },
676
+ "default": "0",
677
+ "fieldName": "smoothingWindow"
678
+ },
679
+ {
680
+ "name": "views",
681
+ "type": {
682
+ "text": "View[]"
683
+ },
684
+ "default": "['bar', 'line', 'bubble', 'table']",
685
+ "fieldName": "views"
686
+ },
687
+ {
688
+ "name": "confidenceIntervalMethods",
689
+ "type": {
690
+ "text": "ConfidenceIntervalMethod[]"
691
+ },
692
+ "default": "['wilson']",
693
+ "fieldName": "confidenceIntervalMethods"
694
+ }
695
+ ],
696
+ "superclass": {
697
+ "name": "PreactLitAdapterWithGridJsStyles",
698
+ "module": "/src/web-components/PreactLitAdapterWithGridJsStyles"
699
+ },
700
+ "tagName": "gs-prevalence-over-time",
701
+ "customElement": true
702
+ }
703
+ ],
704
+ "exports": [
705
+ {
706
+ "kind": "js",
707
+ "name": "PrevalenceOverTimeComponent",
708
+ "declaration": {
709
+ "name": "PrevalenceOverTimeComponent",
710
+ "module": "src/web-components/display/prevalence-over-time-component.tsx"
711
+ }
712
+ },
713
+ {
714
+ "kind": "custom-element-definition",
715
+ "name": "gs-prevalence-over-time",
716
+ "declaration": {
717
+ "name": "PrevalenceOverTimeComponent",
718
+ "module": "src/web-components/display/prevalence-over-time-component.tsx"
719
+ }
720
+ }
721
+ ]
722
+ },
723
+ {
724
+ "kind": "javascript-module",
725
+ "path": "src/web-components/display/relative-growth-advantage-component.stories.ts",
726
+ "declarations": [
727
+ {
728
+ "kind": "variable",
729
+ "name": "meta",
730
+ "type": {
731
+ "text": "Meta<RelativeGrowthAdvantageProps>"
732
+ },
733
+ "default": "{\n title: 'Visualization/Relative growth advantage',\n component: 'gs-relative-growth-advantage',\n argTypes: {\n numerator: { control: 'object' },\n denominator: { control: 'object' },\n generationTime: { control: 'number' },\n views: {\n options: ['line'],\n control: { type: 'check' },\n },\n },\n}"
734
+ },
735
+ {
736
+ "kind": "variable",
737
+ "name": "Default",
738
+ "type": {
739
+ "text": "StoryObj<RelativeGrowthAdvantageProps>"
740
+ },
741
+ "default": "{\n ...Template,\n args: {\n numerator: { country: 'Switzerland', pangoLineage: 'B.1.1.7', dateFrom: '2020-12-01', dateTo: '2021-03-01' },\n denominator: { country: 'Switzerland', dateFrom: '2020-12-01', dateTo: '2021-03-01' },\n generationTime: 7,\n views: ['line'],\n },\n parameters: {\n fetchMock: {\n mocks: [\n {\n matcher: {\n name: 'numerator',\n url: AGGREGATED_ENDPOINT,\n body: {\n country: 'Switzerland',\n pangoLineage: 'B.1.1.7',\n dateFrom: '2020-12-01',\n dateTo: '2021-03-01',\n fields: ['date'],\n },\n },\n response: {\n status: 200,\n body: numerator,\n },\n },\n {\n matcher: {\n name: 'denominator',\n url: AGGREGATED_ENDPOINT,\n body: {\n country: 'Switzerland',\n dateFrom: '2020-12-01',\n dateTo: '2021-03-01',\n fields: ['date'],\n },\n },\n response: {\n status: 200,\n body: denominator,\n },\n },\n ],\n },\n },\n}"
742
+ }
743
+ ],
744
+ "exports": [
745
+ {
746
+ "kind": "js",
747
+ "name": "default",
748
+ "declaration": {
749
+ "name": "meta",
750
+ "module": "src/web-components/display/relative-growth-advantage-component.stories.ts"
751
+ }
752
+ },
753
+ {
754
+ "kind": "js",
755
+ "name": "Default",
756
+ "declaration": {
757
+ "name": "Default",
758
+ "module": "src/web-components/display/relative-growth-advantage-component.stories.ts"
759
+ }
760
+ }
761
+ ]
762
+ },
763
+ {
764
+ "kind": "javascript-module",
765
+ "path": "src/web-components/display/relative-growth-advantage-component.tsx",
766
+ "declarations": [
767
+ {
768
+ "kind": "class",
769
+ "description": "",
770
+ "name": "RelativeGrowthAdvantageComponent",
771
+ "members": [
772
+ {
773
+ "kind": "field",
774
+ "name": "numerator",
775
+ "type": {
776
+ "text": "LapisFilter"
777
+ },
778
+ "default": "{}",
779
+ "attribute": "numerator"
780
+ },
781
+ {
782
+ "kind": "field",
783
+ "name": "denominator",
784
+ "type": {
785
+ "text": "LapisFilter"
786
+ },
787
+ "default": "{}",
788
+ "attribute": "denominator"
789
+ },
790
+ {
791
+ "kind": "field",
792
+ "name": "generationTime",
793
+ "type": {
794
+ "text": "number"
795
+ },
796
+ "default": "7",
797
+ "attribute": "generationTime"
798
+ },
799
+ {
800
+ "kind": "field",
801
+ "name": "views",
802
+ "type": {
803
+ "text": "View[]"
804
+ },
805
+ "default": "['line']",
806
+ "attribute": "views"
807
+ }
808
+ ],
809
+ "attributes": [
810
+ {
811
+ "name": "numerator",
812
+ "type": {
813
+ "text": "LapisFilter"
814
+ },
815
+ "default": "{}",
816
+ "fieldName": "numerator"
817
+ },
818
+ {
819
+ "name": "denominator",
820
+ "type": {
821
+ "text": "LapisFilter"
822
+ },
823
+ "default": "{}",
824
+ "fieldName": "denominator"
825
+ },
826
+ {
827
+ "name": "generationTime",
828
+ "type": {
829
+ "text": "number"
830
+ },
831
+ "default": "7",
832
+ "fieldName": "generationTime"
833
+ },
834
+ {
835
+ "name": "views",
836
+ "type": {
837
+ "text": "View[]"
838
+ },
839
+ "default": "['line']",
840
+ "fieldName": "views"
841
+ }
842
+ ],
843
+ "superclass": {
844
+ "name": "PreactLitAdapter",
845
+ "module": "/src/web-components/PreactLitAdapter"
846
+ },
847
+ "tagName": "gs-relative-growth-advantage",
848
+ "customElement": true
849
+ }
850
+ ],
851
+ "exports": [
852
+ {
853
+ "kind": "js",
854
+ "name": "RelativeGrowthAdvantageComponent",
855
+ "declaration": {
856
+ "name": "RelativeGrowthAdvantageComponent",
857
+ "module": "src/web-components/display/relative-growth-advantage-component.tsx"
858
+ }
859
+ },
860
+ {
861
+ "kind": "custom-element-definition",
862
+ "name": "gs-relative-growth-advantage",
863
+ "declaration": {
864
+ "name": "RelativeGrowthAdvantageComponent",
865
+ "module": "src/web-components/display/relative-growth-advantage-component.tsx"
866
+ }
867
+ }
868
+ ]
869
+ },
870
+ {
871
+ "kind": "javascript-module",
872
+ "path": "src/web-components/index.ts",
873
+ "declarations": [],
874
+ "exports": [
875
+ {
876
+ "kind": "js",
877
+ "name": "App",
878
+ "declaration": {
879
+ "name": "App",
880
+ "module": "./app.js"
881
+ }
882
+ },
883
+ {
884
+ "kind": "js",
885
+ "name": "*",
886
+ "declaration": {
887
+ "name": "*",
888
+ "package": "./display"
889
+ }
890
+ },
891
+ {
892
+ "kind": "js",
893
+ "name": "*",
894
+ "declaration": {
895
+ "name": "*",
896
+ "package": "./input"
897
+ }
898
+ }
899
+ ]
900
+ },
901
+ {
902
+ "kind": "javascript-module",
903
+ "path": "src/web-components/input/date-range-selector-component.stories.ts",
904
+ "declarations": [
905
+ {
906
+ "kind": "variable",
907
+ "name": "meta",
908
+ "type": {
909
+ "text": "Meta<DateRangeSelectorProps>"
910
+ },
911
+ "default": "{\n title: 'Input/DateRangeSelector',\n component: 'gs-date-range-selector',\n parameters: {\n actions: {\n handles: ['gs-date-range-changed'],\n },\n fetchMock: {},\n },\n decorators: [withActions],\n}"
912
+ },
913
+ {
914
+ "kind": "variable",
915
+ "name": "DateRangeSelectorStory",
916
+ "type": {
917
+ "text": "StoryObj<DateRangeSelectorProps>"
918
+ },
919
+ "default": "{\n render: (args) =>\n html` <gs-app lapis=\"${LAPIS_URL}\">\n <div class=\"max-w-screen-lg\">\n <gs-date-range-selector\n .customSelectOptions=${args.customSelectOptions}\n .earliestDate=${args.earliestDate}\n ></gs-date-range-selector>\n </div>\n </gs-app>`,\n\n play: async ({ canvasElement, step }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-date-range-selector');\n const dateTo = () => canvas.getByPlaceholderText('Date to');\n\n await step('Expect last 6 months to be selected', async () => {\n await expect(canvas.getByRole('combobox')).toHaveValue('last6Months');\n await waitFor(() => {\n expect(dateTo()).toHaveValue(toYYYYMMDD(new Date()));\n });\n });\n },\n args: {\n customSelectOptions: [{ label: 'CustomDateRange', dateFrom: '2021-01-01', dateTo: '2021-12-31' }],\n earliestDate: '1970-01-01',\n },\n}"
920
+ }
921
+ ],
922
+ "exports": [
923
+ {
924
+ "kind": "js",
925
+ "name": "default",
926
+ "declaration": {
927
+ "name": "meta",
928
+ "module": "src/web-components/input/date-range-selector-component.stories.ts"
929
+ }
930
+ },
931
+ {
932
+ "kind": "js",
933
+ "name": "DateRangeSelectorStory",
934
+ "declaration": {
935
+ "name": "DateRangeSelectorStory",
936
+ "module": "src/web-components/input/date-range-selector-component.stories.ts"
937
+ }
938
+ }
939
+ ]
940
+ },
941
+ {
942
+ "kind": "javascript-module",
943
+ "path": "src/web-components/input/date-range-selector-component.tsx",
944
+ "declarations": [
945
+ {
946
+ "kind": "class",
947
+ "description": "",
948
+ "name": "DateRangeSelectorComponent",
949
+ "members": [
950
+ {
951
+ "kind": "field",
952
+ "name": "customSelectOptions",
953
+ "type": {
954
+ "text": "CustomSelectOption[]"
955
+ },
956
+ "default": "[]",
957
+ "attribute": "customSelectOptions"
958
+ },
959
+ {
960
+ "kind": "field",
961
+ "name": "earliestDate",
962
+ "type": {
963
+ "text": "string | undefined"
964
+ },
965
+ "default": "'1900-01-01'",
966
+ "attribute": "earliestDate"
967
+ }
968
+ ],
969
+ "events": [
970
+ {
971
+ "type": {
972
+ "text": "CustomEvent<{ dateFrom: string; dateTo: string; }>"
973
+ },
974
+ "description": "When the date range has changed",
975
+ "name": "gs-date-range-changed"
976
+ }
977
+ ],
978
+ "attributes": [
979
+ {
980
+ "name": "customSelectOptions",
981
+ "type": {
982
+ "text": "CustomSelectOption[]"
983
+ },
984
+ "default": "[]",
985
+ "fieldName": "customSelectOptions"
986
+ },
987
+ {
988
+ "name": "earliestDate",
989
+ "type": {
990
+ "text": "string | undefined"
991
+ },
992
+ "default": "'1900-01-01'",
993
+ "fieldName": "earliestDate"
994
+ }
995
+ ],
996
+ "superclass": {
997
+ "name": "PreactLitAdapter",
998
+ "module": "/src/web-components/PreactLitAdapter"
999
+ },
1000
+ "tagName": "gs-date-range-selector",
1001
+ "customElement": true
1002
+ }
1003
+ ],
1004
+ "exports": [
1005
+ {
1006
+ "kind": "js",
1007
+ "name": "DateRangeSelectorComponent",
1008
+ "declaration": {
1009
+ "name": "DateRangeSelectorComponent",
1010
+ "module": "src/web-components/input/date-range-selector-component.tsx"
1011
+ }
1012
+ },
1013
+ {
1014
+ "kind": "custom-element-definition",
1015
+ "name": "gs-date-range-selector",
1016
+ "declaration": {
1017
+ "name": "DateRangeSelectorComponent",
1018
+ "module": "src/web-components/input/date-range-selector-component.tsx"
1019
+ }
1020
+ }
1021
+ ]
1022
+ },
1023
+ {
1024
+ "kind": "javascript-module",
1025
+ "path": "src/web-components/input/index.ts",
1026
+ "declarations": [],
1027
+ "exports": [
1028
+ {
1029
+ "kind": "js",
1030
+ "name": "DateRangeSelectorComponent",
1031
+ "declaration": {
1032
+ "name": "DateRangeSelectorComponent",
1033
+ "module": "./date-range-selector-component"
1034
+ }
1035
+ },
1036
+ {
1037
+ "kind": "js",
1038
+ "name": "LocationFilterComponent",
1039
+ "declaration": {
1040
+ "name": "LocationFilterComponent",
1041
+ "module": "./location-filter-component"
1042
+ }
1043
+ },
1044
+ {
1045
+ "kind": "js",
1046
+ "name": "TextInputComponent",
1047
+ "declaration": {
1048
+ "name": "TextInputComponent",
1049
+ "module": "./text-input-component"
1050
+ }
1051
+ },
1052
+ {
1053
+ "kind": "js",
1054
+ "name": "MutationFilterComponent",
1055
+ "declaration": {
1056
+ "name": "MutationFilterComponent",
1057
+ "module": "./mutation-filter-component"
1058
+ }
1059
+ }
1060
+ ]
1061
+ },
1062
+ {
1063
+ "kind": "javascript-module",
1064
+ "path": "src/web-components/input/location-filter-component.stories.ts",
1065
+ "declarations": [
1066
+ {
1067
+ "kind": "variable",
1068
+ "name": "meta",
1069
+ "type": {
1070
+ "text": "Meta"
1071
+ },
1072
+ "default": "{\n title: 'Input/Location filter',\n component: 'gs-location-filter',\n parameters: {\n actions: {\n handles: ['gs-location-changed'],\n },\n },\n decorators: [withActions],\n}"
1073
+ },
1074
+ {
1075
+ "kind": "variable",
1076
+ "name": "LocationFilter",
1077
+ "type": {
1078
+ "text": "StoryObj<LocationFilterProps>"
1079
+ },
1080
+ "default": "{\n ...Template,\n parameters: {\n fetchMock: {\n mocks: [\n {\n matcher: aggregatedEndpointMatcher,\n response: {\n status: 200,\n body: data,\n },\n },\n ],\n },\n },\n play: async ({ canvasElement }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-location-filter');\n await waitFor(() => {\n return expect(canvas.getByRole('combobox')).toBeEnabled();\n });\n },\n}"
1081
+ },
1082
+ {
1083
+ "kind": "variable",
1084
+ "name": "DelayToShowLoadingState",
1085
+ "type": {
1086
+ "text": "StoryObj<LocationFilterProps>"
1087
+ },
1088
+ "default": "{\n ...Template,\n parameters: {\n fetchMock: {\n mocks: [\n {\n matcher: aggregatedEndpointMatcher,\n response: {\n status: 200,\n body: data,\n },\n options: {\n delay: 5000,\n },\n },\n ],\n },\n },\n}"
1089
+ },
1090
+ {
1091
+ "kind": "variable",
1092
+ "name": "FetchingLocationsFails",
1093
+ "type": {
1094
+ "text": "StoryObj<LocationFilterProps>"
1095
+ },
1096
+ "default": "{\n ...Template,\n parameters: {\n fetchMock: {\n mocks: [\n {\n matcher: aggregatedEndpointMatcher,\n response: {\n status: 500,\n body: { error: 'no data' },\n },\n },\n ],\n },\n },\n play: async ({ canvasElement }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-location-filter');\n\n await waitFor(() =>\n expect(\n canvas.getByText('Internal Server Error: {\"error\":\"no data\"} ', { exact: false }),\n ).toBeInTheDocument(),\n );\n },\n}"
1097
+ },
1098
+ {
1099
+ "kind": "variable",
1100
+ "name": "FiresEvent",
1101
+ "type": {
1102
+ "text": "StoryObj<LocationFilterProps>"
1103
+ },
1104
+ "default": "{\n ...Template,\n parameters: {\n fetchMock: {\n mocks: [\n {\n matcher: aggregatedEndpointMatcher,\n response: {\n status: 200,\n body: data,\n },\n },\n ],\n },\n },\n play: async ({ canvasElement, step }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-location-filter');\n\n const submitButton = () => canvas.getByRole('button', { name: 'Submit' });\n const inputField = () => canvas.getByRole('combobox');\n\n const listenerMock = fn();\n await step('Setup event listener mock', async () => {\n canvasElement.addEventListener('gs-location-changed', listenerMock);\n });\n\n await step('wait until data is loaded', async () => {\n await waitFor(() => {\n return expect(inputField()).toBeEnabled();\n });\n });\n\n await step('Input invalid location', async () => {\n await userEvent.type(inputField(), 'Not / A / Location');\n await userEvent.click(submitButton());\n await expect(listenerMock).not.toHaveBeenCalled();\n await userEvent.type(inputField(), '{backspace>18/}');\n });\n\n await step('Select Asia', async () => {\n await userEvent.type(inputField(), 'Asia');\n await userEvent.click(submitButton());\n await expect(listenerMock).toHaveBeenCalledWith(\n expect.objectContaining({\n detail: {\n region: 'Asia',\n },\n }),\n );\n });\n\n await step('Select Asia / Bangladesh / Rajshahi / Chapainawabgonj', async () => {\n await userEvent.type(inputField(), ' / Bangladesh / Rajshahi / Chapainawabgonj');\n await userEvent.click(submitButton());\n await expect(listenerMock).toHaveBeenCalledWith(\n expect.objectContaining({\n detail: {\n region: 'Asia',\n country: 'Bangladesh',\n division: 'Rajshahi',\n location: 'Chapainawabgonj',\n },\n }),\n );\n });\n },\n}"
1105
+ }
1106
+ ],
1107
+ "exports": [
1108
+ {
1109
+ "kind": "js",
1110
+ "name": "default",
1111
+ "declaration": {
1112
+ "name": "meta",
1113
+ "module": "src/web-components/input/location-filter-component.stories.ts"
1114
+ }
1115
+ },
1116
+ {
1117
+ "kind": "js",
1118
+ "name": "LocationFilter",
1119
+ "declaration": {
1120
+ "name": "LocationFilter",
1121
+ "module": "src/web-components/input/location-filter-component.stories.ts"
1122
+ }
1123
+ },
1124
+ {
1125
+ "kind": "js",
1126
+ "name": "DelayToShowLoadingState",
1127
+ "declaration": {
1128
+ "name": "DelayToShowLoadingState",
1129
+ "module": "src/web-components/input/location-filter-component.stories.ts"
1130
+ }
1131
+ },
1132
+ {
1133
+ "kind": "js",
1134
+ "name": "FetchingLocationsFails",
1135
+ "declaration": {
1136
+ "name": "FetchingLocationsFails",
1137
+ "module": "src/web-components/input/location-filter-component.stories.ts"
1138
+ }
1139
+ },
1140
+ {
1141
+ "kind": "js",
1142
+ "name": "FiresEvent",
1143
+ "declaration": {
1144
+ "name": "FiresEvent",
1145
+ "module": "src/web-components/input/location-filter-component.stories.ts"
1146
+ }
1147
+ }
1148
+ ]
1149
+ },
1150
+ {
1151
+ "kind": "javascript-module",
1152
+ "path": "src/web-components/input/location-filter-component.tsx",
1153
+ "declarations": [
1154
+ {
1155
+ "kind": "class",
1156
+ "description": "## Tag\n\n`gs-location-filter`\n\n## Context\n\nThis component provides an input field to specify filters for locations.\n\nIt expects a list of fields that form a strict hierarchical order, such as continent, country, and city.\nThe component retrieves a list of all possible values for these fields from the Lapis instance.\nThis list is then utilized to display autocomplete suggestions and to validate the input.\n\nGiven `fields` are `['field1', 'field2', ..., 'fieldN']`,\nthen valid values for the location filter must be in the form `valueForField1 / valueForField2 / ... / valueForFieldK`,\nwhere `1 <= K <= N`.\nValues for the fields `i > K` are considered `undefined`.",
1157
+ "name": "LocationFilterComponent",
1158
+ "members": [
1159
+ {
1160
+ "kind": "field",
1161
+ "name": "value",
1162
+ "type": {
1163
+ "text": "string"
1164
+ },
1165
+ "default": "''",
1166
+ "description": "The initial value to use for this location filter.\nMust be of the form `valueForField1 / valueForField2 / ... / valueForFieldN`.",
1167
+ "attribute": "value"
1168
+ },
1169
+ {
1170
+ "kind": "field",
1171
+ "name": "fields",
1172
+ "type": {
1173
+ "text": "string[]"
1174
+ },
1175
+ "default": "[]",
1176
+ "description": "The fields to display in the location filter, in hierarchical order.\nThe top-level field should be the first entry in the array.\nThis component assumes that the values for each field form a strict hierarchy\n(e.g., `fields = ['continent', 'country', 'city']`).",
1177
+ "attribute": "fields"
1178
+ }
1179
+ ],
1180
+ "events": [
1181
+ {
1182
+ "type": {
1183
+ "text": "CustomEvent<Record<string, string>>"
1184
+ },
1185
+ "description": "Fired when the field is submitted with a valid location value. The `details` of this event contain an object with all `fields` as keys and the corresponding values as values, if they are not `undefined`. Example: ``` { continent: \"Asia\", country: \"China\", city: \"Beijing\" } ```",
1186
+ "name": "gs-location-changed"
1187
+ }
1188
+ ],
1189
+ "attributes": [
1190
+ {
1191
+ "name": "value",
1192
+ "type": {
1193
+ "text": "string"
1194
+ },
1195
+ "default": "''",
1196
+ "description": "The initial value to use for this location filter.\nMust be of the form `valueForField1 / valueForField2 / ... / valueForFieldN`.",
1197
+ "fieldName": "value"
1198
+ },
1199
+ {
1200
+ "name": "fields",
1201
+ "type": {
1202
+ "text": "string[]"
1203
+ },
1204
+ "default": "[]",
1205
+ "description": "The fields to display in the location filter, in hierarchical order.\nThe top-level field should be the first entry in the array.\nThis component assumes that the values for each field form a strict hierarchy\n(e.g., `fields = ['continent', 'country', 'city']`).",
1206
+ "fieldName": "fields"
1207
+ }
1208
+ ],
1209
+ "superclass": {
1210
+ "name": "PreactLitAdapter",
1211
+ "module": "/src/web-components/PreactLitAdapter"
1212
+ },
1213
+ "tagName": "gs-location-filter",
1214
+ "customElement": true
1215
+ }
1216
+ ],
1217
+ "exports": [
1218
+ {
1219
+ "kind": "js",
1220
+ "name": "LocationFilterComponent",
1221
+ "declaration": {
1222
+ "name": "LocationFilterComponent",
1223
+ "module": "src/web-components/input/location-filter-component.tsx"
1224
+ }
1225
+ },
1226
+ {
1227
+ "kind": "custom-element-definition",
1228
+ "name": "gs-location-filter",
1229
+ "declaration": {
1230
+ "name": "LocationFilterComponent",
1231
+ "module": "src/web-components/input/location-filter-component.tsx"
1232
+ }
1233
+ }
1234
+ ]
1235
+ },
1236
+ {
1237
+ "kind": "javascript-module",
1238
+ "path": "src/web-components/input/location-filter.mdx",
1239
+ "declarations": [],
1240
+ "exports": []
1241
+ },
1242
+ {
1243
+ "kind": "javascript-module",
1244
+ "path": "src/web-components/input/mutation-filter-component.stories.ts",
1245
+ "declarations": [
1246
+ {
1247
+ "kind": "variable",
1248
+ "name": "meta",
1249
+ "type": {
1250
+ "text": "Meta"
1251
+ },
1252
+ "default": "{\n title: 'Input/Mutation filter',\n component: 'gs-mutation-filter',\n parameters: {\n actions: {\n handles: ['gs-mutation-filter-changed', 'gs-mutation-filter-on-blur'],\n },\n fetchMock: {},\n },\n decorators: [withActions],\n}"
1253
+ },
1254
+ {
1255
+ "kind": "variable",
1256
+ "name": "Default",
1257
+ "type": {
1258
+ "text": "StoryObj<{ lapisField: string; placeholderText: string }>"
1259
+ },
1260
+ "default": "{\n render: () => {\n return html` <gs-app lapis=\"${LAPIS_URL}\">\n <div class=\"max-w-screen-lg\">\n <gs-mutation-filter></gs-mutation-filter>\n </div>\n </gs-app>`;\n },\n}"
1261
+ },
1262
+ {
1263
+ "kind": "variable",
1264
+ "name": "FiresFilterChangedEvent",
1265
+ "type": {
1266
+ "text": "StoryObj<{ lapisField: string; placeholderText: string }>"
1267
+ },
1268
+ "default": "{\n ...Default,\n play: async ({ canvasElement, step }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-mutation-filter');\n\n const inputField = () => canvas.getByPlaceholderText('Enter a mutation');\n const submitButton = () => canvas.getByRole('button', { name: '+' });\n const listenerMock = fn();\n await step('Setup event listener mock', async () => {\n canvasElement.addEventListener('gs-mutation-filter-changed', listenerMock);\n });\n\n await step('wait until data is loaded', async () => {\n await waitFor(() => {\n return expect(inputField()).toBeEnabled();\n });\n });\n\n await step('Enter a valid mutation', async () => {\n await userEvent.type(inputField(), 'A123T');\n await waitFor(() => submitButton().click());\n\n await waitFor(() =>\n expect(listenerMock).toHaveBeenCalledWith(\n expect.objectContaining({\n detail: {\n nucleotideMutations: ['A123T'],\n aminoAcidMutations: [],\n nucleotideInsertions: [],\n aminoAcidInsertions: [],\n },\n }),\n ),\n );\n });\n },\n}"
1269
+ },
1270
+ {
1271
+ "kind": "variable",
1272
+ "name": "FiresFilterOnBlurEvent",
1273
+ "type": {
1274
+ "text": "StoryObj<{ lapisField: string; placeholderText: string }>"
1275
+ },
1276
+ "default": "{\n ...Default,\n play: async ({ canvasElement, step }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-mutation-filter');\n\n const inputField = () => canvas.getByPlaceholderText('Enter a mutation');\n const listenerMock = fn();\n await step('Setup event listener mock', async () => {\n canvasElement.addEventListener('gs-mutation-filter-on-blur', listenerMock);\n });\n\n await step('wait until data is loaded', async () => {\n await waitFor(() => {\n return expect(inputField()).toBeEnabled();\n });\n });\n\n await step('Move outside of input', async () => {\n await userEvent.type(inputField(), 'A123T');\n await userEvent.tab();\n\n await expect(listenerMock).toHaveBeenCalled();\n });\n },\n}"
1277
+ }
1278
+ ],
1279
+ "exports": [
1280
+ {
1281
+ "kind": "js",
1282
+ "name": "default",
1283
+ "declaration": {
1284
+ "name": "meta",
1285
+ "module": "src/web-components/input/mutation-filter-component.stories.ts"
1286
+ }
1287
+ },
1288
+ {
1289
+ "kind": "js",
1290
+ "name": "Default",
1291
+ "declaration": {
1292
+ "name": "Default",
1293
+ "module": "src/web-components/input/mutation-filter-component.stories.ts"
1294
+ }
1295
+ },
1296
+ {
1297
+ "kind": "js",
1298
+ "name": "FiresFilterChangedEvent",
1299
+ "declaration": {
1300
+ "name": "FiresFilterChangedEvent",
1301
+ "module": "src/web-components/input/mutation-filter-component.stories.ts"
1302
+ }
1303
+ },
1304
+ {
1305
+ "kind": "js",
1306
+ "name": "FiresFilterOnBlurEvent",
1307
+ "declaration": {
1308
+ "name": "FiresFilterOnBlurEvent",
1309
+ "module": "src/web-components/input/mutation-filter-component.stories.ts"
1310
+ }
1311
+ }
1312
+ ]
1313
+ },
1314
+ {
1315
+ "kind": "javascript-module",
1316
+ "path": "src/web-components/input/mutation-filter-component.tsx",
1317
+ "declarations": [
1318
+ {
1319
+ "kind": "class",
1320
+ "description": "",
1321
+ "name": "MutationFilterComponent",
1322
+ "members": [],
1323
+ "events": [
1324
+ {
1325
+ "type": {
1326
+ "text": "CustomEvent<SelectedMutationFilterStrings>"
1327
+ },
1328
+ "description": "When the mutation filter values have changed",
1329
+ "name": "gs-mutation-filter-changed"
1330
+ },
1331
+ {
1332
+ "type": {
1333
+ "text": "CustomEvent<SelectedMutationFilterStrings>"
1334
+ },
1335
+ "description": "When the mutation filter has lost focus",
1336
+ "name": "gs-mutation-filter-on-blur"
1337
+ }
1338
+ ],
1339
+ "superclass": {
1340
+ "name": "PreactLitAdapter",
1341
+ "module": "/src/web-components/PreactLitAdapter"
1342
+ },
1343
+ "tagName": "gs-mutation-filter",
1344
+ "customElement": true
1345
+ }
1346
+ ],
1347
+ "exports": [
1348
+ {
1349
+ "kind": "js",
1350
+ "name": "MutationFilterComponent",
1351
+ "declaration": {
1352
+ "name": "MutationFilterComponent",
1353
+ "module": "src/web-components/input/mutation-filter-component.tsx"
1354
+ }
1355
+ },
1356
+ {
1357
+ "kind": "custom-element-definition",
1358
+ "name": "gs-mutation-filter",
1359
+ "declaration": {
1360
+ "name": "MutationFilterComponent",
1361
+ "module": "src/web-components/input/mutation-filter-component.tsx"
1362
+ }
1363
+ }
1364
+ ]
1365
+ },
1366
+ {
1367
+ "kind": "javascript-module",
1368
+ "path": "src/web-components/input/text-input-component.stories.ts",
1369
+ "declarations": [
1370
+ {
1371
+ "kind": "variable",
1372
+ "name": "meta",
1373
+ "type": {
1374
+ "text": "Meta"
1375
+ },
1376
+ "default": "{\n title: 'Input/Text input',\n component: 'gs-text-input',\n parameters: {\n actions: {\n handles: ['gs-text-input-changed'],\n },\n fetchMock: {\n mocks: [\n {\n matcher: {\n name: 'hosts',\n url: AGGREGATED_ENDPOINT,\n body: {\n fields: ['host'],\n },\n },\n response: {\n status: 200,\n body: data,\n },\n },\n ],\n },\n },\n decorators: [withActions],\n tags: ['autodocs'],\n}"
1377
+ },
1378
+ {
1379
+ "kind": "variable",
1380
+ "name": "Default",
1381
+ "type": {
1382
+ "text": "StoryObj<{ lapisField: string; placeholderText: string }>"
1383
+ },
1384
+ "default": "{\n render: (args) => {\n return html` <gs-app lapis=\"${LAPIS_URL}\">\n <div class=\"max-w-screen-lg\">\n <gs-text-input .lapisField=${args.lapisField} .placeholderText=${args.placeholderText}></gs-text-input>\n </div>\n </gs-app>`;\n },\n args: {\n lapisField: 'host',\n placeholderText: 'Enter host name',\n },\n}"
1385
+ },
1386
+ {
1387
+ "kind": "variable",
1388
+ "name": "FiresEvent",
1389
+ "type": {
1390
+ "text": "StoryObj<{ lapisField: string; placeholderText: string }>"
1391
+ },
1392
+ "default": "{\n ...Default,\n play: async ({ canvasElement, step }) => {\n const canvas = await withinShadowRoot(canvasElement, 'gs-text-input');\n\n const inputField = () => canvas.getByPlaceholderText('Enter host name');\n const listenerMock = fn();\n await step('Setup event listener mock', async () => {\n canvasElement.addEventListener('gs-text-input-changed', listenerMock);\n });\n\n await step('wait until data is loaded', async () => {\n await waitFor(() => {\n return expect(inputField()).toBeEnabled();\n });\n });\n\n await step('Enters an invalid host name', async () => {\n await userEvent.type(inputField(), 'notInList');\n await expect(listenerMock).not.toHaveBeenCalled();\n await userEvent.type(inputField(), '{backspace>9/}');\n });\n\n await step('Enter a valid host name', async () => {\n await userEvent.type(inputField(), 'Homo');\n\n await expect(listenerMock).toHaveBeenCalledWith(\n expect.objectContaining({\n detail: {\n host: 'Homo',\n },\n }),\n );\n });\n },\n}"
1393
+ }
1394
+ ],
1395
+ "exports": [
1396
+ {
1397
+ "kind": "js",
1398
+ "name": "default",
1399
+ "declaration": {
1400
+ "name": "meta",
1401
+ "module": "src/web-components/input/text-input-component.stories.ts"
1402
+ }
1403
+ },
1404
+ {
1405
+ "kind": "js",
1406
+ "name": "Default",
1407
+ "declaration": {
1408
+ "name": "Default",
1409
+ "module": "src/web-components/input/text-input-component.stories.ts"
1410
+ }
1411
+ },
1412
+ {
1413
+ "kind": "js",
1414
+ "name": "FiresEvent",
1415
+ "declaration": {
1416
+ "name": "FiresEvent",
1417
+ "module": "src/web-components/input/text-input-component.stories.ts"
1418
+ }
1419
+ }
1420
+ ]
1421
+ },
1422
+ {
1423
+ "kind": "javascript-module",
1424
+ "path": "src/web-components/input/text-input-component.tsx",
1425
+ "declarations": [
1426
+ {
1427
+ "kind": "class",
1428
+ "description": "",
1429
+ "name": "TextInputComponent",
1430
+ "members": [
1431
+ {
1432
+ "kind": "field",
1433
+ "name": "lapisField",
1434
+ "type": {
1435
+ "text": "string"
1436
+ },
1437
+ "default": "''",
1438
+ "attribute": "lapisField"
1439
+ },
1440
+ {
1441
+ "kind": "field",
1442
+ "name": "placeholderText",
1443
+ "type": {
1444
+ "text": "string"
1445
+ },
1446
+ "default": "''",
1447
+ "attribute": "placeholderText"
1448
+ }
1449
+ ],
1450
+ "events": [
1451
+ {
1452
+ "type": {
1453
+ "text": "CustomEvent<Record<string, string>>"
1454
+ },
1455
+ "description": "When the text input has changed",
1456
+ "name": "gs-text-input-changed"
1457
+ }
1458
+ ],
1459
+ "attributes": [
1460
+ {
1461
+ "name": "lapisField",
1462
+ "type": {
1463
+ "text": "string"
1464
+ },
1465
+ "default": "''",
1466
+ "fieldName": "lapisField"
1467
+ },
1468
+ {
1469
+ "name": "placeholderText",
1470
+ "type": {
1471
+ "text": "string"
1472
+ },
1473
+ "default": "''",
1474
+ "fieldName": "placeholderText"
1475
+ }
1476
+ ],
1477
+ "superclass": {
1478
+ "name": "PreactLitAdapter",
1479
+ "module": "/src/web-components/PreactLitAdapter"
1480
+ },
1481
+ "tagName": "gs-text-input",
1482
+ "customElement": true
1483
+ }
1484
+ ],
1485
+ "exports": [
1486
+ {
1487
+ "kind": "js",
1488
+ "name": "TextInputComponent",
1489
+ "declaration": {
1490
+ "name": "TextInputComponent",
1491
+ "module": "src/web-components/input/text-input-component.tsx"
1492
+ }
1493
+ },
1494
+ {
1495
+ "kind": "custom-element-definition",
1496
+ "name": "gs-text-input",
1497
+ "declaration": {
1498
+ "name": "TextInputComponent",
1499
+ "module": "src/web-components/input/text-input-component.tsx"
1500
+ }
1501
+ }
1502
+ ]
1503
+ },
1504
+ {
1505
+ "kind": "javascript-module",
1506
+ "path": "src/web-components/lapis-context.ts",
1507
+ "declarations": [
1508
+ {
1509
+ "kind": "variable",
1510
+ "name": "lapisContext"
1511
+ }
1512
+ ],
1513
+ "exports": [
1514
+ {
1515
+ "kind": "js",
1516
+ "name": "lapisContext",
1517
+ "declaration": {
1518
+ "name": "lapisContext",
1519
+ "module": "src/web-components/lapis-context.ts"
1520
+ }
1521
+ }
1522
+ ]
1523
+ },
1524
+ {
1525
+ "kind": "javascript-module",
1526
+ "path": "src/web-components/reference-genome-context.ts",
1527
+ "declarations": [
1528
+ {
1529
+ "kind": "variable",
1530
+ "name": "referenceGenomeContext"
1531
+ }
1532
+ ],
1533
+ "exports": [
1534
+ {
1535
+ "kind": "js",
1536
+ "name": "referenceGenomeContext",
1537
+ "declaration": {
1538
+ "name": "referenceGenomeContext",
1539
+ "module": "src/web-components/reference-genome-context.ts"
1540
+ }
1541
+ }
1542
+ ]
1543
+ },
1544
+ {
1545
+ "kind": "javascript-module",
1546
+ "path": "src/web-components/withinShadowRoot.story.ts",
1547
+ "declarations": [
1548
+ {
1549
+ "kind": "function",
1550
+ "name": "withinShadowRoot",
1551
+ "parameters": [
1552
+ {
1553
+ "name": "customElement",
1554
+ "type": {
1555
+ "text": "HTMLElement"
1556
+ }
1557
+ },
1558
+ {
1559
+ "name": "selector",
1560
+ "type": {
1561
+ "text": "string"
1562
+ }
1563
+ }
1564
+ ],
1565
+ "description": "taken from https://github.com/storybookjs/testing-library/issues/24#issuecomment-1593709872\n\nUsage:\n```ts\nexport const MyStory: StoryObj = {\n render: () => html` <my-web-component />`,\n play: async ({ canvasElement, step }) => {\n const canvas = await withinShadowRoot(canvasElement, 'my-web-component');\n\n await userEvent.click(canvas.getByRole('button'));\n // ...\n },\n};\n```"
1566
+ }
1567
+ ],
1568
+ "exports": [
1569
+ {
1570
+ "kind": "js",
1571
+ "name": "default",
1572
+ "declaration": {
1573
+ "module": "src/web-components/withinShadowRoot.story.ts"
1574
+ }
1575
+ },
1576
+ {
1577
+ "kind": "js",
1578
+ "name": "withinShadowRoot",
1579
+ "declaration": {
1580
+ "name": "withinShadowRoot",
1581
+ "module": "src/web-components/withinShadowRoot.story.ts"
1582
+ }
1583
+ }
1584
+ ]
1585
+ }
1586
+ ]
1587
+ }