shelving 1.199.2 → 1.200.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 (394) hide show
  1. package/index.js +1 -0
  2. package/package.json +10 -5
  3. package/ui/app/App.d.ts +11 -0
  4. package/ui/app/App.js +21 -0
  5. package/ui/app/App.module.css +168 -0
  6. package/ui/app/App.tsx +26 -0
  7. package/ui/app/index.d.ts +1 -0
  8. package/ui/app/index.js +1 -0
  9. package/ui/app/index.ts +1 -0
  10. package/ui/block/Address.d.ts +20 -0
  11. package/ui/block/Address.js +17 -0
  12. package/ui/block/Address.module.css +20 -0
  13. package/ui/block/Address.tsx +47 -0
  14. package/ui/block/Blockquote.d.ts +5 -0
  15. package/ui/block/Blockquote.js +5 -0
  16. package/ui/block/Blockquote.module.css +21 -0
  17. package/ui/block/Blockquote.tsx +10 -0
  18. package/ui/block/Card.d.ts +10 -0
  19. package/ui/block/Card.js +7 -0
  20. package/ui/block/Card.module.css +32 -0
  21. package/ui/block/Card.tsx +18 -0
  22. package/ui/block/Divider.d.ts +6 -0
  23. package/ui/block/Divider.js +5 -0
  24. package/ui/block/Divider.module.css +19 -0
  25. package/ui/block/Divider.tsx +11 -0
  26. package/ui/block/Element.d.ts +9 -0
  27. package/ui/block/Element.js +7 -0
  28. package/ui/block/Element.module.css +12 -0
  29. package/ui/block/Element.tsx +14 -0
  30. package/ui/block/Elements.d.ts +27 -0
  31. package/ui/block/Elements.js +10 -0
  32. package/ui/block/Elements.module.css +70 -0
  33. package/ui/block/Elements.tsx +44 -0
  34. package/ui/block/Figure.d.ts +6 -0
  35. package/ui/block/Figure.js +5 -0
  36. package/ui/block/Figure.module.css +27 -0
  37. package/ui/block/Figure.tsx +16 -0
  38. package/ui/block/Heading.d.ts +6 -0
  39. package/ui/block/Heading.js +7 -0
  40. package/ui/block/Heading.module.css +23 -0
  41. package/ui/block/Heading.tsx +13 -0
  42. package/ui/block/Image.d.ts +6 -0
  43. package/ui/block/Image.js +5 -0
  44. package/ui/block/Image.module.css +20 -0
  45. package/ui/block/Image.tsx +11 -0
  46. package/ui/block/List.d.ts +6 -0
  47. package/ui/block/List.js +6 -0
  48. package/ui/block/List.module.css +30 -0
  49. package/ui/block/List.tsx +12 -0
  50. package/ui/block/Paragraph.d.ts +15 -0
  51. package/ui/block/Paragraph.js +7 -0
  52. package/ui/block/Paragraph.module.css +36 -0
  53. package/ui/block/Paragraph.tsx +21 -0
  54. package/ui/block/Preformatted.d.ts +5 -0
  55. package/ui/block/Preformatted.js +5 -0
  56. package/ui/block/Preformatted.module.css +23 -0
  57. package/ui/block/Preformatted.tsx +10 -0
  58. package/ui/block/Prose.d.ts +6 -0
  59. package/ui/block/Prose.js +28 -0
  60. package/ui/block/Prose.module.css +15 -0
  61. package/ui/block/Prose.tsx +56 -0
  62. package/ui/block/Section.d.ts +28 -0
  63. package/ui/block/Section.js +26 -0
  64. package/ui/block/Section.module.css +28 -0
  65. package/ui/block/Section.tsx +53 -0
  66. package/ui/block/Subheading.d.ts +3 -0
  67. package/ui/block/Subheading.js +7 -0
  68. package/ui/block/Subheading.module.css +23 -0
  69. package/ui/block/Subheading.tsx +10 -0
  70. package/ui/block/Table.d.ts +5 -0
  71. package/ui/block/Table.js +5 -0
  72. package/ui/block/Table.module.css +85 -0
  73. package/ui/block/Table.tsx +14 -0
  74. package/ui/block/Video.d.ts +36 -0
  75. package/ui/block/Video.js +43 -0
  76. package/ui/block/Video.module.css +103 -0
  77. package/ui/block/Video.tsx +91 -0
  78. package/ui/block/index.d.ts +17 -0
  79. package/ui/block/index.js +17 -0
  80. package/ui/block/index.ts +17 -0
  81. package/ui/dialog/Dialog.d.ts +13 -0
  82. package/ui/dialog/Dialog.js +28 -0
  83. package/ui/dialog/Dialog.module.css +29 -0
  84. package/ui/dialog/Dialog.tsx +57 -0
  85. package/ui/dialog/Dialogs.d.ts +23 -0
  86. package/ui/dialog/Dialogs.js +43 -0
  87. package/ui/dialog/Dialogs.tsx +64 -0
  88. package/ui/dialog/Modal.d.ts +5 -0
  89. package/ui/dialog/Modal.js +5 -0
  90. package/ui/dialog/Modal.module.css +11 -0
  91. package/ui/dialog/Modal.tsx +10 -0
  92. package/ui/dialog/index.d.ts +3 -0
  93. package/ui/dialog/index.js +3 -0
  94. package/ui/dialog/index.ts +3 -0
  95. package/ui/form/ArrayInput.d.ts +13 -0
  96. package/ui/form/ArrayInput.js +23 -0
  97. package/ui/form/ArrayInput.tsx +90 -0
  98. package/ui/form/ArrayRadioInputs.d.ts +15 -0
  99. package/ui/form/ArrayRadioInputs.js +16 -0
  100. package/ui/form/ArrayRadioInputs.tsx +53 -0
  101. package/ui/form/Button.d.ts +24 -0
  102. package/ui/form/Button.js +21 -0
  103. package/ui/form/Button.module.css +83 -0
  104. package/ui/form/Button.tsx +48 -0
  105. package/ui/form/ButtonInput.d.ts +7 -0
  106. package/ui/form/ButtonInput.js +19 -0
  107. package/ui/form/ButtonInput.tsx +33 -0
  108. package/ui/form/ButtonInputPopover.d.ts +16 -0
  109. package/ui/form/ButtonInputPopover.js +17 -0
  110. package/ui/form/ButtonInputPopover.tsx +32 -0
  111. package/ui/form/ButtonPopover.d.ts +16 -0
  112. package/ui/form/ButtonPopover.js +17 -0
  113. package/ui/form/ButtonPopover.tsx +31 -0
  114. package/ui/form/CheckboxInput.d.ts +7 -0
  115. package/ui/form/CheckboxInput.js +8 -0
  116. package/ui/form/CheckboxInput.tsx +37 -0
  117. package/ui/form/ChoiceRadioInputs.d.ts +17 -0
  118. package/ui/form/ChoiceRadioInputs.js +13 -0
  119. package/ui/form/ChoiceRadioInputs.tsx +60 -0
  120. package/ui/form/Clickable.d.ts +27 -0
  121. package/ui/form/Clickable.js +29 -0
  122. package/ui/form/Clickable.tsx +87 -0
  123. package/ui/form/DataInput.d.ts +9 -0
  124. package/ui/form/DataInput.js +17 -0
  125. package/ui/form/DataInput.tsx +43 -0
  126. package/ui/form/DateInput.d.ts +12 -0
  127. package/ui/form/DateInput.js +17 -0
  128. package/ui/form/DateInput.tsx +58 -0
  129. package/ui/form/DictionaryInput.d.ts +13 -0
  130. package/ui/form/DictionaryInput.js +32 -0
  131. package/ui/form/DictionaryInput.tsx +106 -0
  132. package/ui/form/Field.d.ts +10 -0
  133. package/ui/form/Field.js +7 -0
  134. package/ui/form/Field.module.css +45 -0
  135. package/ui/form/Field.test.tsx +26 -0
  136. package/ui/form/Field.tsx +32 -0
  137. package/ui/form/FileInput.d.ts +7 -0
  138. package/ui/form/FileInput.js +13 -0
  139. package/ui/form/FileInput.tsx +41 -0
  140. package/ui/form/Form.d.ts +38 -0
  141. package/ui/form/Form.js +61 -0
  142. package/ui/form/Form.module.css +9 -0
  143. package/ui/form/Form.tsx +130 -0
  144. package/ui/form/FormContext.d.ts +13 -0
  145. package/ui/form/FormContext.js +22 -0
  146. package/ui/form/FormContext.tsx +33 -0
  147. package/ui/form/FormFields.d.ts +6 -0
  148. package/ui/form/FormFields.js +16 -0
  149. package/ui/form/FormFields.tsx +30 -0
  150. package/ui/form/FormFooter.d.ts +11 -0
  151. package/ui/form/FormFooter.js +13 -0
  152. package/ui/form/FormFooter.tsx +27 -0
  153. package/ui/form/FormInput.d.ts +8 -0
  154. package/ui/form/FormInput.js +12 -0
  155. package/ui/form/FormInput.tsx +23 -0
  156. package/ui/form/FormMessage.d.ts +4 -0
  157. package/ui/form/FormMessage.js +11 -0
  158. package/ui/form/FormMessage.tsx +16 -0
  159. package/ui/form/FormNotice.d.ts +4 -0
  160. package/ui/form/FormNotice.js +11 -0
  161. package/ui/form/FormNotice.tsx +16 -0
  162. package/ui/form/FormNotify.d.ts +2 -0
  163. package/ui/form/FormNotify.js +11 -0
  164. package/ui/form/FormNotify.tsx +13 -0
  165. package/ui/form/FormStore.d.ts +39 -0
  166. package/ui/form/FormStore.js +95 -0
  167. package/ui/form/FormStore.tsx +107 -0
  168. package/ui/form/Input.d.ts +47 -0
  169. package/ui/form/Input.js +43 -0
  170. package/ui/form/Input.module.css +190 -0
  171. package/ui/form/Input.tsx +81 -0
  172. package/ui/form/NumberInput.d.ts +12 -0
  173. package/ui/form/NumberInput.js +18 -0
  174. package/ui/form/NumberInput.tsx +54 -0
  175. package/ui/form/Popover.d.ts +31 -0
  176. package/ui/form/Popover.js +20 -0
  177. package/ui/form/Popover.module.css +25 -0
  178. package/ui/form/Popover.tsx +61 -0
  179. package/ui/form/Progress.d.ts +9 -0
  180. package/ui/form/Progress.js +8 -0
  181. package/ui/form/Progress.module.css +30 -0
  182. package/ui/form/Progress.tsx +21 -0
  183. package/ui/form/QueryInput.d.ts +32 -0
  184. package/ui/form/QueryInput.js +37 -0
  185. package/ui/form/QueryInput.tsx +94 -0
  186. package/ui/form/RadioInput.d.ts +7 -0
  187. package/ui/form/RadioInput.js +8 -0
  188. package/ui/form/RadioInput.tsx +37 -0
  189. package/ui/form/SchemaInput.d.ts +59 -0
  190. package/ui/form/SchemaInput.js +102 -0
  191. package/ui/form/SchemaInput.tsx +154 -0
  192. package/ui/form/SegmentedProgress.d.ts +10 -0
  193. package/ui/form/SegmentedProgress.js +16 -0
  194. package/ui/form/SegmentedProgress.module.css +31 -0
  195. package/ui/form/SegmentedProgress.tsx +34 -0
  196. package/ui/form/SelectInput.d.ts +8 -0
  197. package/ui/form/SelectInput.js +6 -0
  198. package/ui/form/SelectInput.tsx +45 -0
  199. package/ui/form/SubmitButton.d.ts +7 -0
  200. package/ui/form/SubmitButton.js +15 -0
  201. package/ui/form/SubmitButton.tsx +38 -0
  202. package/ui/form/TextInput.d.ts +16 -0
  203. package/ui/form/TextInput.js +31 -0
  204. package/ui/form/TextInput.tsx +97 -0
  205. package/ui/form/index.d.ts +34 -0
  206. package/ui/form/index.js +34 -0
  207. package/ui/form/index.ts +34 -0
  208. package/ui/index.d.ts +12 -0
  209. package/ui/index.js +12 -0
  210. package/ui/index.ts +12 -0
  211. package/ui/inline/Code.d.ts +17 -0
  212. package/ui/inline/Code.js +14 -0
  213. package/ui/inline/Code.module.css +14 -0
  214. package/ui/inline/Code.tsx +34 -0
  215. package/ui/inline/Deleted.d.ts +5 -0
  216. package/ui/inline/Deleted.js +5 -0
  217. package/ui/inline/Deleted.module.css +9 -0
  218. package/ui/inline/Deleted.tsx +10 -0
  219. package/ui/inline/Emphasis.d.ts +5 -0
  220. package/ui/inline/Emphasis.js +5 -0
  221. package/ui/inline/Emphasis.module.css +5 -0
  222. package/ui/inline/Emphasis.tsx +10 -0
  223. package/ui/inline/Inserted.d.ts +5 -0
  224. package/ui/inline/Inserted.js +5 -0
  225. package/ui/inline/Inserted.module.css +9 -0
  226. package/ui/inline/Inserted.tsx +10 -0
  227. package/ui/inline/Link.d.ts +5 -0
  228. package/ui/inline/Link.js +5 -0
  229. package/ui/inline/Link.module.css +19 -0
  230. package/ui/inline/Link.tsx +9 -0
  231. package/ui/inline/Mark.d.ts +5 -0
  232. package/ui/inline/Mark.js +5 -0
  233. package/ui/inline/Mark.module.css +15 -0
  234. package/ui/inline/Mark.tsx +10 -0
  235. package/ui/inline/Small.d.ts +5 -0
  236. package/ui/inline/Small.js +5 -0
  237. package/ui/inline/Small.module.css +9 -0
  238. package/ui/inline/Small.tsx +10 -0
  239. package/ui/inline/Strong.d.ts +5 -0
  240. package/ui/inline/Strong.js +5 -0
  241. package/ui/inline/Strong.module.css +5 -0
  242. package/ui/inline/Strong.tsx +10 -0
  243. package/ui/inline/Subscript.d.ts +5 -0
  244. package/ui/inline/Subscript.js +5 -0
  245. package/ui/inline/Subscript.module.css +9 -0
  246. package/ui/inline/Subscript.tsx +10 -0
  247. package/ui/inline/Superscript.d.ts +5 -0
  248. package/ui/inline/Superscript.js +5 -0
  249. package/ui/inline/Superscript.module.css +9 -0
  250. package/ui/inline/Superscript.tsx +10 -0
  251. package/ui/inline/When.d.ts +18 -0
  252. package/ui/inline/When.js +24 -0
  253. package/ui/inline/When.tsx +49 -0
  254. package/ui/inline/index.d.ts +11 -0
  255. package/ui/inline/index.js +11 -0
  256. package/ui/inline/index.ts +11 -0
  257. package/ui/layout/CenteredLayout.d.ts +10 -0
  258. package/ui/layout/CenteredLayout.js +11 -0
  259. package/ui/layout/CenteredLayout.module.css +13 -0
  260. package/ui/layout/CenteredLayout.tsx +23 -0
  261. package/ui/layout/Layout.d.ts +9 -0
  262. package/ui/layout/Layout.js +25 -0
  263. package/ui/layout/Layout.module.css +64 -0
  264. package/ui/layout/Layout.ts +26 -0
  265. package/ui/layout/index.d.ts +2 -0
  266. package/ui/layout/index.js +2 -0
  267. package/ui/layout/index.tsx +2 -0
  268. package/ui/misc/Catcher.d.ts +45 -0
  269. package/ui/misc/Catcher.js +57 -0
  270. package/ui/misc/Catcher.tsx +114 -0
  271. package/ui/misc/Loading.d.ts +8 -0
  272. package/ui/misc/Loading.js +6 -0
  273. package/ui/misc/Loading.module.css +19 -0
  274. package/ui/misc/Loading.tsx +31 -0
  275. package/ui/misc/Meta.d.ts +9 -0
  276. package/ui/misc/Meta.js +14 -0
  277. package/ui/misc/Meta.tsx +20 -0
  278. package/ui/misc/index.d.ts +3 -0
  279. package/ui/misc/index.js +3 -0
  280. package/ui/misc/index.tsx +3 -0
  281. package/ui/notice/Message.d.ts +11 -0
  282. package/ui/notice/Message.js +12 -0
  283. package/ui/notice/Message.module.css +8 -0
  284. package/ui/notice/Message.tsx +30 -0
  285. package/ui/notice/Notice.d.ts +15 -0
  286. package/ui/notice/Notice.js +13 -0
  287. package/ui/notice/Notice.module.css +15 -0
  288. package/ui/notice/Notice.tsx +42 -0
  289. package/ui/notice/NoticeStore.d.ts +21 -0
  290. package/ui/notice/NoticeStore.js +44 -0
  291. package/ui/notice/NoticeStore.ts +60 -0
  292. package/ui/notice/Notices.d.ts +7 -0
  293. package/ui/notice/Notices.js +22 -0
  294. package/ui/notice/Notices.module.css +10 -0
  295. package/ui/notice/Notices.tsx +28 -0
  296. package/ui/notice/NoticesStore.d.ts +11 -0
  297. package/ui/notice/NoticesStore.js +16 -0
  298. package/ui/notice/NoticesStore.ts +23 -0
  299. package/ui/notice/README.md +40 -0
  300. package/ui/notice/Status.d.ts +29 -0
  301. package/ui/notice/Status.js +6 -0
  302. package/ui/notice/Status.module.css +79 -0
  303. package/ui/notice/Status.tsx +36 -0
  304. package/ui/notice/StatusIcon.d.ts +12 -0
  305. package/ui/notice/StatusIcon.js +19 -0
  306. package/ui/notice/StatusIcon.module.css +28 -0
  307. package/ui/notice/StatusIcon.tsx +33 -0
  308. package/ui/notice/index.d.ts +7 -0
  309. package/ui/notice/index.js +7 -0
  310. package/ui/notice/index.ts +7 -0
  311. package/ui/page/Head.d.ts +8 -0
  312. package/ui/page/Head.js +32 -0
  313. package/ui/page/Head.tsx +49 -0
  314. package/ui/page/Page.d.ts +10 -0
  315. package/ui/page/Page.js +10 -0
  316. package/ui/page/Page.tsx +21 -0
  317. package/ui/page/index.d.ts +2 -0
  318. package/ui/page/index.js +2 -0
  319. package/ui/page/index.ts +2 -0
  320. package/ui/router/Router.d.ts +31 -0
  321. package/ui/router/Router.js +59 -0
  322. package/ui/router/Router.tsx +88 -0
  323. package/ui/router/RouterContext.d.ts +5 -0
  324. package/ui/router/RouterContext.js +9 -0
  325. package/ui/router/RouterContext.tsx +12 -0
  326. package/ui/router/RouterStore.d.ts +13 -0
  327. package/ui/router/RouterStore.js +23 -0
  328. package/ui/router/RouterStore.test.tsx +43 -0
  329. package/ui/router/RouterStore.tsx +29 -0
  330. package/ui/router/Routes.d.ts +39 -0
  331. package/ui/router/Routes.js +35 -0
  332. package/ui/router/Routes.tsx +62 -0
  333. package/ui/router/index.d.ts +4 -0
  334. package/ui/router/index.js +4 -0
  335. package/ui/router/index.ts +4 -0
  336. package/ui/transition/CollapseTransition.css +3 -0
  337. package/ui/transition/CollapseTransition.d.ts +6 -0
  338. package/ui/transition/CollapseTransition.js +6 -0
  339. package/ui/transition/CollapseTransition.tsx +9 -0
  340. package/ui/transition/FadeTransition.css +25 -0
  341. package/ui/transition/FadeTransition.d.ts +5 -0
  342. package/ui/transition/FadeTransition.js +5 -0
  343. package/ui/transition/FadeTransition.tsx +8 -0
  344. package/ui/transition/HorizontalTransition.css +66 -0
  345. package/ui/transition/HorizontalTransition.d.ts +6 -0
  346. package/ui/transition/HorizontalTransition.js +6 -0
  347. package/ui/transition/HorizontalTransition.tsx +9 -0
  348. package/ui/transition/Transition.css +3 -0
  349. package/ui/transition/Transition.d.ts +18 -0
  350. package/ui/transition/Transition.js +21 -0
  351. package/ui/transition/Transition.tsx +35 -0
  352. package/ui/transition/VerticalTransition.css +66 -0
  353. package/ui/transition/VerticalTransition.d.ts +6 -0
  354. package/ui/transition/VerticalTransition.js +6 -0
  355. package/ui/transition/VerticalTransition.tsx +9 -0
  356. package/ui/transition/index.d.ts +6 -0
  357. package/ui/transition/index.js +6 -0
  358. package/ui/transition/index.tsx +6 -0
  359. package/ui/transition/util.d.ts +17 -0
  360. package/ui/transition/util.js +6 -0
  361. package/ui/transition/util.tsx +24 -0
  362. package/ui/types.d.ts +9 -0
  363. package/ui/util/context.d.ts +6 -0
  364. package/ui/util/context.js +10 -0
  365. package/ui/util/context.ts +15 -0
  366. package/ui/util/css.d.ts +37 -0
  367. package/ui/util/css.js +63 -0
  368. package/ui/util/css.ts +80 -0
  369. package/ui/util/event.d.ts +2 -0
  370. package/ui/util/event.js +4 -0
  371. package/ui/util/event.ts +4 -0
  372. package/ui/util/focus.d.ts +16 -0
  373. package/ui/util/focus.js +21 -0
  374. package/ui/util/focus.ts +23 -0
  375. package/ui/util/index.d.ts +8 -0
  376. package/ui/util/index.js +8 -0
  377. package/ui/util/index.ts +8 -0
  378. package/ui/util/meta.d.ts +67 -0
  379. package/ui/util/meta.js +33 -0
  380. package/ui/util/meta.ts +97 -0
  381. package/ui/util/notice.d.ts +26 -0
  382. package/ui/util/notice.js +82 -0
  383. package/ui/util/notice.ts +103 -0
  384. package/ui/util/refresh.d.ts +2 -0
  385. package/ui/util/refresh.js +9 -0
  386. package/ui/util/refresh.ts +11 -0
  387. package/ui/util/scroll.d.ts +11 -0
  388. package/ui/util/scroll.js +32 -0
  389. package/ui/util/scroll.ts +40 -0
  390. package/ui/util/state.d.ts +11 -0
  391. package/ui/util/state.js +42 -0
  392. package/ui/util/state.ts +44 -0
  393. package/util/index.d.ts +1 -0
  394. package/util/index.js +1 -0
