@mindlogic-ai/logician-ui 5.0.0-alpha.0 → 5.0.0-alpha.10

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 (444) hide show
  1. package/MIGRATION-5.0.md +18 -18
  2. package/codemods/5.0/button-variants.js +1 -0
  3. package/codemods/5.0/codemods.test.ts +1 -0
  4. package/dist/components/Avatar/Avatar.d.ts +68 -11
  5. package/dist/components/Avatar/Avatar.d.ts.map +1 -1
  6. package/dist/components/Avatar/Avatar.js +38 -5
  7. package/dist/components/Avatar/Avatar.js.map +1 -1
  8. package/dist/components/Avatar/Avatar.mjs +37 -5
  9. package/dist/components/Avatar/Avatar.mjs.map +1 -1
  10. package/dist/components/Avatar/index.d.ts +2 -2
  11. package/dist/components/Avatar/index.d.ts.map +1 -1
  12. package/dist/components/Badge/Badge.d.ts.map +1 -1
  13. package/dist/components/Badge/Badge.js +5 -3
  14. package/dist/components/Badge/Badge.js.map +1 -1
  15. package/dist/components/Badge/Badge.mjs +5 -3
  16. package/dist/components/Badge/Badge.mjs.map +1 -1
  17. package/dist/components/Badge/Badge.types.d.ts +7 -5
  18. package/dist/components/Badge/Badge.types.d.ts.map +1 -1
  19. package/dist/components/Banner/Banner.types.d.ts +24 -1
  20. package/dist/components/Banner/Banner.types.d.ts.map +1 -1
  21. package/dist/components/BottomSheet/BottomSheet.styles.d.ts +2 -2
  22. package/dist/components/Button/Button.d.ts.map +1 -1
  23. package/dist/components/Button/Button.js +10 -2
  24. package/dist/components/Button/Button.js.map +1 -1
  25. package/dist/components/Button/Button.legacy.d.ts.map +1 -1
  26. package/dist/components/Button/Button.legacy.js +1 -0
  27. package/dist/components/Button/Button.legacy.js.map +1 -1
  28. package/dist/components/Button/Button.legacy.mjs +1 -0
  29. package/dist/components/Button/Button.legacy.mjs.map +1 -1
  30. package/dist/components/Button/Button.mjs +10 -2
  31. package/dist/components/Button/Button.mjs.map +1 -1
  32. package/dist/components/Button/Button.styles.d.ts.map +1 -1
  33. package/dist/components/Button/Button.styles.js +18 -0
  34. package/dist/components/Button/Button.styles.js.map +1 -1
  35. package/dist/components/Button/Button.styles.mjs +18 -0
  36. package/dist/components/Button/Button.styles.mjs.map +1 -1
  37. package/dist/components/Button/Button.types.d.ts +5 -3
  38. package/dist/components/Button/Button.types.d.ts.map +1 -1
  39. package/dist/components/Card/Card.types.d.ts +12 -0
  40. package/dist/components/Card/Card.types.d.ts.map +1 -1
  41. package/dist/components/ColorMode/ColorModeToggle.d.ts +7 -2
  42. package/dist/components/ColorMode/ColorModeToggle.d.ts.map +1 -1
  43. package/dist/components/ColorMode/ColorModeToggle.js +8 -3
  44. package/dist/components/ColorMode/ColorModeToggle.js.map +1 -1
  45. package/dist/components/ColorMode/ColorModeToggle.mjs +8 -3
  46. package/dist/components/ColorMode/ColorModeToggle.mjs.map +1 -1
  47. package/dist/components/Confetti/Confetti.types.d.ts +5 -1
  48. package/dist/components/Confetti/Confetti.types.d.ts.map +1 -1
  49. package/dist/components/Confetti/confettiColors.d.ts +5 -5
  50. package/dist/components/Confetti/confettiColors.js +5 -5
  51. package/dist/components/Confetti/confettiColors.mjs +5 -5
  52. package/dist/components/ErrorFallback/ErrorFallback.types.d.ts +6 -0
  53. package/dist/components/ErrorFallback/ErrorFallback.types.d.ts.map +1 -1
  54. package/dist/components/Form/FormModalFooter/FormModalFooter.d.ts +1 -1
  55. package/dist/components/Form/FormModalFooter/FormModalFooter.d.ts.map +1 -1
  56. package/dist/components/Form/FormModalFooter/FormModalFooter.js +2 -2
  57. package/dist/components/Form/FormModalFooter/FormModalFooter.js.map +1 -1
  58. package/dist/components/Form/FormModalFooter/FormModalFooter.mjs +2 -2
  59. package/dist/components/Form/FormModalFooter/FormModalFooter.mjs.map +1 -1
  60. package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts +11 -1
  61. package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts.map +1 -1
  62. package/dist/components/Form/FormSection/CollapsibleFormSection.js +1 -0
  63. package/dist/components/Form/FormSection/CollapsibleFormSection.js.map +1 -1
  64. package/dist/components/Form/FormSection/CollapsibleFormSection.mjs +1 -0
  65. package/dist/components/Form/FormSection/CollapsibleFormSection.mjs.map +1 -1
  66. package/dist/components/LineGraph/LineGraph.d.ts.map +1 -1
  67. package/dist/components/LineGraph/LineGraph.js +4 -5
  68. package/dist/components/LineGraph/LineGraph.js.map +1 -1
  69. package/dist/components/LineGraph/LineGraph.mjs +5 -6
  70. package/dist/components/LineGraph/LineGraph.mjs.map +1 -1
  71. package/dist/components/LineGraph/LineGraph.types.d.ts +12 -2
  72. package/dist/components/LineGraph/LineGraph.types.d.ts.map +1 -1
  73. package/dist/components/LineGraph/seriesColors.d.ts +12 -6
  74. package/dist/components/LineGraph/seriesColors.d.ts.map +1 -1
  75. package/dist/components/LineGraph/seriesColors.js +8 -7
  76. package/dist/components/LineGraph/seriesColors.js.map +1 -1
  77. package/dist/components/LineGraph/seriesColors.mjs +8 -7
  78. package/dist/components/LineGraph/seriesColors.mjs.map +1 -1
  79. package/dist/components/Masonry/Masonry.types.d.ts +8 -3
  80. package/dist/components/Masonry/Masonry.types.d.ts.map +1 -1
  81. package/dist/components/Menu/MenuItem.types.d.ts +8 -0
  82. package/dist/components/Menu/MenuItem.types.d.ts.map +1 -1
  83. package/dist/components/Modal/ModalCloseButton.d.ts +1 -1
  84. package/dist/components/Modal/ModalCloseButton.js +1 -1
  85. package/dist/components/Modal/ModalCloseButton.mjs +1 -1
  86. package/dist/components/Pagination/Pagination.d.ts +11 -10
  87. package/dist/components/Pagination/Pagination.d.ts.map +1 -1
  88. package/dist/components/Pagination/Pagination.js +11 -10
  89. package/dist/components/Pagination/Pagination.js.map +1 -1
  90. package/dist/components/Pagination/Pagination.mjs +11 -10
  91. package/dist/components/Pagination/Pagination.mjs.map +1 -1
  92. package/dist/components/ProgressBar/ProgressBar.types.d.ts +9 -0
  93. package/dist/components/ProgressBar/ProgressBar.types.d.ts.map +1 -1
  94. package/dist/components/RadialProgress/RadialProgress.types.d.ts +21 -1
  95. package/dist/components/RadialProgress/RadialProgress.types.d.ts.map +1 -1
  96. package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts +8 -0
  97. package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts.map +1 -1
  98. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  99. package/dist/components/SegmentedControl/SegmentedControl.js +6 -7
  100. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  101. package/dist/components/SegmentedControl/SegmentedControl.mjs +6 -7
  102. package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  103. package/dist/components/SegmentedProgressBar/SegmentedProgressBar.types.d.ts +2 -0
  104. package/dist/components/SegmentedProgressBar/SegmentedProgressBar.types.d.ts.map +1 -1
  105. package/dist/components/Select/Select.d.ts +5 -1
  106. package/dist/components/Select/Select.d.ts.map +1 -1
  107. package/dist/components/Select/Select.js +2 -2
  108. package/dist/components/Select/Select.js.map +1 -1
  109. package/dist/components/Select/Select.mjs +3 -3
  110. package/dist/components/Select/Select.mjs.map +1 -1
  111. package/dist/components/Select/Select.styles.d.ts +38 -0
  112. package/dist/components/Select/Select.styles.d.ts.map +1 -1
  113. package/dist/components/Select/Select.styles.js +35 -0
  114. package/dist/components/Select/Select.styles.js.map +1 -1
  115. package/dist/components/Select/Select.styles.mjs +35 -2
  116. package/dist/components/Select/Select.styles.mjs.map +1 -1
  117. package/dist/components/Select/Select.types.d.ts +10 -0
  118. package/dist/components/Select/Select.types.d.ts.map +1 -1
  119. package/dist/components/Select/SelectField.d.ts +1 -1
  120. package/dist/components/Select/SelectField.d.ts.map +1 -1
  121. package/dist/components/Select/SelectField.js +3 -2
  122. package/dist/components/Select/SelectField.js.map +1 -1
  123. package/dist/components/Select/SelectField.mjs +3 -2
  124. package/dist/components/Select/SelectField.mjs.map +1 -1
  125. package/dist/components/Select/index.d.ts +1 -0
  126. package/dist/components/Select/index.d.ts.map +1 -1
  127. package/dist/components/Toast/Toast.styles.d.ts +6 -2
  128. package/dist/components/Toast/Toast.styles.d.ts.map +1 -1
  129. package/dist/components/Toast/Toast.styles.js +18 -10
  130. package/dist/components/Toast/Toast.styles.js.map +1 -1
  131. package/dist/components/Toast/Toast.styles.mjs +18 -10
  132. package/dist/components/Toast/Toast.styles.mjs.map +1 -1
  133. package/dist/components/Typography/Caption.d.ts.map +1 -1
  134. package/dist/components/Typography/Caption.js +1 -1
  135. package/dist/components/Typography/Caption.js.map +1 -1
  136. package/dist/components/Typography/Caption.mjs +1 -1
  137. package/dist/components/Typography/Caption.mjs.map +1 -1
  138. package/dist/components/Typography/H1.d.ts.map +1 -1
  139. package/dist/components/Typography/H1.js +1 -1
  140. package/dist/components/Typography/H1.js.map +1 -1
  141. package/dist/components/Typography/H1.mjs +1 -1
  142. package/dist/components/Typography/H1.mjs.map +1 -1
  143. package/dist/components/Typography/H2.d.ts.map +1 -1
  144. package/dist/components/Typography/H2.js +1 -1
  145. package/dist/components/Typography/H2.js.map +1 -1
  146. package/dist/components/Typography/H2.mjs +1 -1
  147. package/dist/components/Typography/H2.mjs.map +1 -1
  148. package/dist/components/Typography/H3.d.ts.map +1 -1
  149. package/dist/components/Typography/H3.js +1 -1
  150. package/dist/components/Typography/H3.js.map +1 -1
  151. package/dist/components/Typography/H3.mjs +1 -1
  152. package/dist/components/Typography/H3.mjs.map +1 -1
  153. package/dist/components/Typography/H4.d.ts.map +1 -1
  154. package/dist/components/Typography/H4.js +1 -1
  155. package/dist/components/Typography/H4.js.map +1 -1
  156. package/dist/components/Typography/H4.mjs +1 -1
  157. package/dist/components/Typography/H4.mjs.map +1 -1
  158. package/dist/components/Typography/H5.d.ts.map +1 -1
  159. package/dist/components/Typography/H5.js +1 -1
  160. package/dist/components/Typography/H5.js.map +1 -1
  161. package/dist/components/Typography/H5.mjs +1 -1
  162. package/dist/components/Typography/H5.mjs.map +1 -1
  163. package/dist/components/Typography/Link.d.ts.map +1 -1
  164. package/dist/components/Typography/Link.js +1 -1
  165. package/dist/components/Typography/Link.js.map +1 -1
  166. package/dist/components/Typography/Link.mjs +1 -1
  167. package/dist/components/Typography/Link.mjs.map +1 -1
  168. package/dist/components/Typography/Overline.d.ts.map +1 -1
  169. package/dist/components/Typography/Overline.js +1 -1
  170. package/dist/components/Typography/Overline.js.map +1 -1
  171. package/dist/components/Typography/Overline.mjs +1 -1
  172. package/dist/components/Typography/Overline.mjs.map +1 -1
  173. package/dist/components/Typography/Subtext.d.ts.map +1 -1
  174. package/dist/components/Typography/Subtext.js +1 -1
  175. package/dist/components/Typography/Subtext.js.map +1 -1
  176. package/dist/components/Typography/Subtext.mjs +1 -1
  177. package/dist/components/Typography/Subtext.mjs.map +1 -1
  178. package/dist/components/Typography/Subtitle.d.ts.map +1 -1
  179. package/dist/components/Typography/Subtitle.js +1 -1
  180. package/dist/components/Typography/Subtitle.js.map +1 -1
  181. package/dist/components/Typography/Subtitle.mjs +1 -1
  182. package/dist/components/Typography/Subtitle.mjs.map +1 -1
  183. package/dist/components/Typography/Text.d.ts.map +1 -1
  184. package/dist/components/Typography/Text.js +1 -1
  185. package/dist/components/Typography/Text.js.map +1 -1
  186. package/dist/components/Typography/Text.mjs +1 -1
  187. package/dist/components/Typography/Text.mjs.map +1 -1
  188. package/dist/hooks/useLanguage.d.ts +5 -0
  189. package/dist/hooks/useLanguage.d.ts.map +1 -1
  190. package/dist/hooks/useLanguage.js +7 -3
  191. package/dist/hooks/useLanguage.js.map +1 -1
  192. package/dist/hooks/useLanguage.mjs +7 -4
  193. package/dist/hooks/useLanguage.mjs.map +1 -1
  194. package/dist/hooks/useTranslate.d.ts.map +1 -1
  195. package/dist/hooks/useTranslate.js +8 -5
  196. package/dist/hooks/useTranslate.js.map +1 -1
  197. package/dist/hooks/useTranslate.mjs +8 -5
  198. package/dist/hooks/useTranslate.mjs.map +1 -1
  199. package/dist/index.js +1 -0
  200. package/dist/index.js.map +1 -1
  201. package/dist/index.mjs +1 -1
  202. package/dist/theme/colors.d.ts +2 -2
  203. package/dist/theme/colors.d.ts.map +1 -1
  204. package/dist/theme/colors.js +36 -2
  205. package/dist/theme/colors.js.map +1 -1
  206. package/dist/theme/colors.mjs +37 -3
  207. package/dist/theme/colors.mjs.map +1 -1
  208. package/dist/theme/global.d.ts.map +1 -1
  209. package/dist/theme/global.js +18 -0
  210. package/dist/theme/global.js.map +1 -1
  211. package/dist/theme/global.mjs +18 -0
  212. package/dist/theme/global.mjs.map +1 -1
  213. package/dist/theme/index.d.ts.map +1 -1
  214. package/dist/theme/index.js +2 -0
  215. package/dist/theme/index.js.map +1 -1
  216. package/dist/theme/index.mjs +2 -0
  217. package/dist/theme/index.mjs.map +1 -1
  218. package/dist/theme/palette.generated.d.ts +98 -0
  219. package/dist/theme/palette.generated.d.ts.map +1 -1
  220. package/dist/theme/palette.generated.js +99 -0
  221. package/dist/theme/palette.generated.js.map +1 -1
  222. package/dist/theme/palette.generated.mjs +99 -1
  223. package/dist/theme/palette.generated.mjs.map +1 -1
  224. package/dist/theme/paletteSwatches.d.ts +20 -0
  225. package/dist/theme/paletteSwatches.d.ts.map +1 -1
  226. package/dist/theme/recipes/avatar.d.ts +30 -0
  227. package/dist/theme/recipes/avatar.d.ts.map +1 -0
  228. package/dist/theme/recipes/avatar.js +96 -0
  229. package/dist/theme/recipes/avatar.js.map +1 -0
  230. package/dist/theme/recipes/avatar.mjs +94 -0
  231. package/dist/theme/recipes/avatar.mjs.map +1 -0
  232. package/dist/translations/Defaults.translations.json.js +9 -0
  233. package/dist/translations/Defaults.translations.json.js.map +1 -1
  234. package/dist/translations/Defaults.translations.json.mjs +9 -1
  235. package/dist/translations/Defaults.translations.json.mjs.map +1 -1
  236. package/package.json +1 -1
  237. package/src/components/Accordion/Accordion.stories.tsx +85 -0
  238. package/src/components/Accordion/Accordion.usage.mdx +200 -0
  239. package/src/components/Appear/Appear.usage.mdx +107 -0
  240. package/src/components/Avatar/Avatar.recipe.test.tsx +171 -0
  241. package/src/components/Avatar/Avatar.stories.tsx +199 -24
  242. package/src/components/Avatar/Avatar.tsx +112 -21
  243. package/src/components/Avatar/Avatar.usage.mdx +185 -0
  244. package/src/components/Avatar/index.tsx +8 -1
  245. package/src/components/Badge/Badge.stories.tsx +193 -3
  246. package/src/components/Badge/Badge.tsx +5 -3
  247. package/src/components/Badge/Badge.types.ts +7 -5
  248. package/src/components/Badge/Badge.usage.mdx +265 -0
  249. package/src/components/Banner/Banner.stories.tsx +152 -2
  250. package/src/components/Banner/Banner.types.ts +30 -1
  251. package/src/components/Banner/Banner.usage.mdx +233 -0
  252. package/src/components/BottomSheet/BottomSheet.stories.tsx +168 -1
  253. package/src/components/BottomSheet/BottomSheet.test.tsx +2 -1
  254. package/src/components/BottomSheet/BottomSheet.usage.mdx +216 -0
  255. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +59 -0
  256. package/src/components/Breadcrumb/Breadcrumb.usage.mdx +181 -0
  257. package/src/components/Button/Button.legacy.ts +1 -0
  258. package/src/components/Button/Button.stories.tsx +287 -3
  259. package/src/components/Button/Button.styles.ts +18 -0
  260. package/src/components/Button/Button.tsx +15 -2
  261. package/src/components/Button/Button.types.ts +5 -2
  262. package/src/components/Button/Button.usage.mdx +342 -0
  263. package/src/components/Button/Button.variants.test.tsx +9 -0
  264. package/src/components/Card/Card.stories.tsx +106 -0
  265. package/src/components/Card/Card.types.ts +12 -0
  266. package/src/components/Card/Card.usage.mdx +216 -0
  267. package/src/components/Checkbox/Checkbox.stories.tsx +140 -13
  268. package/src/components/Checkbox/Checkbox.usage.mdx +214 -0
  269. package/src/components/Chip/Chip.usage.mdx +78 -0
  270. package/src/components/Code/Code.stories.tsx +60 -0
  271. package/src/components/Code/Code.usage.mdx +187 -0
  272. package/src/components/CodeTabs/CodeTabs.stories.tsx +53 -0
  273. package/src/components/CodeTabs/CodeTabs.usage.mdx +176 -0
  274. package/src/components/Collapsible/Collapsible.stories.tsx +58 -0
  275. package/src/components/Collapsible/Collapsible.usage.mdx +173 -0
  276. package/src/components/ColorMode/ColorMode.stories.tsx +50 -0
  277. package/src/components/ColorMode/ColorMode.usage.mdx +135 -0
  278. package/src/components/ColorMode/ColorModeToggle.tsx +10 -3
  279. package/src/components/Confetti/Confetti.types.ts +5 -1
  280. package/src/components/Confetti/Confetti.usage.mdx +111 -0
  281. package/src/components/Confetti/confettiColors.ts +5 -5
  282. package/src/components/Container/Container.stories.tsx +32 -0
  283. package/src/components/Container/Container.usage.mdx +130 -0
  284. package/src/components/CopyableCode/CopyableCode.stories.tsx +62 -0
  285. package/src/components/CopyableCode/CopyableCode.usage.mdx +168 -0
  286. package/src/components/CountBadge/CountBadge.stories.tsx +69 -0
  287. package/src/components/CountBadge/CountBadge.usage.mdx +215 -0
  288. package/src/components/CountUp/CountUp.usage.mdx +107 -0
  289. package/src/components/DatePicker/DatePicker.usage.mdx +177 -0
  290. package/src/components/DatePicker/RangeDatePicker.stories.tsx +87 -3
  291. package/src/components/ErrorFallback/ErrorFallback.types.ts +6 -0
  292. package/src/components/ErrorFallback/ErrorFallback.usage.mdx +127 -0
  293. package/src/components/ExpandableText/ExpandableText.stories.tsx +55 -0
  294. package/src/components/ExpandableText/ExpandableText.usage.mdx +176 -0
  295. package/src/components/FileInput/FileInput.stories.tsx +38 -1
  296. package/src/components/FileInput/FileInput.usage.mdx +178 -0
  297. package/src/components/FileItem/FileItem.stories.tsx +71 -0
  298. package/src/components/FileItem/FileItem.usage.mdx +180 -0
  299. package/src/components/FileList/FileList.stories.tsx +25 -0
  300. package/src/components/FileList/FileList.usage.mdx +165 -0
  301. package/src/components/FlyTo/FlyTo.usage.mdx +99 -0
  302. package/src/components/Form/Form.stories.tsx +149 -0
  303. package/src/components/Form/Form.usage.mdx +203 -0
  304. package/src/components/Form/FormModalFooter/FormModalFooter.stories.tsx +1 -1
  305. package/src/components/Form/FormModalFooter/FormModalFooter.test.tsx +19 -1
  306. package/src/components/Form/FormModalFooter/FormModalFooter.tsx +2 -0
  307. package/src/components/Form/FormModalFooter/FormModalFooter.types.ts +11 -1
  308. package/src/components/FormControl/FormControl.stories.tsx +35 -0
  309. package/src/components/FormControl/FormControl.usage.mdx +128 -0
  310. package/src/components/FormIntegration/FormIntegration.usage.mdx +158 -0
  311. package/src/components/FormLabel/FormLabel.stories.tsx +71 -0
  312. package/src/components/FormLabel/FormLabel.usage.mdx +125 -0
  313. package/src/components/Icon/Icon.stories.tsx +61 -1
  314. package/src/components/Icon/Icon.usage.mdx +158 -0
  315. package/src/components/IconButton/IconButton.stories.tsx +209 -5
  316. package/src/components/IconButton/IconButton.usage.mdx +273 -0
  317. package/src/components/InfoSprinkle/InfoSprinkle.stories.tsx +77 -1
  318. package/src/components/InfoSprinkle/InfoSprinkle.usage.mdx +189 -0
  319. package/src/components/InlineCode/InlineCode.stories.tsx +75 -0
  320. package/src/components/InlineCode/InlineCode.usage.mdx +142 -0
  321. package/src/components/Input/Input.stories.tsx +180 -0
  322. package/src/components/Input/Input.usage.mdx +278 -0
  323. package/src/components/LineGraph/LineGraph.stories.tsx +112 -0
  324. package/src/components/LineGraph/LineGraph.tsx +4 -5
  325. package/src/components/LineGraph/LineGraph.types.ts +12 -2
  326. package/src/components/LineGraph/LineGraph.usage.mdx +186 -0
  327. package/src/components/LineGraph/seriesColors.test.ts +11 -10
  328. package/src/components/LineGraph/seriesColors.ts +18 -14
  329. package/src/components/Loaders/Loaders.stories.tsx +93 -0
  330. package/src/components/Loaders/Loaders.usage.mdx +180 -0
  331. package/src/components/LogicianProvider/LogicianProvider.usage.mdx +98 -0
  332. package/src/components/Markdown/Markdown.stories.tsx +53 -0
  333. package/src/components/Markdown/Markdown.usage.mdx +182 -0
  334. package/src/components/Masonry/Masonry.stories.tsx +63 -1
  335. package/src/components/Masonry/Masonry.types.ts +8 -3
  336. package/src/components/Masonry/Masonry.usage.mdx +142 -0
  337. package/src/components/MaxLengthIndicator/MaxLengthIndicator.stories.tsx +57 -0
  338. package/src/components/MaxLengthIndicator/MaxLengthIndicator.usage.mdx +125 -0
  339. package/src/components/Menu/Menu.stories.tsx +146 -2
  340. package/src/components/Menu/Menu.usage.mdx +230 -0
  341. package/src/components/Menu/MenuItem.types.ts +8 -0
  342. package/src/components/Modal/Modal.stories.tsx +177 -1
  343. package/src/components/Modal/Modal.usage.mdx +262 -0
  344. package/src/components/Modal/ModalCloseButton.tsx +1 -1
  345. package/src/components/MonthPicker/MonthPicker.stories.tsx +30 -0
  346. package/src/components/MonthPicker/MonthPicker.usage.mdx +191 -0
  347. package/src/components/Pagination/Pagination.stories.tsx +90 -1
  348. package/src/components/Pagination/Pagination.tsx +11 -10
  349. package/src/components/Pagination/Pagination.usage.mdx +186 -0
  350. package/src/components/PasswordInput/PasswordInput.stories.tsx +51 -0
  351. package/src/components/PasswordInput/PasswordInput.usage.mdx +193 -0
  352. package/src/components/PinInput/PinInput.stories.tsx +91 -0
  353. package/src/components/PinInput/PinInput.usage.mdx +194 -0
  354. package/src/components/Popover/Popover.stories.tsx +104 -1
  355. package/src/components/Popover/Popover.usage.mdx +197 -0
  356. package/src/components/ProgressBar/ProgressBar.stories.tsx +92 -1
  357. package/src/components/ProgressBar/ProgressBar.types.ts +9 -0
  358. package/src/components/ProgressBar/ProgressBar.usage.mdx +210 -0
  359. package/src/components/Pulse/Pulse.usage.mdx +102 -0
  360. package/src/components/RadialProgress/RadialProgress.stories.tsx +74 -1
  361. package/src/components/RadialProgress/RadialProgress.types.ts +21 -1
  362. package/src/components/RadialProgress/RadialProgress.usage.mdx +153 -0
  363. package/src/components/Radio/Radio.stories.tsx +119 -0
  364. package/src/components/Radio/Radio.usage.mdx +187 -0
  365. package/src/components/Reveal/Reveal.usage.mdx +105 -0
  366. package/src/components/ScaledContext/ScaledContext.usage.mdx +111 -0
  367. package/src/components/SeeMoreButton/SeeMoreButton.stories.tsx +146 -2
  368. package/src/components/SeeMoreButton/SeeMoreButton.types.ts +8 -0
  369. package/src/components/SeeMoreButton/SeeMoreButton.usage.mdx +213 -0
  370. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +69 -0
  371. package/src/components/SegmentedControl/SegmentedControl.tsx +6 -7
  372. package/src/components/SegmentedControl/SegmentedControl.usage.mdx +209 -0
  373. package/src/components/SegmentedProgressBar/SegmentedProgressBar.stories.tsx +54 -0
  374. package/src/components/SegmentedProgressBar/SegmentedProgressBar.types.ts +2 -0
  375. package/src/components/SegmentedProgressBar/SegmentedProgressBar.usage.mdx +145 -0
  376. package/src/components/Select/Comparison.stories.tsx +19 -0
  377. package/src/components/Select/Select.stories.tsx +264 -1
  378. package/src/components/Select/Select.styles.ts +36 -1
  379. package/src/components/Select/Select.tsx +13 -3
  380. package/src/components/Select/Select.types.ts +11 -0
  381. package/src/components/Select/Select.usage.mdx +278 -0
  382. package/src/components/Select/SelectField.tsx +7 -3
  383. package/src/components/Select/index.ts +1 -0
  384. package/src/components/Shake/Shake.usage.mdx +107 -0
  385. package/src/components/Slider/Slider.stories.tsx +116 -0
  386. package/src/components/Slider/Slider.usage.mdx +179 -0
  387. package/src/components/Spinner/Spinner.stories.tsx +64 -0
  388. package/src/components/Spinner/Spinner.usage.mdx +136 -0
  389. package/src/components/SwapTransition/SwapTransition.usage.mdx +102 -0
  390. package/src/components/Switch/Switch.stories.tsx +131 -6
  391. package/src/components/Switch/Switch.usage.mdx +199 -0
  392. package/src/components/Table/Table.stories.tsx +159 -1
  393. package/src/components/Table/Table.usage.mdx +235 -0
  394. package/src/components/Tabs/Tabs.stories.tsx +86 -0
  395. package/src/components/Tabs/Tabs.usage.mdx +219 -0
  396. package/src/components/Tag/Tag.stories.tsx +181 -4
  397. package/src/components/Tag/Tag.usage.mdx +257 -0
  398. package/src/components/Textarea/Textarea.stories.tsx +113 -0
  399. package/src/components/Textarea/Textarea.usage.mdx +186 -0
  400. package/src/components/Toast/Toast.stories.tsx +185 -3
  401. package/src/components/Toast/Toast.styles.ts +18 -10
  402. package/src/components/Toast/Toast.usage.mdx +265 -0
  403. package/src/components/Tooltip/Tooltip.stories.tsx +86 -1
  404. package/src/components/Tooltip/Tooltip.usage.mdx +211 -0
  405. package/src/components/Tree/Tree.stories.tsx +89 -0
  406. package/src/components/Tree/Tree.usage.mdx +207 -0
  407. package/src/components/Typography/Caption.tsx +0 -1
  408. package/src/components/Typography/H1.tsx +0 -1
  409. package/src/components/Typography/H2.tsx +0 -1
  410. package/src/components/Typography/H3.tsx +0 -1
  411. package/src/components/Typography/H4.tsx +0 -1
  412. package/src/components/Typography/H5.tsx +0 -1
  413. package/src/components/Typography/Link.tsx +0 -1
  414. package/src/components/Typography/Overline.tsx +0 -1
  415. package/src/components/Typography/Subtext.tsx +0 -1
  416. package/src/components/Typography/Subtitle.tsx +0 -1
  417. package/src/components/Typography/Text.tsx +0 -1
  418. package/src/components/Typography/Typography.stories.tsx +117 -0
  419. package/src/components/Typography/Typography.usage.mdx +257 -0
  420. package/src/components/Workflow/Workflow.usage.mdx +199 -0
  421. package/src/components/noRawScales.test.ts +5 -1
  422. package/src/foundations/BrandAssets.mdx +637 -0
  423. package/src/foundations/BrandAssets.stories.tsx +680 -0
  424. package/src/foundations/BrandColour.mdx +364 -0
  425. package/src/foundations/BrandColour.stories.tsx +334 -0
  426. package/src/guidelines/ComponentPageTemplate.mdx +84 -0
  427. package/src/guidelines/FeedbackActions.mdx +162 -23
  428. package/src/guidelines/_components/Lang.tsx +175 -0
  429. package/src/guidelines/_components/TokenTable.tsx +136 -0
  430. package/src/hooks/useLanguage.ts +8 -3
  431. package/src/hooks/useTranslate.test.tsx +46 -0
  432. package/src/hooks/useTranslate.ts +7 -5
  433. package/src/theme/BazePalette.stories.tsx +111 -1
  434. package/src/theme/Palette.stories.tsx +2 -2
  435. package/src/theme/SemanticTokens.mdx +87 -2
  436. package/src/theme/claude.md +16 -7
  437. package/src/theme/colors.ts +51 -6
  438. package/src/theme/contrast.test.ts +59 -3
  439. package/src/theme/global.ts +19 -0
  440. package/src/theme/index.ts +2 -0
  441. package/src/theme/palette.generated.ts +99 -0
  442. package/src/theme/paletteSwatches.ts +35 -0
  443. package/src/theme/recipes/avatar.ts +92 -0
  444. package/src/translations/Defaults.translations.json +7 -0
