@nanoporetech-digital/components 8.3.2 → 8.4.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 (225) hide show
  1. package/dist/cjs/constructible-style-BsHBb9au.js +133 -0
  2. package/dist/cjs/{fade-BzBFJiQK.js → fade-DBuNbJEw.js} +1 -1
  3. package/dist/cjs/{fullscreen-Cz3eYnOp.js → fullscreen-Bk4jXSN0.js} +1 -1
  4. package/dist/cjs/index-DGttnXif.js +28 -16
  5. package/dist/cjs/{lazyload-DIFYejbf.js → lazyload-gQqOMvpr.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/nano-accordion.cjs.entry.js +28 -9
  8. package/dist/cjs/nano-avatar_5.cjs.entry.js +11 -11
  9. package/dist/cjs/nano-components.cjs.js +1 -1
  10. package/dist/cjs/{nano-data-table-DFEflpc4.js → nano-data-table-BHQIpW0N.js} +31 -1
  11. package/dist/cjs/nano-data-table.cjs.entry.js +1 -1
  12. package/dist/cjs/nano-details.cjs.entry.js +6 -4
  13. package/dist/cjs/nano-field-validator.cjs.entry.js +4 -2
  14. package/dist/cjs/nano-footer.cjs.entry.js +2 -2
  15. package/dist/cjs/nano-global-nav.cjs.entry.js +22 -21
  16. package/dist/cjs/nano-grid-item.cjs.entry.js +1 -1
  17. package/dist/cjs/nano-grid_2.cjs.entry.js +6 -130
  18. package/dist/cjs/nano-hero.cjs.entry.js +4 -4
  19. package/dist/cjs/{nano-icon_3.cjs.entry.js → nano-icon-button_2.cjs.entry.js} +2 -320
  20. package/dist/cjs/nano-icon.cjs.entry.js +326 -0
  21. package/dist/cjs/nano-in-page-nav.cjs.entry.js +1 -1
  22. package/dist/cjs/nano-increment.cjs.entry.js +1 -1
  23. package/dist/cjs/nano-intersection-observe.cjs.entry.js +1 -1
  24. package/dist/cjs/nano-masked-overflow.cjs.entry.js +3 -3
  25. package/dist/cjs/nano-menu-drawer.cjs.entry.js +2 -2
  26. package/dist/cjs/nano-more-less.cjs.entry.js +2 -2
  27. package/dist/cjs/nano-rating.cjs.entry.js +4 -4
  28. package/dist/cjs/nano-resize-observe.cjs.entry.js +2 -2
  29. package/dist/cjs/nano-slide.cjs.entry.js +1 -1
  30. package/dist/cjs/{nano-slides-C576PTmo.js → nano-slides-C73bSG0h.js} +7 -7
  31. package/dist/cjs/nano-slides.cjs.entry.js +1 -1
  32. package/dist/cjs/nano-sortable.cjs.entry.js +1 -1
  33. package/dist/cjs/nano-step-accordion.cjs.entry.js +101 -0
  34. package/dist/cjs/nano-step-breadcrumb.cjs.entry.js +133 -0
  35. package/dist/cjs/nano-sticker.cjs.entry.js +2 -2
  36. package/dist/cjs/nano-tab-content.cjs.entry.js +2 -2
  37. package/dist/cjs/nano-tab.cjs.entry.js +2 -2
  38. package/dist/cjs/nano-table.cjs.entry.js +2 -2
  39. package/dist/cjs/{page-dots-Clb2QknR.js → page-dots-BLPta5z5.js} +1 -1
  40. package/dist/cjs/{table.worker-DxRLPmU9.js → table.worker-BeE8kdSf.js} +1 -1
  41. package/dist/collection/collection-manifest.json +2 -0
  42. package/dist/collection/components/accordion/accordion.js +51 -13
  43. package/dist/collection/components/breadcrumb/breadcrumb.js +1 -1
  44. package/dist/collection/components/data-table/table.js +1 -13
  45. package/dist/collection/components/details/details.js +9 -6
  46. package/dist/collection/components/field-validator/field-validator.js +4 -2
  47. package/dist/collection/components/footer/footer.css +7 -7
  48. package/dist/collection/components/footer/footer.js +2 -1
  49. package/dist/collection/components/global-nav/global-nav.js +23 -22
  50. package/dist/collection/components/global-search-results/global-search-results.js +4 -4
  51. package/dist/collection/components/grid/grid-item.js +1 -1
  52. package/dist/collection/components/grid/grid.js +1 -1
  53. package/dist/collection/components/hero/hero.js +4 -4
  54. package/dist/collection/components/icon/icon.js +1 -1
  55. package/dist/collection/components/icon/validate.js +1 -1
  56. package/dist/collection/components/img/img.js +3 -3
  57. package/dist/collection/components/in-page-nav/in-page-nav.js +1 -1
  58. package/dist/collection/components/increment/increment.js +1 -1
  59. package/dist/collection/components/intersection-observe/intersection-observe.js +1 -1
  60. package/dist/collection/components/masked-overflow/masked-overflow.js +3 -3
  61. package/dist/collection/components/menu-drawer/menu-drawer.js +2 -2
  62. package/dist/collection/components/more-less/more-less.js +2 -2
  63. package/dist/collection/components/rating/rating.js +4 -4
  64. package/dist/collection/components/resize-observe/resize-observe.js +2 -2
  65. package/dist/collection/components/select/select.js +7 -7
  66. package/dist/collection/components/slides/slide.js +1 -1
  67. package/dist/collection/components/slides/slides.js +3 -3
  68. package/dist/collection/components/sortable/sortable.js +1 -1
  69. package/dist/collection/components/step-accordion/step-accordion.css +138 -0
  70. package/dist/collection/components/step-accordion/step-accordion.js +190 -0
  71. package/dist/collection/components/step-breadcrumb/step-breadcrumb.css +231 -0
  72. package/dist/collection/components/step-breadcrumb/step-breadcrumb.js +222 -0
  73. package/dist/collection/components/sticker/sticker.js +2 -2
  74. package/dist/collection/components/table/table.js +2 -2
  75. package/dist/collection/components/tabs/tab-content.js +2 -2
  76. package/dist/collection/components/tabs/tab.js +2 -2
  77. package/dist/collection/components/tooltip/tooltip.js +2 -2
  78. package/dist/collection/utils/constructible-style.js +2 -2
  79. package/dist/collection/utils/performance.js +17 -0
  80. package/dist/components/accordion.js +80 -0
  81. package/dist/components/constructible-style.js +131 -0
  82. package/dist/components/details.js +6 -4
  83. package/dist/components/global-search-results.js +4 -4
  84. package/dist/components/grid.js +5 -129
  85. package/dist/components/icon.js +2 -2
  86. package/dist/components/img.js +3 -3
  87. package/dist/components/masked-overflow.js +3 -3
  88. package/dist/components/nano-accordion.js +1 -56
  89. package/dist/components/nano-data-table.js +30 -0
  90. package/dist/components/nano-field-validator.js +4 -2
  91. package/dist/components/nano-footer.js +2 -2
  92. package/dist/components/nano-global-nav.js +22 -21
  93. package/dist/components/nano-grid-item.js +1 -1
  94. package/dist/components/nano-hero.js +4 -4
  95. package/dist/components/nano-in-page-nav.js +1 -1
  96. package/dist/components/nano-increment.js +1 -1
  97. package/dist/components/nano-intersection-observe.js +1 -1
  98. package/dist/components/nano-menu-drawer.js +2 -2
  99. package/dist/components/nano-more-less.js +2 -2
  100. package/dist/components/nano-rating.js +4 -4
  101. package/dist/components/nano-slide.js +1 -1
  102. package/dist/components/nano-sortable.js +1 -1
  103. package/dist/components/nano-step-accordion.d.ts +11 -0
  104. package/dist/components/nano-step-accordion.js +141 -0
  105. package/dist/components/nano-step-breadcrumb.d.ts +11 -0
  106. package/dist/components/nano-step-breadcrumb.js +181 -0
  107. package/dist/components/nano-tab-content.js +2 -2
  108. package/dist/components/nano-tab.js +2 -2
  109. package/dist/components/nano-table.js +2 -2
  110. package/dist/components/resize-observe.js +2 -2
  111. package/dist/components/select.js +7 -7
  112. package/dist/components/slides.js +3 -3
  113. package/dist/components/sticker.js +2 -2
  114. package/dist/components/tooltip.js +2 -2
  115. package/dist/esm/constructible-style-B2_GfhhS.js +131 -0
  116. package/dist/esm/{fade-D4P3XGVa.js → fade-C0NluV0K.js} +1 -1
  117. package/dist/esm/{fullscreen-Cfl6LvH2.js → fullscreen-Ck_w6MCZ.js} +1 -1
  118. package/dist/esm/index-BM3Om9WE.js +28 -16
  119. package/dist/esm/{lazyload-CQYknGN2.js → lazyload-DddTyM-A.js} +1 -1
  120. package/dist/esm/loader.js +1 -1
  121. package/dist/esm/nano-accordion.entry.js +28 -9
  122. package/dist/esm/nano-avatar_5.entry.js +11 -11
  123. package/dist/esm/nano-components.js +1 -1
  124. package/dist/esm/{nano-data-table-Bqk8ZUaL.js → nano-data-table-CWliPF7Y.js} +31 -1
  125. package/dist/esm/nano-data-table.entry.js +1 -1
  126. package/dist/esm/nano-details.entry.js +6 -4
  127. package/dist/esm/nano-field-validator.entry.js +4 -2
  128. package/dist/esm/nano-footer.entry.js +2 -2
  129. package/dist/esm/nano-global-nav.entry.js +22 -21
  130. package/dist/esm/nano-grid-item.entry.js +1 -1
  131. package/dist/esm/nano-grid_2.entry.js +7 -131
  132. package/dist/esm/nano-hero.entry.js +4 -4
  133. package/dist/esm/{nano-icon_3.entry.js → nano-icon-button_2.entry.js} +4 -321
  134. package/dist/esm/nano-icon.entry.js +324 -0
  135. package/dist/esm/nano-in-page-nav.entry.js +1 -1
  136. package/dist/esm/nano-increment.entry.js +1 -1
  137. package/dist/esm/nano-intersection-observe.entry.js +1 -1
  138. package/dist/esm/nano-masked-overflow.entry.js +3 -3
  139. package/dist/esm/nano-menu-drawer.entry.js +2 -2
  140. package/dist/esm/nano-more-less.entry.js +2 -2
  141. package/dist/esm/nano-rating.entry.js +4 -4
  142. package/dist/esm/nano-resize-observe.entry.js +2 -2
  143. package/dist/esm/nano-slide.entry.js +1 -1
  144. package/dist/esm/{nano-slides-DcJWApi6.js → nano-slides-BiPGpe5F.js} +7 -7
  145. package/dist/esm/nano-slides.entry.js +1 -1
  146. package/dist/esm/nano-sortable.entry.js +1 -1
  147. package/dist/esm/nano-step-accordion.entry.js +99 -0
  148. package/dist/esm/nano-step-breadcrumb.entry.js +131 -0
  149. package/dist/esm/nano-sticker.entry.js +2 -2
  150. package/dist/esm/nano-tab-content.entry.js +2 -2
  151. package/dist/esm/nano-tab.entry.js +2 -2
  152. package/dist/esm/nano-table.entry.js +2 -2
  153. package/dist/esm/{page-dots-kX7jiD3G.js → page-dots-WKehEjjM.js} +1 -1
  154. package/dist/esm/{table.worker-a52UkSRM.js → table.worker-DJks4i_l.js} +1 -1
  155. package/dist/nano-components/constructible-style-B2_GfhhS.js +4 -0
  156. package/dist/nano-components/{fade-D4P3XGVa.js → fade-C0NluV0K.js} +1 -1
  157. package/dist/nano-components/{fullscreen-Cfl6LvH2.js → fullscreen-Ck_w6MCZ.js} +1 -1
  158. package/dist/nano-components/{lazyload-CQYknGN2.js → lazyload-DddTyM-A.js} +1 -1
  159. package/dist/nano-components/nano-accordion.entry.js +1 -1
  160. package/dist/nano-components/nano-avatar_5.entry.js +1 -1
  161. package/dist/nano-components/nano-components.css +32 -1
  162. package/dist/nano-components/nano-components.esm.js +1 -1
  163. package/dist/nano-components/nano-data-table-CWliPF7Y.js +4 -0
  164. package/dist/nano-components/nano-data-table.entry.js +1 -1
  165. package/dist/nano-components/nano-details.entry.js +1 -1
  166. package/dist/nano-components/nano-field-validator.entry.js +1 -1
  167. package/dist/nano-components/nano-footer.entry.js +1 -1
  168. package/dist/nano-components/nano-global-nav.entry.js +1 -1
  169. package/dist/nano-components/nano-grid-item.entry.js +1 -1
  170. package/dist/nano-components/nano-grid_2.entry.js +1 -1
  171. package/dist/nano-components/nano-hero.entry.js +1 -1
  172. package/dist/nano-components/nano-icon-button_2.entry.js +4 -0
  173. package/dist/nano-components/nano-icon.entry.js +4 -0
  174. package/dist/nano-components/nano-in-page-nav.entry.js +1 -1
  175. package/dist/nano-components/nano-increment.entry.js +1 -1
  176. package/dist/nano-components/nano-intersection-observe.entry.js +1 -1
  177. package/dist/nano-components/nano-masked-overflow.entry.js +1 -1
  178. package/dist/nano-components/nano-menu-drawer.entry.js +1 -1
  179. package/dist/nano-components/nano-more-less.entry.js +1 -1
  180. package/dist/nano-components/nano-rating.entry.js +1 -1
  181. package/dist/nano-components/nano-resize-observe.entry.js +1 -1
  182. package/dist/nano-components/nano-slide.entry.js +1 -1
  183. package/dist/nano-components/{nano-slides-DcJWApi6.js → nano-slides-BiPGpe5F.js} +3 -3
  184. package/dist/nano-components/nano-slides.entry.js +1 -1
  185. package/dist/nano-components/nano-sortable.entry.js +1 -1
  186. package/dist/nano-components/nano-step-accordion.entry.js +4 -0
  187. package/dist/nano-components/nano-step-breadcrumb.entry.js +4 -0
  188. package/dist/nano-components/nano-sticker.entry.js +1 -1
  189. package/dist/nano-components/nano-tab-content.entry.js +1 -1
  190. package/dist/nano-components/nano-tab.entry.js +1 -1
  191. package/dist/nano-components/nano-table.entry.js +1 -1
  192. package/dist/nano-components/{page-dots-kX7jiD3G.js → page-dots-WKehEjjM.js} +1 -1
  193. package/dist/nano-components/{table.worker-a52UkSRM.js → table.worker-DJks4i_l.js} +1 -1
  194. package/dist/stencil.config.js +1 -0
  195. package/dist/style/components.css +1 -1
  196. package/dist/style/components.css.map +1 -1
  197. package/dist/style/core.css +1 -1
  198. package/dist/style/core.css.map +1 -1
  199. package/dist/style/nano.css +1 -1
  200. package/dist/style/nano.css.map +1 -1
  201. package/dist/types/components/accordion/accordion.d.ts +10 -4
  202. package/dist/types/components/details/details.d.ts +3 -2
  203. package/dist/types/components/footer/footer.d.ts +1 -0
  204. package/dist/types/components/global-nav/global-nav.d.ts +1 -1
  205. package/dist/types/components/step-accordion/step-accordion.d.ts +38 -0
  206. package/dist/types/components/step-breadcrumb/step-breadcrumb.d.ts +37 -0
  207. package/dist/types/components.d.ts +174 -4
  208. package/dist/types/utils/performance.d.ts +1 -0
  209. package/docs-json.json +352 -18
  210. package/docs-vscode.json +41 -2
  211. package/hydrate/index.js +404 -99
  212. package/hydrate/index.mjs +404 -99
  213. package/package.json +2 -2
  214. package/dist/nano-components/nano-data-table-Bqk8ZUaL.js +0 -4
  215. package/dist/nano-components/nano-icon_3.entry.js +0 -4
  216. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/generate-vue-component.d.ts +0 -0
  217. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/index.d.ts +0 -0
  218. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/output-vue.d.ts +0 -0
  219. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/plugin.d.ts +0 -0
  220. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/types.d.ts +0 -0
  221. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/plugins/stencil/vue-output/utils.d.ts +0 -0
  222. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/stencil.config.d.ts +0 -0
  223. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/stencil.config.prod.d.ts +0 -0
  224. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/testing/mocks/intersection-observer.d.ts +0 -0
  225. /package/dist/types/builds/{x6knoJK1 → QrfEi4pt}/0/Digital/nano-components/packages/components/.stencil/wdio.conf.d.ts +0 -0
@@ -0,0 +1,231 @@
1
+ :host,
2
+ *,
3
+ *::before,
4
+ *::after {
5
+ box-sizing: border-box;
6
+ }
7
+ [hidden] {
8
+ display: none !important;
9
+ }
10
+ @media (prefers-reduced-motion: reduce) {
11
+ :host,
12
+ *,
13
+ *::before,
14
+ *::after {
15
+ animation-duration: 0.01ms !important;
16
+ animation-iteration-count: 1 !important;
17
+ transition-duration: 0.01ms !important;
18
+ scroll-behavior: auto !important;
19
+ }
20
+ }:host,
21
+ *,
22
+ *::before,
23
+ *::after {
24
+ box-sizing: border-box;
25
+ }
26
+ [hidden] {
27
+ display: none !important;
28
+ }
29
+ @media (prefers-reduced-motion: reduce) {
30
+ :host,
31
+ *,
32
+ *::before,
33
+ *::after {
34
+ animation-duration: 0.01ms !important;
35
+ animation-iteration-count: 1 !important;
36
+ transition-duration: 0.01ms !important;
37
+ scroll-behavior: auto !important;
38
+ }
39
+ }/** Typography */
40
+ :host {
41
+ /**
42
+ * @prop --background: the background color of the step breadcrumb. Defaults to var(--nano-color-base-0).
43
+ */
44
+ display: block;
45
+ --background: var(--nano-color-base-0);
46
+ }
47
+
48
+ .step-wrapper {
49
+ container-type: inline-size;
50
+ }
51
+
52
+ .step-list.desktop {
53
+ display: flex;
54
+ flex-direction: row;
55
+ align-items: center;
56
+ justify-content: space-between;
57
+ list-style: none;
58
+ padding: 0;
59
+ margin: 0;
60
+ position: relative;
61
+ z-index: 1;
62
+ }
63
+ .step-list.desktop::before {
64
+ content: "";
65
+ display: block;
66
+ flex-grow: 1;
67
+ block-size: 1px;
68
+ background-color: var(--nano-color-neutral-300);
69
+ position: absolute;
70
+ inset-block-start: 50%;
71
+ z-index: -1;
72
+ inset-inline-start: 0;
73
+ inline-size: 100%;
74
+ }
75
+
76
+ .step-item-wrapper {
77
+ flex: 0 1 auto;
78
+ display: inline-flex;
79
+ align-items: center;
80
+ cursor: pointer;
81
+ }
82
+ .step-item-wrapper:last-of-type {
83
+ flex: 0 1 auto;
84
+ }
85
+ .step-item-wrapper:last-of-type .step-item {
86
+ padding-inline-end: 0;
87
+ }
88
+ .step-item-wrapper:first-of-type::before {
89
+ display: none;
90
+ }
91
+ .step-item-wrapper:first-of-type .step-item {
92
+ padding-inline-start: 0;
93
+ }
94
+ .step-item-wrapper::before {
95
+ content: "";
96
+ grid-column: 2;
97
+ grid-row: 1;
98
+ inline-size: 0.4rem;
99
+ block-size: 0.4rem;
100
+ place-self: center end;
101
+ inset-block-start: 0.5px;
102
+ position: relative;
103
+ border-inline-end: 1px solid var(--nano-color-neutral-300);
104
+ border-block-end: 1px solid var(--nano-color-neutral-300);
105
+ rotate: -45deg;
106
+ }
107
+
108
+ :dir(rtl) .step-item-wrapper::after {
109
+ rotate: 45deg;
110
+ }
111
+
112
+ .step-item {
113
+ all: unset;
114
+ display: inline-flex;
115
+ align-items: center;
116
+ gap: var(--nano-spacing-sm);
117
+ background-color: var(--background);
118
+ padding: 0 var(--nano-spacing-sm);
119
+ position: relative;
120
+ }
121
+ .step-item:focus-visible {
122
+ outline: var(--nano-focus-ring);
123
+ outline-offset: var(--nano-focus-ring-offset);
124
+ z-index: 1;
125
+ }
126
+ .step-item.step-item--disabled {
127
+ cursor: not-allowed;
128
+ }
129
+ .step-item.step-item--disabled > * {
130
+ opacity: 0.5;
131
+ }
132
+
133
+ .step-item-icon {
134
+ font-size: var(--nano-font-size-xs);
135
+ line-height: var(--nano-line-height-normal);
136
+ letter-spacing: var(--nano-letter-spacing-loose);
137
+ display: inline-flex;
138
+ align-items: center;
139
+ justify-content: center;
140
+ inline-size: 1.5rem;
141
+ block-size: 1.5rem;
142
+ border-radius: var(--nano-border-radius-circle);
143
+ background-color: transparent;
144
+ color: var(--nano-color-neutral-1400);
145
+ border: 1px solid var(--nano-color-neutral-300);
146
+ }
147
+ .step-item--complete .step-item-icon {
148
+ background-color: var(--nano-color-success-1000);
149
+ color: var(--nano-color-base-0);
150
+ border: none;
151
+ }
152
+ .step-item--active .step-item-icon {
153
+ background-color: var(--nano-color-primary-1000);
154
+ color: var(--nano-color-base-0);
155
+ border: none;
156
+ }
157
+
158
+ .step-dropdown {
159
+ inline-size: 100%;
160
+ min-inline-size: 300px;
161
+ }
162
+
163
+ .step-trigger {
164
+ all: unset;
165
+ display: inline-flex;
166
+ gap: var(--nano-spacing-md);
167
+ align-items: center;
168
+ inline-size: 100%;
169
+ cursor: pointer;
170
+ }
171
+
172
+ .step-trigger-text {
173
+ display: flex;
174
+ flex-direction: column;
175
+ }
176
+
177
+ .step-trigger-now {
178
+ font-weight: var(--nano-font-weight-normal);
179
+ font-size: var(--nano-font-size-xl);
180
+ line-height: var(--nano-line-height-denser);
181
+ text-wrap: balance;
182
+ color: var(--nano-color-neutral-1400);
183
+ }
184
+
185
+ .step-trigger-next {
186
+ font-size: var(--nano-font-size-2xs);
187
+ line-height: var(--nano-line-height-normal);
188
+ letter-spacing: var(--nano-letter-spacing-loose);
189
+ color: var(--nano-color-neutral-1000);
190
+ }
191
+
192
+ .step-trigger-icon {
193
+ margin-inline-start: auto;
194
+ color: var(--nano-color-primary-1000);
195
+ transition: var(--nano-transition-x-fast) rotate;
196
+ }
197
+ [open] .step-trigger-icon {
198
+ rotate: 180deg;
199
+ }
200
+
201
+ .step-progress-circle {
202
+ --size: 64px;
203
+ --thickness: 4px;
204
+ inline-size: var(--size);
205
+ min-inline-size: var(--size);
206
+ aspect-ratio: 1/1;
207
+ border-radius: 50%;
208
+ display: grid;
209
+ place-items: center;
210
+ position: relative;
211
+ }
212
+ .step-progress-circle::before {
213
+ content: "";
214
+ position: absolute;
215
+ inset: 0;
216
+ border-radius: 50%;
217
+ background: conic-gradient(var(--nano-color-success-1000) calc(var(--value) / var(--max) * 360deg), var(--nano-color-neutral-100) 0);
218
+ -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black 90%);
219
+ mask: radial-gradient(farthest-side, transparent calc(100% - var(--thickness)), black 90%);
220
+ }
221
+
222
+ .step-progress-title {
223
+ font-size: var(--nano-font-size-sm);
224
+ line-height: var(--nano-line-height-normal);
225
+ font-weight: var(--nano-font-weight-bold);
226
+ white-space: nowrap;
227
+ color: var(--nano-color-neutral-1000);
228
+ }
229
+ .step-progress-title strong {
230
+ color: var(--nano-color-neutral-1400);
231
+ }
@@ -0,0 +1,222 @@
1
+ /*!
2
+ * Custom elements for Nanopore-Digital Web applications
3
+ */
4
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
5
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
7
+ r = Reflect.decorate(decorators, target, key, desc);
8
+ else
9
+ for (var i = decorators.length - 1; i >= 0; i--)
10
+ if (d = decorators[i])
11
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
12
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
13
+ };
14
+ var __metadata = (this && this.__metadata) || function (k, v) {
15
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
16
+ return Reflect.metadata(k, v);
17
+ };
18
+ import { forceUpdate, Host, Build, } from "@stencil/core";
19
+ import { h } from "../../utils/renderer";
20
+ import { ConstructibleStyle } from "../../utils/constructible-style";
21
+ import { addGlobalStylesheetToShadow } from "../../utils/style";
22
+ /**
23
+ * Presents a breadcrumb navigation for steps in a process, allowing users to see their progress and navigate back to completed steps.
24
+ *
25
+ * @version 8.4.0
26
+ * @status new
27
+ */
28
+ export class NanoStepBreadcrumb {
29
+ host;
30
+ calculatedWidth;
31
+ cacheKey;
32
+ /** The currently active step, zero-based index */
33
+ activeStep = 0;
34
+ handleActiveStepChange(newValue, oldValue) {
35
+ if (!this.steps[newValue]?.enabled)
36
+ this.activeStep = oldValue;
37
+ else {
38
+ const event = this.nanoStepActive.emit({
39
+ index: newValue,
40
+ step: this.steps[newValue],
41
+ });
42
+ if (event.defaultPrevented) {
43
+ this.activeStep = oldValue;
44
+ }
45
+ }
46
+ }
47
+ /** Emitted when the active step changes. Prevent default to cancel the change */
48
+ nanoStepActive;
49
+ _steps = [];
50
+ stepProxyHandler = {
51
+ set: (target, prop, value) => {
52
+ target[prop] = value;
53
+ forceUpdate(this.host);
54
+ return true;
55
+ },
56
+ };
57
+ /** An array of steps, each with a title, completion status, and enabled state */
58
+ get steps() {
59
+ return this._steps;
60
+ }
61
+ set steps(value) {
62
+ this._steps = [];
63
+ // improved devX - use a proxy to re-render when step properties change
64
+ value.forEach((step) => {
65
+ const proxyStep = new Proxy(step, this.stepProxyHandler);
66
+ this._steps.push(proxyStep);
67
+ });
68
+ }
69
+ handleStepsChange() {
70
+ const numberOfSteps = this._steps.length;
71
+ const charLength = this._steps.reduce((acc, step) => acc + step.title.length, 0);
72
+ this.cacheKey = 'step-breadcrumb-' + numberOfSteps + charLength;
73
+ // text characters + icons (3 x 1.5rem) + arrows (2 x 1.875rem) + gaps (3 * 20px)
74
+ this.calculatedWidth = `calc(${charLength}ch + ${numberOfSteps * 1.5}rem + ${(numberOfSteps - 1) * 1.875}rem + ${numberOfSteps * 10}px)`;
75
+ }
76
+ styles = () => {
77
+ const css = /* css */ `@container (width > ${this.calculatedWidth}) {
78
+ .step-list.mobile.${this.cacheKey} { display: none; }
79
+ .step-list.desktop.${this.cacheKey} { display: flex; }
80
+ }
81
+ @container (width <= ${this.calculatedWidth}) {
82
+ .step-list.mobile.${this.cacheKey} { display: block; }
83
+ .step-list.desktop.${this.cacheKey} { display: none; }
84
+ }`;
85
+ return css;
86
+ };
87
+ componentWillLoad() {
88
+ this.handleStepsChange();
89
+ if (Build.isBrowser)
90
+ addGlobalStylesheetToShadow(this.host.shadowRoot);
91
+ }
92
+ ControlTag = ({ step, index, }) => {
93
+ const Tag = step.enabled ? (step.href ? 'A' : 'BUTTON') : 'SPAN';
94
+ return (h(Tag, { href: step.href || undefined, class: {
95
+ 'step-item': true,
96
+ 'step-item--active': index === this.activeStep,
97
+ 'step-item--complete': step.complete,
98
+ 'step-item--disabled': !step.enabled,
99
+ }, onClick: () => {
100
+ if (step.enabled) {
101
+ this.activeStep = index;
102
+ }
103
+ } }, h("span", { class: "step-item-icon", slot: "icon-start" }, index + 1), h("span", { class: "step-item-title" }, step.title)));
104
+ };
105
+ render() {
106
+ const Wrapper = this.steps.filter((step) => step.href).length > 0 ? 'nav' : 'div';
107
+ return (h(Host, { key: 'c4d0e767abe4ee65f8e70534844e7ff254455af0' }, h(Wrapper, { key: '6df94c5a9df7ae957b5ff243ecbe78e7c57233b3', class: "step-wrapper" }, h("ul", { key: 'ba1838191a0b888b630bfaba5125ae868f8aab38', class: `step-list desktop ${this.cacheKey}` }, this.steps.map((step, index) => (h("li", { class: "step-item-wrapper", key: index }, h(this.ControlTag, { step: step, index: index }))))), h("div", { key: '64ae2c870494d376f4bb6484e97a5217dc4be311', class: `step-list mobile ${this.cacheKey}` }, h("nano-dropdown", { key: '08d3dc468d594177b922ae91fb1ff02ed79d282c', dialogTitle: "Steps", class: "step-dropdown" }, h("button", { key: '88ef0602628d800a3517da3c06e2eea1dad5a7dd', slot: "trigger", class: "step-trigger" }, h("div", { key: '9d60be986e00fdd6814a910641cf94ef97fb2eed', class: "step-progress-circle", role: "progressbar", "aria-valuenow": "2", "aria-valuemin": "0", "aria-valuemax": "5", style: {
108
+ '--value': '' + (this.activeStep + 1),
109
+ '--max': '' + this.steps.length,
110
+ } }, h("span", { key: '9e6eb88c9fc12f4228f55fe04cb2e1ce9a92e1f2', class: "step-progress-text" }, h("strong", { key: '5e999ae958a2c43f5d8998e9083e91b11ea9041d' }, this.activeStep + 1), " of", ' ', this.steps.length)), h("div", { key: 'ccb66003ef35b256ae8d0d34c8cad7535680d05b', class: "step-trigger-text" }, h("div", { key: '87f8a73802c33c289860b0eb530edae379fa5ebf', class: "step-trigger-now" }, this.steps[this.activeStep | 0]?.title || 'Select a step'), h("div", { key: '9b00c5ae99376028ec077e782f430b0346580119', class: "step-trigger-next" }, this.steps[this.activeStep + 1]?.title || 'Next step')), h("nano-icon", { key: '5073cf36a3a15599df7fa3816a62e72af257ab99', class: "step-trigger-icon", name: "light/chevron-down" })), h("nano-menu", { key: '18f15bb2439661286c019a6f20272db72a6ad1b1' }, this.steps.map((step, index) => (h("nano-nav-item", { class: {
111
+ 'step-item-mobile': true,
112
+ 'step-item-mobile step-item--active': index === this.activeStep,
113
+ 'step-item-mobile step-item--complete': step.complete,
114
+ }, disabled: !step.enabled, key: index, onClick: () => {
115
+ if (step.enabled) {
116
+ this.activeStep = index;
117
+ }
118
+ } }, h("span", { class: "step-item-icon", slot: "icon-start" }, index + 1), h("span", { class: "step-item-title" }, step.title))))))))));
119
+ }
120
+ static get is() { return "nano-step-breadcrumb"; }
121
+ static get encapsulation() { return "shadow"; }
122
+ static get originalStyleUrls() {
123
+ return {
124
+ "$": ["step-breadcrumb.scss"]
125
+ };
126
+ }
127
+ static get styleUrls() {
128
+ return {
129
+ "$": ["step-breadcrumb.css"]
130
+ };
131
+ }
132
+ static get properties() {
133
+ return {
134
+ "activeStep": {
135
+ "type": "number",
136
+ "attribute": "active-step",
137
+ "mutable": true,
138
+ "complexType": {
139
+ "original": "number",
140
+ "resolved": "number",
141
+ "references": {}
142
+ },
143
+ "required": false,
144
+ "optional": false,
145
+ "docs": {
146
+ "tags": [],
147
+ "text": "The currently active step, zero-based index"
148
+ },
149
+ "getter": false,
150
+ "setter": false,
151
+ "reflect": false,
152
+ "defaultValue": "0"
153
+ },
154
+ "steps": {
155
+ "type": "unknown",
156
+ "attribute": "steps",
157
+ "mutable": false,
158
+ "complexType": {
159
+ "original": "Step[]",
160
+ "resolved": "Step[]",
161
+ "references": {
162
+ "Step": {
163
+ "location": "global",
164
+ "id": "global::Step"
165
+ }
166
+ }
167
+ },
168
+ "required": false,
169
+ "optional": false,
170
+ "docs": {
171
+ "tags": [],
172
+ "text": "An array of steps, each with a title, completion status, and enabled state"
173
+ },
174
+ "getter": true,
175
+ "setter": true,
176
+ "defaultValue": "[]"
177
+ }
178
+ };
179
+ }
180
+ static get states() {
181
+ return {
182
+ "calculatedWidth": {}
183
+ };
184
+ }
185
+ static get events() {
186
+ return [{
187
+ "method": "nanoStepActive",
188
+ "name": "nanoStepActive",
189
+ "bubbles": true,
190
+ "cancelable": true,
191
+ "composed": true,
192
+ "docs": {
193
+ "tags": [],
194
+ "text": "Emitted when the active step changes. Prevent default to cancel the change"
195
+ },
196
+ "complexType": {
197
+ "original": "{\n step: Step;\n index: number;\n }",
198
+ "resolved": "{ step: Step; index: number; }",
199
+ "references": {
200
+ "Step": {
201
+ "location": "global",
202
+ "id": "global::Step"
203
+ }
204
+ }
205
+ }
206
+ }];
207
+ }
208
+ static get elementRef() { return "host"; }
209
+ static get watchers() {
210
+ return [{
211
+ "propName": "activeStep",
212
+ "methodName": "handleActiveStepChange"
213
+ }, {
214
+ "propName": "steps",
215
+ "methodName": "handleStepsChange"
216
+ }];
217
+ }
218
+ }
219
+ __decorate([
220
+ ConstructibleStyle({ cacheKeyProperty: 'calculatedWidth' }),
221
+ __metadata("design:type", Object)
222
+ ], NanoStepBreadcrumb.prototype, "styles", void 0);
@@ -603,12 +603,12 @@ export class Sticker {
603
603
  this.hasBootstrapped = false;
604
604
  }
