@pine-ds/core 3.18.0 → 3.20.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 (321) hide show
  1. package/components/index2.js +1 -1
  2. package/components/index2.js.map +1 -1
  3. package/components/mock-pds-modal.js +1 -1
  4. package/components/mock-pds-modal.js.map +1 -1
  5. package/components/pds-button2.js +3 -2
  6. package/components/pds-button2.js.map +1 -1
  7. package/components/pds-chip2.js +20 -7
  8. package/components/pds-chip2.js.map +1 -1
  9. package/components/pds-combobox.js +2 -2
  10. package/components/pds-combobox.js.map +1 -1
  11. package/components/pds-dropdown-menu-item.js +3 -2
  12. package/components/pds-dropdown-menu-item.js.map +1 -1
  13. package/components/pds-dropdown-menu.js +1 -1
  14. package/components/pds-dropdown-menu.js.map +1 -1
  15. package/components/pds-link2.js +3 -2
  16. package/components/pds-link2.js.map +1 -1
  17. package/components/pds-modal.js +2 -2
  18. package/components/pds-modal.js.map +1 -1
  19. package/components/pds-multiselect.js +1 -1
  20. package/components/pds-multiselect.js.map +1 -1
  21. package/components/pds-text2.js +17 -7
  22. package/components/pds-text2.js.map +1 -1
  23. package/dist/cjs/{index-CjhTEk39.js → index-D8mNsvM8.js} +3 -3
  24. package/dist/{esm-es5/index-BFkDH5XU.js.map → cjs/index-D8mNsvM8.js.map} +1 -1
  25. package/dist/cjs/loader.cjs.js +1 -1
  26. package/dist/cjs/mock-pds-modal.cjs.entry.js +1 -1
  27. package/dist/cjs/mock-pds-modal.entry.cjs.js.map +1 -1
  28. package/dist/cjs/pds-accordion.cjs.entry.js +1 -1
  29. package/dist/cjs/pds-avatar.cjs.entry.js +1 -1
  30. package/dist/cjs/pds-button.cjs.entry.js +2 -2
  31. package/dist/cjs/pds-button.entry.cjs.js.map +1 -1
  32. package/dist/cjs/pds-checkbox.cjs.entry.js +1 -1
  33. package/dist/cjs/pds-chip.cjs.entry.js +20 -8
  34. package/dist/cjs/pds-chip.entry.cjs.js.map +1 -1
  35. package/dist/cjs/pds-combobox.cjs.entry.js +2 -2
  36. package/dist/cjs/pds-combobox.entry.cjs.js.map +1 -1
  37. package/dist/cjs/pds-copytext.cjs.entry.js +1 -1
  38. package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +2 -2
  39. package/dist/cjs/pds-dropdown-menu-item.entry.cjs.js.map +1 -1
  40. package/dist/cjs/pds-dropdown-menu.cjs.entry.js +1 -1
  41. package/dist/cjs/pds-dropdown-menu.entry.cjs.js.map +1 -1
  42. package/dist/cjs/pds-filter.cjs.entry.js +1 -1
  43. package/dist/cjs/pds-input.cjs.entry.js +1 -1
  44. package/dist/cjs/pds-link.cjs.entry.js +3 -3
  45. package/dist/cjs/pds-link.entry.cjs.js.map +1 -1
  46. package/dist/cjs/pds-modal.cjs.entry.js +2 -2
  47. package/dist/cjs/pds-modal.entry.cjs.js.map +1 -1
  48. package/dist/cjs/pds-multiselect.cjs.entry.js +2 -2
  49. package/dist/cjs/pds-multiselect.entry.cjs.js.map +1 -1
  50. package/dist/cjs/pds-radio-group.cjs.entry.js +1 -1
  51. package/dist/cjs/pds-radio.cjs.entry.js +1 -1
  52. package/dist/cjs/pds-select.cjs.entry.js +1 -1
  53. package/dist/cjs/pds-sortable-item.cjs.entry.js +1 -1
  54. package/dist/cjs/pds-switch.cjs.entry.js +1 -1
  55. package/dist/cjs/pds-table-head-cell.cjs.entry.js +1 -1
  56. package/dist/cjs/pds-text.cjs.entry.js +17 -7
  57. package/dist/cjs/pds-text.entry.cjs.js.map +1 -1
  58. package/dist/cjs/pds-textarea.cjs.entry.js +1 -1
  59. package/dist/cjs/pine-core.cjs.js +1 -1
  60. package/dist/collection/components/pds-button/pds-button.js +22 -3
  61. package/dist/collection/components/pds-button/pds-button.js.map +1 -1
  62. package/dist/collection/components/pds-chip/pds-chip.css +25 -4
  63. package/dist/collection/components/pds-chip/pds-chip.js +50 -7
  64. package/dist/collection/components/pds-chip/pds-chip.js.map +1 -1
  65. package/dist/collection/components/pds-chip/stories/pds-chip.stories.js +36 -13
  66. package/dist/collection/components/pds-combobox/pds-combobox.js +2 -2
  67. package/dist/collection/components/pds-combobox/pds-combobox.js.map +1 -1
  68. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js +21 -2
  69. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.js.map +1 -1
  70. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.css +1 -1
  71. package/dist/collection/components/pds-link/pds-link.js +21 -2
  72. package/dist/collection/components/pds-link/pds-link.js.map +1 -1
  73. package/dist/collection/components/pds-modal/pds-modal.js +2 -2
  74. package/dist/collection/components/pds-modal/pds-modal.js.map +1 -1
  75. package/dist/collection/components/pds-modal/test/mock-pds-modal.js +1 -1
  76. package/dist/collection/components/pds-modal/test/mock-pds-modal.js.map +1 -1
  77. package/dist/collection/components/pds-multiselect/pds-multiselect.css +2 -2
  78. package/dist/collection/components/pds-text/pds-text.js +24 -14
  79. package/dist/collection/components/pds-text/pds-text.js.map +1 -1
  80. package/dist/collection/utils/types.js.map +1 -1
  81. package/dist/docs.json +154 -14
  82. package/dist/esm/{index-BFkDH5XU.js → index-Bmf4Ow_8.js} +3 -3
  83. package/dist/{cjs/index-CjhTEk39.js.map → esm/index-Bmf4Ow_8.js.map} +1 -1
  84. package/dist/esm/loader.js +1 -1
  85. package/dist/esm/mock-pds-modal.entry.js +1 -1
  86. package/dist/esm/mock-pds-modal.entry.js.map +1 -1
  87. package/dist/esm/pds-accordion.entry.js +1 -1
  88. package/dist/esm/pds-avatar.entry.js +1 -1
  89. package/dist/esm/pds-button.entry.js +2 -2
  90. package/dist/esm/pds-button.entry.js.map +1 -1
  91. package/dist/esm/pds-checkbox.entry.js +1 -1
  92. package/dist/esm/pds-chip.entry.js +20 -8
  93. package/dist/esm/pds-chip.entry.js.map +1 -1
  94. package/dist/esm/pds-combobox.entry.js +2 -2
  95. package/dist/esm/pds-combobox.entry.js.map +1 -1
  96. package/dist/esm/pds-copytext.entry.js +1 -1
  97. package/dist/esm/pds-dropdown-menu-item.entry.js +2 -2
  98. package/dist/esm/pds-dropdown-menu-item.entry.js.map +1 -1
  99. package/dist/esm/pds-dropdown-menu.entry.js +1 -1
  100. package/dist/esm/pds-dropdown-menu.entry.js.map +1 -1
  101. package/dist/esm/pds-filter.entry.js +1 -1
  102. package/dist/esm/pds-input.entry.js +1 -1
  103. package/dist/esm/pds-link.entry.js +3 -3
  104. package/dist/esm/pds-link.entry.js.map +1 -1
  105. package/dist/esm/pds-modal.entry.js +2 -2
  106. package/dist/esm/pds-modal.entry.js.map +1 -1
  107. package/dist/esm/pds-multiselect.entry.js +2 -2
  108. package/dist/esm/pds-multiselect.entry.js.map +1 -1
  109. package/dist/esm/pds-radio-group.entry.js +1 -1
  110. package/dist/esm/pds-radio.entry.js +1 -1
  111. package/dist/esm/pds-select.entry.js +1 -1
  112. package/dist/esm/pds-sortable-item.entry.js +1 -1
  113. package/dist/esm/pds-switch.entry.js +1 -1
  114. package/dist/esm/pds-table-head-cell.entry.js +1 -1
  115. package/dist/esm/pds-text.entry.js +17 -7
  116. package/dist/esm/pds-text.entry.js.map +1 -1
  117. package/dist/esm/pds-textarea.entry.js +1 -1
  118. package/dist/esm/pine-core.js +1 -1
  119. package/dist/esm-es5/{index-BFkDH5XU.js → index-Bmf4Ow_8.js} +1 -1
  120. package/dist/{esm/index-BFkDH5XU.js.map → esm-es5/index-Bmf4Ow_8.js.map} +1 -1
  121. package/dist/esm-es5/loader.js +1 -1
  122. package/dist/esm-es5/mock-pds-modal.entry.js +1 -1
  123. package/dist/esm-es5/mock-pds-modal.entry.js.map +1 -1
  124. package/dist/esm-es5/pds-accordion.entry.js +1 -1
  125. package/dist/esm-es5/pds-avatar.entry.js +1 -1
  126. package/dist/esm-es5/pds-button.entry.js +1 -1
  127. package/dist/esm-es5/pds-button.entry.js.map +1 -1
  128. package/dist/esm-es5/pds-checkbox.entry.js +1 -1
  129. package/dist/esm-es5/pds-chip.entry.js +1 -1
  130. package/dist/esm-es5/pds-chip.entry.js.map +1 -1
  131. package/dist/esm-es5/pds-combobox.entry.js +1 -1
  132. package/dist/esm-es5/pds-combobox.entry.js.map +1 -1
  133. package/dist/esm-es5/pds-copytext.entry.js +1 -1
  134. package/dist/esm-es5/pds-dropdown-menu-item.entry.js +1 -1
  135. package/dist/esm-es5/pds-dropdown-menu-item.entry.js.map +1 -1
  136. package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
  137. package/dist/esm-es5/pds-dropdown-menu.entry.js.map +1 -1
  138. package/dist/esm-es5/pds-filter.entry.js +1 -1
  139. package/dist/esm-es5/pds-input.entry.js +1 -1
  140. package/dist/esm-es5/pds-link.entry.js +1 -1
  141. package/dist/esm-es5/pds-link.entry.js.map +1 -1
  142. package/dist/esm-es5/pds-modal.entry.js +1 -1
  143. package/dist/esm-es5/pds-modal.entry.js.map +1 -1
  144. package/dist/esm-es5/pds-multiselect.entry.js +1 -1
  145. package/dist/esm-es5/pds-multiselect.entry.js.map +1 -1
  146. package/dist/esm-es5/pds-radio-group.entry.js +1 -1
  147. package/dist/esm-es5/pds-radio.entry.js +1 -1
  148. package/dist/esm-es5/pds-select.entry.js +1 -1
  149. package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
  150. package/dist/esm-es5/pds-switch.entry.js +1 -1
  151. package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
  152. package/dist/esm-es5/pds-text.entry.js +1 -1
  153. package/dist/esm-es5/pds-text.entry.js.map +1 -1
  154. package/dist/esm-es5/pds-textarea.entry.js +1 -1
  155. package/dist/esm-es5/pine-core.js +1 -1
  156. package/dist/pine-core/mock-pds-modal.entry.esm.js.map +1 -1
  157. package/dist/pine-core/{p-8f935480.entry.js → p-0b3d6527.entry.js} +2 -2
  158. package/dist/pine-core/{p-b6f57c0f.system.entry.js → p-18a3b6ba.system.entry.js} +2 -2
  159. package/dist/pine-core/{p-45c1f3ea.system.entry.js → p-1b0dc99e.system.entry.js} +2 -2
  160. package/dist/pine-core/p-1b0dc99e.system.entry.js.map +1 -0
  161. package/dist/pine-core/{p-32f65e48.entry.js → p-221b4348.entry.js} +2 -2
  162. package/dist/pine-core/{p-15ac22bd.system.entry.js → p-2a7b94ba.system.entry.js} +2 -2
  163. package/dist/pine-core/{p-01aec1ad.system.entry.js → p-2f64a2fe.system.entry.js} +2 -2
  164. package/dist/pine-core/p-2f64a2fe.system.entry.js.map +1 -0
  165. package/dist/pine-core/{p-3ea301dd.system.entry.js → p-2f663747.system.entry.js} +2 -2
  166. package/dist/pine-core/p-2f663747.system.entry.js.map +1 -0
  167. package/dist/pine-core/p-3239c67a.entry.js +2 -0
  168. package/dist/pine-core/{p-f5fb71f6.entry.js.map → p-3239c67a.entry.js.map} +1 -1
  169. package/dist/pine-core/{p-85ce731b.entry.js → p-378d01df.entry.js} +2 -2
  170. package/dist/pine-core/p-37e5e471.entry.js +2 -0
  171. package/dist/pine-core/p-37e5e471.entry.js.map +1 -0
  172. package/dist/pine-core/{p-4189f1be.system.entry.js → p-3fc8dbc9.system.entry.js} +2 -2
  173. package/dist/pine-core/{p-4189f1be.system.entry.js.map → p-3fc8dbc9.system.entry.js.map} +1 -1
  174. package/dist/pine-core/{p-77d4f274.system.entry.js → p-40c04518.system.entry.js} +2 -2
  175. package/dist/pine-core/{p-4232520f.system.entry.js → p-445c5ec5.system.entry.js} +2 -2
  176. package/dist/pine-core/{p-8ab66dbc.system.entry.js → p-46d61c98.system.entry.js} +2 -2
  177. package/dist/pine-core/{p-4de64b1f.entry.js → p-4c0e71ce.entry.js} +2 -2
  178. package/dist/pine-core/{p-fbe793c7.system.entry.js → p-4fb30dcc.system.entry.js} +2 -2
  179. package/dist/pine-core/p-4fb30dcc.system.entry.js.map +1 -0
  180. package/dist/pine-core/{p-4e015ddd.entry.js → p-5107c129.entry.js} +2 -2
  181. package/dist/pine-core/p-5107c129.entry.js.map +1 -0
  182. package/dist/pine-core/{p-52c5ced3.system.entry.js → p-5bc45784.system.entry.js} +2 -2
  183. package/dist/pine-core/{p-06046885.entry.js → p-5dbbb2be.entry.js} +3 -3
  184. package/dist/pine-core/{p-06046885.entry.js.map → p-5dbbb2be.entry.js.map} +1 -1
  185. package/dist/pine-core/{p-9e8296fc.entry.js → p-5e879622.entry.js} +2 -2
  186. package/dist/pine-core/{p-1cc2fe8d.entry.js → p-5f63b999.entry.js} +2 -2
  187. package/dist/pine-core/p-5f63b999.entry.js.map +1 -0
  188. package/dist/pine-core/{p-9263809e.entry.js → p-64c6c4a0.entry.js} +2 -2
  189. package/dist/pine-core/{p-f795d3fe.system.entry.js → p-6e92e120.system.entry.js} +2 -2
  190. package/dist/pine-core/{p-220cbe98.entry.js → p-73be1c83.entry.js} +2 -2
  191. package/dist/pine-core/p-73be1c83.entry.js.map +1 -0
  192. package/dist/pine-core/{p-593cee44.entry.js → p-78132616.entry.js} +2 -2
  193. package/dist/pine-core/{p-88686193.entry.js → p-79f0b007.entry.js} +2 -2
  194. package/dist/pine-core/{p-f8a2aedd.entry.js → p-7c1b1fb8.entry.js} +2 -2
  195. package/dist/pine-core/{p-6fbe6be4.system.entry.js → p-7fc20a77.system.entry.js} +2 -2
  196. package/dist/pine-core/{p-663abd80.entry.js → p-867ef2f1.entry.js} +2 -2
  197. package/dist/pine-core/{p-87cee4a0.system.entry.js → p-91781a0a.system.entry.js} +2 -2
  198. package/dist/pine-core/{p-a30edeb1.entry.js → p-9558fa60.entry.js} +2 -2
  199. package/dist/pine-core/{p-BBJXL9br.system.js.map → p-9SGoKSa6.system.js.map} +1 -1
  200. package/dist/pine-core/{p-e1815c34.entry.js → p-9b2cd9fc.entry.js} +2 -2
  201. package/dist/pine-core/p-9b2cd9fc.entry.js.map +1 -0
  202. package/dist/pine-core/{p-6980edfe.system.entry.js → p-9f09e116.system.entry.js} +2 -2
  203. package/dist/pine-core/p-B3-LvD0D.system.js.map +1 -0
  204. package/dist/pine-core/{p-h_fnwqV_.system.js.map → p-B3xx1u93.system.js.map} +1 -1
  205. package/dist/pine-core/p-B9rVdQdy.system.js.map +1 -0
  206. package/dist/pine-core/{p-C8y7SAd7.system.js.map → p-BAp8Xlyt.system.js.map} +1 -1
  207. package/dist/pine-core/{p-hL5Id7g5.system.js.map → p-BB9Md7vT.system.js.map} +1 -1
  208. package/dist/pine-core/{p-Ctc231vq.system.js.map → p-BGc1L0Ao.system.js.map} +1 -1
  209. package/dist/pine-core/{p-CbRBe3Eq.system.js.map → p-BUtyruql.system.js.map} +1 -1
  210. package/dist/pine-core/{p-CCh7iS6N.system.js.map → p-BeJr-4oL.system.js.map} +1 -1
  211. package/dist/pine-core/{p-BFkDH5XU.js → p-Bmf4Ow_8.js} +1 -1
  212. package/dist/pine-core/{p-BFkDH5XU.js.map → p-Bmf4Ow_8.js.map} +1 -1
  213. package/dist/pine-core/{p-ljGHaVPv.system.js.map → p-Bsen6aos.system.js.map} +1 -1
  214. package/dist/pine-core/{p-Bd3ynCsJ.system.js.map → p-C1p8XJSR.system.js.map} +1 -1
  215. package/dist/pine-core/{p-6I02BpQf.system.js → p-CFL53vBy.system.js} +1 -1
  216. package/dist/pine-core/{p-6I02BpQf.system.js.map → p-CFL53vBy.system.js.map} +1 -1
  217. package/dist/pine-core/{p-hzdqYC6e.system.js.map → p-CH2XYz0c.system.js.map} +1 -1
  218. package/dist/pine-core/p-CSe1fQxQ.system.js.map +1 -0
  219. package/dist/pine-core/{p-aKHwHZQR.system.js.map → p-CdpI5vUX.system.js.map} +1 -1
  220. package/dist/pine-core/{p-Dkz0RoFB.system.js.map → p-CfNEp0k0.system.js.map} +1 -1
  221. package/dist/pine-core/p-CsWO_n3t.system.js.map +1 -0
  222. package/dist/pine-core/{p-BiLmvJTd.system.js.map → p-DcrqbXJe.system.js.map} +1 -1
  223. package/dist/pine-core/{p-B3dAc5EW.system.js.map → p-Dd9EYBI-.system.js.map} +1 -1
  224. package/dist/pine-core/{p-DhLX7iDs.system.js.map → p-DdR8iWme.system.js.map} +1 -1
  225. package/dist/pine-core/p-DzmLlvu3.system.js.map +1 -0
  226. package/dist/pine-core/p-JAVnELnm.system.js +1 -1
  227. package/dist/pine-core/p-_bwM2Rxz.system.js.map +1 -0
  228. package/dist/pine-core/{p-276f774a.entry.js → p-b2a7c2bf.entry.js} +2 -2
  229. package/dist/pine-core/{p-226e45be.system.entry.js → p-b8f21554.system.entry.js} +2 -2
  230. package/dist/pine-core/p-b8f21554.system.entry.js.map +1 -0
  231. package/dist/pine-core/{p-5a7b25d0.entry.js → p-bf157830.entry.js} +2 -2
  232. package/dist/pine-core/p-bf1a7158.entry.js +2 -0
  233. package/dist/pine-core/{p-c25ea8de.entry.js.map → p-bf1a7158.entry.js.map} +1 -1
  234. package/dist/pine-core/{p-19fef546.system.entry.js → p-c301925f.system.entry.js} +2 -2
  235. package/dist/pine-core/{p-19fef546.system.entry.js.map → p-c301925f.system.entry.js.map} +1 -1
  236. package/dist/pine-core/p-cb2146b0.system.entry.js +2 -0
  237. package/dist/pine-core/{p-e78986ea.system.entry.js.map → p-cb2146b0.system.entry.js.map} +1 -1
  238. package/dist/pine-core/{p-6748d7b4.entry.js → p-d38da7a6.entry.js} +2 -2
  239. package/dist/pine-core/p-d38da7a6.entry.js.map +1 -0
  240. package/dist/pine-core/{p-CcDv1OdF.system.js.map → p-dPhHNR2G.system.js.map} +1 -1
  241. package/dist/pine-core/{p-7514a191.entry.js → p-ea721a45.entry.js} +2 -2
  242. package/dist/pine-core/{p-7514a191.entry.js.map → p-ea721a45.entry.js.map} +1 -1
  243. package/dist/pine-core/p-ed5ca877.system.entry.js +2 -0
  244. package/dist/pine-core/{p-29266dcd.system.entry.js.map → p-ed5ca877.system.entry.js.map} +1 -1
  245. package/dist/pine-core/{p-2e22a1fc.system.entry.js → p-edbaff73.system.entry.js} +2 -2
  246. package/dist/pine-core/{p-a24c75c2.system.entry.js → p-f179c88f.system.entry.js} +2 -2
  247. package/dist/pine-core/p-f179c88f.system.entry.js.map +1 -0
  248. package/dist/pine-core/{p-9e3e441c.system.entry.js → p-f298baeb.system.entry.js} +2 -2
  249. package/dist/pine-core/{p-49c2e2ce.system.entry.js → p-f9c32940.system.entry.js} +2 -2
  250. package/dist/pine-core/p-n9xvc2MF.system.js.map +1 -0
  251. package/dist/pine-core/pds-button.entry.esm.js.map +1 -1
  252. package/dist/pine-core/pds-chip.entry.esm.js.map +1 -1
  253. package/dist/pine-core/pds-combobox.entry.esm.js.map +1 -1
  254. package/dist/pine-core/pds-dropdown-menu-item.entry.esm.js.map +1 -1
  255. package/dist/pine-core/pds-dropdown-menu.entry.esm.js.map +1 -1
  256. package/dist/pine-core/pds-link.entry.esm.js.map +1 -1
  257. package/dist/pine-core/pds-modal.entry.esm.js.map +1 -1
  258. package/dist/pine-core/pds-multiselect.entry.esm.js.map +1 -1
  259. package/dist/pine-core/pds-text.entry.esm.js.map +1 -1
  260. package/dist/pine-core/pine-core.esm.js +1 -1
  261. package/dist/types/components/pds-button/pds-button.d.ts +8 -1
  262. package/dist/types/components/pds-chip/pds-chip.d.ts +9 -2
  263. package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.d.ts +7 -0
  264. package/dist/types/components/pds-link/pds-link.d.ts +6 -0
  265. package/dist/types/components/pds-text/pds-text.d.ts +1 -1
  266. package/dist/types/components.d.ts +103 -79
  267. package/dist/types/utils/types.d.ts +1 -0
  268. package/dist/vscode.html-data.json +47 -5
  269. package/hydrate/index.js +55 -29
  270. package/hydrate/index.mjs +55 -29
  271. package/package.json +2 -2
  272. package/dist/pine-core/p-01aec1ad.system.entry.js.map +0 -1
  273. package/dist/pine-core/p-1cc2fe8d.entry.js.map +0 -1
  274. package/dist/pine-core/p-220cbe98.entry.js.map +0 -1
  275. package/dist/pine-core/p-226e45be.system.entry.js.map +0 -1
  276. package/dist/pine-core/p-29266dcd.system.entry.js +0 -2
  277. package/dist/pine-core/p-3ea301dd.system.entry.js.map +0 -1
  278. package/dist/pine-core/p-45c1f3ea.system.entry.js.map +0 -1
  279. package/dist/pine-core/p-4e015ddd.entry.js.map +0 -1
  280. package/dist/pine-core/p-632e398f.entry.js +0 -2
  281. package/dist/pine-core/p-632e398f.entry.js.map +0 -1
  282. package/dist/pine-core/p-6748d7b4.entry.js.map +0 -1
  283. package/dist/pine-core/p-B48FyOD0.system.js.map +0 -1
  284. package/dist/pine-core/p-B8CAflct.system.js.map +0 -1
  285. package/dist/pine-core/p-CObf7nrT.system.js.map +0 -1
  286. package/dist/pine-core/p-CPri5wQG.system.js.map +0 -1
  287. package/dist/pine-core/p-DR2CskUb.system.js.map +0 -1
  288. package/dist/pine-core/p-DdTbt4lH.system.js.map +0 -1
  289. package/dist/pine-core/p-G3GztZmn.system.js.map +0 -1
  290. package/dist/pine-core/p-a24c75c2.system.entry.js.map +0 -1
  291. package/dist/pine-core/p-c25ea8de.entry.js +0 -2
  292. package/dist/pine-core/p-e1815c34.entry.js.map +0 -1
  293. package/dist/pine-core/p-e78986ea.system.entry.js +0 -2
  294. package/dist/pine-core/p-f5fb71f6.entry.js +0 -2
  295. package/dist/pine-core/p-fbe793c7.system.entry.js.map +0 -1
  296. /package/dist/pine-core/{p-8f935480.entry.js.map → p-0b3d6527.entry.js.map} +0 -0
  297. /package/dist/pine-core/{p-b6f57c0f.system.entry.js.map → p-18a3b6ba.system.entry.js.map} +0 -0
  298. /package/dist/pine-core/{p-32f65e48.entry.js.map → p-221b4348.entry.js.map} +0 -0
  299. /package/dist/pine-core/{p-15ac22bd.system.entry.js.map → p-2a7b94ba.system.entry.js.map} +0 -0
  300. /package/dist/pine-core/{p-85ce731b.entry.js.map → p-378d01df.entry.js.map} +0 -0
  301. /package/dist/pine-core/{p-77d4f274.system.entry.js.map → p-40c04518.system.entry.js.map} +0 -0
  302. /package/dist/pine-core/{p-4232520f.system.entry.js.map → p-445c5ec5.system.entry.js.map} +0 -0
  303. /package/dist/pine-core/{p-8ab66dbc.system.entry.js.map → p-46d61c98.system.entry.js.map} +0 -0
  304. /package/dist/pine-core/{p-4de64b1f.entry.js.map → p-4c0e71ce.entry.js.map} +0 -0
  305. /package/dist/pine-core/{p-52c5ced3.system.entry.js.map → p-5bc45784.system.entry.js.map} +0 -0
  306. /package/dist/pine-core/{p-9e8296fc.entry.js.map → p-5e879622.entry.js.map} +0 -0
  307. /package/dist/pine-core/{p-9263809e.entry.js.map → p-64c6c4a0.entry.js.map} +0 -0
  308. /package/dist/pine-core/{p-f795d3fe.system.entry.js.map → p-6e92e120.system.entry.js.map} +0 -0
  309. /package/dist/pine-core/{p-593cee44.entry.js.map → p-78132616.entry.js.map} +0 -0
  310. /package/dist/pine-core/{p-88686193.entry.js.map → p-79f0b007.entry.js.map} +0 -0
  311. /package/dist/pine-core/{p-f8a2aedd.entry.js.map → p-7c1b1fb8.entry.js.map} +0 -0
  312. /package/dist/pine-core/{p-6fbe6be4.system.entry.js.map → p-7fc20a77.system.entry.js.map} +0 -0
  313. /package/dist/pine-core/{p-663abd80.entry.js.map → p-867ef2f1.entry.js.map} +0 -0
  314. /package/dist/pine-core/{p-87cee4a0.system.entry.js.map → p-91781a0a.system.entry.js.map} +0 -0
  315. /package/dist/pine-core/{p-a30edeb1.entry.js.map → p-9558fa60.entry.js.map} +0 -0
  316. /package/dist/pine-core/{p-6980edfe.system.entry.js.map → p-9f09e116.system.entry.js.map} +0 -0
  317. /package/dist/pine-core/{p-276f774a.entry.js.map → p-b2a7c2bf.entry.js.map} +0 -0
  318. /package/dist/pine-core/{p-5a7b25d0.entry.js.map → p-bf157830.entry.js.map} +0 -0
  319. /package/dist/pine-core/{p-2e22a1fc.system.entry.js.map → p-edbaff73.system.entry.js.map} +0 -0
  320. /package/dist/pine-core/{p-9e3e441c.system.entry.js.map → p-f298baeb.system.entry.js.map} +0 -0
  321. /package/dist/pine-core/{p-49c2e2ce.system.entry.js.map → p-f9c32940.system.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"pds-dropdown-menu-item.js","sourceRoot":"","sources":["../../../../../src/components/pds-dropdown-menu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,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,IAAI,CAAC,aAAa,EAC7B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,mBACR,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;YAE5C,eAAa,CACN,CACV,CAAC;IACJ,CAAC;IAcD,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,EAAE,EAAE,IAAI,CAAC,WAAW,EACxB,KAAK,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,EAC1F,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,EACnD,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,CAAC,CAAC,mBACG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAEzC,IAAI,CAAC,aAAa,EAAE,CAClB,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\nimport type { BasePdsProps } from '@utils/interfaces';\n\n@Component({\n tag: 'pds-dropdown-menu-item',\n styleUrl: 'pds-dropdown-menu-item.scss',\n shadow: true,\n})\nexport class PdsDropdownMenuItem implements BasePdsProps {\n @Element() host: HTMLPdsDropdownMenuItemElement;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * It determines whether or not the dropdown-item is destructive.\n * @defaultValue false\n */\n @Prop() destructive: boolean = false;\n\n /**\n * It determines whether or not the dropdown-item is disabled.\n * @defaultValue false\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n\n /**\n * If provided, renders the dropdown-item as an anchor (`<a>`) element instead of a button.\n */\n @Prop() href: string | undefined;\n\n /**\n * Determines whether the link should open in a new tab and display an external icon.\n * This is a simpler alternative to using `target=\"_blank\"` for the common case.\n * @defaultValue false\n */\n @Prop({ reflect: true }) external: boolean = false;\n\n /**\n * Specifies where to open the linked document when href is provided.\n * Takes precedence over the `external` prop if both are set.\n * Only applies when href is set.\n * @defaultValue undefined\n */\n @Prop({ reflect: true }) target?: '_blank' | '_self' | '_parent' | '_top';\n\n /**\n * Emitted when the dropdown-item is clicked.\n *\n */\n @Event() pdsClick: EventEmitter<{itemIndex: number, item: HTMLPdsDropdownMenuItemElement, content: string}>;\n\n /**\n * Trigger the click event\n */\n @Method()\n async clickItem() {\n this.handleClick();\n };\n\n\n private handleClick() {\n // Filter only pds-dropdown-menu-item elements and find the index of the current item\n const menuItems = Array.from(this.host.parentNode.children).filter(\n (child) => child.tagName.toLowerCase() === 'pds-dropdown-menu-item'\n );\n const itemIndex = menuItems.indexOf(this.host);\n\n // Get the text content from the slotted content\n const content = this.host.textContent?.trim() || '';\n\n this.pdsClick.emit({\n itemIndex,\n item: this.host,\n content\n });\n }\n\n @State() hasFocus: boolean = false;\n\n private handleFocus = () => {\n this.hasFocus = true;\n }\n\n private handleBlur = () => {\n this.hasFocus = false;\n }\n\n private renderElement() {\n if (this.href !== undefined) {\n return (\n <pds-link\n href={this.disabled ? null : this.href}\n external={this.external}\n target={this.target}\n class={{\n 'pds-dropdown-menu-item__content': true,\n 'has-focus': this.hasFocus\n }}\n tabIndex={this.disabled ? -1 : 0}\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n aria-disabled={this.disabled ? 'true' : null}\n >\n <slot></slot>\n </pds-link>\n );\n }\n\n return (\n <button\n class={{\n 'pds-dropdown-menu-item__content': true,\n 'has-focus': this.hasFocus\n }}\n tabIndex={this.disabled ? -1 : 0}\n type=\"button\"\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n disabled={this.disabled}\n aria-disabled={this.disabled ? 'true' : null}\n >\n <slot></slot>\n </button>\n );\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n // Handle keyboard events\n if (!this.disabled && (event.key === 'Enter')) {\n // Only prevent default for button elements or Space key\n // For links with Enter key, we want the default navigation behavior\n if (!this.href) {\n event.preventDefault();\n }\n this.handleClick();\n }\n }\n\n render() {\n return (\n <Host id={this.componentId}\n class={{ 'is-disabled': this.disabled, 'destructive': !this.disabled && this.destructive }}\n onClick={() => !this.disabled && this.handleClick()}\n role=\"none\"\n tabIndex={-1}\n aria-disabled={this.disabled ? 'true' : null}\n >\n {this.renderElement()}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pds-dropdown-menu-item.js","sourceRoot":"","sources":["../../../../../src/components/pds-dropdown-menu/pds-dropdown-menu-item/pds-dropdown-menu-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQtG,MAAM,OAAO,mBAAmB;IALhC;QAaE;;;WAGG;QACK,gBAAW,GAAY,KAAK,CAAC;QAErC;;;WAGG;QACsB,aAAQ,GAAY,KAAK,CAAC;QAgBnD;;;;WAIG;QACsB,aAAQ,GAAY,KAAK,CAAC;QA0C1C,aAAQ,GAAY,KAAK,CAAC;QAE3B,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,CAAC,CAAA;Q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AC,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,EAC1F,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,EACnD,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,CAAC,CAAC,mBACG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAEzC,IAAI,CAAC,aAAa,EAAE,CAClB,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State } from '@stencil/core';\nimport type { BasePdsProps } from '@utils/interfaces';\n\n@Component({\n tag: 'pds-dropdown-menu-item',\n styleUrl: 'pds-dropdown-menu-item.scss',\n shadow: true,\n})\nexport class PdsDropdownMenuItem implements BasePdsProps {\n @Element() host: HTMLPdsDropdownMenuItemElement;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * It determines whether or not the dropdown-item is destructive.\n * @defaultValue false\n */\n @Prop() destructive: boolean = false;\n\n /**\n * It determines whether or not the dropdown-item is disabled.\n * @defaultValue false\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n\n /**\n * Prompts the user to save the linked URL instead of navigating to it.\n * It can be used without a value to download with the default filename,\n * or with a string value to suggest a specific filename for the download.\n * Only applies when href is set.\n */\n @Prop() download?: string;\n\n /**\n * If provided, renders the dropdown-item as an anchor (`<a>`) element instead of a button.\n */\n @Prop() href: string | undefined;\n\n /**\n * Determines whether the link should open in a new tab and display an external icon.\n * This is a simpler alternative to using `target=\"_blank\"` for the common case.\n * @defaultValue false\n */\n @Prop({ reflect: true }) external: boolean = false;\n\n /**\n * Specifies where to open the linked document when href is provided.\n * Takes precedence over the `external` prop if both are set.\n * Only applies when href is set.\n * @defaultValue undefined\n */\n @Prop({ reflect: true }) target?: '_blank' | '_self' | '_parent' | '_top';\n\n /**\n * Emitted when the dropdown-item is clicked.\n *\n */\n @Event() pdsClick: EventEmitter<{itemIndex: number, item: HTMLPdsDropdownMenuItemElement, content: string}>;\n\n /**\n * Trigger the click event\n */\n @Method()\n async clickItem() {\n this.handleClick();\n };\n\n\n private handleClick() {\n // Filter only pds-dropdown-menu-item elements and find the index of the current item\n const menuItems = Array.from(this.host.parentNode.children).filter(\n (child) => child.tagName.toLowerCase() === 'pds-dropdown-menu-item'\n );\n const itemIndex = menuItems.indexOf(this.host);\n\n // Get the text content from the slotted content\n const content = this.host.textContent?.trim() || '';\n\n this.pdsClick.emit({\n itemIndex,\n item: this.host,\n content\n });\n }\n\n @State() hasFocus: boolean = false;\n\n private handleFocus = () => {\n this.hasFocus = true;\n }\n\n private handleBlur = () => {\n this.hasFocus = false;\n }\n\n private renderElement() {\n if (this.href !== undefined) {\n return (\n <pds-link\n download={this.download}\n href={this.disabled ? null : this.href}\n external={this.external}\n target={this.target}\n class={{\n 'pds-dropdown-menu-item__content': true,\n 'has-focus': this.hasFocus\n }}\n tabIndex={this.disabled ? -1 : 0}\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n aria-disabled={this.disabled ? 'true' : null}\n >\n <slot></slot>\n </pds-link>\n );\n }\n\n return (\n <button\n class={{\n 'pds-dropdown-menu-item__content': true,\n 'has-focus': this.hasFocus\n }}\n tabIndex={this.disabled ? -1 : 0}\n type=\"button\"\n onKeyDown={this.handleKeyDown}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n disabled={this.disabled}\n aria-disabled={this.disabled ? 'true' : null}\n >\n <slot></slot>\n </button>\n );\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n // Handle keyboard events\n if (!this.disabled && (event.key === 'Enter')) {\n // Only prevent default for button elements or Space key\n // For links with Enter key, we want the default navigation behavior\n if (!this.href) {\n event.preventDefault();\n }\n this.handleClick();\n }\n }\n\n render() {\n return (\n <Host id={this.componentId}\n class={{ 'is-disabled': this.disabled, 'destructive': !this.disabled && this.destructive }}\n onClick={() => !this.disabled && this.handleClick()}\n role=\"none\"\n tabIndex={-1}\n aria-disabled={this.disabled ? 'true' : null}\n >\n {this.renderElement()}\n </Host>\n );\n }\n}\n"]}
@@ -45,7 +45,7 @@
45
45
  }