@@ -1,10 +1,20 @@
1
- import { useState } from 'react';
2
- import { Flex, Stack, Text } from '@chakra-ui/react';
1
+ import { ReactNode, useState } from 'react';
2
+ import {
3
+ Box,
4
+ Toaster as ChakraToaster,
5
+ createToaster,
6
+ Flex,
7
+ Stack,
8
+ Text,
9
+ } from '@chakra-ui/react';
3
10
  import { Meta, StoryObj } from '@storybook/react';
4
11
 
12
+ import { T } from '../../guidelines/_components/Lang';
13
+ import { TokenTable } from '../../guidelines/_components/TokenTable';
5
14
  import { Button } from '../Button';
6
15
  import { Toast } from './Toast';
7
- import type { UseToastOptions } from './Toast.types';
16
+ import { toastStyles } from './Toast.styles';
17
+ import type { ToastAction, ToastStatus, UseToastOptions } from './Toast.types';
8
18
  import { Toaster } from './Toaster';
9
19
  import { useToast } from './useToast';
10
20
 
@@ -14,6 +24,14 @@ const meta = {
14
24
  parameters: {
15
25
  layout: 'centered',
16
26
  },
27
+ argTypes: {
28
+ status: {
29
+ control: 'select',
30
+ options: ['neutral', 'info', 'success', 'warning', 'error'],
31
+ description:
32
+ '`neutral` (default): a plain result with no status, no icon. `success`: done as asked. `info`: a fact about what just happened; nothing is wrong. `warning`: done, but not quite as expected. `error`: it did not happen.',
33
+ },
34
+ },
17
35
  } satisfies Meta<typeof Toast>;
