@pine-ds/core 2.16.2 → 2.16.3

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 (392) hide show
  1. package/components/index2.js +2 -2
  2. package/components/index2.js.map +1 -1
  3. package/components/pds-box.js +1 -1
  4. package/components/pds-box.js.map +1 -1
  5. package/components/pds-button2.js +25 -5
  6. package/components/pds-button2.js.map +1 -1
  7. package/components/pds-checkbox2.js +3 -3
  8. package/components/pds-chip.js +1 -1
  9. package/components/pds-copytext.js +11 -5
  10. package/components/pds-copytext.js.map +1 -1
  11. package/components/pds-divider.js +1 -1
  12. package/components/pds-image.js +2 -2
  13. package/components/pds-input.js +11 -4
  14. package/components/pds-input.js.map +1 -1
  15. package/components/pds-link.js +2 -2
  16. package/components/pds-loader.js +1 -61
  17. package/components/pds-loader.js.map +1 -1
  18. package/components/pds-loader2.js +65 -0
  19. package/components/pds-loader2.js.map +1 -0
  20. package/components/pds-popover.js +1 -1
  21. package/components/pds-progress.js +1 -1
  22. package/components/pds-radio.js +3 -3
  23. package/components/pds-row.js +1 -1
  24. package/components/pds-select.js +1 -1
  25. package/components/pds-sortable-item.js +1 -1
  26. package/components/pds-sortable.js +1 -1
  27. package/components/pds-switch.js +3 -3
  28. package/components/pds-tab.js +3 -3
  29. package/components/pds-table-body.js +1 -1
  30. package/components/pds-table-cell2.js +2 -2
  31. package/components/pds-table-head-cell2.js +2 -2
  32. package/components/pds-table-head.js +1 -1
  33. package/components/pds-table-row.js +1 -1
  34. package/components/pds-table.js +1 -1
  35. package/components/pds-tabpanel.js +1 -1
  36. package/components/pds-tabs.js +1 -1
  37. package/components/pds-text.js +1 -1
  38. package/components/pds-textarea.js +4 -4
  39. package/components/pds-tooltip.js +2 -2
  40. package/dist/cjs/{index-034a8bb0.js → index-59b0d7e2.js} +3 -3
  41. package/dist/cjs/index-59b0d7e2.js.map +1 -0
  42. package/dist/cjs/loader.cjs.js +1 -1
  43. package/dist/cjs/pds-accordion.cjs.entry.js +1 -1
  44. package/dist/cjs/pds-avatar.cjs.entry.js +1 -1
  45. package/dist/cjs/pds-box.cjs.entry.js +1 -1
  46. package/dist/cjs/pds-box.cjs.entry.js.map +1 -1
  47. package/dist/cjs/pds-button.cjs.entry.js +16 -4
  48. package/dist/cjs/pds-button.cjs.entry.js.map +1 -1
  49. package/dist/cjs/pds-checkbox.cjs.entry.js +4 -4
  50. package/dist/cjs/pds-chip.cjs.entry.js +2 -2
  51. package/dist/cjs/pds-copytext.cjs.entry.js +2 -2
  52. package/dist/cjs/pds-divider.cjs.entry.js +1 -1
  53. package/dist/cjs/pds-image.cjs.entry.js +2 -2
  54. package/dist/cjs/pds-input.cjs.entry.js +12 -5
  55. package/dist/cjs/pds-input.cjs.entry.js.map +1 -1
  56. package/dist/cjs/pds-link.cjs.entry.js +3 -3
  57. package/dist/cjs/pds-loader.cjs.entry.js +2 -2
  58. package/dist/cjs/pds-loader.cjs.entry.js.map +1 -1
  59. package/dist/cjs/pds-popover.cjs.entry.js +1 -1
  60. package/dist/cjs/pds-progress.cjs.entry.js +1 -1
  61. package/dist/cjs/pds-radio.cjs.entry.js +4 -4
  62. package/dist/cjs/pds-row.cjs.entry.js +1 -1
  63. package/dist/cjs/pds-select.cjs.entry.js +2 -2
  64. package/dist/cjs/pds-sortable-item.cjs.entry.js +2 -2
  65. package/dist/cjs/pds-sortable.cjs.entry.js +1 -1
  66. package/dist/cjs/pds-switch.cjs.entry.js +4 -4
  67. package/dist/cjs/pds-tab.cjs.entry.js +3 -3
  68. package/dist/cjs/pds-table-body.cjs.entry.js +1 -1
  69. package/dist/cjs/pds-table-cell.cjs.entry.js +2 -2
  70. package/dist/cjs/pds-table-head-cell.cjs.entry.js +3 -3
  71. package/dist/cjs/pds-table-head.cjs.entry.js +1 -1
  72. package/dist/cjs/pds-table-row.cjs.entry.js +1 -1
  73. package/dist/cjs/pds-table.cjs.entry.js +1 -1
  74. package/dist/cjs/pds-tabpanel.cjs.entry.js +1 -1
  75. package/dist/cjs/pds-tabs.cjs.entry.js +1 -1
  76. package/dist/cjs/pds-text.cjs.entry.js +1 -1
  77. package/dist/cjs/pds-textarea.cjs.entry.js +5 -5
  78. package/dist/cjs/pds-tooltip.cjs.entry.js +2 -2
  79. package/dist/cjs/pine-core.cjs.js +1 -1
  80. package/dist/collection/components/pds-box/pds-box.css +3 -3
  81. package/dist/collection/components/pds-button/pds-button.css +52 -3
  82. package/dist/collection/components/pds-button/pds-button.js +56 -2
  83. package/dist/collection/components/pds-button/pds-button.js.map +1 -1
  84. package/dist/collection/components/pds-button/stories/pds-button.stories.js +32 -0
  85. package/dist/collection/components/pds-checkbox/pds-checkbox.js +3 -3
  86. package/dist/collection/components/pds-chip/pds-chip.js +1 -1
  87. package/dist/collection/components/pds-copytext/pds-copytext.js +1 -1
  88. package/dist/collection/components/pds-divider/pds-divider.js +1 -1
  89. package/dist/collection/components/pds-image/pds-image.js +2 -2
  90. package/dist/collection/components/pds-input/pds-input.css +17 -19
  91. package/dist/collection/components/pds-input/pds-input.js +11 -4
  92. package/dist/collection/components/pds-input/pds-input.js.map +1 -1
  93. package/dist/collection/components/pds-link/pds-link.js +2 -2
  94. package/dist/collection/components/pds-loader/pds-loader.css +2 -2
  95. package/dist/collection/components/pds-loader/pds-loader.js +1 -1
  96. package/dist/collection/components/pds-popover/pds-popover.js +1 -1
  97. package/dist/collection/components/pds-progress/pds-progress.js +1 -1
  98. package/dist/collection/components/pds-radio/pds-radio.js +3 -3
  99. package/dist/collection/components/pds-row/pds-row.js +1 -1
  100. package/dist/collection/components/pds-select/pds-select.js +1 -1
  101. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +1 -1
  102. package/dist/collection/components/pds-sortable/pds-sortable.js +1 -1
  103. package/dist/collection/components/pds-switch/pds-switch.js +3 -3
  104. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +1 -1
  105. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +2 -2
  106. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +1 -1
  107. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +2 -2
  108. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +1 -1
  109. package/dist/collection/components/pds-table/pds-table.js +1 -1
  110. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js +3 -3
  111. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +1 -1
  112. package/dist/collection/components/pds-tabs/pds-tabs.js +1 -1
  113. package/dist/collection/components/pds-text/pds-text.js +1 -1
  114. package/dist/collection/components/pds-textarea/pds-textarea.js +4 -4
  115. package/dist/collection/components/pds-tooltip/pds-tooltip.js +2 -2
  116. package/dist/docs.json +70 -7
  117. package/dist/esm/{index-d320cfa9.js → index-7f8e0fa6.js} +3 -3
  118. package/dist/esm/index-7f8e0fa6.js.map +1 -0
  119. package/dist/esm/loader.js +1 -1
  120. package/dist/esm/pds-accordion.entry.js +1 -1
  121. package/dist/esm/pds-avatar.entry.js +1 -1
  122. package/dist/esm/pds-box.entry.js +1 -1
  123. package/dist/esm/pds-box.entry.js.map +1 -1
  124. package/dist/esm/pds-button.entry.js +16 -4
  125. package/dist/esm/pds-button.entry.js.map +1 -1
  126. package/dist/esm/pds-checkbox.entry.js +4 -4
  127. package/dist/esm/pds-chip.entry.js +2 -2
  128. package/dist/esm/pds-copytext.entry.js +2 -2
  129. package/dist/esm/pds-divider.entry.js +1 -1
  130. package/dist/esm/pds-image.entry.js +2 -2
  131. package/dist/esm/pds-input.entry.js +12 -5
  132. package/dist/esm/pds-input.entry.js.map +1 -1
  133. package/dist/esm/pds-link.entry.js +3 -3
  134. package/dist/esm/pds-loader.entry.js +2 -2
  135. package/dist/esm/pds-loader.entry.js.map +1 -1
  136. package/dist/esm/pds-popover.entry.js +1 -1
  137. package/dist/esm/pds-progress.entry.js +1 -1
  138. package/dist/esm/pds-radio.entry.js +4 -4
  139. package/dist/esm/pds-row.entry.js +1 -1
  140. package/dist/esm/pds-select.entry.js +2 -2
  141. package/dist/esm/pds-sortable-item.entry.js +2 -2
  142. package/dist/esm/pds-sortable.entry.js +1 -1
  143. package/dist/esm/pds-switch.entry.js +4 -4
  144. package/dist/esm/pds-tab.entry.js +3 -3
  145. package/dist/esm/pds-table-body.entry.js +1 -1
  146. package/dist/esm/pds-table-cell.entry.js +2 -2
  147. package/dist/esm/pds-table-head-cell.entry.js +3 -3
  148. package/dist/esm/pds-table-head.entry.js +1 -1
  149. package/dist/esm/pds-table-row.entry.js +1 -1
  150. package/dist/esm/pds-table.entry.js +1 -1
  151. package/dist/esm/pds-tabpanel.entry.js +1 -1
  152. package/dist/esm/pds-tabs.entry.js +1 -1
  153. package/dist/esm/pds-text.entry.js +1 -1
  154. package/dist/esm/pds-textarea.entry.js +5 -5
  155. package/dist/esm/pds-tooltip.entry.js +2 -2
  156. package/dist/esm/pine-core.js +1 -1
  157. package/dist/esm-es5/{index-d320cfa9.js → index-7f8e0fa6.js} +2 -2
  158. package/dist/esm-es5/index-7f8e0fa6.js.map +1 -0
  159. package/dist/esm-es5/loader.js +1 -1
  160. package/dist/esm-es5/loader.js.map +1 -1
  161. package/dist/esm-es5/pds-accordion.entry.js +1 -1
  162. package/dist/esm-es5/pds-avatar.entry.js +1 -1
  163. package/dist/esm-es5/pds-box.entry.js +1 -1
  164. package/dist/esm-es5/pds-box.entry.js.map +1 -1
  165. package/dist/esm-es5/pds-button.entry.js +1 -1
  166. package/dist/esm-es5/pds-button.entry.js.map +1 -1
  167. package/dist/esm-es5/pds-checkbox.entry.js +1 -1
  168. package/dist/esm-es5/pds-chip.entry.js +1 -1
  169. package/dist/esm-es5/pds-copytext.entry.js +1 -1
  170. package/dist/esm-es5/pds-divider.entry.js +1 -1
  171. package/dist/esm-es5/pds-image.entry.js +1 -1
  172. package/dist/esm-es5/pds-input.entry.js +1 -1
  173. package/dist/esm-es5/pds-input.entry.js.map +1 -1
  174. package/dist/esm-es5/pds-link.entry.js +1 -1
  175. package/dist/esm-es5/pds-loader.entry.js +1 -1
  176. package/dist/esm-es5/pds-loader.entry.js.map +1 -1
  177. package/dist/esm-es5/pds-popover.entry.js +1 -1
  178. package/dist/esm-es5/pds-progress.entry.js +1 -1
  179. package/dist/esm-es5/pds-radio.entry.js +1 -1
  180. package/dist/esm-es5/pds-row.entry.js +1 -1
  181. package/dist/esm-es5/pds-select.entry.js +1 -1
  182. package/dist/esm-es5/pds-sortable-item.entry.js +1 -1
  183. package/dist/esm-es5/pds-sortable.entry.js +1 -1
  184. package/dist/esm-es5/pds-switch.entry.js +1 -1
  185. package/dist/esm-es5/pds-tab.entry.js +1 -1
  186. package/dist/esm-es5/pds-table-body.entry.js +1 -1
  187. package/dist/esm-es5/pds-table-cell.entry.js +1 -1
  188. package/dist/esm-es5/pds-table-head-cell.entry.js +1 -1
  189. package/dist/esm-es5/pds-table-head.entry.js +1 -1
  190. package/dist/esm-es5/pds-table-row.entry.js +1 -1
  191. package/dist/esm-es5/pds-table.entry.js +1 -1
  192. package/dist/esm-es5/pds-tabpanel.entry.js +1 -1
  193. package/dist/esm-es5/pds-tabs.entry.js +1 -1
  194. package/dist/esm-es5/pds-text.entry.js +1 -1
  195. package/dist/esm-es5/pds-textarea.entry.js +1 -1
  196. package/dist/esm-es5/pds-tooltip.entry.js +1 -1
  197. package/dist/esm-es5/pine-core.js +1 -1
  198. package/dist/esm-es5/pine-core.js.map +1 -1
  199. package/dist/pine-core/{p-aa134d2a.system.entry.js → p-01fd3a62.system.entry.js} +2 -2
  200. package/dist/pine-core/p-028fcdbc.entry.js +2 -0
  201. package/dist/pine-core/{p-7257c948.entry.js.map → p-028fcdbc.entry.js.map} +1 -1
  202. package/dist/pine-core/{p-8b2db323.system.entry.js → p-10caa9e9.system.entry.js} +2 -2
  203. package/dist/pine-core/{p-f81066da.entry.js → p-11b3830e.entry.js} +2 -2
  204. package/dist/pine-core/{p-f900a8ee.entry.js → p-129ea618.entry.js} +2 -2
  205. package/dist/pine-core/{p-5e50a381.entry.js → p-138ef0d8.entry.js} +2 -2
  206. package/dist/pine-core/{p-954098a2.entry.js → p-14c58ba3.entry.js} +2 -2
  207. package/dist/pine-core/{p-d8260ebf.system.entry.js → p-2aa49969.system.entry.js} +2 -2
  208. package/dist/pine-core/{p-f19e5736.system.entry.js → p-2d0b1310.system.entry.js} +2 -2
  209. package/dist/pine-core/{p-e890c1bb.system.entry.js → p-2f80836e.system.entry.js} +2 -2
  210. package/dist/pine-core/p-325e7255.system.entry.js +2 -0
  211. package/dist/pine-core/p-325e7255.system.entry.js.map +1 -0
  212. package/dist/pine-core/{p-8420594c.system.entry.js → p-3b529bb7.system.entry.js} +2 -2
  213. package/dist/pine-core/{p-d6a5ec65.system.entry.js → p-3c0abfe5.system.entry.js} +2 -2
  214. package/dist/pine-core/{p-e39bd4b2.system.entry.js → p-3de0ec6c.system.entry.js} +2 -2
  215. package/dist/pine-core/{p-df73ebae.entry.js → p-3f256ba6.entry.js} +2 -2
  216. package/dist/pine-core/{p-568ef920.entry.js → p-3fa11581.entry.js} +2 -2
  217. package/dist/pine-core/{p-f085efeb.entry.js → p-511f7b8e.entry.js} +2 -2
  218. package/dist/pine-core/{p-92bcb091.entry.js → p-518f8204.entry.js} +2 -2
  219. package/dist/pine-core/{p-03440844.entry.js → p-520cb092.entry.js} +2 -2
  220. package/dist/pine-core/p-546c2b18.entry.js +2 -0
  221. package/dist/pine-core/{p-d0b371ee.system.entry.js → p-55b10add.system.entry.js} +2 -2
  222. package/dist/pine-core/{p-1e9d6f92.system.entry.js → p-55cbb360.system.entry.js} +2 -2
  223. package/dist/pine-core/p-5c04aee0.system.js +1 -1
  224. package/dist/pine-core/p-5c04aee0.system.js.map +1 -1
  225. package/dist/pine-core/{p-b7e91522.entry.js → p-5d0c0241.entry.js} +2 -2
  226. package/dist/pine-core/p-5dd93828.system.entry.js +2 -0
  227. package/dist/pine-core/{p-798cde42.system.entry.js → p-61ddfc76.system.entry.js} +2 -2
  228. package/dist/pine-core/{p-4f2e4e6f.system.entry.js → p-6500852d.system.entry.js} +2 -2
  229. package/dist/pine-core/{p-80c582b7.system.entry.js → p-6bba1784.system.entry.js} +2 -2
  230. package/dist/pine-core/p-6c42ed23.entry.js +2 -0
  231. package/dist/pine-core/p-6c42ed23.entry.js.map +1 -0
  232. package/dist/pine-core/{p-d561168e.js → p-6e1737e0.js} +2 -2
  233. package/dist/pine-core/p-6e1737e0.js.map +1 -0
  234. package/dist/pine-core/{p-07a7c5bb.entry.js → p-71ba893c.entry.js} +2 -2
  235. package/dist/pine-core/{p-1edca70e.entry.js → p-7369f396.entry.js} +2 -2
  236. package/dist/pine-core/p-77d8e9fc.entry.js +2 -0
  237. package/dist/pine-core/{p-e356293a.entry.js.map → p-77d8e9fc.entry.js.map} +1 -1
  238. package/dist/pine-core/{p-74ad0244.entry.js → p-7a7cd1eb.entry.js} +2 -2
  239. package/dist/pine-core/p-7cdcf66c.entry.js +2 -0
  240. package/dist/pine-core/{p-5e1b7996.entry.js.map → p-7cdcf66c.entry.js.map} +1 -1
  241. package/dist/pine-core/{p-f34096db.system.entry.js → p-8220fa98.system.entry.js} +2 -2
  242. package/dist/pine-core/{p-5480346a.system.js → p-840c252f.system.js} +2 -2
  243. package/dist/pine-core/p-840c252f.system.js.map +1 -0
  244. package/dist/pine-core/{p-c68362cc.entry.js → p-841eae86.entry.js} +2 -2
  245. package/dist/pine-core/{p-19be5a8e.system.entry.js → p-8afa0198.system.entry.js} +2 -2
  246. package/dist/pine-core/{p-da961d2b.entry.js → p-9b2cacf1.entry.js} +2 -2
  247. package/dist/pine-core/{p-2d52d5f7.entry.js → p-9e9f1428.entry.js} +2 -2
  248. package/dist/pine-core/p-a020513a.system.entry.js +2 -0
  249. package/dist/pine-core/p-a020513a.system.entry.js.map +1 -0
  250. package/dist/pine-core/{p-71dc77f3.entry.js → p-a542bd00.entry.js} +2 -2
  251. package/dist/pine-core/{p-d9390457.entry.js → p-a5ab26b7.entry.js} +2 -2
  252. package/dist/pine-core/p-a5ab26b7.entry.js.map +1 -0
  253. package/dist/pine-core/p-a5c127c1.system.entry.js +2 -0
  254. package/dist/pine-core/p-a5c127c1.system.entry.js.map +1 -0
  255. package/dist/pine-core/{p-372a04fa.system.entry.js → p-aab44395.system.entry.js} +2 -2
  256. package/dist/pine-core/{p-a2465224.entry.js → p-b0cf37c0.entry.js} +2 -2
  257. package/dist/pine-core/{p-f0c28381.entry.js → p-b164dfe7.entry.js} +2 -2
  258. package/dist/pine-core/{p-ade60629.system.entry.js → p-b1aa0e9d.system.entry.js} +2 -2
  259. package/dist/pine-core/p-b1aa0e9d.system.entry.js.map +1 -0
  260. package/dist/pine-core/{p-ed990ad0.system.entry.js → p-b492ea28.system.entry.js} +2 -2
  261. package/dist/pine-core/p-bf55e42e.system.entry.js +2 -0
  262. package/dist/pine-core/{p-f182a1f2.system.entry.js → p-c564c31b.system.entry.js} +2 -2
  263. package/dist/pine-core/{p-1da5aaf3.entry.js → p-ce0efc2d.entry.js} +2 -2
  264. package/dist/pine-core/{p-1fd67cb4.system.entry.js → p-d266843a.system.entry.js} +2 -2
  265. package/dist/pine-core/{p-f90088df.entry.js → p-d34b9adb.entry.js} +2 -2
  266. package/dist/pine-core/{p-987a101b.system.entry.js → p-d410221a.system.entry.js} +2 -2
  267. package/dist/pine-core/{p-4c252abb.system.entry.js → p-d61972a6.system.entry.js} +2 -2
  268. package/dist/pine-core/{p-95e4a6ff.system.entry.js → p-d6f5b0a5.system.entry.js} +2 -2
  269. package/dist/pine-core/{p-cae3e411.entry.js → p-dbd37883.entry.js} +2 -2
  270. package/dist/pine-core/{p-29bb6589.entry.js → p-e19d9edd.entry.js} +2 -2
  271. package/dist/pine-core/{p-adf21b0c.entry.js → p-ec1f256a.entry.js} +2 -2
  272. package/dist/pine-core/p-ee3cc6ce.entry.js +2 -0
  273. package/dist/pine-core/p-ee3cc6ce.entry.js.map +1 -0
  274. package/dist/pine-core/p-f099836d.entry.js +2 -0
  275. package/dist/pine-core/p-f099836d.entry.js.map +1 -0
  276. package/dist/pine-core/{p-853af623.system.entry.js → p-f8e61c4c.system.entry.js} +2 -2
  277. package/dist/pine-core/{p-397ce1a8.system.entry.js → p-fad3645f.system.entry.js} +2 -2
  278. package/dist/pine-core/{p-8c07ed73.system.entry.js → p-fce8b94f.system.entry.js} +2 -2
  279. package/dist/pine-core/{p-285cd9d1.system.entry.js → p-fd3e2c23.system.entry.js} +2 -2
  280. package/dist/pine-core/pine-core.esm.js +1 -1
  281. package/dist/pine-core/pine-core.esm.js.map +1 -1
  282. package/dist/pine-core/svg/align-horizontal-bottom.svg +1 -0
  283. package/dist/pine-core/svg/align-horizontal-center.svg +1 -0
  284. package/dist/pine-core/svg/align-horizontal-top.svg +1 -0
  285. package/dist/pine-core/svg/align-vertical-center.svg +1 -0
  286. package/dist/pine-core/svg/align-vertical-left.svg +1 -0
  287. package/dist/pine-core/svg/align-vertical-right.svg +1 -0
  288. package/dist/pine-core/svg/feedback.svg +1 -1
  289. package/dist/pine-core/svg/form.svg +1 -1
  290. package/dist/pine-core/svg/grant-offer.svg +1 -1
  291. package/dist/pine-core/svg/headphones.svg +1 -0
  292. package/dist/pine-core/svg/kajabi-filled.svg +1 -1
  293. package/dist/pine-core/svg/kajabi.svg +1 -1
  294. package/dist/pine-core/svg/layout-top.svg +1 -0
  295. package/dist/pine-core/svg/mail-open.svg +1 -1
  296. package/dist/pine-core/svg/mail.svg +1 -1
  297. package/dist/pine-core/svg/merge.svg +1 -1
  298. package/dist/pine-core/svg/newsletter-2.svg +1 -1
  299. package/dist/pine-core/svg/pie-chart-filled.svg +1 -0
  300. package/dist/pine-core/svg/present.svg +1 -1
  301. package/dist/pine-core/svg/restore.svg +1 -1
  302. package/dist/pine-core/svg/star-03.svg +1 -0
  303. package/dist/pine-core/svg/star-filled.svg +1 -0
  304. package/dist/pine-core/svg/star.svg +1 -1
  305. package/dist/pine-core/svg/sync.svg +1 -1
  306. package/dist/pine-core/svg/trophy.svg +1 -1
  307. package/dist/pine-core/svg/type.svg +1 -0
  308. package/dist/pine-core/svg/user-filled.svg +1 -1
  309. package/dist/types/components/pds-button/pds-button.d.ts +11 -0
  310. package/dist/types/components/pds-input/pds-input.d.ts +2 -1
  311. package/dist/types/components.d.ts +22 -2
  312. package/hydrate/index.js +75 -54
  313. package/hydrate/index.mjs +75 -54
  314. package/package.json +2 -2
  315. package/dist/cjs/index-034a8bb0.js.map +0 -1
  316. package/dist/esm/index-d320cfa9.js.map +0 -1
  317. package/dist/esm-es5/index-d320cfa9.js.map +0 -1
  318. package/dist/pine-core/p-27e12bd2.system.entry.js +0 -2
  319. package/dist/pine-core/p-27e12bd2.system.entry.js.map +0 -1
  320. package/dist/pine-core/p-30cd9f18.entry.js +0 -2
  321. package/dist/pine-core/p-3fbb568f.entry.js +0 -2
  322. package/dist/pine-core/p-3fbb568f.entry.js.map +0 -1
  323. package/dist/pine-core/p-4d1fbb88.system.entry.js +0 -2
  324. package/dist/pine-core/p-5480346a.system.js.map +0 -1
  325. package/dist/pine-core/p-5e1b7996.entry.js +0 -2
  326. package/dist/pine-core/p-60c2039e.system.entry.js +0 -2
  327. package/dist/pine-core/p-7257c948.entry.js +0 -2
  328. package/dist/pine-core/p-7baec1ed.entry.js +0 -2
  329. package/dist/pine-core/p-7baec1ed.entry.js.map +0 -1
  330. package/dist/pine-core/p-8c0a648d.system.entry.js +0 -2
  331. package/dist/pine-core/p-8c0a648d.system.entry.js.map +0 -1
  332. package/dist/pine-core/p-a22fd94e.entry.js +0 -2
  333. package/dist/pine-core/p-a22fd94e.entry.js.map +0 -1
  334. package/dist/pine-core/p-ade60629.system.entry.js.map +0 -1
  335. package/dist/pine-core/p-d561168e.js.map +0 -1
  336. package/dist/pine-core/p-d9390457.entry.js.map +0 -1
  337. package/dist/pine-core/p-e356293a.entry.js +0 -2
  338. package/dist/pine-core/p-e60348bc.system.entry.js +0 -2
  339. package/dist/pine-core/p-e60348bc.system.entry.js.map +0 -1
  340. /package/dist/pine-core/{p-aa134d2a.system.entry.js.map → p-01fd3a62.system.entry.js.map} +0 -0
  341. /package/dist/pine-core/{p-8b2db323.system.entry.js.map → p-10caa9e9.system.entry.js.map} +0 -0
  342. /package/dist/pine-core/{p-f81066da.entry.js.map → p-11b3830e.entry.js.map} +0 -0
  343. /package/dist/pine-core/{p-f900a8ee.entry.js.map → p-129ea618.entry.js.map} +0 -0
  344. /package/dist/pine-core/{p-5e50a381.entry.js.map → p-138ef0d8.entry.js.map} +0 -0
  345. /package/dist/pine-core/{p-954098a2.entry.js.map → p-14c58ba3.entry.js.map} +0 -0
  346. /package/dist/pine-core/{p-d8260ebf.system.entry.js.map → p-2aa49969.system.entry.js.map} +0 -0
  347. /package/dist/pine-core/{p-f19e5736.system.entry.js.map → p-2d0b1310.system.entry.js.map} +0 -0
  348. /package/dist/pine-core/{p-e890c1bb.system.entry.js.map → p-2f80836e.system.entry.js.map} +0 -0
  349. /package/dist/pine-core/{p-8420594c.system.entry.js.map → p-3b529bb7.system.entry.js.map} +0 -0
  350. /package/dist/pine-core/{p-d6a5ec65.system.entry.js.map → p-3c0abfe5.system.entry.js.map} +0 -0
  351. /package/dist/pine-core/{p-e39bd4b2.system.entry.js.map → p-3de0ec6c.system.entry.js.map} +0 -0
  352. /package/dist/pine-core/{p-df73ebae.entry.js.map → p-3f256ba6.entry.js.map} +0 -0
  353. /package/dist/pine-core/{p-568ef920.entry.js.map → p-3fa11581.entry.js.map} +0 -0
  354. /package/dist/pine-core/{p-f085efeb.entry.js.map → p-511f7b8e.entry.js.map} +0 -0
  355. /package/dist/pine-core/{p-92bcb091.entry.js.map → p-518f8204.entry.js.map} +0 -0
  356. /package/dist/pine-core/{p-03440844.entry.js.map → p-520cb092.entry.js.map} +0 -0
  357. /package/dist/pine-core/{p-30cd9f18.entry.js.map → p-546c2b18.entry.js.map} +0 -0
  358. /package/dist/pine-core/{p-d0b371ee.system.entry.js.map → p-55b10add.system.entry.js.map} +0 -0
  359. /package/dist/pine-core/{p-1e9d6f92.system.entry.js.map → p-55cbb360.system.entry.js.map} +0 -0
  360. /package/dist/pine-core/{p-b7e91522.entry.js.map → p-5d0c0241.entry.js.map} +0 -0
  361. /package/dist/pine-core/{p-4d1fbb88.system.entry.js.map → p-5dd93828.system.entry.js.map} +0 -0
  362. /package/dist/pine-core/{p-798cde42.system.entry.js.map → p-61ddfc76.system.entry.js.map} +0 -0
  363. /package/dist/pine-core/{p-4f2e4e6f.system.entry.js.map → p-6500852d.system.entry.js.map} +0 -0
  364. /package/dist/pine-core/{p-80c582b7.system.entry.js.map → p-6bba1784.system.entry.js.map} +0 -0
  365. /package/dist/pine-core/{p-07a7c5bb.entry.js.map → p-71ba893c.entry.js.map} +0 -0
  366. /package/dist/pine-core/{p-1edca70e.entry.js.map → p-7369f396.entry.js.map} +0 -0
  367. /package/dist/pine-core/{p-74ad0244.entry.js.map → p-7a7cd1eb.entry.js.map} +0 -0
  368. /package/dist/pine-core/{p-f34096db.system.entry.js.map → p-8220fa98.system.entry.js.map} +0 -0
  369. /package/dist/pine-core/{p-c68362cc.entry.js.map → p-841eae86.entry.js.map} +0 -0
  370. /package/dist/pine-core/{p-19be5a8e.system.entry.js.map → p-8afa0198.system.entry.js.map} +0 -0
  371. /package/dist/pine-core/{p-da961d2b.entry.js.map → p-9b2cacf1.entry.js.map} +0 -0
  372. /package/dist/pine-core/{p-2d52d5f7.entry.js.map → p-9e9f1428.entry.js.map} +0 -0
  373. /package/dist/pine-core/{p-71dc77f3.entry.js.map → p-a542bd00.entry.js.map} +0 -0
  374. /package/dist/pine-core/{p-372a04fa.system.entry.js.map → p-aab44395.system.entry.js.map} +0 -0
  375. /package/dist/pine-core/{p-a2465224.entry.js.map → p-b0cf37c0.entry.js.map} +0 -0
  376. /package/dist/pine-core/{p-f0c28381.entry.js.map → p-b164dfe7.entry.js.map} +0 -0
  377. /package/dist/pine-core/{p-ed990ad0.system.entry.js.map → p-b492ea28.system.entry.js.map} +0 -0
  378. /package/dist/pine-core/{p-60c2039e.system.entry.js.map → p-bf55e42e.system.entry.js.map} +0 -0
  379. /package/dist/pine-core/{p-f182a1f2.system.entry.js.map → p-c564c31b.system.entry.js.map} +0 -0
  380. /package/dist/pine-core/{p-1da5aaf3.entry.js.map → p-ce0efc2d.entry.js.map} +0 -0
  381. /package/dist/pine-core/{p-1fd67cb4.system.entry.js.map → p-d266843a.system.entry.js.map} +0 -0
  382. /package/dist/pine-core/{p-f90088df.entry.js.map → p-d34b9adb.entry.js.map} +0 -0
  383. /package/dist/pine-core/{p-987a101b.system.entry.js.map → p-d410221a.system.entry.js.map} +0 -0
  384. /package/dist/pine-core/{p-4c252abb.system.entry.js.map → p-d61972a6.system.entry.js.map} +0 -0
  385. /package/dist/pine-core/{p-95e4a6ff.system.entry.js.map → p-d6f5b0a5.system.entry.js.map} +0 -0
  386. /package/dist/pine-core/{p-cae3e411.entry.js.map → p-dbd37883.entry.js.map} +0 -0
  387. /package/dist/pine-core/{p-29bb6589.entry.js.map → p-e19d9edd.entry.js.map} +0 -0
  388. /package/dist/pine-core/{p-adf21b0c.entry.js.map → p-ec1f256a.entry.js.map} +0 -0
  389. /package/dist/pine-core/{p-853af623.system.entry.js.map → p-f8e61c4c.system.entry.js.map} +0 -0
  390. /package/dist/pine-core/{p-397ce1a8.system.entry.js.map → p-fad3645f.system.entry.js.map} +0 -0
  391. /package/dist/pine-core/{p-8c07ed73.system.entry.js.map → p-fce8b94f.system.entry.js.map} +0 -0
  392. /package/dist/pine-core/{p-285cd9d1.system.entry.js.map → p-fd3e2c23.system.entry.js.map} +0 -0
