@powerhousedao/design-system 1.39.1 → 1.39.2-dev.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 (265) hide show
  1. package/dist/src/connect/components/modal/settings-modal-v2/package-manager/package-manager-input.js +1 -1
  2. package/dist/src/scalars/components/aid-field/aid-field.d.ts.map +1 -1
  3. package/dist/src/scalars/components/aid-field/aid-field.js +3 -1
  4. package/dist/src/scalars/components/amount-field/amount-currency-validations.d.ts +3 -0
  5. package/dist/src/scalars/components/amount-field/amount-currency-validations.d.ts.map +1 -0
  6. package/dist/src/scalars/components/amount-field/amount-currency-validations.js +12 -0
  7. package/dist/src/scalars/components/amount-field/amount-field-validations.d.ts.map +1 -1
  8. package/dist/src/scalars/components/amount-field/amount-field-validations.js +1 -4
  9. package/dist/src/scalars/components/amount-field/amount-field.d.ts +1 -1
  10. package/dist/src/scalars/components/amount-field/amount-field.d.ts.map +1 -1
  11. package/dist/src/scalars/components/amount-field/amount-field.js +6 -4
  12. package/dist/src/scalars/components/amount-field/use-amount-field.d.ts +1 -1
  13. package/dist/src/scalars/components/amount-field/use-amount-field.d.ts.map +1 -1
  14. package/dist/src/scalars/components/amount-field/use-amount-field.js +2 -2
  15. package/dist/src/scalars/components/amount-field/utils.d.ts +0 -4
  16. package/dist/src/scalars/components/amount-field/utils.d.ts.map +1 -1
  17. package/dist/src/scalars/components/amount-field/utils.js +1 -30
  18. package/dist/src/scalars/components/boolean-field/boolean-field.d.ts +2 -2
  19. package/dist/src/scalars/components/boolean-field/boolean-field.d.ts.map +1 -1
  20. package/dist/src/scalars/components/currency-code-field/currency-code-field.d.ts +2 -3
  21. package/dist/src/scalars/components/currency-code-field/currency-code-field.d.ts.map +1 -1
  22. package/dist/src/scalars/components/currency-code-field/currency-code-field.js +17 -13
  23. package/dist/src/scalars/components/currency-code-field/index.d.ts +2 -1
  24. package/dist/src/scalars/components/currency-code-field/index.d.ts.map +1 -1
  25. package/dist/src/scalars/components/currency-code-field/index.js +3 -1
  26. package/dist/src/scalars/components/currency-code-field/types.d.ts +10 -2
  27. package/dist/src/scalars/components/currency-code-field/types.d.ts.map +1 -1
  28. package/dist/src/scalars/components/currency-code-field/types.js +6 -1
  29. package/dist/src/scalars/components/currency-code-field/utils.d.ts +31 -0
  30. package/dist/src/scalars/components/currency-code-field/utils.d.ts.map +1 -0
  31. package/dist/src/scalars/components/currency-code-field/utils.js +29 -0
  32. package/dist/src/scalars/components/date-field/date-field.d.ts +1 -1
  33. package/dist/src/scalars/components/date-field/date-field.d.ts.map +1 -1
  34. package/dist/src/scalars/components/date-field/date-validations.d.ts +1 -1
  35. package/dist/src/scalars/components/date-field/date-validations.d.ts.map +1 -1
  36. package/dist/src/scalars/components/date-field/date-validations.js +15 -1
  37. package/dist/src/scalars/components/date-time-field/base-picker-field.d.ts +1 -1
  38. package/dist/src/scalars/components/date-time-field/base-picker-field.d.ts.map +1 -1
  39. package/dist/src/scalars/components/date-time-field/base-picker-field.js +1 -1
  40. package/dist/src/scalars/components/date-time-field/date-time-field-validations.d.ts +1 -1
  41. package/dist/src/scalars/components/date-time-field/date-time-field-validations.d.ts.map +1 -1
  42. package/dist/src/scalars/components/date-time-field/date-time-field-validations.js +17 -3
  43. package/dist/src/scalars/components/date-time-field/date-time-field.d.ts +0 -2
  44. package/dist/src/scalars/components/date-time-field/date-time-field.d.ts.map +1 -1
  45. package/dist/src/scalars/components/date-time-field/utils.d.ts.map +1 -1
  46. package/dist/src/scalars/components/date-time-field/utils.js +23 -22
  47. package/dist/src/scalars/components/fragments/checkbox-field/checkbox-field.d.ts +1 -1
  48. package/dist/src/scalars/components/fragments/checkbox-field/checkbox-field.d.ts.map +1 -1
  49. package/dist/src/scalars/components/fragments/checkbox-field/checkbox-field.js +1 -1
  50. package/dist/src/scalars/components/fragments/checkbox-field/index.d.ts +0 -1
  51. package/dist/src/scalars/components/fragments/checkbox-field/index.d.ts.map +1 -1
  52. package/dist/src/scalars/components/fragments/checkbox-field/index.js +0 -1
  53. package/dist/src/scalars/components/fragments/form-label/form-label.d.ts.map +1 -1
  54. package/dist/src/scalars/components/fragments/form-label/form-label.js +1 -1
  55. package/dist/src/scalars/components/fragments/id-autocomplete-field/id-autocomplete-field.d.ts.map +1 -1
  56. package/dist/src/scalars/components/fragments/id-autocomplete-field/id-autocomplete-field.js +9 -3
  57. package/dist/src/scalars/components/fragments/id-autocomplete-field/id-autocomplete-input-container.d.ts.map +1 -1
  58. package/dist/src/scalars/components/fragments/id-autocomplete-field/id-autocomplete-input-container.js +45 -39
  59. package/dist/src/scalars/components/fragments/id-autocomplete-field/use-id-autocomplete-field.d.ts.map +1 -1
  60. package/dist/src/scalars/components/fragments/id-autocomplete-field/use-id-autocomplete-field.js +26 -3
  61. package/dist/src/scalars/components/fragments/index.d.ts +0 -2
  62. package/dist/src/scalars/components/fragments/index.d.ts.map +1 -1
  63. package/dist/src/scalars/components/fragments/index.js +0 -2
  64. package/dist/src/scalars/components/fragments/text-field/index.d.ts +0 -1
  65. package/dist/src/scalars/components/fragments/text-field/index.d.ts.map +1 -1
  66. package/dist/src/scalars/components/fragments/text-field/index.js +0 -1
  67. package/dist/src/scalars/components/fragments/text-field/text-field.d.ts +1 -1
  68. package/dist/src/scalars/components/fragments/text-field/text-field.d.ts.map +1 -1
  69. package/dist/src/scalars/components/fragments/text-field/text-field.js +1 -1
  70. package/dist/src/scalars/components/fragments/textarea-field/index.d.ts +0 -1
  71. package/dist/src/scalars/components/fragments/textarea-field/index.d.ts.map +1 -1
  72. package/dist/src/scalars/components/fragments/textarea-field/index.js +0 -1
  73. package/dist/src/scalars/components/fragments/textarea-field/textarea-field.d.ts +1 -1
  74. package/dist/src/scalars/components/fragments/textarea-field/textarea-field.d.ts.map +1 -1
  75. package/dist/src/scalars/components/fragments/textarea-field/textarea-field.js +1 -1
  76. package/dist/src/scalars/components/fragments/toggle-field/index.d.ts +0 -1
  77. package/dist/src/scalars/components/fragments/toggle-field/index.d.ts.map +1 -1
  78. package/dist/src/scalars/components/fragments/toggle-field/index.js +0 -1
  79. package/dist/src/scalars/components/fragments/toggle-field/toggle-field.d.ts +1 -1
  80. package/dist/src/scalars/components/fragments/toggle-field/toggle-field.d.ts.map +1 -1
  81. package/dist/src/scalars/components/fragments/toggle-field/toggle-field.js +1 -1
  82. package/dist/src/scalars/components/index.d.ts +83 -3
  83. package/dist/src/scalars/components/index.d.ts.map +1 -1
  84. package/dist/src/scalars/components/index.js +55 -3
  85. package/dist/src/scalars/components/number-field/number-field.js +1 -1
  86. package/dist/src/scalars/components/oid-field/oid-field.d.ts.map +1 -1
  87. package/dist/src/scalars/components/oid-field/oid-field.js +5 -4
  88. package/dist/src/scalars/components/phid-field/phid-field.d.ts.map +1 -1
  89. package/dist/src/scalars/components/phid-field/phid-field.js +4 -2
  90. package/dist/src/scalars/components/time-field/subcomponents/time-picker-content.d.ts +1 -1
  91. package/dist/src/scalars/components/time-field/subcomponents/time-picker-content.d.ts.map +1 -1
  92. package/dist/src/scalars/components/time-field/subcomponents/time-picker-content.js +1 -1
  93. package/dist/src/scalars/components/time-field/subcomponents/time-selector.js +1 -1
  94. package/dist/src/scalars/components/time-field/time-field.d.ts +2 -1
  95. package/dist/src/scalars/components/time-field/time-field.d.ts.map +1 -1
  96. package/dist/src/scalars/components/url-field/url-input.js +2 -1
  97. package/dist/src/scalars/lib/decorators.d.ts.map +1 -1
  98. package/dist/src/scalars/lib/decorators.js +2 -1
  99. package/dist/src/{scalars/components/fragments/checkbox-field → ui/components/data-entry/checkbox}/checkbox-base.d.ts +2 -2
  100. package/dist/src/ui/components/data-entry/checkbox/checkbox-base.d.ts.map +1 -0
  101. package/dist/src/{scalars/components/fragments/checkbox-field → ui/components/data-entry/checkbox}/checkbox.d.ts +1 -1
  102. package/dist/src/ui/components/data-entry/checkbox/checkbox.d.ts.map +1 -0
  103. package/dist/src/{scalars/components/fragments/checkbox-field → ui/components/data-entry/checkbox}/checkbox.js +2 -2
  104. package/dist/src/ui/components/data-entry/checkbox/index.d.ts +3 -0
  105. package/dist/src/ui/components/data-entry/checkbox/index.d.ts.map +1 -0
  106. package/dist/src/ui/components/data-entry/checkbox/index.js +1 -0
  107. package/dist/src/ui/components/data-entry/index.d.ts +6 -0
  108. package/dist/src/ui/components/data-entry/index.d.ts.map +1 -0
  109. package/dist/src/ui/components/data-entry/index.js +5 -0
  110. package/dist/src/ui/components/data-entry/input/index.d.ts.map +1 -0
  111. package/dist/src/ui/components/data-entry/input/input.d.ts.map +1 -0
  112. package/dist/src/{scalars/components/fragments → ui/components/data-entry}/input/input.js +1 -1
  113. package/dist/src/ui/components/data-entry/text-input/index.d.ts +3 -0
  114. package/dist/src/ui/components/data-entry/text-input/index.d.ts.map +1 -0
  115. package/dist/src/ui/components/data-entry/text-input/index.js +1 -0
  116. package/dist/src/{scalars/components/fragments/text-field → ui/components/data-entry/text-input}/text-input.d.ts +1 -1
  117. package/dist/src/ui/components/data-entry/text-input/text-input.d.ts.map +1 -0
  118. package/dist/src/{scalars/components/fragments/text-field → ui/components/data-entry/text-input}/text-input.js +7 -7
  119. package/dist/src/ui/components/data-entry/text-input/types.d.ts.map +1 -0
  120. package/dist/src/ui/components/data-entry/textarea/index.d.ts +2 -0
  121. package/dist/src/ui/components/data-entry/textarea/index.d.ts.map +1 -0
  122. package/dist/src/ui/components/data-entry/textarea/index.js +1 -0
  123. package/dist/src/{scalars/components/fragments/textarea-field → ui/components/data-entry/textarea}/textarea.d.ts +2 -2
  124. package/dist/src/ui/components/data-entry/textarea/textarea.d.ts.map +1 -0
  125. package/dist/src/{scalars/components/fragments/textarea-field → ui/components/data-entry/textarea}/textarea.js +6 -6
  126. package/dist/src/ui/components/data-entry/toggle/index.d.ts +2 -0
  127. package/dist/src/ui/components/data-entry/toggle/index.d.ts.map +1 -0
  128. package/dist/src/ui/components/data-entry/toggle/index.js +1 -0
  129. package/dist/src/ui/components/data-entry/toggle/toggle-base.d.ts.map +1 -0
  130. package/dist/src/{scalars/components/fragments/toggle-field → ui/components/data-entry/toggle}/toggle-base.js +1 -1
  131. package/dist/src/{scalars/components/fragments/toggle-field → ui/components/data-entry/toggle}/toggle.d.ts +1 -1
  132. package/dist/src/ui/components/data-entry/toggle/toggle.d.ts.map +1 -0
  133. package/dist/src/{scalars/components/fragments/toggle-field → ui/components/data-entry/toggle}/toggle.js +2 -2
  134. package/dist/src/ui/components/dropdown/dropdown-example.d.ts.map +1 -0
  135. package/dist/src/ui/components/dropdown/index.d.ts.map +1 -0
  136. package/dist/src/ui/components/dropdown/subcomponents/dropdown-content.d.ts.map +1 -0
  137. package/dist/src/{scalars → ui}/components/dropdown/subcomponents/dropdown-content.js +1 -1
  138. package/dist/src/ui/components/dropdown/subcomponents/dropdown-item.d.ts.map +1 -0
  139. package/dist/src/{scalars → ui}/components/dropdown/subcomponents/dropdown-item.js +1 -1
  140. package/dist/src/ui/components/dropdown/subcomponents/dropdown-label.d.ts.map +1 -0
  141. package/dist/src/{scalars → ui}/components/dropdown/subcomponents/dropdown-label.js +1 -1
  142. package/dist/src/ui/components/dropdown/subcomponents/dropdown-shortcut.d.ts.map +1 -0
  143. package/dist/src/{scalars → ui}/components/dropdown/subcomponents/dropdown-shortcut.js +1 -1
  144. package/dist/src/ui/components/dropdown/subcomponents/dropdown-trigger.d.ts.map +1 -0
  145. package/dist/src/{scalars → ui}/components/dropdown/subcomponents/dropdown-trigger.js +1 -1
  146. package/dist/src/ui/components/index.d.ts +4 -0
  147. package/dist/src/ui/components/index.d.ts.map +1 -0
  148. package/dist/src/ui/components/index.js +8 -0
  149. package/dist/src/ui/components/sidebar/index.d.ts +4 -0
  150. package/dist/src/ui/components/sidebar/index.d.ts.map +1 -0
  151. package/dist/src/ui/components/sidebar/index.js +2 -0
  152. package/dist/src/ui/components/sidebar/sidebar.d.ts.map +1 -0
  153. package/dist/src/ui/components/sidebar/subcomponents/sidebar-content-area.d.ts.map +1 -0
  154. package/dist/src/ui/components/sidebar/subcomponents/sidebar-header.d.ts.map +1 -0
  155. package/dist/src/ui/components/sidebar/subcomponents/sidebar-item.d.ts.map +1 -0
  156. package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-item.js +4 -4
  157. package/dist/src/ui/components/sidebar/subcomponents/sidebar-pinning-area.d.ts.map +1 -0
  158. package/dist/src/ui/components/sidebar/subcomponents/sidebar-provider/index.d.ts.map +1 -0
  159. package/dist/src/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-provider.d.ts.map +1 -0
  160. package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-provider/sidebar-provider.js +0 -1
  161. package/dist/src/ui/components/sidebar/subcomponents/sidebar-provider/sidebar-reducer.d.ts.map +1 -0
  162. package/dist/src/ui/components/sidebar/subcomponents/sidebar-search/index.d.ts.map +1 -0
  163. package/dist/src/ui/components/sidebar/subcomponents/sidebar-search/search-navigation-arrow.d.ts.map +1 -0
  164. package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-search/search-navigation-arrow.js +1 -1
  165. package/dist/src/ui/components/sidebar/subcomponents/sidebar-search/search-result-counter.d.ts.map +1 -0
  166. package/dist/src/ui/components/sidebar/subcomponents/sidebar-search/sidebar-search.d.ts.map +1 -0
  167. package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-search/sidebar-search.js +2 -2
  168. package/dist/src/ui/components/sidebar/subcomponents/status-icon.d.ts.map +1 -0
  169. package/dist/src/ui/components/sidebar/types.d.ts.map +1 -0
  170. package/dist/src/ui/components/sidebar/use-sidebar-resize.d.ts.map +1 -0
  171. package/dist/src/ui/components/sidebar/utils.d.ts.map +1 -0
  172. package/dist/src/ui/components/tooltip/index.d.ts.map +1 -0
  173. package/dist/src/ui/components/tooltip/tooltip.d.ts.map +1 -0
  174. package/dist/src/{scalars/components/fragments → ui/components}/tooltip/tooltip.js +1 -1
  175. package/dist/src/ui/index.d.ts +2 -0
  176. package/dist/src/ui/index.d.ts.map +1 -0
  177. package/dist/src/ui/index.js +1 -0
  178. package/dist/style.css +18 -0
  179. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  180. package/package.json +10 -5
  181. package/dist/src/scalars/components/dropdown/dropdown-example.d.ts.map +0 -1
  182. package/dist/src/scalars/components/dropdown/index.d.ts.map +0 -1
  183. package/dist/src/scalars/components/dropdown/subcomponents/dropdown-content.d.ts.map +0 -1
  184. package/dist/src/scalars/components/dropdown/subcomponents/dropdown-item.d.ts.map +0 -1
  185. package/dist/src/scalars/components/dropdown/subcomponents/dropdown-label.d.ts.map +0 -1
  186. package/dist/src/scalars/components/dropdown/subcomponents/dropdown-shortcut.d.ts.map +0 -1
  187. package/dist/src/scalars/components/dropdown/subcomponents/dropdown-trigger.d.ts.map +0 -1
  188. package/dist/src/scalars/components/fragments/checkbox-field/checkbox-base.d.ts.map +0 -1
  189. package/dist/src/scalars/components/fragments/checkbox-field/checkbox.d.ts.map +0 -1
  190. package/dist/src/scalars/components/fragments/input/index.d.ts.map +0 -1
  191. package/dist/src/scalars/components/fragments/input/input.d.ts.map +0 -1
  192. package/dist/src/scalars/components/fragments/text-field/text-input.d.ts.map +0 -1
  193. package/dist/src/scalars/components/fragments/text-field/types.d.ts.map +0 -1
  194. package/dist/src/scalars/components/fragments/textarea-field/textarea.d.ts.map +0 -1
  195. package/dist/src/scalars/components/fragments/toggle-field/toggle-base.d.ts.map +0 -1
  196. package/dist/src/scalars/components/fragments/toggle-field/toggle.d.ts.map +0 -1
  197. package/dist/src/scalars/components/fragments/tooltip/index.d.ts.map +0 -1
  198. package/dist/src/scalars/components/fragments/tooltip/tooltip.d.ts.map +0 -1
  199. package/dist/src/scalars/components/sidebar/index.d.ts +0 -3
  200. package/dist/src/scalars/components/sidebar/index.d.ts.map +0 -1
  201. package/dist/src/scalars/components/sidebar/index.js +0 -1
  202. package/dist/src/scalars/components/sidebar/sidebar.d.ts.map +0 -1
  203. package/dist/src/scalars/components/sidebar/subcomponents/sidebar-content-area.d.ts.map +0 -1
  204. package/dist/src/scalars/components/sidebar/subcomponents/sidebar-header.d.ts.map +0 -1
  205. package/dist/src/scalars/components/sidebar/subcomponents/sidebar-item.d.ts.map +0 -1
  206. package/dist/src/scalars/components/sidebar/subcomponents/sidebar-pinning-area.d.ts.map +0 -1
  207. package/dist/src/scalars/components/sidebar/subcomponents/sidebar-provider/index.d.ts.map +0 -1
  208. package/dist/src/scalars/components/sidebar/subcomponents/sidebar-provider/sidebar-provider.d.ts.map +0 -1
  209. package/dist/src/scalars/components/sidebar/subcomponents/sidebar-provider/sidebar-reducer.d.ts.map +0 -1
  210. package/dist/src/scalars/components/sidebar/subcomponents/sidebar-search/index.d.ts.map +0 -1
  211. package/dist/src/scalars/components/sidebar/subcomponents/sidebar-search/search-navigation-arrow.d.ts.map +0 -1
  212. package/dist/src/scalars/components/sidebar/subcomponents/sidebar-search/search-result-counter.d.ts.map +0 -1
  213. package/dist/src/scalars/components/sidebar/subcomponents/sidebar-search/sidebar-search.d.ts.map +0 -1
  214. package/dist/src/scalars/components/sidebar/subcomponents/status-icon.d.ts.map +0 -1
  215. package/dist/src/scalars/components/sidebar/types.d.ts.map +0 -1
  216. package/dist/src/scalars/components/sidebar/use-sidebar-resize.d.ts.map +0 -1
  217. package/dist/src/scalars/components/sidebar/utils.d.ts.map +0 -1
  218. /package/dist/src/{scalars/components/fragments/checkbox-field → ui/components/data-entry/checkbox}/checkbox-base.js +0 -0
  219. /package/dist/src/{scalars/components/fragments → ui/components/data-entry}/input/index.d.ts +0 -0
  220. /package/dist/src/{scalars/components/fragments → ui/components/data-entry}/input/index.js +0 -0
  221. /package/dist/src/{scalars/components/fragments → ui/components/data-entry}/input/input.d.ts +0 -0
  222. /package/dist/src/{scalars/components/fragments/text-field → ui/components/data-entry/text-input}/types.d.ts +0 -0
  223. /package/dist/src/{scalars/components/fragments/text-field → ui/components/data-entry/text-input}/types.js +0 -0
  224. /package/dist/src/{scalars/components/fragments/toggle-field → ui/components/data-entry/toggle}/toggle-base.d.ts +0 -0
  225. /package/dist/src/{scalars → ui}/components/dropdown/dropdown-example.d.ts +0 -0
  226. /package/dist/src/{scalars → ui}/components/dropdown/dropdown-example.js +0 -0
  227. /package/dist/src/{scalars → ui}/components/dropdown/index.d.ts +0 -0
  228. /package/dist/src/{scalars → ui}/components/dropdown/index.js +0 -0
  229. /package/dist/src/{scalars → ui}/components/dropdown/subcomponents/dropdown-content.d.ts +0 -0
  230. /package/dist/src/{scalars → ui}/components/dropdown/subcomponents/dropdown-item.d.ts +0 -0
  231. /package/dist/src/{scalars → ui}/components/dropdown/subcomponents/dropdown-label.d.ts +0 -0
  232. /package/dist/src/{scalars → ui}/components/dropdown/subcomponents/dropdown-shortcut.d.ts +0 -0
  233. /package/dist/src/{scalars → ui}/components/dropdown/subcomponents/dropdown-trigger.d.ts +0 -0
  234. /package/dist/src/{scalars → ui}/components/sidebar/mocked_tree.json +0 -0
  235. /package/dist/src/{scalars → ui}/components/sidebar/sidebar.d.ts +0 -0
  236. /package/dist/src/{scalars → ui}/components/sidebar/sidebar.js +0 -0
  237. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-content-area.d.ts +0 -0
  238. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-content-area.js +0 -0
  239. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-header.d.ts +0 -0
  240. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-header.js +0 -0
  241. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-item.d.ts +0 -0
  242. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-pinning-area.d.ts +0 -0
  243. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-pinning-area.js +0 -0
  244. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-provider/index.d.ts +0 -0
  245. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-provider/index.js +0 -0
  246. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-provider/sidebar-provider.d.ts +0 -0
  247. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-provider/sidebar-reducer.d.ts +0 -0
  248. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-provider/sidebar-reducer.js +0 -0
  249. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-search/index.d.ts +0 -0
  250. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-search/index.js +0 -0
  251. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-search/search-navigation-arrow.d.ts +0 -0
  252. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-search/search-result-counter.d.ts +0 -0
  253. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-search/search-result-counter.js +0 -0
  254. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/sidebar-search/sidebar-search.d.ts +0 -0
  255. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/status-icon.d.ts +0 -0
  256. /package/dist/src/{scalars → ui}/components/sidebar/subcomponents/status-icon.js +0 -0
  257. /package/dist/src/{scalars → ui}/components/sidebar/types.d.ts +0 -0
  258. /package/dist/src/{scalars → ui}/components/sidebar/types.js +0 -0
  259. /package/dist/src/{scalars → ui}/components/sidebar/use-sidebar-resize.d.ts +0 -0
  260. /package/dist/src/{scalars → ui}/components/sidebar/use-sidebar-resize.js +0 -0
  261. /package/dist/src/{scalars → ui}/components/sidebar/utils.d.ts +0 -0
  262. /package/dist/src/{scalars → ui}/components/sidebar/utils.js +0 -0
  263. /package/dist/src/{scalars/components/fragments → ui/components}/tooltip/index.d.ts +0 -0
  264. /package/dist/src/{scalars/components/fragments → ui/components}/tooltip/index.js +0 -0
  265. /package/dist/src/{scalars/components/fragments → ui/components}/tooltip/tooltip.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button } from "#powerhouse";
