@pine-ds/core 4.4.3 → 4.5.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 (541) hide show
  1. package/components/attributes.js +1 -1
  2. package/components/closest.js +1 -1
  3. package/components/index.js +1 -1
  4. package/components/pds-avatar.js +1 -1
  5. package/components/pds-box2.js +1 -1
  6. package/components/pds-checkbox2.js +1 -1
  7. package/components/pds-chip2.js +1 -1
  8. package/components/pds-combobox.js +2 -2
  9. package/components/pds-copytext.js +1 -1
  10. package/components/pds-datepicker.js +1 -1
  11. package/components/pds-drawer-content.js +1 -1
  12. package/components/pds-drawer-footer.js +1 -1
  13. package/components/pds-drawer-header.js +1 -1
  14. package/components/pds-drawer.js +1 -1
  15. package/components/pds-dropdown-menu.js +1 -1
  16. package/components/pds-loader2.js +1 -1
  17. package/components/pds-modal-content.js +1 -1
  18. package/components/pds-modal-footer.js +1 -1
  19. package/components/pds-modal-header.js +1 -1
  20. package/components/pds-modal2.js +1 -1
  21. package/components/pds-popover.js +1 -1
  22. package/components/pds-progress.js +1 -1
  23. package/components/pds-radio-group.js +1 -1
  24. package/components/pds-radio.js +1 -1
  25. package/components/pds-row.js +1 -1
  26. package/components/pds-select.js +1 -1
  27. package/components/pds-sortable-item.js +1 -1
  28. package/components/pds-sortable.js +2 -2
  29. package/components/pds-switch.js +1 -1
  30. package/components/pds-table-head.js +1 -1
  31. package/components/pds-table-row.js +1 -1
  32. package/components/pds-tabpanel.js +1 -1
  33. package/components/pds-tabs.js +1 -1
  34. package/components/pds-tooltip.js +1 -1
  35. package/components/reflected-attribute-default.js +1 -0
  36. package/dist/cjs/attributes-DXvaSETR.js +178 -0
  37. package/dist/cjs/{index-D8Gl0bIB.js → index-BQjWfQXw.js} +10 -1
  38. package/dist/cjs/index.cjs.js +3 -0
  39. package/dist/cjs/keep-hydrated-iLS88j1Z.js +67 -0
  40. package/dist/cjs/loader.cjs.js +3 -2
  41. package/dist/cjs/mock-pds-modal.cjs.entry.js +2 -1
  42. package/dist/cjs/pds-accordion.cjs.entry.js +2 -1
  43. package/dist/cjs/pds-alert.cjs.entry.js +2 -1
  44. package/dist/cjs/pds-avatar.cjs.entry.js +19 -2
  45. package/dist/cjs/pds-box.cjs.entry.js +13 -2
  46. package/dist/cjs/pds-button.cjs.entry.js +2 -1
  47. package/dist/cjs/pds-checkbox.cjs.entry.js +13 -5
  48. package/dist/cjs/pds-chip.cjs.entry.js +12 -2
  49. package/dist/cjs/pds-combobox.cjs.entry.js +13 -7
  50. package/dist/cjs/pds-container.cjs.entry.js +2 -1
  51. package/dist/cjs/pds-copytext.cjs.entry.js +18 -2
  52. package/dist/cjs/pds-datepicker.cjs.entry.js +3 -2
  53. package/dist/cjs/pds-divider.cjs.entry.js +2 -1
  54. package/dist/cjs/pds-drawer-content.cjs.entry.js +3 -2
  55. package/dist/cjs/pds-drawer-footer.cjs.entry.js +3 -2
  56. package/dist/cjs/pds-drawer-header.cjs.entry.js +3 -2
  57. package/dist/cjs/pds-drawer.cjs.entry.js +4 -3
  58. package/dist/cjs/pds-dropdown-menu-item.cjs.entry.js +2 -1
  59. package/dist/cjs/pds-dropdown-menu-separator.cjs.entry.js +2 -1
  60. package/dist/cjs/pds-dropdown-menu.cjs.entry.js +41 -10
  61. package/dist/cjs/pds-filter.cjs.entry.js +2 -1
  62. package/dist/cjs/pds-filters.cjs.entry.js +2 -1
  63. package/dist/cjs/pds-icon.cjs.entry.js +2 -1
  64. package/dist/cjs/pds-image.cjs.entry.js +2 -1
  65. package/dist/cjs/pds-input.cjs.entry.js +3 -2
  66. package/dist/cjs/pds-link.cjs.entry.js +2 -1
  67. package/dist/cjs/pds-loader.cjs.entry.js +29 -2
  68. package/dist/cjs/pds-modal-content.cjs.entry.js +4 -3
  69. package/dist/cjs/pds-modal-footer.cjs.entry.js +3 -2
  70. package/dist/cjs/pds-modal-header.cjs.entry.js +3 -2
  71. package/dist/cjs/pds-modal.cjs.entry.js +137 -50
  72. package/dist/cjs/pds-multiselect.cjs.entry.js +2 -1
  73. package/dist/cjs/pds-popover.cjs.entry.js +83 -14
  74. package/dist/cjs/pds-progress.cjs.entry.js +14 -2
  75. package/dist/cjs/pds-property.cjs.entry.js +2 -1
  76. package/dist/cjs/pds-radio-group.cjs.entry.js +5 -4
  77. package/dist/cjs/pds-radio.cjs.entry.js +13 -4
  78. package/dist/cjs/pds-row.cjs.entry.js +13 -2
  79. package/dist/cjs/pds-select.cjs.entry.js +15 -2
  80. package/dist/cjs/pds-sortable-item.cjs.entry.js +12 -2
  81. package/dist/cjs/pds-sortable.cjs.entry.js +13 -2
  82. package/dist/cjs/pds-switch.cjs.entry.js +14 -5
  83. package/dist/cjs/pds-tab.cjs.entry.js +2 -1
  84. package/dist/cjs/pds-table-body.cjs.entry.js +2 -1
  85. package/dist/cjs/pds-table-cell.cjs.entry.js +2 -1
  86. package/dist/cjs/pds-table-head-cell.cjs.entry.js +2 -1
  87. package/dist/cjs/pds-table-head.cjs.entry.js +2 -1
  88. package/dist/cjs/pds-table-row.cjs.entry.js +2 -1
  89. package/dist/cjs/pds-table.cjs.entry.js +2 -1
  90. package/dist/cjs/pds-tabpanel.cjs.entry.js +3 -2
  91. package/dist/cjs/pds-tabs.cjs.entry.js +15 -2
  92. package/dist/cjs/pds-text.cjs.entry.js +2 -1
  93. package/dist/cjs/pds-textarea.cjs.entry.js +3 -2
  94. package/dist/cjs/pds-toast.cjs.entry.js +2 -1
  95. package/dist/cjs/pds-tooltip.cjs.entry.js +4 -3
  96. package/dist/cjs/pine-core.cjs.js +3 -2
  97. package/dist/cjs/reflected-attribute-default-DVYHG6O1.js +44 -0
  98. package/dist/collection/collection-manifest.json +2 -1
  99. package/dist/collection/components/pds-avatar/pds-avatar.js +20 -3
  100. package/dist/collection/components/pds-box/pds-box.js +14 -1
  101. package/dist/collection/components/pds-checkbox/pds-checkbox.js +11 -4
  102. package/dist/collection/components/pds-chip/pds-chip.js +10 -1
  103. package/dist/collection/components/pds-combobox/pds-combobox.css +14 -2
  104. package/dist/collection/components/pds-combobox/pds-combobox.js +33 -5
  105. package/dist/collection/components/pds-combobox/stories/pds-combobox.stories.js +41 -0
  106. package/dist/collection/components/pds-copytext/pds-copytext.js +17 -2
  107. package/dist/collection/components/pds-datepicker/pds-datepicker.css +4 -2
  108. package/dist/collection/components/pds-drawer/pds-drawer-content/pds-drawer-content.js +2 -1
  109. package/dist/collection/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.js +4 -1
  110. package/dist/collection/components/pds-drawer/pds-drawer-header/pds-drawer-header.js +4 -1
  111. package/dist/collection/components/pds-drawer/pds-drawer.js +3 -2
  112. package/dist/collection/components/pds-dropdown-menu/pds-dropdown-menu.js +39 -9
  113. package/dist/collection/components/pds-loader/pds-loader.js +29 -2
  114. package/dist/collection/components/pds-modal/pds-modal-content/pds-modal-content.js +5 -2
  115. package/dist/collection/components/pds-modal/pds-modal-footer/pds-modal-footer.js +4 -1
  116. package/dist/collection/components/pds-modal/pds-modal-header/pds-modal-header.js +4 -1
  117. package/dist/collection/components/pds-modal/pds-modal.js +138 -49
  118. package/dist/collection/components/pds-popover/pds-popover.js +83 -14
  119. package/dist/collection/components/pds-progress/pds-progress.js +12 -1
  120. package/dist/collection/components/pds-radio/pds-radio.js +12 -3
  121. package/dist/collection/components/pds-radio-group/pds-radio-group.js +4 -3
  122. package/dist/collection/components/pds-row/pds-row.js +14 -1
  123. package/dist/collection/components/pds-select/pds-select.js +13 -1
  124. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +11 -1
  125. package/dist/collection/components/pds-sortable/pds-sortable.js +14 -1
  126. package/dist/collection/components/pds-switch/pds-switch.js +12 -4
  127. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js +3 -0
  128. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +4 -1
  129. package/dist/collection/components/pds-tabs/pds-tabs.js +13 -1
  130. package/dist/collection/components/pds-tooltip/pds-tooltip.js +3 -2
  131. package/dist/collection/global/pine-global.js +6 -0
  132. package/dist/collection/index.js +1 -0
  133. package/dist/collection/utils/attributes.js +90 -0
  134. package/dist/collection/utils/keep-hydrated.js +61 -0
  135. package/dist/collection/utils/reflected-attribute-default.js +40 -0
  136. package/dist/collection/utils/test/host-strip.js +50 -0
  137. package/dist/docs.json +129 -19
  138. package/dist/esm/attributes-CF5K2pxn.js +173 -0
  139. package/dist/esm/{index-bLhIfh0N.js → index-2HMD-zUO.js} +10 -1
  140. package/dist/esm/index.js +2 -0
  141. package/dist/esm/keep-hydrated-Dv7ssOTc.js +63 -0
  142. package/dist/esm/loader.js +4 -3
  143. package/dist/esm/mock-pds-modal.entry.js +2 -1
  144. package/dist/esm/pds-accordion.entry.js +2 -1
  145. package/dist/esm/pds-alert.entry.js +2 -1
  146. package/dist/esm/pds-avatar.entry.js +19 -2
  147. package/dist/esm/pds-box.entry.js +13 -2
  148. package/dist/esm/pds-button.entry.js +2 -1
  149. package/dist/esm/pds-checkbox.entry.js +13 -5
  150. package/dist/esm/pds-chip.entry.js +12 -2
  151. package/dist/esm/pds-combobox.entry.js +13 -7
  152. package/dist/esm/pds-container.entry.js +2 -1
  153. package/dist/esm/pds-copytext.entry.js +18 -2
  154. package/dist/esm/pds-datepicker.entry.js +3 -2
  155. package/dist/esm/pds-divider.entry.js +2 -1
  156. package/dist/esm/pds-drawer-content.entry.js +3 -2
  157. package/dist/esm/pds-drawer-footer.entry.js +3 -2
  158. package/dist/esm/pds-drawer-header.entry.js +3 -2
  159. package/dist/esm/pds-drawer.entry.js +4 -3
  160. package/dist/esm/pds-dropdown-menu-item.entry.js +2 -1
  161. package/dist/esm/pds-dropdown-menu-separator.entry.js +2 -1
  162. package/dist/esm/pds-dropdown-menu.entry.js +41 -10
  163. package/dist/esm/pds-filter.entry.js +2 -1
  164. package/dist/esm/pds-filters.entry.js +2 -1
  165. package/dist/esm/pds-icon.entry.js +2 -1
  166. package/dist/esm/pds-image.entry.js +2 -1
  167. package/dist/esm/pds-input.entry.js +3 -2
  168. package/dist/esm/pds-link.entry.js +2 -1
  169. package/dist/esm/pds-loader.entry.js +29 -2
  170. package/dist/esm/pds-modal-content.entry.js +4 -3
  171. package/dist/esm/pds-modal-footer.entry.js +3 -2
  172. package/dist/esm/pds-modal-header.entry.js +3 -2
  173. package/dist/esm/pds-modal.entry.js +137 -50
  174. package/dist/esm/pds-multiselect.entry.js +2 -1
  175. package/dist/esm/pds-popover.entry.js +83 -14
  176. package/dist/esm/pds-progress.entry.js +14 -2
  177. package/dist/esm/pds-property.entry.js +2 -1
  178. package/dist/esm/pds-radio-group.entry.js +5 -4
  179. package/dist/esm/pds-radio.entry.js +13 -4
  180. package/dist/esm/pds-row.entry.js +13 -2
  181. package/dist/esm/pds-select.entry.js +15 -2
  182. package/dist/esm/pds-sortable-item.entry.js +12 -2
  183. package/dist/esm/pds-sortable.entry.js +13 -2
  184. package/dist/esm/pds-switch.entry.js +14 -5
  185. package/dist/esm/pds-tab.entry.js +2 -1
  186. package/dist/esm/pds-table-body.entry.js +2 -1
  187. package/dist/esm/pds-table-cell.entry.js +2 -1
  188. package/dist/esm/pds-table-head-cell.entry.js +2 -1
  189. package/dist/esm/pds-table-head.entry.js +2 -1
  190. package/dist/esm/pds-table-row.entry.js +2 -1
  191. package/dist/esm/pds-table.entry.js +2 -1
  192. package/dist/esm/pds-tabpanel.entry.js +3 -2
  193. package/dist/esm/pds-tabs.entry.js +15 -2
  194. package/dist/esm/pds-text.entry.js +2 -1
  195. package/dist/esm/pds-textarea.entry.js +3 -2
  196. package/dist/esm/pds-toast.entry.js +2 -1
  197. package/dist/esm/pds-tooltip.entry.js +4 -3
  198. package/dist/esm/pine-core.js +4 -3
  199. package/dist/esm/reflected-attribute-default-t3idJwV0.js +42 -0
  200. package/dist/esm-es5/attributes-CF5K2pxn.js +1 -0
  201. package/dist/esm-es5/{index-bLhIfh0N.js → index-2HMD-zUO.js} +2 -2
  202. package/dist/esm-es5/index.js +1 -1
  203. package/dist/esm-es5/keep-hydrated-Dv7ssOTc.js +1 -0
  204. package/dist/esm-es5/loader.js +1 -1
  205. package/dist/esm-es5/mock-pds-modal.entry.js +1 -1
  206. package/dist/esm-es5/pds-accordion.entry.js +1 -1
  207. package/dist/esm-es5/pds-alert.entry.js +1 -1
  208. package/dist/esm-es5/pds-avatar.entry.js +1 -1
  209. package/dist/esm-es5/pds-box.entry.js +1 -1
  210. package/dist/esm-es5/pds-button.entry.js +1 -1
  211. package/dist/esm-es5/pds-checkbox.entry.js +1 -1
  212. package/dist/esm-es5/pds-chip.entry.js +1 -1
  213. package/dist/esm-es5/pds-combobox.entry.js +2 -2
  214. package/dist/esm-es5/pds-container.entry.js +1 -1
  215. package/dist/esm-es5/pds-copytext.entry.js +1 -1
  216. package/dist/esm-es5/pds-datepicker.entry.js +1 -1
  217. package/dist/esm-es5/pds-divider.entry.js +1 -1
  218. package/dist/esm-es5/pds-drawer-content.entry.js +1 -1
  219. package/dist/esm-es5/pds-drawer-footer.entry.js +1 -1
  220. package/dist/esm-es5/pds-drawer-header.entry.js +1 -1
  221. package/dist/esm-es5/pds-drawer.entry.js +1 -1
  222. package/dist/esm-es5/pds-dropdown-menu-item.entry.js +1 -1
  223. package/dist/esm-es5/pds-dropdown-menu-separator.entry.js +1 -1
  224. package/dist/esm-es5/pds-dropdown-menu.entry.js +1 -1
  225. package/dist/esm-es5/pds-filter.entry.js +1 -1
  226. package/dist/esm-es5/pds-filters.entry.js +1 -1
  227. package/dist/esm-es5/pds-icon.entry.js +1 -1
  228. package/dist/esm-es5/pds-image.entry.js +1 -1
  229. package/dist/esm-es5/pds-input.entry.js +1 -1
  230. package/dist/esm-es5/pds-link.entry.js +1 -1
  231. package/dist/esm-es5/pds-loader.entry.js +1 -1
  232. package/dist/esm-es5/pds-modal-content.entry.js +1 -1
  233. package/dist/esm-es5/pds-modal-footer.entry.js +1 -1
  234. package/dist/esm-es5/pds-modal-header.entry.js +1 -1
  235. package/dist/esm-es5/pds-modal.entry.js +1 -1
  236. package/dist/esm-es5/pds-multiselect.entry.js +1 -1
  237. package/dist/esm-es5/pds-popover.entry.js +1 -1
  238. package/dist/esm-es5/pds-progress.entry.js +1 -1
  239. package/dist/esm-es5/pds-property.entry.js +1 -1
  240. package/dist/esm-es5/pds-radio-group.entry.js +1 -1
  241. package/dist/esm-es5/pds-radio.entry.js +1 -1
  242. package/dist/esm-es5/pds-row.entry.js +1 -1
  243. package/dist/esm-es5/pds-select.entry.js +1 -1
  244. package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
  245. package/dist/esm-es5/pds-sortable.entry.js +2 -2
  246. package/dist/esm-es5/pds-switch.entry.js +1 -1
  247. package/dist/esm-es5/pds-tab.entry.js +1 -1
  248. package/dist/esm-es5/pds-table-body.entry.js +1 -1
  249. package/dist/esm-es5/pds-table-cell.entry.js +1 -1
  250. package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
  251. package/dist/esm-es5/pds-table-head.entry.js +1 -1
  252. package/dist/esm-es5/pds-table-row.entry.js +1 -1
  253. package/dist/esm-es5/pds-table.entry.js +1 -1
  254. package/dist/esm-es5/pds-tabpanel.entry.js +1 -1
  255. package/dist/esm-es5/pds-tabs.entry.js +1 -1
  256. package/dist/esm-es5/pds-text.entry.js +1 -1
  257. package/dist/esm-es5/pds-textarea.entry.js +1 -1
  258. package/dist/esm-es5/pds-toast.entry.js +1 -1
  259. package/dist/esm-es5/pds-tooltip.entry.js +1 -1
  260. package/dist/esm-es5/pine-core.js +1 -1
  261. package/dist/esm-es5/reflected-attribute-default-t3idJwV0.js +1 -0
  262. package/dist/pine-core/index.esm.js +1 -1
  263. package/dist/pine-core/p-0166c620.entry.js +1 -0
  264. package/dist/pine-core/p-02857936.entry.js +1 -0
  265. package/dist/pine-core/{p-5986f3c9.entry.js → p-04fe5da7.system.entry.js} +1 -1
  266. package/dist/pine-core/p-0de74105.entry.js +1 -0
  267. package/dist/pine-core/p-152245fa.system.entry.js +1 -0
  268. package/dist/pine-core/p-16c2aa63.entry.js +1 -0
  269. package/dist/pine-core/p-1b13f69c.system.entry.js +1 -0
  270. package/dist/pine-core/p-1cd0acf0.system.entry.js +1 -0
  271. package/dist/pine-core/p-1cf1fced.entry.js +1 -0
  272. package/dist/pine-core/p-1d75a9b1.system.entry.js +1 -0
  273. package/dist/pine-core/p-1e464117.entry.js +1 -0
  274. package/dist/pine-core/p-1ec4eeaf.system.entry.js +1 -0
  275. package/dist/pine-core/p-1f263c0b.system.entry.js +1 -0
  276. package/dist/pine-core/p-1f2e5958.entry.js +1 -0
  277. package/dist/pine-core/p-207c94da.entry.js +1 -0
  278. package/dist/pine-core/p-21115986.system.entry.js +1 -0
  279. package/dist/pine-core/p-22f041ee.system.entry.js +1 -0
  280. package/dist/pine-core/p-2357758d.system.entry.js +1 -0
  281. package/dist/pine-core/p-238e5171.system.entry.js +1 -0
  282. package/dist/pine-core/p-281efc69.entry.js +1 -0
  283. package/dist/pine-core/p-2ac9e90a.system.entry.js +1 -0
  284. package/dist/pine-core/p-2cb02706.entry.js +1 -0
  285. package/dist/pine-core/p-2f539379.system.entry.js +3 -0
  286. package/dist/pine-core/p-343546b1.system.entry.js +1 -0
  287. package/dist/pine-core/p-347ae53c.system.entry.js +1 -0
  288. package/dist/pine-core/p-34b575b6.entry.js +2 -0
  289. package/dist/pine-core/p-37d73369.system.entry.js +1 -0
  290. package/dist/pine-core/p-37d95be9.entry.js +1 -0
  291. package/dist/pine-core/p-3b1d8fae.entry.js +1 -0
  292. package/dist/pine-core/p-419f57c9.entry.js +1 -0
  293. package/dist/pine-core/p-4414d442.system.entry.js +1 -0
  294. package/dist/pine-core/p-45fcc5b7.entry.js +1 -0
  295. package/dist/pine-core/p-4c9cccdb.system.entry.js +8 -0
  296. package/dist/pine-core/p-4e05a4f0.entry.js +1 -0
  297. package/dist/pine-core/p-4e67e68e.entry.js +1 -0
  298. package/dist/pine-core/p-506d3e80.entry.js +1 -0
  299. package/dist/pine-core/p-5132b8a1.entry.js +1 -0
  300. package/dist/pine-core/p-51dff046.system.entry.js +1 -0
  301. package/dist/pine-core/p-539ef98c.entry.js +1 -0
  302. package/dist/pine-core/p-56576b6e.entry.js +1 -0
  303. package/dist/pine-core/p-5737182f.entry.js +1 -0
  304. package/dist/pine-core/p-585832b1.entry.js +1 -0
  305. package/dist/pine-core/p-59491f98.entry.js +1 -0
  306. package/dist/pine-core/p-5ac84b2f.entry.js +1 -0
  307. package/dist/pine-core/p-5b7f7760.entry.js +1 -0
  308. package/dist/pine-core/p-5bc670be.system.entry.js +1 -0
  309. package/dist/pine-core/p-5d014059.entry.js +1 -0
  310. package/dist/pine-core/p-5decd81f.entry.js +1 -0
  311. package/dist/pine-core/p-5e8d73d4.entry.js +1 -0
  312. package/dist/pine-core/p-622e91e3.entry.js +7 -0
  313. package/dist/pine-core/{p-d00c5b9c.system.entry.js → p-63119d23.entry.js} +1 -1
  314. package/dist/pine-core/p-63854c10.system.entry.js +1 -0
  315. package/dist/pine-core/p-650ccffb.entry.js +1 -0
  316. package/dist/pine-core/p-65e30a4c.entry.js +1 -0
  317. package/dist/pine-core/p-66cfef6d.system.entry.js +1 -0
  318. package/dist/pine-core/p-6d83ad2d.system.entry.js +1 -0
  319. package/dist/pine-core/p-70c6f0ed.system.entry.js +1 -0
  320. package/dist/pine-core/p-71e3a89e.system.entry.js +1 -0
  321. package/dist/pine-core/p-721297b5.system.entry.js +1 -0
  322. package/dist/pine-core/p-73bc6e9f.system.entry.js +1 -0
  323. package/dist/pine-core/p-798839f7.system.entry.js +1 -0
  324. package/dist/pine-core/p-7bbfb965.system.entry.js +1 -0
  325. package/dist/pine-core/p-7d01e719.entry.js +1 -0
  326. package/dist/pine-core/p-7e115d33.system.entry.js +1 -0
  327. package/dist/pine-core/p-8027db25.entry.js +1 -0
  328. package/dist/pine-core/p-834c678e.system.entry.js +1 -0
  329. package/dist/pine-core/p-87f91e02.system.entry.js +1 -0
  330. package/dist/pine-core/p-8b0fbeb3.entry.js +1 -0
  331. package/dist/pine-core/p-8b9d8fb5.system.entry.js +1 -0
  332. package/dist/pine-core/p-912487fa.entry.js +1 -0
  333. package/dist/pine-core/p-91f712f4.system.entry.js +1 -0
  334. package/dist/pine-core/p-93877d4a.entry.js +1 -0
  335. package/dist/pine-core/p-969488f5.system.entry.js +1 -0
  336. package/dist/pine-core/p-9835c74b.entry.js +1 -0
  337. package/dist/pine-core/p-99317375.system.entry.js +1 -0
  338. package/dist/pine-core/p-9a7ee7cb.system.entry.js +1 -0
  339. package/dist/pine-core/p-9b9f66b7.entry.js +1 -0
  340. package/dist/pine-core/p-9bcdfac2.entry.js +1 -0
  341. package/dist/pine-core/p-9d33bb05.entry.js +1 -0
  342. package/dist/pine-core/p-BJlg6wq7.system.js +2 -0
  343. package/dist/pine-core/p-BMFBF3sJ.system.js +1 -0
  344. package/dist/pine-core/p-Bkho_oFB.system.js +1 -0
  345. package/dist/pine-core/p-D2MUS7JO.js +1 -0
  346. package/dist/pine-core/p-D2yHYrxQ.system.js +1 -0
  347. package/dist/pine-core/p-DeIDZHrg.js +2 -0
  348. package/dist/pine-core/p-Dv7ssOTc.js +1 -0
  349. package/dist/pine-core/p-TyevV8iv.system.js +1 -0
  350. package/dist/pine-core/p-YQa3CeL9.system.js +1 -0
  351. package/dist/pine-core/p-a22091c4.system.entry.js +1 -0
  352. package/dist/pine-core/p-a6d09102.system.entry.js +1 -0
  353. package/dist/pine-core/p-a83a6618.system.entry.js +1 -0
  354. package/dist/pine-core/p-afd5e2d7.entry.js +1 -0
  355. package/dist/pine-core/p-b5838211.system.entry.js +1 -0
  356. package/dist/pine-core/p-ba1b79c7.system.entry.js +1 -0
  357. package/dist/pine-core/p-bd7da23e.system.entry.js +1 -0
  358. package/dist/pine-core/p-bde53290.system.entry.js +1 -0
  359. package/dist/pine-core/p-bdf68e53.system.entry.js +1 -0
  360. package/dist/pine-core/p-bef04e15.system.entry.js +1 -0
  361. package/dist/pine-core/p-bf1aea9f.system.entry.js +1 -0
  362. package/dist/pine-core/p-c00e46a5.system.entry.js +1 -0
  363. package/dist/pine-core/p-c8e89b61.system.entry.js +1 -0
  364. package/dist/pine-core/p-c9395f43.system.entry.js +1 -0
  365. package/dist/pine-core/p-d576e542.system.entry.js +1 -0
  366. package/dist/pine-core/p-d5dd5599.entry.js +1 -0
  367. package/dist/pine-core/p-d69cfaa4.entry.js +1 -0
  368. package/dist/pine-core/p-db4319fd.entry.js +1 -0
  369. package/dist/pine-core/p-dc81ffff.entry.js +1 -0
  370. package/dist/pine-core/p-e337f32c.system.entry.js +1 -0
  371. package/dist/pine-core/p-e46f7541.system.entry.js +1 -0
  372. package/dist/pine-core/p-e7ba30dd.system.entry.js +1 -0
  373. package/dist/pine-core/p-ed3dd3d2.entry.js +1 -0
  374. package/dist/pine-core/p-eee4f146.entry.js +1 -0
  375. package/dist/pine-core/p-f01e35e2.entry.js +1 -0
  376. package/dist/pine-core/p-f06ca8df.entry.js +1 -0
  377. package/dist/pine-core/p-f2e0da9a.entry.js +1 -0
  378. package/dist/pine-core/p-f30d6192.system.entry.js +1 -0
  379. package/dist/pine-core/p-fbea5703.entry.js +1 -0
  380. package/dist/pine-core/p-fc6ac917.entry.js +1 -0
  381. package/dist/pine-core/p-ffe276ef.entry.js +1 -0
  382. package/dist/pine-core/p-t3idJwV0.js +1 -0
  383. package/dist/pine-core/pine-core.esm.js +1 -1
  384. package/dist/pine-core/pine-core.js +1 -1
  385. package/dist/types/components/pds-avatar/pds-avatar.d.ts +3 -0
  386. package/dist/types/components/pds-box/pds-box.d.ts +7 -0
  387. package/dist/types/components/pds-checkbox/pds-checkbox.d.ts +2 -0
  388. package/dist/types/components/pds-chip/pds-chip.d.ts +2 -0
  389. package/dist/types/components/pds-combobox/pds-combobox.d.ts +5 -0
  390. package/dist/types/components/pds-copytext/pds-copytext.d.ts +3 -0
  391. package/dist/types/components/pds-drawer/pds-drawer-content/pds-drawer-content.d.ts +1 -0
  392. package/dist/types/components/pds-drawer/pds-drawer-footer/pds-drawer-footer.d.ts +3 -0
  393. package/dist/types/components/pds-drawer/pds-drawer-header/pds-drawer-header.d.ts +3 -0
  394. package/dist/types/components/pds-drawer/pds-drawer.d.ts +1 -0
  395. package/dist/types/components/pds-dropdown-menu/pds-dropdown-menu.d.ts +4 -0
  396. package/dist/types/components/pds-loader/pds-loader.d.ts +5 -0
  397. package/dist/types/components/pds-modal/pds-modal-content/pds-modal-content.d.ts +3 -0
  398. package/dist/types/components/pds-modal/pds-modal-footer/pds-modal-footer.d.ts +3 -0
  399. package/dist/types/components/pds-modal/pds-modal-header/pds-modal-header.d.ts +3 -0
  400. package/dist/types/components/pds-modal/pds-modal.d.ts +9 -1
  401. package/dist/types/components/pds-popover/pds-popover.d.ts +15 -0
  402. package/dist/types/components/pds-progress/pds-progress.d.ts +4 -0
  403. package/dist/types/components/pds-radio/pds-radio.d.ts +3 -0
  404. package/dist/types/components/pds-radio-group/pds-radio-group.d.ts +1 -0
  405. package/dist/types/components/pds-row/pds-row.d.ts +7 -0
  406. package/dist/types/components/pds-select/pds-select.d.ts +2 -0
  407. package/dist/types/components/pds-sortable/pds-sortable-item/pds-sortable-item.d.ts +4 -0
  408. package/dist/types/components/pds-sortable/pds-sortable.d.ts +6 -0
  409. package/dist/types/components/pds-switch/pds-switch.d.ts +2 -0
  410. package/dist/types/components/pds-tabs/pds-tab/pds-tab.d.ts +3 -0
  411. package/dist/types/components/pds-tabs/pds-tabpanel/pds-tabpanel.d.ts +3 -0
  412. package/dist/types/components/pds-tabs/pds-tabs.d.ts +3 -0
  413. package/dist/types/components/pds-tooltip/pds-tooltip.d.ts +1 -0
  414. package/dist/types/components.d.ts +199 -0
  415. package/dist/types/global/pine-global.d.ts +2 -0
  416. package/dist/types/index.d.ts +1 -0
  417. package/dist/types/utils/attributes.d.ts +34 -0
  418. package/dist/types/utils/keep-hydrated.d.ts +29 -0
  419. package/dist/types/utils/reflected-attribute-default.d.ts +31 -0
  420. package/dist/types/utils/test/host-strip.d.ts +10 -0
  421. package/dist/vscode.html-data.json +7 -0
  422. package/hydrate/index.js +778 -202
  423. package/hydrate/index.mjs +778 -202
  424. package/package.json +2 -2
  425. package/dist/cjs/attributes-oNMnBEnP.js +0 -85
  426. package/dist/esm/attributes-C0M1gTKv.js +0 -82
  427. package/dist/esm-es5/attributes-C0M1gTKv.js +0 -1
  428. package/dist/pine-core/p-015d2ceb.entry.js +0 -1
  429. package/dist/pine-core/p-02a428af.system.entry.js +0 -1
  430. package/dist/pine-core/p-06534502.entry.js +0 -1
  431. package/dist/pine-core/p-0827c6a6.entry.js +0 -1
  432. package/dist/pine-core/p-085c92aa.system.entry.js +0 -1
  433. package/dist/pine-core/p-0af4685d.entry.js +0 -1
  434. package/dist/pine-core/p-0bfe152a.entry.js +0 -1
  435. package/dist/pine-core/p-0ce3bcf2.system.entry.js +0 -1
  436. package/dist/pine-core/p-1747c005.system.entry.js +0 -1
  437. package/dist/pine-core/p-1dd395d8.system.entry.js +0 -1
  438. package/dist/pine-core/p-2126b4e4.system.entry.js +0 -1
  439. package/dist/pine-core/p-23044953.system.entry.js +0 -1
  440. package/dist/pine-core/p-26d8c4f7.system.entry.js +0 -1
  441. package/dist/pine-core/p-28abc253.system.entry.js +0 -1
  442. package/dist/pine-core/p-2a00844f.entry.js +0 -1
  443. package/dist/pine-core/p-3653fd52.system.entry.js +0 -1
  444. package/dist/pine-core/p-3add97f7.system.entry.js +0 -1
  445. package/dist/pine-core/p-40928521.system.entry.js +0 -1
  446. package/dist/pine-core/p-40ebfe59.system.entry.js +0 -1
  447. package/dist/pine-core/p-468f0dab.system.entry.js +0 -1
  448. package/dist/pine-core/p-478e69d1.entry.js +0 -1
  449. package/dist/pine-core/p-495f791c.entry.js +0 -1
  450. package/dist/pine-core/p-4a43fbd9.entry.js +0 -1
  451. package/dist/pine-core/p-4d3f5098.system.entry.js +0 -1
  452. package/dist/pine-core/p-517e04f6.entry.js +0 -1
  453. package/dist/pine-core/p-517f9962.entry.js +0 -1
  454. package/dist/pine-core/p-563ba784.entry.js +0 -1
  455. package/dist/pine-core/p-569b07ed.system.entry.js +0 -1
  456. package/dist/pine-core/p-5bf397ca.entry.js +0 -1
  457. package/dist/pine-core/p-5c7c2ffa.entry.js +0 -1
  458. package/dist/pine-core/p-5e9396e2.system.entry.js +0 -1
  459. package/dist/pine-core/p-600be0e1.entry.js +0 -1
  460. package/dist/pine-core/p-601b646c.system.entry.js +0 -1
  461. package/dist/pine-core/p-60393d52.entry.js +0 -1
  462. package/dist/pine-core/p-60a15bf7.system.entry.js +0 -1
  463. package/dist/pine-core/p-60e687ac.entry.js +0 -1
  464. package/dist/pine-core/p-61ae5a4b.system.entry.js +0 -1
  465. package/dist/pine-core/p-62045f88.system.entry.js +0 -1
  466. package/dist/pine-core/p-62241978.entry.js +0 -1
  467. package/dist/pine-core/p-62974869.entry.js +0 -1
  468. package/dist/pine-core/p-63422f56.entry.js +0 -2
  469. package/dist/pine-core/p-63930a06.system.entry.js +0 -1
  470. package/dist/pine-core/p-6516adf7.system.entry.js +0 -1
  471. package/dist/pine-core/p-67227922.entry.js +0 -1
  472. package/dist/pine-core/p-686b526d.entry.js +0 -1
  473. package/dist/pine-core/p-69f60432.system.entry.js +0 -1
  474. package/dist/pine-core/p-6aaf945c.entry.js +0 -1
  475. package/dist/pine-core/p-6b25f349.system.entry.js +0 -1
  476. package/dist/pine-core/p-6eb2070a.entry.js +0 -1
  477. package/dist/pine-core/p-715b8e6b.entry.js +0 -1
  478. package/dist/pine-core/p-74b1b841.entry.js +0 -1
  479. package/dist/pine-core/p-7608e9b2.entry.js +0 -1
  480. package/dist/pine-core/p-773f5771.system.entry.js +0 -1
  481. package/dist/pine-core/p-77961987.system.entry.js +0 -1
  482. package/dist/pine-core/p-77e12080.system.entry.js +0 -1
  483. package/dist/pine-core/p-7a177548.system.entry.js +0 -1
  484. package/dist/pine-core/p-7fbb7037.entry.js +0 -1
  485. package/dist/pine-core/p-806f17de.system.entry.js +0 -1
  486. package/dist/pine-core/p-832cedb7.entry.js +0 -1
  487. package/dist/pine-core/p-847e5f00.system.entry.js +0 -1
  488. package/dist/pine-core/p-85981c5d.system.entry.js +0 -1
  489. package/dist/pine-core/p-86978a51.entry.js +0 -1
  490. package/dist/pine-core/p-871894e1.entry.js +0 -1
  491. package/dist/pine-core/p-893b02b7.entry.js +0 -1
  492. package/dist/pine-core/p-8961d112.system.entry.js +0 -3
  493. package/dist/pine-core/p-8d42f505.entry.js +0 -1
  494. package/dist/pine-core/p-9452adc4.entry.js +0 -1
  495. package/dist/pine-core/p-977db8b2.entry.js +0 -1
  496. package/dist/pine-core/p-9903eb37.system.entry.js +0 -1
  497. package/dist/pine-core/p-9b18314c.entry.js +0 -1
  498. package/dist/pine-core/p-9b262a9d.entry.js +0 -1
  499. package/dist/pine-core/p-9dbb8fe9.entry.js +0 -1
  500. package/dist/pine-core/p-BhQhw0S3.system.js +0 -1
  501. package/dist/pine-core/p-C0M1gTKv.js +0 -1
  502. package/dist/pine-core/p-CrXTJmBd.system.js +0 -2
  503. package/dist/pine-core/p-DO9XKAkv.system.js +0 -1
  504. package/dist/pine-core/p-G3CPPJEt.system.js +0 -1
  505. package/dist/pine-core/p-a44316ad.entry.js +0 -1
  506. package/dist/pine-core/p-ae125139.entry.js +0 -1
  507. package/dist/pine-core/p-af9bce53.entry.js +0 -1
  508. package/dist/pine-core/p-b2901e60.system.entry.js +0 -1
  509. package/dist/pine-core/p-b412473d.system.entry.js +0 -8
  510. package/dist/pine-core/p-b51cfa3b.entry.js +0 -1
  511. package/dist/pine-core/p-b62e08c2.system.entry.js +0 -1
  512. package/dist/pine-core/p-b802776b.system.entry.js +0 -1
  513. package/dist/pine-core/p-b823bde2.system.entry.js +0 -1
  514. package/dist/pine-core/p-b82a0693.entry.js +0 -1
  515. package/dist/pine-core/p-b852c82b.system.entry.js +0 -1
  516. package/dist/pine-core/p-b979105e.entry.js +0 -1
  517. package/dist/pine-core/p-bLhIfh0N.js +0 -2
  518. package/dist/pine-core/p-bb9d158c.system.entry.js +0 -1
  519. package/dist/pine-core/p-bd1bdb07.system.entry.js +0 -1
  520. package/dist/pine-core/p-c53e560a.system.entry.js +0 -1
  521. package/dist/pine-core/p-c5c46b65.entry.js +0 -1
  522. package/dist/pine-core/p-cbae27a4.system.entry.js +0 -1
  523. package/dist/pine-core/p-cd7deae5.entry.js +0 -1
  524. package/dist/pine-core/p-cd86ee3e.system.entry.js +0 -1
  525. package/dist/pine-core/p-cf5a484e.system.entry.js +0 -1
  526. package/dist/pine-core/p-cf99f7d8.system.entry.js +0 -1
  527. package/dist/pine-core/p-cff7013e.system.entry.js +0 -1
  528. package/dist/pine-core/p-d11e4956.entry.js +0 -1
  529. package/dist/pine-core/p-da7a7cca.entry.js +0 -1
  530. package/dist/pine-core/p-daaf653f.system.entry.js +0 -1
  531. package/dist/pine-core/p-de740b3e.system.entry.js +0 -1
  532. package/dist/pine-core/p-e1d541f7.entry.js +0 -1
  533. package/dist/pine-core/p-ea0e5253.entry.js +0 -7
  534. package/dist/pine-core/p-ea9468fb.entry.js +0 -1
  535. package/dist/pine-core/p-f22abb4d.system.entry.js +0 -1
  536. package/dist/pine-core/p-f2560935.entry.js +0 -1
  537. package/dist/pine-core/p-f279f435.system.entry.js +0 -1
  538. package/dist/pine-core/p-f5677949.system.entry.js +0 -1
  539. package/dist/pine-core/p-f6943cbf.entry.js +0 -1
  540. package/dist/pine-core/p-f794f7ad.entry.js +0 -1
  541. package/dist/pine-core/p-fe09b6fb.system.entry.js +0 -1
