@mindlogic-ai/logician-ui 5.0.0-alpha.3 → 5.0.0-alpha.4

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 (240) hide show
  1. package/dist/components/Banner/Banner.types.d.ts +24 -1
  2. package/dist/components/Banner/Banner.types.d.ts.map +1 -1
  3. package/dist/components/Card/Card.types.d.ts +12 -0
  4. package/dist/components/Card/Card.types.d.ts.map +1 -1
  5. package/dist/components/ColorMode/ColorModeToggle.d.ts +7 -2
  6. package/dist/components/ColorMode/ColorModeToggle.d.ts.map +1 -1
  7. package/dist/components/ColorMode/ColorModeToggle.js +8 -3
  8. package/dist/components/ColorMode/ColorModeToggle.js.map +1 -1
  9. package/dist/components/ColorMode/ColorModeToggle.mjs +8 -3
  10. package/dist/components/ColorMode/ColorModeToggle.mjs.map +1 -1
  11. package/dist/components/Confetti/Confetti.types.d.ts +5 -1
  12. package/dist/components/Confetti/Confetti.types.d.ts.map +1 -1
  13. package/dist/components/Confetti/confettiColors.d.ts +5 -5
  14. package/dist/components/Confetti/confettiColors.js +5 -5
  15. package/dist/components/Confetti/confettiColors.mjs +5 -5
  16. package/dist/components/ErrorFallback/ErrorFallback.types.d.ts +6 -0
  17. package/dist/components/ErrorFallback/ErrorFallback.types.d.ts.map +1 -1
  18. package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts +4 -1
  19. package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts.map +1 -1
  20. package/dist/components/LineGraph/LineGraph.d.ts.map +1 -1
  21. package/dist/components/LineGraph/LineGraph.js +4 -5
  22. package/dist/components/LineGraph/LineGraph.js.map +1 -1
  23. package/dist/components/LineGraph/LineGraph.mjs +5 -6
  24. package/dist/components/LineGraph/LineGraph.mjs.map +1 -1
  25. package/dist/components/LineGraph/LineGraph.types.d.ts +12 -2
  26. package/dist/components/LineGraph/LineGraph.types.d.ts.map +1 -1
  27. package/dist/components/LineGraph/seriesColors.d.ts +12 -8
  28. package/dist/components/LineGraph/seriesColors.d.ts.map +1 -1
  29. package/dist/components/LineGraph/seriesColors.js +8 -7
  30. package/dist/components/LineGraph/seriesColors.js.map +1 -1
  31. package/dist/components/LineGraph/seriesColors.mjs +8 -7
  32. package/dist/components/LineGraph/seriesColors.mjs.map +1 -1
  33. package/dist/components/Masonry/Masonry.types.d.ts +8 -3
  34. package/dist/components/Masonry/Masonry.types.d.ts.map +1 -1
  35. package/dist/components/Menu/MenuItem.types.d.ts +8 -0
  36. package/dist/components/Menu/MenuItem.types.d.ts.map +1 -1
  37. package/dist/components/Modal/ModalCloseButton.d.ts +1 -1
  38. package/dist/components/Modal/ModalCloseButton.js +1 -1
  39. package/dist/components/Modal/ModalCloseButton.mjs +1 -1
  40. package/dist/components/Pagination/Pagination.d.ts +11 -10
  41. package/dist/components/Pagination/Pagination.d.ts.map +1 -1
  42. package/dist/components/Pagination/Pagination.js +11 -10
  43. package/dist/components/Pagination/Pagination.js.map +1 -1
  44. package/dist/components/Pagination/Pagination.mjs +11 -10
  45. package/dist/components/Pagination/Pagination.mjs.map +1 -1
  46. package/dist/components/ProgressBar/ProgressBar.types.d.ts +9 -0
  47. package/dist/components/ProgressBar/ProgressBar.types.d.ts.map +1 -1
  48. package/dist/components/RadialProgress/RadialProgress.types.d.ts +21 -1
  49. package/dist/components/RadialProgress/RadialProgress.types.d.ts.map +1 -1
  50. package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts +8 -0
  51. package/dist/components/SeeMoreButton/SeeMoreButton.types.d.ts.map +1 -1
  52. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  53. package/dist/components/SegmentedControl/SegmentedControl.js +6 -7
  54. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  55. package/dist/components/SegmentedControl/SegmentedControl.mjs +6 -7
  56. package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -1
  57. package/dist/components/SegmentedProgressBar/SegmentedProgressBar.types.d.ts +2 -0
  58. package/dist/components/SegmentedProgressBar/SegmentedProgressBar.types.d.ts.map +1 -1
  59. package/dist/components/Toast/Toast.styles.d.ts +6 -2
  60. package/dist/components/Toast/Toast.styles.d.ts.map +1 -1
  61. package/dist/components/Toast/Toast.styles.js +18 -10
  62. package/dist/components/Toast/Toast.styles.js.map +1 -1
  63. package/dist/components/Toast/Toast.styles.mjs +18 -10
  64. package/dist/components/Toast/Toast.styles.mjs.map +1 -1
  65. package/dist/theme/colors.d.ts +2 -2
  66. package/dist/theme/colors.d.ts.map +1 -1
  67. package/dist/theme/colors.js +22 -2
  68. package/dist/theme/colors.js.map +1 -1
  69. package/dist/theme/colors.mjs +23 -3
  70. package/dist/theme/colors.mjs.map +1 -1
  71. package/dist/theme/palette.generated.d.ts +98 -0
  72. package/dist/theme/palette.generated.d.ts.map +1 -1
  73. package/dist/theme/palette.generated.js +99 -0
  74. package/dist/theme/palette.generated.js.map +1 -1
  75. package/dist/theme/palette.generated.mjs +99 -1
  76. package/dist/theme/palette.generated.mjs.map +1 -1
  77. package/dist/theme/paletteSwatches.d.ts +20 -0
  78. package/dist/theme/paletteSwatches.d.ts.map +1 -1
  79. package/package.json +1 -1
  80. package/src/components/Accordion/Accordion.stories.tsx +85 -0
  81. package/src/components/Accordion/Accordion.usage.mdx +200 -0
  82. package/src/components/Appear/Appear.usage.mdx +107 -0
  83. package/src/components/Avatar/Avatar.stories.tsx +71 -1
  84. package/src/components/Avatar/Avatar.usage.mdx +166 -0
  85. package/src/components/Banner/Banner.stories.tsx +152 -2
  86. package/src/components/Banner/Banner.types.ts +30 -1
  87. package/src/components/Banner/Banner.usage.mdx +233 -0
  88. package/src/components/BottomSheet/BottomSheet.stories.tsx +168 -1
  89. package/src/components/BottomSheet/BottomSheet.usage.mdx +216 -0
  90. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +59 -0
  91. package/src/components/Breadcrumb/Breadcrumb.usage.mdx +181 -0
  92. package/src/components/Button/Button.stories.tsx +263 -3
  93. package/src/components/Button/Button.usage.mdx +342 -0
  94. package/src/components/Card/Card.stories.tsx +106 -0
  95. package/src/components/Card/Card.types.ts +12 -0
  96. package/src/components/Card/Card.usage.mdx +216 -0
  97. package/src/components/Checkbox/Checkbox.stories.tsx +140 -13
  98. package/src/components/Checkbox/Checkbox.usage.mdx +214 -0
  99. package/src/components/Chip/Chip.usage.mdx +78 -0
  100. package/src/components/Code/Code.stories.tsx +60 -0
  101. package/src/components/Code/Code.usage.mdx +187 -0
  102. package/src/components/CodeTabs/CodeTabs.stories.tsx +53 -0
  103. package/src/components/CodeTabs/CodeTabs.usage.mdx +176 -0
  104. package/src/components/Collapsible/Collapsible.stories.tsx +58 -0
  105. package/src/components/Collapsible/Collapsible.usage.mdx +173 -0
  106. package/src/components/ColorMode/ColorMode.stories.tsx +50 -0
  107. package/src/components/ColorMode/ColorMode.usage.mdx +135 -0
  108. package/src/components/ColorMode/ColorModeToggle.tsx +10 -3
  109. package/src/components/Confetti/Confetti.types.ts +5 -1
  110. package/src/components/Confetti/Confetti.usage.mdx +111 -0
  111. package/src/components/Confetti/confettiColors.ts +5 -5
  112. package/src/components/Container/Container.stories.tsx +32 -0
  113. package/src/components/Container/Container.usage.mdx +130 -0
  114. package/src/components/CopyableCode/CopyableCode.stories.tsx +62 -0
  115. package/src/components/CopyableCode/CopyableCode.usage.mdx +168 -0
  116. package/src/components/CountBadge/CountBadge.stories.tsx +69 -0
  117. package/src/components/CountBadge/CountBadge.usage.mdx +215 -0
  118. package/src/components/CountUp/CountUp.usage.mdx +107 -0
  119. package/src/components/DatePicker/DatePicker.usage.mdx +177 -0
  120. package/src/components/DatePicker/RangeDatePicker.stories.tsx +87 -3
  121. package/src/components/ErrorFallback/ErrorFallback.types.ts +6 -0
  122. package/src/components/ErrorFallback/ErrorFallback.usage.mdx +127 -0
  123. package/src/components/ExpandableText/ExpandableText.stories.tsx +55 -0
  124. package/src/components/ExpandableText/ExpandableText.usage.mdx +176 -0
  125. package/src/components/FileInput/FileInput.stories.tsx +38 -1
  126. package/src/components/FileInput/FileInput.usage.mdx +178 -0
  127. package/src/components/FileItem/FileItem.stories.tsx +71 -0
  128. package/src/components/FileItem/FileItem.usage.mdx +180 -0
  129. package/src/components/FileList/FileList.stories.tsx +25 -0
  130. package/src/components/FileList/FileList.usage.mdx +165 -0
  131. package/src/components/FlyTo/FlyTo.usage.mdx +99 -0
  132. package/src/components/Form/Form.stories.tsx +149 -0
  133. package/src/components/Form/Form.usage.mdx +201 -0
  134. package/src/components/Form/FormModalFooter/FormModalFooter.types.ts +4 -1
  135. package/src/components/FormControl/FormControl.stories.tsx +35 -0
  136. package/src/components/FormControl/FormControl.usage.mdx +128 -0
  137. package/src/components/FormIntegration/FormIntegration.usage.mdx +158 -0
  138. package/src/components/FormLabel/FormLabel.stories.tsx +71 -0
  139. package/src/components/FormLabel/FormLabel.usage.mdx +125 -0
  140. package/src/components/Icon/Icon.stories.tsx +61 -1
  141. package/src/components/Icon/Icon.usage.mdx +158 -0
  142. package/src/components/IconButton/IconButton.stories.tsx +209 -5
  143. package/src/components/IconButton/IconButton.usage.mdx +273 -0
  144. package/src/components/InfoSprinkle/InfoSprinkle.stories.tsx +77 -1
  145. package/src/components/InfoSprinkle/InfoSprinkle.usage.mdx +189 -0
  146. package/src/components/InlineCode/InlineCode.stories.tsx +75 -0
  147. package/src/components/InlineCode/InlineCode.usage.mdx +142 -0
  148. package/src/components/Input/Input.stories.tsx +180 -0
  149. package/src/components/Input/Input.usage.mdx +278 -0
  150. package/src/components/LineGraph/LineGraph.stories.tsx +112 -0
  151. package/src/components/LineGraph/LineGraph.tsx +4 -5
  152. package/src/components/LineGraph/LineGraph.types.ts +12 -2
  153. package/src/components/LineGraph/LineGraph.usage.mdx +186 -0
  154. package/src/components/LineGraph/seriesColors.test.ts +11 -10
  155. package/src/components/LineGraph/seriesColors.ts +18 -16
  156. package/src/components/Loaders/Loaders.stories.tsx +93 -0
  157. package/src/components/Loaders/Loaders.usage.mdx +180 -0
  158. package/src/components/LogicianProvider/LogicianProvider.usage.mdx +98 -0
  159. package/src/components/Markdown/Markdown.stories.tsx +53 -0
  160. package/src/components/Markdown/Markdown.usage.mdx +182 -0
  161. package/src/components/Masonry/Masonry.stories.tsx +63 -1
  162. package/src/components/Masonry/Masonry.types.ts +8 -3
  163. package/src/components/Masonry/Masonry.usage.mdx +142 -0
  164. package/src/components/MaxLengthIndicator/MaxLengthIndicator.stories.tsx +57 -0
  165. package/src/components/MaxLengthIndicator/MaxLengthIndicator.usage.mdx +125 -0
  166. package/src/components/Menu/Menu.stories.tsx +146 -2
  167. package/src/components/Menu/Menu.usage.mdx +230 -0
  168. package/src/components/Menu/MenuItem.types.ts +8 -0
  169. package/src/components/Modal/Modal.stories.tsx +177 -1
  170. package/src/components/Modal/Modal.usage.mdx +262 -0
  171. package/src/components/Modal/ModalCloseButton.tsx +1 -1
  172. package/src/components/MonthPicker/MonthPicker.stories.tsx +30 -0
  173. package/src/components/MonthPicker/MonthPicker.usage.mdx +191 -0
  174. package/src/components/Pagination/Pagination.stories.tsx +90 -1
  175. package/src/components/Pagination/Pagination.tsx +11 -10
  176. package/src/components/Pagination/Pagination.usage.mdx +186 -0
  177. package/src/components/PasswordInput/PasswordInput.stories.tsx +51 -0
  178. package/src/components/PasswordInput/PasswordInput.usage.mdx +193 -0
  179. package/src/components/PinInput/PinInput.stories.tsx +91 -0
  180. package/src/components/PinInput/PinInput.usage.mdx +194 -0
  181. package/src/components/Popover/Popover.stories.tsx +104 -1
  182. package/src/components/Popover/Popover.usage.mdx +197 -0
  183. package/src/components/ProgressBar/ProgressBar.stories.tsx +92 -1
  184. package/src/components/ProgressBar/ProgressBar.types.ts +9 -0
  185. package/src/components/ProgressBar/ProgressBar.usage.mdx +210 -0
  186. package/src/components/Pulse/Pulse.usage.mdx +102 -0
  187. package/src/components/RadialProgress/RadialProgress.stories.tsx +74 -1
  188. package/src/components/RadialProgress/RadialProgress.types.ts +21 -1
  189. package/src/components/RadialProgress/RadialProgress.usage.mdx +153 -0
  190. package/src/components/Radio/Radio.stories.tsx +119 -0
  191. package/src/components/Radio/Radio.usage.mdx +187 -0
  192. package/src/components/Reveal/Reveal.usage.mdx +105 -0
  193. package/src/components/ScaledContext/ScaledContext.usage.mdx +111 -0
  194. package/src/components/SeeMoreButton/SeeMoreButton.stories.tsx +146 -2
  195. package/src/components/SeeMoreButton/SeeMoreButton.types.ts +8 -0
  196. package/src/components/SeeMoreButton/SeeMoreButton.usage.mdx +213 -0
  197. package/src/components/SegmentedControl/SegmentedControl.stories.tsx +69 -0
  198. package/src/components/SegmentedControl/SegmentedControl.tsx +6 -7
  199. package/src/components/SegmentedControl/SegmentedControl.usage.mdx +209 -0
  200. package/src/components/SegmentedProgressBar/SegmentedProgressBar.stories.tsx +54 -0
  201. package/src/components/SegmentedProgressBar/SegmentedProgressBar.types.ts +2 -0
  202. package/src/components/SegmentedProgressBar/SegmentedProgressBar.usage.mdx +145 -0
  203. package/src/components/Select/Select.stories.tsx +209 -1
  204. package/src/components/Select/Select.usage.mdx +278 -0
  205. package/src/components/Shake/Shake.usage.mdx +107 -0
  206. package/src/components/Slider/Slider.stories.tsx +116 -0
  207. package/src/components/Slider/Slider.usage.mdx +179 -0
  208. package/src/components/Spinner/Spinner.stories.tsx +64 -0
  209. package/src/components/Spinner/Spinner.usage.mdx +136 -0
  210. package/src/components/SwapTransition/SwapTransition.usage.mdx +102 -0
  211. package/src/components/Switch/Switch.stories.tsx +131 -6
  212. package/src/components/Switch/Switch.usage.mdx +199 -0
  213. package/src/components/Table/Table.stories.tsx +159 -1
  214. package/src/components/Table/Table.usage.mdx +235 -0
  215. package/src/components/Tabs/Tabs.stories.tsx +86 -0
  216. package/src/components/Tabs/Tabs.usage.mdx +219 -0
  217. package/src/components/Tag/Tag.stories.tsx +181 -4
  218. package/src/components/Tag/Tag.usage.mdx +257 -0
  219. package/src/components/Textarea/Textarea.stories.tsx +113 -0
  220. package/src/components/Textarea/Textarea.usage.mdx +186 -0
  221. package/src/components/Toast/Toast.stories.tsx +185 -3
  222. package/src/components/Toast/Toast.styles.ts +18 -10
  223. package/src/components/Toast/Toast.usage.mdx +265 -0
  224. package/src/components/Tooltip/Tooltip.stories.tsx +86 -1
  225. package/src/components/Tooltip/Tooltip.usage.mdx +211 -0
  226. package/src/components/Tree/Tree.stories.tsx +89 -0
  227. package/src/components/Tree/Tree.usage.mdx +207 -0
  228. package/src/components/Typography/Typography.stories.tsx +117 -0
  229. package/src/components/Typography/Typography.usage.mdx +251 -0
  230. package/src/components/Workflow/Workflow.usage.mdx +199 -0
  231. package/src/components/noRawScales.test.ts +5 -1
  232. package/src/foundations/BrandColour.mdx +65 -2
  233. package/src/theme/BazePalette.stories.tsx +111 -1
  234. package/src/theme/Palette.stories.tsx +2 -2
  235. package/src/theme/SemanticTokens.mdx +75 -16
  236. package/src/theme/claude.md +15 -9
  237. package/src/theme/colors.ts +33 -3
  238. package/src/theme/contrast.test.ts +32 -0
  239. package/src/theme/palette.generated.ts +99 -0
  240. package/src/theme/paletteSwatches.ts +35 -0
