@mindlogic-ai/logician-ui 5.0.0-alpha.2 → 5.0.0-alpha.20

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 (525) hide show
  1. package/README.md +1 -0
  2. package/dist/components/Avatar/Avatar.d.ts +68 -11
  3. package/dist/components/Avatar/Avatar.d.ts.map +1 -1
  4. package/dist/components/Avatar/Avatar.js +41 -5
  5. package/dist/components/Avatar/Avatar.js.map +1 -1
  6. package/dist/components/Avatar/Avatar.mjs +40 -5
  7. package/dist/components/Avatar/Avatar.mjs.map +1 -1
  8. package/dist/components/Avatar/index.d.ts +2 -2
  9. package/dist/components/Avatar/index.d.ts.map +1 -1
  10. package/dist/components/Badge/Badge.d.ts.map +1 -1
  11. package/dist/components/Badge/Badge.js +5 -3
  12. package/dist/components/Badge/Badge.js.map +1 -1
  13. package/dist/components/Badge/Badge.mjs +5 -3
  14. package/dist/components/Badge/Badge.mjs.map +1 -1
  15. package/dist/components/Badge/Badge.types.d.ts +7 -5
  16. package/dist/components/Badge/Badge.types.d.ts.map +1 -1
  17. package/dist/components/Banner/Banner.types.d.ts +24 -1
  18. package/dist/components/Banner/Banner.types.d.ts.map +1 -1
  19. package/dist/components/BottomSheet/BottomSheet.styles.d.ts +2 -2
  20. package/dist/components/Button/Button.d.ts.map +1 -1
  21. package/dist/components/Button/Button.js +31 -3
  22. package/dist/components/Button/Button.js.map +1 -1
  23. package/dist/components/Button/Button.mjs +31 -3
  24. package/dist/components/Button/Button.mjs.map +1 -1
  25. package/dist/components/Button/Button.types.d.ts +38 -1
  26. package/dist/components/Button/Button.types.d.ts.map +1 -1
  27. package/dist/components/Card/Card.types.d.ts +12 -0
  28. package/dist/components/Card/Card.types.d.ts.map +1 -1
  29. package/dist/components/CodeTabs/CodeTabs.styles.d.ts +6 -5
  30. package/dist/components/CodeTabs/CodeTabs.styles.d.ts.map +1 -1
  31. package/dist/components/CodeTabs/CodeTabs.styles.js +6 -5
  32. package/dist/components/CodeTabs/CodeTabs.styles.js.map +1 -1
  33. package/dist/components/CodeTabs/CodeTabs.styles.mjs +6 -5
  34. package/dist/components/CodeTabs/CodeTabs.styles.mjs.map +1 -1
  35. package/dist/components/ColorMode/ColorModeToggle.d.ts +7 -2
  36. package/dist/components/ColorMode/ColorModeToggle.d.ts.map +1 -1
  37. package/dist/components/ColorMode/ColorModeToggle.js +8 -3
  38. package/dist/components/ColorMode/ColorModeToggle.js.map +1 -1
  39. package/dist/components/ColorMode/ColorModeToggle.mjs +8 -3
  40. package/dist/components/ColorMode/ColorModeToggle.mjs.map +1 -1
  41. package/dist/components/Confetti/Confetti.types.d.ts +5 -1
  42. package/dist/components/Confetti/Confetti.types.d.ts.map +1 -1
  43. package/dist/components/Confetti/confettiColors.d.ts +5 -5
  44. package/dist/components/Confetti/confettiColors.js +5 -5
  45. package/dist/components/Confetti/confettiColors.mjs +5 -5
  46. package/dist/components/ErrorFallback/ErrorFallback.types.d.ts +6 -0
  47. package/dist/components/ErrorFallback/ErrorFallback.types.d.ts.map +1 -1
  48. package/dist/components/Form/FormModalFooter/FormModalFooter.d.ts +1 -1
  49. package/dist/components/Form/FormModalFooter/FormModalFooter.d.ts.map +1 -1
  50. package/dist/components/Form/FormModalFooter/FormModalFooter.js +2 -2
  51. package/dist/components/Form/FormModalFooter/FormModalFooter.js.map +1 -1
  52. package/dist/components/Form/FormModalFooter/FormModalFooter.mjs +2 -2
  53. package/dist/components/Form/FormModalFooter/FormModalFooter.mjs.map +1 -1
  54. package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts +11 -1
  55. package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts.map +1 -1
  56. package/dist/components/Form/FormSection/CollapsibleFormSection.js +1 -0
  57. package/dist/components/Form/FormSection/CollapsibleFormSection.js.map +1 -1
  58. package/dist/components/Form/FormSection/CollapsibleFormSection.mjs +1 -0
  59. package/dist/components/Form/FormSection/CollapsibleFormSection.mjs.map +1 -1
  60. package/dist/components/Input/Input.d.ts.map +1 -1
  61. package/dist/components/Input/Input.js +4 -0
  62. package/dist/components/Input/Input.js.map +1 -1
  63. package/dist/components/Input/Input.mjs +4 -0
  64. package/dist/components/Input/Input.mjs.map +1 -1
  65. package/dist/components/LineGraph/LineGraph.d.ts.map +1 -1
  66. package/dist/components/LineGraph/LineGraph.js +4 -5
  67. package/dist/components/LineGraph/LineGraph.js.map +1 -1
  68. package/dist/components/LineGraph/LineGraph.mjs +5 -6
  69. package/dist/components/LineGraph/LineGraph.mjs.map +1 -1
  70. package/dist/components/LineGraph/LineGraph.types.d.ts +12 -2
  71. package/dist/components/LineGraph/LineGraph.types.d.ts.map +1 -1
  72. package/dist/components/LineGraph/seriesColors.d.ts +12 -8
  73. package/dist/components/LineGraph/seriesColors.d.ts.map +1 -1
  74. package/dist/components/LineGraph/seriesColors.js +8 -7
  75. package/dist/components/LineGraph/seriesColors.js.map +1 -1
  76. package/dist/components/LineGraph/seriesColors.mjs +8 -7
  77. package/dist/components/LineGraph/seriesColors.mjs.map +1 -1
  78. package/dist/components/Masonry/Masonry.types.d.ts +8 -3
  79. package/dist/components/Masonry/Masonry.types.d.ts.map +1 -1
  80. package/dist/components/Menu/MenuItem.types.d.ts +8 -0
  81. package/dist/components/Menu/MenuItem.types.d.ts.map +1 -1
  82. package/dist/components/Modal/ModalCloseButton.d.ts +1 -1
  83. package/dist/components/Modal/ModalCloseButton.js +1 -1
  84. package/dist/components/Modal/ModalCloseButton.mjs +1 -1
  85. package/dist/components/NavList/NavList.d.ts +35 -0
  86. package/dist/components/NavList/NavList.d.ts.map +1 -0
  87. package/dist/components/NavList/NavList.js +113 -0
  88. package/dist/components/NavList/NavList.js.map +1 -0
  89. package/dist/components/NavList/NavList.mjs +111 -0
  90. package/dist/components/NavList/NavList.mjs.map +1 -0
  91. package/dist/components/NavList/NavList.styles.d.ts +90 -0
  92. package/dist/components/NavList/NavList.styles.d.ts.map +1 -0
  93. package/dist/components/NavList/NavList.styles.js +104 -0
  94. package/dist/components/NavList/NavList.styles.js.map +1 -0
  95. package/dist/components/NavList/NavList.styles.mjs +97 -0
  96. package/dist/components/NavList/NavList.styles.mjs.map +1 -0
  97. package/dist/components/NavList/NavList.translations.json.js +19 -0
  98. package/dist/components/NavList/NavList.translations.json.js.map +1 -0
  99. package/dist/components/NavList/NavList.translations.json.mjs +14 -0
  100. package/dist/components/NavList/NavList.translations.json.mjs.map +1 -0
  101. package/dist/components/NavList/NavList.types.d.ts +140 -0
  102. package/dist/components/NavList/NavList.types.d.ts.map +1 -0
  103. package/dist/components/NavList/NavListContext.d.ts +30 -0
  104. package/dist/components/NavList/NavListContext.d.ts.map +1 -0
  105. package/dist/components/NavList/NavListContext.js +16 -0
  106. package/dist/components/NavList/NavListContext.js.map +1 -0
  107. package/dist/components/NavList/NavListContext.mjs +13 -0
  108. package/dist/components/NavList/NavListContext.mjs.map +1 -0
  109. package/dist/components/NavList/NavListGroup.d.ts +31 -0
  110. package/dist/components/NavList/NavListGroup.d.ts.map +1 -0
  111. package/dist/components/NavList/NavListGroup.js +115 -0
  112. package/dist/components/NavList/NavListGroup.js.map +1 -0
  113. package/dist/components/NavList/NavListGroup.mjs +113 -0
  114. package/dist/components/NavList/NavListGroup.mjs.map +1 -0
  115. package/dist/components/NavList/NavListItem.d.ts +16 -0
  116. package/dist/components/NavList/NavListItem.d.ts.map +1 -0
  117. package/dist/components/NavList/NavListItem.js +284 -0
  118. package/dist/components/NavList/NavListItem.js.map +1 -0
  119. package/dist/components/NavList/NavListItem.mjs +282 -0
  120. package/dist/components/NavList/NavListItem.mjs.map +1 -0
  121. package/dist/components/NavList/NavListSkeleton.d.ts +17 -0
  122. package/dist/components/NavList/NavListSkeleton.d.ts.map +1 -0
  123. package/dist/components/NavList/NavListSkeleton.js +33 -0
  124. package/dist/components/NavList/NavListSkeleton.js.map +1 -0
  125. package/dist/components/NavList/NavListSkeleton.mjs +31 -0
  126. package/dist/components/NavList/NavListSkeleton.mjs.map +1 -0
  127. package/dist/components/NavList/index.d.ts +7 -0
  128. package/dist/components/NavList/index.d.ts.map +1 -0
  129. package/dist/components/Pagination/Pagination.d.ts +11 -10
  130. package/dist/components/Pagination/Pagination.d.ts.map +1 -1
  131. package/dist/components/Pagination/Pagination.js +11 -10
  132. package/dist/components/Pagination/Pagination.js.map +1 -1
  133. package/dist/components/Pagination/Pagination.mjs +11 -10
  134. package/dist/components/Pagination/Pagination.mjs.map +1 -1
  135. package/dist/components/ProgressBar/ProgressBar.types.d.ts +9 -0
  136. package/dist/components/ProgressBar/ProgressBar.types.d.ts.map +1 -1
  137. package/dist/components/RadialProgress/RadialProgress.types.d.ts +21 -1
  138. package/dist/components/RadialProgress/RadialProgress.types.d.ts.map +1 -1
  139. package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts +8 -0
  140. package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts.map +1 -1
  141. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  142. package/dist/components/SegmentedControl/SegmentedControl.js +6 -7
  143. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  144. package/dist/components/SegmentedControl/SegmentedControl.mjs +6 -7
  145. package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  146. package/dist/components/SegmentedProgressBar/SegmentedProgressBar.types.d.ts +2 -0
  147. package/dist/components/SegmentedProgressBar/SegmentedProgressBar.types.d.ts.map +1 -1
  148. package/dist/components/Select/Combobox.d.ts +1 -1
  149. package/dist/components/Select/Combobox.d.ts.map +1 -1
  150. package/dist/components/Select/Combobox.js +9 -2
  151. package/dist/components/Select/Combobox.js.map +1 -1
  152. package/dist/components/Select/Combobox.mjs +10 -3
  153. package/dist/components/Select/Combobox.mjs.map +1 -1
  154. package/dist/components/Select/Select.d.ts +1 -1
  155. package/dist/components/Select/Select.d.ts.map +1 -1
  156. package/dist/components/Select/Select.js +14 -2
  157. package/dist/components/Select/Select.js.map +1 -1
  158. package/dist/components/Select/Select.mjs +15 -3
  159. package/dist/components/Select/Select.mjs.map +1 -1
  160. package/dist/components/Select/Select.styles.d.ts +97 -1
  161. package/dist/components/Select/Select.styles.d.ts.map +1 -1
  162. package/dist/components/Select/Select.styles.js +83 -0
  163. package/dist/components/Select/Select.styles.js.map +1 -1
  164. package/dist/components/Select/Select.styles.mjs +82 -1
  165. package/dist/components/Select/Select.styles.mjs.map +1 -1
  166. package/dist/components/Tabs/Tab/Tab.styles.d.ts +1 -1
  167. package/dist/components/Tabs/Tab/Tab.styles.js +1 -1
  168. package/dist/components/Tabs/Tab/Tab.styles.mjs +1 -1
  169. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  170. package/dist/components/Textarea/Textarea.js +4 -0
  171. package/dist/components/Textarea/Textarea.js.map +1 -1
  172. package/dist/components/Textarea/Textarea.mjs +4 -0
  173. package/dist/components/Textarea/Textarea.mjs.map +1 -1
  174. package/dist/components/Toast/Toast.styles.d.ts +6 -2
  175. package/dist/components/Toast/Toast.styles.d.ts.map +1 -1
  176. package/dist/components/Toast/Toast.styles.js +18 -10
  177. package/dist/components/Toast/Toast.styles.js.map +1 -1
  178. package/dist/components/Toast/Toast.styles.mjs +18 -10
  179. package/dist/components/Toast/Toast.styles.mjs.map +1 -1
  180. package/dist/components/Typography/Caption.d.ts.map +1 -1
  181. package/dist/components/Typography/Caption.js +1 -1
  182. package/dist/components/Typography/Caption.js.map +1 -1
  183. package/dist/components/Typography/Caption.mjs +1 -1
  184. package/dist/components/Typography/Caption.mjs.map +1 -1
  185. package/dist/components/Typography/H1.d.ts.map +1 -1
  186. package/dist/components/Typography/H1.js +1 -1
  187. package/dist/components/Typography/H1.js.map +1 -1
  188. package/dist/components/Typography/H1.mjs +1 -1
  189. package/dist/components/Typography/H1.mjs.map +1 -1
  190. package/dist/components/Typography/H2.d.ts.map +1 -1
  191. package/dist/components/Typography/H2.js +1 -1
  192. package/dist/components/Typography/H2.js.map +1 -1
  193. package/dist/components/Typography/H2.mjs +1 -1
  194. package/dist/components/Typography/H2.mjs.map +1 -1
  195. package/dist/components/Typography/H3.d.ts.map +1 -1
  196. package/dist/components/Typography/H3.js +1 -1
  197. package/dist/components/Typography/H3.js.map +1 -1
  198. package/dist/components/Typography/H3.mjs +1 -1
  199. package/dist/components/Typography/H3.mjs.map +1 -1
  200. package/dist/components/Typography/H4.d.ts.map +1 -1
  201. package/dist/components/Typography/H4.js +1 -1
  202. package/dist/components/Typography/H4.js.map +1 -1
  203. package/dist/components/Typography/H4.mjs +1 -1
  204. package/dist/components/Typography/H4.mjs.map +1 -1
  205. package/dist/components/Typography/H5.d.ts.map +1 -1
  206. package/dist/components/Typography/H5.js +1 -1
  207. package/dist/components/Typography/H5.js.map +1 -1
  208. package/dist/components/Typography/H5.mjs +1 -1
  209. package/dist/components/Typography/H5.mjs.map +1 -1
  210. package/dist/components/Typography/Link.d.ts.map +1 -1
  211. package/dist/components/Typography/Link.js +1 -1
  212. package/dist/components/Typography/Link.js.map +1 -1
  213. package/dist/components/Typography/Link.mjs +1 -1
  214. package/dist/components/Typography/Link.mjs.map +1 -1
  215. package/dist/components/Typography/Overline.d.ts.map +1 -1
  216. package/dist/components/Typography/Overline.js +1 -1
  217. package/dist/components/Typography/Overline.js.map +1 -1
  218. package/dist/components/Typography/Overline.mjs +1 -1
  219. package/dist/components/Typography/Overline.mjs.map +1 -1
  220. package/dist/components/Typography/Subtext.d.ts.map +1 -1
  221. package/dist/components/Typography/Subtext.js +1 -1
  222. package/dist/components/Typography/Subtext.js.map +1 -1
  223. package/dist/components/Typography/Subtext.mjs +1 -1
  224. package/dist/components/Typography/Subtext.mjs.map +1 -1
  225. package/dist/components/Typography/Subtitle.d.ts.map +1 -1
  226. package/dist/components/Typography/Subtitle.js +1 -1
  227. package/dist/components/Typography/Subtitle.js.map +1 -1
  228. package/dist/components/Typography/Subtitle.mjs +1 -1
  229. package/dist/components/Typography/Subtitle.mjs.map +1 -1
  230. package/dist/components/Typography/Text.d.ts.map +1 -1
  231. package/dist/components/Typography/Text.js +1 -1
  232. package/dist/components/Typography/Text.js.map +1 -1
  233. package/dist/components/Typography/Text.mjs +1 -1
  234. package/dist/components/Typography/Text.mjs.map +1 -1
  235. package/dist/hooks/useLanguage.d.ts +5 -0
  236. package/dist/hooks/useLanguage.d.ts.map +1 -1
  237. package/dist/hooks/useLanguage.js +7 -3
  238. package/dist/hooks/useLanguage.js.map +1 -1
  239. package/dist/hooks/useLanguage.mjs +7 -4
  240. package/dist/hooks/useLanguage.mjs.map +1 -1
  241. package/dist/hooks/useTranslate.d.ts.map +1 -1
  242. package/dist/hooks/useTranslate.js +8 -5
  243. package/dist/hooks/useTranslate.js.map +1 -1
  244. package/dist/hooks/useTranslate.mjs +8 -5
  245. package/dist/hooks/useTranslate.mjs.map +1 -1
  246. package/dist/index.d.ts +2 -1
  247. package/dist/index.d.ts.map +1 -1
  248. package/dist/index.js +13 -0
  249. package/dist/index.js.map +1 -1
  250. package/dist/index.mjs +7 -2
  251. package/dist/index.mjs.map +1 -1
  252. package/dist/theme/colors.d.ts +2 -2
  253. package/dist/theme/colors.d.ts.map +1 -1
  254. package/dist/theme/colors.js +54 -18
  255. package/dist/theme/colors.js.map +1 -1
  256. package/dist/theme/colors.mjs +55 -19
  257. package/dist/theme/colors.mjs.map +1 -1
  258. package/dist/theme/global.d.ts.map +1 -1
  259. package/dist/theme/global.js +19 -1
  260. package/dist/theme/global.js.map +1 -1
  261. package/dist/theme/global.mjs +19 -1
  262. package/dist/theme/global.mjs.map +1 -1
  263. package/dist/theme/index.d.ts.map +1 -1
  264. package/dist/theme/index.js +2 -0
  265. package/dist/theme/index.js.map +1 -1
  266. package/dist/theme/index.mjs +2 -0
  267. package/dist/theme/index.mjs.map +1 -1
  268. package/dist/theme/palette.generated.d.ts +232 -123
  269. package/dist/theme/palette.generated.d.ts.map +1 -1
  270. package/dist/theme/palette.generated.js +233 -123
  271. package/dist/theme/palette.generated.js.map +1 -1
  272. package/dist/theme/palette.generated.mjs +233 -124
  273. package/dist/theme/palette.generated.mjs.map +1 -1
  274. package/dist/theme/paletteSwatches.d.ts +20 -0
  275. package/dist/theme/paletteSwatches.d.ts.map +1 -1
  276. package/dist/theme/recipes/avatar.d.ts +30 -0
  277. package/dist/theme/recipes/avatar.d.ts.map +1 -0
  278. package/dist/theme/recipes/avatar.js +96 -0
  279. package/dist/theme/recipes/avatar.js.map +1 -0
  280. package/dist/theme/recipes/avatar.mjs +94 -0
  281. package/dist/theme/recipes/avatar.mjs.map +1 -0
  282. package/dist/translations/Defaults.translations.json.js +19 -1
  283. package/dist/translations/Defaults.translations.json.js.map +1 -1
  284. package/dist/translations/Defaults.translations.json.mjs +18 -2
  285. package/dist/translations/Defaults.translations.json.mjs.map +1 -1
  286. package/dist/utils/disabledControl.d.ts +8 -1
  287. package/dist/utils/disabledControl.d.ts.map +1 -1
  288. package/dist/utils/disabledControl.js +8 -1
  289. package/dist/utils/disabledControl.js.map +1 -1
  290. package/dist/utils/disabledControl.mjs +8 -1
  291. package/dist/utils/disabledControl.mjs.map +1 -1
  292. package/dist/utils/focusRing.d.ts +22 -0
  293. package/dist/utils/focusRing.d.ts.map +1 -1
  294. package/dist/utils/focusRing.js +22 -0
  295. package/dist/utils/focusRing.js.map +1 -1
  296. package/dist/utils/focusRing.mjs +21 -1
  297. package/dist/utils/focusRing.mjs.map +1 -1
  298. package/package.json +2 -1
  299. package/src/components/Accordion/Accordion.stories.tsx +85 -0
  300. package/src/components/Accordion/Accordion.usage.mdx +200 -0
  301. package/src/components/Appear/Appear.usage.mdx +107 -0
  302. package/src/components/Avatar/Avatar.recipe.test.tsx +176 -0
  303. package/src/components/Avatar/Avatar.stories.tsx +199 -24
  304. package/src/components/Avatar/Avatar.tsx +118 -21
  305. package/src/components/Avatar/Avatar.usage.mdx +185 -0
  306. package/src/components/Avatar/index.tsx +8 -1
  307. package/src/components/Badge/Badge.stories.tsx +193 -3
  308. package/src/components/Badge/Badge.tsx +5 -3
  309. package/src/components/Badge/Badge.types.ts +7 -5
  310. package/src/components/Badge/Badge.usage.mdx +265 -0
  311. package/src/components/Banner/Banner.stories.tsx +152 -2
  312. package/src/components/Banner/Banner.types.ts +30 -1
  313. package/src/components/Banner/Banner.usage.mdx +233 -0
  314. package/src/components/BottomSheet/BottomSheet.stories.tsx +168 -1
  315. package/src/components/BottomSheet/BottomSheet.test.tsx +2 -1
  316. package/src/components/BottomSheet/BottomSheet.usage.mdx +216 -0
  317. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +59 -0
  318. package/src/components/Breadcrumb/Breadcrumb.usage.mdx +181 -0
  319. package/src/components/Button/Button.focusableWhenDisabled.test.tsx +218 -0
  320. package/src/components/Button/Button.stories.tsx +332 -3
  321. package/src/components/Button/Button.tsx +46 -3
  322. package/src/components/Button/Button.types.ts +38 -1
  323. package/src/components/Button/Button.usage.mdx +358 -0
  324. package/src/components/Button/Button.variants.test.tsx +13 -1
  325. package/src/components/Card/Card.stories.tsx +106 -0
  326. package/src/components/Card/Card.types.ts +12 -0
  327. package/src/components/Card/Card.usage.mdx +216 -0
  328. package/src/components/Checkbox/Checkbox.stories.tsx +140 -13
  329. package/src/components/Checkbox/Checkbox.usage.mdx +214 -0
  330. package/src/components/Chip/Chip.usage.mdx +78 -0
  331. package/src/components/Code/Code.stories.tsx +60 -0
  332. package/src/components/Code/Code.usage.mdx +187 -0
  333. package/src/components/CodeTabs/CodeTabs.stories.tsx +53 -0
  334. package/src/components/CodeTabs/CodeTabs.styles.ts +6 -5
  335. package/src/components/CodeTabs/CodeTabs.usage.mdx +176 -0
  336. package/src/components/Collapsible/Collapsible.stories.tsx +58 -0
  337. package/src/components/Collapsible/Collapsible.usage.mdx +173 -0
  338. package/src/components/ColorMode/ColorMode.stories.tsx +50 -0
  339. package/src/components/ColorMode/ColorMode.usage.mdx +135 -0
  340. package/src/components/ColorMode/ColorModeToggle.tsx +10 -3
  341. package/src/components/Confetti/Confetti.types.ts +5 -1
  342. package/src/components/Confetti/Confetti.usage.mdx +111 -0
  343. package/src/components/Confetti/confettiColors.ts +5 -5
  344. package/src/components/Container/Container.stories.tsx +32 -0
  345. package/src/components/Container/Container.usage.mdx +130 -0
  346. package/src/components/CopyableCode/CopyableCode.stories.tsx +62 -0
  347. package/src/components/CopyableCode/CopyableCode.usage.mdx +168 -0
  348. package/src/components/CountBadge/CountBadge.stories.tsx +69 -0
  349. package/src/components/CountBadge/CountBadge.usage.mdx +215 -0
  350. package/src/components/CountUp/CountUp.usage.mdx +107 -0
  351. package/src/components/DatePicker/DatePicker.usage.mdx +177 -0
  352. package/src/components/DatePicker/RangeDatePicker.stories.tsx +87 -3
  353. package/src/components/ErrorFallback/ErrorFallback.types.ts +6 -0
  354. package/src/components/ErrorFallback/ErrorFallback.usage.mdx +127 -0
  355. package/src/components/ExpandableText/ExpandableText.stories.tsx +55 -0
  356. package/src/components/ExpandableText/ExpandableText.usage.mdx +176 -0
  357. package/src/components/FileInput/FileInput.stories.tsx +38 -1
  358. package/src/components/FileInput/FileInput.usage.mdx +178 -0
  359. package/src/components/FileItem/FileItem.stories.tsx +71 -0
  360. package/src/components/FileItem/FileItem.usage.mdx +180 -0
  361. package/src/components/FileList/FileList.stories.tsx +25 -0
  362. package/src/components/FileList/FileList.usage.mdx +165 -0
  363. package/src/components/FlyTo/FlyTo.usage.mdx +99 -0
  364. package/src/components/Form/Form.stories.tsx +149 -0
  365. package/src/components/Form/Form.usage.mdx +203 -0
  366. package/src/components/Form/FormModalFooter/FormModalFooter.stories.tsx +1 -1
  367. package/src/components/Form/FormModalFooter/FormModalFooter.test.tsx +19 -1
  368. package/src/components/Form/FormModalFooter/FormModalFooter.tsx +2 -0
  369. package/src/components/Form/FormModalFooter/FormModalFooter.types.ts +11 -1
  370. package/src/components/FormControl/FormControl.stories.tsx +35 -0
  371. package/src/components/FormControl/FormControl.usage.mdx +128 -0
  372. package/src/components/FormIntegration/FormIntegration.usage.mdx +158 -0
  373. package/src/components/FormLabel/FormLabel.stories.tsx +71 -0
  374. package/src/components/FormLabel/FormLabel.usage.mdx +125 -0
  375. package/src/components/Icon/Icon.stories.tsx +61 -1
  376. package/src/components/Icon/Icon.usage.mdx +158 -0
  377. package/src/components/IconButton/IconButton.stories.tsx +213 -5
  378. package/src/components/IconButton/IconButton.usage.mdx +275 -0
  379. package/src/components/InfoSprinkle/InfoSprinkle.stories.tsx +77 -1
  380. package/src/components/InfoSprinkle/InfoSprinkle.usage.mdx +189 -0
  381. package/src/components/InlineCode/InlineCode.stories.tsx +75 -0
  382. package/src/components/InlineCode/InlineCode.usage.mdx +142 -0
  383. package/src/components/Input/Input.stories.tsx +180 -0
  384. package/src/components/Input/Input.tsx +4 -0
  385. package/src/components/Input/Input.usage.mdx +278 -0
  386. package/src/components/LineGraph/LineGraph.stories.tsx +112 -0
  387. package/src/components/LineGraph/LineGraph.tsx +4 -5
  388. package/src/components/LineGraph/LineGraph.types.ts +12 -2
  389. package/src/components/LineGraph/LineGraph.usage.mdx +186 -0
  390. package/src/components/LineGraph/seriesColors.test.ts +10 -9
  391. package/src/components/LineGraph/seriesColors.ts +18 -16
  392. package/src/components/Loaders/Loaders.stories.tsx +93 -0
  393. package/src/components/Loaders/Loaders.usage.mdx +180 -0
  394. package/src/components/LogicianProvider/LogicianProvider.usage.mdx +98 -0
  395. package/src/components/Markdown/Markdown.stories.tsx +53 -0
  396. package/src/components/Markdown/Markdown.usage.mdx +182 -0
  397. package/src/components/Masonry/Masonry.stories.tsx +63 -1
  398. package/src/components/Masonry/Masonry.types.ts +8 -3
  399. package/src/components/Masonry/Masonry.usage.mdx +142 -0
  400. package/src/components/MaxLengthIndicator/MaxLengthIndicator.stories.tsx +57 -0
  401. package/src/components/MaxLengthIndicator/MaxLengthIndicator.usage.mdx +125 -0
  402. package/src/components/Menu/Menu.stories.tsx +146 -2
  403. package/src/components/Menu/Menu.usage.mdx +238 -0
  404. package/src/components/Menu/MenuItem.types.ts +8 -0
  405. package/src/components/Modal/Modal.stories.tsx +177 -1
  406. package/src/components/Modal/Modal.usage.mdx +262 -0
  407. package/src/components/Modal/ModalCloseButton.tsx +1 -1
  408. package/src/components/MonthPicker/MonthPicker.stories.tsx +30 -0
  409. package/src/components/MonthPicker/MonthPicker.usage.mdx +191 -0
  410. package/src/components/NavList/NavList.stories.tsx +927 -0
  411. package/src/components/NavList/NavList.styles.ts +114 -0
  412. package/src/components/NavList/NavList.test.tsx +1306 -0
  413. package/src/components/NavList/NavList.translations.json +9 -0
  414. package/src/components/NavList/NavList.tsx +160 -0
  415. package/src/components/NavList/NavList.types.ts +155 -0
  416. package/src/components/NavList/NavList.usage.mdx +545 -0
  417. package/src/components/NavList/NavListContext.ts +25 -0
  418. package/src/components/NavList/NavListGroup.tsx +243 -0
  419. package/src/components/NavList/NavListItem.tsx +543 -0
  420. package/src/components/NavList/NavListSkeleton.tsx +57 -0
  421. package/src/components/NavList/index.ts +15 -0
  422. package/src/components/Pagination/Pagination.stories.tsx +90 -1
  423. package/src/components/Pagination/Pagination.tsx +11 -10
  424. package/src/components/Pagination/Pagination.usage.mdx +186 -0
  425. package/src/components/PasswordInput/PasswordInput.stories.tsx +51 -0
  426. package/src/components/PasswordInput/PasswordInput.usage.mdx +193 -0
  427. package/src/components/PinInput/PinInput.stories.tsx +91 -0
  428. package/src/components/PinInput/PinInput.usage.mdx +194 -0
  429. package/src/components/Popover/Popover.stories.tsx +104 -1
  430. package/src/components/Popover/Popover.usage.mdx +197 -0
  431. package/src/components/ProgressBar/ProgressBar.stories.tsx +92 -1
  432. package/src/components/ProgressBar/ProgressBar.types.ts +9 -0
  433. package/src/components/ProgressBar/ProgressBar.usage.mdx +210 -0
  434. package/src/components/Pulse/Pulse.usage.mdx +102 -0
  435. package/src/components/RadialProgress/RadialProgress.stories.tsx +74 -1
  436. package/src/components/RadialProgress/RadialProgress.types.ts +21 -1
  437. package/src/components/RadialProgress/RadialProgress.usage.mdx +153 -0
  438. package/src/components/Radio/Radio.stories.tsx +119 -0
  439. package/src/components/Radio/Radio.usage.mdx +187 -0
  440. package/src/components/Reveal/Reveal.usage.mdx +105 -0
  441. package/src/components/ScaledContext/ScaledContext.usage.mdx +111 -0
  442. package/src/components/SeeMoreButton/SeeMoreButton.stories.tsx +146 -2
  443. package/src/components/SeeMoreButton/SeeMoreButton.types.ts +8 -0
  444. package/src/components/SeeMoreButton/SeeMoreButton.usage.mdx +213 -0
  445. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +69 -0
  446. package/src/components/SegmentedControl/SegmentedControl.tsx +6 -7
  447. package/src/components/SegmentedControl/SegmentedControl.usage.mdx +209 -0
  448. package/src/components/SegmentedProgressBar/SegmentedProgressBar.stories.tsx +54 -0
  449. package/src/components/SegmentedProgressBar/SegmentedProgressBar.types.ts +2 -0
  450. package/src/components/SegmentedProgressBar/SegmentedProgressBar.usage.mdx +145 -0
  451. package/src/components/Select/Combobox.tsx +28 -3
  452. package/src/components/Select/Select.clearTrigger.test.tsx +76 -0
  453. package/src/components/Select/Select.stories.tsx +290 -1
  454. package/src/components/Select/Select.styles.ts +89 -0
  455. package/src/components/Select/Select.tsx +28 -2
  456. package/src/components/Select/Select.usage.mdx +341 -0
  457. package/src/components/Shake/Shake.usage.mdx +107 -0
  458. package/src/components/Slider/Slider.stories.tsx +116 -0
  459. package/src/components/Slider/Slider.usage.mdx +179 -0
  460. package/src/components/Spinner/Spinner.stories.tsx +64 -0
  461. package/src/components/Spinner/Spinner.usage.mdx +136 -0
  462. package/src/components/SwapTransition/SwapTransition.usage.mdx +102 -0
  463. package/src/components/Switch/Switch.stories.tsx +131 -6
  464. package/src/components/Switch/Switch.usage.mdx +199 -0
  465. package/src/components/Table/Table.stories.tsx +159 -1
  466. package/src/components/Table/Table.usage.mdx +235 -0
  467. package/src/components/Tabs/Tab/Tab.styles.ts +1 -1
  468. package/src/components/Tabs/Tabs.stories.tsx +86 -0
  469. package/src/components/Tabs/Tabs.usage.mdx +263 -0
  470. package/src/components/Tag/Tag.stories.tsx +181 -4
  471. package/src/components/Tag/Tag.usage.mdx +257 -0
  472. package/src/components/Textarea/Textarea.stories.tsx +113 -0
  473. package/src/components/Textarea/Textarea.tsx +4 -0
  474. package/src/components/Textarea/Textarea.usage.mdx +186 -0
  475. package/src/components/Toast/Toast.stories.tsx +185 -3
  476. package/src/components/Toast/Toast.styles.ts +18 -10
  477. package/src/components/Toast/Toast.usage.mdx +265 -0
  478. package/src/components/Tooltip/Tooltip.stories.tsx +86 -1
  479. package/src/components/Tooltip/Tooltip.usage.mdx +219 -0
  480. package/src/components/Tree/Tree.stories.tsx +89 -0
  481. package/src/components/Tree/Tree.usage.mdx +207 -0
  482. package/src/components/Typography/Caption.tsx +0 -1
  483. package/src/components/Typography/H1.tsx +0 -1
  484. package/src/components/Typography/H2.tsx +0 -1
  485. package/src/components/Typography/H3.tsx +0 -1
  486. package/src/components/Typography/H4.tsx +0 -1
  487. package/src/components/Typography/H5.tsx +0 -1
  488. package/src/components/Typography/Link.tsx +0 -1
  489. package/src/components/Typography/Overline.tsx +0 -1
  490. package/src/components/Typography/Subtext.tsx +0 -1
  491. package/src/components/Typography/Subtitle.tsx +0 -1
  492. package/src/components/Typography/Text.tsx +0 -1
  493. package/src/components/Typography/Typography.stories.tsx +117 -0
  494. package/src/components/Typography/Typography.usage.mdx +257 -0
  495. package/src/components/Workflow/Workflow.usage.mdx +199 -0
  496. package/src/components/a11y.kwcag.test.tsx +66 -0
  497. package/src/components/claude.md +1 -1
  498. package/src/components/noRawScales.test.ts +5 -1
  499. package/src/foundations/BrandAssets.mdx +637 -0
  500. package/src/foundations/BrandAssets.stories.tsx +680 -0
  501. package/src/foundations/BrandColour.mdx +366 -0
  502. package/src/foundations/BrandColour.stories.tsx +343 -0
  503. package/src/guidelines/ComponentPageTemplate.mdx +84 -0
  504. package/src/guidelines/FeedbackActions.mdx +162 -23
  505. package/src/guidelines/_components/Lang.tsx +175 -0
  506. package/src/guidelines/_components/TokenTable.tsx +136 -0
  507. package/src/hooks/useLanguage.ts +8 -3
  508. package/src/hooks/useTranslate.test.tsx +46 -0
  509. package/src/hooks/useTranslate.ts +7 -5
  510. package/src/index.ts +7 -1
  511. package/src/theme/BazePalette.stories.tsx +111 -1
  512. package/src/theme/Palette.stories.tsx +2 -2
  513. package/src/theme/SemanticTokens.mdx +76 -17
  514. package/src/theme/claude.md +23 -9
  515. package/src/theme/colors.ts +71 -18
  516. package/src/theme/contrast.test.ts +57 -0
  517. package/src/theme/global.ts +20 -1
  518. package/src/theme/index.ts +2 -0
  519. package/src/theme/palette.generated.ts +233 -123
  520. package/src/theme/paletteSwatches.test.ts +1 -1
  521. package/src/theme/paletteSwatches.ts +35 -0
  522. package/src/theme/recipes/avatar.ts +92 -0
  523. package/src/translations/Defaults.translations.json +14 -0
  524. package/src/utils/disabledControl.ts +8 -1
  525. package/src/utils/focusRing.ts +23 -0
