@pine-ds/core 4.8.0 → 4.9.1

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 (555) hide show
  1. package/components/attributes.js +1 -1
  2. package/components/floating-ui.dom.js +1 -1
  3. package/components/index.js +1 -1
  4. package/components/index2.js +1 -1
  5. package/components/keep-hydrated.js +1 -0
  6. package/components/mock-pds-modal.js +1 -1
  7. package/components/pds-alert.js +1 -1
  8. package/components/pds-avatar.js +1 -1
  9. package/components/pds-box2.js +1 -1
  10. package/components/pds-button2.js +1 -1
  11. package/components/pds-checkbox2.js +1 -1
  12. package/components/pds-chip2.js +1 -1
  13. package/components/pds-combobox.js +1 -1
  14. package/components/pds-container.js +1 -1
  15. package/components/pds-copytext.js +1 -1
  16. package/components/pds-datepicker.js +1 -1
  17. package/components/pds-divider.js +1 -1
  18. package/components/pds-drawer-content.js +1 -1
  19. package/components/pds-drawer-footer.js +1 -1
  20. package/components/pds-drawer-header.js +1 -1
  21. package/components/pds-drawer.js +1 -1
  22. package/components/pds-dropdown-menu-item.js +1 -1
  23. package/components/pds-dropdown-menu-separator.js +1 -1
  24. package/components/pds-dropdown-menu.js +1 -1
  25. package/components/pds-filter.js +1 -1
  26. package/components/pds-filters.js +1 -1
  27. package/components/pds-icon2.js +1 -1
  28. package/components/pds-image.js +1 -1
  29. package/components/pds-input2.js +1 -1
  30. package/components/pds-link2.js +1 -1
  31. package/components/pds-loader2.js +1 -1
  32. package/components/pds-modal-content.js +1 -1
  33. package/components/pds-modal-footer.js +1 -1
  34. package/components/pds-modal-header.js +1 -1
  35. package/components/pds-modal2.js +1 -1
  36. package/components/pds-multiselect.js +1 -1
  37. package/components/pds-popover.js +1 -1
  38. package/components/pds-progress.js +1 -1
  39. package/components/pds-property.js +1 -1
  40. package/components/pds-radio-group.js +1 -1
  41. package/components/pds-radio.js +1 -1
  42. package/components/pds-row.js +1 -1
  43. package/components/pds-select.js +1 -1
  44. package/components/pds-sortable-item.js +1 -1
  45. package/components/pds-sortable.js +2 -2
  46. package/components/pds-switch.js +1 -1
  47. package/components/pds-table-body.js +1 -1
  48. package/components/pds-table-cell2.js +1 -1
  49. package/components/pds-table-head-cell2.js +1 -1
  50. package/components/pds-table-head.js +1 -1
  51. package/components/pds-table-row.js +1 -1
  52. package/components/pds-tabpanel.js +1 -1
  53. package/components/pds-tabs.js +1 -1
  54. package/components/pds-text2.js +1 -1
  55. package/components/pds-textarea.js +1 -1
  56. package/components/pds-toast.js +1 -1
  57. package/components/pds-tooltip.js +1 -1
  58. package/components/portal-target.js +1 -0
  59. package/components/tabbable.js +1 -0
  60. package/components/truncation-tooltip.js +1 -1
  61. package/dist/cjs/{attributes-BJ7KBHql.js → attributes-CW49XqaL.js} +1 -1
  62. package/dist/cjs/{floating-ui.dom-Dc8Anyel.js → floating-ui.dom-Dw41zbyY.js} +1 -0
  63. package/dist/cjs/{index-Do70atou.js → index-BDnbr0DK.js} +1 -1
  64. package/dist/cjs/{index-jl_Q819j.js → index-D9iJuJCP.js} +13 -1
  65. package/dist/cjs/index.cjs.js +1 -1
  66. package/dist/cjs/{keep-hydrated-CiXgkEYd.js → keep-hydrated-AKoh0DG4.js} +1 -0
  67. package/dist/cjs/loader.cjs.js +3 -3
  68. package/dist/cjs/mock-pds-modal.cjs.entry.js +4 -4
  69. package/dist/cjs/pds-accordion.cjs.entry.js +3 -3
  70. package/dist/cjs/pds-alert.cjs.entry.js +17 -4
  71. package/dist/cjs/pds-avatar.cjs.entry.js +22 -12
  72. package/dist/cjs/pds-box.cjs.entry.js +4 -4
  73. package/dist/cjs/pds-button.cjs.entry.js +58 -26
  74. package/dist/cjs/pds-checkbox.cjs.entry.js +16 -8
  75. package/dist/cjs/pds-chip.cjs.entry.js +9 -11
  76. package/dist/cjs/pds-combobox.cjs.entry.js +41 -11
  77. package/dist/cjs/pds-container.cjs.entry.js +3 -3
  78. package/dist/cjs/pds-copytext.cjs.entry.js +8 -7
  79. package/dist/cjs/pds-datepicker.cjs.entry.js +8 -45
  80. package/dist/cjs/pds-divider.cjs.entry.js +3 -3
  81. package/dist/cjs/pds-drawer-content.cjs.entry.js +3 -3
  82. package/dist/cjs/pds-drawer-footer.cjs.entry.js +3 -3
  83. package/dist/cjs/pds-drawer-header.cjs.entry.js +3 -3
  84. package/dist/cjs/pds-drawer.cjs.entry.js +4 -4
  85. package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +4 -4
  86. package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +3 -3
  87. package/dist/cjs/pds-dropdown-menu.cjs.entry.js +5 -5
  88. package/dist/cjs/pds-filter.cjs.entry.js +4 -4
  89. package/dist/cjs/pds-filters.cjs.entry.js +3 -3
  90. package/dist/cjs/pds-icon.cjs.entry.js +55 -22
  91. package/dist/cjs/pds-image.cjs.entry.js +4 -4
  92. package/dist/cjs/pds-input.cjs.entry.js +6 -6
  93. package/dist/cjs/pds-link.cjs.entry.js +16 -7
  94. package/dist/cjs/pds-loader.cjs.entry.js +4 -4
  95. package/dist/cjs/pds-modal-content.cjs.entry.js +4 -4
  96. package/dist/cjs/pds-modal-footer.cjs.entry.js +3 -3
  97. package/dist/cjs/pds-modal-header.cjs.entry.js +3 -3
  98. package/dist/cjs/pds-modal.cjs.entry.js +9 -89
  99. package/dist/cjs/pds-multiselect.cjs.entry.js +13 -7
  100. package/dist/cjs/pds-popover.cjs.entry.js +230 -153
  101. package/dist/cjs/pds-progress.cjs.entry.js +4 -4
  102. package/dist/cjs/pds-property.cjs.entry.js +3 -3
  103. package/dist/cjs/pds-radio-group.cjs.entry.js +67 -6
  104. package/dist/cjs/pds-radio.cjs.entry.js +24 -11
  105. package/dist/cjs/pds-row.cjs.entry.js +4 -4
  106. package/dist/cjs/pds-select.cjs.entry.js +132 -21
  107. package/dist/cjs/pds-sortable-item.cjs.entry.js +5 -5
  108. package/dist/cjs/pds-sortable.cjs.entry.js +4 -4
  109. package/dist/cjs/pds-switch.cjs.entry.js +7 -7
  110. package/dist/cjs/pds-tab.cjs.entry.js +3 -3
  111. package/dist/cjs/pds-table-body.cjs.entry.js +3 -3
  112. package/dist/cjs/pds-table-cell.cjs.entry.js +7 -6
  113. package/dist/cjs/pds-table-head-cell.cjs.entry.js +5 -5
  114. package/dist/cjs/pds-table-head.cjs.entry.js +3 -3
  115. package/dist/cjs/pds-table-row.cjs.entry.js +3 -3
  116. package/dist/cjs/pds-table.cjs.entry.js +2 -2
  117. package/dist/cjs/pds-tabpanel.cjs.entry.js +4 -4
  118. package/dist/cjs/pds-tabs.cjs.entry.js +4 -4
  119. package/dist/cjs/pds-text.cjs.entry.js +31 -5
  120. package/dist/cjs/pds-textarea.cjs.entry.js +8 -8
  121. package/dist/cjs/pds-toast.cjs.entry.js +14 -8
  122. package/dist/cjs/pds-tooltip.cjs.entry.js +128 -46
  123. package/dist/cjs/pine-core.cjs.js +3 -3
  124. package/dist/cjs/portal-target-e8WQ6dLx.js +70 -0
  125. package/dist/cjs/tabbable-BrrrGvdG.js +86 -0
  126. package/dist/cjs/{truncation-tooltip-BtuiXLV0.js → truncation-tooltip-DdB78RIe.js} +44 -4
  127. package/dist/collection/components/pds-alert/pds-alert.css +13 -0
  128. package/dist/collection/components/pds-alert/pds-alert.js +36 -1
  129. package/dist/collection/components/pds-alert/stories/pds-alert.stories.js +4 -0
  130. package/dist/collection/components/pds-avatar/pds-avatar.js +41 -9
  131. package/dist/collection/components/pds-avatar/stories/pds-avatar.stories.js +2 -0
  132. package/dist/collection/components/pds-box/pds-box.js +1 -1
  133. package/dist/collection/components/pds-button/pds-button.js +13 -23
  134. package/dist/collection/components/pds-checkbox/pds-checkbox.css +79 -0
  135. package/dist/collection/components/pds-checkbox/pds-checkbox.js +36 -5
  136. package/dist/collection/components/pds-checkbox/stories/pds-checkbox.stories.js +38 -0
  137. package/dist/collection/components/pds-chip/pds-chip.js +2 -5
  138. package/dist/collection/components/pds-combobox/pds-combobox.css +33 -0
  139. package/dist/collection/components/pds-combobox/pds-combobox.js +60 -7
  140. package/dist/collection/components/pds-combobox/stories/pds-combobox.stories.js +44 -0
  141. package/dist/collection/components/pds-container/pds-container.js +1 -1
  142. package/dist/collection/components/pds-copytext/pds-copytext.js +1 -1
  143. package/dist/collection/components/pds-datepicker/calendar-portal.js +1 -38
  144. package/dist/collection/components/pds-datepicker/pds-datepicker.js +2 -2
  145. package/dist/collection/components/pds-divider/pds-divider.js +1 -1
  146. package/dist/collection/components/pds-drawer/pds-drawer-content/pds-drawer-content.js +1 -1
  147. package/dist/collection/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.js +1 -1
  148. package/dist/collection/components/pds-drawer/pds-drawer-header/pds-drawer-header.js +1 -1
  149. package/dist/collection/components/pds-drawer/pds-drawer.js +2 -2
  150. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +24 -2
  151. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-separator/pds-dropdown-menu-separator.js +1 -1
  152. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +1 -1
  153. package/dist/collection/components/pds-filters/pds-filter/pds-filter.js +1 -1
  154. package/dist/collection/components/pds-filters/pds-filters.js +1 -1
  155. package/dist/collection/components/pds-image/pds-image.js +2 -2
  156. package/dist/collection/components/pds-input/pds-input.js +2 -2
  157. package/dist/collection/components/pds-input/stories/pds-input.stories.js +6 -6
  158. package/dist/collection/components/pds-link/pds-link.css +1 -1
  159. package/dist/collection/components/pds-link/pds-link.js +34 -3
  160. package/dist/collection/components/pds-link/stories/pds-link.stories.js +51 -2
  161. package/dist/collection/components/pds-loader/pds-loader.js +1 -1
  162. package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js +2 -2
  163. package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +1 -1
  164. package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +1 -1
  165. package/dist/collection/components/pds-modal/pds-modal.css +1 -1
  166. package/dist/collection/components/pds-modal/pds-modal.js +4 -84
  167. package/dist/collection/components/pds-modal/test/mock-pds-modal.js +1 -1
  168. package/dist/collection/components/pds-multiselect/pds-multiselect.js +9 -3
  169. package/dist/collection/components/pds-popover/pds-popover.css +6 -0
  170. package/dist/collection/components/pds-popover/pds-popover.js +226 -149
  171. package/dist/collection/components/pds-progress/pds-progress.js +1 -1
  172. package/dist/collection/components/pds-property/pds-property.js +1 -1
  173. package/dist/collection/components/pds-radio/pds-radio.css +57 -0
  174. package/dist/collection/components/pds-radio/pds-radio.js +45 -9
  175. package/dist/collection/components/pds-radio/stories/pds-radio.stories.js +15 -0
  176. package/dist/collection/components/pds-radio-group/pds-radio-group.js +65 -4
  177. package/dist/collection/components/pds-radio-group/stories/pds-radio-group.stories.js +45 -0
  178. package/dist/collection/components/pds-row/pds-row.js +1 -1
  179. package/dist/collection/components/pds-select/pds-select.js +128 -17
  180. package/dist/collection/components/pds-select/stories/pds-select.stories.js +2 -2
  181. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +1 -1
  182. package/dist/collection/components/pds-sortable/pds-sortable.js +1 -1
  183. package/dist/collection/components/pds-switch/pds-switch.js +3 -3
  184. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +1 -1
  185. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +2 -2
  186. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +1 -1
  187. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +2 -2
  188. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +1 -1
  189. package/dist/collection/components/pds-table/stories/pds-table.stories.js +3 -3
  190. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +1 -1
  191. package/dist/collection/components/pds-tabs/pds-tabs.js +1 -1
  192. package/dist/collection/components/pds-text/pds-text.js +28 -3
  193. package/dist/collection/components/pds-text/stories/pds-text.stories.js +16 -0
  194. package/dist/collection/components/pds-textarea/pds-textarea.js +4 -4
  195. package/dist/collection/components/pds-textarea/stories/pds-textarea.stories.js +2 -2
  196. package/dist/collection/components/pds-toast/pds-toast.css +13 -0
  197. package/dist/collection/components/pds-toast/pds-toast.js +33 -5
  198. package/dist/collection/components/pds-toast/stories/pds-toast.stories.js +4 -1
  199. package/dist/collection/components/pds-tooltip/pds-tooltip.css +11 -0
  200. package/dist/collection/components/pds-tooltip/pds-tooltip.js +125 -42
  201. package/dist/collection/components/pds-tooltip/stories/pds-tooltip.stories.js +30 -0
  202. package/dist/collection/utils/aria-references.js +42 -0
  203. package/dist/collection/utils/portal-target.js +64 -0
  204. package/dist/collection/utils/tabbable.js +82 -0
  205. package/dist/collection/utils/truncation-tooltip.js +42 -3
  206. package/dist/docs.json +245 -8
  207. package/dist/esm/{attributes-WXw_I_uJ.js → attributes-DkeVeN0g.js} +1 -1
  208. package/dist/esm/{floating-ui.dom-BPqJgIq6.js → floating-ui.dom-Cuc0DYlm.js} +1 -1
  209. package/dist/esm/{index-Cw9J31qd.js → index-4_RRPJTO.js} +13 -2
  210. package/dist/esm/{index-BWDu62Mo.js → index-DvN3tyZp.js} +2 -2
  211. package/dist/esm/index.js +1 -1
  212. package/dist/esm/{keep-hydrated-BLG6RDBt.js → keep-hydrated-BgNaWLoS.js} +1 -1
  213. package/dist/esm/loader.js +4 -4
  214. package/dist/esm/mock-pds-modal.entry.js +4 -4
  215. package/dist/esm/pds-accordion.entry.js +3 -3
  216. package/dist/esm/pds-alert.entry.js +17 -4
  217. package/dist/esm/pds-avatar.entry.js +22 -12
  218. package/dist/esm/pds-box.entry.js +4 -4
  219. package/dist/esm/pds-button.entry.js +58 -26
  220. package/dist/esm/pds-checkbox.entry.js +16 -8
  221. package/dist/esm/pds-chip.entry.js +8 -10
  222. package/dist/esm/pds-combobox.entry.js +41 -11
  223. package/dist/esm/pds-container.entry.js +3 -3
  224. package/dist/esm/pds-copytext.entry.js +8 -7
  225. package/dist/esm/pds-datepicker.entry.js +7 -44
  226. package/dist/esm/pds-divider.entry.js +3 -3
  227. package/dist/esm/pds-drawer-content.entry.js +3 -3
  228. package/dist/esm/pds-drawer-footer.entry.js +3 -3
  229. package/dist/esm/pds-drawer-header.entry.js +3 -3
  230. package/dist/esm/pds-drawer.entry.js +4 -4
  231. package/dist/esm/pds-dropdown-menu-item.entry.js +4 -4
  232. package/dist/esm/pds-dropdown-menu-separator.entry.js +3 -3
  233. package/dist/esm/pds-dropdown-menu.entry.js +5 -5
  234. package/dist/esm/pds-filter.entry.js +4 -4
  235. package/dist/esm/pds-filters.entry.js +3 -3
  236. package/dist/esm/pds-icon.entry.js +55 -22
  237. package/dist/esm/pds-image.entry.js +4 -4
  238. package/dist/esm/pds-input.entry.js +6 -6
  239. package/dist/esm/pds-link.entry.js +16 -7
  240. package/dist/esm/pds-loader.entry.js +4 -4
  241. package/dist/esm/pds-modal-content.entry.js +4 -4
  242. package/dist/esm/pds-modal-footer.entry.js +3 -3
  243. package/dist/esm/pds-modal-header.entry.js +3 -3
  244. package/dist/esm/pds-modal.entry.js +7 -87
  245. package/dist/esm/pds-multiselect.entry.js +13 -7
  246. package/dist/esm/pds-popover.entry.js +230 -153
  247. package/dist/esm/pds-progress.entry.js +4 -4
  248. package/dist/esm/pds-property.entry.js +3 -3
  249. package/dist/esm/pds-radio-group.entry.js +67 -6
  250. package/dist/esm/pds-radio.entry.js +24 -11
  251. package/dist/esm/pds-row.entry.js +4 -4
  252. package/dist/esm/pds-select.entry.js +132 -21
  253. package/dist/esm/pds-sortable-item.entry.js +5 -5
  254. package/dist/esm/pds-sortable.entry.js +4 -4
  255. package/dist/esm/pds-switch.entry.js +7 -7
  256. package/dist/esm/pds-tab.entry.js +3 -3
  257. package/dist/esm/pds-table-body.entry.js +3 -3
  258. package/dist/esm/pds-table-cell.entry.js +7 -6
  259. package/dist/esm/pds-table-head-cell.entry.js +5 -5
  260. package/dist/esm/pds-table-head.entry.js +3 -3
  261. package/dist/esm/pds-table-row.entry.js +3 -3
  262. package/dist/esm/pds-table.entry.js +2 -2
  263. package/dist/esm/pds-tabpanel.entry.js +4 -4
  264. package/dist/esm/pds-tabs.entry.js +4 -4
  265. package/dist/esm/pds-text.entry.js +31 -5
  266. package/dist/esm/pds-textarea.entry.js +8 -8
  267. package/dist/esm/pds-toast.entry.js +14 -8
  268. package/dist/esm/pds-tooltip.entry.js +128 -46
  269. package/dist/esm/pine-core.js +4 -4
  270. package/dist/esm/portal-target-CKRzRKdO.js +66 -0
  271. package/dist/esm/tabbable-C6ZWpp3v.js +84 -0
  272. package/dist/esm/{truncation-tooltip-FaW67DiY.js → truncation-tooltip-CRSdYzpA.js} +44 -5
  273. package/dist/esm-es5/{attributes-WXw_I_uJ.js → attributes-DkeVeN0g.js} +1 -1
  274. package/dist/esm-es5/{floating-ui.dom-BPqJgIq6.js → floating-ui.dom-Cuc0DYlm.js} +1 -1
  275. package/dist/esm-es5/{index-Cw9J31qd.js → index-4_RRPJTO.js} +2 -2
  276. package/dist/esm-es5/{index-BWDu62Mo.js → index-DvN3tyZp.js} +1 -1
  277. package/dist/esm-es5/index.js +1 -1
  278. package/dist/esm-es5/{keep-hydrated-BLG6RDBt.js → keep-hydrated-BgNaWLoS.js} +1 -1
  279. package/dist/esm-es5/loader.js +1 -1
  280. package/dist/esm-es5/mock-pds-modal.entry.js +1 -1
  281. package/dist/esm-es5/pds-accordion.entry.js +1 -1
  282. package/dist/esm-es5/pds-alert.entry.js +1 -1
  283. package/dist/esm-es5/pds-avatar.entry.js +1 -1
  284. package/dist/esm-es5/pds-box.entry.js +1 -1
  285. package/dist/esm-es5/pds-button.entry.js +1 -1
  286. package/dist/esm-es5/pds-checkbox.entry.js +1 -1
  287. package/dist/esm-es5/pds-chip.entry.js +1 -1
  288. package/dist/esm-es5/pds-combobox.entry.js +2 -2
  289. package/dist/esm-es5/pds-container.entry.js +1 -1
  290. package/dist/esm-es5/pds-copytext.entry.js +1 -1
  291. package/dist/esm-es5/pds-datepicker.entry.js +1 -1
  292. package/dist/esm-es5/pds-divider.entry.js +1 -1
  293. package/dist/esm-es5/pds-drawer-content.entry.js +1 -1
  294. package/dist/esm-es5/pds-drawer-footer.entry.js +1 -1
  295. package/dist/esm-es5/pds-drawer-header.entry.js +1 -1
  296. package/dist/esm-es5/pds-drawer.entry.js +1 -1
  297. package/dist/esm-es5/pds-dropdown-menu-item.entry.js +1 -1
  298. package/dist/esm-es5/pds-dropdown-menu-separator.entry.js +1 -1
  299. package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
  300. package/dist/esm-es5/pds-filter.entry.js +1 -1
  301. package/dist/esm-es5/pds-filters.entry.js +1 -1
  302. package/dist/esm-es5/pds-icon.entry.js +1 -1
  303. package/dist/esm-es5/pds-image.entry.js +1 -1
  304. package/dist/esm-es5/pds-input.entry.js +1 -1
  305. package/dist/esm-es5/pds-link.entry.js +1 -1
  306. package/dist/esm-es5/pds-loader.entry.js +1 -1
  307. package/dist/esm-es5/pds-modal-content.entry.js +1 -1
  308. package/dist/esm-es5/pds-modal-footer.entry.js +1 -1
  309. package/dist/esm-es5/pds-modal-header.entry.js +1 -1
  310. package/dist/esm-es5/pds-modal.entry.js +1 -1
  311. package/dist/esm-es5/pds-multiselect.entry.js +1 -1
  312. package/dist/esm-es5/pds-popover.entry.js +1 -1
  313. package/dist/esm-es5/pds-progress.entry.js +1 -1
  314. package/dist/esm-es5/pds-property.entry.js +1 -1
  315. package/dist/esm-es5/pds-radio-group.entry.js +1 -1
  316. package/dist/esm-es5/pds-radio.entry.js +1 -1
  317. package/dist/esm-es5/pds-row.entry.js +1 -1
  318. package/dist/esm-es5/pds-select.entry.js +1 -1
  319. package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
  320. package/dist/esm-es5/pds-sortable.entry.js +2 -2
  321. package/dist/esm-es5/pds-switch.entry.js +1 -1
  322. package/dist/esm-es5/pds-tab.entry.js +1 -1
  323. package/dist/esm-es5/pds-table-body.entry.js +1 -1
  324. package/dist/esm-es5/pds-table-cell.entry.js +1 -1
  325. package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
  326. package/dist/esm-es5/pds-table-head.entry.js +1 -1
  327. package/dist/esm-es5/pds-table-row.entry.js +1 -1
  328. package/dist/esm-es5/pds-table.entry.js +1 -1
  329. package/dist/esm-es5/pds-tabpanel.entry.js +1 -1
  330. package/dist/esm-es5/pds-tabs.entry.js +1 -1
  331. package/dist/esm-es5/pds-text.entry.js +1 -1
  332. package/dist/esm-es5/pds-textarea.entry.js +1 -1
  333. package/dist/esm-es5/pds-toast.entry.js +1 -1
  334. package/dist/esm-es5/pds-tooltip.entry.js +1 -1
  335. package/dist/esm-es5/pine-core.js +1 -1
  336. package/dist/esm-es5/portal-target-CKRzRKdO.js +1 -0
  337. package/dist/esm-es5/tabbable-C6ZWpp3v.js +1 -0
  338. package/dist/esm-es5/truncation-tooltip-CRSdYzpA.js +1 -0
  339. package/dist/pine-core/index.esm.js +1 -1
  340. package/dist/pine-core/{p-9880d251.system.entry.js → p-01f1cdaf.system.entry.js} +1 -1
  341. package/dist/pine-core/{p-138b278b.entry.js → p-07323107.entry.js} +1 -1
  342. package/dist/pine-core/p-08b8e941.entry.js +1 -0
  343. package/dist/pine-core/p-0d5f0ab5.system.entry.js +1 -0
  344. package/dist/pine-core/{p-8c8cc079.system.entry.js → p-1415c988.system.entry.js} +1 -1
  345. package/dist/pine-core/{p-9109b90a.entry.js → p-143b33a6.entry.js} +1 -1
  346. package/dist/pine-core/{p-b9d145f8.system.entry.js → p-14dedf01.system.entry.js} +1 -1
  347. package/dist/pine-core/{p-80e6f3a0.system.entry.js → p-19cf1d91.system.entry.js} +1 -1
  348. package/dist/pine-core/p-1ca8d183.entry.js +1 -0
  349. package/dist/pine-core/p-1cc39908.system.entry.js +1 -0
  350. package/dist/pine-core/p-1e3ef425.entry.js +1 -0
  351. package/dist/pine-core/{p-b914dde8.entry.js → p-1f62bb71.entry.js} +2 -2
  352. package/dist/pine-core/p-20079552.system.entry.js +1 -0
  353. package/dist/pine-core/p-2a18852f.entry.js +1 -0
  354. package/dist/pine-core/{p-ca4ee736.system.entry.js → p-2b9622c1.system.entry.js} +1 -1
  355. package/dist/pine-core/p-2dd30d12.entry.js +1 -0
  356. package/dist/pine-core/{p-cccfe60f.system.entry.js → p-3306dc5a.system.entry.js} +1 -1
  357. package/dist/pine-core/{p-BGLP3keB.js → p-35s7h-dk.js} +1 -1
  358. package/dist/pine-core/{p-8c588ca0.entry.js → p-3610cb3b.entry.js} +1 -1
  359. package/dist/pine-core/p-37718637.entry.js +1 -0
  360. package/dist/pine-core/p-383d84f4.entry.js +2 -0
  361. package/dist/pine-core/p-39276663.entry.js +1 -0
  362. package/dist/pine-core/{p-62433f32.entry.js → p-39e57657.entry.js} +1 -1
  363. package/dist/pine-core/p-3c229091.entry.js +1 -0
  364. package/dist/pine-core/p-3d34b967.system.entry.js +1 -0
  365. package/dist/pine-core/p-3e30a761.entry.js +1 -0
  366. package/dist/pine-core/{p-7a5b21d2.system.entry.js → p-3f8bd3fb.system.entry.js} +1 -1
  367. package/dist/pine-core/p-42d43c3f.system.entry.js +1 -0
  368. package/dist/pine-core/{p-f029b7da.system.entry.js → p-42f70f93.system.entry.js} +1 -1
  369. package/dist/pine-core/{p-d3d69ca4.system.entry.js → p-4a90b9c8.system.entry.js} +1 -1
  370. package/dist/pine-core/{p-ca0a8f5c.entry.js → p-4cfe922b.entry.js} +1 -1
  371. package/dist/pine-core/p-4d1a8803.entry.js +1 -0
  372. package/dist/pine-core/p-4d47023c.system.entry.js +1 -0
  373. package/dist/pine-core/p-4d98bc0c.system.entry.js +1 -0
  374. package/dist/pine-core/{p-c97bfac9.entry.js → p-50ddadbf.entry.js} +1 -1
  375. package/dist/pine-core/{p-0913f696.system.entry.js → p-548bce53.system.entry.js} +1 -1
  376. package/dist/pine-core/p-54f1e86f.system.entry.js +1 -0
  377. package/dist/pine-core/{p-631f5bcc.entry.js → p-590df41a.entry.js} +1 -1
  378. package/dist/pine-core/p-5946203c.entry.js +1 -0
  379. package/dist/pine-core/{p-11d98408.system.entry.js → p-5f181694.system.entry.js} +1 -1
  380. package/dist/pine-core/p-60a30975.system.entry.js +1 -0
  381. package/dist/pine-core/{p-9ab95438.entry.js → p-61cfdbb2.entry.js} +1 -1
  382. package/dist/pine-core/p-62aa6a78.system.entry.js +1 -0
  383. package/dist/pine-core/{p-ecc7a531.system.entry.js → p-63f85859.system.entry.js} +1 -1
  384. package/dist/pine-core/p-64bcb378.entry.js +1 -0
  385. package/dist/pine-core/{p-bdac8f2b.entry.js → p-67999353.entry.js} +1 -1
  386. package/dist/pine-core/{p-cb6a3e4c.system.entry.js → p-67f795d5.system.entry.js} +1 -1
  387. package/dist/pine-core/p-6a1aa8d3.entry.js +1 -0
  388. package/dist/pine-core/p-6f4ab1ea.system.entry.js +1 -0
  389. package/dist/pine-core/{p-acca5f7b.system.entry.js → p-724baba3.system.entry.js} +1 -1
  390. package/dist/pine-core/p-72659a0e.system.entry.js +1 -0
  391. package/dist/pine-core/{p-4bfc8b3e.system.entry.js → p-73efb1ed.system.entry.js} +1 -1
  392. package/dist/pine-core/p-7a51f15e.entry.js +1 -0
  393. package/dist/pine-core/p-7b978fff.system.entry.js +1 -0
  394. package/dist/pine-core/p-8436cbfb.entry.js +1 -0
  395. package/dist/pine-core/p-849ec281.system.entry.js +1 -0
  396. package/dist/pine-core/p-87a32ded.system.entry.js +1 -0
  397. package/dist/pine-core/p-89d38a82.system.entry.js +1 -0
  398. package/dist/pine-core/p-8ade17ce.entry.js +1 -0
  399. package/dist/pine-core/{p-4d03d1e2.system.entry.js → p-8afd5f5b.system.entry.js} +1 -1
  400. package/dist/pine-core/p-8e7f75e6.entry.js +1 -0
  401. package/dist/pine-core/{p-8f531063.entry.js → p-8fb520df.entry.js} +1 -1
  402. package/dist/pine-core/{p-9df5e204.entry.js → p-92115e88.entry.js} +1 -1
  403. package/dist/pine-core/p-93fd7dd8.system.entry.js +1 -0
  404. package/dist/pine-core/p-947582e1.entry.js +1 -0
  405. package/dist/pine-core/{p-2ac2457b.system.entry.js → p-94c9b7d1.system.entry.js} +1 -1
  406. package/dist/pine-core/p-973c3ac0.entry.js +1 -0
  407. package/dist/pine-core/p-97653e60.entry.js +1 -0
  408. package/dist/pine-core/{p-55224683.entry.js → p-97b73359.entry.js} +1 -1
  409. package/dist/pine-core/{p-b1548a20.entry.js → p-99530cb5.entry.js} +1 -1
  410. package/dist/pine-core/p-9a776443.entry.js +1 -0
  411. package/dist/pine-core/p-9b32727a.system.entry.js +1 -0
  412. package/dist/pine-core/{p-CGRdQc49.system.js → p-BK1sLRfg.system.js} +2 -2
  413. package/dist/pine-core/{p-COtCa1Md.system.js → p-BNTlHhoO.system.js} +1 -1
  414. package/dist/pine-core/p-BZ1l3LGl.system.js +1 -0
  415. package/dist/pine-core/p-BgNaWLoS.js +1 -0
  416. package/dist/pine-core/p-C6ZWpp3v.js +1 -0
  417. package/dist/pine-core/{p-Cy8cvR7I.system.js → p-CANeE7Ss.system.js} +1 -1
  418. package/dist/pine-core/p-CKRzRKdO.js +1 -0
  419. package/dist/pine-core/{p-XW4H0W6i.system.js → p-CNXspDYs.system.js} +1 -1
  420. package/dist/pine-core/{p-BPqJgIq6.js → p-Cuc0DYlm.js} +1 -1
  421. package/dist/pine-core/p-DQyF6v9Q.system.js +1 -0
  422. package/dist/pine-core/{p-BWDu62Mo.js → p-DvN3tyZp.js} +1 -1
  423. package/dist/pine-core/p-DwQ5Tjis.js +1 -0
  424. package/dist/pine-core/{p-CmSJytt1.js → p-M31tvpDN.js} +2 -2
  425. package/dist/pine-core/p-XK45dzWR.system.js +1 -0
  426. package/dist/pine-core/{p-1dc5a7e0.system.entry.js → p-a09c9c5e.system.entry.js} +1 -1
  427. package/dist/pine-core/p-a4ce12ef.entry.js +1 -0
  428. package/dist/pine-core/{p-57a2f927.entry.js → p-a594c41f.entry.js} +1 -1
  429. package/dist/pine-core/p-a9d96e22.entry.js +1 -0
  430. package/dist/pine-core/{p-047433a4.system.entry.js → p-ad5208a4.system.entry.js} +1 -1
  431. package/dist/pine-core/p-b3d4f97a.system.entry.js +3 -0
  432. package/dist/pine-core/{p-0b71ecb6.system.entry.js → p-bcc378ba.system.entry.js} +2 -2
  433. package/dist/pine-core/p-bd7dc317.system.entry.js +1 -0
  434. package/dist/pine-core/p-beb7a430.entry.js +1 -0
  435. package/dist/pine-core/p-bfa34194.entry.js +1 -0
  436. package/dist/pine-core/{p-5870b092.system.entry.js → p-c2afe4f3.system.entry.js} +1 -1
  437. package/dist/pine-core/p-c5e1eb3c.system.entry.js +1 -0
  438. package/dist/pine-core/p-c7a53c4f.entry.js +1 -0
  439. package/dist/pine-core/{p-5cfd4d41.system.entry.js → p-c8a0b562.system.entry.js} +1 -1
  440. package/dist/pine-core/{p-f1702281.entry.js → p-c9ae7964.entry.js} +1 -1
  441. package/dist/pine-core/{p-db17c626.system.entry.js → p-cb9baf78.system.entry.js} +1 -1
  442. package/dist/pine-core/{p-e5420660.entry.js → p-ce9fa14b.entry.js} +1 -1
  443. package/dist/pine-core/{p-332590c7.system.entry.js → p-d018dc60.system.entry.js} +1 -1
  444. package/dist/pine-core/p-d47b2a6a.system.entry.js +1 -0
  445. package/dist/pine-core/{p-b75b0d09.system.entry.js → p-d48fe5a0.system.entry.js} +1 -1
  446. package/dist/pine-core/p-d6f338e0.entry.js +1 -0
  447. package/dist/pine-core/{p-8191498f.system.entry.js → p-d920d759.system.entry.js} +1 -1
  448. package/dist/pine-core/{p-26642718.entry.js → p-d9719e37.entry.js} +1 -1
  449. package/dist/pine-core/{p-c483997a.entry.js → p-db7fb5a3.entry.js} +1 -1
  450. package/dist/pine-core/{p-9713fb36.entry.js → p-e1d1b5d8.entry.js} +1 -1
  451. package/dist/pine-core/p-e3de6a1d.entry.js +1 -0
  452. package/dist/pine-core/{p-d2c91e7a.entry.js → p-e7002cee.entry.js} +1 -1
  453. package/dist/pine-core/{p-86040cac.system.entry.js → p-e82f758f.system.entry.js} +1 -1
  454. package/dist/pine-core/p-e84fa9ed.entry.js +1 -0
  455. package/dist/pine-core/{p-ee0e30bf.system.entry.js → p-eb4f0daa.system.entry.js} +1 -1
  456. package/dist/pine-core/p-eeYeEogd.system.js +1 -0
  457. package/dist/pine-core/{p-0af0d752.system.entry.js → p-eecd9ad8.system.entry.js} +1 -1
  458. package/dist/pine-core/p-ef0eba9b.system.entry.js +1 -0
  459. package/dist/pine-core/p-ef3a855f.system.entry.js +1 -0
  460. package/dist/pine-core/{p-717323e4.entry.js → p-f018af99.entry.js} +1 -1
  461. package/dist/pine-core/{p-121612a7.system.entry.js → p-f11cce27.system.entry.js} +1 -1
  462. package/dist/pine-core/{p-4fd454f6.entry.js → p-f6f4fd42.entry.js} +1 -1
  463. package/dist/pine-core/{p-a939b471.entry.js → p-f71d71ca.entry.js} +1 -1
  464. package/dist/pine-core/p-f9063262.system.entry.js +1 -0
  465. package/dist/pine-core/p-f99bd77f.entry.js +1 -0
  466. package/dist/pine-core/{p-ClDiSG97.system.js → p-vFsJv75D.system.js} +1 -1
  467. package/dist/pine-core/p-wB2y8gR7.system.js +1 -0
  468. package/dist/pine-core/pine-core.esm.js +1 -1
  469. package/dist/pine-core/pine-core.js +1 -1
  470. package/dist/types/components/pds-alert/pds-alert.d.ts +10 -0
  471. package/dist/types/components/pds-avatar/pds-avatar.d.ts +8 -0
  472. package/dist/types/components/pds-button/pds-button.d.ts +2 -2
  473. package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +7 -1
  474. package/dist/types/components/pds-combobox/pds-combobox.d.ts +9 -0
  475. package/dist/types/components/pds-datepicker/calendar-portal.d.ts +0 -7
  476. package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.d.ts +7 -0
  477. package/dist/types/components/pds-link/pds-link.d.ts +8 -0
  478. package/dist/types/components/pds-popover/pds-popover.d.ts +44 -20
  479. package/dist/types/components/pds-radio/pds-radio.d.ts +9 -3
  480. package/dist/types/components/pds-radio-group/pds-radio-group.d.ts +8 -0
  481. package/dist/types/components/pds-select/pds-select.d.ts +32 -4
  482. package/dist/types/components/pds-text/pds-text.d.ts +4 -0
  483. package/dist/types/components/pds-toast/pds-toast.d.ts +9 -0
  484. package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +32 -0
  485. package/dist/types/components.d.ts +98 -10
  486. package/dist/types/utils/aria-references.d.ts +24 -0
  487. package/dist/types/utils/portal-target.d.ts +17 -0
  488. package/dist/types/utils/tabbable.d.ts +2 -0
  489. package/dist/types/utils/truncation-tooltip.d.ts +5 -2
  490. package/dist/vscode.html-data.json +82 -10
  491. package/hydrate/index.js +971 -408
  492. package/hydrate/index.mjs +971 -408
  493. package/package.json +2 -2
  494. package/dist/esm-es5/truncation-tooltip-FaW67DiY.js +0 -1
  495. package/dist/pine-core/p-0092444c.system.entry.js +0 -1
  496. package/dist/pine-core/p-00a50de5.system.entry.js +0 -3
  497. package/dist/pine-core/p-049f126a.entry.js +0 -1
  498. package/dist/pine-core/p-089c3e60.entry.js +0 -1
  499. package/dist/pine-core/p-158b2f51.entry.js +0 -1
  500. package/dist/pine-core/p-17f97f1a.entry.js +0 -1
  501. package/dist/pine-core/p-19ba2788.system.entry.js +0 -1
  502. package/dist/pine-core/p-208c7dbf.entry.js +0 -1
  503. package/dist/pine-core/p-25ea48d1.entry.js +0 -1
  504. package/dist/pine-core/p-295f64ea.entry.js +0 -1
  505. package/dist/pine-core/p-29cd4113.system.entry.js +0 -1
  506. package/dist/pine-core/p-2cb5483a.system.entry.js +0 -1
  507. package/dist/pine-core/p-36cb4bf6.entry.js +0 -1
  508. package/dist/pine-core/p-3c977d8d.system.entry.js +0 -1
  509. package/dist/pine-core/p-3d51891a.entry.js +0 -1
  510. package/dist/pine-core/p-432d5ec7.entry.js +0 -1
  511. package/dist/pine-core/p-44f546ae.entry.js +0 -1
  512. package/dist/pine-core/p-5442d983.system.entry.js +0 -1
  513. package/dist/pine-core/p-5833a072.system.entry.js +0 -1
  514. package/dist/pine-core/p-602c197f.entry.js +0 -1
  515. package/dist/pine-core/p-719542e1.system.entry.js +0 -1
  516. package/dist/pine-core/p-73f931a1.entry.js +0 -1
  517. package/dist/pine-core/p-75ee0403.entry.js +0 -1
  518. package/dist/pine-core/p-77395d62.system.entry.js +0 -1
  519. package/dist/pine-core/p-7a287635.system.entry.js +0 -1
  520. package/dist/pine-core/p-875b0436.system.entry.js +0 -1
  521. package/dist/pine-core/p-884cb31d.system.entry.js +0 -1
  522. package/dist/pine-core/p-8987fd45.system.entry.js +0 -1
  523. package/dist/pine-core/p-8cc302aa.system.entry.js +0 -1
  524. package/dist/pine-core/p-8e3ff75d.entry.js +0 -1
  525. package/dist/pine-core/p-90d5edc6.entry.js +0 -1
  526. package/dist/pine-core/p-91f60173.entry.js +0 -1
  527. package/dist/pine-core/p-9265497e.system.entry.js +0 -1
  528. package/dist/pine-core/p-94593f20.system.entry.js +0 -1
  529. package/dist/pine-core/p-99459e27.entry.js +0 -1
  530. package/dist/pine-core/p-99fdf70f.entry.js +0 -1
  531. package/dist/pine-core/p-9aaedded.entry.js +0 -1
  532. package/dist/pine-core/p-9dcd2cdb.entry.js +0 -1
  533. package/dist/pine-core/p-BLG6RDBt.js +0 -1
  534. package/dist/pine-core/p-BR5nujVX.system.js +0 -1
  535. package/dist/pine-core/p-CuSNnuFu.system.js +0 -1
  536. package/dist/pine-core/p-D04W0cAO.system.js +0 -1
  537. package/dist/pine-core/p-a0960b3d.system.entry.js +0 -1
  538. package/dist/pine-core/p-a1230a74.system.entry.js +0 -1
  539. package/dist/pine-core/p-a826f290.entry.js +0 -1
  540. package/dist/pine-core/p-acce8eb2.entry.js +0 -1
  541. package/dist/pine-core/p-aff411d0.entry.js +0 -1
  542. package/dist/pine-core/p-b182f806.entry.js +0 -2
  543. package/dist/pine-core/p-bb68431a.entry.js +0 -1
  544. package/dist/pine-core/p-be9b6e63.system.entry.js +0 -1
  545. package/dist/pine-core/p-bf30dec0.entry.js +0 -1
  546. package/dist/pine-core/p-c4e12f0a.entry.js +0 -1
  547. package/dist/pine-core/p-e0917a26.entry.js +0 -1
  548. package/dist/pine-core/p-e836a041.entry.js +0 -1
  549. package/dist/pine-core/p-ea340c55.system.entry.js +0 -1
  550. package/dist/pine-core/p-ea4d4741.system.entry.js +0 -1
  551. package/dist/pine-core/p-ea8f5d29.entry.js +0 -1
  552. package/dist/pine-core/p-eaf85be6.system.entry.js +0 -1
  553. package/dist/pine-core/p-ef13f665.system.entry.js +0 -1
  554. package/dist/pine-core/p-f3067d90.system.entry.js +0 -1
  555. package/dist/pine-core/p-jrkGLEPe.js +0 -1
