@purpur/library 9.0.9 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/CHANGELOG.json +63 -0
  2. package/CHANGELOG.md +28 -1
  3. package/dist/LICENSE.txt +48 -27
  4. package/dist/{autocomplete-B_OBQM2h.js → autocomplete-B421J7CS.js} +2 -2
  5. package/dist/{autocomplete-B_OBQM2h.js.map → autocomplete-B421J7CS.js.map} +1 -1
  6. package/dist/{autocomplete-DJ3zbA0m.mjs → autocomplete-B8L-dTmF.mjs} +3 -3
  7. package/dist/{autocomplete-DJ3zbA0m.mjs.map → autocomplete-B8L-dTmF.mjs.map} +1 -1
  8. package/dist/autocomplete.cjs.js +1 -1
  9. package/dist/autocomplete.es.js +1 -1
  10. package/dist/button-Cv7NlYbv.mjs +109 -0
  11. package/dist/button-Cv7NlYbv.mjs.map +1 -0
  12. package/dist/button-Dqxdc3nC.js +2 -0
  13. package/dist/button-Dqxdc3nC.js.map +1 -0
  14. package/dist/button.cjs.js +1 -1
  15. package/dist/button.es.js +1 -1
  16. package/dist/{calendar-BSdvi_DA.js → calendar-C-F-pVCe.js} +2 -2
  17. package/dist/{calendar-BSdvi_DA.js.map → calendar-C-F-pVCe.js.map} +1 -1
  18. package/dist/{calendar-9p_aA7KY.mjs → calendar-DWpnuylk.mjs} +2 -2
  19. package/dist/{calendar-9p_aA7KY.mjs.map → calendar-DWpnuylk.mjs.map} +1 -1
  20. package/dist/calendar.cjs.js +1 -1
  21. package/dist/calendar.es.js +1 -1
  22. package/dist/chat-field-CxOqk0-9.js +2 -0
  23. package/dist/chat-field-CxOqk0-9.js.map +1 -0
  24. package/dist/chat-field-yK-TwW0D.mjs +149 -0
  25. package/dist/chat-field-yK-TwW0D.mjs.map +1 -0
  26. package/dist/chat-field.cjs.js +2 -0
  27. package/dist/chat-field.cjs.js.map +1 -0
  28. package/dist/chat-field.es.js +5 -0
  29. package/dist/chat-field.es.js.map +1 -0
  30. package/dist/components/autocomplete/src/autocomplete.d.ts.map +1 -1
  31. package/dist/components/button/src/button.d.ts +4 -0
  32. package/dist/components/button/src/button.d.ts.map +1 -1
  33. package/dist/components/chat-field/src/chat-field.d.ts +71 -0
  34. package/dist/components/chat-field/src/chat-field.d.ts.map +1 -0
  35. package/dist/components/dismissable-chip-group/src/dismissable-chip-group-item.d.ts.map +1 -1
  36. package/dist/components/dismissable-chip-group/src/dismissable-chip-group.d.ts +6 -1
  37. package/dist/components/dismissable-chip-group/src/dismissable-chip-group.d.ts.map +1 -1
  38. package/dist/components/drawer/src/drawer-container.d.ts +2 -0
  39. package/dist/components/drawer/src/drawer-container.d.ts.map +1 -1
  40. package/dist/components/drawer/src/drawer-content.d.ts.map +1 -1
  41. package/dist/components/drawer/src/drawer-frame.d.ts +2 -1
  42. package/dist/components/drawer/src/drawer-frame.d.ts.map +1 -1
  43. package/dist/components/drawer/src/drawer-handle.d.ts +2 -1
  44. package/dist/components/drawer/src/drawer-handle.d.ts.map +1 -1
  45. package/dist/components/drawer/src/drawer-header.d.ts +2 -0
  46. package/dist/components/drawer/src/drawer-header.d.ts.map +1 -1
  47. package/dist/components/drawer/src/drawer-scroll-area.d.ts +2 -0
  48. package/dist/components/drawer/src/drawer-scroll-area.d.ts.map +1 -1
  49. package/dist/components/drawer/src/drawer.context.d.ts +6 -2
  50. package/dist/components/drawer/src/drawer.context.d.ts.map +1 -1
  51. package/dist/components/drawer/src/drawer.d.ts +3 -0
  52. package/dist/components/drawer/src/drawer.d.ts.map +1 -1
  53. package/dist/components/drawer/src/types.d.ts +1 -0
  54. package/dist/components/drawer/src/types.d.ts.map +1 -1
  55. package/dist/components/dropdown/src/dropdown-combobox.d.ts +34 -0
  56. package/dist/components/dropdown/src/dropdown-combobox.d.ts.map +1 -0
  57. package/dist/components/dropdown/src/dropdown-select.d.ts +34 -0
  58. package/dist/components/dropdown/src/dropdown-select.d.ts.map +1 -0
  59. package/dist/components/dropdown/src/dropdown-shared.d.ts +51 -0
  60. package/dist/components/dropdown/src/dropdown-shared.d.ts.map +1 -0
  61. package/dist/components/dropdown/src/dropdown.d.ts +6 -0
  62. package/dist/components/dropdown/src/dropdown.d.ts.map +1 -0
  63. package/dist/components/dropdown/src/dropdown.types.d.ts +94 -0
  64. package/dist/components/dropdown/src/dropdown.types.d.ts.map +1 -0
  65. package/dist/components/dropdown/src/useDropdown.d.ts +38 -0
  66. package/dist/components/dropdown/src/useDropdown.d.ts.map +1 -0
  67. package/dist/components/dropdown/src/useDropdownFilter.d.ts +9 -0
  68. package/dist/components/dropdown/src/useDropdownFilter.d.ts.map +1 -0
  69. package/dist/components/dropdown/src/useDropdownHighlight.d.ts +19 -0
  70. package/dist/components/dropdown/src/useDropdownHighlight.d.ts.map +1 -0
  71. package/dist/components/dropdown/src/useDropdownInput.d.ts +12 -0
  72. package/dist/components/dropdown/src/useDropdownInput.d.ts.map +1 -0
  73. package/dist/components/dropdown/src/useOnClickOutside.d.ts +2 -0
  74. package/dist/components/dropdown/src/useOnClickOutside.d.ts.map +1 -0
  75. package/dist/components/listbox/src/listbox-item.d.ts +2 -0
  76. package/dist/components/listbox/src/listbox-item.d.ts.map +1 -1
  77. package/dist/components/notification/src/notification.d.ts +2 -1
  78. package/dist/components/notification/src/notification.d.ts.map +1 -1
  79. package/dist/components/search-field/src/search-field-autocomplete.d.ts +73 -0
  80. package/dist/components/search-field/src/search-field-autocomplete.d.ts.map +1 -0
  81. package/dist/components/search-field/src/search-field-base.d.ts +97 -0
  82. package/dist/components/search-field/src/search-field-base.d.ts.map +1 -0
  83. package/dist/components/search-field/src/search-field.d.ts +123 -41
  84. package/dist/components/search-field/src/search-field.d.ts.map +1 -1
  85. package/dist/components/text-field/src/text-field-ai.d.ts +669 -0
  86. package/dist/components/text-field/src/text-field-ai.d.ts.map +1 -0
  87. package/dist/components/text-field/src/text-field-base.d.ts +671 -0
  88. package/dist/components/text-field/src/text-field-base.d.ts.map +1 -0
  89. package/dist/components/text-field/src/text-field.d.ts +42 -4
  90. package/dist/components/text-field/src/text-field.d.ts.map +1 -1
  91. package/dist/components-metadata.js +30 -1
  92. package/dist/{date-field-Ch2lM7-P.mjs → date-field-4tYMPw89.mjs} +2 -2
  93. package/dist/{date-field-Ch2lM7-P.mjs.map → date-field-4tYMPw89.mjs.map} +1 -1
  94. package/dist/{date-field-DTI5mQkg.js → date-field-B7ipm5sH.js} +2 -2
  95. package/dist/{date-field-DTI5mQkg.js.map → date-field-B7ipm5sH.js.map} +1 -1
  96. package/dist/date-field.cjs.js +1 -1
  97. package/dist/date-field.es.js +1 -1
  98. package/dist/{date-picker-Dk39IXG5.js → date-picker-B8L1Hm8r.js} +2 -2
  99. package/dist/{date-picker-Dk39IXG5.js.map → date-picker-B8L1Hm8r.js.map} +1 -1
  100. package/dist/{date-picker-Bt3IaH23.mjs → date-picker-Bp_XpoOF.mjs} +4 -4
  101. package/dist/{date-picker-Bt3IaH23.mjs.map → date-picker-Bp_XpoOF.mjs.map} +1 -1
  102. package/dist/date-picker.cjs.js +1 -1
  103. package/dist/date-picker.es.js +1 -1
  104. package/dist/dismissable-chip-group-Cd23yjBa.js +2 -0
  105. package/dist/dismissable-chip-group-Cd23yjBa.js.map +1 -0
  106. package/dist/dismissable-chip-group-D-gD93ON.mjs +89 -0
  107. package/dist/dismissable-chip-group-D-gD93ON.mjs.map +1 -0
  108. package/dist/dismissable-chip-group.cjs.js +1 -1
  109. package/dist/dismissable-chip-group.es.js +5 -2
  110. package/dist/drawer-UdK-u7IX.js +2 -0
  111. package/dist/drawer-UdK-u7IX.js.map +1 -0
  112. package/dist/drawer-Vi9H2O3N.mjs +562 -0
  113. package/dist/drawer-Vi9H2O3N.mjs.map +1 -0
  114. package/dist/drawer.cjs.js +1 -1
  115. package/dist/drawer.es.js +1 -1
  116. package/dist/dropdown-BC6evqyq.js +2 -0
  117. package/dist/dropdown-BC6evqyq.js.map +1 -0
  118. package/dist/dropdown-C-Ze4gvG.mjs +771 -0
  119. package/dist/dropdown-C-Ze4gvG.mjs.map +1 -0
  120. package/dist/dropdown.cjs.js +2 -0
  121. package/dist/dropdown.cjs.js.map +1 -0
  122. package/dist/dropdown.es.js +6 -0
  123. package/dist/dropdown.es.js.map +1 -0
  124. package/dist/{hero-banner-B5HKmkXc.mjs → hero-banner-BjwICxaJ.mjs} +2 -2
  125. package/dist/{hero-banner-B5HKmkXc.mjs.map → hero-banner-BjwICxaJ.mjs.map} +1 -1
  126. package/dist/{hero-banner-OnNSuxNT.js → hero-banner-yGRM4OlS.js} +2 -2
  127. package/dist/{hero-banner-OnNSuxNT.js.map → hero-banner-yGRM4OlS.js.map} +1 -1
  128. package/dist/hero-banner.cjs.js +1 -1
  129. package/dist/hero-banner.es.js +1 -1
  130. package/dist/illustrative-icon/assets/json/cart-checkmark-duocolor-animated.json.d.ts +1 -1
  131. package/dist/illustrative-icon/assets/json/cart-checkmark-offblack-animated.json.d.ts +1 -1
  132. package/dist/illustrative-icon/assets/json/checkmark-duocolor-animated.json.d.ts +1 -1
  133. package/dist/illustrative-icon/assets/json/checkmark-offblack-animated.json.d.ts +1 -1
  134. package/dist/illustrative-icon/assets/json/document-checkmark-duocolor-animated.json.d.ts +1 -1
  135. package/dist/illustrative-icon/assets/json/document-checkmark-offblack-animated.json.d.ts +1 -1
  136. package/dist/illustrative-icon/assets/json/support-checkmark-duocolor-animated.json.d.ts +1 -1
  137. package/dist/illustrative-icon/assets/json/support-checkmark-offblack-animated.json.d.ts +1 -1
  138. package/dist/illustrative-icon/assets/json/user-checkmark-duocolor-animated.json.d.ts +1 -1
  139. package/dist/illustrative-icon/assets/json/user-checkmark-offblack-animated.json.d.ts +1 -1
  140. package/dist/illustrative-icon/components/cart-checkmark-duocolor-animated.cjs.js +1 -1
  141. package/dist/illustrative-icon/components/cart-checkmark-duocolor-animated.cjs.js.map +1 -1
  142. package/dist/illustrative-icon/components/cart-checkmark-duocolor-animated.es.js +1 -1
  143. package/dist/illustrative-icon/components/cart-checkmark-offblack-animated.cjs.js +1 -1
  144. package/dist/illustrative-icon/components/cart-checkmark-offblack-animated.cjs.js.map +1 -1
  145. package/dist/illustrative-icon/components/cart-checkmark-offblack-animated.es.js +1 -1
  146. package/dist/illustrative-icon/components/checkmark-duocolor-animated.cjs.js +1 -1
  147. package/dist/illustrative-icon/components/checkmark-duocolor-animated.cjs.js.map +1 -1
  148. package/dist/illustrative-icon/components/checkmark-duocolor-animated.es.js +1 -1
  149. package/dist/illustrative-icon/components/checkmark-offblack-animated.cjs.js +1 -1
  150. package/dist/illustrative-icon/components/checkmark-offblack-animated.cjs.js.map +1 -1
  151. package/dist/illustrative-icon/components/checkmark-offblack-animated.es.js +1 -1
  152. package/dist/illustrative-icon/components/document-checkmark-duocolor-animated.cjs.js +2 -2
  153. package/dist/illustrative-icon/components/document-checkmark-duocolor-animated.es.js +2 -2
  154. package/dist/illustrative-icon/components/document-checkmark-offblack-animated.cjs.js +2 -2
  155. package/dist/illustrative-icon/components/document-checkmark-offblack-animated.es.js +2 -2
  156. package/dist/illustrative-icon/components/support-checkmark-duocolor-animated.cjs.js +1 -1
  157. package/dist/illustrative-icon/components/support-checkmark-duocolor-animated.cjs.js.map +1 -1
  158. package/dist/illustrative-icon/components/support-checkmark-duocolor-animated.es.js +1 -1
  159. package/dist/illustrative-icon/components/support-checkmark-offblack-animated.cjs.js +1 -1
  160. package/dist/illustrative-icon/components/support-checkmark-offblack-animated.cjs.js.map +1 -1
  161. package/dist/illustrative-icon/components/support-checkmark-offblack-animated.es.js +1 -1
  162. package/dist/illustrative-icon/components/user-checkmark-duocolor-animated.cjs.js +1 -1
  163. package/dist/illustrative-icon/components/user-checkmark-duocolor-animated.es.js +1 -1
  164. package/dist/illustrative-icon/components/user-checkmark-offblack-animated.cjs.js +1 -1
  165. package/dist/illustrative-icon/components/user-checkmark-offblack-animated.es.js +1 -1
  166. package/dist/libraries/library/src/chat-field.d.ts +6 -0
  167. package/dist/libraries/library/src/chat-field.d.ts.map +1 -0
  168. package/dist/libraries/library/src/dropdown.d.ts +6 -0
  169. package/dist/libraries/library/src/dropdown.d.ts.map +1 -0
  170. package/dist/libraries/library/src/library.d.ts +2 -0
  171. package/dist/libraries/library/src/library.d.ts.map +1 -1
  172. package/dist/libraries/theme/src/theme-props.d.ts +1 -0
  173. package/dist/libraries/theme/src/theme-props.d.ts.map +1 -1
  174. package/dist/libraries/tokens/dist/border/variables.d.ts +1 -0
  175. package/dist/libraries/tokens/dist/border/variables.dark.d.ts +1 -0
  176. package/dist/library.cjs.js +1 -1
  177. package/dist/library.es.js +603 -592
  178. package/dist/library.es.js.map +1 -1
  179. package/dist/listbox-COBHLRtB.js +2 -0
  180. package/dist/listbox-COBHLRtB.js.map +1 -0
  181. package/dist/listbox-DG4KmQP_.mjs +66 -0
  182. package/dist/listbox-DG4KmQP_.mjs.map +1 -0
  183. package/dist/listbox.cjs.js +1 -1
  184. package/dist/listbox.es.js +1 -1
  185. package/dist/{modal-CQiJ98iI.js → modal-DMeRO1wE.js} +2 -2
  186. package/dist/{modal-CQiJ98iI.js.map → modal-DMeRO1wE.js.map} +1 -1
  187. package/dist/{modal-B1eJu9HN.mjs → modal-fTWvPEPW.mjs} +2 -2
  188. package/dist/{modal-B1eJu9HN.mjs.map → modal-fTWvPEPW.mjs.map} +1 -1
  189. package/dist/modal.cjs.js +1 -1
  190. package/dist/modal.es.js +1 -1
  191. package/dist/{notification-BtcM7Ndu.mjs → notification-BvoL7BIW.mjs} +60 -51
  192. package/dist/notification-BvoL7BIW.mjs.map +1 -0
  193. package/dist/notification-DE1pvk9W.js +2 -0
  194. package/dist/notification-DE1pvk9W.js.map +1 -0
  195. package/dist/{notification-banner-CbKcE7o4.mjs → notification-banner-C4gkkSlf.mjs} +2 -2
  196. package/dist/{notification-banner-CbKcE7o4.mjs.map → notification-banner-C4gkkSlf.mjs.map} +1 -1
  197. package/dist/{notification-banner-B0CUuKZn.js → notification-banner-COH7wJu2.js} +2 -2
  198. package/dist/{notification-banner-B0CUuKZn.js.map → notification-banner-COH7wJu2.js.map} +1 -1
  199. package/dist/notification-banner.cjs.js +1 -1
  200. package/dist/notification-banner.es.js +1 -1
  201. package/dist/notification.cjs.js +1 -1
  202. package/dist/notification.es.js +1 -1
  203. package/dist/{popover-D6k4-oO1.js → popover-BnUVNqSi.js} +2 -2
  204. package/dist/{popover-D6k4-oO1.js.map → popover-BnUVNqSi.js.map} +1 -1
  205. package/dist/{popover-D3b2gHm-.mjs → popover-lxTyKALA.mjs} +2 -2
  206. package/dist/{popover-D3b2gHm-.mjs.map → popover-lxTyKALA.mjs.map} +1 -1
  207. package/dist/popover.cjs.js +1 -1
  208. package/dist/popover.es.js +1 -1
  209. package/dist/purpur.css +1 -1
  210. package/dist/{quantity-selector-Djf8APeL.mjs → quantity-selector-CsR6KTG3.mjs} +3 -3
  211. package/dist/{quantity-selector-Djf8APeL.mjs.map → quantity-selector-CsR6KTG3.mjs.map} +1 -1
  212. package/dist/{quantity-selector-Bc-4Dnpc.js → quantity-selector-DWDg4aFO.js} +2 -2
  213. package/dist/{quantity-selector-Bc-4Dnpc.js.map → quantity-selector-DWDg4aFO.js.map} +1 -1
  214. package/dist/quantity-selector.cjs.js +1 -1
  215. package/dist/quantity-selector.es.js +1 -1
  216. package/dist/search-field-Caj2dKLn.mjs +151 -0
  217. package/dist/search-field-Caj2dKLn.mjs.map +1 -0
  218. package/dist/search-field-DAktzYb0.js +2 -0
  219. package/dist/search-field-DAktzYb0.js.map +1 -0
  220. package/dist/search-field.cjs.js +1 -1
  221. package/dist/search-field.es.js +3 -2
  222. package/dist/{stepper-CTdGj87I.mjs → stepper-B351hexi.mjs} +3 -3
  223. package/dist/{stepper-CTdGj87I.mjs.map → stepper-B351hexi.mjs.map} +1 -1
  224. package/dist/{stepper-BaoOY4Ea.js → stepper-Cb4_9D2h.js} +2 -2
  225. package/dist/{stepper-BaoOY4Ea.js.map → stepper-Cb4_9D2h.js.map} +1 -1
  226. package/dist/stepper.cjs.js +1 -1
  227. package/dist/stepper.es.js +1 -1
  228. package/dist/{table-D7qthqj_.mjs → table-DXYHrKI7.mjs} +5 -5
  229. package/dist/{table-D7qthqj_.mjs.map → table-DXYHrKI7.mjs.map} +1 -1
  230. package/dist/{table-TdOPMFoP.js → table-x3SDCR-z.js} +2 -2
  231. package/dist/{table-TdOPMFoP.js.map → table-x3SDCR-z.js.map} +1 -1
  232. package/dist/table.cjs.js +1 -1
  233. package/dist/table.es.js +1 -1
  234. package/dist/text-field-BQYzwIrG.mjs +322 -0
  235. package/dist/text-field-BQYzwIrG.mjs.map +1 -0
  236. package/dist/text-field-BwxGMWds.js +2 -0
  237. package/dist/text-field-BwxGMWds.js.map +1 -0
  238. package/dist/text-field.cjs.js +1 -1
  239. package/dist/text-field.es.js +4 -3
  240. package/dist/tokens/border/variables.css +1 -0
  241. package/dist/tokens/border/variables.d.ts +1 -0
  242. package/dist/tokens/border/variables.dark.css +1 -0
  243. package/dist/tokens/border/variables.dark.d.ts +1 -0
  244. package/dist/tokens/border/variables.dark.js +1 -0
  245. package/dist/tokens/border/variables.dark.json +1 -0
  246. package/dist/tokens/border/variables.dark.scss +1 -0
  247. package/dist/tokens/border/variables.js +1 -0
  248. package/dist/tokens/border/variables.json +1 -0
  249. package/dist/tokens/border/variables.scss +1 -0
  250. package/dist/tokens.cjs.js +1 -1
  251. package/dist/tokens.cjs.js.map +1 -1
  252. package/dist/tokens.es.js +337 -336
  253. package/dist/tokens.es.js.map +1 -1
  254. package/dist/{tooltip-BtGtu3ph.mjs → tooltip-BHsVKFJ3.mjs} +2 -2
  255. package/dist/{tooltip-BtGtu3ph.mjs.map → tooltip-BHsVKFJ3.mjs.map} +1 -1
  256. package/dist/{tooltip-eUP35j3v.js → tooltip-B_qTqtcF.js} +2 -2
  257. package/dist/{tooltip-eUP35j3v.js.map → tooltip-B_qTqtcF.js.map} +1 -1
  258. package/dist/tooltip.cjs.js +1 -1
  259. package/dist/tooltip.es.js +1 -1
  260. package/dist/use-autocomplete.es-BHDgQLae.js +2 -0
  261. package/dist/use-autocomplete.es-BHDgQLae.js.map +1 -0
  262. package/dist/use-autocomplete.es-CVv3z8t6.mjs +142 -0
  263. package/dist/use-autocomplete.es-CVv3z8t6.mjs.map +1 -0
  264. package/package.json +22 -20
  265. package/src/aliases.ts +8 -0
  266. package/src/chat-field.ts +6 -0
  267. package/src/dropdown.ts +6 -0
  268. package/src/entries.js +2 -0
  269. package/src/library.ts +4 -0
  270. package/tokens/border/variables.css +1 -0
  271. package/tokens/border/variables.d.ts +1 -0
  272. package/tokens/border/variables.dark.css +1 -0
  273. package/tokens/border/variables.dark.d.ts +1 -0
  274. package/tokens/border/variables.dark.js +1 -0
  275. package/tokens/border/variables.dark.json +1 -0
  276. package/tokens/border/variables.dark.scss +1 -0
  277. package/tokens/border/variables.js +1 -0
  278. package/tokens/border/variables.json +1 -0
  279. package/tokens/border/variables.scss +1 -0
  280. package/dist/button-BxdChrq-.js +0 -2
  281. package/dist/button-BxdChrq-.js.map +0 -1
  282. package/dist/button-D-BBdNhd.mjs +0 -105
  283. package/dist/button-D-BBdNhd.mjs.map +0 -1
  284. package/dist/dismissable-chip-group-CnziecOt.js +0 -2
  285. package/dist/dismissable-chip-group-CnziecOt.js.map +0 -1
  286. package/dist/dismissable-chip-group-ZCYOt1sB.mjs +0 -79
  287. package/dist/dismissable-chip-group-ZCYOt1sB.mjs.map +0 -1
  288. package/dist/drawer-B6j8nfAY.mjs +0 -530
  289. package/dist/drawer-B6j8nfAY.mjs.map +0 -1
  290. package/dist/drawer-CJsLdd2x.js +0 -2
  291. package/dist/drawer-CJsLdd2x.js.map +0 -1
  292. package/dist/listbox-BmjBtIv8.js +0 -2
  293. package/dist/listbox-BmjBtIv8.js.map +0 -1
  294. package/dist/listbox-oDeP8FvH.mjs +0 -65
  295. package/dist/listbox-oDeP8FvH.mjs.map +0 -1
  296. package/dist/notification-BtcM7Ndu.mjs.map +0 -1
  297. package/dist/notification-Dsg3Vzfi.js +0 -2
  298. package/dist/notification-Dsg3Vzfi.js.map +0 -1
  299. package/dist/search-field-0CBoxcNH.js +0 -2
  300. package/dist/search-field-0CBoxcNH.js.map +0 -1
  301. package/dist/search-field-aP_i6Nr0.mjs +0 -91
  302. package/dist/search-field-aP_i6Nr0.mjs.map +0 -1
  303. package/dist/text-field-9zPmL99g.mjs +0 -185
  304. package/dist/text-field-9zPmL99g.mjs.map +0 -1
  305. package/dist/text-field-CKCwxTJX.js +0 -2
  306. package/dist/text-field-CKCwxTJX.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";const I=require("react/jsx-runtime"),P=require("react"),K=require("./text-field-CKCwxTJX.js"),Z=require("./bind-DeUYJ6m9.js"),a=require("./format-CFKKBdIQ.js");function V(){return Object.assign({},a.getDefaultOptions())}function U(n,e){const r=a.toDate(n,e?.in).getDay();return r===0?7:r}function J(n,e){const r=S(e)?new e(0):a.constructFrom(e,0);return r.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),r.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),r}function S(n){return typeof n=="function"&&n.prototype?.constructor===n}const ee=10;class X{subPriority=0;validate(e,r){return!0}}class te extends X{constructor(e,r,t,s,o){super(),this.value=e,this.validateValue=r,this.setValue=t,this.priority=s,o&&(this.subPriority=o)}validate(e,r){return this.validateValue(e,this.value,r)}set(e,r,t){return this.setValue(e,r,this.value,t)}}class re extends X{priority=ee;subPriority=-1;constructor(e,r){super(),this.context=e||(t=>a.constructFrom(r,t))}set(e,r){return r.timestampIsSet?e:a.constructFrom(e,J(e,this.context))}}class c{run(e,r,t,s){const o=this.parse(e,r,t,s);return o?{setter:new te(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(e,r,t){return!0}}class ne extends c{priority=140;parse(e,r,t){switch(r){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"})||t.era(e,{width:"narrow"});case"GGGGG":return t.era(e,{width:"narrow"});default:return t.era(e,{width:"wide"})||t.era(e,{width:"abbreviated"})||t.era(e,{width:"narrow"})}}set(e,r,t){return r.era=t,e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const h={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},T={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function p(n,e){return n&&{value:e(n.value),rest:n.rest}}function f(n,e){const r=e.match(n);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function D(n,e){const r=e.match(n);if(!r)return null;if(r[0]==="Z")return{value:0,rest:e.slice(1)};const t=r[1]==="+"?1:-1,s=r[2]?parseInt(r[2],10):0,o=r[3]?parseInt(r[3],10):0,u=r[5]?parseInt(r[5],10):0;return{value:t*(s*a.millisecondsInHour+o*a.millisecondsInMinute+u*a.millisecondsInSecond),rest:e.slice(r[0].length)}}function A(n){return f(h.anyDigitsSigned,n)}function w(n,e){switch(n){case 1:return f(h.singleDigit,e);case 2:return f(h.twoDigits,e);case 3:return f(h.threeDigits,e);case 4:return f(h.fourDigits,e);default:return f(new RegExp("^\\d{1,"+n+"}"),e)}}function R(n,e){switch(n){case 1:return f(h.singleDigitSigned,e);case 2:return f(h.twoDigitsSigned,e);case 3:return f(h.threeDigitsSigned,e);case 4:return f(h.fourDigitsSigned,e);default:return f(new RegExp("^-?\\d{1,"+n+"}"),e)}}function F(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function z(n,e){const r=e>0,t=r?e:1-e;let s;if(t<=50)s=n||100;else{const o=t+50,u=Math.trunc(o/100)*100,b=n>=o%100;s=n+u-(b?100:0)}return r?s:1-s}function $(n){return n%400===0||n%4===0&&n%100!==0}class se extends c{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,r,t){const s=o=>({year:o,isTwoDigitYear:r==="yy"});switch(r){case"y":return p(w(4,e),s);case"yo":return p(t.ordinalNumber(e,{unit:"year"}),s);default:return p(w(r.length,e),s)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,t){const s=e.getFullYear();if(t.isTwoDigitYear){const u=z(t.year,s);return e.setFullYear(u,0,1),e.setHours(0,0,0,0),e}const o=!("era"in r)||r.era===1?t.year:1-t.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class oe extends c{priority=130;parse(e,r,t){const s=o=>({year:o,isTwoDigitYear:r==="YY"});switch(r){case"Y":return p(w(4,e),s);case"Yo":return p(t.ordinalNumber(e,{unit:"year"}),s);default:return p(w(r.length,e),s)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,t,s){const o=a.getWeekYear(e,s);if(t.isTwoDigitYear){const b=z(t.year,o);return e.setFullYear(b,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),a.startOfWeek(e,s)}const u=!("era"in r)||r.era===1?t.year:1-t.year;return e.setFullYear(u,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),a.startOfWeek(e,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class ae extends c{priority=130;parse(e,r){return R(r==="R"?4:r.length,e)}set(e,r,t){const s=a.constructFrom(e,0);return s.setFullYear(t,0,4),s.setHours(0,0,0,0),a.startOfISOWeek(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class ie extends c{priority=130;parse(e,r){return R(r==="u"?4:r.length,e)}set(e,r,t){return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class ce extends c{priority=120;parse(e,r,t){switch(r){case"Q":case"QQ":return w(r.length,e);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"})||t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});default:return t.quarter(e,{width:"wide",context:"formatting"})||t.quarter(e,{width:"abbreviated",context:"formatting"})||t.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=1&&r<=4}set(e,r,t){return e.setMonth((t-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class ue extends c{priority=120;parse(e,r,t){switch(r){case"q":case"qq":return w(r.length,e);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"})||t.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});default:return t.quarter(e,{width:"wide",context:"standalone"})||t.quarter(e,{width:"abbreviated",context:"standalone"})||t.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=1&&r<=4}set(e,r,t){return e.setMonth((t-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class le extends c{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,r,t){const s=o=>o-1;switch(r){case"M":return p(f(h.month,e),s);case"MM":return p(w(2,e),s);case"Mo":return p(t.ordinalNumber(e,{unit:"month"}),s);case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"})||t.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});default:return t.month(e,{width:"wide",context:"formatting"})||t.month(e,{width:"abbreviated",context:"formatting"})||t.month(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.setMonth(t,1),e.setHours(0,0,0,0),e}}class de extends c{priority=110;parse(e,r,t){const s=o=>o-1;switch(r){case"L":return p(f(h.month,e),s);case"LL":return p(w(2,e),s);case"Lo":return p(t.ordinalNumber(e,{unit:"month"}),s);case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"})||t.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});default:return t.month(e,{width:"wide",context:"standalone"})||t.month(e,{width:"abbreviated",context:"standalone"})||t.month(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.setMonth(t,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function fe(n,e,r){const t=a.toDate(n,r?.in),s=a.getWeek(t,r)-e;return t.setDate(t.getDate()-s*7),a.toDate(t,r?.in)}class we extends c{priority=100;parse(e,r,t){switch(r){case"w":return f(h.week,e);case"wo":return t.ordinalNumber(e,{unit:"week"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,t,s){return a.startOfWeek(fe(e,t,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function he(n,e,r){const t=a.toDate(n,r?.in),s=a.getISOWeek(t,r)-e;return t.setDate(t.getDate()-s*7),t}class pe extends c{priority=100;parse(e,r,t){switch(r){case"I":return f(h.week,e);case"Io":return t.ordinalNumber(e,{unit:"week"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,t){return a.startOfISOWeek(he(e,t))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const ye=[31,28,31,30,31,30,31,31,30,31,30,31],xe=[31,29,31,30,31,30,31,31,30,31,30,31];class be extends c{priority=90;subPriority=1;parse(e,r,t){switch(r){case"d":return f(h.date,e);case"do":return t.ordinalNumber(e,{unit:"date"});default:return w(r.length,e)}}validate(e,r){const t=e.getFullYear(),s=$(t),o=e.getMonth();return s?r>=1&&r<=xe[o]:r>=1&&r<=ye[o]}set(e,r,t){return e.setDate(t),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class me extends c{priority=90;subpriority=1;parse(e,r,t){switch(r){case"D":case"DD":return f(h.dayOfYear,e);case"Do":return t.ordinalNumber(e,{unit:"date"});default:return w(r.length,e)}}validate(e,r){const t=e.getFullYear();return $(t)?r>=1&&r<=366:r>=1&&r<=365}set(e,r,t){return e.setMonth(0,t),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function W(n,e,r){const t=a.getDefaultOptions(),s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,o=a.toDate(n,r?.in),u=o.getDay(),y=(e%7+7)%7,_=7-s,Y=e<0||e>6?e-(u+_)%7:(y+_)%7-(u+_)%7;return a.addDays(o,Y,r)}class ge extends c{priority=90;parse(e,r,t){switch(r){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});default:return t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,s){return e=W(e,t,s),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class Te extends c{priority=90;parse(e,r,t,s){const o=u=>{const b=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+b};switch(r){case"e":case"ee":return p(w(r.length,e),o);case"eo":return p(t.ordinalNumber(e,{unit:"day"}),o);case"eee":return t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"eeeee":return t.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});default:return t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,s){return e=W(e,t,s),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class De extends c{priority=90;parse(e,r,t,s){const o=u=>{const b=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+b};switch(r){case"c":case"cc":return p(w(r.length,e),o);case"co":return p(t.ordinalNumber(e,{unit:"day"}),o);case"ccc":return t.day(e,{width:"abbreviated",context:"standalone"})||t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"});case"ccccc":return t.day(e,{width:"narrow",context:"standalone"});case"cccccc":return t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"});default:return t.day(e,{width:"wide",context:"standalone"})||t.day(e,{width:"abbreviated",context:"standalone"})||t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,s){return e=W(e,t,s),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function _e(n,e,r){const t=a.toDate(n,r?.in),s=U(t,r),o=e-s;return a.addDays(t,o,r)}class ke extends c{priority=90;parse(e,r,t){const s=o=>o===0?7:o;switch(r){case"i":case"ii":return w(r.length,e);case"io":return t.ordinalNumber(e,{unit:"day"});case"iii":return p(t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),s);case"iiiii":return p(t.day(e,{width:"narrow",context:"formatting"}),s);case"iiiiii":return p(t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),s);default:return p(t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),s)}}validate(e,r){return r>=1&&r<=7}set(e,r,t){return e=_e(e,t),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Pe extends c{priority=80;parse(e,r,t){switch(r){case"a":case"aa":case"aaa":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return t.dayPeriod(e,{width:"narrow",context:"formatting"});default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(F(t),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class Me extends c{priority=80;parse(e,r,t){switch(r){case"b":case"bb":case"bbb":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return t.dayPeriod(e,{width:"narrow",context:"formatting"});default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(F(t),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class Oe extends c{priority=80;parse(e,r,t){switch(r){case"B":case"BB":case"BBB":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return t.dayPeriod(e,{width:"narrow",context:"formatting"});default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(F(t),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class Ye extends c{priority=70;parse(e,r,t){switch(r){case"h":return f(h.hour12h,e);case"ho":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=12}set(e,r,t){const s=e.getHours()>=12;return s&&t<12?e.setHours(t+12,0,0,0):!s&&t===12?e.setHours(0,0,0,0):e.setHours(t,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class Ee extends c{priority=70;parse(e,r,t){switch(r){case"H":return f(h.hour23h,e);case"Ho":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=23}set(e,r,t){return e.setHours(t,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class He extends c{priority=70;parse(e,r,t){switch(r){case"K":return f(h.hour11h,e);case"Ko":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.getHours()>=12&&t<12?e.setHours(t+12,0,0,0):e.setHours(t,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class Ie extends c{priority=70;parse(e,r,t){switch(r){case"k":return f(h.hour24h,e);case"ko":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=24}set(e,r,t){const s=t<=24?t%24:t;return e.setHours(s,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class qe extends c{priority=60;parse(e,r,t){switch(r){case"m":return f(h.minute,e);case"mo":return t.ordinalNumber(e,{unit:"minute"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,t){return e.setMinutes(t,0,0),e}incompatibleTokens=["t","T"]}class Re extends c{priority=50;parse(e,r,t){switch(r){case"s":return f(h.second,e);case"so":return t.ordinalNumber(e,{unit:"second"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,t){return e.setSeconds(t,0),e}incompatibleTokens=["t","T"]}class Le extends c{priority=30;parse(e,r){const t=s=>Math.trunc(s*Math.pow(10,-r.length+3));return p(w(r.length,e),t)}set(e,r,t){return e.setMilliseconds(t),e}incompatibleTokens=["t","T"]}class ve extends c{priority=10;parse(e,r){switch(r){case"X":return D(T.basicOptionalMinutes,e);case"XX":return D(T.basic,e);case"XXXX":return D(T.basicOptionalSeconds,e);case"XXXXX":return D(T.extendedOptionalSeconds,e);default:return D(T.extended,e)}}set(e,r,t){return r.timestampIsSet?e:a.constructFrom(e,e.getTime()-a.getTimezoneOffsetInMilliseconds(e)-t)}incompatibleTokens=["t","T","x"]}class Ne extends c{priority=10;parse(e,r){switch(r){case"x":return D(T.basicOptionalMinutes,e);case"xx":return D(T.basic,e);case"xxxx":return D(T.basicOptionalSeconds,e);case"xxxxx":return D(T.extendedOptionalSeconds,e);default:return D(T.extended,e)}}set(e,r,t){return r.timestampIsSet?e:a.constructFrom(e,e.getTime()-a.getTimezoneOffsetInMilliseconds(e)-t)}incompatibleTokens=["t","T","X"]}class Qe extends c{priority=40;parse(e){return A(e)}set(e,r,t){return[a.constructFrom(e,t*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Ce extends c{priority=20;parse(e){return A(e)}set(e,r,t){return[a.constructFrom(e,t),{timestampIsSet:!0}]}incompatibleTokens="*"}const Fe={G:new ne,y:new se,Y:new oe,R:new ae,u:new ie,Q:new ce,q:new ue,M:new le,L:new de,w:new we,I:new pe,d:new be,D:new me,E:new ge,e:new Te,c:new De,i:new ke,a:new Pe,b:new Me,B:new Oe,h:new Ye,H:new Ee,K:new He,k:new Ie,m:new qe,s:new Re,S:new Le,X:new ve,x:new Ne,t:new Qe,T:new Ce},We=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Be=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ge=/^'([^]*?)'?$/,Xe=/''/g,Ae=/\S/,ze=/[a-zA-Z]/;function $e(n,e,r,t){const s=()=>a.constructFrom(r,NaN),o=V(),u=o.locale??a.enUS,b=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,y=o.weekStartsOn??o.locale?.options?.weekStartsOn??0,_={firstWeekContainsDate:b,weekStartsOn:y,locale:u},Y=[new re(t?.in,r)],L=e.match(Be).map(i=>{const l=i[0];if(l in a.longFormatters){const d=a.longFormatters[l];return d(i,u.formatLong)}return i}).join("").match(We),k=[];for(let i of L){a.isProtectedWeekYearToken(i)&&a.warnOrThrowProtectedError(i,e,n),a.isProtectedDayOfYearToken(i)&&a.warnOrThrowProtectedError(i,e,n);const l=i[0],d=Fe[l];if(d){const{incompatibleTokens:x}=d;if(Array.isArray(x)){const O=k.find(m=>x.includes(m.token)||m.token===l);if(O)throw new RangeError(`The format string mustn't contain \`${O.fullToken}\` and \`${i}\` at the same time`)}else if(d.incompatibleTokens==="*"&&k.length>0)throw new RangeError(`The format string mustn't contain \`${i}\` and any other token at the same time`);k.push({token:l,fullToken:i});const g=d.run(n,i,u.match,_);if(!g)return s();Y.push(g.setter),n=g.rest}else{if(l.match(ze))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");if(i==="''"?i="'":l==="'"&&(i=je(i)),n.indexOf(i)===0)n=n.slice(i.length);else return s()}}if(n.length>0&&Ae.test(n))return s();const H=Y.map(i=>i.priority).sort((i,l)=>l-i).filter((i,l,d)=>d.indexOf(i)===l).map(i=>Y.filter(l=>l.priority===i).sort((l,d)=>d.subPriority-l.subPriority)).map(i=>i[0]);let M=a.toDate(r,t?.in);if(isNaN(+M))return s();const q={};for(const i of H){if(!i.validate(M,_))return s();const l=i.set(M,q,_);Array.isArray(l)?(M=l[0],Object.assign(q,l[1])):M=l}return M}function je(n){return n.match(Ge)[1].replace(Xe,"'")}const Ke={"purpur-date-field__container":"_purpur-date-field__container_ci2f4_1","purpur-date-field__overlay":"_purpur-date-field__overlay_ci2f4_5","purpur-date-field__start-adornment":"_purpur-date-field__start-adornment_ci2f4_16"},Ze=n=>$e(n,"yyyy-MM-dd",new Date),G=n=>n?a.format(n,"yyyy-MM-dd"):"",Ve=(...n)=>{const e=n.filter(Boolean);return e.length<=1?e[0]||null:r=>{for(const t of e)typeof t=="function"?t(r):t&&(t.current=r)}},N=Z.c.bind(Ke),Q="purpur-date-field",C="YYYY-MM-DD",Ue=(n,e)=>{let r=n;return e.length>4&&n>=4&&(r+=1),e.length>7&&n>=6&&(r+=1),Math.min(r,e.length)},j=P.forwardRef(({value:n,label:e,onChange:r,startAdornment:t,...s},o)=>{const[u,b]=P.useState(G(n));P.useEffect(()=>{b(n?G(n):"")},[n]);const y=P.useRef(null),_=Ve(o,y),[Y,L]=P.useState({}),k=P.useRef(null),H=P.useRef(null);P.useLayoutEffect(()=>{if(y.current){const d=window.document.querySelector(`label[for="${y.current.id}"]`),x=d?d.offsetHeight+4:0,g=window.getComputedStyle(y.current);L({position:"absolute",top:y.current.offsetTop+x,left:y.current.offsetLeft,padding:g.padding,width:y.current.offsetWidth,height:y.current.offsetHeight})}},[u,e,y]),P.useLayoutEffect(()=>{k.current!==null&&y.current&&(y.current.setSelectionRange(k.current,k.current),k.current=null)},[u]);const M=d=>{if(d.length===0&&r?.(void 0),d.length!==C.length)return;const x=Ze(d);a.isValid(x)&&r?.(x)},q=d=>{const x=d.currentTarget.selectionStart??0;H.current=u.slice(0,x).replace(/\D/g,"").length},i=d=>{const x=d.target.value,g=d.target.selectionStart??0,O=u.replace(/\D/g,""),m=x.replace(/\D/g,"");let E="";m.length>0&&(E+=m.slice(0,4)),m.length>4&&(E+="-"+m.slice(4,6)),m.length>6&&(E+="-"+m.slice(6,8));let v;const B=H.current;B!==null&&m.length>O.length?v=Math.min(B+(m.length-O.length),m.length):v=Math.min(x.slice(0,g).replace(/\D/g,"").length,m.length),H.current=null,k.current=Ue(v,E),b(E),M(E)},l=()=>C.split("").map((x,g)=>{const O=u[g];return I.jsx("span",{style:{color:O?"transparent":"var(--purpur-color-text-weak)"},children:O||x},g)});return I.jsxs("div",{className:N(`${Q}__container`),children:[I.jsx(K.TextField,{...s,startAdornment:t&&I.jsx("span",{className:N(`${Q}__start-adornment`),children:t}),ref:_,value:u,onChange:i,onKeyDown:q,type:"text",maxLength:C.length,inputMode:"numeric",label:e}),I.jsx("div",{role:"presentation",style:Y,className:N(`${Q}__overlay`),children:l()})]})});j.displayName="DateField";exports.DateField=j;
2
- //# sourceMappingURL=date-field-DTI5mQkg.js.map
1
+ "use strict";const I=require("react/jsx-runtime"),P=require("react"),K=require("./text-field-BwxGMWds.js"),Z=require("./bind-DeUYJ6m9.js"),a=require("./format-CFKKBdIQ.js");function V(){return Object.assign({},a.getDefaultOptions())}function U(n,e){const r=a.toDate(n,e?.in).getDay();return r===0?7:r}function J(n,e){const r=S(e)?new e(0):a.constructFrom(e,0);return r.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),r.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),r}function S(n){return typeof n=="function"&&n.prototype?.constructor===n}const ee=10;class X{subPriority=0;validate(e,r){return!0}}class te extends X{constructor(e,r,t,s,o){super(),this.value=e,this.validateValue=r,this.setValue=t,this.priority=s,o&&(this.subPriority=o)}validate(e,r){return this.validateValue(e,this.value,r)}set(e,r,t){return this.setValue(e,r,this.value,t)}}class re extends X{priority=ee;subPriority=-1;constructor(e,r){super(),this.context=e||(t=>a.constructFrom(r,t))}set(e,r){return r.timestampIsSet?e:a.constructFrom(e,J(e,this.context))}}class c{run(e,r,t,s){const o=this.parse(e,r,t,s);return o?{setter:new te(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(e,r,t){return!0}}class ne extends c{priority=140;parse(e,r,t){switch(r){case"G":case"GG":case"GGG":return t.era(e,{width:"abbreviated"})||t.era(e,{width:"narrow"});case"GGGGG":return t.era(e,{width:"narrow"});default:return t.era(e,{width:"wide"})||t.era(e,{width:"abbreviated"})||t.era(e,{width:"narrow"})}}set(e,r,t){return r.era=t,e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const h={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},T={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function p(n,e){return n&&{value:e(n.value),rest:n.rest}}function f(n,e){const r=e.match(n);return r?{value:parseInt(r[0],10),rest:e.slice(r[0].length)}:null}function D(n,e){const r=e.match(n);if(!r)return null;if(r[0]==="Z")return{value:0,rest:e.slice(1)};const t=r[1]==="+"?1:-1,s=r[2]?parseInt(r[2],10):0,o=r[3]?parseInt(r[3],10):0,u=r[5]?parseInt(r[5],10):0;return{value:t*(s*a.millisecondsInHour+o*a.millisecondsInMinute+u*a.millisecondsInSecond),rest:e.slice(r[0].length)}}function A(n){return f(h.anyDigitsSigned,n)}function w(n,e){switch(n){case 1:return f(h.singleDigit,e);case 2:return f(h.twoDigits,e);case 3:return f(h.threeDigits,e);case 4:return f(h.fourDigits,e);default:return f(new RegExp("^\\d{1,"+n+"}"),e)}}function R(n,e){switch(n){case 1:return f(h.singleDigitSigned,e);case 2:return f(h.twoDigitsSigned,e);case 3:return f(h.threeDigitsSigned,e);case 4:return f(h.fourDigitsSigned,e);default:return f(new RegExp("^-?\\d{1,"+n+"}"),e)}}function F(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function z(n,e){const r=e>0,t=r?e:1-e;let s;if(t<=50)s=n||100;else{const o=t+50,u=Math.trunc(o/100)*100,b=n>=o%100;s=n+u-(b?100:0)}return r?s:1-s}function $(n){return n%400===0||n%4===0&&n%100!==0}class se extends c{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,r,t){const s=o=>({year:o,isTwoDigitYear:r==="yy"});switch(r){case"y":return p(w(4,e),s);case"yo":return p(t.ordinalNumber(e,{unit:"year"}),s);default:return p(w(r.length,e),s)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,t){const s=e.getFullYear();if(t.isTwoDigitYear){const u=z(t.year,s);return e.setFullYear(u,0,1),e.setHours(0,0,0,0),e}const o=!("era"in r)||r.era===1?t.year:1-t.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class oe extends c{priority=130;parse(e,r,t){const s=o=>({year:o,isTwoDigitYear:r==="YY"});switch(r){case"Y":return p(w(4,e),s);case"Yo":return p(t.ordinalNumber(e,{unit:"year"}),s);default:return p(w(r.length,e),s)}}validate(e,r){return r.isTwoDigitYear||r.year>0}set(e,r,t,s){const o=a.getWeekYear(e,s);if(t.isTwoDigitYear){const b=z(t.year,o);return e.setFullYear(b,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),a.startOfWeek(e,s)}const u=!("era"in r)||r.era===1?t.year:1-t.year;return e.setFullYear(u,0,s.firstWeekContainsDate),e.setHours(0,0,0,0),a.startOfWeek(e,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class ae extends c{priority=130;parse(e,r){return R(r==="R"?4:r.length,e)}set(e,r,t){const s=a.constructFrom(e,0);return s.setFullYear(t,0,4),s.setHours(0,0,0,0),a.startOfISOWeek(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class ie extends c{priority=130;parse(e,r){return R(r==="u"?4:r.length,e)}set(e,r,t){return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class ce extends c{priority=120;parse(e,r,t){switch(r){case"Q":case"QQ":return w(r.length,e);case"Qo":return t.ordinalNumber(e,{unit:"quarter"});case"QQQ":return t.quarter(e,{width:"abbreviated",context:"formatting"})||t.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return t.quarter(e,{width:"narrow",context:"formatting"});default:return t.quarter(e,{width:"wide",context:"formatting"})||t.quarter(e,{width:"abbreviated",context:"formatting"})||t.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=1&&r<=4}set(e,r,t){return e.setMonth((t-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class ue extends c{priority=120;parse(e,r,t){switch(r){case"q":case"qq":return w(r.length,e);case"qo":return t.ordinalNumber(e,{unit:"quarter"});case"qqq":return t.quarter(e,{width:"abbreviated",context:"standalone"})||t.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return t.quarter(e,{width:"narrow",context:"standalone"});default:return t.quarter(e,{width:"wide",context:"standalone"})||t.quarter(e,{width:"abbreviated",context:"standalone"})||t.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=1&&r<=4}set(e,r,t){return e.setMonth((t-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class le extends c{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,r,t){const s=o=>o-1;switch(r){case"M":return p(f(h.month,e),s);case"MM":return p(w(2,e),s);case"Mo":return p(t.ordinalNumber(e,{unit:"month"}),s);case"MMM":return t.month(e,{width:"abbreviated",context:"formatting"})||t.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return t.month(e,{width:"narrow",context:"formatting"});default:return t.month(e,{width:"wide",context:"formatting"})||t.month(e,{width:"abbreviated",context:"formatting"})||t.month(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.setMonth(t,1),e.setHours(0,0,0,0),e}}class de extends c{priority=110;parse(e,r,t){const s=o=>o-1;switch(r){case"L":return p(f(h.month,e),s);case"LL":return p(w(2,e),s);case"Lo":return p(t.ordinalNumber(e,{unit:"month"}),s);case"LLL":return t.month(e,{width:"abbreviated",context:"standalone"})||t.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return t.month(e,{width:"narrow",context:"standalone"});default:return t.month(e,{width:"wide",context:"standalone"})||t.month(e,{width:"abbreviated",context:"standalone"})||t.month(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.setMonth(t,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function fe(n,e,r){const t=a.toDate(n,r?.in),s=a.getWeek(t,r)-e;return t.setDate(t.getDate()-s*7),a.toDate(t,r?.in)}class we extends c{priority=100;parse(e,r,t){switch(r){case"w":return f(h.week,e);case"wo":return t.ordinalNumber(e,{unit:"week"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,t,s){return a.startOfWeek(fe(e,t,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function he(n,e,r){const t=a.toDate(n,r?.in),s=a.getISOWeek(t,r)-e;return t.setDate(t.getDate()-s*7),t}class pe extends c{priority=100;parse(e,r,t){switch(r){case"I":return f(h.week,e);case"Io":return t.ordinalNumber(e,{unit:"week"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=53}set(e,r,t){return a.startOfISOWeek(he(e,t))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const ye=[31,28,31,30,31,30,31,31,30,31,30,31],xe=[31,29,31,30,31,30,31,31,30,31,30,31];class be extends c{priority=90;subPriority=1;parse(e,r,t){switch(r){case"d":return f(h.date,e);case"do":return t.ordinalNumber(e,{unit:"date"});default:return w(r.length,e)}}validate(e,r){const t=e.getFullYear(),s=$(t),o=e.getMonth();return s?r>=1&&r<=xe[o]:r>=1&&r<=ye[o]}set(e,r,t){return e.setDate(t),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class me extends c{priority=90;subpriority=1;parse(e,r,t){switch(r){case"D":case"DD":return f(h.dayOfYear,e);case"Do":return t.ordinalNumber(e,{unit:"date"});default:return w(r.length,e)}}validate(e,r){const t=e.getFullYear();return $(t)?r>=1&&r<=366:r>=1&&r<=365}set(e,r,t){return e.setMonth(0,t),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function W(n,e,r){const t=a.getDefaultOptions(),s=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,o=a.toDate(n,r?.in),u=o.getDay(),y=(e%7+7)%7,_=7-s,Y=e<0||e>6?e-(u+_)%7:(y+_)%7-(u+_)%7;return a.addDays(o,Y,r)}class ge extends c{priority=90;parse(e,r,t){switch(r){case"E":case"EE":case"EEE":return t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return t.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});default:return t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,s){return e=W(e,t,s),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class Te extends c{priority=90;parse(e,r,t,s){const o=u=>{const b=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+b};switch(r){case"e":case"ee":return p(w(r.length,e),o);case"eo":return p(t.ordinalNumber(e,{unit:"day"}),o);case"eee":return t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});case"eeeee":return t.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"});default:return t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,s){return e=W(e,t,s),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class De extends c{priority=90;parse(e,r,t,s){const o=u=>{const b=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+b};switch(r){case"c":case"cc":return p(w(r.length,e),o);case"co":return p(t.ordinalNumber(e,{unit:"day"}),o);case"ccc":return t.day(e,{width:"abbreviated",context:"standalone"})||t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"});case"ccccc":return t.day(e,{width:"narrow",context:"standalone"});case"cccccc":return t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"});default:return t.day(e,{width:"wide",context:"standalone"})||t.day(e,{width:"abbreviated",context:"standalone"})||t.day(e,{width:"short",context:"standalone"})||t.day(e,{width:"narrow",context:"standalone"})}}validate(e,r){return r>=0&&r<=6}set(e,r,t,s){return e=W(e,t,s),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function _e(n,e,r){const t=a.toDate(n,r?.in),s=U(t,r),o=e-s;return a.addDays(t,o,r)}class ke extends c{priority=90;parse(e,r,t){const s=o=>o===0?7:o;switch(r){case"i":case"ii":return w(r.length,e);case"io":return t.ordinalNumber(e,{unit:"day"});case"iii":return p(t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),s);case"iiiii":return p(t.day(e,{width:"narrow",context:"formatting"}),s);case"iiiiii":return p(t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),s);default:return p(t.day(e,{width:"wide",context:"formatting"})||t.day(e,{width:"abbreviated",context:"formatting"})||t.day(e,{width:"short",context:"formatting"})||t.day(e,{width:"narrow",context:"formatting"}),s)}}validate(e,r){return r>=1&&r<=7}set(e,r,t){return e=_e(e,t),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Pe extends c{priority=80;parse(e,r,t){switch(r){case"a":case"aa":case"aaa":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return t.dayPeriod(e,{width:"narrow",context:"formatting"});default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(F(t),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class Me extends c{priority=80;parse(e,r,t){switch(r){case"b":case"bb":case"bbb":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return t.dayPeriod(e,{width:"narrow",context:"formatting"});default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(F(t),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class Oe extends c{priority=80;parse(e,r,t){switch(r){case"B":case"BB":case"BBB":return t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return t.dayPeriod(e,{width:"narrow",context:"formatting"});default:return t.dayPeriod(e,{width:"wide",context:"formatting"})||t.dayPeriod(e,{width:"abbreviated",context:"formatting"})||t.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,r,t){return e.setHours(F(t),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class Ye extends c{priority=70;parse(e,r,t){switch(r){case"h":return f(h.hour12h,e);case"ho":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=12}set(e,r,t){const s=e.getHours()>=12;return s&&t<12?e.setHours(t+12,0,0,0):!s&&t===12?e.setHours(0,0,0,0):e.setHours(t,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class Ee extends c{priority=70;parse(e,r,t){switch(r){case"H":return f(h.hour23h,e);case"Ho":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=23}set(e,r,t){return e.setHours(t,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class He extends c{priority=70;parse(e,r,t){switch(r){case"K":return f(h.hour11h,e);case"Ko":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=11}set(e,r,t){return e.getHours()>=12&&t<12?e.setHours(t+12,0,0,0):e.setHours(t,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class Ie extends c{priority=70;parse(e,r,t){switch(r){case"k":return f(h.hour24h,e);case"ko":return t.ordinalNumber(e,{unit:"hour"});default:return w(r.length,e)}}validate(e,r){return r>=1&&r<=24}set(e,r,t){const s=t<=24?t%24:t;return e.setHours(s,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class qe extends c{priority=60;parse(e,r,t){switch(r){case"m":return f(h.minute,e);case"mo":return t.ordinalNumber(e,{unit:"minute"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,t){return e.setMinutes(t,0,0),e}incompatibleTokens=["t","T"]}class Re extends c{priority=50;parse(e,r,t){switch(r){case"s":return f(h.second,e);case"so":return t.ordinalNumber(e,{unit:"second"});default:return w(r.length,e)}}validate(e,r){return r>=0&&r<=59}set(e,r,t){return e.setSeconds(t,0),e}incompatibleTokens=["t","T"]}class Le extends c{priority=30;parse(e,r){const t=s=>Math.trunc(s*Math.pow(10,-r.length+3));return p(w(r.length,e),t)}set(e,r,t){return e.setMilliseconds(t),e}incompatibleTokens=["t","T"]}class ve extends c{priority=10;parse(e,r){switch(r){case"X":return D(T.basicOptionalMinutes,e);case"XX":return D(T.basic,e);case"XXXX":return D(T.basicOptionalSeconds,e);case"XXXXX":return D(T.extendedOptionalSeconds,e);default:return D(T.extended,e)}}set(e,r,t){return r.timestampIsSet?e:a.constructFrom(e,e.getTime()-a.getTimezoneOffsetInMilliseconds(e)-t)}incompatibleTokens=["t","T","x"]}class Ne extends c{priority=10;parse(e,r){switch(r){case"x":return D(T.basicOptionalMinutes,e);case"xx":return D(T.basic,e);case"xxxx":return D(T.basicOptionalSeconds,e);case"xxxxx":return D(T.extendedOptionalSeconds,e);default:return D(T.extended,e)}}set(e,r,t){return r.timestampIsSet?e:a.constructFrom(e,e.getTime()-a.getTimezoneOffsetInMilliseconds(e)-t)}incompatibleTokens=["t","T","X"]}class Qe extends c{priority=40;parse(e){return A(e)}set(e,r,t){return[a.constructFrom(e,t*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Ce extends c{priority=20;parse(e){return A(e)}set(e,r,t){return[a.constructFrom(e,t),{timestampIsSet:!0}]}incompatibleTokens="*"}const Fe={G:new ne,y:new se,Y:new oe,R:new ae,u:new ie,Q:new ce,q:new ue,M:new le,L:new de,w:new we,I:new pe,d:new be,D:new me,E:new ge,e:new Te,c:new De,i:new ke,a:new Pe,b:new Me,B:new Oe,h:new Ye,H:new Ee,K:new He,k:new Ie,m:new qe,s:new Re,S:new Le,X:new ve,x:new Ne,t:new Qe,T:new Ce},We=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Be=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ge=/^'([^]*?)'?$/,Xe=/''/g,Ae=/\S/,ze=/[a-zA-Z]/;function $e(n,e,r,t){const s=()=>a.constructFrom(r,NaN),o=V(),u=o.locale??a.enUS,b=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,y=o.weekStartsOn??o.locale?.options?.weekStartsOn??0,_={firstWeekContainsDate:b,weekStartsOn:y,locale:u},Y=[new re(t?.in,r)],L=e.match(Be).map(i=>{const l=i[0];if(l in a.longFormatters){const d=a.longFormatters[l];return d(i,u.formatLong)}return i}).join("").match(We),k=[];for(let i of L){a.isProtectedWeekYearToken(i)&&a.warnOrThrowProtectedError(i,e,n),a.isProtectedDayOfYearToken(i)&&a.warnOrThrowProtectedError(i,e,n);const l=i[0],d=Fe[l];if(d){const{incompatibleTokens:x}=d;if(Array.isArray(x)){const O=k.find(m=>x.includes(m.token)||m.token===l);if(O)throw new RangeError(`The format string mustn't contain \`${O.fullToken}\` and \`${i}\` at the same time`)}else if(d.incompatibleTokens==="*"&&k.length>0)throw new RangeError(`The format string mustn't contain \`${i}\` and any other token at the same time`);k.push({token:l,fullToken:i});const g=d.run(n,i,u.match,_);if(!g)return s();Y.push(g.setter),n=g.rest}else{if(l.match(ze))throw new RangeError("Format string contains an unescaped latin alphabet character `"+l+"`");if(i==="''"?i="'":l==="'"&&(i=je(i)),n.indexOf(i)===0)n=n.slice(i.length);else return s()}}if(n.length>0&&Ae.test(n))return s();const H=Y.map(i=>i.priority).sort((i,l)=>l-i).filter((i,l,d)=>d.indexOf(i)===l).map(i=>Y.filter(l=>l.priority===i).sort((l,d)=>d.subPriority-l.subPriority)).map(i=>i[0]);let M=a.toDate(r,t?.in);if(isNaN(+M))return s();const q={};for(const i of H){if(!i.validate(M,_))return s();const l=i.set(M,q,_);Array.isArray(l)?(M=l[0],Object.assign(q,l[1])):M=l}return M}function je(n){return n.match(Ge)[1].replace(Xe,"'")}const Ke={"purpur-date-field__container":"_purpur-date-field__container_ci2f4_1","purpur-date-field__overlay":"_purpur-date-field__overlay_ci2f4_5","purpur-date-field__start-adornment":"_purpur-date-field__start-adornment_ci2f4_16"},Ze=n=>$e(n,"yyyy-MM-dd",new Date),G=n=>n?a.format(n,"yyyy-MM-dd"):"",Ve=(...n)=>{const e=n.filter(Boolean);return e.length<=1?e[0]||null:r=>{for(const t of e)typeof t=="function"?t(r):t&&(t.current=r)}},N=Z.c.bind(Ke),Q="purpur-date-field",C="YYYY-MM-DD",Ue=(n,e)=>{let r=n;return e.length>4&&n>=4&&(r+=1),e.length>7&&n>=6&&(r+=1),Math.min(r,e.length)},j=P.forwardRef(({value:n,label:e,onChange:r,startAdornment:t,...s},o)=>{const[u,b]=P.useState(G(n));P.useEffect(()=>{b(n?G(n):"")},[n]);const y=P.useRef(null),_=Ve(o,y),[Y,L]=P.useState({}),k=P.useRef(null),H=P.useRef(null);P.useLayoutEffect(()=>{if(y.current){const d=window.document.querySelector(`label[for="${y.current.id}"]`),x=d?d.offsetHeight+4:0,g=window.getComputedStyle(y.current);L({position:"absolute",top:y.current.offsetTop+x,left:y.current.offsetLeft,padding:g.padding,width:y.current.offsetWidth,height:y.current.offsetHeight})}},[u,e,y]),P.useLayoutEffect(()=>{k.current!==null&&y.current&&(y.current.setSelectionRange(k.current,k.current),k.current=null)},[u]);const M=d=>{if(d.length===0&&r?.(void 0),d.length!==C.length)return;const x=Ze(d);a.isValid(x)&&r?.(x)},q=d=>{const x=d.currentTarget.selectionStart??0;H.current=u.slice(0,x).replace(/\D/g,"").length},i=d=>{const x=d.target.value,g=d.target.selectionStart??0,O=u.replace(/\D/g,""),m=x.replace(/\D/g,"");let E="";m.length>0&&(E+=m.slice(0,4)),m.length>4&&(E+="-"+m.slice(4,6)),m.length>6&&(E+="-"+m.slice(6,8));let v;const B=H.current;B!==null&&m.length>O.length?v=Math.min(B+(m.length-O.length),m.length):v=Math.min(x.slice(0,g).replace(/\D/g,"").length,m.length),H.current=null,k.current=Ue(v,E),b(E),M(E)},l=()=>C.split("").map((x,g)=>{const O=u[g];return I.jsx("span",{style:{color:O?"transparent":"var(--purpur-color-text-weak)"},children:O||x},g)});return I.jsxs("div",{className:N(`${Q}__container`),children:[I.jsx(K.TextField,{...s,startAdornment:t&&I.jsx("span",{className:N(`${Q}__start-adornment`),children:t}),ref:_,value:u,onChange:i,onKeyDown:q,type:"text",maxLength:C.length,inputMode:"numeric",label:e}),I.jsx("div",{role:"presentation",style:Y,className:N(`${Q}__overlay`),children:l()})]})});j.displayName="DateField";exports.DateField=j;
2
+ //# sourceMappingURL=date-field-B7ipm5sH.js.map