@askrjs/themes 0.0.9 → 0.0.11

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 (472) hide show
  1. package/README.md +19 -13
  2. package/THEMING.md +24 -18
  3. package/dist/components/_internal/block-layout.d.ts +49 -0
  4. package/dist/components/_internal/block-layout.js +210 -0
  5. package/dist/components/_internal/block-layout.js.map +1 -0
  6. package/dist/components/alert/alert.js +2 -2
  7. package/dist/components/alert/alert.js.map +1 -1
  8. package/dist/components/alert/alert.types.d.ts +0 -1
  9. package/dist/components/aside/aside.d.ts +7 -0
  10. package/dist/components/aside/aside.js +16 -0
  11. package/dist/components/aside/aside.js.map +1 -0
  12. package/dist/components/aside/aside.types.d.ts +6 -0
  13. package/dist/components/aside/index.d.ts +2 -0
  14. package/dist/components/aspect-ratio/aspect-ratio.js +1 -1
  15. package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -1
  16. package/dist/components/badge/index.d.ts +1 -2
  17. package/dist/components/block/block.d.ts +2 -3
  18. package/dist/components/block/block.js +16 -46
  19. package/dist/components/block/block.js.map +1 -1
  20. package/dist/components/block/block.types.d.ts +13 -23
  21. package/dist/components/block/index.d.ts +3 -3
  22. package/dist/components/brand/brand.d.ts +9 -0
  23. package/dist/components/brand/brand.js +49 -0
  24. package/dist/components/brand/brand.js.map +1 -0
  25. package/dist/components/brand/brand.types.d.ts +31 -0
  26. package/dist/components/brand/index.d.ts +2 -0
  27. package/dist/components/card/card.d.ts +3 -3
  28. package/dist/components/card/card.js +6 -11
  29. package/dist/components/card/card.js.map +1 -1
  30. package/dist/components/card/card.types.d.ts +10 -12
  31. package/dist/components/card/index.d.ts +2 -2
  32. package/dist/components/catalog.d.ts +156 -0
  33. package/dist/components/catalog.js +723 -0
  34. package/dist/components/catalog.js.map +1 -0
  35. package/dist/components/container/container.d.ts +2 -3
  36. package/dist/components/container/container.js +8 -71
  37. package/dist/components/container/container.js.map +1 -1
  38. package/dist/components/container/container.types.d.ts +5 -24
  39. package/dist/components/container/index.d.ts +2 -3
  40. package/dist/components/empty-state/empty-state.js +34 -28
  41. package/dist/components/empty-state/empty-state.js.map +1 -1
  42. package/dist/components/empty-state/empty-state.types.d.ts +3 -6
  43. package/dist/components/field/field.js +4 -2
  44. package/dist/components/field/field.js.map +1 -1
  45. package/dist/components/field/field.types.d.ts +1 -0
  46. package/dist/components/footer/footer.d.ts +13 -0
  47. package/dist/components/footer/footer.js +86 -0
  48. package/dist/components/footer/footer.js.map +1 -0
  49. package/dist/components/footer/footer.types.d.ts +37 -0
  50. package/dist/components/footer/index.d.ts +2 -0
  51. package/dist/components/grid/grid.d.ts +7 -0
  52. package/dist/components/grid/grid.js +76 -0
  53. package/dist/components/grid/grid.js.map +1 -0
  54. package/dist/components/grid/grid.types.d.ts +19 -0
  55. package/dist/components/grid/index.d.ts +2 -0
  56. package/dist/components/header/header.js +9 -6
  57. package/dist/components/header/header.js.map +1 -1
  58. package/dist/components/header/header.types.d.ts +5 -5
  59. package/dist/components/header/index.d.ts +2 -0
  60. package/dist/components/main/index.d.ts +2 -0
  61. package/dist/components/main/main.d.ts +7 -0
  62. package/dist/components/main/main.js +17 -0
  63. package/dist/components/main/main.js.map +1 -0
  64. package/dist/components/main/main.types.d.ts +6 -0
  65. package/dist/components/nav/index.d.ts +2 -2
  66. package/dist/components/nav/nav.d.ts +8 -6
  67. package/dist/components/nav/nav.js +93 -58
  68. package/dist/components/nav/nav.js.map +1 -1
  69. package/dist/components/nav/nav.types.d.ts +16 -20
  70. package/dist/components/navbar/index.d.ts +4 -5
  71. package/dist/components/navbar/navbar.d.ts +3 -38
  72. package/dist/components/navbar/navbar.js +103 -210
  73. package/dist/components/navbar/navbar.js.map +1 -1
  74. package/dist/components/navbar/navbar.types.d.ts +14 -24
  75. package/dist/components/page/index.d.ts +2 -0
  76. package/dist/components/page/page.d.ts +7 -0
  77. package/dist/components/page/page.js +22 -0
  78. package/dist/components/page/page.js.map +1 -0
  79. package/dist/components/page/page.types.d.ts +6 -0
  80. package/dist/components/page-header/index.d.ts +2 -0
  81. package/dist/components/page-header/page-header.d.ts +7 -0
  82. package/dist/components/page-header/page-header.js +37 -0
  83. package/dist/components/page-header/page-header.js.map +1 -0
  84. package/dist/components/page-header/page-header.types.d.ts +10 -0
  85. package/dist/components/section/index.d.ts +2 -3
  86. package/dist/components/section/section.d.ts +2 -3
  87. package/dist/components/section/section.js +7 -30
  88. package/dist/components/section/section.js.map +1 -1
  89. package/dist/components/section/section.types.d.ts +3 -20
  90. package/dist/components/separator/index.d.ts +1 -2
  91. package/dist/components/sidebar/index.d.ts +2 -0
  92. package/dist/components/sidebar/sidebar.d.ts +17 -2
  93. package/dist/components/sidebar/sidebar.js +115 -225
  94. package/dist/components/sidebar/sidebar.js.map +1 -1
  95. package/dist/components/sidebar/sidebar.types.d.ts +21 -23
  96. package/dist/components/skeleton/index.d.ts +1 -2
  97. package/dist/components/skeleton/skeleton.js +12 -1
  98. package/dist/components/skeleton/skeleton.js.map +1 -1
  99. package/dist/components/skeleton/skeleton.types.d.ts +2 -0
  100. package/dist/components/spinner/index.d.ts +1 -1
  101. package/dist/components/spinner/spinner.js +6 -3
  102. package/dist/components/spinner/spinner.js.map +1 -1
  103. package/dist/components/spinner/spinner.types.d.ts +3 -1
  104. package/dist/components/stat/index.d.ts +2 -0
  105. package/dist/components/stat/stat.d.ts +10 -0
  106. package/dist/components/stat/stat.js +52 -0
  107. package/dist/components/stat/stat.js.map +1 -0
  108. package/dist/components/stat/stat.types.d.ts +24 -0
  109. package/dist/components/text/index.d.ts +2 -0
  110. package/dist/components/text/text.d.ts +7 -0
  111. package/dist/components/text/text.js +28 -0
  112. package/dist/components/text/text.js.map +1 -0
  113. package/dist/components/text/text.types.d.ts +26 -0
  114. package/dist/components/theme/theme.js +50 -8
  115. package/dist/components/theme/theme.js.map +1 -1
  116. package/dist/components/toolbar/index.d.ts +2 -0
  117. package/dist/components/toolbar/toolbar.d.ts +7 -0
  118. package/dist/components/toolbar/toolbar.js +30 -0
  119. package/dist/components/toolbar/toolbar.js.map +1 -0
  120. package/dist/components/toolbar/toolbar.types.d.ts +9 -0
  121. package/dist/components.d.ts +60 -0
  122. package/dist/components.js +35 -0
  123. package/dist/controls.d.ts +2 -2
  124. package/dist/controls.js +3 -3
  125. package/dist/core.d.ts +36 -0
  126. package/dist/core.js +19 -0
  127. package/dist/navs.d.ts +3 -15
  128. package/dist/navs.js +2 -8
  129. package/dist/overlays.d.ts +2 -2
  130. package/dist/overlays.js +2 -2
  131. package/dist/surfaces.d.ts +10 -8
  132. package/dist/surfaces.js +6 -4
  133. package/dist/themes/default/index.css +3661 -3945
  134. package/package.json +235 -69
  135. package/src/components/_internal/block-layout.ts +354 -0
  136. package/src/components/alert/alert.tsx +1 -2
  137. package/src/components/alert/alert.types.ts +0 -1
  138. package/src/components/aside/aside.tsx +12 -0
  139. package/src/components/aside/aside.types.ts +3 -0
  140. package/src/components/aside/index.ts +2 -0
  141. package/src/components/aspect-ratio/aspect-ratio.tsx +1 -1
  142. package/src/components/badge/index.ts +0 -1
  143. package/src/components/block/block.a11y.ts +0 -6
  144. package/src/components/block/block.tsx +40 -56
  145. package/src/components/block/block.types.ts +59 -41
  146. package/src/components/block/index.ts +1 -10
  147. package/src/components/brand/brand.tsx +61 -0
  148. package/src/components/brand/brand.types.ts +39 -0
  149. package/src/components/brand/index.ts +2 -0
  150. package/src/components/card/card.tsx +6 -18
  151. package/src/components/card/card.types.ts +9 -11
  152. package/src/components/card/index.ts +2 -3
  153. package/src/components/catalog.tsx +713 -0
  154. package/src/components/container/container.a11y.ts +0 -5
  155. package/src/components/container/container.tsx +18 -128
  156. package/src/components/container/container.types.ts +3 -32
  157. package/src/components/container/index.ts +1 -8
  158. package/src/components/empty-state/empty-state.tsx +17 -35
  159. package/src/components/empty-state/empty-state.types.ts +3 -5
  160. package/src/components/field/field.tsx +3 -1
  161. package/src/components/field/field.types.ts +1 -0
  162. package/src/components/footer/footer.tsx +88 -0
  163. package/src/components/footer/footer.types.ts +40 -0
  164. package/src/components/footer/index.ts +10 -0
  165. package/src/components/grid/grid.tsx +113 -0
  166. package/src/components/grid/grid.types.ts +20 -0
  167. package/src/components/grid/index.ts +2 -0
  168. package/src/components/header/header.tsx +10 -7
  169. package/src/components/header/header.types.ts +4 -4
  170. package/src/components/header/index.ts +1 -2
  171. package/src/components/main/index.ts +2 -0
  172. package/src/components/main/main.tsx +12 -0
  173. package/src/components/main/main.types.ts +3 -0
  174. package/src/components/nav/index.ts +7 -9
  175. package/src/components/nav/nav.tsx +153 -110
  176. package/src/components/nav/nav.types.ts +26 -27
  177. package/src/components/navbar/index.ts +4 -11
  178. package/src/components/navbar/navbar.tsx +103 -265
  179. package/src/components/navbar/navbar.types.ts +16 -42
  180. package/src/components/page/index.ts +2 -0
  181. package/src/components/page/page.tsx +17 -0
  182. package/src/components/page/page.types.ts +3 -0
  183. package/src/components/page-header/index.ts +2 -0
  184. package/src/components/page-header/page-header.tsx +29 -0
  185. package/src/components/page-header/page-header.types.ts +7 -0
  186. package/src/components/section/index.ts +1 -7
  187. package/src/components/section/section.a11y.ts +0 -1
  188. package/src/components/section/section.tsx +9 -35
  189. package/src/components/section/section.types.ts +2 -22
  190. package/src/components/separator/index.ts +4 -9
  191. package/src/components/sidebar/index.ts +27 -5
  192. package/src/components/sidebar/sidebar.tsx +146 -336
  193. package/src/components/sidebar/sidebar.types.ts +21 -28
  194. package/src/components/skeleton/index.ts +1 -2
  195. package/src/components/skeleton/skeleton.tsx +33 -1
  196. package/src/components/skeleton/skeleton.types.ts +2 -0
  197. package/src/components/spinner/index.ts +1 -1
  198. package/src/components/spinner/spinner.tsx +7 -2
  199. package/src/components/spinner/spinner.types.ts +3 -0
  200. package/src/components/stat/index.ts +2 -0
  201. package/src/components/stat/stat.tsx +47 -0
  202. package/src/components/stat/stat.types.ts +24 -0
  203. package/src/components/text/index.ts +2 -0
  204. package/src/components/text/text.tsx +39 -0
  205. package/src/components/text/text.types.ts +35 -0
  206. package/src/components/theme/theme.tsx +83 -9
  207. package/src/components/toolbar/index.ts +2 -0
  208. package/src/components/toolbar/toolbar.tsx +24 -0
  209. package/src/components/toolbar/toolbar.types.ts +6 -0
  210. package/src/components.ts +289 -0
  211. package/src/controls.ts +69 -2
  212. package/src/core.ts +42 -0
  213. package/src/navs.ts +9 -24
  214. package/src/overlays.ts +101 -59
  215. package/src/parity.ts +125 -0
  216. package/src/surfaces.ts +60 -13
  217. package/src/themes/default/index.css +11 -14
  218. package/src/themes/default/styles/actions/button-group.css +6 -6
  219. package/src/themes/default/styles/actions/button.css +98 -60
  220. package/src/themes/default/styles/actions/toggle-group.css +61 -25
  221. package/src/themes/default/styles/base/text.css +87 -0
  222. package/src/themes/default/styles/base/typography.css +24 -117
  223. package/src/themes/default/styles/base/utilities.css +0 -250
  224. package/src/themes/default/styles/disclosure/accordion.css +35 -28
  225. package/src/themes/default/styles/display/alert.css +7 -7
  226. package/src/themes/default/styles/display/badge.css +8 -9
  227. package/src/themes/default/styles/display/card.css +10 -47
  228. package/src/themes/default/styles/display/catalog.css +753 -0
  229. package/src/themes/default/styles/display/coverage.css +30 -305
  230. package/src/themes/default/styles/display/progress-circle.css +2 -0
  231. package/src/themes/default/styles/display/scroll-area.css +29 -24
  232. package/src/themes/default/styles/display/spinner.css +38 -1
  233. package/src/themes/default/styles/display/stat.css +21 -0
  234. package/src/themes/default/styles/display/table.css +37 -12
  235. package/src/themes/default/styles/display/virtual-list.css +24 -13
  236. package/src/themes/default/styles/display/virtual-table.css +58 -36
  237. package/src/themes/default/styles/forms/checkbox.css +12 -21
  238. package/src/themes/default/styles/forms/input-group.css +2 -1
  239. package/src/themes/default/styles/forms/input.css +11 -12
  240. package/src/themes/default/styles/forms/radio-group.css +44 -27
  241. package/src/themes/default/styles/forms/select.css +27 -35
  242. package/src/themes/default/styles/forms/slider.css +61 -47
  243. package/src/themes/default/styles/forms/switch.css +18 -23
  244. package/src/themes/default/styles/forms/textarea.css +12 -12
  245. package/src/themes/default/styles/layout/block.css +96 -12
  246. package/src/themes/default/styles/layout/grid.css +78 -0
  247. package/src/themes/default/styles/layout/layout.css +502 -772
  248. package/src/themes/default/styles/layout/patterns.css +0 -155
  249. package/src/themes/default/styles/navigation/nav.css +104 -154
  250. package/src/themes/default/styles/overlays/alert-dialog.css +2 -2
  251. package/src/themes/default/styles/overlays/dialog.css +76 -22
  252. package/src/themes/default/styles/overlays/dropdown.css +108 -31
  253. package/src/themes/default/styles/overlays/hover-card.css +39 -17
  254. package/src/themes/default/styles/overlays/menubar.css +223 -0
  255. package/src/themes/default/styles/overlays/popover.css +69 -23
  256. package/src/themes/default/styles/overlays/toast.css +91 -33
  257. package/src/themes/default/styles/overlays/tooltip.css +88 -14
  258. package/src/themes/default/styles/shell/brand.css +48 -0
  259. package/src/themes/default/styles/shell/footer.css +72 -0
  260. package/src/themes/default/styles/shell/header.css +7 -50
  261. package/src/themes/default/styles/shell/navbar.css +226 -454
  262. package/src/themes/default/styles/shell/sidebar.css +243 -829
  263. package/src/themes/default/tokens.css +145 -98
  264. package/templates/theme/index.css +11 -14
  265. package/templates/theme/styles/actions/button-group.css +6 -6
  266. package/templates/theme/styles/actions/button.css +98 -60
  267. package/templates/theme/styles/actions/toggle-group.css +61 -25
  268. package/templates/theme/styles/base/text.css +87 -0
  269. package/templates/theme/styles/base/typography.css +24 -117
  270. package/templates/theme/styles/disclosure/accordion.css +35 -28
  271. package/templates/theme/styles/display/alert.css +7 -7
  272. package/templates/theme/styles/display/badge.css +8 -9
  273. package/templates/theme/styles/display/card.css +10 -47
  274. package/templates/theme/styles/display/catalog.css +753 -0
  275. package/templates/theme/styles/display/coverage.css +30 -305
  276. package/templates/theme/styles/display/scroll-area.css +29 -24
  277. package/templates/theme/styles/display/spinner.css +38 -1
  278. package/templates/theme/styles/display/stat.css +21 -0
  279. package/templates/theme/styles/display/table.css +37 -12
  280. package/templates/theme/styles/display/virtual-list.css +24 -13
  281. package/templates/theme/styles/display/virtual-table.css +58 -36
  282. package/templates/theme/styles/forms/checkbox.css +12 -21
  283. package/templates/theme/styles/forms/input.css +11 -12
  284. package/templates/theme/styles/forms/radio-group.css +44 -27
  285. package/templates/theme/styles/forms/select.css +27 -35
  286. package/templates/theme/styles/forms/slider.css +61 -47
  287. package/templates/theme/styles/forms/switch.css +18 -23
  288. package/templates/theme/styles/forms/textarea.css +12 -12
  289. package/templates/theme/styles/layout/block.css +96 -12
  290. package/templates/theme/styles/layout/grid.css +78 -0
  291. package/templates/theme/styles/layout/layout.css +676 -1
  292. package/templates/theme/styles/layout/patterns.css +0 -155
  293. package/templates/theme/styles/navigation/nav.css +104 -154
  294. package/templates/theme/styles/overlays/alert-dialog.css +2 -2
  295. package/templates/theme/styles/overlays/dialog.css +76 -22
  296. package/templates/theme/styles/overlays/dropdown.css +108 -31
  297. package/templates/theme/styles/overlays/hover-card.css +39 -17
  298. package/templates/theme/styles/overlays/menubar.css +223 -0
  299. package/templates/theme/styles/overlays/popover.css +69 -23
  300. package/templates/theme/styles/overlays/toast.css +80 -33
  301. package/templates/theme/styles/overlays/tooltip.css +88 -14
  302. package/templates/theme/styles/shell/brand.css +48 -0
  303. package/templates/theme/styles/shell/footer.css +72 -0
  304. package/templates/theme/styles/shell/header.css +7 -50
  305. package/templates/theme/styles/shell/navbar.css +226 -454
  306. package/templates/theme/styles/shell/sidebar.css +197 -779
  307. package/templates/theme/tokens.css +145 -98
  308. package/dist/components/_internal/box-layout.js +0 -116
  309. package/dist/components/_internal/box-layout.js.map +0 -1
  310. package/dist/components/_internal/layout.d.ts +0 -9
  311. package/dist/components/_internal/layout.js +0 -142
  312. package/dist/components/_internal/layout.js.map +0 -1
  313. package/dist/components/badge/badge.a11y.d.ts +0 -17
  314. package/dist/components/block/block.a11y.d.ts +0 -20
  315. package/dist/components/box/box.a11y.d.ts +0 -14
  316. package/dist/components/box/box.d.ts +0 -9
  317. package/dist/components/box/box.js +0 -36
  318. package/dist/components/box/box.js.map +0 -1
  319. package/dist/components/box/box.types.d.ts +0 -72
  320. package/dist/components/box/index.d.ts +0 -3
  321. package/dist/components/breadcrumb/breadcrumb.a11y.d.ts +0 -17
  322. package/dist/components/breadcrumb/breadcrumb.a11y.js +0 -15
  323. package/dist/components/breadcrumb/breadcrumb.a11y.js.map +0 -1
  324. package/dist/components/breadcrumb/breadcrumb.d.ts +0 -18
  325. package/dist/components/breadcrumb/breadcrumb.js +0 -113
  326. package/dist/components/breadcrumb/breadcrumb.js.map +0 -1
  327. package/dist/components/breadcrumb/breadcrumb.types.d.ts +0 -65
  328. package/dist/components/breadcrumb/index.d.ts +0 -3
  329. package/dist/components/container/container.a11y.d.ts +0 -19
  330. package/dist/components/flex/flex.a11y.d.ts +0 -22
  331. package/dist/components/flex/flex.d.ts +0 -9
  332. package/dist/components/flex/flex.js +0 -115
  333. package/dist/components/flex/flex.js.map +0 -1
  334. package/dist/components/flex/flex.types.d.ts +0 -42
  335. package/dist/components/flex/index.d.ts +0 -3
  336. package/dist/components/header/header.a11y.d.ts +0 -14
  337. package/dist/components/header/header.a11y.js +0 -12
  338. package/dist/components/header/header.a11y.js.map +0 -1
  339. package/dist/components/inline/index.d.ts +0 -8
  340. package/dist/components/inline/index.js +0 -13
  341. package/dist/components/inline/index.js.map +0 -1
  342. package/dist/components/list-group/index.d.ts +0 -2
  343. package/dist/components/list-group/list-group.d.ts +0 -9
  344. package/dist/components/list-group/list-group.js +0 -43
  345. package/dist/components/list-group/list-group.js.map +0 -1
  346. package/dist/components/list-group/list-group.types.d.ts +0 -32
  347. package/dist/components/navbar/navbar-panel.js +0 -42
  348. package/dist/components/navbar/navbar-panel.js.map +0 -1
  349. package/dist/components/navbar/navbar.context.js +0 -13
  350. package/dist/components/navbar/navbar.context.js.map +0 -1
  351. package/dist/components/navbar/navbar.render.js +0 -26
  352. package/dist/components/navbar/navbar.render.js.map +0 -1
  353. package/dist/components/navbar/navbar.shared.js +0 -18
  354. package/dist/components/navbar/navbar.shared.js.map +0 -1
  355. package/dist/components/pagination/index.d.ts +0 -2
  356. package/dist/components/pagination/pagination.d.ts +0 -11
  357. package/dist/components/pagination/pagination.js +0 -95
  358. package/dist/components/pagination/pagination.js.map +0 -1
  359. package/dist/components/pagination/pagination.types.d.ts +0 -40
  360. package/dist/components/section/section.a11y.d.ts +0 -15
  361. package/dist/components/separator/separator.a11y.d.ts +0 -17
  362. package/dist/components/separator/separator.a11y.js +0 -15
  363. package/dist/components/separator/separator.a11y.js.map +0 -1
  364. package/dist/components/shell/index.d.ts +0 -3
  365. package/dist/components/shell/shell-nav.types.d.ts +0 -7
  366. package/dist/components/shell/shell-panel.js +0 -54
  367. package/dist/components/shell/shell-panel.js.map +0 -1
  368. package/dist/components/shell/shell-responsive.js +0 -141
  369. package/dist/components/shell/shell-responsive.js.map +0 -1
  370. package/dist/components/shell/shell.a11y.d.ts +0 -23
  371. package/dist/components/shell/shell.a11y.js +0 -23
  372. package/dist/components/shell/shell.a11y.js.map +0 -1
  373. package/dist/components/shell/shell.d.ts +0 -13
  374. package/dist/components/shell/shell.js +0 -69
  375. package/dist/components/shell/shell.js.map +0 -1
  376. package/dist/components/shell/shell.types.d.ts +0 -58
  377. package/dist/components/sidebar/sidebar-panel.d.ts +0 -7
  378. package/dist/components/sidebar/sidebar-panel.js +0 -49
  379. package/dist/components/sidebar/sidebar-panel.js.map +0 -1
  380. package/dist/components/sidebar/sidebar-toggle.d.ts +0 -7
  381. package/dist/components/sidebar/sidebar-toggle.js +0 -8
  382. package/dist/components/sidebar/sidebar-toggle.js.map +0 -1
  383. package/dist/components/sidebar/sidebar.context.js +0 -21
  384. package/dist/components/sidebar/sidebar.context.js.map +0 -1
  385. package/dist/components/sidebar/sidebar.shared.js +0 -12
  386. package/dist/components/sidebar/sidebar.shared.js.map +0 -1
  387. package/dist/components/skeleton/skeleton.a11y.d.ts +0 -16
  388. package/dist/components/spacer/index.d.ts +0 -3
  389. package/dist/components/spacer/spacer.a11y.d.ts +0 -17
  390. package/dist/components/spacer/spacer.d.ts +0 -8
  391. package/dist/components/spacer/spacer.js +0 -49
  392. package/dist/components/spacer/spacer.js.map +0 -1
  393. package/dist/components/spacer/spacer.types.d.ts +0 -26
  394. package/dist/components/stack/index.d.ts +0 -3
  395. package/dist/components/stack/stack.a11y.d.ts +0 -18
  396. package/dist/components/stack/stack.d.ts +0 -8
  397. package/dist/components/stack/stack.js +0 -16
  398. package/dist/components/stack/stack.js.map +0 -1
  399. package/dist/components/stack/stack.types.d.ts +0 -22
  400. package/dist/feedback.d.ts +0 -5
  401. package/dist/feedback.js +0 -4
  402. package/dist/layouts.d.ts +0 -25
  403. package/dist/layouts.js +0 -11
  404. package/dist/shells.d.ts +0 -16
  405. package/dist/shells.js +0 -11
  406. package/src/components/_internal/box-layout.ts +0 -164
  407. package/src/components/_internal/layout.ts +0 -202
  408. package/src/components/box/box.a11y.ts +0 -11
  409. package/src/components/box/box.tsx +0 -38
  410. package/src/components/box/box.types.ts +0 -76
  411. package/src/components/box/index.ts +0 -11
  412. package/src/components/breadcrumb/breadcrumb.a11y.ts +0 -15
  413. package/src/components/breadcrumb/breadcrumb.tsx +0 -123
  414. package/src/components/breadcrumb/breadcrumb.types.ts +0 -74
  415. package/src/components/breadcrumb/index.ts +0 -24
  416. package/src/components/flex/flex.a11y.ts +0 -19
  417. package/src/components/flex/flex.tsx +0 -162
  418. package/src/components/flex/flex.types.ts +0 -51
  419. package/src/components/flex/index.ts +0 -16
  420. package/src/components/inline/index.tsx +0 -28
  421. package/src/components/list-group/index.ts +0 -7
  422. package/src/components/list-group/list-group.tsx +0 -74
  423. package/src/components/list-group/list-group.types.ts +0 -32
  424. package/src/components/navbar/navbar-panel.tsx +0 -62
  425. package/src/components/navbar/navbar.context.ts +0 -22
  426. package/src/components/navbar/navbar.render.tsx +0 -32
  427. package/src/components/navbar/navbar.shared.ts +0 -21
  428. package/src/components/pagination/index.ts +0 -8
  429. package/src/components/pagination/pagination.tsx +0 -158
  430. package/src/components/pagination/pagination.types.ts +0 -41
  431. package/src/components/shell/index.ts +0 -16
  432. package/src/components/shell/shell-nav.types.ts +0 -3
  433. package/src/components/shell/shell-panel.tsx +0 -85
  434. package/src/components/shell/shell-responsive.tsx +0 -262
  435. package/src/components/shell/shell.a11y.ts +0 -20
  436. package/src/components/shell/shell.tsx +0 -74
  437. package/src/components/shell/shell.types.ts +0 -71
  438. package/src/components/sidebar/sidebar-panel.tsx +0 -67
  439. package/src/components/sidebar/sidebar-toggle.tsx +0 -5
  440. package/src/components/sidebar/sidebar.context.ts +0 -40
  441. package/src/components/sidebar/sidebar.shared.ts +0 -12
  442. package/src/components/spacer/index.ts +0 -9
  443. package/src/components/spacer/spacer.a11y.ts +0 -14
  444. package/src/components/spacer/spacer.tsx +0 -61
  445. package/src/components/spacer/spacer.types.ts +0 -31
  446. package/src/components/stack/index.ts +0 -3
  447. package/src/components/stack/stack.a11y.ts +0 -15
  448. package/src/components/stack/stack.tsx +0 -13
  449. package/src/components/stack/stack.types.ts +0 -22
  450. package/src/feedback.ts +0 -6
  451. package/src/layouts.ts +0 -19
  452. package/src/shells.ts +0 -13
  453. package/src/themes/default/styles/actions/toggle.css +0 -50
  454. package/src/themes/default/styles/disclosure/collapsible.css +0 -58
  455. package/src/themes/default/styles/display/list-group.css +0 -84
  456. package/src/themes/default/styles/forms/form.css +0 -5
  457. package/src/themes/default/styles/layout/responsive-layout.css +0 -230
  458. package/src/themes/default/styles/navigation/breadcrumb.css +0 -45
  459. package/src/themes/default/styles/navigation/menu.css +0 -203
  460. package/src/themes/default/styles/navigation/menubar.css +0 -255
  461. package/src/themes/default/styles/navigation/pagination.css +0 -91
  462. package/src/themes/default/styles/shell/theme.css +0 -37
  463. package/templates/theme/styles/actions/toggle.css +0 -50
  464. package/templates/theme/styles/disclosure/collapsible.css +0 -58
  465. package/templates/theme/styles/display/list-group.css +0 -84
  466. package/templates/theme/styles/forms/form.css +0 -5
  467. package/templates/theme/styles/layout/responsive-layout.css +0 -230
  468. package/templates/theme/styles/navigation/breadcrumb.css +0 -45
  469. package/templates/theme/styles/navigation/menu.css +0 -203
  470. package/templates/theme/styles/navigation/menubar.css +0 -255
  471. package/templates/theme/styles/navigation/pagination.css +0 -91
  472. package/templates/theme/styles/shell/theme.css +0 -37
