@celestia-island/hikari 0.4.4 → 0.30.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 (385) hide show
  1. package/README.md +1 -1
  2. package/package.json +22 -7
  3. package/src/DemoApp.tsx +491 -0
  4. package/src/animation/registerAnimations.test.ts +94 -0
  5. package/src/animation/registerAnimations.ts +103 -0
  6. package/src/components/HkAboutModal.scss +95 -0
  7. package/src/components/HkAboutModal.tsx +114 -0
  8. package/src/components/HkAdaptiveDialog.scss +22 -0
  9. package/src/components/HkAdaptiveDialog.test.tsx +271 -0
  10. package/src/components/HkAdaptiveDialog.tsx +167 -0
  11. package/src/components/HkAdminHeader.test.tsx +185 -0
  12. package/src/components/HkAdminHeader.tsx +308 -0
  13. package/src/components/HkAdminShell.test.tsx +237 -0
  14. package/src/components/HkAdminShell.tsx +129 -0
  15. package/src/components/HkAdminTablePage.tsx +70 -0
  16. package/src/components/HkAdminWidgets.test.ts +89 -0
  17. package/src/components/HkAlert.tsx +1 -1
  18. package/src/components/HkAltSignIn.scss +55 -0
  19. package/src/components/HkAltSignIn.test.tsx +88 -0
  20. package/src/components/HkAltSignIn.tsx +92 -0
  21. package/src/components/HkAttachmentModal.scss +49 -0
  22. package/src/components/HkAttachmentModal.tsx +318 -0
  23. package/src/components/HkAuthCard.tsx +50 -0
  24. package/src/components/HkAuthSubmitButton.scss +12 -0
  25. package/src/components/HkAuthSubmitButton.tsx +94 -0
  26. package/src/components/HkAvatar.scss +93 -0
  27. package/src/components/HkAvatar.tsx +2 -2
  28. package/src/components/HkBlockingToast.scss +123 -0
  29. package/src/components/HkBlockingToast.test.tsx +221 -0
  30. package/src/components/HkBlockingToast.tsx +182 -0
  31. package/src/components/HkBreadcrumb.scss +624 -0
  32. package/src/components/HkBreadcrumb.tsx +2 -2
  33. package/src/components/HkButton.scss +16 -2
  34. package/src/components/HkCaptchaModal.scss +14 -0
  35. package/src/components/HkCaptchaModal.tsx +62 -0
  36. package/src/components/HkCaptchaWidget.scss +30 -0
  37. package/src/components/HkCaptchaWidget.tsx +181 -0
  38. package/src/components/HkCard.scss +1 -1
  39. package/src/components/HkChatTypes.ts +65 -0
  40. package/src/components/HkCheckbox.scss +4 -9
  41. package/src/components/HkCheckbox.tsx +18 -6
  42. package/src/components/HkColorPicker.scss +120 -3
  43. package/src/components/HkColorPicker.tsx +130 -19
  44. package/src/components/HkColorPickerTouch.test.tsx +145 -0
  45. package/src/components/HkColorSchemeDialog.scss +52 -0
  46. package/src/components/HkColorSchemeDialog.test.ts +201 -0
  47. package/src/components/HkColorSchemeDialog.tsx +96 -0
  48. package/src/components/HkColorSchemeEditor.test.ts +270 -0
  49. package/src/components/HkColorSchemeEditor.tsx +410 -0
  50. package/src/components/HkConfirmDialog.scss +43 -3
  51. package/src/components/HkConfirmDialog.tsx +7 -4
  52. package/src/components/HkConnectionInfo.ts +80 -0
  53. package/src/components/HkConnectionStatus.tsx +158 -0
  54. package/src/components/HkCookieConsent.scss +22 -0
  55. package/src/components/HkCookieConsent.test.tsx +70 -0
  56. package/src/components/HkCookieConsent.tsx +56 -0
  57. package/src/components/HkCountdownDigit.tsx +105 -0
  58. package/src/components/HkDatePicker.scss +361 -0
  59. package/src/components/HkDatePicker.test.ts +459 -0
  60. package/src/components/HkDatePicker.tsx +568 -0
  61. package/src/components/HkDateTimePicker.scss +65 -37
  62. package/src/components/HkDateTimePicker.test.ts +344 -0
  63. package/src/components/HkDateTimePicker.tsx +249 -82
  64. package/src/components/HkDraggableGrid.scss +4 -1
  65. package/src/components/HkDraggableList.scss +4 -1
  66. package/src/components/HkDrawer.scss +27 -13
  67. package/src/components/HkDrawer.test.tsx +73 -0
  68. package/src/components/HkDrawer.tsx +157 -10
  69. package/src/components/HkErrorBoundary.scss +5 -2
  70. package/src/components/HkErrorBoundary.tsx +7 -4
  71. package/src/components/HkExpansionPanel.scss +143 -0
  72. package/src/components/HkExpansionPanel.test.tsx +109 -0
  73. package/src/components/HkExpansionPanel.tsx +101 -0
  74. package/src/components/HkFab.scss +162 -0
  75. package/src/components/HkFab.test.tsx +217 -0
  76. package/src/components/HkFab.tsx +214 -0
  77. package/src/components/HkHoverRevealAction.scss +6 -0
  78. package/src/components/HkHoverRevealAction.test.ts +68 -0
  79. package/src/components/HkHoverRevealAction.tsx +84 -6
  80. package/src/components/HkIcon.scss +123 -0
  81. package/src/components/HkIcon.tsx +7 -23
  82. package/src/components/HkIconButton.scss +170 -0
  83. package/src/components/HkIconButton.test.tsx +75 -0
  84. package/src/components/HkIconButton.tsx +4 -3
  85. package/src/components/HkIconButtonVars.scss +180 -0
  86. package/src/components/HkInput.affix.test.ts +253 -0
  87. package/src/components/HkInput.enter.test.ts +88 -0
  88. package/src/components/HkInput.scss +127 -8
  89. package/src/components/HkInput.tsx +245 -13
  90. package/src/components/HkKeywordSearchModal.scss +13 -0
  91. package/src/components/HkKeywordSearchModal.tsx +46 -9
  92. package/src/components/HkLabel.scss +34 -0
  93. package/src/components/HkLabel.test.tsx +61 -0
  94. package/src/components/HkLabel.tsx +45 -0
  95. package/src/components/HkListTransition.scss +26 -0
  96. package/src/components/HkListTransition.tsx +57 -0
  97. package/src/components/HkLocalePicker.scss +37 -0
  98. package/src/components/HkLocalePicker.tsx +133 -0
  99. package/src/components/HkLocalePickerPopup.tsx +35 -19
  100. package/src/components/HkLocalizedInput.scss +277 -0
  101. package/src/components/HkLocalizedInput.test.tsx +693 -0
  102. package/src/components/HkLocalizedInput.tsx +495 -0
  103. package/src/components/HkLogWindow.scss +121 -0
  104. package/src/components/HkLogWindow.tsx +195 -0
  105. package/src/components/HkLogo.scss +1 -1
  106. package/src/components/HkLogo.tsx +1 -1
  107. package/src/components/HkMarkdownRenderer.scss +22 -2
  108. package/src/components/HkMarkdownRenderer.tsx +33 -3
  109. package/src/components/HkMediaControlBar.tsx +20 -13
  110. package/src/components/HkMenu.scss +200 -0
  111. package/src/components/HkMenu.test.ts +779 -0
  112. package/src/components/HkMenu.tsx +770 -0
  113. package/src/components/HkMenuActionItem.scss +58 -0
  114. package/src/components/HkMenuActionItem.tsx +41 -0
  115. package/src/components/HkMenuIdentityItem.scss +70 -0
  116. package/src/components/HkMenuIdentityItem.tsx +42 -0
  117. package/src/components/HkMenuPanel.scss +20 -0
  118. package/src/components/HkMenuPanel.test.tsx +118 -0
  119. package/src/components/HkMenuPanel.tsx +32 -0
  120. package/src/components/HkMinimap.tsx +16 -8
  121. package/src/components/HkModal.autofollow.test.ts +44 -0
  122. package/src/components/HkModal.scss +170 -53
  123. package/src/components/HkModal.sheetgap.test.ts +82 -0
  124. package/src/components/HkModal.test.tsx +334 -0
  125. package/src/components/HkModal.tsx +314 -68
  126. package/src/components/HkModalBreadcrumb.scss +4 -1
  127. package/src/components/HkModalBreadcrumb.test.tsx +111 -0
  128. package/src/components/HkModalBreadcrumb.tsx +34 -11
  129. package/src/components/HkModelCatalog.ts +98 -0
  130. package/src/components/HkModelTag.scss +130 -0
  131. package/src/components/HkModelTag.test.tsx +111 -0
  132. package/src/components/HkModelTag.tsx +190 -0
  133. package/src/components/HkNavItem.scss +13 -2
  134. package/src/components/HkNavItem.tsx +2 -1
  135. package/src/components/HkNavSidebar.tsx +99 -0
  136. package/src/components/HkNumberInput.scss +12 -0
  137. package/src/components/HkNumberInput.tsx +15 -8
  138. package/src/components/HkPageHeader.scss +79 -0
  139. package/src/components/HkPageHeader.test.ts +67 -0
  140. package/src/components/HkPageHeader.tsx +51 -0
  141. package/src/components/HkPasswordInput.scss +29 -17
  142. package/src/components/HkPasswordInput.test.ts +281 -0
  143. package/src/components/HkPasswordInput.tsx +337 -59
  144. package/src/components/HkPickerPane.scss +158 -0
  145. package/src/components/HkPlaceholderMarquee.scss +109 -0
  146. package/src/components/HkPlaceholderMarquee.test.ts +305 -0
  147. package/src/components/HkPlaceholderMarquee.tsx +170 -0
  148. package/src/components/HkPopover.scss +134 -10
  149. package/src/components/HkPopover.sheetdock.test.ts +34 -0
  150. package/src/components/HkPopover.surfacevars.test.ts +20 -0
  151. package/src/components/HkPopover.titleSuppress.test.tsx +265 -0
  152. package/src/components/HkPopover.tsx +225 -50
  153. package/src/components/HkPopoverSheet.test.tsx +130 -0
  154. package/src/components/HkPopupSelect.scss +30 -10
  155. package/src/components/HkPopupSelect.tsx +21 -1
  156. package/src/components/HkProgressDialog.scss +31 -0
  157. package/src/components/HkProgressDialog.tsx +37 -19
  158. package/src/components/HkProtocolModal.scss +26 -0
  159. package/src/components/HkProtocolModal.tsx +112 -0
  160. package/src/components/HkRadio.scss +1 -16
  161. package/src/components/HkRadio.tsx +5 -2
  162. package/src/components/HkRichInput.scss +162 -0
  163. package/src/components/HkRichInput.tsx +335 -0
  164. package/src/components/HkRollingNumber.test.ts +90 -0
  165. package/src/components/HkRollingNumber.tsx +39 -1
  166. package/src/components/HkScrollContainer.scss +71 -54
  167. package/src/components/HkScrollContainer.test.ts +160 -0
  168. package/src/components/HkScrollContainer.tsx +187 -160
  169. package/src/components/HkSearchInput.tsx +3 -3
  170. package/src/components/HkSecretRevealModal.scss +61 -0
  171. package/src/components/HkSecretRevealModal.tsx +91 -0
  172. package/src/components/HkSelect.scss +263 -12
  173. package/src/components/HkSelect.sheetdock.test.ts +30 -0
  174. package/src/components/HkSelect.test.tsx +88 -0
  175. package/src/components/HkSelect.tsx +59 -74
  176. package/src/components/HkSelectPanel.test.tsx +666 -0
  177. package/src/components/HkSelectPanel.tsx +595 -0
  178. package/src/components/HkSelectSheet.test.tsx +132 -0
  179. package/src/components/HkSelectionGrid.scss +1 -1
  180. package/src/components/HkSelectionGrid.tsx +2 -1
  181. package/src/components/HkSelectionWaterfall.scss +1 -1
  182. package/src/components/HkShareBar.scss +40 -0
  183. package/src/components/HkShareBar.tsx +50 -0
  184. package/src/components/HkSidebar.scss +15 -10
  185. package/src/components/HkSidebar.tsx +26 -2
  186. package/src/components/HkSignInCard.test.ts +154 -0
  187. package/src/components/HkSignInCard.tsx +155 -0
  188. package/src/components/HkSlider.scss +99 -0
  189. package/src/components/HkSlider.test.tsx +155 -0
  190. package/src/components/HkSlider.tsx +173 -0
  191. package/src/components/HkSpinner.scss +36 -1
  192. package/src/components/HkSpinner.test.tsx +63 -0
  193. package/src/components/HkSpinner.tsx +16 -1
  194. package/src/components/HkSplash.scss +1 -1
  195. package/src/components/HkSplash.tsx +3 -1
  196. package/src/components/HkStatCard.scss +73 -0
  197. package/src/components/HkStatCard.tsx +46 -0
  198. package/src/components/HkStatusBar.test.tsx +178 -0
  199. package/src/components/HkStatusBar.tsx +379 -0
  200. package/src/components/HkStatusPill.scss +73 -0
  201. package/src/components/HkStatusPill.tsx +41 -0
  202. package/src/components/HkStepFlow.scss +75 -0
  203. package/src/components/HkStepFlow.test.tsx +246 -0
  204. package/src/components/HkStepFlow.tsx +115 -0
  205. package/src/components/HkSwitch.scss +5 -17
  206. package/src/components/HkSwitch.tsx +6 -3
  207. package/src/components/HkTable.scss +20 -1
  208. package/src/components/HkTable.tsx +28 -3
  209. package/src/components/HkTabs.scss +222 -48
  210. package/src/components/HkTabs.test.ts +517 -0
  211. package/src/components/HkTabs.tsx +567 -56
  212. package/src/components/HkTag.tsx +2 -1
  213. package/src/components/HkTextarea.tsx +5 -0
  214. package/src/components/HkThemeToggle.scss +232 -0
  215. package/src/components/HkThemeToggle.test.ts +231 -0
  216. package/src/components/HkThemeToggle.tsx +289 -0
  217. package/src/components/HkTimeline.scss +134 -1
  218. package/src/components/HkTimeline.test.tsx +319 -0
  219. package/src/components/HkTimeline.tsx +303 -54
  220. package/src/components/HkToast.scss +34 -5
  221. package/src/components/HkToast.test.tsx +109 -0
  222. package/src/components/HkToast.tsx +57 -8
  223. package/src/components/HkTokenUsageBadge.scss +53 -0
  224. package/src/components/HkTokenUsageBadge.test.tsx +59 -0
  225. package/src/components/HkTokenUsageBadge.tsx +54 -0
  226. package/src/components/HkTokenUsagePanel.scss +95 -0
  227. package/src/components/HkTokenUsagePanel.tsx +140 -0
  228. package/src/components/HkToolBlock.scss +428 -0
  229. package/src/components/HkToolBlock.tsx +639 -0
  230. package/src/components/HkTooltip.scss +14 -2
  231. package/src/components/HkTooltip.tsx +25 -2
  232. package/src/components/HkTrendChart.tsx +27 -16
  233. package/src/components/HkVoiceInputPopup.scss +77 -0
  234. package/src/components/HkVoiceInputPopup.tsx +97 -0
  235. package/src/components/HkZoomToolbar.scss +4 -1
  236. package/src/components/HkZoomToolbar.tsx +7 -4
  237. package/src/components/_hikari-vars.scss +6 -0
  238. package/src/composables/highlightLanguages.ts +109 -0
  239. package/src/composables/iconRegistry.ts +127 -0
  240. package/src/composables/messaging/browserTransport.ts +96 -0
  241. package/src/composables/messaging/index.ts +204 -0
  242. package/src/composables/messaging/messaging.test.ts +256 -0
  243. package/src/composables/messaging/toastTransport.ts +26 -0
  244. package/src/composables/messaging/types.ts +115 -0
  245. package/src/composables/useActionBar.ts +66 -0
  246. package/src/composables/useAttachments.ts +154 -0
  247. package/src/composables/useConnectionProbe.ts +142 -0
  248. package/src/composables/useDeferredTransition.ts +16 -0
  249. package/src/composables/useEngineHealth.ts +69 -0
  250. package/src/composables/useHighlight.ts +124 -0
  251. package/src/composables/useMeasuredHighlight.ts +150 -0
  252. package/src/composables/useOverlayScrollbar.test.ts +221 -0
  253. package/src/composables/useOverlayScrollbar.ts +296 -0
  254. package/src/composables/usePageTitle.ts +37 -0
  255. package/src/composables/useReducedMotion.ts +34 -0
  256. package/src/composables/useResourceListModal.tsx +147 -0
  257. package/src/composables/useSafeArea.ts +137 -0
  258. package/src/composables/useSendShortcut.ts +35 -0
  259. package/src/composables/useSizeMorph.test.ts +156 -0
  260. package/src/composables/useSizeMorph.ts +149 -0
  261. package/src/composables/useSurfaceTransition.test.ts +96 -0
  262. package/src/composables/useSurfaceTransition.ts +71 -0
  263. package/src/composables/useZoomPan.ts +192 -0
  264. package/src/demo.scss +9 -1
  265. package/src/demo.ts +5 -1
  266. package/src/i18n/locales/ar/chat.json +38 -0
  267. package/src/i18n/locales/ar/components.json +141 -40
  268. package/src/i18n/locales/ar/components.toml +59 -0
  269. package/src/i18n/locales/ar/platform.json +65 -0
  270. package/src/i18n/locales/de/chat.json +38 -0
  271. package/src/i18n/locales/de/components.json +139 -38
  272. package/src/i18n/locales/de/components.toml +59 -0
  273. package/src/i18n/locales/de/platform.json +65 -0
  274. package/src/i18n/locales/en/chat.json +38 -0
  275. package/src/i18n/locales/en/components.json +104 -3
  276. package/src/i18n/locales/en/components.toml +59 -0
  277. package/src/i18n/locales/en/platform.json +65 -0
  278. package/src/i18n/locales/es/chat.json +38 -0
  279. package/src/i18n/locales/es/components.json +141 -40
  280. package/src/i18n/locales/es/components.toml +59 -0
  281. package/src/i18n/locales/es/platform.json +65 -0
  282. package/src/i18n/locales/fr/chat.json +38 -0
  283. package/src/i18n/locales/fr/components.json +137 -36
  284. package/src/i18n/locales/fr/components.toml +59 -0
  285. package/src/i18n/locales/fr/platform.json +65 -0
  286. package/src/i18n/locales/ja/chat.json +38 -0
  287. package/src/i18n/locales/ja/components.json +104 -3
  288. package/src/i18n/locales/ja/components.toml +59 -0
  289. package/src/i18n/locales/ja/platform.json +65 -0
  290. package/src/i18n/locales/ko/chat.json +38 -0
  291. package/src/i18n/locales/ko/components.json +104 -3
  292. package/src/i18n/locales/ko/components.toml +59 -0
  293. package/src/i18n/locales/ko/platform.json +65 -0
  294. package/src/i18n/locales/pt/chat.json +38 -0
  295. package/src/i18n/locales/pt/components.json +141 -40
  296. package/src/i18n/locales/pt/components.toml +59 -0
  297. package/src/i18n/locales/pt/platform.json +65 -0
  298. package/src/i18n/locales/ru/chat.json +38 -0
  299. package/src/i18n/locales/ru/components.json +141 -40
  300. package/src/i18n/locales/ru/components.toml +59 -0
  301. package/src/i18n/locales/ru/platform.json +65 -0
  302. package/src/i18n/locales/zh-Hans/chat.json +38 -0
  303. package/src/i18n/locales/zh-Hans/components.json +109 -4
  304. package/src/i18n/locales/zh-Hans/components.toml +59 -0
  305. package/src/i18n/locales/zh-Hans/platform.json +65 -0
  306. package/src/i18n/locales/zh-Hant/chat.json +38 -0
  307. package/src/i18n/locales/zh-Hant/components.json +109 -4
  308. package/src/i18n/locales/zh-Hant/components.toml +59 -0
  309. package/src/i18n/locales/zh-Hant/platform.json +65 -0
  310. package/src/index.ts +225 -6
  311. package/src/plugins/bootScriptsPlugin.ts +47 -0
  312. package/src/plugins/buildHashPlugin.ts +67 -0
  313. package/src/plugins/index.ts +2 -0
  314. package/src/render.ts +1 -1
  315. package/src/runtime/animationBus.test.ts +112 -0
  316. package/src/runtime/animationBus.ts +33 -2
  317. package/src/runtime/backStack.test.ts +334 -0
  318. package/src/runtime/backStack.ts +377 -0
  319. package/src/runtime/env.ts +4 -0
  320. package/src/runtime/index.ts +15 -3
  321. package/src/runtime/intervalBus.test.ts +118 -0
  322. package/src/runtime/intervalBus.ts +189 -0
  323. package/src/runtime/mobileViewport.test.ts +132 -0
  324. package/src/runtime/mobileViewport.ts +157 -0
  325. package/src/runtime/pageLifecycle.ts +91 -0
  326. package/src/runtime/useBlockingToast.ts +112 -0
  327. package/src/runtime/useClipboard.ts +28 -0
  328. package/src/runtime/useConfirm.ts +15 -7
  329. package/src/runtime/useMediaQuery.test.ts +67 -0
  330. package/src/runtime/useMediaQuery.ts +89 -0
  331. package/src/runtime/useOverlay.test.ts +160 -0
  332. package/src/runtime/useOverlay.ts +59 -12
  333. package/src/runtime/usePopupManager.test.ts +200 -0
  334. package/src/runtime/usePopupManager.ts +106 -10
  335. package/src/runtime/useToast.test.ts +90 -0
  336. package/src/runtime/useToast.ts +20 -2
  337. package/src/styles/admin-tokens.scss +744 -0
  338. package/src/styles/index.scss +5 -3
  339. package/src/styles/theme/_glass.scss +33 -0
  340. package/src/styles/theme/_layout.scss +123 -0
  341. package/src/styles/theme/_scrollbar.scss +73 -0
  342. package/src/styles/theme/_tokens.scss +69 -0
  343. package/src/styles/theme/base.scss +617 -0
  344. package/src/styles/theme/foundation.scss +219 -0
  345. package/src/styles/theme/mixins.scss +793 -0
  346. package/src/styles/theme/themes.scss +25 -0
  347. package/src/styles/theme/variables.scss +125 -0
  348. package/src/theme/_field.scss +116 -0
  349. package/src/theme/fontContext.test.ts +179 -0
  350. package/src/theme/fontContext.ts +169 -0
  351. package/src/theme/index.ts +19 -2
  352. package/src/theme/presets.ts +86 -18
  353. package/src/theme/theme.scss +61 -1
  354. package/src/theme/tokenGroups.test.ts +534 -0
  355. package/src/theme/tokenGroups.ts +552 -0
  356. package/src/theme/useSolarTime.test.ts +113 -0
  357. package/src/theme/useSolarTime.ts +95 -20
  358. package/src/theme/useTheme.test.ts +72 -0
  359. package/src/theme/useTheme.ts +144 -9
  360. package/src/tokens.scss +110 -0
  361. package/src/utils/base64.ts +31 -0
  362. package/src/utils/connectivity.ts +51 -0
  363. package/src/utils/dom.test.ts +131 -0
  364. package/src/utils/dom.ts +133 -0
  365. package/src/utils/download.ts +22 -0
  366. package/src/utils/fileType.ts +127 -0
  367. package/src/utils/format.ts +98 -0
  368. package/src/utils/fuzzy.ts +77 -0
  369. package/src/utils/fuzzySearch.test.ts +87 -0
  370. package/src/utils/healthProbe.ts +64 -0
  371. package/src/utils/objectPath.ts +59 -0
  372. package/src/utils/password.ts +53 -0
  373. package/src/utils/pow.test.ts +45 -0
  374. package/src/utils/pow.ts +226 -0
  375. package/src/utils/powNonce.ts +95 -0
  376. package/src/utils/validation.test.ts +78 -0
  377. package/src/DemoApp.vue +0 -400
  378. package/src/components/HkCollapse.tsx +0 -48
  379. package/src/components/HkMorphingTabs.scss +0 -141
  380. package/src/components/HkMorphingTabs.tsx +0 -113
  381. package/src/composables/useBreakpoint.ts +0 -41
  382. package/src/composables/useClipboard.ts +0 -37
  383. package/src/composables/useConfirm.ts +0 -35
  384. package/src/composables/useToast.ts +0 -2
  385. package/src/runtime/useAsyncData.ts +0 -30
