@spatika/react 1.0.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 (406) hide show
  1. package/README.md +72 -0
  2. package/dist/composites/ActionBar.d.ts +7 -0
  3. package/dist/composites/ActionBar.d.ts.map +1 -0
  4. package/dist/composites/ActionBar.js +5 -0
  5. package/dist/composites/AmountInput.d.ts +10 -0
  6. package/dist/composites/AmountInput.d.ts.map +1 -0
  7. package/dist/composites/AmountInput.js +7 -0
  8. package/dist/composites/AppHeader.d.ts +25 -0
  9. package/dist/composites/AppHeader.d.ts.map +1 -0
  10. package/dist/composites/AppHeader.js +13 -0
  11. package/dist/composites/AppSidebar.d.ts +30 -0
  12. package/dist/composites/AppSidebar.d.ts.map +1 -0
  13. package/dist/composites/AppSidebar.js +15 -0
  14. package/dist/composites/BottomSheet.d.ts +36 -0
  15. package/dist/composites/BottomSheet.d.ts.map +1 -0
  16. package/dist/composites/BottomSheet.js +37 -0
  17. package/dist/composites/Breadcrumb.d.ts +10 -0
  18. package/dist/composites/Breadcrumb.d.ts.map +1 -0
  19. package/dist/composites/Breadcrumb.js +10 -0
  20. package/dist/composites/Callout.d.ts +8 -0
  21. package/dist/composites/Callout.d.ts.map +1 -0
  22. package/dist/composites/Callout.js +5 -0
  23. package/dist/composites/Card.d.ts +31 -0
  24. package/dist/composites/Card.d.ts.map +1 -0
  25. package/dist/composites/Card.js +33 -0
  26. package/dist/composites/Chip.d.ts +13 -0
  27. package/dist/composites/Chip.d.ts.map +1 -0
  28. package/dist/composites/Chip.js +59 -0
  29. package/dist/composites/ChipGroup.d.ts +23 -0
  30. package/dist/composites/ChipGroup.d.ts.map +1 -0
  31. package/dist/composites/ChipGroup.js +27 -0
  32. package/dist/composites/CommandSearchField.d.ts +27 -0
  33. package/dist/composites/CommandSearchField.d.ts.map +1 -0
  34. package/dist/composites/CommandSearchField.js +17 -0
  35. package/dist/composites/CoverHero.d.ts +51 -0
  36. package/dist/composites/CoverHero.d.ts.map +1 -0
  37. package/dist/composites/CoverHero.js +71 -0
  38. package/dist/composites/CoverPattern.d.ts +12 -0
  39. package/dist/composites/CoverPattern.d.ts.map +1 -0
  40. package/dist/composites/CoverPattern.js +14 -0
  41. package/dist/composites/DataTableToolbar.d.ts +13 -0
  42. package/dist/composites/DataTableToolbar.d.ts.map +1 -0
  43. package/dist/composites/DataTableToolbar.js +7 -0
  44. package/dist/composites/DividerLabel.d.ts +5 -0
  45. package/dist/composites/DividerLabel.d.ts.map +1 -0
  46. package/dist/composites/DividerLabel.js +5 -0
  47. package/dist/composites/EmptyState.d.ts +16 -0
  48. package/dist/composites/EmptyState.d.ts.map +1 -0
  49. package/dist/composites/EmptyState.js +10 -0
  50. package/dist/composites/EntityCard.d.ts +31 -0
  51. package/dist/composites/EntityCard.d.ts.map +1 -0
  52. package/dist/composites/EntityCard.js +21 -0
  53. package/dist/composites/EntityMediaCard.d.ts +25 -0
  54. package/dist/composites/EntityMediaCard.d.ts.map +1 -0
  55. package/dist/composites/EntityMediaCard.js +17 -0
  56. package/dist/composites/FilterSheet.d.ts +34 -0
  57. package/dist/composites/FilterSheet.d.ts.map +1 -0
  58. package/dist/composites/FilterSheet.js +36 -0
  59. package/dist/composites/FloatingPageChrome.d.ts +90 -0
  60. package/dist/composites/FloatingPageChrome.d.ts.map +1 -0
  61. package/dist/composites/FloatingPageChrome.js +67 -0
  62. package/dist/composites/FormField.d.ts +15 -0
  63. package/dist/composites/FormField.d.ts.map +1 -0
  64. package/dist/composites/FormField.js +9 -0
  65. package/dist/composites/GlassCard.d.ts +13 -0
  66. package/dist/composites/GlassCard.d.ts.map +1 -0
  67. package/dist/composites/GlassCard.js +32 -0
  68. package/dist/composites/HeaderIconButton.d.ts +13 -0
  69. package/dist/composites/HeaderIconButton.d.ts.map +1 -0
  70. package/dist/composites/HeaderIconButton.js +12 -0
  71. package/dist/composites/ListRow.d.ts +9 -0
  72. package/dist/composites/ListRow.d.ts.map +1 -0
  73. package/dist/composites/ListRow.js +6 -0
  74. package/dist/composites/MediaEntryCard.d.ts +25 -0
  75. package/dist/composites/MediaEntryCard.d.ts.map +1 -0
  76. package/dist/composites/MediaEntryCard.js +10 -0
  77. package/dist/composites/MobileTabBar.d.ts +33 -0
  78. package/dist/composites/MobileTabBar.d.ts.map +1 -0
  79. package/dist/composites/MobileTabBar.js +19 -0
  80. package/dist/composites/NotificationBell.d.ts +28 -0
  81. package/dist/composites/NotificationBell.d.ts.map +1 -0
  82. package/dist/composites/NotificationBell.js +25 -0
  83. package/dist/composites/PageHeader.d.ts +11 -0
  84. package/dist/composites/PageHeader.d.ts.map +1 -0
  85. package/dist/composites/PageHeader.js +6 -0
  86. package/dist/composites/PageShell.d.ts +12 -0
  87. package/dist/composites/PageShell.d.ts.map +1 -0
  88. package/dist/composites/PageShell.js +8 -0
  89. package/dist/composites/PageStickyHeader.d.ts +33 -0
  90. package/dist/composites/PageStickyHeader.d.ts.map +1 -0
  91. package/dist/composites/PageStickyHeader.js +19 -0
  92. package/dist/composites/Pagination.d.ts +7 -0
  93. package/dist/composites/Pagination.d.ts.map +1 -0
  94. package/dist/composites/Pagination.js +6 -0
  95. package/dist/composites/PhotoViewer.d.ts +18 -0
  96. package/dist/composites/PhotoViewer.d.ts.map +1 -0
  97. package/dist/composites/PhotoViewer.js +37 -0
  98. package/dist/composites/PinPad.d.ts +29 -0
  99. package/dist/composites/PinPad.d.ts.map +1 -0
  100. package/dist/composites/PinPad.js +58 -0
  101. package/dist/composites/ProfileHero.d.ts +34 -0
  102. package/dist/composites/ProfileHero.d.ts.map +1 -0
  103. package/dist/composites/ProfileHero.js +21 -0
  104. package/dist/composites/QuickFilterRail.d.ts +25 -0
  105. package/dist/composites/QuickFilterRail.d.ts.map +1 -0
  106. package/dist/composites/QuickFilterRail.js +18 -0
  107. package/dist/composites/QuickSettings.d.ts +27 -0
  108. package/dist/composites/QuickSettings.d.ts.map +1 -0
  109. package/dist/composites/QuickSettings.js +18 -0
  110. package/dist/composites/RichTextEditor.d.ts +13 -0
  111. package/dist/composites/RichTextEditor.d.ts.map +1 -0
  112. package/dist/composites/RichTextEditor.js +23 -0
  113. package/dist/composites/SearchField.d.ts +8 -0
  114. package/dist/composites/SearchField.d.ts.map +1 -0
  115. package/dist/composites/SearchField.js +8 -0
  116. package/dist/composites/SectionPanel.d.ts +16 -0
  117. package/dist/composites/SectionPanel.d.ts.map +1 -0
  118. package/dist/composites/SectionPanel.js +8 -0
  119. package/dist/composites/SegmentedControl.d.ts +17 -0
  120. package/dist/composites/SegmentedControl.d.ts.map +1 -0
  121. package/dist/composites/SegmentedControl.js +11 -0
  122. package/dist/composites/StatCard.d.ts +11 -0
  123. package/dist/composites/StatCard.d.ts.map +1 -0
  124. package/dist/composites/StatCard.js +6 -0
  125. package/dist/composites/StatusDot.d.ts +11 -0
  126. package/dist/composites/StatusDot.d.ts.map +1 -0
  127. package/dist/composites/StatusDot.js +23 -0
  128. package/dist/composites/SurfaceCard.d.ts +12 -0
  129. package/dist/composites/SurfaceCard.d.ts.map +1 -0
  130. package/dist/composites/SurfaceCard.js +24 -0
  131. package/dist/composites/Timeline.d.ts +19 -0
  132. package/dist/composites/Timeline.d.ts.map +1 -0
  133. package/dist/composites/Timeline.js +12 -0
  134. package/dist/composites/Toast.d.ts +26 -0
  135. package/dist/composites/Toast.d.ts.map +1 -0
  136. package/dist/composites/Toast.js +49 -0
  137. package/dist/composites/Toolbar.d.ts +6 -0
  138. package/dist/composites/Toolbar.d.ts.map +1 -0
  139. package/dist/composites/Toolbar.js +5 -0
  140. package/dist/composites/ViewFiltersPanel.d.ts +21 -0
  141. package/dist/composites/ViewFiltersPanel.d.ts.map +1 -0
  142. package/dist/composites/ViewFiltersPanel.js +11 -0
  143. package/dist/index.d.ts +96 -0
  144. package/dist/index.d.ts.map +1 -0
  145. package/dist/index.js +95 -0
  146. package/dist/lib/animations.d.ts +62 -0
  147. package/dist/lib/animations.d.ts.map +1 -0
  148. package/dist/lib/animations.js +37 -0
  149. package/dist/lib/avatar-utils.d.ts +10 -0
  150. package/dist/lib/avatar-utils.d.ts.map +1 -0
  151. package/dist/lib/avatar-utils.js +49 -0
  152. package/dist/lib/chips.d.ts +10 -0
  153. package/dist/lib/chips.d.ts.map +1 -0
  154. package/dist/lib/chips.js +30 -0
  155. package/dist/lib/cn.d.ts +4 -0
  156. package/dist/lib/cn.d.ts.map +1 -0
  157. package/dist/lib/cn.js +6 -0
  158. package/dist/lib/compose-refs.d.ts +6 -0
  159. package/dist/lib/compose-refs.d.ts.map +1 -0
  160. package/dist/lib/compose-refs.js +17 -0
  161. package/dist/lib/cover-chrome.d.ts +9 -0
  162. package/dist/lib/cover-chrome.d.ts.map +1 -0
  163. package/dist/lib/cover-chrome.js +23 -0
  164. package/dist/lib/cover-pattern.d.ts +75 -0
  165. package/dist/lib/cover-pattern.d.ts.map +1 -0
  166. package/dist/lib/cover-pattern.js +135 -0
  167. package/dist/lib/overlay-stack.d.ts +23 -0
  168. package/dist/lib/overlay-stack.d.ts.map +1 -0
  169. package/dist/lib/overlay-stack.js +37 -0
  170. package/dist/lib/portal.d.ts +12 -0
  171. package/dist/lib/portal.d.ts.map +1 -0
  172. package/dist/lib/portal.js +12 -0
  173. package/dist/lib/slot.d.ts +12 -0
  174. package/dist/lib/slot.d.ts.map +1 -0
  175. package/dist/lib/slot.js +55 -0
  176. package/dist/lib/surfaces.d.ts +14 -0
  177. package/dist/lib/surfaces.d.ts.map +1 -0
  178. package/dist/lib/surfaces.js +18 -0
  179. package/dist/lib/themes.d.ts +16 -0
  180. package/dist/lib/themes.d.ts.map +1 -0
  181. package/dist/lib/themes.js +53 -0
  182. package/dist/lib/typography.d.ts +17 -0
  183. package/dist/lib/typography.d.ts.map +1 -0
  184. package/dist/lib/typography.js +16 -0
  185. package/dist/lib/use-controllable-state.d.ts +12 -0
  186. package/dist/lib/use-controllable-state.d.ts.map +1 -0
  187. package/dist/lib/use-controllable-state.js +20 -0
  188. package/dist/lib/use-cover-chrome-bleed.d.ts +9 -0
  189. package/dist/lib/use-cover-chrome-bleed.d.ts.map +1 -0
  190. package/dist/lib/use-cover-chrome-bleed.js +28 -0
  191. package/dist/lib/use-dismissable.d.ts +13 -0
  192. package/dist/lib/use-dismissable.d.ts.map +1 -0
  193. package/dist/lib/use-dismissable.js +33 -0
  194. package/dist/lib/use-floating-position.d.ts +27 -0
  195. package/dist/lib/use-floating-position.d.ts.map +1 -0
  196. package/dist/lib/use-floating-position.js +115 -0
  197. package/dist/lib/use-focus-trap.d.ts +7 -0
  198. package/dist/lib/use-focus-trap.d.ts.map +1 -0
  199. package/dist/lib/use-focus-trap.js +61 -0
  200. package/dist/lib/use-media-query.d.ts +5 -0
  201. package/dist/lib/use-media-query.d.ts.map +1 -0
  202. package/dist/lib/use-media-query.js +19 -0
  203. package/dist/primitives/Accordion.d.ts +24 -0
  204. package/dist/primitives/Accordion.d.ts.map +1 -0
  205. package/dist/primitives/Accordion.js +37 -0
  206. package/dist/primitives/Alert.d.ts +10 -0
  207. package/dist/primitives/Alert.d.ts.map +1 -0
  208. package/dist/primitives/Alert.js +25 -0
  209. package/dist/primitives/AlertDialog.d.ts +33 -0
  210. package/dist/primitives/AlertDialog.d.ts.map +1 -0
  211. package/dist/primitives/AlertDialog.js +96 -0
  212. package/dist/primitives/Avatar.d.ts +15 -0
  213. package/dist/primitives/Avatar.d.ts.map +1 -0
  214. package/dist/primitives/Avatar.js +52 -0
  215. package/dist/primitives/Badge.d.ts +12 -0
  216. package/dist/primitives/Badge.d.ts.map +1 -0
  217. package/dist/primitives/Badge.js +27 -0
  218. package/dist/primitives/Button.d.ts +14 -0
  219. package/dist/primitives/Button.d.ts.map +1 -0
  220. package/dist/primitives/Button.js +37 -0
  221. package/dist/primitives/Checkbox.d.ts +9 -0
  222. package/dist/primitives/Checkbox.d.ts.map +1 -0
  223. package/dist/primitives/Checkbox.js +22 -0
  224. package/dist/primitives/Command.d.ts +17 -0
  225. package/dist/primitives/Command.d.ts.map +1 -0
  226. package/dist/primitives/Command.js +33 -0
  227. package/dist/primitives/Dialog.d.ts +34 -0
  228. package/dist/primitives/Dialog.d.ts.map +1 -0
  229. package/dist/primitives/Dialog.js +96 -0
  230. package/dist/primitives/DropdownMenu.d.ts +65 -0
  231. package/dist/primitives/DropdownMenu.d.ts.map +1 -0
  232. package/dist/primitives/DropdownMenu.js +196 -0
  233. package/dist/primitives/Input.d.ts +4 -0
  234. package/dist/primitives/Input.d.ts.map +1 -0
  235. package/dist/primitives/Input.js +6 -0
  236. package/dist/primitives/Kbd.d.ts +4 -0
  237. package/dist/primitives/Kbd.d.ts.map +1 -0
  238. package/dist/primitives/Kbd.js +6 -0
  239. package/dist/primitives/Label.d.ts +4 -0
  240. package/dist/primitives/Label.d.ts.map +1 -0
  241. package/dist/primitives/Label.js +6 -0
  242. package/dist/primitives/NativeSelect.d.ts +7 -0
  243. package/dist/primitives/NativeSelect.d.ts.map +1 -0
  244. package/dist/primitives/NativeSelect.js +10 -0
  245. package/dist/primitives/Popover.d.ts +29 -0
  246. package/dist/primitives/Popover.d.ts.map +1 -0
  247. package/dist/primitives/Popover.js +95 -0
  248. package/dist/primitives/Progress.d.ts +8 -0
  249. package/dist/primitives/Progress.d.ts.map +1 -0
  250. package/dist/primitives/Progress.js +7 -0
  251. package/dist/primitives/RadioGroup.d.ts +13 -0
  252. package/dist/primitives/RadioGroup.d.ts.map +1 -0
  253. package/dist/primitives/RadioGroup.js +33 -0
  254. package/dist/primitives/Select.d.ts +33 -0
  255. package/dist/primitives/Select.d.ts.map +1 -0
  256. package/dist/primitives/Select.js +178 -0
  257. package/dist/primitives/Separator.d.ts +7 -0
  258. package/dist/primitives/Separator.d.ts.map +1 -0
  259. package/dist/primitives/Separator.js +6 -0
  260. package/dist/primitives/Sheet.d.ts +28 -0
  261. package/dist/primitives/Sheet.d.ts.map +1 -0
  262. package/dist/primitives/Sheet.js +96 -0
  263. package/dist/primitives/Skeleton.d.ts +4 -0
  264. package/dist/primitives/Skeleton.d.ts.map +1 -0
  265. package/dist/primitives/Skeleton.js +6 -0
  266. package/dist/primitives/Slider.d.ts +12 -0
  267. package/dist/primitives/Slider.d.ts.map +1 -0
  268. package/dist/primitives/Slider.js +23 -0
  269. package/dist/primitives/Spinner.d.ts +6 -0
  270. package/dist/primitives/Spinner.d.ts.map +1 -0
  271. package/dist/primitives/Spinner.js +7 -0
  272. package/dist/primitives/StarRating.d.ts +10 -0
  273. package/dist/primitives/StarRating.d.ts.map +1 -0
  274. package/dist/primitives/StarRating.js +11 -0
  275. package/dist/primitives/Switch.d.ts +8 -0
  276. package/dist/primitives/Switch.d.ts.map +1 -0
  277. package/dist/primitives/Switch.js +20 -0
  278. package/dist/primitives/Table.d.ts +13 -0
  279. package/dist/primitives/Table.d.ts.map +1 -0
  280. package/dist/primitives/Table.js +20 -0
  281. package/dist/primitives/Tabs.d.ts +17 -0
  282. package/dist/primitives/Tabs.d.ts.map +1 -0
  283. package/dist/primitives/Tabs.js +30 -0
  284. package/dist/primitives/Textarea.d.ts +4 -0
  285. package/dist/primitives/Textarea.d.ts.map +1 -0
  286. package/dist/primitives/Textarea.js +6 -0
  287. package/dist/primitives/Tooltip.d.ts +31 -0
  288. package/dist/primitives/Tooltip.d.ts.map +1 -0
  289. package/dist/primitives/Tooltip.js +94 -0
  290. package/dist/theme/OriginThemeProvider.d.ts +31 -0
  291. package/dist/theme/OriginThemeProvider.d.ts.map +1 -0
  292. package/dist/theme/OriginThemeProvider.js +37 -0
  293. package/dist/theme/SpatikaThemeProvider.d.ts +36 -0
  294. package/dist/theme/SpatikaThemeProvider.d.ts.map +1 -0
  295. package/dist/theme/SpatikaThemeProvider.js +38 -0
  296. package/package.json +58 -0
  297. package/src/composites/ActionBar.tsx +25 -0
  298. package/src/composites/AmountInput.tsx +40 -0
  299. package/src/composites/AppHeader.tsx +88 -0
  300. package/src/composites/AppSidebar.tsx +120 -0
  301. package/src/composites/BottomSheet.tsx +179 -0
  302. package/src/composites/Breadcrumb.tsx +42 -0
  303. package/src/composites/Callout.tsx +22 -0
  304. package/src/composites/Card.tsx +119 -0
  305. package/src/composites/Chip.tsx +87 -0
  306. package/src/composites/ChipGroup.component.test.tsx +31 -0
  307. package/src/composites/ChipGroup.test.ts +16 -0
  308. package/src/composites/ChipGroup.tsx +86 -0
  309. package/src/composites/CommandSearchField.tsx +124 -0
  310. package/src/composites/CoverHero.tsx +359 -0
  311. package/src/composites/CoverPattern.tsx +90 -0
  312. package/src/composites/DataTableToolbar.tsx +48 -0
  313. package/src/composites/DividerLabel.tsx +22 -0
  314. package/src/composites/EmptyState.tsx +55 -0
  315. package/src/composites/EntityCard.tsx +100 -0
  316. package/src/composites/EntityMediaCard.tsx +118 -0
  317. package/src/composites/FilterSheet.tsx +178 -0
  318. package/src/composites/FloatingPageChrome.tsx +294 -0
  319. package/src/composites/FormField.tsx +44 -0
  320. package/src/composites/GlassCard.tsx +47 -0
  321. package/src/composites/HeaderIconButton.tsx +49 -0
  322. package/src/composites/ListRow.tsx +29 -0
  323. package/src/composites/MediaEntryCard.tsx +95 -0
  324. package/src/composites/MobileTabBar.tsx +130 -0
  325. package/src/composites/NotificationBell.tsx +164 -0
  326. package/src/composites/PageHeader.tsx +27 -0
  327. package/src/composites/PageShell.tsx +20 -0
  328. package/src/composites/PageStickyHeader.tsx +157 -0
  329. package/src/composites/Pagination.tsx +41 -0
  330. package/src/composites/PhotoViewer.tsx +142 -0
  331. package/src/composites/PinPad.tsx +163 -0
  332. package/src/composites/ProfileHero.tsx +163 -0
  333. package/src/composites/QuickFilterRail.tsx +92 -0
  334. package/src/composites/QuickSettings.tsx +120 -0
  335. package/src/composites/RichTextEditor.tsx +103 -0
  336. package/src/composites/SearchField.tsx +38 -0
  337. package/src/composites/SectionPanel.tsx +59 -0
  338. package/src/composites/SegmentedControl.tsx +62 -0
  339. package/src/composites/StatCard.tsx +26 -0
  340. package/src/composites/StatusDot.tsx +40 -0
  341. package/src/composites/SurfaceCard.tsx +44 -0
  342. package/src/composites/Timeline.tsx +70 -0
  343. package/src/composites/Toast.tsx +135 -0
  344. package/src/composites/Toolbar.tsx +19 -0
  345. package/src/composites/ViewFiltersPanel.tsx +82 -0
  346. package/src/composites/chrome.test.tsx +170 -0
  347. package/src/composites/smoke.test.tsx +49 -0
  348. package/src/index.ts +355 -0
  349. package/src/lib/animations.ts +47 -0
  350. package/src/lib/avatar-utils.ts +52 -0
  351. package/src/lib/chips.ts +58 -0
  352. package/src/lib/cn.test.ts +16 -0
  353. package/src/lib/cn.ts +7 -0
  354. package/src/lib/compose-refs.ts +21 -0
  355. package/src/lib/cover-chrome.ts +31 -0
  356. package/src/lib/cover-pattern.ts +242 -0
  357. package/src/lib/overlay-stack.ts +44 -0
  358. package/src/lib/portal.tsx +21 -0
  359. package/src/lib/slot.tsx +69 -0
  360. package/src/lib/surfaces.ts +57 -0
  361. package/src/lib/themes.test.ts +73 -0
  362. package/src/lib/themes.ts +59 -0
  363. package/src/lib/tokens.test.ts +52 -0
  364. package/src/lib/typography.ts +27 -0
  365. package/src/lib/use-controllable-state.ts +38 -0
  366. package/src/lib/use-cover-chrome-bleed.ts +33 -0
  367. package/src/lib/use-dismissable.ts +49 -0
  368. package/src/lib/use-floating-position.ts +168 -0
  369. package/src/lib/use-focus-trap.ts +73 -0
  370. package/src/lib/use-media-query.ts +22 -0
  371. package/src/primitives/Accordion.tsx +114 -0
  372. package/src/primitives/Alert.tsx +57 -0
  373. package/src/primitives/AlertDialog.tsx +270 -0
  374. package/src/primitives/Avatar.tsx +140 -0
  375. package/src/primitives/Badge.test.tsx +15 -0
  376. package/src/primitives/Badge.tsx +43 -0
  377. package/src/primitives/Button.test.tsx +37 -0
  378. package/src/primitives/Button.tsx +58 -0
  379. package/src/primitives/Checkbox.tsx +75 -0
  380. package/src/primitives/Command.tsx +175 -0
  381. package/src/primitives/Dialog.tsx +241 -0
  382. package/src/primitives/DropdownMenu.tsx +552 -0
  383. package/src/primitives/Input.test.tsx +22 -0
  384. package/src/primitives/Input.tsx +22 -0
  385. package/src/primitives/Kbd.tsx +17 -0
  386. package/src/primitives/Label.tsx +20 -0
  387. package/src/primitives/NativeSelect.tsx +22 -0
  388. package/src/primitives/Popover.tsx +209 -0
  389. package/src/primitives/Progress.tsx +31 -0
  390. package/src/primitives/RadioGroup.tsx +116 -0
  391. package/src/primitives/Select.tsx +409 -0
  392. package/src/primitives/Separator.tsx +30 -0
  393. package/src/primitives/Sheet.tsx +265 -0
  394. package/src/primitives/Skeleton.tsx +16 -0
  395. package/src/primitives/Slider.tsx +97 -0
  396. package/src/primitives/Spinner.tsx +21 -0
  397. package/src/primitives/StarRating.tsx +53 -0
  398. package/src/primitives/Switch.tsx +68 -0
  399. package/src/primitives/Table.tsx +134 -0
  400. package/src/primitives/Tabs.tsx +97 -0
  401. package/src/primitives/Textarea.tsx +20 -0
  402. package/src/primitives/Tooltip.tsx +193 -0
  403. package/src/primitives/smoke.test.tsx +34 -0
  404. package/src/test/setup.ts +1 -0
  405. package/src/theme/SpatikaThemeProvider.test.tsx +82 -0
  406. package/src/theme/SpatikaThemeProvider.tsx +112 -0
