@tanrei/web 0.0.0-stage → 0.1.0-next.0

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 (781) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +58 -0
  3. package/README.md +9743 -2
  4. package/custom-elements.json +86072 -0
  5. package/dist/THIRD_PARTY_LICENSES.md +136 -0
  6. package/dist/accordion.css +812 -0
  7. package/dist/app-shell.css +493 -0
  8. package/dist/avatar.css +80 -0
  9. package/dist/breadcrumbs.css +511 -0
  10. package/dist/callout.css +65 -0
  11. package/dist/code.css +595 -0
  12. package/dist/components/accordion/accordion.d.ts +197 -0
  13. package/dist/components/accordion/accordion.js +763 -0
  14. package/dist/components/accordion/accordion.js.map +1 -0
  15. package/dist/components/app-bar/app-bar.d.ts +107 -0
  16. package/dist/components/app-bar/app-bar.js +295 -0
  17. package/dist/components/app-bar/app-bar.js.map +1 -0
  18. package/dist/components/app-bar/app-bar.styles.d.ts +12 -0
  19. package/dist/components/app-bar/app-bar.styles.js +223 -0
  20. package/dist/components/app-bar/app-bar.styles.js.map +1 -0
  21. package/dist/components/app-shell/app-shell.d.ts +220 -0
  22. package/dist/components/app-shell/app-shell.js +677 -0
  23. package/dist/components/app-shell/app-shell.js.map +1 -0
  24. package/dist/components/avatar/avatar.d.ts +162 -0
  25. package/dist/components/avatar/avatar.js +390 -0
  26. package/dist/components/avatar/avatar.js.map +1 -0
  27. package/dist/components/avatar/avatar.styles.d.ts +9 -0
  28. package/dist/components/avatar/avatar.styles.js +258 -0
  29. package/dist/components/avatar/avatar.styles.js.map +1 -0
  30. package/dist/components/badge/badge.d.ts +59 -0
  31. package/dist/components/badge/badge.js +176 -0
  32. package/dist/components/badge/badge.js.map +1 -0
  33. package/dist/components/badge/badge.styles.d.ts +1 -0
  34. package/dist/components/badge/badge.styles.js +106 -0
  35. package/dist/components/badge/badge.styles.js.map +1 -0
  36. package/dist/components/bottom-sheet/bottom-sheet.d.ts +207 -0
  37. package/dist/components/bottom-sheet/bottom-sheet.js +724 -0
  38. package/dist/components/bottom-sheet/bottom-sheet.js.map +1 -0
  39. package/dist/components/bottom-sheet/bottom-sheet.styles.d.ts +1 -0
  40. package/dist/components/bottom-sheet/bottom-sheet.styles.js +393 -0
  41. package/dist/components/bottom-sheet/bottom-sheet.styles.js.map +1 -0
  42. package/dist/components/breadcrumbs/breadcrumbs.d.ts +176 -0
  43. package/dist/components/breadcrumbs/breadcrumbs.js +638 -0
  44. package/dist/components/breadcrumbs/breadcrumbs.js.map +1 -0
  45. package/dist/components/breadcrumbs/breadcrumbs.styles.d.ts +1 -0
  46. package/dist/components/breadcrumbs/breadcrumbs.styles.js +225 -0
  47. package/dist/components/breadcrumbs/breadcrumbs.styles.js.map +1 -0
  48. package/dist/components/button/button.d.ts +280 -0
  49. package/dist/components/button/button.js +530 -0
  50. package/dist/components/button/button.js.map +1 -0
  51. package/dist/components/button/button.styles.d.ts +20 -0
  52. package/dist/components/button/button.styles.js +328 -0
  53. package/dist/components/button/button.styles.js.map +1 -0
  54. package/dist/components/button-group/button-group.d.ts +124 -0
  55. package/dist/components/button-group/button-group.js +287 -0
  56. package/dist/components/button-group/button-group.js.map +1 -0
  57. package/dist/components/button-group/button-group.styles.d.ts +1 -0
  58. package/dist/components/button-group/button-group.styles.js +220 -0
  59. package/dist/components/button-group/button-group.styles.js.map +1 -0
  60. package/dist/components/button-with-menu/button-with-menu.d.ts +224 -0
  61. package/dist/components/button-with-menu/button-with-menu.js +635 -0
  62. package/dist/components/button-with-menu/button-with-menu.js.map +1 -0
  63. package/dist/components/button-with-menu/button-with-menu.styles.d.ts +15 -0
  64. package/dist/components/button-with-menu/button-with-menu.styles.js +418 -0
  65. package/dist/components/button-with-menu/button-with-menu.styles.js.map +1 -0
  66. package/dist/components/calendar/calendar.d.ts +380 -0
  67. package/dist/components/calendar/calendar.js +1619 -0
  68. package/dist/components/calendar/calendar.js.map +1 -0
  69. package/dist/components/calendar/calendar.styles.d.ts +11 -0
  70. package/dist/components/calendar/calendar.styles.js +412 -0
  71. package/dist/components/calendar/calendar.styles.js.map +1 -0
  72. package/dist/components/callout/callout.d.ts +157 -0
  73. package/dist/components/callout/callout.js +436 -0
  74. package/dist/components/callout/callout.js.map +1 -0
  75. package/dist/components/callout/callout.styles.d.ts +13 -0
  76. package/dist/components/callout/callout.styles.js +383 -0
  77. package/dist/components/callout/callout.styles.js.map +1 -0
  78. package/dist/components/card/card.d.ts +108 -0
  79. package/dist/components/card/card.js +235 -0
  80. package/dist/components/card/card.js.map +1 -0
  81. package/dist/components/card/card.styles.d.ts +9 -0
  82. package/dist/components/card/card.styles.js +170 -0
  83. package/dist/components/card/card.styles.js.map +1 -0
  84. package/dist/components/carousel/carousel-geometry.d.ts +178 -0
  85. package/dist/components/carousel/carousel-geometry.js +356 -0
  86. package/dist/components/carousel/carousel-geometry.js.map +1 -0
  87. package/dist/components/carousel/carousel.d.ts +401 -0
  88. package/dist/components/carousel/carousel.js +1352 -0
  89. package/dist/components/carousel/carousel.js.map +1 -0
  90. package/dist/components/carousel/carousel.styles.d.ts +4 -0
  91. package/dist/components/carousel/carousel.styles.js +475 -0
  92. package/dist/components/carousel/carousel.styles.js.map +1 -0
  93. package/dist/components/chat-composer/chat-composer.d.ts +482 -0
  94. package/dist/components/chat-composer/chat-composer.js +1374 -0
  95. package/dist/components/chat-composer/chat-composer.js.map +1 -0
  96. package/dist/components/chat-composer/chat-composer.styles.d.ts +9 -0
  97. package/dist/components/chat-composer/chat-composer.styles.js +308 -0
  98. package/dist/components/chat-composer/chat-composer.styles.js.map +1 -0
  99. package/dist/components/checkbox/checkbox.d.ts +135 -0
  100. package/dist/components/checkbox/checkbox.js +296 -0
  101. package/dist/components/checkbox/checkbox.js.map +1 -0
  102. package/dist/components/checkbox/checkbox.styles.d.ts +13 -0
  103. package/dist/components/checkbox/checkbox.styles.js +226 -0
  104. package/dist/components/checkbox/checkbox.styles.js.map +1 -0
  105. package/dist/components/checkbox-group/checkbox-group.d.ts +199 -0
  106. package/dist/components/checkbox-group/checkbox-group.js +500 -0
  107. package/dist/components/checkbox-group/checkbox-group.js.map +1 -0
  108. package/dist/components/chip/chip.d.ts +176 -0
  109. package/dist/components/chip/chip.js +376 -0
  110. package/dist/components/chip/chip.js.map +1 -0
  111. package/dist/components/chip/chip.styles.d.ts +10 -0
  112. package/dist/components/chip/chip.styles.js +465 -0
  113. package/dist/components/chip/chip.styles.js.map +1 -0
  114. package/dist/components/chip-field/chip-field.d.ts +315 -0
  115. package/dist/components/chip-field/chip-field.js +887 -0
  116. package/dist/components/chip-field/chip-field.js.map +1 -0
  117. package/dist/components/code-block/code-block.before.d.ts +2 -0
  118. package/dist/components/code-block/code-block.before.js +193 -0
  119. package/dist/components/code-block/code-block.before.js.map +1 -0
  120. package/dist/components/code-block/code-block.d.ts +268 -0
  121. package/dist/components/code-block/code-block.js +1009 -0
  122. package/dist/components/code-block/code-block.js.map +1 -0
  123. package/dist/components/code-block/code-block.light.d.ts +50 -0
  124. package/dist/components/code-block/code-block.light.js +287 -0
  125. package/dist/components/code-block/code-block.light.js.map +1 -0
  126. package/dist/components/code-block/code-block.lines.d.ts +49 -0
  127. package/dist/components/code-block/code-block.lines.js +75 -0
  128. package/dist/components/code-block/code-block.lines.js.map +1 -0
  129. package/dist/components/code-block/code-block.styles.d.ts +8 -0
  130. package/dist/components/code-block/code-block.styles.js +212 -0
  131. package/dist/components/code-block/code-block.styles.js.map +1 -0
  132. package/dist/components/color-field/color-field.d.ts +120 -0
  133. package/dist/components/color-field/color-field.js +182 -0
  134. package/dist/components/color-field/color-field.js.map +1 -0
  135. package/dist/components/color-input/color-input.d.ts +302 -0
  136. package/dist/components/color-input/color-input.js +748 -0
  137. package/dist/components/color-input/color-input.js.map +1 -0
  138. package/dist/components/color-input/color-input.styles.d.ts +22 -0
  139. package/dist/components/color-input/color-input.styles.js +373 -0
  140. package/dist/components/color-input/color-input.styles.js.map +1 -0
  141. package/dist/components/color-input/color-text.d.ts +48 -0
  142. package/dist/components/color-input/color-text.js +77 -0
  143. package/dist/components/color-input/color-text.js.map +1 -0
  144. package/dist/components/combobox/combobox.d.ts +387 -0
  145. package/dist/components/combobox/combobox.js +1108 -0
  146. package/dist/components/combobox/combobox.js.map +1 -0
  147. package/dist/components/combobox/combobox.styles.d.ts +26 -0
  148. package/dist/components/combobox/combobox.styles.js +497 -0
  149. package/dist/components/combobox/combobox.styles.js.map +1 -0
  150. package/dist/components/combobox-field/combobox-field.d.ts +159 -0
  151. package/dist/components/combobox-field/combobox-field.js +280 -0
  152. package/dist/components/combobox-field/combobox-field.js.map +1 -0
  153. package/dist/components/copy-button/copy-button.d.ts +112 -0
  154. package/dist/components/copy-button/copy-button.js +237 -0
  155. package/dist/components/copy-button/copy-button.js.map +1 -0
  156. package/dist/components/copy-button/copy-button.styles.d.ts +1 -0
  157. package/dist/components/copy-button/copy-button.styles.js +62 -0
  158. package/dist/components/copy-button/copy-button.styles.js.map +1 -0
  159. package/dist/components/date-time-picker/date-time-picker.d.ts +603 -0
  160. package/dist/components/date-time-picker/date-time-picker.js +2537 -0
  161. package/dist/components/date-time-picker/date-time-picker.js.map +1 -0
  162. package/dist/components/date-time-picker/date-time-picker.styles.d.ts +1 -0
  163. package/dist/components/date-time-picker/date-time-picker.styles.js +842 -0
  164. package/dist/components/date-time-picker/date-time-picker.styles.js.map +1 -0
  165. package/dist/components/description-list/description-list.d.ts +133 -0
  166. package/dist/components/description-list/description-list.js +395 -0
  167. package/dist/components/description-list/description-list.js.map +1 -0
  168. package/dist/components/dialog/dialog.d.ts +140 -0
  169. package/dist/components/dialog/dialog.js +440 -0
  170. package/dist/components/dialog/dialog.js.map +1 -0
  171. package/dist/components/dialog/dialog.styles.d.ts +1 -0
  172. package/dist/components/dialog/dialog.styles.js +306 -0
  173. package/dist/components/dialog/dialog.styles.js.map +1 -0
  174. package/dist/components/divider/divider.d.ts +112 -0
  175. package/dist/components/divider/divider.js +331 -0
  176. package/dist/components/divider/divider.js.map +1 -0
  177. package/dist/components/divider/divider.styles.d.ts +6 -0
  178. package/dist/components/divider/divider.styles.js +183 -0
  179. package/dist/components/divider/divider.styles.js.map +1 -0
  180. package/dist/components/embedded-text-input/embedded-text-input.d.ts +246 -0
  181. package/dist/components/embedded-text-input/embedded-text-input.js +673 -0
  182. package/dist/components/embedded-text-input/embedded-text-input.js.map +1 -0
  183. package/dist/components/embedded-text-input/embedded-text-input.styles.d.ts +1 -0
  184. package/dist/components/embedded-text-input/embedded-text-input.styles.js +204 -0
  185. package/dist/components/embedded-text-input/embedded-text-input.styles.js.map +1 -0
  186. package/dist/components/empty-state/empty-state.d.ts +132 -0
  187. package/dist/components/empty-state/empty-state.js +333 -0
  188. package/dist/components/empty-state/empty-state.js.map +1 -0
  189. package/dist/components/empty-state/empty-state.styles.d.ts +11 -0
  190. package/dist/components/empty-state/empty-state.styles.js +218 -0
  191. package/dist/components/empty-state/empty-state.styles.js.map +1 -0
  192. package/dist/components/fab-menu/fab-menu.d.ts +240 -0
  193. package/dist/components/fab-menu/fab-menu.js +605 -0
  194. package/dist/components/fab-menu/fab-menu.js.map +1 -0
  195. package/dist/components/fab-menu/fab-menu.styles.d.ts +21 -0
  196. package/dist/components/fab-menu/fab-menu.styles.js +427 -0
  197. package/dist/components/fab-menu/fab-menu.styles.js.map +1 -0
  198. package/dist/components/field/field.d.ts +165 -0
  199. package/dist/components/field/field.js +399 -0
  200. package/dist/components/field/field.js.map +1 -0
  201. package/dist/components/field/field.styles.d.ts +2 -0
  202. package/dist/components/field/field.styles.js +177 -0
  203. package/dist/components/field/field.styles.js.map +1 -0
  204. package/dist/components/field-group/field-group.d.ts +122 -0
  205. package/dist/components/field-group/field-group.js +246 -0
  206. package/dist/components/field-group/field-group.js.map +1 -0
  207. package/dist/components/field-group/field-group.styles.d.ts +7 -0
  208. package/dist/components/field-group/field-group.styles.js +28 -0
  209. package/dist/components/field-group/field-group.styles.js.map +1 -0
  210. package/dist/components/figure/figure.d.ts +152 -0
  211. package/dist/components/figure/figure.js +435 -0
  212. package/dist/components/figure/figure.js.map +1 -0
  213. package/dist/components/file-item/file-item.d.ts +232 -0
  214. package/dist/components/file-item/file-item.js +665 -0
  215. package/dist/components/file-item/file-item.js.map +1 -0
  216. package/dist/components/file-item/file-item.styles.d.ts +2 -0
  217. package/dist/components/file-item/file-item.styles.js +582 -0
  218. package/dist/components/file-item/file-item.styles.js.map +1 -0
  219. package/dist/components/file-picker/file-picker.d.ts +221 -0
  220. package/dist/components/file-picker/file-picker.js +588 -0
  221. package/dist/components/file-picker/file-picker.js.map +1 -0
  222. package/dist/components/file-picker/file-picker.styles.d.ts +2 -0
  223. package/dist/components/file-picker/file-picker.styles.js +303 -0
  224. package/dist/components/file-picker/file-picker.styles.js.map +1 -0
  225. package/dist/components/file-upload/file-upload.d.ts +353 -0
  226. package/dist/components/file-upload/file-upload.js +939 -0
  227. package/dist/components/file-upload/file-upload.js.map +1 -0
  228. package/dist/components/file-upload/file-upload.styles.d.ts +1 -0
  229. package/dist/components/file-upload/file-upload.styles.js +91 -0
  230. package/dist/components/file-upload/file-upload.styles.js.map +1 -0
  231. package/dist/components/image-preview/image-preview.d.ts +336 -0
  232. package/dist/components/image-preview/image-preview.js +1510 -0
  233. package/dist/components/image-preview/image-preview.js.map +1 -0
  234. package/dist/components/image-preview/image-preview.styles.d.ts +1 -0
  235. package/dist/components/image-preview/image-preview.styles.js +418 -0
  236. package/dist/components/image-preview/image-preview.styles.js.map +1 -0
  237. package/dist/components/keyboard-shortcut/keyboard-shortcut.d.ts +94 -0
  238. package/dist/components/keyboard-shortcut/keyboard-shortcut.js +285 -0
  239. package/dist/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -0
  240. package/dist/components/keyboard-shortcut/keyboard-shortcut.styles.d.ts +11 -0
  241. package/dist/components/keyboard-shortcut/keyboard-shortcut.styles.js +155 -0
  242. package/dist/components/keyboard-shortcut/keyboard-shortcut.styles.js.map +1 -0
  243. package/dist/components/link-card/link-card.d.ts +156 -0
  244. package/dist/components/link-card/link-card.js +713 -0
  245. package/dist/components/link-card/link-card.js.map +1 -0
  246. package/dist/components/list/list.d.ts +430 -0
  247. package/dist/components/list/list.js +1230 -0
  248. package/dist/components/list/list.js.map +1 -0
  249. package/dist/components/list/list.styles.d.ts +3 -0
  250. package/dist/components/list/list.styles.js +334 -0
  251. package/dist/components/list/list.styles.js.map +1 -0
  252. package/dist/components/loading-indicator/loading-indicator.d.ts +83 -0
  253. package/dist/components/loading-indicator/loading-indicator.js +195 -0
  254. package/dist/components/loading-indicator/loading-indicator.js.map +1 -0
  255. package/dist/components/loading-indicator/loading-indicator.styles.d.ts +6 -0
  256. package/dist/components/loading-indicator/loading-indicator.styles.js +124 -0
  257. package/dist/components/loading-indicator/loading-indicator.styles.js.map +1 -0
  258. package/dist/components/main-action-button/main-action-button.d.ts +95 -0
  259. package/dist/components/main-action-button/main-action-button.js +202 -0
  260. package/dist/components/main-action-button/main-action-button.js.map +1 -0
  261. package/dist/components/main-action-button/main-action-button.styles.d.ts +10 -0
  262. package/dist/components/main-action-button/main-action-button.styles.js +285 -0
  263. package/dist/components/main-action-button/main-action-button.styles.js.map +1 -0
  264. package/dist/components/menu/menu.d.ts +813 -0
  265. package/dist/components/menu/menu.js +2061 -0
  266. package/dist/components/menu/menu.js.map +1 -0
  267. package/dist/components/menu/menu.styles.d.ts +18 -0
  268. package/dist/components/menu/menu.styles.js +587 -0
  269. package/dist/components/menu/menu.styles.js.map +1 -0
  270. package/dist/components/menubar/menubar.d.ts +477 -0
  271. package/dist/components/menubar/menubar.js +1677 -0
  272. package/dist/components/menubar/menubar.js.map +1 -0
  273. package/dist/components/menubar/menubar.styles.d.ts +43 -0
  274. package/dist/components/menubar/menubar.styles.js +379 -0
  275. package/dist/components/menubar/menubar.styles.js.map +1 -0
  276. package/dist/components/navigation-bar/navigation-bar.d.ts +239 -0
  277. package/dist/components/navigation-bar/navigation-bar.js +544 -0
  278. package/dist/components/navigation-bar/navigation-bar.js.map +1 -0
  279. package/dist/components/navigation-bar/navigation-bar.styles.d.ts +21 -0
  280. package/dist/components/navigation-bar/navigation-bar.styles.js +320 -0
  281. package/dist/components/navigation-bar/navigation-bar.styles.js.map +1 -0
  282. package/dist/components/navigation-drawer/navigation-drawer.d.ts +627 -0
  283. package/dist/components/navigation-drawer/navigation-drawer.js +1917 -0
  284. package/dist/components/navigation-drawer/navigation-drawer.js.map +1 -0
  285. package/dist/components/navigation-drawer/navigation-drawer.styles.d.ts +40 -0
  286. package/dist/components/navigation-drawer/navigation-drawer.styles.js +934 -0
  287. package/dist/components/navigation-drawer/navigation-drawer.styles.js.map +1 -0
  288. package/dist/components/number-field/number-field.d.ts +147 -0
  289. package/dist/components/number-field/number-field.js +252 -0
  290. package/dist/components/number-field/number-field.js.map +1 -0
  291. package/dist/components/number-input/number-input.d.ts +347 -0
  292. package/dist/components/number-input/number-input.js +929 -0
  293. package/dist/components/number-input/number-input.js.map +1 -0
  294. package/dist/components/number-input/number-input.styles.d.ts +22 -0
  295. package/dist/components/number-input/number-input.styles.js +395 -0
  296. package/dist/components/number-input/number-input.styles.js.map +1 -0
  297. package/dist/components/number-input/number-text.d.ts +74 -0
  298. package/dist/components/number-input/number-text.js +230 -0
  299. package/dist/components/number-input/number-text.js.map +1 -0
  300. package/dist/components/one-time-code-field/one-time-code-field.d.ts +94 -0
  301. package/dist/components/one-time-code-field/one-time-code-field.js +135 -0
  302. package/dist/components/one-time-code-field/one-time-code-field.js.map +1 -0
  303. package/dist/components/one-time-code-input/code-text.d.ts +51 -0
  304. package/dist/components/one-time-code-input/code-text.js +145 -0
  305. package/dist/components/one-time-code-input/code-text.js.map +1 -0
  306. package/dist/components/one-time-code-input/one-time-code-input.d.ts +219 -0
  307. package/dist/components/one-time-code-input/one-time-code-input.js +710 -0
  308. package/dist/components/one-time-code-input/one-time-code-input.js.map +1 -0
  309. package/dist/components/one-time-code-input/one-time-code-input.styles.d.ts +8 -0
  310. package/dist/components/one-time-code-input/one-time-code-input.styles.js +323 -0
  311. package/dist/components/one-time-code-input/one-time-code-input.styles.js.map +1 -0
  312. package/dist/components/option/option.d.ts +51 -0
  313. package/dist/components/option/option.js +75 -0
  314. package/dist/components/option/option.js.map +1 -0
  315. package/dist/components/page-header/page-header.d.ts +97 -0
  316. package/dist/components/page-header/page-header.js +258 -0
  317. package/dist/components/page-header/page-header.js.map +1 -0
  318. package/dist/components/popover/popover.d.ts +217 -0
  319. package/dist/components/popover/popover.js +616 -0
  320. package/dist/components/popover/popover.js.map +1 -0
  321. package/dist/components/popover/popover.styles.d.ts +8 -0
  322. package/dist/components/popover/popover.styles.js +299 -0
  323. package/dist/components/popover/popover.styles.js.map +1 -0
  324. package/dist/components/progress-indicator/progress-indicator.d.ts +76 -0
  325. package/dist/components/progress-indicator/progress-indicator.js +165 -0
  326. package/dist/components/progress-indicator/progress-indicator.js.map +1 -0
  327. package/dist/components/progress-indicator/progress-indicator.styles.d.ts +7 -0
  328. package/dist/components/progress-indicator/progress-indicator.styles.js +271 -0
  329. package/dist/components/progress-indicator/progress-indicator.styles.js.map +1 -0
  330. package/dist/components/radio-button/radio-button.d.ts +149 -0
  331. package/dist/components/radio-button/radio-button.js +370 -0
  332. package/dist/components/radio-button/radio-button.js.map +1 -0
  333. package/dist/components/radio-button/radio-button.styles.d.ts +8 -0
  334. package/dist/components/radio-button/radio-button.styles.js +190 -0
  335. package/dist/components/radio-button/radio-button.styles.js.map +1 -0
  336. package/dist/components/radio-group/radio-group.d.ts +188 -0
  337. package/dist/components/radio-group/radio-group.js +380 -0
  338. package/dist/components/radio-group/radio-group.js.map +1 -0
  339. package/dist/components/search/search.d.ts +569 -0
  340. package/dist/components/search/search.js +1801 -0
  341. package/dist/components/search/search.js.map +1 -0
  342. package/dist/components/search/search.styles.d.ts +15 -0
  343. package/dist/components/search/search.styles.js +967 -0
  344. package/dist/components/search/search.styles.js.map +1 -0
  345. package/dist/components/segmented-button/segmented-button.d.ts +183 -0
  346. package/dist/components/segmented-button/segmented-button.js +483 -0
  347. package/dist/components/segmented-button/segmented-button.js.map +1 -0
  348. package/dist/components/segmented-button/segmented-button.styles.d.ts +19 -0
  349. package/dist/components/segmented-button/segmented-button.styles.js +400 -0
  350. package/dist/components/segmented-button/segmented-button.styles.js.map +1 -0
  351. package/dist/components/select/select.d.ts +259 -0
  352. package/dist/components/select/select.js +702 -0
  353. package/dist/components/select/select.js.map +1 -0
  354. package/dist/components/select/select.styles.d.ts +27 -0
  355. package/dist/components/select/select.styles.js +359 -0
  356. package/dist/components/select/select.styles.js.map +1 -0
  357. package/dist/components/select-field/select-field.d.ts +141 -0
  358. package/dist/components/select-field/select-field.js +234 -0
  359. package/dist/components/select-field/select-field.js.map +1 -0
  360. package/dist/components/side-sheet/side-sheet.d.ts +190 -0
  361. package/dist/components/side-sheet/side-sheet.js +592 -0
  362. package/dist/components/side-sheet/side-sheet.js.map +1 -0
  363. package/dist/components/side-sheet/side-sheet.styles.d.ts +9 -0
  364. package/dist/components/side-sheet/side-sheet.styles.js +352 -0
  365. package/dist/components/side-sheet/side-sheet.styles.js.map +1 -0
  366. package/dist/components/skeleton/skeleton.d.ts +157 -0
  367. package/dist/components/skeleton/skeleton.js +550 -0
  368. package/dist/components/skeleton/skeleton.js.map +1 -0
  369. package/dist/components/slider/slider.d.ts +235 -0
  370. package/dist/components/slider/slider.js +792 -0
  371. package/dist/components/slider/slider.js.map +1 -0
  372. package/dist/components/slider/slider.styles.d.ts +6 -0
  373. package/dist/components/slider/slider.styles.js +492 -0
  374. package/dist/components/slider/slider.styles.js.map +1 -0
  375. package/dist/components/slider-field/slider-field.d.ts +150 -0
  376. package/dist/components/slider-field/slider-field.js +269 -0
  377. package/dist/components/slider-field/slider-field.js.map +1 -0
  378. package/dist/components/snackbar/snackbar.d.ts +237 -0
  379. package/dist/components/snackbar/snackbar.js +607 -0
  380. package/dist/components/snackbar/snackbar.js.map +1 -0
  381. package/dist/components/snackbar/snackbar.styles.d.ts +10 -0
  382. package/dist/components/snackbar/snackbar.styles.js +510 -0
  383. package/dist/components/snackbar/snackbar.styles.js.map +1 -0
  384. package/dist/components/switch/switch.d.ts +161 -0
  385. package/dist/components/switch/switch.js +470 -0
  386. package/dist/components/switch/switch.js.map +1 -0
  387. package/dist/components/switch/switch.styles.d.ts +3 -0
  388. package/dist/components/switch/switch.styles.js +440 -0
  389. package/dist/components/switch/switch.styles.js.map +1 -0
  390. package/dist/components/tab-view/tab-view.d.ts +303 -0
  391. package/dist/components/tab-view/tab-view.js +917 -0
  392. package/dist/components/tab-view/tab-view.js.map +1 -0
  393. package/dist/components/tab-view/tab-view.styles.d.ts +19 -0
  394. package/dist/components/tab-view/tab-view.styles.js +85 -0
  395. package/dist/components/tab-view/tab-view.styles.js.map +1 -0
  396. package/dist/components/table/table.d.ts +386 -0
  397. package/dist/components/table/table.js +1320 -0
  398. package/dist/components/table/table.js.map +1 -0
  399. package/dist/components/table-of-contents/table-of-contents.d.ts +227 -0
  400. package/dist/components/table-of-contents/table-of-contents.js +963 -0
  401. package/dist/components/table-of-contents/table-of-contents.js.map +1 -0
  402. package/dist/components/table-of-contents/table-of-contents.styles.d.ts +1 -0
  403. package/dist/components/table-of-contents/table-of-contents.styles.js +243 -0
  404. package/dist/components/table-of-contents/table-of-contents.styles.js.map +1 -0
  405. package/dist/components/tabs/tabs.d.ts +800 -0
  406. package/dist/components/tabs/tabs.js +2183 -0
  407. package/dist/components/tabs/tabs.js.map +1 -0
  408. package/dist/components/tabs/tabs.styles.d.ts +47 -0
  409. package/dist/components/tabs/tabs.styles.js +595 -0
  410. package/dist/components/tabs/tabs.styles.js.map +1 -0
  411. package/dist/components/tag/tag.d.ts +77 -0
  412. package/dist/components/tag/tag.js +143 -0
  413. package/dist/components/tag/tag.js.map +1 -0
  414. package/dist/components/tag/tag.styles.d.ts +13 -0
  415. package/dist/components/tag/tag.styles.js +215 -0
  416. package/dist/components/tag/tag.styles.js.map +1 -0
  417. package/dist/components/tag-group/tag-group.d.ts +110 -0
  418. package/dist/components/tag-group/tag-group.js +298 -0
  419. package/dist/components/tag-group/tag-group.js.map +1 -0
  420. package/dist/components/tag-group/tag-group.styles.d.ts +8 -0
  421. package/dist/components/tag-group/tag-group.styles.js +66 -0
  422. package/dist/components/tag-group/tag-group.styles.js.map +1 -0
  423. package/dist/components/text-field/text-field.d.ts +159 -0
  424. package/dist/components/text-field/text-field.js +272 -0
  425. package/dist/components/text-field/text-field.js.map +1 -0
  426. package/dist/components/text-input/text-input-segments.d.ts +93 -0
  427. package/dist/components/text-input/text-input-segments.js +233 -0
  428. package/dist/components/text-input/text-input-segments.js.map +1 -0
  429. package/dist/components/text-input/text-input.d.ts +683 -0
  430. package/dist/components/text-input/text-input.js +2120 -0
  431. package/dist/components/text-input/text-input.js.map +1 -0
  432. package/dist/components/text-input/text-input.styles.d.ts +27 -0
  433. package/dist/components/text-input/text-input.styles.js +1071 -0
  434. package/dist/components/text-input/text-input.styles.js.map +1 -0
  435. package/dist/components/toolbar/toolbar.d.ts +123 -0
  436. package/dist/components/toolbar/toolbar.js +336 -0
  437. package/dist/components/toolbar/toolbar.js.map +1 -0
  438. package/dist/components/toolbar/toolbar.styles.d.ts +10 -0
  439. package/dist/components/toolbar/toolbar.styles.js +156 -0
  440. package/dist/components/toolbar/toolbar.styles.js.map +1 -0
  441. package/dist/components/tooltip/tooltip-placement.d.ts +22 -0
  442. package/dist/components/tooltip/tooltip-placement.js +15 -0
  443. package/dist/components/tooltip/tooltip-placement.js.map +1 -0
  444. package/dist/components/tooltip/tooltip.d.ts +267 -0
  445. package/dist/components/tooltip/tooltip.js +902 -0
  446. package/dist/components/tooltip/tooltip.js.map +1 -0
  447. package/dist/components/tooltip/tooltip.styles.d.ts +7 -0
  448. package/dist/components/tooltip/tooltip.styles.js +240 -0
  449. package/dist/components/tooltip/tooltip.styles.js.map +1 -0
  450. package/dist/components/tree-view/tree-view.d.ts +264 -0
  451. package/dist/components/tree-view/tree-view.js +1228 -0
  452. package/dist/components/tree-view/tree-view.js.map +1 -0
  453. package/dist/description-list.css +337 -0
  454. package/dist/empty-state.css +70 -0
  455. package/dist/figure.css +381 -0
  456. package/dist/generated/icon-sets.d.ts +9 -0
  457. package/dist/generated/icon-sets.js +18 -0
  458. package/dist/generated/icon-sets.js.map +1 -0
  459. package/dist/generated/words.d.ts +161 -0
  460. package/dist/generated/words.js +91 -0
  461. package/dist/generated/words.js.map +1 -0
  462. package/dist/highlight/grammars/css.d.ts +3 -0
  463. package/dist/highlight/grammars/css.js +56 -0
  464. package/dist/highlight/grammars/css.js.map +1 -0
  465. package/dist/highlight/grammars/dart.d.ts +3 -0
  466. package/dist/highlight/grammars/dart.js +53 -0
  467. package/dist/highlight/grammars/dart.js.map +1 -0
  468. package/dist/highlight/grammars/javascript.d.ts +4 -0
  469. package/dist/highlight/grammars/javascript.js +119 -0
  470. package/dist/highlight/grammars/javascript.js.map +1 -0
  471. package/dist/highlight/grammars/json.d.ts +3 -0
  472. package/dist/highlight/grammars/json.js +19 -0
  473. package/dist/highlight/grammars/json.js.map +1 -0
  474. package/dist/highlight/grammars/kotlin.d.ts +3 -0
  475. package/dist/highlight/grammars/kotlin.js +46 -0
  476. package/dist/highlight/grammars/kotlin.js.map +1 -0
  477. package/dist/highlight/grammars/markup.d.ts +3 -0
  478. package/dist/highlight/grammars/markup.js +45 -0
  479. package/dist/highlight/grammars/markup.js.map +1 -0
  480. package/dist/highlight/grammars/shared.d.ts +25 -0
  481. package/dist/highlight/grammars/shared.js +37 -0
  482. package/dist/highlight/grammars/shared.js.map +1 -0
  483. package/dist/highlight/grammars/shell.d.ts +3 -0
  484. package/dist/highlight/grammars/shell.js +48 -0
  485. package/dist/highlight/grammars/shell.js.map +1 -0
  486. package/dist/highlight/grammars/swift.d.ts +3 -0
  487. package/dist/highlight/grammars/swift.js +46 -0
  488. package/dist/highlight/grammars/swift.js.map +1 -0
  489. package/dist/highlight/grammars/typescript.d.ts +2 -0
  490. package/dist/highlight/grammars/typescript.js +5 -0
  491. package/dist/highlight/grammars/typescript.js.map +1 -0
  492. package/dist/highlight/index.d.ts +104 -0
  493. package/dist/highlight/index.js +331 -0
  494. package/dist/highlight/index.js.map +1 -0
  495. package/dist/icons.css +107 -0
  496. package/dist/icons.d.ts +2 -0
  497. package/dist/icons.js +10 -0
  498. package/dist/icons.js.map +1 -0
  499. package/dist/index.d.ts +85 -0
  500. package/dist/index.js +100 -0
  501. package/dist/index.js.map +1 -0
  502. package/dist/link-card.css +678 -0
  503. package/dist/link.css +728 -0
  504. package/dist/link.d.ts +21 -0
  505. package/dist/link.js +594 -0
  506. package/dist/link.js.map +1 -0
  507. package/dist/links/index.d.ts +136 -0
  508. package/dist/links/index.js +404 -0
  509. package/dist/links/index.js.map +1 -0
  510. package/dist/links/node/address.js +154 -0
  511. package/dist/links/node/cli.js +102 -0
  512. package/dist/links/node/fetcher.js +267 -0
  513. package/dist/links/node/head.js +278 -0
  514. package/dist/links/node/index.d.ts +164 -0
  515. package/dist/links/node/index.js +26 -0
  516. package/dist/links/node/links.js +275 -0
  517. package/dist/links/node/lock.js +86 -0
  518. package/dist/links/node/mark.js +71 -0
  519. package/dist/links/node/options.js +120 -0
  520. package/dist/links/node/pictures.js +265 -0
  521. package/dist/links/node/refresh.js +28 -0
  522. package/dist/menu.css +97 -0
  523. package/dist/menubar.css +69 -0
  524. package/dist/page-header.css +324 -0
  525. package/dist/pagination.css +410 -0
  526. package/dist/pagination.d.ts +6 -0
  527. package/dist/pagination.js +256 -0
  528. package/dist/pagination.js.map +1 -0
  529. package/dist/primitives/actions.d.ts +75 -0
  530. package/dist/primitives/actions.js +142 -0
  531. package/dist/primitives/actions.js.map +1 -0
  532. package/dist/primitives/after-click.d.ts +8 -0
  533. package/dist/primitives/after-click.js +21 -0
  534. package/dist/primitives/after-click.js.map +1 -0
  535. package/dist/primitives/anchored.d.ts +134 -0
  536. package/dist/primitives/anchored.js +425 -0
  537. package/dist/primitives/anchored.js.map +1 -0
  538. package/dist/primitives/arc.d.ts +13 -0
  539. package/dist/primitives/arc.js +49 -0
  540. package/dist/primitives/arc.js.map +1 -0
  541. package/dist/primitives/arrow.d.ts +47 -0
  542. package/dist/primitives/arrow.js +159 -0
  543. package/dist/primitives/arrow.js.map +1 -0
  544. package/dist/primitives/auto-height.d.ts +56 -0
  545. package/dist/primitives/auto-height.js +150 -0
  546. package/dist/primitives/auto-height.js.map +1 -0
  547. package/dist/primitives/autofocus.d.ts +11 -0
  548. package/dist/primitives/autofocus.js +26 -0
  549. package/dist/primitives/autofocus.js.map +1 -0
  550. package/dist/primitives/availability.d.ts +32 -0
  551. package/dist/primitives/availability.js +122 -0
  552. package/dist/primitives/availability.js.map +1 -0
  553. package/dist/primitives/axes.d.ts +45 -0
  554. package/dist/primitives/axes.js +72 -0
  555. package/dist/primitives/axes.js.map +1 -0
  556. package/dist/primitives/behavior.d.ts +14 -0
  557. package/dist/primitives/behavior.js +19 -0
  558. package/dist/primitives/behavior.js.map +1 -0
  559. package/dist/primitives/calendar-date.d.ts +79 -0
  560. package/dist/primitives/calendar-date.js +135 -0
  561. package/dist/primitives/calendar-date.js.map +1 -0
  562. package/dist/primitives/composed.d.ts +144 -0
  563. package/dist/primitives/composed.js +303 -0
  564. package/dist/primitives/composed.js.map +1 -0
  565. package/dist/primitives/default-button.d.ts +49 -0
  566. package/dist/primitives/default-button.js +270 -0
  567. package/dist/primitives/default-button.js.map +1 -0
  568. package/dist/primitives/description.d.ts +18 -0
  569. package/dist/primitives/description.js +18 -0
  570. package/dist/primitives/description.js.map +1 -0
  571. package/dist/primitives/destination.d.ts +259 -0
  572. package/dist/primitives/destination.js +651 -0
  573. package/dist/primitives/destination.js.map +1 -0
  574. package/dist/primitives/direction.d.ts +23 -0
  575. package/dist/primitives/direction.js +90 -0
  576. package/dist/primitives/direction.js.map +1 -0
  577. package/dist/primitives/disabled-while-focused.d.ts +46 -0
  578. package/dist/primitives/disabled-while-focused.js +126 -0
  579. package/dist/primitives/disabled-while-focused.js.map +1 -0
  580. package/dist/primitives/disclosure.d.ts +9 -0
  581. package/dist/primitives/disclosure.js +15 -0
  582. package/dist/primitives/disclosure.js.map +1 -0
  583. package/dist/primitives/dismiss.d.ts +88 -0
  584. package/dist/primitives/dismiss.js +232 -0
  585. package/dist/primitives/dismiss.js.map +1 -0
  586. package/dist/primitives/field-frame.d.ts +166 -0
  587. package/dist/primitives/field-frame.js +358 -0
  588. package/dist/primitives/field-frame.js.map +1 -0
  589. package/dist/primitives/field-group-frame.d.ts +59 -0
  590. package/dist/primitives/field-group-frame.js +174 -0
  591. package/dist/primitives/field-group-frame.js.map +1 -0
  592. package/dist/primitives/field-trigger.d.ts +117 -0
  593. package/dist/primitives/field-trigger.js +387 -0
  594. package/dist/primitives/field-trigger.js.map +1 -0
  595. package/dist/primitives/field.d.ts +186 -0
  596. package/dist/primitives/field.js +349 -0
  597. package/dist/primitives/field.js.map +1 -0
  598. package/dist/primitives/file-format.d.ts +23 -0
  599. package/dist/primitives/file-format.js +185 -0
  600. package/dist/primitives/file-format.js.map +1 -0
  601. package/dist/primitives/file-item-holder.d.ts +45 -0
  602. package/dist/primitives/file-item-holder.js +39 -0
  603. package/dist/primitives/file-item-holder.js.map +1 -0
  604. package/dist/primitives/focus-order.d.ts +11 -0
  605. package/dist/primitives/focus-order.js +11 -0
  606. package/dist/primitives/focus-order.js.map +1 -0
  607. package/dist/primitives/focus-ring.d.ts +76 -0
  608. package/dist/primitives/focus-ring.js +230 -0
  609. package/dist/primitives/focus-ring.js.map +1 -0
  610. package/dist/primitives/follow.d.ts +65 -0
  611. package/dist/primitives/follow.js +283 -0
  612. package/dist/primitives/follow.js.map +1 -0
  613. package/dist/primitives/form-disabled.d.ts +20 -0
  614. package/dist/primitives/form-disabled.js +46 -0
  615. package/dist/primitives/form-disabled.js.map +1 -0
  616. package/dist/primitives/form-says.d.ts +33 -0
  617. package/dist/primitives/form-says.js +45 -0
  618. package/dist/primitives/form-says.js.map +1 -0
  619. package/dist/primitives/forward.d.ts +13 -0
  620. package/dist/primitives/forward.js +28 -0
  621. package/dist/primitives/forward.js.map +1 -0
  622. package/dist/primitives/glyph-mirror.d.ts +77 -0
  623. package/dist/primitives/glyph-mirror.js +211 -0
  624. package/dist/primitives/glyph-mirror.js.map +1 -0
  625. package/dist/primitives/glyph-pending.d.ts +17 -0
  626. package/dist/primitives/glyph-pending.js +91 -0
  627. package/dist/primitives/glyph-pending.js.map +1 -0
  628. package/dist/primitives/glyph.d.ts +53 -0
  629. package/dist/primitives/glyph.js +161 -0
  630. package/dist/primitives/glyph.js.map +1 -0
  631. package/dist/primitives/group-item.d.ts +128 -0
  632. package/dist/primitives/group-item.js +334 -0
  633. package/dist/primitives/group-item.js.map +1 -0
  634. package/dist/primitives/hidden.d.ts +2 -0
  635. package/dist/primitives/hidden.js +23 -0
  636. package/dist/primitives/hidden.js.map +1 -0
  637. package/dist/primitives/host-aria.d.ts +8 -0
  638. package/dist/primitives/host-aria.js +18 -0
  639. package/dist/primitives/host-aria.js.map +1 -0
  640. package/dist/primitives/index.d.ts +59 -0
  641. package/dist/primitives/index.js +189 -0
  642. package/dist/primitives/index.js.map +1 -0
  643. package/dist/primitives/indicator-drag.d.ts +90 -0
  644. package/dist/primitives/indicator-drag.js +207 -0
  645. package/dist/primitives/indicator-drag.js.map +1 -0
  646. package/dist/primitives/interactive.d.ts +13 -0
  647. package/dist/primitives/interactive.js +67 -0
  648. package/dist/primitives/interactive.js.map +1 -0
  649. package/dist/primitives/item-row.d.ts +34 -0
  650. package/dist/primitives/item-row.js +76 -0
  651. package/dist/primitives/item-row.js.map +1 -0
  652. package/dist/primitives/item-update.d.ts +2 -0
  653. package/dist/primitives/item-update.js +12 -0
  654. package/dist/primitives/item-update.js.map +1 -0
  655. package/dist/primitives/kept-length.d.ts +34 -0
  656. package/dist/primitives/kept-length.js +154 -0
  657. package/dist/primitives/kept-length.js.map +1 -0
  658. package/dist/primitives/keyboard-convention.d.ts +30 -0
  659. package/dist/primitives/keyboard-convention.js +88 -0
  660. package/dist/primitives/keyboard-convention.js.map +1 -0
  661. package/dist/primitives/label-lines.d.ts +12 -0
  662. package/dist/primitives/label-lines.js +34 -0
  663. package/dist/primitives/label-lines.js.map +1 -0
  664. package/dist/primitives/layout-scale.d.ts +18 -0
  665. package/dist/primitives/layout-scale.js +35 -0
  666. package/dist/primitives/layout-scale.js.map +1 -0
  667. package/dist/primitives/link.d.ts +147 -0
  668. package/dist/primitives/link.js +204 -0
  669. package/dist/primitives/link.js.map +1 -0
  670. package/dist/primitives/locale-date.d.ts +132 -0
  671. package/dist/primitives/locale-date.js +508 -0
  672. package/dist/primitives/locale-date.js.map +1 -0
  673. package/dist/primitives/missing-value.d.ts +16 -0
  674. package/dist/primitives/missing-value.js +31 -0
  675. package/dist/primitives/missing-value.js.map +1 -0
  676. package/dist/primitives/modal.d.ts +38 -0
  677. package/dist/primitives/modal.js +175 -0
  678. package/dist/primitives/modal.js.map +1 -0
  679. package/dist/primitives/native-text.d.ts +51 -0
  680. package/dist/primitives/native-text.js +77 -0
  681. package/dist/primitives/native-text.js.map +1 -0
  682. package/dist/primitives/natural-height.d.ts +21 -0
  683. package/dist/primitives/natural-height.js +36 -0
  684. package/dist/primitives/natural-height.js.map +1 -0
  685. package/dist/primitives/option-list.d.ts +314 -0
  686. package/dist/primitives/option-list.js +1098 -0
  687. package/dist/primitives/option-list.js.map +1 -0
  688. package/dist/primitives/overlay-focus.d.ts +48 -0
  689. package/dist/primitives/overlay-focus.js +152 -0
  690. package/dist/primitives/overlay-focus.js.map +1 -0
  691. package/dist/primitives/placement.d.ts +131 -0
  692. package/dist/primitives/placement.js +144 -0
  693. package/dist/primitives/placement.js.map +1 -0
  694. package/dist/primitives/places.d.ts +44 -0
  695. package/dist/primitives/places.js +98 -0
  696. package/dist/primitives/places.js.map +1 -0
  697. package/dist/primitives/press.d.ts +90 -0
  698. package/dist/primitives/press.js +153 -0
  699. package/dist/primitives/press.js.map +1 -0
  700. package/dist/primitives/report.d.ts +17 -0
  701. package/dist/primitives/report.js +34 -0
  702. package/dist/primitives/report.js.map +1 -0
  703. package/dist/primitives/ripple.d.ts +40 -0
  704. package/dist/primitives/ripple.js +70 -0
  705. package/dist/primitives/ripple.js.map +1 -0
  706. package/dist/primitives/roving.d.ts +41 -0
  707. package/dist/primitives/roving.js +71 -0
  708. package/dist/primitives/roving.js.map +1 -0
  709. package/dist/primitives/selection.d.ts +134 -0
  710. package/dist/primitives/selection.js +287 -0
  711. package/dist/primitives/selection.js.map +1 -0
  712. package/dist/primitives/separation.d.ts +28 -0
  713. package/dist/primitives/separation.js +96 -0
  714. package/dist/primitives/separation.js.map +1 -0
  715. package/dist/primitives/shared-choice.d.ts +33 -0
  716. package/dist/primitives/shared-choice.js +110 -0
  717. package/dist/primitives/shared-choice.js.map +1 -0
  718. package/dist/primitives/sheet.d.ts +63 -0
  719. package/dist/primitives/sheet.js +139 -0
  720. package/dist/primitives/sheet.js.map +1 -0
  721. package/dist/primitives/sheets.d.ts +8 -0
  722. package/dist/primitives/sheets.js +96 -0
  723. package/dist/primitives/sheets.js.map +1 -0
  724. package/dist/primitives/states.d.ts +33 -0
  725. package/dist/primitives/states.js +30 -0
  726. package/dist/primitives/states.js.map +1 -0
  727. package/dist/primitives/system-watch.d.ts +9 -0
  728. package/dist/primitives/system-watch.js +29 -0
  729. package/dist/primitives/system-watch.js.map +1 -0
  730. package/dist/primitives/target.d.ts +21 -0
  731. package/dist/primitives/target.js +79 -0
  732. package/dist/primitives/target.js.map +1 -0
  733. package/dist/primitives/values.d.ts +6 -0
  734. package/dist/primitives/values.js +22 -0
  735. package/dist/primitives/values.js.map +1 -0
  736. package/dist/primitives/visibility.d.ts +12 -0
  737. package/dist/primitives/visibility.js +50 -0
  738. package/dist/primitives/visibility.js.map +1 -0
  739. package/dist/primitives/words.d.ts +81 -0
  740. package/dist/primitives/words.js +236 -0
  741. package/dist/primitives/words.js.map +1 -0
  742. package/dist/prose.css +1917 -0
  743. package/dist/registry.d.ts +182 -0
  744. package/dist/registry.js +2 -0
  745. package/dist/registry.js.map +1 -0
  746. package/dist/shape.css +21 -0
  747. package/dist/skeleton.css +428 -0
  748. package/dist/steps.css +231 -0
  749. package/dist/steps.d.ts +6 -0
  750. package/dist/steps.js +156 -0
  751. package/dist/steps.js.map +1 -0
  752. package/dist/styles/icons.d.ts +62 -0
  753. package/dist/styles/icons.js +237 -0
  754. package/dist/styles/icons.js.map +1 -0
  755. package/dist/styles/product-text.d.ts +66 -0
  756. package/dist/styles/product-text.js +114 -0
  757. package/dist/styles/product-text.js.map +1 -0
  758. package/dist/styles/registered-properties.d.ts +6 -0
  759. package/dist/styles/registered-properties.js +68 -0
  760. package/dist/styles/registered-properties.js.map +1 -0
  761. package/dist/styles/shape.d.ts +59 -0
  762. package/dist/styles/shape.js +95 -0
  763. package/dist/styles/shape.js.map +1 -0
  764. package/dist/systems/cupertino.css +8793 -0
  765. package/dist/systems/m3-expressive-like.css +8786 -0
  766. package/dist/systems/m3-like.css +8748 -0
  767. package/dist/table-of-contents.css +482 -0
  768. package/dist/table.css +902 -0
  769. package/dist/tanrei.bundle.js +26644 -0
  770. package/dist/tanrei.bundle.js.map +7 -0
  771. package/dist/text.css +104 -0
  772. package/dist/timeline.css +410 -0
  773. package/dist/timeline.d.ts +6 -0
  774. package/dist/timeline.js +176 -0
  775. package/dist/timeline.js.map +1 -0
  776. package/dist/tokens.css +8801 -0
  777. package/dist/tree-view.css +797 -0
  778. package/dist/words.d.ts +2 -0
  779. package/dist/words.js +6 -0
  780. package/dist/words.js.map +1 -0
  781. package/package.json +132 -3
