@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
@@ -1 +1 @@
1
- {"version":3,"file":"tones.js","names":[],"sources":["../../src/theme/tones.ts"],"sourcesContent":["import {\n type Rgb,\n WHITE,\n contrastRatio,\n ensureContrast,\n mixColors,\n parseColor,\n readableTextColor,\n toHex,\n} from './color';\n\n/**\n * The tones that components accept (`tone=\"success\"`), like Bootstrap's `$theme-colors`. A theme\n * adds its own; declare them here so that `tone=\"signal\"` type-checks:\n *\n * ```ts\n * declare module '@panneau/ui' {\n * interface PanneauTones {\n * signal: true;\n * }\n * }\n * ```\n */\nexport interface PanneauTones {\n neutral: true;\n accent: true;\n success: true;\n warning: true;\n danger: true;\n info: true;\n}\n\n/** A tone name: a built-in tone, or one declared in `PanneauTones`. */\nexport type Tone = keyof PanneauTones & string;\n\n/** The tones Panneau defines, from the semantic tokens of the theme. */\nexport const BUILT_IN_TONES = [\n 'neutral',\n 'accent',\n 'success',\n 'warning',\n 'danger',\n 'info',\n] as const;\n\n/** The colors of a tone, as CSS values. */\nexport type ToneValues = {\n /** Text and icons on surfaces: the outline, subtle and ghost appearances. */\n text: string;\n /** Background of the subtle appearance. */\n subtle: string;\n /** Border of the subtle appearance. */\n border: string;\n /** Border of the outline appearance. */\n outline: string;\n /** Background of the solid appearance. */\n solid: string;\n /** Background of the solid appearance on hover and press. */\n solidHover: string;\n /** Text on the solid appearance. */\n solidText: string;\n};\n\n/**\n * A tone of a theme: one color, from which Panneau derives the others (`'#f25c05'`), or every\n * value, with optional overrides for the dark scheme.\n */\nexport type ToneInput = string | (ToneValues & { dark?: Partial<ToneValues> });\n\n/** The local CSS variables of a tone, which components read. */\nexport const TONE_VARIABLES: Readonly<Record<keyof ToneValues, string>> = {\n text: 'panneau-tone-text',\n subtle: 'panneau-tone-subtle',\n border: 'panneau-tone-border',\n outline: 'panneau-tone-outline',\n solid: 'panneau-tone-solid',\n solidHover: 'panneau-tone-solid-hover',\n solidText: 'panneau-tone-solid-text',\n};\n\n/** The class that applies a tone: `panneau-tone-<tone>`. */\nexport function toneClassName(tone: string): string {\n return `panneau-tone-${tone}`;\n}\n\n/** Surfaces text must be readable on, in each scheme of the default theme. */\nconst SURFACES: Record<'light' | 'dark', Rgb> = { light: WHITE, dark: { r: 24, g: 24, b: 27 } };\n\n/** The surfaces of a theme, in each scheme, when it sets ones Panneau can read. */\nexport type ToneSurfaces = Partial<Record<'light' | 'dark', Rgb>>;\n\n/** How much of the tone's color the subtle background mixes into the surface, per scheme. */\nexport const SUBTLE_AMOUNTS = { light: 0.12, dark: 0.22 };\n\n/** Text must reach this contrast ratio (WCAG AA for normal text). */\nexport const MIN_CONTRAST_RATIO = 4.5;\n\n/**\n * The values of a tone, in both schemes, from one color: Panneau's `button-variant()` and\n * `color-contrast()`.\n *\n * - The solid background is the color, with white or black text, whichever reads better, and a\n * hover 15% darker (or lighter, when the text is black and darker would hurt it).\n * - The text color is the color, darkened (light scheme) or lightened (dark scheme) until it\n * reaches 4.5:1 against the subtle background, which is tinted, and so against the surface too.\n * - The subtle background and the border are mixed with the surface in CSS, so they follow the\n * surface of any theme.\n *\n * A color Panneau can't read (a CSS variable, a named color) is used as is, with `color-mix()` for\n * the hover and white text: `checkTheme()` reports it as unchecked.\n *\n * Text is made readable on the surfaces of the default theme, or on those given, which themes pass\n * so that a tone stays readable on their own surfaces.\n */\nexport function deriveTone(\n color: string,\n surfaces: ToneSurfaces = {},\n): { light: ToneValues; dark: ToneValues } {\n const subtle = (amount: number) =>\n `color-mix(in srgb, ${color} ${amount}%, var(--panneau-color-surface))`;\n const parsed = parseColor(color);\n if (parsed === null) {\n const values: ToneValues = {\n text: color,\n subtle: subtle(SUBTLE_AMOUNTS.light * 100),\n border: subtle(45),\n outline: color,\n solid: color,\n solidHover: `color-mix(in srgb, ${color}, #000 15%)`,\n solidText: '#fff',\n };\n return { light: values, dark: { ...values, subtle: subtle(SUBTLE_AMOUNTS.dark * 100) } };\n }\n const solidText = readableTextColor(parsed);\n const darker = mixColors(parsed, { r: 0, g: 0, b: 0 }, 0.15);\n const hover =\n contrastRatio(solidText, darker) >= contrastRatio(solidText, parsed)\n ? darker\n : mixColors(parsed, WHITE, 0.15);\n const solid = toHex(parsed);\n const shared = {\n solid,\n solidHover: toHex(hover),\n solidText: toHex(solidText),\n };\n // Readable on the subtle background, which is closer to the text color than the surface.\n const readable = (scheme: 'light' | 'dark') =>\n toHex(\n ensureContrast(\n parsed,\n mixColors(surfaces[scheme] ?? SURFACES[scheme], parsed, SUBTLE_AMOUNTS[scheme]),\n MIN_CONTRAST_RATIO,\n ),\n );\n const light = readable('light');\n const dark = readable('dark');\n return {\n light: {\n ...shared,\n text: light,\n outline: light,\n subtle: subtle(SUBTLE_AMOUNTS.light * 100),\n border: subtle(45),\n },\n dark: {\n ...shared,\n text: dark,\n outline: dark,\n subtle: subtle(SUBTLE_AMOUNTS.dark * 100),\n border: subtle(55),\n },\n };\n}\n\n/** The values of a tone input, in both schemes, derived on the given surfaces if it is one color. */\nexport function resolveTone(\n input: ToneInput,\n surfaces: ToneSurfaces = {},\n): { light: ToneValues; dark: ToneValues } {\n if (typeof input === 'string') {\n return deriveTone(input, surfaces);\n }\n const { dark, ...light } = input;\n return { light, dark: { ...light, ...dark } };\n}\n"],"mappings":";;;AAoCA,IAAa,iBAAiB;CAC1B;CACA;CACA;CACA;CACA;CACA;AAAM;;AA4BV,IAAa,iBAA6D;CACtE,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,OAAO;CACP,YAAY;CACZ,WAAW;AACf;;AAGA,SAAgB,cAAc,MAAsB;CAChD,OAAO,gBAAgB;AAC3B;;AAGA,IAAM,WAA0C;CAAE,OAAO;CAAO,MAAM;EAAE,GAAG;EAAI,GAAG;EAAI,GAAG;CAAG;AAAE;;AAM9F,IAAa,iBAAiB;CAAE,OAAO;CAAM,MAAM;AAAK;;AAGxD,IAAa,qBAAqB;;;;;;;;;;;;;;;;;;AAmBlC,SAAgB,WACZ,OACA,WAAyB,CAAC,GACa;CACvC,MAAM,UAAU,WACZ,sBAAsB,MAAK,GAAI,OAAM;CACzC,MAAM,SAAS,WAAW,KAAK;CAC/B,IAAI,WAAW,MAAM;EACjB,MAAM,SAAqB;GACvB,MAAM;GACN,QAAQ,OAAO,eAAe,QAAQ,GAAG;GACzC,QAAQ,OAAO,EAAE;GACjB,SAAS;GACT,OAAO;GACP,YAAY,sBAAsB,MAAK;GACvC,WAAW;EACf;EACA,OAAO;GAAE,OAAO;GAAQ,MAAM;IAAE,GAAG;IAAQ,QAAQ,OAAO,eAAe,OAAO,GAAG;GAAE;EAAE;CAC3F;CACA,MAAM,YAAY,kBAAkB,MAAM;CAC1C,MAAM,SAAS,UAAU,QAAQ;EAAE,GAAG;EAAG,GAAG;EAAG,GAAG;CAAE,GAAG,GAAI;CAC3D,MAAM,QACF,cAAc,WAAW,MAAM,KAAK,cAAc,WAAW,MAAM,IAC7D,SACA,UAAU,QAAQ,OAAO,GAAI;CAEvC,MAAM,SAAS;EACX,OAFU,MAAM,MAEhB;EACA,YAAY,MAAM,KAAK;EACvB,WAAW,MAAM,SAAS;CAC9B;CAEA,MAAM,YAAY,WACd,MACI,eACI,QACA,UAAU,SAAS,WAAW,SAAS,SAAS,QAAQ,eAAe,OAAO,GAC9E,kBACJ,CACJ;CACJ,MAAM,QAAQ,SAAS,OAAO;CAC9B,MAAM,OAAO,SAAS,MAAM;CAC5B,OAAO;EACH,OAAO;GACH,GAAG;GACH,MAAM;GACN,SAAS;GACT,QAAQ,OAAO,eAAe,QAAQ,GAAG;GACzC,QAAQ,OAAO,EAAE;EACrB;EACA,MAAM;GACF,GAAG;GACH,MAAM;GACN,SAAS;GACT,QAAQ,OAAO,eAAe,OAAO,GAAG;GACxC,QAAQ,OAAO,EAAE;EACrB;CACJ;AACJ;;AAGA,SAAgB,YACZ,OACA,WAAyB,CAAC,GACa;CACvC,IAAI,OAAO,UAAU,UACjB,OAAO,WAAW,OAAO,QAAQ;CAErC,MAAM,EAAE,MAAM,GAAG,UAAU;CAC3B,OAAO;EAAE;EAAO,MAAM;GAAE,GAAG;GAAO,GAAG;EAAK;CAAE;AAChD"}
1
+ {"version":3,"file":"tones.js","names":["Rgb","WHITE","contrastRatio","ensureContrast","mixColors","parseColor","readableTextColor","toHex","PanneauTones","neutral","accent","success","warning","danger","info","muted","Tone","BUILT_IN_TONES","const","ToneValues","text","subtle","border","outline","solid","solidHover","solidText","ToneInput","dark","Partial","TONE_VARIABLES","Readonly","Record","toneClassName","tone","SURFACES","light","r","g","b","ToneSurfaces","SUBTLE_AMOUNTS","MIN_CONTRAST_RATIO","deriveTone","color","surfaces","amount","parsed","values","darker","hover","shared","readable","scheme","resolveTone","input"],"sources":["../../src/theme/tones.ts"],"sourcesContent":["import {\n type Rgb,\n WHITE,\n contrastRatio,\n ensureContrast,\n mixColors,\n parseColor,\n readableTextColor,\n toHex,\n} from './color';\n\n/**\n * The tones that components accept (`tone=\"success\"`), like Bootstrap's `$theme-colors`. A theme\n * adds its own; declare them here so that `tone=\"signal\"` type-checks:\n *\n * ```ts\n * declare module '@panneau/ui' {\n * interface PanneauTones {\n * signal: true;\n * }\n * }\n * ```\n */\nexport interface PanneauTones {\n neutral: true;\n accent: true;\n success: true;\n warning: true;\n danger: true;\n info: true;\n muted: true;\n}\n\n/** A tone name: a built-in tone, or one declared in `PanneauTones`. */\nexport type Tone = keyof PanneauTones & string;\n\n/**\n * The tones Panneau defines, from the semantic tokens of the theme. What each one means for a state\n * is written once, in the protocol's docs (\"Tones\"):\n *\n * - `neutral`: not started, waiting, a category (Draft, Pending);\n * - `info`: in progress or coming (In progress, Scheduled);\n * - `success`: done, live, in good shape (Published, Paid);\n * - `warning`: needs attention soon (Expires soon, Low stock);\n * - `danger`: a problem to fix now (Failed, Overdue);\n * - `muted`: over, no longer active (Archived, Cancelled);\n * - `accent`: never a state, the main action of a screen.\n */\nexport const BUILT_IN_TONES = [\n 'neutral',\n 'accent',\n 'success',\n 'warning',\n 'danger',\n 'info',\n 'muted',\n] as const;\n\n/** The colors of a tone, as CSS values. */\nexport type ToneValues = {\n /** Text and icons on surfaces: the outline, subtle and ghost appearances. */\n text: string;\n /** Background of the subtle appearance. */\n subtle: string;\n /** Border of the subtle appearance. */\n border: string;\n /** Border of the outline appearance. */\n outline: string;\n /** Background of the solid appearance. */\n solid: string;\n /** Background of the solid appearance on hover and press. */\n solidHover: string;\n /** Text on the solid appearance. */\n solidText: string;\n};\n\n/**\n * A tone of a theme: one color, from which Panneau derives the others (`'#f25c05'`), or every\n * value, with optional overrides for the dark scheme.\n */\nexport type ToneInput = string | (ToneValues & { dark?: Partial<ToneValues> });\n\n/** The local CSS variables of a tone, which components read. */\nexport const TONE_VARIABLES: Readonly<Record<keyof ToneValues, string>> = {\n text: 'panneau-tone-text',\n subtle: 'panneau-tone-subtle',\n border: 'panneau-tone-border',\n outline: 'panneau-tone-outline',\n solid: 'panneau-tone-solid',\n solidHover: 'panneau-tone-solid-hover',\n solidText: 'panneau-tone-solid-text',\n};\n\n/** The class that applies a tone: `panneau-tone-<tone>`. */\nexport function toneClassName(tone: string): string {\n return `panneau-tone-${tone}`;\n}\n\n/** Surfaces text must be readable on, in each scheme of the default theme. */\nconst SURFACES: Record<'light' | 'dark', Rgb> = { light: WHITE, dark: { r: 24, g: 24, b: 27 } };\n\n/** The surfaces of a theme, in each scheme, when it sets ones Panneau can read. */\nexport type ToneSurfaces = Partial<Record<'light' | 'dark', Rgb>>;\n\n/** How much of the tone's color the subtle background mixes into the surface, per scheme. */\nexport const SUBTLE_AMOUNTS = { light: 0.12, dark: 0.22 };\n\n/** Text must reach this contrast ratio (WCAG AA for normal text). */\nexport const MIN_CONTRAST_RATIO = 4.5;\n\n/**\n * The values of a tone, in both schemes, from one color: Panneau's `button-variant()` and\n * `color-contrast()`.\n *\n * - The solid background is the color, with white or black text, whichever reads better, and a\n * hover 15% darker (or lighter, when the text is black and darker would hurt it).\n * - The text color is the color, darkened (light scheme) or lightened (dark scheme) until it\n * reaches 4.5:1 against the subtle background, which is tinted, and so against the surface too.\n * - The subtle background and the border are mixed with the surface in CSS, so they follow the\n * surface of any theme.\n *\n * A color Panneau can't read (a CSS variable, a named color) is used as is, with `color-mix()` for\n * the hover and white text: `checkTheme()` reports it as unchecked.\n *\n * Text is made readable on the surfaces of the default theme, or on those given, which themes pass\n * so that a tone stays readable on their own surfaces.\n */\nexport function deriveTone(\n color: string,\n surfaces: ToneSurfaces = {},\n): { light: ToneValues; dark: ToneValues } {\n const subtle = (amount: number) =>\n `color-mix(in srgb, ${color} ${amount}%, var(--panneau-color-surface))`;\n const parsed = parseColor(color);\n if (parsed === null) {\n const values: ToneValues = {\n text: color,\n subtle: subtle(SUBTLE_AMOUNTS.light * 100),\n border: subtle(45),\n outline: color,\n solid: color,\n solidHover: `color-mix(in srgb, ${color}, #000 15%)`,\n solidText: '#fff',\n };\n return { light: values, dark: { ...values, subtle: subtle(SUBTLE_AMOUNTS.dark * 100) } };\n }\n const solidText = readableTextColor(parsed);\n const darker = mixColors(parsed, { r: 0, g: 0, b: 0 }, 0.15);\n const hover =\n contrastRatio(solidText, darker) >= contrastRatio(solidText, parsed)\n ? darker\n : mixColors(parsed, WHITE, 0.15);\n const solid = toHex(parsed);\n const shared = {\n solid,\n solidHover: toHex(hover),\n solidText: toHex(solidText),\n };\n // Readable on the subtle background, which is closer to the text color than the surface.\n const readable = (scheme: 'light' | 'dark') =>\n toHex(\n ensureContrast(\n parsed,\n mixColors(surfaces[scheme] ?? SURFACES[scheme], parsed, SUBTLE_AMOUNTS[scheme]),\n MIN_CONTRAST_RATIO,\n ),\n );\n const light = readable('light');\n const dark = readable('dark');\n return {\n light: {\n ...shared,\n text: light,\n outline: light,\n subtle: subtle(SUBTLE_AMOUNTS.light * 100),\n border: subtle(45),\n },\n dark: {\n ...shared,\n text: dark,\n outline: dark,\n subtle: subtle(SUBTLE_AMOUNTS.dark * 100),\n border: subtle(55),\n },\n };\n}\n\n/** The values of a tone input, in both schemes, derived on the given surfaces if it is one color. */\nexport function resolveTone(\n input: ToneInput,\n surfaces: ToneSurfaces = {},\n): { light: ToneValues; dark: ToneValues } {\n if (typeof input === 'string') {\n return deriveTone(input, surfaces);\n }\n const { dark, ...light } = input;\n return { light, dark: { ...light, ...dark } };\n}\n"],"mappings":";;;;;;;;;;;;;;AAgDA,IAAaiB,iBAAiB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;AAAO;;AA4BX,IAAaa,iBAA6D;CACtEV,MAAM;CACNC,QAAQ;CACRC,QAAQ;CACRC,SAAS;CACTC,OAAO;CACPC,YAAY;CACZC,WAAW;AACf;;AAGA,SAAgBO,cAAcC,MAAsB;CAChD,OAAO,gBAAgBA;AAC3B;;AAGA,IAAMC,WAA0C;CAAEC,OAAOnC;CAAO2B,MAAM;EAAES,GAAG;EAAIC,GAAG;EAAIC,GAAG;CAAG;AAAE;;AAM9F,IAAaE,iBAAiB;CAAEL,OAAO;CAAMR,MAAM;AAAK;;AAGxD,IAAac,qBAAqB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;GACH/B,MAAMQ;GACNL,SAASK;GACTP,QAAQA,OAAOoB,eAAeb,OAAO,GAAG;GACxCN,QAAQD,OAAO,EAAE;EACrB;CACJ;AACJ;;AAGA,SAAgBiC,YACZC,OACAV,WAAyB,CAAC,GACa;CACvC,IAAI,OAAOU,UAAU,UACjB,OAAOZ,WAAWY,OAAOV,QAAQ;CAErC,MAAM,EAAEjB,MAAM,GAAGQ,UAAUmB;CAC3B,OAAO;EAAEnB;EAAOR,MAAM;GAAE,GAAGQ;GAAO,GAAGR;EAAK;CAAE;AAChD"}
@@ -1,5 +1,5 @@
1
1
  import { type TimeFieldProps, type TimeValue } from 'react-aria-components';