605
605
  render() {
606
- return (h(Host, { key: 'f087d54cf3135fa7ba3d089f112157797efedaf2', sticky: !this.isRootSticker && !this.stickToEle && this.isSticky, hide: this.hide && this.isStuck, siblings: this.stuckCounter, index: this.stickerIndex, stuck: this.isStuck && this.isSticky, "placed-bottom": this.positions.includes('bottom'), "placed-top": this.positions.includes('top'), "placed-end": this.positions.includes('end'), "placed-start": this.positions.includes('start'), class: "nano-sticker" }, h("div", { key: 'db32b41390349cec6975dfad25b6b99ddadf5758', class: {
606
+ return (h(Host, { key: 'd0e4e1b0cc7c63db0389ee67b999c30347f7e16b', sticky: !this.isRootSticker && !this.stickToEle && this.isSticky, hide: this.hide && this.isStuck, siblings: this.stuckCounter, index: this.stickerIndex, stuck: this.isStuck && this.isSticky, "placed-bottom": this.positions.includes('bottom'), "placed-top": this.positions.includes('top'), "placed-end": this.positions.includes('end'), "placed-start": this.positions.includes('start'), class: "nano-sticker" }, h("div", { key: '6f9852e2cfeb2e203e5dde6f71e7a042a996dd86', class: {
607
607
  sticker: true,
608
608
  sticky: this.isRootSticker && this.isSticky,
609
609
  stuck: this.isStuck && this.isRootSticker && this.isSticky,
610
610
  hide: this.isRootSticker && this.hide && this.isStuck,
611
- }, ref: (div) => (this.sticker = div) }, h("div", { key: 'b1e54c375552b7460fb6991f1c476bf9f73c997f', class: "sticker-content", ref: (div) => (this.content = div) }, h("slot", { key: 'a2ee69ba9e39d796d832340777f61deb21c2f5d1' })))));
611
+ }, ref: (div) => (this.sticker = div) }, h("div", { key: '1e54d0ebe57b52c95a64acbb6d46f8c9d9778dd3', class: "sticker-content", ref: (div) => (this.content = div) }, h("slot", { key: 'e8359edd6c73c5006ff1c90a91ecafad07e5c915' })))));
612
612
  }
