@pitchfork-ui/elements 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/dist/cjs/control-label-C0eK8bPh.js +36 -0
  2. package/dist/cjs/control-label-C0eK8bPh.js.map +1 -0
  3. package/dist/cjs/index-CIskGKk1.js +4 -4
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/pf-checkbox.cjs.entry.js +3 -1
  6. package/dist/cjs/pf-checkbox.cjs.entry.js.map +1 -1
  7. package/dist/cjs/pf-combobox.cjs.entry.js +4 -3
  8. package/dist/cjs/pf-combobox.cjs.entry.js.map +1 -1
  9. package/dist/cjs/pf-date-picker.cjs.entry.js +3 -2
  10. package/dist/cjs/pf-date-picker.cjs.entry.js.map +1 -1
  11. package/dist/cjs/pf-date-range-picker.cjs.entry.js +6 -5
  12. package/dist/cjs/pf-date-range-picker.cjs.entry.js.map +1 -1
  13. package/dist/cjs/pf-header-navigation.cjs.entry.js +15 -3
  14. package/dist/cjs/pf-header-navigation.cjs.entry.js.map +1 -1
  15. package/dist/cjs/pf-input.cjs.entry.js +3 -1
  16. package/dist/cjs/pf-input.cjs.entry.js.map +1 -1
  17. package/dist/cjs/pf-modal.cjs.entry.js +89 -1
  18. package/dist/cjs/pf-modal.cjs.entry.js.map +1 -1
  19. package/dist/cjs/pf-multi-select.cjs.entry.js +4 -3
  20. package/dist/cjs/pf-multi-select.cjs.entry.js.map +1 -1
  21. package/dist/cjs/pf-nav-item.cjs.entry.js +29 -4
  22. package/dist/cjs/pf-nav-item.cjs.entry.js.map +1 -1
  23. package/dist/cjs/pf-number-input.cjs.entry.js +2 -1
  24. package/dist/cjs/pf-number-input.cjs.entry.js.map +1 -1
  25. package/dist/cjs/pf-select.cjs.entry.js +4 -3
  26. package/dist/cjs/pf-select.cjs.entry.js.map +1 -1
  27. package/dist/cjs/pf-sidebar-navigation.cjs.entry.js +11 -8
  28. package/dist/cjs/pf-sidebar-navigation.cjs.entry.js.map +1 -1
  29. package/dist/cjs/pf-slider.cjs.entry.js +4 -2
  30. package/dist/cjs/pf-slider.cjs.entry.js.map +1 -1
  31. package/dist/cjs/pf-switch.cjs.entry.js +3 -1
  32. package/dist/cjs/pf-switch.cjs.entry.js.map +1 -1
  33. package/dist/cjs/pf-tag-input.cjs.entry.js +3 -2
  34. package/dist/cjs/pf-tag-input.cjs.entry.js.map +1 -1
  35. package/dist/cjs/pf-textarea.cjs.entry.js +2 -1
  36. package/dist/cjs/pf-textarea.cjs.entry.js.map +1 -1
  37. package/dist/cjs/pf-time-picker.cjs.entry.js +3 -2
  38. package/dist/cjs/pf-time-picker.cjs.entry.js.map +1 -1
  39. package/dist/cjs/pitchfork.cjs.js +1 -1
  40. package/dist/collection/components/pf-accordion/pf-accordion.js +2 -2
  41. package/dist/collection/components/pf-alert/pf-alert.js +1 -1
  42. package/dist/collection/components/pf-avatar/pf-avatar.js +2 -2
  43. package/dist/collection/components/pf-badge/pf-badge.js +1 -1
  44. package/dist/collection/components/pf-badge-group/pf-badge-group.js +3 -3
  45. package/dist/collection/components/pf-button/pf-button.js +3 -3
  46. package/dist/collection/components/pf-checkbox/pf-checkbox.js +4 -1
  47. package/dist/collection/components/pf-checkbox/pf-checkbox.js.map +1 -1
  48. package/dist/collection/components/pf-combobox/pf-combobox.js +4 -3
  49. package/dist/collection/components/pf-combobox/pf-combobox.js.map +1 -1
  50. package/dist/collection/components/pf-content-divider/pf-content-divider.js +1 -1
  51. package/dist/collection/components/pf-credit-card/pf-credit-card.js +1 -1
  52. package/dist/collection/components/pf-date-picker/pf-date-picker.js +3 -2
  53. package/dist/collection/components/pf-date-picker/pf-date-picker.js.map +1 -1
  54. package/dist/collection/components/pf-date-range-picker/pf-date-range-picker.js +6 -5
  55. package/dist/collection/components/pf-date-range-picker/pf-date-range-picker.js.map +1 -1
  56. package/dist/collection/components/pf-empty-state/pf-empty-state.js +1 -1
  57. package/dist/collection/components/pf-header-navigation/pf-header-navigation.js +25 -4
  58. package/dist/collection/components/pf-header-navigation/pf-header-navigation.js.map +1 -1
  59. package/dist/collection/components/pf-inline-cta/pf-inline-cta.js +1 -1
  60. package/dist/collection/components/pf-input/pf-input.js +5 -2
  61. package/dist/collection/components/pf-input/pf-input.js.map +1 -1
  62. package/dist/collection/components/pf-kbd/pf-kbd.js +1 -1
  63. package/dist/collection/components/pf-line-chart/pf-line-chart.js +1 -1
  64. package/dist/collection/components/pf-loading-dots/pf-loading-dots.js +1 -1
  65. package/dist/collection/components/pf-metric-card/pf-metric-card.js +1 -1
  66. package/dist/collection/components/pf-modal/pf-modal.js +77 -6
  67. package/dist/collection/components/pf-modal/pf-modal.js.map +1 -1
  68. package/dist/collection/components/pf-multi-select/pf-multi-select.js +4 -3
  69. package/dist/collection/components/pf-multi-select/pf-multi-select.js.map +1 -1
  70. package/dist/collection/components/pf-nav-item/pf-nav-item.js +50 -5
  71. package/dist/collection/components/pf-nav-item/pf-nav-item.js.map +1 -1
  72. package/dist/collection/components/pf-notification/pf-notification.js +1 -1
  73. package/dist/collection/components/pf-number-input/pf-number-input.js +2 -1
  74. package/dist/collection/components/pf-number-input/pf-number-input.js.map +1 -1
  75. package/dist/collection/components/pf-progress-steps/pf-progress-steps.js +1 -1
  76. package/dist/collection/components/pf-radio-group/pf-radio-group.js +1 -1
  77. package/dist/collection/components/pf-rating-badge/pf-rating-badge.js +1 -1
  78. package/dist/collection/components/pf-scroll-area/pf-scroll-area.js +1 -1
  79. package/dist/collection/components/pf-section-header/pf-section-header.js +1 -1
  80. package/dist/collection/components/pf-select/pf-select.js +4 -3
  81. package/dist/collection/components/pf-select/pf-select.js.map +1 -1
  82. package/dist/collection/components/pf-sidebar-navigation/pf-sidebar-navigation.js +12 -9
  83. package/dist/collection/components/pf-sidebar-navigation/pf-sidebar-navigation.js.map +1 -1
  84. package/dist/collection/components/pf-slideout-menu/pf-slideout-menu.js +2 -2
  85. package/dist/collection/components/pf-slider/pf-slider.js +5 -2
  86. package/dist/collection/components/pf-slider/pf-slider.js.map +1 -1
  87. package/dist/collection/components/pf-switch/pf-switch.js +4 -1
  88. package/dist/collection/components/pf-switch/pf-switch.js.map +1 -1
  89. package/dist/collection/components/pf-tab/pf-tab.js +2 -2
  90. package/dist/collection/components/pf-table-cell/pf-table-cell.js +1 -1
  91. package/dist/collection/components/pf-tabs/pf-tabs.js +2 -2
  92. package/dist/collection/components/pf-tag/pf-tag.js +1 -1
  93. package/dist/collection/components/pf-tag-input/pf-tag-input.js +3 -2
  94. package/dist/collection/components/pf-tag-input/pf-tag-input.js.map +1 -1
  95. package/dist/collection/components/pf-textarea/pf-textarea.js +2 -1
  96. package/dist/collection/components/pf-textarea/pf-textarea.js.map +1 -1
  97. package/dist/collection/components/pf-time-picker/pf-time-picker.js +3 -2
  98. package/dist/collection/components/pf-time-picker/pf-time-picker.js.map +1 -1
  99. package/dist/collection/components/pf-timeline-item/pf-timeline-item.js +1 -1
  100. package/dist/collection/components/pf-toaster/pf-toaster.js +2 -2
  101. package/dist/collection/components/pf-toolbar/pf-toolbar.js +1 -1
  102. package/dist/collection/components/pf-toolbar-separator/pf-toolbar-separator.js +1 -1
  103. package/dist/collection/components/pf-utility-button/pf-utility-button.js +2 -2
  104. package/dist/collection/components/pf-video-player/pf-video-player.js +2 -2
  105. package/dist/collection/control-label.js +30 -0
  106. package/dist/collection/control-label.js.map +1 -0
  107. package/dist/components/p-Cy_kHPeC.js +2 -0
  108. package/dist/components/p-Cy_kHPeC.js.map +1 -0
  109. package/dist/components/pf-checkbox.js +1 -1
  110. package/dist/components/pf-checkbox.js.map +1 -1
  111. package/dist/components/pf-combobox.js +1 -1
  112. package/dist/components/pf-combobox.js.map +1 -1
  113. package/dist/components/pf-date-picker.js +1 -1
  114. package/dist/components/pf-date-picker.js.map +1 -1
  115. package/dist/components/pf-date-range-picker.js +1 -1
  116. package/dist/components/pf-date-range-picker.js.map +1 -1
  117. package/dist/components/pf-header-navigation.js +1 -1
  118. package/dist/components/pf-header-navigation.js.map +1 -1
  119. package/dist/components/pf-input.js +1 -1
  120. package/dist/components/pf-input.js.map +1 -1
  121. package/dist/components/pf-modal.js +1 -1
  122. package/dist/components/pf-modal.js.map +1 -1
  123. package/dist/components/pf-multi-select.js +1 -1
  124. package/dist/components/pf-multi-select.js.map +1 -1
  125. package/dist/components/pf-nav-item.js +1 -1
  126. package/dist/components/pf-nav-item.js.map +1 -1
  127. package/dist/components/pf-number-input.js +1 -1
  128. package/dist/components/pf-number-input.js.map +1 -1
  129. package/dist/components/pf-select.js +1 -1
  130. package/dist/components/pf-select.js.map +1 -1
  131. package/dist/components/pf-sidebar-navigation.js +1 -1
  132. package/dist/components/pf-sidebar-navigation.js.map +1 -1
  133. package/dist/components/pf-slider.js +1 -1
  134. package/dist/components/pf-slider.js.map +1 -1
  135. package/dist/components/pf-switch.js +1 -1
  136. package/dist/components/pf-switch.js.map +1 -1
  137. package/dist/components/pf-tag-input.js +1 -1
  138. package/dist/components/pf-tag-input.js.map +1 -1
  139. package/dist/components/pf-textarea.js +1 -1
  140. package/dist/components/pf-textarea.js.map +1 -1
  141. package/dist/components/pf-time-picker.js +1 -1
  142. package/dist/components/pf-time-picker.js.map +1 -1
  143. package/dist/docs.json +73 -52
  144. package/dist/elements.json +100 -10
  145. package/dist/esm/control-label-Cy_kHPeC.js +34 -0
  146. package/dist/esm/control-label-Cy_kHPeC.js.map +1 -0
  147. package/dist/esm/index-Bm6UxEit.js +4 -4
  148. package/dist/esm/loader.js +1 -1
  149. package/dist/esm/pf-checkbox.entry.js +4 -2
  150. package/dist/esm/pf-checkbox.entry.js.map +1 -1
  151. package/dist/esm/pf-combobox.entry.js +4 -3
  152. package/dist/esm/pf-combobox.entry.js.map +1 -1
  153. package/dist/esm/pf-date-picker.entry.js +3 -2
  154. package/dist/esm/pf-date-picker.entry.js.map +1 -1
  155. package/dist/esm/pf-date-range-picker.entry.js +6 -5
  156. package/dist/esm/pf-date-range-picker.entry.js.map +1 -1
  157. package/dist/esm/pf-header-navigation.entry.js +15 -3
  158. package/dist/esm/pf-header-navigation.entry.js.map +1 -1
  159. package/dist/esm/pf-input.entry.js +4 -2
  160. package/dist/esm/pf-input.entry.js.map +1 -1
  161. package/dist/esm/pf-modal.entry.js +89 -1
  162. package/dist/esm/pf-modal.entry.js.map +1 -1
  163. package/dist/esm/pf-multi-select.entry.js +4 -3
  164. package/dist/esm/pf-multi-select.entry.js.map +1 -1
  165. package/dist/esm/pf-nav-item.entry.js +30 -5
  166. package/dist/esm/pf-nav-item.entry.js.map +1 -1
  167. package/dist/esm/pf-number-input.entry.js +2 -1
  168. package/dist/esm/pf-number-input.entry.js.map +1 -1
  169. package/dist/esm/pf-select.entry.js +4 -3
  170. package/dist/esm/pf-select.entry.js.map +1 -1
  171. package/dist/esm/pf-sidebar-navigation.entry.js +11 -8
  172. package/dist/esm/pf-sidebar-navigation.entry.js.map +1 -1
  173. package/dist/esm/pf-slider.entry.js +5 -3
  174. package/dist/esm/pf-slider.entry.js.map +1 -1
  175. package/dist/esm/pf-switch.entry.js +4 -2
  176. package/dist/esm/pf-switch.entry.js.map +1 -1
  177. package/dist/esm/pf-tag-input.entry.js +3 -2
  178. package/dist/esm/pf-tag-input.entry.js.map +1 -1
  179. package/dist/esm/pf-textarea.entry.js +2 -1
  180. package/dist/esm/pf-textarea.entry.js.map +1 -1
  181. package/dist/esm/pf-time-picker.entry.js +3 -2
  182. package/dist/esm/pf-time-picker.entry.js.map +1 -1
  183. package/dist/esm/pitchfork.js +1 -1
  184. package/dist/pitchfork/p-01ed0d56.entry.js +2 -0
  185. package/dist/pitchfork/p-01ed0d56.entry.js.map +1 -0
  186. package/dist/pitchfork/p-02e28338.entry.js +2 -0
  187. package/dist/pitchfork/p-02e28338.entry.js.map +1 -0
  188. package/dist/pitchfork/p-19c0145c.entry.js +2 -0
  189. package/dist/pitchfork/p-19c0145c.entry.js.map +1 -0
  190. package/dist/pitchfork/p-22d8c69d.entry.js +2 -0
  191. package/dist/pitchfork/p-22d8c69d.entry.js.map +1 -0
  192. package/dist/pitchfork/p-2add2e98.entry.js +2 -0
  193. package/dist/pitchfork/p-2add2e98.entry.js.map +1 -0
  194. package/dist/pitchfork/p-45039de3.entry.js +2 -0
  195. package/dist/pitchfork/p-45039de3.entry.js.map +1 -0
  196. package/dist/pitchfork/p-4dfe7e8a.entry.js +2 -0
  197. package/dist/pitchfork/p-4dfe7e8a.entry.js.map +1 -0
  198. package/dist/pitchfork/p-51353d53.entry.js +2 -0
  199. package/dist/pitchfork/p-51353d53.entry.js.map +1 -0
  200. package/dist/pitchfork/p-5b98848c.entry.js +2 -0
  201. package/dist/pitchfork/{p-fd5a5ea1.entry.js.map → p-5b98848c.entry.js.map} +1 -1
  202. package/dist/pitchfork/p-7197ef71.entry.js +2 -0
  203. package/dist/pitchfork/p-7197ef71.entry.js.map +1 -0
  204. package/dist/pitchfork/p-Cy_kHPeC.js +2 -0
  205. package/dist/pitchfork/p-Cy_kHPeC.js.map +1 -0
  206. package/dist/pitchfork/p-ab6c09e7.entry.js +2 -0
  207. package/dist/pitchfork/p-ab6c09e7.entry.js.map +1 -0
  208. package/dist/pitchfork/p-d7ca4026.entry.js +2 -0
  209. package/dist/pitchfork/p-d7ca4026.entry.js.map +1 -0
  210. package/dist/pitchfork/p-dd48d94d.entry.js +2 -0
  211. package/dist/pitchfork/p-dd48d94d.entry.js.map +1 -0
  212. package/dist/pitchfork/p-ec8df806.entry.js +2 -0
  213. package/dist/pitchfork/p-ec8df806.entry.js.map +1 -0
  214. package/dist/pitchfork/p-f5df568f.entry.js +2 -0
  215. package/dist/pitchfork/p-f5df568f.entry.js.map +1 -0
  216. package/dist/pitchfork/p-f713c62d.entry.js +2 -0
  217. package/dist/pitchfork/p-f713c62d.entry.js.map +1 -0
  218. package/dist/pitchfork/p-fd802631.entry.js +2 -0
  219. package/dist/pitchfork/p-fd802631.entry.js.map +1 -0
  220. package/dist/pitchfork/pitchfork.esm.js +1 -1
  221. package/dist/types/components/pf-checkbox/pf-checkbox.d.ts +1 -0
  222. package/dist/types/components/pf-header-navigation/pf-header-navigation.d.ts +11 -2
  223. package/dist/types/components/pf-input/pf-input.d.ts +1 -0
  224. package/dist/types/components/pf-modal/pf-modal.d.ts +56 -3
  225. package/dist/types/components/pf-nav-item/pf-nav-item.d.ts +21 -1
  226. package/dist/types/components/pf-sidebar-navigation/pf-sidebar-navigation.d.ts +10 -7
  227. package/dist/types/components/pf-slider/pf-slider.d.ts +1 -0
  228. package/dist/types/components/pf-switch/pf-switch.d.ts +1 -0
  229. package/dist/types/components.d.ts +57 -18
  230. package/dist/types/control-label.d.ts +24 -0
  231. package/package.json +4 -4
  232. package/dist/pitchfork/p-1dbea97f.entry.js +0 -2
  233. package/dist/pitchfork/p-1dbea97f.entry.js.map +0 -1
  234. package/dist/pitchfork/p-23b1be9b.entry.js +0 -2
  235. package/dist/pitchfork/p-23b1be9b.entry.js.map +0 -1
  236. package/dist/pitchfork/p-33857f80.entry.js +0 -2
  237. package/dist/pitchfork/p-33857f80.entry.js.map +0 -1
  238. package/dist/pitchfork/p-47cabc33.entry.js +0 -2
  239. package/dist/pitchfork/p-47cabc33.entry.js.map +0 -1
  240. package/dist/pitchfork/p-48b2d3f7.entry.js +0 -2
  241. package/dist/pitchfork/p-48b2d3f7.entry.js.map +0 -1
  242. package/dist/pitchfork/p-5064d2dd.entry.js +0 -2
  243. package/dist/pitchfork/p-5064d2dd.entry.js.map +0 -1
  244. package/dist/pitchfork/p-52eef7eb.entry.js +0 -2
  245. package/dist/pitchfork/p-52eef7eb.entry.js.map +0 -1
  246. package/dist/pitchfork/p-845c5252.entry.js +0 -2
  247. package/dist/pitchfork/p-845c5252.entry.js.map +0 -1
  248. package/dist/pitchfork/p-a24bf2bd.entry.js +0 -2
  249. package/dist/pitchfork/p-a24bf2bd.entry.js.map +0 -1
  250. package/dist/pitchfork/p-a9b77dbb.entry.js +0 -2
  251. package/dist/pitchfork/p-a9b77dbb.entry.js.map +0 -1
  252. package/dist/pitchfork/p-c6bdd9cd.entry.js +0 -2
  253. package/dist/pitchfork/p-c6bdd9cd.entry.js.map +0 -1
  254. package/dist/pitchfork/p-d0d2070b.entry.js +0 -2
  255. package/dist/pitchfork/p-d0d2070b.entry.js.map +0 -1
  256. package/dist/pitchfork/p-d248b027.entry.js +0 -2
  257. package/dist/pitchfork/p-d248b027.entry.js.map +0 -1
  258. package/dist/pitchfork/p-d6425298.entry.js +0 -2
  259. package/dist/pitchfork/p-d6425298.entry.js.map +0 -1
  260. package/dist/pitchfork/p-d7eb6335.entry.js +0 -2
  261. package/dist/pitchfork/p-d7eb6335.entry.js.map +0 -1
  262. package/dist/pitchfork/p-e944f504.entry.js +0 -2
  263. package/dist/pitchfork/p-e944f504.entry.js.map +0 -1
  264. package/dist/pitchfork/p-fd5a5ea1.entry.js +0 -2
