@panneau/ui 5.0.0-alpha.1 → 5.0.0-alpha.3

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 (396) hide show
  1. package/README.md +276 -13
  2. package/bin/check-theme.js +5 -0
  3. package/dist/alert/Alert.css +28 -42
  4. package/dist/alert/Alert.d.ts +18 -4
  5. package/dist/alert/Alert.d.ts.map +1 -1
  6. package/dist/alert/Alert.js +4 -3
  7. package/dist/alert/Alert.js.map +1 -1
  8. package/dist/alert/Alert.module.js +14 -16
  9. package/dist/alert/Alert.module.js.map +1 -1
  10. package/dist/alert/tokens.d.ts +3 -0
  11. package/dist/alert/tokens.d.ts.map +1 -0
  12. package/dist/alert/tokens.js +21 -0
  13. package/dist/alert/tokens.js.map +1 -0
  14. package/dist/badge/Badge.css +24 -36
  15. package/dist/badge/Badge.d.ts +18 -3
  16. package/dist/badge/Badge.d.ts.map +1 -1
  17. package/dist/badge/Badge.js +3 -2
  18. package/dist/badge/Badge.js.map +1 -1
  19. package/dist/badge/Badge.module.js +9 -13
  20. package/dist/badge/Badge.module.js.map +1 -1
  21. package/dist/badge/tokens.d.ts +3 -0
  22. package/dist/badge/tokens.d.ts.map +1 -0
  23. package/dist/badge/tokens.js +23 -0
  24. package/dist/badge/tokens.js.map +1 -0
  25. package/dist/button/Button.css +58 -42
  26. package/dist/button/Button.d.ts +30 -3
  27. package/dist/button/Button.d.ts.map +1 -1
  28. package/dist/button/Button.js +27 -2
  29. package/dist/button/Button.js.map +1 -1
  30. package/dist/button/Button.module.js +14 -14
  31. package/dist/button/Button.module.js.map +1 -1
  32. package/dist/button/tokens.d.ts +3 -0
  33. package/dist/button/tokens.d.ts.map +1 -0
  34. package/dist/button/tokens.js +25 -0
  35. package/dist/button/tokens.js.map +1 -0
  36. package/dist/card/Card.css +27 -20
  37. package/dist/card/Card.js +1 -1
  38. package/dist/card/Card.js.map +1 -1
  39. package/dist/card/Card.module.js +5 -5
  40. package/dist/card/Card.module.js.map +1 -1
  41. package/dist/card/tokens.d.ts +3 -0
  42. package/dist/card/tokens.d.ts.map +1 -0
  43. package/dist/card/tokens.js +31 -0
  44. package/dist/card/tokens.js.map +1 -0
  45. package/dist/checkbox/Checkbox.css +22 -21
  46. package/dist/checkbox/Checkbox.d.ts.map +1 -1
  47. package/dist/checkbox/Checkbox.js +2 -1
  48. package/dist/checkbox/Checkbox.js.map +1 -1
  49. package/dist/checkbox/Checkbox.module.js +6 -6
  50. package/dist/checkbox/Checkbox.module.js.map +1 -1
  51. package/dist/checkbox/ChoiceChrome.d.ts +3 -1
  52. package/dist/checkbox/ChoiceChrome.d.ts.map +1 -1
  53. package/dist/checkbox/ChoiceChrome.js +2 -2
  54. package/dist/checkbox/ChoiceChrome.js.map +1 -1
  55. package/dist/checkbox/tokens.d.ts +3 -0
  56. package/dist/checkbox/tokens.d.ts.map +1 -0
  57. package/dist/checkbox/tokens.js +21 -0
  58. package/dist/checkbox/tokens.js.map +1 -0
  59. package/dist/combo-box/ComboBox.css +4 -4
  60. package/dist/combo-box/ComboBox.js +1 -1
  61. package/dist/combo-box/ComboBox.js.map +1 -1
  62. package/dist/combo-box/ComboBox.module.js +3 -3
  63. package/dist/container/Container.css +32 -0
  64. package/dist/container/Container.d.ts +15 -0
  65. package/dist/container/Container.d.ts.map +1 -0
  66. package/dist/container/Container.js +18 -0
  67. package/dist/container/Container.js.map +1 -0
  68. package/dist/container/Container.module.js +20 -0
  69. package/dist/container/Container.module.js.map +1 -0
  70. package/dist/container/tokens.d.ts +3 -0
  71. package/dist/container/tokens.d.ts.map +1 -0
  72. package/dist/container/tokens.js +19 -0
  73. package/dist/container/tokens.js.map +1 -0
  74. package/dist/date-picker/DatePicker.css +30 -30
  75. package/dist/date-picker/DatePicker.js +1 -1
  76. package/dist/date-picker/DatePicker.js.map +1 -1
  77. package/dist/date-picker/DatePicker.module.js +11 -11
  78. package/dist/date-picker/DatePicker.module.js.map +1 -1
  79. package/dist/date-picker/calendarTokens.d.ts +3 -0
  80. package/dist/date-picker/calendarTokens.d.ts.map +1 -0
  81. package/dist/date-picker/calendarTokens.js +17 -0
  82. package/dist/date-picker/calendarTokens.js.map +1 -0
  83. package/dist/dialog/Dialog.css +40 -36
  84. package/dist/dialog/Dialog.js +1 -1
  85. package/dist/dialog/Dialog.js.map +1 -1
  86. package/dist/dialog/Dialog.module.js +11 -11
  87. package/dist/dialog/Dialog.module.js.map +1 -1
  88. package/dist/dialog/tokens.d.ts +3 -0
  89. package/dist/dialog/tokens.d.ts.map +1 -0
  90. package/dist/dialog/tokens.js +29 -0
  91. package/dist/dialog/tokens.js.map +1 -0
  92. package/dist/disclosure/Disclosure.css +12 -12
  93. package/dist/disclosure/Disclosure.d.ts.map +1 -1
  94. package/dist/disclosure/Disclosure.js +1 -1
  95. package/dist/disclosure/Disclosure.js.map +1 -1
  96. package/dist/disclosure/Disclosure.module.js +7 -7
  97. package/dist/disclosure/Disclosure.module.js.map +1 -1
  98. package/dist/disclosure/tokens.d.ts +3 -0
  99. package/dist/disclosure/tokens.d.ts.map +1 -0
  100. package/dist/disclosure/tokens.js +15 -0
  101. package/dist/disclosure/tokens.js.map +1 -0
  102. package/dist/divider/Divider.css +17 -0
  103. package/dist/divider/Divider.d.ts +8 -0
  104. package/dist/divider/Divider.d.ts.map +1 -0
  105. package/dist/divider/Divider.js +21 -0
  106. package/dist/divider/Divider.js.map +1 -0
  107. package/dist/divider/Divider.module.js +12 -0
  108. package/dist/divider/Divider.module.js.map +1 -0
  109. package/dist/divider/tokens.d.ts +3 -0
  110. package/dist/divider/tokens.d.ts.map +1 -0
  111. package/dist/divider/tokens.js +13 -0
  112. package/dist/divider/tokens.js.map +1 -0
  113. package/dist/field/Field.css +40 -37
  114. package/dist/field/Field.module.js +11 -11
  115. package/dist/field/Field.module.js.map +1 -1
  116. package/dist/field/Fieldset.js +1 -1
  117. package/dist/field/Fieldset.js.map +1 -1
  118. package/dist/field/inputTokens.d.ts +3 -0
  119. package/dist/field/inputTokens.d.ts.map +1 -0
  120. package/dist/field/inputTokens.js +21 -0
  121. package/dist/field/inputTokens.js.map +1 -0
  122. package/dist/field/tokens.d.ts +3 -0
  123. package/dist/field/tokens.d.ts.map +1 -0
  124. package/dist/field/tokens.js +15 -0
  125. package/dist/field/tokens.js.map +1 -0
  126. package/dist/grid/Grid.css +174 -0
  127. package/dist/grid/Grid.d.ts +28 -0
  128. package/dist/grid/Grid.d.ts.map +1 -0
  129. package/dist/grid/Grid.js +31 -0
  130. package/dist/grid/Grid.js.map +1 -0
  131. package/dist/grid/Grid.module.js +12 -0
  132. package/dist/grid/Grid.module.js.map +1 -0
  133. package/dist/grid/GridItem.css +59 -0
  134. package/dist/grid/GridItem.module.js +7 -0
  135. package/dist/grid/GridItem.module.js.map +1 -0
  136. package/dist/grid/tokens.d.ts +3 -0
  137. package/dist/grid/tokens.d.ts.map +1 -0
  138. package/dist/grid/tokens.js +10 -0
  139. package/dist/grid/tokens.js.map +1 -0
  140. package/dist/heading/Heading.css +52 -0
  141. package/dist/heading/Heading.d.ts +17 -0
  142. package/dist/heading/Heading.d.ts.map +1 -0
  143. package/dist/heading/Heading.js +17 -0
  144. package/dist/heading/Heading.js.map +1 -0
  145. package/dist/heading/Heading.module.js +16 -0
  146. package/dist/heading/Heading.module.js.map +1 -0
  147. package/dist/heading/tokens.d.ts +6 -0
  148. package/dist/heading/tokens.d.ts.map +1 -0
  149. package/dist/heading/tokens.js +66 -0
  150. package/dist/heading/tokens.js.map +1 -0
  151. package/dist/icon/Icon.css +1 -1
  152. package/dist/icon/Icon.js +1 -1
  153. package/dist/icon/Icon.js.map +1 -1
  154. package/dist/icon/Icon.module.js +1 -1
  155. package/dist/icon/lucideIconLoader.d.ts +9 -0
  156. package/dist/icon/lucideIconLoader.d.ts.map +1 -0
  157. package/dist/icon/lucideIconLoader.js +22 -0
  158. package/dist/icon/lucideIconLoader.js.map +1 -0
  159. package/dist/icon/namedIcons.d.ts +15 -8
  160. package/dist/icon/namedIcons.d.ts.map +1 -1
  161. package/dist/icon/namedIcons.js +43 -29
  162. package/dist/icon/namedIcons.js.map +1 -1
  163. package/dist/icon-button/IconButton.css +2 -2
  164. package/dist/icon-button/IconButton.d.ts +1 -1
  165. package/dist/icon-button/IconButton.d.ts.map +1 -1
  166. package/dist/icon-button/IconButton.js +3 -3
  167. package/dist/icon-button/IconButton.js.map +1 -1
  168. package/dist/icon-button/IconButton.module.js +2 -2
  169. package/dist/index.d.ts +26 -6
  170. package/dist/index.d.ts.map +1 -1
  171. package/dist/index.js +21 -3
  172. package/dist/inline/Inline.css +142 -0
  173. package/dist/inline/Inline.d.ts +17 -0
  174. package/dist/inline/Inline.d.ts.map +1 -0
  175. package/dist/inline/Inline.js +21 -0
  176. package/dist/inline/Inline.js.map +1 -0
  177. package/dist/inline/Inline.module.js +12 -0
  178. package/dist/inline/Inline.module.js.map +1 -0
  179. package/dist/inline/tokens.d.ts +3 -0
  180. package/dist/inline/tokens.d.ts.map +1 -0
  181. package/dist/inline/tokens.js +10 -0
  182. package/dist/inline/tokens.js.map +1 -0
  183. package/dist/layout/responsive.d.ts +38 -0
  184. package/dist/layout/responsive.d.ts.map +1 -0
  185. package/dist/layout/responsive.js +49 -0
  186. package/dist/layout/responsive.js.map +1 -0
  187. package/dist/menu/Menu.js +2 -2
  188. package/dist/menu/Menu.js.map +1 -1
  189. package/dist/named-icons/index.d.ts +2 -0
  190. package/dist/named-icons/index.d.ts.map +1 -0
  191. package/dist/named-icons/index.js +1 -0
  192. package/dist/number-input/NumberInput.css +12 -12
  193. package/dist/number-input/NumberInput.js +1 -1
  194. package/dist/number-input/NumberInput.js.map +1 -1
  195. package/dist/number-input/NumberInput.module.js +4 -4
  196. package/dist/number-input/NumberInput.module.js.map +1 -1
  197. package/dist/number-input/tokens.d.ts +3 -0
  198. package/dist/number-input/tokens.d.ts.map +1 -0
  199. package/dist/number-input/tokens.js +10 -0
  200. package/dist/number-input/tokens.js.map +1 -0
  201. package/dist/popover/Popover.css +13 -12
  202. package/dist/popover/Popover.js +2 -2
  203. package/dist/popover/Popover.js.map +1 -1
  204. package/dist/popover/Popover.module.js +3 -3
  205. package/dist/popover/Popover.module.js.map +1 -1
  206. package/dist/popover/tokens.d.ts +3 -0
  207. package/dist/popover/tokens.d.ts.map +1 -0
  208. package/dist/popover/tokens.js +19 -0
  209. package/dist/popover/tokens.js.map +1 -0
  210. package/dist/prose/Prose.css +141 -0
  211. package/dist/prose/Prose.d.ts +11 -0
  212. package/dist/prose/Prose.d.ts.map +1 -0
  213. package/dist/prose/Prose.js +18 -0
  214. package/dist/prose/Prose.js.map +1 -0
  215. package/dist/prose/Prose.module.js +8 -0
  216. package/dist/prose/Prose.module.js.map +1 -0
  217. package/dist/prose/tokens.d.ts +3 -0
  218. package/dist/prose/tokens.d.ts.map +1 -0
  219. package/dist/prose/tokens.js +33 -0
  220. package/dist/prose/tokens.js.map +1 -0
  221. package/dist/radio-group/RadioGroup.css +21 -20
  222. package/dist/radio-group/RadioGroup.d.ts.map +1 -1
  223. package/dist/radio-group/RadioGroup.js +2 -2
  224. package/dist/radio-group/RadioGroup.js.map +1 -1
  225. package/dist/radio-group/RadioGroup.module.js +6 -6
  226. package/dist/radio-group/RadioGroup.module.js.map +1 -1
  227. package/dist/radio-group/tokens.d.ts +3 -0
  228. package/dist/radio-group/tokens.d.ts.map +1 -0
  229. package/dist/radio-group/tokens.js +19 -0
  230. package/dist/radio-group/tokens.js.map +1 -0
  231. package/dist/root/PanneauRoot.css +243 -20
  232. package/dist/root/PanneauRoot.d.ts +35 -4
  233. package/dist/root/PanneauRoot.d.ts.map +1 -1
  234. package/dist/root/PanneauRoot.js +107 -20
  235. package/dist/root/PanneauRoot.js.map +1 -1
  236. package/dist/root/PanneauRoot.module.js +11 -3
  237. package/dist/root/PanneauRoot.module.js.map +1 -1
  238. package/dist/root/ThemeScope.d.ts +24 -0
  239. package/dist/root/ThemeScope.d.ts.map +1 -0
  240. package/dist/root/ThemeScope.js +49 -0
  241. package/dist/root/ThemeScope.js.map +1 -0
  242. package/dist/select/ListBox.css +23 -22
  243. package/dist/select/ListBox.module.js +12 -12
  244. package/dist/select/ListBox.module.js.map +1 -1
  245. package/dist/select/Select.js +1 -1
  246. package/dist/select/Select.js.map +1 -1
  247. package/dist/select/listBoxTokens.d.ts +3 -0
  248. package/dist/select/listBoxTokens.d.ts.map +1 -0
  249. package/dist/select/listBoxTokens.js +19 -0
  250. package/dist/select/listBoxTokens.js.map +1 -0
  251. package/dist/spinner/Spinner.css +8 -8
  252. package/dist/spinner/Spinner.js +1 -1
  253. package/dist/spinner/Spinner.js.map +1 -1
  254. package/dist/spinner/Spinner.module.js +5 -5
  255. package/dist/spinner/Spinner.module.js.map +1 -1
  256. package/dist/spinner/tokens.d.ts +3 -0
  257. package/dist/spinner/tokens.d.ts.map +1 -0
  258. package/dist/spinner/tokens.js +10 -0
  259. package/dist/spinner/tokens.js.map +1 -0
  260. package/dist/stack/Stack.css +135 -0
  261. package/dist/stack/Stack.d.ts +15 -0
  262. package/dist/stack/Stack.d.ts.map +1 -0
  263. package/dist/stack/Stack.js +21 -0
  264. package/dist/stack/Stack.js.map +1 -0
  265. package/dist/stack/Stack.module.js +8 -0
  266. package/dist/stack/Stack.module.js.map +1 -0
  267. package/dist/stack/tokens.d.ts +3 -0
  268. package/dist/stack/tokens.d.ts.map +1 -0
  269. package/dist/stack/tokens.js +10 -0
  270. package/dist/stack/tokens.js.map +1 -0
  271. package/dist/switch/Switch.css +34 -25
  272. package/dist/switch/Switch.d.ts.map +1 -1
  273. package/dist/switch/Switch.js +2 -1
  274. package/dist/switch/Switch.js.map +1 -1
  275. package/dist/switch/Switch.module.js +6 -5
  276. package/dist/switch/Switch.module.js.map +1 -1
  277. package/dist/switch/tokens.d.ts +3 -0
  278. package/dist/switch/tokens.d.ts.map +1 -0
  279. package/dist/switch/tokens.js +25 -0
  280. package/dist/switch/tokens.js.map +1 -0
  281. package/dist/tabs/Tabs.css +24 -23
  282. package/dist/tabs/Tabs.js +4 -4
  283. package/dist/tabs/Tabs.js.map +1 -1
  284. package/dist/tabs/Tabs.module.js +4 -4
  285. package/dist/tabs/Tabs.module.js.map +1 -1
  286. package/dist/tabs/tokens.d.ts +3 -0
  287. package/dist/tabs/tokens.d.ts.map +1 -0
  288. package/dist/tabs/tokens.js +25 -0
  289. package/dist/tabs/tokens.js.map +1 -0
  290. package/dist/text/Text.css +74 -0
  291. package/dist/text/Text.d.ts +27 -0
  292. package/dist/text/Text.d.ts.map +1 -0
  293. package/dist/text/Text.js +16 -0
  294. package/dist/text/Text.js.map +1 -0
  295. package/dist/text/Text.module.js +30 -0
  296. package/dist/text/Text.module.js.map +1 -0
  297. package/dist/text/tokens.d.ts +3 -0
  298. package/dist/text/tokens.d.ts.map +1 -0
  299. package/dist/text/tokens.js +10 -0
  300. package/dist/text/tokens.js.map +1 -0
  301. package/dist/text-area/TextArea.css +1 -1
  302. package/dist/text-area/TextArea.js +2 -2
  303. package/dist/text-area/TextArea.js.map +1 -1
  304. package/dist/text-area/TextArea.module.js +3 -3
  305. package/dist/text-area/TextArea.module.js.map +1 -1
  306. package/dist/text-input/TextInput.js +1 -1
  307. package/dist/text-input/TextInput.js.map +1 -1
  308. package/dist/theme/Tone.css +70 -0
  309. package/dist/theme/Tone.module.js +20 -0
  310. package/dist/theme/Tone.module.js.map +1 -0
  311. package/dist/theme/bootstrap.d.ts +10 -0
  312. package/dist/theme/bootstrap.d.ts.map +1 -1
  313. package/dist/theme/bootstrap.js +48 -5
  314. package/dist/theme/bootstrap.js.map +1 -1
  315. package/dist/theme/chartColors.d.ts +23 -0
  316. package/dist/theme/chartColors.d.ts.map +1 -0
  317. package/dist/theme/chartColors.js +27 -0
  318. package/dist/theme/chartColors.js.map +1 -0
  319. package/dist/theme/checkTheme.d.ts +39 -0
  320. package/dist/theme/checkTheme.d.ts.map +1 -0
  321. package/dist/theme/checkTheme.js +132 -0
  322. package/dist/theme/checkTheme.js.map +1 -0
  323. package/dist/theme/cli.d.ts +14 -0
  324. package/dist/theme/cli.d.ts.map +1 -0
  325. package/dist/theme/cli.js +61 -0
  326. package/dist/theme/cli.js.map +1 -0
  327. package/dist/theme/color.d.ts +30 -0
  328. package/dist/theme/color.d.ts.map +1 -0
  329. package/dist/theme/color.js +94 -0
  330. package/dist/theme/color.js.map +1 -0
  331. package/dist/theme/colorVision.d.ts +23 -0
  332. package/dist/theme/colorVision.d.ts.map +1 -0
  333. package/dist/theme/colorVision.js +140 -0
  334. package/dist/theme/colorVision.js.map +1 -0
  335. package/dist/theme/componentTokens.d.ts +24 -0
  336. package/dist/theme/componentTokens.d.ts.map +1 -0
  337. package/dist/theme/componentTokens.js +20 -0
  338. package/dist/theme/componentTokens.js.map +1 -0
  339. package/dist/theme/components.d.ts +38 -0
  340. package/dist/theme/components.d.ts.map +1 -0
  341. package/dist/theme/components.js +65 -0
  342. package/dist/theme/components.js.map +1 -0
  343. package/dist/theme/defineTheme.d.ts +85 -0
  344. package/dist/theme/defineTheme.d.ts.map +1 -0
  345. package/dist/theme/defineTheme.js +130 -0
  346. package/dist/theme/defineTheme.js.map +1 -0
  347. package/dist/theme/fonts.d.ts +32 -0
  348. package/dist/theme/fonts.d.ts.map +1 -0
  349. package/dist/theme/fonts.js +36 -0
  350. package/dist/theme/fonts.js.map +1 -0
  351. package/dist/theme/index.d.ts +13 -0
  352. package/dist/theme/index.d.ts.map +1 -0
  353. package/dist/theme/index.js +10 -0
  354. package/dist/theme/semanticTokens.d.ts +9 -0
  355. package/dist/theme/semanticTokens.d.ts.map +1 -0
  356. package/dist/theme/semanticTokens.js +110 -0
  357. package/dist/theme/semanticTokens.js.map +1 -0
  358. package/dist/theme/theme.d.ts +61 -7
  359. package/dist/theme/theme.d.ts.map +1 -1
  360. package/dist/theme/theme.js +100 -10
  361. package/dist/theme/theme.js.map +1 -1
  362. package/dist/theme/toneClass.d.ts +8 -0
  363. package/dist/theme/toneClass.d.ts.map +1 -0
  364. package/dist/theme/toneClass.js +15 -0
  365. package/dist/theme/toneClass.js.map +1 -0
  366. package/dist/theme/tones.d.ts +89 -0
  367. package/dist/theme/tones.d.ts.map +1 -0
  368. package/dist/theme/tones.js +127 -0
  369. package/dist/theme/tones.js.map +1 -0
  370. package/dist/time-input/TimeInput.js +1 -1
  371. package/dist/time-input/TimeInput.js.map +1 -1
  372. package/dist/toast/Toast.css +22 -44
  373. package/dist/toast/Toast.d.ts +5 -3
  374. package/dist/toast/Toast.d.ts.map +1 -1
  375. package/dist/toast/Toast.js +4 -3
  376. package/dist/toast/Toast.js.map +1 -1
  377. package/dist/toast/Toast.module.js +10 -16
  378. package/dist/toast/Toast.module.js.map +1 -1
  379. package/dist/toast/tokens.d.ts +3 -0
  380. package/dist/toast/tokens.d.ts.map +1 -0
  381. package/dist/toast/tokens.js +21 -0
  382. package/dist/toast/tokens.js.map +1 -0
  383. package/dist/tooltip/Tooltip.css +12 -11
  384. package/dist/tooltip/Tooltip.js +1 -1
  385. package/dist/tooltip/Tooltip.js.map +1 -1
  386. package/dist/tooltip/Tooltip.module.js +2 -2
  387. package/dist/tooltip/Tooltip.module.js.map +1 -1
  388. package/dist/tooltip/tokens.d.ts +3 -0
  389. package/dist/tooltip/tokens.d.ts.map +1 -0
  390. package/dist/tooltip/tokens.js +21 -0
  391. package/dist/tooltip/tokens.js.map +1 -0
  392. package/dist/utils/cx.d.ts +1 -1
  393. package/dist/utils/cx.d.ts.map +1 -1
  394. package/dist/utils/cx.js +2 -2
  395. package/dist/utils/cx.js.map +1 -1
  396. package/package.json +20 -3
