@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,33 @@
1
+ /** The rows of one document that name one group, and the choice they share (TAB-36). */
2
+ export interface SharedChoice<Member> {
3
+ readonly name: string;
4
+ /** The rows that are in the document now. A row that leaves it is taken out (TAB-41). */
5
+ readonly members: Set<Member>;
6
+ /** The value of a tab, or null until a person, the product or the storage gives the group one (TAB-37, TAB-39). */
7
+ choice: string | null;
8
+ }
9
+ /**
10
+ * TAB-36, TAB-41: the group `name` of `document` — made the first time it is named, and kept, with its choice, for as
11
+ * long as the document lasts, with or without members. The name is compared exactly.
12
+ */
13
+ export declare function sharedChoice<Member>(document: Document, name: string): SharedChoice<Member>;
14
+ /**
15
+ * TAB-39, TAB-41: the value stored under exactly `key`, or null — read from the storage at most once for a key in the
16
+ * life of the document, and afterwards what was last read or written. A storage that is missing, blocked or throws is
17
+ * the same as nothing stored, and nothing is raised or reported.
18
+ */
19
+ export declare function remembered(document: Document, key: string): string | null;
20
+ /**
21
+ * TAB-39: stores `value`, and nothing else, under exactly `key`. A storage that is missing, blocked or full keeps
22
+ * nothing: the choice then lasts as long as the document does (what `remembered()` answers), and nothing is raised or
23
+ * reported.
24
+ */
25
+ export declare function remember(document: Document, key: string, value: string): void;
26
+ /**
27
+ * TAB-40, TBV-21: `element` was at `top` in the window before the choice changed what lies before it. Moves the regions
28
+ * it scrolls in — the nearest first, each as far as it goes — by what is left of the difference, at once and without a
29
+ * scrolling motion. A browser that anchors scrolling itself has by now moved some or all of the way, so only what is
30
+ * left is corrected and the two never add up. Where scroll positions are whole pixels the element ends within half a
31
+ * pixel of where it was.
32
+ */
33
+ export declare function keepInPlace(element: Element, top: number): void;
@@ -0,0 +1,110 @@
1
+ // What rows of tabs that share a choice have in common (TAB-36…41): one registry for a document, kept by this module
2
+ // and never in the DOM. A group is a name, its members and its choice; what a person chose is remembered under the
3
+ // product's own key, read once for a key and written once for a choice, however many rows name it.
4
+ const documents = new WeakMap();
5
+ function sharedBy(document) {
6
+ let shared = documents.get(document);
7
+ if (!shared) {
8
+ shared = { groups: new Map(), stored: new Map() };
9
+ documents.set(document, shared);
10
+ }
11
+ return shared;
12
+ }
13
+ /**
14
+ * TAB-36, TAB-41: the group `name` of `document` — made the first time it is named, and kept, with its choice, for as
15
+ * long as the document lasts, with or without members. The name is compared exactly.
16
+ */
17
+ export function sharedChoice(document, name) {
18
+ const { groups } = sharedBy(document);
19
+ let group = groups.get(name);
20
+ if (!group) {
21
+ group = { name, members: new Set(), choice: null };
22
+ groups.set(name, group);
23
+ }
24
+ return group;
25
+ }
26
+ /** The storage the origin keeps across pages and visits, or null where there is none; reaching for it may itself throw. */
27
+ function storage(document) {
28
+ try {
29
+ return document.defaultView?.localStorage ?? null;
30
+ }
31
+ catch {
32
+ return null;
33
+ }
34
+ }
35
+ /**
36
+ * TAB-39, TAB-41: the value stored under exactly `key`, or null — read from the storage at most once for a key in the
37
+ * life of the document, and afterwards what was last read or written. A storage that is missing, blocked or throws is
38
+ * the same as nothing stored, and nothing is raised or reported.
39
+ */
40
+ export function remembered(document, key) {
41
+ const { stored } = sharedBy(document);
42
+ if (stored.has(key))
43
+ return stored.get(key) ?? null;
44
+ let value = null;
45
+ try {
46
+ value = storage(document)?.getItem(key) ?? null;
47
+ }
48
+ catch {
49
+ value = null;
50
+ }
51
+ stored.set(key, value);
52
+ return value;
53
+ }
54
+ /**
55
+ * TAB-39: stores `value`, and nothing else, under exactly `key`. A storage that is missing, blocked or full keeps
56
+ * nothing: the choice then lasts as long as the document does (what `remembered()` answers), and nothing is raised or
57
+ * reported.
58
+ */
59
+ export function remember(document, key, value) {
60
+ sharedBy(document).stored.set(key, value);
61
+ try {
62
+ storage(document)?.setItem(key, value);
63
+ }
64
+ catch {
65
+ // A person who blocks storage has made a choice, not a mistake.
66
+ }
67
+ }
68
+ /** The regions `element` scrolls in up and down, nearest first, across shadow trees, ending with the document's own. */
69
+ function scrollRegions(element) {
70
+ const regions = [];
71
+ const document = element.ownerDocument;
72
+ const up = (node) => node.assignedSlot ?? node.parentElement ?? node.getRootNode().host ?? null;
73
+ for (let node = up(element); node && node !== document.documentElement; node = up(node)) {
74
+ if (node.scrollHeight - node.clientHeight < 1)
75
+ continue;
76
+ const overflow = getComputedStyle(node).overflowY;
77
+ if (overflow === 'auto' || overflow === 'scroll' || overflow === 'overlay')
78
+ regions.push(node);
79
+ }
80
+ const page = document.scrollingElement;
81
+ if (page && !regions.includes(page))
82
+ regions.push(page);
83
+ return regions;
84
+ }
85
+ /**
86
+ * TAB-40, TBV-21: `element` was at `top` in the window before the choice changed what lies before it. Moves the regions
87
+ * it scrolls in — the nearest first, each as far as it goes — by what is left of the difference, at once and without a
88
+ * scrolling motion. A browser that anchors scrolling itself has by now moved some or all of the way, so only what is
89
+ * left is corrected and the two never add up. Where scroll positions are whole pixels the element ends within half a
90
+ * pixel of where it was.
91
+ */
92
+ export function keepInPlace(element, top) {
93
+ const left = () => element.getBoundingClientRect().top - top;
94
+ let moved = left();
95
+ if (Math.abs(moved) < 0.01)
96
+ return;
97
+ for (const region of scrollRegions(element)) {
98
+ region.scrollBy({ top: moved, behavior: 'instant' });
99
+ moved = left();
100
+ // A browser that keeps whole scroll positions drops the fraction of the distance: the next whole position is the
101
+ // nearer one when more than half a pixel is left.
102
+ if (Math.abs(moved) > 0.5 && Math.abs(moved) < 1) {
103
+ region.scrollBy({ top: Math.sign(moved), behavior: 'instant' });
104
+ moved = left();
105
+ }
106
+ if (Math.abs(moved) < 0.01)
107
+ return;
108
+ }
109
+ }
110
+ //# sourceMappingURL=shared-choice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-choice.js","sourceRoot":"","sources":["../../src/primitives/shared-choice.ts"],"names":[],"mappings":"AAAA,qHAAqH;AACrH,mHAAmH;AACnH,mGAAmG;AAiBnG,MAAM,SAAS,GAAG,IAAI,OAAO,EAAoB,CAAC;AAElD,SAAS,QAAQ,CAAC,QAAkB;IAClC,IAAI,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,EAAE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;QAClD,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAS,QAAkB,EAAE,IAA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AAE,GAAW;IACvD,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC;IAC7D,IAAI,KAAK,GAAG,IAAI,EAAE,CAAC;IACnB,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI;QAAE,OAAO;IACnC,KAAK,MAAM,MAAM,IAAI,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5C,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;QACrD,KAAK,GAAG,IAAI,EAAE,CAAC;QACf,iHAAiH;QACjH,kDAAkD;QAClD,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACjD,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;YAChE,KAAK,GAAG,IAAI,EAAE,CAAC;QACjB,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI;YAAE,OAAO;IACrC,CAAC;AACH,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * What the sheets share (the bottom sheet, BSH-5 and BSH-9; the side sheet, SSH-4): the drag's two gesture constants,
3
+ * a drag along one axis that knows its slop and its velocity, a modal sheet's keys, the reason a native close request
4
+ * carries, the on-screen keyboard's cover and a press on a modal sheet's scrim. Each sheet keeps its own geometry and
5
+ * its own close reasons.
6
+ */
7
+ /**
8
+ * How far a pointer must move along the sheet's axis before the sheet follows it (BSH-9). The web names no touch slop
9
+ * of its own, so the spec's 8 points (px).
10
+ */
11
+ export declare const SHEET_TOUCH_SLOP = 8;
12
+ /** A release at least this fast along the axis is a fling (BSH-9), in px per ms: the web names no minimum of its own. */
13
+ export declare const SHEET_FLING_VELOCITY = 0.5;
14
+ /** What a move did to a drag: nothing yet, it just started following, it follows, or it is not the sheet's (across the axis). */
15
+ export type SheetDragStep = 'wait' | 'start' | 'follow' | 'reject';
16
+ /**
17
+ * One pointer's drag along one axis (`y` for a bottom sheet, `x` for a side sheet). It does not follow before it has
18
+ * moved `SHEET_TOUCH_SLOP` along the axis, more than across it; a drag that goes across first is not the sheet's. Its
19
+ * velocity is measured over the last `VELOCITY_WINDOW` ms, in px per ms along the axis (positive: toward larger
20
+ * coordinates, down or right).
21
+ */
22
+ export declare class SheetDrag {
23
+ private readonly axis;
24
+ readonly id: number;
25
+ readonly startX: number;
26
+ readonly startY: number;
27
+ following: boolean;
28
+ rejected: boolean;
29
+ /** The pointer's position along the axis at the last move. */
30
+ last: number;
31
+ private readonly samples;
32
+ constructor(event: PointerEvent, axis: 'x' | 'y');
33
+ private along;
34
+ /** The distance from where the drag began, along the axis. */
35
+ distance(event: PointerEvent): number;
36
+ /** Feeds one move. */
37
+ move(event: PointerEvent): SheetDragStep;
38
+ /** The move since the last call, along the axis (and remembers this position). */
39
+ delta(event: PointerEvent): number;
40
+ /** The velocity at release, px per ms along the axis; 0 when the pointer had stopped. */
41
+ velocity(event: PointerEvent): number;
42
+ }
43
+ /**
44
+ * Why a modal sheet's native `<dialog>` fired `cancel` (a close request): `escape` when an Escape key has just been
45
+ * pressed (focus was somewhere the sheet's own `keydown` did not see it), otherwise the platform's `back` (Android's
46
+ * back gesture or button). Call `watchEscape()` once a sheet can be shown.
47
+ */
48
+ export declare function closeRequestReason(event: Event): 'escape' | 'back';
49
+ /**
50
+ * A modal sheet's keys, from its `<dialog>`'s `keydown` (BSH-2, BSH-5, BSH-23; SSH-2, SSH-4, SSH-15): Escape asks to
51
+ * close — unless something answered it already or an overlay opened from the sheet's content is above it — and the
52
+ * browser's own close request never runs; Tab stays inside the dialog.
53
+ */
54
+ export declare function modalSheetKeys(event: KeyboardEvent, dialog: HTMLDialogElement, escape: () => void): void;
55
+ /** Starts watching Escape for `closeRequestReason()` (once per window). */
56
+ export declare function watchEscape(): void;
57
+ /**
58
+ * How much of an area whose bottom edge is at `bottom` (viewport px; the layout viewport's bottom when omitted) the
59
+ * on-screen keyboard covers: the part of the layout viewport below the visual viewport (BSH-6, BSH-7).
60
+ */
61
+ export declare function keyboardCover(bottom?: number): number;
62
+ /** Whether a press on a modal `<dialog>` landed on its `::backdrop` (the scrim): on the dialog itself, outside its box. */
63
+ export declare function onBackdrop(event: MouseEvent, dialog: HTMLDialogElement | null): boolean;
@@ -0,0 +1,139 @@
1
+ import { trapFocus } from './modal.js';
2
+ /**
3
+ * What the sheets share (the bottom sheet, BSH-5 and BSH-9; the side sheet, SSH-4): the drag's two gesture constants,
4
+ * a drag along one axis that knows its slop and its velocity, a modal sheet's keys, the reason a native close request
5
+ * carries, the on-screen keyboard's cover and a press on a modal sheet's scrim. Each sheet keeps its own geometry and
6
+ * its own close reasons.
7
+ */
8
+ /**
9
+ * How far a pointer must move along the sheet's axis before the sheet follows it (BSH-9). The web names no touch slop
10
+ * of its own, so the spec's 8 points (px).
11
+ */
12
+ export const SHEET_TOUCH_SLOP = 8;
13
+ /** A release at least this fast along the axis is a fling (BSH-9), in px per ms: the web names no minimum of its own. */
14
+ export const SHEET_FLING_VELOCITY = 0.5;
15
+ /** How far back the velocity of a release looks, in ms: a pointer that stopped longer ago than this releases at rest. */
16
+ const VELOCITY_WINDOW = 80;
17
+ /**
18
+ * One pointer's drag along one axis (`y` for a bottom sheet, `x` for a side sheet). It does not follow before it has
19
+ * moved `SHEET_TOUCH_SLOP` along the axis, more than across it; a drag that goes across first is not the sheet's. Its
20
+ * velocity is measured over the last `VELOCITY_WINDOW` ms, in px per ms along the axis (positive: toward larger
21
+ * coordinates, down or right).
22
+ */
23
+ export class SheetDrag {
24
+ constructor(event, axis) {
25
+ this.axis = axis;
26
+ this.following = false;
27
+ this.rejected = false;
28
+ this.samples = [];
29
+ this.id = event.pointerId;
30
+ this.startX = event.clientX;
31
+ this.startY = event.clientY;
32
+ this.last = this.along(event);
33
+ this.samples.push({ at: this.last, time: event.timeStamp });
34
+ }
35
+ along(event) {
36
+ return this.axis === 'y' ? event.clientY : event.clientX;
37
+ }
38
+ /** The distance from where the drag began, along the axis. */
39
+ distance(event) {
40
+ return this.along(event) - (this.axis === 'y' ? this.startY : this.startX);
41
+ }
42
+ /** Feeds one move. */
43
+ move(event) {
44
+ if (event.pointerId !== this.id || this.rejected)
45
+ return 'wait';
46
+ const at = this.along(event);
47
+ this.samples.push({ at, time: event.timeStamp });
48
+ while (this.samples.length > 2 && event.timeStamp - this.samples[0].time > VELOCITY_WINDOW)
49
+ this.samples.shift();
50
+ if (this.following)
51
+ return 'follow';
52
+ const along = Math.abs(this.distance(event));
53
+ const across = Math.abs(this.axis === 'y' ? event.clientX - this.startX : event.clientY - this.startY);
54
+ if (along > SHEET_TOUCH_SLOP && along > across) {
55
+ this.following = true;
56
+ return 'start';
57
+ }
58
+ if (across > SHEET_TOUCH_SLOP && across >= along)
59
+ this.rejected = true;
60
+ return 'wait';
61
+ }
62
+ /** The move since the last call, along the axis (and remembers this position). */
63
+ delta(event) {
64
+ const at = this.along(event);
65
+ const moved = at - this.last;
66
+ this.last = at;
67
+ return moved;
68
+ }
69
+ /** The velocity at release, px per ms along the axis; 0 when the pointer had stopped. */
70
+ velocity(event) {
71
+ const recent = this.samples.filter((sample) => event.timeStamp - sample.time <= VELOCITY_WINDOW);
72
+ if (recent.length < 2)
73
+ return 0;
74
+ const first = recent[0];
75
+ const last = recent[recent.length - 1];
76
+ const time = last.time - first.time;
77
+ return time > 0 ? (last.at - first.at) / time : 0;
78
+ }
79
+ }
80
+ /** The last Escape key seen in this window, so a native `cancel` can tell Escape from the platform's back. */
81
+ let lastEscape = Number.NEGATIVE_INFINITY;
82
+ let watching = false;
83
+ /**
84
+ * Why a modal sheet's native `<dialog>` fired `cancel` (a close request): `escape` when an Escape key has just been
85
+ * pressed (focus was somewhere the sheet's own `keydown` did not see it), otherwise the platform's `back` (Android's
86
+ * back gesture or button). Call `watchEscape()` once a sheet can be shown.
87
+ */
88
+ export function closeRequestReason(event) {
89
+ return event.timeStamp - lastEscape < 1000 ? 'escape' : 'back';
90
+ }
91
+ /**
92
+ * A modal sheet's keys, from its `<dialog>`'s `keydown` (BSH-2, BSH-5, BSH-23; SSH-2, SSH-4, SSH-15): Escape asks to
93
+ * close — unless something answered it already or an overlay opened from the sheet's content is above it — and the
94
+ * browser's own close request never runs; Tab stays inside the dialog.
95
+ */
96
+ export function modalSheetKeys(event, dialog, escape) {
97
+ if (event.key === 'Escape') {
98
+ if (event.defaultPrevented)
99
+ return;
100
+ if (event.composedPath().some((node) => node instanceof HTMLDialogElement && node !== dialog && node.open))
101
+ return;
102
+ event.preventDefault();
103
+ event.stopPropagation();
104
+ escape();
105
+ return;
106
+ }
107
+ if (event.key === 'Tab')
108
+ trapFocus(event, dialog);
109
+ }
110
+ /** Starts watching Escape for `closeRequestReason()` (once per window). */
111
+ export function watchEscape() {
112
+ if (watching || typeof window === 'undefined')
113
+ return;
114
+ watching = true;
115
+ window.addEventListener('keydown', (event) => {
116
+ if (event.key === 'Escape')
117
+ lastEscape = event.timeStamp;
118
+ }, { capture: true });
119
+ }
120
+ /**
121
+ * How much of an area whose bottom edge is at `bottom` (viewport px; the layout viewport's bottom when omitted) the
122
+ * on-screen keyboard covers: the part of the layout viewport below the visual viewport (BSH-6, BSH-7).
123
+ */
124
+ export function keyboardCover(bottom) {
125
+ const viewport = typeof window === 'undefined' ? null : window.visualViewport;
126
+ if (!viewport)
127
+ return 0;
128
+ const layout = document.documentElement.clientHeight;
129
+ const edge = bottom === undefined ? layout : Math.min(bottom, layout);
130
+ return Math.max(0, edge - (viewport.offsetTop + viewport.height));
131
+ }
132
+ /** Whether a press on a modal `<dialog>` landed on its `::backdrop` (the scrim): on the dialog itself, outside its box. */
133
+ export function onBackdrop(event, dialog) {
134
+ if (!dialog || event.composedPath()[0] !== dialog)
135
+ return false;
136
+ const box = dialog.getBoundingClientRect();
137
+ return event.clientX < box.left || event.clientX > box.right || event.clientY < box.top || event.clientY > box.bottom;
138
+ }
139
+ //# sourceMappingURL=sheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../src/primitives/sheet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC;;;;;GAKG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,yHAAyH;AACzH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAExC,yHAAyH;AACzH,MAAM,eAAe,GAAG,EAAE,CAAC;AAK3B;;;;;GAKG;AACH,MAAM,OAAO,SAAS;IAUpB,YACE,KAAmB,EACF,IAAe;QAAf,SAAI,GAAJ,IAAI,CAAW;QARlC,cAAS,GAAG,KAAK,CAAC;QAClB,aAAQ,GAAG,KAAK,CAAC;QAGA,YAAO,GAAmC,EAAE,CAAC;QAM5D,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9D,CAAC;IAEO,KAAK,CAAC,KAAmB;QAC/B,OAAO,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;IAC3D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MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC;IACrD,MAAM,IAAI,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,2HAA2H;AAC3H,MAAM,UAAU,UAAU,CAAC,KAAiB,EAAE,MAAgC;IAC5E,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IAChE,MAAM,GAAG,GAAG,MAAM,CAAC,qBAAqB,EAAE,CAAC;IAC3C,OAAO,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC,GAAG,IAAI,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC;AACxH,CAAC"}
@@ -0,0 +1,8 @@
1
+ /** Adds `sheet` to `root`, unless the root has it: one write of `adoptedStyleSheets` for a sheet and a root, ever. */
2
+ export declare function adopt(root: Node, sheet: CSSStyleSheet | null | undefined): void;
3
+ /**
4
+ * Adds `sheet` to the root `element` stands in, unless that root draws the element already — it has the sheet, or the
5
+ * page loaded the same rules as a stylesheet of its own (`mark` is a custom property the sheet sets on every element
6
+ * of this element's kind, and on nothing else).
7
+ */
8
+ export declare function adoptUnlessDrawn(element: Element, sheet: CSSStyleSheet | null | undefined, mark: `--${string}`): void;
@@ -0,0 +1,96 @@
1
+ // Adding a stylesheet to the root an element stands in — the document or a shadow root — and what it costs the page.
2
+ //
3
+ // A component that is drawn in the light DOM, or that draws the product's own children from outside its
4
+ // shadow root, has ONE stylesheet: the page loads it (`@tanrei/web/<name>.css`) to draw the component before any
5
+ // script runs, and the element carries the same text and adds it to its root, so that it is drawn without the page's
6
+ // copy and inside a product's own shadow root.
7
+ //
8
+ // A root that already has the rules must not get them a second time. A sheet added to the DOCUMENT has the browser
9
+ // build the document's rules again, and — where the sheet holds an `@property`, a layer or a selector that no tag or
10
+ // class narrows — style every element of the page again: on a long page each such write costs 60 to 90 ms, once per
11
+ // component whose module arrived. So:
12
+ //
13
+ // - `adopt()` writes `adoptedStyleSheets` only when the sheet is not in the list (by identity), and never assigns a
14
+ // list that says what the root already has;
15
+ // - `adoptUnlessDrawn()` first asks the cascade whether the root draws the element already: a name the stylesheet
16
+ // sets on the element itself. The cascade is the truth — a page that loaded the sheet into a layer of its own, or
17
+ // inside a bundle, answers the same — and it is asked once for a root and a sheet while the root's own stylesheets
18
+ // stay as many as they were: not once per instance, and not once per turn.
19
+ const isRoot = (node) => 'adoptedStyleSheets' in node;
20
+ /** Adds `sheet` to `root`, unless the root has it: one write of `adoptedStyleSheets` for a sheet and a root, ever. */
21
+ export function adopt(root, sheet) {
22
+ if (!sheet || !isRoot(root) || root.adoptedStyleSheets.includes(sheet))
23
+ return;
24
+ root.adoptedStyleSheets = [...root.adoptedStyleSheets, sheet];
25
+ }
26
+ /** What an element inherits from: its slot where it has one, else its parent, else the host of its shadow root. */
27
+ function inheritsFrom(element) {
28
+ if (element.assignedSlot)
29
+ return element.assignedSlot;
30
+ const parent = element.parentNode;
31
+ if (parent instanceof Element)
32
+ return parent;
33
+ return parent instanceof ShadowRoot ? parent.host : null;
34
+ }
35
+ /**
36
+ * The element whose answer is the root's: the outermost one of `element`'s own kind among its ancestors in the same
37
+ * root, or `element` itself. An element inside one of its own kind (an accordion in an item of an accordion) inherits
38
+ * the name with the very value its own rule gives it, so its parent would answer for it whether the root has the rule
39
+ * or not; the outermost one inherits from nothing of its kind that the root's rules reach.
40
+ */
41
+ function outermost(element) {
42
+ let subject = element;
43
+ for (let ancestor = element.parentElement; ancestor; ancestor = ancestor.parentElement) {
44
+ if (ancestor.localName === element.localName)
45
+ subject = ancestor;
46
+ }
47
+ return subject;
48
+ }
49
+ /**
50
+ * Whether the rules that set `mark` on `element` are in its root's cascade: the name has a value on the element — on
51
+ * the outermost of its kind in that root — which is not simply what it inherits (a custom property inherits, and an
52
+ * element of the same kind around this one in ANOTHER root, its own sheet drawing it, would answer for a root that
53
+ * has no such rule).
54
+ */
55
+ function drawn(element, mark) {
56
+ const subject = outermost(element);
57
+ const value = getComputedStyle(subject).getPropertyValue(mark).trim();
58
+ if (value === '')
59
+ return false;
60
+ const from = inheritsFrom(subject);
61
+ return !from || getComputedStyle(from).getPropertyValue(mark).trim() !== value;
62
+ }
63
+ /**
64
+ * The sheets each root was found to draw already, with the number of stylesheets the root had when it answered. The
65
+ * answer is kept while that number stands — a page's stylesheets do not come and go with its elements — so the
66
+ * cascade is asked ONCE for a root and a sheet, not once for each turn in which an element is connected: the question
67
+ * is a read of computed style inside the script that connected the element, and has the browser style (and, on a page
68
+ * with container queries, lay out) whatever that script has written so far. A root that gains or loses a stylesheet
69
+ * is asked again.
70
+ */
71
+ const found = new WeakMap();
72
+ /** How many stylesheets of its own the root has (linked, written in a `<style>`): reading it styles nothing. */
73
+ const loaded = (root) => root.styleSheets.length;
74
+ /**
75
+ * Adds `sheet` to the root `element` stands in, unless that root draws the element already — it has the sheet, or the
76
+ * page loaded the same rules as a stylesheet of its own (`mark` is a custom property the sheet sets on every element
77
+ * of this element's kind, and on nothing else).
78
+ */
79
+ export function adoptUnlessDrawn(element, sheet, mark) {
80
+ const root = element.getRootNode();
81
+ if (!sheet || !isRoot(root) || root.adoptedStyleSheets.includes(sheet))
82
+ return;
83
+ let sheets = found.get(root);
84
+ if (!sheets)
85
+ found.set(root, (sheets = new Map()));
86
+ const count = loaded(root);
87
+ if (sheets.get(sheet) === count)
88
+ return;
89
+ if (drawn(element, mark))
90
+ sheets.set(sheet, count);
91
+ else {
92
+ sheets.delete(sheet);
93
+ adopt(root, sheet);
94
+ }
95
+ }
96
+ //# sourceMappingURL=sheets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheets.js","sourceRoot":"","sources":["../../src/primitives/sheets.ts"],"names":[],"mappings":"AAAA,qHAAqH;AACrH,EAAE;AACF,wGAAwG;AACxG,iHAAiH;AACjH,qHAAqH;AACrH,+CAA+C;AAC/C,EAAE;AACF,mHAAmH;AACnH,qHAAqH;AACrH,oHAAoH;AACpH,sCAAsC;AACtC,EAAE;AACF,sHAAsH;AACtH,gDAAgD;AAChD,oHAAoH;AACpH,sHAAsH;AACtH,uHAAuH;AACvH,+EAA+E;AAI/E,MAAM,MAAM,GAAG,CAAC,IAAU,EAAgB,EAAE,CAAC,oBAAoB,IAAI,IAAI,CAAC;AAE1E,sHAAsH;AACtH,MAAM,UAAU,KAAK,CAAC,IAAU,EAAE,KAAuC;IACvE,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO;IAC/E,IAAI,CAAC,kBAAkB,GAAG,CAAC,GAAG,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,mHAAmH;AACnH,SAAS,YAAY,CAAC,OAAgB;IACpC,IAAI,OAAO,CAAC,YAAY;QAAE,OAAO,OAAO,CAAC,YAAY,CAAC;IACtD,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAClC,IAAI,MAAM,YAAY,OAAO;QAAE,OAAO,MAAM,CAAC;IAC7C,OAAO,MAAM,YAAY,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3D,CAAC;AAED;;;;;GAKG;AACH,SAAS,SAAS,CAAC,OAAgB;IACjC,IAAI,OAAO,GAAG,OAAO,CAAC;IACtB,KAAK,IAAI,Q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KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK;QAAE,OAAO;IACxC,IAAI,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;QAAE,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;SAC9C,CAAC;QACJ,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrB,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACrB,CAAC;AACH,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { type CSSResult } from 'lit';
2
+ /**
3
+ * Names the element that paints a state, given the state's condition: `(state) => \`button${state}\``. The conditions
4
+ * are `:hover`, `:focus-visible`, `[data-pressed…]` (written by `PressController` on its container) and `:disabled`.
5
+ */
6
+ export type StateSelector = (state: string) => string;
7
+ /**
8
+ * What each state paints: declarations, all from the component's own tokens for that state (container, label, outline,
9
+ * elevation, opacity, `cornerRadius()` of its shape). How a state looks is the design system's decision; the component
10
+ * only says which tokens a state reads.
11
+ */
12
+ export interface StatePaints {
13
+ hovered: string;
14
+ focused: string;
15
+ /** pressed-feedback: overlay — the pressed tokens on the whole container at once. */
16
+ pressed: string;
17
+ /**
18
+ * pressed-feedback: ripple and dim — everything the pressed tokens give EXCEPT the container color, which stays with
19
+ * the state under the press (resting, hovered or focused). The ripple brings the pressed container color as a layer;
20
+ * dim has none.
21
+ */
22
+ pressedContent: string;
23
+ disabled: string;
24
+ }
25
+ /**
26
+ * The state rules and their precedence (BTN-3 / BTN-6 / BTN-8 / BTN-9 and every control after them). Later rules win:
27
+ * pressed > focused > hovered, and disabled over all. Hover only where the primary pointer hovers. The pressed state
28
+ * appears without a transition in; under pressed-feedback: none nothing about the control changes — its transitions
29
+ * included — so there is no rule for it at all.
30
+ *
31
+ * Put it after the component's resting rule. Anything that must win over disabled (forced colors) comes after it.
32
+ */
33
+ export declare function stateRules(on: StateSelector, paint: StatePaints): CSSResult;
@@ -0,0 +1,30 @@
1
+ import { unsafeCSS } from 'lit';
2
+ /**
3
+ * The state rules and their precedence (BTN-3 / BTN-6 / BTN-8 / BTN-9 and every control after them). Later rules win:
4
+ * pressed > focused > hovered, and disabled over all. Hover only where the primary pointer hovers. The pressed state
5
+ * appears without a transition in; under pressed-feedback: none nothing about the control changes — its transitions
6
+ * included — so there is no rule for it at all.
7
+ *
8
+ * Put it after the component's resting rule. Anything that must win over disabled (forced colors) comes after it.
9
+ */
10
+ export function stateRules(on, paint) {
11
+ return unsafeCSS(`
12
+ @media (hover: hover) {
13
+ ${on(':hover')} {${paint.hovered}
14
+ }
15
+ }
16
+ ${on(':focus-visible')} {${paint.focused}
17
+ }
18
+ ${on("[data-pressed]:not([data-pressed='none'])")} {
19
+ transition-duration: 0s;
20
+ }
21
+ ${on("[data-pressed='overlay']")} {${paint.pressed}
22
+ }
23
+ ${on("[data-pressed='ripple']")},
24
+ ${on("[data-pressed='dim']")} {${paint.pressedContent}
25
+ }
26
+ ${on(':disabled')} {${paint.disabled}
27
+ }
28
+ `);
29
+ }
30
+ //# sourceMappingURL=states.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"states.js","sourceRoot":"","sources":["../../src/primitives/states.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,MAAM,KAAK,CAAC;AA2BhD;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,EAAiB,EAAE,KAAkB;IAC9D,OAAO,SAAS,CAAC;;MAEb,EAAE,CAAC,QAAQ,CAAC,KAAK,KAAK,CAAC,OAAO;;;IAGhC,EAAE,CAAC,gBAAgB,CAAC,KAAK,KAAK,CAAC,OAAO;;IAEtC,EAAE,CAAC,2CAA2C,CAAC;;;IAG/C,EAAE,CAAC,0BAA0B,CAAC,KAAK,KAAK,CAAC,OAAO;;IAEhD,EAAE,CAAC,yBAAyB,CAAC;IAC7B,EAAE,CAAC,sBAAsB,CAAC,KAAK,KAAK,CAAC,cAAc;;IAEnD,EAAE,CAAC,WAAW,CAAC,KAAK,KAAK,CAAC,QAAQ;;CAErC,CAAC,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ type Host = ReactiveControllerHost & Element;
3
+ export declare class SystemWatchController implements ReactiveController {
4
+ private readonly host;
5
+ constructor(host: Host);
6
+ hostConnected(): void;
7
+ hostDisconnected(): void;
8
+ }
9
+ export {};
@@ -0,0 +1,29 @@
1
+ const hosts = new Set();
2
+ let observer = null;
3
+ function watch() {
4
+ if (observer || typeof MutationObserver === 'undefined' || typeof document === 'undefined')
5
+ return;
6
+ observer = new MutationObserver(() => {
7
+ for (const host of hosts)
8
+ host.requestUpdate();
9
+ });
10
+ observer.observe(document.documentElement, { attributes: true, attributeFilter: ['data-tanrei-system', 'data-tanrei-theme', 'class', 'style'] });
11
+ }
12
+ export class SystemWatchController {
13
+ constructor(host) {
14
+ this.host = host;
15
+ host.addController(this);
16
+ }
17
+ hostConnected() {
18
+ hosts.add(this.host);
19
+ watch();
20
+ }
21
+ hostDisconnected() {
22
+ hosts.delete(this.host);
23
+ if (hosts.size === 0) {
24
+ observer?.disconnect();
25
+ observer = null;
26
+ }
27
+ }
28
+ }
29
+ //# sourceMappingURL=system-watch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-watch.js","sourceRoot":"","sources":["../../src/primitives/system-watch.ts"],"names":[],"mappings":"AAUA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAQ,CAAC;AAC9B,IAAI,QAAQ,GAA4B,IAAI,CAAC;AAE7C,SAAS,KAAK;IACZ,IAAI,QAAQ,IAAI,OAAO,gBAAgB,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAO;IACnG,QAAQ,GAAG,IAAI,gBAAgB,CAAC,GAAG,EAAE;QACnC,KAAK,MAAM,IAAI,IAAI,KAAK;YAAE,IAAI,CAAC,aAAa,EAAE,CAAC;IACjD,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;AACnJ,CAAC;AAED,MAAM,OAAO,qBAAqB;IAChC,YAA6B,IAAU;oBAAV,IAAI;QAC/B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,aAAa;QACX,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,KAAK,EAAE,CAAC;IACV,CAAC;IAED,gBAAgB;QACd,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACrB,QAAQ,EAAE,UAAU,EAAE,CAAC;YACvB,QAAQ,GAAG,IAAI,CAAC;QAClB,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,21 @@
1
+ import { type CSSResult } from 'lit';
2
+ /**
3
+ * The minimum target (BTN-5 and every control after it): the hit area meets `sys.target.pointer` for a fine pointer
4
+ * and `sys.target.touch` for a coarse one, on both axes, centered, without changing the visual size. Drawn by the
5
+ * `::before` of `on` (e.g. `button`), which must be a positioning container; RTL mirrors the centering.
6
+ */
7
+ export declare function minimumTarget(on: string): CSSResult;
8
+ /**
9
+ * The minimum target of an element that sits in a row beside others (a button group's standard item, BGR-4; a split
10
+ * button's half, SPB-6). Put it after `minimumTarget(on)`: the hit area still reaches the target above and below, and
11
+ * along the row as far as it would alone, but toward a neighbour no further than a cap the caller sets on the element
12
+ * (inherited by its `::before`): `--_cap-start` toward the logical start, `--_cap-end` toward the end — half the gap
13
+ * between the two, so that a press between them goes to the nearer one and never over a neighbour's visible bounds.
14
+ * A side without a cap (unset, or `initial`) reaches the whole target. RTL mirrors the sides.
15
+ *
16
+ * `axis: 'block'` is the same for a column (a vertical toolbar's item, TBR-9): the caps apply above (`--_cap-start`)
17
+ * and below (`--_cap-end`), and the hit area reaches the whole target across the column.
18
+ */
19
+ export declare function neighbourTarget(on: string, { axis }?: {
20
+ axis?: 'inline' | 'block';
21
+ }): CSSResult;