@@ -0,0 +1,265 @@
1
+ import { ArgTypes, Canvas, Meta } from '@storybook/blocks';
2
+
3
+ import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
4
+ import * as ToastStories from './Toast.stories';
5
+
6
+ <Meta of={ToastStories} name="Usage" />
7
+
8
+ <LangToggle />
9
+
10
+ <En>
11
+
12
+ # Toast
13
+
14
+ A short message that confirms the result of something the reader just did,
15
+ then goes away on its own.
16
+
17
+ ## When to use
18
+
19
+ - To confirm an action that has no other visible result: 링크를 복사했습니다,
20
+ 설정을 저장했습니다.
21
+ - To report that a background action failed or finished, when the reader is
22
+ no longer looking at where it started.
23
+ - To offer one follow-up to that result: undo a delete, open the exported file.
24
+
25
+ ## When not to use
26
+
27
+ - The message must stay until the condition changes → `Banner`.
28
+ - An error about one field → the field's error text (`FormControl`). The
29
+ toast disappears; the field is still wrong.
30
+ - The reader has to decide before going on → `Modal`.
31
+ - Progress of a long job → `ProgressBar`, in the place where the job runs.
32
+ - A status attached to one item → `Badge`.
33
+
34
+ ## How it works
35
+
36
+ - Mount `<Toaster />` once, at the root of the app. Then call
37
+ `const showToast = useToast()` and `showToast({ status, title?, description, action? })`.
38
+ It returns the toast id; `showToast.update(id, options)`,
39
+ `showToast.dismiss(id)` and `showToast.dismissAll()` work on it.
40
+ - A toast closes after 5 s, or 8 s when it has an `action`, unless you pass
41
+ `duration`. Hovering or focusing the toasts pauses the timer, and so does
42
+ leaving the browser tab.
43
+ - `useToast` keeps at most three of its toasts; a fourth closes the oldest.
44
+ - Every toast appears at the top of the window. Placement is set once in
45
+ `Toaster.tsx`, not per toast.
46
+ - `useToast()` returns a new function on every render. Do not list it as an
47
+ effect dependency without wrapping it first.
48
+
49
+ ## Variants and what they mean
50
+
51
+ </En>
52
+
53
+ <Ko>
54
+
55
+ # Toast
56
+
57
+ 사용자가 방금 한 일의 결과를 짧게 확인해 주고, 잠시 뒤 저절로 사라지는 메시지입니다.
58
+
59
+ ## 언제 쓰나요
60
+
61
+ - 화면에 다른 결과가 보이지 않는 동작을 확인해 줄 때: 링크를 복사했습니다, 설정을
62
+ 저장했습니다.
63
+ - 백그라운드 작업이 끝나거나 실패했는데, 사용자가 이미 다른 곳을 보고 있을 때.
64
+ - 그 결과에 이어서 할 일이 하나 있을 때: 삭제 되돌리기, 내보낸 파일 열기.
65
+
66
+ ## 언제 쓰지 않나요
67
+
68
+ - 원인이 해결될 때까지 남아 있어야 하는 안내는 `Banner`를 씁니다.
69
+ - 입력란 하나의 오류는 그 입력란의 오류 문구(`FormControl`)로 알립니다. 토스트는
70
+ 사라지지만 입력란은 여전히 틀린 상태입니다.
71
+ - 사용자가 결정해야 다음으로 넘어갈 수 있다면 `Modal`을 씁니다.
72
+ - 오래 걸리는 작업의 진행률은 그 작업이 돌아가는 자리에 `ProgressBar`로 보여 줍니다.
73
+ - 항목 하나에 붙는 상태는 `Badge`를 씁니다.
74
+
75
+ ## 동작 방식
76
+
77
+ - 앱 맨 위에 `<Toaster />`를 한 번만 둡니다. 그다음 `const showToast = useToast()`를
78
+ 부르고 `showToast({ status, title?, description, action? })`로 띄웁니다. 반환값은
79
+ 토스트 id이며, `showToast.update(id, options)`, `showToast.dismiss(id)`,
80
+ `showToast.dismissAll()`에 씁니다.
81
+ - `duration`을 넘기지 않으면 5초 뒤에 닫히고, `action`이 있으면 8초 뒤에 닫힙니다.
82
+ 토스트 위에 마우스를 올리거나 초점을 옮기면 시간이 멈추고, 브라우저 탭을 떠나도
83
+ 멈춥니다.
84
+ - `useToast`로 띄운 토스트는 세 개까지 남고, 네 번째가 뜨면 가장 오래된 것이 닫힙니다.
85
+ - 토스트는 모두 창 위쪽에 뜹니다. 위치는 `Toaster.tsx`에서 한 번 정하며, 토스트마다
86
+ 바꿀 수 없습니다.
87
+ - `useToast()`는 렌더할 때마다 새 함수를 돌려줍니다. 감싸지 않은 채 effect 의존성에
88
+ 넣지 않습니다.
89
+
90
+ ## 변형과 뜻
91
+
92
+ </Ko>
93
+
94
+ <ArgTypes of={ToastStories} include={['status', 'action']} />
95
+
96
+ <En>
97
+
98
+ | Status | Means | Use for |
99
+ | --- | --- | --- |
100
+ | `neutral` (default) | A plain result with no status; no icon. Inverted (`tooltip.bg` / `tooltip.fg`) so it stands out on a white page | Copied, moved, sent |
101
+ | `success` | Done as asked | Saved, uploaded, deleted |
102
+ | `info` | A fact about what just happened; nothing is wrong | Export ready, model switched for you |
103
+ | `warning` | Done, but not quite as expected | Some files skipped |
104
+ | `error` | It did not happen | Request failed, out of credits |
105
+
106
+ ## Do / Don't
107
+
108
+ </En>
109
+
110
+ <Ko>
111
+
112
+ | 상태 | 뜻 | 예 |
113
+ | --- | --- | --- |
114
+ | `neutral` (기본) | 상태가 없는 단순한 결과이며 아이콘도 없음. 흰 화면에서도 잘 보이도록 반전색(`tooltip.bg` / `tooltip.fg`)을 씀 | 복사, 이동, 전송 |
115
+ | `success` | 요청한 대로 끝남 | 저장, 업로드, 삭제 |
116
+ | `info` | 방금 일어난 일에 대한 사실이며, 문제가 있다는 뜻은 아님 | 내보내기 완료, 모델 자동 변경 |
117
+ | `warning` | 끝났지만 예상과 조금 다름 | 일부 파일 건너뜀 |
118
+ | `error` | 일어나지 않음 | 요청 실패, 크레딧 부족 |
119
+
120
+ ## 이렇게 하세요 / 이렇게 하지 마세요
121
+
122
+ </Ko>
123
+
124
+ <Canvas of={ToastStories.DoActionProp} />
125
+ <Verdict
126
+ kind="do"
127
+ en="Pass the follow-up as action. It renders as a text action in the toast's own colour, lined up with the message."
128
+ ko="이어서 할 일은 action으로 넘깁니다. 토스트와 같은 색의 글자 버튼으로, 메시지와 줄을 맞춰 그려집니다."
129
+ />
130
+
131
+ <Canvas of={ToastStories.DontButtonInDescription} />
132
+ <Verdict
133
+ kind="dont"
134
+ en="Put a Button inside description. It carries none of the toast's colours and reads as a separate card on top."
135
+ ko="description 안에 Button을 넣지 마세요. 토스트의 색을 따르지 않아서 위에 따로 얹은 카드처럼 보입니다."
136
+ />
137
+
138
+ <Canvas of={ToastStories.DoUndoAfterDelete} />
139
+ <Verdict
140
+ kind="do"
141
+ en="Confirm a delete and offer undo. One action only; closing is the ×."
142
+ ko="삭제를 확인해 주고 되돌리기를 제안합니다. 동작은 하나만 두고, 닫기는 ×가 맡습니다."
143
+ />
144
+
145
+ <Canvas of={ToastStories.DontToastForFieldError} />
146
+ <Verdict
147
+ kind="dont"
148
+ en="Report a field error in a toast. It is gone in five seconds and does not say which field. Show the error under the field."
149
+ ko="입력란 오류를 토스트로 알리지 마세요. 5초 뒤에 사라지고, 어느 입력란인지도 알려 주지 않습니다. 오류는 입력란 아래에 보여 줍니다."
150
+ />
151
+
152
+ <Canvas of={ToastStories.DoNeutralResult} />
153
+ <Verdict
154
+ kind="do"
155
+ en="Use neutral for a plain result. A green check on every copy makes success mean nothing."
156
+ ko="단순한 결과에는 neutral을 씁니다. 복사할 때마다 초록 체크를 띄우면 success가 아무 뜻도 전하지 못합니다."
157
+ />
158
+
159
+ <En>
160
+
161
+ ## Content
162
+
163
+ - One sentence in `description`, in the past tense for a result:
164
+ "채팅을 삭제했습니다." Add a `title` only when the description needs a
165
+ heading to make sense.
166
+ - Say what happened, not what the system is: "크레딧이 부족해 응답을 생성하지
167
+ 못했습니다", not "402 Payment Required".
168
+ - The action label is a short verb phrase: 되돌리기, 크레딧 구매, 파일 열기.
169
+ - Do not put information the reader needs later only in a toast. It will be
170
+ gone.
171
+
172
+ ## Accessibility
173
+
174
+ What Toast does for you:
175
+
176
+ - Each toast is `role="status"` inside a polite live region, so screen readers
177
+ read it without moving focus (WCAG 4.1.3).
178
+ - `Alt+T` moves focus to the toasts; `Escape` closes the focused toast. The
179
+ action and the × are real buttons (WCAG 2.1.1).
180
+ - Hover and focus pause the timer, and the action toast stays longer (8 s), so
181
+ the reader has time to act (WCAG 2.2.1).
182
+ - Text, icon, action and × use the status `.fg` colour, which the contrast
183
+ audit checks on `.bg` in both modes (WCAG 1.4.3).
184
+
185
+ What you still have to do:
186
+
187
+ - **Errors are announced politely, not as alerts.** If the reader must not miss
188
+ it, also show it on the page (`Banner` with `role="alert"`).
189
+ - **The × has no accessible name yet.** The close trigger is a button with only
190
+ an icon (WCAG 4.1.2); a fix belongs in `Toast.tsx`. Until then, do not make
191
+ the × the only way to act on a toast.
192
+ - Words, not colour alone (WCAG 1.4.1): the description says it failed; the red
193
+ is a second signal.
194
+
195
+ ## Tokens
196
+
197
+ The table is generated from `Toast.styles.ts` and the theme.
198
+
199
+ </En>
200
+
201
+ <Ko>
202
+
203
+ ## 문구
204
+
205
+ - `description`에 한 문장을 씁니다. 결과는 과거형으로 씁니다: "채팅을 삭제했습니다."
206
+ `title`은 설명만으로 뜻이 통하지 않을 때만 붙입니다.
207
+ - 시스템 상태가 아니라 일어난 일을 씁니다. "402 Payment Required"가 아니라 "크레딧이
208
+ 부족해 응답을 생성하지 못했습니다"라고 씁니다.
209
+ - 동작 라벨은 짧은 동사구로 씁니다: 되돌리기, 크레딧 구매, 파일 열기.
210
+ - 나중에 다시 봐야 하는 정보를 토스트에만 담지 않습니다. 곧 사라집니다.
211
+
212
+ ## 접근성
213
+
214
+ Toast가 알아서 하는 일
215
+
216
+ - 토스트마다 `role="status"`가 붙고, 공손한(polite) 라이브 영역 안에 있습니다.
217
+ 화면 낭독기는 초점을 옮기지 않고 내용을 읽습니다(WCAG 4.1.3).
218
+ - `Alt+T`를 누르면 토스트로 초점이 옮겨지고, `Escape`를 누르면 초점이 있는 토스트가
219
+ 닫힙니다. 동작과 ×는 실제 버튼입니다(WCAG 2.1.1).
220
+ - 마우스를 올리거나 초점을 두면 시간이 멈추고, 동작이 있는 토스트는 8초 동안 남아서
221
+ 읽고 누를 시간이 있습니다(WCAG 2.2.1).
222
+ - 글자, 아이콘, 동작, ×는 상태의 `.fg` 색을 씁니다. 이 색은 대비 감사에서 라이트·다크
223
+ 모두 `.bg` 위에서 검사합니다(WCAG 1.4.3).
224
+
225
+ 직접 챙겨야 하는 일
226
+
227
+ - **오류도 공손하게 읽힐 뿐, 경고(alert)로 읽히지 않습니다.** 놓치면 안 되는 오류라면
228
+ 페이지에도 보여 줍니다(`role="alert"`를 붙인 `Banner`).
229
+ - **×에는 아직 접근 가능한 이름이 없습니다.** 닫기 버튼에 아이콘만 있습니다(WCAG
230
+ 4.1.2). 고칠 곳은 `Toast.tsx`입니다. 그 전까지는 ×를 토스트에 대응하는 유일한
231
+ 방법으로 만들지 않습니다.
232
+ - 색만으로 알리지 않습니다(WCAG 1.4.1). 실패했다는 사실은 문구가 전하고, 빨간색은
233
+ 두 번째 신호입니다.
234
+
235
+ ## 토큰
236
+
237
+ 아래 표는 `Toast.styles.ts`와 테마에서 자동으로 만듭니다.
238
+
239
+ </Ko>
240
+
241
+ <Canvas of={ToastStories.UsageTokens} sourceState="none" />
242
+
243
+ <En>
244
+
245
+ ## Related
246
+
247
+ - **Banner**: a message that stays until the condition changes.
248
+ - **Modal**: a decision the reader has to make now.
249
+ - **ErrorFallback**: the page failed to render.
250
+ - **Guidelines/Actions in feedback surfaces**: the `action` recipe and why.
251
+ - **Foundations/Brand & colour usage**: status colours mean status.
252
+
253
+ </En>
254
+
255
+ <Ko>
256
+
257
+ ## 관련 컴포넌트
258
+
259
+ - **Banner**: 원인이 해결될 때까지 남아 있는 안내.
260
+ - **Modal**: 사용자가 지금 내려야 하는 결정.
261
+ - **ErrorFallback**: 페이지를 그리지 못했을 때.
262
+ - **Guidelines/Actions in feedback surfaces**: `action`의 쓰임과 이유.
263
+ - **Foundations/Brand & colour usage**: 상태색은 상태를 뜻합니다.
264
+
265
+ </Ko>
@@ -2,7 +2,12 @@ import { useState } from 'react';
2
2
  import { Box, Button, HStack, IconButton, VStack } from '@chakra-ui/react';