613
613
  static get is() { return "nano-sticker"; }
614
614
  static get encapsulation() { return "shadow"; }
@@ -227,10 +227,10 @@ export class NanoTable {
227
227
  this.cleanUpObservers();
228
228
  }
229
229
  render() {
230
- return (h(Host, { key: '61967ae8d9228be1374d9a4ee4e08b286cd4dd57', class: {
230
+ return (h(Host, { key: '3c45a2880bd20a771bcc682355452312340db56d', class: {
231
231
  'nano-table': true,
232
232
  'nano-table--props-ready': this.propsReady,
233
- } }, this.scrollable && (h("nano-masked-overflow", { key: 'eca1991383ebca49f6032066078f02b62c839d6c', hideScrollbars: false, scrollControls: false, label: this.caption?.textContent || undefined, class: "nano-table__overflow-container" }, h("div", { key: 'f3bcb6830439858393c1eda96d68c2c5ccadd15a', class: "nano-table__overflow" }))), h("slot", { key: '7662741dcb672f75bae03c16b5745ff4946f12f7' })));
233
+ } }, this.scrollable && (h("nano-masked-overflow", { key: '6b29ca4c8c64deae80def0d3958dc25c4d6cd1c0', hideScrollbars: false, scrollControls: false, label: this.caption?.textContent || undefined, class: "nano-table__overflow-container" }, h("div", { key: '83dce90d6e5425b0fd2a2443d0d90b7acfc9c141', class: "nano-table__overflow" }))), h("slot", { key: 'cff62841c17cf20c2ff5872944dbd38bbe438369' })));
234
234
  }