@@ -0,0 +1,199 @@
1
+ import { Canvas, Meta } from '@storybook/blocks';
2
+
3
+ import { En, Ko, LangToggle, Verdict } from '../../guidelines/_components/Lang';
4
+ import * as WorkflowStories from './stories/Workflow.stories';
5
+
6
+ <Meta of={WorkflowStories} name="Usage" />
7
+
8
+ <LangToggle />
9
+
10
+ <En>
11
+
12
+ # Workflow
13
+
14
+ A node-based workflow editor on React Flow: a drag-and-drop palette, a
15
+ canvas with undo/redo, auto-arrange and selection, and an optional inspector
16
+ drawer. It ships **no node types**: you register yours with
17
+ `defineNodeType`, and you own persistence and validation. FactChat's studio
18
+ behaviour editor is built on it. Full API: `Workflow/README.md`.
19
+
20
+ ## When to use
21
+
22
+ - Users build or read a graph of steps with branches: triggers, AI steps,
23
+ conditions, outputs.
24
+ - A read-only picture of a saved flow (`readOnly`, `showPalette={false}`,
25
+ `minHeight={0}`).
26
+
27
+ ## When not to use
28
+
29
+ - A fixed, linear sequence of steps → a numbered list or a stepper.
30
+ - A hierarchy → `Tree`.
31
+ - A settings form that happens to have sections → `Accordion` or `Card`s.
32
+
33
+ ## Options that change behaviour
34
+
35
+ | Prop / part | Means |
36
+ | --- | --- |
37
+ | `nodeTypes` | Required. Your node kinds; `category` (`trigger`, `ai`, `logic`, `safety`, `output`, `note`) drives the tile colour |
38
+ | `graph` + `onGraphChange`, or `defaultGraph` | Controlled or uncontrolled graph |
39
+ | `<NodeInspector />` child | Built-in drawer on selection (`dock="left" \| "right"`); omit it and use `onSelectionChange` to drive your own panel |
40
+ | `issues` / `validating` | Render-only validation you supply; the editor does not validate |
41
+ | `readOnly` | No palette, no connecting, dragging or deleting; the inspector becomes a read-only view |
42
+ | `translate` | Chrome copy. Without it the bundled strings resolve to Korean |
43
+ | `useWorkflowActions().addNode` | Add nodes without dragging (a "+" toolbar, a tap-to-add list) |
44
+
45
+ ## Do / Don't
46
+
47
+ </En>
48
+
49
+ <Ko>
50
+
51
+ # Workflow
52
+
53
+ React Flow 위에 만든 노드 기반 워크플로 편집기입니다. 끌어다 놓는 팔레트, 실행 취소·
54
+ 다시 실행, 자동 정렬, 선택이 되는 캔버스, 그리고 선택해서 켜는 속성 서랍이 있습니다.
55
+ **노드 종류는 하나도 들어 있지 않습니다.** `defineNodeType`으로 직접 등록하고, 저장과
56
+ 검증도 앱이 맡습니다. FactChat 스튜디오의 동작 편집기가 이것으로 만들어졌습니다. 전체
57
+ API는 `Workflow/README.md`에 있습니다.
58
+
59
+ ## 언제 쓰나요
60
+
61
+ - 사용자가 갈래가 있는 단계 그래프(트리거, AI 단계, 조건, 출력)를 만들거나 읽을 때.
62
+ - 저장된 흐름을 읽기 전용 그림으로 보여 줄 때(`readOnly`, `showPalette={false}`,
63
+ `minHeight={0}`).
64
+
65
+ ## 언제 쓰지 않나요
66
+
67
+ - 갈래 없이 정해진 순서의 단계라면 번호 목록이나 단계 표시를 씁니다.
68
+ - 계층이라면 `Tree`를 씁니다.
69
+ - 섹션이 있는 설정 폼이라면 `Accordion`이나 `Card`를 씁니다.
70
+
71
+ ## 동작을 바꾸는 옵션
72
+
73
+ | 속성 / 파트 | 뜻 |
74
+ | --- | --- |
75
+ | `nodeTypes` | 필수. 노드 종류. `category`(`trigger`, `ai`, `logic`, `safety`, `output`, `note`)가 타일 색을 정합니다 |
76
+ | `graph` + `onGraphChange`, 또는 `defaultGraph` | 제어 그래프 또는 비제어 그래프 |
77
+ | 자식 `<NodeInspector />` | 선택하면 열리는 기본 서랍(`dock="left" \| "right"`). 빼고 `onSelectionChange`로 직접 만든 패널을 움직일 수도 있습니다 |
78
+ | `issues` / `validating` | 앱이 넘기는 검증 결과를 그리기만 합니다. 편집기가 검증하지 않습니다 |
79
+ | `readOnly` | 팔레트를 숨기고 연결·이동·삭제를 막습니다. 서랍은 읽기 전용 보기가 됩니다 |
80
+ | `translate` | 화면 문구 번역 함수. 넘기지 않으면 내장 문구가 한국어로 나옵니다 |
81
+ | `useWorkflowActions().addNode` | 끌지 않고 노드를 추가합니다("+" 도구 모음, 눌러서 추가하는 목록) |
82
+
83
+ ## 이렇게 하세요 / 이렇게 하지 마세요
84
+
85
+ </Ko>
86
+
87
+ <Canvas of={WorkflowStories.AddNodeWithoutDrag} />
88
+ <Verdict
89
+ kind="do"
90
+ en="Offer a way to add nodes without dragging: a + beside the selected node or a list of node types, built on useWorkflowActions().addNode."
91
+ ko="끌지 않고도 노드를 추가할 방법을 줍니다. useWorkflowActions().addNode로 선택한 노드 옆의 +나 노드 종류 목록을 만듭니다."
92
+ />
93
+
94
+ <Canvas of={WorkflowStories.ReadOnly} />
95
+ <Verdict
96
+ kind="do"
97
+ en="Use readOnly for a saved flow the user can look at but not change."
98
+ ko="사용자가 보기만 하고 바꾸지 않는 저장된 흐름에는 readOnly를 씁니다."
99
+ />
100
+
101
+ <Verdict
102
+ kind="dont"
103
+ en="Validate inside the editor or rely on canvas colour alone for errors. Pass issues with a message; they appear on the node and in the drawer as text."
104
+ ko="편집기 안에서 검증하거나 캔버스 색만으로 오류를 알리지 마세요. 메시지가 있는 issues를 넘기면 노드와 서랍에 글로 나타납니다."
105
+ />
106
+
107
+ <En>
108
+
109
+ ## Content
110
+
111
+ - Node `label`s are short operational nouns (Message, Condition). The README
112
+ keeps them untranslated on purpose.
113
+ - `getMetaChips` shows a few words of config on the card; keep chips short.
114
+ - Issue `message`s say what to fix: "연결되지 않은 출구가 있습니다", not "오류".
115
+
116
+ ## Accessibility
117
+
118
+ What Workflow does for you:
119
+
120
+ - Canvas controls (zoom, fit, undo, redo, lock, auto-arrange) are buttons
121
+ with translated names; the palette is a labelled region with a named close
122
+ button (WCAG 4.1.2).
123
+ - Keyboard shortcuts: ⌘/Ctrl+Z and +Y (undo, redo), +C/+V (copy, paste),
124
+ +D (duplicate), Delete/Backspace (remove the selected node or edge), Escape
125
+ (close the inspector). They stay out of the way while typing in a field.
126
+
127
+ What you still have to do:
128
+
129
+ - **Give a non-drag way to add nodes** (WCAG 2.5.7): the palette is
130
+ drag-and-drop. Use `useWorkflowActions().addNode`, as in the Do example.
131
+ - **Pass `translate`** for any non-Korean app, or the chrome is announced in
132
+ Korean.
133
+ - Moving nodes and drawing connections are pointer gestures in React Flow;
134
+ the graph is hard to edit by keyboard alone. Keep the inspector the place
135
+ where every setting can be changed by keyboard (WCAG 2.1.1).
136
+
137
+ ## Tokens
138
+
139
+ Node tiles take their colour from `category`; override the mapping with
140
+ `categoryTokens`. See `Workflow/README.md`, "Theming, layout & read-only".
141
+
142
+ </En>
143
+
144
+ <Ko>
145
+
146
+ ## 문구
147
+
148
+ - 노드 `label`은 짧은 동작 명사(Message, Condition)로 씁니다. README는 일부러 번역하지
149
+ 않습니다.
150
+ - `getMetaChips`는 카드에 설정값 몇 단어를 보여 줍니다. 칩은 짧게 씁니다.
151
+ - issue의 `message`에는 고칠 내용을 씁니다. '오류'가 아니라 '연결되지 않은 출구가
152
+ 있습니다'처럼 씁니다.
153
+
154
+ ## 접근성
155
+
156
+ Workflow가 알아서 하는 일
157
+
158
+ - 캔버스 컨트롤(확대, 축소, 화면 맞춤, 실행 취소, 다시 실행, 잠금, 자동 정렬)은 번역된
159
+ 이름이 있는 버튼이고, 팔레트는 이름이 있는 영역이며 닫기 버튼에도 이름이 있습니다
160
+ (WCAG 4.1.2).
161
+ - 단축키: ⌘/Ctrl+Z와 +Y(실행 취소, 다시 실행), +C/+V(복사, 붙여넣기), +D(복제),
162
+ Delete/Backspace(선택한 노드나 연결 삭제), Escape(서랍 닫기). 입력 칸에 글을 쓰는
163
+ 동안에는 동작하지 않습니다.
164
+
165
+ 직접 챙겨야 하는 일
166
+
167
+ - **끌지 않고 노드를 추가하는 방법을 줍니다**(WCAG 2.5.7). 팔레트는 끌어다 놓는
168
+ 방식입니다. 이렇게 하세요 예시처럼 `useWorkflowActions().addNode`를 씁니다.
169
+ - 한국어가 아닌 앱이라면 **`translate`를 넘깁니다.** 넘기지 않으면 화면 문구가 한국어로
170
+ 읽힙니다.
171
+ - 노드 이동과 연결 그리기는 React Flow의 포인터 동작이라 키보드만으로 그래프를 고치기
172
+ 어렵습니다. 모든 설정은 서랍에서 키보드로 바꿀 수 있게 합니다(WCAG 2.1.1).
173
+
174
+ ## 토큰
175
+
176
+ 노드 타일 색은 `category`에서 오며, `categoryTokens`로 바꿀 수 있습니다.
177
+ `Workflow/README.md`의 "Theming, layout & read-only"를 봅니다.
178
+
179
+ </Ko>
180
+
181
+ <En>
182
+
183
+ ## Related
184
+
185
+ - **Tree**: a hierarchy rather than a graph.
186
+ - **Banner**: graph-wide issues above the canvas.
187
+ - `Workflow/README.md`: node types, the inspector, selection, `hostBridge`.
188
+
189
+ </En>
190
+
191
+ <Ko>
192
+
193
+ ## 관련 컴포넌트
194
+
195
+ - **Tree**: 그래프가 아니라 계층일 때.
196
+ - **Banner**: 캔버스 위의 그래프 전체 문제.
197
+ - `Workflow/README.md`: 노드 종류, 서랍, 선택, `hostBridge`.
198
+
199
+ </Ko>
@@ -4,7 +4,7 @@ import { join, relative } from 'node:path';
4
4
  import { describe, expect, it } from 'vitest';