3
- import { Input } from "#scalars";
3
+ import { Input } from "#ui";
4
4
  import { useCallback, useState } from "react";
5
5
  export const PackageManagerInput = (props) => {
6
6
  const { onInstall, className } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"aid-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/aid-field/aid-field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAa,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtD,KAAK,iBAAiB,GAAG,IAAI,CAC3B,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EACzC,MAAM,cAAc,CAAC,MAAM,CAAC,GAC5B,MAAM,kBAAkB,GACxB,MAAM,QAAQ,GACd,SAAS,CACZ,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,cAAc,CAAC,MAAM,CAAC,GACtB,kBAAkB,GAClB,QAAQ,CAAC;AAuIX,eAAO,MAAM,QAAQ,+EAuDnB,CAAC"}
1
+ {"version":3,"file":"aid-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/aid-field/aid-field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAa,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtD,KAAK,iBAAiB,GAAG,IAAI,CAC3B,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EACzC,MAAM,cAAc,CAAC,MAAM,CAAC,GAC5B,MAAM,kBAAkB,GACxB,MAAM,QAAQ,GACd,SAAS,CACZ,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,cAAc,CAAC,MAAM,CAAC,GACtB,kBAAkB,GAClB,QAAQ,CAAC;AA2IX,eAAO,MAAM,QAAQ,+EAuDnB,CAAC"}
@@ -13,7 +13,9 @@ initialOptions, // to be used only in stories
13
13
  const id = idProp ?? `${prefix}-aid`;