235
235
  static get is() { return "nano-table"; }
236
236
  static get encapsulation() { return "scoped"; }
@@ -24,10 +24,10 @@ export class NanoTabContent {
24
24
  requestAnimationFrame(() => (this.ready = true));
25
25
  }
26
26
  render() {
27
- return (h(Host, { key: 'f182a99dab031220a40b2c5125d3229b8bacca1c', id: this.host.id || this.tabContentId, style: { display: this.active ? 'block' : 'none' }, role: "tabpanel", "aria-hidden": this.active ? 'false' : 'true', class: {
27
+ return (h(Host, { key: '7afee777be86f5847c5ac4c8de6babae3199b01d', id: this.host.id || this.tabContentId, style: { display: this.active ? 'block' : 'none' }, role: "tabpanel", "aria-hidden": this.active ? 'false' : 'true', class: {
28
28
  ready: this.ready,
29
29
  'nano-tab-content': true,
30
- } }, h("div", { key: '47b383859162b6a64518273a9057464de1d37479', part: "base", class: "nano-tab-content" }, h("slot", { key: '3f908fec081c956f9ffd8d7de5e0f45b5e193a8c' }))));
30
+ } }, h("div", { key: 'c316e2c15458eeb9fb6162d81060b81a1132e795', part: "base", class: "nano-tab-content" }, h("slot", { key: '532eedd714e732749cfe9b303b1f4c633e89491c' }))));
31
31
  }