@@ -1,7 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var floatingUi_dom = require('./floating-ui.dom-Dc8Anyel.js');
3
+ var floatingUi_dom = require('./floating-ui.dom-Dw41zbyY.js');
4
+ var portalTarget = require('./portal-target-e8WQ6dLx.js');
4
5
 
6
+ // Controls that clipped text can sit inside that already take focus, so the text adds no tab stop of its own.
7
+ // Not any `[tabindex]`: a focusable scroll region full of chips would show every chip's tooltip at once.
8
+ const FOCUSABLE_WRAPPER = 'a[href], button, summary, pds-button, pds-link, pds-tab, pds-dropdown-menu-item, [role="option"]';
5
9
  /** CSS class prefix used for truncation tooltip portal elements */
6
10
  const TOOLTIP_CLASS = 'pds-truncation-tooltip';
7
11
  /**
@@ -11,7 +15,8 @@ const TOOLTIP_CLASS = 'pds-truncation-tooltip';
11
15
  *
12
16
  * Z-Index Strategy:
13
17
  * Uses --pine-z-index-nuclear (9999) to ensure tooltips appear above all other UI elements.
14
- * This is necessary because tooltips are portaled to document.body and must overlay:
18
+ * This is necessary because tooltips are portaled to document.body, or into the modal dialog or
19
+ * open popover around the host (the top layer, which no z-index reaches from the body), and must overlay:
15
20
  * - Modal dialogs
16
21
  * - Dropdown menus
17
22
  * - Other floating UI elements
@@ -51,6 +56,15 @@ function injectStyles() {
51
56
  opacity: 1;
52
57
  visibility: visible;
53
58
  }
59
+ :is(dialog, [popover]) > .${TOOLTIP_CLASS} {
60
+ font-style: normal;
61
+ font-weight: normal;
62
+ text-align: start;
63
+ text-indent: 0;
64
+ text-transform: none;
65
+ white-space: normal;
66
+ word-spacing: normal;
67
+ }
54
68
  `;
55
69
  document.head.appendChild(style);
56
70
  }
@@ -77,7 +91,8 @@ function isFocusVisible(el) {
77
91
  *
78
92
  * When the element's text overflows, hovering the host element or giving it
79
93
  * keyboard focus will display a tooltip showing the full text content. The
80
- * tooltip is rendered as a portal on document.body and positioned with Floating UI.
94
+ * tooltip is rendered as a portal on document.body, or in the modal dialog or open popover around
95
+ * the host, and positioned with Floating UI.
81
96
  *
82
97
  * Also owns the element's `tabindex` while it is clipped — see syncTabIndex.
83
98
  *
@@ -87,6 +102,7 @@ function setupTruncationTooltip(options) {
87
102
  const { hostEl, contentEl, getTooltipText, placement = 'top', reference = hostEl, manageTabIndex = true, focusEl = hostEl } = options;
88
103
  injectStyles();
89
104
  let portalEl = null;
105
+ let stopWatchingPortalHost = null;
90
106
  let isHovering = false;
91
107
  let isHoveringPortal = false;
92
108
  let isFocused = false;
@@ -165,7 +181,11 @@ function setupTruncationTooltip(options) {
165
181
  contentDiv.className = `${TOOLTIP_CLASS}__content`;
166
182
  contentDiv.textContent = text.trim();
167
183
  portalEl.appendChild(contentDiv);
168
- document.body.appendChild(portalEl);
184
+ const portalHost = portalTarget.findPortalTarget(hostEl, portalTarget.isTopLayerInDocument);
185
+ portalHost.appendChild(portalEl);
186
+ // Closing that host moves no pointer, so a tooltip opened by touch would outlive it unseen.
187
+ if (portalHost !== document.body)
188
+ stopWatchingPortalHost = portalTarget.onTopLayerClose(portalHost, closeWithPortalHost);
169
189
  // Allow the user to hover into the tooltip to select/copy text
170
190
  portalEl.addEventListener('mouseenter', handlePortalMouseEnter);
171
191
  portalEl.addEventListener('mouseleave', handlePortalMouseLeave);
@@ -204,6 +224,10 @@ function setupTruncationTooltip(options) {
204
224
  }
205
225
  }
206
226
  function removePortal() {
227
+ if (stopWatchingPortalHost !== null) {
228
+ stopWatchingPortalHost();
229
+ stopWatchingPortalHost = null;
230
+ }
207
231
  if (portalEl) {
208
232
  portalEl.removeEventListener('mouseenter', handlePortalMouseEnter);
209
233
  portalEl.removeEventListener('mouseleave', handlePortalMouseLeave);
@@ -237,6 +261,14 @@ function setupTruncationTooltip(options) {
237
261
  return;
238
262
  removePortal();
239
263
  }
264
+ // Hover and focus can't outlast a host that's no longer shown, so none of them keeps it open.
265
+ function closeWithPortalHost() {
266
+ isHovering = false;
267
+ isHoveringPortal = false;
268
+ isFocused = false;
269
+ cancelHideTimeout();
270
+ removePortal();
271
+ }
240
272
  /**
241
273
  * Schedules tooltip removal after a short delay.
242
274
  *
@@ -268,11 +300,18 @@ function setupTruncationTooltip(options) {
268
300
  isHoveringPortal = false;
269
301
  scheduleHide();
270
302
  }
303
+ // A second tab stop inside focusEl, such as another clipped text, bubbles its focus here too. Its event.target is
304
+ // retargeted to the stop's outermost element in focusEl's tree, which sits beside hostEl rather than around or in it.
305
+ function isFocusForHost(target) {
306
+ return focusEl === hostEl || target === focusEl || target.contains(hostEl) || hostEl.contains(target);
307
+ }
271
308
  // Keyboard focus only: focus from a click would pin the tooltip open after the pointer leaves.
272
309
  // Events from inside a shadow root arrive retargeted to its host, so test the innermost target.
273
310
  function showForVisibleFocus(event) {
274
311
  if (!isFocusVisible(event.composedPath()[0]))
275
312
  return;
313
+ if (!isFocusForHost(event.target))
314
+ return;
276
315
  isFocused = true;
277
316
  showTooltip();
278
317
  }
@@ -318,4 +357,5 @@ function setupTruncationTooltip(options) {
318
357
  };
319
358
  }
320
359
 
360
+ exports.FOCUSABLE_WRAPPER = FOCUSABLE_WRAPPER;
321
361
  exports.setupTruncationTooltip = setupTruncationTooltip;
@@ -128,4 +128,17 @@
128
128
  flex-shrink: 0;
129
129
  margin-inline-start: auto;
130
130
  white-space: nowrap;
131
+ }
132
+
133
+ .visually-hidden {
134
+ border: 0;
135
+ clip: rect(0 0 0 0);
136
+ clip-path: polygon(0 0, 0 0, 0 0);
137
+ height: 1px;
138
+ margin: -1px;
139
+ overflow: hidden;
140
+ padding: 0;
141
+ position: absolute;
142
+ white-space: nowrap;
143
+ width: 1px;
131
144
  }
@@ -1,4 +1,12 @@
1
1
  import { Host, h } from "@stencil/core";
2
+ // What each variant announces when `severityLabel` isn't set. The `default`
3
+ // variant has no severity.
4
+ const SEVERITY_LABELS = {
5
+ danger: 'Error',
6
+ info: 'Info',
7
+ success: 'Success',
8
+ warning: 'Warning',
9
+ };
2
10
  /**
3
11
  * @slot actions - Slot for alert actions.
4
12
  * @part dismiss
@@ -50,7 +58,12 @@ export class PdsAlert {
50
58
  }
51
59
  return (h("div", null, h("pds-text", { class: "pds-alert__description", color: "var(--pds-alert-color-text)", tag: "p" }, h("slot", null)), this.hasActionsContent && this.renderActions(false)));
52
60
  }
61
+ severityText() {
62
+ var _a;
63
+ return (_a = this.severityLabel) !== null && _a !== void 0 ? _a : SEVERITY_LABELS[this.variant];
64
+ }
53
65
  render() {
66
+ const severity = this.severityText();
54
67
  const iconMap = {
55
68
  danger: 'warning-filled',
56
69
  default: 'info-circle-filled',
@@ -60,7 +73,7 @@ export class PdsAlert {
60
73
  };
61
74
  // Get the icon name based on the current variant
62
75
  const iconName = iconMap[this.variant] || iconMap.default;
63
- return (h(Host, { key: 'b143df0c24c077e412894f5f77f1bd7c0ced1c92', class: "pds-alert", id: this.componentId, variant: this.variant }, h("pds-box", { key: '928e3852507a1776069ee80906443ef650607ce7', class: `pds-alert__container pds-alert__container--${this.variant}`, "background-color": "var(--pds-alert-background)", "border-color": "var(--pds-alert-border-color)", "border-radius": "md", border: true, display: "block" }, h("pds-box", { key: '778046ab1c651a57e910e45fe00944a74a3c32f7', gap: "sm", display: "flex", "align-items": this.small ? "center" : undefined }, !this.hideIcon && (h("pds-icon", { key: '0199ef3e12a8dc9da20006fc8c4e133f83f4caf4', class: `pds-alert__icon ${this.small ? 'pds-alert__icon--small' : ''}`, color: "var(--pds-alert-color-icon)", icon: iconName, size: "var(--pds-alert-icon-size)" })), h("pds-box", { key: 'b7b973c0c6154d72f90a585a116ea76ac48cc6e4', class: "pds-alert__content-wrapper", direction: "column", gap: "xs", flex: "grow" }, this.heading && !this.small && (h("pds-text", { key: 'c969f9a7eabdc31bc2faca247033e89cc15caea0', class: "pds-alert__heading", color: "var(--pds-alert-color-text)", size: "h5", tag: "h3", weight: "medium" }, this.heading)), this.renderContent()), this.dismissible && (h("button", { key: '168c21de5a0112a65b73a854add4393fea9ede6f', class: "pds-alert__dismiss", type: "button", part: "dismiss", "aria-label": this.dismissLabel, onClick: this.handleCloseClick }, h("pds-icon", { key: 'f8e9311a4934c1b8458879cd6244a99e3a730be2', icon: "remove", size: "var(--pds-alert-icon-size)", "aria-hidden": "true", color: "var(--pds-alert-color-dismiss)" })))))));
76
+ return (h(Host, { key: 'd487419289ef352f63e7861fb21f42aa243ee526', class: "pds-alert", id: this.componentId, variant: this.variant }, h("pds-box", { key: '0ecd6e25d4163d41055be53e88f6d332e56e1ed8', class: `pds-alert__container pds-alert__container--${this.variant}`, "background-color": "var(--pds-alert-background)", "border-color": "var(--pds-alert-border-color)", "border-radius": "md", border: true, display: "block" }, h("pds-box", { key: '4cca87bd3b9758e9830eddec25c9fd3e8c06a44d', gap: "sm", display: "flex", "align-items": this.small ? "center" : undefined }, severity && h("span", { key: 'b076475ed4a0bc2db09df84d6530db0e4e098daf', class: "visually-hidden" }, severity), !this.hideIcon && (h("pds-icon", { key: 'e8efc683c4f84e22fac8729c0c476c817b33f3e6', class: `pds-alert__icon ${this.small ? 'pds-alert__icon--small' : ''}`, color: "var(--pds-alert-color-icon)", icon: iconName, size: "var(--pds-alert-icon-size)", "aria-hidden": "true" })), h("pds-box", { key: 'f3ff29ce778f2e8bfb0d0a3e6a732714ce22e8ad', class: "pds-alert__content-wrapper", direction: "column", gap: "xs", flex: "grow" }, this.heading && !this.small && (h("pds-text", { key: 'c00d44fe496e8aae699ac740428e6e523c0c8d0a', class: "pds-alert__heading", color: "var(--pds-alert-color-text)", size: "h5", tag: "h3", weight: "medium" }, this.heading)), this.renderContent()), this.dismissible && (h("button", { key: 'd770590cecc3b27e1dd2750bbdfa07209dbb017d', class: "pds-alert__dismiss", type: "button", part: "dismiss", "aria-label": this.dismissLabel, onClick: this.handleCloseClick }, h("pds-icon", { key: '9d79c27c829662dbeecb30dfad806f345eeb6c67', icon: "remove", size: "var(--pds-alert-icon-size)", "aria-hidden": "true", color: "var(--pds-alert-color-dismiss)" })))))));
64
77
  }
65
78
  static get is() { return "pds-alert"; }
66
79
  static get encapsulation() { return "shadow"; }
@@ -225,6 +238,28 @@ export class PdsAlert {
225
238
  "reflect": false,
226
239
  "attribute": "dismiss-label",
227
240
  "defaultValue": "'Dismiss alert'"
241
+ },
242
+ "severityLabel": {
243
+ "type": "string",
244
+ "mutable": false,
245
+ "complexType": {
246
+ "original": "string",
247
+ "resolved": "string",
248
+ "references": {}
249
+ },
250
+ "required": false,
251
+ "optional": true,
252
+ "docs": {
253
+ "tags": [{
254
+ "name": "defaultValue",
255
+ "text": "undefined"
256
+ }],
257
+ "text": "Accessible label announcing the alert's severity, read before the heading\nand message. Pass a translated string to localize it; defaults to English\nfor each variant (`Error`, `Info`, `Success`, `Warning`). The `default`\nvariant has no severity and announces none unless this is set; pass an\nempty string to announce none for any variant."
258
+ },
259
+ "getter": false,
260
+ "setter": false,
261
+ "reflect": false,
262
+ "attribute": "severity-label"
228
263
  }
229
264
  };
230
265
  }
@@ -1,4 +1,5 @@
1
1
  import { html } from 'lit';
2
+ import { ifDefined } from 'lit/directives/if-defined.js';
2
3
 
3
4
 
4
5
  export default {
@@ -15,6 +16,7 @@ const BaseTemplate = (args) => html` <pds-alert
15
16
  ?small=${args.small}
16
17
  ?dismissible=${args.dismissible}
17
18
  ?hide-icon=${args.hideIcon}
19
+ severity-label=${ifDefined(args.severityLabel)}
18
20
  >${args.description}</pds-alert>`;
19
21
 
20
22
  const ActionsTemplate = (args) => html` <pds-alert
@@ -24,6 +26,7 @@ const ActionsTemplate = (args) => html` <pds-alert
24
26
  ?small=${args.small}
25
27
  ?dismissible=${args.dismissible}
26
28
  ?hide-icon=${args.hideIcon}
29
+ severity-label=${ifDefined(args.severityLabel)}
27
30
  >
28
31
  ${args.description}
29
32
  <pds-button slot="actions" variant="primary">Button</pds-button>
@@ -37,6 +40,7 @@ const SmallActionsTemplate = (args) => html` <pds-alert
37
40
  ?small=${args.small}
38
41
  ?dismissible=${args.dismissible}
39
42
  ?hide-icon=${args.hideIcon}
43
+ severity-label=${ifDefined(args.severityLabel)}
40
44
  >
41
45
  ${args.description}
42
46
  <pds-link slot="actions" variant="plain" href="#">Link</pds-link>
@@ -1,6 +1,8 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import { checkCircleFilled, userFilled } from "@pine-ds/icons/icons";
3
3
  import { restoreReflectedDefault } from "../../utils/reflected-attribute-default";
4
+ // Used when `badgeLabel` is unset; an empty string hides the badge instead.
5
+ const DEFAULT_BADGE_LABEL = 'Verified';
4
6
  /**
5
7
  * @part asset-wrapper
6
8
  * @part button
@@ -79,14 +81,22 @@ export class PdsAvatar {
79
81
  :
80
82
  this.renderAssetWrapper());
81
83
  };
82
- this.renderBadge = () => (
83
- // `badge` and `status` share the bottom-end corner; `status` wins so the
84
- // presence dot is never painted over the badge.
85
- this.badge && !this.status
86
- // Percentage is average size of icon in relation to total avatar size
87
- // of all preset sizes found in Figma.
88
- // Used to allow icons to scale to container size
89
- && h("pds-icon", { color: "var(--pine-color-purple-600)", class: "pds-avatar__badge", icon: checkCircleFilled, size: "33.53%" }));
84
+ this.renderBadge = () => {
85
+ var _a;
86
+ // Inside the dropdown trigger the button's aria-label is the name, so the
87
+ // badge is decorative there, as the status dot is. An empty label is
88
+ // decorative too, rather than an image with no name.
89
+ const badgeLabel = (_a = this.badgeLabel) !== null && _a !== void 0 ? _a : DEFAULT_BADGE_LABEL;
90
+ const label = this.dropdown || badgeLabel === '' ? undefined : badgeLabel;
91
+ return (
92
+ // `badge` and `status` share the bottom-end corner; `status` wins so the
93
+ // presence dot is never painted over the badge.
94
+ this.badge && !this.status
95
+ // Percentage is average size of icon in relation to total avatar size
96
+ // of all preset sizes found in Figma.
97
+ // Used to allow icons to scale to container size
98
+ && h("pds-icon", { color: "var(--pine-color-purple-600)", class: "pds-avatar__badge", icon: checkCircleFilled, size: "33.53%", "aria-label": label, "aria-hidden": label === undefined ? 'true' : undefined }));
99
+ };
90
100
  this.renderStatus = () => {
91
101
  var _a;
92
102
  if (!this.status)
@@ -141,7 +151,7 @@ export class PdsAvatar {
141
151
  }
142
152
  }
143
153
  render() {
144
- return (h(Host, { key: 'bd60a3273eaa4e2f5fa4d0f5d0d27babd7674e09', id: this.componentId, class: Object.assign({}, this.classNames()) }, this.renderAvatar()));
154
+ return (h(Host, { key: '0942c1fff94d0d8138143cbddf80aea1d09e34a9', id: this.componentId, class: Object.assign({}, this.classNames()) }, this.renderAvatar()));
145
155
  }
146
156
  static get is() { return "pds-avatar"; }
147
157
  static get encapsulation() { return "shadow"; }
@@ -203,6 +213,28 @@ export class PdsAvatar {
203
213
  "attribute": "badge",
204
214
  "defaultValue": "false"
205
215
  },
216
+ "badgeLabel": {
217
+ "type": "string",
218
+ "mutable": false,
219
+ "complexType": {
220
+ "original": "string",
221
+ "resolved": "string",
222
+ "references": {}
223
+ },
224
+ "required": false,
225
+ "optional": true,
226
+ "docs": {
227
+ "tags": [{
228
+ "name": "defaultValue",
229
+ "text": "'Verified'"
230
+ }],
231
+ "text": "Accessible label for the badge icon. Pass a translated string to localize\nit; defaults to English. Pass an empty string to make the badge\ndecorative. Has no effect on dropdown avatars, where the trigger's\n`triggerLabel` owns the accessible name."
232
+ },
233
+ "getter": false,
234
+ "setter": false,
235
+ "reflect": false,
236
+ "attribute": "badge-label"
237
+ },
206
238
  "componentId": {
207
239
  "type": "string",
208
240
  "mutable": false,
@@ -1,4 +1,5 @@
1
1
  import { html } from 'lit';
2
+ import { ifDefined } from 'lit/directives/if-defined.js';
2
3
  import imgFile from '../assets/demi_wilkinson.jpg';
3
4
 
4
5
 
@@ -22,6 +23,7 @@ export default {
22
23
  const BaseTemplate = (args) => html`<pds-avatar
23
24
  alt="${args.alt}"
24
25
  badge="${args.badge}"
26
+ badge-label=${ifDefined(args.badgeLabel)}
25
27
  dropdown="${args.dropdown}"
26
28
  component-id="${args.componentId}"
27
29
  image="${args.image}"
@@ -153,7 +153,7 @@ export class PdsBox {
153
153
  const normalizedBorder = normalizeColorValue(this.borderColor);
154
154
  const boxInlineStyles = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (normalizedBackground && { '--color-background-box': normalizedBackground })), (normalizedBorder && { '--color-border-box': normalizedBorder })), (this.minHeight && { '--sizing-min-height-box': this.minHeight })), (this.minWidth && { '--sizing-min-width-box': this.minWidth })), (this.flex && !['none', 'grow', 'shrink'].includes(this.flex) && { 'flex': this.flex }));
155
155
  this.hostKeeper.record(boxClasses, boxInlineStyles);
156
- return (h(Host, { key: '8a1348247b5a4c546759232f0f155721798797e5', class: boxClasses, style: boxInlineStyles }));
156
+ return (h(Host, { key: 'c791a8d413b47629c619424bebf9d9c4acc4d9f3', class: boxClasses, style: boxInlineStyles }));
157
157
  }
158
158
  static get is() { return "pds-box"; }
159
159
  static get originalStyleUrls() {
@@ -1,5 +1,6 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import { hasShadowDom } from "../../utils/utils";
3
+ import { ARIA_REFERENCE_ATTRIBUTES, forwardAriaReferences } from "../../utils/aria-references";
3
4
  import { caretDown, addCircle } from "@pine-ds/icons/icons";
4
5
  const FORWARDED_ARIA_ATTRIBUTES = ['aria-current', 'aria-expanded', 'aria-haspopup', 'aria-label', 'aria-pressed'];
5
6
  /**
@@ -68,7 +69,12 @@ export class PdsButton {
68
69
  if (FORWARDED_ARIA_ATTRIBUTES.some((name) => forwarded[name] !== this.forwardedAria[name])) {
69
70
  this.forwardedAria = forwarded;
70
71
  }
71
- this.forwardAriaControls();
72
+ this.forwardAriaReferences();
73
+ };
74
+ // A hint added after the button, or replaced by a framework or a DOM morph, is picked up by the
75
+ // time focus reaches the button and it's announced.
76
+ this.handleFocusIn = () => {
77
+ this.forwardAriaReferences();
72
78
  };
73
79
  this.handleStartSlotChange = (event) => {
74
80
  this.hasStartContent = event.target.assignedElements({ flatten: true }).length > 0;
@@ -111,7 +117,7 @@ export class PdsButton {
111
117
  // Consumers, popovers and menus set these on the host, often after render, but only the inner element is announced.
112
118
  this.hostAriaObserver = new MutationObserver(this.syncHostAria);
113
119
  this.hostAriaObserver.observe(this.el, {
114
- attributeFilter: FORWARDED_ARIA_ATTRIBUTES.concat('aria-controls'),
120
+ attributeFilter: FORWARDED_ARIA_ATTRIBUTES.concat(ARIA_REFERENCE_ATTRIBUTES),
115
121
  });
116
122
  }
117
123
  disconnectedCallback() {
@@ -120,7 +126,7 @@ export class PdsButton {
120
126
  this.hostAriaObserver = undefined;
121
127
  }
122
128
  componentDidRender() {
123
- this.forwardAriaControls();
129
+ this.forwardAriaReferences();
124
130
  }
125
131
  /**
126
132
  * Listen for Enter key presses on form inputs to trigger submit
@@ -171,25 +177,9 @@ export class PdsButton {
171
177
  }
172
178
  }
173
179
  }
174
- // ID references can't cross the shadow boundary, so aria-controls is forwarded as element references.
175
- forwardAriaControls() {
176
- var _a, _b;
177
- if (!this.contentEl || !('ariaControlsElements' in this.contentEl))
178
- return;
179
- const ids = (_b = (_a = this.el.getAttribute('aria-controls')) === null || _a === void 0 ? void 0 : _a.split(/\s+/).filter(Boolean)) !== null && _b !== void 0 ? _b : [];
180
- const controlled = ids.map((id) => this.findInAncestorRoots(id)).filter((el) => el !== null);
181
- this.contentEl.ariaControlsElements = controlled.length > 0 ? controlled : null;
182
- }
183
- // A trigger inside another component's shadow root still controls a popover portal on document.body.
184
- findInAncestorRoots(id) {
185
- let root = this.el.getRootNode();
186
- while (root instanceof ShadowRoot) {
187
- const found = root.getElementById(id);
188
- if (found)
189
- return found;
190
- root = root.host.getRootNode();
191
- }
192
- return root instanceof Document ? root.getElementById(id) : null;
180
+ forwardAriaReferences() {
181
+ if (this.contentEl)
182
+ forwardAriaReferences(this.el, this.contentEl);
193
183
  }
194
184
  classNames() {
195
185
  const classNames = ['pds-button'];
@@ -249,7 +239,7 @@ export class PdsButton {
249
239
  // Hide text when loading or iconOnly is true
250
240
  const hideText = this.loading || this.iconOnly;
251
241
  const content = (h("div", { class: "pds-button__content", part: "button-content" }, this.renderStartContent(), h("span", { class: `pds-button__text ${hideText ? 'pds-button__text--hidden' : ''}`, part: "button-text" }, h("slot", null)), this.loading && (h("span", { class: "pds-button__loader" }, h("pds-loader", { "is-loading": true, size: "var(--pine-font-size-body-2xl)", variant: "spinner", exportparts: "loader-svg" }, "Loading..."))), this.renderEndContent()));
252
- return (h(Host, Object.assign({ "aria-disabled": this.disabled ? 'true' : null }, (this.componentId != null ? { id: this.componentId } : {}), { onClick: this.handleClick, variant: this.variant }), h(ContentElement, Object.assign({}, attributes()), content)));
242
+ return (h(Host, Object.assign({ "aria-disabled": this.disabled ? 'true' : null }, (this.componentId != null ? { id: this.componentId } : {}), { onClick: this.handleClick, onFocusin: this.handleFocusIn, variant: this.variant }), h(ContentElement, Object.assign({}, attributes()), content)));
253
243
  }
254
244
  static get is() { return "pds-button"; }
255
245
  static get encapsulation() { return "shadow"; }
@@ -155,4 +155,83 @@ label {
155
155
  }
156
156
  .pds-checkbox__message--error pds-icon {
157
157
  margin-block-start: var(--pine-dimension-025);
158
+ }
159
+
160
+ :host(.pds-checkbox--pill) {
161
+ position: relative;
162
+ }
163
+ :host(.pds-checkbox--pill) label {
164
+ align-items: center;
165
+ background: var(--pine-color-background-container);
166
+ border: var(--pine-border);
167
+ border-radius: var(--pine-border-radius-full);
168
+ box-sizing: border-box;
169
+ color: var(--pine-color-text-active);
170
+ cursor: pointer;
171
+ font: var(--pine-typography-body);
172
+ min-block-size: var(--pine-dimension-xl);
173
+ padding: 0 var(--pine-dimension-sm);
174
+ transition: border-color var(--pine-motion-duration-fast) ease;
175
+ }
176
+ :host(.pds-checkbox--pill) label span {
177
+ min-width: 0;
178
+ overflow-wrap: anywhere;
179
+ }
180
+ :host(.pds-checkbox--pill) label:hover {
181
+ border-color: var(--pine-color-text);
182
+ }
183
+ :host(.pds-checkbox--pill) label:has(input:checked) {
184
+ border-color: var(--pine-color-text-active);
185
+ box-shadow: inset 0 0 0 var(--pine-border-width) var(--pine-color-text-active);
186
+ }
187
+ :host(.pds-checkbox--pill) label:has(input:focus-visible) {
188
+ outline: var(--pine-outline-focus);
189
+ outline-offset: var(--pine-border-width-thick);
190
+ }
191
+ :host(.pds-checkbox--pill) label:has(input:disabled) {
192
+ background: var(--pine-color-background-container-disabled);
193
+ border-color: var(--pine-color-border-disabled);
194
+ color: var(--pine-color-text-disabled);
195
+ cursor: not-allowed;
196
+ }
197
+ :host(.pds-checkbox--pill) label:has(input:disabled:checked) {
198
+ border-color: var(--pine-color-text-disabled);
199
+ box-shadow: inset 0 0 0 var(--pine-border-width) var(--pine-color-text-disabled);
200
+ }
201
+ @media (forced-colors: active) {
202
+ :host(.pds-checkbox--pill) label:has(input:disabled) {
203
+ border-color: GrayText;
204
+ }
205
+ :host(.pds-checkbox--pill) label:has(input:checked) {
206
+ border-color: Highlight;
207
+ border-width: var(--pine-border-width-thick);
208
+ padding-inline: calc(var(--pine-dimension-sm) - (var(--pine-border-width-thick) - var(--pine-border-width)));
209
+ }
210
+ :host(.pds-checkbox--pill) label:has(input:disabled:checked) {
211
+ border-color: GrayText;
212
+ border-width: var(--pine-border-width-thick);
213
+ padding-inline: calc(var(--pine-dimension-sm) - (var(--pine-border-width-thick) - var(--pine-border-width)));
214
+ }
215
+ }
216
+ :host(.pds-checkbox--pill) .pds-checkbox__message {
217
+ margin-inline-start: 0;
218
+ }
219
+
220
+ :host(.pds-checkbox--pill.is-invalid:not(.is-disabled)) label {
221
+ border-color: var(--pine-color-border-danger);
222
+ color: var(--pine-color-text-active);
223
+ }
224
+ :host(.pds-checkbox--pill.is-invalid:not(.is-disabled)) label:has(input:checked) {
225
+ border-color: var(--pine-color-border-danger);
226
+ box-shadow: inset 0 0 0 var(--pine-border-width) var(--pine-color-border-danger);
227
+ }
228
+ :host(.pds-checkbox--pill.is-invalid:not(.is-disabled)) label:has(input:focus-visible) {
229
+ outline: var(--pine-outline-focus-danger);
230
+ }
231
+ @media (forced-colors: active) {
232
+ :host(.pds-checkbox--pill.is-invalid:not(.is-disabled)) label:has(input:checked) {
233
+ border-color: Highlight;
234
+ border-width: var(--pine-border-width-thick);
235
+ padding-inline: calc(var(--pine-dimension-sm) - (var(--pine-border-width-thick) - var(--pine-border-width)));
236
+ }
158
237
  }
@@ -15,6 +15,11 @@ export class PdsCheckbox {
15
15
  * It determines whether or not the checkbox is checked.
16
16
  */
