@misoto22/kioku-ui 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (397) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -0
  3. package/dist/Alert/Alert.d.ts +7 -0
  4. package/dist/Alert/Alert.doc.d.ts +11 -0
  5. package/dist/Alert/Alert.doc.js +15 -0
  6. package/dist/Alert/Alert.js +149 -0
  7. package/dist/Alert/index.d.ts +1 -0
  8. package/dist/Alert/index.js +2 -0
  9. package/dist/AsyncState/AsyncState.d.ts +30 -0
  10. package/dist/AsyncState/AsyncState.doc.d.ts +16 -0
  11. package/dist/AsyncState/AsyncState.doc.js +16 -0
  12. package/dist/AsyncState/AsyncState.js +36 -0
  13. package/dist/AsyncState/index.d.ts +1 -0
  14. package/dist/AsyncState/index.js +2 -0
  15. package/dist/Badge/Badge.d.ts +10 -0
  16. package/dist/Badge/Badge.doc.d.ts +11 -0
  17. package/dist/Badge/Badge.doc.js +12 -0
  18. package/dist/Badge/Badge.js +58 -0
  19. package/dist/Badge/index.d.ts +1 -0
  20. package/dist/Badge/index.js +2 -0
  21. package/dist/Button/Button.d.ts +18 -0
  22. package/dist/Button/Button.doc.d.ts +11 -0
  23. package/dist/Button/Button.doc.js +18 -0
  24. package/dist/Button/Button.js +151 -0
  25. package/dist/Button/index.d.ts +1 -0
  26. package/dist/Button/index.js +2 -0
  27. package/dist/Card/Card.d.ts +6 -0
  28. package/dist/Card/Card.doc.d.ts +11 -0
  29. package/dist/Card/Card.doc.js +15 -0
  30. package/dist/Card/Card.js +41 -0
  31. package/dist/Card/index.d.ts +1 -0
  32. package/dist/Card/index.js +2 -0
  33. package/dist/CardFooter/CardFooter.d.ts +3 -0
  34. package/dist/CardFooter/CardFooter.doc.d.ts +11 -0
  35. package/dist/CardFooter/CardFooter.doc.js +12 -0
  36. package/dist/CardFooter/CardFooter.js +16 -0
  37. package/dist/CardFooter/index.d.ts +1 -0
  38. package/dist/CardFooter/index.js +2 -0
  39. package/dist/CardHeader/CardHeader.d.ts +3 -0
  40. package/dist/CardHeader/CardHeader.doc.d.ts +11 -0
  41. package/dist/CardHeader/CardHeader.doc.js +12 -0
  42. package/dist/CardHeader/CardHeader.js +16 -0
  43. package/dist/CardHeader/index.d.ts +1 -0
  44. package/dist/CardHeader/index.js +2 -0
  45. package/dist/Center/Center.d.ts +3 -0
  46. package/dist/Center/Center.doc.d.ts +11 -0
  47. package/dist/Center/Center.doc.js +12 -0
  48. package/dist/Center/Center.js +15 -0
  49. package/dist/Center/index.d.ts +1 -0
  50. package/dist/Center/index.js +2 -0
  51. package/dist/Divider/Divider.d.ts +3 -0
  52. package/dist/Divider/Divider.doc.d.ts +11 -0
  53. package/dist/Divider/Divider.doc.js +12 -0
  54. package/dist/Divider/Divider.js +12 -0
  55. package/dist/Divider/index.d.ts +1 -0
  56. package/dist/Divider/index.js +2 -0
  57. package/dist/EmptyState/EmptyState.d.ts +11 -0
  58. package/dist/EmptyState/EmptyState.doc.d.ts +16 -0
  59. package/dist/EmptyState/EmptyState.doc.js +25 -0
  60. package/dist/EmptyState/EmptyState.js +55 -0
  61. package/dist/EmptyState/index.d.ts +1 -0
  62. package/dist/EmptyState/index.js +2 -0
  63. package/dist/Field/Field.d.ts +21 -0
  64. package/dist/Field/Field.doc.d.ts +16 -0
  65. package/dist/Field/Field.doc.js +28 -0
  66. package/dist/Field/Field.js +117 -0
  67. package/dist/Field/index.d.ts +1 -0
  68. package/dist/Field/index.js +2 -0
  69. package/dist/Grid/Grid.d.ts +7 -0
  70. package/dist/Grid/Grid.doc.d.ts +11 -0
  71. package/dist/Grid/Grid.doc.js +15 -0
  72. package/dist/Grid/Grid.js +76 -0
  73. package/dist/Grid/index.d.ts +1 -0
  74. package/dist/Grid/index.js +2 -0
  75. package/dist/Heading/Heading.d.ts +293 -0
  76. package/dist/Heading/Heading.doc.d.ts +16 -0
  77. package/dist/Heading/Heading.doc.js +19 -0
  78. package/dist/Heading/Heading.js +47 -0
  79. package/dist/Heading/index.d.ts +1 -0
  80. package/dist/Heading/index.js +2 -0
  81. package/dist/IconButton/IconButton.d.ts +9 -0
  82. package/dist/IconButton/IconButton.doc.d.ts +16 -0
  83. package/dist/IconButton/IconButton.doc.js +22 -0
  84. package/dist/IconButton/IconButton.js +11 -0
  85. package/dist/IconButton/index.d.ts +1 -0
  86. package/dist/IconButton/index.js +2 -0
  87. package/dist/MetricGrid/MetricGrid.d.ts +10 -0
  88. package/dist/MetricGrid/MetricGrid.doc.d.ts +12 -0
  89. package/dist/MetricGrid/MetricGrid.doc.js +13 -0
  90. package/dist/MetricGrid/MetricGrid.js +37 -0
  91. package/dist/MetricGrid/index.d.ts +1 -0
  92. package/dist/MetricGrid/index.js +2 -0
  93. package/dist/Section/Section.d.ts +6 -0
  94. package/dist/Section/Section.doc.d.ts +11 -0
  95. package/dist/Section/Section.doc.js +12 -0
  96. package/dist/Section/Section.js +49 -0
  97. package/dist/Section/index.d.ts +1 -0
  98. package/dist/Section/index.js +2 -0
  99. package/dist/SegmentedControl/SegmentedControl.d.ts +31 -0
  100. package/dist/SegmentedControl/SegmentedControl.doc.d.ts +16 -0
  101. package/dist/SegmentedControl/SegmentedControl.doc.js +34 -0
  102. package/dist/SegmentedControl/SegmentedControl.js +108 -0
  103. package/dist/SegmentedControl/index.d.ts +1 -0
  104. package/dist/SegmentedControl/index.js +2 -0
  105. package/dist/Skeleton/Skeleton.d.ts +5 -0
  106. package/dist/Skeleton/Skeleton.doc.d.ts +11 -0
  107. package/dist/Skeleton/Skeleton.doc.js +12 -0
  108. package/dist/Skeleton/Skeleton.js +20 -0
  109. package/dist/Skeleton/index.d.ts +1 -0
  110. package/dist/Skeleton/index.js +2 -0
  111. package/dist/Spinner/Spinner.d.ts +6 -0
  112. package/dist/Spinner/Spinner.doc.d.ts +12 -0
  113. package/dist/Spinner/Spinner.doc.js +13 -0
  114. package/dist/Spinner/Spinner.js +25 -0
  115. package/dist/Spinner/index.d.ts +1 -0
  116. package/dist/Spinner/index.js +2 -0
  117. package/dist/Stack/Stack.d.ts +7 -0
  118. package/dist/Stack/Stack.doc.d.ts +11 -0
  119. package/dist/Stack/Stack.doc.js +15 -0
  120. package/dist/Stack/Stack.js +77 -0
  121. package/dist/Stack/index.d.ts +1 -0
  122. package/dist/Stack/index.js +2 -0
  123. package/dist/StatusDot/StatusDot.d.ts +8 -0
  124. package/dist/StatusDot/StatusDot.doc.d.ts +16 -0
  125. package/dist/StatusDot/StatusDot.doc.js +16 -0
  126. package/dist/StatusDot/StatusDot.js +46 -0
  127. package/dist/StatusDot/index.d.ts +1 -0
  128. package/dist/StatusDot/index.js +2 -0
  129. package/dist/Table/Table.d.ts +20 -0
  130. package/dist/Table/Table.doc.d.ts +92 -0
  131. package/dist/Table/Table.doc.js +94 -0
  132. package/dist/Table/Table.js +205 -0
  133. package/dist/Table/index.d.ts +1 -0
  134. package/dist/Table/index.js +2 -0
  135. package/dist/Text/Text.d.ts +7 -0
  136. package/dist/Text/Text.doc.d.ts +11 -0
  137. package/dist/Text/Text.doc.js +15 -0
  138. package/dist/Text/Text.js +50 -0
  139. package/dist/Text/index.d.ts +1 -0
  140. package/dist/Text/index.js +2 -0
  141. package/dist/TextArea/TextArea.d.ts +16 -0
  142. package/dist/TextArea/TextArea.doc.d.ts +11 -0
  143. package/dist/TextArea/TextArea.doc.js +30 -0
  144. package/dist/TextArea/TextArea.js +47 -0
  145. package/dist/TextArea/index.d.ts +1 -0
  146. package/dist/TextArea/index.js +2 -0
  147. package/dist/TextInput/TextInput.d.ts +16 -0
  148. package/dist/TextInput/TextInput.doc.d.ts +11 -0
  149. package/dist/TextInput/TextInput.doc.js +30 -0
  150. package/dist/TextInput/TextInput.js +49 -0
  151. package/dist/TextInput/index.d.ts +1 -0
  152. package/dist/TextInput/index.js +2 -0
  153. package/dist/Toggle/Toggle.d.ts +16 -0
  154. package/dist/Toggle/Toggle.doc.d.ts +11 -0
  155. package/dist/Toggle/Toggle.doc.js +21 -0
  156. package/dist/Toggle/Toggle.js +64 -0
  157. package/dist/Toggle/index.d.ts +1 -0
  158. package/dist/Toggle/index.js +2 -0
  159. package/dist/VisuallyHidden/VisuallyHidden.d.ts +3 -0
  160. package/dist/VisuallyHidden/VisuallyHidden.doc.d.ts +11 -0
  161. package/dist/VisuallyHidden/VisuallyHidden.doc.js +12 -0
  162. package/dist/VisuallyHidden/VisuallyHidden.js +15 -0
  163. package/dist/VisuallyHidden/index.d.ts +1 -0
  164. package/dist/VisuallyHidden/index.js +2 -0
  165. package/dist/authoring.stylex.d.ts +75 -0
  166. package/dist/authoring.stylex.js +77 -0
  167. package/dist/components/Alert.d.ts +7 -0
  168. package/dist/components/Alert.doc.d.ts +11 -0
  169. package/dist/components/Alert.doc.js +15 -0
  170. package/dist/components/Alert.js +149 -0
  171. package/dist/components/AsyncState.d.ts +30 -0
  172. package/dist/components/AsyncState.doc.d.ts +16 -0
  173. package/dist/components/AsyncState.doc.js +16 -0
  174. package/dist/components/AsyncState.js +36 -0
  175. package/dist/components/Badge.d.ts +10 -0
  176. package/dist/components/Badge.doc.d.ts +11 -0
  177. package/dist/components/Badge.doc.js +12 -0
  178. package/dist/components/Badge.js +58 -0
  179. package/dist/components/Button.d.ts +18 -0
  180. package/dist/components/Button.doc.d.ts +11 -0
  181. package/dist/components/Button.doc.js +18 -0
  182. package/dist/components/Button.js +151 -0
  183. package/dist/components/Card.d.ts +6 -0
  184. package/dist/components/Card.doc.d.ts +11 -0
  185. package/dist/components/Card.doc.js +15 -0
  186. package/dist/components/Card.js +41 -0
  187. package/dist/components/CardFooter.d.ts +3 -0
  188. package/dist/components/CardFooter.doc.d.ts +11 -0
  189. package/dist/components/CardFooter.doc.js +12 -0
  190. package/dist/components/CardFooter.js +16 -0
  191. package/dist/components/CardHeader.d.ts +3 -0
  192. package/dist/components/CardHeader.doc.d.ts +11 -0
  193. package/dist/components/CardHeader.doc.js +12 -0
  194. package/dist/components/CardHeader.js +16 -0
  195. package/dist/components/Center.d.ts +3 -0
  196. package/dist/components/Center.doc.d.ts +11 -0
  197. package/dist/components/Center.doc.js +12 -0
  198. package/dist/components/Center.js +15 -0
  199. package/dist/components/Divider.d.ts +3 -0
  200. package/dist/components/Divider.doc.d.ts +11 -0
  201. package/dist/components/Divider.doc.js +12 -0
  202. package/dist/components/Divider.js +12 -0
  203. package/dist/components/EmptyState.d.ts +11 -0
  204. package/dist/components/EmptyState.doc.d.ts +16 -0
  205. package/dist/components/EmptyState.doc.js +25 -0
  206. package/dist/components/EmptyState.js +55 -0
  207. package/dist/components/Field.d.ts +21 -0
  208. package/dist/components/Field.doc.d.ts +16 -0
  209. package/dist/components/Field.doc.js +28 -0
  210. package/dist/components/Field.js +117 -0
  211. package/dist/components/Grid.d.ts +7 -0
  212. package/dist/components/Grid.doc.d.ts +11 -0
  213. package/dist/components/Grid.doc.js +15 -0
  214. package/dist/components/Grid.js +76 -0
  215. package/dist/components/Heading.d.ts +293 -0
  216. package/dist/components/Heading.doc.d.ts +16 -0
  217. package/dist/components/Heading.doc.js +19 -0
  218. package/dist/components/Heading.js +46 -0
  219. package/dist/components/IconButton.d.ts +9 -0
  220. package/dist/components/IconButton.doc.d.ts +16 -0
  221. package/dist/components/IconButton.doc.js +22 -0
  222. package/dist/components/IconButton.js +11 -0
  223. package/dist/components/MetricGrid.d.ts +10 -0
  224. package/dist/components/MetricGrid.doc.d.ts +12 -0
  225. package/dist/components/MetricGrid.doc.js +13 -0
  226. package/dist/components/MetricGrid.js +37 -0
  227. package/dist/components/Section.d.ts +6 -0
  228. package/dist/components/Section.doc.d.ts +11 -0
  229. package/dist/components/Section.doc.js +12 -0
  230. package/dist/components/Section.js +49 -0
  231. package/dist/components/SegmentedControl.d.ts +31 -0
  232. package/dist/components/SegmentedControl.doc.d.ts +16 -0
  233. package/dist/components/SegmentedControl.doc.js +34 -0
  234. package/dist/components/SegmentedControl.js +108 -0
  235. package/dist/components/Skeleton.d.ts +5 -0
  236. package/dist/components/Skeleton.doc.d.ts +11 -0
  237. package/dist/components/Skeleton.doc.js +12 -0
  238. package/dist/components/Skeleton.js +20 -0
  239. package/dist/components/Spinner.d.ts +6 -0
  240. package/dist/components/Spinner.doc.d.ts +12 -0
  241. package/dist/components/Spinner.doc.js +13 -0
  242. package/dist/components/Spinner.js +25 -0
  243. package/dist/components/Stack.d.ts +7 -0
  244. package/dist/components/Stack.doc.d.ts +11 -0
  245. package/dist/components/Stack.doc.js +15 -0
  246. package/dist/components/Stack.js +77 -0
  247. package/dist/components/StatusDot.d.ts +8 -0
  248. package/dist/components/StatusDot.doc.d.ts +16 -0
  249. package/dist/components/StatusDot.doc.js +16 -0
  250. package/dist/components/StatusDot.js +46 -0
  251. package/dist/components/Table.d.ts +20 -0
  252. package/dist/components/Table.doc.d.ts +92 -0
  253. package/dist/components/Table.doc.js +94 -0
  254. package/dist/components/Table.js +205 -0
  255. package/dist/components/Text.d.ts +7 -0
  256. package/dist/components/Text.doc.d.ts +11 -0
  257. package/dist/components/Text.doc.js +15 -0
  258. package/dist/components/Text.js +50 -0
  259. package/dist/components/TextArea.d.ts +16 -0
  260. package/dist/components/TextArea.doc.d.ts +11 -0
  261. package/dist/components/TextArea.doc.js +30 -0
  262. package/dist/components/TextArea.js +47 -0
  263. package/dist/components/TextInput.d.ts +16 -0
  264. package/dist/components/TextInput.doc.d.ts +11 -0
  265. package/dist/components/TextInput.doc.js +30 -0
  266. package/dist/components/TextInput.js +49 -0
  267. package/dist/components/Toggle.d.ts +16 -0
  268. package/dist/components/Toggle.doc.d.ts +11 -0
  269. package/dist/components/Toggle.doc.js +21 -0
  270. package/dist/components/Toggle.js +64 -0
  271. package/dist/components/VisuallyHidden.d.ts +3 -0
  272. package/dist/components/VisuallyHidden.doc.d.ts +11 -0
  273. package/dist/components/VisuallyHidden.doc.js +12 -0
  274. package/dist/components/VisuallyHidden.js +15 -0
  275. package/dist/components/index.d.ts +27 -0
  276. package/dist/components/index.js +28 -0
  277. package/dist/docs/index.d.ts +33 -0
  278. package/dist/docs/index.js +33 -0
  279. package/dist/docs/types.d.ts +15 -0
  280. package/dist/docs/types.js +25 -0
  281. package/dist/index.d.ts +31 -0
  282. package/dist/index.js +32 -0
  283. package/dist/navigation/LinkProvider.d.ts +9 -0
  284. package/dist/navigation/LinkProvider.doc.d.ts +27 -0
  285. package/dist/navigation/LinkProvider.doc.js +27 -0
  286. package/dist/navigation/LinkProvider.js +22 -0
  287. package/dist/navigation/index.d.ts +1 -0
  288. package/dist/navigation/index.js +2 -0
  289. package/dist/styles/global.stylex.d.ts +20 -0
  290. package/dist/styles/global.stylex.js +22 -0
  291. package/dist/styles/index.css +14 -0
  292. package/dist/styles/reset.css +35 -0
  293. package/dist/styles/stylex.css +212 -0
  294. package/dist/theme/Theme.d.ts +24 -0
  295. package/dist/theme/Theme.doc.d.ts +16 -0
  296. package/dist/theme/Theme.doc.js +27 -0
  297. package/dist/theme/Theme.js +110 -0
  298. package/dist/theme/index.d.ts +2 -0
  299. package/dist/theme/index.js +2 -0
  300. package/dist/tokens/contracts.d.ts +140 -0
  301. package/dist/tokens/contracts.js +102 -0
  302. package/package.json +93 -0
  303. package/src/Alert/Alert.doc.ts +21 -0
  304. package/src/Alert/Alert.tsx +129 -0
  305. package/src/Alert/index.ts +1 -0
  306. package/src/AsyncState/AsyncState.doc.ts +21 -0
  307. package/src/AsyncState/AsyncState.tsx +75 -0
  308. package/src/AsyncState/index.ts +5 -0
  309. package/src/Badge/Badge.doc.ts +15 -0
  310. package/src/Badge/Badge.tsx +58 -0
  311. package/src/Badge/index.ts +6 -0
  312. package/src/Button/Button.doc.ts +17 -0
  313. package/src/Button/Button.tsx +176 -0
  314. package/src/Button/index.ts +7 -0
  315. package/src/Card/Card.doc.ts +22 -0
  316. package/src/Card/Card.tsx +44 -0
  317. package/src/Card/index.ts +1 -0
  318. package/src/CardFooter/CardFooter.doc.ts +12 -0
  319. package/src/CardFooter/CardFooter.tsx +27 -0
  320. package/src/CardFooter/index.ts +1 -0
  321. package/src/CardHeader/CardHeader.doc.ts +12 -0
  322. package/src/CardHeader/CardHeader.tsx +27 -0
  323. package/src/CardHeader/index.ts +1 -0
  324. package/src/Center/Center.doc.ts +12 -0
  325. package/src/Center/Center.tsx +20 -0
  326. package/src/Center/index.ts +1 -0
  327. package/src/Divider/Divider.doc.ts +12 -0
  328. package/src/Divider/Divider.tsx +20 -0
  329. package/src/Divider/index.ts +1 -0
  330. package/src/EmptyState/EmptyState.doc.ts +31 -0
  331. package/src/EmptyState/EmptyState.tsx +87 -0
  332. package/src/EmptyState/index.ts +6 -0
  333. package/src/Field/Field.doc.ts +34 -0
  334. package/src/Field/Field.tsx +126 -0
  335. package/src/Field/index.ts +6 -0
  336. package/src/Grid/Grid.doc.ts +16 -0
  337. package/src/Grid/Grid.tsx +54 -0
  338. package/src/Grid/index.ts +1 -0
  339. package/src/Heading/Heading.doc.ts +26 -0
  340. package/src/Heading/Heading.tsx +48 -0
  341. package/src/Heading/index.ts +1 -0
  342. package/src/IconButton/IconButton.doc.ts +24 -0
  343. package/src/IconButton/IconButton.tsx +18 -0
  344. package/src/IconButton/index.ts +1 -0
  345. package/src/MetricGrid/MetricGrid.doc.ts +19 -0
  346. package/src/MetricGrid/MetricGrid.tsx +72 -0
  347. package/src/MetricGrid/index.ts +5 -0
  348. package/src/Section/Section.doc.ts +12 -0
  349. package/src/Section/Section.tsx +38 -0
  350. package/src/Section/index.ts +1 -0
  351. package/src/SegmentedControl/SegmentedControl.doc.ts +51 -0
  352. package/src/SegmentedControl/SegmentedControl.tsx +238 -0
  353. package/src/SegmentedControl/index.ts +5 -0
  354. package/src/Skeleton/Skeleton.doc.ts +15 -0
  355. package/src/Skeleton/Skeleton.tsx +45 -0
  356. package/src/Skeleton/index.ts +1 -0
  357. package/src/Spinner/Spinner.doc.ts +19 -0
  358. package/src/Spinner/Spinner.tsx +47 -0
  359. package/src/Spinner/index.ts +1 -0
  360. package/src/Stack/Stack.doc.ts +13 -0
  361. package/src/Stack/Stack.tsx +57 -0
  362. package/src/Stack/index.ts +1 -0
  363. package/src/StatusDot/StatusDot.doc.ts +23 -0
  364. package/src/StatusDot/StatusDot.tsx +35 -0
  365. package/src/StatusDot/index.ts +1 -0
  366. package/src/Table/Table.doc.ts +104 -0
  367. package/src/Table/Table.tsx +222 -0
  368. package/src/Table/index.ts +18 -0
  369. package/src/Text/Text.doc.ts +17 -0
  370. package/src/Text/Text.tsx +43 -0
  371. package/src/Text/index.ts +1 -0
  372. package/src/TextArea/TextArea.doc.ts +43 -0
  373. package/src/TextArea/TextArea.tsx +119 -0
  374. package/src/TextArea/index.ts +1 -0
  375. package/src/TextInput/TextInput.doc.ts +43 -0
  376. package/src/TextInput/TextInput.tsx +122 -0
  377. package/src/TextInput/index.ts +1 -0
  378. package/src/Toggle/Toggle.doc.ts +30 -0
  379. package/src/Toggle/Toggle.tsx +139 -0
  380. package/src/Toggle/index.ts +1 -0
  381. package/src/VisuallyHidden/VisuallyHidden.doc.ts +18 -0
  382. package/src/VisuallyHidden/VisuallyHidden.tsx +28 -0
  383. package/src/VisuallyHidden/index.ts +1 -0
  384. package/src/authoring.stylex.ts +76 -0
  385. package/src/docs/index.ts +122 -0
  386. package/src/docs/types.ts +51 -0
  387. package/src/index.ts +102 -0
  388. package/src/navigation/LinkProvider.doc.ts +32 -0
  389. package/src/navigation/LinkProvider.tsx +32 -0
  390. package/src/navigation/index.ts +7 -0
  391. package/src/styles/global.stylex.ts +23 -0
  392. package/src/styles/index.css +14 -0
  393. package/src/styles/reset.css +35 -0
  394. package/src/theme/Theme.doc.ts +38 -0
  395. package/src/theme/Theme.tsx +195 -0
  396. package/src/theme/index.ts +9 -0
  397. package/src/tokens/contracts.ts +210 -0