@@ -0,0 +1,28 @@
1
+ .section {
2
+ /* Box */
3
+ position: relative;
4
+ display: block;
5
+ margin-inline: 0;
6
+ margin-block: var(--section-spacing, var(--spacing-block));
7
+
8
+ /* Psuedo-classes */
9
+ &:first-child {
10
+ margin-block-start: 0;
11
+ }
12
+ &:last-child {
13
+ margin-block-end: 0;
14
+ }
15
+
16
+ /* Variants */
17
+ &.narrow {
18
+ margin-inline: auto;
19
+ max-width: var(--section-width-narrow, var(--width-narrow));
20
+ }
21
+ &.wide {
22
+ margin-inline: auto;
23
+ max-width: var(--section-width-wide, var(--width-wide));
24
+ }
25
+ &.spacious {
26
+ margin-block: var(--paragraph-spacious-spacing, var(--spacing-spacious));
27
+ }
28
+ }
@@ -0,0 +1,53 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import { getModuleClass } from "../util/css.js";
3
+ import styles from "./Section.module.css";
4
+
5
+ export interface SectionProps {
6
+ children?: ReactNode;
7
+ /** Constrain the section to narrow width (defaults to full-width). */
8
+ narrow?: boolean;
9
+ /** Constrain the section to wide width (defaults to full-width). */
10
+ wide?: boolean;
11
+ /** Constrain the section to spacious spacing (defaults to full-width). */
12
+ spacious?: boolean;
13
+ }
14
+
15
+ function renderSection(
16
+ Component: "header" | "footer" | "nav" | "section" | "aside",
17
+ { children, ...variants }: SectionProps,
18
+ ): ReactElement {
19
+ return <Component className={getModuleClass(styles, "section", variants)}>{children}</Component>;
20
+ }
21
+
22
+ export interface HeaderProps extends SectionProps {}
23
+
24
+ /** A single HTML `<header>` with correct spacing. */
25
+ export function Header(props: HeaderProps): ReactElement {
26
+ return renderSection("header", props);
27
+ }
28
+
29
+ /** A single HTML `<section>` with correct spacing. */
30
+ export function Section(props: SectionProps): ReactElement {
31
+ return renderSection("section", props);
32
+ }
33
+
34
+ export interface NavigationProps extends SectionProps {}
35
+
36
+ /** A single HTML `<nav>` with correct spacing. */
37
+ export function Navigation(props: NavigationProps): ReactElement {
38
+ return renderSection("nav", props);
39
+ }
40
+
41
+ export interface AsideProps extends SectionProps {}
42
+
43
+ /** A single HTML `<aside>` with correct spacing. */
44
+ export function Aside(props: AsideProps): ReactElement {
45
+ return renderSection("aside", props);
46
+ }
47
+
48
+ export interface FooterProps extends SectionProps {}
49
+
50
+ /** A single HTML `<footer>` with correct spacing. */
51
+ export function Footer(props: FooterProps): ReactElement {
52
+ return renderSection("footer", props);
53
+ }
@@ -0,0 +1,3 @@
1
+ import type { HeadingProps } from "./Heading.js";
2
+ export type SubheadingProps = HeadingProps;
3
+ export declare function Subheading({ level, children, ...variants }: SubheadingProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { getModuleClass } from "../util/css.js";
3
+ import styles from "./Subheading.module.css";
4
+ export function Subheading({ level = "2", children, ...variants }) {
5
+ const Element = `h${level}`;
6
+ return _jsx(Element, { className: getModuleClass(styles, "subheading", variants), children: children });
7
+ }
@@ -0,0 +1,23 @@
1
+ .subheading,
2
+ .prose :is(h2, h3, h4, h5, h6) {
3
+ /* Box */
4
+ display: block;
5
+ inline-size: 100%;
6
+ margin-inline: 0;
7
+ margin-block: var(--subheading-spacing, var(--spacing-paragraph));
8
+
9
+ /* Style */
10
+ font-family: var(--subheading-font, var(--font-body));
11
+ font-weight: var(--subheading-weight, var(--weight-strong));
12
+ font-size: var(--subheading-font-size, var(--size-large));
13
+ line-height: var(--subheading-leading, var(--leading-tight));
14
+ color: var(--subheading-color, var(--color-text));
15
+
16
+ /* Psuedo-classes */
17
+ &:first-child {
18
+ margin-block-start: 0;
19
+ }
20
+ &:last-child {
21
+ margin-block-end: 0;
22
+ }
23
+ }
@@ -0,0 +1,10 @@
1
+ import { getModuleClass } from "../util/css.js";
2
+ import type { HeadingProps } from "./Heading.js";
3
+ import styles from "./Subheading.module.css";
4
+
5
+ export type SubheadingProps = HeadingProps;
6
+
7
+ export function Subheading({ level = "2", children, ...variants }: SubheadingProps) {
8
+ const Element: `h${typeof level}` = `h${level}`;
9
+ return <Element className={getModuleClass(styles, "subheading", variants)}>{children}</Element>;
10
+ }
@@ -0,0 +1,5 @@
1
+ import type { ReactNode } from "react";
2
+ export interface TableProps {
3
+ children: ReactNode;
4
+ }
5
+ export declare function Table({ children }: TableProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import styles from "./Table.module.css";
3
+ export function Table({ children }) {
4
+ return (_jsx("div", { className: styles.wrap, children: _jsx("table", { className: styles.table, children: children }) }));
5
+ }
@@ -0,0 +1,85 @@
1
+ .table,
2
+ .prose table {
3
+ /* Box */
4
+ display: table;
5
+ margin-inline: 0;
6
+ margin-block: var(--table-spacing, var(--spacing-block));
7
+
8
+ /* Contents */
9
+ text-indent: 0;
10
+
11
+ /* Style */
12
+ border-color: inherit;
13
+ border-collapse: collapse;
14
+ text-align: left;
15
+
16
+ /* Pseudo-classes */
17
+ &:first-child {
18
+ margin-block-start: 0;
19
+ }
20
+ &:last-child {
21
+ margin-block-end: 0;
22
+ }
23
+
24
+ /* Children */
25
+ th,
26
+ td {
27
+ padding-block: var(--table-padding, var(--spacing-inline));
28
+ padding-inline: var(--table-padding, var(--spacing-inline));
29
+ border-block: var(--table-border, var(--border-block)) solid var(--table-color-border, var(--color-border));
30
+ }
31
+ th:first-child,
32
+ td:first-child {
33
+ padding-inline-start: 0;
34
+ }
35
+ th:last-child,
36
+ td:last-child {
37
+ padding-inline-end: 0;
38
+ }
39
+ thead,
40
+ tbody th,
41
+ tfoot {
42
+ font-weight: var(--table-header-weight, var(--weight-strong));
43
+ }
44
+ thead th,
45
+ thead td {
46
+ padding-block-start: 0;
47
+ border: 0;
48
+ }
49
+ tfoot th,
50
+ tfoot td {
51
+ padding-block-end: 0;
52
+ border: 0;
53
+ }
54
+ thead th,
55
+ tfoot th {
56
+ color: var(--table-label-color, var(--color-quiet));
57
+ font-weight: var(--table-label-weight, var(--weight-strong));
58
+ font-size: var(--table-label-size, var(--size-small));
59
+ }
60
+ }
61
+
62
+ .wrap {
63
+ /* Box */
64
+ display: block;
65
+ margin-block: var(--table-spacing, var(--spacing-block));
66
+ margin-inline: calc(var(--spacing-block) * -1);
67
+ padding-inline: var(--spacing-block);
68
+
69
+ /* Contents */
70
+ overflow-x: auto;
71
+ white-space: nowrap;
72
+
73
+ /* Psuedo-classes */
74
+ &:first-child {
75
+ margin-block-start: 0;
76
+ }
77
+ &:last-child {
78
+ margin-block-end: 0;
79
+ }
80
+
81
+ /* Children */
82
+ .table {
83
+ min-width: 100%;
84
+ }
85
+ }
@@ -0,0 +1,14 @@
1
+ import type { ReactNode } from "react";
2
+ import styles from "./Table.module.css";
3
+
4
+ export interface TableProps {
5
+ children: ReactNode;
6
+ }
7
+
8
+ export function Table({ children }: TableProps) {
9
+ return (
10
+ <div className={styles.wrap}>
11
+ <table className={styles.table}>{children}</table>
12
+ </div>
13
+ );
14
+ }
@@ -0,0 +1,36 @@
1
+ import { type MouseEvent, type ReactElement, type ReactNode } from "react";
2
+ export interface VideoProps {
3
+ children?: ReactNode;
4
+ /** Constrain the video to narrow width (defaults to full-width). */
5
+ narrow?: boolean;
6
+ /** Constrain the video to wide width (defaults to full-width). */
7
+ wide?: boolean;
8
+ }
9
+ export interface VideoButtonsProps {
10
+ children: ReactNode;
11
+ left?: boolean;
12
+ }
13
+ export interface VideoButtonProps {
14
+ children: ReactNode;
15
+ title?: string | undefined;
16
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
17
+ danger?: boolean;
18
+ disabled?: boolean;
19
+ }
20
+ /**
21
+ * Video container element.
22
+ * - Has a black background and a 16:9 aspect ratio.
23
+ * - Shows its contents (i.e. a `<video>` element or a `<TwilioRoom>`.
24
+ */
25
+ export declare function Video({ children, ...variants }: VideoProps): ReactElement;
26
+ /** Set of video buttons floating over a video. */
27
+ export declare function VideoButtons({ children, ...variants }: VideoButtonsProps): import("react/jsx-runtime").JSX.Element;
28
+ /** Individual video button over a video. */
29
+ export declare function VideoButton({ children, title, onClick, disabled, ...variants }: VideoButtonProps): ReactElement;
30
+ declare const _fullscreenVideoButtonProps: unique symbol;
31
+ export interface FullscreenVideoButtonProps {
32
+ readonly [_fullscreenVideoButtonProps]?: never;
33
+ }
34
+ /** Button to make a video element go fullscreen. */
35
+ export declare function FullscreenVideoButton(): ReactElement | null;
36
+ export {};
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ArrowsPointingInIcon, ArrowsPointingOutIcon } from "@heroicons/react/24/solid";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { getModuleClass } from "../util/css.js";
5
+ import styles from "./Video.module.css";
6
+ /**
7
+ * Video container element.
8
+ * - Has a black background and a 16:9 aspect ratio.
9
+ * - Shows its contents (i.e. a `<video>` element or a `<TwilioRoom>`.
10
+ */
11
+ export function Video({ children, ...variants }) {
12
+ const ref = useRef(null);
13
+ return (_jsx("figure", { ref: ref, className: getModuleClass(styles, "video", variants), children: children }));
14
+ }
15
+ /** Set of video buttons floating over a video. */
16
+ export function VideoButtons({ children, ...variants }) {
17
+ return _jsx("div", { className: getModuleClass(styles, "buttons", variants), children: children });
18
+ }
19
+ /** Individual video button over a video. */
20
+ export function VideoButton({ children, title, onClick, disabled, ...variants }) {
21
+ return (_jsx("button", { type: "button", onClick: onClick, className: getModuleClass(styles, "button", variants), title: title, disabled: disabled, children: children }));
22
+ }
23
+ /** Button to make a video element go fullscreen. */
24
+ export function FullscreenVideoButton() {
25
+ const [isFull, setFull] = useState(!!document.fullscreenElement);
26
+ useEffect(() => {
27
+ const onChange = () => setFull(!!document.fullscreenElement);
28
+ document.addEventListener("fullscreenchange", onChange);
29
+ return () => document.removeEventListener("fullscreenchange", onChange);
30
+ });
31
+ if (!document.fullscreenEnabled)
32
+ return null;
33
+ return (_jsx(VideoButton, { title: isFull ? "Exit full screen mode" : "Enter full screen mode", onClick: ({ currentTarget }) => {
34
+ if (document.fullscreenElement) {
35
+ document.exitFullscreen();
36
+ }
37
+ else {
38
+ const parent = currentTarget.closest("figure, video");
39
+ if (parent)
40
+ parent.requestFullscreen();
41
+ }
42
+ }, children: isFull ? _jsx(ArrowsPointingInIcon, {}) : _jsx(ArrowsPointingOutIcon, {}) }));
43
+ }
@@ -0,0 +1,103 @@
1
+ .video {
2
+ /* Block */
3
+ aspect-ratio: 16 / 9;
4
+ margin-inline: 0;
5
+ margin-block: var(--video-spacing, var(--spacing-block));
6
+
7
+ /* Contents */
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: var(--video-gap, var(--spacing-block));
11
+ justify-content: center;
12
+ align-items: center;
13
+ position: relative;
14
+
15
+ /* Style */
16
+ background: var(--video-color-bg, var(--color-black));
17
+ color: var(--video-color-text, var(--color-white));
18
+ overflow: hidden;
19
+ border-radius: var(--video-radius, var(--radius-element));
20
+
21
+ &.narrow {
22
+ margin-inline: auto;
23
+ max-width: var(--section-width-narrow, var(--width-narrow));
24
+ }
25
+
26
+ &.wide {
27
+ margin-inline: auto;
28
+ max-width: var(--section-width-wide, var(--width-wide));
29
+ }
30
+
31
+ &:first-child {
32
+ margin-block-start: 0;
33
+ }
34
+
35
+ &:last-child {
36
+ margin-block-end: 0;
37
+ }
38
+
39
+ &:fullscreen {
40
+ border-radius: 0;
41
+ }
42
+ }
43
+
44
+ .buttons {
45
+ position: absolute;
46
+ top: var(--video-controls-offset-y, var(--spacing-block));
47
+ right: var(--video-controls-offset-x, var(--spacing-block));
48
+ display: flex;
49
+ gap: var(--video-controls-gap, var(--spacing-element));
50
+
51
+ &.left {
52
+ right: auto;
53
+ left: var(--video-controls-offset-x, var(--spacing-block));
54
+ }
55
+ }
56
+
57
+ .button {
58
+ display: inline-flex;
59
+ flex-direction: row;
60
+ gap: var(--video-control-gap, var(--spacing-element));
61
+ height: var(--video-control-size, 3rem);
62
+ min-width: var(--video-control-size, 3rem);
63
+ padding-inline: var(--video-control-padding-x, var(--spacing-inline));
64
+ align-items: center;
65
+ justify-content: center;
66
+ border-radius: var(--video-control-radius, 100rem);
67
+ border: var(--video-control-border, var(--border-block)) solid transparent;
68
+ color: var(--video-color-control-text, var(--video-color-bg, var(--color-black)));
69
+ background: var(--video-color-control-bg, var(--video-color-text, var(--color-white)));
70
+ transition:
71
+ box-shadow var(--duration-fast) ease-in-out,
72
+ background-color var(--duration-fast) ease-in-out,
73
+ border-color var(--duration-fast) ease-in-out;
74
+
75
+ &:hover {
76
+ box-shadow: var(--video-control-shadow-hover, var(--shadow-element));
77
+ background: var(--video-color-control-hover-bg, color-mix(in srgb, var(--color-quiet) 20%, transparent));
78
+ }
79
+
80
+ &:disabled {
81
+ opacity: var(--video-control-disabled-opacity, 0.5);
82
+ cursor: default;
83
+ }
84
+
85
+ &.danger {
86
+ border-color: var(--video-color-danger-border, var(--error-text));
87
+ background: var(--video-color-danger-bg, var(--error-text));
88
+ color: var(--video-color-danger-text, var(--error-contrast));
89
+ }
90
+
91
+ &.danger:hover {
92
+ background: var(--video-color-danger-hover-bg, color-mix(in srgb, var(--video-color-danger-bg, var(--error-text)) 80%, white));
93
+ border-color: var(
94
+ --video-color-danger-hover-border,
95
+ color-mix(in srgb, var(--video-color-danger-border, var(--error-text)) 80%, white)
96
+ );
97
+ }
98
+
99
+ & svg {
100
+ width: 1.5rem;
101
+ height: 1.5rem;
102
+ }
103
+ }
@@ -0,0 +1,91 @@
1
+ import { ArrowsPointingInIcon, ArrowsPointingOutIcon } from "@heroicons/react/24/solid";
2
+ import { type MouseEvent, type ReactElement, type ReactNode, useEffect, useRef, useState } from "react";
3
+ import { getModuleClass } from "../util/css.js";
4
+ import styles from "./Video.module.css";
5
+
6
+ export interface VideoProps {
7
+ children?: ReactNode;
8
+
9
+ /** Constrain the video to narrow width (defaults to full-width). */
10
+ narrow?: boolean;
11
+
12
+ /** Constrain the video to wide width (defaults to full-width). */
13
+ wide?: boolean;
14
+ }
15
+
16
+ export interface VideoButtonsProps {
17
+ children: ReactNode;
18
+ left?: boolean;
19
+ }
20
+
21
+ export interface VideoButtonProps {
22
+ children: ReactNode;
23
+ title?: string | undefined;
24
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
25
+ danger?: boolean;
26
+ disabled?: boolean;
27
+ }
28
+
29
+ /**
30
+ * Video container element.
31
+ * - Has a black background and a 16:9 aspect ratio.
32
+ * - Shows its contents (i.e. a `<video>` element or a `<TwilioRoom>`.
33
+ */
34
+ export function Video({ children, ...variants }: VideoProps): ReactElement {
35
+ const ref = useRef<HTMLElement | null>(null);
36
+
37
+ return (
38
+ <figure ref={ref} className={getModuleClass(styles, "video", variants)}>
39
+ {children}
40
+ </figure>
41
+ );
42
+ }
43
+
44
+ /** Set of video buttons floating over a video. */
45
+ export function VideoButtons({ children, ...variants }: VideoButtonsProps) {
46
+ return <div className={getModuleClass(styles, "buttons", variants)}>{children}</div>;
47
+ }
48
+
49
+ /** Individual video button over a video. */
50
+ export function VideoButton({ children, title, onClick, disabled, ...variants }: VideoButtonProps): ReactElement {
51
+ return (
52
+ <button type="button" onClick={onClick} className={getModuleClass(styles, "button", variants)} title={title} disabled={disabled}>
53
+ {children}
54
+ </button>
55
+ );
56
+ }
57
+
58
+ declare const _fullscreenVideoButtonProps: unique symbol;
59
+
60
+ export interface FullscreenVideoButtonProps {
61
+ readonly [_fullscreenVideoButtonProps]?: never;
62
+ }
63
+
64
+ /** Button to make a video element go fullscreen. */
65
+ export function FullscreenVideoButton(): ReactElement | null {
66
+ const [isFull, setFull] = useState(!!document.fullscreenElement);
67
+
68
+ useEffect(() => {
69
+ const onChange = () => setFull(!!document.fullscreenElement);
70
+ document.addEventListener("fullscreenchange", onChange);
71
+ return () => document.removeEventListener("fullscreenchange", onChange);
72
+ });
73
+
74
+ if (!document.fullscreenEnabled) return null;
75
+
76
+ return (
77
+ <VideoButton
78
+ title={isFull ? "Exit full screen mode" : "Enter full screen mode"}
79
+ onClick={({ currentTarget }) => {
80
+ if (document.fullscreenElement) {
81
+ document.exitFullscreen();
82
+ } else {
83
+ const parent = currentTarget.closest("figure, video");
84
+ if (parent) parent.requestFullscreen();
85
+ }
86
+ }}
87
+ >
88
+ {isFull ? <ArrowsPointingInIcon /> : <ArrowsPointingOutIcon />}
89
+ </VideoButton>
90
+ );
91
+ }
@@ -0,0 +1,17 @@
1
+ export * from "./Address.js";
2
+ export * from "./Blockquote.js";
3
+ export * from "./Card.js";
4
+ export * from "./Divider.js";
5
+ export * from "./Element.js";
6
+ export * from "./Elements.js";
7
+ export * from "./Figure.js";
8
+ export * from "./Heading.js";
9
+ export * from "./Image.js";
10
+ export * from "./List.js";
11
+ export * from "./Paragraph.js";
12
+ export * from "./Preformatted.js";
13
+ export * from "./Prose.js";
14
+ export * from "./Section.js";
15
+ export * from "./Subheading.js";
16
+ export * from "./Table.js";
17
+ export * from "./Video.js";
@@ -0,0 +1,17 @@
1
+ export * from "./Address.js";
2
+ export * from "./Blockquote.js";
3
+ export * from "./Card.js";
4
+ export * from "./Divider.js";
5
+ export * from "./Element.js";
6
+ export * from "./Elements.js";
7
+ export * from "./Figure.js";
8
+ export * from "./Heading.js";
9
+ export * from "./Image.js";
10
+ export * from "./List.js";
11
+ export * from "./Paragraph.js";
12
+ export * from "./Preformatted.js";
13
+ export * from "./Prose.js";
14
+ export * from "./Section.js";
15
+ export * from "./Subheading.js";
16
+ export * from "./Table.js";
17
+ export * from "./Video.js";
@@ -0,0 +1,17 @@
1
+ export * from "./Address.js";
2
+ export * from "./Blockquote.js";
3
+ export * from "./Card.js";
4
+ export * from "./Divider.js";
5
+ export * from "./Element.js";
6
+ export * from "./Elements.js";
7
+ export * from "./Figure.js";
8
+ export * from "./Heading.js";
9
+ export * from "./Image.js";
10
+ export * from "./List.js";
11
+ export * from "./Paragraph.js";
12
+ export * from "./Preformatted.js";
13
+ export * from "./Prose.js";
14
+ export * from "./Section.js";
15
+ export * from "./Subheading.js";
16
+ export * from "./Table.js";
17
+ export * from "./Video.js";
@@ -0,0 +1,13 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ import type { Callback } from "../../util/function.js";
3
+ import type { ButtonVariants } from "../form/Button.js";
4
+ export interface DialogProps {
5
+ children?: ReactNode;
6
+ onClose?: Callback;
7
+ }
8
+ export declare const Dialog: import("react").MemoExoticComponent<({ children, onClose, ...props }: DialogProps) => import("react/jsx-runtime").JSX.Element>;
9
+ export interface DialogCloseButtonProps extends ButtonVariants {
10
+ children?: ReactNode | undefined;
11
+ }
12
+ /** Button that closes its wrapping dialog with an X icon. */
13
+ export declare function DialogCloseButton({ children, ...variants }: DialogCloseButtonProps): ReactElement;
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { XMarkIcon } from "@heroicons/react/24/solid";
3
+ import { memo, Suspense, useEffect, useRef } from "react";
4
+ import { getModuleClass } from "../util/css.js";
5
+ import styles from "./Dialog.module.css";
6
+ export const Dialog = memo(({ children, onClose, ...props }) => {
7
+ const ref = useRef(null);
8
+ useEffect(() => {
9
+ ref.current?.showModal();
10
+ }, []);
11
+ return (_jsx(Suspense, { fallback: null, children: _jsxs("dialog", { ref: ref, className: styles.dialog, onClick: _closeOnBackdropClick, onClose: onClose, ...props, children: [children, _jsx("div", { className: styles.close, children: _jsx(DialogCloseButton, { plain: true }) })] }) }));
12
+ });
13
+ /** When the user clicks anywhere on a `<dialog>` element (and the click isn't on a link etc), then close the dialog. */
14
+ function _closeOnBackdropClick({ currentTarget, target }) {
15
+ // Close the dialog when clicking on the dialog itself (but not its children).
16
+ if (currentTarget === target)
17
+ currentTarget.close();
18
+ // Close the dialog when clicking on links or buttons in a `<nav>` element.
19
+ if (target instanceof Element && target.closest("a:any-link, nav button:enabled"))
20
+ currentTarget.close();
21
+ }
22
+ /** Button that closes its wrapping dialog with an X icon. */
23
+ export function DialogCloseButton({ children = _jsx(XMarkIcon, {}), ...variants }) {
24
+ return (_jsx("button", { type: "button", title: "Close", className: getModuleClass(styles, "button", variants), onClick: _closeOnButtonClick, children: children }));
25
+ }
26
+ function _closeOnButtonClick({ currentTarget }) {
27
+ currentTarget.closest("dialog")?.close();
28
+ }
@@ -0,0 +1,29 @@
1
+ .dialog {
2
+ display: none;
3
+ position: fixed;
4
+ inset: 0;
5
+ z-index: 1000;
6
+ margin: 0;
7
+ width: 100vw;
8
+ height: 100vh;
9
+ align-items: center;
10
+ justify-content: center;
11
+ background: var(--dialog-color-overlay, var(--color-overlay));
12
+ padding: var(--dialog-padding, var(--spacing-block));
13
+ opacity: 0;
14
+ transition: opacity var(--dialog-transition-duration, var(--duration-fast)) ease-in-out;
15
+
16
+ &[open] {
17
+ opacity: 1;
18
+ }
19
+
20
+ @starting-style {
21
+ opacity: 0;
22
+ }
23
+ }
24
+
25
+ .close {
26
+ position: fixed;
27
+ top: var(--dialog-close-offset, var(--spacing-element));
28
+ right: var(--dialog-close-offset, var(--spacing-element));
29
+ }