@@ -1,17 +1,58 @@
1
- /* HkTabs — unified underline / pill tab component */
1
+ /* HkTabs — THE unified button-group / tab-strip primitive.
2
+ *
3
+ * ONE look (the centered pill strip of the page-level top/bottom bars)
4
+ * is shared by every button group, radio group and tab strip. Variants
5
+ * only switch the working mode (pill = tablist, segmented = radiogroup)
6
+ * and layout extras (block) — never the visual language. */
2
7
 
3
8
  .hk-tabs {
4
9
  width: 100%;
5
10
  }
6
11
 
7
- /* === Shared list === */
12
+ /* === Scrollable (default) === */
8
13
 
9
- .hk-tabs-list {
10
- display: flex;
11
- gap: var(--space-2);
14
+ /* The scroller (a horizontal HkScrollContainer) bounds the list: it
15
+ sizes to the content up to the available width, then the list
16
+ scrolls inside with safe centering. min-width: 0 lets the whole
17
+ chain shrink inside constrained flex parents (status bars, header
18
+ centres). */
19
+ .hk-tabs[data-scrollable] {
20
+ width: auto;
21
+ max-width: 100%;
22
+ min-width: 0;
23
+ }
24
+
25
+ .hk-tabs-scroller {
26
+ width: 100%;
27
+ }
28
+
29
+ /* === Protruding end actions (startAction / endAction) === */
30
+
31
+ /* With an end action the whole strip sits inside an HkHoverRevealAction
32
+ host (`.hk-tabs-addwrap`) and the button protrudes at the host's edge
33
+ (left:100% / right:100% in HkHoverRevealAction.scss) — outside the
34
+ scroll viewport, so it never scrolls away. Shrink-wrap the strip the
35
+ same way the scrollable variant does, so the hover-reveal chain can
36
+ cap inside constrained flex parents and the tabs keep their safe
37
+ centering. */
38
+ .hk-tabs[data-actions] {
39
+ width: auto;
40
+ max-width: 100%;
41
+ min-width: 0;
42
+ }
43
+
44
+ /* The reveal host itself must be able to shrink below its content and
45
+ must not be clipped by rigid parents — mirrors HkHoverRevealAction's
46
+ own min/max rules; no flex shorthand here, the host's natural
47
+ shrink-wrap keeps the centered-bar geometry. */
48
+ .hk-tabs-addwrap {
49
+ min-width: 0;
50
+ max-width: 100%;
12
51
  }
13
52
 
14
- .hk-tabs-list[data-variant="pill"] {
53
+ /* === The one shared track (every variant) === */
54
+
55
+ .hk-tabs-list {
15
56
  position: relative;
16
57
  display: inline-flex;
17
58
  gap: 0;
@@ -21,89 +62,222 @@
21
62
  background: rgb(var(--color-surface) / 60%);
22
63
  }
23
64
 
24
- /* === Shared trigger === */
65
+ /* === The one shared trigger (every variant) === */
25
66
 
26
67
  .hk-tabs-trigger {
27
- font-weight: 500;
68
+ position: relative;
69
+ /* Paint above the sliding indicator. */
70
+ z-index: 1;
71
+ display: flex;
72
+ align-items: center;
73
+ justify-content: center;
74
+ gap: var(--space-6);
75
+ flex: none;
76
+ padding: var(--space-4) var(--space-12);
77
+ font-family: inherit;
78
+ font-size: var(--text-sm);
79
+ font-weight: 600;
28
80
  color: rgb(var(--color-muted));
29
81
  background: transparent;
30
82
  border: none;
83
+ border-radius: var(--radius-sm);
84
+ white-space: nowrap;
31
85
  cursor: pointer;
32
- font-family: inherit;
33
86
  outline: none;
34
- transition: color var(--duration-short) ease;
87
+ transition: color var(--duration-short) ease,
88
+ transform var(--duration-short) ease;
35
89
 
36
90
  &:hover {
37
91
  color: rgb(var(--color-text));
38
92
  }
39
93
 
94
+ /* Tactile press feedback — every button-group click animates, even
95
+ before the sliding indicator arrives. */
96
+ &:active:not([data-disabled]) {
97
+ transform: scale(0.96);
98
+ }
99
+
40
100
  &[data-active] {
41
101
  color: rgb(var(--color-primary));
42
102
  }
103
+
104
+ /* Inset ring: the track padding and the scroller's edge-fade mask
105
+ would clip an outset outline. */
106
+ &:focus-visible {
107
+ outline: 2px solid rgb(var(--color-primary));
108
+ outline-offset: -2px;
109
+ }
43
110
  }
44
111
 
45
- /* === Underline variant === */
112
+ .hk-tabs-trigger-icon {
113
+ display: inline-flex;
114
+ align-items: center;
115
+ }
46
116
 
47
- .hk-tabs[data-variant="underline"] .hk-tabs-list {
48
- border-bottom: 1px solid rgb(var(--color-border) / 15%);
117
+ /* === The one shared sliding indicator (every variant) ===
118
+ * Starts transparent: the first measured frame only fades it in (no
119
+ * pop-in from a stale corner), later frames slide via left/width. */
120
+ .hk-tabs-indicator {
121
+ position: absolute;
122
+ top: 2px;
123
+ height: calc(100% - 4px);
124
+ border-radius: var(--radius-sm);
125
+ background: rgb(var(--color-primary) / 12%);
126
+ pointer-events: none;
127
+ z-index: 0;
128
+ opacity: 0;
129
+ transition: left var(--duration-normal) var(--ease-standard),
130
+ width var(--duration-normal) var(--ease-standard),
131
+ opacity var(--duration-short) ease;
49
132
  }
50
133
 
51
- .hk-tabs[data-variant="underline"] .hk-tabs-trigger {
52
- padding: var(--space-8) var(--space-16);
53
- font-size: var(--text-base);
54
- border-bottom: 2px solid transparent;
55
- transition: background-color, border-color, color, box-shadow, opacity, transform, filter var(--duration-normal) ease;
134
+ .hk-tabs-indicator[data-ready] {
135
+ opacity: 1;
136
+ }
56
137
 
57
- &:hover {
58
- background: var(--c-primary-faint);
59
- }
138
+ /* === Option swap transitions (dynamic options / merged cell) ===
139
+ * Entering options/cells fade and settle in; leaving ones fade out
140
+ * absolutely so siblings reflow at once. Geometry motion belongs to
141
+ * the sliding indicator, so there is deliberately no move FLIP. */
142
+ .hk-tabs-swap-enter-active,
143
+ .hk-tabs-swap-leave-active {
144
+ transition: opacity var(--duration-short) ease,
145
+ transform var(--duration-short) ease;
146
+ }
60
147
 
61
- &[data-active] {
62
- border-bottom-color: rgb(var(--color-primary));
148
+ .hk-tabs-swap-enter-from {
149
+ opacity: 0;
150
+ transform: scale(0.96);
151
+ }
152
+
153
+ .hk-tabs-swap-leave-to {
154
+ opacity: 0;
155
+ }
156
+
157
+ /* Child-selector form, NOT the bare `.hk-tabs-swap-leave-active`: the
158
+ leaving element may be a trigger or the merged cell whose own rules
159
+ (`.hk-tabs-trigger` / `.hk-tabs-merged`, position:relative) share the
160
+ same one-class specificity and could win by source order — the
161
+ two-class selector lifts the ghost to absolute regardless of order. */
162
+ .hk-tabs-list > .hk-tabs-swap-leave-active {
163
+ position: absolute;
164
+ z-index: 0;
165
+ }
166
+
167
+ /* === Panel (pill / tablist mode) === */
168
+
169
+ .hk-tabs-panel {
170
+ outline: none;
171
+
172
+ &:not([data-active]) {
173
+ display: none;
63
174
  }
64
175
  }
65
176
 
66
- /* === Pill variant — mirrors SMorphingTabs exactly === */
177
+ /* === segmented = radiogroup working mode ===
178
+ * Same chrome; only the form-row layout extra lives here:
179
+ * row-filling (block). */
180
+
181
+ /* block outside the scroller (scrollable opted out): legacy fill —
182
+ triggers may shrink below their content. */
183
+ .hk-tabs-list[data-variant="segmented"][data-block="true"] {
184
+ display: flex;
185
+ width: 100%;
186
+ }
187
+
188
+ .hk-tabs-list[data-variant="segmented"][data-block="true"] .hk-tabs-trigger {
189
+ flex: 1 1 auto;
190
+ }
191
+
192
+ /* block inside the scroller (the default): fill the row while it fits,
193
+ scroll with edge fades when it doesn't — triggers never shrink below
194
+ their content, so option labels are never clipped. */
195
+ .hk-tabs-scroller .hk-tabs-list[data-variant="segmented"][data-block="true"] {
196
+ width: max-content;
197
+ min-width: 100%;
198
+ }
199
+
200
+ .hk-tabs-scroller .hk-tabs-list[data-variant="segmented"][data-block="true"] .hk-tabs-trigger {
201
+ flex: 1 0 auto;
202
+ }
67
203
 
68
- .hk-tabs[data-variant="pill"] .hk-tabs-trigger {
204
+ /* === Merged cell (dynamic merged-option rendering) ===
205
+ * The contiguous run of options listed in `mergeKeys` collapses into ONE
206
+ * combined cell (the #merged slot) — a REAL in-flow child of the track
207
+ * (a grid item on slot-unit strips, see the distribution rules below),
208
+ * not an absolute cover: it joins layout and the animation context
209
+ * (hk-tabs-swap enter/leave + the sliding indicator measures it when
210
+ * the active option is merged). Chrome follows the unselected-option
211
+ * grammar: NAKED — no border, no own surface; only the sliding
212
+ * indicator ever frames the active option, so a merged cell must never
213
+ * grow a box of its own. Interactive slot content (e.g. the theme
214
+ * toggle's altitude strip) fills the cell and owns its hover/press. */
215
+ .hk-tabs-merged {
69
216
  position: relative;
217
+ /* Same layer as the triggers, above the sliding indicator. */
70
218
  z-index: 1;
71
- display: flex;
219
+ display: inline-flex;
72
220
  align-items: center;
73
221
  justify-content: center;
74
- gap: var(--space-6);
75
222
  flex: none;
76
- padding: var(--space-4) var(--space-12);
223
+ min-width: 0;
224
+ color: rgb(var(--color-muted));
77
225
  font-size: var(--text-sm);
78
226
  font-weight: 600;
79
- border-radius: var(--radius-sm);
80
227
  white-space: nowrap;
81
228
  }
82
229
 
83
- /* === Pill sliding indicator === */
84
-
85
- .hk-tabs-indicator {
86
- position: absolute;
87
- top: 2px;
88
- height: calc(100% - 4px);
89
- border-radius: var(--radius-sm);
90
- background: rgb(var(--color-primary) / 12%);
230
+ /* Whole-strip disabled mutes the cell's interactive slot content too —
231
+ the triggers get the native disabled attribute, the cell gets this. */
232
+ .hk-tabs-merged[data-disabled] {
91
233
  pointer-events: none;
92
- z-index: 0;
93
- transition: left var(--duration-normal) var(--ease-standard),
94
- width var(--duration-normal) var(--ease-standard);
95
234
  }
96
235
 
97
- /* === Panel === */
236
+ /* block (row-filling) strips: the merged cell shares the triggers'
237
+ flex growth so it lands on the merged run's share of the row. */
238
+ .hk-tabs-list[data-variant="segmented"][data-block="true"] .hk-tabs-merged {
239
+ flex: 1 1 auto;
240
+ }
98
241
 
99
- .hk-tabs-panel {
100
- outline: none;
242
+ .hk-tabs-scroller .hk-tabs-list[data-variant="segmented"][data-block="true"] .hk-tabs-merged {
243
+ flex: 1 0 auto;
244
+ }
101
245
 
102
- &:not([data-active]) {
103
- display: none;
104
- }
246
+ /* === Slot-unit distribution (block strips carrying data-slots) ===
247
+ * A merged cell always spans its run's option count and TabItem.span
248
+ * may weight any trigger; the row is then divided into one equal 1fr
249
+ * track per unit, NOT by content. This is what makes dynamic merging
250
+ * width-stable: the theme toggle's altitude strip replaces the
251
+ * Light+Dark pair and occupies EXACTLY the two one-unit tracks those
252
+ * triggers owned, so toggling auto ↔ manual never re-measures any
253
+ * cell — the strip neither narrows (desktop content-size case) nor
254
+ * re-divides (mobile block case, thirds stay thirds).
255
+ *
256
+ * The division is a GRID because flex-basis math cannot give padded
257
+ * items exact equal units: a zero flex basis still leaves each item's
258
+ * own padding riding on its share (item = padding + share of the
259
+ * remainder), so a 12px-padded trigger consistently stole ~8-16px from
260
+ * its neighbors. Grid `1fr` tracks are exact regardless of item
261
+ * padding, borders or content, in both the definite-width and the
262
+ * `width: max-content; min-width: 100%` intrinsic contexts.
263
+ *
264
+ * `minmax(min-content, 1fr)` keeps the never-clip contract: when the
265
+ * row runs tight a track floors at its content and the max-content
266
+ * list scrolls instead; the cell's flex-era `min-width: 0` is reset to
267
+ * `auto` so its content keeps counting toward its track's floor. The
268
+ * sliding indicator (absolute, positioned from JS measurements) and
269
+ * the swap transition's absolute leaving items are untouched by the
270
+ * display switch. Keep this AFTER the rules it overrides
271
+ * (equal-or-higher specificity + source order). */
272
+ .hk-tabs-list[data-variant="segmented"][data-block="true"][data-slots] {
273
+ display: grid;
274
+ grid-template-columns: repeat(var(--hk-tabs-units, 1), minmax(min-content, 1fr));
105
275
  }
106
276
 
107
- .hk-tabs[data-variant="underline"] .hk-tabs-panel {
108
- padding: var(--space-16) 0;
277
+ .hk-tabs-list[data-variant="segmented"][data-block="true"][data-slots] > .hk-tabs-trigger,
278
+ .hk-tabs-scroller .hk-tabs-list[data-variant="segmented"][data-block="true"][data-slots] > .hk-tabs-trigger,
279
+ .hk-tabs-list[data-variant="segmented"][data-block="true"][data-slots] > .hk-tabs-merged,
280
+ .hk-tabs-scroller .hk-tabs-list[data-variant="segmented"][data-block="true"][data-slots] > .hk-tabs-merged {
281
+ grid-column: span var(--hk-tabs-span, 1) / span var(--hk-tabs-span, 1);
282
+ min-width: auto;
109
283
  }