@@ -1 +1 @@
1
- {"file":"pf-date-picker.cjs.entry.js","mappings":";;;;;;;;;AAAA,MAAM,eAAe,GAAG,MAAM,CAAC,+4DAA+4D,CAAC;;MCoDl6D,YAAY,GAAA,MAAA;;;;;;;;;;;;;;AAEJ,IAAA,SAAS;AAE5B;;;AAGG;AACsB,IAAA,IAAI;;IAGJ,KAAK,GAAG,EAAE;;IAGK,IAAI,GAAG,KAAK;;AAG5C,IAAA,KAAK;;AAGL,IAAA,WAAW;;AAGX,IAAA,KAAK;IAEL,WAAW,GAAG,eAAe;IAEZ,QAAQ,GAAG,KAAK;IAEhB,QAAQ,GAAG,KAAK;;IAGjC,UAAU,GAAG,KAAK;;AAGlB,IAAA,GAAG;;AAGH,IAAA,GAAG;AAEH,IAAA,SAAS;AAET,IAAA,OAAO;IAEP,eAAe,GAAG,IAAI;;AAGtB,IAAA,cAAc;;AAGb,IAAA,QAAQ;;AAGR,IAAA,YAAY;;IAGb,YAAY,GAAG,EAAE;AAEjB,IAAA,aAAa;IAErB,iBAAiB,GAAA;QACf,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE;QAC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oredPosition","placePopover","Keys","date","parseISODate","composeDescribedBy","h","Host"],"sources":["src/components/pf-date-picker/pf-date-picker.css?tag=pf-date-picker&encapsulation=shadow","src/components/pf-date-picker/pf-date-picker.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.field {\n display: grid;\n gap: var(--space-1);\n}\n\n.label {\n color: var(--pf-field-label-text, var(--pf-input-label-text));\n font-size: var(--font-size-sm);\n font-weight: var(--font-weight-medium);\n}\n\n.required {\n color: var(--pf-input-invalid-border);\n margin-inline-start: var(--space-1);\n}\n\n.row {\n align-items: center;\n display: flex;\n gap: var(--space-2);\n}\n\n.trigger {\n align-items: center;\n background: var(--pf-input-bg);\n border: 1px solid var(--pf-input-border);\n border-radius: var(--radius-md);\n color: var(--pf-input-text);\n cursor: pointer;\n display: flex;\n flex: 1;\n font-family: inherit;\n font-size: var(--font-size-sm);\n gap: var(--space-2);\n justify-content: space-between;\n min-width: 0;\n padding: var(--space-2) var(--space-3);\n text-align: start;\n}\n\n.trigger:hover:not(:disabled) {\n border-color: var(--pf-input-border-hover);\n}\n\n.trigger:focus-visible {\n box-shadow: var(--pf-focus-ring);\n outline: none;\n}\n\n.trigger:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.trigger--invalid {\n border-color: var(--pf-input-invalid-border);\n}\n\n.value {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.value--placeholder {\n color: var(--pf-input-placeholder-text);\n}\n\n.clear {\n align-items: center;\n background: none;\n border: 0;\n border-radius: var(--radius-sm);\n color: var(--pf-input-text-muted, var(--pf-input-placeholder-text));\n cursor: pointer;\n display: inline-flex;\n flex-shrink: 0;\n justify-content: center;\n padding: var(--space-1);\n}\n\n.clear:hover:not(:disabled) {\n color: var(--pf-input-text);\n}\n\n.clear:focus-visible {\n box-shadow: var(--pf-focus-ring);\n outline: none;\n}\n\n.description {\n color: var(--pf-input-description-text);\n font-size: var(--font-size-xs);\n margin: 0;\n}\n\n.error {\n color: var(--pf-input-invalid-border);\n font-size: var(--font-size-xs);\n margin: 0;\n}\n\n/*\n * See src/place-popover.ts: `inset: auto; margin: 0` are what make the\n * coordinates mean what they say, since the UA stylesheet centres a popover.\n * Declared here and set inline, because no test project applies this file.\n */\n.panel {\n inset: auto;\n margin: 0;\n background: none;\n border: 0;\n overflow: visible;\n padding: 0;\n}\n\n.panel:popover-open {\n animation: pf-date-picker-in var(--pf-transition-enter);\n}\n\n/* Its own copy: @keyframes do not cross a shadow boundary. */\n@keyframes pf-date-picker-in {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .panel:popover-open {\n animation: none;\n }\n}\n","import {\n composeDescribedBy,\n Keys,\n observeAnchoredPosition,\n parseISODate,\n} from '@pitchfork-ui/core';\n\nimport { applyControlValidity } from '../../form-validity';\nimport { placePopover } from '../../place-popover';\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n Watch,\n} from '@stencil/core';\n\n/**\n * A form-associated date field: a trigger that opens `pf-calendar` in a\n * popover.\n *\n * Form-associated, which the React `DatePicker` is not — it is a button and a\n * portal, so its value reaches a surrounding `<form>` only if the consumer\n * wires it there themselves. Here the value is submitted as `YYYY-MM-DD`,\n * constraint validation works, and Angular's generated accessor has something\n * to bind to.\n *\n * The panel is a `popover`, so light dismiss and Escape are the browser's.\n * Unlike `pf-dropdown`, the trigger and the panel are both in *this* shadow\n * root, so `aria-controls` resolves and is worth setting — a same-root IDREF\n * is the one case that works, measured.\n *\n * @part field - the wrapper around label, control and messages.\n * @part label - the label element.\n * @part trigger - the button that opens the calendar.\n * @part clear - the clear button.\n * @part panel - the floating panel holding the calendar.\n * @part calendar - the calendar itself.\n * @part description - the hint text below the control.\n * @part error - the error message below the control.\n */\n@Component({\n tag: 'pf-date-picker',\n styleUrl: 'pf-date-picker.css',\n formAssociated: true,\n shadow: true,\n})\nexport class PfDatePicker {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * Submitted under this name. Reflected, because the submission name comes\n * from the content attribute and the generated bindings set properties.\n */\n @Prop({ reflect: true }) name?: string;\n\n /** The selected date as `YYYY-MM-DD`, or empty. */\n @Prop({ mutable: true }) value = '';\n\n /** Whether the calendar is showing. Reflected for the stylesheet. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** Visible label. In the same root as the trigger, so `for` works. */\n @Prop() label?: string;\n\n /** Hint text below the control. */\n @Prop() description?: string;\n\n /** Error message. Its presence is what marks the control invalid. */\n @Prop() error?: string;\n\n @Prop() placeholder = 'Select a date';\n\n @Prop({ reflect: true }) required = false;\n\n @Prop({ reflect: true }) disabled = false;\n\n /** Offer a button that empties the field. */\n @Prop() allowClear = false;\n\n /** Earliest selectable date, as `YYYY-MM-DD`. */\n @Prop() min?: string;\n\n /** Latest selectable date, as `YYYY-MM-DD`. */\n @Prop() max?: string;\n\n @Prop() startYear?: number;\n\n @Prop() endYear?: number;\n\n @Prop() showOutsideDays = true;\n\n /** A predicate for days that cannot be chosen; see `pf-calendar`. */\n @Prop() isDateDisabled?: (date: Date) => boolean;\n\n /** Fires when a date is chosen or cleared. */\n @Event() pfChange!: EventEmitter<{ value: string }>;\n\n /** Fires whenever the calendar opens or closes, whoever caused it. */\n @Event() pfOpenChange!: EventEmitter<{ open: boolean }>;\n\n /** What a form reset restores; `value` has been overwritten by then. */\n private initialValue = '';\n\n private stopObserving?: () => void;\n\n componentWillLoad() {\n this.initialValue = this.value ?? '';\n this.syncFormState();\n }\n\n disconnectedCallback() {\n this.stopObserving?.();\n }\n\n @Watch('value')\n @Watch('error')\n @Watch('required')\n syncFormState() {\n this.internals.setFormValue(this.value || null);\n applyControlValidity(this.internals, Boolean(this.value), this.required, this.error);\n }\n\n /** The one place an open or close is announced, whatever caused it. */\n @Watch('open')\n syncOpen(next: boolean, previous: boolean) {\n if (next) this.showPanel();\n else this.hidePanel();\n if (next !== previous) this.pfOpenChange.emit({ open: next });\n }\n\n /** Opens the calendar. */\n @Method()\n async show(): Promise<void> {\n if (!this.disabled) this.open = true;\n }\n\n /** Closes the calendar. */\n @Method()\n async hide(): Promise<void> {\n this.open = false;\n }\n\n @Method()\n async checkValidity(): Promise<boolean> {\n return this.internals.checkValidity();\n }\n\n @Method()\n async reportValidity(): Promise<boolean> {\n return this.internals.reportValidity();\n }\n\n @Method()\n async getValidationMessage(): Promise<string> {\n return this.internals.validationMessage;\n }\n\n /** A reset restores the value the field started with, not an empty one. */\n formResetCallback() {\n this.value = this.initialValue;\n }\n\n private get panel() {\n return this.el.shadowRoot?.querySelector<HTMLElement>('[part=\"panel\"]') ?? null;\n }\n\n private get trigger() {\n return this.el.shadowRoot?.querySelector<HTMLButtonElement>('[part=\"trigger\"]') ?? null;\n }\n\n private get calendar() {\n return (\n this.el.shadowRoot?.querySelector<HTMLElement & { focusSelectedDay(): Promise<void> }>(\n 'pf-calendar',\n ) ?? null\n );\n }\n\n private showPanel() {\n const panel = this.panel;\n if (this.disabled || !panel || panel.matches(':popover-open')) return;\n\n panel.showPopover();\n this.stopObserving?.();\n this.stopObserving = observeAnchoredPosition({\n getAnchor: () => this.trigger,\n getFloating: () => panel,\n align: 'start',\n matchAnchorWidth: false,\n flip: true,\n onChange: ({ left, top }) => placePopover(panel, left, top),\n });\n\n // Focus the grid, not the panel: the calendar owns its own tab stop, and\n // it asks for focus through a method rather than having it reached for.\n void this.calendar?.focusSelectedDay();\n }\n\n private hidePanel() {\n this.stopObserving?.();\n this.stopObserving = undefined;\n const panel = this.panel;\n if (panel?.matches(':popover-open')) panel.hidePopover();\n }\n\n /**\n * Mirrors a browser-driven close — a light dismiss or Escape — back into\n * `open`, which is what then announces it.\n */\n private onToggle = (event: ToggleEvent) => {\n const nowOpen = event.newState === 'open';\n if (this.open !== nowOpen) this.open = nowOpen;\n if (!nowOpen) this.trigger?.focus();\n };\n\n /**\n * Listens on the calendar element itself, not on the host.\n *\n * Both were tried. A `@Listen('pfChange')` on the host sees the calendar's\n * event *and* this element's own — a Stencil event is composed, so by then\n * both have been retargeted to the host and `event.target` cannot tell them\n * apart. Worse, `stopPropagation()` there does not help: the consumer's\n * listener is on that same node, and stopping propagation never stops\n * same-node listeners, so every pick reported twice. Caught by a test that\n * counted them.\n *\n * On the calendar, the event is stopped before it reaches the host at all,\n * which does not depend on listener registration order the way\n * `stopImmediatePropagation` would.\n */\n private bindCalendar = (element?: HTMLElement) => {\n if (!element || element === this.boundCalendar) return;\n this.boundCalendar = element;\n element.addEventListener('pfChange', this.onCalendarChange as EventListener);\n };\n\n private boundCalendar?: HTMLElement;\n\n private onCalendarChange = (event: CustomEvent<{ value: string }>) => {\n event.stopPropagation();\n\n this.value = event.detail.value;\n this.pfChange.emit({ value: this.value });\n this.open = false;\n this.trigger?.focus();\n };\n\n private clear = (event: MouseEvent) => {\n event.stopPropagation();\n if (!this.value) return;\n this.value = '';\n this.pfChange.emit({ value: '' });\n };\n\n /**\n * Down opens the calendar from a closed trigger, as a popup button should.\n * Escape is the browser's while the panel is open — `popover=\"auto\"` handles\n * it — so there is nothing to do here for it.\n */\n private onTriggerKeyDown = (event: KeyboardEvent) => {\n if (this.open || this.disabled) return;\n if (event.key === Keys.ArrowDown || event.key === Keys.Enter || event.key === Keys.Space) {\n if (event.key === Keys.ArrowDown) {\n event.preventDefault();\n this.open = true;\n }\n }\n };\n\n /** `MMM D, YYYY`, matching the React component's trigger text. */\n private formatted(): string {\n const date = parseISODate(this.value);\n if (!date) return '';\n return new Intl.DateTimeFormat('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n }).format(date);\n }\n\n render() {\n const describedBy = composeDescribedBy(\n this.description && 'description',\n this.error && 'error',\n );\n const text = this.formatted();\n\n return (\n <Host>\n <div class=\"field\" part=\"field\">\n {this.label && (\n <label class=\"label\" part=\"label\" htmlFor=\"trigger\">\n {this.label}\n {this.required && (\n <span class=\"required\" aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <div class=\"row\">\n <button\n id=\"trigger\"\n part=\"trigger\"\n class={{ trigger: true, 'trigger--invalid': Boolean(this.error) }}\n type=\"button\"\n disabled={this.disabled}\n aria-haspopup=\"dialog\"\n aria-expanded={this.open ? 'true' : 'false'}\n /* Same shadow root as the panel, so this IDREF resolves. */\n aria-controls=\"panel\"\n aria-invalid={this.error ? 'true' : null}\n aria-required={this.required ? 'true' : null}\n aria-describedby={describedBy}\n onClick={() => {\n if (!this.disabled) this.open = !this.open;\n }}\n onKeyDown={this.onTriggerKeyDown}\n >\n <span class={{ value: true, 'value--placeholder': !text }}>\n {text || this.placeholder}\n </span>\n <pf-icon name=\"calendar\"></pf-icon>\n </button>\n\n {this.allowClear && this.value && (\n <button\n class=\"clear\"\n part=\"clear\"\n type=\"button\"\n aria-label=\"Clear selected date\"\n disabled={this.disabled}\n onClick={this.clear}\n >\n <pf-icon name=\"circle-xmark\"></pf-icon>\n </button>\n )}\n </div>\n\n {this.description && (\n <p class=\"description\" part=\"description\" id=\"description\">\n {this.description}\n </p>\n )}\n {this.error && (\n <p class=\"error\" part=\"error\" id=\"error\">\n {this.error}\n </p>\n )}\n </div>\n\n <div\n id=\"panel\"\n part=\"panel\"\n class=\"panel\"\n popover=\"auto\"\n role=\"dialog\"\n aria-label=\"Choose a date\"\n onToggle={this.onToggle}\n >\n <pf-calendar\n ref={this.bindCalendar}\n part=\"calendar\"\n value={this.value || undefined}\n min={this.min}\n max={this.max}\n startYear={this.startYear}\n endYear={this.endYear}\n showOutsideDays={this.showOutsideDays}\n isDateDisabled={this.isDateDisabled}\n ></pf-calendar>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pf-date-picker.cjs.entry.js","mappings":";;;;;;;;;;AAAA,MAAM,eAAe,GAAG,MAAM,CAAC,+4DAA+4D,CAAC;;MCqDl6D,YAAY,GAAA,MAAA;;;;;;;;;;;;;;AAEJ,IAAA,SAAS;AAE5B;;;AAGG;AACs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Z,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,MAAM,EACd,IAAI,EAAC,QAAQ,EAAA,YAAA,EACF,eAAe,EAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAA,EAEvBA,OAAA,CAAA,aAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,GAAG,EAAE,IAAI,CAAC,YAAY,EACtB,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS,EAC9B,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,cAAc,EAAE,IAAI,CAAC,cAAc,EAAA,CACtB,CACX,CACD;;;;;;;;;;;;;;;;;;;;;;","names":["applyControlValidity","observeAnchoredPosition","placePopover","Keys","date","parseISODate","composeDescribedBy","h","Host","controlAriaLabel"],"sources":["src/components/pf-date-picker/pf-date-picker.css?tag=pf-date-picker&encapsulation=shadow","src/components/pf-date-picker/pf-date-picker.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.field {\n display: grid;\n gap: var(--space-1);\n}\n\n.label {\n color: var(--pf-field-label-text, var(--pf-input-label-text));\n font-size: var(--font-size-sm);\n font-weight: var(--font-weight-medium);\n}\n\n.required {\n color: var(--pf-input-invalid-border);\n margin-inline-start: var(--space-1);\n}\n\n.row {\n align-items: center;\n display: flex;\n gap: var(--space-2);\n}\n\n.trigger {\n align-items: center;\n background: var(--pf-input-bg);\n border: 1px solid var(--pf-input-border);\n border-radius: var(--radius-md);\n color: var(--pf-input-text);\n cursor: pointer;\n display: flex;\n flex: 1;\n font-family: inherit;\n font-size: var(--font-size-sm);\n gap: var(--space-2);\n justify-content: space-between;\n min-width: 0;\n padding: var(--space-2) var(--space-3);\n text-align: start;\n}\n\n.trigger:hover:not(:disabled) {\n border-color: var(--pf-input-border-hover);\n}\n\n.trigger:focus-visible {\n box-shadow: var(--pf-focus-ring);\n outline: none;\n}\n\n.trigger:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.trigger--invalid {\n border-color: var(--pf-input-invalid-border);\n}\n\n.value {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.value--placeholder {\n color: var(--pf-input-placeholder-text);\n}\n\n.clear {\n align-items: center;\n background: none;\n border: 0;\n border-radius: var(--radius-sm);\n color: var(--pf-input-text-muted, var(--pf-input-placeholder-text));\n cursor: pointer;\n display: inline-flex;\n flex-shrink: 0;\n justify-content: center;\n padding: var(--space-1);\n}\n\n.clear:hover:not(:disabled) {\n color: var(--pf-input-text);\n}\n\n.clear:focus-visible {\n box-shadow: var(--pf-focus-ring);\n outline: none;\n}\n\n.description {\n color: var(--pf-input-description-text);\n font-size: var(--font-size-xs);\n margin: 0;\n}\n\n.error {\n color: var(--pf-input-invalid-border);\n font-size: var(--font-size-xs);\n margin: 0;\n}\n\n/*\n * See src/place-popover.ts: `inset: auto; margin: 0` are what make the\n * coordinates mean what they say, since the UA stylesheet centres a popover.\n * Declared here and set inline, because no test project applies this file.\n */\n.panel {\n inset: auto;\n margin: 0;\n background: none;\n border: 0;\n overflow: visible;\n padding: 0;\n}\n\n.panel:popover-open {\n animation: pf-date-picker-in var(--pf-transition-enter);\n}\n\n/* Its own copy: @keyframes do not cross a shadow boundary. */\n@keyframes pf-date-picker-in {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .panel:popover-open {\n animation: none;\n }\n}\n","import {\n composeDescribedBy,\n Keys,\n observeAnchoredPosition,\n parseISODate,\n} from '@pitchfork-ui/core';\n\nimport { applyControlValidity } from '../../form-validity';\nimport { controlAriaLabel } from '../../control-label';\nimport { placePopover } from '../../place-popover';\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n Watch,\n} from '@stencil/core';\n\n/**\n * A form-associated date field: a trigger that opens `pf-calendar` in a\n * popover.\n *\n * Form-associated, which the React `DatePicker` is not — it is a button and a\n * portal, so its value reaches a surrounding `<form>` only if the consumer\n * wires it there themselves. Here the value is submitted as `YYYY-MM-DD`,\n * constraint validation works, and Angular's generated accessor has something\n * to bind to.\n *\n * The panel is a `popover`, so light dismiss and Escape are the browser's.\n * Unlike `pf-dropdown`, the trigger and the panel are both in *this* shadow\n * root, so `aria-controls` resolves and is worth setting — a same-root IDREF\n * is the one case that works, measured.\n *\n * @part field - the wrapper around label, control and messages.\n * @part label - the label element.\n * @part trigger - the button that opens the calendar.\n * @part clear - the clear button.\n * @part panel - the floating panel holding the calendar.\n * @part calendar - the calendar itself.\n * @part description - the hint text below the control.\n * @part error - the error message below the control.\n */\n@Component({\n tag: 'pf-date-picker',\n styleUrl: 'pf-date-picker.css',\n formAssociated: true,\n shadow: true,\n})\nexport class PfDatePicker {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * Submitted under this name. Reflected, because the submission name comes\n * from the content attribute and the generated bindings set properties.\n */\n @Prop({ reflect: true }) name?: string;\n\n /** The selected date as `YYYY-MM-DD`, or empty. */\n @Prop({ mutable: true }) value = '';\n\n /** Whether the calendar is showing. Reflected for the stylesheet. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n /** Visible label. In the same root as the trigger, so `for` works. */\n @Prop() label?: string;\n\n /** Hint text below the control. */\n @Prop() description?: string;\n\n /** Error message. Its presence is what marks the control invalid. */\n @Prop() error?: string;\n\n @Prop() placeholder = 'Select a date';\n\n @Prop({ reflect: true }) required = false;\n\n @Prop({ reflect: true }) disabled = false;\n\n /** Offer a button that empties the field. */\n @Prop() allowClear = false;\n\n /** Earliest selectable date, as `YYYY-MM-DD`. */\n @Prop() min?: string;\n\n /** Latest selectable date, as `YYYY-MM-DD`. */\n @Prop() max?: string;\n\n @Prop() startYear?: number;\n\n @Prop() endYear?: number;\n\n @Prop() showOutsideDays = true;\n\n /** A predicate for days that cannot be chosen; see `pf-calendar`. */\n @Prop() isDateDisabled?: (date: Date) => boolean;\n\n /** Fires when a date is chosen or cleared. */\n @Event() pfChange!: EventEmitter<{ value: string }>;\n\n /** Fires whenever the calendar opens or closes, whoever caused it. */\n @Event() pfOpenChange!: EventEmitter<{ open: boolean }>;\n\n /** What a form reset restores; `value` has been overwritten by then. */\n private initialValue = '';\n\n private stopObserving?: () => void;\n\n componentWillLoad() {\n this.initialValue = this.value ?? '';\n this.syncFormState();\n }\n\n disconnectedCallback() {\n this.stopObserving?.();\n }\n\n @Watch('value')\n @Watch('error')\n @Watch('required')\n syncFormState() {\n this.internals.setFormValue(this.value || null);\n applyControlValidity(this.internals, Boolean(this.value), this.required, this.error);\n }\n\n /** The one place an open or close is announced, whatever caused it. */\n @Watch('open')\n syncOpen(next: boolean, previous: boolean) {\n if (next) this.showPanel();\n else this.hidePanel();\n if (next !== previous) this.pfOpenChange.emit({ open: next });\n }\n\n /** Opens the calendar. */\n @Method()\n async show(): Promise<void> {\n if (!this.disabled) this.open = true;\n }\n\n /** Closes the calendar. */\n @Method()\n async hide(): Promise<void> {\n this.open = false;\n }\n\n @Method()\n async checkValidity(): Promise<boolean> {\n return this.internals.checkValidity();\n }\n\n @Method()\n async reportValidity(): Promise<boolean> {\n return this.internals.reportValidity();\n }\n\n @Method()\n async getValidationMessage(): Promise<string> {\n return this.internals.validationMessage;\n }\n\n /** A reset restores the value the field started with, not an empty one. */\n formResetCallback() {\n this.value = this.initialValue;\n }\n\n private get panel() {\n return this.el.shadowRoot?.querySelector<HTMLElement>('[part=\"panel\"]') ?? null;\n }\n\n private get trigger() {\n return this.el.shadowRoot?.querySelector<HTMLButtonElement>('[part=\"trigger\"]') ?? null;\n }\n\n private get calendar() {\n return (\n this.el.shadowRoot?.querySelector<HTMLElement & { focusSelectedDay(): Promise<void> }>(\n 'pf-calendar',\n ) ?? null\n );\n }\n\n private showPanel() {\n const panel = this.panel;\n if (this.disabled || !panel || panel.matches(':popover-open')) return;\n\n panel.showPopover();\n this.stopObserving?.();\n this.stopObserving = observeAnchoredPosition({\n getAnchor: () => this.trigger,\n getFloating: () => panel,\n align: 'start',\n matchAnchorWidth: false,\n flip: true,\n onChange: ({ left, top }) => placePopover(panel, left, top),\n });\n\n // Focus the grid, not the panel: the calendar owns its own tab stop, and\n // it asks for focus through a method rather than having it reached for.\n void this.calendar?.focusSelectedDay();\n }\n\n private hidePanel() {\n this.stopObserving?.();\n this.stopObserving = undefined;\n const panel = this.panel;\n if (panel?.matches(':popover-open')) panel.hidePopover();\n }\n\n /**\n * Mirrors a browser-driven close — a light dismiss or Escape — back into\n * `open`, which is what then announces it.\n */\n private onToggle = (event: ToggleEvent) => {\n const nowOpen = event.newState === 'open';\n if (this.open !== nowOpen) this.open = nowOpen;\n if (!nowOpen) this.trigger?.focus();\n };\n\n /**\n * Listens on the calendar element itself, not on the host.\n *\n * Both were tried. A `@Listen('pfChange')` on the host sees the calendar's\n * event *and* this element's own — a Stencil event is composed, so by then\n * both have been retargeted to the host and `event.target` cannot tell them\n * apart. Worse, `stopPropagation()` there does not help: the consumer's\n * listener is on that same node, and stopping propagation never stops\n * same-node listeners, so every pick reported twice. Caught by a test that\n * counted them.\n *\n * On the calendar, the event is stopped before it reaches the host at all,\n * which does not depend on listener registration order the way\n * `stopImmediatePropagation` would.\n */\n private bindCalendar = (element?: HTMLElement) => {\n if (!element || element === this.boundCalendar) return;\n this.boundCalendar = element;\n element.addEventListener('pfChange', this.onCalendarChange as EventListener);\n };\n\n private boundCalendar?: HTMLElement;\n\n private onCalendarChange = (event: CustomEvent<{ value: string }>) => {\n event.stopPropagation();\n\n this.value = event.detail.value;\n this.pfChange.emit({ value: this.value });\n this.open = false;\n this.trigger?.focus();\n };\n\n private clear = (event: MouseEvent) => {\n event.stopPropagation();\n if (!this.value) return;\n this.value = '';\n this.pfChange.emit({ value: '' });\n };\n\n /**\n * Down opens the calendar from a closed trigger, as a popup button should.\n * Escape is the browser's while the panel is open — `popover=\"auto\"` handles\n * it — so there is nothing to do here for it.\n */\n private onTriggerKeyDown = (event: KeyboardEvent) => {\n if (this.open || this.disabled) return;\n if (event.key === Keys.ArrowDown || event.key === Keys.Enter || event.key === Keys.Space) {\n if (event.key === Keys.ArrowDown) {\n event.preventDefault();\n this.open = true;\n }\n }\n };\n\n /** `MMM D, YYYY`, matching the React component's trigger text. */\n private formatted(): string {\n const date = parseISODate(this.value);\n if (!date) return '';\n return new Intl.DateTimeFormat('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n }).format(date);\n }\n\n render() {\n const describedBy = composeDescribedBy(\n this.description && 'description',\n this.error && 'error',\n );\n const text = this.formatted();\n\n return (\n <Host>\n <div class=\"field\" part=\"field\">\n {this.label && (\n <label class=\"label\" part=\"label\" htmlFor=\"trigger\">\n {this.label}\n {this.required && (\n <span class=\"required\" aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <div class=\"row\">\n <button\n id=\"trigger\"\n aria-label={controlAriaLabel(this.el, this.label)}\n part=\"trigger\"\n class={{ trigger: true, 'trigger--invalid': Boolean(this.error) }}\n type=\"button\"\n disabled={this.disabled}\n aria-haspopup=\"dialog\"\n aria-expanded={this.open ? 'true' : 'false'}\n /* Same shadow root as the panel, so this IDREF resolves. */\n aria-controls=\"panel\"\n aria-invalid={this.error ? 'true' : null}\n aria-required={this.required ? 'true' : null}\n aria-describedby={describedBy}\n onClick={() => {\n if (!this.disabled) this.open = !this.open;\n }}\n onKeyDown={this.onTriggerKeyDown}\n >\n <span class={{ value: true, 'value--placeholder': !text }}>\n {text || this.placeholder}\n </span>\n <pf-icon name=\"calendar\"></pf-icon>\n </button>\n\n {this.allowClear && this.value && (\n <button\n class=\"clear\"\n part=\"clear\"\n type=\"button\"\n aria-label=\"Clear selected date\"\n disabled={this.disabled}\n onClick={this.clear}\n >\n <pf-icon name=\"circle-xmark\"></pf-icon>\n </button>\n )}\n </div>\n\n {this.description && (\n <p class=\"description\" part=\"description\" id=\"description\">\n {this.description}\n </p>\n )}\n {this.error && (\n <p class=\"error\" part=\"error\" id=\"error\">\n {this.error}\n </p>\n )}\n </div>\n\n <div\n id=\"panel\"\n part=\"panel\"\n class=\"panel\"\n popover=\"auto\"\n role=\"dialog\"\n aria-label=\"Choose a date\"\n onToggle={this.onToggle}\n >\n <pf-calendar\n ref={this.bindCalendar}\n part=\"calendar\"\n value={this.value || undefined}\n min={this.min}\n max={this.max}\n startYear={this.startYear}\n endYear={this.endYear}\n showOutsideDays={this.showOutsideDays}\n isDateDisabled={this.isDateDisabled}\n ></pf-calendar>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -6,6 +6,7 @@ var aria = require('./aria-5oCPUGFo.js');
6
6
  var date = require('./date-CzVt5Lej.js');
7
7
  var keys = require('./keys-S3YTuCcn.js');
8
8
  var formValidity = require('./form-validity-BCrcqnZ7.js');
9
+ var controlLabel = require('./control-label-C0eK8bPh.js');
9
10
 
10
11
  //#region src/date-range.ts
11
12
  /**
@@ -436,16 +437,16 @@ const PfDateRangePicker = class {
436
437
  const describedBy = aria.composeDescribedBy(this.description && 'description', this.error && 'error');
437
438
  const text = this.formatted();
438
439
  const right = date.addMonths(this.leftMonth, 1);
439
- return (index.h(index.Host, { key: 'c769f8e46ecb2b1cc36fb6569f5c52c602d5bace' }, index.h("div", { key: '9800b4ea3fbd90e9ce1aa0e14b1c18c960da6c80', class: "field", part: "field" }, this.label && (index.h("label", { key: 'da11753ffc0352c61aa63c57fa03f84dbff7b8be', class: "label", part: "label", htmlFor: "trigger" }, this.label, this.required && (index.h("span", { key: '156cce16b0dcd46f94cf13f87bf2bdeebb1f8bd3', class: "required", "aria-hidden": "true" }, "*")))), index.h("div", { key: '9ff549ec5c220e04049055b813eb979fdf87a835', class: "row-controls" }, index.h("button", { key: 'b4245ab2a3fe86abfc33b451eb4cc4994ef78480', id: "trigger", part: "trigger", class: { trigger: true, 'trigger--invalid': Boolean(this.error) }, type: "button", disabled: this.disabled, "aria-haspopup": "dialog", "aria-expanded": this.open ? 'true' : 'false', "aria-controls": "panel", "aria-invalid": this.error ? 'true' : null, "aria-required": this.required ? 'true' : null, "aria-describedby": describedBy, onClick: () => {
440
+ return (index.h(index.Host, { key: 'e581ed7c3a2449e96b594a4d650d7d16225c502b' }, index.h("div", { key: '42af6feb4a669c989f734bf179e0f60c24a47401', class: "field", part: "field" }, this.label && (index.h("label", { key: '5a6b9ea4e2bcdb7c07801c474a901ae4019d397f', class: "label", part: "label", htmlFor: "trigger" }, this.label, this.required && (index.h("span", { key: '6e90bc09ed442464ea424d47e60a64951df45eea', class: "required", "aria-hidden": "true" }, "*")))), index.h("div", { key: 'b0b66d4bf30cc7228e7e2153e9be05d71401ec20', class: "row-controls" }, index.h("button", { key: '46cfbfeb5e679bb00dd48e7b718350db4530e82e', id: "trigger", "aria-label": controlLabel.controlAriaLabel(this.el, this.label), part: "trigger", class: { trigger: true, 'trigger--invalid': Boolean(this.error) }, type: "button", disabled: this.disabled, "aria-haspopup": "dialog", "aria-expanded": this.open ? 'true' : 'false', "aria-controls": "panel", "aria-invalid": this.error ? 'true' : null, "aria-required": this.required ? 'true' : null, "aria-describedby": describedBy, onClick: () => {
440
441
  if (!this.disabled)
441
442
  this.open = !this.open;
442
- } }, index.h("span", { key: '02e3efca7af827add1fa80519cdf995c7cb54dc3', class: { value: true, 'value--placeholder': !text } }, text || this.placeholder), index.h("pf-icon", { key: 'e2139c1b236edfd82e109caeb778de8c1c43468d', name: "calendar" })), this.allowClear && (this.value || this.pendingStart) && (index.h("button", { key: 'f2572d3f798e9ba895b1165d024522014cfbb5ab', class: "clear", part: "clear", type: "button", "aria-label": "Clear selected dates", disabled: this.disabled, onClick: this.clear }, index.h("pf-icon", { key: 'd22ecfecc4114815c557b60d4908a9bbea6e8b1d', name: "circle-xmark" })))), this.description && (index.h("p", { key: 'f5399489f7666e2b7b7d4bbc1885e74a52e32cd4', class: "description", part: "description", id: "description" }, this.description)), this.error && (index.h("p", { key: '1a46f2d10e6edcc47979ecbb0724958a9790b2db', class: "error", part: "error", id: "error" }, this.error))), index.h("div", { key: '2aaa30dcd06ab95ebe7973d2783224cf236b57ef', id: "panel", part: "panel", class: "panel", popover: "auto", role: "dialog", "aria-label": "Choose a date range", onToggle: this.onToggle, onKeyDown: this.onKeyDown, onMouseLeave: () => {
443
+ } }, index.h("span", { key: '4bcf49fdfed1cef4f458c5019315ea833d8575e0', class: { value: true, 'value--placeholder': !text } }, text || this.placeholder), index.h("pf-icon", { key: 'da03fb4ccb5aef720f042adae79d701148ade479', name: "calendar" })), this.allowClear && (this.value || this.pendingStart) && (index.h("button", { key: 'f6b36144e765a28a15e7addf3d10d4aff1d25a00', class: "clear", part: "clear", type: "button", "aria-label": "Clear selected dates", disabled: this.disabled, onClick: this.clear }, index.h("pf-icon", { key: 'f4fb9769008137437b26c14c54d4d73909729da9', name: "circle-xmark" })))), this.description && (index.h("p", { key: '084a2a397d5277d237310cd9c202dce0028fcf78', class: "description", part: "description", id: "description" }, this.description)), this.error && (index.h("p", { key: '9fa6a9400ded59e6c0263012ce4d4be1d04c9352', class: "error", part: "error", id: "error" }, this.error))), index.h("div", { key: 'f8b15d11302ae13a7d9d21fea5ce5db3d0c407cc', id: "panel", part: "panel", class: "panel", popover: "auto", role: "dialog", "aria-label": "Choose a date range", onToggle: this.onToggle, onKeyDown: this.onKeyDown, onMouseLeave: () => {
443
444
  this.hovered = null;
444
- } }, index.h("div", { key: 'd5c052b2ce87bb5a19492a3d2afe65a8be50aac6', class: "nav" }, index.h("button", { key: '3f04ddb2cfea5ef4c05380a81c1f4cd2b43be396', type: "button", class: "step", "aria-label": "Previous month", onClick: () => {
445
+ } }, index.h("div", { key: '39a29079e9e97d19272ef9d5ec9fa02c2c368f6a', class: "nav" }, index.h("button", { key: '8e0fb9c8e800e53a88dfa98c928966a919f4dee0', type: "button", class: "step", "aria-label": "Previous month", onClick: () => {
445
446
  this.leftMonth = this.clamp(date.addMonths(this.leftMonth, -1));
446
- } }, index.h("pf-icon", { key: 'cb18b7c7e71a687d6220126f503a36170f1afc2f', name: "square-caret-left" })), index.h("button", { key: '837bf1095910392e6a0249f785e558ecf729e870', type: "button", class: "step", "aria-label": "Next month", onClick: () => {
447
+ } }, index.h("pf-icon", { key: 'df4f5aa6dfc5b387a9d73c674f25e5f445ad4778', name: "square-caret-left" })), index.h("button", { key: 'c48a949065acfb0e16fce8b732399f6fa9d8204c', type: "button", class: "step", "aria-label": "Next month", onClick: () => {
447
448
  this.leftMonth = this.clamp(date.addMonths(this.leftMonth, 1));
448
- } }, index.h("pf-icon", { key: 'bd56b0173777c7dc13bc9c052e2ccb7fc81cefb1', name: "square-caret-right" }))), index.h("div", { key: '102f50860c882a493ec9b8f9098d0703f4ecaf40', class: "months" }, this.renderGrid(this.leftMonth), this.renderGrid(right)))));
449
+ } }, index.h("pf-icon", { key: '10ae6ca6d30cbfdbd538d1a5247a6c83b299fd7a', name: "square-caret-right" }))), index.h("div", { key: '46610cb99d27eda167a28c281a5c1462fd5ab19c', class: "months" }, this.renderGrid(this.leftMonth), this.renderGrid(right)))));
449
450
  }
450
451
  static get formAssociated() { return true; }
451
452
  static get watchers() { return {
@@ -1 +1 @@
1
- {"file":"pf-date-range-picker.cjs.entry.js","mappings":";;;;;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAAsB,CAAC,OAAO,EAAEA,MAAI,EAAE;AAC/C,CAAC,MAAM,OAAO,GAAGC,aAAQ,CAACD,MAAI,CAAC;AAC/B,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO;AAC1D,EAAE,KAAK,EAAE;AACT,GAAG,KAAK,EAAE,OAAO;AACjB,GAAG,GAAG,EAAE;AACR,GAAG;AACH,EAAE,WAAW,EAAE;AACf,E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KAAK,CAACH,cAAS,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;aAC1D,EAAA,EAEDG,OAAA,CAAA,SAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAS,IAAI,EAAC,oBAAoB,EAAA,CAAW,CACtC,CACL,EAENA,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,QAAQ,EAAA,EAChB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAC/B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CACnB,CACF,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["date","toMidday","isSameDay","Keys","startOfMonth","formatISODate","applyControlValidity","parseISODate","clampMonthToYearRange","isOutsideDateRange","observeAnchoredPosition","placePopover","moveCalendarDate","addMonths","isSameMonth","buildCalendarDays","h","WEEKDAY_LABELS","CALENDAR_CELL_COUNT","composeDescribedBy","Host"],"sources":["../core/dist/date-range.js","src/components/pf-date-range-picker/pf-date-range-picker.css?tag=pf-date-range-picker&encapsulation=shadow","src/components/pf-date-range-picker/pf-date-range-picker.tsx"],"sourcesContent":["import { isSameDay, toMidday } from \"./date.js\";\n//#region src/date-range.ts\n/**\n* Where a click on `date` leaves the selection.\n*\n* Three cases, and the second two are the ones worth naming:\n* - not awaiting an end: start the range here and wait for the other end;\n* - awaiting an end, clicked before the start: the two swap, because a range\n* has no opinion about which end the user picked first;\n* - awaiting an end, clicked the start again: start over rather than make a\n* one-day range, which is what the React component does and is the kinder\n* reading of a double click.\n*/\nfunction nextDateRangeSelection(current, date) {\n\tconst clicked = toMidday(date);\n\tif (!current.awaitingEnd || !current.range.start) return {\n\t\trange: {\n\t\t\tstart: clicked,\n\t\t\tend: null\n\t\t},\n\t\tawaitingEnd: true\n\t};\n\tconst start = current.range.start;\n\tif (isSameDay(start, clicked)) return {\n\t\trange: {\n\t\t\tstart: clicked,\n\t\t\tend: null\n\t\t},\n\t\tawaitingEnd: true\n\t};\n\treturn {\n\t\trange: clicked.getTime() < start.getTime() ? {\n\t\t\tstart: clicked,\n\t\t\tend: start\n\t\t} : {\n\t\t\tstart,\n\t\t\tend: clicked\n\t\t},\n\t\tawaitingEnd: false\n\t};\n}\n/**\n* How a day should read, given the range and whatever is hovered.\n*\n* A hovered day stands in for the missing end while the range is half-made,\n* which is what makes the preview follow the pointer. It stands in only when\n* there is a start and no end — hovering before the first click previews\n* nothing.\n*/\nfunction rangeDayState(date, range, hovered = null) {\n\tconst { start } = range;\n\tconst end = range.end ?? (start && hovered ? hovered : null);\n\tconst isStart = Boolean(start && isSameDay(date, start));\n\tconst isEnd = Boolean(end && isSameDay(date, end));\n\tif (!start || !end) return {\n\t\tisStart,\n\t\tisEnd,\n\t\tisInside: false\n\t};\n\tconst [low, high] = start.getTime() <= end.getTime() ? [start, end] : [end, start];\n\tconst day = date.getTime();\n\treturn {\n\t\tisStart,\n\t\tisEnd,\n\t\tisInside: day > low.getTime() && day < high.getTime()\n\t};\n}\n/** `YYYY-MM-DD/YYYY-MM-DD`, or `''` when the range is not yet complete. */\nfunction formatDateRange(range, format) {\n\tif (!range.start || !range.end) return \"\";\n\treturn `${format(range.start)}/${format(range.end)}`;\n}\n/** Parses `YYYY-MM-DD/YYYY-MM-DD`; anything else is an empty range. */\nfunction parseDateRange(value, parse) {\n\tconst [from, to] = (value ?? \"\").split(\"/\");\n\tconst start = parse(from ?? \"\");\n\tconst end = parse(to ?? \"\");\n\tif (!start || !end) return {\n\t\tstart: null,\n\t\tend: null\n\t};\n\treturn start.getTime() <= end.getTime() ? {\n\t\tstart,\n\t\tend\n\t} : {\n\t\tstart: end,\n\t\tend: start\n\t};\n}\n//#endregion\nexport { formatDateRange, nextDateRangeSelection, parseDateRange, rangeDayState };\n",":host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.field {\n display: grid;\n gap: var(--space-1);\n}\n\n.label {\n color: var(--pf-daterange-text);\n font-size: var(--font-size-sm);\n font-weight: var(--font-weight-medium);\n}\n\n.required {\n color: var(--pf-daterange-invalid-border);\n margin-inline-start: var(--space-1);\n}\n\n.row-controls {\n align-items: center;\n display: flex;\n gap: var(--space-2);\n}\n\n.trigger {\n align-items: center;\n background: var(--pf-daterange-bg);\n border: 1px solid var(--pf-daterange-border);\n border-radius: var(--radius-md);\n color: var(--pf-daterange-text);\n cursor: pointer;\n display: flex;\n flex: 1;\n font-family: inherit;\n font-size: var(--font-size-sm);\n gap: var(--space-2);\n justify-content: space-between;\n min-width: 0;\n padding: var(--space-2) var(--space-3);\n text-align: start;\n}\n\n.trigger:focus-visible {\n box-shadow: var(--pf-daterange-focus-ring);\n outline: none;\n}\n\n.trigger:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.trigger--invalid {\n border-color: var(--pf-daterange-invalid-border);\n}\n\n.value {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.value--placeholder {\n color: var(--pf-daterange-text-muted);\n}\n\n.clear {\n align-items: center;\n background: none;\n border: 0;\n border-radius: var(--radius-sm);\n color: var(--pf-daterange-text-muted);\n cursor: pointer;\n display: inline-flex;\n flex-shrink: 0;\n justify-content: center;\n padding: var(--space-1);\n}\n\n.clear:hover:not(:disabled) {\n color: var(--pf-daterange-text);\n}\n\n.clear:focus-visible {\n box-shadow: var(--pf-daterange-focus-ring);\n outline: none;\n}\n\n.description {\n color: var(--pf-daterange-text-muted);\n font-size: var(--font-size-xs);\n margin: 0;\n}\n\n.error {\n color: var(--pf-daterange-invalid-border);\n font-size: var(--font-size-xs);\n margin: 0;\n}\n\n/* See src/place-popover.ts: the UA stylesheet centres a popover otherwise. */\n.panel {\n inset: auto;\n margin: 0;\n background: var(--pf-daterange-menu-bg);\n border: 1px solid var(--pf-daterange-menu-border);\n border-radius: var(--radius-md);\n box-shadow: var(--pf-elevation-popover-shadow);\n color: var(--pf-daterange-text);\n padding: var(--space-3);\n}\n\n.panel:popover-open {\n animation: pf-date-range-in var(--pf-transition-enter);\n}\n\n/* Its own copy: @keyframes do not cross a shadow boundary. */\n@keyframes pf-date-range-in {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .panel:popover-open {\n animation: none;\n }\n}\n\n.nav {\n display: flex;\n justify-content: space-between;\n margin-bottom: var(--space-2);\n}\n\n.step {\n align-items: center;\n background: none;\n border: 0;\n border-radius: var(--radius-sm);\n color: var(--pf-daterange-text-muted);\n cursor: pointer;\n display: inline-flex;\n justify-content: center;\n padding: var(--space-1);\n}\n\n.step:hover {\n background: var(--pf-daterange-bg-subtle);\n color: var(--pf-daterange-text);\n}\n\n.step:focus-visible {\n box-shadow: var(--pf-daterange-focus-ring);\n outline: none;\n}\n\n/* One month on a phone, two side by side from --md up. */\n.months {\n display: grid;\n gap: var(--space-4);\n}\n\n@media (--md) {\n .months {\n grid-template-columns: 1fr 1fr;\n }\n}\n\n.month-label {\n font-size: var(--font-size-sm);\n font-weight: var(--font-weight-semibold);\n margin: 0 0 var(--space-2);\n text-align: center;\n}\n\n.grid {\n display: grid;\n gap: 2px;\n grid-template-columns: repeat(7, 1fr);\n}\n\n/*\n * `display: contents`, so each row's seven cells join the grid's own columns.\n * The rows exist for the `role=\"row\"` the grid pattern needs, not for layout.\n */\n.row {\n display: contents;\n}\n\n.weekday {\n color: var(--pf-daterange-text-muted);\n font-size: var(--font-size-xs);\n font-weight: var(--font-weight-semibold);\n padding: var(--space-1) 0;\n text-align: center;\n}\n\n.day,\n.empty {\n aspect-ratio: 1;\n display: flex;\n min-width: var(--space-7);\n}\n\n.day {\n align-items: center;\n background: none;\n border: 1px solid transparent;\n border-radius: var(--radius-sm);\n color: var(--pf-daterange-text);\n cursor: pointer;\n font-family: inherit;\n font-size: var(--font-size-sm);\n justify-content: center;\n}\n\n.day:hover:not([aria-disabled='true']) {\n background: var(--pf-daterange-bg-subtle);\n}\n\n.day:focus-visible {\n box-shadow: var(--pf-daterange-focus-ring);\n outline: none;\n}\n\n.day--today {\n border-color: var(--pf-calendar-today-border);\n}\n\n/*\n * The inside of the range is square and the ends are rounded on their outer\n * side only, so the run reads as one band rather than a row of pills.\n */\n.day--inside {\n background: var(--pf-daterange-range-bg);\n border-radius: 0;\n color: var(--pf-daterange-range-text);\n}\n\n.day--endpoint {\n background: var(--pf-calendar-selected-bg);\n border-color: var(--pf-calendar-selected-bg);\n color: var(--pf-calendar-selected-text);\n}\n\n.day--start:not(.day--end) {\n border-end-end-radius: 0;\n border-start-end-radius: 0;\n}\n\n.day--end:not(.day--start) {\n border-end-start-radius: 0;\n border-start-start-radius: 0;\n}\n\n.day[aria-disabled='true'] {\n cursor: not-allowed;\n opacity: 0.4;\n}\n","import {\n addMonths,\n buildCalendarDays,\n CALENDAR_CELL_COUNT,\n clampMonthToYearRange,\n composeDescribedBy,\n formatDateRange,\n formatISODate,\n isOutsideDateRange,\n isSameDay,\n isSameMonth,\n Keys,\n moveCalendarDate,\n nextDateRangeSelection,\n observeAnchoredPosition,\n parseDateRange,\n parseISODate,\n rangeDayState,\n startOfMonth,\n toMidday,\n WEEKDAY_LABELS,\n type CalendarMove,\n type DateRangeValue,\n} from '@pitchfork-ui/core';\n\nimport { applyControlValidity } from '../../form-validity';\nimport { placePopover } from '../../place-popover';\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nconst MOVES: Record<string, CalendarMove> = {\n [Keys.ArrowRight]: 'day-next',\n [Keys.ArrowLeft]: 'day-previous',\n [Keys.ArrowDown]: 'week-next',\n [Keys.ArrowUp]: 'week-previous',\n [Keys.Home]: 'week-start',\n [Keys.End]: 'week-end',\n PageDown: 'month-next',\n PageUp: 'month-previous',\n};\n\n/**\n * A form-associated date-range field: two month grids in a popover, with a\n * preview that follows the pointer while the range is half-made.\n *\n * **It submits two entries from one control.** `setFormValue` accepts a\n * `FormData`, and every entry in it is submitted — measured, along with the\n * fact that the element's own `name` attribute is then ignored entirely. So a\n * range goes in as `${name}-start` and `${name}-end`, which is what a server\n * handling a form actually wants, rather than one field a handler has to split.\n * The `value` property stays a single round-trippable `start/end` string.\n *\n * The grids are rendered here rather than composed from two `pf-calendar`s:\n * the range preview spans both months, so one element has to own the hover and\n * the selection for both. The day-state and selection rules are core's, shared\n * with the React component.\n *\n * @part field - the wrapper around label, control and messages.\n * @part label - the label element.\n * @part trigger - the button that opens the grids.\n * @part clear - the clear button.\n * @part panel - the floating panel.\n * @part grid - each month grid.\n * @part day - every day cell.\n * @part description - the hint text below the control.\n * @part error - the error message below the control.\n */\n@Component({\n tag: 'pf-date-range-picker',\n styleUrl: 'pf-date-range-picker.css',\n formAssociated: true,\n shadow: true,\n})\nexport class PfDateRangePicker {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The base name for the two submitted entries, `${name}-start` and\n * `${name}-end`. Reflected for selectors; the submission reads the property,\n * because a `FormData` value carries its own keys.\n */\n @Prop({ reflect: true }) name?: string;\n\n /** The range as `YYYY-MM-DD/YYYY-MM-DD`, or empty. */\n @Prop({ mutable: true }) value = '';\n\n /** Whether the panel is showing. Reflected for the stylesheet. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n @Prop() label?: string;\n\n @Prop() description?: string;\n\n @Prop() error?: string;\n\n @Prop() placeholder = 'Select dates';\n\n @Prop({ reflect: true }) required = false;\n\n @Prop({ reflect: true }) disabled = false;\n\n /** Offer a button that empties the range. */\n @Prop() allowClear = false;\n\n @Prop() min?: string;\n\n @Prop() max?: string;\n\n @Prop() startYear?: number;\n\n @Prop() endYear?: number;\n\n /** A predicate for days that cannot be chosen; see `pf-calendar`. */\n @Prop() isDateDisabled?: (date: Date) => boolean;\n\n /** Fires when the range changes or is cleared, with the `start/end` string. */\n @Event() pfChange!: EventEmitter<{ value: string; start: string; end: string }>;\n\n /** Fires whenever the panel opens or closes, whoever caused it. */\n @Event() pfOpenChange!: EventEmitter<{ open: boolean }>;\n\n /** The left-hand month; the right-hand one is always the month after. */\n @State() leftMonth: Date = startOfMonth(new Date());\n\n /** The day the grids' single tab stop sits on. */\n @State() focusedDate: Date = toMidday(new Date());\n\n /** The day under the pointer, which previews the missing end. */\n @State() hovered: Date | null = null;\n\n /** True once a start is chosen and the next click sets the end. */\n @State() awaitingEnd = false;\n\n private initialValue = '';\n\n /**\n * The start held while the range is half-made.\n *\n * Not in `value`, because `value` is the *submitted* range and a half-made\n * one is not a range — a form read mid-selection would see a start with no\n * end. Held here instead, and folded back in for rendering.\n */\n private pendingStart: Date | null = null;\n private stopObserving?: () => void;\n private shouldRestoreFocus = false;\n\n componentWillLoad() {\n this.initialValue = this.value ?? '';\n const { start } = this.range();\n const base = start ?? toMidday(new Date());\n this.focusedDate = base;\n this.leftMonth = this.clamp(startOfMonth(base));\n this.syncFormState();\n }\n\n componentDidRender() {\n if (!this.shouldRestoreFocus) return;\n this.shouldRestoreFocus = false;\n this.el.shadowRoot?.querySelector<HTMLButtonElement>('button[data-day][tabindex=\"0\"]')?.focus();\n }\n\n disconnectedCallback() {\n this.stopObserving?.();\n }\n\n /**\n * Follows a range set from outside, so the grids show what they are told.\n *\n * Without this the element kept whatever month it loaded with, and a\n * consumer assigning `value` got a correct value over the wrong months —\n * the days it names were not even rendered.\n */\n @Watch('value')\n syncDisplayedMonths() {\n const { start, end } = this.range();\n if (!start || !end) return;\n this.pendingStart = null;\n this.awaitingEnd = false;\n this.focusedDate = start;\n this.leftMonth = this.clamp(startOfMonth(start));\n }\n\n /*\n * `name` is watched here and not on the controls that pass a plain string to\n * `setFormValue`: those take their submission name from the reflected\n * attribute, so the platform picks a change up by itself. This one builds\n * the name *into* a FormData, so without the watch a name assigned after\n * load would never reach the submission.\n */\n @Watch('name')\n @Watch('value')\n @Watch('error')\n @Watch('required')\n syncFormState() {\n const { start, end } = this.range();\n\n if (!start || !end || !this.name) {\n this.internals.setFormValue(null);\n } else {\n /*\n * A FormData, so one control submits both ends. Measured: every entry in\n * it reaches the submission, and the element's own `name` attribute is\n * ignored in this mode — which is why the keys are built here.\n */\n const data = new FormData();\n data.append(`${this.name}-start`, formatISODate(start));\n data.append(`${this.name}-end`, formatISODate(end));\n this.internals.setFormValue(data);\n }\n\n applyControlValidity(this.internals, Boolean(start && end), this.required, this.error);\n }\n\n @Watch('open')\n syncOpen(next: boolean, previous: boolean) {\n if (next) this.showPanel();\n else this.hidePanel();\n if (next !== previous) this.pfOpenChange.emit({ open: next });\n }\n\n @Method()\n async show(): Promise<void> {\n if (!this.disabled) this.open = true;\n }\n\n @Method()\n async hide(): Promise<void> {\n this.open = false;\n }\n\n @Method()\n async checkValidity(): Promise<boolean> {\n return this.internals.checkValidity();\n }\n\n @Method()\n async reportValidity(): Promise<boolean> {\n return this.internals.reportValidity();\n }\n\n @Method()\n async getValidationMessage(): Promise<string> {\n return this.internals.validationMessage;\n }\n\n formResetCallback() {\n this.value = this.initialValue;\n this.awaitingEnd = false;\n this.hovered = null;\n }\n\n private range(): DateRangeValue {\n return parseDateRange(this.value, parseISODate);\n }\n\n private get years() {\n const now = new Date().getFullYear();\n const start = this.startYear ?? now - 50;\n const end = this.endYear ?? now + 50;\n return { start: Math.min(start, end), end: Math.max(start, end) };\n }\n\n private clamp(date: Date): Date {\n const { start, end } = this.years;\n return clampMonthToYearRange(date, start, end);\n }\n\n private get panel() {\n return this.el.shadowRoot?.querySelector<HTMLElement>('[part=\"panel\"]') ?? null;\n }\n\n private get trigger() {\n return this.el.shadowRoot?.querySelector<HTMLButtonElement>('[part=\"trigger\"]') ?? null;\n }\n\n private isDisabled(date: Date): boolean {\n if (isOutsideDateRange(date, parseISODate(this.min), parseISODate(this.max))) return true;\n return this.isDateDisabled?.(date) ?? false;\n }\n\n private showPanel() {\n const panel = this.panel;\n if (this.disabled || !panel || panel.matches(':popover-open')) return;\n\n panel.showPopover();\n this.stopObserving?.();\n this.stopObserving = observeAnchoredPosition({\n getAnchor: () => this.trigger,\n getFloating: () => panel,\n align: 'start',\n matchAnchorWidth: false,\n flip: true,\n onChange: ({ left, top }) => placePopover(panel, left, top),\n });\n\n this.shouldRestoreFocus = true;\n }\n\n private hidePanel() {\n this.stopObserving?.();\n this.stopObserving = undefined;\n this.hovered = null;\n const panel = this.panel;\n if (panel?.matches(':popover-open')) panel.hidePopover();\n }\n\n private onToggle = (event: ToggleEvent) => {\n const nowOpen = event.newState === 'open';\n if (this.open !== nowOpen) this.open = nowOpen;\n if (!nowOpen) this.trigger?.focus();\n };\n\n /** One click through core's state machine, plus this element's side-effects. */\n private pick(date: Date) {\n if (this.isDisabled(date)) return;\n\n /*\n * `displayRange()`, not `range()`. A half-made range is deliberately kept\n * out of `value`, so reading the state machine's input from `value` hands\n * it a range with no start — and core, correctly, treats that as \"begin a\n * new range\". Every second click restarted instead of closing. Caught by\n * the swap and Enter tests.\n */\n const next = nextDateRangeSelection(\n { range: this.displayRange(), awaitingEnd: this.awaitingEnd },\n date,\n );\n\n this.awaitingEnd = next.awaitingEnd;\n this.focusedDate = toMidday(date);\n\n if (next.awaitingEnd) {\n // Half-made: hold the start without reporting an incomplete range.\n this.value = '';\n this.pendingStart = next.range.start;\n return;\n }\n\n this.pendingStart = null;\n this.hovered = null;\n this.value = formatDateRange(next.range, formatISODate);\n this.pfChange.emit({\n value: this.value,\n start: next.range.start ? formatISODate(next.range.start) : '',\n end: next.range.end ? formatISODate(next.range.end) : '',\n });\n this.open = false;\n }\n\n /** What the grids draw: the committed range, or the half-made one. */\n private displayRange(): DateRangeValue {\n const committed = this.range();\n if (committed.start && committed.end) return committed;\n return { start: this.pendingStart, end: null };\n }\n\n private moveFocus(move: CalendarMove) {\n const next = moveCalendarDate(this.focusedDate, move);\n const { start, end } = this.years;\n if (next.getFullYear() < start || next.getFullYear() > end) return;\n\n this.focusedDate = next;\n this.shouldRestoreFocus = true;\n\n // Keep the focused day on screen: it belongs to one of the two months.\n const right = addMonths(this.leftMonth, 1);\n if (!isSameMonth(next, this.leftMonth) && !isSameMonth(next, right)) {\n this.leftMonth = this.clamp(startOfMonth(next));\n }\n }\n\n private onKeyDown = (event: KeyboardEvent) => {\n const move = MOVES[event.key];\n if (move) {\n event.preventDefault();\n this.moveFocus(move);\n return;\n }\n\n if (event.key === Keys.Enter || event.key === Keys.Space) {\n event.preventDefault();\n this.pick(this.focusedDate);\n this.shouldRestoreFocus = true;\n }\n };\n\n private clear = (event: MouseEvent) => {\n event.stopPropagation();\n if (!this.value && !this.pendingStart) return;\n this.value = '';\n this.pendingStart = null;\n this.awaitingEnd = false;\n this.hovered = null;\n this.pfChange.emit({ value: '', start: '', end: '' });\n };\n\n private formatted(): string {\n const { start, end } = this.range();\n if (!start || !end) return '';\n const format = new Intl.DateTimeFormat('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n });\n return `${format.format(start)} – ${format.format(end)}`;\n }\n\n private renderGrid(month: Date) {\n const days = buildCalendarDays(month);\n const range = this.displayRange();\n const today = toMidday(new Date());\n const label = new Intl.DateTimeFormat('en-US', {\n month: 'long',\n year: 'numeric',\n }).format(month);\n\n return (\n <div class=\"month\">\n <p class=\"month-label\">{label}</p>\n <div class=\"grid\" part=\"grid\" role=\"grid\" aria-label={label}>\n <div class=\"row\" role=\"row\">\n {WEEKDAY_LABELS.map((day) => (\n <span key={day} class=\"weekday\" role=\"columnheader\" aria-label={day}>\n {day}\n </span>\n ))}\n </div>\n\n {Array.from({ length: CALENDAR_CELL_COUNT / 7 }, (_, week) => (\n <div key={week} class=\"row\" role=\"row\">\n {days.slice(week * 7, week * 7 + 7).map(({ date, inCurrentMonth }) => {\n if (!inCurrentMonth) {\n return <span key={formatISODate(date)} class=\"empty\" role=\"gridcell\"></span>;\n }\n\n const state = rangeDayState(date, range, this.hovered);\n const isEndpoint = state.isStart || state.isEnd;\n const disabled = this.isDisabled(date);\n\n return (\n <button\n key={formatISODate(date)}\n type=\"button\"\n role=\"gridcell\"\n data-day={formatISODate(date)}\n part=\"day\"\n class={{\n day: true,\n 'day--today': isSameDay(today, date),\n 'day--endpoint': isEndpoint,\n 'day--start': state.isStart,\n 'day--end': state.isEnd,\n 'day--inside': state.isInside,\n }}\n tabindex={isSameDay(this.focusedDate, date) ? 0 : -1}\n aria-selected={isEndpoint || state.isInside ? 'true' : 'false'}\n aria-current={isSameDay(today, date) ? 'date' : null}\n aria-disabled={disabled ? 'true' : null}\n aria-label={new Intl.DateTimeFormat('en-US', {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n }).format(date)}\n onClick={() => {\n this.pick(date);\n this.shouldRestoreFocus = true;\n }}\n onMouseEnter={() => {\n if (this.awaitingEnd && !disabled) this.hovered = date;\n }}\n >\n {date.getDate()}\n </button>\n );\n })}\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n render() {\n const describedBy = composeDescribedBy(\n this.description && 'description',\n this.error && 'error',\n );\n const text = this.formatted();\n const right = addMonths(this.leftMonth, 1);\n\n return (\n <Host>\n <div class=\"field\" part=\"field\">\n {this.label && (\n <label class=\"label\" part=\"label\" htmlFor=\"trigger\">\n {this.label}\n {this.required && (\n <span class=\"required\" aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <div class=\"row-controls\">\n <button\n id=\"trigger\"\n part=\"trigger\"\n class={{ trigger: true, 'trigger--invalid': Boolean(this.error) }}\n type=\"button\"\n disabled={this.disabled}\n aria-haspopup=\"dialog\"\n aria-expanded={this.open ? 'true' : 'false'}\n aria-controls=\"panel\"\n aria-invalid={this.error ? 'true' : null}\n aria-required={this.required ? 'true' : null}\n aria-describedby={describedBy}\n onClick={() => {\n if (!this.disabled) this.open = !this.open;\n }}\n >\n <span class={{ value: true, 'value--placeholder': !text }}>\n {text || this.placeholder}\n </span>\n <pf-icon name=\"calendar\"></pf-icon>\n </button>\n\n {this.allowClear && (this.value || this.pendingStart) && (\n <button\n class=\"clear\"\n part=\"clear\"\n type=\"button\"\n aria-label=\"Clear selected dates\"\n disabled={this.disabled}\n onClick={this.clear}\n >\n <pf-icon name=\"circle-xmark\"></pf-icon>\n </button>\n )}\n </div>\n\n {this.description && (\n <p class=\"description\" part=\"description\" id=\"description\">\n {this.description}\n </p>\n )}\n {this.error && (\n <p class=\"error\" part=\"error\" id=\"error\">\n {this.error}\n </p>\n )}\n </div>\n\n <div\n id=\"panel\"\n part=\"panel\"\n class=\"panel\"\n popover=\"auto\"\n role=\"dialog\"\n aria-label=\"Choose a date range\"\n onToggle={this.onToggle}\n onKeyDown={this.onKeyDown}\n onMouseLeave={() => {\n this.hovered = null;\n }}\n >\n <div class=\"nav\">\n <button\n type=\"button\"\n class=\"step\"\n aria-label=\"Previous month\"\n onClick={() => {\n this.leftMonth = this.clamp(addMonths(this.leftMonth, -1));\n }}\n >\n <pf-icon name=\"square-caret-left\"></pf-icon>\n </button>\n <button\n type=\"button\"\n class=\"step\"\n aria-label=\"Next month\"\n onClick={() => {\n this.leftMonth = this.clamp(addMonths(this.leftMonth, 1));\n }}\n >\n <pf-icon name=\"square-caret-right\"></pf-icon>\n </button>\n </div>\n\n <div class=\"months\">\n {this.renderGrid(this.leftMonth)}\n {this.renderGrid(right)}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pf-date-range-picker.cjs.entry.js","mappings":";;;;;;;;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAAsB,CAAC,OAAO,EAAEA,MAAI,EAAE;AAC/C,CAAC,MAAM,OAAO,GAAGC,aAAQ,CAACD,MAAI,CAAC;AAC/B,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO;AAC1D,EAAE,KAAK,EAAE;AACT,GAAG,KAAK,EAAE,OAAO;AACjB,GAAG,GAAG,EAAE;AACR,GAAG;AACH,EAAE,WAAW,EAAE;AACf,EAAE;AACF,CAAC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK;AAClC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C,KAAK,CAACH,cAAS,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;aAC1D,EAAA,EAEDG,OAAA,CAAA,SAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAS,IAAI,EAAC,oBAAoB,EAAA,CAAW,CACtC,CACL,EAENA,OAAA,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAK,KAAK,EAAC,QAAQ,EAAA,EAChB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAC/B,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CACnB,CACF,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["date","toMidday","isSameDay","Keys","startOfMonth","formatISODate","applyControlValidity","parseISODate","clampMonthToYearRange","isOutsideDateRange","observeAnchoredPosition","placePopover","moveCalendarDate","addMonths","isSameMonth","buildCalendarDays","h","WEEKDAY_LABELS","CALENDAR_CELL_COUNT","composeDescribedBy","Host","controlAriaLabel"],"sources":["../core/dist/date-range.js","src/components/pf-date-range-picker/pf-date-range-picker.css?tag=pf-date-range-picker&encapsulation=shadow","src/components/pf-date-range-picker/pf-date-range-picker.tsx"],"sourcesContent":["import { isSameDay, toMidday } from \"./date.js\";\n//#region src/date-range.ts\n/**\n* Where a click on `date` leaves the selection.\n*\n* Three cases, and the second two are the ones worth naming:\n* - not awaiting an end: start the range here and wait for the other end;\n* - awaiting an end, clicked before the start: the two swap, because a range\n* has no opinion about which end the user picked first;\n* - awaiting an end, clicked the start again: start over rather than make a\n* one-day range, which is what the React component does and is the kinder\n* reading of a double click.\n*/\nfunction nextDateRangeSelection(current, date) {\n\tconst clicked = toMidday(date);\n\tif (!current.awaitingEnd || !current.range.start) return {\n\t\trange: {\n\t\t\tstart: clicked,\n\t\t\tend: null\n\t\t},\n\t\tawaitingEnd: true\n\t};\n\tconst start = current.range.start;\n\tif (isSameDay(start, clicked)) return {\n\t\trange: {\n\t\t\tstart: clicked,\n\t\t\tend: null\n\t\t},\n\t\tawaitingEnd: true\n\t};\n\treturn {\n\t\trange: clicked.getTime() < start.getTime() ? {\n\t\t\tstart: clicked,\n\t\t\tend: start\n\t\t} : {\n\t\t\tstart,\n\t\t\tend: clicked\n\t\t},\n\t\tawaitingEnd: false\n\t};\n}\n/**\n* How a day should read, given the range and whatever is hovered.\n*\n* A hovered day stands in for the missing end while the range is half-made,\n* which is what makes the preview follow the pointer. It stands in only when\n* there is a start and no end — hovering before the first click previews\n* nothing.\n*/\nfunction rangeDayState(date, range, hovered = null) {\n\tconst { start } = range;\n\tconst end = range.end ?? (start && hovered ? hovered : null);\n\tconst isStart = Boolean(start && isSameDay(date, start));\n\tconst isEnd = Boolean(end && isSameDay(date, end));\n\tif (!start || !end) return {\n\t\tisStart,\n\t\tisEnd,\n\t\tisInside: false\n\t};\n\tconst [low, high] = start.getTime() <= end.getTime() ? [start, end] : [end, start];\n\tconst day = date.getTime();\n\treturn {\n\t\tisStart,\n\t\tisEnd,\n\t\tisInside: day > low.getTime() && day < high.getTime()\n\t};\n}\n/** `YYYY-MM-DD/YYYY-MM-DD`, or `''` when the range is not yet complete. */\nfunction formatDateRange(range, format) {\n\tif (!range.start || !range.end) return \"\";\n\treturn `${format(range.start)}/${format(range.end)}`;\n}\n/** Parses `YYYY-MM-DD/YYYY-MM-DD`; anything else is an empty range. */\nfunction parseDateRange(value, parse) {\n\tconst [from, to] = (value ?? \"\").split(\"/\");\n\tconst start = parse(from ?? \"\");\n\tconst end = parse(to ?? \"\");\n\tif (!start || !end) return {\n\t\tstart: null,\n\t\tend: null\n\t};\n\treturn start.getTime() <= end.getTime() ? {\n\t\tstart,\n\t\tend\n\t} : {\n\t\tstart: end,\n\t\tend: start\n\t};\n}\n//#endregion\nexport { formatDateRange, nextDateRangeSelection, parseDateRange, rangeDayState };\n",":host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.field {\n display: grid;\n gap: var(--space-1);\n}\n\n.label {\n color: var(--pf-daterange-text);\n font-size: var(--font-size-sm);\n font-weight: var(--font-weight-medium);\n}\n\n.required {\n color: var(--pf-daterange-invalid-border);\n margin-inline-start: var(--space-1);\n}\n\n.row-controls {\n align-items: center;\n display: flex;\n gap: var(--space-2);\n}\n\n.trigger {\n align-items: center;\n background: var(--pf-daterange-bg);\n border: 1px solid var(--pf-daterange-border);\n border-radius: var(--radius-md);\n color: var(--pf-daterange-text);\n cursor: pointer;\n display: flex;\n flex: 1;\n font-family: inherit;\n font-size: var(--font-size-sm);\n gap: var(--space-2);\n justify-content: space-between;\n min-width: 0;\n padding: var(--space-2) var(--space-3);\n text-align: start;\n}\n\n.trigger:focus-visible {\n box-shadow: var(--pf-daterange-focus-ring);\n outline: none;\n}\n\n.trigger:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.trigger--invalid {\n border-color: var(--pf-daterange-invalid-border);\n}\n\n.value {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.value--placeholder {\n color: var(--pf-daterange-text-muted);\n}\n\n.clear {\n align-items: center;\n background: none;\n border: 0;\n border-radius: var(--radius-sm);\n color: var(--pf-daterange-text-muted);\n cursor: pointer;\n display: inline-flex;\n flex-shrink: 0;\n justify-content: center;\n padding: var(--space-1);\n}\n\n.clear:hover:not(:disabled) {\n color: var(--pf-daterange-text);\n}\n\n.clear:focus-visible {\n box-shadow: var(--pf-daterange-focus-ring);\n outline: none;\n}\n\n.description {\n color: var(--pf-daterange-text-muted);\n font-size: var(--font-size-xs);\n margin: 0;\n}\n\n.error {\n color: var(--pf-daterange-invalid-border);\n font-size: var(--font-size-xs);\n margin: 0;\n}\n\n/* See src/place-popover.ts: the UA stylesheet centres a popover otherwise. */\n.panel {\n inset: auto;\n margin: 0;\n background: var(--pf-daterange-menu-bg);\n border: 1px solid var(--pf-daterange-menu-border);\n border-radius: var(--radius-md);\n box-shadow: var(--pf-elevation-popover-shadow);\n color: var(--pf-daterange-text);\n padding: var(--space-3);\n}\n\n.panel:popover-open {\n animation: pf-date-range-in var(--pf-transition-enter);\n}\n\n/* Its own copy: @keyframes do not cross a shadow boundary. */\n@keyframes pf-date-range-in {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .panel:popover-open {\n animation: none;\n }\n}\n\n.nav {\n display: flex;\n justify-content: space-between;\n margin-bottom: var(--space-2);\n}\n\n.step {\n align-items: center;\n background: none;\n border: 0;\n border-radius: var(--radius-sm);\n color: var(--pf-daterange-text-muted);\n cursor: pointer;\n display: inline-flex;\n justify-content: center;\n padding: var(--space-1);\n}\n\n.step:hover {\n background: var(--pf-daterange-bg-subtle);\n color: var(--pf-daterange-text);\n}\n\n.step:focus-visible {\n box-shadow: var(--pf-daterange-focus-ring);\n outline: none;\n}\n\n/* One month on a phone, two side by side from --md up. */\n.months {\n display: grid;\n gap: var(--space-4);\n}\n\n@media (--md) {\n .months {\n grid-template-columns: 1fr 1fr;\n }\n}\n\n.month-label {\n font-size: var(--font-size-sm);\n font-weight: var(--font-weight-semibold);\n margin: 0 0 var(--space-2);\n text-align: center;\n}\n\n.grid {\n display: grid;\n gap: 2px;\n grid-template-columns: repeat(7, 1fr);\n}\n\n/*\n * `display: contents`, so each row's seven cells join the grid's own columns.\n * The rows exist for the `role=\"row\"` the grid pattern needs, not for layout.\n */\n.row {\n display: contents;\n}\n\n.weekday {\n color: var(--pf-daterange-text-muted);\n font-size: var(--font-size-xs);\n font-weight: var(--font-weight-semibold);\n padding: var(--space-1) 0;\n text-align: center;\n}\n\n.day,\n.empty {\n aspect-ratio: 1;\n display: flex;\n min-width: var(--space-7);\n}\n\n.day {\n align-items: center;\n background: none;\n border: 1px solid transparent;\n border-radius: var(--radius-sm);\n color: var(--pf-daterange-text);\n cursor: pointer;\n font-family: inherit;\n font-size: var(--font-size-sm);\n justify-content: center;\n}\n\n.day:hover:not([aria-disabled='true']) {\n background: var(--pf-daterange-bg-subtle);\n}\n\n.day:focus-visible {\n box-shadow: var(--pf-daterange-focus-ring);\n outline: none;\n}\n\n.day--today {\n border-color: var(--pf-calendar-today-border);\n}\n\n/*\n * The inside of the range is square and the ends are rounded on their outer\n * side only, so the run reads as one band rather than a row of pills.\n */\n.day--inside {\n background: var(--pf-daterange-range-bg);\n border-radius: 0;\n color: var(--pf-daterange-range-text);\n}\n\n.day--endpoint {\n background: var(--pf-calendar-selected-bg);\n border-color: var(--pf-calendar-selected-bg);\n color: var(--pf-calendar-selected-text);\n}\n\n.day--start:not(.day--end) {\n border-end-end-radius: 0;\n border-start-end-radius: 0;\n}\n\n.day--end:not(.day--start) {\n border-end-start-radius: 0;\n border-start-start-radius: 0;\n}\n\n.day[aria-disabled='true'] {\n cursor: not-allowed;\n opacity: 0.4;\n}\n","import {\n addMonths,\n buildCalendarDays,\n CALENDAR_CELL_COUNT,\n clampMonthToYearRange,\n composeDescribedBy,\n formatDateRange,\n formatISODate,\n isOutsideDateRange,\n isSameDay,\n isSameMonth,\n Keys,\n moveCalendarDate,\n nextDateRangeSelection,\n observeAnchoredPosition,\n parseDateRange,\n parseISODate,\n rangeDayState,\n startOfMonth,\n toMidday,\n WEEKDAY_LABELS,\n type CalendarMove,\n type DateRangeValue,\n} from '@pitchfork-ui/core';\n\nimport { applyControlValidity } from '../../form-validity';\nimport { controlAriaLabel } from '../../control-label';\nimport { placePopover } from '../../place-popover';\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nconst MOVES: Record<string, CalendarMove> = {\n [Keys.ArrowRight]: 'day-next',\n [Keys.ArrowLeft]: 'day-previous',\n [Keys.ArrowDown]: 'week-next',\n [Keys.ArrowUp]: 'week-previous',\n [Keys.Home]: 'week-start',\n [Keys.End]: 'week-end',\n PageDown: 'month-next',\n PageUp: 'month-previous',\n};\n\n/**\n * A form-associated date-range field: two month grids in a popover, with a\n * preview that follows the pointer while the range is half-made.\n *\n * **It submits two entries from one control.** `setFormValue` accepts a\n * `FormData`, and every entry in it is submitted — measured, along with the\n * fact that the element's own `name` attribute is then ignored entirely. So a\n * range goes in as `${name}-start` and `${name}-end`, which is what a server\n * handling a form actually wants, rather than one field a handler has to split.\n * The `value` property stays a single round-trippable `start/end` string.\n *\n * The grids are rendered here rather than composed from two `pf-calendar`s:\n * the range preview spans both months, so one element has to own the hover and\n * the selection for both. The day-state and selection rules are core's, shared\n * with the React component.\n *\n * @part field - the wrapper around label, control and messages.\n * @part label - the label element.\n * @part trigger - the button that opens the grids.\n * @part clear - the clear button.\n * @part panel - the floating panel.\n * @part grid - each month grid.\n * @part day - every day cell.\n * @part description - the hint text below the control.\n * @part error - the error message below the control.\n */\n@Component({\n tag: 'pf-date-range-picker',\n styleUrl: 'pf-date-range-picker.css',\n formAssociated: true,\n shadow: true,\n})\nexport class PfDateRangePicker {\n @Element() el!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * The base name for the two submitted entries, `${name}-start` and\n * `${name}-end`. Reflected for selectors; the submission reads the property,\n * because a `FormData` value carries its own keys.\n */\n @Prop({ reflect: true }) name?: string;\n\n /** The range as `YYYY-MM-DD/YYYY-MM-DD`, or empty. */\n @Prop({ mutable: true }) value = '';\n\n /** Whether the panel is showing. Reflected for the stylesheet. */\n @Prop({ mutable: true, reflect: true }) open = false;\n\n @Prop() label?: string;\n\n @Prop() description?: string;\n\n @Prop() error?: string;\n\n @Prop() placeholder = 'Select dates';\n\n @Prop({ reflect: true }) required = false;\n\n @Prop({ reflect: true }) disabled = false;\n\n /** Offer a button that empties the range. */\n @Prop() allowClear = false;\n\n @Prop() min?: string;\n\n @Prop() max?: string;\n\n @Prop() startYear?: number;\n\n @Prop() endYear?: number;\n\n /** A predicate for days that cannot be chosen; see `pf-calendar`. */\n @Prop() isDateDisabled?: (date: Date) => boolean;\n\n /** Fires when the range changes or is cleared, with the `start/end` string. */\n @Event() pfChange!: EventEmitter<{ value: string; start: string; end: string }>;\n\n /** Fires whenever the panel opens or closes, whoever caused it. */\n @Event() pfOpenChange!: EventEmitter<{ open: boolean }>;\n\n /** The left-hand month; the right-hand one is always the month after. */\n @State() leftMonth: Date = startOfMonth(new Date());\n\n /** The day the grids' single tab stop sits on. */\n @State() focusedDate: Date = toMidday(new Date());\n\n /** The day under the pointer, which previews the missing end. */\n @State() hovered: Date | null = null;\n\n /** True once a start is chosen and the next click sets the end. */\n @State() awaitingEnd = false;\n\n private initialValue = '';\n\n /**\n * The start held while the range is half-made.\n *\n * Not in `value`, because `value` is the *submitted* range and a half-made\n * one is not a range — a form read mid-selection would see a start with no\n * end. Held here instead, and folded back in for rendering.\n */\n private pendingStart: Date | null = null;\n private stopObserving?: () => void;\n private shouldRestoreFocus = false;\n\n componentWillLoad() {\n this.initialValue = this.value ?? '';\n const { start } = this.range();\n const base = start ?? toMidday(new Date());\n this.focusedDate = base;\n this.leftMonth = this.clamp(startOfMonth(base));\n this.syncFormState();\n }\n\n componentDidRender() {\n if (!this.shouldRestoreFocus) return;\n this.shouldRestoreFocus = false;\n this.el.shadowRoot?.querySelector<HTMLButtonElement>('button[data-day][tabindex=\"0\"]')?.focus();\n }\n\n disconnectedCallback() {\n this.stopObserving?.();\n }\n\n /**\n * Follows a range set from outside, so the grids show what they are told.\n *\n * Without this the element kept whatever month it loaded with, and a\n * consumer assigning `value` got a correct value over the wrong months —\n * the days it names were not even rendered.\n */\n @Watch('value')\n syncDisplayedMonths() {\n const { start, end } = this.range();\n if (!start || !end) return;\n this.pendingStart = null;\n this.awaitingEnd = false;\n this.focusedDate = start;\n this.leftMonth = this.clamp(startOfMonth(start));\n }\n\n /*\n * `name` is watched here and not on the controls that pass a plain string to\n * `setFormValue`: those take their submission name from the reflected\n * attribute, so the platform picks a change up by itself. This one builds\n * the name *into* a FormData, so without the watch a name assigned after\n * load would never reach the submission.\n */\n @Watch('name')\n @Watch('value')\n @Watch('error')\n @Watch('required')\n syncFormState() {\n const { start, end } = this.range();\n\n if (!start || !end || !this.name) {\n this.internals.setFormValue(null);\n } else {\n /*\n * A FormData, so one control submits both ends. Measured: every entry in\n * it reaches the submission, and the element's own `name` attribute is\n * ignored in this mode — which is why the keys are built here.\n */\n const data = new FormData();\n data.append(`${this.name}-start`, formatISODate(start));\n data.append(`${this.name}-end`, formatISODate(end));\n this.internals.setFormValue(data);\n }\n\n applyControlValidity(this.internals, Boolean(start && end), this.required, this.error);\n }\n\n @Watch('open')\n syncOpen(next: boolean, previous: boolean) {\n if (next) this.showPanel();\n else this.hidePanel();\n if (next !== previous) this.pfOpenChange.emit({ open: next });\n }\n\n @Method()\n async show(): Promise<void> {\n if (!this.disabled) this.open = true;\n }\n\n @Method()\n async hide(): Promise<void> {\n this.open = false;\n }\n\n @Method()\n async checkValidity(): Promise<boolean> {\n return this.internals.checkValidity();\n }\n\n @Method()\n async reportValidity(): Promise<boolean> {\n return this.internals.reportValidity();\n }\n\n @Method()\n async getValidationMessage(): Promise<string> {\n return this.internals.validationMessage;\n }\n\n formResetCallback() {\n this.value = this.initialValue;\n this.awaitingEnd = false;\n this.hovered = null;\n }\n\n private range(): DateRangeValue {\n return parseDateRange(this.value, parseISODate);\n }\n\n private get years() {\n const now = new Date().getFullYear();\n const start = this.startYear ?? now - 50;\n const end = this.endYear ?? now + 50;\n return { start: Math.min(start, end), end: Math.max(start, end) };\n }\n\n private clamp(date: Date): Date {\n const { start, end } = this.years;\n return clampMonthToYearRange(date, start, end);\n }\n\n private get panel() {\n return this.el.shadowRoot?.querySelector<HTMLElement>('[part=\"panel\"]') ?? null;\n }\n\n private get trigger() {\n return this.el.shadowRoot?.querySelector<HTMLButtonElement>('[part=\"trigger\"]') ?? null;\n }\n\n private isDisabled(date: Date): boolean {\n if (isOutsideDateRange(date, parseISODate(this.min), parseISODate(this.max))) return true;\n return this.isDateDisabled?.(date) ?? false;\n }\n\n private showPanel() {\n const panel = this.panel;\n if (this.disabled || !panel || panel.matches(':popover-open')) return;\n\n panel.showPopover();\n this.stopObserving?.();\n this.stopObserving = observeAnchoredPosition({\n getAnchor: () => this.trigger,\n getFloating: () => panel,\n align: 'start',\n matchAnchorWidth: false,\n flip: true,\n onChange: ({ left, top }) => placePopover(panel, left, top),\n });\n\n this.shouldRestoreFocus = true;\n }\n\n private hidePanel() {\n this.stopObserving?.();\n this.stopObserving = undefined;\n this.hovered = null;\n const panel = this.panel;\n if (panel?.matches(':popover-open')) panel.hidePopover();\n }\n\n private onToggle = (event: ToggleEvent) => {\n const nowOpen = event.newState === 'open';\n if (this.open !== nowOpen) this.open = nowOpen;\n if (!nowOpen) this.trigger?.focus();\n };\n\n /** One click through core's state machine, plus this element's side-effects. */\n private pick(date: Date) {\n if (this.isDisabled(date)) return;\n\n /*\n * `displayRange()`, not `range()`. A half-made range is deliberately kept\n * out of `value`, so reading the state machine's input from `value` hands\n * it a range with no start — and core, correctly, treats that as \"begin a\n * new range\". Every second click restarted instead of closing. Caught by\n * the swap and Enter tests.\n */\n const next = nextDateRangeSelection(\n { range: this.displayRange(), awaitingEnd: this.awaitingEnd },\n date,\n );\n\n this.awaitingEnd = next.awaitingEnd;\n this.focusedDate = toMidday(date);\n\n if (next.awaitingEnd) {\n // Half-made: hold the start without reporting an incomplete range.\n this.value = '';\n this.pendingStart = next.range.start;\n return;\n }\n\n this.pendingStart = null;\n this.hovered = null;\n this.value = formatDateRange(next.range, formatISODate);\n this.pfChange.emit({\n value: this.value,\n start: next.range.start ? formatISODate(next.range.start) : '',\n end: next.range.end ? formatISODate(next.range.end) : '',\n });\n this.open = false;\n }\n\n /** What the grids draw: the committed range, or the half-made one. */\n private displayRange(): DateRangeValue {\n const committed = this.range();\n if (committed.start && committed.end) return committed;\n return { start: this.pendingStart, end: null };\n }\n\n private moveFocus(move: CalendarMove) {\n const next = moveCalendarDate(this.focusedDate, move);\n const { start, end } = this.years;\n if (next.getFullYear() < start || next.getFullYear() > end) return;\n\n this.focusedDate = next;\n this.shouldRestoreFocus = true;\n\n // Keep the focused day on screen: it belongs to one of the two months.\n const right = addMonths(this.leftMonth, 1);\n if (!isSameMonth(next, this.leftMonth) && !isSameMonth(next, right)) {\n this.leftMonth = this.clamp(startOfMonth(next));\n }\n }\n\n private onKeyDown = (event: KeyboardEvent) => {\n const move = MOVES[event.key];\n if (move) {\n event.preventDefault();\n this.moveFocus(move);\n return;\n }\n\n if (event.key === Keys.Enter || event.key === Keys.Space) {\n event.preventDefault();\n this.pick(this.focusedDate);\n this.shouldRestoreFocus = true;\n }\n };\n\n private clear = (event: MouseEvent) => {\n event.stopPropagation();\n if (!this.value && !this.pendingStart) return;\n this.value = '';\n this.pendingStart = null;\n this.awaitingEnd = false;\n this.hovered = null;\n this.pfChange.emit({ value: '', start: '', end: '' });\n };\n\n private formatted(): string {\n const { start, end } = this.range();\n if (!start || !end) return '';\n const format = new Intl.DateTimeFormat('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n });\n return `${format.format(start)} – ${format.format(end)}`;\n }\n\n private renderGrid(month: Date) {\n const days = buildCalendarDays(month);\n const range = this.displayRange();\n const today = toMidday(new Date());\n const label = new Intl.DateTimeFormat('en-US', {\n month: 'long',\n year: 'numeric',\n }).format(month);\n\n return (\n <div class=\"month\">\n <p class=\"month-label\">{label}</p>\n <div class=\"grid\" part=\"grid\" role=\"grid\" aria-label={label}>\n <div class=\"row\" role=\"row\">\n {WEEKDAY_LABELS.map((day) => (\n <span key={day} class=\"weekday\" role=\"columnheader\" aria-label={day}>\n {day}\n </span>\n ))}\n </div>\n\n {Array.from({ length: CALENDAR_CELL_COUNT / 7 }, (_, week) => (\n <div key={week} class=\"row\" role=\"row\">\n {days.slice(week * 7, week * 7 + 7).map(({ date, inCurrentMonth }) => {\n if (!inCurrentMonth) {\n return <span key={formatISODate(date)} class=\"empty\" role=\"gridcell\"></span>;\n }\n\n const state = rangeDayState(date, range, this.hovered);\n const isEndpoint = state.isStart || state.isEnd;\n const disabled = this.isDisabled(date);\n\n return (\n <button\n key={formatISODate(date)}\n type=\"button\"\n role=\"gridcell\"\n data-day={formatISODate(date)}\n part=\"day\"\n class={{\n day: true,\n 'day--today': isSameDay(today, date),\n 'day--endpoint': isEndpoint,\n 'day--start': state.isStart,\n 'day--end': state.isEnd,\n 'day--inside': state.isInside,\n }}\n tabindex={isSameDay(this.focusedDate, date) ? 0 : -1}\n aria-selected={isEndpoint || state.isInside ? 'true' : 'false'}\n aria-current={isSameDay(today, date) ? 'date' : null}\n aria-disabled={disabled ? 'true' : null}\n aria-label={new Intl.DateTimeFormat('en-US', {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n }).format(date)}\n onClick={() => {\n this.pick(date);\n this.shouldRestoreFocus = true;\n }}\n onMouseEnter={() => {\n if (this.awaitingEnd && !disabled) this.hovered = date;\n }}\n >\n {date.getDate()}\n </button>\n );\n })}\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n render() {\n const describedBy = composeDescribedBy(\n this.description && 'description',\n this.error && 'error',\n );\n const text = this.formatted();\n const right = addMonths(this.leftMonth, 1);\n\n return (\n <Host>\n <div class=\"field\" part=\"field\">\n {this.label && (\n <label class=\"label\" part=\"label\" htmlFor=\"trigger\">\n {this.label}\n {this.required && (\n <span class=\"required\" aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <div class=\"row-controls\">\n <button\n id=\"trigger\"\n aria-label={controlAriaLabel(this.el, this.label)}\n part=\"trigger\"\n class={{ trigger: true, 'trigger--invalid': Boolean(this.error) }}\n type=\"button\"\n disabled={this.disabled}\n aria-haspopup=\"dialog\"\n aria-expanded={this.open ? 'true' : 'false'}\n aria-controls=\"panel\"\n aria-invalid={this.error ? 'true' : null}\n aria-required={this.required ? 'true' : null}\n aria-describedby={describedBy}\n onClick={() => {\n if (!this.disabled) this.open = !this.open;\n }}\n >\n <span class={{ value: true, 'value--placeholder': !text }}>\n {text || this.placeholder}\n </span>\n <pf-icon name=\"calendar\"></pf-icon>\n </button>\n\n {this.allowClear && (this.value || this.pendingStart) && (\n <button\n class=\"clear\"\n part=\"clear\"\n type=\"button\"\n aria-label=\"Clear selected dates\"\n disabled={this.disabled}\n onClick={this.clear}\n >\n <pf-icon name=\"circle-xmark\"></pf-icon>\n </button>\n )}\n </div>\n\n {this.description && (\n <p class=\"description\" part=\"description\" id=\"description\">\n {this.description}\n </p>\n )}\n {this.error && (\n <p class=\"error\" part=\"error\" id=\"error\">\n {this.error}\n </p>\n )}\n </div>\n\n <div\n id=\"panel\"\n part=\"panel\"\n class=\"panel\"\n popover=\"auto\"\n role=\"dialog\"\n aria-label=\"Choose a date range\"\n onToggle={this.onToggle}\n onKeyDown={this.onKeyDown}\n onMouseLeave={() => {\n this.hovered = null;\n }}\n >\n <div class=\"nav\">\n <button\n type=\"button\"\n class=\"step\"\n aria-label=\"Previous month\"\n onClick={() => {\n this.leftMonth = this.clamp(addMonths(this.leftMonth, -1));\n }}\n >\n <pf-icon name=\"square-caret-left\"></pf-icon>\n </button>\n <button\n type=\"button\"\n class=\"step\"\n aria-label=\"Next month\"\n onClick={() => {\n this.leftMonth = this.clamp(addMonths(this.leftMonth, 1));\n }}\n >\n <pf-icon name=\"square-caret-right\"></pf-icon>\n </button>\n </div>\n\n <div class=\"months\">\n {this.renderGrid(this.leftMonth)}\n {this.renderGrid(right)}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -31,8 +31,20 @@ const PfHeaderNavigation = class {
31
31
  this.sync();
32
32
  }
33
33
  /**
34
- * Re-reads the items, for a consumer who marked one current through its
35
- * *property* — which leaves no attribute and fires no `slotchange`.
34
+ * An item's `current` changed, so the resolution has to run again.
35
+ *
36
+ * The items are this navigation's own light-DOM children, so nothing is
37
+ * retargeted and a host listener is safe — the same reason the sidebar can
38
+ * listen for a section's copy of this event. `refresh()` stays for a
39
+ * consumer who changes something else the group reads.
40
+ */
41
+ handleStructureChange(event) {
42
+ event.stopPropagation();
43
+ this.sync();
44
+ }
45
+ /**
46
+ * Re-reads the items, for a consumer who changed something the group reads
47
+ * and has no event for.
36
48
  */
37
49
  async refresh() {
38
50
  this.sync();
@@ -66,7 +78,7 @@ const PfHeaderNavigation = class {
66
78
  }
67
79
  }
68
80
  render() {
69
- return (index.h(index.Host, { key: '2b0c0031fc8225b1b3d87cf91c06a84138840dca' }, index.h("nav", { key: '196a2e3faf81b1b831683ae4e422beedeeef1af6', class: "nav", part: "nav", "aria-label": this.label }, index.h("span", { key: 'a99fb70cb2763fd865f1d39290632952d1f27fbb', class: { brand: true, empty: !this.hasBrand }, part: "brand" }, index.h("slot", { key: 'e9d3eb13fd19f1265b3caed47e082331414e47f9', name: "brand", onSlotchange: () => this.refresh() })), index.h("ul", { key: 'c03966d2083df04e560b2151d89694755276aea2', class: "list", part: "list" }, index.h("slot", { key: '754a8d4910efc0aee658ea4c01e392f2a2f91178', onSlotchange: () => this.refresh() })), index.h("span", { key: 'bee95bd441bb2bac3ef88ce5ca40ea07989adba4', class: { actions: true, empty: !this.hasActions }, part: "actions" }, index.h("slot", { key: 'a5a75d6aa8ff4736d32a6ddd9535c34c629ee524', name: "actions", onSlotchange: () => this.refresh() })))));
81
+ return (index.h(index.Host, { key: 'f3f8c91ba9eab4755b1e5e96adc7245e630bd7fa' }, index.h("nav", { key: '7984894e4bcc395140ef229f351bbc037efa565e', class: "nav", part: "nav", "aria-label": this.label }, index.h("span", { key: 'fc21f987ab7f5ac3c74779157f70a23c5375cb27', class: { brand: true, empty: !this.hasBrand }, part: "brand" }, index.h("slot", { key: 'bb68a3a686be890c522671f3d6a569f438275631', name: "brand", onSlotchange: () => this.refresh() })), index.h("ul", { key: '43f0bb0d2d82497373ac74bfda26d9e2e545932e', class: "list", part: "list" }, index.h("slot", { key: '30be86d24556bd3521642ee79195a2af6a8c70c9', onSlotchange: () => this.refresh() })), index.h("span", { key: '687115f0db5bb7f35a82bb1b5dd79234a0049c99', class: { actions: true, empty: !this.hasActions }, part: "actions" }, index.h("slot", { key: 'f11f998414c8a424d64ddf759369a31b9ddbd0bb', name: "actions", onSlotchange: () => this.refresh() })))));
70
82
  }
71
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AAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAC,SAAS,EAAA,EACrEA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,EAAA,CAAI,CACtD,CACH,CACD;;;;;;;","names":["resolveCurrentNavItem","h","Host"],"sources":["src/components/pf-header-navigation/pf-header-navigation.css?tag=pf-header-navigation&encapsulation=shadow","src/components/pf-header-navigation/pf-header-navigation.tsx"],"sourcesContent":[":host {\n background: var(--pf-header-nav-bg);\n border: 1px solid var(--pf-header-nav-border);\n border-radius: var(--pf-header-nav-radius, var(--radius-md));\n display: block;\n width: 100%;\n\n /*\n * The bridge to the shared item: custom properties inherit through a shadow\n * boundary, so a slotted `pf-nav-item` resolves these inside its own shadow\n * root. It is how one element serves two navigations without\n * `:host-context`, which Firefox does not support.\n */\n --pf-nav-item-text: var(--pf-header-nav-text-muted);\n --pf-nav-item-hover-text: var(--pf-header-nav-text);\n --pf-nav-item-hover-bg: var(--pf-header-nav-bg-subtle);\n --pf-nav-item-current-text: var(--pf-header-nav-text);\n --pf-nav-item-current-bg: var(--pf-header-nav-bg-subtle);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n/* Mobile first: one column, the items wrapping under the brand. */\n.nav {\n align-items: center;\n display: grid;\n gap: var(--space-3);\n grid-template-columns: 1fr;\n min-height: var(--pf-header-nav-min-height, 56px);\n padding: var(--space-3);\n}\n\n@media (--md) {\n .nav {\n grid-template-columns: auto 1fr auto;\n padding: 0 var(--space-4);\n }\n}\n\n.brand {\n color: var(--pf-header-nav-text);\n font-size: var(--font-size-md);\n font-weight: var(--font-weight-semibold);\n white-space: nowrap;\n}\n\n.list {\n align-items: center;\n display: flex;\n gap: var(--space-1);\n list-style: none;\n margin: 0;\n overflow-x: auto;\n padding: 0;\n}\n\n/*\n * The items have to be flex children of the list, not of a box inside it. The\n * UA stylesheet already gives a slot `display: contents`; this says so out\n * loud.\n */\n.list slot {\n display: contents;\n}\n\n.actions {\n align-items: center;\n display: inline-flex;\n gap: var(--space-2);\n}\n\n/*\n * Both classes rather than a bare `.empty`, so the rule does not depend on\n * sitting below the `display` a box sets on itself: specificity ties break on\n * source order, and `.empty` losing that way is how a bare `pf-metric-card`\n * came to draw all three of its boxes.\n */\n.brand.empty,\n.actions.empty {\n display: none;\n}\n","import { resolveCurrentNavItem } from '@pitchfork-ui/core';\nimport { Component, Element, h, Host, Method, Prop, State } from '@stencil/core';\n\n/**\n * A header navigation over `pf-nav-item` children.\n *\n * The group owns the one thing an item cannot know: which item is the current\n * page. Core's rule decides, so the React `HeaderNavigation` marks the same\n * one, and it is one index — which is what stops a navigation claiming two\n * current pages.\n *\n * The host is **not** a banner. The React component renders a `<header>`,\n * which is the banner landmark at the top level of a page, but an element\n * cannot know whether it is the page's header: a second banner is a defect,\n * not a decoration. So the shadow root renders only the `<nav>` landmark, and\n * a consumer who wants a banner puts this inside their own `<header>`.\n *\n * @slot - the `pf-nav-item` children.\n * @slot brand - a logo or product name, before the items.\n * @slot actions - controls after the items, such as a sign-in button.\n * @part nav - the navigation landmark.\n * @part brand - the brand's box.\n * @part list - the list the items are slotted into.\n * @part actions - the actions' box.\n */\n@Component({\n tag: 'pf-header-navigation',\n styleUrl: 'pf-header-navigation.css',\n shadow: true,\n})\nexport class PfHeaderNavigation {\n @Element() el!: HTMLElement;\n\n /** The navigation's accessible name. */\n @Prop() label = 'Header navigation';\n\n /**\n * Whether anything was slotted into `brand` and `actions`.\n *\n * Asked in JS because a wrapper around a slot cannot be collapsed from CSS\n * — `:not(:has(*))` never matches, since the `<slot>` is itself a child —\n * and these two boxes have to exist when they are used: they are grid\n * items, so an empty one still takes a column and a gap, which would push\n * every item along by one `--space-3` for no visible reason.\n */\n @State() hasBrand = false;\n @State() hasActions = false;\n\n /** The light DOM is readable here, so first paint is already right. */\n componentWillLoad() {\n this.sync();\n }\n\n componentDidLoad() {\n this.sync();\n }\n\n /**\n * Re-reads the items, for a consumer who marked one current through its\n * *property* — which leaves no attribute and fires no `slotchange`.\n */\n @Method()\n async refresh() {\n this.sync();\n }\n\n /** Direct children only: a nested navigation owns its own items. */\n private get items(): HTMLElement[] {\n return Array.from(this.el.querySelectorAll<HTMLElement>('pf-nav-item')).filter(\n (item) => item.parentElement === this.el,\n );\n }\n\n /**\n * The property if the item has upgraded, the attribute if it has not:\n * `componentWillLoad` can run before a child parsed from HTML upgrades.\n */\n private isCurrent(item: HTMLElement) {\n return (item as HTMLElement & { current?: boolean }).current ?? item.hasAttribute('current');\n }\n\n private sync() {\n /*\n * The children are read one by one rather than with a `:scope >`\n * selector, which Stencil's mock DOM does not support at all — it throws\n * from jQuery's selector engine rather than returning nothing.\n */\n const slotted = (name: string) =>\n Array.from(this.el.children).some((child) => child.getAttribute('slot') === name);\n\n this.hasBrand = slotted('brand');\n this.hasActions = slotted('actions');\n\n const items = this.items;\n const currentIndex = resolveCurrentNavItem(\n items.map((item) => ({ current: this.isCurrent(item) })),\n );\n\n for (const [index, item] of items.entries()) {\n const node = item as HTMLElement & { currentPage: boolean; orientation: string };\n node.currentPage = index === currentIndex;\n node.orientation = 'horizontal';\n }\n }\n\n render() {\n return (\n <Host>\n <nav class=\"nav\" part=\"nav\" aria-label={this.label}>\n {/*\n The slots stay in the tree whether or not they hold anything: a\n slot that is not rendered never fires `slotchange`, so content\n added later would stay invisible for good. The box is hidden\n instead.\n */}\n <span class={{ brand: true, empty: !this.hasBrand }} part=\"brand\">\n <slot name=\"brand\" onSlotchange={() => this.refresh()} />\n </span>\n\n <ul class=\"list\" part=\"list\">\n <slot onSlotchange={() => this.refresh()} />\n </ul>\n\n <span class={{ actions: true, empty: !this.hasActions }} part=\"actions\">\n <slot name=\"actions\" onSlotchange={() => this.refresh()} />\n </span>\n </nav>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pf-header-navigation.cjs.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AAA,0CAAA,EAAM,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAC,SAAS,EAAA,EACrEA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAM,IAAI,EAAC,SAAS,EAAC,YAAY,EAAE,MAAM,IAAI,CAAC,OAAO,EAAE,EAAA,CAAI,CACtD,CACH,CACD;;;;;;;","names":["resolveCurrentNavItem","h","Host"],"sources":["src/components/pf-header-navigation/pf-header-navigation.css?tag=pf-header-navigation&encapsulation=shadow","src/components/pf-header-navigation/pf-header-navigation.tsx"],"sourcesContent":[":host {\n background: var(--pf-header-nav-bg);\n border: 1px solid var(--pf-header-nav-border);\n border-radius: var(--pf-header-nav-radius, var(--radius-md));\n display: block;\n width: 100%;\n\n /*\n * The bridge to the shared item: custom properties inherit through a shadow\n * boundary, so a slotted `pf-nav-item` resolves these inside its own shadow\n * root. It is how one element serves two navigations without\n * `:host-context`, which Firefox does not support.\n */\n --pf-nav-item-text: var(--pf-header-nav-text-muted);\n --pf-nav-item-hover-text: var(--pf-header-nav-text);\n --pf-nav-item-hover-bg: var(--pf-header-nav-bg-subtle);\n --pf-nav-item-current-text: var(--pf-header-nav-text);\n --pf-nav-item-current-bg: var(--pf-header-nav-bg-subtle);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n/* Mobile first: one column, the items wrapping under the brand. */\n.nav {\n align-items: center;\n display: grid;\n gap: var(--space-3);\n grid-template-columns: 1fr;\n min-height: var(--pf-header-nav-min-height, 56px);\n padding: var(--space-3);\n}\n\n@media (--md) {\n .nav {\n grid-template-columns: auto 1fr auto;\n padding: 0 var(--space-4);\n }\n}\n\n.brand {\n color: var(--pf-header-nav-text);\n font-size: var(--font-size-md);\n font-weight: var(--font-weight-semibold);\n white-space: nowrap;\n}\n\n.list {\n align-items: center;\n display: flex;\n gap: var(--space-1);\n list-style: none;\n margin: 0;\n overflow-x: auto;\n padding: 0;\n}\n\n/*\n * The items have to be flex children of the list, not of a box inside it. The\n * UA stylesheet already gives a slot `display: contents`; this says so out\n * loud.\n */\n.list slot {\n display: contents;\n}\n\n.actions {\n align-items: center;\n display: inline-flex;\n gap: var(--space-2);\n}\n\n/*\n * Both classes rather than a bare `.empty`, so the rule does not depend on\n * sitting below the `display` a box sets on itself: specificity ties break on\n * source order, and `.empty` losing that way is how a bare `pf-metric-card`\n * came to draw all three of its boxes.\n */\n.brand.empty,\n.actions.empty {\n display: none;\n}\n","import { resolveCurrentNavItem } from '@pitchfork-ui/core';\nimport { Component, Element, h, Host, Listen, Method, Prop, State } from '@stencil/core';\n\n/**\n * A header navigation over `pf-nav-item` children.\n *\n * The group owns the one thing an item cannot know: which item is the current\n * page. Core's rule decides, so the React `HeaderNavigation` marks the same\n * one, and it is one index — which is what stops a navigation claiming two\n * current pages.\n *\n * The host is **not** a banner. The React component renders a `<header>`,\n * which is the banner landmark at the top level of a page, but an element\n * cannot know whether it is the page's header: a second banner is a defect,\n * not a decoration. So the shadow root renders only the `<nav>` landmark, and\n * a consumer who wants a banner puts this inside their own `<header>`.\n *\n * @slot - the `pf-nav-item` children.\n * @slot brand - a logo or product name, before the items.\n * @slot actions - controls after the items, such as a sign-in button.\n * @part nav - the navigation landmark.\n * @part brand - the brand's box.\n * @part list - the list the items are slotted into.\n * @part actions - the actions' box.\n */\n@Component({\n tag: 'pf-header-navigation',\n styleUrl: 'pf-header-navigation.css',\n shadow: true,\n})\nexport class PfHeaderNavigation {\n @Element() el!: HTMLElement;\n\n /** The navigation's accessible name. */\n @Prop() label = 'Header navigation';\n\n /**\n * Whether anything was slotted into `brand` and `actions`.\n *\n * Asked in JS because a wrapper around a slot cannot be collapsed from CSS\n * — `:not(:has(*))` never matches, since the `<slot>` is itself a child —\n * and these two boxes have to exist when they are used: they are grid\n * items, so an empty one still takes a column and a gap, which would push\n * every item along by one `--space-3` for no visible reason.\n */\n @State() hasBrand = false;\n @State() hasActions = false;\n\n /** The light DOM is readable here, so first paint is already right. */\n componentWillLoad() {\n this.sync();\n }\n\n componentDidLoad() {\n this.sync();\n }\n\n /**\n * An item's `current` changed, so the resolution has to run again.\n *\n * The items are this navigation's own light-DOM children, so nothing is\n * retargeted and a host listener is safe — the same reason the sidebar can\n * listen for a section's copy of this event. `refresh()` stays for a\n * consumer who changes something else the group reads.\n */\n @Listen('pfNavStructure')\n handleStructureChange(event: CustomEvent<void>) {\n event.stopPropagation();\n this.sync();\n }\n\n /**\n * Re-reads the items, for a consumer who changed something the group reads\n * and has no event for.\n */\n @Method()\n async refresh() {\n this.sync();\n }\n\n /** Direct children only: a nested navigation owns its own items. */\n private get items(): HTMLElement[] {\n return Array.from(this.el.querySelectorAll<HTMLElement>('pf-nav-item')).filter(\n (item) => item.parentElement === this.el,\n );\n }\n\n /**\n * The property if the item has upgraded, the attribute if it has not:\n * `componentWillLoad` can run before a child parsed from HTML upgrades.\n */\n private isCurrent(item: HTMLElement) {\n return (item as HTMLElement & { current?: boolean }).current ?? item.hasAttribute('current');\n }\n\n private sync() {\n /*\n * The children are read one by one rather than with a `:scope >`\n * selector, which Stencil's mock DOM does not support at all — it throws\n * from jQuery's selector engine rather than returning nothing.\n */\n const slotted = (name: string) =>\n Array.from(this.el.children).some((child) => child.getAttribute('slot') === name);\n\n this.hasBrand = slotted('brand');\n this.hasActions = slotted('actions');\n\n const items = this.items;\n const currentIndex = resolveCurrentNavItem(\n items.map((item) => ({ current: this.isCurrent(item) })),\n );\n\n for (const [index, item] of items.entries()) {\n const node = item as HTMLElement & { currentPage: boolean; orientation: string };\n node.currentPage = index === currentIndex;\n node.orientation = 'horizontal';\n }\n }\n\n render() {\n return (\n <Host>\n <nav class=\"nav\" part=\"nav\" aria-label={this.label}>\n {/*\n The slots stay in the tree whether or not they hold anything: a\n slot that is not rendered never fires `slotchange`, so content\n added later would stay invisible for good. The box is hidden\n instead.\n */}\n <span class={{ brand: true, empty: !this.hasBrand }} part=\"brand\">\n <slot name=\"brand\" onSlotchange={() => this.refresh()} />\n </span>\n\n <ul class=\"list\" part=\"list\">\n <slot onSlotchange={() => this.refresh()} />\n </ul>\n\n <span class={{ actions: true, empty: !this.hasActions }} part=\"actions\">\n <slot name=\"actions\" onSlotchange={() => this.refresh()} />\n </span>\n </nav>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -3,6 +3,7 @@
3
3
  var index = require('./index-CIskGKk1.js');
4
4
  var aria = require('./aria-5oCPUGFo.js');
5
5
  var formValidity = require('./form-validity-BCrcqnZ7.js');
6
+ var controlLabel = require('./control-label-C0eK8bPh.js');
6
7
 
7
8
  const pfInputCss = () => `:host{display:block}:host([hidden]){display:none}.field{display:grid;gap:var(--space-2)}.label{color:var(--pf-input-field-label, var(--pf-field-label));font-size:var(--font-size-sm);font-weight:var(--font-weight-medium)}.required{color:var(--pf-field-required);margin-inline-start:var(--space-1)}.description{color:var(--pf-input-field-description, var(--pf-field-description));font-size:var(--font-size-sm);margin:0}.error{color:var(--pf-input-field-error, var(--pf-field-error));font-size:var(--font-size-sm);margin:0}.input{background:var(--pf-input-bg);border:1px solid var(--pf-input-border);border-radius:var(--radius-md);color:var(--pf-input-text);font:inherit;min-height:40px;padding:0 var(--space-3);width:100%;transition:background 0.2s, border 0.2s, color 0.2s, opacity 0.2s}.input:disabled{background:var(--pf-control-bg-disabled);border-color:var(--pf-control-border-disabled);color:var(--pf-control-text-disabled);cursor:not-allowed;opacity:0.6}.input:focus{outline:none}.input:focus-visible{border-color:var(--pf-input-focus-border);box-shadow:var(--pf-input-focus-ring, var(--pf-focus-ring))}.input::placeholder{color:var(--pf-input-placeholder)}.input--invalid{border-color:var(--pf-input-invalid-border)}@media (prefers-reduced-motion: reduce){.input{transition:none}}`;
8
9
 
@@ -19,6 +20,7 @@ const PfInput = class {
19
20
  hostRef.$hostElement$["s-ei"] = this.internals;
20
21
  }
21
22
  }
23
+ get el() { return index.getElement(this); }
22
24
  internals;
23
25
  /**
24
26
  * Submitted under this name.
@@ -98,7 +100,7 @@ const PfInput = class {
98
100
  // IDs are scoped to this shadow root, so they can be literal -- the useId()
99
101
  // the React component needs has no counterpart here.
100
102
  const describedBy = aria.composeDescribedBy(this.description && 'description', this.error && 'error');
101
- return (index.h(index.Host, { key: 'a6d68ce6641fb92407356c94e2181b280bdc03b6' }, index.h("div", { key: '312ee69f4a661494548b01f598b74ed56bd443fc', class: "field", part: "field" }, this.label && (index.h("label", { key: '59188fde6b3639105f8ade8b497c764ddd5d658f', class: "label", part: "label", htmlFor: "input" }, this.label, this.required && (index.h("span", { key: '4f71679ec6bb99d3f7dc8f941d8c02bb94452c21', class: "required", "aria-hidden": "true" }, "*")))), index.h("input", { key: '0680b0e5aa0f8ddf9850a212f735f0f8c5b273a3', id: "input", part: "input", class: { input: true, 'input--invalid': Boolean(this.error) }, type: this.type, name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, disabled: this.disabled, readOnly: this.readonly, "aria-invalid": this.error ? 'true' : null, "aria-describedby": describedBy, onInput: this.onInput, onChange: this.onChange }), this.description && (index.h("p", { key: 'f732742b8602ed6094600065d5036bdad538ad35', class: "description", part: "description", id: "description" }, this.description)), this.error && (index.h("p", { key: '9d524a204abfb733afaf2bf3cc5ec9a5e1c65b94', class: "error", part: "error", id: "error" }, this.error)))));
103
+ return (index.h(index.Host, { key: '2eabd0d15d1a83b03064dee5feef9884a55a3c4c' }, index.h("div", { key: '3c10b0b9d675eede30e34c27013d51713584baca', class: "field", part: "field" }, this.label && (index.h("label", { key: 'f0b9b45f307792a93190a354efcf0a980a326589', class: "label", part: "label", htmlFor: "input" }, this.label, this.required && (index.h("span", { key: 'e3d8edb769ea8736ca485f5e539a0398ba1d1a33', class: "required", "aria-hidden": "true" }, "*")))), index.h("input", { key: '419f2ba1f5a7b62b5042d1fd94b96a8abee829a7', id: "input", "aria-label": controlLabel.controlAriaLabel(this.el, this.label), part: "input", class: { input: true, 'input--invalid': Boolean(this.error) }, type: this.type, name: this.name, value: this.value, placeholder: this.placeholder, required: this.required, disabled: this.disabled, readOnly: this.readonly, "aria-invalid": this.error ? 'true' : null, "aria-describedby": describedBy, onInput: this.onInput, onChange: this.onChange }), this.description && (index.h("p", { key: 'c0d1323a34f5503a2049cc3ac5ef9e892cfb1cb6', class: "description", part: "description", id: "description" }, this.description)), this.error && (index.h("p", { key: '915301b580225bbf0b901c53f977b73a53fa94ee', class: "error", part: "error", id: "error" }, this.error)))));
102
104
  }
103
105
  static get delegatesFocus() { return true; }
104
106
  static get formAssociated() { return true; }
@@ -1 +1 @@
1
- {"file":"pf-input.cjs.entry.js","mappings":";;;;;;AAAA,MAAM,UAAU,GAAG,MAAM,CAAC,kxCAAkxC,CAAC;;MCoChyC,OAAO,GAAA,MAAA;;;;;;;;;;;;;AACC,IAAA,SAAS;AAE5B;;;;;;;;AAQG;AACsB,IAAA,IAAI;;IAGJ,KAAK,GAAG,EAAE;IAEV,IAAI,GAAgB,MAAM;;AAG3C,IAAA,KAAK;;AAGL,IAAA,WAAW;;AAGX,IAAA,KAAK;AAEL,IAAA,WAAW;IAEM,QAAQ,GAAG,KAAK;IAEhB,QAAQ,GAAG,KAAK;IAEhB,QAAQ,GAAG,KAAK;;AAGhC,IAAA,OAAO;;AAGP,IAAA,QAAQ;AAEjB;;;AAGG;IACK,YAAY,GAAG,EAAE;IAEzB,iBAAiB,GAAA;QACf,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE;QACpC,IAAI,CAAC,aAAa,EAAE;;IAMtB,aAAa,GAAA;QACX,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC7CA,iCAAoB,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC;;AAGtF;;;;;;AAMG;AAEH,IAAA,MAAM,aAAa,GAAA;AACjB,QAAA,OAAO,IAAI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EAAA,GAAA,CAElC,CACR,CACK,CACT,EACDA,OAAA,CAAA,OAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EACE,EAAE,EAAC,OAAO,EACV,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAC7D,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAA,cAAA,EACT,IAAI,CAAC,KAAK,GAAG,MAAM,GAAG,IAAI,EAAA,kBAAA,EACtB,WAAW,EAC7B,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAA,CACvB,EACD,IAAI,CAAC,WAAW,KACfA,gEAAG,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,aAAa,EAAC,EAAE,EAAC,aAAa,IACvD,IAAI,CAAC,WAAW,CACf,CACL,EACA,IAAI,CAAC,KAAK,KACTA,OAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,EAAE,EAAC,OAAO,EAAA,EACrC,IAAI,CAAC,KAAK,CACT,CACL,CACG,CACD;;;;;;;;;;;;;;;;;;;;","names":["applyControlValidity","composeDescribedBy","h","Host"],"sources":["src/components/pf-input/pf-input.css?tag=pf-input&encapsulation=shadow","src/components/pf-input/pf-input.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.field {\n display: grid;\n gap: var(--space-2);\n}\n\n.label {\n color: var(--pf-input-field-label, var(--pf-field-label));\n font-size: var(--font-size-sm);\n font-weight: var(--font-weight-medium);\n}\n\n.required {\n color: var(--pf-field-required);\n margin-inline-start: var(--space-1);\n}\n\n.description {\n color: var(--pf-input-field-description, var(--pf-field-description));\n font-size: var(--font-size-sm);\n margin: 0;\n}\n\n.error {\n color: var(--pf-input-field-error, var(--pf-field-error));\n font-size: var(--font-size-sm);\n margin: 0;\n}\n\n.input {\n background: var(--pf-input-bg);\n border: 1px solid var(--pf-input-border);\n border-radius: var(--radius-md);\n color: var(--pf-input-text);\n font: inherit;\n min-height: 40px;\n padding: 0 var(--space-3);\n width: 100%;\n transition:\n background 0.2s,\n border 0.2s,\n color 0.2s,\n opacity 0.2s;\n}\n\n.input:disabled {\n background: var(--pf-control-bg-disabled);\n border-color: var(--pf-control-border-disabled);\n color: var(--pf-control-text-disabled);\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.input:focus {\n outline: none;\n}\n\n.input:focus-visible {\n border-color: var(--pf-input-focus-border);\n box-shadow: var(--pf-input-focus-ring, var(--pf-focus-ring));\n}\n\n.input::placeholder {\n color: var(--pf-input-placeholder);\n}\n\n.input--invalid {\n border-color: var(--pf-input-invalid-border);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .input {\n transition: none;\n }\n}\n","import { composeDescribedBy } from '@pitchfork-ui/core';\nimport { applyControlValidity } from '../../form-validity';\nimport {\n AttachInternals,\n Component,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n Watch,\n} from '@stencil/core';\n\nexport type PfInputType = 'text' | 'email' | 'password' | 'search' | 'tel' | 'url';\n\n/**\n * A form-associated text input.\n *\n * `formAssociated` plus `ElementInternals` is what makes this participate in a\n * real `<form>`: the value reaches `FormData`, constraint validation works, and\n * Angular's generated value accessor has something to bind to. A plain\n * `<input>` inside a shadow root does none of that.\n *\n * @part field - the wrapper around label, control and messages.\n * @part label - the label element.\n * @part input - the native input.\n * @part description - the hint text below the control.\n * @part error - the error message below the control.\n */\n@Component({\n tag: 'pf-input',\n styleUrl: 'pf-input.css',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n})\nexport class PfInput {\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * Submitted under this name.\n *\n * Reflected, because a form-associated custom element takes its submission\n * name from the `name` *content attribute* -- not from this property. A\n * framework wrapper that sets properties rather than attributes (the\n * generated React bindings do) would otherwise leave the control nameless\n * and absent from the submission, with every other sign of working.\n */\n @Prop({ reflect: true }) name?: string;\n\n /** The control's value. */\n @Prop({ mutable: true }) value = '';\n\n @Prop({ reflect: true }) type: PfInputType = 'text';\n\n /** Visible label. Rendered in the same root as the input, so `for` works. */\n @Prop() label?: string;\n\n /** Hint text below the control. */\n @Prop() description?: string;\n\n /** Error message. Its presence is what marks the control invalid. */\n @Prop() error?: string;\n\n @Prop() placeholder?: string;\n\n @Prop({ reflect: true }) required = false;\n\n @Prop({ reflect: true }) disabled = false;\n\n @Prop({ reflect: true }) readonly = false;\n\n /** Fires on every keystroke, like the native `input` event. */\n @Event() pfInput!: EventEmitter<{ value: string }>;\n\n /** Fires when the value is committed, like the native `change` event. */\n @Event() pfChange!: EventEmitter<{ value: string }>;\n\n /**\n * The value the control had when it was created, which is what a form reset\n * restores. Captured here because `value` has been overwritten by then.\n */\n private initialValue = '';\n\n componentWillLoad() {\n this.initialValue = this.value ?? '';\n this.syncFormState();\n }\n\n @Watch('value')\n @Watch('error')\n @Watch('required')\n syncFormState() {\n this.internals.setFormValue(this.value ?? '');\n applyControlValidity(this.internals, Boolean(this.value), this.required, this.error);\n }\n\n /**\n * Whether the control currently satisfies its constraints.\n *\n * A form-associated custom element does not inherit `checkValidity` from\n * anywhere -- the spec puts it on ElementInternals, so the element has to\n * forward it or consumers cannot ask.\n */\n @Method()\n async checkValidity(): Promise<boolean> {\n return this.internals.checkValidity();\n }\n\n /** As `checkValidity`, but also shows the browser's validation message. */\n @Method()\n async reportValidity(): Promise<boolean> {\n return this.internals.reportValidity();\n }\n\n /** The message explaining why the control is invalid, or an empty string. */\n @Method()\n async getValidationMessage(): Promise<string> {\n return this.internals.validationMessage;\n }\n\n /**\n * A reset restores the value the control started with, not an empty string —\n * verified against a native `<input value=\"initial\">`, which comes back to\n * \"initial\" rather than to \"\". Clearing it was a real defect: a\n * `<pf-input value=\"…\">` in a form lost its value on any reset.\n */\n formResetCallback() {\n this.value = this.initialValue;\n }\n\n private onInput = (event: Event) => {\n this.value = (event.target as HTMLInputElement).value;\n this.pfInput.emit({ value: this.value });\n };\n\n private onChange = () => {\n this.pfChange.emit({ value: this.value });\n };\n\n render() {\n // IDs are scoped to this shadow root, so they can be literal -- the useId()\n // the React component needs has no counterpart here.\n const describedBy = composeDescribedBy(\n this.description && 'description',\n this.error && 'error',\n );\n\n return (\n <Host>\n <div class=\"field\" part=\"field\">\n {this.label && (\n <label class=\"label\" part=\"label\" htmlFor=\"input\">\n {this.label}\n {this.required && (\n <span class=\"required\" aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n <input\n id=\"input\"\n part=\"input\"\n class={{ input: true, 'input--invalid': Boolean(this.error) }}\n type={this.type}\n name={this.name}\n value={this.value}\n placeholder={this.placeholder}\n required={this.required}\n disabled={this.disabled}\n readOnly={this.readonly}\n aria-invalid={this.error ? 'true' : null}\n aria-describedby={describedBy}\n onInput={this.onInput}\n onChange={this.onChange}\n />\n {this.description && (\n <p class=\"description\" part=\"description\" id=\"description\">\n {this.description}\n </p>\n )}\n {this.error && (\n <p class=\"error\" part=\"error\" id=\"error\">\n {this.error}\n </p>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pf-input.cjs.entry.js","mappings":";;;;;;;AAAA,MAAM,UAAU,GAAG,MAAM,CAAC,kxCAAkxC,CAAC;;MCsChyC,OAAO,GAAA,MAAA;;;;;;;;;;;;;;AAGC,IAAA,SAAS;AAE5B;;;;;;;;AAQG;AACsB,IAAA,IAAI;;IAGJ,KAAK,GAAG,EAAE;IAEV,IAAI,GAAgB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C,QAAQ,EAAA,cAAA,EACT,IAAI,CAAC,KAAK,GAAG,MAAM,GAAG,IAAI,EAAA,kBAAA,EACtB,WAAW,EAC7B,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAA,CACvB,EACD,IAAI,CAAC,WAAW,KACfF,gEAAG,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,aAAa,EAAC,EAAE,EAAC,aAAa,IACvD,IAAI,CAAC,WAAW,CACf,CACL,EACA,IAAI,CAAC,KAAK,KACTA,OAAA,CAAA,GAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAG,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,OAAO,EAAC,EAAE,EAAC,OAAO,EAAA,EACrC,IAAI,CAAC,KAAK,CACT,CACL,CACG,CACD;;;;;;;;;;;;;;;;;;;;","names":["applyControlValidity","composeDescribedBy","h","Host","controlAriaLabel"],"sources":["src/components/pf-input/pf-input.css?tag=pf-input&encapsulation=shadow","src/components/pf-input/pf-input.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.field {\n display: grid;\n gap: var(--space-2);\n}\n\n.label {\n color: var(--pf-input-field-label, var(--pf-field-label));\n font-size: var(--font-size-sm);\n font-weight: var(--font-weight-medium);\n}\n\n.required {\n color: var(--pf-field-required);\n margin-inline-start: var(--space-1);\n}\n\n.description {\n color: var(--pf-input-field-description, var(--pf-field-description));\n font-size: var(--font-size-sm);\n margin: 0;\n}\n\n.error {\n color: var(--pf-input-field-error, var(--pf-field-error));\n font-size: var(--font-size-sm);\n margin: 0;\n}\n\n.input {\n background: var(--pf-input-bg);\n border: 1px solid var(--pf-input-border);\n border-radius: var(--radius-md);\n color: var(--pf-input-text);\n font: inherit;\n min-height: 40px;\n padding: 0 var(--space-3);\n width: 100%;\n transition:\n background 0.2s,\n border 0.2s,\n color 0.2s,\n opacity 0.2s;\n}\n\n.input:disabled {\n background: var(--pf-control-bg-disabled);\n border-color: var(--pf-control-border-disabled);\n color: var(--pf-control-text-disabled);\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.input:focus {\n outline: none;\n}\n\n.input:focus-visible {\n border-color: var(--pf-input-focus-border);\n box-shadow: var(--pf-input-focus-ring, var(--pf-focus-ring));\n}\n\n.input::placeholder {\n color: var(--pf-input-placeholder);\n}\n\n.input--invalid {\n border-color: var(--pf-input-invalid-border);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .input {\n transition: none;\n }\n}\n","import { composeDescribedBy } from '@pitchfork-ui/core';\nimport { applyControlValidity } from '../../form-validity';\nimport { controlAriaLabel } from '../../control-label';\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n Watch,\n} from '@stencil/core';\n\nexport type PfInputType = 'text' | 'email' | 'password' | 'search' | 'tel' | 'url';\n\n/**\n * A form-associated text input.\n *\n * `formAssociated` plus `ElementInternals` is what makes this participate in a\n * real `<form>`: the value reaches `FormData`, constraint validation works, and\n * Angular's generated value accessor has something to bind to. A plain\n * `<input>` inside a shadow root does none of that.\n *\n * @part field - the wrapper around label, control and messages.\n * @part label - the label element.\n * @part input - the native input.\n * @part description - the hint text below the control.\n * @part error - the error message below the control.\n */\n@Component({\n tag: 'pf-input',\n styleUrl: 'pf-input.css',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n})\nexport class PfInput {\n @Element() el!: HTMLElement;\n\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * Submitted under this name.\n *\n * Reflected, because a form-associated custom element takes its submission\n * name from the `name` *content attribute* -- not from this property. A\n * framework wrapper that sets properties rather than attributes (the\n * generated React bindings do) would otherwise leave the control nameless\n * and absent from the submission, with every other sign of working.\n */\n @Prop({ reflect: true }) name?: string;\n\n /** The control's value. */\n @Prop({ mutable: true }) value = '';\n\n @Prop({ reflect: true }) type: PfInputType = 'text';\n\n /** Visible label. Rendered in the same root as the input, so `for` works. */\n @Prop() label?: string;\n\n /** Hint text below the control. */\n @Prop() description?: string;\n\n /** Error message. Its presence is what marks the control invalid. */\n @Prop() error?: string;\n\n @Prop() placeholder?: string;\n\n @Prop({ reflect: true }) required = false;\n\n @Prop({ reflect: true }) disabled = false;\n\n @Prop({ reflect: true }) readonly = false;\n\n /** Fires on every keystroke, like the native `input` event. */\n @Event() pfInput!: EventEmitter<{ value: string }>;\n\n /** Fires when the value is committed, like the native `change` event. */\n @Event() pfChange!: EventEmitter<{ value: string }>;\n\n /**\n * The value the control had when it was created, which is what a form reset\n * restores. Captured here because `value` has been overwritten by then.\n */\n private initialValue = '';\n\n componentWillLoad() {\n this.initialValue = this.value ?? '';\n this.syncFormState();\n }\n\n @Watch('value')\n @Watch('error')\n @Watch('required')\n syncFormState() {\n this.internals.setFormValue(this.value ?? '');\n applyControlValidity(this.internals, Boolean(this.value), this.required, this.error);\n }\n\n /**\n * Whether the control currently satisfies its constraints.\n *\n * A form-associated custom element does not inherit `checkValidity` from\n * anywhere -- the spec puts it on ElementInternals, so the element has to\n * forward it or consumers cannot ask.\n */\n @Method()\n async checkValidity(): Promise<boolean> {\n return this.internals.checkValidity();\n }\n\n /** As `checkValidity`, but also shows the browser's validation message. */\n @Method()\n async reportValidity(): Promise<boolean> {\n return this.internals.reportValidity();\n }\n\n /** The message explaining why the control is invalid, or an empty string. */\n @Method()\n async getValidationMessage(): Promise<string> {\n return this.internals.validationMessage;\n }\n\n /**\n * A reset restores the value the control started with, not an empty string —\n * verified against a native `<input value=\"initial\">`, which comes back to\n * \"initial\" rather than to \"\". Clearing it was a real defect: a\n * `<pf-input value=\"…\">` in a form lost its value on any reset.\n */\n formResetCallback() {\n this.value = this.initialValue;\n }\n\n private onInput = (event: Event) => {\n this.value = (event.target as HTMLInputElement).value;\n this.pfInput.emit({ value: this.value });\n };\n\n private onChange = () => {\n this.pfChange.emit({ value: this.value });\n };\n\n render() {\n // IDs are scoped to this shadow root, so they can be literal -- the useId()\n // the React component needs has no counterpart here.\n const describedBy = composeDescribedBy(\n this.description && 'description',\n this.error && 'error',\n );\n\n return (\n <Host>\n <div class=\"field\" part=\"field\">\n {this.label && (\n <label class=\"label\" part=\"label\" htmlFor=\"input\">\n {this.label}\n {this.required && (\n <span class=\"required\" aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n <input\n id=\"input\"\n aria-label={controlAriaLabel(this.el, this.label)}\n part=\"input\"\n class={{ input: true, 'input--invalid': Boolean(this.error) }}\n type={this.type}\n name={this.name}\n value={this.value}\n placeholder={this.placeholder}\n required={this.required}\n disabled={this.disabled}\n readOnly={this.readonly}\n aria-invalid={this.error ? 'true' : null}\n aria-describedby={describedBy}\n onInput={this.onInput}\n onChange={this.onChange}\n />\n {this.description && (\n <p class=\"description\" part=\"description\" id=\"description\">\n {this.description}\n </p>\n )}\n {this.error && (\n <p class=\"error\" part=\"error\" id=\"error\">\n {this.error}\n </p>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}