3
3
  import { Meta, StoryObj } from '@storybook/react';
4
4
 
5
- import { FaRegCopy } from '../Icon';
5
+ import { T } from '../../guidelines/_components/Lang';
6
+ import { TokenTable } from '../../guidelines/_components/TokenTable';
7
+ import { Button as LogicianButton } from '../Button';
8
+ import { FaRegCopy, RefreshIcon, TrashIcon } from '../Icon';
9
+ import { IconButton as LogicianIconButton } from '../IconButton';
10
+ import { Link } from '../Typography';
6
11
  import { Tooltip } from './Tooltip';
7
12
 
8
13
  const meta = {
@@ -281,3 +286,83 @@ export const CustomStylesWithoutArrow: Story = {
281
286
  </VStack>
282
287
  ),
283
288
  };
289
+
290
+ // ───────────────────────── Usage-page specimens ─────────────────────────
291
+ // Pulled into `Tooltip.usage.mdx` with <Canvas of={…} />. Hidden from the
292
+ // sidebar (`!dev`). Each tooltip is held open (`open`) so the page shows it
293
+ // without a hover.
294
+
295
+ export const DoNameIconButton: Story = {
296
+ tags: ['!dev'],
297
+ parameters: { layout: 'padded' },
298
+ name: 'Usage / Do: name an icon button',
299
+ render: () => (
300
+ <Box pt={10} pb={2} px={2}>
301
+ <Tooltip content="새로고침" open>
302
+ <LogicianIconButton aria-label="새로고침" variant="ghost">
303
+ <RefreshIcon aria-hidden />
304
+ </LogicianIconButton>
305
+ </Tooltip>
306
+ </Box>
307
+ ),
308
+ };
309
+
310
+ export const DontLinkInTooltip: Story = {
311
+ tags: ['!dev'],
312
+ parameters: { layout: 'padded' },
313
+ name: "Usage / Don't: a link inside a tooltip",
314
+ render: () => (
315
+ <Box pt={12} pb={2} px={20}>
316
+ <Tooltip
317
+ open
318
+ content={
319
+ <>
320
+ 관리자만 바꿀 수 있습니다. <Link href="#">자세히 보기</Link>
321
+ </>
322
+ }
323
+ >
324
+ <LogicianButton variant="secondary">정책 변경</LogicianButton>
325
+ </Tooltip>
326
+ </Box>
327
+ ),
328
+ };
329
+
330
+ export const DontStatusColourTooltip: Story = {
331
+ tags: ['!dev'],
332
+ parameters: { layout: 'padded' },
333
+ name: "Usage / Don't: a status colour on a tooltip",
334
+ render: () => (
335
+ <Box pt={10} pb={2} px={2}>
336
+ <Tooltip
337
+ content="삭제"
338
+ open
339
+ contentProps={{
340
+ css: { '--tooltip-bg': 'var(--chakra-colors-danger-solid)' },
341
+ bgColor: 'danger.solid',
342
+ }}
343
+ >
344
+ <LogicianIconButton aria-label="삭제" variant="ghost">
345
+ <TrashIcon aria-hidden />
346
+ </LogicianIconButton>
347
+ </Tooltip>
348
+ </Box>
349
+ ),
350
+ };
351
+
352
+ /** Tokens the tooltip reads, as set in `Tooltip.tsx`. */
353
+ export const UsageTokens: Story = {
354
+ tags: ['!dev'],
355
+ parameters: { layout: 'padded' },
356
+ name: 'Usage / Tokens',
357
+ render: () => (
358
+ <TokenTable
359
+ rows={[
360
+ {
361
+ token: 'tooltip.bg',
362
+ use: <T en="Background and arrow" ko="배경·화살표" />,
363
+ },
364
+ { token: 'tooltip.fg', use: <T en="Text" ko="글자" /> },
365
+ ]}
366
+ />
367
+ ),
368
+ };
@@ -0,0 +1,219 @@
1
+ import { ArgTypes, Canvas, Meta } from '@storybook/blocks';
2
+
3
+ import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
4
+ import * as TooltipStories from './Tooltip.stories';
5
+
6
+ <Meta of={TooltipStories} name="Usage" />
7
+
8
+ <LangToggle />
9
+
10
+ <En>
11
+
12
+ # Tooltip
13
+
14
+ A short text label that appears when the pointer rests on, or the keyboard
15
+ focuses, the element it describes.
16
+
17
+ ## When to use
18
+
19
+ - To show the name of an icon-only button: 새로고침, 복사, 공유.
20
+ - To show the full text of a label that is cut off, when the element is
21
+ focusable.
22
+ - To give the label of a collapsed navigation item.
23
+
24
+ ## When not to use
25
+
26
+ - Anything the user must read to succeed, such as a password rule or an error →
27
+ visible helper text, `FormControl`, or `Banner`. Touch screens never show a
28
+ tooltip.
29
+ - A definition or an explanation with more than one sentence → `InfoSprinkle`.
30
+ - Anything clickable, such as a link or a button → `Popover`. The pointer cannot
31
+ reach a tooltip and the keyboard cannot focus inside it.
32
+ - A status → `Badge`, `Toast` or `Banner`.
33
+
34
+ ## Variants and what they mean
35
+
36
+ Tooltip has one look, `tooltip.bg` with `tooltip.fg`. These props change where
37
+ and whether it shows:
38
+
39
+ </En>
40
+
41
+ <Ko>
42
+
43
+ # Tooltip
44
+
45
+ 포인터를 올리거나 키보드 초점이 닿았을 때 그 요소를 설명하는 짧은 라벨입니다.
46
+
47
+ ## 언제 쓰나요
48
+
49
+ - 아이콘만 있는 버튼의 이름을 보일 때: 새로고침, 복사, 공유.
50
+ - 잘린 라벨의 전체 문구를 보일 때. 단, 그 요소가 초점을 받을 수 있어야 합니다.
51
+ - 접힌 내비게이션 항목의 이름을 보일 때.
52
+
53
+ ## 언제 쓰지 않나요
54
+
55
+ - 비밀번호 규칙이나 오류처럼 꼭 읽어야 하는 내용은 눈에 보이는 도움말, `FormControl`,
56
+ `Banner`로 보입니다. 터치 화면에서는 툴팁이 뜨지 않습니다.
57
+ - 용어 설명이나 두 문장 이상의 설명은 `InfoSprinkle`을 씁니다.
58
+ - 링크나 버튼처럼 누를 수 있는 것은 `Popover`에 넣습니다. 툴팁에는 포인터가 닿지 못하고
59
+ 키보드 초점도 들어가지 못합니다.
60
+ - 상태는 `Badge`, `Toast`, `Banner`로 알립니다.
61
+
62
+ ## 변형과 뜻
63
+
64
+ Tooltip의 모양은 `tooltip.bg` 배경에 `tooltip.fg` 글자 하나뿐입니다. 아래 속성은
65
+ 위치와 표시 여부를 정합니다.
66
+
67
+ </Ko>
68
+
69
+ <ArgTypes of={TooltipStories} include={['content', 'placement', 'showArrow', 'disabled']} />
70
+
71
+ <En>
72
+
73
+ | Prop | Default | Notes |
74
+ | --- | --- | --- |
75
+ | `placement` | `top` | Use `right` for a collapsed side navigation. |
76
+ | `showArrow` | `false` | Turn it on when the trigger is small or sits among others, so it is clear which one the tooltip belongs to. |
77
+ | `disabled` | `false` | Renders the children with no tooltip at all, e.g. when the label is not truncated. |
78
+ | `openDelay` | `300` ms | Moving from one open tooltip to the next shows the next one at once. |
79
+
80
+ ## Do / Don't
81
+
82
+ </En>
83
+
84
+ <Ko>
85
+
86
+ | 속성 | 기본값 | 참고 |
87
+ | --- | --- | --- |
88
+ | `placement` | `top` | 접힌 사이드 내비게이션에서는 `right`를 씁니다. |
89
+ | `showArrow` | `false` | 여는 요소가 작거나 여러 개가 붙어 있어 어느 것의 툴팁인지 헷갈릴 때 켭니다. |
90
+ | `disabled` | `false` | 툴팁 없이 자식만 그립니다. 라벨이 잘리지 않았을 때처럼 툴팁이 필요 없을 때 씁니다. |
91
+ | `openDelay` | `300`ms | 열린 툴팁에서 옆 툴팁으로 옮겨 가면 기다리지 않고 바로 뜹니다. |
92
+
93
+ ## 이렇게 하세요 / 이렇게 하지 마세요
94
+
95
+ </Ko>
96
+
97
+ <Canvas of={TooltipStories.DoNameIconButton} />
98
+ <Verdict
99
+ kind="do"
100
+ en="Give the icon button an aria-label and show the same words in the tooltip. The tooltip is a description, not the button's name."
101
+ ko="아이콘 버튼에 aria-label을 붙이고 툴팁에도 같은 말을 씁니다. 툴팁은 버튼의 이름이 아니라 설명입니다."
102
+ />
103
+
104
+ <Canvas of={TooltipStories.DontLinkInTooltip} />
105
+ <Verdict
106
+ kind="dont"
107
+ en="Put a link in a tooltip. It closes as the pointer moves toward it, and keyboard focus can never land on it. Use a Popover or visible text."
108
+ ko="툴팁에 링크를 넣지 마세요. 포인터를 옮기는 사이에 툴팁이 닫히고, 키보드 초점은 그 링크에 닿지 못합니다. Popover나 눈에 보이는 문구를 씁니다."
109
+ />
110
+
111
+ <Canvas of={TooltipStories.DontStatusColourTooltip} />
112
+ <Verdict
113
+ kind="dont"
114
+ en="Recolour a tooltip with a status colour. Status colours carry a meaning; a red tooltip on a delete button reads as an error."
115
+ ko="툴팁을 상태색으로 칠하지 마세요. 상태색에는 뜻이 있어서, 삭제 버튼의 빨간 툴팁은 오류로 읽힙니다."
116
+ />
117
+
118
+ <En>
119
+
120
+ ## Content
121
+
122
+ - One to five words for a button name; one short sentence at most. No full
123
+ stop on a name.
124
+ - Match the accessible name of the trigger word for word (WCAG 2.5.3).
125
+ - Do not repeat visible text. A button that already says "공유" needs no
126
+ tooltip.
127
+
128
+ ## Accessibility
129
+
130
+ What Tooltip does for you:
131
+
132
+ - Opens on hover after 300 ms and on keyboard focus; `Escape` closes it, and so
133
+ does scrolling (WCAG 1.4.13).
134
+ - While open, the trigger gets `aria-describedby` pointing at the content,
135
+ which has `role="tooltip"` (WCAG 4.1.2).
136
+
137
+ What you still have to do:
138
+
139
+ - **Name the trigger yourself.** `aria-describedby` adds a description; it does
140
+ not give an icon-only button a name. Pass `aria-label` on the button.
141
+ - **The trigger must be focusable.** Tooltip wraps its child with
142
+ `asChild`, so the child must be a real button, link or other focusable
143
+ element. A disabled button gets no hover or focus, so its tooltip never
144
+ shows.
145
+ - Never put the only copy of required information in a tooltip; touch screens
146
+ have no hover.
147
+ - **Tooltip + Menu on one trigger: share `ids.trigger`.** Both make the
148
+ button their trigger and each gives it its own id, so the menu cannot find
149
+ its anchor and opens at the top-left of the page. Pass one `useId()` to
150
+ both: `<Menu ids={{ trigger: id }}><Tooltip ids={{ trigger: id }} …>`.
151
+
152
+ ## Tokens
153
+
154
+ The table lists the tokens set in `Tooltip.tsx`.
155
+
156
+ </En>
157
+
158
+ <Ko>
159
+
160
+ ## 문구
161
+
162
+ - 버튼 이름은 한 단어에서 다섯 단어, 길어도 짧은 한 문장까지 씁니다. 이름에는 마침표를
163
+ 찍지 않습니다.
164
+ - 여는 요소의 접근 가능한 이름과 글자 하나까지 같게 씁니다(WCAG 2.5.3).
165
+ - 화면에 보이는 문구를 되풀이하지 않습니다. 이미 "공유"라고 쓰인 버튼에는 툴팁이
166
+ 필요 없습니다.
167
+
168
+ ## 접근성
169
+
170
+ Tooltip이 알아서 하는 일
171
+
172
+ - 포인터를 올리고 300ms가 지나면, 또는 키보드 초점이 닿으면 열립니다. `Escape`를
173
+ 누르거나 스크롤하면 닫힙니다(WCAG 1.4.13).
174
+ - 열려 있는 동안 여는 요소에 `aria-describedby`가 붙어 `role="tooltip"`인 내용을
175
+ 가리킵니다(WCAG 4.1.2).
176
+
177
+ 직접 챙겨야 하는 일
178
+
179
+ - **여는 요소의 이름은 직접 붙입니다.** `aria-describedby`는 설명을 더할 뿐, 아이콘만
180
+ 있는 버튼에 이름을 주지 않습니다. 버튼에 `aria-label`을 넘깁니다.
181
+ - **여는 요소가 초점을 받을 수 있어야 합니다.** Tooltip은 자식을 `asChild`로 감싸므로
182
+ 자식은 실제 버튼, 링크처럼 초점을 받는 요소여야 합니다. 비활성 버튼은 포인터도 초점도
183
+ 받지 않아 툴팁이 뜨지 않습니다.
184
+ - 꼭 필요한 정보를 툴팁에만 두지 않습니다. 터치 화면에는 마우스 올리기가 없습니다.
185
+ - **한 버튼에 Tooltip과 Menu를 함께 걸 때는 `ids.trigger`를 같이 씁니다.** 둘 다 그 버튼을
186
+ 여는 요소로 삼고 각자 다른 id를 붙이므로, 메뉴가 기준 위치를 못 찾고 화면 왼쪽 위에서
187
+ 열립니다. `useId()` 하나를 양쪽에 넘깁니다:
188
+ `<Menu ids={{ trigger: id }}><Tooltip ids={{ trigger: id }} …>`.
189
+
190
+ ## 토큰
191
+
192
+ 아래 표는 `Tooltip.tsx`에서 정한 토큰입니다.
193
+
194
+ </Ko>
195
+
196
+ <Canvas of={TooltipStories.UsageTokens} sourceState="none" />
197
+
198
+ <En>
199
+
200
+ ## Related
201
+
202
+ - **InfoSprinkle**: a definition or explanation next to a label.
203
+ - **Popover**: anything with links or controls.
204
+ - **IconButton**: the usual trigger, which needs its own `aria-label`.
205
+ - **Foundations/Brand & colour usage**: why status colours are never
206
+ decoration.
207
+
208
+ </En>
209
+
210
+ <Ko>
211
+
212
+ ## 관련 컴포넌트
213
+
214
+ - **InfoSprinkle**: 라벨 옆의 용어 설명이나 해설.
215
+ - **Popover**: 링크나 컨트롤이 들어가는 내용.
216
+ - **IconButton**: 툴팁을 여는 가장 흔한 요소이며, 자기 `aria-label`이 따로 필요합니다.
217
+ - **Foundations/Brand & colour usage**: 상태색을 장식으로 쓰지 않는 이유.
218
+
219
+ </Ko>
@@ -3,6 +3,8 @@ import { Box, HStack, Stack, Text } from '@chakra-ui/react';
3
3
  import { Meta, StoryObj } from '@storybook/react';
