@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,1108 @@
1
+ import { LitElement, html, nothing } from 'lit';
2
+ import { AvailabilityController, DismissController, FieldControlController, GlyphDrawnController, GlyphMirrorController, NativeTextController, OpenAxesController, SEPARATION_VALUES, SystemWatchController, registerOverlay, report, slottedInteractive, syncFocusStyle, WordsController, } from '../../primitives/index.js';
3
+ import { missingValueMessage } from '../../primitives/missing-value.js';
4
+ import { FloatingLabelController, floatingAsterisk, floatingLabel, triggerEdges } from '../../primitives/field-trigger.js';
5
+ import { OPTION_GLYPHS, OPTION_GROUP_TAG, OPTION_MIRRORED, OPTION_TAG, OptionListController, OptionsController, anchoredOptionList, filterOptions, } from '../../primitives/option-list.js';
6
+ import '../button/button.js';
7
+ import '../loading-indicator/loading-indicator.js';
8
+ import '../option/option.js';
9
+ import { formOf, pressDefaultButton } from '../../primitives/default-button.js';
10
+ import { takeFormDisabled } from '../../primitives/form-disabled.js';
11
+ import { FormSays } from '../../primitives/form-says.js';
12
+ import { AXES, INSET, styles } from './combobox.styles.js';
13
+ import { disabledWaitsWhileFocused } from '../../primitives/disabled-while-focused.js';
14
+ import { focusedAtFirst } from '../../primitives/autofocus.js';
15
+ const FILTERS = ['contains', 'none'];
16
+ const STATUSES = ['idle', 'loading', 'error'];
17
+ /** Runs `task` once the document has been read: an element upgraded while its children are still being parsed has none yet. */
18
+ function whenParsed(task) {
19
+ if (document.readyState === 'loading')
20
+ document.addEventListener('DOMContentLoaded', task, { once: true });
21
+ else
22
+ task();
23
+ }
24
+ // ── CMB-25, CMB-29, CMB-38: how a text is compared with a label ───────────────────────────────────────────────────
25
+ //
26
+ // Without regard to case, to the width of a character or to the marks on a letter: each letter with the marks that
27
+ // follow it is folded by itself — its compatibility form (a full-width "t" is "t", a half-width "カ" is "カ"), without
28
+ // its marks (an "á" is "a"), in lower case — so that a place in the folded text is a place in the label, and the run
29
+ // that matched can be drawn. The two sound marks of kana are letters' own and are kept: "が" is not "か".
30
+ const CLUSTER = /\P{M}\p{M}*|\p{M}+/gu;
31
+ const KANA_SOUND_MARKS = new Set(['\u3099', '\u309A']);
32
+ const foldCluster = (cluster) => cluster
33
+ .normalize('NFKD')
34
+ .replace(/\p{M}/gu, (mark) => (KANA_SOUND_MARKS.has(mark) ? mark : ''))
35
+ .normalize('NFKC')
36
+ .toLowerCase();
37
+ function fold(label) {
38
+ const clusters = label.match(CLUSTER) ?? [];
39
+ let text = '';
40
+ const from = [];
41
+ clusters.forEach((cluster, index) => {
42
+ const folded = foldCluster(cluster);
43
+ text += folded;
44
+ for (let i = 0; i < folded.length; i++)
45
+ from.push(index);
46
+ });
47
+ return { clusters, text, from };
48
+ }
49
+ /** A text as it is compared: folded, without the spaces around it. */
50
+ const foldText = (text) => fold(text.trim()).text;
51
+ /** The first run of `label` that matched `query` (already folded), as the three pieces of the label; null when none did. */
52
+ function matchRun(folded, query) {
53
+ if (!query)
54
+ return null;
55
+ const at = folded.text.indexOf(query);
56
+ if (at < 0)
57
+ return null;
58
+ const first = folded.from[at];
59
+ const last = folded.from[at + query.length - 1];
60
+ const { clusters } = folded;
61
+ return [clusters.slice(0, first).join(''), clusters.slice(first, last + 1).join(''), clusters.slice(last + 1).join('')];
62
+ }
63
+ /**
64
+ * Lets people find one value by typing: a box that looks and measures like a text input, with a list of options that
65
+ * narrows as they type and that they choose from, or, where the product allows it, a value of their own. The bare
66
+ * control: it has no label row and no message of its own.
67
+ *
68
+ * Contract: specs/combobox.spec.json. The options are `<tanrei-option>` children, optionally in
69
+ * `<tanrei-option-group>` elements (the pair a select holds too); the combobox reads them — and reads them again when
70
+ * they change — and renders the rows itself. A `<slot>` among its children stands for the elements assigned to it, so
71
+ * that an element composed around it passes its own children on as the options. Every visual value is a token: the box is
72
+ * drawn from `--tanrei-comp-input-box-*`, the one set every input box is drawn from (CMB-63), and the list and the
73
+ * status row from `--tanrei-comp-combobox-*` — the list's hold the menu's values and the status row's the search's, in
74
+ * every shipped design system.
75
+ *
76
+ * ```html
77
+ * <tanrei-field label="City">
78
+ * <tanrei-combobox name="city" value="tokyo">
79
+ * <tanrei-option value="kyoto">Kyoto</tanrei-option>
80
+ * <tanrei-option value="tokyo">Tokyo</tanrei-option>
81
+ * </tanrei-combobox>
82
+ * </tanrei-field>
83
+ * ```
84
+ *
85
+ * In a form it is framed: by a Field, as above, or as `<tanrei-combobox-field>`, which is that pair as one element.
86
+ * The Field gives it its name, its description and its required, invalid and disabled states, and draws the label
87
+ * row, the requirement mark, the help and the error; the combobox says back that it draws the label itself where its
88
+ * look floats one (`filled`, `outlined`), where its input text starts and ends, and that it is drawn focused for as
89
+ * long as its list is open (`src/primitives/field.ts`). Bare — a filter in a toolbar, a cell of a table — it is named
90
+ * by its own `label`, which a stacked combobox does not draw.
91
+ *
92
+ * It holds two things: `value`, the committed choice, and `inputValue`, the text in the input. Typing changes the text,
93
+ * opens the list and filters it (`filter="contains"`; with `filter="none"` the product filters, on `input`); a press on
94
+ * an option or Enter on the active one chooses; leaving the box resolves the text — a typed label chooses its
95
+ * option, any other text is kept as the value (`allow-custom-value`) or given up. The value changes only by a choice,
96
+ * a commit or the clear button.
97
+ *
98
+ * It is a block as wide as its place, with no width of its own. It is a form-associated element: it takes `name`,
99
+ * submits `value` (never an uncommitted text), resets to the `value` attribute, is restored on navigation, follows
100
+ * `<fieldset disabled>` and reports `valueMissing` while the Field that frames it says it is required and `value` is
101
+ * empty. It never validates beyond that, and is never required by itself.
102
+ *
103
+ * The pattern is the editable combobox with a list box: focus stays in the input while the list is open and one
104
+ * option at most is the active one (`aria-activedescendant`). While an input method composes, every key is its own.
105
+ *
106
+ * @tag tanrei-combobox
107
+ * @slot - The options: `<tanrei-option>` elements, optionally in `<tanrei-option-group>` elements. They are read, not drawn in place. A `<slot>` element here stands for the elements assigned to it.
108
+ * @slot leading-icon - A glyph at the start of the container that stands for the combobox whatever is chosen (a magnifier before a field that searches people). It takes the place of the chosen option's own glyph. A glyph the icon set flags is mirrored in right-to-left; `data-mirror="auto | always | never"` on the element decides for one use.
109
+ * @csspart container - The combobox's box: the list's anchor.
110
+ * @csspart outline - A stacked combobox's inner line, or an outlined one's border.
111
+ * @csspart active-indicator - The line along the bottom of a filled combobox.
112
+ * @csspart label - The label floating in a filled or an outlined combobox.
113
+ * @csspart requirement-label - The required asterisk after a floating label.
114
+ * @csspart input - The native `<input>`: the combobox.
115
+ * @csspart leading-icon - The box of the glyph at the start of the container.
116
+ * @csspart clear-button - The clear button, a `<tanrei-button>`.
117
+ * @csspart chevron - The chevron's button at the end of the container.
118
+ * @csspart list - The raised sheet that holds the options.
119
+ * @csspart option - An option's row.
120
+ * @csspart option-label - An option's label.
121
+ * @csspart option-supporting-text - An option's supporting text.
122
+ * @csspart option-leading-icon - The box of an option's glyph.
123
+ * @csspart mark - The check of the chosen option.
124
+ * @csspart group - A group of options.
125
+ * @csspart group-title - A group's title.
126
+ * @csspart divider - The line between two groups while the separation is divider.
127
+ * @csspart status - The status row after the options.
128
+ * @attr {string} form - The id of the form the combobox 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.
129
+ * @fires input - The person changed the text: the native, composed `input` of the text element as they type, delete, paste or an input method commits; one more when the clear button empties the text and when Escape restores it. `inputValue` is already the new text. Never fired when the product sets `inputValue` or `value`, or when a choice writes its label. The product's cue to load options.
130
+ * @fires {CustomEvent<TanreiComboboxChangeDetail>} change - The committed value changed by the person: an option was chosen, a custom text was committed, or the value was cleared; `value` is already the new one. `detail.value` and `detail.inputValue`. Composed and bubbling. Never fired when the product sets `value`, when the chosen option is chosen again, or while the person only types or moves through the list.
131
+ * @fires {CustomEvent<TanreiComboboxToggleDetail>} toggle - The list was opened or closed by the person, or closed by having nothing left to show; `open` is already the new one. `detail.open`, and for a close `detail.reason`: `select`, `commit`, `escape`, `outside`, `press`, `tab`, `focus-out`, `anchor-hidden` or `empty`. After a choice it follows `change`. Composed and not bubbling, as the platform's own `toggle`: heard on the element, and on an element composed around it, and by no ancestor. Never fired when the product sets `open`.
132
+ * @fires {CustomEvent<TanreiComboboxChangeDetail>} action - The person pressed Enter with no option active and the text was committed; after any `change` it caused. Cancelable: unless it is cancelled, the form the combobox stands in is then asked to submit.
133
+ */
134
+ export class TanreiCombobox extends LitElement {
135
+ static { this.styles = styles; }
136
+ static { this.formAssociated = true; }
137
+ /**
138
+ * Its documented parts, once: what an element composed around it exports (src/primitives/composed.ts). Held equal to
139
+ * the `@csspart` lines above by src/primitives/composed.test.ts.
140
+ *
141
+ * @internal
142
+ */
143
+ static { this.parts = [
144
+ 'container',
145
+ 'outline',
146
+ 'active-indicator',
147
+ 'label',
148
+ 'requirement-label',
149
+ 'input',
150
+ 'leading-icon',
151
+ 'clear-button',
152
+ 'chevron',
153
+ 'list',
154
+ 'option',
155
+ 'option-label',
156
+ 'option-supporting-text',
157
+ 'option-leading-icon',
158
+ 'mark',
159
+ 'group',
160
+ 'group-title',
161
+ 'divider',
162
+ 'status',
163
+ ]; }
164
+ static { this.properties = {
165
+ variant: { type: String, reflect: true },
166
+ size: { type: String, reflect: true },
167
+ value: { type: String },
168
+ inputValue: { type: String, attribute: 'input-value' },
169
+ name: { type: String, reflect: true },
170
+ label: { type: String },
171
+ labelHidden: { type: Boolean, attribute: 'label-hidden', reflect: true },
172
+ placeholder: { type: String },
173
+ error: { type: Boolean, reflect: true },
174
+ disabled: { type: Boolean, reflect: true },
175
+ readOnly: { type: Boolean, attribute: 'readonly', reflect: true },
176
+ open: { type: Boolean, reflect: true },
177
+ allowCustomValue: { type: Boolean, attribute: 'allow-custom-value', reflect: true },
178
+ filter: { type: String, reflect: true },
179
+ noChevron: { type: Boolean, attribute: 'no-chevron', reflect: true },
180
+ clearable: { type: Boolean, reflect: true },
181
+ clearLabel: { type: String, attribute: 'clear-label' },
182
+ status: { type: String, reflect: true },
183
+ statusText: { type: String, attribute: 'status-text' },
184
+ emptyText: { type: String, attribute: 'empty-text' },
185
+ separation: { type: String, reflect: true },
186
+ inline: { type: Boolean, reflect: true },
187
+ hasLeading: { state: true },
188
+ focused: { state: true },
189
+ formDisabled: { state: true },
190
+ }; }
191
+ /** The text in the input (`input-value`). The combobox writes it as the person types and when a value is chosen or restored; the product may set it, and reads it from `input` to load options. */
192
+ // An accessor, not a field: the text is the person's at every moment (CBF-3). The native `input`
193
+ // event is the browser's own and composed — a capturing listener on an ancestor hears it before the element's own
194
+ // listener has run — so what the person has just typed into the native element and the element has not taken yet is
195
+ // read from that element. `event.target.inputValue` is then the new text in every listener, and in every listener of
196
+ // an element composed around this one.
197
+ get inputValue() {
198
+ const native = this.nativeSeen === undefined ? null : this.input;
199
+ return native && native.value !== this.nativeSeen ? native.value : this.text;
200
+ }
201
+ set inputValue(text) {
202
+ this.text = text;
203
+ }
204
+ constructor() {
205
+ super();
206
+ this.availability = new AvailabilityController(this, 'combobox');
207
+ /** The look, as the text inputs beside it: `stacked` is a filled box that draws no label — the label above it is the row of the Field that frames it; `filled` and `outlined` float the label inside the box. Use one style per form. A value the combobox does not know by name is laid out as stacked. Reflected. */
208
+ this.variant = 'stacked';
209
+ /** The container's minimum height: `medium` or `large` (48 / 56 in the default system), the text input's two sizes. The hit area always meets the minimum target. Reflected. */
210
+ this.size = 'medium';
211
+ /** The committed choice: the chosen option's value, or, with `allowCustomValue`, a text the person typed that names no option. Empty while nothing is chosen. The `value` attribute is the value a form reset returns to. */
212
+ this.value = '';
213
+ /** The text the element holds: what the product set, what the combobox wrote, or the person's last edit as the element took it. */
214
+ this.text = '';
215
+ /** The name the value is submitted under in a form. Reflected. */
216
+ this.name = '';
217
+ /** The combobox's own accessible name, for a combobox no Field frames or one whose visible label is elsewhere; a filled or an outlined combobox draws it floating. Inside a Field leave it empty: the Field's label names the combobox, and its own would win. */
218
+ this.label = '';
219
+ /** Does not draw the floating label of a filled or an outlined combobox, which stays the accessible name (`label-hidden`). Inside a Field, hide the label on the Field. */
220
+ this.labelHidden = false;
221
+ /** A hint shown while the input is empty and the label is not in the input line. Never a replacement for `label`. */
222
+ this.placeholder = '';
223
+ /** Puts the combobox in the error condition: its box is drawn from its error parts and it is exposed as invalid. Inside a Field, set `error` on the Field, which also shows the words. The combobox never sets this itself. */
224
+ this.error = false;
225
+ /** Disables the combobox: it takes no focus, cannot be edited, does not open and is left out of form submission. Inside a Field, disable the Field, so that its label follows. */
226
+ this.disabled = false;
227
+ /** The value is shown, can be focused, selected and copied, and is submitted, but cannot be changed: the list does not open and neither the chevron nor the clear button is drawn. The attribute is `readonly`. */
228
+ this.readOnly = false;
229
+ /** Whether the list is shown. The combobox opens and closes itself and emits `toggle`; the product may also set it (to open on focus, for one). Ignored while the combobox is disabled or read-only or has nothing to show. Reflected. */
230
+ this.open = false;
231
+ /** False: the value is always one of the options, and a text that names none is given up when the person leaves. True: the options are suggestions, and a text that names none becomes the value as typed (`allow-custom-value`). Reflected. */
232
+ this.allowCustomValue = false;
233
+ /** Who decides which options answer the text. `contains`: the combobox shows the options whose label contains what was typed, ignoring case, width and marks, and marks the match. `none`: it shows every option it is given and the product filters, on `input`. Reflected. */
234
+ this.filter = 'contains';
235
+ /** Draws no chevron (`no-chevron`: the spec's `chevron`, inverted, because a boolean attribute cannot default to true): for a field whose suggestions exist only for what was typed. The list then opens by typing and by the arrow keys alone. Reflected. */
236
+ this.noChevron = false;
237
+ /** Draws a clear button while the text is not empty, for a combobox whose value may be none. Without it, emptying the text and leaving the field clears the value. Reflected. */
238
+ this.clearable = false;
239
+ /** The clear button's accessible name, in the product's language (`clear-label`). Required while `clearable` is true. */
240
+ this.clearLabel = '';
241
+ /** What the product's source of options is doing: `idle`, `loading` (the status row shows a loading indicator and the list is marked busy) or `error` (the status row shows `statusText` as an error, announced at once). Reflected. */
242
+ this.status = 'idle';
243
+ /** The status row's text, in the product's language (`status-text`), announced when it changes: a count, that loading failed, or, while loading, the loading indicator's name. */
244
+ this.statusText = '';
245
+ /** Shown in the list while the text names nothing the combobox can show, `allowCustomValue` is false and no status is set (`empty-text`): this instance's words, else the product's (`setWords({ emptyText })`). Tanrei has none: without them no such row is drawn. */
246
+ this.emptyText = '';
247
+ /** How a group of options is told from what is next to it: `divider`, `gap`, or `auto` for the design system's answer (`--tanrei-comp-combobox-separation`). */
248
+ this.separation = 'auto';
249
+ /** For tests and fixtures: draws the open list in place below the field — inside its positioned ancestor, which stands for the window — not in the top layer; it then answers no dismissal. */
250
+ this.inline = false;
251
+ /** Whether the leading-icon slot has content. */
252
+ this.hasLeading = false;
253
+ /** CMB-15: the input has focus, however it was gained. */
254
+ this.focused = false;
255
+ /** Set by an ancestor `<fieldset disabled>` (the element's `formDisabledCallback`). */
256
+ this.formDisabled = false;
257
+ this.internals = this.attachInternals();
258
+ /** What it tells its form, said where an element composed around it hears it (src/primitives/form-says.ts). */
259
+ this.says = new FormSays(this, this.internals);
260
+ /** Whether the list is presented: open, usable, and beside a container in the page. */
261
+ this.presented = false;
262
+ this.unregister = null;
263
+ // ── CMB-17: the two things the combobox holds ─────────────────────────────────────────────────────────────────
264
+ /** The text the combobox itself wrote or took from the person last: another `inputValue` is the product's. */
265
+ this.ownText = '';
266
+ /** The value the combobox committed or took from the product last: another `value` is the product's. */
267
+ this.ownValue = '';
268
+ /** The person is editing: the text was changed since the last commit (CMB-17). */
269
+ this.editing = false;
270
+ /** CMB-25: the text the list is filtered by; null shows every option (a list opened by an arrow key or the chevron). */
271
+ this.query = null;
272
+ /** The text was last taken during a composition: its end makes the first match active (CMB-26). */
273
+ this.composedText = false;
274
+ /** The key that is moving focus now is Tab: a list it closes says so (CMB-29). */
275
+ this.tabbing = false;
276
+ /** CMB-56: sizes and variants a design system adds, and a value the active system does not have (src/primitives/axes.ts). */
277
+ this.axes = new OpenAxesController(this, { component: 'combobox', behavior: 'CMB-56', axes: AXES });
278
+ /** CMB-44: where style queries are missing the system's separation is read by script, again when the system is switched. */
279
+ this.system = new SystemWatchController(this);
280
+ /**
281
+ * CMB-61: the combobox's side of the exchange with the Field that frames it (src/primitives/field.ts). It takes the
282
+ * Field's name, description and states, whether the label is hidden and whether an asterisk follows it; and it says
283
+ * what only it knows — that it draws the label, how far its input text is inset, and that it is drawn focused while
284
+ * its list is open. It has an error condition of its own (CMB-10). No Field: it is drawn as a bare combobox.
285
+ */
286
+ this.frame = new FieldControlController(this, {
287
+ errorCondition: true,
288
+ named: () => !!this.label.trim(),
289
+ says: () => this.saysToField,
290
+ changed: () => (this.frameChanged = true),
291
+ });
292
+ /** The Field's answer changed since the last update: the floating label may have other lines (CMB-8). */
293
+ this.frameChanged = false;
294
+ /** CMB-31: the options, read from the children and read again when they change (src/primitives/option-list.ts). */
295
+ this.options$ = new OptionsController(this);
296
+ /** CMB-24, CMB-26, CMB-27, CMB-40, CMB-41: the active option, the keys that move it, the press and the choice. */
297
+ this.list = new OptionListController(this, {
298
+ model: () => this.shown,
299
+ chosen: () => this.chosen,
300
+ choose: (option) => this.choose(option),
301
+ // CMB-26: an active option that is no longer shown gives way to what typing would have found.
302
+ replacement: (options) => (this.native.composing ? null : this.found(options)),
303
+ });
304
+ /** CMB-22, CMB-23, CMB-58: where the list is — the anchored surface a popover is drawn on, as wide as the container. */
305
+ this.anchored = anchoredOptionList(this, {
306
+ anchor: () => this.container,
307
+ inline: () => this.inline,
308
+ gone: () => this.closeList('anchor-hidden'),
309
+ });
310
+ /** CMB-30: Escape pressed elsewhere, a press outside and focus arriving elsewhere (src/primitives/dismiss.ts). */
311
+ this.dismiss = new DismissController(this, {
312
+ related: () => [this],
313
+ request: (reason) => this.closeList(reason),
314
+ });
315
+ /** CMB-16: the text and the native element kept in step without breaking an input method (src/primitives/native-text.ts). */
316
+ this.native = new NativeTextController({
317
+ input: () => this.input,
318
+ value: () => this.text,
319
+ setValue: (text) => this.took(text, this.native.composing),
320
+ });
321
+ /** CMB-8: a floating label that does not fit on one line is given the room its lines take. */
322
+ this.floating = new FloatingLabelController(this);
323
+ /** CMB-54: the glyphs of the two slots, the chosen option's own and the options' are marked when the icon set mirrors them. */
324
+ this.mirror = new GlyphMirrorController(this, { slots: 'slot[name="leading-icon"]', drawn: `.leading-own, ${OPTION_MIRRORED}` });
325
+ /** A glyph the combobox draws by name is drawn once the icon set can draw it; until then nothing stands in its place. */
326
+ this.glyphs = new GlyphDrawnController(this, () => this.renderRoot.querySelectorAll(`.chevron-glyph, .leading-own, .clear-glyph, ${OPTION_GLYPHS}`));
327
+ // ── CMB-25: which options are shown ───────────────────────────────────────────────────────────────────────────
328
+ this.folded = null;
329
+ this.filtered = null;
330
+ /** CMB-60: the product's words, read where the instance gives none (src/primitives/words.ts). */
331
+ this.words = new WordsController(this);
332
+ this.reportedOptions = '';
333
+ /** CMB-38: an option's label with the first run that matched the text in a `<mark>`: one text, drawn heavier there. */
334
+ this.labelText = (option) => {
335
+ const run = matchRun(this.foldedLabel(option), this.needle);
336
+ // The run is drawn, not said: without a role of its own it is no node of the option's label for assistive technology.
337
+ return run ? html `${run[0]}<mark role="none">${run[1]}</mark>${run[2]}` : option.label;
338
+ };
339
+ // A `<label for>` of the page activates the element itself: its input takes focus, and nothing opens.
340
+ this.addEventListener('click', (event) => {
341
+ if (event.composedPath()[0] === this)
342
+ this.focus();
343
+ });
344
+ }
345
+ get container() {
346
+ return this.renderRoot?.querySelector('.container') ?? null;
347
+ }
348
+ get input() {
349
+ return this.renderRoot?.querySelector('.input') ?? null;
350
+ }
351
+ /** Disabled by its own `disabled`, a fieldset's, or the Field's or the field group's that frames it (CMB-46). */
352
+ get inert_() {
353
+ return this.disabled || this.formDisabled || this.frame.disabled;
354
+ }
355
+ /** How the variant is laid out: filled and outlined by name, every other value as stacked (CMB-56). */
356
+ get layout() {
357
+ return this.variant === 'filled' || this.variant === 'outlined' ? this.variant : 'stacked';
358
+ }
359
+ /** CMB-56: a filter the combobox does not define is contains, a status idle. */
360
+ get filterNow() {
361
+ return this.filter === 'none' ? 'none' : 'contains';
362
+ }
363
+ get statusNow() {
364
+ return STATUSES.includes(this.status) ? this.status : 'idle';
365
+ }
366
+ /** CMB-17, CMB-57: the chosen option — the first, in order and across groups, whose value equals `value`; never one whose value is empty. */
367
+ get chosen() {
368
+ return this.value === '' ? null : (this.options$.model.options.find((option) => option.value === this.value) ?? null);
369
+ }
370
+ /** CMB-17: the text of the committed value: the chosen option's label; a value that names no option itself where a custom value is allowed, and nothing otherwise. */
371
+ get committedText() {
372
+ const chosen = this.chosen;
373
+ return chosen ? chosen.label : this.allowCustomValue ? this.value : '';
374
+ }
375
+ /** An option's label as it is compared, folded once for as long as the options stay. */
376
+ foldedLabel(option) {
377
+ const model = this.options$.model;
378
+ if (this.folded?.model !== model)
379
+ this.folded = { model, labels: new Map() };
380
+ let folded = this.folded.labels.get(option.element);
381
+ if (!folded)
382
+ this.folded.labels.set(option.element, (folded = fold(option.label)));
383
+ return folded;
384
+ }
385
+ /** The folded text the combobox filters by now; empty while it shows every option. */
386
+ get needle() {
387
+ return this.filterNow === 'contains' && this.query ? fold(this.query).text : '';
388
+ }
389
+ /** CMB-25: the options shown now, in their order: every one, or, while the combobox filters, those whose label contains the text. */
390
+ get shown() {
391
+ const model = this.options$.model;
392
+ const query = this.needle;
393
+ if (!query)
394
+ return model;
395
+ if (this.filtered?.model !== model || this.filtered.query !== query) {
396
+ this.filtered = { model, query, out: filterOptions(model, (option) => this.foldedLabel(option).text.includes(query)) };
397
+ }
398
+ return this.filtered.out;
399
+ }
400
+ /** CMB-12: the accessible name — its own label, else the label of the Field that frames it. */
401
+ get name_() {
402
+ return this.frame.name(this.label.trim() ? this.label : '');
403
+ }
404
+ /** CMB-10: in the error condition — its own `error`, or its Field's (FLD-8). */
405
+ get inError() {
406
+ return this.error || this.frame.invalid;
407
+ }
408
+ /** CMB-8: the label floats in the box — a filled or an outlined combobox with a name, unless its own `labelHidden` or its Field's says to draw none. */
409
+ get labelled() {
410
+ return this.layout !== 'stacked' && !!this.name_ && !this.labelHidden && !this.frame.labelHidden;
411
+ }
412
+ /** CMB-7: an asterisk follows the floating label — the Field's answer (FLD-25); never outside a Field. */
413
+ get asterisked() {
414
+ return this.labelled && this.frame.requiredMark === 'asterisk';
415
+ }
416
+ /** CMB-18: the glyph at the start of the container — the slot's, or else the chosen option's own while the person is not editing. */
417
+ get leading() {
418
+ return this.hasLeading ? 'slot' : this.chosen?.leadingIcon && !this.editing ? 'option' : null;
419
+ }
420
+ /** CMB-19: the chevron is drawn. */
421
+ get chevronShown() {
422
+ return !this.noChevron && !this.readOnly;
423
+ }
424
+ /** CMB-20: the clear button is drawn. */
425
+ get clearShown() {
426
+ return this.clearable && this.text !== '' && !this.inert_ && !this.readOnly;
427
+ }
428
+ /**
429
+ * CMB-61: what the combobox says to the Field that frames it. That it draws the label while its look floats one — its
430
+ * name, or nothing while the label is hidden; the Field draws no label row either way. How far its input text
431
+ * stands from its start edge and the padding it keeps at its end edge, as lengths of the box's tokens (`INSET`, in the
432
+ * styles). And that it is drawn focused for as long as its list is open, whether or not it has focus (CMB-15).
433
+ */
434
+ get saysToField() {
435
+ const size = /^[a-z0-9][a-z0-9-]*$/.test(this.size) ? this.size : 'medium';
436
+ return {
437
+ drawsLabel: this.layout !== 'stacked',
438
+ inset: INSET(size, { leading: !!this.leading, trailing: this.chevronShown || this.clearShown }),
439
+ drawnFocused: this.open && this.usable,
440
+ };
441
+ }
442
+ /** CMB-32: the status row has something of the product's to show. */
443
+ get statusShown() {
444
+ return this.statusNow === 'loading' || this.statusText !== '';
445
+ }
446
+ /** CMB-32: nothing matched, and nothing of the product's stands in the status row's place: the empty text is asked for. */
447
+ get emptyAsked() {
448
+ return this.shown.options.length === 0 && !this.statusShown && !this.allowCustomValue && this.text !== '';
449
+ }
450
+ /** CMB-32, CMB-60: what says that nothing matched — the instance's emptyText, else the product's words, else nothing. */
451
+ get emptyWords() {
452
+ return this.words.get('emptyText', this.emptyText);
453
+ }
454
+ /** CMB-32: nothing matched, and the combobox says so in the status row's place. */
455
+ get emptyShown() {
456
+ return this.emptyAsked && this.emptyWords !== '';
457
+ }
458
+ /** CMB-21, CMB-57: there is something to show: an option after filtering, a status row or the empty text. */
459
+ get something() {
460
+ return this.shown.options.length > 0 || this.statusShown || this.emptyShown;
461
+ }
462
+ /** CMB-21, CMB-46, CMB-47, CMB-57: whether the list can be shown at all. */
463
+ get usable() {
464
+ return !this.inert_ && !this.readOnly && this.something;
465
+ }
466
+ /** CMB-26: the option typing makes active: the first shown that is not disabled, or none where Enter keeps the text. */
467
+ found(options) {
468
+ return this.allowCustomValue ? null : (options.find((option) => !option.disabled) ?? null);
469
+ }
470
+ /** CMB-29: the first option that is not disabled whose whole label is `text`, compared as the filter compares and ignoring the spaces around it. */
471
+ named(text) {
472
+ const wanted = foldText(text);
473
+ if (!wanted)
474
+ return null;
475
+ return this.options$.model.options.find((option) => !option.disabled && option.value !== '' && foldText(option.label) === wanted) ?? null;
476
+ }
477
+ /** The form it belongs to, if any. */
478
+ get form() {
479
+ return this.internals.form;
480
+ }
481
+ /** The native constraint validity: `valueMissing` while its Field says the combobox is required and its value is empty. */
482
+ get validity() {
483
+ return this.internals.validity;
484
+ }
485
+ get validationMessage() {
486
+ return this.internals.validationMessage;
487
+ }
488
+ get willValidate() {
489
+ return this.internals.willValidate;
490
+ }
491
+ checkValidity() {
492
+ return this.internals.checkValidity();
493
+ }
494
+ reportValidity() {
495
+ return this.internals.reportValidity();
496
+ }
497
+ /** Moves focus to the input: the combobox's one stop in the focus order (the clear button, while shown, is the next). */
498
+ focus(options) {
499
+ this.input?.focus(options);
500
+ }
501
+ blur() {
502
+ this.input?.blur();
503
+ }
504
+ /** Selects the text in the input. */
505
+ select() {
506
+ this.input?.select();
507
+ }
508
+ formResetCallback() {
509
+ this.value = this.getAttribute('value') ?? '';
510
+ this.settle();
511
+ this.requestUpdate();
512
+ }
513
+ formStateRestoreCallback(state) {
514
+ this.value = typeof state === 'string' ? state : '';
515
+ this.settle();
516
+ this.requestUpdate();
517
+ }
518
+ formDisabledCallback(disabled) {
519
+ takeFormDisabled(this, disabled, (value) => (this.formDisabled = value));
520
+ }
521
+ // ── CMB-16, CMB-17: the text ──────────────────────────────────────────────────────────────────────────────────
522
+ /** The combobox writes the text itself: no `input` is fired, and the element shows it at once (never into a composition). */
523
+ write(text) {
524
+ this.inputValue = text;
525
+ this.ownText = text;
526
+ this.show();
527
+ }
528
+ /** CMB-16, CMB-31: the text is shown in the native element — never into a composition — and what the element then holds is what was seen of it. */
529
+ show() {
530
+ this.native.show();
531
+ this.nativeSeen = this.input?.value;
532
+ }
533
+ /** The person is no longer editing: the text is the committed value's, and the list shows every option again. */
534
+ settle() {
535
+ this.editing = false;
536
+ this.query = null;
537
+ this.composedText = false;
538
+ }
539
+ /**
540
+ * CMB-16, CMB-21, CMB-25, CMB-26: the person changed the text. The native `input` is the combobox's event — it is
541
+ * composed and leaves the shadow root by itself. The list is filtered by the text, opened where there is something to
542
+ * show, and the first match becomes the active option — none where a custom value is allowed or an input method is
543
+ * composing, so that Enter keeps what was typed.
544
+ */
545
+ took(text, composing) {
546
+ // What the native element holds is taken from here on: `inputValue` is the element's own again.
547
+ this.nativeSeen = this.input?.value ?? text;
548
+ if (text === this.text && this.editing && (composing || !this.composedText))
549
+ return;
550
+ this.composedText = composing;
551
+ this.inputValue = text;
552
+ this.ownText = text;
553
+ this.editing = true;
554
+ this.query = text;
555
+ if (this.inert_ || this.readOnly)
556
+ return;
557
+ const active = composing ? null : this.found(this.shown.options);
558
+ if (this.open && this.presented)
559
+ this.list.setActive(active, true);
560
+ else if (!this.open)
561
+ this.openList('text', active);
562
+ // CMB-30: a list with nothing left to show closes with the reason empty, once the text is drawn (updated()).
563
+ }
564
+ onInput(event) {
565
+ if (this.native.composingInput(event))
566
+ return;
567
+ const input = event.target;
568
+ this.took(input.value, false);
569
+ }
570
+ /** CMB-27, CMB-28, CMB-29: `value` is committed with the text that stands for it; `change` once while it differs. */
571
+ commit(value, text) {
572
+ const changed = value !== this.value;
573
+ this.value = value;
574
+ this.ownValue = value;
575
+ this.write(text);
576
+ this.settle();
577
+ if (changed)
578
+ this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: { value, inputValue: text } }));
579
+ }
580
+ /**
581
+ * CMB-21, CMB-30: `toggle` — composed, so that it leaves the shadow root of an element composed around the combobox
582
+ * with that element as its target, and not bubbling, as the platform's own `toggle`: no ancestor hears it.
583
+ */
584
+ toggled(detail) {
585
+ this.dispatchEvent(new CustomEvent('toggle', { composed: true, detail }));
586
+ }
587
+ /**
588
+ * CMB-29: resolves the text. An empty text makes the value empty; the whole label of an option that is not disabled
589
+ * chooses the first such option; any other text becomes the value where a custom value is allowed. Returns false
590
+ * where the text names nothing and no custom value is allowed: the caller keeps it (Enter) or gives it up (leaving).
591
+ */
592
+ resolve() {
593
+ if (!this.editing)
594
+ return true;
595
+ const text = this.text;
596
+ if (text === '')
597
+ this.commit('', '');
598
+ else {
599
+ const option = this.named(text);
600
+ if (option)
601
+ this.commit(option.value, option.label);
602
+ else if (this.allowCustomValue)
603
+ this.commit(text, text);
604
+ else
605
+ return false;
606
+ }
607
+ return true;
608
+ }
609
+ /** CMB-29, CMB-30: the text of the committed value is written back. Returns whether the text changed. */
610
+ restore() {
611
+ const text = this.committedText;
612
+ const changed = text !== this.text;
613
+ this.write(text);
614
+ this.settle();
615
+ return changed;
616
+ }
617
+ // ── CMB-21, CMB-27, CMB-30: opening, closing and choosing ─────────────────────────────────────────────────────
618
+ /**
619
+ * CMB-21: the person opens the list. Opened by an arrow key or the chevron it shows every option and the chosen one
620
+ * is active (CMB-26); opened by typing it is filtered and `active` is. `open` is true before `toggle` is fired; the
621
+ * list is presented by the render that follows.
622
+ */
623
+ openList(how, active) {
624
+ if (this.open)
625
+ return;
626
+ if (how !== 'text')
627
+ this.query = null;
628
+ if (!this.usable)
629
+ return;
630
+ this.open = true;
631
+ if (how === 'text')
632
+ this.list.start(true, active ?? null);
633
+ else
634
+ this.list.start(how === 'key');
635
+ this.toggled({ open: true });
636
+ }
637
+ /** CMB-30: the list closes, for `reason`. `open` is false, and the list no longer takes input, before `toggle` is fired. */
638
+ closeList(reason) {
639
+ if (!this.open)
640
+ return;
641
+ // An `open` the product set over nothing to show was never a list: it is taken back, and nothing closed.
642
+ const was = this.presented;
643
+ this.open = false;
644
+ this.withdraw();
645
+ if (was)
646
+ this.toggled({ open: false, reason });
647
+ }
648
+ /** CMB-27: the person confirmed `option`. `value` is the new one before `change`; the list then closes, so `toggle` follows. */
649
+ choose(option) {
650
+ // CMB-17, CMB-57: an option whose value is empty is not a choice.
651
+ if (option.disabled || option.value === '' || this.inert_ || this.readOnly)
652
+ return;
653
+ this.commit(option.value, option.label);
654
+ this.closeList('select');
655
+ }
656
+ /** CMB-22, CMB-24: into the overlay layer beside the container. Focus stays where it is. */
657
+ present() {
658
+ if (!this.anchored.show())
659
+ return;
660
+ this.presented = true;
661
+ // CMB-23: the whole of the chosen option is in view when the list opens.
662
+ this.list.reveal();
663
+ if (!this.inline)
664
+ this.dismiss.start();
665
+ }
666
+ /** CMB-30, CMB-45: out of it, fading; closed or closing it takes no pointer input. */
667
+ withdraw(fade = true) {
668
+ if (!this.presented)
669
+ return;
670
+ this.presented = false;
671
+ if (this.dismiss.active) {
672
+ this.dismiss.closeOwned();
673
+ this.dismiss.stop();
674
+ }
675
+ this.anchored.hide(fade);
676
+ }
677
+ // ── CMB-16, CMB-21, CMB-26 … CMB-30: the input's keys ─────────────────────────────────────────────────────────
678
+ onKeyDown(event) {
679
+ if (event.defaultPrevented || this.inert_)
680
+ return;
681
+ // CMB-16: while an input method composes, every key is its own.
682
+ if (event.isComposing || this.native.composing || event.keyCode === 229)
683
+ return;
684
+ const { key } = event;
685
+ if (key === 'Tab') {
686
+ this.tabbing = true;
687
+ setTimeout(() => (this.tabbing = false), 0);
688
+ return;
689
+ }
690
+ if (key === 'Enter') {
691
+ this.enter(event);
692
+ return;
693
+ }
694
+ if (this.readOnly)
695
+ return;
696
+ const open = this.open && this.presented;
697
+ if (key === 'Escape') {
698
+ if (open) {
699
+ // CMB-30: the key closes the list and goes no further.
700
+ event.preventDefault();
701
+ event.stopPropagation();
702
+ this.closeList('escape');
703
+ }
704
+ else if (this.editing && this.text !== this.committedText) {
705
+ // CMB-30: a second Escape restores the committed value's text, and never clears a value.
706
+ event.preventDefault();
707
+ event.stopPropagation();
708
+ this.restore();
709
+ this.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true, inputType: 'historyUndo' }));
710
+ }
711
+ return;
712
+ }
713
+ if (event.ctrlKey || event.metaKey || event.shiftKey)
714
+ return;
715
+ if (key === 'ArrowDown' || key === 'ArrowUp') {
716
+ if (!open) {
717
+ // CMB-21: with or without Alt, the list opens with every option.
718
+ this.openList('key');
719
+ if (this.open)
720
+ event.preventDefault();
721
+ return;
722
+ }
723
+ event.preventDefault();
724
+ const { options } = this.shown;
725
+ // CMB-26: where a custom value is allowed, Up Arrow on the first gives Enter back to the text.
726
+ if (key === 'ArrowUp' && this.allowCustomValue && options.length > 0 && this.list.active?.element === options[0].element)
727
+ this.list.setActive(null, true);
728
+ else
729
+ this.list.key(key);
730
+ return;
731
+ }
732
+ // CMB-26: the page keys move by ten; Home, End, Left and Right Arrow are the text's.
733
+ if ((key === 'PageDown' || key === 'PageUp') && open) {
734
+ event.preventDefault();
735
+ this.list.key(key);
736
+ }
737
+ }
738
+ /**
739
+ * CMB-27, CMB-28: Enter. With an option active it chooses it and does nothing else. With none it commits the text —
740
+ * and where the text names nothing and no custom value is allowed, keeps it and keeps or opens the list — then fires
741
+ * `action` after any `change` it caused, and asks the form to submit unless `action` was cancelled.
742
+ */
743
+ enter(event) {
744
+ if (this.open && this.presented && this.list.active) {
745
+ event.preventDefault();
746
+ if (!this.readOnly)
747
+ this.list.activate(event);
748
+ return;
749
+ }
750
+ if (!this.resolve()) {
751
+ event.preventDefault();
752
+ if (!this.open)
753
+ this.openList('text', null);
754
+ return;
755
+ }
756
+ if (this.open)
757
+ this.closeList('commit');
758
+ const action = new CustomEvent('action', { bubbles: true, composed: true, cancelable: true, detail: { value: this.value, inputValue: this.text } });
759
+ // Its own form, or the form of the element composed around it (src/primitives/default-button.ts, `formOf`).
760
+ const form = this.dispatchEvent(action) ? formOf(this, this.form) : null;
761
+ if (form) {
762
+ event.preventDefault();
763
+ pressDefaultButton(form);
764
+ }
765
+ }
766
+ onFocus() {
767
+ this.focused = true;
768
+ // CMB-15: where style queries are missing, the focus style is read when focus arrives.
769
+ syncFocusStyle(this, this.renderRoot.querySelector('.field'));
770
+ }
771
+ onBlur() {
772
+ this.focused = false;
773
+ }
774
+ /** The clear button's Tab leaves the combobox too. */
775
+ onFieldKeyDown(event) {
776
+ if (event.key !== 'Tab' || this.tabbing)
777
+ return;
778
+ this.tabbing = true;
779
+ setTimeout(() => (this.tabbing = false), 0);
780
+ }
781
+ /**
782
+ * CMB-29: focus leaves the combobox — the input and, while it is shown, the clear button. The text is resolved, or
783
+ * given up where it names nothing; the active option is not chosen; an open list closes with the reason tab or
784
+ * focus-out. Focus that leaves the window has gone nowhere: nothing is resolved until it goes elsewhere in the page.
785
+ */
786
+ onFocusOut(event) {
787
+ const next = event.relatedTarget;
788
+ if (next && this.renderRoot.contains(next))
789
+ return;
790
+ if (!next && !document.hasFocus())
791
+ return;
792
+ if (this.inert_ || this.readOnly)
793
+ return;
794
+ if (!this.resolve())
795
+ this.restore();
796
+ this.closeList(this.tabbing ? 'tab' : 'focus-out');
797
+ }
798
+ /**
799
+ * CMB-14: a press on the container's padding or on a decorative glyph moves focus to the input and does nothing
800
+ * else. A press in the input places the caret; the clear button and the chevron answer their own click, and focus
801
+ * stays where it is (the clear button is reached by Tab).
802
+ */
803
+ onContainerPress(event) {
804
+ if (event.button !== 0)
805
+ return;
806
+ const target = event.target;
807
+ if (target.closest('.input'))
808
+ return;
809
+ // The press must not take the focus it gives — nor take it from the input: where a pressed button takes no focus
810
+ // (Safari), a press on the clear button or the chevron would leave the field, and resolve the text.
811
+ event.preventDefault();
812
+ if (!this.inert_ && !target.closest('.chevron, .clear-box'))
813
+ this.focus();
814
+ }
815
+ /** CMB-19: a press on the chevron opens the list while it is closed and closes it while it is open; focus is the input's. */
816
+ onChevron() {
817
+ if (this.inert_ || this.readOnly)
818
+ return;
819
+ this.focus({ preventScroll: true });
820
+ if (this.open && this.presented)
821
+ this.closeList('press');
822
+ else
823
+ this.openList('press');
824
+ }
825
+ /**
826
+ * CMB-20: the clear button empties the text and the value: `input` once with the empty text, `change` once while the
827
+ * value was not empty, focus to the input, and the list left as it is — showing every option while open.
828
+ */
829
+ onClear() {
830
+ if (this.inert_ || this.readOnly)
831
+ return;
832
+ const had = this.value !== '';
833
+ this.value = '';
834
+ this.ownValue = '';
835
+ this.write('');
836
+ this.settle();
837
+ this.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true, inputType: 'deleteContentBackward' }));
838
+ if (had)
839
+ this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true, detail: { value: '', inputValue: '' } }));
840
+ this.focus();
841
+ }
842
+ onLeadingSlotChange(event) {
843
+ const slot = event.target;
844
+ this.hasLeading = slot.assignedNodes({ flatten: true }).some((node) => node.nodeType === Node.ELEMENT_NODE || !!node.textContent?.trim());
845
+ // CMB-18: the slot's content is a glyph only.
846
+ void slottedInteractive(slot).then((found) => {
847
+ if (found)
848
+ report(this, 'CMB-18', `the leading-icon slot holds an interactive element (<${found.localName}>); it takes a glyph only`);
849
+ });
850
+ }
851
+ connectedCallback() {
852
+ super.connectedCallback();
853
+ // The list belongs to the overlay the combobox stands in, and closes with it.
854
+ this.unregister = registerOverlay(this, {
855
+ openers: () => [this],
856
+ open: () => this.presented,
857
+ close: () => this.closeList('anchor-hidden'),
858
+ kind: 'combobox',
859
+ });
860
+ // Put back in the page while open: presented again, as mounted.
861
+ if (this.hasUpdated)
862
+ this.requestUpdate();
863
+ }
864
+ disconnectedCallback() {
865
+ super.disconnectedCallback();
866
+ this.unregister?.();
867
+ this.unregister = null;
868
+ // The controllers take the surface out of the top layer and stop listening.
869
+ this.presented = false;
870
+ this.focused = false;
871
+ }
872
+ willUpdate(changed) {
873
+ // The first render already draws the glyphs' room: the light-DOM children are there before the slots say so.
874
+ if (!this.hasUpdated)
875
+ this.hasLeading = [...this.children].some((child) => child.slot === 'leading-icon');
876
+ if (this.inert_)
877
+ this.focused = false;
878
+ // CMB-31: a value or a text the product set. A value shows its text and ends an edit; a text is shown, and the list
879
+ // is filtered by it as by typed text. Neither fires anything.
880
+ const valueSet = changed.has('value') && this.value !== this.ownValue;
881
+ const textSet = changed.has('inputValue') && this.text !== this.ownText;
882
+ if (valueSet) {
883
+ this.ownValue = this.value;
884
+ if (!textSet)
885
+ this.settle();
886
+ }
887
+ if (textSet) {
888
+ this.ownText = this.text;
889
+ this.editing = this.text !== this.committedText;
890
+ this.query = this.editing ? this.text : null;
891
+ this.composedText = false;
892
+ }
893
+ // CMB-17, CMB-31: while the person is not editing, the text is the committed value's — also when the options that
894
+ // name it arrive later. A text the person is editing is never touched.
895
+ if (!this.editing) {
896
+ const text = this.committedText;
897
+ if (text !== this.text) {
898
+ this.inputValue = text;
899
+ this.ownText = text;
900
+ }
901
+ }
902
+ // CMB-24, CMB-26: the list runs for as long as it is shown, from the render that shows it. Opened by the product,
903
+ // the chosen option is the active one — or, over a text that is being edited, what typing would have found.
904
+ const shown = this.open && this.usable && this.isConnected;
905
+ if (shown) {
906
+ if (!this.list.started)
907
+ this.list.start(false, this.editing ? (this.native.composing ? null : this.found(this.shown.options)) : undefined);
908
+ }
909
+ else
910
+ this.list.stop();
911
+ }
912
+ updated(changed) {
913
+ // CMB-16, CMB-31: the text is shown in the element — never into a composition.
914
+ this.show();
915
+ // CMB-8: a floating label whose words, mark or text style changed — its own, or what its Field gives — may wrap.
916
+ if (this.frameChanged || changed.has('label') || changed.has('labelHidden') || changed.has('variant') || changed.has('size'))
917
+ this.floating.measure();
918
+ this.frameChanged = false;
919
+ // CMB-31: the product's `open`, and what makes the list unusable, show or remove the list without `toggle`.
920
+ const want = this.open && this.usable && this.isConnected;
921
+ if (changed.has('inline') && this.presented)
922
+ this.withdraw(false);
923
+ if (want && !this.presented)
924
+ this.present();
925
+ else if (!want && this.presented) {
926
+ // CMB-30: nothing is left to show — the filter left no option, or the product emptied the options and the
927
+ // status: the list closes with the reason empty. Disabled or read-only while open, it is closed and says nothing.
928
+ if (this.open && !this.inert_ && !this.readOnly && this.isConnected)
929
+ this.closeList('empty');
930
+ else {
931
+ this.withdraw();
932
+ if (this.open)
933
+ this.open = false;
934
+ }
935
+ }
936
+ else if (this.presented)
937
+ this.anchored.request();
938
+ // The form's view: the committed value — never the text of an edit — left out while disabled; a missing value while
939
+ // the Field that frames it says it is required (CMB-12, CMB-59). Said through `FormSays`, so that an element
940
+ // composed around the combobox repeats it on its own internals.
941
+ this.says.value(this.inert_ ? null : this.value, this.value);
942
+ if (this.frame.required && this.value === '' && !this.inert_ && !this.readOnly) {
943
+ this.says.validity({ valueMissing: true }, missingValueMessage('text', { errorText: '', requiredText: this.frame.state?.requiredText ?? '', label: this.name_ }), this.input ?? undefined);
944
+ }
945
+ else
946
+ this.says.validity();
947
+ whenParsed(() => this.reports(changed));
948
+ }
949
+ /** What a debug build tells the developer; the combobox still renders. */
950
+ reports(changed) {
951
+ if (!this.isConnected)
952
+ return;
953
+ // CMB-12: a combobox no Field names, with no label of its own, still renders. (A Field with an empty label says so itself: FLD-10.)
954
+ if (!this.label.trim() && !this.frame.state)
955
+ report(this, 'CMB-12', 'label is empty and no field frames it, so the combobox has no accessible name; put it in a field with a label, or give it a label');
956
+ if (this.clearable && this.words.lacks('clearLabel', this.clearLabel))
957
+ report(this, 'CMB-20', 'clearLabel is empty, so the clear button has no accessible name; give it one ("Clear")');
958
+ // CMB-32, CMB-60: only where the row would be drawn — a person typed, or the product opened the list on, a text that
959
+ // matches nothing. (Without the words the list has nothing to show and is not open: `open` is taken back.)
960
+ if (this.emptyAsked && !this.emptyWords && !this.inert_ && !this.readOnly && (this.focused || this.open || changed.has('open'))) {
961
+ this.words.missing('emptyText', { id: 'CMB-32', effect: 'a text that matches nothing draws no row in the list' });
962
+ }
963
+ if (changed.has('filter') && !FILTERS.includes(this.filter))
964
+ report(this, 'CMB-56', `filter "${this.filter}" is not contains or none; it behaves as "contains"`);
965
+ if (changed.has('status') && !STATUSES.includes(this.status))
966
+ report(this, 'CMB-56', `status "${this.status}" is not idle, loading or error; it behaves as "idle"`);
967
+ if (changed.has('separation') && !SEPARATION_VALUES.includes(this.separation)) {
968
+ report(this, 'CMB-44', `separation "${this.separation}" is not auto, divider or gap; it behaves as "auto"`);
969
+ }
970
+ const { options, nested } = this.options$.model;
971
+ // The options are reported when they change — not on every render.
972
+ const signature = `${options.map((option) => `${option.value}\u0001${option.label}`).join('\u0000')}\u0000${nested.length}`;
973
+ if (signature === this.reportedOptions)
974
+ return;
975
+ this.reportedOptions = signature;
976
+ if (options.some((option) => !option.label))
977
+ report(this, 'CMB-57', `an option has an empty label, so it has no accessible name; give each <${OPTION_TAG}> a label or a text`);
978
+ if (options.some((option) => option.value === ''))
979
+ report(this, 'CMB-57', `an option has the empty value, which means that nothing is chosen: it is drawn and cannot be chosen; give each <${OPTION_TAG}> a value`);
980
+ const seen = new Set();
981
+ for (const option of options) {
982
+ if (seen.has(option.value))
983
+ report(this, 'CMB-57', `two options share the value "${option.value}"; the first is the one both stand for`);
984
+ seen.add(option.value);
985
+ }
986
+ if (nested.length)
987
+ report(this, 'CMB-43', `a <${OPTION_GROUP_TAG}> stands inside another; its options are drawn as the outer group's, with no title or separation of its own`);
988
+ }
989
+ /**
990
+ * CMB-32, CMB-33: the status row, after the last option. Its two live regions exist from the moment the list opens —
991
+ * the polite one holds statusText, or the empty text, while idle; the assertive one statusText while the source
992
+ * failed; while loading both are empty, so nothing is announced, and the loading indicator, named by statusText,
993
+ * stands in the text's place.
994
+ */
995
+ renderStatus() {
996
+ const status = this.statusNow;
997
+ const said = status === 'idle' ? this.statusText || (this.emptyShown ? this.emptyWords : '') : '';
998
+ return html `<div part="status" class=${status === 'error' ? 'status error' : 'status'} ?data-shown=${this.statusShown || this.emptyShown}>
999
+ ${status === 'loading' ? html `<tanrei-loading-indicator class="spinner" size="small" label=${this.statusText}></tanrei-loading-indicator>` : nothing}<span class="said" role="status">${said}</span
1000
+ ><span class="said" role="alert">${status === 'error' ? this.statusText : ''}</span>
1001
+ </div>`;
1002
+ }
1003
+ render() {
1004
+ const layout = this.layout;
1005
+ const stacked = layout === 'stacked';
1006
+ const inert = this.inert_;
1007
+ const chosen = this.chosen;
1008
+ const name = this.name_;
1009
+ const expanded = this.open && this.usable;
1010
+ const leading = this.leading;
1011
+ const chevron = this.chevronShown;
1012
+ const clear = this.clearShown;
1013
+ // CMB-8: the label floats in a filled or an outlined box, and nowhere else.
1014
+ const floating = this.labelled;
1015
+ // CMB-7: the asterisk follows a floating label while the Field says so (FLD-25); hidden from assistive technology,
1016
+ // because the required state already says it.
1017
+ const asterisk = floating ? floatingAsterisk(this.asterisked ? 'asterisk' : 'none') : nothing;
1018
+ // CMB-12: the description is what the Field gives — its shown supporting or error text and its optional text.
1019
+ const described = this.frame.description();
1020
+ // CMB-55: typed text is laid out by its own direction once it has a letter to tell it by; until then the input
1021
+ // keeps the layout's direction, so the caret and the placeholder stand at the box's start edge.
1022
+ const own = /\p{L}/u.test(this.text) ? 'auto' : nothing;
1023
+ // The text is the chosen option's label for as long as nobody has changed it: its words are in that option's
1024
+ // language, and in its direction where the option says one (`lang`, `dir` on the option or its group).
1025
+ const said = chosen && this.text === chosen.label ? chosen : null;
1026
+ // CMB-12, CMB-48: the input is an editable combobox named by its own label, else by the Field's — drawn or not, and
1027
+ // never by the placeholder — and described by what the Field gives. They are values written on this element
1028
+ // (`aria-label`; the description as a text of this shadow root), because an id cannot be referenced across a
1029
+ // shadow root. The drawn label and every glyph are kept from assistive technology.
1030
+ return html `
1031
+ <div
1032
+ class="field"
1033
+ data-layout=${layout}
1034
+ ?data-error=${this.inError}
1035
+ ?data-disabled=${inert}
1036
+ ?data-focused=${(this.focused || expanded) && !inert}
1037
+ ?data-labelled=${floating}
1038
+ ?data-has-value=${this.text !== ''}
1039
+ data-leading=${leading ?? nothing}
1040
+ ?data-chevron=${chevron}
1041
+ ?data-clear=${clear}
1042
+ @focusout=${this.onFocusOut}
1043
+ @keydown=${this.onFieldKeyDown}
1044
+ >
1045
+ <div part="container" class="container" data-tanrei-shape aria-disabled=${inert ? 'true' : nothing} @mousedown=${this.onContainerPress}>
1046
+ <span part="leading-icon" class="icon leading-slot" aria-hidden="true"><slot name="leading-icon" @slotchange=${this.onLeadingSlotChange}></slot></span>
1047
+ <span part="leading-icon" class="icon leading-own" aria-hidden="true"><span class="ink">${leading === 'option' ? chosen?.leadingIcon : nothing}</span></span>
1048
+ <div class="body">
1049
+ <input
1050
+ id="input"
1051
+ part="input"
1052
+ class="input"
1053
+ type="text"
1054
+ role="combobox"
1055
+ autocomplete="off"
1056
+ autocapitalize="none"
1057
+ autocorrect="off"
1058
+ spellcheck="false"
1059
+ lang=${said?.lang || nothing}
1060
+ dir=${said?.dir || own}
1061
+ .placeholder=${this.placeholder}
1062
+ ?disabled=${inert}
1063
+ ?readonly=${this.readOnly}
1064
+ aria-label=${name || nothing}
1065
+ aria-describedby=${described ? 'description' : nothing}
1066
+ aria-invalid=${this.inError ? 'true' : nothing}
1067
+ aria-required=${this.frame.required ? 'true' : nothing}
1068
+ aria-readonly=${this.readOnly ? 'true' : nothing}
1069
+ aria-autocomplete="list"
1070
+ aria-haspopup="listbox"
1071
+ aria-expanded=${expanded ? 'true' : 'false'}
1072
+ aria-controls=${expanded ? 'list' : nothing}
1073
+ aria-activedescendant=${(expanded && this.list.activeId) || nothing}
1074
+ @input=${this.onInput}
1075
+ @keydown=${this.onKeyDown}
1076
+ @focus=${this.onFocus}
1077
+ @blur=${this.onBlur}
1078
+ @compositionstart=${this.native.onCompositionStart}
1079
+ @compositionend=${this.native.onCompositionEnd}
1080
+ />
1081
+ </div>
1082
+ ${clear
1083
+ ? html `<span class="clear-box"
1084
+ ><tanrei-button part="clear-button" class="clear" variant="text" size="small" label=${this.words.get('clearLabel', this.clearLabel)} @click=${this.onClear}
1085
+ ><span slot="icon" class="clear-glyph"><span class="ink">close</span></span></tanrei-button
1086
+ ></span
1087
+ >`
1088
+ : nothing}${chevron
1089
+ ? html `<button part="chevron" class="chevron" type="button" tabindex="-1" aria-label=${name} aria-expanded=${expanded ? 'true' : 'false'} ?disabled=${inert} @click=${this.onChevron}>
1090
+ <span class="icon chevron-glyph" aria-hidden="true"><span class="ink">expand_more</span></span>
1091
+ </button>`
1092
+ : nothing}
1093
+ ${floatingLabel({ floating, label: name, asterisk })} ${triggerEdges({ stacked, floating, label: name, asterisk })}
1094
+ </div>
1095
+ <span id="name" hidden>${name}</span>
1096
+ ${described ? html `<span id="description" hidden>${described}</span>` : nothing}
1097
+ </div>
1098
+ ${this.list.render({ labelledBy: 'name', inline: this.inline, text: this.labelText, after: this.renderStatus(), tail: this.statusShown || this.emptyShown, busy: this.statusNow === 'loading' })}
1099
+ `;
1100
+ }
1101
+ }
1102
+ // Its `disabled` attribute, written while it holds focus, waits until focus has left: a frame at most.
1103
+ disabledWaitsWhileFocused(TanreiCombobox);
1104
+ // `autofocus` on it gives it focus when the page first loads too (src/primitives/autofocus.ts).
1105
+ focusedAtFirst(TanreiCombobox);
1106
+ if (!customElements.get('tanrei-combobox'))
1107
+ customElements.define('tanrei-combobox', TanreiCombobox);
1108
+ //# sourceMappingURL=combobox.js.map