@@ -1,26 +0,0 @@
1
- import { JSXElement } from "@askrjs/askr/foundations";
2
- import { Ref } from "@askrjs/askr/foundations/utilities";
3
-
4
- //#region src/components/spacer/spacer.types.d.ts
5
- type SpacerAxis = "inline" | "block";
6
- type SpacerOwnProps = {
7
- /** flex-grow factor (default 1 when no axis is set). */grow?: number; /** flex-shrink factor (default 1 when no axis is set, 0 when axis is set). */
8
- shrink?: number; /** CSS flex-basis / width (axis=inline) / height (axis=block) value. */
9
- basis?: string; /** When set, renders a fixed space along the given axis instead of a flex-grow spacer. */
10
- axis?: SpacerAxis;
11
- children?: unknown;
12
- };
13
- type SpacerNativeProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> & SpacerOwnProps & {
14
- asChild?: false;
15
- ref?: Ref<HTMLDivElement>;
16
- };
17
- type SpacerAsChildProps = SpacerOwnProps & {
18
- asChild: true;
19
- children: JSXElement;
20
- ref?: Ref<unknown>;
21
- style?: JSX.IntrinsicElements["div"]["style"];
22
- };
23
- type SpacerProps = SpacerNativeProps | SpacerAsChildProps;
24
- //#endregion
25
- export { SpacerAsChildProps, SpacerAxis, SpacerNativeProps, SpacerOwnProps, SpacerProps };
26
- //# sourceMappingURL=spacer.types.d.ts.map
@@ -1,3 +0,0 @@
1
- import { StackAsChildProps, StackDivProps, StackOwnProps, StackProps } from "./stack.types.js";
2
- import { Stack } from "./stack.js";
3
- import { STACK_A11Y_CONTRACT, StackA11yContract } from "./stack.a11y.js";
@@ -1,18 +0,0 @@
1
- //#region src/components/stack/stack.a11y.d.ts
2
- declare const STACK_A11Y_CONTRACT: {
3
- readonly DATA_ATTRIBUTES: {
4
- readonly slot: "data-slot";
5
- readonly layout: "data-ak-layout";
6
- readonly gap: "data-gap";
7
- readonly align: "data-align";
8
- readonly justify: "data-justify";
9
- readonly wrap: "data-wrap";
10
- };
11
- readonly SLOT_VALUES: {
12
- readonly root: "stack";
13
- };
14
- };
15
- type StackA11yContract = typeof STACK_A11Y_CONTRACT;
16
- //#endregion
17
- export { STACK_A11Y_CONTRACT, StackA11yContract };
18
- //# sourceMappingURL=stack.a11y.d.ts.map
@@ -1,8 +0,0 @@
1
- import { StackAsChildProps, StackDivProps } from "./stack.types.js";
2
-
3
- //#region src/components/stack/stack.d.ts
4
- declare function Stack(props: StackDivProps): JSX.Element;
5
- declare function Stack(props: StackAsChildProps): JSX.Element;
6
- //#endregion
7
- export { Stack };
8
- //# sourceMappingURL=stack.d.ts.map
@@ -1,16 +0,0 @@
1
- import { Flex } from "../flex/flex.js";
2
- import { jsx } from "@askrjs/askr/jsx-runtime";
3
- //#region src/components/stack/stack.tsx
4
- function Stack(props) {
5
- const { children, ...rest } = props;
6
- return /* @__PURE__ */ jsx(Flex, {
7
- ...rest,
8
- "data-slot": "stack",
9
- direction: "column",
10
- children
11
- });
12
- }
13
- //#endregion
14
- export { Stack };
15
-
16
- //# sourceMappingURL=stack.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stack.js","names":[],"sources":["../../../src/components/stack/stack.tsx"],"sourcesContent":["import { Flex } from \"../flex\";\nimport type { StackAsChildProps, StackDivProps } from \"./stack.types\";\n\nexport function Stack(props: StackDivProps): JSX.Element;\nexport function Stack(props: StackAsChildProps): JSX.Element;\nexport function Stack(props: StackDivProps | StackAsChildProps) {\n const { children, ...rest } = props;\n return (\n <Flex {...(rest as Record<string, unknown>)} data-slot=\"stack\" direction=\"column\">\n {children}\n </Flex>\n );\n}\n"],"mappings":";;;AAKA,SAAgB,MAAM,OAA0C;CAC9D,MAAM,EAAE,UAAU,GAAG,SAAS;CAC9B,OACE,oBAAC,MAAD;EAAM,GAAK;EAAkC,aAAU;EAAQ,WAAU;EACtE;CACG,CAAA;AAEV"}
@@ -1,22 +0,0 @@
1
- import { FlexOwnProps } from "../flex/flex.types.js";
2
- import { JSXElement } from "@askrjs/askr/foundations";
3
- import { Ref } from "@askrjs/askr/foundations/utilities";
4
-
5
- //#region src/components/stack/stack.types.d.ts
6
- type StackOwnProps = Omit<FlexOwnProps, "direction" | "as"> & {
7
- children?: unknown;
8
- };
9
- type StackDivProps = Omit<JSX.IntrinsicElements["div"], "children" | "ref"> & StackOwnProps & {
10
- asChild?: false;
11
- ref?: Ref<HTMLDivElement>;
12
- };
13
- type StackAsChildProps = StackOwnProps & {
14
- asChild: true;
15
- children: JSXElement;
16
- ref?: Ref<unknown>;
17
- style?: JSX.IntrinsicElements["div"]["style"];
18
- };
19
- type StackProps = StackDivProps | StackAsChildProps;
20
- //#endregion
21
- export { StackAsChildProps, StackDivProps, StackOwnProps, StackProps };
22
- //# sourceMappingURL=stack.types.d.ts.map
@@ -1,5 +0,0 @@
1
- import { EmptyStateHeadingTag, EmptyStateProps } from "./components/empty-state/empty-state.types.js";
2
- import { EmptyState } from "./components/empty-state/empty-state.js";
3
- import { SpinnerOwnProps, SpinnerProps } from "./components/spinner/spinner.types.js";
4
- import { Spinner } from "./components/spinner/spinner.js";
5
- export { EmptyState, type EmptyStateHeadingTag, type EmptyStateProps, Spinner, type SpinnerOwnProps, type SpinnerProps };
package/dist/feedback.js DELETED
@@ -1,4 +0,0 @@
1
- /* empty css */
2
- import { EmptyState } from "./components/empty-state/empty-state.js";
3
- import { Spinner } from "./components/spinner/spinner.js";
4
- export { EmptyState, Spinner };
package/dist/layouts.d.ts DELETED
@@ -1,25 +0,0 @@
1
- import { AspectRatioAsChildProps, AspectRatioProps } from "./components/aspect-ratio/aspect-ratio.types.js";
2
- import { AspectRatio } from "./components/aspect-ratio/aspect-ratio.js";
3
- import { BlockAsChildProps, BlockDivProps, BlockNativeProps, BlockOwnProps, BlockProps, BlockSize, BlockSpanProps } from "./components/block/block.types.js";
4
- import { Block } from "./components/block/block.js";
5
- import { BLOCK_A11Y_CONTRACT, BlockA11yContract } from "./components/block/block.a11y.js";
6
- import { BoxAsChildProps, BoxDivProps, BoxLayoutOwnProps, BoxOwnProps, BoxProps, BoxSpanProps, LayoutResponsive } from "./components/box/box.types.js";
7
- import { Box } from "./components/box/box.js";
8
- import { BOX_A11Y_CONTRACT, BoxA11yContract } from "./components/box/box.a11y.js";
9
- import { ContainerAsChildProps, ContainerNativeProps, ContainerOwnProps, ContainerProps, ContainerVariant } from "./components/container/container.types.js";
10
- import { Container } from "./components/container/container.js";
11
- import { CONTAINER_A11Y_CONTRACT, ContainerA11yContract } from "./components/container/container.a11y.js";
12
- import { FlexAsChildProps, FlexDivProps, FlexNativeProps, FlexOwnProps, FlexProps, FlexSpanProps } from "./components/flex/flex.types.js";
13
- import { Flex } from "./components/flex/flex.js";
14
- import { FLEX_A11Y_CONTRACT, FlexA11yContract } from "./components/flex/flex.a11y.js";
15
- import { Inline } from "./components/inline/index.js";
16
- import { SectionAsChildProps, SectionElementProps, SectionOwnProps, SectionProps } from "./components/section/section.types.js";
17
- import { Section } from "./components/section/section.js";
18
- import { SECTION_A11Y_CONTRACT, SectionA11yContract } from "./components/section/section.a11y.js";
19
- import { SpacerAsChildProps, SpacerAxis, SpacerNativeProps, SpacerOwnProps, SpacerProps } from "./components/spacer/spacer.types.js";
20
- import { Spacer } from "./components/spacer/spacer.js";
21
- import { SPACER_A11Y_CONTRACT, SpacerA11yContract } from "./components/spacer/spacer.a11y.js";
22
- import { StackAsChildProps, StackDivProps, StackOwnProps, StackProps } from "./components/stack/stack.types.js";
23
- import { Stack } from "./components/stack/stack.js";
24
- import { STACK_A11Y_CONTRACT, StackA11yContract } from "./components/stack/stack.a11y.js";
25
- export { AspectRatio, type AspectRatioAsChildProps, type AspectRatioProps, type BLOCK_A11Y_CONTRACT, type BOX_A11Y_CONTRACT, Block, type BlockA11yContract, type BlockAsChildProps, type BlockDivProps, type BlockNativeProps, type BlockOwnProps, type BlockProps, type BlockSize, type BlockSpanProps, Box, type BoxA11yContract, type BoxAsChildProps, type BoxDivProps, type BoxLayoutOwnProps, type BoxOwnProps, type BoxProps, type BoxSpanProps, type CONTAINER_A11Y_CONTRACT, Container, type ContainerA11yContract, type ContainerAsChildProps, type ContainerNativeProps, type ContainerOwnProps, type ContainerProps, type ContainerVariant, type FLEX_A11Y_CONTRACT, Flex, type FlexA11yContract, type FlexAsChildProps, type FlexDivProps, type FlexNativeProps, type FlexOwnProps, type FlexProps, type FlexSpanProps, type FLEX_A11Y_CONTRACT as INLINE_A11Y_CONTRACT, Inline, type FlexA11yContract as InlineA11yContract, type FlexAsChildProps as InlineAsChildProps, type FlexDivProps as InlineDivProps, type FlexNativeProps as InlineNativeProps, type FlexOwnProps as InlineOwnProps, type FlexProps as InlineProps, type FlexSpanProps as InlineSpanProps, type LayoutResponsive, type SECTION_A11Y_CONTRACT, type SPACER_A11Y_CONTRACT, type STACK_A11Y_CONTRACT, Section, type SectionA11yContract, type SectionAsChildProps, type SectionElementProps, type SectionOwnProps, type SectionProps, Spacer, type SpacerA11yContract, type SpacerAsChildProps, type SpacerAxis, type SpacerNativeProps, type SpacerOwnProps, type SpacerProps, Stack, type StackA11yContract, type StackAsChildProps, type StackDivProps, type StackOwnProps, type StackProps };
package/dist/layouts.js DELETED
@@ -1,11 +0,0 @@
1
- /* empty css */
2
- import { AspectRatio } from "./components/aspect-ratio/aspect-ratio.js";
3
- import { Block } from "./components/block/block.js";
4
- import { Box } from "./components/box/box.js";
5
- import { Container } from "./components/container/container.js";
6
- import { Flex } from "./components/flex/flex.js";
7
- import { Inline } from "./components/inline/index.js";
8
- import { Section } from "./components/section/section.js";
9
- import { Spacer } from "./components/spacer/spacer.js";
10
- import { Stack } from "./components/stack/stack.js";
11
- export { AspectRatio, Block, Box, Container, Flex, Inline, Section, Spacer, Stack };
package/dist/shells.d.ts DELETED
@@ -1,16 +0,0 @@
1
- import { NavItemAsChildProps, NavItemProps, NavItemVariant, NavLinkProps } from "./components/nav/nav.types.js";
2
- import { NavItem, NavLink } from "./components/nav/nav.js";
3
- import { CollapseBreakpoint, CollapseIconPlacement, Collapsible } from "./components/shell/shell-nav.types.js";
4
- import { NavBrandProps, NavGroupProps, NavToggleProps, NavbarProps } from "./components/navbar/navbar.types.js";
5
- import { NavBrand, NavGroup, NavToggle, Navbar } from "./components/navbar/navbar.js";
6
- import { SidebarPanelProps, SidebarProps, SidebarToggleProps } from "./components/sidebar/sidebar.types.js";
7
- import { Sidebar } from "./components/sidebar/sidebar.js";
8
- import { SidebarPanel } from "./components/sidebar/sidebar-panel.js";
9
- import { SidebarToggle } from "./components/sidebar/sidebar-toggle.js";
10
- import { HeaderPosition, HeaderProps } from "./components/header/header.types.js";
11
- import { Header } from "./components/header/header.js";
12
- import { HEADER_A11Y_CONTRACT, HeaderA11yContract } from "./components/header/header.a11y.js";
13
- import { ShellAsChildProps, ShellDivProps, ShellMainAsChildProps, ShellMainDivProps, ShellMainMainProps, ShellMainProps, ShellNavAsChildProps, ShellNavDivProps, ShellNavProps, ShellOwnProps, ShellProps, ShellVariant } from "./components/shell/shell.types.js";
14
- import { Shell, ShellMain, ShellNav } from "./components/shell/shell.js";
15
- import { SHELL_A11Y_CONTRACT, ShellA11yContract } from "./components/shell/shell.a11y.js";
16
- export { type CollapseBreakpoint, type CollapseIconPlacement, type Collapsible, HEADER_A11Y_CONTRACT, Header, type HeaderA11yContract, type HeaderPosition, type HeaderProps, NavBrand, type NavBrandProps, NavGroup, type NavGroupProps, NavItem, type NavItemAsChildProps, type NavItemProps, type NavItemVariant, NavLink, type NavLinkProps, NavToggle, type NavToggleProps, Navbar, type NavbarProps, SHELL_A11Y_CONTRACT, Shell, type ShellA11yContract, type ShellAsChildProps, type ShellDivProps, ShellMain, type ShellMainAsChildProps, type ShellMainDivProps, type ShellMainMainProps, type ShellMainProps, ShellNav, type ShellNavAsChildProps, type ShellNavDivProps, type ShellNavProps, type ShellOwnProps, type ShellProps, type ShellVariant, Sidebar, SidebarPanel, type SidebarPanelProps, type SidebarProps, SidebarToggle, type SidebarToggleProps };
package/dist/shells.js DELETED
@@ -1,11 +0,0 @@
1
- /* empty css */
2
- import { NavItem, NavLink } from "./components/nav/nav.js";
3
- import { NavBrand, NavGroup, NavToggle, Navbar } from "./components/navbar/navbar.js";
4
- import { SidebarPanel } from "./components/sidebar/sidebar-panel.js";
5
- import { SidebarToggle } from "./components/sidebar/sidebar-toggle.js";
6
- import { Sidebar } from "./components/sidebar/sidebar.js";
7
- import { Header } from "./components/header/header.js";
8
- import { HEADER_A11Y_CONTRACT } from "./components/header/header.a11y.js";
9
- import { Shell, ShellMain, ShellNav } from "./components/shell/shell.js";
10
- import { SHELL_A11Y_CONTRACT } from "./components/shell/shell.a11y.js";
11
- export { HEADER_A11Y_CONTRACT, Header, NavBrand, NavGroup, NavItem, NavLink, NavToggle, Navbar, SHELL_A11Y_CONTRACT, Shell, ShellMain, ShellNav, Sidebar, SidebarPanel, SidebarToggle };
@@ -1,164 +0,0 @@
1
- import { mergeLayoutStyles, resolveSpaceValue, setResponsiveStyleVar } from "./layout";
2
- import { styleDeclarationsToClass } from "./style";
3
- import type { BoxLayoutOwnProps } from "../box/box.types";
4
-
5
- const SPACE_PROP_KEYS = new Set([
6
- "m",
7
- "mx",
8
- "my",
9
- "mt",
10
- "mr",
11
- "mb",
12
- "ml",
13
- "p",
14
- "px",
15
- "py",
16
- "pt",
17
- "pr",
18
- "pb",
19
- "pl",
20
- "inset",
21
- "top",
22
- "right",
23
- "bottom",
24
- "left",
25
- ]);
26
-
27
- const BOX_PROP_KEYS = new Set<keyof BoxLayoutOwnProps>([
28
- "display",
29
- "m",
30
- "mx",
31
- "my",
32
- "mt",
33
- "mr",
34
- "mb",
35
- "ml",
36
- "p",
37
- "px",
38
- "py",
39
- "pt",
40
- "pr",
41
- "pb",
42
- "pl",
43
- "width",
44
- "minWidth",
45
- "maxWidth",
46
- "height",
47
- "minHeight",
48
- "maxHeight",
49
- "position",
50
- "inset",
51
- "top",
52
- "right",
53
- "bottom",
54
- "left",
55
- "overflow",
56
- "overflowX",
57
- "overflowY",
58
- "flexBasis",
59
- "flexGrow",
60
- "flexShrink",
61
- "gridArea",
62
- "gridColumn",
63
- "gridColumnStart",
64
- "gridColumnEnd",
65
- "gridRow",
66
- "gridRowStart",
67
- "gridRowEnd",
68
- ]);
69
-
70
- function variableNameForProp(prop: keyof BoxLayoutOwnProps): string {
71
- switch (prop) {
72
- case "overflowX":
73
- return "overflow-x";
74
- case "overflowY":
75
- return "overflow-y";
76
- case "minWidth":
77
- return "min-width";
78
- case "maxWidth":
79
- return "max-width";
80
- case "minHeight":
81
- return "min-height";
82
- case "maxHeight":
83
- return "max-height";
84
- case "flexBasis":
85
- return "flex-basis";
86
- case "flexGrow":
87
- return "flex-grow";
88
- case "flexShrink":
89
- return "flex-shrink";
90
- case "gridArea":
91
- return "grid-area";
92
- case "gridColumn":
93
- return "grid-column";
94
- case "gridColumnStart":
95
- return "grid-column-start";
96
- case "gridColumnEnd":
97
- return "grid-column-end";
98
- case "gridRow":
99
- return "grid-row";
100
- case "gridRowStart":
101
- return "grid-row-start";
102
- case "gridRowEnd":
103
- return "grid-row-end";
104
- default:
105
- return prop;
106
- }
107
- }
108
-
109
- export function splitBoxLayoutProps<T extends Record<string, unknown>>(
110
- props: T,
111
- ): {
112
- boxProps: Partial<BoxLayoutOwnProps>;
113
- rest: Omit<T, keyof BoxLayoutOwnProps>;
114
- } {
115
- const boxProps: Partial<BoxLayoutOwnProps> = {};
116
- const rest: Record<string, unknown> = {};
117
-
118
- for (const [key, value] of Object.entries(props)) {
119
- if (BOX_PROP_KEYS.has(key as keyof BoxLayoutOwnProps)) {
120
- (boxProps as Record<string, unknown>)[key] = value;
121
- } else {
122
- rest[key] = value;
123
- }
124
- }
125
-
126
- return { boxProps, rest: rest as Omit<T, keyof BoxLayoutOwnProps> };
127
- }
128
-
129
- export function applyBoxLayoutStyles(
130
- styles: Record<string, string | number>,
131
- boxProps: Partial<BoxLayoutOwnProps>,
132
- ) {
133
- for (const key of BOX_PROP_KEYS) {
134
- const value = boxProps[key];
135
- if (value === undefined) continue;
136
-
137
- const variable = variableNameForProp(key);
138
- if (SPACE_PROP_KEYS.has(key)) {
139
- setResponsiveStyleVar(styles, variable, value as string | number, resolveSpaceValue);
140
- continue;
141
- }
142
-
143
- setResponsiveStyleVar(
144
- styles,
145
- variable,
146
- value as string | number,
147
- (input) => input as string | number,
148
- );
149
- }
150
- }
151
-
152
- export function withBoxLayoutStyle(
153
- styles: Record<string, string | number>,
154
- userStyle: unknown,
155
- ): string | undefined {
156
- return mergeLayoutStyles(styles, userStyle);
157
- }
158
-
159
- export function withBoxLayoutClass(
160
- styles: Record<string, string | number>,
161
- userStyle: unknown,
162
- ): string | undefined {
163
- return styleDeclarationsToClass(mergeLayoutStyles(styles, userStyle));
164
- }
@@ -1,202 +0,0 @@
1
- import { serializeCssDeclarations } from "./style";
2
-
3
- /**
4
- * Layout helpers shared by headless layout primitives.
5
- */
6
-
7
- export type LayoutBreakpoint = "initial" | "sm" | "md" | "lg" | "xl";
8
- export type ResponsiveValue<T> = T | Partial<Record<LayoutBreakpoint, T>>;
9
-
10
- const BREAKPOINTS: readonly LayoutBreakpoint[] = ["initial", "sm", "md", "lg", "xl"];
11
-
12
- /** Units and patterns that identify a concrete CSS length value. */
13
- const CSS_UNIT_RE =
14
- /^-?[\d.]+(%|px|em|rem|ex|ch|ic|lh|rlh|vw|vh|vmin|vmax|svw|svh|dvw|dvh|cqw|cqh|cqi|cqb|fr|cm|mm|in|pt|pc|Q)$/;
15
-
16
- const SPACE_TOKEN_MAP: Record<string, string> = {
17
- "1": "var(--ak-space-1)",
18
- "2": "var(--ak-space-2)",
19
- "3": "var(--ak-space-3)",
20
- "4": "var(--ak-space-4)",
21
- "5": "var(--ak-space-5)",
22
- "6": "var(--ak-space-6)",
23
- "7": "var(--ak-space-7)",
24
- "8": "var(--ak-space-8)",
25
- "9": "var(--ak-space-9)",
26
- xs: "var(--ak-space-xs)",
27
- sm: "var(--ak-space-sm)",
28
- md: "var(--ak-space-md)",
29
- lg: "var(--ak-space-lg)",
30
- xl: "var(--ak-space-xl)",
31
- "2xl": "var(--ak-space-2xl)",
32
- "3xl": "var(--ak-space-3xl)",
33
- };
34
-
35
- const CONTAINER_SIZE_MAP: Record<string, string> = {
36
- "1": "var(--ak-container-1)",
37
- "2": "var(--ak-container-2)",
38
- "3": "var(--ak-container-3)",
39
- "4": "var(--ak-container-4)",
40
- sm: "var(--ak-container-1)",
41
- md: "var(--ak-container-2)",
42
- lg: "var(--ak-container-3)",
43
- xl: "var(--ak-container-4)",
44
- fluid: "100%",
45
- };
46
-
47
- const SECTION_SIZE_MAP: Record<string, string> = {
48
- "1": "var(--ak-section-1)",
49
- "2": "var(--ak-section-2)",
50
- "3": "var(--ak-section-3)",
51
- "4": "var(--ak-section-4)",
52
- };
53
-
54
- /**
55
- * Returns true when `value` is a concrete CSS length/size that can be serialized
56
- * into a CSS declaration without token translation.
57
- */
58
- export function isCssLength(value: unknown): value is string {
59
- if (typeof value !== "string") return false;
60
- const v = value.trim();
61
- if (v === "0") return true;
62
- if (CSS_UNIT_RE.test(v)) return true;
63
- // CSS functions: calc(), min(), max(), clamp(), fit-content(), env(), var()
64
- if (/^[a-z][a-z-]*\(/.test(v)) return true;
65
- return false;
66
- }
67
-
68
- export function isResponsiveValue<T>(
69
- value: ResponsiveValue<T> | undefined,
70
- ): value is Partial<Record<LayoutBreakpoint, T>> {
71
- if (!value || typeof value !== "object" || Array.isArray(value)) return false;
72
- return BREAKPOINTS.some((breakpoint) => breakpoint in value);
73
- }
74
-
75
- export function normalizeResponsiveValue<T>(
76
- value: ResponsiveValue<T> | undefined,
77
- ): Partial<Record<LayoutBreakpoint, T>> | undefined {
78
- if (value === undefined) return undefined;
79
- if (isResponsiveValue(value)) return value;
80
- return { initial: value };
81
- }
82
-
83
- export function serializeResponsiveValue<T>(
84
- value: ResponsiveValue<T> | undefined,
85
- ): string | undefined {
86
- const normalized = normalizeResponsiveValue(value);
87
- if (!normalized) return undefined;
88
-
89
- return BREAKPOINTS.map((breakpoint) => {
90
- const breakpointValue = normalized[breakpoint];
91
- if (breakpointValue === undefined) return "";
92
- return `${breakpoint}:${String(breakpointValue)}`;
93
- })
94
- .filter(Boolean)
95
- .join("|");
96
- }
97
-
98
- export function serializeResponsiveValueIf<T>(
99
- value: ResponsiveValue<T> | undefined,
100
- predicate: (value: T) => boolean,
101
- ): string | undefined {
102
- const normalized = normalizeResponsiveValue(value);
103
- if (!normalized) return undefined;
104
-
105
- for (const breakpoint of BREAKPOINTS) {
106
- const breakpointValue = normalized[breakpoint];
107
- if (breakpointValue === undefined) continue;
108
- if (!predicate(breakpointValue)) return undefined;
109
- }
110
-
111
- return serializeResponsiveValue(value);
112
- }
113
-
114
- export function serializeValueIf<T>(
115
- value: T | undefined,
116
- predicate: (value: T) => boolean,
117
- ): string | undefined {
118
- if (value === undefined || !predicate(value)) return undefined;
119
- return String(value);
120
- }
121
-
122
- export function setResponsiveStyleVar<T>(
123
- styles: Record<string, string | number>,
124
- variable: string,
125
- value: ResponsiveValue<T> | undefined,
126
- resolve: (value: T) => string | number | undefined = (input) =>
127
- input as string | number | undefined,
128
- ) {
129
- const normalized = normalizeResponsiveValue(value);
130
- if (!normalized) return;
131
-
132
- for (const breakpoint of BREAKPOINTS) {
133
- const breakpointValue = normalized[breakpoint];
134
- if (breakpointValue === undefined) continue;
135
- const resolved = resolve(breakpointValue);
136
- if (resolved === undefined || resolved === null || resolved === "") continue;
137
- styles[`--ak-${variable}-${breakpoint}`] = resolved;
138
- }
139
- }
140
-
141
- export function resolveSpaceValue(value: string | number): string | number {
142
- if (typeof value === "number") return String(value);
143
- const trimmed = value.trim();
144
- return SPACE_TOKEN_MAP[trimmed] ?? trimmed;
145
- }
146
-
147
- export function resolveContainerSizeValue(value: string): string {
148
- const trimmed = value.trim();
149
- return CONTAINER_SIZE_MAP[trimmed] ?? trimmed;
150
- }
151
-
152
- export function resolveSectionSizeValue(value: string): string {
153
- const trimmed = value.trim();
154
- return SECTION_SIZE_MAP[trimmed] ?? trimmed;
155
- }
156
-
157
- export function resolveJustifyValue(value: string): string {
158
- const trimmed = value.trim();
159
- if (trimmed === "between") return "space-between";
160
- if (trimmed === "start") return "flex-start";
161
- if (trimmed === "end") return "flex-end";
162
- return trimmed;
163
- }
164
-
165
- export function resolveAlignValue(value: string): string {
166
- const trimmed = value.trim();
167
- if (trimmed === "start") return "flex-start";
168
- if (trimmed === "end") return "flex-end";
169
- return trimmed;
170
- }
171
-
172
- export function resolveInlineAlignValue(value: "left" | "center" | "right"): {
173
- marginLeft?: string;
174
- marginRight?: string;
175
- } {
176
- if (value === "left") return { marginLeft: "0", marginRight: "auto" };
177
- if (value === "right") return { marginLeft: "auto", marginRight: "0" };
178
- return { marginLeft: "auto", marginRight: "auto" };
179
- }
180
-
181
- /**
182
- * Merges a record of computed layout declarations with a user-supplied style
183
- * value. The user's declarations take precedence for conflicting keys.
184
- */
185
- export function mergeLayoutStyles(
186
- layout: Record<string, string | number>,
187
- user: unknown,
188
- ): string | undefined {
189
- const merged: Record<string, unknown> = { ...layout };
190
-
191
- if (user !== null && user !== undefined && typeof user === "object") {
192
- Object.assign(merged, user as Record<string, unknown>);
193
- }
194
-
195
- const mergedString = serializeCssDeclarations(merged);
196
-
197
- if (typeof user === "string" && user.trim()) {
198
- return mergedString ? `${mergedString};${user.trim()}` : user.trim();
199
- }
200
-
201
- return mergedString || undefined;
202
- }
@@ -1,11 +0,0 @@
1
- export const BOX_A11Y_CONTRACT = {
2
- DATA_ATTRIBUTES: {
3
- slot: "data-slot" as const,
4
- layout: "data-ak-layout" as const,
5
- },
6
- SLOT_VALUES: {
7
- root: "box" as const,
8
- },
9
- } as const;
10
-
11
- export type BoxA11yContract = typeof BOX_A11Y_CONTRACT;
@@ -1,38 +0,0 @@
1
- import { Slot } from "@askrjs/askr/foundations";
2
- import { mergeProps } from "../_internal/merge-props";
3
- import {
4
- applyBoxLayoutStyles,
5
- splitBoxLayoutProps,
6
- withBoxLayoutClass,
7
- } from "../_internal/box-layout";
8
- import type { BoxAsChildProps, BoxDivProps, BoxSpanProps } from "./box.types";
9
-
10
- export function Box(props: BoxDivProps): JSX.Element;
11
- export function Box(props: BoxSpanProps): JSX.Element;
12
- export function Box(props: BoxAsChildProps): JSX.Element;
13
- export function Box(props: BoxDivProps | BoxSpanProps | BoxAsChildProps) {
14
- const as = "as" in props ? props.as : "div";
15
- const { asChild, children, ref, style: userStyle, ...rest } = props;
16
-
17
- const { boxProps, rest: passthroughProps } = splitBoxLayoutProps(rest);
18
- const layoutStyle: Record<string, string | number> = {};
19
- applyBoxLayoutStyles(layoutStyle, boxProps);
20
- const layoutClass = withBoxLayoutClass(layoutStyle, userStyle);
21
-
22
- const finalProps = mergeProps(passthroughProps, {
23
- ref,
24
- "data-slot": "box",
25
- "data-ak-layout": "true",
26
- ...(layoutClass ? { class: layoutClass } : {}),
27
- });
28
-
29
- if (asChild) {
30
- return <Slot asChild {...finalProps} children={children} />;
31
- }
32
-
33
- if (as === "span") {
34
- return <span {...finalProps}>{children}</span>;
35
- }
36
-
37
- return <div {...finalProps}>{children}</div>;
38
- }