4
4
  import { IoFolder, IoFolderOpen } from 'react-icons/io5';
5
5
 
6
+ import { T } from '../../guidelines/_components/Lang';
7
+ import { TokenTable } from '../../guidelines/_components/TokenTable';
6
8
  import { Tree } from './Tree';
7
9
  import {
8
10
  createTreeCollection,
@@ -562,3 +564,90 @@ export const MultipleSelection: Story = {
562
564
  </Box>
563
565
  ),
564
566
  };
567
+
568
+ // ───────────────────────── Usage-page specimens ─────────────────────────
569
+ // Pulled into `Tree.usage.mdx` with <Canvas of={…} />. Hidden from the
570
+ // sidebar (`!dev`); `tags` is written out on each story because the indexer
571
+ // reads CSF statically.
572
+
573
+ export const DoNamedWithElbows: Story = {
574
+ tags: ['!dev'],
575
+ name: 'Usage / Do: a named tree, elbow guides for depth',
576
+ args: {
577
+ collection: orgCollection,
578
+ defaultExpandedValue: ['hq', 'hq-dev', 'hq-dev-backend'],
579
+ defaultSelectedValue: ['hq-dev-backend-api'],
580
+ },
581
+ render: (args) => (
582
+ <Box maxWidth="360px">
583
+ <Tree.Root {...args}>
584
+ <Tree.Label>조직</Tree.Label>
585
+ <Tree.Tree>
586
+ <Tree.Node
587
+ indentGuide={<Tree.BranchIndentGuide elbow />}
588
+ render={renderNode}
589
+ />
590
+ </Tree.Tree>
591
+ </Tree.Root>
592
+ </Box>
593
+ ),
594
+ };
595
+
596
+ const flatCollection = createTreeCollection<Node>({
597
+ rootNode: {
598
+ id: 'root',
599
+ name: '',
600
+ children: [
601
+ { id: 'a', name: '마케팅' },
602
+ { id: 'b', name: '영업' },
603
+ { id: 'c', name: '개발' },
604
+ ],
605
+ },
606
+ nodeToValue: (node) => node.id,
607
+ nodeToString: (node) => node.name,
608
+ });
609
+
610
+ export const DontFlatList: Story = {
611
+ tags: ['!dev'],
612
+ name: "Usage / Don't: a tree for a flat list",
613
+ args: { collection: flatCollection, 'aria-label': '팀' },
614
+ render: (args) => (
615
+ <Box maxWidth="360px">
616
+ <Tree.Root {...args}>
617
+ <Tree.Tree>
618
+ <Tree.Node render={renderNode} />
619
+ </Tree.Tree>
620
+ </Tree.Root>
621
+ </Box>
622
+ ),
623
+ };
624
+
625
+ /** Tokens the Tree parts set (TreeItem / TreeBranchControl / TreeLabel / guide). */
626
+ export const UsageTokens: Story = {
627
+ tags: ['!dev'],
628
+ name: 'Usage / Tokens',
629
+ args: { collection: orgCollection },
630
+ render: () => (
631
+ <TokenTable
632
+ rows={[
633
+ { token: 'fg.default', use: <T en="Row text" ko="행 글자" /> },
634
+ { token: 'bg.subtle', use: <T en="Row hover" ko="행 호버" /> },
635
+ {
636
+ token: 'primary.selected',
637
+ use: <T en="Selected row" ko="선택된 행" />,
638
+ },
639
+ { token: 'fg.muted', use: <T en="Tree.Label" ko="Tree.Label" /> },
640
+ {
641
+ token: 'border.default',
642
+ use: (
643
+ <T
644
+ en="BranchIndentGuide · guideColor default"
645
+ ko="BranchIndentGuide · guideColor 기본값"
646
+ />
647
+ ),
648
+ },
649
+ { token: 'focus.ring', use: <T en="Focus ring" ko="초점 링" /> },
650
+ ]}
651
+ />
652
+ ),
653
+ };