@mortenbrudvik/waveui 0.4.0 → 0.7.0

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 (574) hide show
  1. package/README.md +1221 -173
  2. package/dist/_virtual/_rolldown/runtime.cjs +1 -0
  3. package/dist/components/button/Button.cjs +2 -0
  4. package/dist/components/button/Button.cjs.map +1 -0
  5. package/dist/components/button/Button.mjs +50 -0
  6. package/dist/components/button/Button.mjs.map +1 -0
  7. package/dist/components/button/Button.semantics.cjs +2 -0
  8. package/dist/components/button/Button.semantics.cjs.map +1 -0
  9. package/dist/components/button/Button.semantics.mjs +61 -0
  10. package/dist/components/button/Button.semantics.mjs.map +1 -0
  11. package/dist/components/button/Button.slots.cjs +2 -0
  12. package/dist/components/button/Button.slots.cjs.map +1 -0
  13. package/dist/components/button/Button.slots.mjs +47 -0
  14. package/dist/components/button/Button.slots.mjs.map +1 -0
  15. package/dist/components/button/CompoundButton.cjs +2 -0
  16. package/dist/components/button/CompoundButton.cjs.map +1 -0
  17. package/dist/components/button/CompoundButton.mjs +53 -0
  18. package/dist/components/button/CompoundButton.mjs.map +1 -0
  19. package/dist/components/button/Link.cjs +2 -0
  20. package/dist/components/button/Link.cjs.map +1 -0
  21. package/dist/components/button/Link.mjs +37 -0
  22. package/dist/components/button/Link.mjs.map +1 -0
  23. package/dist/components/button/MenuButton.cjs +2 -0
  24. package/dist/components/button/MenuButton.cjs.map +1 -0
  25. package/dist/components/button/MenuButton.mjs +45 -0
  26. package/dist/components/button/MenuButton.mjs.map +1 -0
  27. package/dist/components/button/SplitButton.cjs +2 -0
  28. package/dist/components/button/SplitButton.cjs.map +1 -0
  29. package/dist/components/button/SplitButton.mjs +66 -0
  30. package/dist/components/button/SplitButton.mjs.map +1 -0
  31. package/dist/components/button/ToggleButton.cjs +2 -0
  32. package/dist/components/button/ToggleButton.cjs.map +1 -0
  33. package/dist/components/button/ToggleButton.mjs +65 -0
  34. package/dist/components/button/ToggleButton.mjs.map +1 -0
  35. package/dist/components/button/Toolbar.cjs +2 -0
  36. package/dist/components/button/Toolbar.cjs.map +1 -0
  37. package/dist/components/button/Toolbar.context.cjs +2 -0
  38. package/dist/components/button/Toolbar.context.cjs.map +1 -0
  39. package/dist/components/button/Toolbar.context.mjs +31 -0
  40. package/dist/components/button/Toolbar.context.mjs.map +1 -0
  41. package/dist/components/button/Toolbar.mjs +63 -0
  42. package/dist/components/button/Toolbar.mjs.map +1 -0
  43. package/dist/components/button/Toolbar.parts.cjs +2 -0
  44. package/dist/components/button/Toolbar.parts.cjs.map +1 -0
  45. package/dist/components/button/Toolbar.parts.mjs +131 -0
  46. package/dist/components/button/Toolbar.parts.mjs.map +1 -0
  47. package/dist/components/button/buttonStyles.cjs +2 -0
  48. package/dist/components/button/buttonStyles.cjs.map +1 -0
  49. package/dist/components/button/buttonStyles.mjs +39 -0
  50. package/dist/components/button/buttonStyles.mjs.map +1 -0
  51. package/dist/components/data-display/Avatar.cjs +2 -0
  52. package/dist/components/data-display/Avatar.cjs.map +1 -0
  53. package/dist/components/data-display/Avatar.mjs +157 -0
  54. package/dist/components/data-display/Avatar.mjs.map +1 -0
  55. package/dist/components/data-display/AvatarGroup.cjs +2 -0
  56. package/dist/components/data-display/AvatarGroup.cjs.map +1 -0
  57. package/dist/components/data-display/AvatarGroup.mjs +134 -0
  58. package/dist/components/data-display/AvatarGroup.mjs.map +1 -0
  59. package/dist/components/data-display/Badge.cjs +2 -0
  60. package/dist/components/data-display/Badge.cjs.map +1 -0
  61. package/dist/components/data-display/Badge.colors.cjs +2 -0
  62. package/dist/components/data-display/Badge.colors.cjs.map +1 -0
  63. package/dist/components/data-display/Badge.colors.mjs +58 -0
  64. package/dist/components/data-display/Badge.colors.mjs.map +1 -0
  65. package/dist/components/data-display/Badge.mjs +32 -0
  66. package/dist/components/data-display/Badge.mjs.map +1 -0
  67. package/dist/components/data-display/CounterBadge.cjs +2 -0
  68. package/dist/components/data-display/CounterBadge.cjs.map +1 -0
  69. package/dist/components/data-display/CounterBadge.mjs +28 -0
  70. package/dist/components/data-display/CounterBadge.mjs.map +1 -0
  71. package/dist/components/data-display/Divider.cjs +2 -0
  72. package/dist/components/data-display/Divider.cjs.map +1 -0
  73. package/dist/components/data-display/Divider.mjs +52 -0
  74. package/dist/components/data-display/Divider.mjs.map +1 -0
  75. package/dist/components/data-display/Image.cjs +2 -0
  76. package/dist/components/data-display/Image.cjs.map +1 -0
  77. package/dist/components/data-display/Image.mjs +32 -0
  78. package/dist/components/data-display/Image.mjs.map +1 -0
  79. package/dist/components/data-display/InfoLabel.cjs +2 -0
  80. package/dist/components/data-display/InfoLabel.cjs.map +1 -0
  81. package/dist/components/data-display/InfoLabel.mjs +104 -0
  82. package/dist/components/data-display/InfoLabel.mjs.map +1 -0
  83. package/dist/components/data-display/List.cjs +2 -0
  84. package/dist/components/data-display/List.cjs.map +1 -0
  85. package/dist/components/data-display/List.mjs +381 -0
  86. package/dist/components/data-display/List.mjs.map +1 -0
  87. package/dist/components/data-display/List.registry.cjs +2 -0
  88. package/dist/components/data-display/List.registry.cjs.map +1 -0
  89. package/dist/components/data-display/List.registry.mjs +101 -0
  90. package/dist/components/data-display/List.registry.mjs.map +1 -0
  91. package/dist/components/data-display/Persona.cjs +2 -0
  92. package/dist/components/data-display/Persona.cjs.map +1 -0
  93. package/dist/components/data-display/Persona.mjs +48 -0
  94. package/dist/components/data-display/Persona.mjs.map +1 -0
  95. package/dist/components/data-display/PresenceBadge.cjs +2 -0
  96. package/dist/components/data-display/PresenceBadge.cjs.map +1 -0
  97. package/dist/components/data-display/PresenceBadge.mjs +71 -0
  98. package/dist/components/data-display/PresenceBadge.mjs.map +1 -0
  99. package/dist/components/data-display/Tag.cjs +2 -0
  100. package/dist/components/data-display/Tag.cjs.map +1 -0
  101. package/dist/components/data-display/Tag.mjs +147 -0
  102. package/dist/components/data-display/Tag.mjs.map +1 -0
  103. package/dist/components/feedback/MessageBar.cjs +2 -0
  104. package/dist/components/feedback/MessageBar.cjs.map +1 -0
  105. package/dist/components/feedback/MessageBar.mjs +144 -0
  106. package/dist/components/feedback/MessageBar.mjs.map +1 -0
  107. package/dist/components/feedback/MessageBar.status.cjs +2 -0
  108. package/dist/components/feedback/MessageBar.status.cjs.map +1 -0
  109. package/dist/components/feedback/MessageBar.status.mjs +45 -0
  110. package/dist/components/feedback/MessageBar.status.mjs.map +1 -0
  111. package/dist/components/feedback/ProgressBar.cjs +2 -0
  112. package/dist/components/feedback/ProgressBar.cjs.map +1 -0
  113. package/dist/components/feedback/ProgressBar.mjs +72 -0
  114. package/dist/components/feedback/ProgressBar.mjs.map +1 -0
  115. package/dist/components/feedback/Skeleton.cjs +2 -0
  116. package/dist/components/feedback/Skeleton.cjs.map +1 -0
  117. package/dist/components/feedback/Skeleton.mjs +47 -0
  118. package/dist/components/feedback/Skeleton.mjs.map +1 -0
  119. package/dist/components/feedback/Spinner.cjs +2 -0
  120. package/dist/components/feedback/Spinner.cjs.map +1 -0
  121. package/dist/components/feedback/Spinner.mjs +60 -0
  122. package/dist/components/feedback/Spinner.mjs.map +1 -0
  123. package/dist/components/feedback/Toast.cjs +2 -0
  124. package/dist/components/feedback/Toast.cjs.map +1 -0
  125. package/dist/components/feedback/Toast.mjs +347 -0
  126. package/dist/components/feedback/Toast.mjs.map +1 -0
  127. package/dist/components/input/Checkbox.cjs +2 -0
  128. package/dist/components/input/Checkbox.cjs.map +1 -0
  129. package/dist/components/input/Checkbox.mjs +96 -0
  130. package/dist/components/input/Checkbox.mjs.map +1 -0
  131. package/dist/components/input/ColorPicker.cjs +6 -0
  132. package/dist/components/input/ColorPicker.cjs.map +1 -0
  133. package/dist/components/input/ColorPicker.mjs +236 -0
  134. package/dist/components/input/ColorPicker.mjs.map +1 -0
  135. package/dist/components/input/Combobox.cjs +2 -0
  136. package/dist/components/input/Combobox.cjs.map +1 -0
  137. package/dist/components/input/Combobox.expand.cjs +2 -0
  138. package/dist/components/input/Combobox.expand.cjs.map +1 -0
  139. package/dist/components/input/Combobox.expand.mjs +38 -0
  140. package/dist/components/input/Combobox.expand.mjs.map +1 -0
  141. package/dist/components/input/Combobox.mjs +187 -0
  142. package/dist/components/input/Combobox.mjs.map +1 -0
  143. package/dist/components/input/DatePicker.cjs +2 -0
  144. package/dist/components/input/DatePicker.cjs.map +1 -0
  145. package/dist/components/input/DatePicker.mjs +340 -0
  146. package/dist/components/input/DatePicker.mjs.map +1 -0
  147. package/dist/components/input/Dropdown.cjs +2 -0
  148. package/dist/components/input/Dropdown.cjs.map +1 -0
  149. package/dist/components/input/Dropdown.mjs +128 -0
  150. package/dist/components/input/Dropdown.mjs.map +1 -0
  151. package/dist/components/input/Field.cjs +2 -0
  152. package/dist/components/input/Field.cjs.map +1 -0
  153. package/dist/components/input/Field.mjs +200 -0
  154. package/dist/components/input/Field.mjs.map +1 -0
  155. package/dist/components/input/Input.cjs +2 -0
  156. package/dist/components/input/Input.cjs.map +1 -0
  157. package/dist/components/input/Input.mjs +81 -0
  158. package/dist/components/input/Input.mjs.map +1 -0
  159. package/dist/components/input/Label.cjs +2 -0
  160. package/dist/components/input/Label.cjs.map +1 -0
  161. package/dist/components/input/Label.mjs +28 -0
  162. package/dist/components/input/Label.mjs.map +1 -0
  163. package/dist/components/input/Option.cjs +2 -0
  164. package/dist/components/input/Option.cjs.map +1 -0
  165. package/dist/components/input/Option.mjs +169 -0
  166. package/dist/components/input/Option.mjs.map +1 -0
  167. package/dist/components/input/RadioGroup.cjs +2 -0
  168. package/dist/components/input/RadioGroup.cjs.map +1 -0
  169. package/dist/components/input/RadioGroup.mjs +139 -0
  170. package/dist/components/input/RadioGroup.mjs.map +1 -0
  171. package/dist/components/input/Rating.cjs +2 -0
  172. package/dist/components/input/Rating.cjs.map +1 -0
  173. package/dist/components/input/Rating.mjs +196 -0
  174. package/dist/components/input/Rating.mjs.map +1 -0
  175. package/dist/components/input/SearchBox.cjs +2 -0
  176. package/dist/components/input/SearchBox.cjs.map +1 -0
  177. package/dist/components/input/SearchBox.mjs +205 -0
  178. package/dist/components/input/SearchBox.mjs.map +1 -0
  179. package/dist/components/input/Select.cjs +2 -0
  180. package/dist/components/input/Select.cjs.map +1 -0
  181. package/dist/components/input/Select.mjs +33 -0
  182. package/dist/components/input/Select.mjs.map +1 -0
  183. package/dist/components/input/Slider.cjs +2 -0
  184. package/dist/components/input/Slider.cjs.map +1 -0
  185. package/dist/components/input/Slider.mjs +79 -0
  186. package/dist/components/input/Slider.mjs.map +1 -0
  187. package/dist/components/input/SpinButton.cjs +2 -0
  188. package/dist/components/input/SpinButton.cjs.map +1 -0
  189. package/dist/components/input/SpinButton.mjs +157 -0
  190. package/dist/components/input/SpinButton.mjs.map +1 -0
  191. package/dist/components/input/SwatchPicker.cjs +2 -0
  192. package/dist/components/input/SwatchPicker.cjs.map +1 -0
  193. package/dist/components/input/SwatchPicker.mjs +113 -0
  194. package/dist/components/input/SwatchPicker.mjs.map +1 -0
  195. package/dist/components/input/Switch.cjs +2 -0
  196. package/dist/components/input/Switch.cjs.map +1 -0
  197. package/dist/components/input/Switch.mjs +92 -0
  198. package/dist/components/input/Switch.mjs.map +1 -0
  199. package/dist/components/input/TagPicker.cjs +2 -0
  200. package/dist/components/input/TagPicker.cjs.map +1 -0
  201. package/dist/components/input/TagPicker.mjs +249 -0
  202. package/dist/components/input/TagPicker.mjs.map +1 -0
  203. package/dist/components/input/Textarea.cjs +2 -0
  204. package/dist/components/input/Textarea.cjs.map +1 -0
  205. package/dist/components/input/Textarea.mjs +32 -0
  206. package/dist/components/input/Textarea.mjs.map +1 -0
  207. package/dist/components/input/TimePicker.cjs +2 -0
  208. package/dist/components/input/TimePicker.cjs.map +1 -0
  209. package/dist/components/input/TimePicker.mjs +292 -0
  210. package/dist/components/input/TimePicker.mjs.map +1 -0
  211. package/dist/components/input/colorUtils.cjs +2 -0
  212. package/dist/components/input/colorUtils.cjs.map +1 -0
  213. package/dist/components/input/colorUtils.mjs +96 -0
  214. package/dist/components/input/colorUtils.mjs.map +1 -0
  215. package/dist/components/input/dateUtils.cjs +2 -0
  216. package/dist/components/input/dateUtils.cjs.map +1 -0
  217. package/dist/components/input/dateUtils.mjs +250 -0
  218. package/dist/components/input/dateUtils.mjs.map +1 -0
  219. package/dist/components/input/pickerStyles.cjs +2 -0
  220. package/dist/components/input/pickerStyles.cjs.map +1 -0
  221. package/dist/components/input/pickerStyles.mjs +10 -0
  222. package/dist/components/input/pickerStyles.mjs.map +1 -0
  223. package/dist/components/internal/HiddenInput.cjs +2 -0
  224. package/dist/components/internal/HiddenInput.cjs.map +1 -0
  225. package/dist/components/internal/HiddenInput.mjs +88 -0
  226. package/dist/components/internal/HiddenInput.mjs.map +1 -0
  227. package/dist/components/layout/Accordion.cjs +2 -0
  228. package/dist/components/layout/Accordion.cjs.map +1 -0
  229. package/dist/components/layout/Accordion.mjs +236 -0
  230. package/dist/components/layout/Accordion.mjs.map +1 -0
  231. package/dist/components/layout/Card.cjs +2 -0
  232. package/dist/components/layout/Card.cjs.map +1 -0
  233. package/dist/components/layout/Card.mjs +121 -0
  234. package/dist/components/layout/Card.mjs.map +1 -0
  235. package/dist/components/layout/Carousel.cjs +2 -0
  236. package/dist/components/layout/Carousel.cjs.map +1 -0
  237. package/dist/components/layout/Carousel.mjs +205 -0
  238. package/dist/components/layout/Carousel.mjs.map +1 -0
  239. package/dist/components/layout/Flex.cjs +2 -0
  240. package/dist/components/layout/Flex.cjs.map +1 -0
  241. package/dist/components/layout/Flex.mjs +54 -0
  242. package/dist/components/layout/Flex.mjs.map +1 -0
  243. package/dist/components/layout/Grid.cjs +2 -0
  244. package/dist/components/layout/Grid.cjs.map +1 -0
  245. package/dist/components/layout/Grid.mjs +62 -0
  246. package/dist/components/layout/Grid.mjs.map +1 -0
  247. package/dist/components/layout/Overflow.cjs +2 -0
  248. package/dist/components/layout/Overflow.cjs.map +1 -0
  249. package/dist/components/layout/Overflow.mjs +269 -0
  250. package/dist/components/layout/Overflow.mjs.map +1 -0
  251. package/dist/components/layout/Stack.cjs +2 -0
  252. package/dist/components/layout/Stack.cjs.map +1 -0
  253. package/dist/components/layout/Stack.mjs +39 -0
  254. package/dist/components/layout/Stack.mjs.map +1 -0
  255. package/dist/components/layout/TabList.cjs +2 -0
  256. package/dist/components/layout/TabList.cjs.map +1 -0
  257. package/dist/components/layout/TabList.mjs +238 -0
  258. package/dist/components/layout/TabList.mjs.map +1 -0
  259. package/dist/components/layout/Tree.cjs +2 -0
  260. package/dist/components/layout/Tree.cjs.map +1 -0
  261. package/dist/components/layout/Tree.mjs +220 -0
  262. package/dist/components/layout/Tree.mjs.map +1 -0
  263. package/dist/components/layout/disclosureIds.cjs +2 -0
  264. package/dist/components/layout/disclosureIds.cjs.map +1 -0
  265. package/dist/components/layout/disclosureIds.mjs +12 -0
  266. package/dist/components/layout/disclosureIds.mjs.map +1 -0
  267. package/dist/components/motion/Presence.cjs +2 -0
  268. package/dist/components/motion/Presence.cjs.map +1 -0
  269. package/dist/components/motion/Presence.mjs +35 -0
  270. package/dist/components/motion/Presence.mjs.map +1 -0
  271. package/dist/components/navigation/Breadcrumb.cjs +2 -0
  272. package/dist/components/navigation/Breadcrumb.cjs.map +1 -0
  273. package/dist/components/navigation/Breadcrumb.mjs +144 -0
  274. package/dist/components/navigation/Breadcrumb.mjs.map +1 -0
  275. package/dist/components/navigation/Menu.cjs +2 -0
  276. package/dist/components/navigation/Menu.cjs.map +1 -0
  277. package/dist/components/navigation/Menu.context.cjs +2 -0
  278. package/dist/components/navigation/Menu.context.cjs.map +1 -0
  279. package/dist/components/navigation/Menu.context.mjs +82 -0
  280. package/dist/components/navigation/Menu.context.mjs.map +1 -0
  281. package/dist/components/navigation/Menu.group.cjs +2 -0
  282. package/dist/components/navigation/Menu.group.cjs.map +1 -0
  283. package/dist/components/navigation/Menu.group.mjs +58 -0
  284. package/dist/components/navigation/Menu.group.mjs.map +1 -0
  285. package/dist/components/navigation/Menu.items.cjs +2 -0
  286. package/dist/components/navigation/Menu.items.cjs.map +1 -0
  287. package/dist/components/navigation/Menu.items.mjs +127 -0
  288. package/dist/components/navigation/Menu.items.mjs.map +1 -0
  289. package/dist/components/navigation/Menu.link.cjs +2 -0
  290. package/dist/components/navigation/Menu.link.cjs.map +1 -0
  291. package/dist/components/navigation/Menu.link.mjs +41 -0
  292. package/dist/components/navigation/Menu.link.mjs.map +1 -0
  293. package/dist/components/navigation/Menu.mjs +27 -0
  294. package/dist/components/navigation/Menu.mjs.map +1 -0
  295. package/dist/components/navigation/Menu.popover.cjs +2 -0
  296. package/dist/components/navigation/Menu.popover.cjs.map +1 -0
  297. package/dist/components/navigation/Menu.popover.mjs +231 -0
  298. package/dist/components/navigation/Menu.popover.mjs.map +1 -0
  299. package/dist/components/navigation/Menu.root.cjs +2 -0
  300. package/dist/components/navigation/Menu.root.cjs.map +1 -0
  301. package/dist/components/navigation/Menu.root.mjs +308 -0
  302. package/dist/components/navigation/Menu.root.mjs.map +1 -0
  303. package/dist/components/navigation/Menu.selectable.cjs +2 -0
  304. package/dist/components/navigation/Menu.selectable.cjs.map +1 -0
  305. package/dist/components/navigation/Menu.selectable.mjs +89 -0
  306. package/dist/components/navigation/Menu.selectable.mjs.map +1 -0
  307. package/dist/components/navigation/Menu.shared.cjs +2 -0
  308. package/dist/components/navigation/Menu.shared.cjs.map +1 -0
  309. package/dist/components/navigation/Menu.shared.mjs +23 -0
  310. package/dist/components/navigation/Menu.shared.mjs.map +1 -0
  311. package/dist/components/navigation/Menu.splitGroup.cjs +2 -0
  312. package/dist/components/navigation/Menu.splitGroup.cjs.map +1 -0
  313. package/dist/components/navigation/Menu.splitGroup.mjs +51 -0
  314. package/dist/components/navigation/Menu.splitGroup.mjs.map +1 -0
  315. package/dist/components/navigation/Menu.trigger.cjs +2 -0
  316. package/dist/components/navigation/Menu.trigger.cjs.map +1 -0
  317. package/dist/components/navigation/Menu.trigger.mjs +79 -0
  318. package/dist/components/navigation/Menu.trigger.mjs.map +1 -0
  319. package/dist/components/navigation/Nav.cjs +2 -0
  320. package/dist/components/navigation/Nav.cjs.map +1 -0
  321. package/dist/components/navigation/Nav.mjs +276 -0
  322. package/dist/components/navigation/Nav.mjs.map +1 -0
  323. package/dist/components/navigation/Pagination.cjs +2 -0
  324. package/dist/components/navigation/Pagination.cjs.map +1 -0
  325. package/dist/components/navigation/Pagination.mjs +110 -0
  326. package/dist/components/navigation/Pagination.mjs.map +1 -0
  327. package/dist/components/navigation/Stepper.cjs +2 -0
  328. package/dist/components/navigation/Stepper.cjs.map +1 -0
  329. package/dist/components/navigation/Stepper.mjs +204 -0
  330. package/dist/components/navigation/Stepper.mjs.map +1 -0
  331. package/dist/components/overlays/Dialog.cjs +2 -0
  332. package/dist/components/overlays/Dialog.cjs.map +1 -0
  333. package/dist/components/overlays/Dialog.mjs +180 -0
  334. package/dist/components/overlays/Dialog.mjs.map +1 -0
  335. package/dist/components/overlays/Dialog.shared.cjs +2 -0
  336. package/dist/components/overlays/Dialog.shared.cjs.map +1 -0
  337. package/dist/components/overlays/Dialog.shared.mjs +227 -0
  338. package/dist/components/overlays/Dialog.shared.mjs.map +1 -0
  339. package/dist/components/overlays/Drawer.cjs +2 -0
  340. package/dist/components/overlays/Drawer.cjs.map +1 -0
  341. package/dist/components/overlays/Drawer.mjs +192 -0
  342. package/dist/components/overlays/Drawer.mjs.map +1 -0
  343. package/dist/components/overlays/Popover.cjs +2 -0
  344. package/dist/components/overlays/Popover.cjs.map +1 -0
  345. package/dist/components/overlays/Popover.mjs +365 -0
  346. package/dist/components/overlays/Popover.mjs.map +1 -0
  347. package/dist/components/overlays/Popover.shared.cjs +2 -0
  348. package/dist/components/overlays/Popover.shared.cjs.map +1 -0
  349. package/dist/components/overlays/Popover.shared.mjs +182 -0
  350. package/dist/components/overlays/Popover.shared.mjs.map +1 -0
  351. package/dist/components/overlays/TeachingPopover.cjs +2 -0
  352. package/dist/components/overlays/TeachingPopover.cjs.map +1 -0
  353. package/dist/components/overlays/TeachingPopover.mjs +181 -0
  354. package/dist/components/overlays/TeachingPopover.mjs.map +1 -0
  355. package/dist/components/overlays/Tooltip.cjs +2 -0
  356. package/dist/components/overlays/Tooltip.cjs.map +1 -0
  357. package/dist/components/overlays/Tooltip.mjs +160 -0
  358. package/dist/components/overlays/Tooltip.mjs.map +1 -0
  359. package/dist/components/portal/Portal.cjs +2 -0
  360. package/dist/components/portal/Portal.cjs.map +1 -0
  361. package/dist/components/portal/Portal.mjs +45 -0
  362. package/dist/components/portal/Portal.mjs.map +1 -0
  363. package/dist/components/provider/WaveProvider.cjs +2 -0
  364. package/dist/components/provider/WaveProvider.cjs.map +1 -0
  365. package/dist/components/provider/WaveProvider.mjs +51 -0
  366. package/dist/components/provider/WaveProvider.mjs.map +1 -0
  367. package/dist/components/table/DataGrid.cjs +2 -0
  368. package/dist/components/table/DataGrid.cjs.map +1 -0
  369. package/dist/components/table/DataGrid.mjs +489 -0
  370. package/dist/components/table/DataGrid.mjs.map +1 -0
  371. package/dist/components/table/Table.cjs +2 -0
  372. package/dist/components/table/Table.cjs.map +1 -0
  373. package/dist/components/table/Table.mjs +99 -0
  374. package/dist/components/table/Table.mjs.map +1 -0
  375. package/dist/components/table/useGridNavigation.cjs +2 -0
  376. package/dist/components/table/useGridNavigation.cjs.map +1 -0
  377. package/dist/components/table/useGridNavigation.mjs +336 -0
  378. package/dist/components/table/useGridNavigation.mjs.map +1 -0
  379. package/dist/components/typography/Text.cjs +2 -0
  380. package/dist/components/typography/Text.cjs.map +1 -0
  381. package/dist/components/typography/Text.mjs +38 -0
  382. package/dist/components/typography/Text.mjs.map +1 -0
  383. package/dist/hooks/useAnnounce.cjs +2 -0
  384. package/dist/hooks/useAnnounce.cjs.map +1 -0
  385. package/dist/hooks/useAnnounce.mjs +88 -0
  386. package/dist/hooks/useAnnounce.mjs.map +1 -0
  387. package/dist/hooks/useCheckedValues.cjs +2 -0
  388. package/dist/hooks/useCheckedValues.cjs.map +1 -0
  389. package/dist/hooks/useCheckedValues.mjs +102 -0
  390. package/dist/hooks/useCheckedValues.mjs.map +1 -0
  391. package/dist/hooks/useContextMenuAnchor.cjs +2 -0
  392. package/dist/hooks/useContextMenuAnchor.cjs.map +1 -0
  393. package/dist/hooks/useContextMenuAnchor.mjs +132 -0
  394. package/dist/hooks/useContextMenuAnchor.mjs.map +1 -0
  395. package/dist/hooks/useControllable.cjs +2 -0
  396. package/dist/hooks/useControllable.cjs.map +1 -0
  397. package/dist/hooks/useControllable.mjs +37 -0
  398. package/dist/hooks/useControllable.mjs.map +1 -0
  399. package/dist/hooks/useDirection.cjs +2 -0
  400. package/dist/hooks/useDirection.cjs.map +1 -0
  401. package/dist/hooks/useDirection.mjs +57 -0
  402. package/dist/hooks/useDirection.mjs.map +1 -0
  403. package/dist/hooks/useDismiss.cjs +2 -0
  404. package/dist/hooks/useDismiss.cjs.map +1 -0
  405. package/dist/hooks/useDismiss.mjs +57 -0
  406. package/dist/hooks/useDismiss.mjs.map +1 -0
  407. package/dist/hooks/useEventCallback.cjs +2 -0
  408. package/dist/hooks/useEventCallback.cjs.map +1 -0
  409. package/dist/hooks/useEventCallback.mjs +16 -0
  410. package/dist/hooks/useEventCallback.mjs.map +1 -0
  411. package/dist/hooks/useFieldControl.cjs +2 -0
  412. package/dist/hooks/useFieldControl.cjs.map +1 -0
  413. package/dist/hooks/useFieldControl.mjs +62 -0
  414. package/dist/hooks/useFieldControl.mjs.map +1 -0
  415. package/dist/hooks/useFocusTrap.cjs +2 -0
  416. package/dist/hooks/useFocusTrap.cjs.map +1 -0
  417. package/dist/hooks/useFocusTrap.mjs +266 -0
  418. package/dist/hooks/useFocusTrap.mjs.map +1 -0
  419. package/dist/hooks/useFormReset.cjs +2 -0
  420. package/dist/hooks/useFormReset.cjs.map +1 -0
  421. package/dist/hooks/useFormReset.mjs +33 -0
  422. package/dist/hooks/useFormReset.mjs.map +1 -0
  423. package/dist/hooks/useHoverIntent.cjs +2 -0
  424. package/dist/hooks/useHoverIntent.cjs.map +1 -0
  425. package/dist/hooks/useHoverIntent.mjs +201 -0
  426. package/dist/hooks/useHoverIntent.mjs.map +1 -0
  427. package/dist/hooks/useId.cjs +2 -0
  428. package/dist/hooks/useId.cjs.map +1 -0
  429. package/dist/hooks/useId.mjs +11 -0
  430. package/dist/hooks/useId.mjs.map +1 -0
  431. package/dist/hooks/useIsClient.cjs +2 -0
  432. package/dist/hooks/useIsClient.cjs.map +1 -0
  433. package/dist/hooks/useIsClient.mjs +19 -0
  434. package/dist/hooks/useIsClient.mjs.map +1 -0
  435. package/dist/hooks/useListbox.cjs +2 -0
  436. package/dist/hooks/useListbox.cjs.map +1 -0
  437. package/dist/hooks/useListbox.mjs +492 -0
  438. package/dist/hooks/useListbox.mjs.map +1 -0
  439. package/dist/hooks/useMergedRefs.cjs +2 -0
  440. package/dist/hooks/useMergedRefs.cjs.map +1 -0
  441. package/dist/hooks/useMergedRefs.mjs +57 -0
  442. package/dist/hooks/useMergedRefs.mjs.map +1 -0
  443. package/dist/hooks/useModalIsolation.cjs +2 -0
  444. package/dist/hooks/useModalIsolation.cjs.map +1 -0
  445. package/dist/hooks/useModalIsolation.mjs +87 -0
  446. package/dist/hooks/useModalIsolation.mjs.map +1 -0
  447. package/dist/hooks/useModalLayer.cjs +2 -0
  448. package/dist/hooks/useModalLayer.cjs.map +1 -0
  449. package/dist/hooks/useModalLayer.mjs +30 -0
  450. package/dist/hooks/useModalLayer.mjs.map +1 -0
  451. package/dist/hooks/usePopupPosition.cjs +2 -0
  452. package/dist/hooks/usePopupPosition.cjs.map +1 -0
  453. package/dist/hooks/usePopupPosition.mjs +117 -0
  454. package/dist/hooks/usePopupPosition.mjs.map +1 -0
  455. package/dist/hooks/usePrefersReducedMotion.cjs +2 -0
  456. package/dist/hooks/usePrefersReducedMotion.cjs.map +1 -0
  457. package/dist/hooks/usePrefersReducedMotion.mjs +24 -0
  458. package/dist/hooks/usePrefersReducedMotion.mjs.map +1 -0
  459. package/dist/hooks/usePresence.cjs +2 -0
  460. package/dist/hooks/usePresence.cjs.map +1 -0
  461. package/dist/hooks/usePresence.mjs +136 -0
  462. package/dist/hooks/usePresence.mjs.map +1 -0
  463. package/dist/hooks/usePreserveFocus.cjs +2 -0
  464. package/dist/hooks/usePreserveFocus.cjs.map +1 -0
  465. package/dist/hooks/usePreserveFocus.mjs +50 -0
  466. package/dist/hooks/usePreserveFocus.mjs.map +1 -0
  467. package/dist/hooks/useRestoreFocus.cjs +2 -0
  468. package/dist/hooks/useRestoreFocus.cjs.map +1 -0
  469. package/dist/hooks/useRestoreFocus.mjs +271 -0
  470. package/dist/hooks/useRestoreFocus.mjs.map +1 -0
  471. package/dist/hooks/useRovingTabIndex.cjs +2 -0
  472. package/dist/hooks/useRovingTabIndex.cjs.map +1 -0
  473. package/dist/hooks/useRovingTabIndex.mjs +389 -0
  474. package/dist/hooks/useRovingTabIndex.mjs.map +1 -0
  475. package/dist/hooks/useScrollLock.cjs +2 -0
  476. package/dist/hooks/useScrollLock.cjs.map +1 -0
  477. package/dist/hooks/useScrollLock.mjs +71 -0
  478. package/dist/hooks/useScrollLock.mjs.map +1 -0
  479. package/dist/hooks/useTriggerElement.cjs +2 -0
  480. package/dist/hooks/useTriggerElement.cjs.map +1 -0
  481. package/dist/hooks/useTriggerElement.mjs +126 -0
  482. package/dist/hooks/useTriggerElement.mjs.map +1 -0
  483. package/dist/hooks/useTypeahead.cjs +2 -0
  484. package/dist/hooks/useTypeahead.cjs.map +1 -0
  485. package/dist/hooks/useTypeahead.mjs +38 -0
  486. package/dist/hooks/useTypeahead.mjs.map +1 -0
  487. package/dist/index.cjs +1 -1
  488. package/dist/index.d.cts +9099 -0
  489. package/dist/index.d.ts +7688 -1027
  490. package/dist/index.mjs +91 -5695
  491. package/dist/lib/aria.cjs +2 -0
  492. package/dist/lib/aria.cjs.map +1 -0
  493. package/dist/lib/aria.mjs +29 -0
  494. package/dist/lib/aria.mjs.map +1 -0
  495. package/dist/lib/children.cjs +2 -0
  496. package/dist/lib/children.cjs.map +1 -0
  497. package/dist/lib/children.mjs +37 -0
  498. package/dist/lib/children.mjs.map +1 -0
  499. package/dist/lib/cn.cjs +2 -0
  500. package/dist/lib/cn.cjs.map +1 -0
  501. package/dist/lib/cn.mjs +64 -0
  502. package/dist/lib/cn.mjs.map +1 -0
  503. package/dist/lib/composeEventHandlers.cjs +2 -0
  504. package/dist/lib/composeEventHandlers.cjs.map +1 -0
  505. package/dist/lib/composeEventHandlers.mjs +11 -0
  506. package/dist/lib/composeEventHandlers.mjs.map +1 -0
  507. package/dist/lib/dev.cjs +2 -0
  508. package/dist/lib/dev.cjs.map +1 -0
  509. package/dist/lib/dev.mjs +42 -0
  510. package/dist/lib/dev.mjs.map +1 -0
  511. package/dist/lib/direction.cjs +2 -0
  512. package/dist/lib/direction.cjs.map +1 -0
  513. package/dist/lib/direction.mjs +35 -0
  514. package/dist/lib/direction.mjs.map +1 -0
  515. package/dist/lib/events.cjs +2 -0
  516. package/dist/lib/events.cjs.map +1 -0
  517. package/dist/lib/events.mjs +31 -0
  518. package/dist/lib/events.mjs.map +1 -0
  519. package/dist/lib/focus.cjs +2 -0
  520. package/dist/lib/focus.cjs.map +1 -0
  521. package/dist/lib/focus.mjs +119 -0
  522. package/dist/lib/focus.mjs.map +1 -0
  523. package/dist/lib/globalRegistry.cjs +2 -0
  524. package/dist/lib/globalRegistry.cjs.map +1 -0
  525. package/dist/lib/globalRegistry.mjs +13 -0
  526. package/dist/lib/globalRegistry.mjs.map +1 -0
  527. package/dist/lib/icons.cjs +2 -0
  528. package/dist/lib/icons.cjs.map +1 -0
  529. package/dist/lib/icons.mjs +254 -0
  530. package/dist/lib/icons.mjs.map +1 -0
  531. package/dist/lib/labelInName.cjs +2 -0
  532. package/dist/lib/labelInName.cjs.map +1 -0
  533. package/dist/lib/labelInName.mjs +54 -0
  534. package/dist/lib/labelInName.mjs.map +1 -0
  535. package/dist/lib/layers.cjs +2 -0
  536. package/dist/lib/layers.cjs.map +1 -0
  537. package/dist/lib/layers.mjs +224 -0
  538. package/dist/lib/layers.mjs.map +1 -0
  539. package/dist/lib/mergeProps.cjs +2 -0
  540. package/dist/lib/mergeProps.cjs.map +1 -0
  541. package/dist/lib/mergeProps.mjs +21 -0
  542. package/dist/lib/mergeProps.mjs.map +1 -0
  543. package/dist/lib/mergeRefs.cjs +2 -0
  544. package/dist/lib/mergeRefs.cjs.map +1 -0
  545. package/dist/lib/mergeRefs.mjs +29 -0
  546. package/dist/lib/mergeRefs.mjs.map +1 -0
  547. package/dist/lib/renderTrigger.cjs +2 -0
  548. package/dist/lib/renderTrigger.cjs.map +1 -0
  549. package/dist/lib/renderTrigger.mjs +29 -0
  550. package/dist/lib/renderTrigger.mjs.map +1 -0
  551. package/dist/lib/slot.cjs +2 -0
  552. package/dist/lib/slot.cjs.map +1 -0
  553. package/dist/lib/slot.mjs +122 -0
  554. package/dist/lib/slot.mjs.map +1 -0
  555. package/dist/lib/styles.cjs +2 -0
  556. package/dist/lib/styles.cjs.map +1 -0
  557. package/dist/lib/styles.mjs +16 -0
  558. package/dist/lib/styles.mjs.map +1 -0
  559. package/dist/lib/theme.cjs +2 -0
  560. package/dist/lib/theme.cjs.map +1 -0
  561. package/dist/lib/theme.mjs +16 -0
  562. package/dist/lib/theme.mjs.map +1 -0
  563. package/dist/preflight.css +2 -0
  564. package/dist/styles.css +2 -0
  565. package/package.json +149 -100
  566. package/src/styles/animations.css +7 -39
  567. package/src/styles/base.css +103 -0
  568. package/src/styles/globals.css +10 -22
  569. package/src/styles/legacy-tokens.css +184 -0
  570. package/src/styles/preflight.css +7 -0
  571. package/src/styles/styles.css +32 -0
  572. package/src/styles/tailwind.css +17 -0
  573. package/src/styles/tokens.css +561 -221
  574. package/src/styles/variants.css +29 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.registry.mjs","names":["NO_VALUES","ListRegistrySnapshot","records","values","valueSet","duplicateSet","hasActions","record","ListRegistry","listener","previous","token","root","byElement","entry","element","ordered","current","moved","child","active","snapshot","value","loss"],"sources":["../../../src/components/data-display/List.registry.ts"],"sourcesContent":["/**\n * The item registry of the List component (internal module: not re-exported by the barrels).\n *\n * Items register their value in a layout effect; the List reads the registered set during render\n * (C-HOOKS: an external store instead of setState in an effect).\n */\n\nconst NO_VALUES: readonly string[] = [];\n\n/** What one mounted item registered. */\nexport interface ListItemRecord {\n /** The item's explicit `value` (`undefined`: the item cannot be selected). */\n value: string | undefined;\n /** Whether the item has an action (a selectable list with actions renders a grid). */\n hasAction: boolean;\n /** The item element's ref, read after a commit to keep the records in DOM order. */\n element: { readonly current: Element | null };\n}\n\n/** The data collected from the records, see {@link ListRegistrySnapshot}. */\nexport interface ListRegistryData {\n values: readonly string[];\n valueSet: ReadonlySet<string>;\n /** Values that more than one item holds, each listed once. */\n duplicates: readonly string[];\n count: number;\n hasActions: boolean;\n}\n\n/**\n * What the items of a List registered, published through `useSyncExternalStore`.\n *\n * Creating a snapshot is O(1): the data is collected from the records the first time it is read\n * (the List's next render), so a commit that mounts or unmounts n items costs O(n) in total\n * instead of one full rebuild per item (table-core#22). A newer snapshot replaces this one on every\n * change, and React always renders with the newest, so the lazily read records are the current\n * ones.\n */\nexport class ListRegistrySnapshot {\n private data: ListRegistryData | null = null;\n\n constructor(private readonly records: ReadonlyMap<object, ListItemRecord>) {}\n\n /** Item values in DOM order (see {@link ListRegistry.syncOrder}), without duplicates. */\n get values(): readonly string[] {\n return this.read().values;\n }\n\n get valueSet(): ReadonlySet<string> {\n return this.read().valueSet;\n }\n\n /** Values that more than one mounted item holds (each listed once). */\n get duplicates(): readonly string[] {\n return this.read().duplicates;\n }\n\n /** Number of mounted items (with or without a value). */\n get count(): number {\n return this.read().count;\n }\n\n /** Whether any item has an action. */\n get hasActions(): boolean {\n return this.read().hasActions;\n }\n\n /** Collects the data from the records: O(n), once per snapshot. Public for the cost test only. */\n build(): ListRegistryData {\n const values: string[] = [];\n const valueSet = new Set<string>();\n const duplicateSet = new Set<string>();\n let hasActions = false;\n for (const record of this.records.values()) {\n if (record.hasAction) hasActions = true;\n if (record.value === undefined) continue;\n if (valueSet.has(record.value)) {\n duplicateSet.add(record.value);\n } else {\n valueSet.add(record.value);\n values.push(record.value);\n }\n }\n const duplicates = duplicateSet.size > 0 ? Array.from(duplicateSet) : NO_VALUES;\n return { values, valueSet, duplicates, count: this.records.size, hasActions };\n }\n\n private read(): ListRegistryData {\n this.data ??= this.build();\n return this.data;\n }\n}\n\n/** The item that held focus when it was removed, recorded for the List's focus restore. */\nexport interface ListFocusLoss {\n /** The item's explicit `value`, if it has one. */\n value: string | undefined;\n /** Its position among the list's items. */\n index: number;\n}\n\n/**\n * The registry behind a List's snapshot.\n *\n * Only a selectable List publishes (`setActive(true)` in its layout effect): a plain list never\n * reads the registry, so its items' registrations cost O(1) and cause no renders. The snapshot is\n * `null` while inactive and until the List's first commit, so the server and the first client\n * render treat every selected value as present.\n */\nexport class ListRegistry {\n private readonly records = new Map<object, ListItemRecord>();\n private readonly listeners = new Set<() => void>();\n private active = false;\n private snapshot: ListRegistrySnapshot | null = null;\n private focusLoss: ListFocusLoss | null = null;\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener);\n return () => {\n this.listeners.delete(listener);\n };\n };\n\n getSnapshot = (): ListRegistrySnapshot | null => this.snapshot;\n\n getServerSnapshot = (): ListRegistrySnapshot | null => null;\n\n /**\n * Adds an item's record, or updates it in place: a `Map.set` on an existing token keeps its\n * position, so an item whose value or action changes does not move to the end. Publishes only\n * when the value or the action changed.\n */\n set(token: object, record: ListItemRecord): void {\n const previous = this.records.get(token);\n this.records.set(token, record);\n if (previous && previous.value === record.value && previous.hasAction === record.hasAction) {\n return;\n }\n this.publish();\n }\n\n /** Removes an item's record (on unmount only). */\n delete(token: object): void {\n if (this.records.delete(token)) this.publish();\n }\n\n /**\n * Puts the records in DOM order, so `values` (and with it the List's Tab stop, the first selected\n * item) follows the DOM. Items that mount between others register last, and keyed moves do not\n * register again, so the List calls this after each of its commits. O(n); publishes only when\n * the order changed. The records keep their registration order while an item is not a direct\n * child of `root` (an element wrapped around an item) or has no element.\n *\n * The children are walked with `nextElementSibling`, never through the `root.children`\n * collection: jsdom before 30.1 does not cache indexed `HTMLCollection` access, so an indexed\n * loop (or `Array.from`) is O(n²) there and made every commit of a large list in a consumer's\n * test suite cost seconds.\n */\n syncOrder(root: Element | null): void {\n if (!this.active || !root || this.records.size < 2) return;\n const byElement = new Map<Element, [object, ListItemRecord]>();\n for (const entry of this.records) {\n const element = entry[1].element.current;\n if (!element || element.parentElement !== root) return;\n byElement.set(element, entry);\n }\n const ordered: [object, ListItemRecord][] = [];\n const current = this.records.keys();\n let moved = false;\n for (let child = root.firstElementChild; child; child = child.nextElementSibling) {\n const entry = byElement.get(child);\n if (!entry) continue;\n ordered.push(entry);\n if (!moved && current.next().value !== entry[0]) moved = true;\n }\n if (!moved || ordered.length !== this.records.size) return;\n this.records.clear();\n for (const [token, record] of ordered) this.records.set(token, record);\n this.publish();\n }\n\n /** Called by the List after each commit that changes `selectable` (and on mount). */\n setActive(active: boolean): void {\n if (active === this.active) return;\n this.active = active;\n if (active) {\n this.publish();\n } else if (this.snapshot !== null) {\n this.snapshot = null;\n this.notify();\n }\n }\n\n /** `values` without the ones no mounted item has (read at event time). */\n prune(values: readonly string[]): string[] {\n const snapshot = this.snapshot;\n return snapshot ? values.filter((value) => snapshot.valueSet.has(value)) : [...values];\n }\n\n /**\n * Records that a removed item (or action) held focus. Only the current commit can use it: the\n * record is dropped in a microtask, so a later commit never moves focus because of an old removal.\n */\n recordFocusLoss(loss: ListFocusLoss): void {\n this.focusLoss = loss;\n queueMicrotask(() => {\n if (this.focusLoss === loss) this.focusLoss = null;\n });\n }\n\n takeFocusLoss(): ListFocusLoss | null {\n const loss = this.focusLoss;\n this.focusLoss = null;\n return loss;\n }\n\n private publish(): void {\n if (!this.active) return;\n this.snapshot = new ListRegistrySnapshot(this.records);\n this.notify();\n }\n\n private notify(): void {\n for (const listener of this.listeners) listener();\n }\n}\n"],"mappings":";;AAOA,IAAMA,IAA+B,CAAC,GA+BzBC,IAAb,MA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B,EAAS,SAAS,IAAIC,CAAK,CAAC,IAAI,CAAC,GAAGnB,CAAM;CACvF;CAMA,gBAAgB,GAA2B;EAEzC,AADA,KAAK,YAAYoB,GACjB,qBAAqB;GACnB,AAAI,KAAK,cAAcA,MAAM,KAAK,YAAY;EAChD,CAAC;CACH;CAEA,gBAAsC;EACpC,IAAMA,IAAO,KAAK;EAElB,OADA,KAAK,YAAY,MACVA;CACT;CAEA,UAAwB;EACtB,AAAK,KAAK,WACV,KAAK,WAAW,IAAItB,EAAqB,KAAK,OAAO,GACrD,KAAK,OAAO;CACd;CAEA,SAAuB;EACrB,KAAK,IAAMQ,KAAY,KAAK,WAAW,EAAS;CAClD;AACF"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/slot.cjs"),r=require("./Avatar.cjs"),i=require("./PresenceBadge.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("react/jsx-runtime");function s(e){return e===`extra-small`||e===`small`?`small`:`medium`}var c=({name:e,secondaryText:a,src:c,size:l=`medium`,status:u,avatar:d,badge:f,className:p,ref:m,...h})=>{let g=f&&n.slotRendersContent(f)?n.renderSlot(f,`span`):u?(0,o.jsx)(i.PresenceBadge,{status:u,size:s(l)}):null;return(0,o.jsxs)(`div`,{ref:m,className:t.cn(`inline-flex items-center gap-3`,p),...h,children:[(0,o.jsxs)(`div`,{className:`relative inline-flex shrink-0`,children:[d&&n.slotRendersContent(d)?n.renderSlot(d,`span`):(0,o.jsx)(r.Avatar,{src:c,name:e,size:l,decorative:!0}),g&&(0,o.jsx)(`span`,{className:`absolute bottom-0 end-0 inline-flex`,children:g})]}),(0,o.jsxs)(`div`,{className:`flex flex-col`,children:[(0,o.jsx)(`span`,{className:`font-semibold text-body-1`,children:e}),a&&(0,o.jsx)(`span`,{className:`text-caption-1 text-muted-foreground`,children:a})]})]})};c.displayName=`Persona`,exports.Persona=c;
2
+ //# sourceMappingURL=Persona.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Persona.cjs","names":["slotRendersContent","renderSlot","PresenceBadge","cn","Avatar","require_runtime","require_cn","require_slot","require_Avatar","require_PresenceBadge","react","react_jsx_runtime","derivePresenceSize","size","Persona","props","badgeNode","badge","status","className","avatar","name","secondaryText"],"sources":["../../../src/components/data-display/Persona.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport type { PresenceStatus, Size, Slot } from '../../lib/types';\nimport { renderSlot, slotRendersContent } from '../../lib/slot';\nimport { Avatar } from './Avatar';\nimport { PresenceBadge } from './PresenceBadge';\n\n/** Properties for the Persona component. */\nexport interface PersonaProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Display name of the person. */\n name: string;\n /** Secondary text such as job title or email. */\n secondaryText?: string;\n /** URL of the person's avatar image. */\n src?: string;\n /** Size of the persona avatar.\n * @default 'medium'\n */\n size?: Size;\n /** Presence status shown as a badge on the avatar. Ignored when a `badge` is given. */\n status?: PresenceStatus;\n /**\n * Slot for a custom avatar element, replacing the built-in one. The name is already visible\n * next to it, so make a custom avatar decorative (e.g. `<Avatar decorative … />`). A value that\n * renders nothing (`null`, `false`, `''`, `0`, `NaN`, or an array, `Set` or generator of only\n * such items) counts as not given.\n */\n avatar?: Slot<'span'>;\n /**\n * Slot for a custom badge element. Takes precedence over `status`. A value that renders nothing\n * (`null`, `false`, `''`, `0`, `NaN`, e.g. `badge={count && <CounterBadge count={count} />}`,\n * or an array, `Set` or generator of only such items) counts as not given.\n */\n badge?: Slot<'span'>;\n /** Ref to the root `<div>`. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\nfunction derivePresenceSize(size: Size): Size {\n return size === 'extra-small' || size === 'small' ? 'small' : 'medium';\n}\n\n/**\n * A person's avatar next to their name and optional secondary text (job title, email), with an\n * optional presence badge.\n *\n * The built-in avatar is decorative (`<Avatar decorative>`): the visible name is announced once,\n * not a second time as the avatar's image name. The presence badge stays exposed as a named image.\n *\n * @example\n * <Persona name=\"Jane Doe\" secondaryText=\"Designer\" status=\"available\" />\n */\nexport const Persona = ({\n name,\n secondaryText,\n src,\n size = 'medium',\n status,\n avatar,\n badge,\n className,\n ref,\n ...props\n}: PersonaProps) => {\n // A slot that renders nothing (`badge={count && …}` with count 0, an empty `.map()` result) is\n // not given (C-SLOTS), so the status badge and the built-in avatar apply.\n const badgeNode =\n badge && slotRendersContent(badge) ? (\n renderSlot(badge, 'span')\n ) : status ? (\n <PresenceBadge status={status} size={derivePresenceSize(size)} />\n ) : null;\n\n return (\n <div ref={ref} className={cn('inline-flex items-center gap-3', className)} {...props}>\n <div className=\"relative inline-flex shrink-0\">\n {avatar && slotRendersContent(avatar) ? (\n renderSlot(avatar, 'span')\n ) : (\n <Avatar src={src} name={name} size={size} decorative />\n )}\n {badgeNode && <span className=\"absolute bottom-0 end-0 inline-flex\">{badgeNode}</span>}\n </div>\n <div className=\"flex flex-col\">\n <span className=\"font-semibold text-body-1\">{name}</span>\n {secondaryText && (\n <span className=\"text-caption-1 text-muted-foreground\">{secondaryText}</span>\n )}\n </div>\n </div>\n );\n};\n\nPersona.displayName = 'Persona';\n"],"mappings":"yQAsCA,SAASY,EAAmB,EAAkB,CAC5C,OAAOC,IAAS,eAAiBA,IAAS,QAAU,QAAU,QAChE,CAYA,IAAaC,GAAW,CACtB,OACA,gBACA,MACA,OAAO,SACP,SACA,SACA,QACA,YACA,MACA,GAAGC,KACe,CAGlB,IAAMC,EACJC,GAASjB,EAAAA,mBAAmBiB,CAAK,EAC/BhB,EAAAA,WAAWgB,EAAO,MAAM,EACtBC,GACF,EAAAP,EAAA,IAAA,CAACT,EAAAA,cAAD,CAAuB,SAAQ,KAAMU,EAAmBC,CAAI,CAAI,CAAA,EAC9D,KAEN,OACE,EAAAF,EAAA,KAAA,CAAC,MAAD,CAAU,MAAK,UAAWR,EAAAA,GAAG,iCAAkCgB,CAAS,EAAG,GAAIJ,EAA/E,SAAA,EACE,EAAAJ,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,gCAAf,SAAA,CACGS,GAAUpB,EAAAA,mBAAmBoB,CAAM,EAClCnB,EAAAA,WAAWmB,EAAQ,MAAM,GAEzB,EAAAT,EAAA,IAAA,CAACP,EAAAA,OAAD,CAAa,MAAW,OAAY,OAAM,WAAA,EAAY,CAAA,EAEvDY,IAAa,EAAAL,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sCAAuC,SAAAK,CAAgB,CAAA,CAClF,CACL,CAAA,GAAA,EAAAL,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,gBAAf,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,4BAA6B,SAAAU,CAAW,CAAA,EACvDC,IACC,EAAAX,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,uCAAwC,SAAAW,CAAoB,CAAA,CAE3E,CACF,CAAA,CAAA,GAET,EAEA,EAAQ,YAAc"}
@@ -0,0 +1,48 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/cn.mjs";
3
+ import { renderSlot as t, slotRendersContent as n } from "../../lib/slot.mjs";
4
+ import { Avatar as r } from "./Avatar.mjs";
5
+ import { PresenceBadge as i } from "./PresenceBadge.mjs";
6
+ import "react";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
+ //#region src/components/data-display/Persona.tsx
9
+ function s(e) {
10
+ return e === "extra-small" || e === "small" ? "small" : "medium";
11
+ }
12
+ var c = ({ name: c, secondaryText: l, src: u, size: d = "medium", status: f, avatar: p, badge: m, className: h, ref: g, ..._ }) => {
13
+ let v = m && n(m) ? t(m, "span") : f ? /* @__PURE__ */ a(i, {
14
+ status: f,
15
+ size: s(d)
16
+ }) : null;
17
+ return /* @__PURE__ */ o("div", {
18
+ ref: g,
19
+ className: e("inline-flex items-center gap-3", h),
20
+ ..._,
21
+ children: [/* @__PURE__ */ o("div", {
22
+ className: "relative inline-flex shrink-0",
23
+ children: [p && n(p) ? t(p, "span") : /* @__PURE__ */ a(r, {
24
+ src: u,
25
+ name: c,
26
+ size: d,
27
+ decorative: !0
28
+ }), v && /* @__PURE__ */ a("span", {
29
+ className: "absolute bottom-0 end-0 inline-flex",
30
+ children: v
31
+ })]
32
+ }), /* @__PURE__ */ o("div", {
33
+ className: "flex flex-col",
34
+ children: [/* @__PURE__ */ a("span", {
35
+ className: "font-semibold text-body-1",
36
+ children: c
37
+ }), l && /* @__PURE__ */ a("span", {
38
+ className: "text-caption-1 text-muted-foreground",
39
+ children: l
40
+ })]
41
+ })]
42
+ });
43
+ };
44
+ c.displayName = "Persona";
45
+ //#endregion
46
+ export { c as Persona };
47
+
48
+ //# sourceMappingURL=Persona.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Persona.mjs","names":["derivePresenceSize","size","Persona","props","badgeNode","badge","slotRendersContent","renderSlot","status","PresenceBadge","cn","className","avatar","Avatar","name","secondaryText"],"sources":["../../../src/components/data-display/Persona.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport type { PresenceStatus, Size, Slot } from '../../lib/types';\nimport { renderSlot, slotRendersContent } from '../../lib/slot';\nimport { Avatar } from './Avatar';\nimport { PresenceBadge } from './PresenceBadge';\n\n/** Properties for the Persona component. */\nexport interface PersonaProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Display name of the person. */\n name: string;\n /** Secondary text such as job title or email. */\n secondaryText?: string;\n /** URL of the person's avatar image. */\n src?: string;\n /** Size of the persona avatar.\n * @default 'medium'\n */\n size?: Size;\n /** Presence status shown as a badge on the avatar. Ignored when a `badge` is given. */\n status?: PresenceStatus;\n /**\n * Slot for a custom avatar element, replacing the built-in one. The name is already visible\n * next to it, so make a custom avatar decorative (e.g. `<Avatar decorative … />`). A value that\n * renders nothing (`null`, `false`, `''`, `0`, `NaN`, or an array, `Set` or generator of only\n * such items) counts as not given.\n */\n avatar?: Slot<'span'>;\n /**\n * Slot for a custom badge element. Takes precedence over `status`. A value that renders nothing\n * (`null`, `false`, `''`, `0`, `NaN`, e.g. `badge={count && <CounterBadge count={count} />}`,\n * or an array, `Set` or generator of only such items) counts as not given.\n */\n badge?: Slot<'span'>;\n /** Ref to the root `<div>`. */\n ref?: React.Ref<HTMLDivElement>;\n}\n\nfunction derivePresenceSize(size: Size): Size {\n return size === 'extra-small' || size === 'small' ? 'small' : 'medium';\n}\n\n/**\n * A person's avatar next to their name and optional secondary text (job title, email), with an\n * optional presence badge.\n *\n * The built-in avatar is decorative (`<Avatar decorative>`): the visible name is announced once,\n * not a second time as the avatar's image name. The presence badge stays exposed as a named image.\n *\n * @example\n * <Persona name=\"Jane Doe\" secondaryText=\"Designer\" status=\"available\" />\n */\nexport const Persona = ({\n name,\n secondaryText,\n src,\n size = 'medium',\n status,\n avatar,\n badge,\n className,\n ref,\n ...props\n}: PersonaProps) => {\n // A slot that renders nothing (`badge={count && …}` with count 0, an empty `.map()` result) is\n // not given (C-SLOTS), so the status badge and the built-in avatar apply.\n const badgeNode =\n badge && slotRendersContent(badge) ? (\n renderSlot(badge, 'span')\n ) : status ? (\n <PresenceBadge status={status} size={derivePresenceSize(size)} />\n ) : null;\n\n return (\n <div ref={ref} className={cn('inline-flex items-center gap-3', className)} {...props}>\n <div className=\"relative inline-flex shrink-0\">\n {avatar && slotRendersContent(avatar) ? (\n renderSlot(avatar, 'span')\n ) : (\n <Avatar src={src} name={name} size={size} decorative />\n )}\n {badgeNode && <span className=\"absolute bottom-0 end-0 inline-flex\">{badgeNode}</span>}\n </div>\n <div className=\"flex flex-col\">\n <span className=\"font-semibold text-body-1\">{name}</span>\n {secondaryText && (\n <span className=\"text-caption-1 text-muted-foreground\">{secondaryText}</span>\n )}\n </div>\n </div>\n );\n};\n\nPersona.displayName = 'Persona';\n"],"mappings":";;;;;;;;AAsCA,SAASA,EAAmB,GAAkB;CAC5C,OAAOC,MAAS,iBAAiBA,MAAS,UAAU,UAAU;AAChE;AAYA,IAAaC,KAAW,EACtB,SACA,kBACA,QACA,UAAO,UACP,WACA,WACA,UACA,cACA,QACA,GAAGC,QACe;CAGlB,IAAMC,IACJC,KAASC,EAAmBD,CAAK,IAC/BE,EAAWF,GAAO,MAAM,IACtBG,IACF,kBAACC,GAAD;EAAuB;EAAQ,MAAMT,EAAmBC,CAAI;CAAI,CAAA,IAC9D;CAEN,OACE,kBAAC,OAAD;EAAU;EAAK,WAAWS,EAAG,kCAAkCC,CAAS;EAAG,GAAIR;EAA/E,UAAA,CACE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACGS,KAAUN,EAAmBM,CAAM,IAClCL,EAAWK,GAAQ,MAAM,IAEzB,kBAACC,GAAD;IAAa;IAAW;IAAY;IAAM,YAAA;GAAY,CAAA,GAEvDT,KAAa,kBAAC,QAAD;IAAM,WAAU;IAAuC,UAAAA;GAAgB,CAAA,CAClF;EACL,CAAA,GAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,QAAD;IAAM,WAAU;IAA6B,UAAAU;GAAW,CAAA,GACvDC,KACC,kBAAC,QAAD;IAAM,WAAU;IAAwC,UAAAA;GAAoB,CAAA,CAE3E;EACF,CAAA,CAAA;;AAET;AAEA,EAAQ,cAAc"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/styles.cjs"),r=require("../../lib/icons.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o={available:{glyph:`check`,Icon:r.PresenceAvailableIcon,className:`bg-presence-available text-presence-glyph`},busy:{glyph:`solid`,Icon:r.PresenceBusyIcon,className:`bg-presence-busy text-presence-busy`},away:{glyph:`clock`,Icon:r.PresenceAwayIcon,className:`bg-presence-away text-presence-glyph`},offline:{glyph:`ring-x`,Icon:r.PresenceOfflineIcon,className:`bg-background text-presence-offline`},dnd:{glyph:`bar`,Icon:r.PresenceDndIcon,className:`bg-presence-busy text-presence-glyph`},oof:{glyph:`arrow`,Icon:r.PresenceOofIcon,className:`bg-presence-oof text-presence-glyph`}},s={available:`Available`,busy:`Busy`,away:`Away`,offline:`Offline`,dnd:`Do not disturb`,oof:`Out of office`},c={"extra-small":`size-2`,small:`size-2.5`,medium:`size-3`,large:`size-4`,"extra-large":`size-5`},l=({status:e,size:r=`medium`,className:i,ref:l,...u})=>{let{glyph:d,Icon:f,className:p}=o[e];return(0,a.jsx)(`span`,{ref:l,role:`img`,"aria-label":s[e],"data-glyph":d,...u,className:t.cn(`inline-flex shrink-0 items-center justify-center rounded-full ring-2 ring-background`,`forced-colors:border`,n.forcedColors.border,c[r],p,i),children:(0,a.jsx)(f,{size:`100%`,className:t.cn(`size-full`,d===`arrow`&&`wave-rtl:-scale-x-100`)})})};l.displayName=`PresenceBadge`,exports.PresenceBadge=l;
2
+ //# sourceMappingURL=PresenceBadge.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PresenceBadge.cjs","names":["PresenceAvailableIcon","PresenceBusyIcon","PresenceAwayIcon","PresenceOfflineIcon","PresenceDndIcon","PresenceOofIcon","cn","forcedColors","require_runtime","require_cn","require_styles","require_icons","react","react_jsx_runtime","statusStyles","statusLabels","sizeClasses","PresenceBadge","props","statusClassName","status","glyph","size","className","Icon"],"sources":["../../../src/components/data-display/PresenceBadge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport {\n PresenceAvailableIcon,\n PresenceAwayIcon,\n PresenceBusyIcon,\n PresenceDndIcon,\n PresenceOfflineIcon,\n PresenceOofIcon,\n} from '../../lib/icons';\nimport type { IconComponent } from '../../lib/icons';\nimport { forcedColors } from '../../lib/styles';\nimport type { PresenceStatus, Size } from '../../lib/types';\n\n/** Properties for the PresenceBadge component. */\nexport interface PresenceBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Presence status to display. */\n status: PresenceStatus;\n /** Size of the presence indicator.\n * @default 'medium'\n */\n size?: Size;\n /** Ref to the root `<span>`. */\n ref?: React.Ref<HTMLSpanElement>;\n}\n\n/** The shape drawn for a status, exposed as `data-glyph` (styling hook and test contract). */\ntype PresenceGlyph = 'check' | 'solid' | 'clock' | 'ring-x' | 'bar' | 'arrow';\n\n/**\n * Per status: the glyph name, its shared icon (src/lib/icons.tsx, drawn in a 16×16 box that the\n * badge circle fills) and the colors. Busy is a full disc in `currentColor`: forced-colors mode\n * replaces the background with Canvas but forces `color` to CanvasText, so busy stays a solid dot\n * instead of an empty ring.\n */\nconst statusStyles: Record<\n PresenceStatus,\n { glyph: PresenceGlyph; Icon: IconComponent; className: string }\n> = {\n available: {\n glyph: 'check',\n Icon: PresenceAvailableIcon,\n className: 'bg-presence-available text-presence-glyph',\n },\n busy: {\n glyph: 'solid',\n Icon: PresenceBusyIcon,\n className: 'bg-presence-busy text-presence-busy',\n },\n away: {\n glyph: 'clock',\n Icon: PresenceAwayIcon,\n className: 'bg-presence-away text-presence-glyph',\n },\n offline: {\n glyph: 'ring-x',\n Icon: PresenceOfflineIcon,\n className: 'bg-background text-presence-offline',\n },\n dnd: { glyph: 'bar', Icon: PresenceDndIcon, className: 'bg-presence-busy text-presence-glyph' },\n oof: { glyph: 'arrow', Icon: PresenceOofIcon, className: 'bg-presence-oof text-presence-glyph' },\n};\n\nconst statusLabels: Record<PresenceStatus, string> = {\n available: 'Available',\n busy: 'Busy',\n away: 'Away',\n offline: 'Offline',\n dnd: 'Do not disturb',\n oof: 'Out of office',\n};\n\nconst sizeClasses: Record<Size, string> = {\n 'extra-small': 'size-2', // 8px\n small: 'size-2.5', // 10px\n medium: 'size-3', // 12px\n large: 'size-4', // 16px\n 'extra-large': 'size-5', // 20px\n};\n\n/**\n * A person's availability as a small badge, usually placed on an `Avatar` (`badge` prop).\n *\n * Every status has its own shape, so it is not conveyed by color alone: available (check),\n * busy (solid), away (clock), offline (hollow ring with an X), do not disturb (bar), out of office\n * (arrow, mirrored in right-to-left layouts). A background-colored ring separates it from the\n * avatar. It is a named image (`role=\"img\"`, `aria-label` = the status name; pass `aria-label` to\n * localise or extend it) and never a live region.\n *\n * @example\n * <PresenceBadge status=\"busy\" />\n */\nexport const PresenceBadge = ({\n status,\n size = 'medium',\n className,\n ref,\n ...props\n}: PresenceBadgeProps) => {\n const { glyph, Icon, className: statusClassName } = statusStyles[status];\n\n return (\n <span\n ref={ref}\n role=\"img\"\n aria-label={statusLabels[status]}\n data-glyph={glyph}\n {...props}\n className={cn(\n 'inline-flex shrink-0 items-center justify-center rounded-full ring-2 ring-background',\n 'forced-colors:border',\n forcedColors.border,\n sizeClasses[size],\n statusClassName,\n className,\n )}\n >\n <Icon size=\"100%\" className={cn('size-full', glyph === 'arrow' && 'wave-rtl:-scale-x-100')} />\n </span>\n );\n};\n\nPresenceBadge.displayName = 'PresenceBadge';\n"],"mappings":"iPAmCA,IAAMc,EAGF,CACF,UAAW,CACT,MAAO,QACP,KAAMd,EAAAA,sBACN,UAAW,2CACb,EACA,KAAM,CACJ,MAAO,QACP,KAAMC,EAAAA,iBACN,UAAW,qCACb,EACA,KAAM,CACJ,MAAO,QACP,KAAMC,EAAAA,iBACN,UAAW,sCACb,EACA,QAAS,CACP,MAAO,SACP,KAAMC,EAAAA,oBACN,UAAW,qCACb,EACA,IAAK,CAAE,MAAO,MAAO,KAAMC,EAAAA,gBAAiB,UAAW,sCAAuC,EAC9F,IAAK,CAAE,MAAO,QAAS,KAAMC,EAAAA,gBAAiB,UAAW,qCAAsC,CACjG,EAEMU,EAA+C,CACnD,UAAW,YACX,KAAM,OACN,KAAM,OACN,QAAS,UACT,IAAK,iBACL,IAAK,eACP,EAEMC,EAAoC,CACxC,cAAe,SACf,MAAO,WACP,OAAQ,SACR,MAAO,SACP,cAAe,QACjB,EAcaC,GAAiB,CAC5B,SACA,OAAO,SACP,YACA,MACA,GAAGC,KACqB,CACxB,GAAM,CAAE,QAAO,OAAM,UAAWC,GAAoBL,EAAaM,GAEjE,OACE,EAAAP,EAAA,IAAA,CAAC,OAAD,CACO,MACL,KAAK,MACL,aAAYE,EAAaK,GACzB,aAAYC,EACZ,GAAIH,EACJ,UAAWZ,EAAAA,GACT,uFACA,uBACAC,EAAAA,aAAa,OACbS,EAAYM,GACZH,EACAI,CACF,EAEA,UAAA,EAAAV,EAAA,IAAA,CAACW,EAAD,CAAM,KAAK,OAAO,UAAWlB,EAAAA,GAAG,YAAae,IAAU,SAAW,uBAAuB,CAAI,CAAA,CACzF,CAAA,CAEV,EAEA,EAAc,YAAc"}
@@ -0,0 +1,71 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/cn.mjs";
3
+ import { forcedColors as t } from "../../lib/styles.mjs";
4
+ import { PresenceAvailableIcon as n, PresenceAwayIcon as r, PresenceBusyIcon as i, PresenceDndIcon as a, PresenceOfflineIcon as o, PresenceOofIcon as s } from "../../lib/icons.mjs";
5
+ import "react";
6
+ import { jsx as c } from "react/jsx-runtime";
7
+ //#region src/components/data-display/PresenceBadge.tsx
8
+ var l = {
9
+ available: {
10
+ glyph: "check",
11
+ Icon: n,
12
+ className: "bg-presence-available text-presence-glyph"
13
+ },
14
+ busy: {
15
+ glyph: "solid",
16
+ Icon: i,
17
+ className: "bg-presence-busy text-presence-busy"
18
+ },
19
+ away: {
20
+ glyph: "clock",
21
+ Icon: r,
22
+ className: "bg-presence-away text-presence-glyph"
23
+ },
24
+ offline: {
25
+ glyph: "ring-x",
26
+ Icon: o,
27
+ className: "bg-background text-presence-offline"
28
+ },
29
+ dnd: {
30
+ glyph: "bar",
31
+ Icon: a,
32
+ className: "bg-presence-busy text-presence-glyph"
33
+ },
34
+ oof: {
35
+ glyph: "arrow",
36
+ Icon: s,
37
+ className: "bg-presence-oof text-presence-glyph"
38
+ }
39
+ }, u = {
40
+ available: "Available",
41
+ busy: "Busy",
42
+ away: "Away",
43
+ offline: "Offline",
44
+ dnd: "Do not disturb",
45
+ oof: "Out of office"
46
+ }, d = {
47
+ "extra-small": "size-2",
48
+ small: "size-2.5",
49
+ medium: "size-3",
50
+ large: "size-4",
51
+ "extra-large": "size-5"
52
+ }, f = ({ status: n, size: r = "medium", className: i, ref: a, ...o }) => {
53
+ let { glyph: s, Icon: f, className: p } = l[n];
54
+ return /* @__PURE__ */ c("span", {
55
+ ref: a,
56
+ role: "img",
57
+ "aria-label": u[n],
58
+ "data-glyph": s,
59
+ ...o,
60
+ className: e("inline-flex shrink-0 items-center justify-center rounded-full ring-2 ring-background", "forced-colors:border", t.border, d[r], p, i),
61
+ children: /* @__PURE__ */ c(f, {
62
+ size: "100%",
63
+ className: e("size-full", s === "arrow" && "wave-rtl:-scale-x-100")
64
+ })
65
+ });
66
+ };
67
+ f.displayName = "PresenceBadge";
68
+ //#endregion
69
+ export { f as PresenceBadge };
70
+
71
+ //# sourceMappingURL=PresenceBadge.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PresenceBadge.mjs","names":["statusStyles","PresenceAvailableIcon","PresenceBusyIcon","PresenceAwayIcon","PresenceOfflineIcon","PresenceDndIcon","PresenceOofIcon","statusLabels","sizeClasses","PresenceBadge","props","statusClassName","status","glyph","cn","forcedColors","size","className","Icon"],"sources":["../../../src/components/data-display/PresenceBadge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport {\n PresenceAvailableIcon,\n PresenceAwayIcon,\n PresenceBusyIcon,\n PresenceDndIcon,\n PresenceOfflineIcon,\n PresenceOofIcon,\n} from '../../lib/icons';\nimport type { IconComponent } from '../../lib/icons';\nimport { forcedColors } from '../../lib/styles';\nimport type { PresenceStatus, Size } from '../../lib/types';\n\n/** Properties for the PresenceBadge component. */\nexport interface PresenceBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Presence status to display. */\n status: PresenceStatus;\n /** Size of the presence indicator.\n * @default 'medium'\n */\n size?: Size;\n /** Ref to the root `<span>`. */\n ref?: React.Ref<HTMLSpanElement>;\n}\n\n/** The shape drawn for a status, exposed as `data-glyph` (styling hook and test contract). */\ntype PresenceGlyph = 'check' | 'solid' | 'clock' | 'ring-x' | 'bar' | 'arrow';\n\n/**\n * Per status: the glyph name, its shared icon (src/lib/icons.tsx, drawn in a 16×16 box that the\n * badge circle fills) and the colors. Busy is a full disc in `currentColor`: forced-colors mode\n * replaces the background with Canvas but forces `color` to CanvasText, so busy stays a solid dot\n * instead of an empty ring.\n */\nconst statusStyles: Record<\n PresenceStatus,\n { glyph: PresenceGlyph; Icon: IconComponent; className: string }\n> = {\n available: {\n glyph: 'check',\n Icon: PresenceAvailableIcon,\n className: 'bg-presence-available text-presence-glyph',\n },\n busy: {\n glyph: 'solid',\n Icon: PresenceBusyIcon,\n className: 'bg-presence-busy text-presence-busy',\n },\n away: {\n glyph: 'clock',\n Icon: PresenceAwayIcon,\n className: 'bg-presence-away text-presence-glyph',\n },\n offline: {\n glyph: 'ring-x',\n Icon: PresenceOfflineIcon,\n className: 'bg-background text-presence-offline',\n },\n dnd: { glyph: 'bar', Icon: PresenceDndIcon, className: 'bg-presence-busy text-presence-glyph' },\n oof: { glyph: 'arrow', Icon: PresenceOofIcon, className: 'bg-presence-oof text-presence-glyph' },\n};\n\nconst statusLabels: Record<PresenceStatus, string> = {\n available: 'Available',\n busy: 'Busy',\n away: 'Away',\n offline: 'Offline',\n dnd: 'Do not disturb',\n oof: 'Out of office',\n};\n\nconst sizeClasses: Record<Size, string> = {\n 'extra-small': 'size-2', // 8px\n small: 'size-2.5', // 10px\n medium: 'size-3', // 12px\n large: 'size-4', // 16px\n 'extra-large': 'size-5', // 20px\n};\n\n/**\n * A person's availability as a small badge, usually placed on an `Avatar` (`badge` prop).\n *\n * Every status has its own shape, so it is not conveyed by color alone: available (check),\n * busy (solid), away (clock), offline (hollow ring with an X), do not disturb (bar), out of office\n * (arrow, mirrored in right-to-left layouts). A background-colored ring separates it from the\n * avatar. It is a named image (`role=\"img\"`, `aria-label` = the status name; pass `aria-label` to\n * localise or extend it) and never a live region.\n *\n * @example\n * <PresenceBadge status=\"busy\" />\n */\nexport const PresenceBadge = ({\n status,\n size = 'medium',\n className,\n ref,\n ...props\n}: PresenceBadgeProps) => {\n const { glyph, Icon, className: statusClassName } = statusStyles[status];\n\n return (\n <span\n ref={ref}\n role=\"img\"\n aria-label={statusLabels[status]}\n data-glyph={glyph}\n {...props}\n className={cn(\n 'inline-flex shrink-0 items-center justify-center rounded-full ring-2 ring-background',\n 'forced-colors:border',\n forcedColors.border,\n sizeClasses[size],\n statusClassName,\n className,\n )}\n >\n <Icon size=\"100%\" className={cn('size-full', glyph === 'arrow' && 'wave-rtl:-scale-x-100')} />\n </span>\n );\n};\n\nPresenceBadge.displayName = 'PresenceBadge';\n"],"mappings":";;;;;;;AAmCA,IAAMA,IAGF;CACF,WAAW;EACT,OAAO;EACP,MAAMC;EACN,WAAW;CACb;CACA,MAAM;EACJ,OAAO;EACP,MAAMC;EACN,WAAW;CACb;CACA,MAAM;EACJ,OAAO;EACP,MAAMC;EACN,WAAW;CACb;CACA,SAAS;EACP,OAAO;EACP,MAAMC;EACN,WAAW;CACb;CACA,KAAK;EAAE,OAAO;EAAO,MAAMC;EAAiB,WAAW;CAAuC;CAC9F,KAAK;EAAE,OAAO;EAAS,MAAMC;EAAiB,WAAW;CAAsC;AACjG,GAEMC,IAA+C;CACnD,WAAW;CACX,MAAM;CACN,MAAM;CACN,SAAS;CACT,KAAK;CACL,KAAK;AACP,GAEMC,IAAoC;CACxC,eAAe;CACf,OAAO;CACP,QAAQ;CACR,OAAO;CACP,eAAe;AACjB,GAcaC,KAAiB,EAC5B,WACA,UAAO,UACP,cACA,QACA,GAAGC,QACqB;CACxB,IAAM,EAAE,UAAO,SAAM,WAAWC,MAAoBX,EAAaY;CAEjE,OACE,kBAAC,QAAD;EACO;EACL,MAAK;EACL,cAAYL,EAAaK;EACzB,cAAYC;EACZ,GAAIH;EACJ,WAAWI,EACT,wFACA,wBACAC,EAAa,QACbP,EAAYQ,IACZL,GACAM,CACF;EAEA,UAAA,kBAACC,GAAD;GAAM,MAAK;GAAO,WAAWJ,EAAG,aAAaD,MAAU,WAAW,uBAAuB;EAAI,CAAA;CACzF,CAAA;AAEV;AAEA,EAAc,cAAc"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/children.cjs"),r=require("../../lib/dev.cjs"),i=require("../../lib/slot.cjs"),a=require("../../hooks/useId.cjs"),o=require("../../lib/styles.cjs"),s=require("../button/Button.cjs"),c=require("../../lib/icons.cjs"),l=require("../../lib/mergeProps.cjs"),u=require("../button/Button.slots.cjs"),d=require("../../lib/labelInName.cjs");let f=require("react");f=e.__toESM(f,1);let p=require("react/jsx-runtime");var m=new Set([`type`,`disabled`,`autoFocus`,`form`,`formAction`,`formEncType`,`formMethod`,`formNoValidate`,`formTarget`,`name`,`value`]),h=/^on[A-Z]/,g=new Set([`aria-label`,`aria-labelledby`]),_=()=>{};function v(e){let t={},n=!1;for(let[r,i]of Object.entries(e))g.has(r)?i!==void 0&&(n=!0):t[r]=i;return{props:t,ignoredName:n}}var y=`inline-flex items-center justify-center`;function b(e){if(typeof e!=`object`||!e||f.isValidElement(e)||Symbol.iterator in e)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function x(){return(0,p.jsx)(c.DismissIcon,{size:12})}function S(e){if(!i.slotRendersContent(e))return{buttonProps:null,content:x(),warning:null,ignoredName:!1,contentMayName:!1,literalTextLabel:!1,disabledFocusable:!1};let t=n.getElementType(e);if(f.isValidElement(e)&&(t===`button`||t===s.Button)){let{children:n,dangerouslySetInnerHTML:r,...a}=e.props,o=t===s.Button,c=a;if(o){c={};for(let[e,t]of Object.entries(a))u.BUTTON_OWN_PROP_KEYS.has(e)||(c[e]=t)}let l=o?a.icon:void 0,{props:f,ignoredName:m}=v(c),h=i.slotRendersContent(l)?i.renderSlot(l,`span`,y,{"aria-hidden":!0}):null,g=r==null?i.materialiseSlotContent(n):(0,p.jsx)(`span`,{className:y,dangerouslySetInnerHTML:r});return{buttonProps:f,content:h||i.slotRendersContent(g)?u.placeButtonIcon(h,g,o&&a.iconPosition):x(),warning:`button-element`,ignoredName:m,contentMayName:!0,literalTextLabel:d.hasTextLabel(g),disabledFocusable:o&&!!a.disabledFocusable}}if(b(e)){let t=e.as===s.Button,n=e.as===`button`||t||Object.keys(e).some(e=>m.has(e)||h.test(e)),r={},a={},o={},c=!1;for(let[i,s]of Object.entries(e))i===`as`?s!==`button`&&!t&&(a.as=s):t&&u.BUTTON_OWN_PROP_KEYS.has(i)?o[i]=s:g.has(i)?s!==void 0&&(c=!0):i===`children`||i===`dangerouslySetInnerHTML`?a[i]=s:n||i.startsWith(`aria-`)&&i!==`aria-hidden`?r[i]=s:a[i]=s;return i.slotRendersContent(o.icon)?a.children=u.placeButtonIcon(i.renderSlot(o.icon,`span`,y),i.materialiseSlotContent(a.children),o.iconPosition):i.slotWrapsDefaultContent(a.as??`span`,a)&&(a.children=x()),{buttonProps:n||Object.keys(r).length>0?r:null,content:i.renderSlot(a,`span`,y,{"aria-hidden":!0}),warning:n?`button-object`:null,ignoredName:c,contentMayName:!1,literalTextLabel:!1,disabledFocusable:!!o.disabledFocusable}}return{buttonProps:null,content:i.renderSlot(e,`span`,y,{"aria-hidden":!0}),warning:null,ignoredName:!1,contentMayName:!1,literalTextLabel:!1,disabledFocusable:!1}}var C=e=>{let{as:n,dismissible:i,onDismiss:s,dismissIcon:c,dismissLabel:m=`Dismiss`,className:h,children:g,ref:v,...y}=e,b=n??`span`,x=a.useId(`tag-content`),C=a.useId(`tag-dismiss`),w=a.useId(`tag-dismiss-text`),{buttonProps:T,content:E,warning:D,ignoredName:O,contentMayName:k,literalTextLabel:A,disabledFocusable:j}=S(i?c:void 0),[M,N]=f.useState(null),P=f.useCallback(e=>M?d.observeTextLabel(M,e):_,[M]),F=f.useSyncExternalStore(P,()=>M?d.hasRenderedTextLabel(M):A,()=>A),I=k&&F;f.useEffect(()=>{D===`button-element`?r.warnOnce(`Tag:dismissIcon-button`,"Tag: `dismissIcon` received a button. Its props were merged into the built-in dismiss button (a button cannot contain another button), which is named by its text label (or `dismissLabel`) and the tag content. Pass icon content instead, e.g. `dismissIcon={<CloseIcon />}`, and handle the dismissal in `onDismiss`."):D===`button-object`&&r.warnDeprecated(`Tag`,`dismissIcon={{ onClick, type, disabled, … }} (button props on the slot object)`,`onDismiss and icon content in dismissIcon`,"Its props are merged onto the built-in dismiss button, which is named by `dismissLabel` and the tag content.")},[D]);let L=i===void 0&&(s!==void 0||c!==void 0);f.useEffect(()=>{L&&r.warnOnce(`Tag:dismiss-without-dismissible`,"Tag: `onDismiss` and `dismissIcon` take effect only with `dismissible`; no dismiss button was rendered. Add `dismissible` to render it.")},[L]),f.useEffect(()=>{O&&r.warnOnce(`Tag:dismissIcon-name`,'Tag: `aria-label`/`aria-labelledby` on `dismissIcon` are ignored. The dismiss button is named by `dismissLabel` (default "Dismiss") and the tag content, e.g. "Dismiss Cherry"; set `dismissLabel` to change or localise it.')},[O]);let R={type:`button`,className:t.cn(`inline-flex size-5 shrink-0 items-center justify-center rounded-full border-0 bg-transparent p-0 text-foreground`,`not-disabled:not-aria-disabled:hover:bg-subtle-pressed`,`disabled:cursor-not-allowed disabled:opacity-50`,u.mergedAriaDisabledClasses,o.focusRing),"aria-labelledby":`${I?w:C} ${x}`};s&&(R.onClick=s);let z=T?l.mergeProps(R,T):R;return(0,p.jsxs)(b,{ref:v,className:t.cn(`inline-flex items-center gap-1 rounded-full bg-muted py-1 ps-3 text-body-1 text-foreground`,i?`pe-1.5`:`pe-3`,h),...y,children:[(0,p.jsx)(`span`,{id:x,className:`inline-flex items-center gap-1`,children:g}),i&&(0,p.jsxs)(`button`,{...z,type:z.type??`button`,...j?u.MERGED_DISABLED_FOCUSABLE_PROPS:void 0,children:[(0,p.jsx)(`span`,{id:C,className:`sr-only`,children:m}),k?(0,p.jsx)(`span`,{id:w,ref:N,className:`inline-flex items-center justify-center gap-[inherit]`,children:E}):E]})]})};C.displayName=`Tag`,exports.Tag=C;
2
+ //# sourceMappingURL=Tag.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tag.cjs","names":["React","DismissIcon","slotRendersContent","getElementType","Button","BUTTON_OWN_PROP_KEYS","renderSlot","materialiseSlotContent","placeButtonIcon","hasTextLabel","slotWrapsDefaultContent","useId","observeTextLabel","hasRenderedTextLabel","cn","mergedAriaDisabledClasses","focusRing","mergeProps","MERGED_DISABLED_FOCUSABLE_PROPS","require_runtime","require_cn","require_children","require_dev","require_slot","require_useId","require_styles","require_Button","require_icons","require_mergeProps","require_Button_slots","require_labelInName","react","react_jsx_runtime","BUTTON_ONLY_KEYS","HANDLER_KEY","NAME_KEYS","noop","withoutName","result","ignoredName","key","value","props","iconClassName","isPlainObject","proto","defaultDismissContent","resolveDismissSlot","slot","elementType","markup","elementProps","isWaveButton","slotProps","icon","buttonProps","iconNode","ownContent","children","asWaveButton","isButtonObject","contentProps","ownProps","Tag","rest","Component","as","contentId","dismissLabelId","dismissTextId","slotButtonProps","dismissible","dismissIcon","labelTarget","setLabelTarget","subscribeToContent","onChange","contentHasTextLabel","literalTextLabel","namedByContent","contentMayName","warning","dismissPropsIgnored","onDismiss","ownButtonProps","dismissButtonProps","className","disabledFocusable","dismissLabel","content"],"sources":["../../../src/components/data-display/Tag.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { warnDeprecated, warnOnce } from '../../lib/dev';\nimport { mergeProps } from '../../lib/mergeProps';\nimport { getElementType } from '../../lib/children';\nimport {\n materialiseSlotContent,\n renderSlot,\n slotRendersContent,\n slotWrapsDefaultContent,\n} from '../../lib/slot';\nimport { focusRing } from '../../lib/styles';\nimport { DismissIcon } from '../../lib/icons';\nimport { hasRenderedTextLabel, hasTextLabel, observeTextLabel } from '../../lib/labelInName';\nimport type { Slot, SlotObject } from '../../lib/slot';\nimport type { PolymorphicComponent, PolymorphicProps } from '../../lib/polymorphic';\nimport { useId } from '../../hooks/useId';\nimport { Button } from '../button/Button';\nimport {\n BUTTON_OWN_PROP_KEYS,\n MERGED_DISABLED_FOCUSABLE_PROPS,\n mergedAriaDisabledClasses,\n placeButtonIcon,\n} from '../button/Button.slots';\n\n/**\n * The Tag's own props (the XOwnProps rule of `PolymorphicProps`: component-specific props only).\n * Every other prop comes from the rendered element (`as`, default `span`).\n */\nexport interface TagOwnProps {\n /**\n * Whether the tag renders a dismiss button. `onDismiss` and `dismissIcon` take effect only with\n * it (a development warning says so when they are passed without it).\n */\n dismissible?: boolean;\n /**\n * Called when the dismiss button is activated (click, Enter or Space). Passing it does not render\n * the dismiss button: set `dismissible` too. When it removes the tag, move focus yourself (see\n * \"Focus after dismissal\" on {@link Tag}).\n */\n onDismiss?: () => void;\n /**\n * Content of the dismiss button (an icon). The Tag always renders its own dismiss\n * `<button type=\"button\">`, wired to `onDismiss` and named by `dismissLabel` plus the tag\n * content; this slot only replaces the icon inside it.\n *\n * A `<button>` element or a Wave `Button` passed here is not nested (a button cannot contain a\n * button): its props are merged into the dismiss button (its `onClick` runs first and can call\n * `preventDefault()` to skip `onDismiss`) and a development warning recommends icon content.\n * A Wave `Button`'s own props are not attributes: its `icon` becomes decorative content before\n * its children (after them with `iconPosition=\"after\"`), `disabledFocusable` makes the dismiss\n * button unavailable but focusable as on the Button (`onDismiss` is not called), and\n * `appearance` and `size` are ignored.\n * A slot object with button props (`type`, `disabled`, event handlers, `as: 'button'` or\n * `as: Button`) is the deprecated 0.4 button-object form: its props (`className`, `id`,\n * `aria-*`, handlers, …) are merged onto the dismiss button, except its content (`children`,\n * `dangerouslySetInnerHTML`, rendered inside the button) and the naming attributes (see below);\n * for `as: Button`, the Button's own props apply as for a `Button` element — pass icon content\n * and use `onDismiss` instead.\n * The `aria-*` attributes of an icon slot object also go to the dismiss button, because the icon\n * is `aria-hidden`.\n *\n * The dismiss button's name is `dismissLabel` plus the tag content (\"Dismiss Cherry\"):\n * `aria-label` and `aria-labelledby` on the slot are ignored (development warning). Icon\n * content is decorative (`aria-hidden`). The children of a merged `<button>`/`Button` (or its\n * `dangerouslySetInnerHTML` markup) are rendered as is inside the dismiss button, next to the\n * decorative `icon` of a Wave `Button`: when they render a text label (at least two letters or\n * digits outside `aria-hidden`/`hidden` content, text from components such as translations\n * included), that text replaces `dismissLabel` in the name, so the name contains the visible\n * label (WCAG 2.5.3): `<button>Remove</button>` or\n * `<Button icon={<CloseIcon />}>Remove</Button>` on \"Cherry\" is named \"Remove Cherry\". An icon or\n * a lone character (`x`, `×`) keeps \"Dismiss Cherry\". Text hidden only with CSS still counts as\n * the label.\n *\n * When the slot renders no content (`[]`, `<></>`, a childless merged button, a slot object\n * without `children`), the default dismiss icon is shown; a slot object then styles it, e.g.\n * `{ className: 'text-error' }`. A slot object that renders a component or a void element\n * (`{ as: CloseIcon }`, `{ as: 'img', src, alt: '' }`) or sets `dangerouslySetInnerHTML` is the\n * icon itself: no default icon is added. Only takes effect with `dismissible`.\n */\n dismissIcon?: Slot<'span'> | SlotObject<'button'>;\n /**\n * Visually hidden text that names the dismiss button together with the tag content\n * (`aria-labelledby`), e.g. \"Dismiss Cherry\". Localise it here. A text label rendered by a\n * merged `<button>` slot replaces it (see `dismissIcon`).\n * @default 'Dismiss'\n */\n dismissLabel?: string;\n}\n\n/**\n * Props of {@link Tag} rendered as `C` (default `'span'`). `TagProps` without a type argument is\n * the 0.4 name.\n */\nexport type TagProps<C extends React.ElementType = 'span'> = PolymorphicProps<C, TagOwnProps>;\n\n/** The props the implementation reads, for any `as` (the public typing is `PolymorphicComponent`). */\ntype TagImplProps = TagOwnProps &\n React.HTMLAttributes<HTMLElement> & {\n as?: React.ElementType;\n ref?: React.Ref<HTMLElement>;\n };\n\ntype UnknownProps = Record<string, unknown>;\n\n/** Attributes that only make sense on the dismiss `<button>` itself. */\nconst BUTTON_ONLY_KEYS: ReadonlySet<string> = new Set([\n 'type',\n 'disabled',\n 'autoFocus',\n 'form',\n 'formAction',\n 'formEncType',\n 'formMethod',\n 'formNoValidate',\n 'formTarget',\n 'name',\n 'value',\n]);\n\nconst HANDLER_KEY = /^on[A-Z]/;\n\n/**\n * Naming attributes a slot cannot set: the Tag names its dismiss button itself\n * (`aria-labelledby` = `dismissLabel` + tag content, data-display#10), so these are dropped.\n */\nconst NAME_KEYS: ReadonlySet<string> = new Set(['aria-label', 'aria-labelledby']);\n\n/** The props of a merged `<button>` or Wave `Button` that the Tag reads itself. */\ninterface WaveButtonSlotProps extends UnknownProps {\n icon?: Slot<'span'>;\n iconPosition?: unknown;\n disabledFocusable?: unknown;\n children?: React.ReactNode;\n dangerouslySetInnerHTML?: React.HTMLAttributes<HTMLElement>['dangerouslySetInnerHTML'];\n}\n\ninterface ResolvedDismissSlot {\n /** Props merged onto the wired dismiss button (`null`: none). */\n buttonProps: UnknownProps | null;\n /** What renders inside the dismiss button. */\n content: React.ReactNode;\n /** Which development warning the slot needs. */\n warning: 'button-element' | 'button-object' | null;\n /** Whether the slot passed `aria-label`/`aria-labelledby`, which the Tag ignores. */\n ignoredName: boolean;\n /**\n * `true` when the content is rendered as is (a merged `<button>`/`Button`), so a text label in it\n * replaces `dismissLabel` in the name (C-SLOTS naming, WCAG 2.5.3); `false` when the content is\n * decorative (`aria-hidden`).\n */\n contentMayName: boolean;\n /**\n * Whether the literal content contains a text label: the name for the server render and the\n * first client render. After mount the rendered content decides.\n */\n literalTextLabel: boolean;\n /**\n * Whether a merged Wave `Button` set `disabledFocusable`: the dismiss button is then unavailable\n * but focusable, as the Button would be.\n */\n disabledFocusable: boolean;\n}\n\nconst noop = () => {};\n\n/** `props` without the naming attributes, and whether any was set. */\nfunction withoutName(props: UnknownProps): { props: UnknownProps; ignoredName: boolean } {\n const result: UnknownProps = {};\n let ignoredName = false;\n for (const [key, value] of Object.entries(props)) {\n if (NAME_KEYS.has(key)) {\n if (value !== undefined) ignoredName = true;\n } else {\n result[key] = value;\n }\n }\n return { props: result, ignoredName };\n}\n\nconst iconClassName = 'inline-flex items-center justify-center';\n\nfunction isPlainObject(value: unknown): value is UnknownProps {\n if (typeof value !== 'object' || value === null) return false;\n if (React.isValidElement(value) || Symbol.iterator in value) return false;\n const proto: unknown = Object.getPrototypeOf(value);\n return proto === null || proto === Object.prototype;\n}\n\n/** The decorative default dismiss glyph. */\nfunction defaultDismissContent(): React.ReactNode {\n return <DismissIcon size={12} />;\n}\n\n/**\n * Splits the dismissIcon slot into dismiss-button props and icon content (C-SLOTS). The icon\n * content is `aria-hidden`, so no attribute that means something to assistive technology stays on\n * it: button-form props go to the dismiss button, and so do the `aria-*` attributes of an icon slot\n * object; the naming attributes are dropped (see {@link NAME_KEYS}).\n *\n * Content that renders nothing (`[]`, `<></>`, a childless merged button, a slot object without\n * `children`) shows the default icon, so the dismiss button is never an empty, invisible Tab stop.\n */\nfunction resolveDismissSlot(slot: TagOwnProps['dismissIcon']): ResolvedDismissSlot {\n if (!slotRendersContent(slot)) {\n return {\n buttonProps: null,\n content: defaultDismissContent(),\n warning: null,\n ignoredName: false,\n contentMayName: false,\n literalTextLabel: false,\n disabledFocusable: false,\n };\n }\n\n // A `<button>` or a Wave `Button` (also one written in a Server Component, whose type arrives as\n // a lazy reference) is merged into the dismiss button. Its content is rendered as is, after the\n // Button's icon, which is decorative (as in MessageBar and SearchBox); its text label names it.\n const elementType = getElementType(slot as React.ReactNode);\n if (\n React.isValidElement<WaveButtonSlotProps>(slot) &&\n (elementType === 'button' || elementType === Button)\n ) {\n const { children, dangerouslySetInnerHTML: markup, ...elementProps } = slot.props;\n const isWaveButton = elementType === Button;\n let slotProps: UnknownProps = elementProps;\n if (isWaveButton) {\n // Wave Button's own props are not attributes: `icon`, `iconPosition` and\n // `disabledFocusable` are applied here, the others (`appearance`, `size`) are dropped.\n slotProps = {};\n for (const [key, value] of Object.entries(elementProps)) {\n if (!BUTTON_OWN_PROP_KEYS.has(key)) slotProps[key] = value;\n }\n }\n const icon = isWaveButton ? elementProps.icon : undefined;\n const { props: buttonProps, ignoredName } = withoutName(slotProps);\n const iconNode = slotRendersContent(icon)\n ? renderSlot(icon, 'span', iconClassName, { 'aria-hidden': true })\n : null;\n // A generator is read once by the check; its items are what renders (and names the button).\n // Markup of the merged button (`dangerouslySetInnerHTML`) is its content as well: the dismiss\n // button holds its own name text, so the markup renders in a span inside it.\n const ownContent =\n markup != null ? (\n <span className={iconClassName} dangerouslySetInnerHTML={markup} />\n ) : (\n materialiseSlotContent(children)\n );\n return {\n buttonProps,\n content:\n iconNode || slotRendersContent(ownContent)\n ? placeButtonIcon(iconNode, ownContent, isWaveButton && elementProps.iconPosition)\n : defaultDismissContent(),\n warning: 'button-element',\n ignoredName,\n contentMayName: true,\n literalTextLabel: hasTextLabel(ownContent),\n disabledFocusable: isWaveButton && Boolean(elementProps.disabledFocusable),\n };\n }\n\n if (isPlainObject(slot)) {\n // 0.4 rendered the whole object as the dismiss element, so an object with button props\n // describes the button: everything but its content goes to the dismiss button. `as: Button`\n // is that form too (a button cannot contain a button); its icon becomes decorative content.\n const asWaveButton = slot.as === Button;\n const isButtonObject =\n slot.as === 'button' ||\n asWaveButton ||\n Object.keys(slot).some((key) => BUTTON_ONLY_KEYS.has(key) || HANDLER_KEY.test(key));\n const buttonProps: UnknownProps = {};\n const contentProps: UnknownProps = {};\n // Wave Button's own props are not attributes: `icon`, `iconPosition` and `disabledFocusable`\n // are applied below, the others (`appearance`, `size`) are dropped.\n const ownProps: UnknownProps = {};\n let ignoredName = false;\n for (const [key, value] of Object.entries(slot)) {\n if (key === 'as') {\n if (value !== 'button' && !asWaveButton) contentProps.as = value;\n } else if (asWaveButton && BUTTON_OWN_PROP_KEYS.has(key)) {\n ownProps[key] = value;\n } else if (NAME_KEYS.has(key)) {\n if (value !== undefined) ignoredName = true;\n } else if (key === 'children' || key === 'dangerouslySetInnerHTML') {\n // Content, also in the button-object form: the dismiss button holds its own name text.\n contentProps[key] = value;\n } else if (isButtonObject || (key.startsWith('aria-') && key !== 'aria-hidden')) {\n buttonProps[key] = value;\n } else {\n contentProps[key] = value;\n }\n }\n // An object without content styles the default icon, e.g. `{ className: 'text-error' }` (as in\n // MessageBar and SearchBox); a Wave Button's icon comes before the content (after it with\n // `iconPosition=\"after\"`).\n if (slotRendersContent(ownProps.icon)) {\n contentProps.children = placeButtonIcon(\n renderSlot(ownProps.icon as Slot<'span'>, 'span', iconClassName),\n materialiseSlotContent(contentProps.children),\n ownProps.iconPosition,\n );\n } else if (slotWrapsDefaultContent(contentProps.as ?? 'span', contentProps)) {\n contentProps.children = defaultDismissContent();\n }\n return {\n buttonProps: isButtonObject || Object.keys(buttonProps).length > 0 ? buttonProps : null,\n content: renderSlot(contentProps as SlotObject<'span'>, 'span', iconClassName, {\n 'aria-hidden': true,\n }),\n warning: isButtonObject ? 'button-object' : null,\n ignoredName,\n contentMayName: false,\n literalTextLabel: false,\n disabledFocusable: Boolean(ownProps.disabledFocusable),\n };\n }\n\n return {\n buttonProps: null,\n content: renderSlot(slot as Slot<'span'>, 'span', iconClassName, { 'aria-hidden': true }),\n warning: null,\n ignoredName: false,\n contentMayName: false,\n literalTextLabel: false,\n disabledFocusable: false,\n };\n}\n\n/**\n * A compact label (a \"chip\") for a keyword, category or filter, optionally dismissible.\n *\n * - The dismiss button is a real `<button type=\"button\">` wired to `onDismiss`. Its accessible\n * name is `dismissLabel` plus the tag content (\"Dismiss Cherry\"), so a row of tags has\n * distinguishable dismiss buttons.\n * - `dismissIcon` replaces only the icon inside that button (see {@link TagOwnProps.dismissIcon}).\n * - Polymorphic: `as=\"a\"` renders a link chip with anchor props type-checked.\n *\n * **Focus after dismissal.** A tag cannot keep focus once you remove it. When `onDismiss` removes\n * the tag, move focus to the next tag's dismiss button (else the previous one, else a sensible\n * element nearby); TagGroup (planned) will do this for you. The neighbour stays mounted, so you\n * can focus it in `onDismiss` before removing the tag.\n *\n * @example\n * <Tag>React</Tag>\n * <Tag dismissible onDismiss={() => remove('cherry')}>Cherry</Tag>\n * <Tag dismissible dismissLabel=\"Remove\" dismissIcon={<CloseIcon />}>Cherry</Tag>\n */\nexport const Tag: PolymorphicComponent<'span', TagOwnProps> = (props) => {\n const {\n as,\n dismissible,\n onDismiss,\n dismissIcon,\n dismissLabel = 'Dismiss',\n className,\n children,\n ref,\n ...rest\n } = props as TagImplProps;\n const Component: React.ElementType = as ?? 'span';\n const contentId = useId('tag-content');\n const dismissLabelId = useId('tag-dismiss');\n const dismissTextId = useId('tag-dismiss-text');\n\n const {\n buttonProps: slotButtonProps,\n content,\n warning,\n ignoredName,\n contentMayName,\n literalTextLabel,\n disabledFocusable,\n } = resolveDismissSlot(dismissible ? dismissIcon : undefined);\n\n // C-SLOTS naming (WCAG 2.5.3 Label in Name): the rendered text label of a merged button replaces\n // `dismissLabel` in the name (\"Remove Cherry\"). The literal content decides on the server and on\n // the first render; after mount, the rendered content does (text from components, later changes).\n const [labelTarget, setLabelTarget] = React.useState<HTMLSpanElement | null>(null);\n const subscribeToContent = React.useCallback(\n (onChange: () => void) => (labelTarget ? observeTextLabel(labelTarget, onChange) : noop),\n [labelTarget],\n );\n const contentHasTextLabel = React.useSyncExternalStore(\n subscribeToContent,\n () => (labelTarget ? hasRenderedTextLabel(labelTarget) : literalTextLabel),\n () => literalTextLabel,\n );\n const namedByContent = contentMayName && contentHasTextLabel;\n\n React.useEffect(() => {\n if (warning === 'button-element') {\n warnOnce(\n 'Tag:dismissIcon-button',\n 'Tag: `dismissIcon` received a button. Its props were merged into the built-in dismiss button (a button cannot contain another button), which is named by its text label (or `dismissLabel`) and the tag content. Pass icon content instead, e.g. `dismissIcon={<CloseIcon />}`, and handle the dismissal in `onDismiss`.',\n );\n } else if (warning === 'button-object') {\n warnDeprecated(\n 'Tag',\n 'dismissIcon={{ onClick, type, disabled, … }} (button props on the slot object)',\n 'onDismiss and icon content in dismissIcon',\n 'Its props are merged onto the built-in dismiss button, which is named by `dismissLabel` and the tag content.',\n );\n }\n }, [warning]);\n\n // `onDismiss`/`dismissIcon` alone render no dismiss button (unlike MessageBar's `onDismiss`).\n // An explicit `dismissible={false}` is a deliberate state, so only a missing flag warns.\n const dismissPropsIgnored =\n dismissible === undefined && (onDismiss !== undefined || dismissIcon !== undefined);\n React.useEffect(() => {\n if (dismissPropsIgnored) {\n warnOnce(\n 'Tag:dismiss-without-dismissible',\n 'Tag: `onDismiss` and `dismissIcon` take effect only with `dismissible`; no dismiss button was rendered. Add `dismissible` to render it.',\n );\n }\n }, [dismissPropsIgnored]);\n\n React.useEffect(() => {\n if (ignoredName) {\n warnOnce(\n 'Tag:dismissIcon-name',\n 'Tag: `aria-label`/`aria-labelledby` on `dismissIcon` are ignored. The dismiss button is named by `dismissLabel` (default \"Dismiss\") and the tag content, e.g. \"Dismiss Cherry\"; set `dismissLabel` to change or localise it.',\n );\n }\n }, [ignoredName]);\n\n const ownButtonProps: UnknownProps = {\n type: 'button',\n className: cn(\n 'inline-flex size-5 shrink-0 items-center justify-center rounded-full border-0 bg-transparent p-0 text-foreground',\n 'not-disabled:not-aria-disabled:hover:bg-subtle-pressed',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n mergedAriaDisabledClasses,\n focusRing,\n ),\n 'aria-labelledby': `${namedByContent ? dismissTextId : dismissLabelId} ${contentId}`,\n };\n if (onDismiss) ownButtonProps.onClick = onDismiss;\n const dismissButtonProps = slotButtonProps\n ? mergeProps(ownButtonProps, slotButtonProps)\n : ownButtonProps;\n\n return (\n <Component\n ref={ref}\n className={cn(\n 'inline-flex items-center gap-1 rounded-full bg-muted py-1 ps-3 text-body-1 text-foreground',\n dismissible ? 'pe-1.5' : 'pe-3',\n className,\n )}\n {...rest}\n >\n <span id={contentId} className=\"inline-flex items-center gap-1\">\n {children}\n </span>\n {dismissible && (\n <button\n {...dismissButtonProps}\n type={(dismissButtonProps.type as 'button' | 'submit' | 'reset' | undefined) ?? 'button'}\n // A merged `disabledFocusable` Button makes the dismiss button unavailable but focusable\n // (spread last: it wins over `disabled` and `onDismiss`).\n {...(disabledFocusable ? MERGED_DISABLED_FOCUSABLE_PROPS : undefined)}\n >\n <span id={dismissLabelId} className=\"sr-only\">\n {dismissLabel}\n </span>\n {contentMayName ? (\n // The merged button's own content, rendered as is: its text label can name the button.\n // `gap-[inherit]` keeps a gap set on the button between the content items.\n <span\n id={dismissTextId}\n ref={setLabelTarget}\n className=\"inline-flex items-center justify-center gap-[inherit]\"\n >\n {content}\n </span>\n ) : (\n content\n )}\n </button>\n )}\n </Component>\n );\n};\n\nTag.displayName = 'Tag';\n"],"mappings":"8gBA0GA,IAAMiC,EAAwC,IAAI,IAAI,CACpD,OACA,WACA,YACA,OACA,aACA,cACA,aACA,iBACA,aACA,OACA,OACF,CAAC,EAEKC,EAAc,WAMdC,EAAiC,IAAI,IAAI,CAAC,aAAc,iBAAiB,CAAC,EAsC1EC,MAAa,CAAC,EAGpB,SAASC,EAAY,EAAoE,CACvF,IAAMC,EAAuB,CAAC,EAC1BC,EAAc,GAClB,IAAK,GAAM,CAACC,EAAKC,KAAU,OAAO,QAAQC,CAAK,EACzCP,EAAU,IAAIK,CAAG,EACfC,IAAU,IAAA,KAAW,EAAc,IAEvC,EAAOD,GAAOC,EAGlB,MAAO,CAAE,MAAOH,EAAQ,aAAY,CACtC,CAEA,IAAMK,EAAgB,0CAEtB,SAASC,EAAc,EAAuC,CAE5D,GADI,OAAOH,GAAU,WAAYA,GAC7BzC,EAAM,eAAeyC,CAAK,GAAK,OAAO,YAAYA,EAAO,MAAO,GACpE,IAAMI,EAAiB,OAAO,eAAeJ,CAAK,EAClD,OAAOI,IAAU,MAAQA,IAAU,OAAO,SAC5C,CAGA,SAASC,GAAyC,CAChD,OAAO,EAAAd,EAAA,IAAA,CAAC/B,EAAAA,YAAD,CAAa,KAAM,EAAK,CAAA,CACjC,CAWA,SAAS8C,EAAmB,EAAuD,CACjF,GAAI,CAAC7C,EAAAA,mBAAmB8C,CAAI,EAC1B,MAAO,CACL,YAAa,KACb,QAASF,EAAsB,EAC/B,QAAS,KACT,YAAa,GACb,eAAgB,GAChB,iBAAkB,GAClB,kBAAmB,EACrB,EAMF,IAAMG,EAAc9C,EAAAA,eAAe6C,CAAuB,EAC1D,GACEhD,EAAM,eAAoCgD,CAAI,IAC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AAA,EASE,EAAAhC,EAAA,IAAA,CAAC,OAAD,CAAM,GAAImC,EAAW,UAAU,iCAC5B,UACG,CAAA,EACLI,IACC,EAAAvC,EAAA,KAAA,CAAC,SAAD,CACE,GAAIqD,EACJ,KAAOA,EAAmB,MAAsD,SAGhF,GAAKE,EAAoBrE,EAAAA,gCAAkC,IAAA,GAL7D,SAAA,EAOE,EAAAc,EAAA,IAAA,CAAC,OAAD,CAAM,GAAIoC,EAAgB,UAAU,UACjC,SAAAoB,CACG,CAAA,EACLR,GAGC,EAAAhD,EAAA,IAAA,CAAC,OAAD,CACE,GAAIqC,EACJ,IAAKK,EACL,UAAU,wDAET,SAAAe,CACG,CAAA,EAENA,CAEI,CAED,CAAA,CAAA,GAEf,EAEA,EAAI,YAAc"}
@@ -0,0 +1,147 @@
1
+ "use client";
2
+ import { cn as e } from "../../lib/cn.mjs";
3
+ import { getElementType as t } from "../../lib/children.mjs";
4
+ import { warnDeprecated as n, warnOnce as r } from "../../lib/dev.mjs";
5
+ import { materialiseSlotContent as i, renderSlot as a, slotRendersContent as o, slotWrapsDefaultContent as s } from "../../lib/slot.mjs";
6
+ import { useId as c } from "../../hooks/useId.mjs";
7
+ import { focusRing as l } from "../../lib/styles.mjs";
8
+ import { Button as u } from "../button/Button.mjs";
9
+ import { DismissIcon as d } from "../../lib/icons.mjs";
10
+ import { mergeProps as f } from "../../lib/mergeProps.mjs";
11
+ import { BUTTON_OWN_PROP_KEYS as p, MERGED_DISABLED_FOCUSABLE_PROPS as m, mergedAriaDisabledClasses as h, placeButtonIcon as g } from "../button/Button.slots.mjs";
12
+ import { hasRenderedTextLabel as _, hasTextLabel as v, observeTextLabel as y } from "../../lib/labelInName.mjs";
13
+ import * as b from "react";
14
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
15
+ //#region src/components/data-display/Tag.tsx
16
+ var C = /* @__PURE__ */ new Set([
17
+ "type",
18
+ "disabled",
19
+ "autoFocus",
20
+ "form",
21
+ "formAction",
22
+ "formEncType",
23
+ "formMethod",
24
+ "formNoValidate",
25
+ "formTarget",
26
+ "name",
27
+ "value"
28
+ ]), w = /^on[A-Z]/, T = /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]), E = () => {};
29
+ function D(e) {
30
+ let t = {}, n = !1;
31
+ for (let [r, i] of Object.entries(e)) T.has(r) ? i !== void 0 && (n = !0) : t[r] = i;
32
+ return {
33
+ props: t,
34
+ ignoredName: n
35
+ };
36
+ }
37
+ var O = "inline-flex items-center justify-center";
38
+ function k(e) {
39
+ if (typeof e != "object" || !e || b.isValidElement(e) || Symbol.iterator in e) return !1;
40
+ let t = Object.getPrototypeOf(e);
41
+ return t === null || t === Object.prototype;
42
+ }
43
+ function A() {
44
+ return /* @__PURE__ */ x(d, { size: 12 });
45
+ }
46
+ function j(e) {
47
+ if (!o(e)) return {
48
+ buttonProps: null,
49
+ content: A(),
50
+ warning: null,
51
+ ignoredName: !1,
52
+ contentMayName: !1,
53
+ literalTextLabel: !1,
54
+ disabledFocusable: !1
55
+ };
56
+ let n = t(e);
57
+ if (b.isValidElement(e) && (n === "button" || n === u)) {
58
+ let { children: t, dangerouslySetInnerHTML: r, ...s } = e.props, c = n === u, l = s;
59
+ if (c) {
60
+ l = {};
61
+ for (let [e, t] of Object.entries(s)) p.has(e) || (l[e] = t);
62
+ }
63
+ let d = c ? s.icon : void 0, { props: f, ignoredName: m } = D(l), h = o(d) ? a(d, "span", O, { "aria-hidden": !0 }) : null, _ = r == null ? i(t) : /* @__PURE__ */ x("span", {
64
+ className: O,
65
+ dangerouslySetInnerHTML: r
66
+ });
67
+ return {
68
+ buttonProps: f,
69
+ content: h || o(_) ? g(h, _, c && s.iconPosition) : A(),
70
+ warning: "button-element",
71
+ ignoredName: m,
72
+ contentMayName: !0,
73
+ literalTextLabel: v(_),
74
+ disabledFocusable: c && !!s.disabledFocusable
75
+ };
76
+ }
77
+ if (k(e)) {
78
+ let t = e.as === u, n = e.as === "button" || t || Object.keys(e).some((e) => C.has(e) || w.test(e)), r = {}, c = {}, l = {}, d = !1;
79
+ for (let [i, a] of Object.entries(e)) i === "as" ? a !== "button" && !t && (c.as = a) : t && p.has(i) ? l[i] = a : T.has(i) ? a !== void 0 && (d = !0) : i === "children" || i === "dangerouslySetInnerHTML" ? c[i] = a : n || i.startsWith("aria-") && i !== "aria-hidden" ? r[i] = a : c[i] = a;
80
+ return o(l.icon) ? c.children = g(a(l.icon, "span", O), i(c.children), l.iconPosition) : s(c.as ?? "span", c) && (c.children = A()), {
81
+ buttonProps: n || Object.keys(r).length > 0 ? r : null,
82
+ content: a(c, "span", O, { "aria-hidden": !0 }),
83
+ warning: n ? "button-object" : null,
84
+ ignoredName: d,
85
+ contentMayName: !1,
86
+ literalTextLabel: !1,
87
+ disabledFocusable: !!l.disabledFocusable
88
+ };
89
+ }
90
+ return {
91
+ buttonProps: null,
92
+ content: a(e, "span", O, { "aria-hidden": !0 }),
93
+ warning: null,
94
+ ignoredName: !1,
95
+ contentMayName: !1,
96
+ literalTextLabel: !1,
97
+ disabledFocusable: !1
98
+ };
99
+ }
100
+ var M = (t) => {
101
+ let { as: i, dismissible: a, onDismiss: o, dismissIcon: s, dismissLabel: u = "Dismiss", className: d, children: p, ref: g, ...v } = t, C = i ?? "span", w = c("tag-content"), T = c("tag-dismiss"), D = c("tag-dismiss-text"), { buttonProps: O, content: k, warning: A, ignoredName: M, contentMayName: N, literalTextLabel: P, disabledFocusable: F } = j(a ? s : void 0), [I, L] = b.useState(null), R = b.useCallback((e) => I ? y(I, e) : E, [I]), z = b.useSyncExternalStore(R, () => I ? _(I) : P, () => P), B = N && z;
102
+ b.useEffect(() => {
103
+ A === "button-element" ? r("Tag:dismissIcon-button", "Tag: `dismissIcon` received a button. Its props were merged into the built-in dismiss button (a button cannot contain another button), which is named by its text label (or `dismissLabel`) and the tag content. Pass icon content instead, e.g. `dismissIcon={<CloseIcon />}`, and handle the dismissal in `onDismiss`.") : A === "button-object" && n("Tag", "dismissIcon={{ onClick, type, disabled, … }} (button props on the slot object)", "onDismiss and icon content in dismissIcon", "Its props are merged onto the built-in dismiss button, which is named by `dismissLabel` and the tag content.");
104
+ }, [A]);
105
+ let V = a === void 0 && (o !== void 0 || s !== void 0);
106
+ b.useEffect(() => {
107
+ V && r("Tag:dismiss-without-dismissible", "Tag: `onDismiss` and `dismissIcon` take effect only with `dismissible`; no dismiss button was rendered. Add `dismissible` to render it.");
108
+ }, [V]), b.useEffect(() => {
109
+ M && r("Tag:dismissIcon-name", "Tag: `aria-label`/`aria-labelledby` on `dismissIcon` are ignored. The dismiss button is named by `dismissLabel` (default \"Dismiss\") and the tag content, e.g. \"Dismiss Cherry\"; set `dismissLabel` to change or localise it.");
110
+ }, [M]);
111
+ let H = {
112
+ type: "button",
113
+ className: e("inline-flex size-5 shrink-0 items-center justify-center rounded-full border-0 bg-transparent p-0 text-foreground", "not-disabled:not-aria-disabled:hover:bg-subtle-pressed", "disabled:cursor-not-allowed disabled:opacity-50", h, l),
114
+ "aria-labelledby": `${B ? D : T} ${w}`
115
+ };
116
+ o && (H.onClick = o);
117
+ let U = O ? f(H, O) : H;
118
+ return /* @__PURE__ */ S(C, {
119
+ ref: g,
120
+ className: e("inline-flex items-center gap-1 rounded-full bg-muted py-1 ps-3 text-body-1 text-foreground", a ? "pe-1.5" : "pe-3", d),
121
+ ...v,
122
+ children: [/* @__PURE__ */ x("span", {
123
+ id: w,
124
+ className: "inline-flex items-center gap-1",
125
+ children: p
126
+ }), a && /* @__PURE__ */ S("button", {
127
+ ...U,
128
+ type: U.type ?? "button",
129
+ ...F ? m : void 0,
130
+ children: [/* @__PURE__ */ x("span", {
131
+ id: T,
132
+ className: "sr-only",
133
+ children: u
134
+ }), N ? /* @__PURE__ */ x("span", {
135
+ id: D,
136
+ ref: L,
137
+ className: "inline-flex items-center justify-center gap-[inherit]",
138
+ children: k
139
+ }) : k]
140
+ })]
141
+ });
142
+ };
143
+ M.displayName = "Tag";
144
+ //#endregion
145
+ export { M as Tag };
146
+
147
+ //# sourceMappingURL=Tag.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tag.mjs","names":["useId","useId$1","React","BUTTON_ONLY_KEYS","HANDLER_KEY","NAME_KEYS","noop","withoutName","result","ignoredName","key","value","props","iconClassName","isPlainObject","proto","defaultDismissContent","DismissIcon","resolveDismissSlot","slotRendersContent","slot","elementType","getElementType","Button","markup","elementProps","isWaveButton","slotProps","BUTTON_OWN_PROP_KEYS","icon","buttonProps","iconNode","renderSlot","ownContent","materialiseSlotContent","children","placeButtonIcon","hasTextLabel","asWaveButton","isButtonObject","contentProps","ownProps","slotWrapsDefaultContent","Tag","rest","Component","as","contentId","dismissLabelId","dismissTextId","slotButtonProps","dismissible","dismissIcon","labelTarget","setLabelTarget","subscribeToContent","observeTextLabel","onChange","contentHasTextLabel","hasRenderedTextLabel","literalTextLabel","namedByContent","contentMayName","warning","warnOnce","warnDeprecated","dismissPropsIgnored","onDismiss","ownButtonProps","cn","mergedAriaDisabledClasses","focusRing","dismissButtonProps","mergeProps","className","disabledFocusable","MERGED_DISABLED_FOCUSABLE_PROPS","dismissLabel","content"],"sources":["../../../src/components/data-display/Tag.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../lib/cn';\nimport { warnDeprecated, warnOnce } from '../../lib/dev';\nimport { mergeProps } from '../../lib/mergeProps';\nimport { getElementType } from '../../lib/children';\nimport {\n materialiseSlotContent,\n renderSlot,\n slotRendersContent,\n slotWrapsDefaultContent,\n} from '../../lib/slot';\nimport { focusRing } from '../../lib/styles';\nimport { DismissIcon } from '../../lib/icons';\nimport { hasRenderedTextLabel, hasTextLabel, observeTextLabel } from '../../lib/labelInName';\nimport type { Slot, SlotObject } from '../../lib/slot';\nimport type { PolymorphicComponent, PolymorphicProps } from '../../lib/polymorphic';\nimport { useId } from '../../hooks/useId';\nimport { Button } from '../button/Button';\nimport {\n BUTTON_OWN_PROP_KEYS,\n MERGED_DISABLED_FOCUSABLE_PROPS,\n mergedAriaDisabledClasses,\n placeButtonIcon,\n} from '../button/Button.slots';\n\n/**\n * The Tag's own props (the XOwnProps rule of `PolymorphicProps`: component-specific props only).\n * Every other prop comes from the rendered element (`as`, default `span`).\n */\nexport interface TagOwnProps {\n /**\n * Whether the tag renders a dismiss button. `onDismiss` and `dismissIcon` take effect only with\n * it (a development warning says so when they are passed without it).\n */\n dismissible?: boolean;\n /**\n * Called when the dismiss button is activated (click, Enter or Space). Passing it does not render\n * the dismiss button: set `dismissible` too. When it removes the tag, move focus yourself (see\n * \"Focus after dismissal\" on {@link Tag}).\n */\n onDismiss?: () => void;\n /**\n * Content of the dismiss button (an icon). The Tag always renders its own dismiss\n * `<button type=\"button\">`, wired to `onDismiss` and named by `dismissLabel` plus the tag\n * content; this slot only replaces the icon inside it.\n *\n * A `<button>` element or a Wave `Button` passed here is not nested (a button cannot contain a\n * button): its props are merged into the dismiss button (its `onClick` runs first and can call\n * `preventDefault()` to skip `onDismiss`) and a development warning recommends icon content.\n * A Wave `Button`'s own props are not attributes: its `icon` becomes decorative content before\n * its children (after them with `iconPosition=\"after\"`), `disabledFocusable` makes the dismiss\n * button unavailable but focusable as on the Button (`onDismiss` is not called), and\n * `appearance` and `size` are ignored.\n * A slot object with button props (`type`, `disabled`, event handlers, `as: 'button'` or\n * `as: Button`) is the deprecated 0.4 button-object form: its props (`className`, `id`,\n * `aria-*`, handlers, …) are merged onto the dismiss button, except its content (`children`,\n * `dangerouslySetInnerHTML`, rendered inside the button) and the naming attributes (see below);\n * for `as: Button`, the Button's own props apply as for a `Button` element — pass icon content\n * and use `onDismiss` instead.\n * The `aria-*` attributes of an icon slot object also go to the dismiss button, because the icon\n * is `aria-hidden`.\n *\n * The dismiss button's name is `dismissLabel` plus the tag content (\"Dismiss Cherry\"):\n * `aria-label` and `aria-labelledby` on the slot are ignored (development warning). Icon\n * content is decorative (`aria-hidden`). The children of a merged `<button>`/`Button` (or its\n * `dangerouslySetInnerHTML` markup) are rendered as is inside the dismiss button, next to the\n * decorative `icon` of a Wave `Button`: when they render a text label (at least two letters or\n * digits outside `aria-hidden`/`hidden` content, text from components such as translations\n * included), that text replaces `dismissLabel` in the name, so the name contains the visible\n * label (WCAG 2.5.3): `<button>Remove</button>` or\n * `<Button icon={<CloseIcon />}>Remove</Button>` on \"Cherry\" is named \"Remove Cherry\". An icon or\n * a lone character (`x`, `×`) keeps \"Dismiss Cherry\". Text hidden only with CSS still counts as\n * the label.\n *\n * When the slot renders no content (`[]`, `<></>`, a childless merged button, a slot object\n * without `children`), the default dismiss icon is shown; a slot object then styles it, e.g.\n * `{ className: 'text-error' }`. A slot object that renders a component or a void element\n * (`{ as: CloseIcon }`, `{ as: 'img', src, alt: '' }`) or sets `dangerouslySetInnerHTML` is the\n * icon itself: no default icon is added. Only takes effect with `dismissible`.\n */\n dismissIcon?: Slot<'span'> | SlotObject<'button'>;\n /**\n * Visually hidden text that names the dismiss button together with the tag content\n * (`aria-labelledby`), e.g. \"Dismiss Cherry\". Localise it here. A text label rendered by a\n * merged `<button>` slot replaces it (see `dismissIcon`).\n * @default 'Dismiss'\n */\n dismissLabel?: string;\n}\n\n/**\n * Props of {@link Tag} rendered as `C` (default `'span'`). `TagProps` without a type argument is\n * the 0.4 name.\n */\nexport type TagProps<C extends React.ElementType = 'span'> = PolymorphicProps<C, TagOwnProps>;\n\n/** The props the implementation reads, for any `as` (the public typing is `PolymorphicComponent`). */\ntype TagImplProps = TagOwnProps &\n React.HTMLAttributes<HTMLElement> & {\n as?: React.ElementType;\n ref?: React.Ref<HTMLElement>;\n };\n\ntype UnknownProps = Record<string, unknown>;\n\n/** Attributes that only make sense on the dismiss `<button>` itself. */\nconst BUTTON_ONLY_KEYS: ReadonlySet<string> = new Set([\n 'type',\n 'disabled',\n 'autoFocus',\n 'form',\n 'formAction',\n 'formEncType',\n 'formMethod',\n 'formNoValidate',\n 'formTarget',\n 'name',\n 'value',\n]);\n\nconst HANDLER_KEY = /^on[A-Z]/;\n\n/**\n * Naming attributes a slot cannot set: the Tag names its dismiss button itself\n * (`aria-labelledby` = `dismissLabel` + tag content, data-display#10), so these are dropped.\n */\nconst NAME_KEYS: ReadonlySet<string> = new Set(['aria-label', 'aria-labelledby']);\n\n/** The props of a merged `<button>` or Wave `Button` that the Tag reads itself. */\ninterface WaveButtonSlotProps extends UnknownProps {\n icon?: Slot<'span'>;\n iconPosition?: unknown;\n disabledFocusable?: unknown;\n children?: React.ReactNode;\n dangerouslySetInnerHTML?: React.HTMLAttributes<HTMLElement>['dangerouslySetInnerHTML'];\n}\n\ninterface ResolvedDismissSlot {\n /** Props merged onto the wired dismiss button (`null`: none). */\n buttonProps: UnknownProps | null;\n /** What renders inside the dismiss button. */\n content: React.ReactNode;\n /** Which development warning the slot needs. */\n warning: 'button-element' | 'button-object' | null;\n /** Whether the slot passed `aria-label`/`aria-labelledby`, which the Tag ignores. */\n ignoredName: boolean;\n /**\n * `true` when the content is rendered as is (a merged `<button>`/`Button`), so a text label in it\n * replaces `dismissLabel` in the name (C-SLOTS naming, WCAG 2.5.3); `false` when the content is\n * decorative (`aria-hidden`).\n */\n contentMayName: boolean;\n /**\n * Whether the literal content contains a text label: the name for the server render and the\n * first client render. After mount the rendered content decides.\n */\n literalTextLabel: boolean;\n /**\n * Whether a merged Wave `Button` set `disabledFocusable`: the dismiss button is then unavailable\n * but focusable, as the Button would be.\n */\n disabledFocusable: boolean;\n}\n\nconst noop = () => {};\n\n/** `props` without the naming attributes, and whether any was set. */\nfunction withoutName(props: UnknownProps): { props: UnknownProps; ignoredName: boolean } {\n const result: UnknownProps = {};\n let ignoredName = false;\n for (const [key, value] of Object.entries(props)) {\n if (NAME_KEYS.has(key)) {\n if (value !== undefined) ignoredName = true;\n } else {\n result[key] = value;\n }\n }\n return { props: result, ignoredName };\n}\n\nconst iconClassName = 'inline-flex items-center justify-center';\n\nfunction isPlainObject(value: unknown): value is UnknownProps {\n if (typeof value !== 'object' || value === null) return false;\n if (React.isValidElement(value) || Symbol.iterator in value) return false;\n const proto: unknown = Object.getPrototypeOf(value);\n return proto === null || proto === Object.prototype;\n}\n\n/** The decorative default dismiss glyph. */\nfunction defaultDismissContent(): React.ReactNode {\n return <DismissIcon size={12} />;\n}\n\n/**\n * Splits the dismissIcon slot into dismiss-button props and icon content (C-SLOTS). The icon\n * content is `aria-hidden`, so no attribute that means something to assistive technology stays on\n * it: button-form props go to the dismiss button, and so do the `aria-*` attributes of an icon slot\n * object; the naming attributes are dropped (see {@link NAME_KEYS}).\n *\n * Content that renders nothing (`[]`, `<></>`, a childless merged button, a slot object without\n * `children`) shows the default icon, so the dismiss button is never an empty, invisible Tab stop.\n */\nfunction resolveDismissSlot(slot: TagOwnProps['dismissIcon']): ResolvedDismissSlot {\n if (!slotRendersContent(slot)) {\n return {\n buttonProps: null,\n content: defaultDismissContent(),\n warning: null,\n ignoredName: false,\n contentMayName: false,\n literalTextLabel: false,\n disabledFocusable: false,\n };\n }\n\n // A `<button>` or a Wave `Button` (also one written in a Server Component, whose type arrives as\n // a lazy reference) is merged into the dismiss button. Its content is rendered as is, after the\n // Button's icon, which is decorative (as in MessageBar and SearchBox); its text label names it.\n const elementType = getElementType(slot as React.ReactNode);\n if (\n React.isValidElement<WaveButtonSlotProps>(slot) &&\n (elementType === 'button' || elementType === Button)\n ) {\n const { children, dangerouslySetInnerHTML: markup, ...elementProps } = slot.props;\n const isWaveButton = elementType === Button;\n let slotProps: UnknownProps = elementProps;\n if (isWaveButton) {\n // Wave Button's own props are not attributes: `icon`, `iconPosition` and\n // `disabledFocusable` are applied here, the others (`appearance`, `size`) are dropped.\n slotProps = {};\n for (const [key, value] of Object.entries(elementProps)) {\n if (!BUTTON_OWN_PROP_KEYS.has(key)) slotProps[key] = value;\n }\n }\n const icon = isWaveButton ? elementProps.icon : undefined;\n const { props: buttonProps, ignoredName } = withoutName(slotProps);\n const iconNode = slotRendersContent(icon)\n ? renderSlot(icon, 'span', iconClassName, { 'aria-hidden': true })\n : null;\n // A generator is read once by the check; its items are what renders (and names the button).\n // Markup of the merged button (`dangerouslySetInnerHTML`) is its content as well: the dismiss\n // button holds its own name text, so the markup renders in a span inside it.\n const ownContent =\n markup != null ? (\n <span className={iconClassName} dangerouslySetInnerHTML={markup} />\n ) : (\n materialiseSlotContent(children)\n );\n return {\n buttonProps,\n content:\n iconNode || slotRendersContent(ownContent)\n ? placeButtonIcon(iconNode, ownContent, isWaveButton && elementProps.iconPosition)\n : defaultDismissContent(),\n warning: 'button-element',\n ignoredName,\n contentMayName: true,\n literalTextLabel: hasTextLabel(ownContent),\n disabledFocusable: isWaveButton && Boolean(elementProps.disabledFocusable),\n };\n }\n\n if (isPlainObject(slot)) {\n // 0.4 rendered the whole object as the dismiss element, so an object with button props\n // describes the button: everything but its content goes to the dismiss button. `as: Button`\n // is that form too (a button cannot contain a button); its icon becomes decorative content.\n const asWaveButton = slot.as === Button;\n const isButtonObject =\n slot.as === 'button' ||\n asWaveButton ||\n Object.keys(slot).some((key) => BUTTON_ONLY_KEYS.has(key) || HANDLER_KEY.test(key));\n const buttonProps: UnknownProps = {};\n const contentProps: UnknownProps = {};\n // Wave Button's own props are not attributes: `icon`, `iconPosition` and `disabledFocusable`\n // are applied below, the others (`appearance`, `size`) are dropped.\n const ownProps: UnknownProps = {};\n let ignoredName = false;\n for (const [key, value] of Object.entries(slot)) {\n if (key === 'as') {\n if (value !== 'button' && !asWaveButton) contentProps.as = value;\n } else if (asWaveButton && BUTTON_OWN_PROP_KEYS.has(key)) {\n ownProps[key] = value;\n } else if (NAME_KEYS.has(key)) {\n if (value !== undefined) ignoredName = true;\n } else if (key === 'children' || key === 'dangerouslySetInnerHTML') {\n // Content, also in the button-object form: the dismiss button holds its own name text.\n contentProps[key] = value;\n } else if (isButtonObject || (key.startsWith('aria-') && key !== 'aria-hidden')) {\n buttonProps[key] = value;\n } else {\n contentProps[key] = value;\n }\n }\n // An object without content styles the default icon, e.g. `{ className: 'text-error' }` (as in\n // MessageBar and SearchBox); a Wave Button's icon comes before the content (after it with\n // `iconPosition=\"after\"`).\n if (slotRendersContent(ownProps.icon)) {\n contentProps.children = placeButtonIcon(\n renderSlot(ownProps.icon as Slot<'span'>, 'span', iconClassName),\n materialiseSlotContent(contentProps.children),\n ownProps.iconPosition,\n );\n } else if (slotWrapsDefaultContent(contentProps.as ?? 'span', contentProps)) {\n contentProps.children = defaultDismissContent();\n }\n return {\n buttonProps: isButtonObject || Object.keys(buttonProps).length > 0 ? buttonProps : null,\n content: renderSlot(contentProps as SlotObject<'span'>, 'span', iconClassName, {\n 'aria-hidden': true,\n }),\n warning: isButtonObject ? 'button-object' : null,\n ignoredName,\n contentMayName: false,\n literalTextLabel: false,\n disabledFocusable: Boolean(ownProps.disabledFocusable),\n };\n }\n\n return {\n buttonProps: null,\n content: renderSlot(slot as Slot<'span'>, 'span', iconClassName, { 'aria-hidden': true }),\n warning: null,\n ignoredName: false,\n contentMayName: false,\n literalTextLabel: false,\n disabledFocusable: false,\n };\n}\n\n/**\n * A compact label (a \"chip\") for a keyword, category or filter, optionally dismissible.\n *\n * - The dismiss button is a real `<button type=\"button\">` wired to `onDismiss`. Its accessible\n * name is `dismissLabel` plus the tag content (\"Dismiss Cherry\"), so a row of tags has\n * distinguishable dismiss buttons.\n * - `dismissIcon` replaces only the icon inside that button (see {@link TagOwnProps.dismissIcon}).\n * - Polymorphic: `as=\"a\"` renders a link chip with anchor props type-checked.\n *\n * **Focus after dismissal.** A tag cannot keep focus once you remove it. When `onDismiss` removes\n * the tag, move focus to the next tag's dismiss button (else the previous one, else a sensible\n * element nearby); TagGroup (planned) will do this for you. The neighbour stays mounted, so you\n * can focus it in `onDismiss` before removing the tag.\n *\n * @example\n * <Tag>React</Tag>\n * <Tag dismissible onDismiss={() => remove('cherry')}>Cherry</Tag>\n * <Tag dismissible dismissLabel=\"Remove\" dismissIcon={<CloseIcon />}>Cherry</Tag>\n */\nexport const Tag: PolymorphicComponent<'span', TagOwnProps> = (props) => {\n const {\n as,\n dismissible,\n onDismiss,\n dismissIcon,\n dismissLabel = 'Dismiss',\n className,\n children,\n ref,\n ...rest\n } = props as TagImplProps;\n const Component: React.ElementType = as ?? 'span';\n const contentId = useId('tag-content');\n const dismissLabelId = useId('tag-dismiss');\n const dismissTextId = useId('tag-dismiss-text');\n\n const {\n buttonProps: slotButtonProps,\n content,\n warning,\n ignoredName,\n contentMayName,\n literalTextLabel,\n disabledFocusable,\n } = resolveDismissSlot(dismissible ? dismissIcon : undefined);\n\n // C-SLOTS naming (WCAG 2.5.3 Label in Name): the rendered text label of a merged button replaces\n // `dismissLabel` in the name (\"Remove Cherry\"). The literal content decides on the server and on\n // the first render; after mount, the rendered content does (text from components, later changes).\n const [labelTarget, setLabelTarget] = React.useState<HTMLSpanElement | null>(null);\n const subscribeToContent = React.useCallback(\n (onChange: () => void) => (labelTarget ? observeTextLabel(labelTarget, onChange) : noop),\n [labelTarget],\n );\n const contentHasTextLabel = React.useSyncExternalStore(\n subscribeToContent,\n () => (labelTarget ? hasRenderedTextLabel(labelTarget) : literalTextLabel),\n () => literalTextLabel,\n );\n const namedByContent = contentMayName && contentHasTextLabel;\n\n React.useEffect(() => {\n if (warning === 'button-element') {\n warnOnce(\n 'Tag:dismissIcon-button',\n 'Tag: `dismissIcon` received a button. Its props were merged into the built-in dismiss button (a button cannot contain another button), which is named by its text label (or `dismissLabel`) and the tag content. Pass icon content instead, e.g. `dismissIcon={<CloseIcon />}`, and handle the dismissal in `onDismiss`.',\n );\n } else if (warning === 'button-object') {\n warnDeprecated(\n 'Tag',\n 'dismissIcon={{ onClick, type, disabled, … }} (button props on the slot object)',\n 'onDismiss and icon content in dismissIcon',\n 'Its props are merged onto the built-in dismiss button, which is named by `dismissLabel` and the tag content.',\n );\n }\n }, [warning]);\n\n // `onDismiss`/`dismissIcon` alone render no dismiss button (unlike MessageBar's `onDismiss`).\n // An explicit `dismissible={false}` is a deliberate state, so only a missing flag warns.\n const dismissPropsIgnored =\n dismissible === undefined && (onDismiss !== undefined || dismissIcon !== undefined);\n React.useEffect(() => {\n if (dismissPropsIgnored) {\n warnOnce(\n 'Tag:dismiss-without-dismissible',\n 'Tag: `onDismiss` and `dismissIcon` take effect only with `dismissible`; no dismiss button was rendered. Add `dismissible` to render it.',\n );\n }\n }, [dismissPropsIgnored]);\n\n React.useEffect(() => {\n if (ignoredName) {\n warnOnce(\n 'Tag:dismissIcon-name',\n 'Tag: `aria-label`/`aria-labelledby` on `dismissIcon` are ignored. The dismiss button is named by `dismissLabel` (default \"Dismiss\") and the tag content, e.g. \"Dismiss Cherry\"; set `dismissLabel` to change or localise it.',\n );\n }\n }, [ignoredName]);\n\n const ownButtonProps: UnknownProps = {\n type: 'button',\n className: cn(\n 'inline-flex size-5 shrink-0 items-center justify-center rounded-full border-0 bg-transparent p-0 text-foreground',\n 'not-disabled:not-aria-disabled:hover:bg-subtle-pressed',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n mergedAriaDisabledClasses,\n focusRing,\n ),\n 'aria-labelledby': `${namedByContent ? dismissTextId : dismissLabelId} ${contentId}`,\n };\n if (onDismiss) ownButtonProps.onClick = onDismiss;\n const dismissButtonProps = slotButtonProps\n ? mergeProps(ownButtonProps, slotButtonProps)\n : ownButtonProps;\n\n return (\n <Component\n ref={ref}\n className={cn(\n 'inline-flex items-center gap-1 rounded-full bg-muted py-1 ps-3 text-body-1 text-foreground',\n dismissible ? 'pe-1.5' : 'pe-3',\n className,\n )}\n {...rest}\n >\n <span id={contentId} className=\"inline-flex items-center gap-1\">\n {children}\n </span>\n {dismissible && (\n <button\n {...dismissButtonProps}\n type={(dismissButtonProps.type as 'button' | 'submit' | 'reset' | undefined) ?? 'button'}\n // A merged `disabledFocusable` Button makes the dismiss button unavailable but focusable\n // (spread last: it wins over `disabled` and `onDismiss`).\n {...(disabledFocusable ? MERGED_DISABLED_FOCUSABLE_PROPS : undefined)}\n >\n <span id={dismissLabelId} className=\"sr-only\">\n {dismissLabel}\n </span>\n {contentMayName ? (\n // The merged button's own content, rendered as is: its text label can name the button.\n // `gap-[inherit]` keeps a gap set on the button between the content items.\n <span\n id={dismissTextId}\n ref={setLabelTarget}\n className=\"inline-flex items-center justify-center gap-[inherit]\"\n >\n {content}\n </span>\n ) : (\n content\n )}\n </button>\n )}\n </Component>\n );\n};\n\nTag.displayName = 'Tag';\n"],"mappings":";;;;;;;;;;;;;;;AA0GA,IAAMG,oBAAwC,IAAI,IAAI;CACpD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GAEKC,IAAc,YAMdC,oBAAiC,IAAI,IAAI,CAAC,cAAc,iBAAiB,CAAC,GAsC1EC,UAAa,CAAC;AAGpB,SAASC,EAAY,GAAoE;CACvF,IAAMC,IAAuB,CAAC,GAC1BC,IAAc;CAClB,KAAK,IAAM,CAACC,GAAKC,MAAU,OAAO,QAAQC,CAAK,GAC7C,AAAIP,EAAU,IAAIK,CAAG,IACfC,MAAU,KAAA,MAAW,IAAc,MAEvC,EAAOD,KAAOC;CAGlB,OAAO;EAAE,OAAOH;EAAQ;CAAY;AACtC;AAEA,IAAMK,IAAgB;AAEtB,SAASC,EAAc,GAAuC;CAE5D,IADI,OAAOH,KAAU,aAAYA,KAC7BT,EAAM,eAAeS,CAAK,KAAK,OAAO,YAAYA,GAAO,OAAO;CACpE,IAAMI,IAAiB,OAAO,eAAeJ,CAAK;CAClD,OAAOI,MAAU,QAAQA,MAAU,OAAO;AAC5C;AAGA,SAASC,IAAyC;CAChD,OAAO,kBAACC,GAAD,EAAa,MAAM,GAAK,CAAA;AACjC;AAWA,SAASC,EAAmB,GAAuD;CACjF,IAAI,CAACC,EAAmBC,CAAI,GAC1B,OAAO;EACL,aAAa;EACb,SAASJ,EAAsB;EAC/B,SAAS;EACT,aAAa;EACb,gBAAgB;EAChB,kBAAkB;EAClB,mBAAmB;CACrB;CAMF,IAAMK,IAAcC,EAAeF,CAAuB;CAC1D,IACElB,EAAM,eAAoCkB,CAAI,MAC7CC,MAAgB,YAAYA,MAAgBE,IAC7C;EACA,IAAM,EAAE,aAAU,yB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L,WAAU;IAET,UAAAwB;GACG,CAAA,IAENA,CAEI;EAED,CAAA,CAAA;;AAEf;AAEA,EAAI,cAAc"}
@@ -0,0 +1,2 @@
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/cn.cjs"),n=require("../../lib/children.cjs"),r=require("../../lib/dev.cjs"),i=require("../../lib/slot.cjs"),a=require("../../hooks/useMergedRefs.cjs"),o=require("../../lib/styles.cjs"),s=require("../button/Button.cjs"),c=require("../../lib/icons.cjs"),l=require("../../lib/mergeProps.cjs"),u=require("../button/Button.slots.cjs"),d=require("../../lib/labelInName.cjs"),f=require("./MessageBar.status.cjs");let p=require("react");p=e.__toESM(p,1);let m=require("react/jsx-runtime");var h={info:`bg-info-tint`,success:`bg-success-tint`,warning:`bg-warning-tint`,error:`bg-error-tint`},g=`Dismiss`,_=new Set([`type`,`disabled`,`autoFocus`,`form`,`formAction`,`formEncType`,`formMethod`,`formNoValidate`,`formTarget`,`name`,`value`,`popoverTarget`,`popoverTargetAction`]),v=new Set([`aria-label`,`aria-labelledby`,`title`]),y=/^on[A-Z]/,b=`inline-flex items-center justify-center`,x=()=>{};function S(){return(0,m.jsx)(c.DismissIcon,{})}function C(e){return e===`button`||e===s.Button}function w(){return{buttonProps:{},content:S(),contentMayName:!1,literalTextLabel:!1,disabledFocusable:!1,warning:null}}function T(e){if(e===null)return null;if(e===void 0||typeof e==`boolean`)return w();let r=e;if(n.isElementOfType(r,`button`,s.Button)){let e={};for(let[t,n]of Object.entries(r.props))t!==`children`&&t!==`dangerouslySetInnerHTML`&&!u.BUTTON_OWN_PROP_KEYS.has(t)&&(e[t]=n);let t=n.isElementOfType(r,s.Button),a=r.props.dangerouslySetInnerHTML,o=a==null?i.materialiseSlotContent(r.props.children):(0,m.jsx)(`span`,{className:b,dangerouslySetInnerHTML:a}),c=r.props.icon,l=t&&i.slotRendersContent(c)?i.renderSlot(c,`span`,b,{"aria-hidden":!0}):null;return{buttonProps:e,content:l||i.slotRendersContent(o)?u.placeButtonIcon(l,o,r.props.iconPosition):S(),contentMayName:!0,literalTextLabel:d.hasTextLabel(o),disabledFocusable:t&&!!r.props.disabledFocusable,warning:`button-element`}}let a=i.resolveSlot(e,`span`);if(!a)return w();let{Component:o,props:c,children:l}=a,f=C(o),h=f||Object.keys(c).some(e=>_.has(e)||y.test(e)),g={},x={},T=null;for(let[e,t]of Object.entries(c))o===s.Button&&u.BUTTON_OWN_PROP_KEYS.has(e)?e===`icon`&&i.slotRendersContent(t)&&(T=i.renderSlot(t,`span`,b,{"aria-hidden":!0})):_.has(e)||y.test(e)||v.has(e)||h&&(e===`className`||e===`style`||e===`ref`)?g[e]=t:x[e]=t;let E=f?`span`:o,D={"aria-hidden":!0,...x,className:t.cn(b,x.className)},O=null;return T||i.slotRendersContent(l)?O=u.placeButtonIcon(T,l,o===s.Button&&c.iconPosition):i.slotWrapsDefaultContent(E,{...x,children:l})&&(O=S()),{buttonProps:g,content:O===null?p.createElement(E,D):p.createElement(E,D,O),contentMayName:!1,literalTextLabel:!1,disabledFocusable:o===s.Button&&!!c.disabledFocusable,warning:h?`button-object`:null}}var E=({status:e=`info`,statusLabel:n,onDismiss:s,icon:c,dismiss:_,children:y,className:b,ref:S,...C})=>{let w=t.cn(`mt-0.5 inline-flex shrink-0`,f.STATUS_ICON_COLOR[e]),E=c===void 0?(0,m.jsx)(`span`,{"aria-hidden":`true`,className:w,children:(0,m.jsx)(f.StatusIcon,{status:e,size:20})}):i.renderSlot(c,`span`,w,{"aria-hidden":!0}),D=s!==void 0||_!==void 0&&typeof _!=`boolean`?T(_):null,O=D?.warning??null;p.useEffect(()=>{O===`button-element`?r.warnOnce(`MessageBar:dismiss-button-element`,"MessageBar: `dismiss` received a button element; its props were merged into the built-in dismiss button (buttons cannot be nested). Pass icon content instead, e.g. `dismiss={<CloseIcon />}`, and use `onDismiss`."):O===`button-object`&&r.warnOnce(`MessageBar:dismiss-button-object`,"MessageBar: the button-object form of `dismiss` is deprecated and will be removed in 1.0; its button props were merged into the built-in dismiss button. Pass icon content instead, e.g. `dismiss={<CloseIcon />}`, and use `onDismiss`.")},[O]);let{ref:k,...A}=D?.buttonProps??{},j=Object.keys(A).some(e=>v.has(e)&&A[e]!=null),M=D!==null&&D.contentMayName&&!j,N=D?.literalTextLabel??!1,[P,F]=p.useState(null),I=p.useCallback(e=>P?d.observeTextLabel(P,e):x,[P]),L=p.useSyncExternalStore(I,()=>P?d.hasRenderedTextLabel(P):N,()=>N),R=M&&L,z=a.useMergedRefs(k,M?F:void 0),B=null;if(D){let e=l.mergeProps({"aria-label":j||R?void 0:g,onClick:()=>s?.(),className:t.cn(`ms-auto inline-flex shrink-0 cursor-pointer items-center justify-center rounded border-none bg-transparent p-1 text-muted-foreground`,`not-disabled:not-aria-disabled:hover:bg-subtle-hover not-disabled:not-aria-disabled:hover:text-foreground`,`not-disabled:not-aria-disabled:active:bg-subtle-pressed`,o.focusRing,`disabled:cursor-not-allowed disabled:opacity-50`,u.mergedAriaDisabledClasses)},A);B=(0,m.jsx)(`button`,{...e,ref:z,type:e.type??`button`,...D.disabledFocusable?u.MERGED_DISABLED_FOCUSABLE_PROPS:void 0,children:D.content})}return(0,m.jsxs)(`div`,{ref:S,role:e===`error`||e===`warning`?`alert`:`status`,...C,className:t.cn(`flex items-start gap-3 rounded border-s-4 px-4 py-3 text-foreground`,h[e],f.STATUS_BORDER[e],b),children:[E,(0,m.jsxs)(`div`,{className:`min-w-0 flex-1 text-body-1`,children:[(0,m.jsx)(f.StatusText,{label:f.getStatusLabel(e,n)}),y]}),B]})};E.displayName=`MessageBar`,exports.MessageBar=E;
2
+ //# sourceMappingURL=MessageBar.cjs.map