32
32
  static get is() { return "nano-tab-content"; }
33
33
  static get encapsulation() { return "shadow"; }
@@ -51,12 +51,12 @@ export class NanoTab {
51
51
  }
52
52
  };
53
53
  render() {
54
- return (h(Host, { key: '7eca94a330509cbd3c6d232444fbcde422b755a6', id: this.host.id || this.tabId, role: "tab", "aria-disabled": this.disabled ? 'true' : 'false', "aria-selected": this.active ? 'true' : 'false', class: "nano-tab" }, h("div", { key: 'fca6ace8b5fc9c0142fcd04d70cb475323d8ef9d', part: `base${this.active ? ' base--active' : ''}${this.disabled ? ' base--disabled' : ''}${this.closable ? ' base--closable' : ''}`, class: {
54
+ return (h(Host, { key: '67fe232bda16bf41bf1268a1891cfeb6483ebd02', id: this.host.id || this.tabId, role: "tab", "aria-disabled": this.disabled ? 'true' : 'false', "aria-selected": this.active ? 'true' : 'false', class: "nano-tab" }, h("div", { key: '6f07d7d5a89071e094fe3deb19e88ec66a524f3d', part: `base${this.active ? ' base--active' : ''}${this.disabled ? ' base--disabled' : ''}${this.closable ? ' base--closable' : ''}`, class: {
55
55
  tab: true,
56
56
  'tab--active': this.active,
57
57
  'tab--disabled': this.disabled,
58
58
  'tab--closable': this.closable,
59
- } }, h("slot", { key: '3693ff8719b24c34db9018941daab7c840434502', name: "start" }), h("div", { key: 'c792fce22a28175e32f7e0b23a1a62f799016c76', part: "label", ref: (el) => (this.tab = el), tabindex: this.disabled || !this.active ? '-1' : '0', class: "tab__label" }, h("slot", { key: '76b725cd050993d377bf5c7208ce5b7fdf224136' })), h("slot", { key: 'f7bd50a43bb64b67b2ce181bf9215ada4c0ccd12', name: "end" }), this.closable && !this.disabled && (h("nano-icon-button", { key: '96f6bddd3dee12d2e8adeb7a59f98d0cfe8b9c82', label: "Close this tab", iconName: "light/xmark", class: "tab__close-button", onClick: this.handleCloseClick, onKeyDown: this.handleCloseKeydown, part: "close-button" })))));
59
+ } }, h("slot", { key: '4c8dce458c8ae3ed526d4aed7332650be891510c', name: "start" }), h("div", { key: 'e71cced02347ffaa432b5711af54666ac0a6cfd6', part: "label", ref: (el) => (this.tab = el), tabindex: this.disabled || !this.active ? '-1' : '0', class: "tab__label" }, h("slot", { key: '382f7f77b009e3a5cf3af3d3b94b02e639bf2934' })), h("slot", { key: '82a2c81ab573d3c78b7d913f4b7ab146e7c6d5b2', name: "end" }), this.closable && !this.disabled && (h("nano-icon-button", { key: '14e812f9acd5e081a1eba5014f6d4fe4b79371e2', label: "Close this tab", iconName: "light/xmark", class: "tab__close-button", onClick: this.handleCloseClick, onKeyDown: this.handleCloseKeydown, part: "close-button" })))));
60
60
  }