17
17
  this.checked = false;
18
+ /**
19
+ * Sets the style variant of the checkbox. `pill` renders the label as a pill-shaped choice; the native input still handles keyboard, form, and screen reader behavior.
20
+ * @defaultValue default
21
+ */
22
+ this.variant = 'default';
18
23
  this.handleCheckboxChange = (e) => {
19
24
  if (this.disabled) {
20
25
  return;
@@ -54,6 +59,9 @@ export class PdsCheckbox {
54
59
  if (this.hasLabelSlot) {
55
60
  classNames.push('has-label-slot');
56
61
  }
62
+ if (this.variant === 'pill') {
63
+ classNames.push('pds-checkbox--pill');
64
+ }
57
65
  return classNames.join(' ');
58
66
  }
59
67
  connectedCallback() {
@@ -116,9 +124,9 @@ export class PdsCheckbox {
116
124
  render() {
117
125
  const hostClass = this.classNames();
118
126
  this.hostKeeper.record(hostClass);
119
- return (h(Host, { key: 'bbe09a5e9eb55f62b2921b09a04ddc9476a871ae', class: hostClass }, h("label", { key: 'fa1856d9306eb8c0c19618ea5e2619ea20c3c51d', htmlFor: this.componentId }, h("input", Object.assign({ key: '8537d97a8e69a17d0d563306dac179e393885dda', type: "checkbox", "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage, this.errorMessage), "aria-invalid": this.invalid ? "true" : undefined, id: this.componentId, indeterminate: this.indeterminate, name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onChange: this.handleCheckboxChange, onInput: this.handleInput }, this.inheritedAttributes)), h("span", { key: 'e523922889c80a2d18243cb560cd855bab95803d', class: this.hideLabel ? 'visually-hidden' : '' }, h("slot", { key: 'b6ff34ecbc346d254a0211bfa610823feedb486b', name: "label", onSlotchange: this.updateHasLabelSlot }), !this.hasLabelSlot && this.label)), this.helperMessage &&
120
- h("div", { key: '55dcca850dff0aa93d9ba63d6827d9155ac35dab', class: 'pds-checkbox__message', id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
121
- h("div", { key: '5af843679994d29f084d41e90e41e0939c951063', class: `pds-checkbox__message pds-checkbox__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: '88a46a17abc1c7b3b3e90543ce8dcf38a14c878c', "aria-hidden": "true", icon: danger, size: "small" }), this.errorMessage)));
127
+ return (h(Host, { key: '8e9185653796f250ad425350b9adc1f65fd047c1', class: hostClass }, h("label", { key: 'e17bab4b96b4ffc716e311ecea488a3025e1551c', htmlFor: this.componentId }, h("input", Object.assign({ key: '8af9bbc3dbe18409532e95b4b490eab4aabc8762', type: "checkbox", "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage, this.errorMessage), "aria-invalid": this.invalid ? "true" : undefined, id: this.componentId, indeterminate: this.indeterminate, name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onChange: this.handleCheckboxChange, onInput: this.handleInput, class: this.variant === 'pill' ? 'visually-hidden' : undefined }, this.inheritedAttributes)), h("span", { key: '1e4d9a826b6b5ec429ae47096d4aede3af43d110', class: this.hideLabel && this.variant !== 'pill' ? 'visually-hidden' : '' }, h("slot", { key: '7b10c7d1e018be4afe019cb56e82a5ec7a638de8', name: "label", onSlotchange: this.updateHasLabelSlot }), !this.hasLabelSlot && this.label)), this.helperMessage &&
128
+ h("div", { key: 'c5455322eb07bf73805a17c28bf6acc1b5384337', class: 'pds-checkbox__message', id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
129
+ h("div", { key: '0f7c8ec00362c31b1c5bd11c185c6e7bfc177f22', class: `pds-checkbox__message pds-checkbox__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: 'f6eccfaac90505903aee379f2fc28b5735d8c4a9', "aria-hidden": "true", icon: danger, size: "small" }), this.errorMessage)));
122
130
  }
123
131
  static get is() { return "pds-checkbox"; }
124
132
  static get encapsulation() { return "shadow"; }
@@ -243,7 +251,7 @@ export class PdsCheckbox {
243
251
  "optional": false,
244
252
  "docs": {
245
253
  "tags": [],
246
- "text": "If `true`, the checkbox will visually appear as indeterminate.\nOnly JavaScript can set the objects `indeterminate` property. See [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes)."
254
+ "text": "If `true`, the checkbox will visually appear as indeterminate.\nOnly JavaScript can set the objects `indeterminate` property. See [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes).\nHas no visual style when `variant` is `pill`."
247
255
  },
248
256
  "getter": false,
249
257
  "setter": false,
@@ -300,7 +308,7 @@ export class PdsCheckbox {
300
308
  "optional": false,
301
309
  "docs": {
302
310
  "tags": [],
303
- "text": "Visually hides the label text for instances where only the checkbox should be displayed. Label remains accessible to assistive technology such as screen readers."
311
+ "text": "Visually hides the label text for instances where only the checkbox should be displayed. Label remains accessible to assistive technology such as screen readers. Ignored when `variant` is `pill`."
304
312
  },
305
313
  "getter": false,
306
314
  "setter": false,
@@ -363,6 +371,29 @@ export class PdsCheckbox {
363
371
  "setter": false,
364
372
  "reflect": false,
365
373
  "attribute": "value"
374
+ },
375
+ "variant": {
376
+ "type": "string",
377
+ "mutable": false,
378
+ "complexType": {
379
+ "original": "'default' | 'pill'",
380
+ "resolved": "\"default\" | \"pill\"",
381
+ "references": {}
382
+ },
383
+ "required": false,
384
+ "optional": false,
385
+ "docs": {
386
+ "tags": [{
387
+ "name": "defaultValue",
388
+ "text": "default"
389
+ }],
390
+ "text": "Sets the style variant of the checkbox. `pill` renders the label as a pill-shaped choice; the native input still handles keyboard, form, and screen reader behavior."
391
+ },
392
+ "getter": false,
393
+ "setter": false,
394
+ "reflect": false,
395
+ "attribute": "variant",
396
+ "defaultValue": "'default'"
366
397
  }
367
398
  };
368
399
  }
@@ -8,6 +8,13 @@ export default {
8
8
  invalid: false,
9
9
  hideLabel: false,
10
10
  required: false,
11
+ variant: 'default',
12
+ },
13
+ argTypes: {
14
+ variant: {
15
+ control: { type: 'select' },
16
+ options: ['default', 'pill'],
17
+ },
11
18
  },
12
19
  component: 'pds-checkbox',
13
20
  parameters: {},
@@ -28,6 +35,7 @@ const BaseTemplate = (args) =>
28
35
  name=${args.name}
29
36
  ?required=${args.required}
30
37
  value=${args.value}
38
+ variant=${args.variant}
31
39
  />`;
32
40
 
33
41
  export const Default = BaseTemplate.bind();
@@ -72,3 +80,33 @@ Invalid.args = {
72
80
  label: 'Label text',
73
81
  invalid: true,
74
82
  };
83
+
84
+ export const Pill = BaseTemplate.bind();
85
+ Pill.args = {
86
+ componentId: 'pill',
87
+ label: 'Label text',
88
+ variant: 'pill',
89
+ };
90
+
91
+ const PillGroupTemplate = (args) =>
92
+ html`<fieldset style="border: 0; margin: 0; padding: 0;">
93
+ <legend style="font: var(--pine-typography-body-medium); margin-block-end: var(--pine-dimension-xs); padding: 0;">Send to</legend>
94
+ <pds-box wrap gap="xs">
95
+ <pds-checkbox component-id="pill-email" name="channels" value="email" label="Email" variant="pill" checked ?disabled=${args.disabled} ?invalid=${args.invalid}></pds-checkbox>
96
+ <pds-checkbox component-id="pill-sms" name="channels" value="sms" label="SMS" variant="pill" ?disabled=${args.disabled} ?invalid=${args.invalid}></pds-checkbox>
97
+ <pds-checkbox component-id="pill-push" name="channels" value="push" label="Push notification" variant="pill" ?disabled=${args.disabled} ?invalid=${args.invalid}></pds-checkbox>
98
+ </pds-box>
99
+ </fieldset>`;
100
+
101
+ export const PillGroup = PillGroupTemplate.bind();
102
+ PillGroup.args = {};
103
+
104
+ export const PillDisabled = PillGroupTemplate.bind();
105
+ PillDisabled.args = {
106
+ disabled: true,
107
+ };
108
+
109
+ export const PillInvalid = PillGroupTemplate.bind();
110
+ PillInvalid.args = {
111
+ invalid: true,
112
+ };