46
46
 
47
47
  ::slotted([aria-disabled=true]),
48
- ::slotted([disabled]) {
48
+ ::slotted([disabled]:not([disabled=false])) {
49
49
  cursor: not-allowed;
50
50
  opacity: 0.5;
51
51
  pointer-events: none;
@@ -49,8 +49,8 @@ export class PdsLink {
49
49
  const targetValue = this.target || (this.external ? '_blank' : undefined);
50
50
  const showExternalIcon = this.external;
51
51
  const relValue = targetValue === '_blank' ? 'noopener noreferrer' : undefined;
52
- return (h("a", { key: '8c8c1f148aa53b20d232d9ad94d58333aa66553b', class: this.classNames(), href: this.href, id: this.componentId, part: "link", target: targetValue, rel: relValue, style: this.setLinkStyles() }, h("slot", { key: '9a803b0086b0c665f62ff9702d6a5c41c868c874' }, this.href), showExternalIcon &&
53
- h("pds-icon", { key: 'f9c752a279e427d2caa6771cf19a989622cd2110', icon: launch, size: this.fontSize })));
52
+ return (h("a", { key: '7d42e0a140af1093ea3019556e607036be5b274b', class: this.classNames(), download: this.download, href: this.href, id: this.componentId, part: "link", target: targetValue, rel: relValue, style: this.setLinkStyles() }, h("slot", { key: '7a8e0c7393c87817350fc380fac2aed3ee7c338c' }, this.href), showExternalIcon &&
53
+ h("pds-icon", { key: 'f2486339296564d5d07e0c6c4cf83cb2566b8f24', icon: launch, size: this.fontSize })));
54
54
  }
55
55
  static get is() { return "pds-link"; }
56
56
  static get encapsulation() { return "shadow"; }
@@ -85,6 +85,25 @@ export class PdsLink {
85
85
  "reflect": false,
86
86
  "attribute": "color"
87
87
  },
88
+ "download": {
89
+ "type": "string",
90
+ "mutable": false,
91
+ "complexType": {
92
+ "original": "string",
93
+ "resolved": "string",
94
+ "references": {}
95
+ },
96
+ "required": false,
97
+ "optional": true,
98
+ "docs": {
99
+ "tags": [],
100
+ "text": "Prompts the user to save the linked URL instead of navigating to it.\nIt can be used without a value to download with the default filename,\nor with a string value to suggest a specific filename for the download."
101
+ },
102
+ "getter": false,
103
+ "setter": false,
104
+ "reflect": false,
105
+ "attribute": "download"
106
+ },
88
107
  "componentId": {
89
108
  "type": "string",
90
109
  "mutable": false,
@@ -1 +1 @@
1
- {"version":3,"file":"pds-link.js","sourceRoot":"","sources":["../../../../src/components/pds-link/pds-link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C;;;GAGG;AAMH,MAAM,OAAO,OAAO;IALpB;QAgBE;;;;WAIG;QACK,aAAQ,GAAG,KAAK,CAAC;QAUzB;;;WAGG;QACK,YAAO,GAAuB,QAAQ,CAAC;QAE/C;;;WAGG;QACK,aAAQ,GAAuB,IAAI,CAAC;KAyD7C;IAlDS,UAAU;QAChB,MAAM,UAAU,GAAG,CAAC,UAAU,CAAC,CAAC;QAEhC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,UAAU,CAAC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChD,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,UAAU,CAAC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;QAED,OAAO,UAAU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;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\nimport { setColor } from '../../utils/utils';\n\nimport { launch } from '@pine-ds/icons/icons';\n\n/**\n * @part link - Link element styles.\n * @slot (default) - Text content placed between the opening and closing tags. If no text is provided, the **href** will be used as a fallback.\n */\n@Component({\n tag: 'pds-link',\n styleUrls: ['pds-link.scss'],\n shadow: true,\n})\nexport class PdsLink {\n /**\n * Sets the link color.\n */\n @Prop() color?: string;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Determines whether the link should open in a new tab.\n * @defaultValue false\n * @deprecated Consider using the `target` prop for more control. This prop will be maintained for backward compatibility.\n */\n @Prop() external = false;\n\n /**\n * Specifies where to open the linked document.\n * @defaultValue undefined\n * @example\n * <pds-link href=\"https://example.com\" target=\"_blank\">Opens in new tab</pds-link>\n */\n @Prop() target?: '_blank' | '_self' | '_parent' | '_top';\n\n /**\n * Sets the link variant styles.\n * @defaultValue inline\n */\n @Prop() variant: 'inline' | 'plain' = 'inline';\n\n /**\n * The font size of the link's text.\n * @defaultValue lg\n */\n @Prop() fontSize: 'sm' | 'md' | 'lg' = 'lg';\n\n /**\n * The hyperlink's destination URL. If no text is provided in the custom slot, the href will be used.\n */\n @Prop() href!: string;\n\n private classNames() {\n const classNames = ['pds-link'];\n\n if (this.fontSize) {\n classNames.push('pds-link--' + this.fontSize);\n }\n\n if (this.variant) {\n classNames.push('pds-link--' + this.variant);\n }\n\n return classNames.join(' ');\n }\n\n private setLinkStyles() {\n if (!this.color) return;\n\n const linkColors = {\n secondary: 'var(--pine-color-text-primary)',\n accent: 'var(--pine-color-accent)',\n danger: 'var(--pine-color-danger)',\n }\n\n const linkStyles = setColor(this.color, linkColors);\n\n return linkStyles;\n }\n\n render() {\n const targetValue = this.target || (this.external ? '_blank' : undefined);\n const showExternalIcon = this.external;\n const relValue = targetValue === '_blank' ? 'noopener noreferrer' : undefined;\n\n return (\n <a\n class={this.classNames()}\n href={this.href}\n id={this.componentId}\n part=\"link\"\n target={targetValue}\n rel={relValue}\n style={this.setLinkStyles()}\n >\n <slot>{this.href}</slot>\n {showExternalIcon &&\n <pds-icon icon={launch} size={this.fontSize}></pds-icon>\n }\n </a>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pds-link.js","sourceRoot":"","sources":["../../../../src/components/pds-link/pds-link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C;;;GAGG;AAMH,MAAM,OAAO,OAAO;IALpB;QAuBE;;;;WAIG;QACK,aAAQ,GAAG,KAAK,CAAC;QAUzB;;;WAGG;QACK,YAAO,GAAuB,QAAQ,CAAC;QAE/C;;;WAGG;QACK,aAAQ,GAAuB,IAAI,CAAC;KA0D7C;IAnDS,UAAU;QAChB,MAAM,UAAU,GAAG,CAAC,UAAU,CAAC,CAAC;QAEhC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,UAAU,CAAC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChD,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,UAAU,CAAC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;QAED,OAAO,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IAEO,aAAa;QACnB,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO;QAExB,MAAM,UAAU,GAAG;YACjB,SAAS,EAAE,gCAAgC;YAC3C,MAAM,EAAE,0BAA0B;YAClC,MAAM,EAAE,0BAA0B;SACnC,CAAA;QAED,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAEpD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC1E,MAAM,gBAAgB,GAAG,IAAI,CAAC,QAAQ,CAAC;QACvC,MAAM,QAAQ,GAAG,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC;QAE9E,OAAO,CACL,0DACE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,EAAE,EAAE,IAAI,CAAC,WAAW,EACpB,IAAI,EAAC,MAAM,EACX,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE;YAE3B,+DAAO,IAAI,CAAC,IAAI,CAAQ;YACvB,gBAAgB;gBACf,iEAAU,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAa,CAExD,CACL,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop } from '@stencil/core';\nimport { setColor } from '../../utils/utils';\n\nimport { launch } from '@pine-ds/icons/icons';\n\n/**\n * @part link - Link element styles.\n * @slot (default) - Text content placed between the opening and closing tags. If no text is provided, the **href** will be used as a fallback.\n */\n@Component({\n tag: 'pds-link',\n styleUrls: ['pds-link.scss'],\n shadow: true,\n})\nexport class PdsLink {\n /**\n * Sets the link color.\n */\n @Prop() color?: string;\n\n /**\n * Prompts the user to save the linked URL instead of navigating to it.\n * It can be used without a value to download with the default filename,\n * or with a string value to suggest a specific filename for the download.\n */\n @Prop() download?: string;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Determines whether the link should open in a new tab.\n * @defaultValue false\n * @deprecated Consider using the `target` prop for more control. This prop will be maintained for backward compatibility.\n */\n @Prop() external = false;\n\n /**\n * Specifies where to open the linked document.\n * @defaultValue undefined\n * @example\n * <pds-link href=\"https://example.com\" target=\"_blank\">Opens in new tab</pds-link>\n */\n @Prop() target?: '_blank' | '_self' | '_parent' | '_top';\n\n /**\n * Sets the link variant styles.\n * @defaultValue inline\n */\n @Prop() variant: 'inline' | 'plain' = 'inline';\n\n /**\n * The font size of the link's text.\n * @defaultValue lg\n */\n @Prop() fontSize: 'sm' | 'md' | 'lg' = 'lg';\n\n /**\n * The hyperlink's destination URL. If no text is provided in the custom slot, the href will be used.\n */\n @Prop() href!: string;\n\n private classNames() {\n const classNames = ['pds-link'];\n\n if (this.fontSize) {\n classNames.push('pds-link--' + this.fontSize);\n }\n\n if (this.variant) {\n classNames.push('pds-link--' + this.variant);\n }\n\n return classNames.join(' ');\n }\n\n private setLinkStyles() {\n if (!this.color) return;\n\n const linkColors = {\n secondary: 'var(--pine-color-text-primary)',\n accent: 'var(--pine-color-accent)',\n danger: 'var(--pine-color-danger)',\n }\n\n const linkStyles = setColor(this.color, linkColors);\n\n return linkStyles;\n }\n\n render() {\n const targetValue = this.target || (this.external ? '_blank' : undefined);\n const showExternalIcon = this.external;\n const relValue = targetValue === '_blank' ? 'noopener noreferrer' : undefined;\n\n return (\n <a\n class={this.classNames()}\n download={this.download}\n href={this.href}\n id={this.componentId}\n part=\"link\"\n target={targetValue}\n rel={relValue}\n style={this.setLinkStyles()}\n >\n <slot>{this.href}</slot>\n {showExternalIcon &&\n <pds-icon icon={launch} size={this.fontSize}></pds-icon>\n }\n </a>\n );\n }\n}\n"]}
@@ -236,11 +236,11 @@ export class PdsModal {
236
236
  return (h("dialog", { key: '22ca55ddcc3aaf6e1158940d1fec23c9622b7810', class: {
237
237
  'pds-modal__backdrop': true,
238
238
  'open': this.open
239
- }, "aria-modal": "true", "aria-labelledby": `${this.componentId}-heading`, onClick: this.handleBackdropClick }, h("div", { key: '456929b5fa8ee7297fc11ffee1441a698cb2f3bc', class: {
239
+ }, "aria-modal": "true", "aria-labelledby": `${this.componentId}-heading`, onClick: this.handleBackdropClick }, h("div", { key: '803acd0d7a80886efd58c9eeb1af94b40c049de8', class: {
240
240
  'pds-modal': true,
241
241
  [`pds-modal--${this.size}`]: true,
242
242
  'pds-modal--scrollable': this.scrollable
243
- } }, h("slot", { key: 'f6981ab3a8c5b13a48d4e791979760e1cf8a28a4' }))));
243
+ }, part: "modal" }, h("slot", { key: '227deb370e056365f188724bdb2fbabe6062ab77' }))));
244
244
  }
