@panneau/ui 5.0.0-alpha.4 → 5.0.0-alpha.42

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 (485) hide show
  1. package/README.md +138 -4
  2. package/dist/alert/Alert.d.ts +2 -2
  3. package/dist/alert/Alert.js +108 -40
  4. package/dist/alert/Alert.js.map +1 -1
  5. package/dist/alert/tokens.d.ts +1 -1
  6. package/dist/alert/tokens.js.map +1 -1
  7. package/dist/aside/Aside.css +255 -0
  8. package/dist/aside/Aside.d.ts +86 -0
  9. package/dist/aside/Aside.d.ts.map +1 -0
  10. package/dist/aside/Aside.js +403 -0
  11. package/dist/aside/Aside.js.map +1 -0
  12. package/dist/aside/Aside.module.js +46 -0
  13. package/dist/aside/Aside.module.js.map +1 -0
  14. package/dist/aside/tokens.d.ts +3 -0
  15. package/dist/aside/tokens.d.ts.map +1 -0
  16. package/dist/aside/tokens.js +23 -0
  17. package/dist/aside/tokens.js.map +1 -0
  18. package/dist/badge/Badge.d.ts +1 -1
  19. package/dist/badge/Badge.js +34 -6
  20. package/dist/badge/Badge.js.map +1 -1
  21. package/dist/badge/tokens.d.ts +1 -1
  22. package/dist/badge/tokens.js.map +1 -1
  23. package/dist/bar-chart/BarChart.css +76 -0
  24. package/dist/bar-chart/BarChart.d.ts +33 -0
  25. package/dist/bar-chart/BarChart.d.ts.map +1 -0
  26. package/dist/bar-chart/BarChart.js +151 -0
  27. package/dist/bar-chart/BarChart.js.map +1 -0
  28. package/dist/bar-chart/BarChart.module.js +26 -0
  29. package/dist/bar-chart/BarChart.module.js.map +1 -0
  30. package/dist/bar-chart/tokens.d.ts +3 -0
  31. package/dist/bar-chart/tokens.d.ts.map +1 -0
  32. package/dist/bar-chart/tokens.js +17 -0
  33. package/dist/bar-chart/tokens.js.map +1 -0
  34. package/dist/button/Button.css +13 -1
  35. package/dist/button/Button.d.ts +20 -6
  36. package/dist/button/Button.d.ts.map +1 -1
  37. package/dist/button/Button.js +169 -22
  38. package/dist/button/Button.js.map +1 -1
  39. package/dist/button/Button.module.js.map +1 -1
  40. package/dist/button/LinkButton.d.ts +22 -0
  41. package/dist/button/LinkButton.d.ts.map +1 -0
  42. package/dist/button/LinkButton.js +113 -0
  43. package/dist/button/LinkButton.js.map +1 -0
  44. package/dist/button/tokens.d.ts +1 -1
  45. package/dist/button/tokens.d.ts.map +1 -1
  46. package/dist/button/tokens.js +4 -0
  47. package/dist/button/tokens.js.map +1 -1
  48. package/dist/card/Card.css +1 -0
  49. package/dist/card/Card.js +76 -23
  50. package/dist/card/Card.js.map +1 -1
  51. package/dist/card/Card.module.js.map +1 -1
  52. package/dist/card/tokens.d.ts +1 -1
  53. package/dist/card/tokens.js.map +1 -1
  54. package/dist/chart-legend/ChartLegend.css +73 -0
  55. package/dist/chart-legend/ChartLegend.d.ts +32 -0
  56. package/dist/chart-legend/ChartLegend.d.ts.map +1 -0
  57. package/dist/chart-legend/ChartLegend.js +76 -0
  58. package/dist/chart-legend/ChartLegend.js.map +1 -0
  59. package/dist/chart-legend/ChartLegend.module.js +26 -0
  60. package/dist/chart-legend/ChartLegend.module.js.map +1 -0
  61. package/dist/checkbox/Checkbox.css +15 -16
  62. package/dist/checkbox/Checkbox.d.ts +1 -1
  63. package/dist/checkbox/Checkbox.js +86 -25
  64. package/dist/checkbox/Checkbox.js.map +1 -1
  65. package/dist/checkbox/Checkbox.module.js.map +1 -1
  66. package/dist/checkbox/ChoiceChrome.js +82 -21
  67. package/dist/checkbox/ChoiceChrome.js.map +1 -1
  68. package/dist/checkbox/tokens.d.ts +1 -1
  69. package/dist/checkbox/tokens.js +2 -2
  70. package/dist/checkbox/tokens.js.map +1 -1
  71. package/dist/combo-box/ComboBox.css +10 -0
  72. package/dist/combo-box/ComboBox.d.ts +7 -2
  73. package/dist/combo-box/ComboBox.d.ts.map +1 -1
  74. package/dist/combo-box/ComboBox.js +310 -78
  75. package/dist/combo-box/ComboBox.js.map +1 -1
  76. package/dist/combo-box/ComboBox.module.js +4 -2
  77. package/dist/combo-box/ComboBox.module.js.map +1 -1
  78. package/dist/command-palette/CommandPalette.css +299 -0
  79. package/dist/command-palette/CommandPalette.d.ts +37 -0
  80. package/dist/command-palette/CommandPalette.d.ts.map +1 -0
  81. package/dist/command-palette/CommandPalette.js +497 -0
  82. package/dist/command-palette/CommandPalette.js.map +1 -0
  83. package/dist/command-palette/CommandPalette.module.js +62 -0
  84. package/dist/command-palette/CommandPalette.module.js.map +1 -0
  85. package/dist/command-palette/match.d.ts +39 -0
  86. package/dist/command-palette/match.d.ts.map +1 -0
  87. package/dist/command-palette/match.js +44 -0
  88. package/dist/command-palette/match.js.map +1 -0
  89. package/dist/command-palette/tokens.d.ts +3 -0
  90. package/dist/command-palette/tokens.d.ts.map +1 -0
  91. package/dist/command-palette/tokens.js +23 -0
  92. package/dist/command-palette/tokens.js.map +1 -0
  93. package/dist/command-palette/useCommandShortcut.d.ts +12 -0
  94. package/dist/command-palette/useCommandShortcut.d.ts.map +1 -0
  95. package/dist/command-palette/useCommandShortcut.js +48 -0
  96. package/dist/command-palette/useCommandShortcut.js.map +1 -0
  97. package/dist/container/Container.js +48 -5
  98. package/dist/container/Container.js.map +1 -1
  99. package/dist/container/tokens.d.ts +1 -1
  100. package/dist/container/tokens.js.map +1 -1
  101. package/dist/date-picker/DatePicker.css +56 -4
  102. package/dist/date-picker/DatePicker.d.ts +16 -3
  103. package/dist/date-picker/DatePicker.d.ts.map +1 -1
  104. package/dist/date-picker/DatePicker.js +359 -72
  105. package/dist/date-picker/DatePicker.js.map +1 -1
  106. package/dist/date-picker/DatePicker.module.js +8 -2
  107. package/dist/date-picker/DatePicker.module.js.map +1 -1
  108. package/dist/date-picker/calendarTokens.d.ts +1 -1
  109. package/dist/date-picker/calendarTokens.js +2 -2
  110. package/dist/date-picker/calendarTokens.js.map +1 -1
  111. package/dist/date-range-picker/DateRangePicker.css +37 -0
  112. package/dist/date-range-picker/DateRangePicker.d.ts +41 -0
  113. package/dist/date-range-picker/DateRangePicker.d.ts.map +1 -0
  114. package/dist/date-range-picker/DateRangePicker.js +438 -0
  115. package/dist/date-range-picker/DateRangePicker.js.map +1 -0
  116. package/dist/date-range-picker/DateRangePicker.module.js +20 -0
  117. package/dist/date-range-picker/DateRangePicker.module.js.map +1 -0
  118. package/dist/dialog/Dialog.css +44 -5
  119. package/dist/dialog/Dialog.d.ts +15 -3
  120. package/dist/dialog/Dialog.d.ts.map +1 -1
  121. package/dist/dialog/Dialog.js +161 -32
  122. package/dist/dialog/Dialog.js.map +1 -1
  123. package/dist/dialog/Dialog.module.js +10 -2
  124. package/dist/dialog/Dialog.module.js.map +1 -1
  125. package/dist/dialog/tokens.d.ts +1 -1
  126. package/dist/dialog/tokens.d.ts.map +1 -1
  127. package/dist/dialog/tokens.js +2 -0
  128. package/dist/dialog/tokens.js.map +1 -1
  129. package/dist/disclosure/Disclosure.js +132 -28
  130. package/dist/disclosure/Disclosure.js.map +1 -1
  131. package/dist/disclosure/tokens.d.ts +1 -1
  132. package/dist/disclosure/tokens.js.map +1 -1
  133. package/dist/divider/Divider.js +55 -11
  134. package/dist/divider/Divider.js.map +1 -1
  135. package/dist/divider/tokens.d.ts +1 -1
  136. package/dist/divider/tokens.js.map +1 -1
  137. package/dist/field/Field.css +30 -4
  138. package/dist/field/Field.module.js +6 -2
  139. package/dist/field/Field.module.js.map +1 -1
  140. package/dist/field/FieldParts.d.ts +1 -1
  141. package/dist/field/FieldParts.js +69 -15
  142. package/dist/field/FieldParts.js.map +1 -1
  143. package/dist/field/Fieldset.d.ts +6 -1
  144. package/dist/field/Fieldset.d.ts.map +1 -1
  145. package/dist/field/Fieldset.js +132 -33
  146. package/dist/field/Fieldset.js.map +1 -1
  147. package/dist/field/inputTokens.d.ts +1 -1
  148. package/dist/field/inputTokens.d.ts.map +1 -1
  149. package/dist/field/inputTokens.js +7 -1
  150. package/dist/field/inputTokens.js.map +1 -1
  151. package/dist/field/tokens.d.ts +1 -1
  152. package/dist/field/tokens.d.ts.map +1 -1
  153. package/dist/field/tokens.js +3 -1
  154. package/dist/field/tokens.js.map +1 -1
  155. package/dist/grid/Grid.d.ts +1 -1
  156. package/dist/grid/Grid.js +123 -14
  157. package/dist/grid/Grid.js.map +1 -1
  158. package/dist/grid/tokens.d.ts +1 -1
  159. package/dist/grid/tokens.js.map +1 -1
  160. package/dist/heading/Heading.js +41 -6
  161. package/dist/heading/Heading.js.map +1 -1
  162. package/dist/heading/tokens.d.ts +1 -1
  163. package/dist/heading/tokens.js.map +1 -1
  164. package/dist/icon/Icon.css +5 -0
  165. package/dist/icon/Icon.d.ts +5 -1
  166. package/dist/icon/Icon.d.ts.map +1 -1
  167. package/dist/icon/Icon.js +38 -12
  168. package/dist/icon/Icon.js.map +1 -1
  169. package/dist/icon/Icon.module.js.map +1 -1
  170. package/dist/icon/lucideIconLoader.d.ts +1 -1
  171. package/dist/icon/lucideIconLoader.js.map +1 -1
  172. package/dist/icon/namedIcons.d.ts +1 -1
  173. package/dist/icon/namedIcons.js +87 -26
  174. package/dist/icon/namedIcons.js.map +1 -1
  175. package/dist/icon/tokens.d.ts +3 -0
  176. package/dist/icon/tokens.d.ts.map +1 -0
  177. package/dist/icon/tokens.js +13 -0
  178. package/dist/icon/tokens.js.map +1 -0
  179. package/dist/icon-button/IconButton.d.ts +2 -2
  180. package/dist/icon-button/IconButton.js +70 -13
  181. package/dist/icon-button/IconButton.js.map +1 -1
  182. package/dist/index.d.ts +71 -52
  183. package/dist/index.d.ts.map +1 -1
  184. package/dist/index.js +25 -6
  185. package/dist/inline/Inline.d.ts +1 -1
  186. package/dist/inline/Inline.js +65 -7
  187. package/dist/inline/Inline.js.map +1 -1
  188. package/dist/inline/tokens.d.ts +1 -1
  189. package/dist/inline/tokens.js.map +1 -1
  190. package/dist/intl/usePanneauIntl.js.map +1 -1
  191. package/dist/layout/responsive.js.map +1 -1
  192. package/dist/line-chart/LineChart.css +314 -0
  193. package/dist/line-chart/LineChart.d.ts +84 -0
  194. package/dist/line-chart/LineChart.d.ts.map +1 -0
  195. package/dist/line-chart/LineChart.js +626 -0
  196. package/dist/line-chart/LineChart.js.map +1 -0
  197. package/dist/line-chart/LineChart.module.js +73 -0
  198. package/dist/line-chart/LineChart.module.js.map +1 -0
  199. package/dist/line-chart/geometry.d.ts +37 -0
  200. package/dist/line-chart/geometry.d.ts.map +1 -0
  201. package/dist/line-chart/geometry.js +115 -0
  202. package/dist/line-chart/geometry.js.map +1 -0
  203. package/dist/line-chart/tokens.d.ts +3 -0
  204. package/dist/line-chart/tokens.d.ts.map +1 -0
  205. package/dist/line-chart/tokens.js +23 -0
  206. package/dist/line-chart/tokens.js.map +1 -0
  207. package/dist/locales/index.js.map +1 -1
  208. package/dist/menu/Menu.css +84 -0
  209. package/dist/menu/Menu.d.ts +34 -7
  210. package/dist/menu/Menu.d.ts.map +1 -1
  211. package/dist/menu/Menu.js +243 -32
  212. package/dist/menu/Menu.js.map +1 -1
  213. package/dist/menu/Menu.module.js +22 -0
  214. package/dist/menu/Menu.module.js.map +1 -0
  215. package/dist/menu/tokens.d.ts +3 -0
  216. package/dist/menu/tokens.d.ts.map +1 -0
  217. package/dist/menu/tokens.js +31 -0
  218. package/dist/menu/tokens.js.map +1 -0
  219. package/dist/meter/Meter.css +23 -0
  220. package/dist/meter/Meter.d.ts +26 -0
  221. package/dist/meter/Meter.d.ts.map +1 -0
  222. package/dist/meter/Meter.js +99 -0
  223. package/dist/meter/Meter.js.map +1 -0
  224. package/dist/meter/Meter.module.js +16 -0
  225. package/dist/meter/Meter.module.js.map +1 -0
  226. package/dist/meter/tokens.d.ts +3 -0
  227. package/dist/meter/tokens.d.ts.map +1 -0
  228. package/dist/meter/tokens.js +15 -0
  229. package/dist/meter/tokens.js.map +1 -0
  230. package/dist/named-icons/index.d.ts +1 -1
  231. package/dist/node_modules/@internationalized/date/dist/private/CalendarDate.js +136 -0
  232. package/dist/node_modules/@internationalized/date/dist/private/CalendarDate.js.map +1 -0
  233. package/dist/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +117 -0
  234. package/dist/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js.map +1 -0
  235. package/dist/node_modules/@internationalized/date/dist/private/conversion.js +116 -0
  236. package/dist/node_modules/@internationalized/date/dist/private/conversion.js.map +1 -0
  237. package/dist/node_modules/@internationalized/date/dist/private/manipulation.js +206 -0
  238. package/dist/node_modules/@internationalized/date/dist/private/manipulation.js.map +1 -0
  239. package/dist/node_modules/@internationalized/date/dist/private/queries.js +26 -0
  240. package/dist/node_modules/@internationalized/date/dist/private/queries.js.map +1 -0
  241. package/dist/node_modules/@internationalized/date/dist/private/string.js +19 -0
  242. package/dist/node_modules/@internationalized/date/dist/private/string.js.map +1 -0
  243. package/dist/node_modules/@internationalized/date/dist/private/utils.js +8 -0
  244. package/dist/node_modules/@internationalized/date/dist/private/utils.js.map +1 -0
  245. package/dist/number-input/NumberInput.css +18 -0
  246. package/dist/number-input/NumberInput.d.ts +1 -1
  247. package/dist/number-input/NumberInput.js +232 -60
  248. package/dist/number-input/NumberInput.js.map +1 -1
  249. package/dist/number-input/NumberInput.module.js +3 -1
  250. package/dist/number-input/NumberInput.module.js.map +1 -1
  251. package/dist/number-input/tokens.d.ts +1 -1
  252. package/dist/number-input/tokens.js.map +1 -1
  253. package/dist/pill-trigger/PillTrigger.css +104 -0
  254. package/dist/pill-trigger/PillTrigger.d.ts +20 -0
  255. package/dist/pill-trigger/PillTrigger.d.ts.map +1 -0
  256. package/dist/pill-trigger/PillTrigger.js +94 -0
  257. package/dist/pill-trigger/PillTrigger.js.map +1 -0
  258. package/dist/pill-trigger/PillTrigger.module.js +18 -0
  259. package/dist/pill-trigger/PillTrigger.module.js.map +1 -0
  260. package/dist/pill-trigger/tokens.d.ts +3 -0
  261. package/dist/pill-trigger/tokens.d.ts.map +1 -0
  262. package/dist/pill-trigger/tokens.js +37 -0
  263. package/dist/pill-trigger/tokens.js.map +1 -0
  264. package/dist/popover/Popover.css +7 -2
  265. package/dist/popover/Popover.d.ts.map +1 -1
  266. package/dist/popover/Popover.js +116 -20
  267. package/dist/popover/Popover.js.map +1 -1
  268. package/dist/popover/Popover.module.js +4 -2
  269. package/dist/popover/Popover.module.js.map +1 -1
  270. package/dist/popover/tokens.d.ts +1 -1
  271. package/dist/popover/tokens.js.map +1 -1
  272. package/dist/prose/Prose.js +36 -5
  273. package/dist/prose/Prose.js.map +1 -1
  274. package/dist/prose/tokens.d.ts +1 -1
  275. package/dist/prose/tokens.js.map +1 -1
  276. package/dist/radio-group/RadioGroup.css +214 -9
  277. package/dist/radio-group/RadioGroup.d.ts +34 -5
  278. package/dist/radio-group/RadioGroup.d.ts.map +1 -1
  279. package/dist/radio-group/RadioGroup.js +258 -43
  280. package/dist/radio-group/RadioGroup.js.map +1 -1
  281. package/dist/radio-group/RadioGroup.module.js +22 -2
  282. package/dist/radio-group/RadioGroup.module.js.map +1 -1
  283. package/dist/radio-group/tokens.d.ts +2 -2
  284. package/dist/radio-group/tokens.d.ts.map +1 -1
  285. package/dist/radio-group/tokens.js +31 -3
  286. package/dist/radio-group/tokens.js.map +1 -1
  287. package/dist/root/PanneauRoot.css +35 -0
  288. package/dist/root/PanneauRoot.d.ts +37 -6
  289. package/dist/root/PanneauRoot.d.ts.map +1 -1
  290. package/dist/root/PanneauRoot.js +283 -85
  291. package/dist/root/PanneauRoot.js.map +1 -1
  292. package/dist/root/PanneauRoot.module.js.map +1 -1
  293. package/dist/root/ThemeScope.d.ts +1 -1
  294. package/dist/root/ThemeScope.d.ts.map +1 -1
  295. package/dist/root/ThemeScope.js +110 -27
  296. package/dist/root/ThemeScope.js.map +1 -1
  297. package/dist/segmented-control/SegmentedControl.css +87 -0
  298. package/dist/segmented-control/SegmentedControl.d.ts +35 -0
  299. package/dist/segmented-control/SegmentedControl.d.ts.map +1 -0
  300. package/dist/segmented-control/SegmentedControl.js +142 -0
  301. package/dist/segmented-control/SegmentedControl.js.map +1 -0
  302. package/dist/segmented-control/SegmentedControl.module.js +16 -0
  303. package/dist/segmented-control/SegmentedControl.module.js.map +1 -0
  304. package/dist/segmented-control/tokens.d.ts +3 -0
  305. package/dist/segmented-control/tokens.d.ts.map +1 -0
  306. package/dist/segmented-control/tokens.js +33 -0
  307. package/dist/segmented-control/tokens.js.map +1 -0
  308. package/dist/select/ListBox.css +86 -1
  309. package/dist/select/ListBox.module.js +11 -3
  310. package/dist/select/ListBox.module.js.map +1 -1
  311. package/dist/select/Select.d.ts +14 -1
  312. package/dist/select/Select.d.ts.map +1 -1
  313. package/dist/select/Select.js +352 -92
  314. package/dist/select/Select.js.map +1 -1
  315. package/dist/select/listBoxTokens.d.ts +1 -1
  316. package/dist/select/listBoxTokens.d.ts.map +1 -1
  317. package/dist/select/listBoxTokens.js +2 -0
  318. package/dist/select/listBoxTokens.js.map +1 -1
  319. package/dist/skeleton/LoadingRegion.d.ts +16 -0
  320. package/dist/skeleton/LoadingRegion.d.ts.map +1 -0
  321. package/dist/skeleton/LoadingRegion.js +65 -0
  322. package/dist/skeleton/LoadingRegion.js.map +1 -0
  323. package/dist/skeleton/Skeleton.css +62 -0
  324. package/dist/skeleton/Skeleton.d.ts +25 -0
  325. package/dist/skeleton/Skeleton.d.ts.map +1 -0
  326. package/dist/skeleton/Skeleton.js +106 -0
  327. package/dist/skeleton/Skeleton.js.map +1 -0
  328. package/dist/skeleton/Skeleton.module.js +22 -0
  329. package/dist/skeleton/Skeleton.module.js.map +1 -0
  330. package/dist/skeleton/tokens.d.ts +3 -0
  331. package/dist/skeleton/tokens.d.ts.map +1 -0
  332. package/dist/skeleton/tokens.js +15 -0
  333. package/dist/skeleton/tokens.js.map +1 -0
  334. package/dist/slider/Slider.css +94 -0
  335. package/dist/slider/Slider.d.ts +20 -0
  336. package/dist/slider/Slider.d.ts.map +1 -0
  337. package/dist/slider/Slider.js +248 -0
  338. package/dist/slider/Slider.js.map +1 -0
  339. package/dist/slider/Slider.module.js +20 -0
  340. package/dist/slider/Slider.module.js.map +1 -0
  341. package/dist/sparkline/Sparkline.css +44 -0
  342. package/dist/sparkline/Sparkline.d.ts +23 -0
  343. package/dist/sparkline/Sparkline.d.ts.map +1 -0
  344. package/dist/sparkline/Sparkline.js +164 -0
  345. package/dist/sparkline/Sparkline.js.map +1 -0
  346. package/dist/sparkline/Sparkline.module.js +20 -0
  347. package/dist/sparkline/Sparkline.module.js.map +1 -0
  348. package/dist/sparkline/tokens.d.ts +3 -0
  349. package/dist/sparkline/tokens.d.ts.map +1 -0
  350. package/dist/sparkline/tokens.js +17 -0
  351. package/dist/sparkline/tokens.js.map +1 -0
  352. package/dist/spinner/Spinner.css +21 -6
  353. package/dist/spinner/Spinner.d.ts.map +1 -1
  354. package/dist/spinner/Spinner.js +60 -10
  355. package/dist/spinner/Spinner.js.map +1 -1
  356. package/dist/spinner/Spinner.module.js +5 -1
  357. package/dist/spinner/Spinner.module.js.map +1 -1
  358. package/dist/spinner/tokens.d.ts +1 -1
  359. package/dist/spinner/tokens.js.map +1 -1
  360. package/dist/stack/Stack.d.ts +1 -1
  361. package/dist/stack/Stack.js +60 -7
  362. package/dist/stack/Stack.js.map +1 -1
  363. package/dist/stack/tokens.d.ts +1 -1
  364. package/dist/stack/tokens.js.map +1 -1
  365. package/dist/stat/Stat.css +79 -0
  366. package/dist/stat/Stat.d.ts +49 -0
  367. package/dist/stat/Stat.d.ts.map +1 -0
  368. package/dist/stat/Stat.js +127 -0
  369. package/dist/stat/Stat.js.map +1 -0
  370. package/dist/stat/Stat.module.js +28 -0
  371. package/dist/stat/Stat.module.js.map +1 -0
  372. package/dist/stat/tokens.d.ts +3 -0
  373. package/dist/stat/tokens.d.ts.map +1 -0
  374. package/dist/stat/tokens.js +21 -0
  375. package/dist/stat/tokens.js.map +1 -0
  376. package/dist/switch/Switch.css +16 -10
  377. package/dist/switch/Switch.d.ts +1 -1
  378. package/dist/switch/Switch.js +68 -11
  379. package/dist/switch/Switch.js.map +1 -1
  380. package/dist/switch/Switch.module.js.map +1 -1
  381. package/dist/switch/tokens.d.ts +1 -1
  382. package/dist/switch/tokens.d.ts.map +1 -1
  383. package/dist/switch/tokens.js +4 -2
  384. package/dist/switch/tokens.js.map +1 -1
  385. package/dist/tabs/Tabs.css +11 -4
  386. package/dist/tabs/Tabs.js +1 -1
  387. package/dist/tabs/Tabs.js.map +1 -1
  388. package/dist/tabs/Tabs.module.js.map +1 -1
  389. package/dist/tabs/tokens.d.ts +1 -1
  390. package/dist/tabs/tokens.js +1 -1
  391. package/dist/tabs/tokens.js.map +1 -1
  392. package/dist/tags-input/TagsInput.css +73 -0
  393. package/dist/tags-input/TagsInput.d.ts +32 -0
  394. package/dist/tags-input/TagsInput.d.ts.map +1 -0
  395. package/dist/tags-input/TagsInput.js +316 -0
  396. package/dist/tags-input/TagsInput.js.map +1 -0
  397. package/dist/tags-input/TagsInput.module.js +20 -0
  398. package/dist/tags-input/TagsInput.module.js.map +1 -0
  399. package/dist/text/Text.d.ts +1 -1
  400. package/dist/text/Text.js +70 -5
  401. package/dist/text/Text.js.map +1 -1
  402. package/dist/text/tokens.d.ts +1 -1
  403. package/dist/text/tokens.js.map +1 -1
  404. package/dist/text-area/TextArea.d.ts +1 -1
  405. package/dist/text-area/TextArea.js +135 -28
  406. package/dist/text-area/TextArea.js.map +1 -1
  407. package/dist/text-input/TextInput.d.ts +7 -3
  408. package/dist/text-input/TextInput.d.ts.map +1 -1
  409. package/dist/text-input/TextInput.js +164 -47
  410. package/dist/text-input/TextInput.js.map +1 -1
  411. package/dist/theme/Tone.css +14 -0
  412. package/dist/theme/Tone.module.js +4 -2
  413. package/dist/theme/Tone.module.js.map +1 -1
  414. package/dist/theme/bootstrap.d.ts +2 -2
  415. package/dist/theme/bootstrap.d.ts.map +1 -1
  416. package/dist/theme/bootstrap.js +6 -0
  417. package/dist/theme/bootstrap.js.map +1 -1
  418. package/dist/theme/chartColors.js.map +1 -1
  419. package/dist/theme/checkTheme.d.ts +6 -4
  420. package/dist/theme/checkTheme.d.ts.map +1 -1
  421. package/dist/theme/checkTheme.js +54 -7
  422. package/dist/theme/checkTheme.js.map +1 -1
  423. package/dist/theme/cli.d.ts +2 -2
  424. package/dist/theme/cli.js.map +1 -1
  425. package/dist/theme/color.d.ts +13 -0
  426. package/dist/theme/color.d.ts.map +1 -1
  427. package/dist/theme/color.js +41 -1
  428. package/dist/theme/color.js.map +1 -1
  429. package/dist/theme/colorVision.d.ts +1 -1
  430. package/dist/theme/colorVision.js.map +1 -1
  431. package/dist/theme/componentTokens.js.map +1 -1
  432. package/dist/theme/components.d.ts +24 -11
  433. package/dist/theme/components.d.ts.map +1 -1
  434. package/dist/theme/components.js +26 -0
  435. package/dist/theme/components.js.map +1 -1
  436. package/dist/theme/defineTheme.d.ts +5 -5
  437. package/dist/theme/defineTheme.js.map +1 -1
  438. package/dist/theme/fonts.js.map +1 -1
  439. package/dist/theme/index.d.ts +12 -12
  440. package/dist/theme/index.js +1 -1
  441. package/dist/theme/selectedTokens.d.ts +11 -0
  442. package/dist/theme/selectedTokens.d.ts.map +1 -0
  443. package/dist/theme/selectedTokens.js +23 -0
  444. package/dist/theme/selectedTokens.js.map +1 -0
  445. package/dist/theme/semanticTokens.d.ts +1 -1
  446. package/dist/theme/semanticTokens.d.ts.map +1 -1
  447. package/dist/theme/semanticTokens.js +10 -0
  448. package/dist/theme/semanticTokens.js.map +1 -1
  449. package/dist/theme/theme.d.ts +2 -2
  450. package/dist/theme/theme.js.map +1 -1
  451. package/dist/theme/toneClass.d.ts +1 -1
  452. package/dist/theme/toneClass.js.map +1 -1
  453. package/dist/theme/tones.d.ts +15 -3
  454. package/dist/theme/tones.d.ts.map +1 -1
  455. package/dist/theme/tones.js +14 -2
  456. package/dist/theme/tones.js.map +1 -1
  457. package/dist/time-input/TimeInput.d.ts +1 -1
  458. package/dist/time-input/TimeInput.js +138 -31
  459. package/dist/time-input/TimeInput.js.map +1 -1
  460. package/dist/toast/Toast.css +180 -19
  461. package/dist/toast/Toast.d.ts +61 -10
  462. package/dist/toast/Toast.d.ts.map +1 -1
  463. package/dist/toast/Toast.js +246 -70
  464. package/dist/toast/Toast.js.map +1 -1
  465. package/dist/toast/Toast.module.js +6 -3
  466. package/dist/toast/Toast.module.js.map +1 -1
  467. package/dist/toast/tokens.d.ts +1 -1
  468. package/dist/toast/tokens.js +1 -1
  469. package/dist/toast/tokens.js.map +1 -1
  470. package/dist/tooltip/Tooltip.css +1 -1
  471. package/dist/tooltip/Tooltip.js +38 -8
  472. package/dist/tooltip/Tooltip.js.map +1 -1
  473. package/dist/tooltip/Tooltip.module.js.map +1 -1
  474. package/dist/tooltip/tokens.d.ts +1 -1
  475. package/dist/tooltip/tokens.js.map +1 -1
  476. package/dist/utils/cx.js.map +1 -1
  477. package/dist/utils/events.d.ts +4 -0
  478. package/dist/utils/events.d.ts.map +1 -0
  479. package/dist/utils/events.js +9 -0
  480. package/dist/utils/events.js.map +1 -0
  481. package/dist/utils/preference.d.ts +7 -0
  482. package/dist/utils/preference.d.ts.map +1 -0
  483. package/dist/utils/preference.js +54 -0
  484. package/dist/utils/preference.js.map +1 -0
  485. package/package.json +5 -5