@@ -0,0 +1,939 @@
1
+ import { html, nothing } from 'lit';
2
+ import { repeat } from 'lit/directives/repeat.js';
3
+ import { AvailabilityController, FieldControlController, FieldProviderController, GROUP_PLACE, WordsController, missingValueMessage, report } from '../../primitives/index.js';
4
+ import { ComposedElement, composedHost, exported, forward } from '../../primitives/composed.js';
5
+ import { acceptConverter } from '../../primitives/file-format.js';
6
+ import { FILE_ITEM_TAKE_FOCUS, FILE_ITEM_UPDATE, giveFileItem } from '../../primitives/file-item-holder.js';
7
+ import { takeFormDisabled } from '../../primitives/form-disabled.js';
8
+ import { hiddenHost } from '../../primitives/hidden.js';
9
+ import { TanreiFileItem } from '../file-item/file-item.js';
10
+ import { TanreiFilePicker } from '../file-picker/file-picker.js';
11
+ import { styles } from './file-upload.styles.js';
12
+ import { disabledWaitsWhileFocused } from '../../primitives/disabled-while-focused.js';
13
+ const ITEM = 'tanrei-file-item';
14
+ const ITEM_FORMS = ['row', 'tile'];
15
+ const STATUSES = ['pending', 'uploading', 'done', 'error'];
16
+ const ROWS = ['own', 'given'];
17
+ /** FUP-56: the props that are the file picker's, given to it unchanged. Its `maxFiles` and its `label` are never set, and its `selectionText` is the file upload's to fill (FUP-2). */
18
+ const PICKER = ['layout', 'multiple', 'accept', 'maxSize', 'constraintsText', 'dropText', 'disabled', 'error', 'required'];
19
+ /**
20
+ * FUP-58: what the file upload gives every file item, and the file item's attribute a product's own item would say it
21
+ * with. A file item writes two of them on itself when the product said nothing (it reflects `form` and `fit`, each
22
+ * with its first value): that value on an item is therefore not the product's word, and is the third entry.
23
+ */
24
+ const SHARED = [
25
+ ['itemForm', 'form', 'row'],
26
+ ['itemPreview', 'preview'],
27
+ ['itemFit', 'fit', 'cover'],
28
+ ['itemNameHidden', 'name-hidden'],
29
+ ['itemWidth', 'width'],
30
+ ['itemHeight', 'height'],
31
+ ['removeLabel', 'remove-label'],
32
+ ['retryLabel', 'retry-label'],
33
+ ];
34
+ /** W4: each member's documented parts, from the member's own list. A made file item's leave under the prefix `item-`: three of them have a file picker's name. */
35
+ const PICKER_PARTS = exported(TanreiFilePicker);
36
+ const ITEM_PARTS = exported(TanreiFileItem, Object.fromEntries(TanreiFileItem.parts.map((part) => [part, { as: `item-${part}` }])));
37
+ /** FIT-18: what lies between two rows of the file upload's column — its own distance, given to each file item through the internal channel. */
38
+ const BETWEEN = 'var(--tanrei-comp-file-upload-list-item-gap)';
39
+ /** FUP-38: a limit of the files it holds is a number above zero; anything else sets none. */
40
+ const limit = (value) => (typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : null);
41
+ /** Whether focus is on `element` or inside it, its shadow root included. */
42
+ function holdsFocus(element) {
43
+ const active = element.getRootNode().activeElement;
44
+ return !!active && element.contains(active);
45
+ }
46
+ /** FUP-53: each reason's key of the product's words, and the attribute of the instance's own sentence. */
47
+ const REASONS = [
48
+ ['type', 'fileTypeErrorText', 'type-error-text'],
49
+ ['size', 'fileSizeErrorText', 'size-error-text'],
50
+ ['count', 'fileCountErrorText', 'count-error-text'],
51
+ ];
52
+ /** A row's prop, from the element or — before it is defined — from its attribute. */
53
+ const rowText = (row, prop, attribute) => String(row[prop] ?? row.getAttribute(attribute) ?? '');
54
+ const rowStatus = (row) => {
55
+ const status = rowText(row, 'status', 'status');
56
+ return STATUSES.includes(status) ? status : 'pending';
57
+ };
58
+ /** FUP-30: focus into a row that stays — its remove action, or its body where it has none and that is pressable. */
59
+ const takeFocus = (row) => {
60
+ if (row[FILE_ITEM_TAKE_FOCUS])
61
+ return row[FILE_ITEM_TAKE_FOCUS]();
62
+ row.focus();
63
+ return holdsFocus(row);
64
+ };
65
+ /**
66
+ * Lets people choose files and shows what was chosen. Built from a File picker (`<tanrei-file-picker>`) — the trigger,
67
+ * the drop area, the limits in words, the judging of a choice — and File items (`<tanrei-file-item>`), one for each
68
+ * file, in a column of rows or a strip of tiles; it adds the state that ties them: which files are kept, the room that
69
+ * is left, one form for all its items, one message for many changes, where focus goes after a removal, and the form's
70
+ * value. **It never uploads**: it opens no connection and reads no byte of a file (FUP-7).
71
+ *
72
+ * Contract: specs/file-upload.spec.json. Who holds the rows is `rows`, and the product says which.
73
+ *
74
+ * `rows="own"`, the default: the element keeps the chosen files and makes a file item for each itself, so a plain form
75
+ * works by placing it — `<form><tanrei-file-upload name="attachments" multiple remove-label="…"><tanrei-button
76
+ * slot="trigger" variant="outlined">Choose files</tanrei-button></tanrei-file-upload></form>`. With `multiple` a second
77
+ * choice adds and `max-files` counts the files kept; without it a file that passes takes the place of the one kept. The
78
+ * same file (name, size, time of last change) is kept once. A refused file is a failed row with the product's sentence
79
+ * for its reason (`type-error-text`, `size-error-text`, `count-error-text`, else `setWords`), is not kept, and leaves
80
+ * when it is removed, when files next arrive or on `clear()`. The remove action removes. `files` reads the kept files,
81
+ * `add(files)` hands files over and answers with the refused, `clear()` empties, and `formatSize` — a property — writes
82
+ * a row's size; without it none is drawn. A kept file's row shows no status and no progress: the element sends nothing.
83
+ *
84
+ * `rows="given"`: the rows are `<tanrei-file-item>` children the product adds on `select` and removes on a row's
85
+ * `remove`, each with its status, progress and error; the element adds, changes and removes none and keeps no file —
86
+ * for a product that sends files itself.
87
+ *
88
+ * Every row is of one form: `item-form` (`row`, `tile`), `item-preview`, `item-fit`, `item-name-hidden`, `item-width`,
89
+ * `item-height`, with `remove-label`, `retry-label` and `disabled`, are given to every file item it holds — the
90
+ * product's own included — through an internal channel; a product's item that says one of them otherwise is drawn as
91
+ * the file upload says. The picture of an image row is made and released by its file item, never by this element.
92
+ *
93
+ * `select` carries the files that passed `accept`, `max-size` and the count and found room, `reject` the ones that did
94
+ * not, each with a reason that is a name and not words (`type`, `size`, `count`); while `rows` is `own`, `change` then
95
+ * carries the files now kept. None is emitted for what the product did itself (`add()`, `clear()`, a reset, a change
96
+ * of `rows`). The file picker's own two events do not leave the element.
97
+ *
98
+ * Form-associated: under its `name` it submits the kept files, in order — or, while `rows` is `given`, the `file` of
99
+ * every row that has one; it is invalid for its form while `required` and there is none. A reset empties the kept
100
+ * files and changes nothing of the product's rows. Nothing is restored with a page. Inside a `<tanrei-field>` it takes
101
+ * the field's label, help, error, requirement and `disabled`.
102
+ *
103
+ * One level down, the same by hand: a `<tanrei-file-picker>` and `<tanrei-file-item>`s the product arranges — for a
104
+ * list of its own, an order people change (file items in the rows of a List), or files that are only shown.
105
+ *
106
+ * Without script, and until the element is defined, the trigger is a button that opens nothing and no row is drawn: a
107
+ * page that must take files where script does not run writes a native `<input type="file">` in its own form.
108
+ *
109
+ * @tag tanrei-file-upload
110
+ * @slot trigger - => tanrei-file-picker
111
+ * @slot icon - => tanrei-file-picker
112
+ * @slot - While `rows` is `given`: the rows, `<tanrei-file-item>` children, in order. Anything else is not drawn, and while `rows` is `own` nothing here is.
113
+ * @csspart file-picker - The part that chooses: the `<tanrei-file-picker>` it is built from.
114
+ * @csspart file-item - A row the file upload made itself, while `rows` is `own`: a `<tanrei-file-item>` it is built from.
115
+ * @csspart list - The list of rows.
116
+ * @exportparts tanrei-file-picker
117
+ * @exportparts tanrei-file-item container: item-container, media: item-media, icon: item-icon, preview: item-preview, headline: item-headline, supporting-text: item-supporting-text, status-icon: item-status-icon, progress: item-progress, action: item-action
118
+ * @attr {string} form - The id of the form the file upload belongs to, where it stands outside it: the platform's own attribute, which then wins over a form around it. The `form` property is read-only and returns the form element.
119
+ * @fires select - Files were chosen or dropped, passed and found room. Once per choice; `detail.files` is a `File[]` — while `rows` is `own`, the files newly kept. Bubbles.
120
+ * @fires reject - Files of one choice or one drop were refused. Once, after `select` where both happen; `detail.files` is `{ file, reason }[]`, the reason `type`, `size` or `count`. Bubbles.
121
+ * @fires change - While `rows` is `own`: the kept files changed by what a person did — a choice or a drop that kept or replaced a file, or a kept file's row removed. Once, after `select` and `reject`; `detail.files` is the `File[]` now kept. Bubbles. Never for `add()`, `clear()`, a reset or a change of `rows`.
122
+ */
123
+ export class TanreiFileUpload extends ComposedElement {
124
+ static { this.styles = [composedHost, hiddenHost, styles]; }
125
+ /** FUP-31, FUP-49: the one control the form meets. Its members stand in its shadow root, or are the product's own children, and take no part in a form. */
126
+ static { this.formAssociated = true; }
127
+ /**
128
+ * Its parts, once: the two members, its own list, and what each member exports.
129
+ *
130
+ * @internal
131
+ */
132
+ static { this.parts = ['file-picker', 'file-item', 'list', ...PICKER_PARTS.names, ...ITEM_PARTS.names]; }
133
+ static { this.properties = {
134
+ layout: { type: String, reflect: true },
135
+ multiple: { type: Boolean, reflect: true },
136
+ accept: { converter: acceptConverter },
137
+ maxSize: { type: Number, attribute: 'max-size' },
138
+ maxFiles: { type: Number, attribute: 'max-files' },
139
+ label: { type: String },
140
+ constraintsText: { type: String, attribute: 'constraints-text' },
141
+ dropText: { type: String, attribute: 'drop-text' },
142
+ emptyText: { type: String, attribute: 'empty-text' },
143
+ itemForm: { type: String, attribute: 'item-form', reflect: true },
144
+ itemPreview: { type: Boolean, attribute: 'item-preview', reflect: true },
145
+ itemFit: { type: String, attribute: 'item-fit', reflect: true },
146
+ itemNameHidden: { type: Boolean, attribute: 'item-name-hidden', reflect: true },
147
+ itemWidth: { type: Number, attribute: 'item-width' },
148
+ itemHeight: { type: Number, attribute: 'item-height' },
149
+ removeLabel: { type: String, attribute: 'remove-label' },
150
+ retryLabel: { type: String, attribute: 'retry-label' },
151
+ announcement: { type: String },
152
+ disabled: { type: Boolean, reflect: true },
153
+ error: { type: Boolean, reflect: true },
154
+ required: { type: Boolean, reflect: true },
155
+ name: { type: String, reflect: true },
156
+ rows: { type: String, reflect: true },
157
+ typeErrorText: { type: String, attribute: 'type-error-text' },
158
+ sizeErrorText: { type: String, attribute: 'size-error-text' },
159
+ countErrorText: { type: String, attribute: 'count-error-text' },
160
+ formatSize: { attribute: false },
161
+ count: { state: true },
162
+ formDisabled: { state: true },
163
+ }; }
164
+ constructor() {
165
+ super();
166
+ this.availability = new AvailabilityController(this, 'file-upload');
167
+ /** @from tanrei-file-picker.layout */
168
+ this.layout = 'button';
169
+ /** @from tanrei-file-picker.multiple */
170
+ this.multiple = false;
171
+ /** @from tanrei-file-picker.accept */
172
+ this.accept = [];
173
+ /** @from tanrei-file-picker.maxSize */
174
+ this.maxSize = null;
175
+ /** The most files while `multiple` is set (`max-files`): the files it keeps while `rows` is `own`, the rows the list holds while it is `given`. Files chosen beyond the room that is left are refused. Null sets no limit. It is the file upload's own and is not given to its file picker. */
176
+ this.maxFiles = null;
177
+ /** The accessible name of the group ("Attachments"): the file picker and the list together. Not drawn. Leave it empty inside a Field, whose label names the group. */
178
+ this.label = '';
179
+ /** @from tanrei-file-picker.constraintsText */
180
+ this.constraintsText = '';
181
+ /** @from tanrei-file-picker.dropText */
182
+ this.dropText = '';
183
+ /** What is shown beside the trigger while no file is chosen, in the button layout (`empty-text`): this instance's words, else the product's (`setWords({ noFileText })`); with neither, nothing is drawn. Given to the file picker as its `selectionText` while the list holds no row. */
184
+ this.emptyText = '';
185
+ /** @from tanrei-file-item.form */
186
+ this.itemForm = 'row';
187
+ /** @from tanrei-file-item.preview */
188
+ this.itemPreview = false;
189
+ /** @from tanrei-file-item.fit */
190
+ this.itemFit = 'cover';
191
+ /** @from tanrei-file-item.nameHidden */
192
+ this.itemNameHidden = false;
193
+ /** @from tanrei-file-item.width */
194
+ this.itemWidth = null;
195
+ /** @from tanrei-file-item.height */
196
+ this.itemHeight = null;
197
+ /** @from tanrei-file-item.removeLabel */
198
+ this.removeLabel = '';
199
+ /** @from tanrei-file-item.retryLabel */
200
+ this.retryLabel = '';
201
+ /** A message assistive technology hears through the one live region when the product sets or changes it ("3 files added"). Not drawn. Set in the same turn as rows change, it is said in their place. */
202
+ this.announcement = '';
203
+ /** @from tanrei-file-picker.disabled */
204
+ this.disabled = false;
205
+ /** @from tanrei-file-picker.error */
206
+ this.error = false;
207
+ /** @from tanrei-file-picker.required */
208
+ this.required = false;
209
+ /** The name the files are submitted under: the kept files while `rows` is `own`, the files of the product's rows while it is `given`. Web only. A product that sends files itself gives none. */
210
+ this.name = '';
211
+ /** Who holds the rows. `own` (the default, and every value it does not know): the file upload keeps the files a person chose and makes a file item for each itself — choose, see the list, remove, submit, with nothing written. `given`: the product gives the rows as `<tanrei-file-item>` children and the file upload keeps no file — for a product that sends files itself and shows each one's status. Never guessed from the children. */
212
+ this.rows = 'own';
213
+ /** While `rows` is `own`: the sentence on the row of a file refused for its kind (`type-error-text`): this instance's words, else the product's (`setWords({ fileTypeErrorText })`); with neither the row is drawn without a sentence. */
214
+ this.typeErrorText = '';
215
+ /** While `rows` is `own`: the sentence on the row of a file refused for its size (`size-error-text`): this instance's words, else the product's (`setWords({ fileSizeErrorText })`). */
216
+ this.sizeErrorText = '';
217
+ /** While `rows` is `own`: the sentence on the row of a file refused because no more files fit (`count-error-text`): this instance's words, else the product's (`setWords({ fileCountErrorText })`). */
218
+ this.countErrorText = '';
219
+ /** While `rows` is `own`: the product's function from a size in bytes to the text a kept or refused file's row draws ("820 KB"). A property, never an attribute. Null draws no size: the file upload writes none itself. */
220
+ this.formatSize = null;
221
+ /** FUP-17: how many rows the product gave. */
222
+ this.count = 0;
223
+ /** Set by an ancestor `<fieldset disabled>`, or by the element's own attribute (the element's `formDisabledCallback`). */
224
+ this.formDisabled = false;
225
+ this.hostNameSentence = 'FUP-24';
226
+ this.internals = this.attachInternals();
227
+ /** FUP-27: the product's words, read where the instance gives none (src/primitives/words.ts). */
228
+ this.words = new WordsController(this);
229
+ /**
230
+ * FUP-32: what a field around the file upload gives it (src/primitives/field.ts): the name while it has no `label`
231
+ * of its own, the description, the invalid, required and disabled states. The file upload is the field's one control.
232
+ */
233
+ this.field = new FieldControlController(this, { errorCondition: true, named: () => !!this.label.trim() });
234
+ /**
235
+ * FUP-24, FUP-32, FPK-21: the file picker inside asks as every control does, and the file upload answers it in a
236
+ * field's place — the description a field gave and the three states, and no name, so that the file picker exposes no
237
+ * second group inside this one. The file picker gives its trigger the rest.
238
+ */
239
+ this.provider = new FieldProviderController(this, {
240
+ controls: () => (this.picker ? [this.picker] : []),
241
+ state: () => this.given,
242
+ plain: () => null,
243
+ });
244
+ /** FUP-57: what the file picker's two events of one arrival said, until the arrival is over. */
245
+ this.arriving = { accepted: [], refused: [] };
246
+ /** FUP-26: what each row last said; a row not in it is new. */
247
+ this.known = new Map();
248
+ /** FUP-26: the file upload has been presented: a row that comes now was added. */
249
+ this.presented = false;
250
+ /** FUP-26: the product's own sentence, set or changed in this turn. */
251
+ this.own = null;
252
+ /** FUP-43: the files it keeps while `rows` is `own`, in order — handles, never read (FUP-51). */
253
+ this.kept = [];
254
+ /** FUP-45: the files the last arrival refused, in the order they were refused. Not kept. */
255
+ this.refused = [];
256
+ /** FUP-50: what the arrivals of this turn say: each newly kept file's name, each refused file's name and sentence. */
257
+ this.arrived = [];
258
+ /** FUP-52: the next message says no row: the rows that are there came by a change of `rows`. */
259
+ this.hush = false;
260
+ /** FUP-52: a row that leaves because `rows` changed held focus. */
261
+ this.leavingHeld = false;
262
+ /** FUP-30: the row focus is on, as the last `focusin` said, and the rows as they stood. */
263
+ this.held = null;
264
+ this.stood = [];
265
+ /** FUP-17, FUP-30: a row that comes or goes is drawn at once; a row that left with focus on it hands focus on. */
266
+ this.children$ = typeof MutationObserver === 'undefined' ? null : new MutationObserver((records) => this.rowsChanged(records));
267
+ // ─── Arrivals (FUP-9, FUP-43, FUP-57) ─────────────────────────────────────────────────────────────────────────
268
+ /** FUP-57: the file picker's `select` is answered here and does not reach the product as it is. */
269
+ this.onPickerSelect = (event) => {
270
+ event.stopPropagation();
271
+ this.arriving.accepted = [...event.detail.files];
272
+ };
273
+ /** FUP-57: the file picker's `reject` is answered here and does not reach the product as it is. */
274
+ this.onPickerReject = (event) => {
275
+ event.stopPropagation();
276
+ this.arriving.refused = [...event.detail.files];
277
+ };
278
+ /** FUP-57: the arrival is over — one choice is told once, by the file upload's own events. */
279
+ this.onArrival = (event) => {
280
+ event.stopPropagation();
281
+ const { accepted, refused } = this.arriving;
282
+ this.arriving = { accepted: [], refused: [] };
283
+ if (this.isDisabled || (!accepted.length && !refused.length))
284
+ return;
285
+ if (this.keeps)
286
+ this.arrive(accepted, refused, true);
287
+ else
288
+ this.handOver(accepted, refused);
289
+ };
290
+ // ─── The rows (FUP-17, FUP-26, FUP-30, FUP-58) ────────────────────────────────────────────────────────────────
291
+ this.onRowUpdate = (event) => {
292
+ if (event.target === this)
293
+ return;
294
+ event.stopPropagation();
295
+ // A file item it made itself is drawn from what the file upload holds: nothing of it is read back.
296
+ if (this.keeps)
297
+ return;
298
+ this.readRows();
299
+ };
300
+ this.onFocusIn = (event) => {
301
+ this.held = this.rowOf(event.target);
302
+ };
303
+ /**
304
+ * Focus that leaves a row which is still here has gone elsewhere, by the person's doing. An engine that says so
305
+ * while it removes the focused element says it of a row that is no longer here: that one is the observer's to follow.
306
+ */
307
+ this.onFocusOut = (event) => {
308
+ const row = this.rowOf(event.target);
309
+ if (!row)
310
+ return;
311
+ queueMicrotask(() => {
312
+ if (this.held === row && row.parentNode === this && !holdsFocus(row))
313
+ this.held = null;
314
+ });
315
+ };
316
+ this.addEventListener(FILE_ITEM_UPDATE, this.onRowUpdate);
317
+ this.addEventListener('focusin', this.onFocusIn);
318
+ this.addEventListener('focusout', this.onFocusOut);
319
+ }
320
+ // ─── What it reads ────────────────────────────────────────────────────────────────────────────────────────────
321
+ /** FUP-56: its one file picker, once rendered. */
322
+ get picker() {
323
+ return this.renderRoot?.querySelector('tanrei-file-picker') ?? null;
324
+ }
325
+ /** Disabled by its own `disabled`, by a field around it, or by its form (FUP-28, FUP-31, FUP-32). */
326
+ get isDisabled() {
327
+ return this.disabled || this.field.disabled || this.formDisabled;
328
+ }
329
+ get isError() {
330
+ return this.error || this.field.invalid;
331
+ }
332
+ get isRequired() {
333
+ return this.required || this.field.required;
334
+ }
335
+ /** The one element in the trigger slot; the first where there are several (FPK-5). */
336
+ get trigger() {
337
+ return this.querySelector(':scope > [slot="trigger"]');
338
+ }
339
+ /** W7: the file upload's first stop — the product's own trigger. */
340
+ get control() {
341
+ return this.trigger;
342
+ }
343
+ /** FUP-42: it keeps the chosen files and makes their rows itself — `own`, and every value it does not know. */
344
+ get keeps() {
345
+ return this.rows !== 'given';
346
+ }
347
+ /** FUP-17: the rows the product gave, in the order it gave them — and none while `rows` is `own` (FUP-42). */
348
+ get givenRows() {
349
+ return this.keeps ? [] : this.itemChildren;
350
+ }
351
+ /** The `tanrei-file-item` children the product wrote, whatever `rows` says. */
352
+ get itemChildren() {
353
+ return [...this.children].filter((child) => child.localName === ITEM && !child.slot);
354
+ }
355
+ /** FUP-17: how many rows the list holds — the product's, or the file upload's own: the kept files, then the refused. */
356
+ get rowCount() {
357
+ return this.keeps ? this.kept.length + this.refused.length : this.count;
358
+ }
359
+ /** FUP-24: the group's name — its own label, else the field's. */
360
+ get groupName() {
361
+ return this.field.name(this.label);
362
+ }
363
+ /** FUP-2: what the file picker is given as its selectionText — emptyText (the prop, else the product's words) while the list holds no row, and nothing while it holds one. */
364
+ get shownEmptyText() {
365
+ return this.rowCount === 0 ? this.words.get('noFileText', this.emptyText) : '';
366
+ }
367
+ /** FUP-17: the form of every row; one it does not know is a column of rows. */
368
+ get shownForm() {
369
+ return this.itemForm === 'tile' ? 'tile' : 'row';
370
+ }
371
+ /**
372
+ * FUP-24, FUP-32: what the file picker is given, as a field gives its control: no name; the description a field
373
+ * gave the file upload, which the file picker puts last in its trigger's description; and the three states.
374
+ */
375
+ get given() {
376
+ return {
377
+ label: '',
378
+ description: this.field.description(),
379
+ invalid: this.isError,
380
+ required: this.isRequired,
381
+ requiredText: this.field.state?.requiredText ?? '',
382
+ disabled: this.isDisabled,
383
+ };
384
+ }
385
+ /** FUP-58, FUP-25, FUP-28: what every file item it holds is given, through the internal channel and through no prop of the item's. */
386
+ get gift() {
387
+ return {
388
+ form: this.shownForm,
389
+ preview: this.itemPreview,
390
+ fit: this.itemFit,
391
+ nameHidden: this.itemNameHidden,
392
+ width: this.itemWidth,
393
+ height: this.itemHeight,
394
+ removeLabel: this.removeLabel,
395
+ retryLabel: this.retryLabel,
396
+ disabled: this.isDisabled,
397
+ listItem: true,
398
+ made: this.keeps,
399
+ between: BETWEEN,
400
+ };
401
+ }
402
+ // ─── Form (FUP-31, FUP-49) ────────────────────────────────────────────────────────────────────────────────────
403
+ /** The form it belongs to, if any. */
404
+ get form() {
405
+ return this.internals.form;
406
+ }
407
+ /** The native constraint validity: `valueMissing` while it is required and no row carries a file. */
408
+ get validity() {
409
+ return this.internals.validity;
410
+ }
411
+ get validationMessage() {
412
+ return this.internals.validationMessage;
413
+ }
414
+ get willValidate() {
415
+ return this.internals.willValidate;
416
+ }
417
+ checkValidity() {
418
+ return this.internals.checkValidity();
419
+ }
420
+ reportValidity() {
421
+ return this.internals.reportValidity();
422
+ }
423
+ /** FUP-31: while `rows` is `given` a reset changes nothing — the rows are the product's to clear. FUP-49: while it is `own` a reset does what `clear()` does, and emits nothing. */
424
+ formResetCallback() {
425
+ if (this.keeps)
426
+ this.clear();
427
+ this.syncForm();
428
+ }
429
+ /** FUP-31, FUP-49: nothing is restored: no state is kept with the form — a handle does not outlast the page. */
430
+ formStateRestoreCallback() {
431
+ this.syncForm();
432
+ }
433
+ formDisabledCallback(disabled) {
434
+ takeFormDisabled(this, disabled, (value) => (this.formDisabled = value));
435
+ }
436
+ /**
437
+ * FUP-31: one entry per row that has a file, under the name, in the order of the rows — and nothing while disabled or
438
+ * unnamed. FUP-49: while `rows` is `own`, one entry per kept file, never a refused one, and no empty entry.
439
+ */
440
+ syncForm() {
441
+ const files = this.keeps ? this.kept.map((row) => row.file) : this.givenRows.map((row) => row.file).filter((file) => typeof File !== 'undefined' && file instanceof File);
442
+ if (this.isDisabled || !this.name)
443
+ this.internals.setFormValue(null, null);
444
+ else {
445
+ const data = new FormData();
446
+ for (const file of files)
447
+ data.append(this.name, file, file.name);
448
+ this.internals.setFormValue(data, null);
449
+ }
450
+ if (!this.isRequired || files.length > 0) {
451
+ this.internals.setValidity({});
452
+ return;
453
+ }
454
+ // The browser's own words for a required file input left empty; the bubble stands at the trigger.
455
+ const message = missingValueMessage('file', { errorText: '', requiredText: this.field.state?.requiredText ?? '', label: this.groupName });
456
+ try {
457
+ this.internals.setValidity({ valueMissing: true }, message, this.trigger ?? undefined);
458
+ }
459
+ catch {
460
+ this.internals.setValidity({ valueMissing: true }, message);
461
+ }
462
+ }
463
+ /** FUP-9: the room that is left, which the file picker cannot know — `held` is what the list already holds. Answers with the files that found room and the ones that did not. */
464
+ room(files, held) {
465
+ const maxFiles = this.multiple ? limit(this.maxFiles) : null;
466
+ if (maxFiles === null)
467
+ return { passed: [...files], refused: [] };
468
+ const left = Math.max(0, maxFiles - held);
469
+ return { passed: files.slice(0, left), refused: files.slice(left).map((file) => ({ file, reason: 'count' })) };
470
+ }
471
+ /**
472
+ * FUP-9: while `rows` is `given` nothing is kept: `select` with the files that also found room, then `reject` with
473
+ * the files the file picker refused, in the order it refused them, and then those refused for want of room. No row
474
+ * is added: the product adds one for each file it keeps.
475
+ */
476
+ handOver(accepted, refusedByPicker) {
477
+ const { passed, refused: full } = this.room(accepted, this.givenRows.length);
478
+ const refused = [...refusedByPicker, ...full];
479
+ if (passed.length)
480
+ this.dispatchEvent(new CustomEvent('select', { bubbles: true, detail: { files: passed } }));
481
+ if (refused.length)
482
+ this.dispatchEvent(new CustomEvent('reject', { bubbles: true, detail: { files: refused } }));
483
+ }
484
+ // ─── Its own files (FUP-42 to FUP-55) ─────────────────────────────────────────────────────────────────────────
485
+ /**
486
+ * FUP-48: the files it keeps while `rows` is `own`, in order, as the browser's own `File` handles: a new array on
487
+ * each read, so changing it changes nothing that is kept. Never a refused file. Empty while `rows` is `given`.
488
+ */
489
+ get files() {
490
+ return this.keeps ? this.kept.map((row) => row.file) : [];
491
+ }
492
+ /**
493
+ * FUP-48: hands files over, as a product does that takes them elsewhere — a drop target of its own, a paste. They
494
+ * are judged by its file picker (FPK-31) and are then an arrival (FUP-43): kept or refused, drawn and announced as a
495
+ * choice is, with no event. Answers with the refused files and their reasons. Works while disabled. While `rows` is
496
+ * `given` it does nothing and is reported.
497
+ */
498
+ add(files) {
499
+ if (!this.keeps) {
500
+ report(this, 'FUP-42', 'add() was called while rows is "given": the file upload keeps no file there, and nothing was added; give the product\'s rows their files, or leave rows as "own"');
501
+ return [];
502
+ }
503
+ const given = typeof File === 'undefined' ? [] : [...(files ?? [])].filter((file) => file instanceof File);
504
+ if (!given.length)
505
+ return [];
506
+ // The file picker judges by what the file upload says now, also where it has not rendered since a prop changed —
507
+ // and, before the file upload was first drawn, a file picker that is nowhere judges by the same props.
508
+ const picker = this.picker ?? document.createElement('tanrei-file-picker');
509
+ picker.multiple = this.multiple;
510
+ picker.accept = this.accept;
511
+ picker.maxSize = this.maxSize;
512
+ const { accepted, refused } = picker.judge(given);
513
+ return this.arrive(accepted, refused, false);
514
+ }
515
+ /**
516
+ * FUP-48: lets go of every file it keeps and removes every row, kept and refused. Emits nothing and announces
517
+ * nothing; focus that was on a row goes to the trigger. Works while disabled. Does nothing while `rows` is `given`.
518
+ */
519
+ clear() {
520
+ if (!this.keeps || (!this.kept.length && !this.refused.length))
521
+ return;
522
+ this.redraw(() => {
523
+ this.kept = [];
524
+ this.refused = [];
525
+ });
526
+ this.arrived = [];
527
+ }
528
+ /** FUP-43: the same file — the same name, size and time of last change, as the browser reports them. */
529
+ static same(a, b) {
530
+ return a === b || (a.name === b.name && a.size === b.size && a.lastModified === b.lastModified);
531
+ }
532
+ /**
533
+ * FUP-43: files arrived while `rows` is `own` — chosen or dropped (`person`), or handed over by `add()` — and were
534
+ * judged by the file picker. The rows of what an earlier arrival refused leave; a file that passed and that it
535
+ * already keeps, and a second copy within the arrival, is passed over; the rest is judged for the room that is left.
536
+ * With `multiple` what found room is kept after the others; without it a file that passed takes the place of them
537
+ * all, and a refused choice replaces nothing. Then the rows are drawn, and — for what a person did — `select`,
538
+ * `reject` and `change` are emitted, in that order (FUP-47). One message says it (FUP-50).
539
+ */
540
+ arrive(accepted, refusedByPicker, person) {
541
+ const before = this.kept;
542
+ const fresh = [];
543
+ for (const file of accepted) {
544
+ if (before.some((row) => TanreiFileUpload.same(row.file, file)) || fresh.some((other) => TanreiFileUpload.same(other, file)))
545
+ continue;
546
+ fresh.push(file);
547
+ }
548
+ const { passed, refused: full } = this.room(fresh, before.length);
549
+ // FUP-45: first the files the file picker refused, in the order it refused them, then those refused for want of room.
550
+ const refused = [...refusedByPicker, ...full];
551
+ const added = passed.map((file) => ({ file, reason: null }));
552
+ const kept = !added.length ? before : this.multiple ? [...before, ...added] : added;
553
+ this.redraw(() => {
554
+ this.kept = kept;
555
+ this.refused = refused.map(({ file, reason }) => ({ file, reason }));
556
+ });
557
+ // FUP-50: the names are the files' own and the sentences the product's.
558
+ this.arrived.push(...passed.map((file) => file.name), ...refused.map(({ file, reason }) => [file.name, this.sentence(reason)].map((text) => text.trim()).filter(Boolean).join(', ')));
559
+ if (this.arrived.length)
560
+ this.changed();
561
+ if (person) {
562
+ if (passed.length)
563
+ this.dispatchEvent(new CustomEvent('select', { bubbles: true, detail: { files: passed } }));
564
+ if (refused.length)
565
+ this.dispatchEvent(new CustomEvent('reject', { bubbles: true, detail: { files: refused } }));
566
+ if (kept !== before)
567
+ this.emitChange();
568
+ }
569
+ return refused.map(({ file, reason }) => ({ file, reason }));
570
+ }
571
+ /** FUP-47: the files it keeps changed by what a person did. Never while disabled (FUP-54). */
572
+ emitChange() {
573
+ if (this.isDisabled)
574
+ return;
575
+ this.dispatchEvent(new CustomEvent('change', { bubbles: true, detail: { files: this.files } }));
576
+ }
577
+ /** FUP-53: the product's sentence for a reason — the instance's prop, else the product's words, else nothing. */
578
+ sentence(reason) {
579
+ return reason === 'type' ? this.words.get('fileTypeErrorText', this.typeErrorText) : reason === 'size' ? this.words.get('fileSizeErrorText', this.sizeErrorText) : this.words.get('fileCountErrorText', this.countErrorText);
580
+ }
581
+ /** FUP-44: a file's size in the product's words: what its function writes, and nothing where it gave none. */
582
+ sizeOf(file) {
583
+ if (typeof this.formatSize !== 'function')
584
+ return '';
585
+ try {
586
+ const text = this.formatSize(file.size);
587
+ return typeof text === 'string' ? text : text === null || text === undefined ? '' : String(text);
588
+ }
589
+ catch (error) {
590
+ report(this, 'FUP-44', `formatSize threw for a size of ${file.size} bytes, so no size is drawn: ${String(error)}`);
591
+ return '';
592
+ }
593
+ }
594
+ /** The file items it made itself, in the order they are drawn. */
595
+ get ownRows() {
596
+ return [...(this.renderRoot?.querySelectorAll(`.rows > ${ITEM}`) ?? [])];
597
+ }
598
+ /**
599
+ * Changes the two lists and draws the rows at once, so that what is emitted afterwards is emitted with the rows as
600
+ * they will be (FUP-47). FUP-30: where a row that leaves held focus, focus goes to the remove action of the row that
601
+ * followed it, or of the one before where none follows, or to the trigger where no row is left.
602
+ */
603
+ redraw(change) {
604
+ const order = [...this.kept, ...this.refused];
605
+ const active = this.shadowRoot?.activeElement ?? null;
606
+ const at = active ? this.ownRows.indexOf(active) : -1;
607
+ const held = at >= 0 ? order[at] : undefined;
608
+ change();
609
+ this.requestUpdate();
610
+ // Before it was first drawn there is no row to draw at once, and none that held focus.
611
+ if (!this.hasUpdated || !this.isConnected)
612
+ return;
613
+ this.performUpdate();
614
+ const now = [...this.kept, ...this.refused];
615
+ if (!held || now.includes(held))
616
+ return;
617
+ const next = [...order.slice(at + 1), ...order.slice(0, at).reverse()].find((row) => now.includes(row));
618
+ const target = next ? this.ownRows[now.indexOf(next)] : undefined;
619
+ if (!target || !takeFocus(target))
620
+ this.trigger?.focus();
621
+ }
622
+ /**
623
+ * FUP-46: the remove action of a row it made itself removes the row, at once. A kept file is let go and `change` is
624
+ * emitted; a refused one leaves and nothing is emitted. The file item's own `remove` does not leave the shadow root:
625
+ * it is an event of the product's rows.
626
+ */
627
+ removeOwn(event, row) {
628
+ event.stopPropagation();
629
+ if (this.isDisabled)
630
+ return;
631
+ const kept = this.kept.includes(row);
632
+ this.redraw(() => {
633
+ this.kept = this.kept.filter((each) => each !== row);
634
+ this.refused = this.refused.filter((each) => each !== row);
635
+ });
636
+ if (kept)
637
+ this.emitChange();
638
+ }
639
+ /** The rows were added to, removed from, or changed: drawn at once, said once, submitted as they are now. */
640
+ readRows() {
641
+ const rows = this.givenRows;
642
+ this.count = rows.length;
643
+ this.tellRows(rows);
644
+ this.syncForm();
645
+ this.changed();
646
+ }
647
+ /** FUP-58, FUP-25, FUP-28: each file item it holds is given the one form of the rows, the two action names, whether it is disabled and that it is an item of a list; one it holds no longer is told so. */
648
+ tellRows(rows = this.keeps ? this.ownRows : this.givenRows) {
649
+ const gift = this.gift;
650
+ for (const row of rows)
651
+ giveFileItem(row, gift);
652
+ // FUP-42: a child the file upload does not draw is given nothing.
653
+ if (this.keeps)
654
+ for (const row of this.itemChildren)
655
+ giveFileItem(row, null);
656
+ }
657
+ rowsChanged(records) {
658
+ // A file item that left is the product's alone again: what it was given goes back.
659
+ for (const record of records)
660
+ for (const node of record.removedNodes)
661
+ if (node instanceof Element && node.localName === ITEM)
662
+ giveFileItem(node, null);
663
+ const before = this.stood;
664
+ this.readRows();
665
+ this.stood = this.givenRows;
666
+ this.afterLeave(before, records);
667
+ }
668
+ rowOf(target) {
669
+ return target instanceof Element && target.parentNode === this && target.localName === ITEM ? target : null;
670
+ }
671
+ /**
672
+ * FUP-30: a row left while focus was on one of its stops, and focus is now nowhere: it goes to the remove action of
673
+ * the row that followed, or of the one before where none follows — to its body where it has no remove action and
674
+ * that is pressable, and on to the next such row otherwise — or to the trigger where no row is left. Where the
675
+ * product has already put focus somewhere, nothing is done.
676
+ */
677
+ afterLeave(before, records) {
678
+ const held = this.held;
679
+ if (!held || !records.some((record) => [...record.removedNodes].includes(held)))
680
+ return;
681
+ const active = this.ownerDocument.activeElement;
682
+ const nowhere = !active || active === this.ownerDocument.body || active === this.ownerDocument.documentElement;
683
+ if (!nowhere || held.parentNode === this) {
684
+ if (!holdsFocus(held))
685
+ this.held = null;
686
+ return;
687
+ }
688
+ this.held = null;
689
+ const here = (node) => node.parentNode === this;
690
+ const at = before.indexOf(held);
691
+ const now = this.givenRows;
692
+ // The rows that were its neighbours, the following ones first. A product that writes the whole list again leaves
693
+ // none of them: the row that now stands where it stood is the one that followed it.
694
+ const order = before.some(here) ? [...before.slice(at + 1), ...before.slice(0, Math.max(0, at)).reverse()] : [...now.slice(Math.max(0, at)), ...now.slice(0, Math.max(0, at)).reverse()];
695
+ const candidates = order.filter(here);
696
+ const take = () => {
697
+ for (const candidate of candidates.filter(here)) {
698
+ if (takeFocus(candidate)) {
699
+ this.held = candidate;
700
+ return true;
701
+ }
702
+ }
703
+ return false;
704
+ };
705
+ if (take())
706
+ return;
707
+ // A row that was written a moment ago has no action to focus until it has rendered.
708
+ const pending = candidates.map((candidate) => candidate.updateComplete).filter((promise) => !!promise);
709
+ void Promise.all(pending).then(() => {
710
+ const current = this.ownerDocument.activeElement;
711
+ if (!this.isConnected || (current && current !== this.ownerDocument.body && current !== this.ownerDocument.documentElement))
712
+ return;
713
+ if (!take())
714
+ this.trigger?.focus();
715
+ });
716
+ }
717
+ /** FUP-26: something that may be said changed in this turn; everything of one turn is one message. */
718
+ changed() {
719
+ if (this.turn !== undefined)
720
+ return;
721
+ this.turn = setTimeout(() => {
722
+ this.turn = undefined;
723
+ this.say();
724
+ }, 0);
725
+ }
726
+ /**
727
+ * FUP-26: the one message of a turn — the product's own sentence alone where it set one, else each row that was
728
+ * added, finished or failed, in the order of the rows, in the product's words: the name, then the status or the error.
729
+ * Rows that were there when the file upload was first presented say nothing.
730
+ */
731
+ say() {
732
+ const hush = this.hush;
733
+ this.hush = false;
734
+ // FUP-50: while `rows` is `own`, what arrived in this turn — nothing of it before the file upload was first presented.
735
+ const messages = this.keeps && this.presented ? this.arrived : [];
736
+ this.arrived = [];
737
+ const rows = this.givenRows;
738
+ for (const row of rows) {
739
+ const now = { status: rowStatus(row), errorText: rowText(row, 'errorText', 'error-text') };
740
+ const was = this.known.get(row);
741
+ const failed = now.status === 'error';
742
+ const said = !was
743
+ ? this.presented && !hush
744
+ : (now.status === 'done' && was.status !== 'done') || (failed && (was.status !== 'error' || was.errorText !== now.errorText));
745
+ if (said)
746
+ messages.push([rowText(row, 'name', 'name'), failed ? now.errorText : rowText(row, 'statusText', 'status-text')].map((text) => text.trim()).filter(Boolean).join(', '));
747
+ this.known.set(row, now);
748
+ }
749
+ for (const row of [...this.known.keys()])
750
+ if (!rows.includes(row))
751
+ this.known.delete(row);
752
+ const first = !this.presented;
753
+ this.presented = true;
754
+ const own = this.own;
755
+ this.own = null;
756
+ this.check(first);
757
+ const region = this.renderRoot?.querySelector('.announce');
758
+ const lines = own ? [own] : messages.filter(Boolean);
759
+ if (!region || !this.isConnected || lines.length === 0)
760
+ return;
761
+ // Written as new lines in place of the last ones, so that a text equal to the last one is said again.
762
+ region.replaceChildren(...lines.map((text) => {
763
+ const line = document.createElement('div');
764
+ line.textContent = text;
765
+ return line;
766
+ }));
767
+ }
768
+ /** @internal FPK-22: where a child is placed, for the Button that asks its parent when it connects: the file picker says it of its trigger. */
769
+ [GROUP_PLACE](child) {
770
+ return this.picker?.[GROUP_PLACE]?.(child) ?? null;
771
+ }
772
+ // ─── Lifecycle ────────────────────────────────────────────────────────────────────────────────────────────────
773
+ connectedCallback() {
774
+ super.connectedCallback();
775
+ this.children$?.observe(this, { childList: true });
776
+ this.stood = this.givenRows;
777
+ this.count = this.stood.length;
778
+ // FUP-58: the file items that are here already are given what every row shares before any of them draws itself.
779
+ this.tellRows(this.stood);
780
+ }
781
+ disconnectedCallback() {
782
+ super.disconnectedCallback();
783
+ this.children$?.disconnect();
784
+ clearTimeout(this.turn);
785
+ this.turn = undefined;
786
+ this.held = null;
787
+ this.arriving = { accepted: [], refused: [] };
788
+ }
789
+ willUpdate(changed) {
790
+ // FUP-52: `rows` changed while it is shown. From own to given every kept file is let go and every row it made
791
+ // leaves; from given to own it begins with none (it kept none) and the product's rows are no longer drawn. Nothing
792
+ // is emitted or said, and focus that a leaving row held goes to the trigger. (Before it was first drawn the same
793
+ // holds, and there is no row that could hold focus: what it has read of the product's rows is read again.)
794
+ if (changed.has('rows')) {
795
+ const kept = changed.get('rows') !== 'given';
796
+ if (kept !== this.keeps) {
797
+ if (this.hasUpdated) {
798
+ const active = this.shadowRoot?.activeElement ?? null;
799
+ this.leavingHeld = kept ? !!active && this.ownRows.includes(active) : this.itemChildren.some(holdsFocus);
800
+ }
801
+ if (kept) {
802
+ this.kept = [];
803
+ this.refused = [];
804
+ }
805
+ this.arrived = [];
806
+ this.held = null;
807
+ this.stood = this.givenRows;
808
+ this.count = this.stood.length;
809
+ this.hush = true;
810
+ this.changed();
811
+ }
812
+ }
813
+ // FUP-26: the product's sentence, when it is set to a text or changed — never the one it was first presented with.
814
+ if (changed.has('announcement') && this.hasUpdated && this.announcement.trim()) {
815
+ this.own = this.announcement;
816
+ this.changed();
817
+ }
818
+ }
819
+ firstUpdated() {
820
+ // FUP-26: the rows that are here now are the ones it was presented with.
821
+ this.changed();
822
+ }
823
+ updated(changed) {
824
+ super.updated(changed);
825
+ // FUP-24, FUP-32: the file picker is told at once what a field gave the file upload.
826
+ this.provider.sync();
827
+ this.tellRows();
828
+ this.syncForm();
829
+ if (this.leavingHeld) {
830
+ this.leavingHeld = false;
831
+ this.trigger?.focus();
832
+ }
833
+ if (this.presented)
834
+ this.reports(changed);
835
+ }
836
+ /** What a debug build is told about the content, once it has all been written: the file upload still renders. */
837
+ check(first) {
838
+ // FUP-41: a child that is neither the trigger, the glyph nor a file item is not drawn.
839
+ const strays = [...this.childNodes].filter((node) => (node instanceof Element ? !node.slot && node.localName !== ITEM : node.nodeType === Node.TEXT_NODE && !!node.textContent?.trim()));
840
+ if (strays.length)
841
+ report(this, 'FUP-41', 'the file upload holds content that is neither its trigger, its glyph nor a file item; it is not drawn');
842
+ // FUP-42: a row the product gives while the file upload keeps its own files is not drawn.
843
+ if (this.keeps && this.itemChildren.length)
844
+ report(this, 'FUP-42', 'the file upload holds tanrei-file-item children while rows is "own": it keeps the chosen files and makes their rows itself, so these are not drawn; say rows="given" to give the rows');
845
+ const rows = this.givenRows;
846
+ // FUP-38: two rows with one value are both drawn.
847
+ const values = rows.map((row) => rowText(row, 'value', 'value'));
848
+ const twice = values.find((value, index) => values.indexOf(value) !== index);
849
+ if (twice !== undefined)
850
+ report(this, 'FUP-38', `two rows have the value "${twice}"; both are drawn, and click, remove and retry cannot tell them apart`);
851
+ // FUP-58: a product's file item that says otherwise what the file upload gives every row is drawn as the file upload says.
852
+ for (const [prop, attribute, unsaid] of SHARED) {
853
+ const mine = this[prop];
854
+ const theirs = rows.find((row) => {
855
+ if (!row.hasAttribute(attribute))
856
+ return false;
857
+ const said = row.getAttribute(attribute);
858
+ if (said === unsaid)
859
+ return false;
860
+ return typeof mine === 'boolean' ? !mine : typeof mine === 'number' || mine === null ? Number(said) !== mine : said !== mine;
861
+ });
862
+ if (theirs)
863
+ report(this, 'FUP-58', `a file item says ${attribute}="${theirs.getAttribute(attribute)}" and the file upload gives every row its own ${prop}; the row is drawn as the file upload says — set it on the file upload`);
864
+ }
865
+ if (first)
866
+ this.reports(new Map(), true);
867
+ }
868
+ reports(changed, all = false) {
869
+ const has = (name) => all || changed.has(name);
870
+ if (has('rows') && !ROWS.includes(this.rows))
871
+ report(this, 'FUP-42', `rows "${String(this.rows)}" is not a way of holding the rows; the file upload keeps its own files, as with "own"`);
872
+ if (has('itemForm') && !ITEM_FORMS.includes(this.itemForm))
873
+ report(this, 'FUP-17', `item-form "${String(this.itemForm)}" is not a form of a file item; the rows are arranged as a column`);
874
+ if (has('maxFiles') && this.maxFiles !== null && limit(this.maxFiles) === null)
875
+ report(this, 'FUP-38', `max-files "${String(this.maxFiles)}" is not a number above zero; no limit of files is set`);
876
+ // FUP-24: a group without a name.
877
+ if (!this.groupName.trim())
878
+ report(this, 'FUP-24', 'label is empty and no field names the file upload, so the group has no accessible name; give it a label, or put it in a tanrei-field');
879
+ // FUP-27: a limit of its own that is enforced and not said; the file picker says the same of accept and max-size (FPK-18).
880
+ if (!this.constraintsText.trim() && this.multiple && limit(this.maxFiles) !== null) {
881
+ report(this, 'FUP-27', 'max-files sets a limit and constraints-text is empty, so the limit is enforced and not said; say it in constraints-text');
882
+ }
883
+ // FUP-45, FUP-53: a refused file's row without the product's sentence for its reason is drawn with its mark and its name.
884
+ for (const [reason, key, attribute] of REASONS) {
885
+ if (this.keeps && this.refused.some((row) => row.reason === reason) && !this.sentence(reason)) {
886
+ this.words.missing(key, { id: 'FUP-45', effect: `a file refused for its ${reason} is drawn as a failed row without a sentence that says why (${attribute})` });
887
+ }
888
+ }
889
+ }
890
+ /**
891
+ * FUP-44, FUP-45: a row it makes itself — a file item, so a row has one drawing. A kept file is a pending file item
892
+ * given the file's handle, its name and its media type, with the size the product's function writes; a refused one
893
+ * a failed file item with the product's sentence for its reason, given no handle, never retryable. Neither is
894
+ * pressable or a link: the file upload opens nothing.
895
+ */
896
+ ownRow(row) {
897
+ return html `<tanrei-file-item
898
+ part="file-item"
899
+ exportparts=${ITEM_PARTS.attribute}
900
+ .file=${row.reason ? null : row.file}
901
+ .name=${row.file.name}
902
+ .mediaType=${row.file.type}
903
+ .sizeText=${this.sizeOf(row.file)}
904
+ .status=${row.reason ? 'error' : 'pending'}
905
+ .errorText=${row.reason ? this.sentence(row.reason) : ''}
906
+ @remove=${(event) => this.removeOwn(event, row)}
907
+ @retry=${(event) => event.stopPropagation()}
908
+ @click=${(event) => event.stopPropagation()}
909
+ ></tanrei-file-item>`;
910
+ }
911
+ // FUP-56, FUP-58: its file picker, as a product writes one — with the passage of the trigger and the glyph — and
912
+ // below it the list: the product's own file items in the default slot, or the ones it makes.
913
+ render() {
914
+ const name = this.groupName.trim();
915
+ return html `
916
+ <div class="group" role="group" aria-label=${name || nothing}>
917
+ <tanrei-file-picker
918
+ part="file-picker"
919
+ exportparts=${PICKER_PARTS.attribute}
920
+ ${forward(this, PICKER)}
921
+ .selectionText=${this.shownEmptyText}
922
+ @select=${this.onPickerSelect}
923
+ @reject=${this.onPickerReject}
924
+ @tanrei-file-picker-arrival=${this.onArrival}
925
+ >${this.pass('trigger')}${this.pass('icon')}</tanrei-file-picker
926
+ >
927
+ <div part="list" class="list" role="list" aria-label=${name || nothing} data-form=${this.shownForm} ?hidden=${this.rowCount === 0}>
928
+ <div class="rows">${this.keeps ? repeat([...this.kept, ...this.refused], (row) => row, (row) => this.ownRow(row)) : html `<slot></slot>`}</div>
929
+ </div>
930
+ <div class="announce" aria-live="polite" aria-atomic="true"></div>
931
+ </div>
932
+ `;
933
+ }
934
+ }
935
+ // Its `disabled` attribute, written while it holds focus, waits until focus has left: a frame at most.
936
+ disabledWaitsWhileFocused(TanreiFileUpload);
937
+ if (!customElements.get('tanrei-file-upload'))
938
+ customElements.define('tanrei-file-upload', TanreiFileUpload);
939
+ //# sourceMappingURL=file-upload.js.map