@@ -1,4 +1,5 @@
1
1
  import { Host, h } from "@stencil/core";
2
+ import { HostStylingKeeper } from "../../utils/attributes";
2
3
  import { assignDescription, isSpecTest, messageId, exposeTypeProperty } from "../../utils/form";
3
4
  import { danger, enlarge } from "@pine-ds/icons/icons";
4
5
  /**
@@ -7,6 +8,7 @@ import { danger, enlarge } from "@pine-ds/icons/icons";
7
8
  export class PdsSelect {
8
9
  constructor() {
9
10
  this._type = 'select-one';
11
+ this.hostKeeper = new HostStylingKeeper();
10
12
  /**
11
13
  * Indicates whether or not the select field is disabled.
12
14
  * @defaultValue false
@@ -88,6 +90,7 @@ export class PdsSelect {
88
90
  this._type = this.multiple ? 'select-multiple' : 'select-one';
89
91
  }
90
92
  connectedCallback() {
93
+ this.hostKeeper.connect(this.el);
91
94
  // Initialize ElementInternals for form association (only once per element instance)
92
95
  if (this.el.attachInternals && !this.internals) {
93
96
  this.internals = this.el.attachInternals();
@@ -95,6 +98,9 @@ export class PdsSelect {
95
98
  // Expose type property on the element instance to match native form element behavior
96
99
  exposeTypeProperty(this.el, () => this._type);
97
100
  }
101
+ disconnectedCallback() {
102
+ this.hostKeeper.disconnect();
103
+ }
98
104
  componentWillLoad() {
99
105
  // Set initial type based on multiple prop
100
106
  this.updateType();
@@ -228,7 +234,13 @@ export class PdsSelect {
228
234
  }
229
235
  render() {
230
236
  const hasAction = this.el.querySelector('[slot="action"]') !== null;
231
- return (h(Host, { key: '89ba8f5f06b2a1bf82a495992efcb8490021e19f', "aria-disabled": this.disabled ? 'true' : null, class: this.classNames(), "has-action": hasAction && !this.hideLabel ? 'true' : null }, h("div", { key: '009dd8fe960889fd85a6cbe3239d94f81eddc9bb', class: "pds-select" }, !this.hideLabel && (h("div", { key: 'e198c3dcd664da65c0356b7eb7f9b4dff8c27035', class: "pds-select__label-wrapper" }, h("label", { key: '914b278a8e154b17365ffadcfe655139d3bef915', htmlFor: this.componentId }, h("span", { key: '6cd42f182ae8c585364a781044b8fd2fa3d61304', class: this.hideLabel ? 'visually-hidden' : '' }, this.label)), hasAction && this.renderAction())), h("select", { key: '7a3a91336f938ffb13a1e7ea1632090c37b5ad78', "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-label": this.hideLabel ? this.label : undefined, autocomplete: this.autocomplete || undefined, class: "pds-select__field", disabled: this.disabled, id: this.componentId, multiple: this.multiple, name: this.name, onBlur: this.onBlur, onChange: this.onSelectUpdate, onFocus: this.onFocus, onKeyDown: this.onKeyDown, part: "select", required: this.required, ref: (el) => (this.selectEl = el) }), h("div", { key: 'd3ddc61e4458e5ec0af1e700e69355d1cabaa651', "aria-hidden": "true", class: "hidden", ref: (el) => (this.slotContainer = el) }, h("slot", { key: 'dae8f36dd59e84f502500a24fec97a6fad305167', onSlotchange: this.handleSlotChange })), this.renderMessages(), !this.multiple && h("pds-icon", { key: '66fd7ed9fd065b6aff73df75234fa9534c828b6f', "aria-hidden": "true", class: "pds-select__select-icon", icon: enlarge }))));
237
+ const hostClass = this.classNames();
238
+ const hostAttributes = {
239
+ 'aria-disabled': this.disabled ? 'true' : null,
240
+ 'has-action': hasAction && !this.hideLabel ? 'true' : null,
241
+ };
242
+ this.hostKeeper.record(hostClass, {}, hostAttributes);
243
+ return (h(Host, Object.assign({ key: 'c99bfc000ad351298e154554a8b22635b1abb718', class: hostClass }, hostAttributes), h("div", { key: '35374b150cbef745c6a6068ba5a2fde0803c0314', class: "pds-select" }, !this.hideLabel && (h("div", { key: 'a3b9bae451c5c384606790a29bf8ab5fc70427c0', class: "pds-select__label-wrapper" }, h("label", { key: '80d7740a05a6d3cce6d51224169eb6c2501c4896', htmlFor: this.componentId }, h("span", { key: 'a51c02d7c84f75bb168889dab50cae807271c63d', class: this.hideLabel ? 'visually-hidden' : '' }, this.label)), hasAction && this.renderAction())), h("select", { key: '11444dad795bd02c008252a60e701125861e4af0', "aria-describedby": assignDescription(this.componentId, this.isInvalid(), this.helperMessage, this.errorMessage), "aria-invalid": this.isInvalid() ? 'true' : undefined, "aria-label": this.hideLabel ? this.label : undefined, autocomplete: this.autocomplete || undefined, class: "pds-select__field", disabled: this.disabled, id: this.componentId, multiple: this.multiple, name: this.name, onBlur: this.onBlur, onChange: this.onSelectUpdate, onFocus: this.onFocus, onKeyDown: this.onKeyDown, part: "select", required: this.required, ref: (el) => (this.selectEl = el) }), h("div", { key: 'ce54fa1df287d96a7503bb19cd2ba6c74a6da638', "aria-hidden": "true", class: "hidden", ref: (el) => (this.slotContainer = el) }, h("slot", { key: '22c55e78999076a37d43fb708dabc7379dd4cee3', onSlotchange: this.handleSlotChange })), this.renderMessages(), !this.multiple && h("pds-icon", { key: '45628074fbcdb259b8bba42299082423309a6968', "aria-hidden": "true", class: "pds-select__select-icon", icon: enlarge }))));
232
244
  }
233
245
  static get is() { return "pds-select"; }
234
246
  static get encapsulation() { return "shadow"; }
@@ -1,10 +1,13 @@
1
1
  import { Host, h } from "@stencil/core";
2
+ import { HostStylingKeeper } from "../../../utils/attributes";
2
3
  import { handle as handleIcon } from "@pine-ds/icons/icons";
3
4
  /**
4
5
  * @slot sortable-item-actions - Content is placed within the `pds-sortable-item__actions` element as children. This slot is only rendered if `actions` is set to `true`.
6
+ * @lightDom renders-markup
5
7
  */