package/README.md CHANGED
@@ -73,7 +73,7 @@ Every component reads its own tokens, `--panneau-<component>-<token>`, which def
73
73
 
74
74
  ### Tones and appearances
75
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):
76
+ Components with a color take a `tone`, like Bootstrap's theme colors: `neutral`, `accent`, `success`, `warning`, `danger`, `info` and `muted` are built in. What each one means for a state (`muted` is what is over: Archived, Cancelled) is written once, in [the tones of the protocol](../../docs/protocol.md#tones): follow it, so that a user learns the colors once. `Button`, `Badge` and `Alert` also take an `appearance` (`solid`, `outline`, `subtle`, and `ghost` for buttons):
77
77
 
78
78
  ```tsx
79
79
  <Button tone="accent">Save</Button>
@@ -214,7 +214,7 @@ Responsive values are inline CSS variables, read by static rules in each contain
214
214
 
215
215
  ### Density
216
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.
217
+ A density is a set of tokens: `--panneau-control-height` and `-sm`, `--panneau-font-size-control`, `--panneau-control-padding-x` (inputs and buttons), `--panneau-row-padding-y` (rows of tables, options of lists) and `--panneau-target-size`, the smallest size of what a pointer or a finger hits that isn't a control (rows of checkboxes, radios and switches, links of the sidebar, sortable headers): 1.5rem, and 2.75rem in the touch density. The `density` of the root picks one, and the `size` props of components (`size="sm"`) stay relative to it.
218
218
 
219
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
220
 
@@ -245,6 +245,26 @@ Charts (dashboard widgets, reports) use only the chart tokens of the theme, in b
245
245
 
246
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
247
 
248
+ `Stat` and `LineChart` are the charts of the dashboard ([decision 0064](../../docs/decisions/0064-dashboard-widgets.md)):
249
+
250
+ ```tsx
251
+ <Stat label="Overdue" value={3} help="Since Monday" tone="danger" href="/entries?filter[late]=1" />
252
+ <LineChart
253
+ label="Entries per day"
254
+ points={[
255
+ { label: 'October 5, 2026', shortLabel: 'Oct 5', value: 4 },
256
+ { label: 'October 6, 2026', shortLabel: 'Oct 6', value: 8 },
257
+ ]}
258
+ />
259
+ ```
260
+
261
+ - `Stat` shows a number for the locale (`format` takes the options of `Intl.NumberFormat`), what it counts above it and its help under it. A `tone` colors the number only when it calls for attention: the help says why.
262
+ - `LineChart` draws a curve and the area under it on a categorical chart color (`color`, from 0), a scale of round graduations, dates under it and the last value at the end of the line ([decision 0085](../../docs/decisions/0085-readable-line-charts.md)). `axisLabel`, `showMax`, `showLast`, `showAxis`, `domain` and `formatTick` fit it to its data; `curve="linear"` draws straight segments. `isInteractive` shows the value of the point under the pointer or chosen with the arrow keys, for a long series. The plot is hidden from assistive technologies, which read the values in a table.
263
+ - With `series` instead of `points`, `LineChart` draws a line per series on the categorical colors or the color of a `tone`, stacked as areas with `stacked`, without values written on them, and its table has a column per line ([decision 0089](../../docs/decisions/0089-combined-widgets.md)). `ChartLegend` lists their names, totals and help beside it.
264
+ - `Stat` takes a `change` from a previous value: its direction, drawn as an arrow and said to assistive technologies, what it is (`12% from the previous 30 days`), and a `tone` only when the change is good or bad news.
265
+ - `Sparkline` draws a small line of values without a scale or labels, from the lowest to the highest: the trend beside a number, in a card or a row of a table. With a `label`, it is an image; without one, it is decorative.
266
+ - They draw a skeleton of their shape while their `value`, `points` or `values` are `undefined`.
267
+
248
268
  ### Checking a theme
249
269
 
250
270
  `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:
@@ -288,18 +308,132 @@ Class names are stable and readable, without a hash, like Bootstrap's: target th
288
308
 
289
309
  The theme model is described in [decision 0024](../../docs/decisions/0024-theme-model.md).
290
310
 
311
+ ### Content Security Policy
312
+
313
+ Panneau runs under a strict Content Security Policy: it never needs `'unsafe-eval'` or inline scripts. For styles:
314
+
315
+ - **CSS Modules** are files of the packages, that the project's bundler serves as its other stylesheets (`style-src 'self'`).
316
+ - **Themes and fonts** are `<style>` elements (and a `<link>` for each font stylesheet) that `PanneauRoot` writes from the theme. With a policy without `'unsafe-inline'`, give them the page's nonce: `<PanneauRoot nonce={nonce}>`, or `nonce` of `<Panneau>` and `createPanneauApp()`. Without it, Panneau reads the nonce where React Aria does: `<meta property="csp-nonce" content="…">`, then `__webpack_nonce__`. The default theme writes no `<style>`.
317
+ - **React Aria** adds one `<style>` (`react-aria-pressable-style`) with the same nonce.
318
+ - **Inline `style` attributes** that components set (widths of progress bars, positions of popovers) go through the CSSOM, which `style-src` doesn't block.
319
+
320
+ ```html
321
+ <meta property="csp-nonce" content="{{ $nonce }}" />
322
+ ```
323
+
324
+ ```text
325
+ Content-Security-Policy: default-src 'self'; style-src 'self' 'nonce-{{ $nonce }}'; img-src 'self' data: https:
326
+ ```
327
+
291
328
  ## Primitives