package/README.md CHANGED
@@ -15,24 +15,282 @@ import { Button, PanneauRoot, TextInput, bootstrapTheme } from '@panneau/ui';
15
15
  </PanneauRoot>;
16
16
  ```
17
17
 
18
- | Export | Content |
19
- | --------------------- | ------------------------------------------------------------------------------------------------- |
20
- | `@panneau/ui` | `PanneauRoot`, themes, the primitives, `Icon`, `getNamedIcon()`, `useToast()`, `usePanneauIntl()` |
21
- | `@panneau/ui/locales` | Deprecated: the UI messages by locale, `en` and `fr`. Use `@panneau/intl` |
18
+ | Export | Content |
19
+ | ------------------------- | ------------------------------------------------------------------------------------------------------- |
20
+ | `@panneau/ui` | `PanneauRoot`, themes, the primitives, `Icon`, `getNamedIcon()`, `useToast()`, `usePanneauIntl()` |
21
+ | `@panneau/ui/named-icons` | `lucideIconLoader`: loads any Lucide icon by name, for `PanneauRoot`'s `iconLoader` |
22
+ | `@panneau/ui/theme` | Themes as data, without components or CSS, for Node: `defineTheme()`, `checkTheme()`, `bootstrapTheme`… |
23
+ | `@panneau/ui/locales` | Deprecated: the UI messages by locale, `en` and `fr`. Use `@panneau/intl` |
22
24
 
23
25
  ## Root, tokens and themes
24
26
 
25
27
  Every Panneau interface renders inside a `PanneauRoot`. It scopes the base stylesheet and the design tokens (`--panneau-*` CSS variables) to its element: Panneau adds no global CSS to the page. Overlays (dialogs, popovers, menus, tooltips) and toasts render inside it too.
26
28
 
27
29
  - `colorScheme`: `light` (default), `dark`, or `auto`, which follows the system.
28
- - `theme`: tokens that override the default theme. `bootstrapTheme` follows a site's Bootstrap 5.3 variables and color mode.
30
+ - `density`: `compact`, `comfortable`, `touch`, or `auto` (default), which is `touch` on touch screens and `comfortable` otherwise. See [Density](#density).
31
+ - `theme`: tokens, tones and variants that override the default theme (see [Defining themes](#defining-themes)). `bootstrapTheme` follows a site's Bootstrap 5.3 variables and color mode.
29
32
  - A project can also override any token with its own class on the root: `.my-panneau { --panneau-color-accent: #0a58ca; }`.
30
33
 
31
34
  The default theme and the icon set are explained in [decision 0020](../../docs/decisions/0020-default-theme-and-icons.md).
32
35
 
36
+ ### Scopes
37
+
38
+ `ThemeScope` applies a theme, a color scheme or a density to part of the page, like `data-bs-theme` on any element, without a new root:
39
+
40
+ ```tsx
41
+ <PanneauRoot theme={brand}>
42
+ <ThemeScope as="aside" colorScheme="dark">
43
+ <Navigation />
44
+ </ThemeScope>
45
+ <ThemeScope density="compact">
46
+ <ListView />
47
+ </ThemeScope>
48
+ </PanneauRoot>
49
+ ```
50
+
51
+ What a scope doesn't set comes from around it: a scope with only a density keeps the colors of the root's theme. Overlays opened inside a scope (dialogs, popovers, menus) render in its own container and keep its tokens. Custom color schemes, beyond light and dark, are themes applied to a scope.
52
+
53
+ ### Component tokens
54
+
55
+ Every component reads its own tokens, `--panneau-<component>-<token>`, which default to semantic tokens. Set one to restyle a single component, in a theme, on the root, or on any element around the components:
56
+
57
+ ```css
58
+ .my-panneau {
59
+ --panneau-badge-radius: var(--panneau-radius-sm); /* square badges, nothing else changes */
60
+ }
61
+
62
+ .my-toolbar {
63
+ --panneau-button-padding-x: var(--panneau-space-2);
64
+ }
65
+ ```
66
+
67
+ `componentTokens` lists every component token and its default, by component, and `ComponentTokenName` is their type. Some tokens style parts that several components share:
68
+
69
+ - `input`: the box of text inputs, selects, combo boxes and pickers;
70
+ - `field`: labels, descriptions and errors;
71
+ - `list-box`: options of selects, combo boxes and menus;
72
+ - `calendar`.
73
+
74
+ ### Tones and appearances
75
+
76
+ Components with a color take a `tone`, like Bootstrap's theme colors: `neutral`, `accent`, `success`, `warning`, `danger` and `info` are built in. `Button`, `Badge` and `Alert` also take an `appearance` (`solid`, `outline`, `subtle`, and `ghost` for buttons):
77
+
78
+ ```tsx
79
+ <Button tone="accent">Save</Button>
80
+ <Button tone="danger" appearance="outline">Remove</Button>
81
+ <Badge tone="success">Published</Badge>
82
+ <Alert tone="warning" appearance="solid" title="Scheduled" />
83
+ ```
84
+
85
+ The `variant` values of `Button` (`primary`, `secondary`, `ghost`, `danger`) are deprecated aliases of a tone and an appearance.
86
+
87
+ A theme adds tones, from one color (Panneau derives a readable text color, the hover, the subtle background and the border) or with every value, and named variants of components:
88
+
89
+ ```tsx
90
+ const theme = defineTheme({
91
+ tones: { signal: '#f25c05' },
92
+ components: {
93
+ badge: { variants: { tag: { 'panneau-badge-radius': 'var(--panneau-radius-sm)' } } },
94
+ },
95
+ });
96
+
97
+ declare module '@panneau/ui' {
98
+ interface PanneauTones {
99
+ signal: true;
100
+ }
101
+ interface BadgeVariants {
102
+ tag: true;
103
+ }
104
+ }
105
+
106
+ <Badge tone="signal" variant="tag">
107
+ Live
108
+ </Badge>;
109
+ ```
110
+
111
+ `checkTheme(theme)` reports the colors of a theme that miss their contrast ratio (4.5:1 for text, 3:1 for control borders), like Bootstrap's `$min-contrast-ratio`. It follows references to the theme's palette and tokens.
112
+
113
+ ### Defining themes
114
+
115
+ `defineTheme()` declares a theme. TypeScript checks the name of every token, semantic or component, and the console reports unknown names in Panneau's namespaces (`panneau-color-txt`), such as typos in a theme loaded from JSON. A theme can name its raw colors once in a `palette`, written as `--panneau-palette-<name>`, and build on other themes with `extends`:
116
+
117
+ ```ts
118
+ import { bootstrapTheme, defineTheme } from '@panneau/ui';
119
+
120
+ const brand = defineTheme({
121
+ label: 'Brand',
122
+ palette: { orange: '#f25c05', ink: '#1c1917' },
123
+ tokens: {
124
+ 'panneau-color-accent': 'var(--panneau-palette-ink)',
125
+ 'panneau-button-radius': '0',
126
+ },
127
+ dark: { 'panneau-color-accent': '#fafaf9' },
128
+ tones: { signal: 'var(--panneau-palette-orange)' },
129
+ });
130
+
131
+ // A variation: the same theme, more compact.
132
+ const compact = defineTheme({ extends: brand, tokens: { 'panneau-control-height': '2rem' } });
133
+
134
+ // The brand theme, on a site that uses Bootstrap.
135
+ const onBootstrap = defineTheme({ extends: [bootstrapTheme, brand] });
136
+ ```
137
+
138
+ Values merge in this order, each overriding the ones before: the default theme, the themes a theme `extends` (in order), the theme itself, then a project's own class on the root. A token set in `tokens` but not in `dark` applies to both schemes, so it also replaces the dark value of the themes it extends. `mergeThemes()` merges themes the same way.
139
+
140
+ `defineTheme()` returns a plain `Theme`: themes are data. They can be written as JSON files, with the [`theme.schema.json`](../protocol/schema/theme.schema.json) of `@panneau/protocol`, registered by plugins of `@panneau/core`, and carried by the definition, whose `theme` extends themes of plugins by id. Tokens of a project's own components are declared in `PanneauTokens`:
141
+
142
+ ```ts
143
+ declare module '@panneau/ui' {
144
+ interface PanneauTokens {
145
+ 'panneau-map-marker-color': true;
146
+ }
147
+ }
148
+ ```
149
+
150
+ `SEMANTIC_TOKENS` lists the semantic tokens, `componentTokens` the component tokens.
151
+
152
+ ### Typography and fonts
153
+
154
+ The theme has four font roles: `--panneau-font-family-body`, `-heading` (the body's by default), `-display` (the heading's by default) and `-mono`. `--panneau-font-family` is a deprecated alias of the body family: set `-body` instead, so that headings follow it. `--panneau-font-numeric` (`tabular-nums`) lines up digits in stats, dates and tables.
155
+
156
+ Panneau styles no element beyond its reset, since it is often embedded in someone else's page. Three components apply the typography of the theme:
157
+
158
+ - `Heading`: a `level` (`h1`–`h6`, 2 by default) and a visual `size`, independent of it: `1` to `4`, `display-1` and `display-2`, like Bootstrap's `.h1` and `.display-1`. Its tokens (`--panneau-heading-1-font-size`, `--panneau-heading-display-1-font-weight`…) set the size, weight, line height and letter spacing of each size.
159
+ - `Text`: `size` (`xs` to `xl`), `weight`, `family` (a font role), `tone`, `muted`, `numeric` and `truncate`, as a `p` by default (`as="span"`).
160
+ - `Prose`: styles the elements of rich content inside it (headings, lists, links, quotes, code, tables), such as the output of an editor or Markdown.
161
+
162
+ ```tsx
163
+ <Heading level={1} size="display-2">
164
+ 1,204 pages
165
+ </Heading>
166
+ <Text muted size="sm">
167
+ Updated today
168
+ </Text>
169
+ <Prose dangerouslySetInnerHTML={{ __html: page.body }} />
170
+ ```
171
+
172
+ A theme declares its fonts: font faces, written as `@font-face` rules, or a hosted stylesheet. `PanneauRoot` adds them to the page once, however many roots use the theme.
173
+
174
+ ```ts
175
+ const editorial = defineTheme({
176
+ fonts: [
177
+ { family: 'Geist', src: "url(/fonts/geist.woff2) format('woff2')", weight: '100 900' },
178
+ { stylesheet: 'https://fonts.googleapis.com/css2?family=Fraunces:wght@600&display=swap' },
179
+ ],
180
+ tokens: {
181
+ 'panneau-font-family-body': 'Geist, system-ui, sans-serif',
182
+ 'panneau-font-family-heading': 'Fraunces, Georgia, serif',
183
+ },
184
+ });
185
+ ```
186
+
187
+ ### Layout
188
+
189
+ Five primitives lay out content with the space scale of the theme, without utility classes:
190
+
191
+ - `Stack`: items one under the other, like Bootstrap's `.vstack`;
192
+ - `Inline`: items side by side, wrapping when they don't fit, like `.hstack`;
193
+ - `Grid` and `GridItem`: equal columns (`columns`), or as many as fit (`minItemWidth="16rem"`), and cells that span several columns (`span`, or `span="full"`);
194
+ - `Container`: a centered column with a maximum width (`size`: `sm`, `md`, `lg` by default, `xl` or `full`);
195
+ - `Divider`: a line between groups, horizontal or vertical.
196
+
197
+ `gap` takes a step of the space scale (`gap={2}` is `--panneau-space-2`), and `align` and `justify` the alignment of the items. These props, `columns` and `span` are **responsive**: a value, or values by breakpoint, each applying from its breakpoint up.
198
+
199
+ ```tsx
200
+ <Container>
201
+ <Grid columns={{ base: 1, md: 2, lg: 3 }} gap={{ base: 3, lg: 4 }}>
202
+ <GridItem span={{ base: 1, lg: 'full' }}>
203
+ <Card title="Summary" />
204
+ </GridItem>
205
+ <Card title="Pages" />
206
+ <Card title="Articles" />
207
+ </Grid>
208
+ </Container>
209
+ ```
210
+
211
+ Breakpoints (`BREAKPOINTS`) are `sm` 40rem, `md` 48rem, `lg` 64rem and `xl` 80rem, like `$grid-breakpoints`. They are widths of the nearest **size container**, not of the viewport, so that a grid in a narrow sidebar behaves as on a phone. `PanneauRoot` and `Container` are size containers, as are forms and lists. A size container takes its width from its parent, never from its content: in a flex row or a float, give the root a width, or it collapses.
212
+
213
+ Responsive values are inline CSS variables, read by static rules in each container query: no styles are generated per instance.
214
+
215
+ ### Density
216
+
217
+ A density is a set of tokens: `--panneau-control-height` and `-sm`, `--panneau-font-size-control`, `--panneau-control-padding-x` (inputs and buttons) and `--panneau-row-padding-y` (rows of tables, options of lists). The `density` of the root picks one, and the `size` props of components (`size="sm"`) stay relative to it.
218
+
219
+ A theme redefines a density in `densities`. Density tokens set in `tokens` instead apply to every density, which then no longer changes them.
220
+
221
+ ```ts
222
+ const roomy = defineTheme({
223
+ densities: {
224
+ comfortable: { 'panneau-control-height': '2.5rem' },
225
+ compact: { 'panneau-row-padding-y': '0.125rem' },
226
+ },
227
+ });
228
+ ```
229
+
230
+ ### Chart colors
231
+
232
+ Charts (dashboard widgets, reports) use only the chart tokens of the theme, in both schemes:
233
+
234
+ - `--panneau-chart-categorical-1` to `-8`: series, in a fixed order;
235
+ - `--panneau-chart-sequential-1` to `-5`: a ramp from low to high, for quantities;
236
+ - `--panneau-chart-diverging-negative`, `-neutral` and `-positive`: values below and above a reference.
237
+
238
+ `chartColors` gives them as CSS variables for `fill` and `stroke`, so that charts follow the theme, the color scheme and the scope:
239
+
240
+ ```tsx
241
+ <rect fill={chartColors.categorical(index)} />
242
+ <rect fill={chartColors.sequential(5)} />
243
+ <rect fill={chartColors.diverging.negative} />
244
+ ```
245
+
246
+ Each default categorical color reaches 3:1 against the surface (WCAG non-text contrast), and the eight stay distinct for people with protanopia, deuteranopia or tritanopia: a test checks it. `checkTheme()` runs the same checks on the chart colors a theme sets, and `checkColorDifferences(colors)` on any palette.
247
+
248
+ ### Checking a theme
249
+
250
+ `checkTheme(theme)` reports what a theme makes hard to read: text tokens against backgrounds (4.5:1), control borders and chart colors (3:1), the text of each tone on the surface and on its subtle background, and categorical chart colors that look alike with a color vision deficiency. The `panneau-check-theme` command runs it on a JSON theme or on an export of a module, and exits with 1 when a check fails, for CI:
251
+
252
+ ```sh
253
+ npx panneau-check-theme themes/brand.json
254
+ npx panneau-check-theme src/theme.mjs --export brand --json
255
+ ```
256
+
257
+ `@panneau/ui/theme` exports the theme functions without components or CSS, so that Node scripts (a build step, a backend that stores themes) can import them.
258
+
259
+ ### Bootstrap
260
+
261
+ `bootstrapTheme` maps Panneau's tokens to the CSS variables of Bootstrap 5.3: colors, fonts, radii, shadows, the color mode (`data-bs-theme`), and the size of controls in the comfortable density. Bootstrap's theme colors become tones: `accent` is `primary`, and `primary` and `secondary` keep their names. `bootstrapTone(color)` turns any theme color of a site, custom ones included, into a tone:
262
+
263
+ ```ts
264
+ const site = defineTheme({ extends: bootstrapTheme, tones: { brand: bootstrapTone('brand') } });
265
+ ```
266
+
267
+ Bootstrap 5.3 declares the variables of its components (`--bs-btn-*`, `--bs-card-*`) on their classes, where Panneau's components can't read them: `bootstrapTheme` maps component tokens to the root variables those default to (`--bs-border-radius`, `--bs-border-color-translucent`, `--bs-heading-color`).
268
+
269
+ ### Classes
270
+
271
+ Class names are stable and readable, without a hash, like Bootstrap's: target them in a project's CSS.
272
+
273
+ - The root of every component has `panneau-<component>`: `.panneau-button`, `.panneau-badge`, `.panneau-text-input`, `.panneau-card`.
274
+ - Its parts and modifiers are `panneau-<component>-<name>`: `.panneau-card-header`, `.panneau-button-sm`.
275
+ - States use standard attributes: ARIA (`[aria-invalid]`, `[aria-expanded]`, `[aria-selected]`…) and the state attributes of React Aria Components (`[data-hovered]`, `[data-focus-visible]`…).
276
+
277
+ ```css
278
+ .my-panneau .panneau-badge {
279
+ letter-spacing: 0.02em;
280
+ }
281
+
282
+ .my-panneau .panneau-text-input [aria-invalid='true'] {
283
+ background-color: #fff5f5;
284
+ }
285
+ ```
286
+
287
+ [`api/ui.classes.md`](api/ui.classes.md) lists every class. They are public API: a rename is a breaking change.
288
+
289
+ The theme model is described in [decision 0024](../../docs/decisions/0024-theme-model.md).
290
+
33
291
  ## Primitives
34
292
 
35
- `Button`, `IconButton`, `TextInput`, `TextArea`, `NumberInput`, `Select` (single or multiple), `ComboBox`, `Checkbox`, `Switch`, `RadioGroup`, `DatePicker`, `TimeInput`, `Fieldset`, `Dialog`, `Popover`, `Menu`, `Tabs`, `Tooltip`, toasts (`useToast()`), `Alert`, `Badge`, `Spinner`, `Card`, `Disclosure` and `Icon`.
293
+ `Heading`, `Text`, `Prose`, `Stack`, `Inline`, `Grid`, `Container`, `Divider`, `Button`, `IconButton`, `TextInput`, `TextArea`, `NumberInput`, `Select` (single or multiple), `ComboBox`, `Checkbox`, `Switch`, `RadioGroup`, `DatePicker`, `TimeInput`, `Fieldset`, `Dialog`, `Popover`, `Menu`, `Tabs`, `Tooltip`, toasts (`useToast()`), `Alert`, `Badge`, `Spinner`, `Card`, `Disclosure` and `Icon`.
36
294
 
37
295
  - Every component accepts `className`, and `xxxClassName` props for its inner elements (`labelClassName`, `inputClassName`…).
38
296
  - Labelled controls take `label`, `description` and `errors` (a list of messages: any message makes the control invalid and describes it).
@@ -42,18 +300,23 @@ The default theme and the icon set are explained in [decision 0020](../../docs/d
42
300
 
43
301
  Components take icons as components: any Lucide icon (`icon={Pencil}`), or a component with the same props.
44
302
 
45
- Definitions name their icons (`"icon": "send"`, a name of [lucide.dev/icons](https://lucide.dev/icons)). `getNamedIcon(name)` turns a name into an icon component that goes wherever an icon component goes:
303
+ Definitions name their icons (`"icon": "send"`, a name of [lucide.dev/icons](https://lucide.dev/icons)). `getNamedIcon(name)` turns a name into an icon component that goes wherever an icon component goes, and loads it with the `iconLoader` of `PanneauRoot`:
46
304
 
47
305
  ```tsx
48
- import { Button, getNamedIcon } from '@panneau/ui';
306
+ import { Button, PanneauRoot, getNamedIcon } from '@panneau/ui';
307
+ import { lucideIconLoader } from '@panneau/ui/named-icons';
49
308
 
50
- <Button icon={getNamedIcon('send')}>Send</Button>;
309
+ <PanneauRoot iconLoader={lucideIconLoader}>
310
+ <Button icon={getNamedIcon('send')}>Send</Button>
311
+ </PanneauRoot>;
51
312
  ```
52
313
 
53
- - It loads that one icon the first time it renders, through Lucide's dynamic imports, and renders an empty space of the same size until then. The list of names is loaded on demand too: the whole set is never in the bundle, but bundlers emit one small chunk per icon.
54
- - It returns the same component for the same name. A name Lucide doesn't have renders nothing, with a warning in the console.
55
- - `loadNamedIcon(name)` loads an icon ahead of time, and resolves with its component (or `null`).
56
- - **Vite apps, in development:** add `optimizeDeps: { exclude: ['lucide-react/dynamicIconImports.mjs'] }` to the Vite config. When Vite optimizes it together with `lucide-react`, it splits `lucide-react` into one chunk per icon (about 1,900 requests on every page load). Production builds are not affected.
314
+ - **Loading icons by name is opt-in.** `lucideIconLoader` loads any Lucide icon, one chunk per icon the first time it renders, but bundlers emit a chunk for every Lucide icon (about 1,900) and the map of them in the runtime of every page. So it lives in its own entry point, `@panneau/ui/named-icons`: apps that only pass icon components (`icon={Send}`, `actionIcons`) don't pay for it.
315
+ - An app can instead load only the icons its definitions use: `iconLoader={(name) => Promise.resolve(({ send: Send, archive: Archive })[name] ?? null)}`.
316
+ - Without a loader, a named icon renders an empty space of the same size, with one warning in the console.
317
+ - `getNamedIcon()` returns the same component for the same name, renders an empty space while the icon loads, and nothing for a name the loader doesn't know (with a warning).
318
+ - `loadNamedIcon(name, loader)` loads an icon ahead of time, and resolves with its component (or `null`).
319
+ - **Vite apps, in development:** with `lucideIconLoader`, add `optimizeDeps: { exclude: ['lucide-react/dynamicIconImports.mjs'] }` to the Vite config. When Vite optimizes it together with `lucide-react`, it splits `lucide-react` into one chunk per icon (about 1,900 requests on every page load). Production builds are not affected.
57
320
 
58
321
  ## Messages
59
322
 
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ // Checks the contrast of a theme: `panneau-check-theme theme.json`. See `--help`.
3
+ import { runCheckTheme } from '../dist/theme/cli.js';
4
+
5
+ process.exitCode = await runCheckTheme(process.argv.slice(2));
@@ -1,56 +1,42 @@
1
- .panneau-alert-YltdMY {
1
+ .panneau-alert {
2
2
  display: flex;
3
3
  align-items: flex-start;
4
- gap: var(--panneau-space-3);
5
- padding: var(--panneau-space-3) var(--panneau-space-4);
4
+ gap: var(--panneau-alert-gap, var(--panneau-space-3));
5
+ padding: var(--panneau-alert-padding-y, var(--panneau-space-3))
6
+ var(--panneau-alert-padding-x, var(--panneau-space-4));
6
7
  color: var(--panneau-color-text);
7
- background-color: var(--panneau-color-surface-sunken);
8
- border: var(--panneau-border-width) solid var(--panneau-color-border);
9
- border-radius: var(--panneau-radius-md);
8
+ border: var(--panneau-alert-border-width, var(--panneau-border-width)) solid transparent;
9
+ border-radius: var(--panneau-alert-radius, var(--panneau-radius-md));
10
10
  }
11
11
 
12
- .panneau-success-Z7VQdb {
13
- background-color: var(--panneau-color-success-subtle);
14
- border-color: var(--panneau-color-success-border);
15
- }
16
-
17
- .panneau-danger-7fFkRR {
18
- background-color: var(--panneau-color-danger-subtle);
19
- border-color: var(--panneau-color-danger-border);
20
- }
21
-
22
- .panneau-warning-xvkEcQ {
23
- background-color: var(--panneau-color-warning-subtle);
24
- border-color: var(--panneau-color-warning-border);
25
- }
26
-
27
- .panneau-info-beWi9v {
28
- background-color: var(--panneau-color-info-subtle);
29
- border-color: var(--panneau-color-info-border);
30
- }
31
-
32
- .panneau-icon-blRAxm {
12
+ .panneau-alert-icon {
33
13
  margin-top: 0.125rem;
34
- color: var(--panneau-color-text-muted);
14
+ color: var(--panneau-tone-text);
35
15
  }
36
16
 
37
- .panneau-success-Z7VQdb .panneau-icon-blRAxm {
38
- color: var(--panneau-color-success);
17
+ /* Appearances: they read the --panneau-tone-* variables of the tone class (decision 0024). */
18
+
19
+ .panneau-alert-subtle {
20
+ background-color: var(--panneau-tone-subtle);
21
+ border-color: var(--panneau-tone-border);
39
22
  }
40
23
 
41
- .panneau-danger-7fFkRR .panneau-icon-blRAxm {
42
- color: var(--panneau-color-danger);
24
+ .panneau-alert-outline {
25
+ background-color: var(--panneau-color-surface);
26
+ border-color: var(--panneau-tone-outline);
43
27
  }
44
28
 
45
- .panneau-warning-xvkEcQ .panneau-icon-blRAxm {
46
- color: var(--panneau-color-warning);
29
+ .panneau-alert-solid {
30
+ color: var(--panneau-tone-solid-text);
31
+ background-color: var(--panneau-tone-solid);
32
+ border-color: var(--panneau-tone-solid);
47
33
  }
48
34
 
49
- .panneau-info-beWi9v .panneau-icon-blRAxm {
50
- color: var(--panneau-color-info);
35
+ .panneau-alert-solid .panneau-alert-icon {
36
+ color: inherit;
51
37
  }
52
38
 
53
- .panneau-content-dNGM-n {
39
+ .panneau-alert-content {
54
40
  display: flex;
55
41
  flex: 1 1 auto;
56
42
  flex-direction: column;
@@ -58,21 +44,21 @@
58
44
  min-width: 0;
59
45
  }
60
46
 
61
- .panneau-title-uRgCXb {
62
- font-weight: var(--panneau-font-weight-bold);
47
+ .panneau-alert-title {
48
+ font-weight: var(--panneau-alert-title-font-weight, var(--panneau-font-weight-bold));
63
49
  }
64
50
 
65
- .panneau-body-2meig0 {
51
+ .panneau-alert-body {
66
52
  overflow-wrap: anywhere;
67
53
  }
68
54
 
69
- .panneau-actions-MXSoKc {
55
+ .panneau-alert-actions {
70
56
  display: flex;
71
57
  flex-wrap: wrap;
72
58
  gap: var(--panneau-space-2);
73
59
  margin-top: var(--panneau-space-2);
74
60
  }
75
61
 
76
- .panneau-dismiss-LWaGfl {
62
+ .panneau-alert-dismiss {
77
63
  margin: calc(-1 * var(--panneau-space-1)) calc(-1 * var(--panneau-space-2)) 0 0;
78
64
  }
@@ -1,12 +1,26 @@
1
1
  import type { ReactNode, Ref } from 'react';
2
2
  import { type IconComponent } from '../icon/Icon';
3
- export type AlertTone = 'neutral' | 'success' | 'danger' | 'warning' | 'info';
3
+ import type { Tone } from '../theme/tones';
4
+ /** @deprecated Use `Tone`. */
5
+ export type AlertTone = Tone;
6
+ /** How an alert uses its tone. */
7
+ export type AlertAppearance = 'subtle' | 'outline' | 'solid';
8
+ /**
9
+ * Named variants of `Alert`, registered by a theme (`components.alert.variants`). Declare them
10
+ * here so that `variant="banner"` type-checks.
11
+ */
12
+ export interface AlertVariants {
13
+ }
4
14
  export interface AlertProps {
5
15
  /** Defaults to `neutral`. */
6
- tone?: AlertTone;
16
+ tone?: Tone;
17
+ /** Defaults to `subtle`. */
18
+ appearance?: AlertAppearance;
19
+ /** A named variant of the theme. */
20
+ variant?: keyof AlertVariants & string;
7
21
  title?: ReactNode;
8
22
  children?: ReactNode;
9
- /** Replaces the icon of the tone. `null` hides it. */
23
+ /** Replaces the icon of the tone (an info icon for tones added by a theme). `null` hides it. */
10
24
  icon?: IconComponent | null;
11
25
  /** Buttons under the message. */
12
26
  actions?: ReactNode;
@@ -26,5 +40,5 @@ export interface AlertProps {
26
40
  bodyClassName?: string;
27
41
  }
28
42
  /** A message inside the page: an error summary, a warning, a confirmation. */
29
- export declare function Alert({ tone, title, children, icon, actions, onDismiss, role, id, tabIndex, ref, className, titleClassName, bodyClassName, }: AlertProps): import("react").JSX.Element;
43
+ export declare function Alert({ tone, appearance, variant, title, children, icon, actions, onDismiss, role, id, tabIndex, ref, className, titleClassName, bodyClassName, }: AlertProps): import("react").JSX.Element;
30
44
  //# sourceMappingURL=Alert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../src/alert/Alert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAMxD,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAU9E,MAAM,WAAW,UAAU;IACvB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,sDAAsD;IACtD,IAAI,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5B,iCAAiC;IACjC,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,8EAA8E;AAC9E,wBAAgB,KAAK,CAAC,EAClB,IAAgB,EAChB,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,SAAS,EACT,IAAI,EACJ,EAAE,EACF,QAAQ,EACR,GAAG,EACH,SAAS,EACT,cAAc,EACd,aAAa,GAChB,EAAE,UAAU,+BAmCZ"}
1
+ {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../src/alert/Alert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAIxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAI3C,8BAA8B;AAC9B,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC;AAE7B,kCAAkC;AAClC,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAE7D;;;GAGG;AAEH,MAAM,WAAW,aAAa;CAAG;AAUjC,MAAM,WAAW,UAAU;IACvB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,4BAA4B;IAC5B,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,aAAa,GAAG,MAAM,CAAC;IACvC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gGAAgG;IAChG,IAAI,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5B,iCAAiC;IACjC,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,8EAA8E;AAC9E,wBAAgB,KAAK,CAAC,EAClB,IAAgB,EAChB,UAAqB,EACrB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,SAAS,EACT,IAAI,EACJ,EAAE,EACF,QAAQ,EACR,GAAG,EACH,SAAS,EACT,cAAc,EACd,aAAa,GAChB,EAAE,UAAU,+BA0CZ"}
@@ -2,6 +2,7 @@ import { cx } from "../utils/cx.js";
2
2
  import { Icon } from "../icon/Icon.js";
3
3
  import { messages } from "../intl/messages.js";
4
4
  import { usePanneauIntl } from "../intl/usePanneauIntl.js";
5
+ import { toneClass } from "../theme/toneClass.js";
5
6
  import { IconButton } from "../icon-button/IconButton.js";
6
7
  import Alert_module_default from "./Alert.module.js";
7
8
  import { CircleAlert, CircleCheck, Info, TriangleAlert, X } from "lucide-react";
@@ -15,15 +16,15 @@ var TONE_ICONS = {
15
16
  info: Info
16
17
  };
17
18
  /** A message inside the page: an error summary, a warning, a confirmation. */
18
- function Alert({ tone = "neutral", title, children, icon, actions, onDismiss, role, id, tabIndex, ref, className, titleClassName, bodyClassName }) {
19
+ function Alert({ tone = "neutral", appearance = "subtle", variant, title, children, icon, actions, onDismiss, role, id, tabIndex, ref, className, titleClassName, bodyClassName }) {
19
20
  const intl = usePanneauIntl();
20
- const shown = icon === void 0 ? TONE_ICONS[tone] : icon;
21
+ const shown = icon === void 0 ? TONE_ICONS[tone] ?? Info : icon;
21
22
  return /* @__PURE__ */ jsxs("div", {
22
23
  ref,
23
24
  id,
24
25
  role,
25
26
  tabIndex,
26
- className: cx(Alert_module_default.alert, Alert_module_default[tone], className),
27
+ className: cx("panneau-alert", Alert_module_default.alert, toneClass(tone), Alert_module_default[appearance], variant !== void 0 && `panneau-alert-variant-${variant}`, className),
27
28
  children: [
28
29
  shown !== null ? /* @__PURE__ */ jsx(Icon, {
29
30
  icon: shown,
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.js","names":["styles"],"sources":["../../src/alert/Alert.tsx"],"sourcesContent":["import { CircleAlert, CircleCheck, Info, TriangleAlert, X } from 'lucide-react';\nimport type { ReactNode, Ref } from 'react';\n\nimport { IconButton } from '../icon-button/IconButton';\nimport { Icon, type IconComponent } from '../icon/Icon';\nimport { messages } from '../intl/messages';\nimport { usePanneauIntl } from '../intl/usePanneauIntl';\nimport { cx } from '../utils/cx';\nimport styles from './Alert.module.css';\n\nexport type AlertTone = 'neutral' | 'success' | 'danger' | 'warning' | 'info';\n\nconst TONE_ICONS: Record<AlertTone, IconComponent> = {\n neutral: Info,\n success: CircleCheck,\n danger: CircleAlert,\n warning: TriangleAlert,\n info: Info,\n};\n\nexport interface AlertProps {\n /** Defaults to `neutral`. */\n tone?: AlertTone;\n title?: ReactNode;\n children?: ReactNode;\n /** Replaces the icon of the tone. `null` hides it. */\n icon?: IconComponent | null;\n /** Buttons under the message. */\n actions?: ReactNode;\n /** Shows a close button. */\n onDismiss?: () => void;\n /**\n * `alert` announces the message as soon as it appears, for errors that need attention.\n * `status` announces it politely. Without a role, it is only read in place.\n */\n role?: 'alert' | 'status';\n id?: string;\n /** Makes the alert focusable, to move focus to it (an error summary). */\n tabIndex?: number;\n ref?: Ref<HTMLDivElement>;\n className?: string;\n titleClassName?: string;\n bodyClassName?: string;\n}\n\n/** A message inside the page: an error summary, a warning, a confirmation. */\nexport function Alert({\n tone = 'neutral',\n title,\n children,\n icon,\n actions,\n onDismiss,\n role,\n id,\n tabIndex,\n ref,\n className,\n titleClassName,\n bodyClassName,\n}: AlertProps) {\n const intl = usePanneauIntl();\n const shown = icon === undefined ? TONE_ICONS[tone] : icon;\n return (\n <div\n ref={ref}\n id={id}\n role={role}\n tabIndex={tabIndex}\n className={cx(styles.alert, styles[tone], className)}\n >\n {shown !== null ? <Icon icon={shown} size=\"lg\" className={styles.icon} /> : null}\n <div className={styles.content}>\n {title !== undefined && title !== null ? (\n <div className={cx(styles.title, titleClassName)}>{title}</div>\n ) : null}\n {children !== undefined && children !== null ? (\n <div className={cx(styles.body, bodyClassName)}>{children}</div>\n ) : null}\n {actions !== undefined && actions !== null ? (\n <div className={styles.actions}>{actions}</div>\n ) : null}\n </div>\n {onDismiss !== undefined ? (\n <IconButton\n icon={X}\n size=\"sm\"\n label={intl.formatMessage(messages.close)}\n showTooltip={false}\n onPress={onDismiss}\n className={styles.dismiss}\n />\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAYA,IAAM,aAA+C;CACjD,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,MAAM;AACV;;AA4BA,SAAgB,MAAM,EAClB,OAAO,WACP,OACA,UACA,MACA,SACA,WACA,MACA,IACA,UACA,KACA,WACA,gBACA,iBACW;CACX,MAAM,OAAO,eAAe;CAC5B,MAAM,QAAQ,SAAS,KAAA,IAAY,WAAW,QAAQ;CACtD,OACI,qBAAC,OAAD;EACS;EACD;EACE;EACI;EACV,WAAW,GAAGA,qBAAO,OAAOA,qBAAO,OAAO,SAAS;EALvD,UAAA;GAOK,UAAU,OAAO,oBAAC,MAAD;IAAM,MAAM;IAAO,MAAK;IAAK,WAAWA,qBAAO;GAAK,CAAA,IAAM;GAC5E,qBAAC,OAAD;IAAK,WAAWA,qBAAO;IAAvB,UAAA;KACK,UAAU,KAAA,KAAa,UAAU,OAC9B,oBAAC,OAAD;MAAK,WAAW,GAAGA,qBAAO,OAAO,cAAc;MAAI,UAAA;KAAW,CAAA,IAC9D;KACH,aAAa,KAAA,KAAa,aAAa,OACpC,oBAAC,OAAD;MAAK,WAAW,GAAGA,qBAAO,MAAM,aAAa;MAAI;KAAc,CAAA,IAC/D;KACH,YAAY,KAAA,KAAa,YAAY,OAClC,oBAAC,OAAD;MAAK,WAAWA,qBAAO;MAAU,UAAA;KAAa,CAAA,IAC9C;IACH;;GACJ,cAAc,KAAA,IACX,oBAAC,YAAD;IACI,MAAM;IACN,MAAK;IACL,OAAO,KAAK,cAAc,SAAS,KAAK;IACxC,aAAa;IACb,SAAS;IACT,WAAWA,qBAAO;GAAQ,CAAA,IAE9B;EACH;;AAEb"}
1
+ {"version":3,"file":"Alert.js","names":["styles"],"sources":["../../src/alert/Alert.tsx"],"sourcesContent":["import { CircleAlert, CircleCheck, Info, TriangleAlert, X } from 'lucide-react';\nimport type { ReactNode, Ref } from 'react';\n\nimport { IconButton } from '../icon-button/IconButton';\nimport { Icon, type IconComponent } from '../icon/Icon';\nimport { messages } from '../intl/messages';\nimport { usePanneauIntl } from '../intl/usePanneauIntl';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './Alert.module.css';\n\n/** @deprecated Use `Tone`. */\nexport type AlertTone = Tone;\n\n/** How an alert uses its tone. */\nexport type AlertAppearance = 'subtle' | 'outline' | 'solid';\n\n/**\n * Named variants of `Alert`, registered by a theme (`components.alert.variants`). Declare them\n * here so that `variant=\"banner\"` type-checks.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type -- extended by projects\nexport interface AlertVariants {}\n\nconst TONE_ICONS: Partial<Record<Tone, IconComponent>> = {\n neutral: Info,\n success: CircleCheck,\n danger: CircleAlert,\n warning: TriangleAlert,\n info: Info,\n};\n\nexport interface AlertProps {\n /** Defaults to `neutral`. */\n tone?: Tone;\n /** Defaults to `subtle`. */\n appearance?: AlertAppearance;\n /** A named variant of the theme. */\n variant?: keyof AlertVariants & string;\n title?: ReactNode;\n children?: ReactNode;\n /** Replaces the icon of the tone (an info icon for tones added by a theme). `null` hides it. */\n icon?: IconComponent | null;\n /** Buttons under the message. */\n actions?: ReactNode;\n /** Shows a close button. */\n onDismiss?: () => void;\n /**\n * `alert` announces the message as soon as it appears, for errors that need attention.\n * `status` announces it politely. Without a role, it is only read in place.\n */\n role?: 'alert' | 'status';\n id?: string;\n /** Makes the alert focusable, to move focus to it (an error summary). */\n tabIndex?: number;\n ref?: Ref<HTMLDivElement>;\n className?: string;\n titleClassName?: string;\n bodyClassName?: string;\n}\n\n/** A message inside the page: an error summary, a warning, a confirmation. */\nexport function Alert({\n tone = 'neutral',\n appearance = 'subtle',\n variant,\n title,\n children,\n icon,\n actions,\n onDismiss,\n role,\n id,\n tabIndex,\n ref,\n className,\n titleClassName,\n bodyClassName,\n}: AlertProps) {\n const intl = usePanneauIntl();\n const shown = icon === undefined ? (TONE_ICONS[tone] ?? Info) : icon;\n return (\n <div\n ref={ref}\n id={id}\n role={role}\n tabIndex={tabIndex}\n className={cx(\n 'panneau-alert',\n styles.alert,\n toneClass(tone),\n styles[appearance],\n variant !== undefined && `panneau-alert-variant-${variant}`,\n className,\n )}\n >\n {shown !== null ? <Icon icon={shown} size=\"lg\" className={styles.icon} /> : null}\n <div className={styles.content}>\n {title !== undefined && title !== null ? (\n <div className={cx(styles.title, titleClassName)}>{title}</div>\n ) : null}\n {children !== undefined && children !== null ? (\n <div className={cx(styles.body, bodyClassName)}>{children}</div>\n ) : null}\n {actions !== undefined && actions !== null ? (\n <div className={styles.actions}>{actions}</div>\n ) : null}\n </div>\n {onDismiss !== undefined ? (\n <IconButton\n icon={X}\n size=\"sm\"\n label={intl.formatMessage(messages.close)}\n showTooltip={false}\n onPress={onDismiss}\n className={styles.dismiss}\n />\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAyBA,IAAM,aAAmD;CACrD,SAAS;CACT,SAAS;CACT,QAAQ;CACR,SAAS;CACT,MAAM;AACV;;AAgCA,SAAgB,MAAM,EAClB,OAAO,WACP,aAAa,UACb,SACA,OACA,UACA,MACA,SACA,WACA,MACA,IACA,UACA,KACA,WACA,gBACA,iBACW;CACX,MAAM,OAAO,eAAe;CAC5B,MAAM,QAAQ,SAAS,KAAA,IAAa,WAAW,SAAS,OAAQ;CAChE,OACI,qBAAC,OAAD;EACS;EACD;EACE;EACI;EACV,WAAW,GACP,iBACAA,qBAAO,OACP,UAAU,IAAI,GACdA,qBAAO,aACP,YAAY,KAAA,KAAa,yBAAyB,WAClD,SACJ;EAZJ,UAAA;GAcK,UAAU,OAAO,oBAAC,MAAD;IAAM,MAAM;IAAO,MAAK;IAAK,WAAWA,qBAAO;GAAK,CAAA,IAAM;GAC5E,qBAAC,OAAD;IAAK,WAAWA,qBAAO;IAAvB,UAAA;KACK,UAAU,KAAA,KAAa,UAAU,OAC9B,oBAAC,OAAD;MAAK,WAAW,GAAGA,qBAAO,OAAO,cAAc;MAAI,UAAA;KAAW,CAAA,IAC9D;KACH,aAAa,KAAA,KAAa,aAAa,OACpC,oBAAC,OAAD;MAAK,WAAW,GAAGA,qBAAO,MAAM,aAAa;MAAI;KAAc,CAAA,IAC/D;KACH,YAAY,KAAA,KAAa,YAAY,OAClC,oBAAC,OAAD;MAAK,WAAWA,qBAAO;MAAU,UAAA;KAAa,CAAA,IAC9C;IACH;;GACJ,cAAc,KAAA,IACX,oBAAC,YAAD;IACI,MAAM;IACN,MAAK;IACL,OAAO,KAAK,cAAc,SAAS,KAAK;IACxC,aAAa;IACb,SAAS;IACT,WAAWA,qBAAO;GAAQ,CAAA,IAE9B;EACH;;AAEb"}
@@ -1,23 +1,21 @@
1
1
  import "./Alert.css";
2
2
  //#region src/alert/Alert.module.css
3
- var alert = "panneau-alert-YltdMY";
4
- var success = "panneau-success-Z7VQdb";
5
- var danger = "panneau-danger-7fFkRR";
6
- var warning = "panneau-warning-xvkEcQ";
7
- var info = "panneau-info-beWi9v";
8
- var icon = "panneau-icon-blRAxm";
9
- var content = "panneau-content-dNGM-n";
10
- var title = "panneau-title-uRgCXb";
11
- var body = "panneau-body-2meig0";
12
- var actions = "panneau-actions-MXSoKc";
13
- var dismiss = "panneau-dismiss-LWaGfl";
3
+ var alert = "panneau-alert";
4
+ var icon = "panneau-alert-icon";
5
+ var subtle = "panneau-alert-subtle";
6
+ var outline = "panneau-alert-outline";
7
+ var solid = "panneau-alert-solid";
8
+ var content = "panneau-alert-content";
9
+ var title = "panneau-alert-title";
10
+ var body = "panneau-alert-body";
11
+ var actions = "panneau-alert-actions";
12
+ var dismiss = "panneau-alert-dismiss";
14
13
  var Alert_module_default = {
15
14
  alert,
16
- success,
17
- danger,
18
- warning,
19
- info,
20
15
  icon,
16
+ subtle,
17
+ outline,
18
+ solid,
21
19
  content,
22
20
  title,
23
21
  body,
@@ -25,6 +23,6 @@ var Alert_module_default = {
25
23
  dismiss
26
24
  };
27
25
  //#endregion
28
- export { actions, alert, body, content, danger, Alert_module_default as default, dismiss, icon, info, success, title, warning };
26
+ export { actions, alert, body, content, Alert_module_default as default, dismiss, icon, outline, solid, subtle, title };
29
27
 
30
28
  //# sourceMappingURL=Alert.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Alert.module.js","names":[],"sources":["../../src/alert/Alert.module.css"],"sourcesContent":[".alert {\n display: flex;\n align-items: flex-start;\n gap: var(--panneau-space-3);\n padding: var(--panneau-space-3) var(--panneau-space-4);\n color: var(--panneau-color-text);\n background-color: var(--panneau-color-surface-sunken);\n border: var(--panneau-border-width) solid var(--panneau-color-border);\n border-radius: var(--panneau-radius-md);\n}\n\n.success {\n background-color: var(--panneau-color-success-subtle);\n border-color: var(--panneau-color-success-border);\n}\n\n.danger {\n background-color: var(--panneau-color-danger-subtle);\n border-color: var(--panneau-color-danger-border);\n}\n\n.warning {\n background-color: var(--panneau-color-warning-subtle);\n border-color: var(--panneau-color-warning-border);\n}\n\n.info {\n background-color: var(--panneau-color-info-subtle);\n border-color: var(--panneau-color-info-border);\n}\n\n.icon {\n margin-top: 0.125rem;\n color: var(--panneau-color-text-muted);\n}\n\n.success .icon {\n color: var(--panneau-color-success);\n}\n\n.danger .icon {\n color: var(--panneau-color-danger);\n}\n\n.warning .icon {\n color: var(--panneau-color-warning);\n}\n\n.info .icon {\n color: var(--panneau-color-info);\n}\n\n.content {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n gap: var(--panneau-space-1);\n min-width: 0;\n}\n\n.title {\n font-weight: var(--panneau-font-weight-bold);\n}\n\n.body {\n overflow-wrap: anywhere;\n}\n\n.actions {\n display: flex;\n flex-wrap: wrap;\n gap: var(--panneau-space-2);\n margin-top: var(--panneau-space-2);\n}\n\n.dismiss {\n margin: calc(-1 * var(--panneau-space-1)) calc(-1 * var(--panneau-space-2)) 0 0;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"Alert.module.js","names":[],"sources":["../../src/alert/Alert.module.css"],"sourcesContent":[".alert {\n display: flex;\n align-items: flex-start;\n gap: var(--panneau-alert-gap, var(--panneau-space-3));\n padding: var(--panneau-alert-padding-y, var(--panneau-space-3))\n var(--panneau-alert-padding-x, var(--panneau-space-4));\n color: var(--panneau-color-text);\n border: var(--panneau-alert-border-width, var(--panneau-border-width)) solid transparent;\n border-radius: var(--panneau-alert-radius, var(--panneau-radius-md));\n}\n\n.icon {\n margin-top: 0.125rem;\n color: var(--panneau-tone-text);\n}\n\n/* Appearances: they read the --panneau-tone-* variables of the tone class (decision 0024). */\n\n.subtle {\n background-color: var(--panneau-tone-subtle);\n border-color: var(--panneau-tone-border);\n}\n\n.outline {\n background-color: var(--panneau-color-surface);\n border-color: var(--panneau-tone-outline);\n}\n\n.solid {\n color: var(--panneau-tone-solid-text);\n background-color: var(--panneau-tone-solid);\n border-color: var(--panneau-tone-solid);\n}\n\n.solid .icon {\n color: inherit;\n}\n\n.content {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n gap: var(--panneau-space-1);\n min-width: 0;\n}\n\n.title {\n font-weight: var(--panneau-alert-title-font-weight, var(--panneau-font-weight-bold));\n}\n\n.body {\n overflow-wrap: anywhere;\n}\n\n.actions {\n display: flex;\n flex-wrap: wrap;\n gap: var(--panneau-space-2);\n margin-top: var(--panneau-space-2);\n}\n\n.dismiss {\n margin: calc(-1 * var(--panneau-space-1)) calc(-1 * var(--panneau-space-2)) 0 0;\n}\n"],"mappings":""}
@@ -0,0 +1,3 @@
1
+ /** Tokens of Alert. */
2
+ export declare const alertTokens: import("..").ComponentTokens<"alert", "panneau-alert-radius" | "panneau-alert-gap" | "panneau-alert-padding-y" | "panneau-alert-padding-x" | "panneau-alert-border-width" | "panneau-alert-title-font-weight">;
3
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/alert/tokens.ts"],"names":[],"mappings":"AAEA,uBAAuB;AACvB,eAAO,MAAM,WAAW,gNAatB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { defineComponentTokens } from "../theme/componentTokens.js";
2
+ //#region src/alert/tokens.ts
3
+ /** Tokens of Alert. */
4
+ var alertTokens = defineComponentTokens("alert", {
5
+ /** Space between the icon, the content and the dismiss button. */
6
+ gap: "var(--panneau-space-3)",
7
+ /** Vertical padding. */
8
+ "padding-y": "var(--panneau-space-3)",
9
+ /** Horizontal padding. */
10
+ "padding-x": "var(--panneau-space-4)",
11
+ /** Width of the border. */
12
+ "border-width": "var(--panneau-border-width)",
13
+ /** Corner radius. */
14
+ radius: "var(--panneau-radius-md)",
15
+ /** Font weight of the title. */
16
+ "title-font-weight": "var(--panneau-font-weight-bold)"
17
+ });
18
+ //#endregion
19
+ export { alertTokens };
20
+
21
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","names":[],"sources":["../../src/alert/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Alert. */\nexport const alertTokens = defineComponentTokens('alert', {\n /** Space between the icon, the content and the dismiss button. */\n gap: 'var(--panneau-space-3)',\n /** Vertical padding. */\n 'padding-y': 'var(--panneau-space-3)',\n /** Horizontal padding. */\n 'padding-x': 'var(--panneau-space-4)',\n /** Width of the border. */\n 'border-width': 'var(--panneau-border-width)',\n /** Corner radius. */\n radius: 'var(--panneau-radius-md)',\n /** Font weight of the title. */\n 'title-font-weight': 'var(--panneau-font-weight-bold)',\n});\n"],"mappings":";;;AAGA,IAAa,cAAc,sBAAsB,SAAS;;CAEtD,KAAK;;CAEL,aAAa;;CAEb,aAAa;;CAEb,gBAAgB;;CAEhB,QAAQ;;CAER,qBAAqB;AACzB,CAAC"}