18
36
 
19
37
  export default meta;
@@ -602,3 +620,167 @@ export const ActionShortMessage: Story = {
602
620
  />
603
621
  ),
604
622
  };
623
+
624
+ // ───────────────────────── Usage-page specimens ─────────────────────────
625
+ // Pulled into `Toast.usage.mdx` with <Canvas of={…} />. Hidden from the
626
+ // sidebar (`!dev`); `tags` is written on each story because the indexer reads
627
+ // CSF statically.
628
+ //
629
+ // Each specimen renders the real `Toast` through its own toaster, held open
630
+ // (`duration: Infinity`) inside a transformed box. The transform makes the
631
+ // toaster's `position: fixed` region relative to the box, so the toast sits in
632
+ // the docs page instead of at the top of the window, and the specimens do not
633
+ // share the app-wide `toaster`.
634
+
635
+ const ToastPreview = ({
636
+ status = 'neutral',
637
+ title,
638
+ description,
639
+ action,
640
+ height = 150,
641
+ }: {
642
+ status?: ToastStatus;
643
+ title?: ReactNode;
644
+ description?: ReactNode;
645
+ action?: ToastAction;
646
+ height?: number;
647
+ }) => {
648
+ // Created with its toast in the initialiser, not in an effect: a toast
649
+ // dismissed by a StrictMode effect cleanup did not come back.
650
+ const [local] = useState(() => {
651
+ const toaster = createToaster({ placement: 'top' });
652
+ toaster.create({
653
+ type: status === 'neutral' ? 'info' : status,
654
+ title,
655
+ description,
656
+ duration: Infinity,
657
+ meta: { status, action },
658
+ });
659
+ return toaster;
660
+ });
661
+ return (
662
+ <Box
663
+ position="relative"
664
+ transform="translateZ(0)"
665
+ h={`${height}px`}
666
+ w="100%"
667
+ minW={{ md: '420px' }}
668
+ overflow="hidden"
669
+ >
670
+ <ChakraToaster toaster={local} insetInline={{ mdDown: '4' }} gap={3}>
671
+ {(toast) => {
672
+ const s = (toast.meta?.status ?? 'neutral') as ToastStatus;
673
+ return (
674
+ <Toast
675
+ title={toast.title}
676
+ description={toast.description}
677
+ status={s}
678
+ action={toast.meta?.action}
679
+ onClose={() => {}}
680
+ {...toastStyles[s]}
681
+ />
682
+ );
683
+ }}
684
+ </ChakraToaster>
685
+ </Box>
686
+ );
687
+ };
688
+
689
+ const noop = () => {};
690
+
691
+ export const DoActionProp: Story = {
692
+ tags: ['!dev'],
693
+ parameters: { layout: 'padded' },
694
+ name: 'Usage / Do: one action through `action`',
695
+ render: () => (
696
+ <ToastPreview
697
+ status="error"
698
+ description="크레딧이 부족해 응답을 생성하지 못했습니다."
699
+ action={{ label: '크레딧 구매', onClick: noop }}
700
+ />
701
+ ),
702
+ };
703
+
704
+ export const DontButtonInDescription: Story = {
705
+ tags: ['!dev'],
706
+ parameters: { layout: 'padded' },
707
+ name: "Usage / Don't: a Button inside `description`",
708
+ render: () => (
709
+ <ToastPreview
710
+ status="error"
711
+ height={170}
712
+ description={
713
+ <Stack gap={2} align="flex-start">
714
+ <span>크레딧이 부족해 응답을 생성하지 못했습니다.</span>
715
+ <Button variant="secondary" size="sm">
716
+ 크레딧 구매
717
+ </Button>
718
+ </Stack>
719
+ }
720
+ />
721
+ ),
722
+ };
723
+
724
+ export const DoUndoAfterDelete: Story = {
725
+ tags: ['!dev'],
726
+ parameters: { layout: 'padded' },
727
+ name: 'Usage / Do: confirm, and offer undo',
728
+ render: () => (
729
+ <ToastPreview
730
+ status="success"
731
+ description="채팅을 삭제했습니다."
732
+ action={{ label: '되돌리기', onClick: noop }}
733
+ />
734
+ ),
735
+ };
736
+
737
+ export const DontToastForFieldError: Story = {
738
+ tags: ['!dev'],
739
+ parameters: { layout: 'padded' },
740
+ name: "Usage / Don't: a toast for a field error",
741
+ render: () => (
742
+ <ToastPreview
743
+ status="error"
744
+ description="이메일 형식이 올바르지 않습니다."
745
+ />
746
+ ),
747
+ };
748
+
749
+ export const DoNeutralResult: Story = {
750
+ tags: ['!dev'],
751
+ parameters: { layout: 'padded' },
752
+ name: 'Usage / Do: neutral for a plain result',
753
+ render: () => <ToastPreview description="링크를 복사했습니다." />,
754
+ };
755
+
756
+ const STATUSES: ToastStatus[] = ['neutral', 'info', 'success', 'warning', 'error'];
757
+
758
+ /** Tokens each status reads, from `Toast.styles.ts` and the theme. */
759
+ export const UsageTokens: Story = {
760
+ tags: ['!dev'],
761
+ parameters: { layout: 'padded' },
762
+ name: 'Usage / Tokens',
763
+ render: () => (
764
+ <TokenTable
765
+ rows={STATUSES.flatMap((status) => [
766
+ {
767
+ token: toastStyles[status].bg as string,
768
+ use: <T en={`${status} · background`} ko={`${status} · 배경`} />,
769
+ },
770
+ {
771
+ token: toastStyles[status].borderColor as string,
772
+ use: <T en={`${status} · border`} ko={`${status} · 테두리`} />,
773
+ },
774
+ {
775
+ token: toastStyles[status].color as string,
776
+ use: (
777
+ <T
778
+ en={`${status} · text, icon, action, ×`}
779
+ ko={`${status} · 글자, 아이콘, 동작, ×`}
780
+ />
781
+ ),
782
+ },
783
+ ])}
784
+ />
785
+ ),
786
+ };
@@ -7,8 +7,12 @@ import type { ToastStatus } from './Toast.types';
7
7
  *
