@unisane/ui 0.1.0-next.b67ebfd0

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 (533) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +45 -0
  3. package/dist/components/accordion.d.ts +30 -0
  4. package/dist/components/accordion.d.ts.map +1 -0
  5. package/dist/components/accordion.js +47 -0
  6. package/dist/components/accordion.js.map +1 -0
  7. package/dist/components/alert.d.ts +13 -0
  8. package/dist/components/alert.d.ts.map +1 -0
  9. package/dist/components/alert.js +33 -0
  10. package/dist/components/alert.js.map +1 -0
  11. package/dist/components/avatar.d.ts +20 -0
  12. package/dist/components/avatar.d.ts.map +1 -0
  13. package/dist/components/avatar.js +38 -0
  14. package/dist/components/avatar.js.map +1 -0
  15. package/dist/components/badge.d.ts +19 -0
  16. package/dist/components/badge.d.ts.map +1 -0
  17. package/dist/components/badge.js +92 -0
  18. package/dist/components/badge.js.map +1 -0
  19. package/dist/components/banner.d.ts +24 -0
  20. package/dist/components/banner.d.ts.map +1 -0
  21. package/dist/components/banner.js +43 -0
  22. package/dist/components/banner.js.map +1 -0
  23. package/dist/components/bottom-app-bar.d.ts +34 -0
  24. package/dist/components/bottom-app-bar.d.ts.map +1 -0
  25. package/dist/components/bottom-app-bar.js +32 -0
  26. package/dist/components/bottom-app-bar.js.map +1 -0
  27. package/dist/components/breadcrumb.d.ts +26 -0
  28. package/dist/components/breadcrumb.d.ts.map +1 -0
  29. package/dist/components/breadcrumb.js +23 -0
  30. package/dist/components/breadcrumb.js.map +1 -0
  31. package/dist/components/button.d.ts +20 -0
  32. package/dist/components/button.d.ts.map +1 -0
  33. package/dist/components/button.js +66 -0
  34. package/dist/components/button.js.map +1 -0
  35. package/dist/components/calendar.d.ts +14 -0
  36. package/dist/components/calendar.d.ts.map +1 -0
  37. package/dist/components/calendar.js +178 -0
  38. package/dist/components/calendar.js.map +1 -0
  39. package/dist/components/canonical-layouts.d.ts +36 -0
  40. package/dist/components/canonical-layouts.d.ts.map +1 -0
  41. package/dist/components/canonical-layouts.js +49 -0
  42. package/dist/components/canonical-layouts.js.map +1 -0
  43. package/dist/components/card.d.ts +20 -0
  44. package/dist/components/card.d.ts.map +1 -0
  45. package/dist/components/card.js +70 -0
  46. package/dist/components/card.js.map +1 -0
  47. package/dist/components/carousel.d.ts +42 -0
  48. package/dist/components/carousel.d.ts.map +1 -0
  49. package/dist/components/carousel.js +225 -0
  50. package/dist/components/carousel.js.map +1 -0
  51. package/dist/components/checkbox.d.ts +10 -0
  52. package/dist/components/checkbox.d.ts.map +1 -0
  53. package/dist/components/checkbox.js +31 -0
  54. package/dist/components/checkbox.js.map +1 -0
  55. package/dist/components/chip.d.ts +27 -0
  56. package/dist/components/chip.d.ts.map +1 -0
  57. package/dist/components/chip.js +69 -0
  58. package/dist/components/chip.js.map +1 -0
  59. package/dist/components/combobox.d.ts +27 -0
  60. package/dist/components/combobox.d.ts.map +1 -0
  61. package/dist/components/combobox.js +261 -0
  62. package/dist/components/combobox.js.map +1 -0
  63. package/dist/components/command.d.ts +87 -0
  64. package/dist/components/command.d.ts.map +1 -0
  65. package/dist/components/command.js +31 -0
  66. package/dist/components/command.js.map +1 -0
  67. package/dist/components/confirm-dialog.d.ts +22 -0
  68. package/dist/components/confirm-dialog.d.ts.map +1 -0
  69. package/dist/components/confirm-dialog.js +72 -0
  70. package/dist/components/confirm-dialog.js.map +1 -0
  71. package/dist/components/date-input.d.ts +30 -0
  72. package/dist/components/date-input.d.ts.map +1 -0
  73. package/dist/components/date-input.js +334 -0
  74. package/dist/components/date-input.js.map +1 -0
  75. package/dist/components/date-picker.d.ts +13 -0
  76. package/dist/components/date-picker.d.ts.map +1 -0
  77. package/dist/components/date-picker.js +93 -0
  78. package/dist/components/date-picker.js.map +1 -0
  79. package/dist/components/date-range-picker.d.ts +29 -0
  80. package/dist/components/date-range-picker.d.ts.map +1 -0
  81. package/dist/components/date-range-picker.js +196 -0
  82. package/dist/components/date-range-picker.js.map +1 -0
  83. package/dist/components/dialog.d.ts +31 -0
  84. package/dist/components/dialog.d.ts.map +1 -0
  85. package/dist/components/dialog.js +58 -0
  86. package/dist/components/dialog.js.map +1 -0
  87. package/dist/components/divider.d.ts +8 -0
  88. package/dist/components/divider.d.ts.map +1 -0
  89. package/dist/components/divider.js +8 -0
  90. package/dist/components/divider.js.map +1 -0
  91. package/dist/components/drawer.d.ts +30 -0
  92. package/dist/components/drawer.d.ts.map +1 -0
  93. package/dist/components/drawer.js +27 -0
  94. package/dist/components/drawer.js.map +1 -0
  95. package/dist/components/dropdown-menu.d.ts +61 -0
  96. package/dist/components/dropdown-menu.d.ts.map +1 -0
  97. package/dist/components/dropdown-menu.js +572 -0
  98. package/dist/components/dropdown-menu.js.map +1 -0
  99. package/dist/components/fab-menu.d.ts +18 -0
  100. package/dist/components/fab-menu.d.ts.map +1 -0
  101. package/dist/components/fab-menu.js +56 -0
  102. package/dist/components/fab-menu.js.map +1 -0
  103. package/dist/components/fab.d.ts +25 -0
  104. package/dist/components/fab.d.ts.map +1 -0
  105. package/dist/components/fab.js +75 -0
  106. package/dist/components/fab.js.map +1 -0
  107. package/dist/components/field.d.ts +15 -0
  108. package/dist/components/field.d.ts.map +1 -0
  109. package/dist/components/field.js +14 -0
  110. package/dist/components/field.js.map +1 -0
  111. package/dist/components/icon-button.d.ts +27 -0
  112. package/dist/components/icon-button.d.ts.map +1 -0
  113. package/dist/components/icon-button.js +80 -0
  114. package/dist/components/icon-button.js.map +1 -0
  115. package/dist/components/icon.d.ts +18 -0
  116. package/dist/components/icon.d.ts.map +1 -0
  117. package/dist/components/icon.js +50 -0
  118. package/dist/components/icon.js.map +1 -0
  119. package/dist/components/list.d.ts +43 -0
  120. package/dist/components/list.d.ts.map +1 -0
  121. package/dist/components/list.js +74 -0
  122. package/dist/components/list.js.map +1 -0
  123. package/dist/components/mode-switcher.d.ts +9 -0
  124. package/dist/components/mode-switcher.d.ts.map +1 -0
  125. package/dist/components/mode-switcher.js +22 -0
  126. package/dist/components/mode-switcher.js.map +1 -0
  127. package/dist/components/month-picker.d.ts +22 -0
  128. package/dist/components/month-picker.d.ts.map +1 -0
  129. package/dist/components/month-picker.js +210 -0
  130. package/dist/components/month-picker.js.map +1 -0
  131. package/dist/components/navigation-bar.d.ts +8 -0
  132. package/dist/components/navigation-bar.d.ts.map +1 -0
  133. package/dist/components/navigation-bar.js +23 -0
  134. package/dist/components/navigation-bar.js.map +1 -0
  135. package/dist/components/navigation-drawer.d.ts +18 -0
  136. package/dist/components/navigation-drawer.d.ts.map +1 -0
  137. package/dist/components/navigation-drawer.js +64 -0
  138. package/dist/components/navigation-drawer.js.map +1 -0
  139. package/dist/components/navigation-rail.d.ts +13 -0
  140. package/dist/components/navigation-rail.d.ts.map +1 -0
  141. package/dist/components/navigation-rail.js +23 -0
  142. package/dist/components/navigation-rail.js.map +1 -0
  143. package/dist/components/pagination.d.ts +32 -0
  144. package/dist/components/pagination.d.ts.map +1 -0
  145. package/dist/components/pagination.js +68 -0
  146. package/dist/components/pagination.js.map +1 -0
  147. package/dist/components/pane-group.d.ts +9 -0
  148. package/dist/components/pane-group.d.ts.map +1 -0
  149. package/dist/components/pane-group.js +6 -0
  150. package/dist/components/pane-group.js.map +1 -0
  151. package/dist/components/popover.d.ts +26 -0
  152. package/dist/components/popover.d.ts.map +1 -0
  153. package/dist/components/popover.js +242 -0
  154. package/dist/components/popover.js.map +1 -0
  155. package/dist/components/progress.d.ts +15 -0
  156. package/dist/components/progress.d.ts.map +1 -0
  157. package/dist/components/progress.js +37 -0
  158. package/dist/components/progress.js.map +1 -0
  159. package/dist/components/radio.d.ts +9 -0
  160. package/dist/components/radio.d.ts.map +1 -0
  161. package/dist/components/radio.js +19 -0
  162. package/dist/components/radio.js.map +1 -0
  163. package/dist/components/rating.d.ts +19 -0
  164. package/dist/components/rating.d.ts.map +1 -0
  165. package/dist/components/rating.js +64 -0
  166. package/dist/components/rating.js.map +1 -0
  167. package/dist/components/ripple.d.ts +10 -0
  168. package/dist/components/ripple.d.ts.map +1 -0
  169. package/dist/components/ripple.js +44 -0
  170. package/dist/components/ripple.js.map +1 -0
  171. package/dist/components/scroll-area.d.ts +6 -0
  172. package/dist/components/scroll-area.d.ts.map +1 -0
  173. package/dist/components/scroll-area.js +6 -0
  174. package/dist/components/scroll-area.js.map +1 -0
  175. package/dist/components/search-bar.d.ts +12 -0
  176. package/dist/components/search-bar.d.ts.map +1 -0
  177. package/dist/components/search-bar.js +71 -0
  178. package/dist/components/search-bar.js.map +1 -0
  179. package/dist/components/segmented-button.d.ts +39 -0
  180. package/dist/components/segmented-button.d.ts.map +1 -0
  181. package/dist/components/segmented-button.js +162 -0
  182. package/dist/components/segmented-button.js.map +1 -0
  183. package/dist/components/select-field.d.ts +46 -0
  184. package/dist/components/select-field.d.ts.map +1 -0
  185. package/dist/components/select-field.js +56 -0
  186. package/dist/components/select-field.js.map +1 -0
  187. package/dist/components/select.d.ts +45 -0
  188. package/dist/components/select.d.ts.map +1 -0
  189. package/dist/components/select.js +356 -0
  190. package/dist/components/select.js.map +1 -0
  191. package/dist/components/sheet.d.ts +28 -0
  192. package/dist/components/sheet.d.ts.map +1 -0
  193. package/dist/components/sheet.js +122 -0
  194. package/dist/components/sheet.js.map +1 -0
  195. package/dist/components/sidebar/components/sidebar-drawer.d.ts +14 -0
  196. package/dist/components/sidebar/components/sidebar-drawer.d.ts.map +1 -0
  197. package/dist/components/sidebar/components/sidebar-drawer.js +60 -0
  198. package/dist/components/sidebar/components/sidebar-drawer.js.map +1 -0
  199. package/dist/components/sidebar/components/sidebar-inset.d.ts +6 -0
  200. package/dist/components/sidebar/components/sidebar-inset.d.ts.map +1 -0
  201. package/dist/components/sidebar/components/sidebar-inset.js +24 -0
  202. package/dist/components/sidebar/components/sidebar-inset.js.map +1 -0
  203. package/dist/components/sidebar/components/sidebar-navigation.d.ts +13 -0
  204. package/dist/components/sidebar/components/sidebar-navigation.d.ts.map +1 -0
  205. package/dist/components/sidebar/components/sidebar-navigation.js +40 -0
  206. package/dist/components/sidebar/components/sidebar-navigation.js.map +1 -0
  207. package/dist/components/sidebar/components/sidebar-rail.d.ts +5 -0
  208. package/dist/components/sidebar/components/sidebar-rail.d.ts.map +1 -0
  209. package/dist/components/sidebar/components/sidebar-rail.js +19 -0
  210. package/dist/components/sidebar/components/sidebar-rail.js.map +1 -0
  211. package/dist/components/sidebar/components/sidebar-shell.d.ts +13 -0
  212. package/dist/components/sidebar/components/sidebar-shell.d.ts.map +1 -0
  213. package/dist/components/sidebar/components/sidebar-shell.js +42 -0
  214. package/dist/components/sidebar/components/sidebar-shell.js.map +1 -0
  215. package/dist/components/sidebar/context/sidebar-provider.d.ts +5 -0
  216. package/dist/components/sidebar/context/sidebar-provider.d.ts.map +1 -0
  217. package/dist/components/sidebar/context/sidebar-provider.js +335 -0
  218. package/dist/components/sidebar/context/sidebar-provider.js.map +1 -0
  219. package/dist/components/sidebar/index.d.ts +11 -0
  220. package/dist/components/sidebar/index.d.ts.map +1 -0
  221. package/dist/components/sidebar/index.js +7 -0
  222. package/dist/components/sidebar/index.js.map +1 -0
  223. package/dist/components/sidebar/model/sidebar.state.d.ts +44 -0
  224. package/dist/components/sidebar/model/sidebar.state.d.ts.map +1 -0
  225. package/dist/components/sidebar/model/sidebar.state.js +122 -0
  226. package/dist/components/sidebar/model/sidebar.state.js.map +1 -0
  227. package/dist/components/sidebar/model/sidebar.types.d.ts +79 -0
  228. package/dist/components/sidebar/model/sidebar.types.d.ts.map +1 -0
  229. package/dist/components/sidebar/model/sidebar.types.js +2 -0
  230. package/dist/components/sidebar/model/sidebar.types.js.map +1 -0
  231. package/dist/components/skeleton.d.ts +27 -0
  232. package/dist/components/skeleton.d.ts.map +1 -0
  233. package/dist/components/skeleton.js +37 -0
  234. package/dist/components/skeleton.js.map +1 -0
  235. package/dist/components/slider.d.ts +16 -0
  236. package/dist/components/slider.d.ts.map +1 -0
  237. package/dist/components/slider.js +41 -0
  238. package/dist/components/slider.js.map +1 -0
  239. package/dist/components/stat-card.d.ts +20 -0
  240. package/dist/components/stat-card.d.ts.map +1 -0
  241. package/dist/components/stat-card.js +13 -0
  242. package/dist/components/stat-card.js.map +1 -0
  243. package/dist/components/stepper.d.ts +21 -0
  244. package/dist/components/stepper.d.ts.map +1 -0
  245. package/dist/components/stepper.js +49 -0
  246. package/dist/components/stepper.js.map +1 -0
  247. package/dist/components/switch.d.ts +8 -0
  248. package/dist/components/switch.d.ts.map +1 -0
  249. package/dist/components/switch.js +23 -0
  250. package/dist/components/switch.js.map +1 -0
  251. package/dist/components/table.d.ts +8 -0
  252. package/dist/components/table.d.ts.map +1 -0
  253. package/dist/components/table.js +9 -0
  254. package/dist/components/table.js.map +1 -0
  255. package/dist/components/tabs.d.ts +23 -0
  256. package/dist/components/tabs.d.ts.map +1 -0
  257. package/dist/components/tabs.js +96 -0
  258. package/dist/components/tabs.js.map +1 -0
  259. package/dist/components/text-field.d.ts +31 -0
  260. package/dist/components/text-field.d.ts.map +1 -0
  261. package/dist/components/text-field.js +103 -0
  262. package/dist/components/text-field.js.map +1 -0
  263. package/dist/components/time-picker.d.ts +11 -0
  264. package/dist/components/time-picker.d.ts.map +1 -0
  265. package/dist/components/time-picker.js +284 -0
  266. package/dist/components/time-picker.js.map +1 -0
  267. package/dist/components/toast.d.ts +40 -0
  268. package/dist/components/toast.d.ts.map +1 -0
  269. package/dist/components/toast.js +194 -0
  270. package/dist/components/toast.js.map +1 -0
  271. package/dist/components/token-field.d.ts +48 -0
  272. package/dist/components/token-field.d.ts.map +1 -0
  273. package/dist/components/token-field.js +244 -0
  274. package/dist/components/token-field.js.map +1 -0
  275. package/dist/components/tooltip.d.ts +12 -0
  276. package/dist/components/tooltip.d.ts.map +1 -0
  277. package/dist/components/tooltip.js +81 -0
  278. package/dist/components/tooltip.js.map +1 -0
  279. package/dist/components/top-app-bar.d.ts +28 -0
  280. package/dist/components/top-app-bar.d.ts.map +1 -0
  281. package/dist/components/top-app-bar.js +31 -0
  282. package/dist/components/top-app-bar.js.map +1 -0
  283. package/dist/components/typography.d.ts +17 -0
  284. package/dist/components/typography.d.ts.map +1 -0
  285. package/dist/components/typography.js +57 -0
  286. package/dist/components/typography.js.map +1 -0
  287. package/dist/hooks/use-scroll-lock.d.ts +6 -0
  288. package/dist/hooks/use-scroll-lock.d.ts.map +1 -0
  289. package/dist/hooks/use-scroll-lock.js +30 -0
  290. package/dist/hooks/use-scroll-lock.js.map +1 -0
  291. package/dist/index.css +5138 -0
  292. package/dist/index.d.ts +143 -0
  293. package/dist/index.d.ts.map +1 -0
  294. package/dist/index.js +79 -0
  295. package/dist/index.js.map +1 -0
  296. package/dist/layout/action-cluster.d.ts +7 -0
  297. package/dist/layout/action-cluster.d.ts.map +1 -0
  298. package/dist/layout/action-cluster.js +19 -0
  299. package/dist/layout/action-cluster.js.map +1 -0
  300. package/dist/layout/app-layout.d.ts +14 -0
  301. package/dist/layout/app-layout.d.ts.map +1 -0
  302. package/dist/layout/app-layout.js +9 -0
  303. package/dist/layout/app-layout.js.map +1 -0
  304. package/dist/layout/appearance-provider.d.ts +63 -0
  305. package/dist/layout/appearance-provider.d.ts.map +1 -0
  306. package/dist/layout/appearance-provider.js +250 -0
  307. package/dist/layout/appearance-provider.js.map +1 -0
  308. package/dist/layout/card-grid.d.ts +6 -0
  309. package/dist/layout/card-grid.d.ts.map +1 -0
  310. package/dist/layout/card-grid.js +13 -0
  311. package/dist/layout/card-grid.js.map +1 -0
  312. package/dist/layout/container.d.ts +8 -0
  313. package/dist/layout/container.d.ts.map +1 -0
  314. package/dist/layout/container.js +13 -0
  315. package/dist/layout/container.js.map +1 -0
  316. package/dist/layout/page-section.d.ts +9 -0
  317. package/dist/layout/page-section.d.ts.map +1 -0
  318. package/dist/layout/page-section.js +24 -0
  319. package/dist/layout/page-section.js.map +1 -0
  320. package/dist/layout/pane.d.ts +20 -0
  321. package/dist/layout/pane.d.ts.map +1 -0
  322. package/dist/layout/pane.js +48 -0
  323. package/dist/layout/pane.js.map +1 -0
  324. package/dist/layout/preview-frame.d.ts +8 -0
  325. package/dist/layout/preview-frame.d.ts.map +1 -0
  326. package/dist/layout/preview-frame.js +23 -0
  327. package/dist/layout/preview-frame.js.map +1 -0
  328. package/dist/layout/window-size-provider.d.ts +12 -0
  329. package/dist/layout/window-size-provider.d.ts.map +1 -0
  330. package/dist/layout/window-size-provider.js +40 -0
  331. package/dist/layout/window-size-provider.js.map +1 -0
  332. package/dist/lib/action-control.d.ts +27 -0
  333. package/dist/lib/action-control.d.ts.map +1 -0
  334. package/dist/lib/action-control.js +28 -0
  335. package/dist/lib/action-control.js.map +1 -0
  336. package/dist/lib/action-size.d.ts +41 -0
  337. package/dist/lib/action-size.d.ts.map +1 -0
  338. package/dist/lib/action-size.js +59 -0
  339. package/dist/lib/action-size.js.map +1 -0
  340. package/dist/lib/field-shell.d.ts +31 -0
  341. package/dist/lib/field-shell.d.ts.map +1 -0
  342. package/dist/lib/field-shell.js +48 -0
  343. package/dist/lib/field-shell.js.map +1 -0
  344. package/dist/lib/field-size.d.ts +44 -0
  345. package/dist/lib/field-size.d.ts.map +1 -0
  346. package/dist/lib/field-size.js +126 -0
  347. package/dist/lib/field-size.js.map +1 -0
  348. package/dist/lib/navigation-action.d.ts +21 -0
  349. package/dist/lib/navigation-action.d.ts.map +1 -0
  350. package/dist/lib/navigation-action.js +53 -0
  351. package/dist/lib/navigation-action.js.map +1 -0
  352. package/dist/lib/navigation-visuals.d.ts +38 -0
  353. package/dist/lib/navigation-visuals.d.ts.map +1 -0
  354. package/dist/lib/navigation-visuals.js +27 -0
  355. package/dist/lib/navigation-visuals.js.map +1 -0
  356. package/dist/lib/portal-layer.d.ts +3 -0
  357. package/dist/lib/portal-layer.d.ts.map +1 -0
  358. package/dist/lib/portal-layer.js +13 -0
  359. package/dist/lib/portal-layer.js.map +1 -0
  360. package/dist/lib/selection-control-size.d.ts +8 -0
  361. package/dist/lib/selection-control-size.d.ts.map +1 -0
  362. package/dist/lib/selection-control-size.js +15 -0
  363. package/dist/lib/selection-control-size.js.map +1 -0
  364. package/dist/lib/typography-roles.d.ts +20 -0
  365. package/dist/lib/typography-roles.d.ts.map +1 -0
  366. package/dist/lib/typography-roles.js +19 -0
  367. package/dist/lib/typography-roles.js.map +1 -0
  368. package/dist/lib/use-anchored-overlay-position.d.ts +21 -0
  369. package/dist/lib/use-anchored-overlay-position.d.ts.map +1 -0
  370. package/dist/lib/use-anchored-overlay-position.js +50 -0
  371. package/dist/lib/use-anchored-overlay-position.js.map +1 -0
  372. package/dist/lib/use-controllable-state.d.ts +8 -0
  373. package/dist/lib/use-controllable-state.d.ts.map +1 -0
  374. package/dist/lib/use-controllable-state.js +14 -0
  375. package/dist/lib/use-controllable-state.js.map +1 -0
  376. package/dist/lib/use-field-state.d.ts +16 -0
  377. package/dist/lib/use-field-state.d.ts.map +1 -0
  378. package/dist/lib/use-field-state.js +14 -0
  379. package/dist/lib/use-field-state.js.map +1 -0
  380. package/dist/lib/use-overlay-behavior.d.ts +17 -0
  381. package/dist/lib/use-overlay-behavior.d.ts.map +1 -0
  382. package/dist/lib/use-overlay-behavior.js +230 -0
  383. package/dist/lib/use-overlay-behavior.js.map +1 -0
  384. package/dist/lib/utils.d.ts +47 -0
  385. package/dist/lib/utils.d.ts.map +1 -0
  386. package/dist/lib/utils.js +176 -0
  387. package/dist/lib/utils.js.map +1 -0
  388. package/dist/primitives/input.d.ts +15 -0
  389. package/dist/primitives/input.d.ts.map +1 -0
  390. package/dist/primitives/input.js +17 -0
  391. package/dist/primitives/input.js.map +1 -0
  392. package/dist/primitives/label.d.ts +14 -0
  393. package/dist/primitives/label.d.ts.map +1 -0
  394. package/dist/primitives/label.js +13 -0
  395. package/dist/primitives/label.js.map +1 -0
  396. package/dist/primitives/menu.d.ts +34 -0
  397. package/dist/primitives/menu.d.ts.map +1 -0
  398. package/dist/primitives/menu.js +56 -0
  399. package/dist/primitives/menu.js.map +1 -0
  400. package/dist/primitives/surface.d.ts +15 -0
  401. package/dist/primitives/surface.d.ts.map +1 -0
  402. package/dist/primitives/surface.js +53 -0
  403. package/dist/primitives/surface.js.map +1 -0
  404. package/dist/primitives/text.d.ts +16 -0
  405. package/dist/primitives/text.d.ts.map +1 -0
  406. package/dist/primitives/text.js +78 -0
  407. package/dist/primitives/text.js.map +1 -0
  408. package/dist/primitives/textarea.d.ts +16 -0
  409. package/dist/primitives/textarea.d.ts.map +1 -0
  410. package/dist/primitives/textarea.js +18 -0
  411. package/dist/primitives/textarea.js.map +1 -0
  412. package/dist/types/navigation.d.ts +26 -0
  413. package/dist/types/navigation.d.ts.map +1 -0
  414. package/dist/types/navigation.js +2 -0
  415. package/dist/types/navigation.js.map +1 -0
  416. package/package.json +485 -0
  417. package/registry/components/accordion.tsx +166 -0
  418. package/registry/components/alert.tsx +90 -0
  419. package/registry/components/avatar.tsx +86 -0
  420. package/registry/components/badge.tsx +104 -0
  421. package/registry/components/banner.tsx +165 -0
  422. package/registry/components/bottom-app-bar.tsx +88 -0
  423. package/registry/components/breadcrumb.tsx +87 -0
  424. package/registry/components/button.tsx +195 -0
  425. package/registry/components/calendar.tsx +334 -0
  426. package/registry/components/canonical-layouts.tsx +264 -0
  427. package/registry/components/card.tsx +165 -0
  428. package/registry/components/carousel.tsx +482 -0
  429. package/registry/components/checkbox.tsx +154 -0
  430. package/registry/components/chip.tsx +201 -0
  431. package/registry/components/combobox.tsx +504 -0
  432. package/registry/components/command.tsx +165 -0
  433. package/registry/components/confirm-dialog.tsx +146 -0
  434. package/registry/components/date-input.tsx +570 -0
  435. package/registry/components/date-picker.tsx +214 -0
  436. package/registry/components/date-range-picker.tsx +449 -0
  437. package/registry/components/dialog.tsx +253 -0
  438. package/registry/components/divider.tsx +33 -0
  439. package/registry/components/drawer.tsx +217 -0
  440. package/registry/components/dropdown-menu.tsx +879 -0
  441. package/registry/components/fab-menu.tsx +138 -0
  442. package/registry/components/fab.tsx +185 -0
  443. package/registry/components/field.tsx +48 -0
  444. package/registry/components/icon-button.tsx +209 -0
  445. package/registry/components/icon.tsx +118 -0
  446. package/registry/components/list.tsx +319 -0
  447. package/registry/components/mode-switcher.tsx +48 -0
  448. package/registry/components/month-picker.tsx +363 -0
  449. package/registry/components/navigation-bar.tsx +112 -0
  450. package/registry/components/navigation-drawer.tsx +189 -0
  451. package/registry/components/navigation-rail.tsx +113 -0
  452. package/registry/components/pagination.tsx +243 -0
  453. package/registry/components/pane-group.tsx +38 -0
  454. package/registry/components/popover.tsx +395 -0
  455. package/registry/components/progress.tsx +112 -0
  456. package/registry/components/radio.tsx +103 -0
  457. package/registry/components/rating.tsx +150 -0
  458. package/registry/components/ripple.tsx +82 -0
  459. package/registry/components/scroll-area.tsx +26 -0
  460. package/registry/components/search-bar.tsx +171 -0
  461. package/registry/components/segmented-button.tsx +352 -0
  462. package/registry/components/select-field.tsx +216 -0
  463. package/registry/components/select.tsx +720 -0
  464. package/registry/components/sheet.tsx +318 -0
  465. package/registry/components/sidebar/components/sidebar-drawer.tsx +177 -0
  466. package/registry/components/sidebar/components/sidebar-inset.tsx +46 -0
  467. package/registry/components/sidebar/components/sidebar-navigation.tsx +208 -0
  468. package/registry/components/sidebar/components/sidebar-rail.tsx +47 -0
  469. package/registry/components/sidebar/components/sidebar-shell.tsx +100 -0
  470. package/registry/components/sidebar/context/sidebar-provider.tsx +402 -0
  471. package/registry/components/sidebar/index.ts +25 -0
  472. package/registry/components/sidebar/model/sidebar.state.ts +172 -0
  473. package/registry/components/sidebar/model/sidebar.types.ts +87 -0
  474. package/registry/components/skeleton.tsx +103 -0
  475. package/registry/components/slider.tsx +170 -0
  476. package/registry/components/stat-card.tsx +78 -0
  477. package/registry/components/stepper.tsx +183 -0
  478. package/registry/components/switch.tsx +123 -0
  479. package/registry/components/table.tsx +71 -0
  480. package/registry/components/tabs.tsx +235 -0
  481. package/registry/components/text-field.tsx +273 -0
  482. package/registry/components/time-picker.tsx +571 -0
  483. package/registry/components/toast.tsx +402 -0
  484. package/registry/components/token-field.tsx +438 -0
  485. package/registry/components/tooltip.tsx +149 -0
  486. package/registry/components/top-app-bar.tsx +120 -0
  487. package/registry/components/typography.tsx +95 -0
  488. package/registry/hooks/use-scroll-lock.ts +36 -0
  489. package/registry/layout/action-cluster.tsx +40 -0
  490. package/registry/layout/app-layout.tsx +82 -0
  491. package/registry/layout/appearance-provider.tsx +367 -0
  492. package/registry/layout/card-grid.tsx +31 -0
  493. package/registry/layout/container.tsx +26 -0
  494. package/registry/layout/page-section.tsx +54 -0
  495. package/registry/layout/pane.tsx +126 -0
  496. package/registry/layout/preview-frame.tsx +50 -0
  497. package/registry/layout/window-size-provider.tsx +59 -0
  498. package/registry/lib/action-control.tsx +68 -0
  499. package/registry/lib/action-size.ts +67 -0
  500. package/registry/lib/field-shell.ts +115 -0
  501. package/registry/lib/field-size.ts +169 -0
  502. package/registry/lib/navigation-action.tsx +109 -0
  503. package/registry/lib/navigation-visuals.tsx +173 -0
  504. package/registry/lib/portal-layer.ts +17 -0
  505. package/registry/lib/selection-control-size.ts +24 -0
  506. package/registry/lib/typography-roles.ts +23 -0
  507. package/registry/lib/use-anchored-overlay-position.ts +95 -0
  508. package/registry/lib/use-controllable-state.ts +29 -0
  509. package/registry/lib/use-field-state.ts +32 -0
  510. package/registry/lib/use-overlay-behavior.ts +324 -0
  511. package/registry/lib/utils.ts +205 -0
  512. package/registry/primitives/input.tsx +37 -0
  513. package/registry/primitives/label.tsx +35 -0
  514. package/registry/primitives/menu.tsx +218 -0
  515. package/registry/primitives/surface.tsx +67 -0
  516. package/registry/primitives/text.tsx +105 -0
  517. package/registry/primitives/textarea.tsx +38 -0
  518. package/registry/registry-schema.json +91 -0
  519. package/registry/registry.json +1369 -0
  520. package/registry/styles/globals.css +1370 -0
  521. package/registry/styles/themes/black.css +342 -0
  522. package/registry/styles/themes/blue.css +342 -0
  523. package/registry/styles/themes/cyan.css +342 -0
  524. package/registry/styles/themes/green.css +342 -0
  525. package/registry/styles/themes/neutral.css +342 -0
  526. package/registry/styles/themes/orange.css +342 -0
  527. package/registry/styles/themes/pink.css +342 -0
  528. package/registry/styles/themes/purple.css +342 -0
  529. package/registry/styles/themes/red.css +342 -0
  530. package/registry/styles/themes/yellow.css +342 -0
  531. package/registry/tsconfig.json +10 -0
  532. package/registry/types/navigation.ts +35 -0
  533. package/unisane.meta.json +99 -0