61
61
  static get is() { return "nano-tab"; }
62
62
  static get encapsulation() { return "shadow"; }
@@ -227,10 +227,10 @@ export class Tooltip {
227
227
  this.popover.destroy();
228
228
  }
229
229
  render() {
230
- return (h(Host, { key: '88500e56b7cc79e344604bfb9ffc54f2c7884c16', onKeyDown: this.handleKeyDown, onMouseOver: this.handleMouseOver, onMouseOut: this.handleMouseOut, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.handleClick, class: "nano-tooltip" }, h("slot", { key: '6ff00a2034648eb7cde6bb7e7ba1bc0dcf611238', onSlotchange: this.handleSlotChange }), h("div", { key: 'e278b67db89953ef0a174b50f5aa28e101e8e83d', ref: (el) => (this.tooltipPositioner = el), class: "tooltip-positioner", popover: "manual" }, h("div", { key: '226bc518e38502e1a864c26a265abb01cfdb918e', part: "base", ref: (el) => (this.tooltip = el), class: {
230
+ return (h(Host, { key: '94758bb18228b14884cf2be79228e554de84013f', onKeyDown: this.handleKeyDown, onMouseOver: this.handleMouseOver, onMouseOut: this.handleMouseOut, onBlur: this.handleBlur, onFocus: this.handleFocus, onClick: this.handleClick, class: "nano-tooltip" }, h("slot", { key: '45589386e68d89c21abbb50513678152e8bce9d1', onSlotchange: this.handleSlotChange }), h("div", { key: '6a76c101c35d45458f0a680753a381cc95631b87', ref: (el) => (this.tooltipPositioner = el), class: "tooltip-positioner", popover: "manual" }, h("div", { key: 'd3b2cc9c9018c9a0a5dc4cef256c8b9c568cd0b4', part: "base", ref: (el) => (this.tooltip = el), class: {
231
231
  tooltip: true,
232
232
  'tooltip--open': this.open,
233
- }, role: "tooltip", "aria-hidden": this.open ? 'false' : 'true' }, h("slot", { key: '6245d2904946b690c9c3ea4e902fa5d789473110', name: "content", onSlotchange: () => this.setLabel() }, this.content), h("div", { key: '8ddc4c34d70107ade21b7b53827d3c37e6744d2e', class: "tooltip-arrow", "data-popper-arrow": true })))));
233
+ }, role: "tooltip", "aria-hidden": this.open ? 'false' : 'true' }, h("slot", { key: '1c51cdc6a7ec88107e3290b0b9750198e7176c20', name: "content", onSlotchange: () => this.setLabel() }, this.content), h("div", { key: '00f090eee000e6bba713dc21a1d53c348eb94a76', class: "tooltip-arrow", "data-popper-arrow": true })))));
234
234
  }