8
8
  * Each status is bg `{s}.bg` + text `{s}.fg` + a 1px `{s}.border` outline —
9
9
  * `info` reads its own `info.*` family instead of borrowing `primary.*`.
10
- * `neutral` carries no status (it is the default when none is given):
11
- * `border.default` / `bg.surface` / `fg.default`.
10
+ * `neutral` carries no status (it is the default when none is given) and is
11
+ * inverted: the tooltip pair `tooltip.bg` / `tooltip.fg`. A `bg.surface` toast
12
+ * was white on a white canvas in light mode, set apart only by a 1px border
13
+ * and the shadow — a "링크를 복사했어요" confirmation was easy to miss. The
14
+ * tooltip pair already flips per mode (ink in light, cream in dark), so the
15
+ * toast stays the highest-contrast thing on the page in both.
12
16
  */
13
17
  export const toastStyles: Record<ToastStatus, BoxProps> = {
14
18
  info: {
@@ -32,9 +36,9 @@ export const toastStyles: Record<ToastStatus, BoxProps> = {
32
36
  borderColor: 'danger.border',
33
37
  },
34
38
  neutral: {
35
- bg: 'bg.surface',
36
- color: 'fg.default',
37
- borderColor: 'border.default',
39
+ bg: 'tooltip.bg',
40
+ color: 'tooltip.fg',
41
+ borderColor: 'tooltip.bg',
38
42
  },
39
43
  };
40
44
 
@@ -69,9 +73,11 @@ export const closeButtonStyles: Record<ToastStatus, BoxProps> = {
69
73
  },
70
74
  },
71
75
  neutral: {
72
- color: 'fg.default',
76
+ color: 'tooltip.fg',
73
77
  _hover: {
74
- bg: 'bg.muted',
78
+ // A tint of the toast's own text colour: no surface token sits on the
79
+ // inverted ground in both modes.
80
+ bg: 'color-mix(in srgb, var(--chakra-colors-tooltip-fg) 16%, transparent)',
75
81
  },
76
82
  },
77
83
  };
@@ -127,9 +133,11 @@ export const actionStyles: Record<ToastStatus, BoxProps> = {
127
133
  },
128
134
  neutral: {
129
135
  ...actionBase,
130
- color: 'fg.default',
131
- _hover: { bg: 'bg.muted' },
132
- _focusVisible: { outline: '2px solid', outlineColor: 'fg.default' },
136
+ color: 'tooltip.fg',
137
+ _hover: {
138
+ bg: 'color-mix(in srgb, var(--chakra-colors-tooltip-fg) 16%, transparent)',
139
+ },
140
+ _focusVisible: { outline: '2px solid', outlineColor: 'tooltip.fg' },
133
141
  },
134
142
  };
135
143
 
@@ -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
+ };