@@ -0,0 +1,238 @@
1
+ import * as stylex from '@stylexjs/stylex';
2
+ import {
3
+ useRef,
4
+ useState,
5
+ type HTMLAttributes,
6
+ type KeyboardEvent,
7
+ type ReactNode,
8
+ } from 'react';
9
+
10
+ import {semanticTokens} from '../authoring.stylex.js';
11
+
12
+ const styles = stylex.create({
13
+ root: {
14
+ backgroundColor: semanticTokens.colorSurfaceMuted,
15
+ borderRadius: semanticTokens.radiusElement,
16
+ display: 'inline-flex',
17
+ gap: semanticTokens.spacingXs,
18
+ padding: semanticTokens.spacingXs,
19
+ },
20
+ option: {
21
+ backgroundColor: 'transparent',
22
+ borderRadius: semanticTokens.radiusInner,
23
+ borderStyle: 'none',
24
+ boxSizing: 'border-box',
25
+ color: semanticTokens.colorText,
26
+ fontFamily: semanticTokens.fontFamilyBody,
27
+ fontSize: semanticTokens.fontSizeMd,
28
+ minHeight: semanticTokens.sizeControlMd,
29
+ paddingBlock: semanticTokens.spacingXs,
30
+ paddingInline: semanticTokens.spacingSm,
31
+ ':disabled': {color: semanticTokens.colorDisabledText},
32
+ ':focus-visible': {
33
+ outlineColor: semanticTokens.colorFocus,
34
+ outlineOffset: semanticTokens.focusOffset,
35
+ outlineStyle: semanticTokens.borderStyle,
36
+ outlineWidth: semanticTokens.focusWidth,
37
+ },
38
+ },
39
+ unselected: {
40
+ ':active:not(:disabled)': {
41
+ backgroundColor: semanticTokens.colorOverlayActive,
42
+ },
43
+ ':hover:not(:disabled)': {
44
+ backgroundColor: semanticTokens.colorOverlayHover,
45
+ },
46
+ },
47
+ selected: {
48
+ backgroundColor: semanticTokens.colorSurfaceRaised,
49
+ boxShadow: semanticTokens.elevationLow,
50
+ color: semanticTokens.colorText,
51
+ },
52
+ vertical: {flexDirection: 'column'},
53
+ });
54
+
55
+ export interface SegmentedControlOption<Value extends string = string> {
56
+ readonly disabled?: boolean;
57
+ readonly label: ReactNode;
58
+ readonly value: Value;
59
+ }
60
+
61
+ type SharedSegmentedControlProps<Value extends string> = Omit<
62
+ HTMLAttributes<HTMLDivElement>,
63
+ 'aria-label' | 'aria-labelledby' | 'className' | 'defaultValue' | 'onChange'
64
+ > & {
65
+ readonly disabled?: boolean;
66
+ readonly onValueChange?: (value: Value) => void;
67
+ readonly options: readonly SegmentedControlOption<Value>[];
68
+ readonly orientation?: 'horizontal' | 'vertical';
69
+ };
70
+
71
+ type SegmentedControlAccessibleName =
72
+ | {
73
+ readonly 'aria-label': string;
74
+ readonly 'aria-labelledby'?: string;
75
+ }
76
+ | {
77
+ readonly 'aria-label'?: string;
78
+ readonly 'aria-labelledby': string;
79
+ };
80
+
81
+ type ControlledSegmentedControlProps<Value extends string> =
82
+ SharedSegmentedControlProps<Value> & {
83
+ readonly defaultValue?: never;
84
+ readonly onValueChange: (value: Value) => void;
85
+ readonly value: Value;
86
+ };
87
+
88
+ type UncontrolledSegmentedControlProps<Value extends string> =
89
+ SharedSegmentedControlProps<Value> & {
90
+ readonly defaultValue?: Value;
91
+ readonly value?: never;
92
+ };
93
+
94
+ export type SegmentedControlProps<Value extends string = string> = (
95
+ | ControlledSegmentedControlProps<Value>
96
+ | UncontrolledSegmentedControlProps<Value>
97
+ ) &
98
+ SegmentedControlAccessibleName;
99
+
100
+ export function SegmentedControl<Value extends string = string>({
101
+ 'aria-label': ariaLabel,
102
+ 'aria-labelledby': ariaLabelledBy,
103
+ defaultValue,
104
+ disabled = false,
105
+ onValueChange,
106
+ options,
107
+ orientation = 'horizontal',
108
+ value,
109
+ ...props
110
+ }: SegmentedControlProps<Value>) {
111
+ if (!ariaLabel?.trim() && !ariaLabelledBy?.trim()) {
112
+ throw new Error('SegmentedControl requires an accessible name');
113
+ }
114
+
115
+ const firstEnabledValue = options.find((option) => !option.disabled)?.value;
116
+ const [internalValue, setInternalValue] = useState<Value | undefined>(
117
+ defaultValue ?? firstEnabledValue,
118
+ );
119
+ const requestedValue = value ?? internalValue;
120
+ const selectedValue = options.some(
121
+ (option) => option.value === requestedValue && !option.disabled,
122
+ )
123
+ ? requestedValue
124
+ : firstEnabledValue;
125
+ const optionRefs = useRef(new Map<Value, HTMLButtonElement>());
126
+ const enabledOptions = options.filter(
127
+ (option) => !disabled && !option.disabled,
128
+ );
129
+
130
+ function select(nextValue: Value) {
131
+ if (value === undefined) {
132
+ setInternalValue(nextValue);
133
+ }
134
+ onValueChange?.(nextValue);
135
+ }
136
+
137
+ function moveSelection(
138
+ currentValue: Value,
139
+ direction: 'first' | 'last' | 'next' | 'previous',
140
+ ) {
141
+ if (enabledOptions.length === 0) {
142
+ return;
143
+ }
144
+
145
+ const currentIndex = enabledOptions.findIndex(
146
+ (option) => option.value === currentValue,
147
+ );
148
+ let nextIndex: number;
149
+
150
+ if (direction === 'first') {
151
+ nextIndex = 0;
152
+ } else if (direction === 'last') {
153
+ nextIndex = enabledOptions.length - 1;
154
+ } else if (direction === 'next') {
155
+ nextIndex =
156
+ (currentIndex + 1 + enabledOptions.length) % enabledOptions.length;
157
+ } else {
158
+ nextIndex =
159
+ (currentIndex - 1 + enabledOptions.length) % enabledOptions.length;
160
+ }
161
+
162
+ const nextOption = enabledOptions[nextIndex];
163
+ if (!nextOption) {
164
+ return;
165
+ }
166
+ select(nextOption.value);
167
+ optionRefs.current.get(nextOption.value)?.focus();
168
+ }
169
+
170
+ function handleKeyDown(
171
+ event: KeyboardEvent<HTMLButtonElement>,
172
+ currentValue: Value,
173
+ ) {
174
+ const nextKey = orientation === 'horizontal' ? 'ArrowRight' : 'ArrowDown';
175
+ const previousKey = orientation === 'horizontal' ? 'ArrowLeft' : 'ArrowUp';
176
+ const direction =
177
+ event.key === nextKey
178
+ ? 'next'
179
+ : event.key === previousKey
180
+ ? 'previous'
181
+ : event.key === 'Home'
182
+ ? 'first'
183
+ : event.key === 'End'
184
+ ? 'last'
185
+ : undefined;
186
+
187
+ if (direction) {
188
+ event.preventDefault();
189
+ moveSelection(currentValue, direction);
190
+ }
191
+ }
192
+
193
+ return (
194
+ <div
195
+ {...props}
196
+ aria-label={ariaLabel}
197
+ aria-labelledby={ariaLabelledBy}
198
+ aria-disabled={disabled || undefined}
199
+ aria-orientation={orientation}
200
+ role="radiogroup"
201
+ {...stylex.props(
202
+ styles.root,
203
+ orientation === 'vertical' ? styles.vertical : undefined,
204
+ )}
205
+ >
206
+ {options.map((option) => {
207
+ const isDisabled = disabled || Boolean(option.disabled);
208
+ const isSelected = option.value === selectedValue;
209
+
210
+ return (
211
+ <button
212
+ aria-checked={isSelected}
213
+ disabled={isDisabled}
214
+ key={option.value}
215
+ onClick={() => select(option.value)}
216
+ onKeyDown={(event) => handleKeyDown(event, option.value)}
217
+ ref={(element) => {
218
+ if (element) {
219
+ optionRefs.current.set(option.value, element);
220
+ } else {
221
+ optionRefs.current.delete(option.value);
222
+ }
223
+ }}
224
+ role="radio"
225
+ tabIndex={isSelected && !isDisabled ? 0 : -1}
226
+ {...stylex.props(
227
+ styles.option,
228
+ isSelected ? styles.selected : styles.unselected,
229
+ )}
230
+ type="button"
231
+ >
232
+ {option.label}
233
+ </button>
234
+ );
235
+ })}
236
+ </div>
237
+ );
238
+ }
@@ -0,0 +1,5 @@
1
+ export {
2
+ SegmentedControl,
3
+ type SegmentedControlOption,
4
+ type SegmentedControlProps,
5
+ } from './SegmentedControl.js';
@@ -0,0 +1,15 @@
1
+ import type {ComponentDoc} from '../docs/types.js';
2
+
3
+ export const skeletonDoc = {
4
+ name: 'Skeleton',
5
+ description:
6
+ 'Displays a decorative or explicitly labelled loading placeholder with a static reduced-motion fallback.',
7
+ props: [
8
+ {name: 'label', description: 'Optionally announces what is loading.'},
9
+ ],
10
+ inheritedProps: [
11
+ 'HTMLAttributes<HTMLDivElement> except aria-label, children, className, and role',
12
+ ],
13
+ example: '<Skeleton label="Loading summary" />',
14
+ storyId: 'core-skeleton--default',
15
+ } satisfies ComponentDoc;
@@ -0,0 +1,45 @@
1
+ import * as stylex from '@stylexjs/stylex';
2
+ import type {HTMLAttributes} from 'react';
3
+
4
+ import {semanticTokens} from '../authoring.stylex.js';
5
+
6
+ const pulse = stylex.keyframes({
7
+ '50%': {backgroundColor: semanticTokens.colorSurface},
8
+ });
9
+
10
+ const styles = stylex.create({
11
+ base: {
12
+ animationDirection: 'alternate',
13
+ animationDuration: semanticTokens.durationSlow,
14
+ animationIterationCount: 'infinite',
15
+ animationName: {
16
+ default: pulse,
17
+ '@media (prefers-reduced-motion: reduce)': 'none',
18
+ },
19
+ animationTimingFunction: semanticTokens.easingStandard,
20
+ backgroundColor: semanticTokens.colorSurfaceMuted,
21
+ borderRadius: semanticTokens.radiusElement,
22
+ minHeight: semanticTokens.sizeControlMd,
23
+ width: '100%',
24
+ },
25
+ });
26
+
27
+ export interface SkeletonProps extends Omit<
28
+ HTMLAttributes<HTMLDivElement>,
29
+ 'aria-label' | 'children' | 'className' | 'role'
30
+ > {
31
+ readonly label?: string;
32
+ }
33
+
34
+ export function Skeleton({label, ...props}: SkeletonProps) {
35
+ return (
36
+ <div
37
+ {...props}
38
+ aria-busy={label ? 'true' : undefined}
39
+ aria-hidden={label ? undefined : 'true'}
40
+ aria-label={label}
41
+ role={label ? 'status' : undefined}
42
+ {...stylex.props(styles.base)}
43
+ />
44
+ );
45
+ }
@@ -0,0 +1 @@
1
+ export {Skeleton, type SkeletonProps} from './Skeleton.js';
@@ -0,0 +1,19 @@
1
+ import type {ComponentDoc} from '../docs/types.js';
2
+
3
+ export const spinnerDoc = {
4
+ name: 'Spinner',
5
+ description:
6
+ 'Announces indeterminate progress with a required accessible label and a static reduced-motion fallback.',
7
+ props: [
8
+ {
9
+ name: 'label',
10
+ description: 'Names the operation in progress.',
11
+ required: true,
12
+ },
13
+ ],
14
+ inheritedProps: [
15
+ 'HTMLAttributes<HTMLSpanElement> except aria-label, children, className, and role',
16
+ ],
17
+ example: '<Spinner label="Loading items" />',
18
+ storyId: 'core-spinner--default',
19
+ } satisfies ComponentDoc;
@@ -0,0 +1,47 @@
1
+ import * as stylex from '@stylexjs/stylex';
2
+ import type {HTMLAttributes} from 'react';
3
+
4
+ import {semanticTokens} from '../authoring.stylex.js';
5
+
6
+ const spin = stylex.keyframes({
7
+ to: {transform: 'rotate(360deg)'},
8
+ });
9
+
10
+ const styles = stylex.create({
11
+ spinner: {
12
+ animationDuration: semanticTokens.durationSlow,
13
+ animationIterationCount: 'infinite',
14
+ animationName: {
15
+ default: spin,
16
+ '@media (prefers-reduced-motion: reduce)': 'none',
17
+ },
18
+ animationTimingFunction: semanticTokens.easingStandard,
19
+ borderBlockStartColor: semanticTokens.colorAccent,
20
+ borderColor: semanticTokens.colorSurfaceMuted,
21
+ borderRadius: semanticTokens.radiusFull,
22
+ borderStyle: semanticTokens.borderStyle,
23
+ borderWidth: semanticTokens.borderWidth,
24
+ display: 'inline-block',
25
+ height: semanticTokens.spacingLg,
26
+ width: semanticTokens.spacingLg,
27
+ },
28
+ });
29
+
30
+ export interface SpinnerProps extends Omit<
31
+ HTMLAttributes<HTMLSpanElement>,
32
+ 'aria-label' | 'children' | 'className' | 'role'
33
+ > {
34
+ readonly label: string;
35
+ }
36
+
37
+ export function Spinner({label, ...props}: SpinnerProps) {
38
+ return (
39
+ <span {...props} aria-busy="true" aria-label={label} role="status">
40
+ <SpinnerVisual />
41
+ </span>
42
+ );
43
+ }
44
+
45
+ export function SpinnerVisual() {
46
+ return <span aria-hidden="true" {...stylex.props(styles.spinner)} />;
47
+ }
@@ -0,0 +1 @@
1
+ export {Spinner, SpinnerVisual, type SpinnerProps} from './Spinner.js';
@@ -0,0 +1,13 @@
1
+ import type {ComponentDoc} from '../docs/types.js';
2
+
3
+ export const stackDoc = {
4
+ name: 'Stack',
5
+ description: 'Arranges children vertically with semantic spacing.',
6
+ props: [
7
+ {name: 'gap', description: 'Optional semantic gap token.'},
8
+ {name: 'align', description: 'Optional cross-axis alignment.'},
9
+ ],
10
+ inheritedProps: ['HTMLAttributes<HTMLDivElement> except className'],
11
+ example: '<Stack gap="md"><Text>First</Text><Text>Second</Text></Stack>',
12
+ storyId: 'core-stack--default',
13
+ } satisfies ComponentDoc;
@@ -0,0 +1,57 @@
1
+ import * as stylex from '@stylexjs/stylex';
2
+ import type {HTMLAttributes} from 'react';
3
+
4
+ import {semanticTokens} from '../authoring.stylex.js';
5
+
6
+ export type Space = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
7
+
8
+ const styles = stylex.create({
9
+ base: {display: 'flex', flexDirection: 'column'},
10
+ gapXs: {gap: semanticTokens.spacingXs},
11
+ gapSm: {gap: semanticTokens.spacingSm},
12
+ gapMd: {gap: semanticTokens.spacingMd},
13
+ gapLg: {gap: semanticTokens.spacingLg},
14
+ gapXl: {gap: semanticTokens.spacingXl},
15
+ gap2xl: {gap: semanticTokens.spacing2xl},
16
+ alignStretch: {alignItems: 'stretch'},
17
+ alignStart: {alignItems: 'flex-start'},
18
+ alignCenter: {alignItems: 'center'},
19
+ alignEnd: {alignItems: 'flex-end'},
20
+ });
21
+
22
+ const gaps = {
23
+ xs: styles.gapXs,
24
+ sm: styles.gapSm,
25
+ md: styles.gapMd,
26
+ lg: styles.gapLg,
27
+ xl: styles.gapXl,
28
+ '2xl': styles.gap2xl,
29
+ } as const;
30
+
31
+ const aligns = {
32
+ stretch: styles.alignStretch,
33
+ start: styles.alignStart,
34
+ center: styles.alignCenter,
35
+ end: styles.alignEnd,
36
+ } as const;
37
+
38
+ export interface StackProps extends Omit<
39
+ HTMLAttributes<HTMLDivElement>,
40
+ 'className'
41
+ > {
42
+ readonly gap?: Space;
43
+ readonly align?: 'stretch' | 'start' | 'center' | 'end';
44
+ }
45
+
46
+ export function Stack({
47
+ gap = 'md',
48
+ align = 'stretch',
49
+ children,
50
+ ...props
51
+ }: StackProps) {
52
+ return (
53
+ <div {...props} {...stylex.props(styles.base, gaps[gap], aligns[align])}>
54
+ {children}
55
+ </div>
56
+ );
57
+ }
@@ -0,0 +1 @@
1
+ export {Stack, type Space, type StackProps} from './Stack.js';
@@ -0,0 +1,23 @@
1
+ import type {ComponentDoc} from '../docs/types.js';
2
+
3
+ export const statusDotDoc = {
4
+ name: 'StatusDot',
5
+ description:
6
+ 'Announces a compact live status indicator by its supplied label.',
7
+ props: [
8
+ {
9
+ name: 'aria-label',
10
+ description: 'Names the represented status.',
11
+ required: true,
12
+ },
13
+ {
14
+ name: 'tone',
15
+ description: 'Selects one of the four semantic status tones.',
16
+ },
17
+ ],
18
+ inheritedProps: [
19
+ 'HTMLAttributes<HTMLSpanElement> except aria-label, children, className, and role',
20
+ ],
21
+ example: '<StatusDot aria-label="Service available" tone="success" />',
22
+ storyId: 'core-status-dot--default',
23
+ } satisfies ComponentDoc;
@@ -0,0 +1,35 @@
1
+ import * as stylex from '@stylexjs/stylex';
2
+ import type {HTMLAttributes} from 'react';
3
+
4
+ import {semanticTokens} from '../authoring.stylex.js';
5
+ import type {StatusTone} from '../Badge/index.js';
6
+
7
+ const styles = stylex.create({
8
+ base: {
9
+ borderRadius: semanticTokens.radiusFull,
10
+ display: 'inline-block',
11
+ height: semanticTokens.spacingSm,
12
+ width: semanticTokens.spacingSm,
13
+ },
14
+ info: {backgroundColor: semanticTokens.statusInfoText},
15
+ success: {backgroundColor: semanticTokens.statusSuccessText},
16
+ warning: {backgroundColor: semanticTokens.statusWarningText},
17
+ danger: {backgroundColor: semanticTokens.statusDangerText},
18
+ });
19
+
20
+ /** Props for a labelled live-status indicator using semantic status tones. */
21
+ export interface StatusDotProps extends Omit<
22
+ HTMLAttributes<HTMLSpanElement>,
23
+ 'aria-label' | 'children' | 'className' | 'role'
24
+ > {
25
+ readonly 'aria-label': string;
26
+ readonly tone?: StatusTone;
27
+ }
28
+
29
+ export function StatusDot({tone = 'info', ...props}: StatusDotProps) {
30
+ return (
31
+ <span {...props} aria-live="polite" role="status">
32
+ <span aria-hidden="true" {...stylex.props(styles.base, styles[tone])} />
33
+ </span>
34
+ );
35
+ }
@@ -0,0 +1 @@
1
+ export {StatusDot, type StatusDotProps} from './StatusDot.js';
@@ -0,0 +1,104 @@
1
+ import type {ComponentDoc} from '../docs/types.js';
2
+
3
+ export const tableDoc = {
4
+ name: 'Table',
5
+ description:
6
+ 'Composes native table, caption, section, row, header, and cell primitives.',
7
+ props: [
8
+ {
9
+ name: 'children',
10
+ description: 'Supplies semantic table primitives.',
11
+ required: true,
12
+ },
13
+ {
14
+ name: 'density',
15
+ description: 'Selects compact, default, or spacious cell rhythm.',
16
+ },
17
+ {
18
+ name: 'dividers',
19
+ description:
20
+ 'Selects internal row, column, grid, or borderless dividers without adding an outer boundary.',
21
+ },
22
+ ],
23
+ inheritedProps: ['TableHTMLAttributes<HTMLTableElement> except className'],
24
+ example:
25
+ '<Table density="compact" dividers="grid"><TableCaption>Values</TableCaption><TableBody /></Table>',
26
+ storyId: 'core-table--default',
27
+ } satisfies ComponentDoc;
28
+
29
+ export const tableCaptionDoc = {
30
+ name: 'TableCaption',
31
+ description: 'Provides the native accessible name and context for a table.',
32
+ props: [
33
+ {
34
+ name: 'children',
35
+ description: 'Describes the table contents.',
36
+ required: true,
37
+ },
38
+ ],
39
+ inheritedProps: ['HTMLAttributes<HTMLTableCaptionElement> except className'],
40
+ example: '<TableCaption>Quarterly values</TableCaption>',
41
+ storyId: 'core-table--table-caption',
42
+ } satisfies ComponentDoc;
43
+
44
+ export const tableHeadDoc = {
45
+ name: 'TableHead',
46
+ description: 'Groups a table’s column header rows with native semantics.',
47
+ props: [
48
+ {
49
+ name: 'children',
50
+ description: 'Supplies header rows.',
51
+ required: true,
52
+ },
53
+ ],
54
+ inheritedProps: ['HTMLAttributes<HTMLTableSectionElement> except className'],
55
+ example: '<TableHead><TableRow /></TableHead>',
56
+ storyId: 'core-table--table-head',
57
+ } satisfies ComponentDoc;
58
+
59
+ export const tableBodyDoc = {
60
+ name: 'TableBody',
61
+ description: 'Groups a table’s data rows with native semantics.',
62
+ props: [
63
+ {name: 'children', description: 'Supplies data rows.', required: true},
64
+ ],
65
+ inheritedProps: ['HTMLAttributes<HTMLTableSectionElement> except className'],
66
+ example: '<TableBody><TableRow /></TableBody>',
67
+ storyId: 'core-table--table-body',
68
+ } satisfies ComponentDoc;
69
+
70
+ export const tableRowDoc = {
71
+ name: 'TableRow',
72
+ description: 'Groups related header or data cells in a native table row.',
73
+ props: [{name: 'children', description: 'Supplies cells.', required: true}],
74
+ inheritedProps: ['HTMLAttributes<HTMLTableRowElement> except className'],
75
+ example: '<TableRow><TableCell>Value</TableCell></TableRow>',
76
+ storyId: 'core-table--table-row',
77
+ } satisfies ComponentDoc;
78
+
79
+ export const tableHeaderCellDoc = {
80
+ name: 'TableHeaderCell',
81
+ description: 'Labels a row or column through native table-header semantics.',
82
+ props: [
83
+ {
84
+ name: 'children',
85
+ description: 'Supplies the header label.',
86
+ required: true,
87
+ },
88
+ {name: 'scope', description: 'Associates the header with a row or column.'},
89
+ ],
90
+ inheritedProps: ['ThHTMLAttributes<HTMLTableCellElement> except className'],
91
+ example: '<TableHeaderCell scope="col">Name</TableHeaderCell>',
92
+ storyId: 'core-table--table-header-cell',
93
+ } satisfies ComponentDoc;
94
+
95
+ export const tableCellDoc = {
96
+ name: 'TableCell',
97
+ description: 'Renders one native data cell in a table row.',
98
+ props: [
99
+ {name: 'children', description: 'Supplies the cell value.', required: true},
100
+ ],
101
+ inheritedProps: ['TdHTMLAttributes<HTMLTableCellElement> except className'],
102
+ example: '<TableCell>24</TableCell>',
103
+ storyId: 'core-table--table-cell',
104
+ } satisfies ComponentDoc;