@@ -0,0 +1,166 @@
1
+ 'use client';
2
+
3
+ import React, { useState, useId } from 'react';
4
+ import { cn } from '@/lib/utils';
5
+ import { Icon } from '@/components/ui/icon';
6
+ import { Ripple } from '@/components/ui/ripple';
7
+
8
+ interface AccordionContextValue {
9
+ expanded: string[];
10
+ toggle: (value: string) => void;
11
+ }
12
+
13
+ const AccordionContext = React.createContext<AccordionContextValue | null>(null);
14
+
15
+ export interface AccordionProps {
16
+ type?: 'single' | 'multiple';
17
+ defaultValue?: string[];
18
+ children: React.ReactNode;
19
+ className?: string;
20
+ }
21
+
22
+ export const Accordion: React.FC<AccordionProps> = ({
23
+ type = 'single',
24
+ defaultValue = [],
25
+ children,
26
+ className,
27
+ }) => {
28
+ const [expanded, setExpanded] = useState<string[]>(defaultValue);
29
+
30
+ const toggle = (value: string) => {
31
+ if (type === 'single') {
32
+ setExpanded((prev) => (prev.includes(value) ? [] : [value]));
33
+ return;
34
+ }
35
+
36
+ setExpanded((prev) =>
37
+ prev.includes(value) ? prev.filter((item) => item !== value) : [...prev, value],
38
+ );
39
+ };
40
+
41
+ return (
42
+ <AccordionContext.Provider value={{ expanded, toggle }}>
43
+ <div
44
+ className={cn(
45
+ 'border-outline-soft bg-surface flex flex-col overflow-hidden rounded-sm border',
46
+ className,
47
+ )}
48
+ >
49
+ {children}
50
+ </div>
51
+ </AccordionContext.Provider>
52
+ );
53
+ };
54
+
55
+ export interface AccordionItemProps {
56
+ value: string;
57
+ children: React.ReactNode;
58
+ className?: string;
59
+ }
60
+
61
+ export const AccordionItem: React.FC<AccordionItemProps> = ({ value, children, className }) => {
62
+ const context = React.useContext(AccordionContext);
63
+ const isExpanded = context?.expanded.includes(value);
64
+ const contentId = useId();
65
+ const triggerId = useId();
66
+
67
+ return (
68
+ <div
69
+ className={cn(
70
+ 'border-outline-weak border-b last:border-none',
71
+ isExpanded && 'bg-surface-container-low',
72
+ className,
73
+ )}
74
+ >
75
+ {React.Children.map(children, (child) => {
76
+ if (React.isValidElement(child)) {
77
+ return React.cloneElement(child as React.ReactElement<Record<string, unknown>>, {
78
+ value,
79
+ isExpanded,
80
+ contentId,
81
+ triggerId,
82
+ });
83
+ }
84
+ return child;
85
+ })}
86
+ </div>
87
+ );
88
+ };
89
+
90
+ export interface AccordionTriggerProps {
91
+ children: React.ReactNode;
92
+ value?: string;
93
+ isExpanded?: boolean;
94
+ contentId?: string;
95
+ triggerId?: string;
96
+ }
97
+
98
+ export const AccordionTrigger: React.FC<AccordionTriggerProps> = ({
99
+ children,
100
+ value,
101
+ isExpanded,
102
+ contentId,
103
+ triggerId,
104
+ }) => {
105
+ const context = React.useContext(AccordionContext);
106
+
107
+ const handleKeyDown = (e: React.KeyboardEvent) => {
108
+ if (e.key === 'Enter' || e.key === ' ') {
109
+ e.preventDefault();
110
+ context?.toggle(value!);
111
+ }
112
+ };
113
+
114
+ return (
115
+ <button
116
+ id={triggerId}
117
+ onClick={() => context?.toggle(value!)}
118
+ onKeyDown={handleKeyDown}
119
+ aria-expanded={isExpanded}
120
+ aria-controls={contentId}
121
+ className={cn(
122
+ 'text-label-medium group relative flex h-12 w-full items-center justify-between overflow-hidden px-4 font-medium transition-all',
123
+ isExpanded ? 'text-primary' : 'text-on-surface hover:bg-state-hover',
124
+ )}
125
+ >
126
+ <Ripple />
127
+ <span className="relative z-10 flex-1 pt-0.5 text-left">{children}</span>
128
+ <Icon
129
+ symbol="expand_more"
130
+ className={cn(
131
+ 'duration-medium ease-emphasized relative z-10 transition-transform',
132
+ isExpanded && 'rotate-180',
133
+ )}
134
+ />
135
+ </button>
136
+ );
137
+ };
138
+
139
+ export interface AccordionContentProps {
140
+ children: React.ReactNode;
141
+ isExpanded?: boolean;
142
+ contentId?: string;
143
+ triggerId?: string;
144
+ }
145
+
146
+ export const AccordionContent: React.FC<AccordionContentProps> = ({
147
+ children,
148
+ isExpanded,
149
+ contentId,
150
+ triggerId,
151
+ }) => (
152
+ <div
153
+ id={contentId}
154
+ role="region"
155
+ aria-labelledby={triggerId}
156
+ aria-hidden={!isExpanded}
157
+ className={cn(
158
+ 'duration-medium ease-emphasized overflow-hidden transition-all',
159
+ isExpanded ? 'max-h-250 opacity-100' : 'max-h-0 opacity-0',
160
+ )}
161
+ >
162
+ <div className="text-on-surface-variant text-body-small px-4 pt-1 pb-4 leading-relaxed font-medium">
163
+ {children}
164
+ </div>
165
+ </div>
166
+ );
@@ -0,0 +1,90 @@
1
+ import React, { forwardRef, type ReactNode } from 'react';
2
+ import { cva, type VariantProps } from 'class-variance-authority';
3
+ import { cn } from '@/lib/utils';
4
+ import { Icon } from '@/components/ui/icon';
5
+ import { Typography } from '@/components/ui/typography';
6
+
7
+ const alertVariants = cva('relative flex w-full items-start gap-3 rounded-sm border-l-4 p-4', {
8
+ variants: {
9
+ variant: {
10
+ info: 'bg-info-container border-info text-on-info-container',
11
+ error: 'bg-error-container border-error text-on-error-container',
12
+ warning: 'bg-warning-container border-warning text-on-warning-container',
13
+ success: 'bg-success-container border-success text-on-success-container',
14
+ },
15
+ },
16
+ defaultVariants: {
17
+ variant: 'info',
18
+ },
19
+ });
20
+
21
+ export type AlertVariant = NonNullable<VariantProps<typeof alertVariants>['variant']>;
22
+
23
+ export interface AlertProps
24
+ extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>, VariantProps<typeof alertVariants> {
25
+ icon?: ReactNode | string | false;
26
+ title?: ReactNode;
27
+ }
28
+
29
+ const DEFAULT_ICONS: Record<AlertVariant, string> = {
30
+ info: 'info',
31
+ error: 'error',
32
+ warning: 'warning',
33
+ success: 'check_circle',
34
+ };
35
+
36
+ export const Alert = forwardRef<HTMLDivElement, AlertProps>(
37
+ (
38
+ {
39
+ variant = 'info',
40
+ icon,
41
+ title,
42
+ children,
43
+ className,
44
+ role,
45
+ 'aria-live': ariaLive,
46
+ 'aria-atomic': ariaAtomic,
47
+ ...props
48
+ },
49
+ ref,
50
+ ) => {
51
+ const resolvedVariant = variant ?? 'info';
52
+ const isAssertive = resolvedVariant === 'error' || resolvedVariant === 'warning';
53
+ const iconNode =
54
+ icon === false ? null : typeof icon === 'string' || icon === undefined ? (
55
+ <Icon symbol={icon ?? DEFAULT_ICONS[resolvedVariant]} size="sm" />
56
+ ) : (
57
+ icon
58
+ );
59
+
60
+ return (
61
+ <div
62
+ ref={ref}
63
+ className={cn(alertVariants({ variant: resolvedVariant, className }))}
64
+ role={role ?? (isAssertive ? 'alert' : 'status')}
65
+ aria-live={ariaLive ?? (isAssertive ? 'assertive' : 'polite')}
66
+ aria-atomic={ariaAtomic ?? true}
67
+ {...props}
68
+ >
69
+ {iconNode ? (
70
+ <div
71
+ aria-hidden="true"
72
+ className="size-icon-sm flex shrink-0 items-center justify-center opacity-80"
73
+ >
74
+ {iconNode}
75
+ </div>
76
+ ) : null}
77
+ <div className="flex flex-1 flex-col gap-1">
78
+ {title ? (
79
+ <Typography variant="labelMedium" className="text-inherit">
80
+ {title}
81
+ </Typography>
82
+ ) : null}
83
+ <div className="text-body-small leading-snug opacity-90">{children}</div>
84
+ </div>
85
+ </div>
86
+ );
87
+ },
88
+ );
89
+
90
+ Alert.displayName = 'Alert';
@@ -0,0 +1,86 @@
1
+ import React from 'react';
2
+ import { cva, type VariantProps } from 'class-variance-authority';
3
+ import { cn } from '@/lib/utils';
4
+ import { avatarSizeClasses } from '@/lib/action-size';
5
+ import { Surface } from '@/primitives/surface';
6
+ import { Text } from '@/primitives/text';
7
+
8
+ const avatarVariants = cva(
9
+ 'relative inline-flex items-center justify-center overflow-hidden rounded-full',
10
+ {
11
+ variants: {
12
+ size: {
13
+ sm: avatarSizeClasses.sm,
14
+ md: avatarSizeClasses.md,
15
+ lg: avatarSizeClasses.lg,
16
+ xl: avatarSizeClasses.xl,
17
+ },
18
+ variant: {
19
+ circular: 'rounded-full',
20
+ rounded: 'rounded-sm',
21
+ square: 'rounded-none',
22
+ },
23
+ },
24
+ defaultVariants: {
25
+ size: 'md',
26
+ variant: 'circular',
27
+ },
28
+ },
29
+ );
30
+
31
+ export type AvatarProps = VariantProps<typeof avatarVariants> & {
32
+ src?: string | undefined;
33
+ alt?: string | undefined;
34
+ fallback?: string | undefined;
35
+ className?: string | undefined;
36
+ };
37
+
38
+ export const Avatar: React.FC<AvatarProps> = ({ src, alt, fallback, size, variant, className }) => {
39
+ const fallbackChar = fallback?.charAt(0).toUpperCase() || '?';
40
+ const fallbackLabel = fallback || alt || 'Avatar';
41
+
42
+ return (
43
+ <Surface
44
+ tone="surfaceVariant"
45
+ className={cn(avatarVariants({ size, variant, className }))}
46
+ role="img"
47
+ aria-label={src ? alt : fallbackLabel}
48
+ >
49
+ {src ? (
50
+ <img src={src} alt={alt || 'Avatar'} className="h-full w-full object-cover" />
51
+ ) : (
52
+ <Text variant="labelLarge" className="text-inherit" aria-hidden="true">
53
+ {fallbackChar}
54
+ </Text>
55
+ )}
56
+ </Surface>
57
+ );
58
+ };
59
+
60
+ export const AvatarGroup: React.FC<{
61
+ children: React.ReactNode;
62
+ max?: number;
63
+ className?: string;
64
+ }> = ({ children, max = 5, className }) => {
65
+ const childrenArray = React.Children.toArray(children);
66
+ const visibleChildren = childrenArray.slice(0, max);
67
+ const remainingCount = childrenArray.length - max;
68
+
69
+ return (
70
+ <div className={cn('flex -space-x-2', className)} role="group" aria-label="Avatar group">
71
+ {visibleChildren}
72
+ {remainingCount > 0 && (
73
+ <Surface
74
+ tone="surfaceVariant"
75
+ className="border-surface flex h-[var(--size-avatar-md)] w-[var(--size-avatar-md)] items-center justify-center rounded-full border-2"
76
+ role="img"
77
+ aria-label={`${remainingCount} more`}
78
+ >
79
+ <Text variant="labelSmall" className="text-on-surface-variant" aria-hidden="true">
80
+ +{remainingCount}
81
+ </Text>
82
+ </Surface>
83
+ )}
84
+ </div>
85
+ );
86
+ };
@@ -0,0 +1,104 @@
1
+ import React, { forwardRef } from 'react';
2
+ import { cva, type VariantProps } from 'class-variance-authority';
3
+ import { cn } from '@/lib/utils';
4
+
5
+ const badgeVariants = cva('inline-flex items-center justify-center rounded-full font-medium', {
6
+ variants: {
7
+ variant: {
8
+ filled: '',
9
+ tonal: '',
10
+ outlined: 'border border-outline-soft',
11
+ },
12
+ color: {
13
+ primary: '',
14
+ secondary: '',
15
+ tertiary: '',
16
+ error: '',
17
+ success: '',
18
+ warning: '',
19
+ info: '',
20
+ },
21
+ size: {
22
+ sm: 'text-label-small px-1.5 py-0.5',
23
+ md: 'text-label-small px-2 py-0.5',
24
+ lg: 'text-body-small px-3 py-1',
25
+ },
26
+ },
27
+ compoundVariants: [
28
+ { variant: 'filled', color: 'primary', className: 'bg-primary text-on-primary' },
29
+ { variant: 'filled', color: 'secondary', className: 'bg-secondary text-on-secondary' },
30
+ { variant: 'filled', color: 'tertiary', className: 'bg-tertiary text-on-tertiary' },
31
+ { variant: 'filled', color: 'error', className: 'bg-error text-on-error' },
32
+ { variant: 'filled', color: 'success', className: 'bg-success text-on-success' },
33
+ { variant: 'filled', color: 'warning', className: 'bg-warning text-on-warning' },
34
+ { variant: 'filled', color: 'info', className: 'bg-info text-on-info' },
35
+ {
36
+ variant: 'tonal',
37
+ color: 'primary',
38
+ className: 'bg-primary-container text-on-primary-container',
39
+ },
40
+ {
41
+ variant: 'tonal',
42
+ color: 'secondary',
43
+ className: 'bg-secondary-container text-on-secondary-container',
44
+ },
45
+ {
46
+ variant: 'tonal',
47
+ color: 'tertiary',
48
+ className: 'bg-tertiary-container text-on-tertiary-container',
49
+ },
50
+ { variant: 'tonal', color: 'error', className: 'bg-error-container text-on-error-container' },
51
+ {
52
+ variant: 'tonal',
53
+ color: 'success',
54
+ className: 'bg-success-container text-on-success-container',
55
+ },
56
+ {
57
+ variant: 'tonal',
58
+ color: 'warning',
59
+ className: 'bg-warning-container text-on-warning-container',
60
+ },
61
+ {
62
+ variant: 'tonal',
63
+ color: 'info',
64
+ className: 'bg-info-container text-on-info-container',
65
+ },
66
+ { variant: 'outlined', color: 'primary', className: 'text-primary border-primary-container' },
67
+ {
68
+ variant: 'outlined',
69
+ color: 'secondary',
70
+ className: 'text-secondary border-secondary-container',
71
+ },
72
+ {
73
+ variant: 'outlined',
74
+ color: 'tertiary',
75
+ className: 'text-tertiary border-tertiary-container',
76
+ },
77
+ { variant: 'outlined', color: 'error', className: 'text-error border-error-container' },
78
+ { variant: 'outlined', color: 'success', className: 'text-success border-success-container' },
79
+ { variant: 'outlined', color: 'warning', className: 'text-warning border-warning-container' },
80
+ { variant: 'outlined', color: 'info', className: 'text-info border-info-container' },
81
+ ],
82
+ defaultVariants: {
83
+ variant: 'filled',
84
+ color: 'primary',
85
+ size: 'md',
86
+ },
87
+ });
88
+
89
+ export type BadgeProps = VariantProps<typeof badgeVariants> &
90
+ React.HTMLAttributes<HTMLSpanElement> & {
91
+ children: React.ReactNode;
92
+ };
93
+
94
+ export const Badge = forwardRef<HTMLSpanElement, BadgeProps>(
95
+ ({ children, variant, color, size, className, ...props }, ref) => {
96
+ return (
97
+ <span ref={ref} className={cn(badgeVariants({ variant, color, size, className }))} {...props}>
98
+ {children}
99
+ </span>
100
+ );
101
+ },
102
+ );
103
+
104
+ Badge.displayName = 'Badge';
@@ -0,0 +1,165 @@
1
+ import React, { forwardRef, type MouseEventHandler, type ReactNode } from 'react';
2
+ import { cva, type VariantProps } from 'class-variance-authority';
3
+ import { cn } from '@/lib/utils';
4
+ import { Surface } from '@/primitives/surface';
5
+ import { Text } from '@/primitives/text';
6
+ import { Button } from '@/components/ui/button';
7
+ import { IconButton } from '@/components/ui/icon-button';
8
+ import { Icon } from '@/components/ui/icon';
9
+
10
+ const bannerVariants = cva(
11
+ 'relative flex w-full items-start gap-4 border-b border-outline-weak p-4 transition-all duration-medium ease-standard',
12
+ {
13
+ variants: {
14
+ variant: {
15
+ default: 'bg-surface text-on-surface',
16
+ info: 'bg-info-container text-on-info-container',
17
+ success: 'bg-success-container text-on-success-container',
18
+ warning: 'bg-warning-container text-on-warning-container',
19
+ error: 'bg-error-container text-on-error-container',
20
+ },
21
+ },
22
+ defaultVariants: {
23
+ variant: 'default',
24
+ },
25
+ },
26
+ );
27
+
28
+ export type BannerVariant = NonNullable<VariantProps<typeof bannerVariants>['variant']>;
29
+
30
+ export interface BannerAction {
31
+ id: string;
32
+ label: ReactNode;
33
+ onClick: MouseEventHandler<HTMLButtonElement>;
34
+ disabled?: boolean;
35
+ }
36
+
37
+ export interface BannerProps
38
+ extends
39
+ Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'title'>,
40
+ VariantProps<typeof bannerVariants> {
41
+ children: ReactNode;
42
+ open?: boolean;
43
+ onDismiss?: () => void;
44
+ dismissLabel?: string;
45
+ icon?: ReactNode | string | false;
46
+ title?: ReactNode;
47
+ actions?: BannerAction[];
48
+ }
49
+
50
+ const DEFAULT_ICONS: Record<BannerVariant, string> = {
51
+ default: 'info',
52
+ info: 'info',
53
+ success: 'check_circle',
54
+ warning: 'warning',
55
+ error: 'error',
56
+ };
57
+
58
+ export const Banner = forwardRef<HTMLDivElement, BannerProps>(
59
+ (
60
+ {
61
+ children,
62
+ open = true,
63
+ onDismiss,
64
+ dismissLabel = 'Dismiss banner',
65
+ icon,
66
+ title,
67
+ actions,
68
+ className,
69
+ variant = 'default',
70
+ role,
71
+ 'aria-live': ariaLive,
72
+ 'aria-atomic': ariaAtomic,
73
+ ...props
74
+ },
75
+ ref,
76
+ ) => {
77
+ if (!open) return null;
78
+
79
+ const resolvedVariant = variant ?? 'default';
80
+ const isAssertive = resolvedVariant === 'error' || resolvedVariant === 'warning';
81
+ const isDefaultVariant = resolvedVariant === 'default';
82
+ const iconNode =
83
+ icon === false ? null : typeof icon === 'string' || icon === undefined ? (
84
+ <Icon symbol={icon ?? DEFAULT_ICONS[resolvedVariant]} size="sm" />
85
+ ) : (
86
+ icon
87
+ );
88
+
89
+ return (
90
+ <Surface
91
+ ref={ref}
92
+ tone="surface"
93
+ className={cn(bannerVariants({ variant: resolvedVariant, className }))}
94
+ role={role ?? (isAssertive ? 'alert' : 'status')}
95
+ aria-live={ariaLive ?? (isAssertive ? 'assertive' : 'polite')}
96
+ aria-atomic={ariaAtomic ?? true}
97
+ {...props}
98
+ >
99
+ {iconNode ? (
100
+ <div
101
+ aria-hidden="true"
102
+ className={cn(
103
+ 'size-icon-sm mt-0.5 flex shrink-0 items-center justify-center',
104
+ isDefaultVariant ? 'text-primary' : 'text-inherit',
105
+ )}
106
+ >
107
+ {iconNode}
108
+ </div>
109
+ ) : null}
110
+
111
+ <div className="min-w-0 flex-1">
112
+ {title ? (
113
+ <Text
114
+ variant="titleSmall"
115
+ className={cn('mb-1', isDefaultVariant ? 'text-on-surface' : 'text-inherit')}
116
+ >
117
+ {title}
118
+ </Text>
119
+ ) : null}
120
+ <div
121
+ className={cn(
122
+ 'text-body-small leading-relaxed',
123
+ isDefaultVariant ? 'text-on-surface-variant' : 'text-inherit opacity-90',
124
+ )}
125
+ >
126
+ {children}
127
+ </div>
128
+
129
+ {actions?.length ? (
130
+ <div className="mt-4 flex flex-wrap gap-2">
131
+ {actions.map((action) => (
132
+ <Button
133
+ key={action.id}
134
+ variant="text"
135
+ size="sm"
136
+ disabled={action.disabled}
137
+ onClick={action.onClick}
138
+ className={cn('font-medium', isDefaultVariant ? 'text-primary' : 'text-inherit')}
139
+ >
140
+ {action.label}
141
+ </Button>
142
+ ))}
143
+ </div>
144
+ ) : null}
145
+ </div>
146
+
147
+ {onDismiss ? (
148
+ <IconButton
149
+ icon={<Icon symbol="close" size="sm" />}
150
+ onClick={onDismiss}
151
+ className={cn(
152
+ 'hover:bg-state-hover ml-2 shrink-0',
153
+ isDefaultVariant
154
+ ? 'text-on-surface-variant'
155
+ : 'text-inherit opacity-80 hover:opacity-100',
156
+ )}
157
+ aria-label={dismissLabel}
158
+ />
159
+ ) : null}
160
+ </Surface>
161
+ );
162
+ },
163
+ );
164
+
165
+ Banner.displayName = 'Banner';
@@ -0,0 +1,88 @@
1
+ import React, { forwardRef } from 'react';
2
+ import { cva, type VariantProps } from 'class-variance-authority';
3
+ import { cn, focusRing } from '@/lib/utils';
4
+ import { Surface } from '@/primitives/surface';
5
+ import { Ripple } from '@/components/ui/ripple';
6
+
7
+ const bottomAppBarVariants = cva(
8
+ 'fixed bottom-0 left-0 right-0 h-20 flex items-center justify-between px-4 z-20',
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: '',
13
+ },
14
+ },
15
+ defaultVariants: {
16
+ variant: 'default',
17
+ },
18
+ },
19
+ );
20
+
21
+ export type BottomAppBarProps = VariantProps<typeof bottomAppBarVariants> &
22
+ Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> & {
23
+ children: React.ReactNode;
24
+ fab?: React.ReactNode;
25
+ };
26
+
27
+ export const BottomAppBar = forwardRef<HTMLDivElement, BottomAppBarProps>(
28
+ (
29
+ { children, fab, className, variant, ['aria-label']: ariaLabel = 'Bottom actions', ...props },
30
+ ref,
31
+ ) => (
32
+ <Surface
33
+ ref={ref}
34
+ tone="surface"
35
+ elevation={3}
36
+ className={cn(bottomAppBarVariants({ variant, className }))}
37
+ role="toolbar"
38
+ aria-label={ariaLabel}
39
+ {...props}
40
+ >
41
+ <div className="flex flex-1 items-center gap-2">{children}</div>
42
+
43
+ {fab && <div className="absolute -top-8 left-1/2 -translate-x-1/2">{fab}</div>}
44
+ </Surface>
45
+ ),
46
+ );
47
+
48
+ BottomAppBar.displayName = 'BottomAppBar';
49
+
50
+ const bottomAppBarActionVariants = cva(
51
+ 'relative flex h-12 w-12 items-center justify-center overflow-hidden rounded-icon-button select-none transition-colors duration-short disabled:pointer-events-none disabled:opacity-38',
52
+ {
53
+ variants: {
54
+ active: {
55
+ true: 'text-primary',
56
+ false: 'text-on-surface-variant hover:text-primary',
57
+ },
58
+ },
59
+ defaultVariants: {
60
+ active: false,
61
+ },
62
+ },
63
+ );
64
+
65
+ export type BottomAppBarActionProps = VariantProps<typeof bottomAppBarActionVariants> & {
66
+ icon: React.ReactNode;
67
+ label: string;
68
+ active?: boolean;
69
+ className?: string;
70
+ } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'>;
71
+
72
+ export const BottomAppBarAction = forwardRef<HTMLButtonElement, BottomAppBarActionProps>(
73
+ ({ icon, label, active, className, type = 'button', ...props }, ref) => (
74
+ <button
75
+ ref={ref}
76
+ type={type}
77
+ className={cn(bottomAppBarActionVariants({ active, className }), focusRing)}
78
+ aria-label={props['aria-label'] ?? label}
79
+ aria-pressed={active}
80
+ {...props}
81
+ >
82
+ <Ripple />
83
+ <div className="size-icon-sm relative z-10 flex items-center justify-center">{icon}</div>
84
+ </button>
85
+ ),
86
+ );
87
+
88
+ BottomAppBarAction.displayName = 'BottomAppBarAction';