292
329
 
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`.
330
+ `Heading`, `Text`, `Prose`, `Stack`, `Inline`, `Grid`, `Container`, `Divider`, `Button`, `IconButton`, `TextInput`, `TextArea`, `NumberInput`, `Slider`, `TagsInput`, `Select` (single or multiple), `ComboBox`, `Checkbox`, `Switch`, `RadioGroup`, `SegmentedControl`, `DatePicker`, `TimeInput`, `Fieldset`, `Dialog`, `Popover`, `Menu`, `PillTrigger`, `Tabs`, `Tooltip`, toasts (`useToast()`), `Alert`, `Badge`, `Spinner`, `Skeleton`, `LoadingRegion`, `Card`, `Disclosure` and `Icon`.
294
331
 
295
332
  - Every component accepts `className`, and `xxxClassName` props for its inner elements (`labelClassName`, `inputClassName`…).
296
333
  - Labelled controls take `label`, `description` and `errors` (a list of messages: any message makes the control invalid and describes it).
297
- - They work on phones: larger touch targets on touch screens, dialogs as bottom sheets, scrolling tabs.
334
+ - They work on phones: larger touch targets on touch screens, dialogs as bottom sheets (or the whole screen, with `fullScreenOnPhone`), scrolling tabs.
335
+
336
+ ### Rich choices
337
+
338
+ Picking one item among a few rich ones, such as an account (an avatar, a name, a handle), a plan or a template, takes a menu or radio cards.
339
+
340
+ - **`Menu`** groups its items in `MenuSection`s, whose `title` is a small muted eyebrow that labels the group, and takes a `footer`: a short note under the items, after a line, which describes the menu and can't be focused. With `selectionMode` (`single` or `multiple`) and `selectedKeys`, its items are radio or checkbox items, and the selected ones have a check at their end and a sunken background.
341
+ - **`MenuItem`** takes a leading `media` (an avatar or an image) instead of an `icon`: larger when the item has a `description`, and clipped to a circle by default (`--panneau-menu-media-radius`).
342
+ - **`PillTrigger`** is a compact rounded button that shows the current value, with an optional leading `media` and a chevron, for a `MenuTrigger` or a `PopoverTrigger`. Its accessible name is its value: give it an `aria-label` that contains the value when the value alone doesn't say what it picks.
343
+
344
+ ```tsx
345
+ <MenuTrigger>
346
+ <PillTrigger size="sm" media={<Avatar user={account} />}>
347
+ {account.name}
348
+ </PillTrigger>
349
+ <Menu
350
+ aria-label="Accounts"
351
+ selectionMode="single"
352
+ selectedKeys={[account.id]}
353
+ onSelectionChange={(keys) => keys !== 'all' && onChange([...keys][0])}
354
+ footer="Only this step changes."
355
+ >
356
+ <MenuSection title="Publish on">
357
+ {accounts.map((item) => (
358
+ <MenuItem
359
+ key={item.id}
360
+ id={item.id}
361
+ media={<Avatar user={item} />}
362
+ description={item.handle}
363
+ >
364
+ {item.name}
365
+ </MenuItem>
366
+ ))}
367
+ </MenuSection>
368
+ </Menu>
369
+ </MenuTrigger>
370
+ ```
371
+
372
+ - **`RadioGroup`** with `appearance="cards"` shows its options as bordered cards in a grid of `columns` (2 by default): each card has the radio, the option's `media`, its label and its description, and the selected card has a stronger border. The grid is a size container of its own, and becomes a single column when it is narrower than 28rem. Keyboard and focus work as in a list of radios.
373
+
374
+ ```tsx
375
+ <RadioGroup
376
+ label="Publish on"
377
+ appearance="cards"
378
+ options={accounts.map((item) => ({
379
+ value: item.id,
380
+ label: item.name,
381
+ description: item.handle,
382
+ media: <Avatar user={item} />,
383
+ }))}
384
+ value={accountId}
385
+ onChange={setAccountId}
386
+ />
387
+ ```
388
+
389
+ ### Loading
390
+
391
+ Content that loads shows a skeleton of its shape, never a spinner in its place ([decision 0034](../../docs/decisions/0034-skeletons-while-content-loads.md)). Spinners are for operations in progress (`Button` `isPending`) and lookups inside a control (`ComboBox` `isLoading`).
392
+
393
+ - `Skeleton` is a block of the shape to come: a line of text (`lines` for several, the last one shorter), a `rect` with a `width`, a `height` or an `aspectRatio`, or a `circle`. It is `aria-hidden`, pulses unless the user prefers reduced motion, and reads the `skeleton` component tokens (`color`, `radius`, `duration`).
394
+ - `LoadingRegion` goes around the skeleton, in place of the content: it has `aria-busy="true"`, and a status message says once that the content loads (`label`, "Loading…" by default).
395
+
396
+ ```tsx
397
+ function ArticleCard({ article }: { article: Article | undefined }) {
398
+ if (article === undefined) {
399
+ return (
400
+ <LoadingRegion label="Loading the article…">
401
+ <Skeleton shape="rect" aspectRatio="16 / 9" />
402
+ <Skeleton lines={3} />
403
+ </LoadingRegion>
404
+ );
405
+ }
406
+ return <ArticleView article={article} />;
407
+ }
408
+ ```
409
+
410
+ A skeleton never replaces content already shown: while it is fetched again, it stays, dimmed, with `aria-busy`, as in lists.
411
+
412
+ ### Toasts
413
+
414
+ `useToast().show(content, options)` shows a toast in the region of the closest `PanneauRoot` ([decision 0062](../../docs/decisions/0062-toasts.md)):
415
+
416
+ ```tsx
417
+ const toasts = useToast();
418
+ toasts.show(
419
+ { title: '3 entries archived', tone: 'success', action: { label: 'Undo', onAction: undo } },
420
+ { key: 'archive' },
421
+ );
422
+ ```
423
+
424
+ - **Only when the page doesn't already say it.** A toast for what happened out of sight (a run that finished, a change made from a menu), for what can be undone, and for an error that has no place in the page (the network, a logout that failed). No toast where the page shows the result: a form says "Saved" in its footer, an error of a field stays on it, and a run that starts shows in the runs button of the shell.
425
+ - **Name the thing, and offer the next step**: what was done to what ("“Spring contest” saved", "3 entries archived"), and an `action` that leads to the result ("Open", "Download") or undoes it ("Undo").
426
+ - **One per thing**: a toast with the `key` of one already shown replaces it. At most three show at once; the older ones fold behind the newest and unfold on hover or focus.
427
+ - **Timeouts that match what the toast holds** (`getToastTimeout()`): about 5 seconds, longer for a longer text, about 10 seconds with an action, none for an error (`danger`). Timers pause while the region is hovered or focused. `timeout` sets another, `null` none.
428
+ - **Quiet**: a success has the neutral look with its icon; only warnings and errors color the edge.
429
+ - **At the bottom, centered**, above what sticks to the bottom of the page: such an element calls `useToastOffset(ref)`, as the footer of a form does. `PanneauRoot`'s `toastPlacement` puts them at `bottom-end` or `top-end` instead. On a phone, they take the whole width.
298
430
 
299
431
  ## Icons
300
432
 
301
433
  Components take icons as components: any Lucide icon (`icon={Pencil}`), or a component with the same props.
302
434
 
435
+ The stroke of icons scales with them, so every size has the same weight: `--panneau-icon-stroke-width` is in units of Lucide's 24-unit grid (`2` by default, about 1.33px at 16px). A theme sets it for a lighter or a bolder icon set.
436
+
303
437
  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`:
304
438
 
305
439
  ```tsx
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode, Ref } from 'react';
2
- import { type IconComponent } from '../icon/Icon';
3
- import type { Tone } from '../theme/tones';
2
+ import { type IconComponent } from '../icon/Icon.js';
3
+ import type { Tone } from '../theme/tones.js';
4
4
  /** @deprecated Use `Tone`. */
5
5
  export type AlertTone = Tone;
6
6
  /** How an alert uses its tone. */
@@ -5,6 +5,7 @@ import { usePanneauIntl } from "../intl/usePanneauIntl.js";
5
5
  import { toneClass } from "../theme/toneClass.js";
6
6
  import { IconButton } from "../icon-button/IconButton.js";
7
7
  import Alert_module_default from "./Alert.module.js";
8
+ import { c } from "react/compiler-runtime";
8
9
  import { CircleAlert, CircleCheck, Info, TriangleAlert, X } from "lucide-react";
9
10
  import { jsx, jsxs } from "react/jsx-runtime";
10
11
  //#region src/alert/Alert.tsx
@@ -16,48 +17,115 @@ var TONE_ICONS = {
16
17
  info: Info
17
18
  };
18
19
  /** A message inside the page: an error summary, a warning, a confirmation. */
19
- function Alert({ tone = "neutral", appearance = "subtle", variant, title, children, icon, actions, onDismiss, role, id, tabIndex, ref, className, titleClassName, bodyClassName }) {
20
+ function Alert(t0) {
21
+ const $ = c(31);
22
+ const { tone: t1, appearance: t2, variant, title, children, icon, actions, onDismiss, role, id, tabIndex, ref, className, titleClassName, bodyClassName } = t0;
23
+ const tone = t1 === void 0 ? "neutral" : t1;
24
+ const appearance = t2 === void 0 ? "subtle" : t2;
20
25
  const intl = usePanneauIntl();
21
26
  const shown = icon === void 0 ? TONE_ICONS[tone] ?? Info : icon;
22
- return /* @__PURE__ */ jsxs("div", {
23
- ref,
24
- id,
25
- role,
26
- tabIndex,
27
- className: cx("panneau-alert", Alert_module_default.alert, toneClass(tone), Alert_module_default[appearance], variant !== void 0 && `panneau-alert-variant-${variant}`, className),
28
- children: [
29
- shown !== null ? /* @__PURE__ */ jsx(Icon, {
30
- icon: shown,
31
- size: "lg",
32
- className: Alert_module_default.icon
33
- }) : null,
34
- /* @__PURE__ */ jsxs("div", {
35
- className: Alert_module_default.content,
36
- children: [
37
- title !== void 0 && title !== null ? /* @__PURE__ */ jsx("div", {
38
- className: cx(Alert_module_default.title, titleClassName),
39
- children: title
40
- }) : null,
41
- children !== void 0 && children !== null ? /* @__PURE__ */ jsx("div", {
42
- className: cx(Alert_module_default.body, bodyClassName),
43
- children
44
- }) : null,
45
- actions !== void 0 && actions !== null ? /* @__PURE__ */ jsx("div", {
46
- className: Alert_module_default.actions,
47
- children: actions
48
- }) : null
49
- ]
50
- }),
51
- onDismiss !== void 0 ? /* @__PURE__ */ jsx(IconButton, {
52
- icon: X,
53
- size: "sm",
54
- label: intl.formatMessage(messages.close),
55
- showTooltip: false,
56
- onPress: onDismiss,
57
- className: Alert_module_default.dismiss
58
- }) : null
59
- ]
60
- });
27
+ let t3;
28
+ if ($[0] !== appearance || $[1] !== className || $[2] !== tone || $[3] !== variant) {
29
+ t3 = cx("panneau-alert", Alert_module_default.alert, toneClass(tone), Alert_module_default[appearance], variant !== void 0 && `panneau-alert-variant-${variant}`, className);
30
+ $[0] = appearance;
31
+ $[1] = className;
32
+ $[2] = tone;
33
+ $[3] = variant;
34
+ $[4] = t3;
35
+ } else t3 = $[4];
36
+ let t4;
37
+ if ($[5] !== shown) {
38
+ t4 = shown !== null ? /* @__PURE__ */ jsx(Icon, {
39
+ icon: shown,
40
+ size: "lg",
41
+ className: Alert_module_default.icon
42
+ }) : null;
43
+ $[5] = shown;
44
+ $[6] = t4;
45
+ } else t4 = $[6];
46
+ let t5;
47
+ if ($[7] !== title || $[8] !== titleClassName) {
48
+ t5 = title !== void 0 && title !== null ? /* @__PURE__ */ jsx("div", {
49
+ className: cx(Alert_module_default.title, titleClassName),
50
+ children: title
51
+ }) : null;
52
+ $[7] = title;
53
+ $[8] = titleClassName;
54
+ $[9] = t5;
55
+ } else t5 = $[9];
56
+ let t6;
57
+ if ($[10] !== bodyClassName || $[11] !== children) {
58
+ t6 = children !== void 0 && children !== null ? /* @__PURE__ */ jsx("div", {
59
+ className: cx(Alert_module_default.body, bodyClassName),
60
+ children
61
+ }) : null;
62
+ $[10] = bodyClassName;
63
+ $[11] = children;
64
+ $[12] = t6;
65
+ } else t6 = $[12];
66
+ let t7;
67
+ if ($[13] !== actions) {
68
+ t7 = actions !== void 0 && actions !== null ? /* @__PURE__ */ jsx("div", {
69
+ className: Alert_module_default.actions,
70
+ children: actions
71
+ }) : null;
72
+ $[13] = actions;
73
+ $[14] = t7;
74
+ } else t7 = $[14];
75
+ let t8;
76
+ if ($[15] !== t5 || $[16] !== t6 || $[17] !== t7) {
77
+ t8 = /* @__PURE__ */ jsxs("div", {
78
+ className: Alert_module_default.content,
79
+ children: [
80
+ t5,
81
+ t6,
82
+ t7
83
+ ]
84
+ });
85
+ $[15] = t5;
86
+ $[16] = t6;
87
+ $[17] = t7;
88
+ $[18] = t8;
89
+ } else t8 = $[18];
90
+ let t9;
91
+ if ($[19] !== intl || $[20] !== onDismiss) {
92
+ t9 = onDismiss !== void 0 ? /* @__PURE__ */ jsx(IconButton, {
93
+ icon: X,
94
+ size: "sm",
95
+ label: intl.formatMessage(messages.close),
96
+ showTooltip: false,
97
+ onPress: onDismiss,
98
+ className: Alert_module_default.dismiss
99
+ }) : null;
100
+ $[19] = intl;
101
+ $[20] = onDismiss;
102
+ $[21] = t9;
103
+ } else t9 = $[21];
104
+ let t10;
105
+ if ($[22] !== id || $[23] !== ref || $[24] !== role || $[25] !== t3 || $[26] !== t4 || $[27] !== t8 || $[28] !== t9 || $[29] !== tabIndex) {
106
+ t10 = /* @__PURE__ */ jsxs("div", {
107
+ ref,
108
+ id,
109
+ role,
110
+ tabIndex,
111
+ className: t3,
112
+ children: [
113
+ t4,
114
+ t8,
115
+ t9
116
+ ]
117
+ });
118
+ $[22] = id;
119
+ $[23] = ref;
120
+ $[24] = role;
121
+ $[25] = t3;
122
+ $[26] = t4;
123
+ $[27] = t8;
124
+ $[28] = t9;
125
+ $[29] = tabIndex;
126
+ $[30] = t10;
127
+ } else t10 = $[30];
128
+ return t10;
61
129
  }
62
130
  //#endregion
63
131
  export { Alert };
@@ -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 { 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
+ {"version":3,"file":"Alert.js","names":["CircleAlert","CircleCheck","Info","TriangleAlert","X","ReactNode","Ref","IconButton","Icon","IconComponent","messages","usePanneauIntl","toneClass","Tone","cx","styles","AlertTone","AlertAppearance","AlertVariants","TONE_ICONS","Partial","Record","neutral","success","danger","warning","info","AlertProps","tone","appearance","variant","title","children","icon","actions","onDismiss","role","id","tabIndex","ref","HTMLDivElement","className","titleClassName","bodyClassName","Alert","t0","$","_c","t1","t2","undefined","intl","shown","t3","alert","t4","t5","t6","body","t7","t8","content","t9","formatMessage","close","dismiss","t10","_c","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":"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"}
@@ -1,3 +1,3 @@
1
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">;
2
+ export declare const alertTokens: import("../index.js").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
3
  //# sourceMappingURL=tokens.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"tokens.js","names":["defineComponentTokens","alertTokens","gap","radius"],"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,IAAaC,cAAcD,sBAAsB,SAAS;;CAEtDE,KAAK;;CAEL,aAAa;;CAEb,aAAa;;CAEb,gBAAgB;;CAEhBC,QAAQ;;CAER,qBAAqB;AACzB,CAAC"}