@@ -1156,7 +1156,7 @@ pds-box {
1156
1156
  }
1157
1157
 
1158
1158
  .pds-box-gap-xxl {
1159
- gap: var(--pine-dimension-xxl);
1159
+ gap: var(--pine-dimension-2xl);
1160
1160
  }
1161
1161
 
1162
1162
  .pds-padding-none {
@@ -1168,7 +1168,7 @@ pds-box {
1168
1168
  }
1169
1169
 
1170
1170
  .pds-padding-xs {
1171
- padding: var(--pine-dimension-2xs);
1171
+ padding: var(--pine-dimension-xs);
1172
1172
  }
1173
1173
 
1174
1174
  .pds-padding-sm {
@@ -1188,7 +1188,7 @@ pds-box {
1188
1188
  }
1189
1189
 
1190
1190
  .pds-padding-xxl {
1191
- padding: var(--pine-dimension-xxl);
1191
+ padding: var(--pine-dimension-2xl);
1192
1192
  }
1193
1193
 
1194
1194
  .pds-box-display-flex {
@@ -3,11 +3,27 @@
3
3
  --color-border-disabled: transparent;
4
4
  --color-border-focus: transparent;
5
5
  --color-border-hover: transparent;
6
+ --button-loader-color: var(--color-text-default);
6
7
  display: inline-flex;
7
8
  vertical-align: middle;
8
9
  }
9
10
 
11
+ :host([full-width=true]) {
12
+ display: flex;
13
+ width: 100%;
14
+ }
15
+ :host([full-width=true]) button {
16
+ justify-content: center;
17
+ width: 100%;
18
+ }
19
+
20
+ :host([loading=true]) {
21
+ cursor: wait;
22
+ pointer-events: none;
23
+ }
24
+
10
25
  .pds-button {
26
+ --pds-loader-color: var(--color-text-default);
11
27
  align-items: center;
12
28
  background-color: var(--color-background-default);
13
29
  border: var(--pine-border);
@@ -52,6 +68,7 @@
52
68
  --color-text-default: var(--pine-color-text-primary);
53
69
  --color-text-disabled: var(--pine-color-text-primary-disabled);
54
70
  --color-outline: var(--pine-color-focus-ring);
71
+ --button-loader-color: var(--pine-color-text-primary);
55
72
  }
56
73
 
57
74
  .pds-button--accent {
@@ -63,6 +80,7 @@
63
80
  --color-text-default: var(--pine-color-text-primary);
64
81
  --color-text-disabled: var(--pine-color-text-accent-disabled);
65
82
  --color-outline: var(--pine-color-focus-ring);
83
+ --button-loader-color: var(--pine-color-text-primary);
66
84
  }
67
85
 
68
86
  .pds-button--destructive {
@@ -74,6 +92,7 @@
74
92
  --color-text-default: var(--pine-color-text-primary);
75
93
  --color-text-disabled: var(--pine-color-text-danger-disabled);
76
94
  --color-outline: var(--pine-color-focus-ring-danger);
95
+ --button-loader-color: var(--pine-color-text-primary);
77
96
  }
78
97
  .pds-button--destructive:focus-visible {
79
98
  --box-shadow-focus: 0 0 0 1px #ffffff, 0 0 0 3px var(--pine-color-danger);
@@ -83,9 +102,9 @@
83
102
 
84
103
  .pds-button--secondary,
85
104
  .pds-button--disclosure {
86
- --color-background-default: transparent;
87
- --color-background-hover: transparent;
88
- --color-background-disabled: transparent;
105
+ --color-background-default: var(--pine-color-secondary);
106
+ --color-background-hover: var(--pine-color-secondary-hover);
107
+ --color-background-disabled: var(--pine-color-secondary-disabled);
89
108
  --color-border-disabled: var(--pine-color-border-disabled);
90
109
  --color-border-focus: var(--pine-color-border);
91
110
  --color-border-hover: var(--pine-color-border-hover);
@@ -93,6 +112,7 @@
93
112
  --color-text-default: var(--pine-color-text-secondary);
94
113
  --color-text-disabled: var(--pine-color-text-secondary-disabled);
95
114
  --color-outline: var(--pine-color-focus-ring);
115
+ --button-loader-color: var(--pine-color-text-secondary);
96
116
  }
97
117
  .pds-button--secondary:hover,
98
118
  .pds-button--disclosure:hover {
@@ -109,9 +129,38 @@
109
129
  --color-background-hover: transparent;
110
130
  --color-background-disabled: transparent;
111
131
  --color-text-default: inherit;
132
+ --button-loader-color: inherit;
112
133
  border-width: var(--pine-dimension-none);
113
134
  margin: var(--pine-dimension-none);
114
135
  min-height: auto;
115
136
  padding: var(--pine-dimension-none);
116
137
  width: inherit;
138
+ }
139
+
140
+ .pds-button__content {
141
+ align-items: center;
142
+ display: inline-flex;
143
+ position: relative;
144
+ }
145
+
146
+ .pds-button__text--hidden,
147
+ .pds-button__icon--hidden {
148
+ opacity: 0;
149
+ }
150
+
151
+ .pds-button__loader {
152
+ height: var(--pine-dimension-250);
153
+ left: 50%;
154
+ position: absolute;
155
+ top: 50%;
156
+ transform: translate(-50%, -50%);
157
+ width: var(--pine-dimension-250);
158
+ }
159
+
160
+ .pds-button--loading {
161
+ cursor: wait;
162
+ pointer-events: none;
163
+ }
164
+ .pds-button--loading .pds-button__loader pds-loader {
165
+ --loader-color: var(--button-loader-color);
117
166
  }
@@ -9,6 +9,10 @@ import { caretDown } from "@pine-ds/icons/icons";
9
9
  export class PdsButton {
10
10
  constructor() {
11
11
  this.handleClick = (ev) => {
12
+ if (this.loading) {
13
+ ev.preventDefault();
14
+ return;
15
+ }
12
16
  if (this.type != 'button') {
13
17
  // If button clicked IS NOT associated with a form
14
18
  if (hasShadowDom(this.el)) {
@@ -28,7 +32,9 @@ export class PdsButton {
28
32
  };
29
33
  this.componentId = undefined;
30
34
  this.disabled = false;
35
+ this.fullWidth = false;
31
36
  this.icon = null;
37
+ this.loading = false;
32
38
  this.name = undefined;
33
39
  this.value = undefined;
34
40
  this.type = 'button';
@@ -39,10 +45,16 @@ export class PdsButton {
39
45
  if (this.variant) {
40
46
  classNames.push('pds-button--' + this.variant);
41
47
  }
42
- return classNames.join(' ');
48
+ if (this.loading) {
49
+ classNames.push('pds-button--loading');
50
+ }
51
+ return classNames.join(' ');
43
52
  }
44
53
  render() {
45
- return (h(Host, { key: '09f73346a0de854613bb43e81a9099c2e3783ec0', "aria-disabled": this.disabled ? 'true' : null, id: this.componentId, onClick: this.handleClick, variant: this.variant }, h("button", { key: 'e02d07f103692dfdf0f40c4ef0659674d92b701a', class: this.classNames(), disabled: this.disabled, name: this.name, part: "button", type: this.type, value: this.value }, this.icon && this.variant !== 'disclosure' && h("pds-icon", { key: '642e6890c4d6cdbbe129af1ef3532fcd5c4a7925', name: this.icon, part: "icon" }), h("slot", { key: '58e95d868055a2723657a757a3c49cbb7989d912' }), this.variant === 'disclosure' && h("pds-icon", { key: '81d4456cb62d77056f93e60091215347ac743134', icon: caretDown, part: "caret" }))));
54
+ return (h(Host, { key: '6b9f3c286fe8e74703d482df6ae49e770a26d3f4', "aria-disabled": this.disabled ? 'true' : null, id: this.componentId, onClick: this.handleClick, variant: this.variant }, h("button", { key: 'ba8f5ce2e101875de773d4967dc7e4e61e0d6e1b', "aria-busy": this.loading ? 'true' : null, "aria-live": this.loading ? 'polite' : null, class: this.classNames(), disabled: this.disabled, name: this.name, part: "button", type: this.type, value: this.value }, h("div", { key: 'fdb0c43a4688a271ac5f4c261c12891a1b798e78', class: "pds-button__content" }, this.icon && this.variant !== 'disclosure' &&
55
+ h("pds-icon", { key: '37e212a7f08f0734cc53644fd776667c70aa7fc5', class: this.loading ? 'pds-button__icon--hidden' : '', name: this.icon, part: "icon" }), h("span", { key: 'a7969b2c2cd18ab615d5070428050d513bb659b8', class: `pds-button__text ${this.loading ? 'pds-button__text--hidden' : ''}` }, h("slot", { key: 'a0d2a610c2b4dfc2d5fdf1acb715b002a1927aa6' })), this.loading &&
56
+ h("span", { key: 'f889c60c94baf9c8c73b31de76482e09515c2cf0', class: "pds-button__loader" }, h("pds-loader", { key: '372ff4bc2f3dd3a75015d341f41689b07bd237e0', "is-loading": true, size: "var(--pine-font-size-body-2xl)", variant: "spinner" }, "Loading...")), this.variant === 'disclosure' &&
57
+ h("pds-icon", { key: 'd0e0f35a0b44f69138bf9a78989cf1a5bbdec135', class: this.loading ? 'pds-button__icon--hidden' : '', icon: caretDown, part: "caret" })))));
46
58
  }
47
59
  static get is() { return "pds-button"; }
48
60
  static get encapsulation() { return "shadow"; }
@@ -96,6 +108,27 @@ export class PdsButton {
96
108
  "reflect": false,
97
109
  "defaultValue": "false"
98
110
  },
111
+ "fullWidth": {
112
+ "type": "boolean",
113
+ "mutable": false,
114
+ "complexType": {
115
+ "original": "boolean",
116
+ "resolved": "boolean",
117
+ "references": {}
118
+ },
119
+ "required": false,
120
+ "optional": true,
121
+ "docs": {
122
+ "tags": [{
123
+ "name": "defaultValue",
124
+ "text": "false"
125
+ }],
126
+ "text": "Determines if the button should take up the full width of its container."
127
+ },
128
+ "attribute": "full-width",
129
+ "reflect": false,
130
+ "defaultValue": "false"
131
+ },
99
132
  "icon": {
100
133
  "type": "string",
101
134
  "mutable": false,
@@ -117,6 +150,27 @@ export class PdsButton {
117
150
  "reflect": false,
118
151
  "defaultValue": "null"
119
152
  },
153
+ "loading": {
154
+ "type": "boolean",
155
+ "mutable": false,
156
+ "complexType": {
157
+ "original": "boolean",
158
+ "resolved": "boolean",
159
+ "references": {}
160
+ },
161
+ "required": false,
162
+ "optional": true,
163
+ "docs": {
164
+ "tags": [{
165
+ "name": "defaultValue",
166
+ "text": "false"
167
+ }],
168
+ "text": "Determines if the button is in a loading state.\nWhen true, displays a loader and hides the button text."
169
+ },
170
+ "attribute": "loading",
171
+ "reflect": false,
172
+ "defaultValue": "false"
173
+ },
120
174
  "name": {
121
175
  "type": "string",
122
176
  "mutable": false,
@@ -1 +1 @@
1
- {"version":3,"file":"pds-button.js","sourceRoot":"","sources":["../../../src/components/pds-button/pds-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD;;;;EAIE;AAOF,MAAM,OAAO,SAAS;;QA6CZ,gBAAW,GAAG,CAAC,EAAS,EAAE,EAAE;YAClC,IAAI,IAAI,CAAC,IAAI,IAAI,QAAQ,EAAE,CAAC;gBAC1B,kDAAkD;gBAClD,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;oBAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;oBACpC,IAAI,IAAI,EAAE,CAAC;wBACT,EAAE,CAAC,cAAc,EAAE,CAAA;wBAEnB,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;wBACnD,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;wBAC3B,UAAU,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAA;wBACjC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAA;wBAC5B,UAAU,CAAC,KAAK,EAAE,CAAA;wBAClB,UAAU,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Host, h, Prop } from '@stencil/core';\nimport { hasShadowDom } from '../../utils/utils';\n\nimport { caretDown } from '@pine-ds/icons/icons';\n\n/**\n * @part button - Exposes the button element for styling.\n * @part caret - Exposes the caret icon component for styling. Appears only on the disclosure variant.\n * @part icon - Exposes the icon component for styling.\n*/\n\n@Component({\n tag: 'pds-button',\n styleUrls: ['pds-button.scss'],\n shadow: true,\n})\nexport class PdsButton {\n @Element() el: HTMLPdsButtonElement;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Determines the button's disabled state.\n * @defaultValue false\n */\n @Prop() disabled? = false;\n\n /**\n * Displays an icon before the text when\n * the icon string matches an icon name.\n * @defaultValue null\n */\n @Prop() icon?: string = null;\n\n /**\n * Provides the button with a submittable name.\n */\n @Prop() name?: string;\n\n /**\n * Provides button with a submittable value\n */\n @Prop() value?: string;\n\n /**\n * Provides button with a type.\n * @defaultValue button\n */\n @Prop() type?: 'button' | 'reset' | 'submit' = 'button';\n\n /**\n * Sets the style variant of the button.\n * @defaultValue primary\n */\n @Prop() variant: 'primary' | 'secondary' | 'accent' | 'disclosure' | 'destructive' | 'unstyled' = 'primary';\n\n @Event() pdsClick: EventEmitter;\n\n private handleClick = (ev: Event) => {\n if (this.type != 'button') {\n // If button clicked IS NOT associated with a form\n if (hasShadowDom(this.el)) {\n const form = this.el.closest('form')\n if (form) {\n ev.preventDefault()\n\n const fakeButton = document.createElement('button')\n fakeButton.type = this.type\n fakeButton.style.display = 'none'\n form.appendChild(fakeButton)\n fakeButton.click()\n fakeButton.remove()\n }\n }\n }\n this.pdsClick.emit(ev);\n }\n\n private classNames() {\n const classNames = ['pds-button'];\n\n if (this.variant) {\n classNames.push('pds-button--' + this.variant);\n }\n\n return classNames.join(' ');\n }\n\n render() {\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n id={this.componentId}\n onClick={this.handleClick}\n variant={this.variant}\n >\n <button\n class={this.classNames()}\n disabled={this.disabled}\n name={this.name}\n part=\"button\"\n type={this.type}\n value={this.value}\n >\n {this.icon && this.variant !== 'disclosure' && <pds-icon name={this.icon} part=\"icon\"></pds-icon>}\n <slot />\n {this.variant === 'disclosure' && <pds-icon icon={caretDown} part=\"caret\"></pds-icon>}\n </button>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pds-button.js","sourceRoot":"","sources":["../../../src/components/pds-button/pds-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD;;;;EAIE;AAOF,MAAM,OAAO,SAAS;;QA0DZ,gBAAW,GAAG,CAAC,EAAS,EAAE,EAAE;YAClC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACjB,EAAE,CAAC,cAAc,EAAE,CAAC;gBACpB,OAAO;YACT,CAAC;YAED,IAAI,IAAI,CAAC,IAAI,IAAI,QAAQ,EAAE,CAAC;gBAC1B,kDAAkD;gBAClD,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;oBAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;oBACpC,IAAI,IAAI,EAAE,CAAC;wBACT,EAAE,CAAC,cAAc,EAAE,CAAA;wBAEnB,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;wBACnD,UAAU,CAAC,IA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Q,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK;gBAEjB,4DAAK,KAAK,EAAC,qBAAqB;oBAC7B,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,OAAO,KAAK,YAAY;wBACzC,iEACE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,EACrD,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAC,MAAM,GACD;oBAGd,6DAAM,KAAK,EAAE,oBAAoB,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,EAAE;wBAC/E,8DAAQ,CACH;oBAEN,IAAI,CAAC,OAAO;wBACX,6DAAM,KAAK,EAAC,oBAAoB;4BAC9B,iFACc,IAAI,EAChB,IAAI,EAAC,gCAAgC,EACrC,OAAO,EAAC,SAAS,iBAGN,CACR;oBAGR,IAAI,CAAC,OAAO,KAAK,YAAY;wBAC5B,iEACE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,EACrD,IAAI,EAAE,SAAS,EACf,IAAI,EAAC,OAAO,GACF,CAEV,CACC,CACJ,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, Host, h, Prop } from '@stencil/core';\nimport { hasShadowDom } from '../../utils/utils';\n\nimport { caretDown } from '@pine-ds/icons/icons';\n\n/**\n * @part button - Exposes the button element for styling.\n * @part caret - Exposes the caret icon component for styling. Appears only on the disclosure variant.\n * @part icon - Exposes the icon component for styling.\n*/\n\n@Component({\n tag: 'pds-button',\n styleUrls: ['pds-button.scss'],\n shadow: true,\n})\nexport class PdsButton {\n @Element() el: HTMLPdsButtonElement;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId: string;\n\n /**\n * Determines the button's disabled state.\n * @defaultValue false\n */\n @Prop() disabled? = false;\n\n /**\n * Determines if the button should take up the full width of its container.\n * @defaultValue false\n */\n @Prop() fullWidth? = false;\n\n /**\n * Displays an icon before the text when\n * the icon string matches an icon name.\n * @defaultValue null\n */\n @Prop() icon?: string = null;\n\n /**\n * Determines if the button is in a loading state.\n * When true, displays a loader and hides the button text.\n * @defaultValue false\n */\n @Prop() loading? = false;\n\n /**\n * Provides the button with a submittable name.\n */\n @Prop() name?: string;\n\n /**\n * Provides button with a submittable value\n */\n @Prop() value?: string;\n\n /**\n * Provides button with a type.\n * @defaultValue button\n */\n @Prop() type?: 'button' | 'reset' | 'submit' = 'button';\n\n /**\n * Sets the style variant of the button.\n * @defaultValue primary\n */\n @Prop() variant: 'primary' | 'secondary' | 'accent' | 'disclosure' | 'destructive' | 'unstyled' = 'primary';\n\n @Event() pdsClick: EventEmitter;\n\n private handleClick = (ev: Event) => {\n if (this.loading) {\n ev.preventDefault();\n return;\n }\n\n if (this.type != 'button') {\n // If button clicked IS NOT associated with a form\n if (hasShadowDom(this.el)) {\n const form = this.el.closest('form')\n if (form) {\n ev.preventDefault()\n\n const fakeButton = document.createElement('button')\n fakeButton.type = this.type\n fakeButton.style.display = 'none'\n form.appendChild(fakeButton)\n fakeButton.click()\n fakeButton.remove()\n }\n }\n }\n this.pdsClick.emit(ev);\n }\n\n private classNames() {\n const classNames = ['pds-button'];\n\n if (this.variant) {\n classNames.push('pds-button--' + this.variant);\n }\n\n if (this.loading) {\n classNames.push('pds-button--loading');\n }\n\n return classNames.join(' ');\n }\n\n render() {\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n id={this.componentId}\n onClick={this.handleClick}\n variant={this.variant}\n >\n <button\n aria-busy={this.loading ? 'true' : null}\n aria-live={this.loading ? 'polite' : null}\n class={this.classNames()}\n disabled={this.disabled}\n name={this.name}\n part=\"button\"\n type={this.type}\n value={this.value}\n >\n <div class=\"pds-button__content\">\n {this.icon && this.variant !== 'disclosure' &&\n <pds-icon\n class={this.loading ? 'pds-button__icon--hidden' : ''}\n name={this.icon}\n part=\"icon\"\n ></pds-icon>\n }\n\n <span class={`pds-button__text ${this.loading ? 'pds-button__text--hidden' : ''}`}>\n <slot />\n </span>\n\n {this.loading &&\n <span class=\"pds-button__loader\">\n <pds-loader\n is-loading={true}\n size=\"var(--pine-font-size-body-2xl)\"\n variant=\"spinner\"\n >\n Loading...\n </pds-loader>\n </span>\n }\n\n {this.variant === 'disclosure' &&\n <pds-icon\n class={this.loading ? 'pds-button__icon--hidden' : ''}\n icon={caretDown}\n part=\"caret\"\n ></pds-icon>\n }\n </div>\n </button>\n </Host>\n );\n }\n}\n"]}
@@ -19,7 +19,9 @@ const BaseTemplate = (args) => html`
19
19
  <pds-button
20
20
  component-id=${args.componentId}
21
21
  disabled=${args.disabled}
22
+ full-width=${args.fullWidth}
22
23
  icon=${args.icon}
24
+ loading=${args.loading}
23
25
  name=${args.name}
24
26
  type=${args.type}
25
27
  value=${args.value}
@@ -30,6 +32,8 @@ const BaseTemplate = (args) => html`
30
32
  export const Accent = BaseTemplate.bind();
31
33
  Accent.args = {
32
34
  disabled: false,
35
+ fullWidth: false,
36
+ loading: false,
33
37
  slot: 'Accent',
34
38
  type: 'button',
35
39
  variant: 'accent',
@@ -38,6 +42,8 @@ Accent.args = {
38
42
  export const Destructive = BaseTemplate.bind({});
39
43
  Destructive.args = {
40
44
  disabled: false,
45
+ fullWidth: false,
46
+ loading: false,
41
47
  slot: 'Destructive',
42
48
  type: 'button',
43
49
  variant: 'destructive',
@@ -46,6 +52,8 @@ Destructive.args = {
46
52
  export const Disclosure = BaseTemplate.bind({});
47
53
  Disclosure.args = {
48
54
  disabled: false,
55
+ fullWidth: false,
56
+ loading: false,
49
57
  slot: 'Disclosure',
50
58
  type: 'button',
51
59
  variant: 'disclosure'
@@ -56,9 +64,21 @@ Disclosure.parameters = {
56
64
  controls: { exclude: 'icon' }
57
65
  }
58
66
 
67
+ export const FullWidth = BaseTemplate.bind({});
68
+ FullWidth.args = {
69
+ disabled: false,
70
+ fullWidth: true,
71
+ loading: false,
72
+ slot: 'Full Width',
73
+ type: 'button',
74
+ variant: 'primary'
75
+ }
76
+
59
77
  export const Primary = BaseTemplate.bind({});
60
78
  Primary.args = {
61
79
  disabled: false,
80
+ fullWidth: false,
81
+ loading: false,
62
82
  slot: 'Primary',
63
83
  type: 'button',
64
84
  variant: 'primary'
@@ -67,7 +87,19 @@ Primary.args = {
67
87
  export const Secondary = BaseTemplate.bind({});
68
88
  Secondary.args = {
69
89
  disabled: false,
90
+ fullWidth: false,
91
+ loading: false,
70
92
  slot: 'Secondary',
93
+ type: 'button',
71
94
  variant: 'secondary',
95
+ }
96
+
97
+ export const Loading = BaseTemplate.bind({});
98
+ Loading.args = {
99
+ disabled: false,
100
+ fullWidth: false,
101
+ loading: true,
102
+ slot: 'Loading',
72
103
  type: 'button',
104
+ variant: 'primary',
73
105
  }
@@ -51,9 +51,9 @@ export class PdsCheckbox {
51
51
  return classNames.join(' ');
52
52
  }
53
53
  render() {
54
- return (h(Host, { key: '2e6627298218058dbd148b667664fa9c5732dfd2', class: this.classNames() }, h("input", { key: '09f2cffa460c9a0f96ae2fd21c8dd02312d50a6a', type: "checkbox", "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, id: this.componentId, indeterminate: this.indeterminate, name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onChange: this.handleCheckboxChange, onInput: this.handleInput }), h(PdsLabel, { key: '8a20482c4c25714f16bd6aa07b7c2a044223476c', htmlFor: this.componentId, text: this.label, classNames: this.labelHidden ? 'visually-hidden' : '' }), this.helperMessage &&
55
- h("div", { key: 'ef4b8f6b774b4679553a0374f129eef81783de6c', class: 'pds-checkbox__message', id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
56
- h("div", { key: '0c94e228cb82672d3e9a91722916fa20c53f5ff5', class: `pds-checkbox__message pds-checkbox__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: '545f0bc41110e89828ace83d2b34ab3bc83a8a3d', icon: danger, size: "small" }), this.errorMessage)));
54
+ return (h(Host, { key: '153bd77abfb36756b96e0a4fe9f992615e742987', class: this.classNames() }, h("input", { key: '089cddd89bc9244a5b17776d444c9e8183fb20fc', type: "checkbox", "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, id: this.componentId, indeterminate: this.indeterminate, name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onChange: this.handleCheckboxChange, onInput: this.handleInput }), h(PdsLabel, { key: '427fd2e9b065146eb1f8707da9bc21baddd9fe7e', htmlFor: this.componentId, text: this.label, classNames: this.labelHidden ? 'visually-hidden' : '' }), this.helperMessage &&
55
+ h("div", { key: '7f6fa0aa9fc730c58da1f686f94c6b2536bd1d80', class: 'pds-checkbox__message', id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
56
+ h("div", { key: 'e117555fd3b179f04ff969e2c04280e58adb228f', class: `pds-checkbox__message pds-checkbox__message--error`, id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: '442d8e53735ce15564c14a77eaf52939aa0ad895', icon: danger, size: "small" }), this.errorMessage)));
57
57
  }
58
58
  static get is() { return "pds-checkbox"; }
59
59
  static get encapsulation() { return "shadow"; }
@@ -31,7 +31,7 @@ export class PdsChip {
31
31
  return chipContent;
32
32
  }
33
33
  render() {
34
- return (h(Host, { key: '256ee05959d6561b0a2f208bad11ccc6b3b7b8ef', class: this.classNames(), id: this.componentId }, this.setChipContent(), this.variant === 'tag' && (h("button", { key: 'eb0593d00e34e0530af49bef45b211658c3d1842', class: "pds-chip__close", type: "button", onClick: this.handleCloseClick, "aria-label": "Remove" }, h("pds-icon", { key: 'ace8b0a28a1b2f731051fb645cb99f7f468ce9b8', icon: remove, size: "12px" })))));
34
+ return (h(Host, { key: '91f7d9a87538c4b30b16462061a61fb92812732f', class: this.classNames(), id: this.componentId }, this.setChipContent(), this.variant === 'tag' && (h("button", { key: 'bee8696d3644f33d8630a4ab93ff83c8b1d7ee78', class: "pds-chip__close", type: "button", onClick: this.handleCloseClick, "aria-label": "Remove" }, h("pds-icon", { key: '5a375bf7507f7ac674a6f3c27048e2c218064bb4', icon: remove, size: "12px" })))));
35
35
  }
36
36
  static get is() { return "pds-chip"; }
37
37
  static get encapsulation() { return "shadow"; }
@@ -36,7 +36,7 @@ export class PdsCopytext {
36
36
  return classNames.join(' ');
37
37
  }
38
38
  render() {
39
- return (h(Host, { key: '5efcd7642021a5049762c865be34bc1b649a40f9', class: this.classNames(), id: this.componentId }, h("pds-button", { key: '27b193cc3d52a599d33cba7b6cdb5b4c9d9fb234', type: "button", variant: "unstyled", onClick: this.handleClick }, h("span", { key: '0dbefb874870ebe4f9b2d261855d5f60fd155df8' }, this.value), h("pds-icon", { key: 'f5ad27e0bc677ba2a7f62c971ee9402bb268b3f4', icon: copyIcon, size: "16px" }))));
39
+ return (h(Host, { key: '46c38faeba9b70d2e510a4b6af08866577936478', class: this.classNames(), id: this.componentId }, h("pds-button", { key: '6e28c11a9a7a57f4c256b0283b64ec655a897f65', type: "button", variant: "unstyled", onClick: this.handleClick }, h("span", { key: '6818451171f85fd6ad63f07c69871082d3fcba4e' }, this.value), h("pds-icon", { key: '05e683d7b28575d924d6af482e6ce4c3cfee3f05', icon: copyIcon, size: "16px" }))));
40
40
  }
41
41
  static get is() { return "pds-copytext"; }
42
42
  static get encapsulation() { return "shadow"; }
@@ -17,7 +17,7 @@ export class PdsDivider {
17
17
  return classNames.join(' ');
18
18
  }
19
19
  render() {
20
- return (h(Host, { key: '655b579ae9137c8a6c663bc57928a0825d054d2d', id: this.componentId }, h("hr", { key: 'dcbc46f0b0bfa8553b577684775ab631022f73a0', class: this.classNames() })));
20
+ return (h(Host, { key: 'ee48ee45e0463abbd3cb7aa686f8d86928830ccb', id: this.componentId }, h("hr", { key: '4af739f85e502a7d9bff1b3581c283cb6ee53a0e', class: this.classNames() })));
21
21
  }
22
22
  static get is() { return "pds-divider"; }
23
23
  static get encapsulation() { return "shadow"; }
@@ -11,9 +11,9 @@ export class PdsImage {
11
11
  this.width = undefined;
12
12
  }
13
13
  render() {
14
- return (h(Host, { key: '784f2478acc28f043613c4c8fa67b5bef85820b1', class: {
14
+ return (h(Host, { key: '2b5893c36517ee6e30c12a141f19b3f13845db97', class: {
15
15
  'pds-image': true,
16
- }, id: this.componentId }, h("img", { key: '766a8230a6ea0ae45746fae832206785f963d215', alt: this.alt, height: this.height, loading: this.loading, sizes: this.sizes, src: this.src, srcset: this.srcset, width: this.width })));
16
+ }, id: this.componentId }, h("img", { key: '965043cab5ea5c62c52951ec90018bced5bb46e8', alt: this.alt, height: this.height, loading: this.loading, sizes: this.sizes, src: this.src, srcset: this.srcset, width: this.width })));
17
17
  }
18
18
  static get is() { return "pds-image"; }
19
19
  static get encapsulation() { return "shadow"; }
@@ -14,11 +14,7 @@
14
14
  flex-direction: column;
15
15
  }
16
16
 
17
- label {
18
- margin-block-end: var(--pine-dimension-xs);
19
- }
20
-
21
- input {
17
+ .pds-input__field {
22
18
  border: 1px solid var(--pine-color-border);
23
19
  border-radius: 10px;
24
20
  color: var(--pine-color-text-active);
@@ -28,7 +24,10 @@ input {
28
24
  /* stylelint-disable */
29
25
  /* stylelint-enable */
30
26
  }
31
- input:disabled {
27
+ .pds-input__field:hover:not(:disabled, .is-invalid) {
28
+ border: var(--pine-border-hover);
29
+ }
30
+ .pds-input__field:disabled {
32
31
  background-color: var(--pine-color-background-container-disabled);
33
32
  border-color: var(--pine-color-border-disabled);
34
33
  color: var(--pine-color-text-disabled);
@@ -36,45 +35,44 @@ input:disabled {
36
35
  /* stylelint-disable */
37
36
  /* stylelint-enable */
38
37
  }
39
- input:disabled::-webkit-input-placeholder {
38
+ .pds-input__field:disabled::-webkit-input-placeholder {
40
39
  color: var(--pine-color-text-placeholder-disabled);
41
40
  }
42
- input:disabled::-moz-placeholder {
41
+ .pds-input__field:disabled::-moz-placeholder {
43
42
  color: var(--pine-color-text-placeholder-disabled);
44
43
  }
45
- input:disabled::-moz-placeholder {
44
+ .pds-input__field:disabled::-moz-placeholder {
46
45
  color: var(--pine-color-text-placeholder-disabled);
47
46
  }
48
- input:disabled:-ms-input-placeholder {
47
+ .pds-input__field:disabled:-ms-input-placeholder {
49
48
  color: var(--pine-color-text-placeholder-disabled);
50
49
  }
51
- input:hover {
50
+ .pds-input__field:hover {
52
51
  border-color: var(--pine-color-border-hover);
53
52
  }
54
- input:focus-visible {
53
+ .pds-input__field:focus-visible {
55
54
  border-color: var(--pine-color-border-active);
56
55
  box-shadow: var(--box-shadow-focus);
57
56
  outline: none;
58
57
  }
59
- input::-webkit-input-placeholder {
58
+ .pds-input__field::-webkit-input-placeholder {
60
59
  color: var(--pine-color-text-placeholder);
61
60
  }
62
- input::-moz-placeholder {
61
+ .pds-input__field::-moz-placeholder {
63
62
  color: var(--pine-color-text-placeholder);
64
63
  }
65
- input::-moz-placeholder {
64
+ .pds-input__field::-moz-placeholder {
66
65
  color: var(--pine-color-text-placeholder);
67
66
  }
68
- input:-ms-input-placeholder {
67
+ .pds-input__field:-ms-input-placeholder {
69
68
  color: var(--pine-color-text-placeholder);
70
69
  }
71
- input:has(~ .pds-input__error-message) {
70
+ .pds-input__field.is-invalid {
72
71
  background-color: var(--pine-input-color-background-danger);
73
72
  border-color: var(--pine-color-border-danger);
74
73
  }
75
- input:has(~ .pds-input__error-message):focus-visible {
74
+ .pds-input__field.is-invalid:focus-visible {
76
75
  box-shadow: var(--box-shadow-focus-error);
77
- outline: none;
78
76
  }
79
77
 
80
78
  .pds-input__error-message,
@@ -107,10 +107,17 @@ export class PdsInput {
107
107
  componentDidLoad() {
108
108
  this.debounceChanged();
109
109
  }
110
+ inputClassNames() {
111
+ const classNames = ['pds-input__field'];
112
+ if (this.invalid && this.invalid === true) {
113
+ classNames.push('is-invalid');
114
+ }
115
+ return classNames.join(' ');
116
+ }
110
117
  render() {
111
- return (h(Host, { key: '4247c9ed871a2f5e39fea4c222367341eda18e32', "aria-disabled": this.disabled ? 'true' : null, "aria-readonly": this.readonly ? 'true' : null }, h("div", { key: 'b49fb30682b34b2c20ed6b0959d66e18050088d0', class: "pds-input" }, h("label", { key: 'ac028db52deca16edd0663ccccdc01d3651a299a', htmlFor: this.componentId }, this.label), h("input", Object.assign({ key: 'cf478f28743397013c0964aa3f6232de2a319f7a', class: "pds-input__field", ref: (input) => this.nativeInput = input, "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, autocomplete: this.autocomplete, disabled: this.disabled, id: this.componentId, name: this.name, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, type: this.type, value: this.value, onInput: this.onInputEvent, onChange: this.onChangeEvent, onBlur: this.onBlurEvent, onFocus: this.onFocusEvent, onCompositionstart: this.onCompositionStart, onCompositionend: this.onCompositionEnd }, this.inheritedAttributes)), this.helperMessage &&
112
- h("p", { key: '78180c0527fc6ef81d9e915898333a9e09e892e4', class: "pds-input__helper-message", id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
113
- h("p", { key: '9512deaecd57644da843557cd07ac8880cde424f', class: "pds-input__error-message", id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: '38c36403181b41c06f16e737f088e58199f07618', icon: danger, size: "small" }), this.errorMessage))));
118
+ return (h(Host, { key: 'a823b0086b4c4accc0788813a41b19f8b6ff32e1', "aria-disabled": this.disabled ? 'true' : null, "aria-readonly": this.readonly ? 'true' : null }, h("div", { key: 'e9b04aaa8e50c987e6010017fbb82bc7b6774d34', class: "pds-input" }, h("label", { key: 'c53aca73ab264954cd91e206a35c699833d0bb9b', htmlFor: this.componentId }, this.label), h("input", Object.assign({ key: 'ca86d6e35e71d9758bef9ddb277581ac5e337099', class: this.inputClassNames(), ref: (input) => this.nativeInput = input, "aria-describedby": assignDescription(this.componentId, this.invalid, this.helperMessage), "aria-invalid": this.invalid ? "true" : undefined, autocomplete: this.autocomplete, disabled: this.disabled, id: this.componentId, name: this.name, placeholder: this.placeholder, readOnly: this.readonly, required: this.required, type: this.type, value: this.value, onInput: this.onInputEvent, onChange: this.onChangeEvent, onBlur: this.onBlurEvent, onFocus: this.onFocusEvent, onCompositionstart: this.onCompositionStart, onCompositionend: this.onCompositionEnd }, this.inheritedAttributes)), this.helperMessage &&
119
+ h("p", { key: 'c7a845d961d149cba34661b487435bcc7a2d3b4f', class: "pds-input__helper-message", id: messageId(this.componentId, 'helper') }, this.helperMessage), this.errorMessage &&
120
+ h("p", { key: '0cb7785fd26b2573e04fdede1e84c4daac9c9052', class: "pds-input__error-message", id: messageId(this.componentId, 'error'), "aria-live": "assertive" }, h("pds-icon", { key: 'd8636ef0e49f4a32ab9ad91d5e51d4a1ca3fe4de', icon: danger, size: "small" }), this.errorMessage))));
114
121
  }
115
122
  static get is() { return "pds-input"; }
116
123
  static get encapsulation() { return "shadow"; }
@@ -345,7 +352,7 @@ export class PdsInput {
345
352
  "name": "defaultValue",
346
353
  "text": "\"text\""
347
354
  }],
348
- "text": "Determines the type of control that will be displayed\n`'email'`, `'number'`, `'password'`, `'tel'`, `'text'`"
355
+ "text": "Determines the type of control that will be displayed\n`'email'`, `'number'`, `'password'`, `'tel'`, `'text'`, `'url'`"
349
356
  },
350
357
  "attribute": "type",
351
358
  "reflect": false,
@@ -1 +1 @@
1
- {"version":3,"file":"pds-input.js","sourceRoot":"","sources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B,WAAW;wBAErB,iEAAU,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC,OAAO,GAAG;wBACtC,IAAI,CAAC,YAAY,CAChB,CAEF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport { assignDescription, messageId } from '../../utils/form';\nimport { danger } from '@pine-ds/icons/icons';\n\nimport { debounceEvent } from '@utils/utils';\nimport { inheritAriaAttributes } from '@utils/attributes';\n\nimport type { Attributes } from '@utils/attributes';\nimport type { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\n\n@Component({\n tag: 'pds-input',\n styleUrls: ['pds-input.tokens.scss', '../../global/styles/utils/label.scss', 'pds-input.scss'],\n shadow: true,\n})\nexport class PdsInput {\n private nativeInput?: HTMLInputElement;\n private inheritedAttributes: Attributes = {};\n private isComposing = false;\n /**\n * The value of the input when the input is focused.\n */\n private focusedValue?: string | number | null;\n\n private originalPdsInput?: EventEmitter<InputInputEventDetail>;\n\n @Element() el!: HTMLPdsInputElement;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() pdsBlur!: EventEmitter<FocusEvent>;\n\n /**\n *\n * Emitted when the value has changed.\n *\n * This event will not emit when programmatically setting the `value` property.\n */\n @Event() pdsChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() pdsFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when a keyboard input occurs.\n */\n @Event() pdsInput: EventEmitter<InputInputEventDetail>;\n\n /**\n * Sets focus on the native `input` in the `pds-input`. Use this method instead of the global\n * `input.focus()`.\n */\n @Method()\n async setFocus() {\n if ( this.nativeInput ) {\n this.nativeInput.focus();\n }\n }\n\n /**\n * Specifies if and how the browser provides `autocomplete` assistance for the field.\n */\n @Prop() autocomplete: string;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Sets the number of milliseconds to wait before updating the value.\n */\n @Prop() debounce?: number;\n\n /**\n * Determines whether or not the input field is disabled.\n */\n @Prop() disabled?: boolean;\n\n /**\n * Specifies the error message and provides an error-themed treatment to the field.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Displays a message or hint below the input field.\n */\n @Prop() helperMessage?: string;\n\n /**\n * Determines whether or not the input field is invalid or throws an error.\n */\n @Prop() invalid?: boolean;\n\n /**\n * Text to be displayed as the input label.\n */\n @Prop() label?: string;\n\n /**\n * Specifies the name. Submitted with the form name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * Specifies a short hint that describes the expected value of the input field.\n */\n @Prop() placeholder?: string;\n\n /**\n * Determines whether or not the input field is readonly.\n */\n @Prop() readonly?: boolean;\n\n /**\n * Determines whether or not the input field is required.\n */\n @Prop() required?: boolean;\n\n /**\n * Determines the type of control that will be displayed\n * `'email'`, `'number'`, `'password'`, `'tel'`, `'text'`\n * @defaultValue \"text\"\n */\n @Prop() type = 'text';\n\n /**\n * The value of the input.\n */\n @Prop({mutable: true}) value?: string | number | null = '';\n\n /**\n * Determines if the input has focus.\n */\n @State() hasFocus = false;\n\n\n @Watch('debounce')\n protected debounceChanged() {\n const { pdsInput, debounce, originalPdsInput } = this;\n\n /**\n * If debounce is undefined, we have to manually revert the pdsInput emitter in case\n * debounce used to be set to a number. Otherwise, the event would stay debounced.\n */\n this.pdsInput = debounce === undefined ? originalPdsInput ?? pdsInput : debounceEvent(pdsInput, debounce);\n }\n\n @Watch('value')\n protected valueChanged() {\n const nativeInput = this.nativeInput;\n const value = this.getValue();\n\n if (nativeInput && nativeInput.value !== value && !this.isComposing) {\n nativeInput.value = value;\n }\n }\n\n private getValue(): string {\n return typeof this.value === 'number' ? this.value.toString() : (this.value || '').toString();\n }\n\n private onInputEvent = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n this.emitInputChange(ev);\n };\n\n private onChangeEvent = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlurEvent = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `pdsChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.pdsBlur.emit(ev);\n };\n\n private onFocusEvent = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.pdsFocus.emit(ev);\n };\n\n private onCompositionStart = () => {\n this.isComposing = true;\n }\n\n private onCompositionEnd = () => {\n this.isComposing = false;\n }\n\n /**\n * Emits a pdsChange event\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n const newValue = value == null ? value : value.toString();\n\n this.focusedValue = newValue;\n this.pdsChange.emit({ value: newValue, event });\n }\n\n /**\n *\n * Emits a `pdsInput` event\n */\n private emitInputChange(event?: Event) {\n const { value } = this;\n\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n\n this.pdsInput.emit({ value: newValue, event });\n }\n\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el)\n }\n }\n\n componentDidLoad() {\n this.debounceChanged();\n }\n\n render() {\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n aria-readonly={this.readonly ? 'true' : null}\n >\n <div class=\"pds-input\">\n <label htmlFor={this.componentId}>{this.label}</label>\n <input class=\"pds-input__field\"\n ref={(input) => this.nativeInput = input}\n aria-describedby={assignDescription(this.componentId, this.invalid, this.helperMessage)}\n aria-invalid={this.invalid ? \"true\" : undefined}\n autocomplete={this.autocomplete}\n disabled={this.disabled}\n id={this.componentId}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n type={this.type}\n value={this.value}\n onInput={this.onInputEvent}\n onChange={this.onChangeEvent}\n onBlur={this.onBlurEvent}\n onFocus={this.onFocusEvent}\n onCompositionstart={this.onCompositionStart}\n onCompositionend={this.onCompositionEnd}\n {...this.inheritedAttributes}\n />\n {this.helperMessage &&\n <p\n class=\"pds-input__helper-message\"\n id={messageId(this.componentId, 'helper')}\n >\n {this.helperMessage}\n </p>\n }\n {this.errorMessage &&\n <p\n class=\"pds-input__error-message\"\n id={messageId(this.componentId, 'error')}\n aria-live=\"assertive\"\n >\n <pds-icon icon={danger} size=\"small\" />\n {this.errorMessage}\n </p>\n }\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"pds-input.js","sourceRoot":"","sources":["../../../src/components/pds-input/pds-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAU1D,MAAM,OAAO,QAAQ;;QAEX,wBAAmB,GAAe,EAAE,CAAC;QACrC,gBAAW,GAAG,KAAK,CAAC;QAmJpB,iBAAY,GAAG,CAAC,EAAS,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Method, Prop, State, Watch } from '@stencil/core';\nimport { assignDescription, messageId } from '../../utils/form';\nimport { danger } from '@pine-ds/icons/icons';\n\nimport { debounceEvent } from '@utils/utils';\nimport { inheritAriaAttributes } from '@utils/attributes';\n\nimport type { Attributes } from '@utils/attributes';\nimport type { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\n\n@Component({\n tag: 'pds-input',\n styleUrls: ['pds-input.tokens.scss', '../../global/styles/utils/label.scss', 'pds-input.scss'],\n shadow: true,\n})\nexport class PdsInput {\n private nativeInput?: HTMLInputElement;\n private inheritedAttributes: Attributes = {};\n private isComposing = false;\n /**\n * The value of the input when the input is focused.\n */\n private focusedValue?: string | number | null;\n\n private originalPdsInput?: EventEmitter<InputInputEventDetail>;\n\n @Element() el!: HTMLPdsInputElement;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() pdsBlur!: EventEmitter<FocusEvent>;\n\n /**\n *\n * Emitted when the value has changed.\n *\n * This event will not emit when programmatically setting the `value` property.\n */\n @Event() pdsChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() pdsFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when a keyboard input occurs.\n */\n @Event() pdsInput: EventEmitter<InputInputEventDetail>;\n\n /**\n * Sets focus on the native `input` in the `pds-input`. Use this method instead of the global\n * `input.focus()`.\n */\n @Method()\n async setFocus() {\n if ( this.nativeInput ) {\n this.nativeInput.focus();\n }\n }\n\n /**\n * Specifies if and how the browser provides `autocomplete` assistance for the field.\n */\n @Prop() autocomplete: string;\n\n /**\n * A unique identifier used for the underlying component `id` attribute.\n */\n @Prop() componentId!: string;\n\n /**\n * Sets the number of milliseconds to wait before updating the value.\n */\n @Prop() debounce?: number;\n\n /**\n * Determines whether or not the input field is disabled.\n */\n @Prop() disabled?: boolean;\n\n /**\n * Specifies the error message and provides an error-themed treatment to the field.\n */\n @Prop() errorMessage?: string;\n\n /**\n * Displays a message or hint below the input field.\n */\n @Prop() helperMessage?: string;\n\n /**\n * Determines whether or not the input field is invalid or throws an error.\n */\n @Prop() invalid?: boolean;\n\n /**\n * Text to be displayed as the input label.\n */\n @Prop() label?: string;\n\n /**\n * Specifies the name. Submitted with the form name/value pair.\n */\n @Prop() name?: string;\n\n /**\n * Specifies a short hint that describes the expected value of the input field.\n */\n @Prop() placeholder?: string;\n\n /**\n * Determines whether or not the input field is readonly.\n */\n @Prop() readonly?: boolean;\n\n /**\n * Determines whether or not the input field is required.\n */\n @Prop() required?: boolean;\n\n /**\n * Determines the type of control that will be displayed\n * `'email'`, `'number'`, `'password'`, `'tel'`, `'text'`, `'url'`\n * @defaultValue \"text\"\n */\n @Prop() type = 'text';\n\n /**\n * The value of the input.\n */\n @Prop({mutable: true}) value?: string | number | null = '';\n\n /**\n * Determines if the input has focus.\n */\n @State() hasFocus = false;\n\n\n @Watch('debounce')\n protected debounceChanged() {\n const { pdsInput, debounce, originalPdsInput } = this;\n\n /**\n * If debounce is undefined, we have to manually revert the pdsInput emitter in case\n * debounce used to be set to a number. Otherwise, the event would stay debounced.\n */\n this.pdsInput = debounce === undefined ? originalPdsInput ?? pdsInput : debounceEvent(pdsInput, debounce);\n }\n\n @Watch('value')\n protected valueChanged() {\n const nativeInput = this.nativeInput;\n const value = this.getValue();\n\n if (nativeInput && nativeInput.value !== value && !this.isComposing) {\n nativeInput.value = value;\n }\n }\n\n private getValue(): string {\n return typeof this.value === 'number' ? this.value.toString() : (this.value || '').toString();\n }\n\n private onInputEvent = (ev: Event) => {\n const input = ev.target as HTMLInputElement | null;\n if (input) {\n this.value = input.value || '';\n }\n this.emitInputChange(ev);\n };\n\n private onChangeEvent = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlurEvent = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `pdsChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.pdsBlur.emit(ev);\n };\n\n private onFocusEvent = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.pdsFocus.emit(ev);\n };\n\n private onCompositionStart = () => {\n this.isComposing = true;\n }\n\n private onCompositionEnd = () => {\n this.isComposing = false;\n }\n\n /**\n * Emits a pdsChange event\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n const newValue = value == null ? value : value.toString();\n\n this.focusedValue = newValue;\n this.pdsChange.emit({ value: newValue, event });\n }\n\n /**\n *\n * Emits a `pdsInput` event\n */\n private emitInputChange(event?: Event) {\n const { value } = this;\n\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n\n this.pdsInput.emit({ value: newValue, event });\n }\n\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el)\n }\n }\n\n componentDidLoad() {\n this.debounceChanged();\n }\n\n private inputClassNames() {\n const classNames = ['pds-input__field'];\n\n if (this.invalid && this.invalid === true) {\n classNames.push('is-invalid');\n }\n\n return classNames.join(' ');\n }\n\n render() {\n return (\n <Host\n aria-disabled={this.disabled ? 'true' : null}\n aria-readonly={this.readonly ? 'true' : null}\n >\n <div class=\"pds-input\">\n <label htmlFor={this.componentId}>{this.label}</label>\n <input\n class={this.inputClassNames()}\n ref={(input) => this.nativeInput = input}\n aria-describedby={assignDescription(this.componentId, this.invalid, this.helperMessage)}\n aria-invalid={this.invalid ? \"true\" : undefined}\n autocomplete={this.autocomplete}\n disabled={this.disabled}\n id={this.componentId}\n name={this.name}\n placeholder={this.placeholder}\n readOnly={this.readonly}\n required={this.required}\n type={this.type}\n value={this.value}\n onInput={this.onInputEvent}\n onChange={this.onChangeEvent}\n onBlur={this.onBlurEvent}\n onFocus={this.onFocusEvent}\n onCompositionstart={this.onCompositionStart}\n onCompositionend={this.onCompositionEnd}\n {...this.inheritedAttributes}\n />\n {this.helperMessage &&\n <p\n class=\"pds-input__helper-message\"\n id={messageId(this.componentId, 'helper')}\n >\n {this.helperMessage}\n </p>\n }\n {this.errorMessage &&\n <p\n class=\"pds-input__error-message\"\n id={messageId(this.componentId, 'error')}\n aria-live=\"assertive\"\n >\n <pds-icon icon={danger} size=\"small\" />\n {this.errorMessage}\n </p>\n }\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -23,8 +23,8 @@ export class PdsLink {
23
23
  return classNames.join(' ');
24
24
  }
25
25
  render() {
26
- return (h("a", { key: 'd21ad4828be4f730d996dfa814ea8f8863053a51', class: this.classNames(), href: this.href, id: this.componentId, target: this.external ? '_blank' : undefined, part: "link" }, h("slot", { key: '7e2dd2c8f33a12ba99a7b0c6f80e263c4fc7d695' }, this.href), this.external &&
27
- h("pds-icon", { key: '8e1597318fb76223ae25232b9f1a814781f25409', icon: launch, size: this.fontSize })));
26
+ return (h("a", { key: 'ee9b0a9897e2a212989d607c85f2050ee992bd32', class: this.classNames(), href: this.href, id: this.componentId, target: this.external ? '_blank' : undefined, part: "link" }, h("slot", { key: '611a4f9194ce38fd3b79c7e55281a625267846a4' }, this.href), this.external &&
27
+ h("pds-icon", { key: 'a527d217c8ef1e69a2ca127019fbeb3eb25b3a02', icon: launch, size: this.fontSize })));
28
28
  }
29
29
  static get is() { return "pds-link"; }
30
30
  static get encapsulation() { return "shadow"; }
@@ -1,4 +1,5 @@
1
1
  :host {
2
+ --loader-color: var(--pine-color-brand);
2
3
  align-items: center;
3
4
  display: flex;
4
5
  flex-direction: column;
@@ -19,11 +20,10 @@
19
20
  }
20
21
 
21
22
  .pds-loader--spinner svg {
22
- --color-background-spinner: var(--pine-color-brand);
23
23
  --number-spinner-timing: 2s;
24
24
  --number-spinner-path-timing: 1.5s;
25
25
  animation: rotate var(--number-spinner-timing) linear infinite;
26
- color: var(--color-background-spinner);
26
+ color: var(--loader-color);
27
27
  }
28
28
 
29
29
  .pds-loader__spinner-path {