245
245
  static get is() { return "pds-modal"; }
246
246
  static get originalStyleUrls() {
@@ -1 +1 @@
1
- {"version":3,"file":"pds-modal.js","sourceRoot":"","sources":["../../../../src/components/pds-modal/pds-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOvG,MAAM,OAAO,QAAQ;IALrB;QAQU,sBAAiB,GAAkB,EAAE,CAAC;QAI9C;;;WAGG;QACK,oBAAe,GAAG,IAAI,CAAC;QAO/B;;;WAGG;QACsB,SAAI,GAAG,KAAK,CAAC;QAEtC;;;WAGG;QACK,SAAI,GAAsC,IAAI,CAAC;QAEvD;;;WAGG;QACK,eAAU,GAAG,IAAI,CAAC;QAY1B;;WAEG;QACM,2BAAsB,GAAkB,EAAE,CAAC;QAoJ5C,wBAAmB,GAAG,CAAC,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AI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnD,OAAO,UAAU,KAAK,SAAS,CAAC;IAClC,CAAC;IAiDD,MAAM;QACJ,OAAO,CACL,+DACE,KAAK,EAAE;gBACL,qBAAqB,EAAE,IAAI;gBAC3B,MAAM,EAAE,IAAI,CAAC,IAAI;aAClB,gBACU,MAAM,qBACA,GAAG,IAAI,CAAC,WAAW,UAAU,EAC9C,OAAO,EAAE,IAAI,CAAC,mBAAmB;YAEjC,4DACE,KAAK,EAAE;oBACL,WAAW,EAAE,IAAI;oBACjB,CAAC,cAAc,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI;oBACjC,uBAAuB,EAAE,IAAI,CAAC,UAAU;iBACzC;gBAED,8DAAa,CACT,CACC,CACV,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'pds-modal',\n styleUrl: 'pds-modal.scss',\n shadow: false\n})\nexport class PdsModal {\n private modalRef: HTMLDialogElement;\n private previousActiveElement: HTMLElement;\n private focusableElements: HTMLElement[] = [];\n\n @Element() el: HTMLPdsModalElement;\n\n /**\n * Whether the modal can be dismissed by clicking the backdrop\n * @default true\n */\n @Prop() backdropDismiss = true;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Whether the modal is open\n * @default false\n */\n @Prop({ mutable: true }) open = false;\n\n /**\n * The size of the modal\n * @default 'md'\n */\n @Prop() size: 'sm' | 'md' | 'lg' | 'fullscreen' = 'md';\n\n /**\n * Whether the modal content should be scrollable\n * @default true\n */\n @Prop() scrollable = true;\n\n /**\n * Emitted when the modal is opened\n */\n @Event() pdsModalOpen: EventEmitter<void>;\n\n /**\n * Emitted when the modal is closed\n */\n @Event() pdsModalClose: EventEmitter<void>;\n\n /**\n * Stores the list of focusable elements in the modal\n */\n @State() focusableElementsArray: HTMLElement[] = [];\n\n componentDidLoad() {\n this.modalRef = this.el.querySelector('.pds-modal__backdrop') as HTMLDialogElement;\n // Add keyboard event listener\n document.addEventListener('keydown', this.handleKeyDown);\n }\n\n disconnectedCallback() {\n // Clean up event listener\n document.removeEventListener('keydown', this.handleKeyDown);\n }\n\n @Watch('open')\n handleOpenChange(newValue: boolean) {\n if (newValue) {\n this.showModal();\n } else {\n this.hideModal();\n }\n }\n\n /**\n * Updates the list of focusable elements in the modal\n */\n private updateFocusableElements() {\n if (!this.modalRef) return;\n\n // Get all focusable elements within the modal\n const selector = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n 'pds-button:not([disabled])',\n 'pds-link:not([disabled])',\n 'pds-input:not([disabled])',\n 'pds-checkbox:not([disabled])',\n 'pds-radio:not([disabled])',\n 'pds-switch:not([disabled])',\n 'pds-select:not([disabled])',\n ].join(',');\n\n this.focusableElements = Array.from(\n this.modalRef.querySelectorAll(selector)\n ) as HTMLElement[];\n\n // Filter out elements with display: none or visibility: hidden\n this.focusableElements = this.focusableElements.filter(el => {\n const style = window.getComputedStyle(el);\n return style.display !== 'none' && style.visibility !== 'hidden';\n });\n }\n\n /**\n * Sets focus to the first focusable element in the modal\n */\n private setInitialFocus() {\n if (this.focusableElements.length === 0) return;\n\n // Focus the first focusable element\n const firstElement = this.focusableElements[0];\n\n // For web components, we need to ensure they're properly focused\n this.focusElement(firstElement);\n }\n\n /**\n * Helper method to focus an element, with special handling for web components\n */\n private focusElement(element: HTMLElement) {\n if (!element) return;\n\n try {\n // Try standard focus first\n element.focus();\n\n // Check if focus worked\n setTimeout(() => {\n if (document.activeElement !== element) {\n // For web components, try to find a focusable element inside\n if (element.shadowRoot) {\n const focusableInShadow = element.shadowRoot.querySelector(\n 'button, [tabindex], input, a[href]'\n ) as HTMLElement;\n\n if (focusableInShadow) {\n focusableInShadow.focus();\n }\n }\n }\n }, 0);\n } catch (error) {\n console.error('Error focusing element:', error);\n }\n }\n\n /**\n * Opens the modal\n */\n @Method()\n async showModal() {\n if (this.modalRef) {\n try {\n // Store the currently focused element to restore focus when modal closes\n this.previousActiveElement = document.activeElement as HTMLElement;\n\n // Use native dialog showModal method which makes the rest of the page inert\n this.modalRef.showModal();\n this.open = true;\n\n // Update focusable elements and set initial focus\n // Using a longer timeout to ensure all components are fully rendered\n setTimeout(() => {\n this.updateFocusableElements();\n this.setInitialFocus();\n this.pdsModalOpen.emit();\n }, 100);\n } catch (error) {\n console.error('Failed to show modal:', error);\n }\n }\n }\n\n /**\n * Closes the modal\n */\n @Method()\n async hideModal() {\n if (this.modalRef) {\n try {\n this.modalRef.close();\n this.open = false;\n\n // Restore focus to the element that was focused before the modal was opened\n if (this.previousActiveElement && typeof this.previousActiveElement.focus === 'function') {\n this.previousActiveElement.focus();\n }\n\n this.pdsModalClose.emit();\n } catch (error) {\n console.error('Failed to hide modal:', error);\n }\n }\n }\n\n private handleBackdropClick = (e: MouseEvent) => {\n if (!this.backdropDismiss || !this.open) return;\n\n if ((e.target as HTMLElement).classList.contains('pds-modal__backdrop')) {\n e.stopPropagation();\n\n // Only close if this is the innermost modal\n if (this.isInnermostModal()) {\n this.hideModal();\n }\n }\n };\n\n /**\n * Gets the z-index of a modal's backdrop element\n */\n private getBackdropZIndex(modal: Element): number {\n const backdrop = modal.querySelector('.pds-modal__backdrop');\n return backdrop ? parseInt(getComputedStyle(backdrop).zIndex, 10) : -1;\n }\n\n /**\n * Checks if this modal is the innermost (highest z-index) modal\n */\n private isInnermostModal(): boolean {\n // Find all open modals\n const openModals = Array.from(document.querySelectorAll('pds-modal')).filter(\n modal => modal.open\n );\n\n if (openModals.length === 0) return false;\n\n // Get this modal's backdrop element\n const thisBackdrop = this.el.querySelector('.pds-modal__backdrop');\n if (!thisBackdrop) return false;\n\n // Get computed z-index of all open modal backdrops\n const modalZIndexes = openModals.map(modal => this.getBackdropZIndex(modal));\n\n // Get the highest z-index\n const maxZIndex = Math.max(...modalZIndexes);\n\n // Check if this modal's backdrop has the highest z-index\n const thisZIndex = this.getBackdropZIndex(this.el);\n return thisZIndex === maxZIndex;\n }\n\n private handleKeyDown = (e: KeyboardEvent) => {\n // If the modal is not open, don't handle any keyboard events\n if (!this.open) return;\n\n // Handle Escape key to close the modal\n if (e.key === 'Escape') {\n // Always prevent native dialog close behavior\n e.preventDefault();\n // Only close if backdropDismiss is enabled and this is the innermost modal\n if (this.backdropDismiss && this.isInnermostModal()) {\n this.hideModal();\n }\n return;\n }\n\n // Handle Tab key for focus trapping\n if (e.key === 'Tab') {\n // If there are no focusable elements, do nothing\n if (this.focusableElements.length === 0) return;\n\n // Get the first and last focusable elements\n const firstFocusableElement = this.focusableElements[0];\n const lastFocusableElement = this.focusableElements[this.focusableElements.length - 1];\n\n // Get the current active element\n const activeElement = document.activeElement;\n\n // Check if we need to wrap focus\n const isFirstElement = activeElement === firstFocusableElement ||\n firstFocusableElement.contains(activeElement as Node);\n\n const isLastElement = activeElement === lastFocusableElement ||\n lastFocusableElement.contains(activeElement as Node);\n\n // If shift + tab is pressed and focus is on the first element, move to the last element\n if (e.shiftKey && isFirstElement) {\n e.preventDefault();\n this.focusElement(lastFocusableElement);\n }\n // If tab is pressed and focus is on the last element, move to the first element\n else if (!e.shiftKey && isLastElement) {\n e.preventDefault();\n this.focusElement(firstFocusableElement);\n }\n }\n };\n\n render() {\n return (\n <dialog\n class={{\n 'pds-modal__backdrop': true,\n 'open': this.open\n }}\n aria-modal=\"true\"\n aria-labelledby={`${this.componentId}-heading`}\n onClick={this.handleBackdropClick}\n >\n <div\n class={{\n 'pds-modal': true,\n [`pds-modal--${this.size}`]: true,\n 'pds-modal--scrollable': this.scrollable\n }}\n >\n <slot></slot>\n </div>\n </dialog>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pds-modal.js","sourceRoot":"","sources":["../../../../src/components/pds-modal/pds-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOvG,MAAM,OAAO,QAAQ;IALrB;QAQU,sBAAiB,GAAkB,EAAE,CAAC;QAI9C;;;WAGG;QACK,oBAAe,GAAG,IAAI,CAAC;QAO/B;;;WAGG;QACsB,SAAI,GAAG,KAAK,CAAC;QAEtC;;;WAGG;QACK,SAAI,GAAsC,IAAI,CAAC;QAEvD;;;WAGG;QACK,eAAU,GAAG,IAAI,CAAC;QAY1B;;WAEG;QACM,2BAAsB,GAAkB,EAAE,CAAC;QAoJ5C,wBAAmB,GAAG,CAAC,CAAa,EAAE,EAAE;YAC9C,IAAI,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,IAAI,CAAC,IAAI;gBAAE,OAAO;YAEhD,IAAK,CAAC,CAAC,MAAsB,CAAC,SAAS,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC;gBACxE,CAAC,CAAC,eAAe,EAAE,CAAC;gBAEpB,4CAA4C;gBAC5C,IAAI,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC;oBAC5B,IAAI,CAAC,SAAS,EAAE,CAAC;gBACnB,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAoCM,kBAAa,GAAG,CAAC,CAAgB,EAAE,EAAE;YAC3C,6DAA6D;YAC7D,IAAI,CAAC,IAAI,CAAC,IAAI;gBAAE,OAAO;YAEvB,uCAAuC;YACvC,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,EAAE,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\n\n@Component({\n tag: 'pds-modal',\n styleUrl: 'pds-modal.scss',\n shadow: false\n})\nexport class PdsModal {\n private modalRef: HTMLDialogElement;\n private previousActiveElement: HTMLElement;\n private focusableElements: HTMLElement[] = [];\n\n @Element() el: HTMLPdsModalElement;\n\n /**\n * Whether the modal can be dismissed by clicking the backdrop\n * @default true\n */\n @Prop() backdropDismiss = true;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Whether the modal is open\n * @default false\n */\n @Prop({ mutable: true }) open = false;\n\n /**\n * The size of the modal\n * @default 'md'\n */\n @Prop() size: 'sm' | 'md' | 'lg' | 'fullscreen' = 'md';\n\n /**\n * Whether the modal content should be scrollable\n * @default true\n */\n @Prop() scrollable = true;\n\n /**\n * Emitted when the modal is opened\n */\n @Event() pdsModalOpen: EventEmitter<void>;\n\n /**\n * Emitted when the modal is closed\n */\n @Event() pdsModalClose: EventEmitter<void>;\n\n /**\n * Stores the list of focusable elements in the modal\n */\n @State() focusableElementsArray: HTMLElement[] = [];\n\n componentDidLoad() {\n this.modalRef = this.el.querySelector('.pds-modal__backdrop') as HTMLDialogElement;\n // Add keyboard event listener\n document.addEventListener('keydown', this.handleKeyDown);\n }\n\n disconnectedCallback() {\n // Clean up event listener\n document.removeEventListener('keydown', this.handleKeyDown);\n }\n\n @Watch('open')\n handleOpenChange(newValue: boolean) {\n if (newValue) {\n this.showModal();\n } else {\n this.hideModal();\n }\n }\n\n /**\n * Updates the list of focusable elements in the modal\n */\n private updateFocusableElements() {\n if (!this.modalRef) return;\n\n // Get all focusable elements within the modal\n const selector = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n 'pds-button:not([disabled])',\n 'pds-link:not([disabled])',\n 'pds-input:not([disabled])',\n 'pds-checkbox:not([disabled])',\n 'pds-radio:not([disabled])',\n 'pds-switch:not([disabled])',\n 'pds-select:not([disabled])',\n ].join(',');\n\n this.focusableElements = Array.from(\n this.modalRef.querySelectorAll(selector)\n ) as HTMLElement[];\n\n // Filter out elements with display: none or visibility: hidden\n this.focusableElements = this.focusableElements.filter(el => {\n const style = window.getComputedStyle(el);\n return style.display !== 'none' && style.visibility !== 'hidden';\n });\n }\n\n /**\n * Sets focus to the first focusable element in the modal\n */\n private setInitialFocus() {\n if (this.focusableElements.length === 0) return;\n\n // Focus the first focusable element\n const firstElement = this.focusableElements[0];\n\n // For web components, we need to ensure they're properly focused\n this.focusElement(firstElement);\n }\n\n /**\n * Helper method to focus an element, with special handling for web components\n */\n private focusElement(element: HTMLElement) {\n if (!element) return;\n\n try {\n // Try standard focus first\n element.focus();\n\n // Check if focus worked\n setTimeout(() => {\n if (document.activeElement !== element) {\n // For web components, try to find a focusable element inside\n if (element.shadowRoot) {\n const focusableInShadow = element.shadowRoot.querySelector(\n 'button, [tabindex], input, a[href]'\n ) as HTMLElement;\n\n if (focusableInShadow) {\n focusableInShadow.focus();\n }\n }\n }\n }, 0);\n } catch (error) {\n console.error('Error focusing element:', error);\n }\n }\n\n /**\n * Opens the modal\n */\n @Method()\n async showModal() {\n if (this.modalRef) {\n try {\n // Store the currently focused element to restore focus when modal closes\n this.previousActiveElement = document.activeElement as HTMLElement;\n\n // Use native dialog showModal method which makes the rest of the page inert\n this.modalRef.showModal();\n this.open = true;\n\n // Update focusable elements and set initial focus\n // Using a longer timeout to ensure all components are fully rendered\n setTimeout(() => {\n this.updateFocusableElements();\n this.setInitialFocus();\n this.pdsModalOpen.emit();\n }, 100);\n } catch (error) {\n console.error('Failed to show modal:', error);\n }\n }\n }\n\n /**\n * Closes the modal\n */\n @Method()\n async hideModal() {\n if (this.modalRef) {\n try {\n this.modalRef.close();\n this.open = false;\n\n // Restore focus to the element that was focused before the modal was opened\n if (this.previousActiveElement && typeof this.previousActiveElement.focus === 'function') {\n this.previousActiveElement.focus();\n }\n\n this.pdsModalClose.emit();\n } catch (error) {\n console.error('Failed to hide modal:', error);\n }\n }\n }\n\n private handleBackdropClick = (e: MouseEvent) => {\n if (!this.backdropDismiss || !this.open) return;\n\n if ((e.target as HTMLElement).classList.contains('pds-modal__backdrop')) {\n e.stopPropagation();\n\n // Only close if this is the innermost modal\n if (this.isInnermostModal()) {\n this.hideModal();\n }\n }\n };\n\n /**\n * Gets the z-index of a modal's backdrop element\n */\n private getBackdropZIndex(modal: Element): number {\n const backdrop = modal.querySelector('.pds-modal__backdrop');\n return backdrop ? parseInt(getComputedStyle(backdrop).zIndex, 10) : -1;\n }\n\n /**\n * Checks if this modal is the innermost (highest z-index) modal\n */\n private isInnermostModal(): boolean {\n // Find all open modals\n const openModals = Array.from(document.querySelectorAll('pds-modal')).filter(\n modal => modal.open\n );\n\n if (openModals.length === 0) return false;\n\n // Get this modal's backdrop element\n const thisBackdrop = this.el.querySelector('.pds-modal__backdrop');\n if (!thisBackdrop) return false;\n\n // Get computed z-index of all open modal backdrops\n const modalZIndexes = openModals.map(modal => this.getBackdropZIndex(modal));\n\n // Get the highest z-index\n const maxZIndex = Math.max(...modalZIndexes);\n\n // Check if this modal's backdrop has the highest z-index\n const thisZIndex = this.getBackdropZIndex(this.el);\n return thisZIndex === maxZIndex;\n }\n\n private handleKeyDown = (e: KeyboardEvent) => {\n // If the modal is not open, don't handle any keyboard events\n if (!this.open) return;\n\n // Handle Escape key to close the modal\n if (e.key === 'Escape') {\n // Always prevent native dialog close behavior\n e.preventDefault();\n // Only close if backdropDismiss is enabled and this is the innermost modal\n if (this.backdropDismiss && this.isInnermostModal()) {\n this.hideModal();\n }\n return;\n }\n\n // Handle Tab key for focus trapping\n if (e.key === 'Tab') {\n // If there are no focusable elements, do nothing\n if (this.focusableElements.length === 0) return;\n\n // Get the first and last focusable elements\n const firstFocusableElement = this.focusableElements[0];\n const lastFocusableElement = this.focusableElements[this.focusableElements.length - 1];\n\n // Get the current active element\n const activeElement = document.activeElement;\n\n // Check if we need to wrap focus\n const isFirstElement = activeElement === firstFocusableElement ||\n firstFocusableElement.contains(activeElement as Node);\n\n const isLastElement = activeElement === lastFocusableElement ||\n lastFocusableElement.contains(activeElement as Node);\n\n // If shift + tab is pressed and focus is on the first element, move to the last element\n if (e.shiftKey && isFirstElement) {\n e.preventDefault();\n this.focusElement(lastFocusableElement);\n }\n // If tab is pressed and focus is on the last element, move to the first element\n else if (!e.shiftKey && isLastElement) {\n e.preventDefault();\n this.focusElement(firstFocusableElement);\n }\n }\n };\n\n render() {\n return (\n <dialog\n class={{\n 'pds-modal__backdrop': true,\n 'open': this.open\n }}\n aria-modal=\"true\"\n aria-labelledby={`${this.componentId}-heading`}\n onClick={this.handleBackdropClick}\n >\n <div\n class={{\n 'pds-modal': true,\n [`pds-modal--${this.size}`]: true,\n 'pds-modal--scrollable': this.scrollable\n }}\n part=\"modal\"\n >\n <slot></slot>\n </div>\n </dialog>\n );\n }\n}\n"]}
@@ -77,7 +77,7 @@ export class MockPdsModal {
77
77
  'pds-modal__backdrop': true,
78
78
  'open': this.open,
79
79
  };
80
- return (h("div", { key: '932c22f17088b6cd5efa34563533b10192ba01c5', class: backdropClasses }, h("div", { key: '476cc7428d5fa0b1cb3cdc7a2942e446cf80fe32', class: modalClasses, role: "dialog", "aria-modal": "true", "aria-labelledby": this.componentId ? `${this.componentId}-heading` : null }, h("div", { key: '7b08398565a4bca4e14b570064ff7bf705c2b664', class: "pds-modal__header" }, h("slot", { key: '25be59059e0fe45210283755c71d9dd64f6d7e14', name: "header" })), h("div", { key: '21b2eb295db0a8fe40a16f5d4816129498220958', class: "pds-modal-content" }, h("slot", { key: '86e2ae4bfb4f1df345958d44c0ab50597d6ca099' })), h("div", { key: '73a2af8f314185e9d72c899f6b7958287e568766', class: "pds-modal__footer" }, h("slot", { key: '26b239609b484949e0e8f64248d2725588ccd6e0', name: "footer" })))));
80
+ return (h("div", { key: '932c22f17088b6cd5efa34563533b10192ba01c5', class: backdropClasses }, h("div", { key: '09c13a485986d40fa0240530feffde18b5192ff3', class: modalClasses, role: "dialog", "aria-modal": "true", "aria-labelledby": this.componentId ? `${this.componentId}-heading` : null, part: "modal" }, h("div", { key: '69c2feba501225873ffcf7aab3a1b40a981cec89', class: "pds-modal__header" }, h("slot", { key: 'c38802b6007b85b45532743ee4a94bcc9d5da08f', name: "header" })), h("div", { key: '6998e3da4906070de62a1016c2e23836c84ad96a', class: "pds-modal-content" }, h("slot", { key: '98ed7a23ca4c84de297aa71a7b15c6fa9a2666bf' })), h("div", { key: '7d0ed4f725857a77d916004967d88d5e9c66a5de', class: "pds-modal__footer" }, h("slot", { key: '437b8ab71722e6bad1caee076020c5bb216a2aad', name: "footer" })))));
81
81
  }
82
82
  static get is() { return "mock-pds-modal"; }
83
83
  static get originalStyleUrls() {
@@ -1 +1 @@
1
- {"version":3,"file":"mock-pds-modal.js","sourceRoot":"","sources":["../../../../../src/components/pds-modal/test/mock-pds-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAWzF;;;GAGG;AAMH,MAAM,OAAO,YAAY;IALzB;QAaE;;WAEG;QACK,SAAI,GAAsC,IAAI,CAAC;QAEvD;;;WAGG;QACK,eAAU,GAAG,IAAI,CAAC;QAE1B;;WAEG;QACK,oBAAe,GAAG,IAAI,CAAC;QAE/B;;WAEG;QACsB,SAAI,GAAG,KAAK,CAAC;KAuGvC;IApFC;;OAEG;IAEH,KAAK,CAA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I;SAClB,CAAC;QAEF,OAAO,CACL,4DAAK,KAAK,EAAE,eAAe;YACzB,4DACE,KAAK,EAAE,YAAY,EACnB,IAAI,EAAC,QAAQ,gBACF,MAAM,qBACA,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,UAAU,CAAC,CAAC,CAAC,IAAI;gBAExE,4DAAK,KAAK,EAAC,mBAAmB;oBAC5B,6DAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB;gBACN,4DAAK,KAAK,EAAC,mBAAmB;oBAC5B,8DAAa,CACT;gBACN,4DAAK,KAAK,EAAC,mBAAmB;oBAC5B,6DAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB,CACF,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, Event, EventEmitter, Method, Element, h } from '@stencil/core';\n\n// Define the element interface for the mock component\ninterface HTMLMockPdsModalElement extends HTMLElement {\n open: boolean;\n showModal: () => Promise<void>;\n hideModal: () => Promise<void>;\n handleBackdropClick: (event: MouseEvent) => void;\n handleKeyDown: (event: KeyboardEvent) => void;\n}\n\n/**\n * Mock PdsModal component for testing purposes\n * This component mimics the real PdsModal but without using the Popover API\n */\n@Component({\n tag: 'mock-pds-modal',\n styleUrl: '../pds-modal.scss',\n shadow: false,\n})\nexport class MockPdsModal {\n @Element() el!: HTMLMockPdsModalElement;\n\n /**\n * The ID of the modal component\n */\n @Prop() componentId?: string;\n\n /**\n * The size of the modal\n */\n @Prop() size: 'sm' | 'md' | 'lg' | 'fullscreen' = 'md';\n\n /**\n * Whether the modal content should be scrollable\n * @default true\n */\n @Prop() scrollable = true;\n\n /**\n * Whether the modal can be dismissed by clicking the backdrop or pressing Escape\n */\n @Prop() backdropDismiss = true;\n\n /**\n * Whether the modal is open\n */\n @Prop({ mutable: true }) open = false;\n\n // No need for modalRef in the mock implementation\n\n /**\n * Event emitted when the modal is opened\n */\n @Event() pdsModalOpen: EventEmitter<void>;\n\n /**\n * Event emitted when the modal is closed\n */\n @Event() pdsModalClose: EventEmitter<void>;\n\n /**\n * Event emitted when the backdrop is clicked\n */\n @Event() pdsModalBackdropClick: EventEmitter<void>;\n\n /**\n * Shows the modal\n */\n @Method()\n async showModal() {\n this.open = true;\n this.pdsModalOpen.emit();\n }\n\n /**\n * Hides the modal\n */\n @Method()\n async hideModal() {\n this.open = false;\n this.pdsModalClose.emit();\n }\n\n /**\n * Listen for click events on the backdrop\n */\n // Using direct method instead of @Listen to avoid ESLint warning\n handleBackdropClick(event: MouseEvent) {\n const backdrop = this.el.querySelector('.pds-modal__backdrop');\n // Check if the click was directly on the backdrop (not on a child element)\n if (event.target === backdrop && this.backdropDismiss === true) {\n this.pdsModalBackdropClick.emit();\n this.hideModal();\n }\n }\n\n /**\n * Listen for keydown events to handle Escape key\n * Should only close on Escape if backdropDismiss is enabled\n */\n // Using direct method instead of @Listen to avoid ESLint warning\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.open === true) {\n // Always prevent default to mirror native dialog behavior blocking\n event.preventDefault();\n // Only close if backdropDismiss is enabled\n if (this.backdropDismiss === true) {\n this.hideModal();\n }\n }\n }\n\n componentDidLoad() {\n // No need to do anything in componentDidLoad for the mock\n }\n\n render() {\n const modalClasses = {\n 'pds-modal': true,\n [`pds-modal--${this.size}`]: true,\n 'pds-modal--scrollable': this.scrollable\n };\n\n const backdropClasses = {\n 'pds-modal__backdrop': true,\n 'open': this.open,\n };\n\n return (\n <div class={backdropClasses}>\n <div\n class={modalClasses}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={this.componentId ? `${this.componentId}-heading` : null}\n >\n <div class=\"pds-modal__header\">\n <slot name=\"header\"></slot>\n </div>\n <div class=\"pds-modal-content\">\n <slot></slot>\n </div>\n <div class=\"pds-modal__footer\">\n <slot name=\"footer\"></slot>\n </div>\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"mock-pds-modal.js","sourceRoot":"","sources":["../../../../../src/components/pds-modal/test/mock-pds-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAWzF;;;GAGG;AAMH,MAAM,OAAO,YAAY;IALzB;QAaE;;WAEG;QACK,SAAI,GAAsC,IAAI,CAAC;QAEvD;;;WAGG;QACK,eAAU,GAAG,IAAI,CAAC;QAE1B;;WAEG;QACK,oBAAe,GAAG,IAAI,CAAC;QAE/B;;WAEG;QACsB,SAAI,GAAG,KAAK,CAAC;KAwGvC;IArFC;;OAEG;IAEH,KAAK,CAAC,SAAS;QACb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IAEH,KAAK,CAAC,SAAS;QACb,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAClB,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,iEAAiE;IACjE,mBAAmB,CAAC,KAAiB;QACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC;QAC/D,2EAA2E;QAC3E,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ,IAAI,IAAI,CAAC,eAAe,KAAK,IAAI,EAAE,CAAC;YAC/D,IAAI,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC;YAClC,IAAI,CAAC,SAAS,EAAE,CAAC;QACnB,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, Event, EventEmitter, Method, Element, h } from '@stencil/core';\n\n// Define the element interface for the mock component\ninterface HTMLMockPdsModalElement extends HTMLElement {\n open: boolean;\n showModal: () => Promise<void>;\n hideModal: () => Promise<void>;\n handleBackdropClick: (event: MouseEvent) => void;\n handleKeyDown: (event: KeyboardEvent) => void;\n}\n\n/**\n * Mock PdsModal component for testing purposes\n * This component mimics the real PdsModal but without using the Popover API\n */\n@Component({\n tag: 'mock-pds-modal',\n styleUrl: '../pds-modal.scss',\n shadow: false,\n})\nexport class MockPdsModal {\n @Element() el!: HTMLMockPdsModalElement;\n\n /**\n * The ID of the modal component\n */\n @Prop() componentId?: string;\n\n /**\n * The size of the modal\n */\n @Prop() size: 'sm' | 'md' | 'lg' | 'fullscreen' = 'md';\n\n /**\n * Whether the modal content should be scrollable\n * @default true\n */\n @Prop() scrollable = true;\n\n /**\n * Whether the modal can be dismissed by clicking the backdrop or pressing Escape\n */\n @Prop() backdropDismiss = true;\n\n /**\n * Whether the modal is open\n */\n @Prop({ mutable: true }) open = false;\n\n // No need for modalRef in the mock implementation\n\n /**\n * Event emitted when the modal is opened\n */\n @Event() pdsModalOpen: EventEmitter<void>;\n\n /**\n * Event emitted when the modal is closed\n */\n @Event() pdsModalClose: EventEmitter<void>;\n\n /**\n * Event emitted when the backdrop is clicked\n */\n @Event() pdsModalBackdropClick: EventEmitter<void>;\n\n /**\n * Shows the modal\n */\n @Method()\n async showModal() {\n this.open = true;\n this.pdsModalOpen.emit();\n }\n\n /**\n * Hides the modal\n */\n @Method()\n async hideModal() {\n this.open = false;\n this.pdsModalClose.emit();\n }\n\n /**\n * Listen for click events on the backdrop\n */\n // Using direct method instead of @Listen to avoid ESLint warning\n handleBackdropClick(event: MouseEvent) {\n const backdrop = this.el.querySelector('.pds-modal__backdrop');\n // Check if the click was directly on the backdrop (not on a child element)\n if (event.target === backdrop && this.backdropDismiss === true) {\n this.pdsModalBackdropClick.emit();\n this.hideModal();\n }\n }\n\n /**\n * Listen for keydown events to handle Escape key\n * Should only close on Escape if backdropDismiss is enabled\n */\n // Using direct method instead of @Listen to avoid ESLint warning\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && this.open === true) {\n // Always prevent default to mirror native dialog behavior blocking\n event.preventDefault();\n // Only close if backdropDismiss is enabled\n if (this.backdropDismiss === true) {\n this.hideModal();\n }\n }\n }\n\n componentDidLoad() {\n // No need to do anything in componentDidLoad for the mock\n }\n\n render() {\n const modalClasses = {\n 'pds-modal': true,\n [`pds-modal--${this.size}`]: true,\n 'pds-modal--scrollable': this.scrollable\n };\n\n const backdropClasses = {\n 'pds-modal__backdrop': true,\n 'open': this.open,\n };\n\n return (\n <div class={backdropClasses}>\n <div\n class={modalClasses}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={this.componentId ? `${this.componentId}-heading` : null}\n part=\"modal\"\n >\n <div class=\"pds-modal__header\">\n <slot name=\"header\"></slot>\n </div>\n <div class=\"pds-modal-content\">\n <slot></slot>\n </div>\n <div class=\"pds-modal__footer\">\n <slot name=\"footer\"></slot>\n </div>\n </div>\n </div>\n );\n }\n}\n"]}
@@ -35,11 +35,11 @@
35
35
  border-radius: var(--pine-dimension-125);
36
36
  cursor: pointer;
37
37
  display: flex;
38
- font: var(--pine-typography-body);
38
+ font: var(--pine-typography-body-medium);
39
39
  gap: var(--pine-dimension-xs);
40
40
  justify-content: space-between;
41
41
  letter-spacing: var(--pine-letter-spacing);
42
- min-height: var(--pine-dimension-550);
42
+ min-height: var(--pine-dimension-450);
43
43
  padding: var(--pine-dimension-xs) var(--pine-dimension-sm);
44
44
  position: relative;
45
45
  text-align: start;
@@ -10,7 +10,7 @@ export class PdsText {
10
10
  /**
11
11
  * Determines what semantic text tag to render.
12
12
  */
13
- this.tag = "p";
13
+ this.tag = 'p';
14
14
  }
15
15
  handleTruncateChange(newValue) {
16
16
  if (newValue) {
@@ -49,13 +49,23 @@ export class PdsText {
49
49
  const Tag = this.tag;
50
50
  const typeClasses = `
51
51
  pds-text
52
- ${this.align !== undefined && this.align.trim() !== '' ? `pds-text--align-${this.align}` : ''}
53
- ${this.gutter !== undefined && this.gutter.trim() !== '' ? `pds-text--gutter-${this.gutter}` : ''}
54
- ${this.size !== undefined && this.size.trim() !== '' ? `pds-text--size-${this.size}` : ''}
55
- ${this.weight !== undefined && this.weight.trim() !== '' ? `pds-text--weight-${this.weight}` : ''}
56
- ${this.decoration !== undefined && this.decoration.trim() !== '' ? `pds-text--decoration-${this.decoration}` : ''}
52
+ ${this.align !== undefined && this.align.trim() !== ''
53
+ ? `pds-text--align-${this.align}`
54
+ : ''}
55
+ ${this.gutter !== undefined && this.gutter.trim() !== ''
56
+ ? `pds-text--gutter-${this.gutter}`
57
+ : ''}
58
+ ${this.size !== undefined && this.size.trim() !== ''
59
+ ? `pds-text--size-${this.size}`
60
+ : ''}
61
+ ${this.weight !== undefined && this.weight.trim() !== ''
62
+ ? `pds-text--weight-${this.weight}`
63
+ : ''}
64
+ ${this.decoration !== undefined && this.decoration.trim() !== ''
65
+ ? `pds-text--decoration-${this.decoration}`
66
+ : ''}
57
67
  `;
58
- return (h(Tag, { key: 'e5d4fa802fbc1a66c21d6e959fb2228f8cac1902', ref: (el) => this.contentEl = el, style: this.color && setColor(this.color), class: typeClasses, part: "content", tabIndex: this.truncate ? 0 : undefined }, h("slot", { key: '4ff0b2cb3a185fd97ef296262790379df832b7b8' })));
68
+ return (h(Tag, { key: '1d4952d18c09b26a5f2c7f64574be86c90cca553', ref: (el) => (this.contentEl = el), style: this.color && setColor(this.color), class: typeClasses, part: "content", tabIndex: this.truncate ? 0 : undefined }, h("slot", { key: '62a5caff5274601b79f35025c9382e2430118cdc' })));
59
69
  }
60
70
  static get is() { return "pds-text"; }
61
71
  static get encapsulation() { return "shadow"; }
@@ -113,7 +123,7 @@ export class PdsText {
113
123
  "type": "string",
114
124
  "mutable": false,
115
125
  "complexType": {
116
- "original": "| 'strikethrough'\n | 'underline-dotted'",
126
+ "original": "'strikethrough' | 'underline-dotted'",
117
127
  "resolved": "\"strikethrough\" | \"underline-dotted\"",
118
128
  "references": {}
119
129
  },
@@ -132,7 +142,7 @@ export class PdsText {
132
142
  "type": "string",
133
143
  "mutable": false,
134
144
  "complexType": {
135
- "original": "| '2xl'\n | 'xl'\n | 'lg'\n | 'md'\n | 'sm'\n | 'xs'\n | '2xs'",
145
+ "original": "'2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs'",
136
146
  "resolved": "\"2xl\" | \"2xs\" | \"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\"",
137
147
  "references": {}
138
148
  },
@@ -170,7 +180,7 @@ export class PdsText {
170
180
  "type": "string",
171
181
  "mutable": false,
172
182
  "complexType": {
173
- "original": "| '2xl'\n | 'xl'\n | 'lg'\n | 'md'\n | 'sm'\n | 'xs'\n | '2xs'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'",
183
+ "original": "| '2xl'\n | 'xl'\n | 'lg'\n | 'md'\n | 'sm'\n | 'xs'\n | '2xs'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'",
174
184
  "resolved": "\"2xl\" | \"2xs\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\"",
175
185
  "references": {}
176
186
  },
@@ -189,7 +199,7 @@ export class PdsText {
189
199
  "type": "string",
190
200
  "mutable": false,
191
201
  "complexType": {
192
- "original": "| 'extra-light'\n | 'light'\n | 'regular'\n | 'medium'\n | 'semibold'\n | 'bold'",
202
+ "original": "| 'extra-light'\n | 'light'\n | 'regular'\n | 'medium'\n | 'semibold'\n | 'bold'",
193
203
  "resolved": "\"bold\" | \"extra-light\" | \"light\" | \"medium\" | \"regular\" | \"semibold\"",
194
204
  "references": {}
195
205
  },
@@ -208,8 +218,8 @@ export class PdsText {
208
218
  "type": "string",
209
219
  "mutable": false,
210
220
  "complexType": {
211
- "original": "| 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'p'\n | 'code'\n | 'pre'\n | 'strong'\n | 'em'",
212
- "resolved": "\"code\" | \"em\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"pre\" | \"strong\"",
221
+ "original": "| 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'p'\n | 'span'\n | 'code'\n | 'pre'\n | 'strong'\n | 'em'",
222
+ "resolved": "\"code\" | \"em\" | \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\" | \"p\" | \"pre\" | \"span\" | \"strong\"",
213
223
  "references": {}
214
224
  },
215
225
  "required": false,
@@ -222,7 +232,7 @@ export class PdsText {
222
232
  "setter": false,
223
233
  "reflect": false,
224
234
  "attribute": "tag",
225
- "defaultValue": "\"p\""
235
+ "defaultValue": "'p'"
226
236
  },
227
237
  "truncate": {
228
238
  "type": "boolean",
@@ -1 +1 @@
1
- {"version":3,"file":"pds-text.js","sourceRoot":"","sources":["../../../../src/components/pds-text/pds-text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE;;GAEG;AAMH,MAAM,OAAO,OAAO;IALpB;QAQU,sBAAiB,GAAwB,IAAI,CAAC;QAgEtD;;WAEG;QACK,QAAG,GAWF,GAAG,CAAC;KAwEd;IA9DC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\nimport { setupTruncationTooltip } from '../../utils/truncation-tooltip';\n\n/**\n * @part content - The text content container\n */\n@Component({\n tag: 'pds-text',\n styleUrl: 'pds-text.scss',\n shadow: true,\n})\nexport class PdsText {\n @Element() el: HTMLPdsTextElement;\n private contentEl: HTMLElement;\n private truncationCleanup: (() => void) | null = null;\n /**\n * Sets the text alignment.\n */\n @Prop() align?: 'start' | 'center' | 'end' | 'justify';\n\n /**\n * Sets the text color.\n */\n @Prop() color?: string;\n\n /**\n * Sets the text decoration.\n */\n @Prop() decoration?:\n | 'strikethrough'\n | 'underline-dotted';\n\n /**\n * Set the bottom margin for the text.\n */\n @Prop() gutter?:\n | '2xl'\n | 'xl'\n | 'lg'\n | 'md'\n | 'sm'\n | 'xs'\n | '2xs';\n\n /**\n * If set or `true`, the text will be italic.\n */\n @Prop() italic?: boolean;\n\n /**\n * Sets the font size.\n */\n @Prop() size?:\n | '2xl'\n | 'xl'\n | 'lg'\n | 'md'\n | 'sm'\n | 'xs'\n | '2xs'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6';\n\n /**\n * Sets the font weight.\n */\n @Prop() weight?:\n | 'extra-light'\n | 'light'\n | 'regular'\n | 'medium'\n | 'semibold'\n | 'bold';\n\n /**\n * Determines what semantic text tag to render.\n */\n @Prop() tag:\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'p'\n | 'code'\n | 'pre'\n | 'strong'\n | 'em' = \"p\";\n\n /**\n * If set or `true`, the text will be truncated. Must add a `width` to the element.\n * When text overflows, a tooltip showing the full text will appear on hover/focus.\n * Note: When truncate is enabled, the element automatically receives tabindex=\"0\" for keyboard accessibility.\n */\n @Prop({ reflect: true }) truncate?: boolean;\n\n @Watch('truncate')\n handleTruncateChange(newValue: boolean) {\n if (newValue) {\n this.initTruncationTooltip();\n } else {\n this.destroyTruncationTooltip();\n }\n }\n\n componentDidLoad() {\n if (this.truncate) {\n this.initTruncationTooltip();\n }\n }\n\n disconnectedCallback() {\n this.destroyTruncationTooltip();\n }\n\n private initTruncationTooltip() {\n // Clean up any existing tooltip before setting up a new one\n this.destroyTruncationTooltip();\n\n if (this.contentEl) {\n this.truncationCleanup = setupTruncationTooltip({\n hostEl: this.el,\n contentEl: this.contentEl,\n getTooltipText: () => this.el.textContent || '',\n });\n }\n }\n\n private destroyTruncationTooltip() {\n if (this.truncationCleanup) {\n this.truncationCleanup();\n this.truncationCleanup = null;\n }\n }\n\n render() {\n const Tag = this.tag;\n\n const typeClasses = `\n pds-text\n ${this.align !== undefined && this.align.trim() !== '' ? `pds-text--align-${this.align}` : ''}\n ${this.gutter !== undefined && this.gutter.trim() !== '' ? `pds-text--gutter-${this.gutter}` : ''}\n ${this.size !== undefined && this.size.trim() !== '' ? `pds-text--size-${this.size}` : ''}\n ${this.weight !== undefined && this.weight.trim() !== '' ? `pds-text--weight-${this.weight}` : ''}\n ${this.decoration !== undefined && this.decoration.trim() !== '' ? `pds-text--decoration-${this.decoration}` : ''}\n `;\n\n return (\n <Tag\n ref={(el) => this.contentEl = el}\n style={this.color && setColor(this.color)}\n class={typeClasses}\n part=\"content\"\n tabIndex={this.truncate ? 0 : undefined}\n >\n <slot />\n </Tag>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pds-text.js","sourceRoot":"","sources":["../../../../src/components/pds-text/pds-text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE;;GAEG;AAMH,MAAM,OAAO,OAAO;IALpB;QAQU,sBAAiB,GAAwB,IAAI,CAAC;QAuDtD;;WAEG;QACK,QAAG,GAYA,GAAG,CAAC;KA4FhB;IAlFC,oBAAoB,CAAC,QAAiB;QACpC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AM,EAAE;YACnC,CAAC,CAAC,EACN;QAEE,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE;YAChD,CAAC,CAAC,kBAAkB,IAAI,CAAC,IAAI,EAAE;YAC/B,CAAC,CAAC,EACN;QAEE,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE;YACpD,CAAC,CAAC,oBAAoB,IAAI,CAAC,MAAM,EAAE;YACnC,CAAC,CAAC,EACN;QAEE,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE;YAC5D,CAAC,CAAC,wBAAwB,IAAI,CAAC,UAAU,EAAE;YAC3C,CAAC,CAAC,EACN;KACD,CAAC;QAEF,OAAO,CACL,EAAC,GAAG,qDACF,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,EAClC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EACzC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAC,SAAS,EACd,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;YAEvC,8DAAQ,CACJ,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, Prop, Element, Watch } from '@stencil/core';\nimport { setColor } from '../../utils/utils';\nimport { setupTruncationTooltip } from '../../utils/truncation-tooltip';\n\n/**\n * @part content - The text content container\n */\n@Component({\n tag: 'pds-text',\n styleUrl: 'pds-text.scss',\n shadow: true,\n})\nexport class PdsText {\n @Element() el: HTMLPdsTextElement;\n private contentEl: HTMLElement;\n private truncationCleanup: (() => void) | null = null;\n /**\n * Sets the text alignment.\n */\n @Prop() align?: 'start' | 'center' | 'end' | 'justify';\n\n /**\n * Sets the text color.\n */\n @Prop() color?: string;\n\n /**\n * Sets the text decoration.\n */\n @Prop() decoration?: 'strikethrough' | 'underline-dotted';\n\n /**\n * Set the bottom margin for the text.\n */\n @Prop() gutter?: '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs' | '2xs';\n\n /**\n * If set or `true`, the text will be italic.\n */\n @Prop() italic?: boolean;\n\n /**\n * Sets the font size.\n */\n @Prop() size?:\n | '2xl'\n | 'xl'\n | 'lg'\n | 'md'\n | 'sm'\n | 'xs'\n | '2xs'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6';\n\n /**\n * Sets the font weight.\n */\n @Prop() weight?:\n | 'extra-light'\n | 'light'\n | 'regular'\n | 'medium'\n | 'semibold'\n | 'bold';\n\n /**\n * Determines what semantic text tag to render.\n */\n @Prop() tag:\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'p'\n | 'span'\n | 'code'\n | 'pre'\n | 'strong'\n | 'em' = 'p';\n\n /**\n * If set or `true`, the text will be truncated. Must add a `width` to the element.\n * When text overflows, a tooltip showing the full text will appear on hover/focus.\n * Note: When truncate is enabled, the element automatically receives tabindex=\"0\" for keyboard accessibility.\n */\n @Prop({ reflect: true }) truncate?: boolean;\n\n @Watch('truncate')\n handleTruncateChange(newValue: boolean) {\n if (newValue) {\n this.initTruncationTooltip();\n } else {\n this.destroyTruncationTooltip();\n }\n }\n\n componentDidLoad() {\n if (this.truncate) {\n this.initTruncationTooltip();\n }\n }\n\n disconnectedCallback() {\n this.destroyTruncationTooltip();\n }\n\n private initTruncationTooltip() {\n // Clean up any existing tooltip before setting up a new one\n this.destroyTruncationTooltip();\n\n if (this.contentEl) {\n this.truncationCleanup = setupTruncationTooltip({\n hostEl: this.el,\n contentEl: this.contentEl,\n getTooltipText: () => this.el.textContent || '',\n });\n }\n }\n\n private destroyTruncationTooltip() {\n if (this.truncationCleanup) {\n this.truncationCleanup();\n this.truncationCleanup = null;\n }\n }\n\n render() {\n const Tag = this.tag;\n\n const typeClasses = `\n pds-text\n ${\n this.align !== undefined && this.align.trim() !== ''\n ? `pds-text--align-${this.align}`\n : ''\n }\n ${\n this.gutter !== undefined && this.gutter.trim() !== ''\n ? `pds-text--gutter-${this.gutter}`\n : ''\n }\n ${\n this.size !== undefined && this.size.trim() !== ''\n ? `pds-text--size-${this.size}`\n : ''\n }\n ${\n this.weight !== undefined && this.weight.trim() !== ''\n ? `pds-text--weight-${this.weight}`\n : ''\n }\n ${\n this.decoration !== undefined && this.decoration.trim() !== ''\n ? `pds-text--decoration-${this.decoration}`\n : ''\n }\n `;\n\n return (\n <Tag\n ref={(el) => (this.contentEl = el)}\n style={this.color && setColor(this.color)}\n class={typeClasses}\n part=\"content\"\n tabIndex={this.truncate ? 0 : undefined}\n >\n <slot />\n </Tag>\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["export type PlacementType =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'left-start'\n | 'left'\n | 'left-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-start'\n | 'bottom'\n | 'bottom-end';\n\nexport type BoxColumnType =\n '0'\n | '1'\n | '2'\n | '3'\n | '4'\n | '5'\n | '6'\n | '7'\n | '8'\n | '9'\n | '10'\n | '11'\n | '12';\n\nexport type BoxSpacingType =\n 'none'\n | 'xxs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | 'xxl'\n | '025'\n | '050'\n | '100'\n | '125'\n | '150'\n | '200'\n | '250'\n | '300'\n | '350'\n | '400'\n | '450'\n | '500'\n | '550'\n | '600'\n | '650'\n | '700'\n | '750'\n | '800';\n\nexport type BoxShadowSizeType =\n 'none'\n | '050'\n | '100'\n | '150'\n | '200'\n | '300'\n | '400'\n | '500'\n\nexport type ChipSentimentType =\n 'accent'\n | 'brand'\n | 'danger'\n | 'info'\n | 'neutral'\n | 'success'\n | 'warning';\n\nexport type ChipVariantType =\n 'text'\n | 'tag'\n | 'dropdown';"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["export type PlacementType =\n | 'top-start'\n | 'top'\n | 'top-end'\n | 'left-start'\n | 'left'\n | 'left-end'\n | 'right-start'\n | 'right'\n | 'right-end'\n | 'bottom-start'\n | 'bottom'\n | 'bottom-end';\n\nexport type BoxColumnType =\n '0'\n | '1'\n | '2'\n | '3'\n | '4'\n | '5'\n | '6'\n | '7'\n | '8'\n | '9'\n | '10'\n | '11'\n | '12';\n\nexport type BoxSpacingType =\n 'none'\n | 'xxs'\n | 'xs'\n | 'sm'\n | 'md'\n | 'lg'\n | 'xl'\n | 'xxl'\n | '025'\n | '050'\n | '100'\n | '125'\n | '150'\n | '200'\n | '250'\n | '300'\n | '350'\n | '400'\n | '450'\n | '500'\n | '550'\n | '600'\n | '650'\n | '700'\n | '750'\n | '800';\n\nexport type BoxShadowSizeType =\n 'none'\n | '050'\n | '100'\n | '150'\n | '200'\n | '300'\n | '400'\n | '500'\n\nexport type ChipSentimentType =\n 'accent'\n | 'brand'\n | 'danger'\n | 'info'\n | 'neutral'\n | 'success'\n | 'warning';\n\nexport type ChipSizeType =\n 'sm'\n | 'md'\n | 'lg';\n\nexport type ChipVariantType =\n 'text'\n | 'tag'\n | 'dropdown';"]}