5
5
 
6
6
  import { SYSTEM_HUE_NAMES } from '@/theme/colors';
7
- import { CORAL } from '@/theme/palette.generated';
7
+ import { CORAL, DATAVIZ } from '@/theme/palette.generated';
8
8
 
9
9
  /**
10
10
  * Components read ROLE tokens (`bg.*`, `fg.*`, `primary.*`, `category.*` …),
@@ -64,6 +64,7 @@ const TOKEN = new RegExp(
64
64
  `(?<![\\w.$-])(?:` +
65
65
  `(?:${alt(numeric)})\\.\\d+` +
66
66
  `|coral\\.(?:${alt(Object.keys(CORAL))})` +
67
+ `|dataviz\\.(?:${alt(Object.keys(DATAVIZ))})` +
67
68
  `|(?:${alt(SYSTEM_HUE_NAMES)})\\.(?:${alt(HUE_KEYS)})` +
68
69
  `)(?![\\w.])`,
69
70
  'g'
@@ -124,6 +125,7 @@ describe('components read no raw palette scales', () => {
124
125
  "'ink.12'",
125
126
  "'sandDark.3'",
126
127
  "'coral.base'",
128
+ "'dataviz.blueMid'",
127
129
  "'red.surface'",
128
130
  "'blue.hc'",
129
131
  "'blackAlpha.600'",
@@ -135,6 +137,8 @@ describe('components read no raw palette scales', () => {
135
137
  "'category.green.surface'",
136
138
  "'green'",
137
139
  "'fg.default'",
140
+ "'data.4'",
141
+ "'diverging.pos.3'",
138
142
  'theme.colors.gray.100',
139
143
  "'--chakra-colors-gray-100'",
140
144
  "'secondary.surface'",
@@ -39,7 +39,11 @@ token for which surface: **Setup/Theme/Using Semantic Tokens**.
39
39
  - **The twelve system hues are for categories only.** `category.{hue}.*`
40
40
  carries no status meaning.
41
41
  - **Blue means data and links.** `fg.link` for links; a blue monochrome ramp
42
- for single-measure charts (see Using Semantic Tokens).
42
+ (`data.1–4`) for single-measure charts (see Using Semantic Tokens).
43
+ - **Above and below a baseline is blue and orange.** Charts against a real
44
+ baseline (vs plan, vs average) use `diverging.*`: blue above, orange below,
45
+ `diverging.mid` at the baseline. Orange fills only, never red/green for
46
+ direction.
43
47
  - **No gradients.** A brand band is one solid colour.
44
48
 
45
49
  ## Neutrals
@@ -85,6 +89,7 @@ borrowing a hue.
85
89
  | The coral icon on the black run button (`action.iconOnSolid`) | Wide surfaces, light backgrounds, card fills |
86
90
  | The AI-working mark, the logo mark, large type (`action.mark`) | Promotion badges |
87
91
  | The unread count badge (`count.*`, a deeper coral red) | Warning and error text or borders; switches and checkboxes when on; links |
92
+ | The prize amount on an event screen, as display type (`action.mark`) | Event card headers, modal footer bands, small eyebrow text |
88
93
 
89
94
  - **Points, not surfaces.** Nothing coral is larger than a button, badge or
90
95
  icon. Coral and the error red are only a few degrees apart in hue; at light
@@ -94,6 +99,34 @@ borrowing a hue.
94
99
  Super Agent diamond are status and identity marks, so they may appear next to
95
100
  a run signal.
96
101
 
102
+ ## Campaign and event surfaces
103
+
104
+ First decide whether the screen is product or marketing. A page that needs a
105
+ login, or has controls that change the account, is product. In-app event pages,
106
+ their intro modals and promo banners are product. Marketing is everything
107
+ outside the product that people see logged out: baze.co, SNS posts, print.
108
+
109
+ - **In the product, events follow the coral rule above.** No coral fills and
110
+ no text on coral. Emphasis comes from the illustration; a band behind a card
111
+ header or modal footer is `bg.muted` or `layer.*`, never `secondary.surface`
112
+ or coral.
113
+ - **The prize may be coral.** The reward amount as display type in
114
+ `action.mark` (24px and up, or 19px bold) is the screen's one coral moment.
115
+ Everything around it stays neutral.
116
+ - **Small text is never coral.** Eyebrows and labels use `fg.subtle`. Darkening
117
+ coral until small text passes contrast lands right next to the error text red
118
+ (`danger.fg`).
119
+ - **A thin decorative line counts as a point.** A coral line up to 4px with no
120
+ text or information on it is allowed, like the band under the FactChat promo
121
+ banner.
122
+ - **Event CTAs stay `primary`.** An event screen is a product screen, so
123
+ `Button variant="accent"` stays on marketing heroes (see Button usage), and a
124
+ reward claim is never coral.
125
+ - **A marketing page may have one full-bleed coral band.** Only ink or cream
126
+ content sits on it; elsewhere on that page coral is large type or art only.
127
+ The reference is baze.co/social: the offer section is the band, and
128
+ "80개 이상", "월 5,900원" and "9,000" are the large coral type.
129
+
97
130
  ## Status
98
131
 
99
132
  <Canvas of={BrandColour.Status} sourceState="none" />
@@ -186,7 +219,10 @@ BAZE의 화면은 따뜻한 무채색입니다. 크림·아이보리 바탕에
186
219
  - **열두 가지 시스템 색은 카테고리 구분에만 씁니다.** `category.{hue}.*`에는 상태의
187
220
  뜻이 없습니다.
188
221
  - **파란색은 데이터와 링크를 뜻합니다.** 링크는 `fg.link`, 하나의 값을 보여 주는
189
- 차트는 파란색 단색 단계를 씁니다(Using Semantic Tokens 참고).
222
+ 차트는 파란색 단색 단계(`data.1–4`)를 씁니다(Using Semantic Tokens 참고).
223
+ - **기준선 위아래는 파랑과 주황으로 나눕니다.** 계획 대비, 평균 대비처럼 실제 기준선이
224
+ 있는 차트는 `diverging.*`를 씁니다. 기준선 위는 파랑, 아래는 주황, 기준선 자리는
225
+ `diverging.mid`입니다. 주황은 면에만 쓰고, 방향을 빨강·초록으로 나타내지 않습니다.
190
226
  - **그라데이션은 쓰지 않습니다.** 브랜드 띠는 단색 하나로 칠합니다.
191
227
 
192
228
  ## 무채색
@@ -231,6 +267,7 @@ BAZE의 화면은 따뜻한 무채색입니다. 크림·아이보리 바탕에
231
267
  | 블랙 실행 버튼 위의 코랄 아이콘 (`action.iconOnSolid`) | 넓은 면, 옅은 배경, 카드 바탕 |
232
268
  | AI 작업 중 표시, 로고 마크, 큰 글씨 (`action.mark`) | 프로모션 배지 |
233
269
  | 읽지 않은 숫자 배지 (`count.*`, 조금 더 진한 코랄 레드) | 경고·오류 문구와 테두리, 켜진 스위치·체크박스, 링크 |
270
+ | 이벤트 화면의 보상 금액 큰 글씨 (`action.mark`) | 이벤트 카드 머리와 모달 하단 띠, 작은 머리말 글자 |
234
271
 
235
272
  - **면이 아니라 점으로 씁니다.** 버튼·배지·아이콘보다 큰 면을 코랄로 칠하지 않습니다.
236
273
  코랄과 오류 빨강은 색상 차이가 몇 도밖에 나지 않아 옅게 쓰면 같은 색이 됩니다.
@@ -239,6 +276,32 @@ BAZE의 화면은 따뜻한 무채색입니다. 크림·아이보리 바탕에
239
276
  버튼이 사라지고 그 자리에 로딩 표시가 나타납니다. 숫자 배지와 Super Agent 마름모는
240
277
  상태와 정체성을 나타내는 표시라 실행 신호와 함께 보여도 됩니다.
241
278
 
279
+ ## 캠페인·이벤트 화면
280
+
281
+ 먼저 그 화면이 제품인지 마케팅인지 가립니다. 로그인해야 들어갈 수 있거나 계정을
282
+ 바꾸는 조작이 있으면 제품입니다. 앱 안의 이벤트 페이지와 그 안내 모달, 프로모션
283
+ 배너도 제품입니다. 마케팅은 제품 밖에서 로그인 없이 보는 화면으로, baze.co, SNS
284
+ 게시물, 인쇄물이 여기에 해당합니다.
285
+
286
+ - **제품 안의 이벤트도 위의 코랄 규칙을 따릅니다.** 코랄로 면을 칠하지 않고 코랄
287
+ 위에 글자를 올리지 않습니다. 강조는 일러스트로 하고, 카드 머리나 모달 하단의 띠는
288
+ `bg.muted`나 `layer.*`로 칠합니다. `secondary.surface`나 코랄은 쓰지 않습니다.
289
+ - **보상 금액은 코랄로 쓸 수 있습니다.** 보상 금액을 `action.mark` 큰 글씨(24px
290
+ 이상, 또는 19px 굵게)로 쓰는 것이 그 화면의 하나뿐인 코랄입니다. 주변은 모두
291
+ 무채색으로 둡니다.
292
+ - **작은 글자는 코랄로 쓰지 않습니다.** 작은 머리말이나 라벨은 `fg.subtle`을 씁니다.
293
+ 작은 글자가 대비 기준을 넘을 때까지 코랄을 어둡게 하면 오류 문구의 빨강
294
+ (`danger.fg`)과 거의 같아집니다.
295
+ - **얇은 장식선은 점으로 봅니다.** 글자나 정보 없이 장식만 하는 4px 이하의 코랄 선은
296
+ 써도 됩니다. FactChat 프로모션 배너 아래의 띠가 그 예입니다.
297
+ - **이벤트의 행동 유도 버튼은 `primary`입니다.** 이벤트 화면도 제품 화면이므로
298
+ `Button variant="accent"`는 마케팅 히어로에만 씁니다(Button 사용법 참고). 보상 받기
299
+ 버튼도 코랄로 칠하지 않습니다.
300
+ - **마케팅 페이지에는 화면 폭을 가득 채우는 코랄 띠를 하나 둘 수 있습니다.** 그 위에는
301
+ 블랙이나 크림색 내용만 올리고, 페이지의 나머지 부분에서 코랄은 큰 글씨나 그림에만
302
+ 씁니다. 기준은 baze.co/social입니다. 혜택 섹션이 그 띠이고, "80개 이상",
303
+ "월 5,900원", "9,000"이 코랄 큰 글씨입니다.
304
+
242
305
  ## 상태
243
306
 
244
307
  <Canvas of={BrandColour.Status} sourceState="none" />
@@ -7,7 +7,19 @@ import {
7
7
  ROLE_TOKEN_PATHS,
8
8
  SYSTEM_HUE_NAMES,
9
9
  } from './colors';
10
- import { CORAL, RAMPS, SCHEMES, SYSTEM_HUES } from './palette.generated';
10
+ import {
11
+ CORAL,
12
+ DATAVIZ,
13
+ RAMPS,
14
+ SCHEMES,
15
+ SYSTEM_HUES,
16
+ } from './palette.generated';
17
+ import {
18
+ DATA_VIZ_LABEL_TOKEN,
19
+ DATA_VIZ_LABELS,
20
+ type DataVizKey,
21
+ resolveColor,
22
+ } from './paletteSwatches';
11
23
 
12
24
  /**
13
25
  * logician-ui 5.0 BAZE palette — the three token layers.
@@ -104,6 +116,12 @@ export const RawScales: Story = {
104
116
  <Chip key={k} hex={hex} label={k} />
105
117
  ))}
106
118
  </Flex>
119
+ <H4>dataviz</H4>
120
+ <Flex gap={2} wrap="wrap">
121
+ {Object.entries(DATAVIZ).map(([k, hex]) => (
122
+ <Chip key={k} hex={hex} label={k} />
123
+ ))}
124
+ </Flex>
107
125
  <H4>system hues</H4>
108
126
  <Grid templateColumns="120px repeat(8, 1fr)" gap={1} fontSize="11px">
109
127
  <span />
@@ -157,6 +175,98 @@ export const RoleTokens: Story = {
157
175
  ),
158
176
  };
159
177
 
178
+ const DATA_STEPS = (Object.keys(DATA_VIZ_LABELS) as DataVizKey[]).filter((k) =>
179
+ k.startsWith('data-')
180
+ );
181
+ /** Display order: far below → baseline → far above. */
182
+ const DIVERGING_STEPS: DataVizKey[] = [
183
+ 'diverging-neg-3',
184
+ 'diverging-neg-2',
185
+ 'diverging-neg-1',
186
+ 'diverging-mid',
187
+ 'diverging-pos-1',
188
+ 'diverging-pos-2',
189
+ 'diverging-pos-3',
190
+ ];
191
+
192
+ /** A fill with the in-cell label `DATA_VIZ_LABELS` gives it (or none). */
193
+ const DataCell = ({
194
+ flat,
195
+ hex,
196
+ mode,
197
+ }: {
198
+ flat: DataVizKey;
199
+ hex: string;
200
+ mode: 'light' | 'dark';
201
+ }) => {
202
+ const label = DATA_VIZ_LABELS[flat][mode];
203
+ const labelHex =
204
+ label && resolveColor(`{colors.${DATA_VIZ_LABEL_TOKEN[label]}}`, mode);
205
+ return (
206
+ <Stack gap={1}>
207
+ <Flex
208
+ bg={hex}
209
+ color={labelHex || undefined}
210
+ h="56px"
211
+ align="center"
212
+ justify="center"
213
+ fontSize="13px"
214
+ fontWeight="bold"
215
+ borderRadius="sm"
216
+ >
217
+ {labelHex && '42%'}
218
+ </Flex>
219
+ {/* Plain boxes: the panel paints its own mode, so text inherits its colour. */}
220
+ <Box fontFamily="mono" fontSize="11px">
221
+ {ROLE_TOKEN_PATHS[flat]}
222
+ </Box>
223
+ <Box fontSize="10px">
224
+ {hex} ·{' '}
225
+ {labelHex
226
+ ? `${label} label ${ratio(hex, labelHex).toFixed(2)}`
227
+ : 'no in-cell label'}
228
+ </Box>
229
+ </Stack>
230
+ );
231
+ };
232
+
233
+ /**
234
+ * Data-visualisation fills — `data.1–4` (single measure, 4 = largest) and
235
+ * `diverging.*` (blue above the baseline, orange below, `diverging.mid` at it)
236
+ * — in light and dark, each with the in-cell label it can carry.
237
+ */
238
+ export const DataViz: Story = {
239
+ render: () => (
240
+ <Stack gap={6} maxW="1100px">
241
+ {(['light', 'dark'] as const).map((mode) => {
242
+ const table = SCHEMES.ink[mode] as Record<string, string>;
243
+ return (
244
+ <Stack
245
+ key={mode}
246
+ gap={4}
247
+ p={4}
248
+ borderRadius="md"
249
+ bg={table['bg-canvas']}
250
+ color={table['fg-default']}
251
+ >
252
+ <Box fontWeight="bold">{mode}</Box>
253
+ <Grid templateColumns="repeat(4, 1fr)" gap={2}>
254
+ {DATA_STEPS.map((k) => (
255
+ <DataCell key={k} flat={k} hex={table[k]} mode={mode} />
256
+ ))}
257
+ </Grid>
258
+ <Grid templateColumns="repeat(7, 1fr)" gap={2}>
259
+ {DIVERGING_STEPS.map((k) => (
260
+ <DataCell key={k} flat={k} hex={table[k]} mode={mode} />
261
+ ))}
262
+ </Grid>
263
+ </Stack>
264
+ );
265
+ })}
266
+ </Stack>
267
+ ),
268
+ };
269
+
160
270
  /** Live tokens on this page's colour mode — flip the toolbar to check dark. */