14
14
  const autoComplete = autoCompleteProp ?? true;
15
15
  const contextValue = useMemo(() => ({ supportedNetworks }), [supportedNetworks]);
16
- const renderOption = useCallback((option, displayProps) => (_jsx(IdAutocompleteListOption, { variant: variant, icon: option.icon, title: option.title, path: option.path, value: displayProps?.asPlaceholder ? "did not available" : option.value, description: option.description, agentType: displayProps?.asPlaceholder
16
+ const renderOption = useCallback((option, displayProps) => (_jsx(IdAutocompleteListOption, { variant: variant, icon: option.icon, title: option.title, path: displayProps?.asPlaceholder
17
+ ? { text: "URL not available" }
18
+ : option.path, value: displayProps?.asPlaceholder ? "aid not available" : option.value, description: option.description, agentType: displayProps?.asPlaceholder
17
19
  ? "Agent type not available"
18
20
  : option.agentType, placeholderIcon: "Person", ...displayProps })), [variant]);
19
21
  return (_jsx(IdAutocompleteContext.Provider, { value: contextValue, children: autoComplete && fetchOptionsCallback ? (_jsx(IdAutocompleteFieldRaw, { id: id, name: name, className: className, label: label, description: description, value: value, defaultValue: defaultValue, disabled: disabled, placeholder: placeholder, required: required, errors: errors, warnings: warnings, onChange: onChange, onBlur: onBlur, onClick: onClick, onMouseDown: onMouseDown, autoComplete: true, variant: variant, maxLength: maxLength, fetchOptionsCallback: fetchOptionsCallback, fetchSelectedOptionCallback: fetchSelectedOptionCallback, isOpenByDefault: isOpenByDefault, initialOptions: initialOptions, renderOption: renderOption, ...props, ref: ref })) : (_jsx(IdAutocompleteFieldRaw, { id: id, name: name, className: className, label: label, description: description, value: value, defaultValue: defaultValue, disabled: disabled, placeholder: placeholder, required: required, errors: errors, warnings: warnings, onChange: onChange, onBlur: onBlur, onClick: onClick, onMouseDown: onMouseDown, autoComplete: false, maxLength: maxLength, ...props, ref: ref })) }));
@@ -0,0 +1,3 @@
1
+ import { type AmountFieldProps } from "./amount-field.js";
2
+ export declare const validateAmountCurrency: ({ type, units }: AmountFieldProps) => (value: unknown) => true | "Please select a valid currency";
3
+ //# sourceMappingURL=amount-currency-validations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amount-currency-validations.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/amount-field/amount-currency-validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,eAAO,MAAM,sBAAsB,GAChC,iBAAiB,gBAAgB,MACjC,OAAO,OAAO,4CAmBd,CAAC"}
@@ -0,0 +1,12 @@
1
+ export const validateAmountCurrency = ({ type, units }) => (value) => {
2
+ if (!value)
3
+ return true;
4
+ if (typeof value === "object" && "unit" in value) {
5
+ if (["AmountFiat", "AmountCrypto", "AmountCurrency", "Amount"].includes(type)) {
6
+ if (!units?.some((currency) => currency.ticker === value.unit)) {
7
+ return "Please select a valid currency";
8
+ }
9
+ }
10
+ }
11
+ return true;
12
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"amount-field-validations.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/amount-field/amount-field-validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AA6C1D,eAAO,MAAM,cAAc,GACxB,+DAOE,gBAAgB,MAClB,OAAO,OAAO,KAAG,eA+DjB,CAAC"}
1
+ {"version":3,"file":"amount-field-validations.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/amount-field/amount-field-validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AA6C1D,eAAO,MAAM,cAAc,GACxB,+DAOE,gBAAgB,MAClB,OAAO,OAAO,KAAG,eA6DjB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { isValidNumber } from "../number-field/number-field-validations.js";
2
- import { isValidBigInt, isValidUnit } from "./utils.js";
2
+ import { isValidBigInt } from "./utils.js";
3
3
  const isAmountCurrencyFiat = (type) => type === "AmountFiat";
4
4
  const isAmountCurrencyCrypto = (type) => type === "AmountCrypto";
5
5
  const isAmountCurrencyUniversal = (type) => type === "AmountCurrency";
@@ -32,9 +32,6 @@ export const validateAmount = ({ type, required, minValue, maxValue, allowNegati
32
32
  }
33
33
  return true;
34
34
  }
35
- if (!isValidUnit(type, value, units)) {
36
- return "Select a valid currency";
37
- }
38
35
  if (!isValidNumber(amount) && type !== "AmountCurrency") {
39
36
  return "Value is not a valid number";
40
37
  }
@@ -1,8 +1,8 @@
1
1
  import { type NumberFieldProps } from "#scalars";
2
+ import type { Currency } from "../currency-code-field/types.js";
2
3
  import { type SelectFieldProps } from "../fragments/index.js";
3
4
  import type { InputNumberProps } from "../number-field/types.js";
4
5
  import type { AmountFieldPropsGeneric, AmountValue } from "./types.js";
5
- import type { Currency } from "../currency-code-field/types.js";
6
6
  export type AmountFieldProps = AmountFieldPropsGeneric & Omit<InputNumberProps, "onChange" | "onBlur" | "precision"> & {
7
7
  className?: string;
8
8
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"amount-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/amount-field/amount-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,gBAAgB,EAAkB,MAAM,UAAU,CAAC;AAErE,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAGhE,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,GACpD,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC,GAAG;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;IAC7C,WAAW,CAAC,EAAE,IAAI,CAChB,gBAAgB,EAChB,aAAa,GAAG,eAAe,GAAG,QAAQ,CAC3C,CAAC;IACF,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAChE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC7D,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAwLJ,eAAO,MAAM,WAAW,sGAOvB,CAAC"}
1
+ {"version":3,"file":"amount-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/amount-field/amount-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,KAAK,gBAAgB,EAAkB,MAAM,UAAU,CAAC;AAGrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGvE,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,GACpD,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC,GAAG;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;IAC7C,WAAW,CAAC,EAAE,IAAI,CAChB,gBAAgB,EAChB,aAAa,GAAG,eAAe,GAAG,QAAQ,CAC3C,CAAC;IACF,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAChE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC7D,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAwLJ,eAAO,MAAM,WAAW,sGAQvB,CAAC"}
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { cn, NumberFieldRaw } from "#scalars";
3
3
  import { forwardRef, useId } from "react";
4
+ import { CurrencyCodeFieldRaw } from "../currency-code-field/currency-code-field.js";
4
5
  import { FormDescription, FormGroup, FormLabel, FormMessageList, } from "../fragments/index.js";
5
6
  import { withFieldValidation } from "../fragments/with-field-validation/with-field-validation.js";
6
- import { useAmountField } from "./use-amount-field.js";
7
- import { CurrencyCodeFieldRaw } from "../currency-code-field/currency-code-field.js";
7
+ import { validateAmountCurrency } from "./amount-currency-validations.js";
8
8
  import { validateAmount } from "./amount-field-validations.js";
9
+ import { useAmountField } from "./use-amount-field.js";
9
10
  const AmountFieldRaw = forwardRef(({ label, value, id: propId, minValue, maxValue, onChange, onBlur, disabled, className, required, errors, warnings, description, defaultValue, type, numberProps, selectProps, step = 1, currencyPosition = "right", name, trailingZeros, viewPrecision, precision, placeholder, placeholderSelect, units, includeCurrencySymbols, symbolPosition, }, ref) => {
10
11
  const generatedId = useId();
11
12
  const id = propId ?? generatedId;
@@ -20,7 +21,7 @@ const AmountFieldRaw = forwardRef(({ label, value, id: propId, minValue, maxValu
20
21
  trailingZeros,
21
22
  units,
22
23
  });
23
- return (_jsxs(FormGroup, { children: [label && (_jsx(FormLabel, { htmlFor: id, required: required, disabled: disabled, hasError: !!errors?.length, className: cn(disabled && "mb-[3px]"), children: label })), _jsxs("div", { className: cn("relative flex items-center"), children: [_jsx("input", { name: name, type: "hidden", "data-cast": isBigInt ? "AmountBigInt" : "AmountNumber" }), _jsxs("div", { className: cn("relative flex items-center"), children: [isShowSelect && currencyPosition === "left" && (_jsx(CurrencyCodeFieldRaw, { contentAlign: "start", contentClassName: "min-w-[160px]", disabled: disabled, currencies: options, onChange: handleOnChangeSelect, placeholder: placeholderSelect, includeCurrencySymbols: includeCurrencySymbols, symbolPosition: symbolPosition, searchable: false, className: cn("rounded-l-md rounded-r-none border border-gray-300", "border-r-[0.5px]",
24
+ return (_jsxs(FormGroup, { children: [label && (_jsx(FormLabel, { htmlFor: id, required: required, disabled: disabled, hasError: !!errors?.length, className: cn(disabled && "mb-[3px]"), children: label })), _jsxs("div", { className: cn("relative flex items-center"), children: [_jsx("input", { name: name, type: "hidden", "data-cast": isBigInt ? "AmountBigInt" : "AmountNumber" }), _jsxs("div", { className: cn("relative flex items-center"), children: [isShowSelect && currencyPosition === "left" && (_jsx(CurrencyCodeFieldRaw, { contentAlign: "start", contentClassName: "min-w-[160px]", disabled: disabled, currencies: options ?? [], onChange: handleOnChangeSelect, placeholder: placeholderSelect, includeCurrencySymbols: includeCurrencySymbols, symbolPosition: symbolPosition, searchable: false, className: cn("rounded-l-md rounded-r-none border border-gray-300", "border-r-[0.5px]",
24
25
  // focus state
25
26
  "focus:border-r-none focus:z-10 focus:ring-1 focus:ring-gray-900 focus:ring-offset-0", "focus:outline-none", selectProps?.className), ...(selectProps ?? { name: "" }) })), _jsx(NumberFieldRaw, { name: "", step: step, required: required, disabled: disabled, value: valueInput === undefined
26
27
  ? undefined
@@ -28,7 +29,7 @@ const AmountFieldRaw = forwardRef(({ label, value, id: propId, minValue, maxValu
28
29
  "rounded-l-none border border-l-[0.5px] border-gray-300", currencyPosition === "right" &&
29
30
  "rounded-r-none border border-r-[0.5px] border-gray-300", isPercent && "rounded-md pr-7",
30
31
  // focus state
31
- "focus:border-r-0", isAmountWithoutUnit && "rounded-md", className), onBlur: handleBlur, ref: ref, ...(numberProps || {}) }), isPercent && !inputFocused && (_jsx("span", { className: cn("pointer-events-none absolute inset-y-0 right-2 ml-2 flex items-center", disabled ? "text-gray-400" : "text-gray-900"), children: "%" }))] }), isShowSelect && currencyPosition === "right" && (_jsx(CurrencyCodeFieldRaw, { contentAlign: "end", contentClassName: "min-w-[160px]", disabled: disabled, includeCurrencySymbols: includeCurrencySymbols, currencies: options, value: valueSelect, onChange: handleOnChangeSelect, name: "", placeholder: placeholderSelect, symbolPosition: symbolPosition, searchable: false, className: cn("rounded-l-none rounded-r-md border border-gray-300", "border-l-[0.5px]",
32
+ "focus:border-r-0", isAmountWithoutUnit && "rounded-md", className), onBlur: handleBlur, ref: ref, ...(numberProps || {}) }), isPercent && !inputFocused && (_jsx("span", { className: cn("pointer-events-none absolute inset-y-0 right-2 ml-2 flex items-center", disabled ? "text-gray-400" : "text-gray-900"), children: "%" }))] }), isShowSelect && currencyPosition === "right" && (_jsx(CurrencyCodeFieldRaw, { contentAlign: "end", contentClassName: "min-w-[160px]", disabled: disabled, includeCurrencySymbols: includeCurrencySymbols, currencies: options ?? [], value: valueSelect, onChange: handleOnChangeSelect, name: "", placeholder: placeholderSelect, symbolPosition: symbolPosition, searchable: false, className: cn("rounded-l-none rounded-r-md border border-gray-300", "border-l-[0.5px]",
32
33
  // focus state
33
34
  "focus:border-l-none focus:z-10 focus:ring-1 focus:ring-gray-900 focus:ring-offset-0", "focus:outline-none", selectProps?.className) }))] }), description && _jsx(FormDescription, { children: description }), warnings && _jsx(FormMessageList, { messages: warnings, type: "warning" }), errors && _jsx(FormMessageList, { messages: errors, type: "error" })] }));
34
35
  });
@@ -36,6 +37,7 @@ AmountFieldRaw.displayName = "AmountFieldRaw";
36
37
  export const AmountField = withFieldValidation(AmountFieldRaw, {
37
38
  validations: {
38
39
  _numericAmount: validateAmount,
40
+ _validOptionCurrency: validateAmountCurrency,
39
41
  },
40
42
  });
41
43
  AmountField.displayName = "AmountField";
@@ -14,7 +14,7 @@ interface UseAmountFieldProps {
14
14
  export declare const useAmountField: ({ value, defaultValue, type, onChange, onBlur, precision, viewPrecision, trailingZeros, units, }: UseAmountFieldProps) => {
15
15
  isPercent: boolean;
16
16
  isShowSelect: boolean;
17
- options: Currency[];
17
+ options: Currency[] | undefined;
18
18
  valueInput: string | number | undefined;
19
19
  valueSelect: string | undefined;
20
20
  handleOnChangeInput: (e: React.ChangeEvent<HTMLInputElement>) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"use-amount-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/amount-field/use-amount-field.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAKL,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AAYpB,UAAU,mBAAmB;IAC3B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,IAAI,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,GAAI,kGAU5B,mBAAmB;;;;;;6BAwIY,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC;8BAoDlC,MAAM,GAAG,MAAM,EAAE;oBAmC3B,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC;;;;;CA8J1D,CAAC"}
1
+ {"version":3,"file":"use-amount-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/amount-field/use-amount-field.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAKL,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EACjB,MAAM,YAAY,CAAC;AAWpB,UAAU,mBAAmB;IAC3B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,IAAI,EAAE,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,GAAI,kGAU5B,mBAAmB;;;;;;6BAwIY,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC;8BAoDlC,MAAM,GAAG,MAAM,EAAE;oBAmC3B,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC;;;;;CA8J1D,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useMemo, useState } from "react";
2
2
  import { isValidNumber } from "../number-field/number-field-validations.js";
3
- import { createAmountValue, displayValueAmount, getDefaultUnits, handleEventOnBlur, handleEventOnChange, isNotSafeValue, isValidBigInt, isValidNumberGreaterThanMaxSafeInteger, } from "./utils.js";
3
+ import { createAmountValue, displayValueAmount, handleEventOnBlur, handleEventOnChange, isNotSafeValue, isValidBigInt, isValidNumberGreaterThanMaxSafeInteger, } from "./utils.js";
4
4
  export const useAmountField = ({ value, defaultValue, type, onChange, onBlur, precision, viewPrecision, trailingZeros, units, }) => {
5
5
  const currentValue = value ?? defaultValue;
6
6
  const baseValue = useMemo(() => {
@@ -288,7 +288,7 @@ export const useAmountField = ({ value, defaultValue, type, onChange, onBlur, pr
288
288
  const handleIsInputFocused = () => {
289
289
  setInputFocused(true);
290
290
  };
291
- const options = units ?? getDefaultUnits(type);
291
+ const options = units;
292
292
  //Put the placeholder in case that value its not in the options
293
293
  const validatedValueSelect = valueSelect && units?.some((unit) => unit.ticker === valueSelect)
294
294
  ? valueSelect
@@ -1,9 +1,5 @@
1
1
  import type { Currency } from "../currency-code-field/types.js";
2
2
  import type { AmountFieldPropsGeneric, AmountValue } from "./types.js";
3
- export declare const DEFAULT_FIAT_CURRENCIES: Currency[];
4
- export declare const DEFAULT_CRYPTO_CURRENCIES: Currency[];
5
- export declare const DEFAULT_ALL_CURRENCIES: Currency[];
6
- export declare const getDefaultUnits: (type: AmountFieldPropsGeneric["type"]) => Currency[];
7
3
  export declare const isValidBigInt: (value: string | undefined) => boolean;
8
4
  export declare const isValidNumberGreaterThanMaxSafeInteger: (value: string | undefined) => boolean;
9
5
  export declare const isNotSafeValue: (value: string) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/amount-field/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACvE,eAAO,MAAM,uBAAuB,EAAE,QAAQ,EAI7C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,EAO/C,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,EAG5C,CAAC;AACF,eAAO,MAAM,eAAe,GAAI,MAAM,uBAAuB,CAAC,MAAM,CAAC,eAWpE,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,OAOzD,CAAC;AAEF,eAAO,MAAM,sCAAsC,GACjD,OAAO,MAAM,GAAG,SAAS,YAS1B,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,YAE3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,gBAAgB,MAAM,EACtB,gBAAgB,OAAO,gCA4BxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,CAAC,EAAE,OAAO,CAAC,KASZ,KAAK,CAAC,WAAW,CAAC,gBAAgB,CACpE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAE,OAAO,CAAC,KASV,KAAK,CAAC,UAAU,CAAC,gBAAgB,CACnE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,uBAEnD,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,MAAM,uBAAuB,CAAC,MAAM,CAAC,EACrC,OAAO,WAAW,EAClB,QAAQ,QAAQ,EAAE,YAiBnB,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/amount-field/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEvE,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,OAOzD,CAAC;AAEF,eAAO,MAAM,sCAAsC,GACjD,OAAO,MAAM,GAAG,SAAS,YAS1B,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,YAE3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,gBAAgB,MAAM,EACtB,gBAAgB,OAAO,gCA4BxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,CAAC,EAAE,OAAO,CAAC,KASZ,KAAK,CAAC,WAAW,CAAC,gBAAgB,CACpE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAE,OAAO,CAAC,KASV,KAAK,CAAC,UAAU,CAAC,gBAAgB,CACnE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,uBAEnD,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,MAAM,uBAAuB,CAAC,MAAM,CAAC,EACrC,OAAO,WAAW,EAClB,QAAQ,QAAQ,EAAE,YAiBnB,CAAC"}
@@ -1,32 +1,3 @@
1
- export const DEFAULT_FIAT_CURRENCIES = [
2
- { ticker: "USD", crypto: false, label: "USD", symbol: "$" },
3
- { ticker: "EUR", crypto: false, label: "EUR", symbol: "€" },
4
- { ticker: "GBP", crypto: false, label: "GBP", symbol: "£" },
5
- ];
6
- export const DEFAULT_CRYPTO_CURRENCIES = [
7
- { ticker: "DAI", crypto: true, label: "DAI", symbol: "DAI" },
8
- { ticker: "ETH", crypto: true, label: "ETH", symbol: "ETH" },
9
- { ticker: "MKR", crypto: true, label: "MKR", symbol: "MKR" },
10
- { ticker: "SKY", crypto: true, label: "SKY", symbol: "SKY" },
11
- { ticker: "USDC", crypto: true, label: "USDC", symbol: "USDC" },
12
- { ticker: "USDS", crypto: true, label: "USDS", symbol: "USDS" },
13
- ];
14
- export const DEFAULT_ALL_CURRENCIES = [
15
- ...DEFAULT_FIAT_CURRENCIES,
16
- ...DEFAULT_CRYPTO_CURRENCIES,
17
- ];
18
- export const getDefaultUnits = (type) => {
19
- switch (type) {
20
- case "AmountFiat":
21
- return DEFAULT_FIAT_CURRENCIES;
22
- case "AmountCrypto":
23
- return DEFAULT_CRYPTO_CURRENCIES;
24
- case "AmountCurrency":
25
- return DEFAULT_ALL_CURRENCIES;
26
- default:
27
- return [];
28
- }
29
- };
30
1
  export const isValidBigInt = (value) => {
31
2
  if (!value) {
32
3
  return false;
@@ -104,5 +75,5 @@ export const isValidUnit = (type, value, units) => {
104
75
  if (type === "AmountFiat" && typeof value === "object") {
105
76
  return units.some((u) => u.ticker === value.unit);
106
77
  }
107
- return true;
78
+ return false;
108
79
  };
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import type { CheckboxProps } from "../fragments/checkbox-field/checkbox.js";
3
- import type { ToggleProps } from "../fragments/toggle-field/toggle.js";
2
+ import type { CheckboxProps } from "../../../ui/components/data-entry/checkbox/checkbox.js";
3
+ import type { ToggleProps } from "../../../ui/components/data-entry/toggle/toggle.js";
4
4
  export interface BooleanFieldProps extends Omit<CheckboxProps, "defaultValue" | "onChange" | "value">, Omit<ToggleProps, "onChange" | "value"> {
5
5
  isToggle?: boolean;
6
6
  onChange?: (value: boolean) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"boolean-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/boolean-field/boolean-field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAG7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,cAAc,GAAG,UAAU,GAAG,OAAO,CAAC,EAChE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,6FAavB,CAAC"}
1
+ {"version":3,"file":"boolean-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/boolean-field/boolean-field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wDAAwD,CAAC;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oDAAoD,CAAC;AAGtF,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,cAAc,GAAG,UAAU,GAAG,OAAO,CAAC,EAChE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,OAAO,CAAC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,6FAavB,CAAC"}
@@ -1,14 +1,13 @@
1
1
  import React from "react";
2
2
  import type { FieldErrorHandling, InputBaseProps } from "../types.js";
3
- import type { Currency, CurrencyType } from "./types.js";
3
+ import type { Currency } from "./types.js";
4
4
  type CurrencyCodeFieldBaseProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof InputBaseProps<string | string[]> | keyof FieldErrorHandling | "onChange" | "onBlur">;
5
5
  export interface CurrencyCodeFieldProps extends CurrencyCodeFieldBaseProps, InputBaseProps<string | string[]>, FieldErrorHandling {
6
6
  placeholder?: string;
7
7
  onChange?: (value: string | string[]) => void;
8
8
  onBlur?: () => void;
9
- currencies?: Currency[];
9
+ currencies: Currency[];
10
10
  includeCurrencySymbols?: boolean;
11
- allowedTypes?: CurrencyType | "Both";
12
11
  favoriteCurrencies?: string[];
13
12
  symbolPosition?: "left" | "right";
14
13
  searchable?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"currency-code-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/currency-code-field/currency-code-field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEzD,KAAK,0BAA0B,GAAG,IAAI,CACpC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC3C,MAAM,cAAc,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,GACvC,MAAM,kBAAkB,GACxB,UAAU,GACV,QAAQ,CACX,CAAC;AAEF,MAAM,WAAW,sBACf,SAAQ,0BAA0B,EAChC,cAAc,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EACjC,kBAAkB;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC;IACxB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;CAC3C;AAED,eAAO,MAAM,oBAAoB,kGA6FhC,CAAC;AAIF,eAAO,MAAM,iBAAiB,wFACqC,CAAC"}
1
+ {"version":3,"file":"currency-code-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/currency-code-field/currency-code-field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAQvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,KAAK,0BAA0B,GAAG,IAAI,CACpC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC3C,MAAM,cAAc,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,GACvC,MAAM,kBAAkB,GACxB,UAAU,GACV,QAAQ,CACX,CAAC;AAEF,MAAM,WAAW,sBACf,SAAQ,0BAA0B,EAChC,cAAc,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EACjC,kBAAkB;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,QAAQ,EAAE,CAAC;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;CAC3C;AAED,eAAO,MAAM,oBAAoB,kGA4GhC,CAAC;AAIF,eAAO,MAAM,iBAAiB,wFACqC,CAAC"}
@@ -1,16 +1,12 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useMemo } from "react";
3
- import { SelectFieldRaw } from "../fragments/index.js";
3
+ import { FormGroup, FormMessageList, SelectFieldRaw, } from "../fragments/index.js";
4
4
  import { withFieldValidation } from "../fragments/with-field-validation/with-field-validation.js";
5
- export const CurrencyCodeFieldRaw = React.forwardRef(({ placeholder, currencies, favoriteCurrencies = [], includeCurrencySymbols = true, symbolPosition = "right", searchable = false, contentClassName, contentAlign = "start",
6
- // TODO: implement following props
7
- // allowedTypes = "Both",
8
- // favoriteCurrencies,
9
- ...props }, ref) => {
5
+ export const CurrencyCodeFieldRaw = React.forwardRef(({ placeholder, currencies, favoriteCurrencies = [], includeCurrencySymbols = true, symbolPosition = "right", searchable = false, contentClassName, contentAlign = "start", warnings, errors, ...props }, ref) => {
10
6
  const options = useMemo(() => {
11
7
  const favoriteTickers = new Set(favoriteCurrencies);
12
8
  return (currencies
13
- ?.map((currency) => {
9
+ .map((currency) => {
14
10
  if (favoriteTickers.has(currency.ticker)) {
15
11
  return null;
16
12
  }
@@ -21,10 +17,14 @@ export const CurrencyCodeFieldRaw = React.forwardRef(({ placeholder, currencies,
21
17
  ? `${label} (${currency.symbol})`
22
18
  : `(${currency.symbol}) ${label}`;
23
19
  }
24
- return {
20
+ const option = {
25
21
  label,
26
22
  value: currency.ticker,
27
23
  };
24
+ if ("icon" in currency) {
25
+ option.icon = currency.icon;
26
+ }
27
+ return option;
28
28
  })
29
29
  .filter(Boolean) ?? []);
30
30
  }, [
@@ -34,9 +34,9 @@ export const CurrencyCodeFieldRaw = React.forwardRef(({ placeholder, currencies,
34
34
  favoriteCurrencies,
35
35
  ]);
36
36
  const favoriteOptions = useMemo(() => {
37
- const favoriteTickers = new Set(favoriteCurrencies || []);
37
+ const favoriteTickers = new Set(favoriteCurrencies);
38
38
  return (currencies
39
- ?.filter((currency) => favoriteTickers.has(currency.ticker))
39
+ .filter((currency) => favoriteTickers.has(currency.ticker))
40
40
  .map((currency) => {
41
41
  let label = currency.label ?? currency.ticker;
42
42
  if (includeCurrencySymbols && currency.symbol) {
@@ -45,10 +45,14 @@ export const CurrencyCodeFieldRaw = React.forwardRef(({ placeholder, currencies,
45
45
  ? `${label} (${currency.symbol})`
46
46
  : `(${currency.symbol}) ${label}`;
47
47
  }
48
- return {
48
+ const option = {
49
49
  label,
50
50
  value: currency.ticker,
51
51
  };
52
+ if ("icon" in currency) {
53
+ option.icon = currency.icon;
54
+ }
55
+ return option;
52
56
  }) ?? []);
53
57
  }, [
54
58
  currencies,
@@ -56,7 +60,7 @@ export const CurrencyCodeFieldRaw = React.forwardRef(({ placeholder, currencies,
56
60
  includeCurrencySymbols,
57
61
  symbolPosition,
58
62
  ]);
59
- return (_jsx(SelectFieldRaw, { ref: ref, options: options, selectionIcon: "checkmark", searchable: searchable, multiple: false, placeholder: placeholder, contentAlign: contentAlign, contentClassName: contentClassName, favoriteOptions: favoriteOptions, ...props }));
63
+ return (_jsxs(FormGroup, { children: [_jsx(SelectFieldRaw, { ref: ref, options: options, selectionIcon: "checkmark", searchable: searchable, multiple: false, placeholder: placeholder, contentAlign: contentAlign, contentClassName: contentClassName, favoriteOptions: favoriteOptions, ...props }), warnings && _jsx(FormMessageList, { messages: warnings, type: "warning" }), errors && _jsx(FormMessageList, { messages: errors, type: "error" })] }));
60
64
  });
61
65
  CurrencyCodeFieldRaw.displayName = "CurrencyCodeFieldRaw";
62
66
  export const CurrencyCodeField = withFieldValidation(CurrencyCodeFieldRaw);
@@ -1,4 +1,5 @@
1
- export { commonCryptoCurrencies, commonFiatCurrencies } from "./defaults.js";
2
1
  export { CurrencyCodeField } from "./currency-code-field.js";
2
+ export { commonCryptoCurrencies, commonFiatCurrencies } from "./defaults.js";
3
3
  export type { Currency, CurrencyType } from "./types.js";
4
+ export { cryptoCurrencies, currencies, fiatCurrencies } from "./utils.js";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/currency-code-field/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/currency-code-field/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC7E,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
@@ -1,2 +1,4 @@
1
- export { commonCryptoCurrencies, commonFiatCurrencies } from "./defaults.js";
1
+ /* eslint-disable prettier/prettier */
2
2
  export { CurrencyCodeField } from "./currency-code-field.js";
3
+ export { commonCryptoCurrencies, commonFiatCurrencies } from "./defaults.js";
4
+ export { cryptoCurrencies, currencies, fiatCurrencies } from "./utils.js";
@@ -1,9 +1,17 @@
1
+ import type { IconName } from "#powerhouse";
2
+ import type React from "react";
1
3
  export interface Currency {
2
4
  ticker: string;
3
5
  crypto: boolean;
4
6
  label?: string;
5
7
  symbol?: string;
6
- icon?: string;
8
+ icon?: IconName | React.ComponentType<{
9
+ className?: string;
10
+ }>;
11
+ }
12
+ export declare enum CurrencyType {
13
+ FIAT = "fiat",
14
+ CRYPTO = "crypto",
15
+ ALL = "all"
7
16
  }
8
- export type CurrencyType = "Fiat" | "Crypto";
9
17
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/currency-code-field/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/currency-code-field/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/D;AAED,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,GAAG,QAAQ;CACZ"}
@@ -1 +1,6 @@
1
- export {};
1
+ export var CurrencyType;
2
+ (function (CurrencyType) {
3
+ CurrencyType["FIAT"] = "fiat";
4
+ CurrencyType["CRYPTO"] = "crypto";
5
+ CurrencyType["ALL"] = "all";
6
+ })(CurrencyType || (CurrencyType = {}));
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Get the fiat currencies
3
+ * @returns {Currency[]} The fiat currencies
4
+ */
5
+ export declare const fiatCurrencies: () => {
6
+ ticker: string;
7
+ crypto: boolean;
8
+ label: string;
9
+ symbol: string;
10
+ }[];
11
+ /**
12
+ * Get the crypto currencies
13
+ * @returns {Currency[]} The crypto currencies
14
+ */
15
+ export declare const cryptoCurrencies: () => {
16
+ ticker: string;
17
+ crypto: boolean;
18
+ label: string;
19
+ symbol: string;
20
+ }[];
21
+ /**
22
+ * Get the currencies
23
+ * @returns {Currency[]} The currencies
24
+ */
25
+ export declare const currencies: () => {
26
+ ticker: string;
27
+ crypto: boolean;
28
+ label: string;
29
+ symbol: string;
30
+ }[];
31
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/currency-code-field/utils.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;GAI1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;GAO5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;GAEtB,CAAC"}
@@ -0,0 +1,29 @@
1
+ // add docs
2
+ /**
3
+ * Get the fiat currencies
4
+ * @returns {Currency[]} The fiat currencies
5
+ */
6
+ export const fiatCurrencies = () => [
7
+ { ticker: "USD", crypto: false, label: "USD", symbol: "$" },
8
+ { ticker: "EUR", crypto: false, label: "EUR", symbol: "€" },
9
+ { ticker: "GBP", crypto: false, label: "GBP", symbol: "£" },
10
+ ];
11
+ /**
12
+ * Get the crypto currencies
13
+ * @returns {Currency[]} The crypto currencies
14
+ */
15
+ export const cryptoCurrencies = () => [
16
+ { ticker: "DAI", crypto: true, label: "DAI", symbol: "DAI" },
17
+ { ticker: "ETH", crypto: true, label: "ETH", symbol: "ETH" },
18
+ { ticker: "MKR", crypto: true, label: "MKR", symbol: "MKR" },
19
+ { ticker: "SKY", crypto: true, label: "SKY", symbol: "SKY" },
20
+ { ticker: "USDC", crypto: true, label: "USDC", symbol: "USDC" },
21
+ { ticker: "USDS", crypto: true, label: "USDS", symbol: "USDS" },
22
+ ];
23
+ /**
24
+ * Get the currencies
25
+ * @returns {Currency[]} The currencies
26
+ */
27
+ export const currencies = () => {
28
+ return [...fiatCurrencies(), ...cryptoCurrencies()];
29
+ };
@@ -1,4 +1,4 @@
1
- import { type InputProps } from "../fragments/index.js";
1
+ import { type InputProps } from "../../../ui/components/data-entry/index.js";
2
2
  import type { FieldErrorHandling, InputBaseProps } from "../types.js";
3
3
  import type { DateFieldValue } from "./types.js";
4
4
  export interface DateFieldProps extends InputBaseProps<DateFieldValue>, FieldErrorHandling {
@@ -1 +1 @@
1
- {"version":3,"file":"date-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/date-field/date-field.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,MAAM,WAAW,cACf,SAAQ,cAAc,CAAC,cAAc,CAAC,EACpC,kBAAkB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD,UAAU,CAAC,EAAE,IAAI,CACf,UAAU,EACV,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,QAAQ,CAC1D,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAmKD,eAAO,MAAM,SAAS,oGAIpB,CAAC"}
1
+ {"version":3,"file":"date-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/date-field/date-field.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAO7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAGjD,MAAM,WAAW,cACf,SAAQ,cAAc,CAAC,cAAc,CAAC,EACpC,kBAAkB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD,UAAU,CAAC,EAAE,IAAI,CACf,UAAU,EACV,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,QAAQ,CAC1D,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAmKD,eAAO,MAAM,SAAS,oGAIpB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { type DateFieldProps } from "./date-field.js";
2
- export declare const validateDatePicker: ({ dateFormat, minDate, maxDate }: DateFieldProps) => (value: unknown) => string | true;
2
+ export declare const validateDatePicker: ({ dateFormat, minDate, maxDate, disablePastDates, disableFutureDates, }: DateFieldProps) => (value: unknown) => string | true;
3
3
  //# sourceMappingURL=date-validations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-validations.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/date-field/date-validations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAatD,eAAO,MAAM,kBAAkB,GAC5B,kCAAkC,cAAc,MAChD,OAAO,OAAO,kBAkCd,CAAC"}
1
+ {"version":3,"file":"date-validations.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/date-field/date-validations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAatD,eAAO,MAAM,kBAAkB,GAC5B,yEAME,cAAc,MAChB,OAAO,OAAO,kBAgDd,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { format } from "date-fns";
2
2
  import { formatDateToValidCalendarDateFormat, getDateFromValue, } from "./utils.js";
3
3
  import { getDateFormat, isDateFormatAllowed, normalizeMonthFormat, } from "../date-time-field/utils.js";
4
- export const validateDatePicker = ({ dateFormat, minDate, maxDate }) => (value) => {
4
+ export const validateDatePicker = ({ dateFormat, minDate, maxDate, disablePastDates, disableFutureDates, }) => (value) => {
5
5
  if (value === "" || value === undefined) {
6
6
  return true;
7
7
  }
@@ -27,5 +27,19 @@ export const validateDatePicker = ({ dateFormat, minDate, maxDate }) => (value)
27
27
  return `Date must be on or before ${formattedMaxDate}.`;
28
28
  }
29
29
  }
30
+ if (disablePastDates) {
31
+ const today = new Date();
32
+ if (validDate < today) {
33
+ const formattedToday = format(today, "dd/MM/yyyy");
34
+ return `Date must be on or after ${formattedToday}.`;
35
+ }
36
+ }
37
+ if (disableFutureDates) {
38
+ const today = new Date();
39
+ if (validDate > today) {
40
+ const formattedToday = format(today, "dd/MM/yyyy");
41
+ return `Date must be on or before ${formattedToday}.`;
42
+ }
43
+ }
30
44
  return true;
31
45
  };
@@ -1,6 +1,6 @@
1
1
  import { type IconName } from "#powerhouse";
2
2
  import React from "react";
3
- import { type InputProps } from "../fragments/index.js";
3
+ import { type InputProps } from "../../../ui/components/data-entry/index.js";
4
4
  import type { FieldErrorHandling, InputBaseProps } from "../types.js";
5
5
  export interface BasePickerFieldProps extends InputBaseProps<string>, FieldErrorHandling {
6
6
  id?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"base-picker-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/date-time-field/base-picker-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,KAAiC,MAAM,OAAO,CAAC;AAEtD,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAM/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,WAAW,oBACf,SAAQ,cAAc,CAAC,MAAM,CAAC,EAC5B,kBAAkB;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAChE,UAAU,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D,UAAU,CAAC,EAAE,IAAI,CACf,UAAU,EACV,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,QAAQ,CAC1D,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe;;0CAmG3B,CAAC"}
1
+ {"version":3,"file":"base-picker-field.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/date-time-field/base-picker-field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,KAAiC,MAAM,OAAO,CAAC;AACtD,OAAO,EAEL,KAAK,UAAU,EAChB,MAAM,4CAA4C,CAAC;AAOpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,WAAW,oBACf,SAAQ,cAAc,CAAC,MAAM,CAAC,EAC5B,kBAAkB;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,aAAa,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAChE,UAAU,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC5D,UAAU,CAAC,EAAE,IAAI,CACf,UAAU,EACV,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,QAAQ,CAC1D,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe;;0CAmG3B,CAAC"}
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Icon } from "#powerhouse";
3
3
  import { cn } from "#scalars";
4
4
  import React from "react";
5
+ import { Input, } from "../../../ui/components/data-entry/index.js";
5
6
  import { Button } from "../fragments/button/button.js";
6
- import { Input } from "../fragments/index.js";
7
7
  import { Popover, PopoverContent, PopoverTrigger, } from "../fragments/popover/popover.js";
8
8
  export const BasePickerField = React.forwardRef(({ id, name, disabled, required, iconName, placeholder, children, value, defaultValue, isOpen, setIsOpen, onInputChange, handleBlur, inputProps, className, ...props }, ref) => {
9
9
  return (_jsx("div", { className: "flex flex-col space-y-2", children: _jsxs("div", { className: cn("flex w-[275px] rounded-md text-sm", "focus-within:ring-ring dark:ring-charcoal-300 ring-gray-900 focus-within:ring-1 focus-within:ring-offset-0", "dark:border-charcoal-700 dark:bg-charcoal-900 border border-gray-300 bg-white",
@@ -1,3 +1,3 @@
1
1
  import { type DateFieldProps } from "../date-field/date-field.js";
2
- export declare const dateTimeFieldValidations: ({ dateFormat, minDate, maxDate }: DateFieldProps) => (value: unknown) => string | true;
2
+ export declare const dateTimeFieldValidations: ({ dateFormat, minDate, maxDate, disablePastDates, disableFutureDates, }: DateFieldProps) => (value: unknown) => string | true;
3
3
  //# sourceMappingURL=date-time-field-validations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"date-time-field-validations.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/date-time-field/date-time-field-validations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAclE,eAAO,MAAM,wBAAwB,GAClC,kCAAkC,cAAc,MAChD,OAAO,OAAO,kBA8Cd,CAAC"}
1
+ {"version":3,"file":"date-time-field-validations.d.ts","sourceRoot":"","sources":["../../../../../src/scalars/components/date-time-field/date-time-field-validations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAclE,eAAO,MAAM,wBAAwB,GAClC,yEAME,cAAc,MAChB,OAAO,OAAO,kBA2Dd,CAAC"}