@@ -0,0 +1,135 @@
1
+ import {
2
+ createContext,
3
+ useCallback,
4
+ useContext,
5
+ useMemo,
6
+ useState,
7
+ type ReactNode,
8
+ } from "react";
9
+ import { X } from "lucide-react";
10
+ import { cn } from "../lib/cn";
11
+
12
+ export type ToastTone = "default" | "success" | "warn" | "danger";
13
+
14
+ export type ToastItem = {
15
+ id: string;
16
+ title: string;
17
+ description?: string;
18
+ tone?: ToastTone;
19
+ durationMs?: number;
20
+ };
21
+
22
+ type ToastContextValue = {
23
+ toasts: ToastItem[];
24
+ toast: (item: Omit<ToastItem, "id"> & { id?: string }) => string;
25
+ dismiss: (id: string) => void;
26
+ };
27
+
28
+ const ToastContext = createContext<ToastContextValue | null>(null);
29
+
30
+ let toastSeq = 0;
31
+
32
+ export function useToast() {
33
+ const ctx = useContext(ToastContext);
34
+ if (!ctx) throw new Error("useToast must be used within <Toaster />");
35
+ return ctx;
36
+ }
37
+
38
+ const toneClass: Record<ToastTone, string> = {
39
+ default: "border-border/60",
40
+ success: "border-emerald-500/35 bg-emerald-500/8",
41
+ warn: "border-amber-500/35 bg-amber-500/8",
42
+ danger: "border-destructive/35 bg-destructive/8",
43
+ };
44
+
45
+ export type ToasterProps = {
46
+ children?: ReactNode;
47
+ className?: string;
48
+ position?: "top-right" | "bottom-right" | "top-center" | "bottom-center";
49
+ };
50
+
51
+ /** App-level toast host + provider. Wrap the app once and call useToast(). */
52
+ export function Toaster({
53
+ children,
54
+ className,
55
+ position = "bottom-right",
56
+ }: ToasterProps) {
57
+ const [toasts, setToasts] = useState<ToastItem[]>([]);
58
+
59
+ const dismiss = useCallback((id: string) => {
60
+ setToasts((prev) => prev.filter((t) => t.id !== id));
61
+ }, []);
62
+
63
+ const toast = useCallback(
64
+ (item: Omit<ToastItem, "id"> & { id?: string }) => {
65
+ const id = item.id ?? `toast-${++toastSeq}`;
66
+ const next: ToastItem = {
67
+ id,
68
+ title: item.title,
69
+ description: item.description,
70
+ tone: item.tone ?? "default",
71
+ durationMs: item.durationMs ?? 4200,
72
+ };
73
+ setToasts((prev) => [...prev, next]);
74
+ if (next.durationMs && next.durationMs > 0) {
75
+ window.setTimeout(() => dismiss(id), next.durationMs);
76
+ }
77
+ return id;
78
+ },
79
+ [dismiss],
80
+ );
81
+
82
+ const value = useMemo(() => ({ toasts, toast, dismiss }), [toasts, toast, dismiss]);
83
+
84
+ const positionClass =
85
+ position === "top-right"
86
+ ? "top-4 right-4"
87
+ : position === "top-center"
88
+ ? "top-4 left-1/2 -translate-x-1/2"
89
+ : position === "bottom-center"
90
+ ? "bottom-4 left-1/2 -translate-x-1/2"
91
+ : "bottom-4 right-4";
92
+
93
+ return (
94
+ <ToastContext.Provider value={value}>
95
+ {children}
96
+ <div
97
+ data-slot="toaster"
98
+ className={cn(
99
+ "pointer-events-none fixed z-[200] flex w-[min(calc(100vw-1.5rem),22rem)] flex-col gap-2",
100
+ positionClass,
101
+ className,
102
+ )}
103
+ >
104
+ {toasts.map((t) => (
105
+ <div
106
+ key={t.id}
107
+ data-slot="toast"
108
+ className={cn(
109
+ "pointer-events-auto rounded-2xl border bg-background p-3.5 shadow-[0_22px_50px_-24px_rgba(15,23,42,0.55)] dark:bg-card",
110
+ toneClass[t.tone ?? "default"],
111
+ )}
112
+ role="status"
113
+ >
114
+ <div className="flex items-start gap-3">
115
+ <div className="min-w-0 flex-1">
116
+ <p className="text-sm font-bold text-foreground">{t.title}</p>
117
+ {t.description ? (
118
+ <p className="mt-0.5 text-xs text-muted-foreground">{t.description}</p>
119
+ ) : null}
120
+ </div>
121
+ <button
122
+ type="button"
123
+ aria-label="Dismiss"
124
+ className="rounded-lg p-1 text-muted-foreground transition-colors hover:bg-muted/40 hover:text-foreground"
125
+ onClick={() => dismiss(t.id)}
126
+ >
127
+ <X className="h-3.5 w-3.5" />
128
+ </button>
129
+ </div>
130
+ </div>
131
+ ))}
132
+ </div>
133
+ </ToastContext.Provider>
134
+ );
135
+ }
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from "react";
2
+ import { cn } from "../lib/cn";
3
+
4
+ export function Toolbar({
5
+ children,
6
+ className,
7
+ }: {
8
+ children: ReactNode;
9
+ className?: string;
10
+ }) {
11
+ return (
12
+ <div
13
+ data-slot="toolbar"
14
+ className={cn("app-toolbar flex flex-wrap items-center gap-2 px-3 py-2", className)}
15
+ >
16
+ {children}
17
+ </div>
18
+ );
19
+ }
@@ -0,0 +1,82 @@
1
+ import type { ReactNode } from "react";
2
+ import { X } from "lucide-react";
3
+ import { cn } from "../lib/cn";
4
+ import { Button } from "../primitives/Button";
5
+ import { BottomSheet } from "./BottomSheet";
6
+
7
+ export type ViewFiltersPanelProps = {
8
+ open: boolean;
9
+ onOpenChange: (open: boolean) => void;
10
+ title?: string;
11
+ description?: string;
12
+ hasActive?: boolean;
13
+ onClear?: () => void;
14
+ trigger?: ReactNode;
15
+ children: ReactNode;
16
+ topSection?: ReactNode;
17
+ className?: string;
18
+ doneLabel?: string;
19
+ clearLabel?: string;
20
+ };
21
+
22
+ /**
23
+ * View & filters panel — glass bottom sheet with clear / done chrome.
24
+ * Pass arbitrary filter fields as children for full customization.
25
+ */
26
+ export function ViewFiltersPanel({
27
+ open,
28
+ onOpenChange,
29
+ title = "View & filters",
30
+ description,
31
+ hasActive,
32
+ onClear,
33
+ trigger,
34
+ children,
35
+ topSection,
36
+ className,
37
+ doneLabel = "Done",
38
+ clearLabel = "Clear",
39
+ }: ViewFiltersPanelProps) {
40
+ return (
41
+ <>
42
+ {trigger}
43
+ <BottomSheet open={open} onOpenChange={onOpenChange} className={className}>
44
+ <div className="flex items-start justify-between gap-3 border-b border-border/40 px-4 py-3">
45
+ <div className="min-w-0">
46
+ <h2 className="text-base font-black tracking-tight">{title}</h2>
47
+ {description ? (
48
+ <p className="mt-0.5 text-xs font-medium text-muted-foreground">{description}</p>
49
+ ) : null}
50
+ </div>
51
+ <div className="flex shrink-0 items-center gap-1">
52
+ {hasActive && onClear ? (
53
+ <Button type="button" variant="ghost" size="sm" onClick={onClear}>
54
+ {clearLabel}
55
+ </Button>
56
+ ) : null}
57
+ <Button
58
+ type="button"
59
+ variant="ghost"
60
+ size="icon"
61
+ aria-label="Close"
62
+ onClick={() => onOpenChange(false)}
63
+ >
64
+ <X className="size-4" />
65
+ </Button>
66
+ </div>
67
+ </div>
68
+ {topSection}
69
+ <div className="max-h-[60vh] space-y-5 overflow-y-auto px-4 py-4">{children}</div>
70
+ <div className="border-t border-border/40 p-4 pb-[calc(1rem+env(safe-area-inset-bottom))]">
71
+ <Button
72
+ type="button"
73
+ className="h-9 w-full rounded-xl text-xs font-black uppercase tracking-widest"
74
+ onClick={() => onOpenChange(false)}
75
+ >
76
+ {doneLabel}
77
+ </Button>
78
+ </div>
79
+ </BottomSheet>
80
+ </>
81
+ );
82
+ }
@@ -0,0 +1,170 @@
1
+ import { render, screen } from "@testing-library/react";
2
+ import userEvent from "@testing-library/user-event";
3
+ import { describe, expect, it, afterEach, vi } from "vitest";
4
+ import {
5
+ FloatingPageChromeBar,
6
+ FloatingPageChromeIdentity,
7
+ FloatingPageChromeSearchField,
8
+ } from "./FloatingPageChrome";
9
+ import { FilterSheet } from "./FilterSheet";
10
+ import { CoverHero } from "./CoverHero";
11
+ import { CoverPattern } from "./CoverPattern";
12
+ import { PageStickyHeader } from "./PageStickyHeader";
13
+ import { MobileTabBar } from "./MobileTabBar";
14
+ import { ProfileHero } from "./ProfileHero";
15
+ import { Home } from "lucide-react";
16
+ import { getCoverPattern } from "../lib/cover-pattern";
17
+ import { useCoverChromeBleed } from "../lib/use-cover-chrome-bleed";
18
+
19
+ describe("FloatingPageChrome", () => {
20
+ it("renders identity title, count, and search", async () => {
21
+ const user = userEvent.setup();
22
+ const onBack = vi.fn();
23
+ const onChange = vi.fn();
24
+ render(
25
+ <FloatingPageChromeBar
26
+ identity={
27
+ <FloatingPageChromeIdentity title="People" count={12} onBack={onBack} />
28
+ }
29
+ search={
30
+ <FloatingPageChromeSearchField
31
+ value="al"
32
+ onChange={onChange}
33
+ onClear={() => onChange("")}
34
+ placeholder="Search people…"
35
+ />
36
+ }
37
+ />,
38
+ );
39
+ expect(screen.getByText("People")).toBeInTheDocument();
40
+ expect(screen.getByText("12")).toBeInTheDocument();
41
+ await user.click(screen.getByLabelText("Go back"));
42
+ expect(onBack).toHaveBeenCalled();
43
+ expect(screen.getByPlaceholderText("Search people…")).toHaveValue("al");
44
+ expect(document.querySelector(".glass-page-toolbar")).toBeTruthy();
45
+ });
46
+
47
+ it("pins children in a nested scroller", () => {
48
+ render(
49
+ <FloatingPageChromeBar
50
+ identity={<FloatingPageChromeIdentity title="People" count={4} />}
51
+ >
52
+ <p>Directory body</p>
53
+ </FloatingPageChromeBar>,
54
+ );
55
+ expect(document.querySelector(".app-page-chrome")).toBeTruthy();
56
+ expect(document.querySelector(".app-page-chrome-body")).toHaveTextContent("Directory body");
57
+ });
58
+ });
59
+
60
+ describe("PageStickyHeader", () => {
61
+ it("renders title, count, and density slots", () => {
62
+ render(
63
+ <PageStickyHeader
64
+ offsetClassName="top-0"
65
+ title="Insights"
66
+ subtitle="Last 30 days"
67
+ count={8}
68
+ />,
69
+ );
70
+ expect(screen.getByText("Insights")).toBeInTheDocument();
71
+ expect(screen.getByText("Last 30 days")).toBeInTheDocument();
72
+ expect(screen.getByText("8")).toBeInTheDocument();
73
+ });
74
+ });
75
+
76
+ describe("FilterSheet", () => {
77
+ it("opens a desktop popover from the chrome trigger", async () => {
78
+ const user = userEvent.setup();
79
+ const onOpenChange = vi.fn();
80
+ render(
81
+ <FilterSheet
82
+ open={false}
83
+ onOpenChange={onOpenChange}
84
+ title="View & filters"
85
+ trigger={<button type="button">Filters</button>}
86
+ >
87
+ <p>Status</p>
88
+ </FilterSheet>,
89
+ );
90
+ await user.click(screen.getByText("Filters"));
91
+ expect(onOpenChange).toHaveBeenCalledWith(true);
92
+ });
93
+ });
94
+
95
+ describe("CoverPattern", () => {
96
+ it("seeds a stable scene kind", () => {
97
+ const a = getCoverPattern({ seed: "alex", hue: 210 });
98
+ const b = getCoverPattern({ seed: "alex", hue: 210 });
99
+ expect(a.kind).toBe(b.kind);
100
+ expect(a.headerInk).toMatch(/light|dark/);
101
+ expect(a.chromeInk).toMatch(/light|dark/);
102
+ });
103
+
104
+ it("renders a cover pattern node", () => {
105
+ const { container } = render(<CoverPattern seed="alex" hue={210} />);
106
+ expect(container.querySelector("[data-cover-pattern]")).toBeTruthy();
107
+ });
108
+ });
109
+
110
+ describe("CoverHero", () => {
111
+ it("renders title, kicker, and facts", () => {
112
+ render(
113
+ <CoverHero
114
+ title="Friday night · Studio district"
115
+ kicker={<span>Meetup Story</span>}
116
+ facts={[{ key: "when", label: "When", value: "Fri 14 Mar" }]}
117
+ avatars={[{ name: "Alex Rivera" }]}
118
+ />,
119
+ );
120
+ expect(screen.getByText("Friday night · Studio district")).toBeInTheDocument();
121
+ expect(screen.getByText("Meetup Story")).toBeInTheDocument();
122
+ expect(screen.getByText("When")).toBeInTheDocument();
123
+ });
124
+ });
125
+
126
+ describe("ProfileHero", () => {
127
+ it("renders name, alias, and a notched identity plate", () => {
128
+ const { container } = render(
129
+ <ProfileHero name="Alex Chen" alias="Product designer" coverSeed="alex" />,
130
+ );
131
+ expect(screen.getByText("Alex Chen")).toBeInTheDocument();
132
+ expect(screen.getByText("Product designer")).toBeInTheDocument();
133
+ expect(container.querySelector(".profile-identity")).toBeTruthy();
134
+ expect(container.querySelector(".profile-identity__plate")).toBeTruthy();
135
+ });
136
+ });
137
+
138
+ describe("MobileTabBar", () => {
139
+ it("renders a floating capsule with an active item", () => {
140
+ const { container } = render(
141
+ <MobileTabBar
142
+ items={[{ id: "home", label: "Home", icon: Home, active: true }]}
143
+ />,
144
+ );
145
+ expect(container.querySelector("[data-app-tabbar]")).toBeTruthy();
146
+ expect(screen.getByText("Home")).toBeInTheDocument();
147
+ });
148
+ });
149
+
150
+ function BleedProbe({ active }: { active: boolean }) {
151
+ useCoverChromeBleed(active, "light");
152
+ return <span>probe</span>;
153
+ }
154
+
155
+ describe("useCoverChromeBleed", () => {
156
+ afterEach(() => {
157
+ document.documentElement.removeAttribute("data-cover-chrome-bleed");
158
+ document.documentElement.removeAttribute("data-cover-chrome-ink");
159
+ document.documentElement.removeAttribute("data-profile-cover-bleed");
160
+ document.documentElement.removeAttribute("data-profile-cover-ink");
161
+ });
162
+
163
+ it("sets and clears cover bleed attributes", () => {
164
+ const { unmount } = render(<BleedProbe active />);
165
+ expect(document.documentElement.getAttribute("data-cover-chrome-bleed")).toBe("true");
166
+ expect(document.documentElement.getAttribute("data-cover-chrome-ink")).toBe("light");
167
+ unmount();
168
+ expect(document.documentElement.getAttribute("data-cover-chrome-bleed")).toBeNull();
169
+ });
170
+ });
@@ -0,0 +1,49 @@
1
+ import { render, screen } from "@testing-library/react";
2
+ import { describe, expect, it } from "vitest";
3
+ import { EmptyState } from "./EmptyState";
4
+ import { FormField } from "./FormField";
5
+ import { PageHeader } from "./PageHeader";
6
+ import { StatusDot } from "./StatusDot";
7
+ import { EntityCard, EntityCardChip, EntityCardMeta, EntityCardTitle } from "./EntityCard";
8
+
9
+ describe("composites smoke", () => {
10
+ it("renders EmptyState", () => {
11
+ render(<EmptyState title="Nothing here" description="Try again" />);
12
+ expect(screen.getByText("Nothing here")).toBeInTheDocument();
13
+ expect(screen.getByText("Try again")).toBeInTheDocument();
14
+ });
15
+
16
+ it("renders PageHeader", () => {
17
+ render(<PageHeader title="Directory" description="People" />);
18
+ expect(screen.getByText("Directory")).toBeInTheDocument();
19
+ });
20
+
21
+ it("renders FormField with label", () => {
22
+ render(
23
+ <FormField id="email" label="Email">
24
+ <input id="email" aria-label="Email" />
25
+ </FormField>,
26
+ );
27
+ expect(screen.getByText("Email")).toBeInTheDocument();
28
+ });
29
+
30
+ it("renders StatusDot", () => {
31
+ const { container } = render(<StatusDot tone="success" />);
32
+ expect(container.querySelector('[data-slot="status-dot"]')).toBeTruthy();
33
+ });
34
+
35
+ it("renders EntityCard rows", () => {
36
+ render(
37
+ <EntityCard interactive>
38
+ <div>
39
+ <EntityCardTitle>Alex Chen</EntityCardTitle>
40
+ <EntityCardMeta>Product designer</EntityCardMeta>
41
+ </div>
42
+ <EntityCardChip>Active</EntityCardChip>
43
+ </EntityCard>,
44
+ );
45
+ expect(screen.getByText("Alex Chen")).toBeInTheDocument();
46
+ expect(screen.getByText("Product designer")).toBeInTheDocument();
47
+ expect(screen.getByText("Active")).toBeInTheDocument();
48
+ });
49
+ });