6
8
  export class PdsSortableItem {
7
9
  constructor() {
10
+ this.hostKeeper = new HostStylingKeeper();
8
11
  /**
9
12
  * Determines whether `sortable-item-actions` slot should be enabled.
10
13
  * @defaultValue false
@@ -16,6 +19,12 @@ export class PdsSortableItem {
16
19
  */
17
20
  this.showHandle = false;
18
21
  }
22
+ connectedCallback() {
23
+ this.hostKeeper.connect(this.el);
24
+ }
25
+ disconnectedCallback() {
26
+ this.hostKeeper.disconnect();
27
+ }
19
28
  // Discards stale handle/actions siblings left by a page-cache (Turbo, bfcache) reconnect; the fresh handle is always first, the fresh actions wrapper always last.
20
29
  componentDidRender() {
21
30
  const handles = Array.from(this.el.children).filter((child) => child.matches('.pds-sortable-item__handle'));
@@ -38,7 +47,8 @@ export class PdsSortableItem {
38
47
  }
39
48
  }
40
49
  render() {
41
- return (h(Host, { key: 'a401963153e64b33f47f8897f2e8a157557d625e', class: "pds-sortable-item", id: this.componentId }, this.showHandle && (h("div", { key: 'e93df2aea5fcad497bd64f54b09a3e700141dfa6', class: "pds-sortable-item__handle" }, h("pds-icon", { key: '9454196233b1c12a232815a2a14f05e41721a152', "aria-hidden": "true", icon: handleIcon }))), h("slot", { key: 'da456ae383e8fe7dd9375eada035bee755cdd684' }), this.enableActions && (h("div", { key: 'bed7efa1c242e59b547e5e09018b1aacb1c1b172', class: "pds-sortable-item__actions" }, h("slot", { key: 'c4563d2a50c3bb55108527ae1f0a68a84d5749a7', name: "sortable-item-actions" })))));
50
+ this.hostKeeper.record('pds-sortable-item');
51
+ return (h(Host, { key: '3f9098a7c938bfa6443f08fb8b0a7c7217230890', class: "pds-sortable-item", id: this.componentId }, this.showHandle && (h("div", { key: '77718a6867ddd8bc029bb3ef995f6ee9a5999ce7', class: "pds-sortable-item__handle" }, h("pds-icon", { key: 'aad7f46e776ece85858798f8f1a1a50c9022b84f', "aria-hidden": "true", icon: handleIcon }))), h("slot", { key: 'afa9346ec8fd7aa6132a15dd44d3b1cae24500b9' }), this.enableActions && (h("div", { key: 'c28c85391117542999c12d673879768394002c90', class: "pds-sortable-item__actions" }, h("slot", { key: '88ab53f3ba4ed47715e31935b861d9ab42342b32', name: "sortable-item-actions" })))));
42
52
  }
43
53
  static get is() { return "pds-sortable-item"; }
44
54
  static get encapsulation() { return "scoped"; }
@@ -1,5 +1,9 @@
1
1
  import { Host, h } from "@stencil/core";
2
+ import { HostStylingKeeper } from "../../utils/attributes";
2
3
  import Sortable from "sortablejs";
4
+ /**
5
+ * @lightDom host-only
6
+ */
3
7
  export class PdsSortable {
4
8
  constructor() {
5
9
  /**
@@ -20,6 +24,7 @@ export class PdsSortable {
20
24
  * Determines the grabbable area for the `pds-sortable-item`.
21
25
  */
22
26
  this.handleType = 'row';
27
+ this.hostKeeper = new HostStylingKeeper();
23
28
  }
24
29
  handleDisabledChange() {
25
30
  var _a;
@@ -41,6 +46,12 @@ export class PdsSortable {
41
46
  }
42
47
  return classNames.join(' ');
43
48
  }
49
+ connectedCallback() {
50
+ this.hostKeeper.connect(this.el);
51
+ }
52
+ disconnectedCallback() {
53
+ this.hostKeeper.disconnect();
54
+ }
44
55
  componentDidLoad() {
45
56
  let sortableOptions = {
46
57
  animation: 150,
@@ -57,7 +68,9 @@ export class PdsSortable {
57
68
  this.sortableInstance = Sortable.create(this.el, sortableOptions);
58
69
  }
59
70
  render() {
60
- return (h(Host, { key: '6ff85345305337587c3d06b6f6c333125707efe8', class: this.classNames(), id: this.componentId }, h("slot", { key: 'e25c441574cc8b59bb1865a69af8691ce37ff341' })));
71
+ const classNames = this.classNames();
72
+ this.hostKeeper.record(classNames);
73
+ return (h(Host, { key: 'fb6e9a79babf01980c04ee7208d195510493a7dc', class: classNames, id: this.componentId }, h("slot", { key: '5735ca3af531a736f07d1fafde8ae544d00a75bb' })));
61
74
  }
62
75
  static get is() { return "pds-sortable"; }
63
76
  static get encapsulation() { return "scoped"; }
@@ -1,7 +1,7 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import { assignDescription, isSpecTest, messageId, exposeTypeProperty } from "../../utils/form";
3
3
  import { danger } from "@pine-ds/icons/icons";
4
- import { inheritAriaAttributes } from "../../utils/attributes";
4
+ import { inheritAriaAttributes, HostStylingKeeper } from "../../utils/attributes";
5
5
  /**
6
6
  * @slot label - Content displayed as the switch label in place of the `label` text. Clicking it toggles the switch.
7
7
  */
@@ -9,6 +9,7 @@ export class PdsSwitch {
9
9
  constructor() {
10
10
  this.inheritedAttributes = {};
11
11
  this._type = 'checkbox';
12
+ this.hostKeeper = new HostStylingKeeper();
12
13
  this.hasLabelSlot = false;
13
14
  /**
14
15
  * Determines the input 'checked' state.
@@ -52,6 +53,7 @@ export class PdsSwitch {
52
53
  };
53
54
  }
54
55
  connectedCallback() {
56
+ this.hostKeeper.connect(this.el);
55
57
  // Initialize ElementInternals for form association (only once per element instance)
56
58
  if (this.el.attachInternals && !this.internals) {
57
59
  this.internals = this.el.attachInternals();
@@ -59,6 +61,9 @@ export class PdsSwitch {
59
61
  // Expose type property on the element instance to match native form element behavior
60
62
  exposeTypeProperty(this.el, () => this._type);
61
63
  }
64
+ disconnectedCallback() {
65
+ this.hostKeeper.disconnect();
66
+ }
62
67
  componentDidLoad() {
63
68
  this.updateFormValue();
64
69
  }
@@ -93,9 +98,12 @@ export class PdsSwitch {
93
98
  this.updateHasLabelSlot();
94
99
  }
95
100
  render() {
96
- return (h(Host, { key: 'b04295a8cc5acec33c5c6461516e9ec57ff9c396', class: this.switchClassNames(), "aria-disabled": this.disabled ? 'true' : null }, h("label", { key: 'f052e2409b0d7603598fd59bcdd382d6091cd794', htmlFor: this.componentId }, h("input", Object.assign({ key: 'd61df3ac3762af2dcc27a8800f7317ac03994ea3', "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage, this.errorMessage), "aria-invalid": this.invalid ? "true" : undefined, checked: this.checked, class: "pds-switch__input", disabled: this.disabled, id: this.componentId, name: this.name ? this.name : this.componentId, onChange: this.onSwitchUpdate, required: this.required, type: "checkbox", value: this.value }, this.inheritedAttributes)), h("span", { key: '0f921ea88d5706c364b1d8e4e05afac95be9f092', class: this.hideLabel ? 'visually-hidden' : '' }, h("slot", { key: '10f20c7f761635be8d90580be85fd7d62e2968f3', name: "label", onSlotchange: this.updateHasLabelSlot }), !this.hasLabelSlot && this.label)), this.helperMessage &&
97
- h("div", { key: '97a0281aa88b9208128fa169740cc710beed5538', class: `pds-switch__message`, id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
98
- h("div", { key: '26dd988675278031577df77560557484a8187cd5', class: `pds-switch__message pds-switch__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: 'ed674224e564f330ea797d0b4196442ad372ae99', icon: danger, size: "small" }), this.errorMessage)));
101
+ const hostClass = this.switchClassNames();
102
+ const ariaDisabled = this.disabled ? 'true' : null;
103
+ this.hostKeeper.record(hostClass, {}, { 'aria-disabled': ariaDisabled });
104
+ return (h(Host, { key: '6d4b51307f2619a99981e344f782f69871aabf0f', class: hostClass, "aria-disabled": ariaDisabled }, h("label", { key: '068ef3759e2bc3d9870cff36714de0e9cf558b2b', htmlFor: this.componentId }, h("input", Object.assign({ key: 'aa28fb67332bb2d81c09b6c749c1cb0f079e327f', "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage, this.errorMessage), "aria-invalid": this.invalid ? "true" : undefined, checked: this.checked, class: "pds-switch__input", disabled: this.disabled, id: this.componentId, name: this.name ? this.name : this.componentId, onChange: this.onSwitchUpdate, required: this.required, type: "checkbox", value: this.value }, this.inheritedAttributes)), h("span", { key: 'd237980a9ce2abc04d57085df022f28dfa2768e4', class: this.hideLabel ? 'visually-hidden' : '' }, h("slot", { key: '83d0e2110cfdcd3208319302af237178dfd419a4', name: "label", onSlotchange: this.updateHasLabelSlot }), !this.hasLabelSlot && this.label)), this.helperMessage &&
105
+ h("div", { key: '137d9e5626b34ade33f68c4c24c3dcb154500dc6', class: `pds-switch__message`, id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
106
+ h("div", { key: '64c3b8884d0568e26953f67a95d045aa5731c41f', class: `pds-switch__message pds-switch__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: 'f99f8045eb33d0c60518f3b4c6a0183170a50f4a', icon: danger, size: "small" }), this.errorMessage)));
99
107
  }
100
108
  static get is() { return "pds-switch"; }
101
109
  static get encapsulation() { return "shadow"; }
@@ -1,5 +1,8 @@
1
1
  import { Fragment, Host, h } from "@stencil/core";
2
2
  import { unwrapReconnectedContent } from "../../../utils/reconnected-content";
3
+ /**
4
+ * @lightDom renders-markup
5
+ */
3
6
  export class PdsTab {
4
7
  constructor() {
5
8
  /**
@@ -1,5 +1,8 @@
1
1
  import { Host, h } from "@stencil/core";
2
2
  import { unwrapReconnectedContent } from "../../../utils/reconnected-content";
3
+ /**
4
+ * @lightDom renders-markup
5
+ */
3
6
  export class PdsTabpanel {
4
7
  constructor() {
5
8
  /**
@@ -18,7 +21,7 @@ export class PdsTabpanel {
18
21
  unwrapReconnectedContent(this.el.querySelector('.pds-tabpanel'), '.pds-tabpanel');
19
22
  }
20
23
  render() {
21
- return (h(Host, { key: 'cce5229aaa694a4eeb30ceacb7edbb7b03f7e24a', slot: "tabpanels", class: this.stretch && this.selected ? "pds-tabpanel--stretch-active" : undefined }, h("div", { key: '614187ea6676c80d94acd9aef7c8e10137fb6179', role: "tabpanel", id: this.parentComponentId + "__" + this.name + '-panel', tabindex: "0", "aria-labelledby": this.parentComponentId + "__" + this.name, class: this.selected ? "pds-tabpanel is-active" : "pds-tabpanel" }, h("slot", { key: '368f81238023d647d42b3c1f6dc14795245bbc87' }))));
24
+ return (h(Host, { key: '87b00d828c9cddbcccd5d6e89dab7541a3c5c839', slot: "tabpanels", class: this.stretch && this.selected ? "pds-tabpanel--stretch-active" : undefined }, h("div", { key: 'd7058a727d010351c73b5287f45991d48ef71151', role: "tabpanel", id: this.parentComponentId + "__" + this.name + '-panel', tabindex: "0", "aria-labelledby": this.parentComponentId + "__" + this.name, class: this.selected ? "pds-tabpanel is-active" : "pds-tabpanel" }, h("slot", { key: '97861fcd8432206a1115135fad919d75dc327112' }))));
22
25
  }
23
26
  static get is() { return "pds-tabpanel"; }
24
27
  static get originalStyleUrls() {
@@ -1,4 +1,5 @@
1
1
  import { Host, h } from "@stencil/core";
2
+ import { HostStylingKeeper } from "../../utils/attributes";
2
3
  /**
3
4
  * @slot tabs - Content is placed within the `div[role="tablist"]` element as children
4
5
  * @slot tabpanels - Content is placed directly after the `div[role="tablist"]` element as siblings
@@ -6,6 +7,7 @@ import { Host, h } from "@stencil/core";
6
7
  */
7
8
  export class PdsTabs {
8
9
  constructor() {
10
+ this.hostKeeper = new HostStylingKeeper();
9
11
  /**
10
12
  * Adds a divider rule beneath the tab list.
11
13
  * @defaultValue false
@@ -26,6 +28,12 @@ export class PdsTabs {
26
28
  */
27
29
  this.nav = false;
28
30
  }
31
+ connectedCallback() {
32
+ this.hostKeeper.connect(this.el);
33
+ }
34
+ disconnectedCallback() {
35
+ this.hostKeeper.disconnect();
36
+ }
29
37
  tabClickHandler(event) {
30
38
  if (this.componentId === event.detail[1]) {
31
39
  this.activeTabIndex = event.detail[0];
@@ -160,7 +168,11 @@ export class PdsTabs {
160
168
  // Navigation mode: a <nav> landmark of links (aria-current marks the current
161
169
  // page). Panel mode: the ARIA tablist of role=tab buttons over tabpanels.
162
170
  const tabList = this.isNav ? (h("nav", { class: "pds-tabs__tablist", "aria-label": this.tablistLabel || undefined, part: "tab-list" }, h("slot", { name: "tabs" }))) : (h("div", { class: "pds-tabs__tablist", role: "tablist", "aria-label": this.tablistLabel, part: "tab-list" }, h("slot", { name: "tabs" })));
163
- return (h(Host, { key: 'db689b695d53916eb40a7c6f4596a20925fd4b2e', "active-tab-name": this.activeTabName, class: this.classNames(), id: this.componentId }, tabList, h("slot", { key: 'd2e79967a75d4e2fc33bff5321c62cc89ac74491', name: "tabpanels" })));
171
+ const hostClass = this.classNames();
172
+ // Only the classes: `active-tab-name` backs the mutable activeTabName prop, so a morph that drops
173
+ // it is a prop change, not a strip.
174
+ this.hostKeeper.record(hostClass);
175
+ return (h(Host, { key: 'ea26bc4e4cadd4621511afa01ca2a353a053fd0e', "active-tab-name": this.activeTabName, class: hostClass, id: this.componentId }, tabList, h("slot", { key: '3f920708c647920af3d0d50f74b5409d30d70af8', name: "tabpanels" })));
164
176
  }
165
177
  static get is() { return "pds-tabs"; }
166
178
  static get encapsulation() { return "shadow"; }
@@ -3,6 +3,7 @@ import { autoUpdate, computePosition, flip, offset, shift, } from "@floating-ui/
3
3
  /**
4
4
  * @slot (default) - The tooltip's target element
5
5
  * @slot content - HTML content for the tooltip
6
+ * @lightDom renders-markup
6
7
  */
7
8
  export class PdsTooltip {
8
9
  constructor() {
@@ -342,9 +343,9 @@ export class PdsTooltip {
342
343
  }
343
344
  render() {
344
345
  const hostId = this.componentId || undefined;
345
- return (h(Host, { key: 'd63b6632a084fbaebd2004a569fb96e0fff91f41', id: hostId, class: { 'pds-tooltip--is-open': this.opened } }, h("span", { key: '79b8b9c2bb9fc2afaf8cbb06dbc102d18c060362', class: "pds-tooltip__trigger", onMouseEnter: this.handleShow, onMouseLeave: this.handleHide,
346
+ return (h(Host, { key: 'e80abb11248d9bf6aec1ae738c61692594975630', id: hostId, class: { 'pds-tooltip--is-open': this.opened } }, h("span", { key: '9ff484925a1792302eee230a5c37a0268d536935', class: "pds-tooltip__trigger", onMouseEnter: this.handleShow, onMouseLeave: this.handleHide,
346
347
  /* focusin/out bubble; ensure keyboard users see tooltips */
347
- onFocusin: this.handleShow, onFocusout: this.handleHide, ref: el => this.triggerEl = el }, h("slot", { key: '9e12d130ac5f392d966f442d91673c3864962b01' })), h("div", { key: '5b83f093b2cbb2b22af0c440278ee318c456087a', class: "pds-tooltip__content-slot-wrapper", hidden: true }, h("slot", { key: 'c0243ad0a833326e8daf799d41b1bf8048c6dee9', name: "content" }))));
348
+ onFocusin: this.handleShow, onFocusout: this.handleHide, ref: el => this.triggerEl = el }, h("slot", { key: '738c314a816e82fd81a0c0e9895d51af45b75eb2' })), h("div", { key: '5b0477cd433cae0b53c4d5ce5767dc703be28ee0', class: "pds-tooltip__content-slot-wrapper", hidden: true }, h("slot", { key: '51ad497357c1d1547bba69d07fd7fa1b675c021f', name: "content" }))));
348
349
  }
349
350
  static get is() { return "pds-tooltip"; }
350
351
  static get originalStyleUrls() {
@@ -0,0 +1,6 @@
1
+ import { keepPineHydrated } from "../utils/keep-hydrated";
2
+ // Stencil runs this when the loader loads, before any component is defined, and again for each
3
+ // server-rendered document, where it does nothing.
4
+ export default () => {
5
+ keepPineHydrated();
6
+ };
@@ -1,3 +1,4 @@
1
1
  export * from './components';
2
2
  export { TEXT_SIZES } from './utils/types';
3
+ export { keepPineHydrated } from './utils/keep-hydrated';
3
4
  import "@pine-ds/icons";
@@ -1,3 +1,71 @@
1
+ import { classNamesOf, isStencilClass } from "./keep-hydrated";
2
+ /**
3
+ * Sets each attribute whose current value differs, and leaves the rest alone. A `MutationObserver`
4
+ * that calls this to restore attributes sees its own writes once and then settles, so it can't loop.
5
+ * @param el - Element to write to
6
+ * @param attributes - Attribute names and the values they should have
7
+ */
8
+ export const setAttributesIfChanged = (el, attributes) => {
9
+ Object.entries(attributes).forEach(([name, value]) => {
10
+ if (el.getAttribute(name) !== value)
11
+ el.setAttribute(name, value);
12
+ });
13
+ };
14
+ /**
15
+ * Puts back any of `expected`'s classes or style properties that are missing from `el`. It only
16
+ * adds what's missing, never rewrites a value that's there, because browsers normalize some style
17
+ * values (`flex: 1` reads back as `1 1 0%`): comparing values would rewrite them forever.
18
+ * @param el - Host element
19
+ * @param expected - Classes and style properties the component rendered
20
+ */
21
+ export const restoreHostStyling = (el, { classes, styles }) => {
22
+ const missing = classes.filter((name) => !el.classList.contains(name));
23
+ if (missing.length > 0)
24
+ el.classList.add(...missing);
25
+ Object.entries(styles).forEach(([name, value]) => {
26
+ if (value && el.style.getPropertyValue(name) === '')
27
+ el.style.setProperty(name, value);
28
+ });
29
+ };
30
+ /**
31
+ * Watches a component's own host and puts back what it rendered when something strips it. A DOM
32
+ * morph does: it makes the host match the server's HTML, which carries the component's props but not
33
+ * the classes, styles and attributes it wrote, and Stencil won't write them again because it diffs
34
+ * against its previous render, not the live DOM.
35
+ *
36
+ * It also means a script that removes one of these on purpose sees it come back: change them through
37
+ * the component's props instead.
38
+ * @param el - Host element
39
+ * @param expected - Reads what the component last rendered
40
+ * @returns The observer, to disconnect when the component is removed; `null` without MutationObserver
41
+ */
42
+ const keepHostStyling = (el, expected) => {
43
+ if (typeof MutationObserver === 'undefined')
44
+ return null;
45
+ const observer = new MutationObserver((records) => {
46
+ const styling = expected();
47
+ // A strip takes Stencil's own classes too: without `hydrated` Stencil hides the component, and
48
+ // without its scope classes a scoped component's CSS stops matching. Put back only the ones that
49
+ // were there, so this never runs ahead of Stencil. `keepPineHydrated` does the same for every
50
+ // component, but the custom-elements build only runs it if the consumer calls it, so keep this.
51
+ const stencilClasses = records
52
+ .filter((record) => record.attributeName === 'class' && record.oldValue != null)
53
+ .flatMap((record) => classNamesOf(record.oldValue).filter((name) => isStencilClass(el, name)));
54
+ restoreHostStyling(el, Object.assign(Object.assign({}, styling), { classes: [...styling.classes, ...stencilClasses] }));
55
+ // An attribute the component still renders comes back with the value it had, which is what
56
+ // Stencil wrote (a boolean `true` lands as an empty value). One it stopped rendering stays
57
+ // removed, since that was Stencil's own write.
58
+ records.forEach(({ attributeName: name, oldValue }) => {
59
+ var _a;
60
+ const rendered = (_a = styling.attributes) === null || _a === void 0 ? void 0 : _a[name];
61
+ if (oldValue == null || rendered == null || rendered === false || el.hasAttribute(name))
62
+ return;
63
+ el.setAttribute(name, oldValue);
64
+ });
65
+ });
66
+ observer.observe(el, { attributes: true, attributeOldValue: true });
67
+ return observer;
68
+ };
1
69
  /**
2
70
  * Inherit attributes from the host element
3
71
  * @param el - Host element
@@ -81,3 +149,25 @@ export const inheritAriaAttributes = (el, ignoreList) => {
81
149
  }
82
150
  return inheritAttributes(el, attributesToInherit);
83
151
  };
152
+ /**
153
+ * One component's use of `keepHostStyling`: `record` what `render()` puts on the host, `connect` in
154
+ * `connectedCallback` and `disconnect` in `disconnectedCallback`.
155
+ */
156
+ export class HostStylingKeeper {
157
+ constructor() {
158
+ this.styling = { classes: [], styles: {} };
159
+ this.observer = null;
160
+ }
161
+ record(classes, styles = {}, attributes = {}) {
162
+ this.styling = { classes: classNamesOf(classes), styles, attributes };
163
+ }
164
+ connect(el) {
165
+ var _a;
166
+ (_a = this.observer) !== null && _a !== void 0 ? _a : (this.observer = keepHostStyling(el, () => this.styling));
167
+ }
168
+ disconnect() {
169
+ var _a;
170
+ (_a = this.observer) === null || _a === void 0 ? void 0 : _a.disconnect();
171
+ this.observer = null;
172
+ }
173
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Whether a class is one Stencil itself puts on a host: its default `hydratedFlag` (Pine doesn't
3
+ * change it), or a scoped component's own scope classes (`sc-pds-radio`, `sc-pds-radio-h`,
4
+ * `sc-pds-radio-s`), which its CSS needs. Only the host's own: another `sc-` class may be a
5
+ * consumer's (styled-components ids).
6
+ * @param el - Host element
7
+ * @param name - Class name
8
+ */
9
+ export const isStencilClass = (el, name) => {
10
+ const scope = `sc-${el.localName}`;
11
+ return name === 'hydrated' || name === scope || name === `${scope}-h` || name === `${scope}-s`;
12
+ };
13
+ /**
14
+ * The class names in a rendered `class` value: a string, or Stencil's `{ name: boolean }` form.
15
+ */
16
+ export const classNamesOf = (classes) => typeof classes === 'string'
17
+ ? classes.split(/\s+/).filter(Boolean)
18
+ : Object.keys(classes).filter((name) => classes[name]);
19
+ // On the global object, not in this module, so a page with two copies of Pine (the CDN build and a
20
+ // bundled `@pine-ds/react`) still has one observer.
21
+ const OBSERVER = Symbol.for('@pine-ds/core/keepPineHydrated');
22
+ /**
23
+ * Puts Stencil's own classes back on any Pine component that loses them. Stencil hides a component
24
+ * until it has `hydrated`, so a DOM morph that strips a host's `class` makes it vanish, and nothing
25
+ * rewrites it. One observer on the whole document covers every component, including the ones with no
26
+ * host restore of their own. It only restores classes the element had, so it never runs ahead of
27
+ * Stencil. It can't see inside shadow roots, which a morph doesn't reach either.
28
+ *
29
+ * A script that removes `hydrated` on purpose sees it come back, and one that removes it every time it
30
+ * appears never settles: don't strip Pine's classes from a `MutationObserver`.
31
+ *
32
+ * Pine's global script calls this, so the CDN and `dist` builds get it on load. The custom-elements
33
+ * build (`@pine-ds/core/components/*`, `@pine-ds/react`) has no global script: call it once yourself.
34
+ * Calling it again does nothing, and without `MutationObserver` (server rendering) neither does the
35
+ * first call.
36
+ */
37
+ export const keepPineHydrated = () => {
38
+ if (typeof MutationObserver === 'undefined' || typeof document === 'undefined')
39
+ return;
40
+ const store = globalThis;
41
+ if (store[OBSERVER])
42
+ return;
43
+ const observer = new MutationObserver((records) => {
44
+ records.forEach(({ target, oldValue }) => {
45
+ const el = target;
46
+ if (oldValue == null || !el.localName.startsWith('pds-'))
47
+ return;
48
+ const missing = classNamesOf(oldValue).filter((name) => isStencilClass(el, name) && !el.classList.contains(name));
49
+ if (missing.length > 0)
50
+ el.classList.add(...missing);
51
+ });
52
+ });
53
+ // The document rather than its root element, so replacing `<html>` doesn't end the watch.
54
+ observer.observe(document, {
55
+ subtree: true,
56
+ attributes: true,
57
+ attributeFilter: ['class'],
58
+ attributeOldValue: true,
59
+ });
60
+ store[OBSERVER] = observer;
61
+ };
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Restores a reflected prop's default when its attribute is removed.
3
+ *
4
+ * A reflected `@Prop` with a default writes that default onto the host as an
5
+ * attribute even when the author leaves it out. Removing the attribute doesn't
6
+ * restore the default: Stencil's `attributeChangedCallback` sets the prop to
7
+ * `null` (or `false` for a boolean), even when its default is `true`. A Turbo
8
+ * morph hits this whenever the author relied on the default, since the
9
+ * server's HTML never carries the attribute Pine wrote.
10
+ *
11
+ * A `null` or `undefined` falls back to the default, whether the attribute was
12
+ * removed or a consumer (or a framework clearing a prop) assigned it. Any other
13
+ * value is a real write and is kept, except a boolean's `false`: that's also
14
+ * what removing the attribute produces, so it's told apart by the host's actual
15
+ * attribute. Present, trust it; absent, fall back to the default.
16
+ *
17
+ * Falling back also writes the default back onto the host. Stencil won't: it
18
+ * diffs a reflected attribute against the previous render, not the live DOM,
19
+ * so when the removed attribute held the default (`'lg'` → `null` → `'lg'`)
20
+ * the values match and it skips the write. Left absent, the attribute would
21
+ * make a later `copytext.border = false` fall back to the default too.
22
+ *
23
+ * Wire up from a `@Watch` on the prop and reassign the prop to the result.
24
+ *
25
+ * `attr` is the HTML attribute name, not the prop name — pass the kebab-case
26
+ * form (e.g. `'is-loading'`) for a camelCase prop. They're the same string
27
+ * for every current caller (`size`, `variant`, `placement`, `border`), but
28
+ * `hasAttribute` would silently always return `false` for a multi-word prop
29
+ * if the prop name were passed instead.
30
+ */
31
+ export function restoreReflectedDefault(el, attr, value, defaultValue) {
32
+ // Only a boolean's `false` needs the attribute to tell a write from a removal. Checking it for
33
+ // other values would let a `null` write strip the attribute and reset every later write.
34
+ if (value != null && (value !== false || el.hasAttribute(attr)))
35
+ return value;
36
+ if (defaultValue !== false && defaultValue != null) {
37
+ el.setAttribute(attr, defaultValue === true ? '' : String(defaultValue));
38
+ }
39
+ return defaultValue;
40
+ }
@@ -0,0 +1,50 @@
1
+ // The browser-side code below is passed as strings, the same workaround `runAxe` uses: under Jest's
2
+ // coverage instrumentation, a function passed to `page.$eval` is serialized with injected `cov_*`
3
+ // counter calls that don't exist in the browser, which throws a `ReferenceError` there.
4
+ const inBrowser = (page, selector, body, args = null) => page.evaluate(`
5
+ (() => {
6
+ const el = document.querySelector(${JSON.stringify(selector)});
7
+ const args = ${JSON.stringify(args)};
8
+ ${body}
9
+ })()
10
+ `);
11
+ // Computed properties a host class, style or attribute tends to drive, for the host and everything
12
+ // it renders (its shadow tree, or its light DOM for a shadowless component).
13
+ const snapshotStyles = (page, selector) => inBrowser(page, selector, `
14
+ const nodes = [el, ...Array.from((el.shadowRoot || el).querySelectorAll('*'))];
15
+ return nodes.map((node) => {
16
+ const style = getComputedStyle(node);
17
+ // No sizes: text width shifts as web fonts load, and inner elements can be mid-animation. The
18
+ // class check covers what a size would have caught.
19
+ return [
20
+ style.display, style.visibility, style.opacity, style.position, style.clip, style.overflow, style.flexDirection, style.flex, style.minHeight, style.gap,
21
+ style.paddingTop, style.maxWidth, style.color, style.backgroundColor, style.fontWeight,
22
+ style.borderTopStyle, style.borderTopColor, style.borderTopWidth,
23
+ style.borderBottomStyle, style.borderBottomColor, style.borderBottomWidth,
24
+ style.animationName, style.cursor,
25
+ ].join(' | ');
26
+ });
27
+ `);
28
+ /**
29
+ * Strips the host's `class` (keeping a `consumer` class the markup must carry), its `style`, and any
30
+ * `removeAttributes`, as a DOM morph does when the server's HTML lacks what the component wrote.
31
+ * Expects every class and removed attribute to come back, and every computed style of the host and
32
+ * what it renders to be unchanged.
33
+ */
34
+ export const expectStylingSurvivesStrip = async (page, selector, { removeAttributes = [] } = {}) => {
35
+ const host = () => inBrowser(page, selector, `
36
+ return {
37
+ classes: Array.from(el.classList).sort(),
38
+ attributes: args.map((name) => [name, el.getAttribute(name)]),
39
+ };
40
+ `, removeAttributes);
41
+ const before = { host: await host(), styles: await snapshotStyles(page, selector) };
42
+ await inBrowser(page, selector, `
43
+ el.setAttribute('class', 'consumer');
44
+ el.removeAttribute('style');
45
+ args.forEach((name) => el.removeAttribute(name));
46
+ `, removeAttributes);
47
+ await page.waitForChanges();
48
+ expect(await host()).toEqual(before.host);
49
+ expect(await snapshotStyles(page, selector)).toEqual(before.styles);
50
+ };