161
271
  export const Category: Story = {
162
272
  render: () => (
@@ -30,9 +30,9 @@ const meta = {
30
30
 
31
31
  Three layers; components read only the last one.
32
32
 
33
- 1. **Raw scales** — \`ink\` / \`inkDark\`, \`sand\` / \`sandDark\`, \`slate\` / \`slateDark\` (1–12), \`coral\`, and 12 system hues. Values come from \`scripts/palette/generate.mjs\`.
33
+ 1. **Raw scales** — \`ink\` / \`inkDark\`, \`sand\` / \`sandDark\`, \`slate\` / \`slateDark\` (1–12), \`coral\`, 12 system hues, and \`dataviz\`. Values come from \`scripts/palette/generate.mjs\`.
34
34
  2. **Semantic steps** — \`neutral.1–12\` and \`secondary.1–12\`, filled by the theme option: \`createLogicianTheme({ neutral: 'ink' | 'slate', secondary: 'sand' })\` (or \`<LogicianProvider theme={…}>\`).
35
- 3. **Role tokens** — \`bg.*\`, \`layer.*\`, \`fg.*\`, \`border.*\`, \`primary.*\`, \`action.*\`, status \`{bg,border,fg,solid,onSolid}\`, \`category.*\` …
35
+ 3. **Role tokens** — \`bg.*\`, \`layer.*\`, \`fg.*\`, \`border.*\`, \`primary.*\`, \`action.*\`, status \`{bg,border,fg,solid,onSolid}\`, \`category.*\`, data-viz fills \`data.*\` / \`diverging.*\` …
36
36
 
37
37
  Every value below is shown in light and dark. Contrast is audited in CI (\`contrast.test.ts\`) in light, dark and both high-contrast modes. The 4.x names still resolve as aliases until 6.0 and are listed at the bottom, not in the grid. Setup/Theme/BAZE Palette shows the raw scales and every role in all four modes.
38
38
  `,
@@ -15,7 +15,7 @@ Values and contrast for every token: **Setup/Theme/BAZE Palette**.
15
15
  | --- | --- | --- |
16
16
  | Raw scale (colour names) | `ink.1–12`, `inkDark.1–12`, `sand.*`, `slate.*`, `coral.*`, `red.base` … | never in components |
17
17
  | Semantic step (role names) | `neutral.1–12`, `secondary.1–12` | a specific neutral step no role names |
18
- | Semantic role | `bg.*`, `layer.*`, `fg.*`, `border.*`, `primary.*`, `secondary.*`, `action.*`, `send.*`, `count.*`, `disabled.*`, `focus.ring`, status, `tooltip.*`, `category.*` | everything else |
18
+ | Semantic role | `bg.*`, `layer.*`, `fg.*`, `border.*`, `primary.*`, `secondary.*`, `action.*`, `send.*`, `count.*`, `disabled.*`, `focus.ring`, status, `tooltip.*`, `category.*`, `data.*`, `diverging.*` | everything else |
19
19
 
20
20
  ```ts
21
21
  createLogicianTheme() // BAZE: { neutral: 'ink', secondary: 'sand' }
@@ -45,6 +45,8 @@ createLogicianTheme({ neutral: 'slate' }) // cool gray — app code unchanged
45
45
  | Disabled (no opacity) | `disabled.bg` / `disabled.fg` |
46
46
  | Status | `danger` · `success` · `warning` · `info` → `.bg` `.border` `.fg` `.solid` `.onSolid` |
47
47
  | Decorative category (tiles, avatars, tags, charts) | `category.{hue}.surface` / `.fg` |
48
+ | Single-measure chart, usage bar, map, heatmap fill | `data.1`–`data.4` (4 = largest) |
49
+ | Chart fill above / below a real baseline (vs plan, vs average) | `diverging.pos.1–3` / `diverging.neg.1–3`, `diverging.mid` at the baseline |
48
50
 
49
51
  Emphasis is weight, not colour: headings use `fg.default`, never `primary.*`.
50
52
  Status colours mean status — don't borrow `success`/`warning` for decoration;
@@ -57,25 +59,82 @@ Use it for both, and for nothing decorative.
57
59
 
58
60
  - **Links** — `fg.link` / `fg.linkHover` (blue ink, #48607A / #AFC7E1), in chat
59
61
  messages, markdown and app copy alike. Never ink-black or coral for a link.
60
- - **Data visualisation** — usage/share bars, single-measure bar and line charts,
61
- maps, heatmaps, progress-by-share: a **blue monochrome ramp**, never a
62
- rainbow and never a grey ramp. Steps differ in lightness only (the saturated
63
- `blue.base` is left out); the largest value gets the strongest step.
64
-
65
- | Step | Light | Dark |
62
+ - **Data visualisation** — usage/share bars, single-measure bar charts, maps,
63
+ heatmaps, progress-by-share: the `data.*` ramp, a **blue monochrome ramp**,
64
+ never a rainbow and never a grey ramp. Steps differ in lightness only (the
65
+ saturated `blue.base` is left out). **The higher number is the larger value**:
66
+ `data.4` is the strongest step in both modes (dark mode flips the lightness,
67
+ so `data.4` is the lightest blue there).
68
+ - **Lines** — a single-measure line chart, and series 1 of a multi-series one,
69
+ stroke in `blue.base` (`#4674A4` / `#6892BD`, ≥ 4.5:1). A 2px line is not a
70
+ filled area: the ramp's darkest step `blue.ink` reads as slate grey at that
71
+ width, so lines take the saturated blue the ramp leaves out.
72
+
73
+ | Token | Light | Dark |
66
74
  | --- | --- | --- |
67
- | 1 (largest) | `#48607A` (`blue.ink`) · white label | `#AFC7E1` (`blue.inkDark`) · ink label |
68
- | 2 | `#7492B3` · ink label | `#7492B3` · ink label |
69
- | 3 | `#AFC7E1` · ink label | `#48607A` · white label |
70
- | 4 | `#DFEBF9` (`blue.surface`) · ink label | `#232F3D` (`blue.surfaceDark`) · white label |
71
-
72
- Pick each label by measured contrast (≥ 4.5:1), not by step number.
73
- A chart that must tell several *categories* apart (multi-series lines) keeps
74
- `CHART_SERIES_HUES` in `LineGraph/seriesColors.ts`, which leaves blue out so
75
- no series reads as a link or an info state.
75
+ | `data.4` (largest) | `#48607A` (`blue.ink`) · white label | `#AFC7E1` (`blue.inkDark`) · ink label |
76
+ | `data.3` | `#7492B3` (`dataviz.blueMid`) · ink label | `#7492B3` · ink label |
77
+ | `data.2` | `#AFC7E1` (`blue.inkDark`) · ink label | `#48607A` (`blue.ink`) · white label |
78
+ | `data.1` (smallest) | `#DFEBF9` (`blue.surface`) · ink label | `#232F3D` (`blue.surfaceDark`) · white label |
79
+
80
+ Pick each label by measured contrast (≥ 4.5:1), not by step number. Ink is
81
+ `#252525`, white is `#FFFFFF`, in either mode; `contrast.test.ts` re-measures
82
+ every label in this section, including the diverging table below.
83
+
84
+ A chart that must tell several *categories* apart (multi-series lines) starts
85
+ with the same data blue (`blue.base`) and then cycles `CHART_SERIES_HUES` in
86
+ `LineGraph/seriesColors.ts` (teal, pink, indigo, purple, brown, …), which
87
+ leaves red, yellow and green out so no series reads as a status.
76
88
  `info` is also blue; status always comes with an icon and words, so a blue
77
89
  chart is never mistaken for an info notice.
78
90
 
91
+ ### Diverging: above and below a baseline
92
+
93
+ When the value has a **real zero or baseline** and both directions mean
94
+ something — actual vs plan, this month vs the average, change since last
95
+ week — use the `diverging.*` ramp. A one-sided value (a count, a share, a
96
+ usage total) keeps `data.*`, even if some bars are small.
97
+
98
+ - **Blue is above the baseline, orange is below** (`diverging.pos.*` /
99
+ `diverging.neg.*`). `3` is the largest distance from the baseline on either
100
+ side, and the two sides share their lightness per step, so the same
101
+ distance looks the same size in both directions.
102
+ - **The baseline itself is `diverging.mid`** (neutral step 3, so it follows
103
+ the neutral scheme). Never white or `bg.canvas`: a "no change" cell must
104
+ still read as a cell.
105
+ - **Never red and green for direction.** Above/below is not good/bad. When a
106
+ direction is good or bad, that is a status: say it with an icon and words,
107
+ as everywhere else.
108
+ - **Orange is for fills only** — bars, cells, areas. Never orange text or
109
+ icons; labels and axis text stay `fg.*`. Lines keep the stroke rules
110
+ above.
111
+ - **The legend names the direction in words** ("above plan" / "below plan"),
112
+ not only with the two colours.
113
+
114
+ | Token | Light | Dark |
115
+ | --- | --- | --- |
116
+ | `diverging.pos.3` (far above) | `#2C5D91` · white label | `#A9C7EB` · ink label |
117
+ | `diverging.pos.2` | `#5890CD` · ink label | `#5890CD` · ink label |
118
+ | `diverging.pos.1` (just above) | `#A9C7EB` · ink label | `#2C5D91` · white label |
119
+ | `diverging.mid` (at the baseline) | `#EDE9E2` (`neutral.3`) · ink label | `#38332E` (`neutral.3`) · white label |
120
+ | `diverging.neg.1` (just below) | `#E4BBA0` · ink label | `#85491A` · white label |
121
+ | `diverging.neg.2` | `#BF7946` · **no in-cell label**; label outside the mark | `#BF7946` · **no in-cell label**; label outside the mark |
122
+ | `diverging.neg.3` (far below) | `#85491A` · white label | `#E4BBA0` · ink label |
123
+
124
+ `diverging.neg.2` clears neither label (ink 4.41:1, white 3.48:1), so values
125
+ for that step go beside or above the bar, not inside it. The `diverging.mid`
126
+ values shown are the `ink` scheme; with `neutral: 'slate'` it is slate step 3.
127
+
128
+ The diverging ramp is a dedicated data-viz ramp (OKLCH chroma ≈ 0.10–0.11 at
129
+ steps 2–3, 0.06 at step 1, the same on both sides): paired with the dusty
130
+ `data.*` blue (≈ 0.05), any warm hue reads as brown. Blue ↔ orange
131
+ also keeps the widest colour-blind separation of the pairs considered; gold
132
+ reads as a warning and purple collapses into blue for deuteranopes.
133
+
134
+ `data.*` and `diverging.*` are fills: under high contrast they keep their
135
+ value (like `bg.track`), and in-cell labels are audited at 4.5:1 in light and
136
+ dark.
137
+
79
138
  ## Modes
80
139
 
81
140
  Every role flips with the colour mode (`_light` / `_dark`) and has a
@@ -143,11 +143,11 @@ is the maintainer's view.
143
143
 
144
144
  ### Layers and files
145
145
 
146
- | Layer | Where | Rule |
147
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ----------------------------------------------------------------------------- |
148
- | Raw scales `ink`/`inkDark`, `sand`/`sandDark`, `slate`/`slateDark` (1–12), `coral`, 12 system hues `{base, baseDark, hc, hcDark, surface, ink, surfaceDark, inkDark}` | `palette.generated.ts` → `colors` in `colors.ts` | Components and recipes **never** read them |
149
- | Semantic steps `neutral.1–12`, `secondary.1–12` | `createSemanticColors()` | Filled by the theme option (`neutral: 'ink' \| 'slate'`, `secondary: 'sand'`) |
150
- | Roles (`bg.*`, `layer.*`, `fg.*`, `border.*`, `primary.*`, `secondary.*`, `action.*`, `send.*`, `count.*`, `disabled.*`, `focus.ring`, status, `tooltip.*`, `category.*`) | `ROLE_TOKEN_PATHS` + `createSemanticColors()` | The only colours a component reads |
146
+ | Layer | Where | Rule |
147
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ----------------------------------------------------------------------------- |
148
+ | Raw scales `ink`/`inkDark`, `sand`/`sandDark`, `slate`/`slateDark` (1–12), `coral`, 12 system hues `{base, baseDark, hc, hcDark, surface, ink, surfaceDark, inkDark}`, `dataviz` | `palette.generated.ts` → `colors` in `colors.ts` | Components and recipes **never** read them |
149
+ | Semantic steps `neutral.1–12`, `secondary.1–12` | `createSemanticColors()` | Filled by the theme option (`neutral: 'ink' \| 'slate'`, `secondary: 'sand'`) |
150
+ | Roles (`bg.*`, `layer.*`, `fg.*`, `border.*`, `primary.*`, `secondary.*`, `action.*`, `send.*`, `count.*`, `disabled.*`, `focus.ring`, status, `tooltip.*`, `category.*`, `data.*`, `diverging.*`) | `ROLE_TOKEN_PATHS` + `createSemanticColors()` | The only colours a component reads |
151
151
 
152
152
  - **Values come from the generator.** `scripts/palette/generate.mjs` ports the
153
153
  designer prototype (OKLCH, contrast-targeted steps) and `--check`s it against
@@ -166,8 +166,9 @@ _moreContrast }`) because Chakra cannot nest `_dark` inside `_moreContrast`
166
166
  ### Adding or changing a token
167
167
 
168
168
  1. Add it to the generator (`buildScheme`) and to `PATHS` in `colors.ts`.
169
- 2. Register its contrast pair(s) in `contrast.test.ts` (`PAIRS`, `SEP`), or a
170
- reason in `NO_PAIR`. The registry test fails until you do; the audit runs
169
+ 2. Register its contrast pair(s) in `contrast.test.ts` (`PAIRS`, `SEP`; a
170
+ data-viz fill goes in `DATA_VIZ_LABELS` (`paletteSwatches.ts`) with its in-cell label), or a reason in
171
+ `NO_PAIR`. The registry test fails until you do; the audit runs
171
172
  light / dark / hcLight / hcDark for every neutral scheme.
172
173
  3. Add it to `SemanticColorToken` and to SemanticTokens.mdx.
173
174
 
@@ -250,8 +251,13 @@ follow the scheme and high contrast. Base font size is 14px.
250
251
  badges/tags, the modal header band), never rows or panels.
251
252
  5. Disabled = `disabled.*`, not opacity. Focus = `focusRing`.
252
253
  6. Blue means data and links: links are `fg.link`; data visualisation
253
- (usage bars, single-measure charts, maps) is a blue monochrome ramp, never a
254
- rainbow or grey ramp. Values: SemanticTokens.mdx → "Blue means data and links".
254
+ (usage bars, single-measure bar charts, maps) fills with `data.1–4` (4 =
255
+ largest), never a rainbow or grey ramp; line strokes (single-measure, and
256
+ series 1) use `blue.base`. Values against a real baseline (vs plan, vs
257
+ average) fill with `diverging.pos.1–3` (above, blue) / `diverging.neg.1–3`
258
+ (below, orange) and `diverging.mid` at the baseline — never red/green for
259
+ direction, never orange text or icons. Values and labels:
260
+ SemanticTokens.mdx → "Blue means data and links".
255
261
 
256
262
  ## Extending the Theme
257
263