235
235
  static get is() { return "nano-tooltip"; }
236
236
  static get encapsulation() { return "shadow"; }
@@ -33,9 +33,8 @@ export function ConstructibleStyle(opts = {}) {
33
33
  opts.cacheKeyProperty = propertyKey;
34
34
  }
35
35
  const { componentWillLoad, render, componentWillRender } = target;
36
- if (!componentWillLoad)
37
- console.warn(`ConstructibleStyle requires you to have a \`componentWillLoad\` lifecycle method in \`${target.constructor.name}\`. Failure to add this function may cause ConstructibleStyle to fail due to StencilJS build optimizations.`);
38
36
  if (supportsConstructibleStylesheets && !Build.isServer) {
37
+ // adds a constructible stylesheet to the component
39
38
  const addStylesheet = (instance) => {
40
39
  if (!instance[opts.cacheKeyProperty] ||
41
40
  (cacheKeys.get(instance) &&
@@ -64,6 +63,7 @@ export function ConstructibleStyle(opts = {}) {
64
63
  };
65
64
  }
66
65
  else {
66
+ // adds a style element to the component
67
67
  target.render = function () {
68
68
  const cssText = typeof this[propertyKey] === 'function'
69
69
  ? this[propertyKey]()
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * Custom elements for Nanopore-Digital Web applications
3
+ */
4
+ const measurePerf = true;
5
+ export function perMark(name, end = false) {
6
+ if (!performance || !measurePerf)
7
+ return;
8
+ if (end) {
9
+ performance?.mark('end' + name);
10
+ performance?.measure(name, 'start' + name, 'end' + name);
11
+ const entries = performance?.getEntriesByName(name);
12
+ console.info(entries[entries.length ? entries.length - 1 : 0]);
13
+ }
14
+ else {
15
+ performance?.mark('start' + name);
16
+ }
17
+ }
@@ -0,0 +1,80 @@
1
+ /*!
2
+ * Custom elements for Nanopore-Digital Web applications
3
+ */
4
+ import { proxyCustomElement, HTMLElement, createEvent } from '@stencil/core/internal/client';
5
+ import { t as transformTag, h } from './renderer.js';
6
+ import { g as getDirectChildren } from './dom.js';
7
+
8
+ const accordionCss = ":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{display:contents}";
9
+
10
+ const NanoAccordion = /*@__PURE__*/ proxyCustomElement(class NanoAccordion extends HTMLElement {
11
+ constructor() {
12
+ super();
13
+ this.__registerHost();
14
+ this.__attachShadow();
15
+ this.nanoToggle = createEvent(this, "nanoToggle", 7);
16
+ }
17
+ indexOpened;
18
+ elementOpened;
19
+ get el() { return this; }
20
+ /** Force one details element to always be open */
21
+ alwaysOpen = false;
22
+ /** Fires when accordion elements toggle */
23
+ nanoToggle;
24
+ onToggleHandler(event) {
25
+ if (event.target?.tagName !== 'NANO-DETAILS')
26
+ return;
27
+ event.stopPropagation();
28
+ const items = getDirectChildren(this.el, transformTag('nano-details'));
29
+ items.forEach((item, i) => {
30
+ if (item !== event.target)
31
+ item.open = false;
32
+ else if (item === event.target) {
33
+ this.indexOpened = i;
34
+ }
35
+ });
36
+ this.nanoToggle.emit({ element: event.target, index: this.indexOpened });
37
+ }
38
+ onClosedHandler(event) {
39
+ event.stopPropagation();
40
+ if (this.alwaysOpen) {
41
+ let foundOpen;
42
+ const items = getDirectChildren(this.el, transformTag('nano-details'));
43
+ items.forEach((item) => {
44
+ if (item !== event.target && item.open) {
45
+ foundOpen = true;
46
+ }
47
+ });
48
+ if (!foundOpen) {
49
+ event.preventDefault();
50
+ return;
51
+ }
52
+ }
53
+ if (this.elementOpened === event.target) {
54
+ this.elementOpened = null;
55
+ this.indexOpened = null;
56
+ this.nanoToggle.emit();
57
+ }
58
+ }
59
+ render() {
60
+ return h("slot", { key: 'a16b340b9312672847ee022b2beb6767fc0dfb86' });
61
+ }
62
+ static get style() { return accordionCss; }
63
+ }, [257, "nano-accordion", {
64
+ "alwaysOpen": [4, "always-open"]
65
+ }, [[0, "nanoOpen", "onToggleHandler"], [0, "nanoClose", "onClosedHandler"]]]);
66
+ function defineCustomElement() {
67
+ if (typeof customElements === "undefined") {
68
+ return;
69
+ }
70
+ const components = ["nano-accordion"];
71
+ components.forEach(tagName => { switch (tagName) {
72
+ case "nano-accordion":
73
+ if (!customElements.get(tagName)) {
74
+ customElements.define(tagName, NanoAccordion);
75
+ }
76
+ break;
77
+ } });
78
+ }
79
+
80
+ export { NanoAccordion as N, defineCustomElement as d };