2
- import { type FieldChromeProps } from '../field/FieldParts';
2
+ import { type FieldChromeProps } from '../field/FieldParts.js';
3
3
  export interface TimeInputProps extends Omit<TimeFieldProps<TimeValue>, 'className' | 'style' | 'children' | 'isInvalid' | 'validate'>, FieldChromeProps {
4
4
  controlClassName?: string;
5
5
  }
@@ -2,41 +2,148 @@ import { cx } from "../utils/cx.js";
2
2
  import Field_module_default from "../field/Field.module.js";
3
3
  import { FieldDescription, FieldErrors, FieldLabel } from "../field/FieldParts.js";
4
4
  import DatePicker_module_default from "../date-picker/DatePicker.module.js";
5
+ import { c } from "react/compiler-runtime";
5
6
  import { DateInput, DateSegment, TimeField } from "react-aria-components";
6
7
  import { jsx, jsxs } from "react/jsx-runtime";
7
8
  //#region src/time-input/TimeInput.tsx
8
9
  /** A time of day, typed segment by segment in the format of the locale. */
9
- function TimeInput({ label, description, errors = [], isRequired, isReadOnly, className, labelClassName, descriptionClassName, errorsClassName, controlClassName, ...props }) {
10
- return /* @__PURE__ */ jsxs(TimeField, {
11
- ...props,
12
- isRequired,
13
- isReadOnly,
14
- isInvalid: errors.length > 0,
15
- validationBehavior: "aria",
16
- className: cx("panneau-time-input", Field_module_default.field, className),
17
- children: [
18
- /* @__PURE__ */ jsx(FieldLabel, {
19
- isRequired,
20
- className: labelClassName,
21
- children: label
22
- }),
23
- /* @__PURE__ */ jsx(DateInput, {
24
- className: cx(Field_module_default.control, DatePicker_module_default.input, controlClassName),
25
- "data-readonly": isReadOnly || void 0,
26
- children: (segment) => /* @__PURE__ */ jsx(DateSegment, {
27
- segment,
28
- className: DatePicker_module_default.segment
29
- })
30
- }),
31
- /* @__PURE__ */ jsx(FieldDescription, {
32
- className: descriptionClassName,
33
- children: description
34
- }),
35
- /* @__PURE__ */ jsx(FieldErrors, {
36
- errors,
37
- className: errorsClassName
38
- })
39
- ]
10
+ function TimeInput(t0) {
11
+ const $ = c(41);
12
+ let className;
13
+ let controlClassName;
14
+ let description;
15
+ let descriptionClassName;
16
+ let errorsClassName;
17
+ let isReadOnly;
18
+ let isRequired;
19
+ let label;
20
+ let labelClassName;
21
+ let props;
22
+ let t1;
23
+ if ($[0] !== t0) {
24
+ ({label, description, errors: t1, isRequired, isReadOnly, className, labelClassName, descriptionClassName, errorsClassName, controlClassName, ...props} = t0);
25
+ $[0] = t0;
26
+ $[1] = className;
27
+ $[2] = controlClassName;
28
+ $[3] = description;
29
+ $[4] = descriptionClassName;
30
+ $[5] = errorsClassName;
31
+ $[6] = isReadOnly;
32
+ $[7] = isRequired;
33
+ $[8] = label;
34
+ $[9] = labelClassName;
35
+ $[10] = props;
36
+ $[11] = t1;
37
+ } else {
38
+ className = $[1];
39
+ controlClassName = $[2];
40
+ description = $[3];
41
+ descriptionClassName = $[4];
42
+ errorsClassName = $[5];
43
+ isReadOnly = $[6];
44
+ isRequired = $[7];
45
+ label = $[8];
46
+ labelClassName = $[9];
47
+ props = $[10];
48
+ t1 = $[11];
49
+ }
50
+ let t2;
51
+ if ($[12] !== t1) {
52
+ t2 = t1 === void 0 ? [] : t1;
53
+ $[12] = t1;
54
+ $[13] = t2;
55
+ } else t2 = $[13];
56
+ const errors = t2;
57
+ const t3 = errors.length > 0;
58
+ let t4;
59
+ if ($[14] !== className) {
60
+ t4 = cx("panneau-time-input", Field_module_default.field, className);
61
+ $[14] = className;
62
+ $[15] = t4;
63
+ } else t4 = $[15];
64
+ let t5;
65
+ if ($[16] !== isRequired || $[17] !== label || $[18] !== labelClassName) {
66
+ t5 = /* @__PURE__ */ jsx(FieldLabel, {
67
+ isRequired,
68
+ className: labelClassName,
69
+ children: label
70
+ });
71
+ $[16] = isRequired;
72
+ $[17] = label;
73
+ $[18] = labelClassName;
74
+ $[19] = t5;
75
+ } else t5 = $[19];
76
+ let t6;
77
+ if ($[20] !== controlClassName) {
78
+ t6 = cx(Field_module_default.control, DatePicker_module_default.input, controlClassName);
79
+ $[20] = controlClassName;
80
+ $[21] = t6;
81
+ } else t6 = $[21];
82
+ const t7 = isReadOnly || void 0;
83
+ let t8;
84
+ if ($[22] !== t6 || $[23] !== t7) {
85
+ t8 = /* @__PURE__ */ jsx(DateInput, {
86
+ className: t6,
87
+ "data-readonly": t7,
88
+ children: _temp
89
+ });
90
+ $[22] = t6;
91
+ $[23] = t7;
92
+ $[24] = t8;
93
+ } else t8 = $[24];
94
+ let t9;
95
+ if ($[25] !== description || $[26] !== descriptionClassName) {
96
+ t9 = /* @__PURE__ */ jsx(FieldDescription, {
97
+ className: descriptionClassName,
98
+ children: description
99
+ });
100
+ $[25] = description;
101
+ $[26] = descriptionClassName;
102
+ $[27] = t9;
103
+ } else t9 = $[27];
104
+ let t10;
105
+ if ($[28] !== errors || $[29] !== errorsClassName) {
106
+ t10 = /* @__PURE__ */ jsx(FieldErrors, {
107
+ errors,
108
+ className: errorsClassName
109
+ });
110
+ $[28] = errors;
111
+ $[29] = errorsClassName;
112
+ $[30] = t10;
113
+ } else t10 = $[30];
114
+ let t11;
115
+ if ($[31] !== isReadOnly || $[32] !== isRequired || $[33] !== props || $[34] !== t10 || $[35] !== t3 || $[36] !== t4 || $[37] !== t5 || $[38] !== t8 || $[39] !== t9) {
116
+ t11 = /* @__PURE__ */ jsxs(TimeField, {
117
+ ...props,
118
+ isRequired,
119
+ isReadOnly,
120
+ isInvalid: t3,
121
+ validationBehavior: "aria",
122
+ className: t4,
123
+ children: [
124
+ t5,
125
+ t8,
126
+ t9,
127
+ t10
128
+ ]
129
+ });
130
+ $[31] = isReadOnly;
131
+ $[32] = isRequired;
132
+ $[33] = props;
133
+ $[34] = t10;
134
+ $[35] = t3;
135
+ $[36] = t4;
136
+ $[37] = t5;
137
+ $[38] = t8;
138
+ $[39] = t9;
139
+ $[40] = t11;
140
+ } else t11 = $[40];
141
+ return t11;
142
+ }
143
+ function _temp(segment) {
144
+ return /* @__PURE__ */ jsx(DateSegment, {
145
+ segment,
146
+ className: DatePicker_module_default.segment
40
147
  });
41
148
  }
42
149
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"TimeInput.js","names":["fieldStyles","datePickerStyles"],"sources":["../../src/time-input/TimeInput.tsx"],"sourcesContent":["import {\n DateInput,\n DateSegment,\n TimeField,\n type TimeFieldProps,\n type TimeValue,\n} from 'react-aria-components';\n\nimport datePickerStyles from '../date-picker/DatePicker.module.css';\nimport {\n type FieldChromeProps,\n FieldDescription,\n FieldErrors,\n FieldLabel,\n fieldStyles,\n} from '../field/FieldParts';\nimport { cx } from '../utils/cx';\n\nexport interface TimeInputProps\n extends\n Omit<\n TimeFieldProps<TimeValue>,\n 'className' | 'style' | 'children' | 'isInvalid' | 'validate'\n >,\n FieldChromeProps {\n controlClassName?: string;\n}\n\n/** A time of day, typed segment by segment in the format of the locale. */\nexport function TimeInput({\n label,\n description,\n errors = [],\n isRequired,\n isReadOnly,\n className,\n labelClassName,\n descriptionClassName,\n errorsClassName,\n controlClassName,\n ...props\n}: TimeInputProps) {\n return (\n <TimeField\n {...props}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n isInvalid={errors.length > 0}\n validationBehavior=\"aria\"\n className={cx('panneau-time-input', fieldStyles.field, className)}\n >\n <FieldLabel isRequired={isRequired} className={labelClassName}>\n {label}\n </FieldLabel>\n <DateInput\n className={cx(fieldStyles.control, datePickerStyles.input, controlClassName)}\n data-readonly={isReadOnly || undefined}\n >\n {(segment) => (\n <DateSegment segment={segment} className={datePickerStyles.segment} />\n )}\n </DateInput>\n <FieldDescription className={descriptionClassName}>{description}</FieldDescription>\n <FieldErrors errors={errors} className={errorsClassName} />\n </TimeField>\n );\n}\n"],"mappings":";;;;;;;;AA6BA,SAAgB,UAAU,EACtB,OACA,aACA,SAAS,CAAA,GACT,YACA,YACA,WACA,gBACA,sBACA,iBACA,kBACA,GAAG,SACY;CACf,OACI,qBAAC,WAAD;EACI,GAAI;EACQ;EACA;EACZ,WAAW,OAAO,SAAS;EAC3B,oBAAmB;EACnB,WAAW,GAAG,sBAAsBA,qBAAY,OAAO,SAAS;EANpE,UAAA;GAQI,oBAAC,YAAD;IAAwB;IAAY,WAAW;IAC1C,UAAA;GACO,CAAA;GACZ,oBAAC,WAAD;IACI,WAAW,GAAGA,qBAAY,SAASC,0BAAiB,OAAO,gBAAgB;IAC3E,iBAAe,cAAc,KAAA;IAE3B,WAAA,YACE,oBAAC,aAAD;KAAsB;KAAS,WAAWA,0BAAiB;IAAQ,CAAA;GAEhE,CAAA;GACX,oBAAC,kBAAD;IAAkB,WAAW;IAAuB,UAAA;GAA8B,CAAA;GAClF,oBAAC,aAAD;IAAqB;IAAQ,WAAW;GAAgB,CAAA;EACjD;;AAEnB"}
1
+ {"version":3,"file":"TimeInput.js","names":["DateInput","DateSegment","TimeField","TimeFieldProps","TimeValue","datePickerStyles","FieldChromeProps","FieldDescription","FieldErrors","FieldLabel","fieldStyles","cx","TimeInputProps","Omit","controlClassName","TimeInput","t0","$","_c","className","description","descriptionClassName","errorsClassName","isReadOnly","isRequired","label","labelClassName","props","t1","errors","t2","undefined","t3","length","t4","field","t5","t6","control","input","t7","t8","_temp","t9","t10","t11","segment","_c","fieldStyles","datePickerStyles"],"sources":["../../src/time-input/TimeInput.tsx"],"sourcesContent":["import {\n DateInput,\n DateSegment,\n TimeField,\n type TimeFieldProps,\n type TimeValue,\n} from 'react-aria-components';\n\nimport datePickerStyles from '../date-picker/DatePicker.module.css';\nimport {\n type FieldChromeProps,\n FieldDescription,\n FieldErrors,\n FieldLabel,\n fieldStyles,\n} from '../field/FieldParts';\nimport { cx } from '../utils/cx';\n\nexport interface TimeInputProps\n extends\n Omit<\n TimeFieldProps<TimeValue>,\n 'className' | 'style' | 'children' | 'isInvalid' | 'validate'\n >,\n FieldChromeProps {\n controlClassName?: string;\n}\n\n/** A time of day, typed segment by segment in the format of the locale. */\nexport function TimeInput({\n label,\n description,\n errors = [],\n isRequired,\n isReadOnly,\n className,\n labelClassName,\n descriptionClassName,\n errorsClassName,\n controlClassName,\n ...props\n}: TimeInputProps) {\n return (\n <TimeField\n {...props}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n isInvalid={errors.length > 0}\n validationBehavior=\"aria\"\n className={cx('panneau-time-input', fieldStyles.field, className)}\n >\n <FieldLabel isRequired={isRequired} className={labelClassName}>\n {label}\n </FieldLabel>\n <DateInput\n className={cx(fieldStyles.control, datePickerStyles.input, controlClassName)}\n data-readonly={isReadOnly || undefined}\n >\n {(segment) => (\n <DateSegment segment={segment} className={datePickerStyles.segment} />\n )}\n </DateInput>\n <FieldDescription className={descriptionClassName}>{description}</FieldDescription>\n <FieldErrors errors={errors} className={errorsClassName} />\n </TimeField>\n );\n}\n"],"mappings":";;;;;;;;;AA6BA,SAAOe,UAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAL;CAAA,IAAAM;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAX,EAAA,OAAAD,IAAA;EAAmB,CAAA,CAAAS,OAAAL,aAAAS,QAAAD,IAAAJ,YAAAD,YAAAJ,WAAAO,gBAAAL,sBAAAC,iBAAAR,kBAAA,GAAAa,SAAAX;EAYTC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAH;EAAAG,EAAA,KAAAG;EAAAH,EAA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,MAAAe;EAAAf,EAAA,MAAAiB;EAAAjB,EAAA,MAAAmB;EAAAnB,EAAA,MAAAwB;EAAAxB,EAAA,MAAA0B;EAAA1B,EAAA,MAAA4B;CAAA,OAAAA,MAAA5B,EAAA;CAAA,OArBZ4B;AAqBY;AAnCb,SAAAH,MAAAI,SAAA;CAAA,OA8Ba,oBAAC,aAAD;EAAsBA;EAAoB,WAAAzC,0BAAgByC;CAAQ,CAAA;AAAI"}
@@ -1,44 +1,195 @@
1
- /* The region carries the root's class (tokens), since React Aria renders it in the body. */
1
+ /*
2
+ * The region carries the root's class (tokens), since React Aria renders it in the body. Toasts show
3
+ * at the bottom, centered, above what sticks to the bottom of the page (--panneau-bottom-offset,
4
+ * set by useToastOffset()), or at the bottom or top of the end side (data-placement). React Aria
5
+ * renders them newest first, each in a list item with `display: contents`.
6
+ */
2
7
  .panneau-toast-region.panneau-toast-region {
3
8
  position: fixed;
4
- inset-block-end: var(--panneau-space-4);
5
- inset-inline-end: var(--panneau-space-4);
9
+ inset-block-end: calc(var(--panneau-bottom-offset, 0px) + var(--panneau-space-4));
10
+ inset-inline: 0;
6
11
  z-index: var(--panneau-z-toast);
7
- display: flex;
8
- flex-direction: column-reverse;
9
- gap: var(--panneau-space-2);
12
+ display: grid;
13
+ grid-template-columns: minmax(0, 1fr);
14
+ align-items: end;
10
15
  width: min(var(--panneau-toast-width, 24rem), calc(100vw - 2 * var(--panneau-space-4)));
16
+ margin-inline: auto;
11
17
  background: transparent;
12
18
  outline: none;
13
19
  }
14
20
 
21
+ .panneau-toast-region[data-placement='bottom-end'] {
22
+ inset-inline: auto var(--panneau-space-4);
23
+ margin-inline: 0;
24
+ }
25
+
26
+ .panneau-toast-region[data-placement='top-end'] {
27
+ inset-block: var(--panneau-space-4) auto;
28
+ inset-inline: auto var(--panneau-space-4);
29
+ align-items: start;
30
+ margin-inline: 0;
31
+ }
32
+
15
33
  .panneau-toast-region[data-focus-visible] {
16
34
  outline: var(--panneau-focus-width) solid var(--panneau-color-focus);
17
35
  outline-offset: 4px;
18
36
  }
19
37
 
38
+ /* On a phone, the whole width at the bottom (or the top). */
20
39
  @media (max-width: 30rem) {
21
- .panneau-toast-region.panneau-toast-region {
40
+ .panneau-toast-region.panneau-toast-region,
41
+ .panneau-toast-region.panneau-toast-region[data-placement] {
22
42
  inset-inline: var(--panneau-space-2);
23
- inset-block-end: var(--panneau-space-2);
24
43
  width: auto;
44
+ margin-inline: 0;
45
+ }
46
+
47
+ .panneau-toast-region.panneau-toast-region:not([data-placement='top-end']) {
48
+ inset-block: auto calc(var(--panneau-bottom-offset, 0px) + var(--panneau-space-2));
25
49
  }
26
50
  }
27
51
 
28
52
  .panneau-toast {
53
+ --toast-rise: 1rem;
54
+
29
55
  display: flex;
56
+ grid-area: 1 / 1;
30
57
  align-items: flex-start;
58
+ position: relative;
31
59
  gap: var(--panneau-space-3);
32
- padding: var(--panneau-space-3) var(--panneau-space-3) var(--panneau-space-3)
60
+ /* The buttons have room of their own: the toast is as high as them, plus a small margin. */
61
+ padding: var(--panneau-space-2) var(--panneau-space-2) var(--panneau-space-2)
33
62
  var(--panneau-space-4);
63
+ /* The colored edge follows the rounded corners. */
64
+ overflow: hidden;
34
65
  color: var(--panneau-color-text);
35
66
  background-color: var(--panneau-toast-bg, var(--panneau-color-surface-raised));
36
67
  border: var(--panneau-border-width) solid
37
68
  var(--panneau-toast-border-color, var(--panneau-color-border));
38
- border-inline-start-width: var(--panneau-toast-tone-width, 4px);
39
69
  border-radius: var(--panneau-toast-radius, var(--panneau-radius-lg));
40
70
  box-shadow: var(--panneau-toast-shadow, var(--panneau-shadow-lg));
41
71
  outline: none;
72
+ transition:
73
+ transform var(--panneau-duration) var(--panneau-ease-out),
74
+ opacity var(--panneau-duration) var(--panneau-ease-out);
75
+ animation: panneau-toast-rise calc(2 * var(--panneau-duration)) var(--panneau-ease-out);
76
+ }
77
+
78
+ .panneau-toast-region[data-placement='top-end'] .panneau-toast {
79
+ --toast-rise: -1rem;
80
+ }
81
+
82
+ @keyframes panneau-toast-rise {
83
+ from {
84
+ opacity: 0;
85
+ transform: translateY(var(--toast-rise));
86
+ }
87
+ }
88
+
89
+ /*
90
+ * Folded: the newest in front, the older ones behind it, peeking out a little. Hovered or focused,
91
+ * the region unfolds them in a column, the newest closest to the edge of the screen.
92
+ */
93
+ .panneau-toast-region li:nth-child(1) > .panneau-toast {
94
+ z-index: 3;
95
+ }
96
+
97
+ .panneau-toast-region li:nth-child(2) > .panneau-toast {
98
+ z-index: 2;
99
+ transform: translateY(calc(-1 * var(--panneau-space-2))) scale(0.95);
100
+ }
101
+
102
+ .panneau-toast-region li:nth-child(3) > .panneau-toast {
103
+ z-index: 1;
104
+ transform: translateY(calc(-2 * var(--panneau-space-2))) scale(0.9);
105
+ }
106
+
107
+ .panneau-toast-region[data-placement='top-end'] li:nth-child(2) > .panneau-toast {
108
+ transform: translateY(var(--panneau-space-2)) scale(0.95);
109
+ }
110
+
111
+ .panneau-toast-region[data-placement='top-end'] li:nth-child(3) > .panneau-toast {
112
+ transform: translateY(calc(2 * var(--panneau-space-2))) scale(0.9);
113
+ }
114
+
115
+ .panneau-toast-region li:nth-child(n + 2) > .panneau-toast > * {
116
+ opacity: 0;
117
+ transition: opacity var(--panneau-duration) var(--panneau-ease-out);
118
+ }
119
+
120
+ .panneau-toast-region:is(:hover, :focus-within, [data-hovered], [data-focused]) {
121
+ gap: var(--panneau-space-2);
122
+ }
123
+
124
+ .panneau-toast-region:is(:hover, :focus-within, [data-hovered], [data-focused]) li > .panneau-toast {
125
+ transform: none;
126
+ }
127
+
128
+ .panneau-toast-region:is(:hover, :focus-within, [data-hovered], [data-focused]) li > .panneau-toast > * {
129
+ opacity: 1;
130
+ }
131
+
132
+ .panneau-toast-region:not([data-placement='top-end']):is(:hover, :focus-within, [data-hovered], [data-focused])
133
+ li:nth-child(1)
134
+ > .panneau-toast {
135
+ grid-area: 3 / 1;
136
+ }
137
+
138
+ .panneau-toast-region:not([data-placement='top-end']):is(:hover, :focus-within, [data-hovered], [data-focused])
139
+ li:nth-child(2)
140
+ > .panneau-toast {
141
+ grid-area: 2 / 1;
142
+ }
143
+
144
+ .panneau-toast-region:not([data-placement='top-end']):is(:hover, :focus-within, [data-hovered], [data-focused])
145
+ li:nth-child(3)
146
+ > .panneau-toast {
147
+ grid-area: 1 / 1;
148
+ }
149
+
150
+ .panneau-toast-region[data-placement='top-end']:is(:hover, :focus-within, [data-hovered], [data-focused])
151
+ li
152
+ > .panneau-toast {
153
+ grid-area: auto;
154
+ }
155
+
156
+ /*
157
+ * In the view transition of a change of the toasts (wrapToastUpdate()): a toast that closes fades
158
+ * out and drops a little, the others move into their place. One that opens keeps its own rise.
159
+ * Only the toasts are captured: the page itself isn't, so it doesn't cross-fade. The durations are written here,
160
+ * since these pseudo-elements live on the document, outside the root and its tokens.
161
+ */
162
+ html:active-view-transition-type(panneau-toast) {
163
+ view-transition-name: none;
164
+ }
165
+
166
+ html:active-view-transition-type(panneau-toast)::view-transition-group(*) {
167
+ animation-duration: 200ms;
168
+ animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
169
+ }
170
+
171
+ html:active-view-transition-type(panneau-toast)::view-transition-new(*):only-child {
172
+ animation: none;
173
+ }
174
+
175
+ html:active-view-transition-type(panneau-toast)::view-transition-old(*):only-child {
176
+ animation: panneau-toast-toast-leave 150ms cubic-bezier(0.55, 0, 1, 0.45) forwards;
177
+ }
178
+
179
+ @keyframes panneau-toast-toast-leave {
180
+ to {
181
+ opacity: 0;
182
+ transform: translateY(0.5rem) scale(0.96);
183
+ }
184
+ }
185
+
186
+ /* Without motion when the system asks for less. */
187
+ @media (prefers-reduced-motion: reduce) {
188
+ .panneau-toast,
189
+ .panneau-toast-region li > .panneau-toast > * {
190
+ transition: none;
191
+ animation: none;
192
+ }
42
193
  }
43
194
 
44
195
  .panneau-toast[data-focus-visible] {
@@ -46,17 +197,27 @@
46
197
  outline-offset: 2px;
47
198
  }
48
199
 
200
+ /*
201
+ * The icon, the first line of the text and the buttons share one axis: the icon and the text each
202
+ * take the height of a small button, centered in it. A longer text wraps below that first line.
203
+ */
49
204
  .panneau-toast-icon {
50
- margin-top: 0.125rem;
51
- }
52
-
53
- /* A toast with a tone other than neutral: a colored edge and icon, from its tone class. */
54
- .panneau-toast-toned {
55
- border-inline-start-color: var(--panneau-tone-text);
205
+ display: flex;
206
+ flex: 0 0 auto;
207
+ align-items: center;
208
+ height: var(--panneau-control-height-sm);
209
+ /* A success or an info keeps the neutral look, with its icon in the color of its tone. */
210
+ color: var(--panneau-tone-text);
56
211
  }
57
212
 
58
- .panneau-toast-toned .panneau-toast-icon {
59
- color: var(--panneau-tone-text);
213
+ /* Only what needs a look, a warning or an error, colors its edge: a straight band at the start. */
214
+ .panneau-toast-edge::before {
215
+ position: absolute;
216
+ inset-block: 0;
217
+ inset-inline-start: 0;
218
+ width: var(--panneau-toast-tone-width, 4px);
219
+ content: '';
220
+ background-color: var(--panneau-tone-text);
60
221
  }
61
222
 
62
223
  .panneau-toast-content {
@@ -65,7 +226,7 @@
65
226
  flex-direction: column;
66
227
  gap: var(--panneau-space-1);
67
228
  min-width: 0;
68
- padding-top: 0.125rem;
229
+ padding-block: calc((var(--panneau-control-height-sm) - 1lh) / 2);
69
230
  }
70
231
 
71
232
  .panneau-toast-title {
@@ -1,14 +1,23 @@
1
- import { type ReactNode } from 'react';
2
- import type { Tone } from '../theme/tones';
1
+ import { type ReactNode, type RefObject } from 'react';
2
+ import type { Tone } from '../theme/tones.js';
3
3
  /** @deprecated Use `Tone`. */
4
4
  export type ToastTone = Tone;
5
- /** What a toast says. */
5
+ /**
6
+ * What a toast says: what was done to what ("“Spring contest” saved", "3 entries archived"), and
7
+ * the next step when there is one.
8
+ */
6
9
  export interface ToastContent {
7
10
  title: string;
8
11
  description?: string;
9
- /** Defaults to `neutral`. Any tone other than neutral colors the edge and the icon. */
12
+ /**
13
+ * Defaults to `neutral`. A success keeps the neutral look with its icon; only `warning` and
14
+ * `danger` color the edge.
15
+ */
10
16
  tone?: Tone;
11
- /** A button in the toast, such as "Retry" or "Undo". The toast closes when it is pressed. */
17
+ /**
18
+ * A button in the toast that leads to the result ("Open", "Show", "Download") or undoes what was
19
+ * done ("Undo"). The toast closes when it is pressed.
20
+ */
12
21
  action?: {
13
22
  label: string;
14
23
  onAction: () => void;
@@ -16,26 +25,68 @@ export interface ToastContent {
16
25
  }
17
26
  export interface ToastOptions {
18
27
  /**
19
- * Milliseconds before the toast closes by itself. Defaults to 5000, and to no timeout for
20
- * toasts with an action, which users must have time to reach.
28
+ * A toast with the key of one already shown replaces it instead of adding another: "Saved"
29
+ * once, however many saves. `show()` returns it.
30
+ */
31
+ key?: string;
32
+ /**
33
+ * Milliseconds before the toast closes by itself, or `null` to keep it until it is closed.
34
+ * Defaults to what the toast holds (`getToastTimeout()`): about 5 seconds, longer for a longer
35
+ * text, about 10 seconds with an action, and none for an error.
21
36
  */
22
37
  timeout?: number | null;
23
38
  onClose?: () => void;
24
39
  }
25
40
  export interface Toasts {
26
- /** Shows a toast. Returns its key. */
41
+ /** Shows a toast. Returns its key: the one given in its options, or a new one. */
27
42
  show(content: ToastContent, options?: ToastOptions): string;
28
43
  /** Closes a toast by key. */
29
44
  close(key: string): void;
30
45
  }
46
+ /** Where toasts show: `bottom` (centered, the default), `bottom-end` or `top-end`. */
47
+ export type ToastPlacement = 'bottom' | 'bottom-end' | 'top-end';
48
+ /** At most this many toasts show at once: older ones wait for a place. */
49
+ export declare const MAX_VISIBLE_TOASTS = 3;
50
+ /**
51
+ * How long a toast stays, from what it holds: about 5 seconds, longer for a longer text; about 10
52
+ * seconds with an action, which must be reached in that time (an action to reach later belongs in
53
+ * the page, not in a toast that stays); and `null`, no timeout, for an error the user must read.
54
+ */
55
+ export declare function getToastTimeout(content: ToastContent): number | null;
31
56
  /** Shows toasts in the closest `PanneauRoot`. */
32
57
  export declare function useToast(): Toasts;
58
+ /**
59
+ * How far the toasts rise above an element: from its top to the bottom of the viewport, when it
60
+ * covers the bottom of the viewport, as a sticky footer does once the page scrolls. `0` when it
61
+ * shows higher, as the footer of a short form does, after its last field: toasts then stay at the
62
+ * bottom, rather than floating where nothing is.
63
+ */
64
+ export declare function getToastOffset(rect: Pick<DOMRect, 'top' | 'bottom' | 'height'>, viewport: number): number;
65
+ /**
66
+ * Raises the toasts above an element that sticks to the bottom of the page, such as the footer of
67
+ * a form, while it is mounted and `active` and it covers the bottom of the viewport: the space it
68
+ * takes there becomes the `--panneau-bottom-offset` of the region. Measured again when the page
69
+ * scrolls or resizes. Toasts at the top ignore it.
70
+ */
71
+ export declare function useToastOffset(ref: RefObject<HTMLElement | null>, active?: boolean): void;
72
+ /**
73
+ * Runs a change of the toasts in a view transition, where the browser has them: a toast that closes
74
+ * fades out, and the others slide into its place (decision 0081). At once without them, or when the
75
+ * system asks for less motion.
76
+ */
77
+ export declare function wrapToastUpdate(update: () => void): void;
33
78
  export interface ToastProviderProps {
34
79
  children?: ReactNode;
80
+ /** Where the toasts show. Defaults to `bottom`. */
81
+ placement?: ToastPlacement;
35
82
  /** Class names that give the region its tokens, since it renders in the body. */
36
83
  regionClassName?: string;
37
84
  regionProps?: Record<`data-${string}`, string | undefined>;
38
85
  }
39
- /** Holds the toasts of a `PanneauRoot` and renders them in an accessible region. */
40
- export declare function ToastProvider({ children, regionClassName, regionProps }: ToastProviderProps): import("react").JSX.Element;
86
+ /**
87
+ * Holds the toasts of a `PanneauRoot` and renders them in an accessible region (decision 0062): at
88
+ * the bottom by default, one per key, at most three, the older ones folded behind the newest until
89
+ * the region is hovered or focused, where their timers pause.
90
+ */
91
+ export declare function ToastProvider({ children, placement, regionClassName, regionProps, }: ToastProviderProps): import("react").JSX.Element;
41
92
  //# sourceMappingURL=Toast.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/toast/Toast.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAgC,MAAM,OAAO,CAAC;AAerE,OAAO,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