@cratis/components 4.38.2 → 4.39.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/compat-manifest.json +11 -11
  2. package/dist/esm/Chat/ChatSidebar.d.ts.map +1 -1
  3. package/dist/esm/Chat/ChatSidebar.js +2 -2
  4. package/dist/esm/Chat/ChatSidebar.js.map +1 -1
  5. package/dist/esm/CommandDialog/CommandDialog.d.ts +1 -1
  6. package/dist/esm/CommandDialog/CommandDialog.d.ts.map +1 -1
  7. package/dist/esm/CommandDialog/CommandDialog.js +5 -2
  8. package/dist/esm/CommandDialog/CommandDialog.js.map +1 -1
  9. package/dist/esm/CommandDialog/CommandStepperContent.js +1 -1
  10. package/dist/esm/CommandDialog/CommandStepperContent.js.map +1 -1
  11. package/dist/esm/CommandDialog/StepperCommandDialog.d.ts +7 -0
  12. package/dist/esm/CommandDialog/StepperCommandDialog.d.ts.map +1 -1
  13. package/dist/esm/CommandDialog/StepperCommandDialog.js +4 -4
  14. package/dist/esm/CommandDialog/StepperCommandDialog.js.map +1 -1
  15. package/dist/esm/CommandForm/fields/CheckboxField.d.ts.map +1 -1
  16. package/dist/esm/CommandForm/fields/CheckboxField.js +1 -1
  17. package/dist/esm/CommandForm/fields/CheckboxField.js.map +1 -1
  18. package/dist/esm/CommandForm/fields/ChipsField.d.ts.map +1 -1
  19. package/dist/esm/CommandForm/fields/ChipsField.js +1 -1
  20. package/dist/esm/CommandForm/fields/ChipsField.js.map +1 -1
  21. package/dist/esm/CommandForm/fields/ColorPickerField.d.ts.map +1 -1
  22. package/dist/esm/CommandForm/fields/ColorPickerField.js +1 -1
  23. package/dist/esm/CommandForm/fields/ColorPickerField.js.map +1 -1
  24. package/dist/esm/CommandForm/fields/NumberField.d.ts.map +1 -1
  25. package/dist/esm/CommandForm/fields/NumberField.js +1 -1
  26. package/dist/esm/CommandForm/fields/NumberField.js.map +1 -1
  27. package/dist/esm/CommandForm/fields/PasswordField.d.ts.map +1 -1
  28. package/dist/esm/CommandForm/fields/PasswordField.js +1 -1
  29. package/dist/esm/CommandForm/fields/PasswordField.js.map +1 -1
  30. package/dist/esm/CommandForm/fields/RadioButtonField.d.ts.map +1 -1
  31. package/dist/esm/CommandForm/fields/RadioButtonField.js +1 -1
  32. package/dist/esm/CommandForm/fields/RadioButtonField.js.map +1 -1
  33. package/dist/esm/CommandForm/fields/RadioGroupField.d.ts.map +1 -1
  34. package/dist/esm/CommandForm/fields/RadioGroupField.js +1 -1
  35. package/dist/esm/CommandForm/fields/RadioGroupField.js.map +1 -1
  36. package/dist/esm/CommandForm/fields/RatingField.d.ts.map +1 -1
  37. package/dist/esm/CommandForm/fields/RatingField.js +1 -1
  38. package/dist/esm/CommandForm/fields/RatingField.js.map +1 -1
  39. package/dist/esm/CommandForm/fields/SliderField.d.ts.map +1 -1
  40. package/dist/esm/CommandForm/fields/SliderField.js +1 -1
  41. package/dist/esm/CommandForm/fields/SliderField.js.map +1 -1
  42. package/dist/esm/CommandForm/fields/ToggleSwitchField.d.ts.map +1 -1
  43. package/dist/esm/CommandForm/fields/ToggleSwitchField.js +1 -1
  44. package/dist/esm/CommandForm/fields/ToggleSwitchField.js.map +1 -1
  45. package/dist/esm/Common/ActionMenubar.d.ts.map +1 -1
  46. package/dist/esm/Common/ActionMenubar.js +1 -1
  47. package/dist/esm/Common/ActionMenubar.js.map +1 -1
  48. package/dist/esm/Common/Breadcrumbs.d.ts.map +1 -1
  49. package/dist/esm/Common/Breadcrumbs.js +1 -1
  50. package/dist/esm/Common/Breadcrumbs.js.map +1 -1
  51. package/dist/esm/Common/Button.d.ts.map +1 -1
  52. package/dist/esm/Common/Button.js +4 -1
  53. package/dist/esm/Common/Button.js.map +1 -1
  54. package/dist/esm/Common/CheckboxImplementation.d.ts.map +1 -1
  55. package/dist/esm/Common/CheckboxImplementation.js +1 -1
  56. package/dist/esm/Common/CheckboxImplementation.js.map +1 -1
  57. package/dist/esm/Common/ComboBox.js +1 -1
  58. package/dist/esm/Common/ComboBox.js.map +1 -1
  59. package/dist/esm/Common/CratisComponentsProvider.d.ts +14 -1
  60. package/dist/esm/Common/CratisComponentsProvider.d.ts.map +1 -1
  61. package/dist/esm/Common/CratisComponentsProvider.js +6 -2
  62. package/dist/esm/Common/CratisComponentsProvider.js.map +1 -1
  63. package/dist/esm/Common/DatePickerInputImplementation.d.ts.map +1 -1
  64. package/dist/esm/Common/DatePickerInputImplementation.js +1 -1
  65. package/dist/esm/Common/DatePickerInputImplementation.js.map +1 -1
  66. package/dist/esm/Common/FormElement.js +1 -1
  67. package/dist/esm/Common/FormElement.js.map +1 -1
  68. package/dist/esm/Common/IconButton.d.ts.map +1 -1
  69. package/dist/esm/Common/IconButton.js +4 -1
  70. package/dist/esm/Common/IconButton.js.map +1 -1
  71. package/dist/esm/Common/NumberInput.d.ts.map +1 -1
  72. package/dist/esm/Common/NumberInput.js +1 -1
  73. package/dist/esm/Common/NumberInput.js.map +1 -1
  74. package/dist/esm/Common/Page.d.ts +1 -1
  75. package/dist/esm/Common/Page.d.ts.map +1 -1
  76. package/dist/esm/Common/Page.js +11 -2
  77. package/dist/esm/Common/Page.js.map +1 -1
  78. package/dist/esm/Common/RadioImplementation.d.ts.map +1 -1
  79. package/dist/esm/Common/RadioImplementation.js +1 -1
  80. package/dist/esm/Common/RadioImplementation.js.map +1 -1
  81. package/dist/esm/Common/SurfaceImplementation.d.ts.map +1 -1
  82. package/dist/esm/Common/SurfaceImplementation.js +1 -1
  83. package/dist/esm/Common/SurfaceImplementation.js.map +1 -1
  84. package/dist/esm/Common/SwitchImplementation.d.ts.map +1 -1
  85. package/dist/esm/Common/SwitchImplementation.js +1 -1
  86. package/dist/esm/Common/SwitchImplementation.js.map +1 -1
  87. package/dist/esm/Common/Tabs.d.ts.map +1 -1
  88. package/dist/esm/Common/Tabs.js +1 -1
  89. package/dist/esm/Common/Tabs.js.map +1 -1
  90. package/dist/esm/Common/TagGroup.d.ts.map +1 -1
  91. package/dist/esm/Common/TagGroup.js +1 -1
  92. package/dist/esm/Common/TagGroup.js.map +1 -1
  93. package/dist/esm/Common/TextArea.d.ts.map +1 -1
  94. package/dist/esm/Common/TextArea.js +4 -1
  95. package/dist/esm/Common/TextArea.js.map +1 -1
  96. package/dist/esm/Common/TextInput.d.ts.map +1 -1
  97. package/dist/esm/Common/TextInput.js +4 -1
  98. package/dist/esm/Common/TextInput.js.map +1 -1
  99. package/dist/esm/Common/ToggleGroup.d.ts.map +1 -1
  100. package/dist/esm/Common/ToggleGroup.js +1 -1
  101. package/dist/esm/Common/ToggleGroup.js.map +1 -1
  102. package/dist/esm/Common/buttonDescriptor.d.ts +7 -0
  103. package/dist/esm/Common/buttonDescriptor.d.ts.map +1 -0
  104. package/dist/esm/Common/buttonDescriptor.js +28 -0
  105. package/dist/esm/Common/buttonDescriptor.js.map +1 -0
  106. package/dist/esm/Common/textFieldDescriptors.d.ts +7 -0
  107. package/dist/esm/Common/textFieldDescriptors.d.ts.map +1 -0
  108. package/dist/esm/Common/textFieldDescriptors.js +25 -0
  109. package/dist/esm/Common/textFieldDescriptors.js.map +1 -0
  110. package/dist/esm/ComponentPicker/ComponentHighlight.d.ts +14 -0
  111. package/dist/esm/ComponentPicker/ComponentHighlight.d.ts.map +1 -0
  112. package/dist/esm/ComponentPicker/ComponentHighlight.js +12 -0
  113. package/dist/esm/ComponentPicker/ComponentHighlight.js.map +1 -0
  114. package/dist/esm/ComponentPicker/ComponentPicker.d.ts +24 -0
  115. package/dist/esm/ComponentPicker/ComponentPicker.d.ts.map +1 -0
  116. package/dist/esm/ComponentPicker/ComponentPicker.js +116 -0
  117. package/dist/esm/ComponentPicker/ComponentPicker.js.map +1 -0
  118. package/dist/esm/ComponentPicker/ComponentResolver.d.ts +6 -0
  119. package/dist/esm/ComponentPicker/ComponentResolver.d.ts.map +1 -0
  120. package/dist/esm/ComponentPicker/ComponentResolver.js +4 -0
  121. package/dist/esm/ComponentPicker/ComponentResolver.js.map +1 -0
  122. package/dist/esm/ComponentPicker/HighlightFrame.d.ts +14 -0
  123. package/dist/esm/ComponentPicker/HighlightFrame.d.ts.map +1 -0
  124. package/dist/esm/ComponentPicker/HighlightFrame.js +70 -0
  125. package/dist/esm/ComponentPicker/HighlightFrame.js.map +1 -0
  126. package/dist/esm/ComponentPicker/PickedAncestor.d.ts +10 -0
  127. package/dist/esm/ComponentPicker/PickedAncestor.d.ts.map +1 -0
  128. package/dist/esm/ComponentPicker/PickedAncestor.js +4 -0
  129. package/dist/esm/ComponentPicker/PickedAncestor.js.map +1 -0
  130. package/dist/esm/ComponentPicker/PickedComponent.d.ts +23 -0
  131. package/dist/esm/ComponentPicker/PickedComponent.d.ts.map +1 -0
  132. package/dist/esm/ComponentPicker/PickedComponent.js +4 -0
  133. package/dist/esm/ComponentPicker/PickedComponent.js.map +1 -0
  134. package/dist/esm/ComponentPicker/PickedPresentationProperty.d.ts +22 -0
  135. package/dist/esm/ComponentPicker/PickedPresentationProperty.d.ts.map +1 -0
  136. package/dist/esm/ComponentPicker/PickedPresentationProperty.js +4 -0
  137. package/dist/esm/ComponentPicker/PickedPresentationProperty.js.map +1 -0
  138. package/dist/esm/ComponentPicker/PickedRect.d.ts +20 -0
  139. package/dist/esm/ComponentPicker/PickedRect.d.ts.map +1 -0
  140. package/dist/esm/ComponentPicker/PickedRect.js +4 -0
  141. package/dist/esm/ComponentPicker/PickedRect.js.map +1 -0
  142. package/dist/esm/ComponentPicker/PresentationPropertyEditor.d.ts +25 -0
  143. package/dist/esm/ComponentPicker/PresentationPropertyEditor.d.ts.map +1 -0
  144. package/dist/esm/ComponentPicker/PresentationPropertyEditor.js +51 -0
  145. package/dist/esm/ComponentPicker/PresentationPropertyEditor.js.map +1 -0
  146. package/dist/esm/ComponentPicker/componentElements.d.ts +14 -0
  147. package/dist/esm/ComponentPicker/componentElements.d.ts.map +1 -0
  148. package/dist/esm/ComponentPicker/componentElements.js +18 -0
  149. package/dist/esm/ComponentPicker/componentElements.js.map +1 -0
  150. package/dist/esm/ComponentPicker/describeComponentElement.d.ts +11 -0
  151. package/dist/esm/ComponentPicker/describeComponentElement.d.ts.map +1 -0
  152. package/dist/esm/ComponentPicker/describeComponentElement.js +63 -0
  153. package/dist/esm/ComponentPicker/describeComponentElement.js.map +1 -0
  154. package/dist/esm/ComponentPicker/index.d.ts +24 -0
  155. package/dist/esm/ComponentPicker/index.d.ts.map +1 -0
  156. package/dist/esm/ComponentPicker/index.js +12 -0
  157. package/dist/esm/ComponentPicker/index.js.map +1 -0
  158. package/dist/esm/ComponentPicker/pickerStacking.d.ts +3 -0
  159. package/dist/esm/ComponentPicker/pickerStacking.d.ts.map +1 -0
  160. package/dist/esm/ComponentPicker/pickerStacking.js +10 -0
  161. package/dist/esm/ComponentPicker/pickerStacking.js.map +1 -0
  162. package/dist/esm/ComponentPicker/proposedChanges.d.ts +11 -0
  163. package/dist/esm/ComponentPicker/proposedChanges.d.ts.map +1 -0
  164. package/dist/esm/ComponentPicker/proposedChanges.js +6 -0
  165. package/dist/esm/ComponentPicker/proposedChanges.js.map +1 -0
  166. package/dist/esm/ComponentPicker/useComponentPicker.d.ts +30 -0
  167. package/dist/esm/ComponentPicker/useComponentPicker.d.ts.map +1 -0
  168. package/dist/esm/ComponentPicker/useComponentPicker.js +31 -0
  169. package/dist/esm/ComponentPicker/useComponentPicker.js.map +1 -0
  170. package/dist/esm/ConfigurationEditor/OrderedItemEditor.d.ts.map +1 -1
  171. package/dist/esm/ConfigurationEditor/OrderedItemEditor.js +1 -1
  172. package/dist/esm/ConfigurationEditor/OrderedItemEditor.js.map +1 -1
  173. package/dist/esm/ConfigurationEditor/PropertyControls.d.ts.map +1 -1
  174. package/dist/esm/ConfigurationEditor/PropertyControls.js +1 -1
  175. package/dist/esm/ConfigurationEditor/PropertyControls.js.map +1 -1
  176. package/dist/esm/DataPage/DataPage.js +1 -1
  177. package/dist/esm/DataPage/DataPage.js.map +1 -1
  178. package/dist/esm/DataTables/DataTableCore.d.ts.map +1 -1
  179. package/dist/esm/DataTables/DataTableCore.js +1 -1
  180. package/dist/esm/DataTables/DataTableCore.js.map +1 -1
  181. package/dist/esm/DataTables/DataTableHeaderCell.d.ts +2 -2
  182. package/dist/esm/DataTables/DataTableHeaderCell.d.ts.map +1 -1
  183. package/dist/esm/DataTables/DataTableHeaderCell.js +7 -2
  184. package/dist/esm/DataTables/DataTableHeaderCell.js.map +1 -1
  185. package/dist/esm/DataTables/TablePaginatorImplementation.d.ts.map +1 -1
  186. package/dist/esm/DataTables/TablePaginatorImplementation.js +1 -1
  187. package/dist/esm/DataTables/TablePaginatorImplementation.js.map +1 -1
  188. package/dist/esm/DataTables/columnDescriptor.d.ts +4 -0
  189. package/dist/esm/DataTables/columnDescriptor.d.ts.map +1 -0
  190. package/dist/esm/DataTables/columnDescriptor.js +10 -0
  191. package/dist/esm/DataTables/columnDescriptor.js.map +1 -0
  192. package/dist/esm/Dialogs/Dialog.d.ts +18 -0
  193. package/dist/esm/Dialogs/Dialog.d.ts.map +1 -1
  194. package/dist/esm/Dialogs/Dialog.js.map +1 -1
  195. package/dist/esm/Dialogs/DialogGlobalHeaderActions.d.ts +8 -0
  196. package/dist/esm/Dialogs/DialogGlobalHeaderActions.d.ts.map +1 -0
  197. package/dist/esm/Dialogs/DialogGlobalHeaderActions.js +6 -0
  198. package/dist/esm/Dialogs/DialogGlobalHeaderActions.js.map +1 -0
  199. package/dist/esm/Dialogs/DialogImplementation.d.ts +1 -1
  200. package/dist/esm/Dialogs/DialogImplementation.d.ts.map +1 -1
  201. package/dist/esm/Dialogs/DialogImplementation.js +22 -6
  202. package/dist/esm/Dialogs/DialogImplementation.js.map +1 -1
  203. package/dist/esm/Dialogs/dialogDescriptor.d.ts +4 -0
  204. package/dist/esm/Dialogs/dialogDescriptor.d.ts.map +1 -0
  205. package/dist/esm/Dialogs/dialogDescriptor.js +12 -0
  206. package/dist/esm/Dialogs/dialogDescriptor.js.map +1 -0
  207. package/dist/esm/Dialogs/index.d.ts +3 -0
  208. package/dist/esm/Dialogs/index.d.ts.map +1 -1
  209. package/dist/esm/Display/Avatar.d.ts.map +1 -1
  210. package/dist/esm/Display/Avatar.js +1 -1
  211. package/dist/esm/Display/Avatar.js.map +1 -1
  212. package/dist/esm/Display/Badge.d.ts.map +1 -1
  213. package/dist/esm/Display/Badge.js +1 -1
  214. package/dist/esm/Display/Badge.js.map +1 -1
  215. package/dist/esm/Display/Chip.d.ts.map +1 -1
  216. package/dist/esm/Display/Chip.js +1 -1
  217. package/dist/esm/Display/Chip.js.map +1 -1
  218. package/dist/esm/Display/Message.d.ts.map +1 -1
  219. package/dist/esm/Display/Message.js +1 -1
  220. package/dist/esm/Display/Message.js.map +1 -1
  221. package/dist/esm/Display/ProgressBarImplementation.d.ts.map +1 -1
  222. package/dist/esm/Display/ProgressBarImplementation.js +1 -1
  223. package/dist/esm/Display/ProgressBarImplementation.js.map +1 -1
  224. package/dist/esm/Display/ProgressSpinner.d.ts.map +1 -1
  225. package/dist/esm/Display/ProgressSpinner.js +1 -1
  226. package/dist/esm/Display/ProgressSpinner.js.map +1 -1
  227. package/dist/esm/Display/Skeleton.d.ts.map +1 -1
  228. package/dist/esm/Display/Skeleton.js +1 -1
  229. package/dist/esm/Display/Skeleton.js.map +1 -1
  230. package/dist/esm/Display/Tag.d.ts.map +1 -1
  231. package/dist/esm/Display/Tag.js +1 -1
  232. package/dist/esm/Display/Tag.js.map +1 -1
  233. package/dist/esm/Dropdown/DropdownImplementation.js +4 -4
  234. package/dist/esm/Dropdown/DropdownImplementation.js.map +1 -1
  235. package/dist/esm/IconPicker/IconPicker.d.ts.map +1 -1
  236. package/dist/esm/IconPicker/IconPicker.js +1 -1
  237. package/dist/esm/IconPicker/IconPicker.js.map +1 -1
  238. package/dist/esm/MarkdownEditor/MarkdownEditor.d.ts.map +1 -1
  239. package/dist/esm/MarkdownEditor/MarkdownEditor.js +1 -1
  240. package/dist/esm/MarkdownEditor/MarkdownEditor.js.map +1 -1
  241. package/dist/esm/Toolbar/Toolbar.d.ts.map +1 -1
  242. package/dist/esm/Toolbar/Toolbar.js +1 -1
  243. package/dist/esm/Toolbar/Toolbar.js.map +1 -1
  244. package/dist/esm/configuration/DialogHeaderActionsRenderer.d.ts +8 -0
  245. package/dist/esm/configuration/DialogHeaderActionsRenderer.d.ts.map +1 -0
  246. package/dist/esm/configuration/DialogHeaderActionsRenderer.js +4 -0
  247. package/dist/esm/configuration/DialogHeaderActionsRenderer.js.map +1 -0
  248. package/dist/esm/configuration/DialogHeaderContext.d.ts +13 -0
  249. package/dist/esm/configuration/DialogHeaderContext.d.ts.map +1 -0
  250. package/dist/esm/configuration/DialogHeaderContext.js +4 -0
  251. package/dist/esm/configuration/DialogHeaderContext.js.map +1 -0
  252. package/dist/esm/configuration/DialogSliceLocation.d.ts +13 -0
  253. package/dist/esm/configuration/DialogSliceLocation.d.ts.map +1 -0
  254. package/dist/esm/configuration/DialogSliceLocation.js +4 -0
  255. package/dist/esm/configuration/DialogSliceLocation.js.map +1 -0
  256. package/dist/esm/configuration/identity/ComponentDescriptor.d.ts +12 -0
  257. package/dist/esm/configuration/identity/ComponentDescriptor.d.ts.map +1 -0
  258. package/dist/esm/configuration/identity/ComponentDescriptor.js +4 -0
  259. package/dist/esm/configuration/identity/ComponentDescriptor.js.map +1 -0
  260. package/dist/esm/configuration/identity/ComponentMarkerAttributes.d.ts +10 -0
  261. package/dist/esm/configuration/identity/ComponentMarkerAttributes.d.ts.map +1 -0
  262. package/dist/esm/configuration/identity/ComponentMarkerAttributes.js +4 -0
  263. package/dist/esm/configuration/identity/ComponentMarkerAttributes.js.map +1 -0
  264. package/dist/esm/configuration/identity/PresentationChange.d.ts +11 -0
  265. package/dist/esm/configuration/identity/PresentationChange.d.ts.map +1 -0
  266. package/dist/esm/configuration/identity/PresentationChange.js +4 -0
  267. package/dist/esm/configuration/identity/PresentationChange.js.map +1 -0
  268. package/dist/esm/configuration/identity/PresentationPropertyDescriptor.d.ts +22 -0
  269. package/dist/esm/configuration/identity/PresentationPropertyDescriptor.d.ts.map +1 -0
  270. package/dist/esm/configuration/identity/PresentationPropertyDescriptor.js +4 -0
  271. package/dist/esm/configuration/identity/PresentationPropertyDescriptor.js.map +1 -0
  272. package/dist/esm/configuration/identity/PresentationPropertyType.d.ts +3 -0
  273. package/dist/esm/configuration/identity/PresentationPropertyType.d.ts.map +1 -0
  274. package/dist/esm/configuration/identity/PresentationPropertyType.js +4 -0
  275. package/dist/esm/configuration/identity/PresentationPropertyType.js.map +1 -0
  276. package/dist/esm/configuration/identity/PresentationPropertyValue.d.ts +3 -0
  277. package/dist/esm/configuration/identity/PresentationPropertyValue.d.ts.map +1 -0
  278. package/dist/esm/configuration/identity/PresentationPropertyValue.js +4 -0
  279. package/dist/esm/configuration/identity/PresentationPropertyValue.js.map +1 -0
  280. package/dist/esm/configuration/identity/RegisteredComponent.d.ts +9 -0
  281. package/dist/esm/configuration/identity/RegisteredComponent.d.ts.map +1 -0
  282. package/dist/esm/configuration/identity/RegisteredComponent.js +4 -0
  283. package/dist/esm/configuration/identity/RegisteredComponent.js.map +1 -0
  284. package/dist/esm/configuration/identity/componentIdentityAttributes.d.ts +7 -0
  285. package/dist/esm/configuration/identity/componentIdentityAttributes.d.ts.map +1 -0
  286. package/dist/esm/configuration/identity/componentIdentityAttributes.js +6 -0
  287. package/dist/esm/configuration/identity/componentIdentityAttributes.js.map +1 -0
  288. package/dist/esm/configuration/identity/componentInstances.d.ts +30 -0
  289. package/dist/esm/configuration/identity/componentInstances.d.ts.map +1 -0
  290. package/dist/esm/configuration/identity/componentInstances.js +61 -0
  291. package/dist/esm/configuration/identity/componentInstances.js.map +1 -0
  292. package/dist/esm/configuration/identity/componentMarker.d.ts +9 -0
  293. package/dist/esm/configuration/identity/componentMarker.d.ts.map +1 -0
  294. package/dist/esm/configuration/identity/componentMarker.js +7 -0
  295. package/dist/esm/configuration/identity/componentMarker.js.map +1 -0
  296. package/dist/esm/configuration/identity/describeComponent.d.ts +11 -0
  297. package/dist/esm/configuration/identity/describeComponent.d.ts.map +1 -0
  298. package/dist/esm/configuration/identity/describeComponent.js +4 -0
  299. package/dist/esm/configuration/identity/describeComponent.js.map +1 -0
  300. package/dist/esm/configuration/identity/useComponentPresentation.d.ts +15 -0
  301. package/dist/esm/configuration/identity/useComponentPresentation.d.ts.map +1 -0
  302. package/dist/esm/configuration/identity/useComponentPresentation.js +18 -0
  303. package/dist/esm/configuration/identity/useComponentPresentation.js.map +1 -0
  304. package/dist/esm/index.d.ts +3 -0
  305. package/dist/esm/index.d.ts.map +1 -1
  306. package/dist/esm/renderer/dialogStack.d.ts +2 -0
  307. package/dist/esm/renderer/dialogStack.d.ts.map +1 -1
  308. package/dist/esm/renderer/dialogStack.js +2 -1
  309. package/dist/esm/renderer/dialogStack.js.map +1 -1
  310. package/dist/esm/types/parts.d.ts +25 -2
  311. package/dist/esm/types/parts.d.ts.map +1 -1
  312. package/dist/esm/types/parts.js +25 -2
  313. package/dist/esm/types/parts.js.map +1 -1
  314. package/package.json +5 -1
@@ -1 +1 @@
1
- {"version":3,"file":"StepperCommandDialog.d.ts","sourceRoot":"","sources":["../../../CommandDialog/StepperCommandDialog.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAY,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAI5D,OAAO,EAIH,KAAK,gBAAgB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEH,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EACtB,MAAM,sBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAkB,CAAC;AAElE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAAwB,CAAC;AAKnE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,yBAAyB,CAAC,QAAQ,SAAS,MAAM,EAAE,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e,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAC3C;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AA4SD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AACH,QAAA,MAAM,6BAA6B,GAC/B,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChC,SAAS,GAAG,MAAM,SAEX,yBAAyB,CAAC,QAAQ,EAAE,SAAS,CAAC,sBAsFxD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,sCAAgC,CAAC"}
@@ -16,7 +16,7 @@ import { useCommandExecution } from './useCommandExecution.js';
16
16
  import { getStepPanels } from './stepChildren.js';
17
17
  import { transitionStep } from './transitionStep.js';
18
18
 
19
- const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', style, contentStyle, resizable = false, isValid, onClose, onConfirm, onCancel, onSuccess, onValidationFailure, onFailed, onException, onUnauthorized, onBeforeExecute, confirmBeforeExecute, okLabel, nextLabel, previousLabel, showCancel = false, cancelLabel, linear = true, orientation, headerPosition, start, end, onChangeStep, pt, ptOptions, unstyled, dialogClassName, dialogPt, dialogPtOptions, dialogUnstyled, children, }) => {
19
+ const StepperCommandDialogWrapper = ({ title, headerActions, hideGlobalHeaderActions, sliceLocation, visible = true, width = '600px', style, contentStyle, resizable = false, isValid, onClose, onConfirm, onCancel, onSuccess, onValidationFailure, onFailed, onException, onUnauthorized, onBeforeExecute, confirmBeforeExecute, okLabel, nextLabel, previousLabel, showCancel = false, cancelLabel, linear = true, orientation, headerPosition, start, end, onChangeStep, pt, ptOptions, unstyled, dialogClassName, dialogPt, dialogPtOptions, dialogUnstyled, children, }) => {
20
20
  const { messages } = useCratisComponentsConfig();
21
21
  const stepperMessages = messages?.stepper;
22
22
  const dialogMessages = messages?.dialog;
@@ -107,11 +107,11 @@ const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', s
107
107
  width: '100%',
108
108
  gap: '0.75rem',
109
109
  }, children: [showCancel && (jsx(Button, { variant: 'outline', onClick: () => handleClose(DialogResult.Cancelled), disabled: isBusy, style: { width: 'auto' }, children: jsx("span", { children: resolvedCancelLabel }) })), !isFirstStep && (jsx(Button, { variant: 'outline', onClick: () => changeStep(currentStep - 1), disabled: isBusy, style: { width: 'auto' }, children: jsx("span", { children: resolvedPreviousLabel }) })), jsx("div", { style: { flex: 1 } }), !isLastStep && (jsx(Button, { onClick: () => changeStep(currentStep + 1), disabled: isBusy || isCurrentStepInvalid, style: { width: 'auto' }, children: jsx("span", { children: resolvedNextLabel }) })), isLastStep && isDialogValid && (jsxs(Button, { onClick: handleSubmit, disabled: isBusy, autoFocus: true, style: { width: 'auto' }, children: [isBusy && (jsx("span", { className: 'cratis-dialog__spinner', "aria-hidden": 'true' })), jsx("span", { children: resolvedOkLabel })] }))] }));
110
- return (jsx(Dialog, { title: title, visible: visible, width: width, style: style, contentStyle: contentStyle, resizable: resizable, dismissable: !isBusy, buttons: footer, onCancel: onCancel, onClose: onClose, className: dialogClassName, pt: dialogPt, ptOptions: dialogPtOptions, unstyled: dialogUnstyled, children: jsx(CommandStepperContent, { activeStep: currentStep, visitedSteps: visitedSteps, getFieldError: getFieldError, onActiveStepChange: setActiveStep, onVisitedStepsChange: setVisitedSteps, onStepErrorsChange: setStepErrors, showNavigation: false, showSubmit: false, isSubmitting: confirmBeforeExecute !== undefined && isBusy, disableFieldsWhileSubmitting: confirmBeforeExecute !== undefined, linear: linear, orientation: orientation, headerPosition: headerPosition, start: start, end: end, onChangeStep: onChangeStep, pt: pt, ptOptions: ptOptions, unstyled: unstyled, children: children }) }));
110
+ return (jsx(Dialog, { title: title, headerActions: headerActions, hideGlobalHeaderActions: hideGlobalHeaderActions, sliceLocation: sliceLocation, isCommandDialog: true, visible: visible, width: width, style: style, contentStyle: contentStyle, resizable: resizable, dismissable: !isBusy, buttons: footer, onCancel: onCancel, onClose: onClose, className: dialogClassName, pt: dialogPt, ptOptions: dialogPtOptions, unstyled: dialogUnstyled, children: jsx(CommandStepperContent, { activeStep: currentStep, visitedSteps: visitedSteps, getFieldError: getFieldError, onActiveStepChange: setActiveStep, onVisitedStepsChange: setVisitedSteps, onStepErrorsChange: setStepErrors, showNavigation: false, showSubmit: false, isSubmitting: confirmBeforeExecute !== undefined && isBusy, disableFieldsWhileSubmitting: confirmBeforeExecute !== undefined, linear: linear, orientation: orientation, headerPosition: headerPosition, start: start, end: end, onChangeStep: onChangeStep, pt: pt, ptOptions: ptOptions, unstyled: unstyled, children: children }) }));
111
111
  };
112
112
  const StepperCommandDialogComponent = (props) => {
113
- const { title, visible, width, style, contentStyle, resizable, isValid, onClose, onConfirm, onCancel, onBeforeExecute, confirmBeforeExecute, okLabel, nextLabel, previousLabel, showCancel, cancelLabel, linear, orientation, headerPosition, start, end, onChangeStep, pt, ptOptions, unstyled, dialogClassName, dialogPt, dialogPtOptions, dialogUnstyled, children, ...commandFormProps } = props;
114
- return (jsx(CommandForm, { ...commandFormProps, children: jsx(StepperCommandDialogWrapper, { title: title, visible: visible, width: width, style: style, contentStyle: contentStyle, resizable: resizable, isValid: isValid, onClose: onClose, onConfirm: onConfirm, onCancel: onCancel, onSuccess: props.onSuccess, onValidationFailure: props.onValidationFailure, onFailed: props.onFailed, onException: props.onException, onUnauthorized: props.onUnauthorized, onBeforeExecute: onBeforeExecute, confirmBeforeExecute: confirmBeforeExecute, okLabel: okLabel, nextLabel: nextLabel, previousLabel: previousLabel, showCancel: showCancel, cancelLabel: cancelLabel, linear: linear, orientation: orientation, headerPosition: headerPosition, start: start, end: end, onChangeStep: onChangeStep, pt: pt, ptOptions: ptOptions, unstyled: unstyled, dialogClassName: dialogClassName, dialogPt: dialogPt, dialogPtOptions: dialogPtOptions, dialogUnstyled: dialogUnstyled, children: children }) }));
113
+ const { title, headerActions, hideGlobalHeaderActions, sliceLocation, visible, width, style, contentStyle, resizable, isValid, onClose, onConfirm, onCancel, onBeforeExecute, confirmBeforeExecute, okLabel, nextLabel, previousLabel, showCancel, cancelLabel, linear, orientation, headerPosition, start, end, onChangeStep, pt, ptOptions, unstyled, dialogClassName, dialogPt, dialogPtOptions, dialogUnstyled, children, ...commandFormProps } = props;
114
+ return (jsx(CommandForm, { ...commandFormProps, children: jsx(StepperCommandDialogWrapper, { title: title, headerActions: headerActions, hideGlobalHeaderActions: hideGlobalHeaderActions, sliceLocation: sliceLocation, visible: visible, width: width, style: style, contentStyle: contentStyle, resizable: resizable, isValid: isValid, onClose: onClose, onConfirm: onConfirm, onCancel: onCancel, onSuccess: props.onSuccess, onValidationFailure: props.onValidationFailure, onFailed: props.onFailed, onException: props.onException, onUnauthorized: props.onUnauthorized, onBeforeExecute: onBeforeExecute, confirmBeforeExecute: confirmBeforeExecute, okLabel: okLabel, nextLabel: nextLabel, previousLabel: previousLabel, showCancel: showCancel, cancelLabel: cancelLabel, linear: linear, orientation: orientation, headerPosition: headerPosition, start: start, end: end, onChangeStep: onChangeStep, pt: pt, ptOptions: ptOptions, unstyled: unstyled, dialogClassName: dialogClassName, dialogPt: dialogPt, dialogPtOptions: dialogPtOptions, dialogUnstyled: dialogUnstyled, children: children }) }));
115
115
  };
116
116
  const StepperCommandDialog = StepperCommandDialogComponent;
117
117
 
@@ -1 +1 @@
1
- {"version":3,"file":"StepperCommandDialog.js","sources":["../../../CommandDialog/StepperCommandDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React, { useState, type CSSProperties } from 'react';\nimport { DialogResult, useDialogContext } from '@cratis/arc.react/dialogs';\nimport { Button } from '../Common/Button';\nimport { useCratisComponentsConfig } from '../Common/CratisComponentsProvider';\nimport {\n CommandForm,\n useCommandFormContext,\n useCommandInstance,\n type CommandFormProps,\n} from '@cratis/arc.react/commands';\nimport {\n Dialog,\n type DialogProps,\n type CloseDialog,\n type ConfirmCallback,\n type CancelCallback,\n} from '../Dialogs/Dialog';\nimport type { StepperCustomizationProps } from './CommandStepper';\nimport { CommandStepperContent } from './CommandStepperContent';\nimport type { BeforeExecuteCallback } from './applyBeforeExecute';\nimport type { ConfirmBeforeExecute } from './confirmBeforeExecute';\nimport { useCommandExecution } from './useCommandExecution';\nimport { getStepPanels } from './stepChildren';\nimport { transitionStep } from './transitionStep';\n\n/**\n * Props for {@link StepperCommandDialog}. Combines the command-form props,\n * the stepper customization props (`linear`, `pt`, …), and dialog-specific\n * props for the outer modal.\n *\n * The Stepper customization props (`pt`/`ptOptions`/`unstyled`) target the\n * inner Stepper. To customize the outer Dialog use `dialogPt`, `dialogPtOptions`,\n * `dialogUnstyled`, and `dialogClassName`.\n *\n * @typeParam TCommand - The command record type.\n * @typeParam TResponse - The response payload type returned by a successful command.\n */\nexport interface StepperCommandDialogProps<TCommand extends object, TResponse = object>\n extends\n Omit<CommandFormProps<TCommand, TResponse>, 'children' | 'onBeforeExecute'>,\n StepperCustomizationProps {\n /**\n * A transformer invoked with the current command values immediately before\n * the command executes on submit. It **must return** the values to run with\n * (mutated or not) — a callback that returns nothing does not execute the\n * command with `undefined`; the current values are kept and a warning is\n * logged. May be async.\n *\n * ⚠️ It runs **only on submit**, after every step has already been validated,\n * so a value produced here can never satisfy required-field validation. Seed\n * required values through `initialValues`; reserve `onBeforeExecute` for\n * transforms that do not affect validity (for example a generated id).\n */\n onBeforeExecute?: BeforeExecuteCallback<TCommand>;\n /**\n * Ask before executing the transformed command values; only `true` executes.\n * Fields are disabled from submit until the guarded submission settles. If command values change\n * during that time, execution is skipped; confirm the new values again.\n */\n confirmBeforeExecute?: ConfirmBeforeExecute<TCommand>;\n /** Dialog title text. */\n title: string;\n /** Controls dialog visibility. Defaults to `true`. */\n visible?: boolean;\n /** Dialog width. */\n width?: string;\n /** Custom CSS styles applied to the dialog. */\n style?: CSSProperties;\n /** Custom CSS styles applied to the dialog content area. */\n contentStyle?: CSSProperties;\n /** Whether the dialog can be resized. Defaults to `false`. */\n resizable?: boolean;\n /** Additional validity gate combined with command form validity. */\n isValid?: boolean;\n /** Fallback close callback. */\n onClose?: CloseDialog;\n /** Confirm callback — called only after successful command execution. */\n onConfirm?: ConfirmCallback;\n /**\n * Cancel callback — invoked for every dismissal that is not a successful submit: the X in the\n * dialog header, the Escape key, and the footer Cancel button when `showCancel` is on. Return\n * `true` to let the dialog close through the dialog context. None of the three is offered while\n * the command is executing.\n */\n onCancel?: CancelCallback;\n /** Label for the submit button shown on the last step when valid. Falls back to the provider's `stepper.submit` message, then `'Submit'`. */\n okLabel?: string;\n /** Label for the next step button. Falls back to the provider's `stepper.next` message, then `'Next'`. */\n nextLabel?: string;\n /** Label for the previous step button. Falls back to the provider's `stepper.previous` message, then `'Previous'`. */\n previousLabel?: string;\n /**\n * Show a Cancel action in the footer. Defaults to `false`, leaving the X in the header as the\n * only way to dismiss. Turn it on for a wizard whose dismissal should be as reachable as its\n * submit — a destructive or long flow, or one presented without a visible header.\n */\n showCancel?: boolean;\n /** Label for the footer cancel button. Falls back to the provider's `dialog.cancel` message, then `'Cancel'`. */\n cancelLabel?: string;\n /**\n * Extra CSS class name forwarded to the underlying Cratis Dialog root.\n * Use the inherited `pt`/`ptOptions`/`unstyled` props to customize the Stepper.\n */\n dialogClassName?: string;\n /** Cratis-owned per-part attributes applied to the outer Dialog. */\n dialogPt?: DialogProps['pt'];\n /**\n * @deprecated Cratis dialog parts always merge. Remove this renderer-era option.\n */\n dialogPtOptions?: DialogProps['ptOptions'];\n /**\n * @deprecated Components always uses consumer-owned CSS. Customize through `dialogPt` and CSS instead.\n */\n dialogUnstyled?: boolean;\n /** StepperPanel children defining each wizard step. */\n children?: React.ReactNode;\n}\n\ntype StepperCommandDialogWrapperProps<TCommand extends object, TResponse = object> = {\n title: string;\n visible?: boolean;\n width?: string;\n style?: CSSProperties;\n contentStyle?: CSSProperties;\n resizable?: boolean;\n isValid?: boolean;\n onClose?: CloseDialog;\n onConfirm?: ConfirmCallback;\n onCancel?: CancelCallback;\n onSuccess?: CommandFormProps<TCommand, TResponse>['onSuccess'];\n onValidationFailure?: CommandFormProps<TCommand, TResponse>['onValidationFailure'];\n onFailed?: CommandFormProps<TCommand, TResponse>['onFailed'];\n onException?: CommandFormProps<TCommand, TResponse>['onException'];\n onUnauthorized?: CommandFormProps<TCommand, TResponse>['onUnauthorized'];\n onBeforeExecute?: BeforeExecuteCallback<TCommand>;\n confirmBeforeExecute?: ConfirmBeforeExecute<TCommand>;\n okLabel?: string;\n nextLabel?: string;\n previousLabel?: string;\n showCancel?: boolean;\n cancelLabel?: string;\n dialogClassName?: string;\n dialogPt?: DialogProps['pt'];\n dialogPtOptions?: DialogProps['ptOptions'];\n dialogUnstyled?: boolean;\n children?: React.ReactNode;\n} & StepperCustomizationProps;\n\nconst StepperCommandDialogWrapper = <TCommand extends object, TResponse = object>({\n title,\n visible = true,\n width = '600px',\n style,\n contentStyle,\n resizable = false,\n isValid,\n onClose,\n onConfirm,\n onCancel,\n onSuccess,\n onValidationFailure,\n onFailed,\n onException,\n onUnauthorized,\n onBeforeExecute,\n confirmBeforeExecute,\n okLabel,\n nextLabel,\n previousLabel,\n showCancel = false,\n cancelLabel,\n linear = true,\n orientation,\n headerPosition,\n start,\n end,\n onChangeStep,\n pt,\n ptOptions,\n unstyled,\n dialogClassName,\n dialogPt,\n dialogPtOptions,\n dialogUnstyled,\n children,\n}: StepperCommandDialogWrapperProps<TCommand, TResponse>) => {\n const { messages } = useCratisComponentsConfig();\n const stepperMessages = messages?.stepper;\n const dialogMessages = messages?.dialog;\n const resolvedOkLabel = okLabel ?? stepperMessages?.submit ?? 'Submit';\n const resolvedNextLabel = nextLabel ?? stepperMessages?.next ?? 'Next';\n const resolvedPreviousLabel =\n previousLabel ?? stepperMessages?.previous ?? 'Previous';\n const resolvedCancelLabel = cancelLabel ?? dialogMessages?.cancel ?? 'Cancel';\n const {\n setCommandValues,\n setCommandResult,\n isValid: isCommandFormValid,\n getFieldError,\n } = useCommandFormContext<TCommand>();\n const commandInstance = useCommandInstance<TCommand>();\n const submission = useCommandExecution<TCommand, TResponse>(\n commandInstance, setCommandValues, onBeforeExecute, confirmBeforeExecute, onException,\n );\n const isBusy = submission.isSubmitting;\n const [activeStep, setActiveStep] = useState(0);\n const [visitedSteps, setVisitedSteps] = useState<Set<number>>(new Set([0]));\n const [stepErrors, setStepErrors] = useState<boolean[]>([]);\n\n // useDialogContext() is called unconditionally on every render — the try/catch only suppresses\n // the exception when the dialog is used standalone (outside a provider). React's Rules of Hooks\n // are not violated because the hook is always called; the try/catch never skips the call.\n let contextCloseDialog: ((result: DialogResult) => void) | undefined;\n try {\n const context = useDialogContext();\n contextCloseDialog = context?.closeDialog;\n } catch {\n contextCloseDialog = undefined;\n }\n\n // Only the steps that actually render count. That count is not fixed: a conditional step\n // (`{condition && <StepperPanel/>}`) can disappear after the user has already advanced past\n // it — a late-resolving query or a `currentValues` overlay flipping the condition is enough.\n // The step the wizard is on is therefore clamped into the set that still renders, and the\n // last/first tests are inequalities, so an index left stranded above the end still resolves\n // to the last surviving step instead of a step that is neither last nor navigable. Same\n // shape as CommandStepperContent, which this dialog's body is.\n const stepCount = getStepPanels(children).length;\n const currentStep = Math.min(Math.max(activeStep, 0), Math.max(stepCount - 1, 0));\n const isLastStep = currentStep >= stepCount - 1;\n const isFirstStep = currentStep <= 0;\n const isDialogValid = isValid !== false && isCommandFormValid;\n const isCurrentStepInvalid = stepErrors[currentStep] ?? false;\n const changeStep = (index: number) => transitionStep({\n index,\n currentStep,\n stepCount,\n isCurrentStepInvalid,\n linear,\n visitedSteps,\n onActiveStepChange: setActiveStep,\n onVisitedStepsChange: setVisitedSteps,\n onChangeStep,\n });\n\n // Both close paths this wrapper owns — the footer Cancel and the successful Submit — run the\n // caller's gate before closing through the dialog host. The header X and Escape are owned by\n // the outer Cratis Dialog instead, which runs the same `onCancel` / `onClose` callbacks; that\n // keeps one contract for the caller no matter which affordance was used.\n const handleClose = async (result: DialogResult) => {\n let shouldCloseThroughContext = true;\n\n if (result === DialogResult.Ok || result === DialogResult.Yes) {\n if (onConfirm) {\n const closeResult = await onConfirm();\n shouldCloseThroughContext = closeResult === true;\n } else if (onClose) {\n const closeResult = await onClose(result);\n shouldCloseThroughContext = closeResult !== false;\n }\n } else if (onCancel) {\n const closeResult = await onCancel();\n shouldCloseThroughContext = closeResult === true;\n } else if (onClose) {\n const closeResult = await onClose(result);\n shouldCloseThroughContext = closeResult !== false;\n }\n\n if (shouldCloseThroughContext) {\n contextCloseDialog?.(result);\n }\n };\n\n // Busy is set before anything is awaited, not just around execute(). `onBeforeExecute` may be\n // async, and from the moment Submit is pressed the dialog is committed to running the command -\n // so every dismissal has to be withdrawn for the whole window, not only for the part of it the\n // request is in flight. Setting it after the transform would leave Cancel live while the command\n // is already on its way: the operator cancels, the dialog closes reporting cancellation, the\n // transform resolves, and the command executes anyway. The `finally` is what releases it, so the\n // flag is cleared on the failure paths and on a transform that throws just as it is on success.\n // Result callbacks run after the submission releases busy.\n const handleSubmit = async () => {\n const result = await submission.run();\n if (!result) return;\n\n if (!result.isSuccess) {\n await onFailed?.(result);\n if (result.hasExceptions) {\n await onException?.(result.exceptionMessages, result.exceptionStackTrace);\n }\n if (!result.isAuthorized) await onUnauthorized?.();\n if (!result.isValid) {\n await onValidationFailure?.(result.validationResults);\n }\n if (submission.isMounted()) setCommandResult(result);\n return;\n }\n\n await onSuccess?.(result.response as TResponse);\n await handleClose(DialogResult.Ok);\n };\n\n const footer = (\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n gap: '0.75rem',\n }}\n >\n {showCancel && (\n <Button\n variant='outline'\n onClick={() => handleClose(DialogResult.Cancelled)}\n disabled={isBusy}\n style={{ width: 'auto' }}\n >\n <span>{resolvedCancelLabel}</span>\n </Button>\n )}\n {!isFirstStep && (\n <Button\n variant='outline'\n onClick={() => changeStep(currentStep - 1)}\n disabled={isBusy}\n style={{ width: 'auto' }}\n >\n <span>{resolvedPreviousLabel}</span>\n </Button>\n )}\n <div style={{ flex: 1 }} />\n {!isLastStep && (\n <Button\n onClick={() => changeStep(currentStep + 1)}\n disabled={isBusy || isCurrentStepInvalid}\n style={{ width: 'auto' }}\n >\n <span>{resolvedNextLabel}</span>\n </Button>\n )}\n {isLastStep && isDialogValid && (\n <Button\n onClick={handleSubmit}\n disabled={isBusy}\n autoFocus\n style={{ width: 'auto' }}\n >\n {isBusy && (\n <span className='cratis-dialog__spinner' aria-hidden='true' />\n )}\n <span>{resolvedOkLabel}</span>\n </Button>\n )}\n </div>\n );\n\n // The header X and the Escape key are withdrawn on the same flag as the footer Cancel. A\n // dismissal that still worked mid-flight would close the dialog and then let onSuccess fire on\n // a dialog that is already gone. `dismissable` is the single switch on the Cratis Dialog that\n // governs all three affordances — the header close button, the backdrop click\n // and `closeOnEscape` — so withdrawing it withdraws every dismissal at once.\n return (\n <Dialog\n title={title}\n visible={visible}\n width={width}\n style={style}\n contentStyle={contentStyle}\n resizable={resizable}\n dismissable={!isBusy}\n buttons={footer}\n onCancel={onCancel}\n onClose={onClose}\n className={dialogClassName}\n pt={dialogPt}\n ptOptions={dialogPtOptions}\n unstyled={dialogUnstyled}\n >\n <CommandStepperContent\n activeStep={currentStep}\n visitedSteps={visitedSteps}\n getFieldError={getFieldError}\n onActiveStepChange={setActiveStep}\n onVisitedStepsChange={setVisitedSteps}\n onStepErrorsChange={setStepErrors}\n showNavigation={false}\n showSubmit={false}\n isSubmitting={confirmBeforeExecute !== undefined && isBusy}\n disableFieldsWhileSubmitting={confirmBeforeExecute !== undefined}\n linear={linear}\n orientation={orientation}\n headerPosition={headerPosition}\n start={start}\n end={end}\n onChangeStep={onChangeStep}\n pt={pt}\n ptOptions={ptOptions}\n unstyled={unstyled}\n >\n {children}\n </CommandStepperContent>\n </Dialog>\n );\n};\n\n/**\n * A multi-step wizard dialog backed by a single Cratis Arc command. Wraps\n * the Cratis-owned Stepper inside a Cratis {@link Dialog}, tracks per-step\n * visit state, surfaces inline error indicators on steps with invalid\n * fields, and executes the bound command when the user submits the last\n * step. Use it when one command has enough fields that they should be\n * broken into named stages; for single-stage commands, use\n * {@link CommandDialog}.\n *\n * ## What `TCommand` is\n *\n * `TCommand` is the auto-generated TypeScript class produced by the Arc\n * proxy generator from a C# `[Command]` record. The wizard fields all bind\n * to properties on this single command — the multi-step UI is purely a\n * presentation grouping of one command's fields, not multiple commands.\n *\n * ## What's unique vs. {@link CommandDialog}\n *\n * - **Progressive disclosure**: fields are grouped into `<StepperPanel>`\n * children and the user advances through them with explicit Previous /\n * Next buttons before reaching Submit on the last step.\n * - **Per-step error indicators**: the step number circle paints red when\n * any field inside that step has a validation error and the step has\n * been visited, so a long wizard doesn't hide a single-field error on\n * page 1 behind page 4. The CratisStepper handles this by reading\n * `getFieldError` from the form context and inspecting which fields\n * belong to which step.\n * - **Visited tracking**: only visited steps show error indicators; an\n * un-visited step is never marked red just because its fields are blank.\n * - **Linear mode (default)**: the user must complete a step before\n * advancing. Set `linear={false}` to allow free navigation.\n * - **Submit only fires on the last step**: the command runs through Arc's\n * command pipeline only when the user clicks the final Submit button —\n * not on every Next click. Failure paths\n * (`onValidationFailure` / `onFailed`) work exactly like\n * {@link CommandDialog}: dialog stays open, errors surface back to the\n * form.\n *\n * ## Typed dialog host usage\n *\n * Same pattern as {@link CommandDialog} — combine with\n * `useDialog<CommandResult<TResponse>>()` from `@cratis/arc.react/dialogs`\n * to get a fully-typed result at the call site:\n *\n * ```tsx\n * import { useDialog, DialogResult } from '@cratis/arc.react/dialogs';\n * import { StepperCommandDialog, StepperPanel } from '@cratis/components/CommandDialog';\n * import { RegisterOrder } from './RegisterOrder'; // proxy from C#\n *\n * const RegisterOrderDialog = () => {\n * const { closeDialog } = useDialogContext<CommandResult<RegisterOrderResponse>>();\n * return (\n * <StepperCommandDialog<RegisterOrder, RegisterOrderResponse>\n * command={RegisterOrder}\n * title=\"New order\"\n * onSuccess={() => closeDialog(DialogResult.Ok)}\n * onCancel={() => closeDialog(DialogResult.Cancelled)}>\n * <StepperPanel header=\"Customer\">\n * <InputTextField value={c => c.customerName} title=\"Name\" />\n * <InputTextField value={c => c.email} title=\"Email\" />\n * </StepperPanel>\n * <StepperPanel header=\"Items\">\n * <ChipsField value={c => c.items} title=\"Items\" />\n * <NumberField value={c => c.quantity} title=\"Quantity\" min={1} />\n * </StepperPanel>\n * <StepperPanel header=\"Confirm\">\n * <CheckboxField value={c => c.confirmed} label=\"I confirm the order\" />\n * </StepperPanel>\n * </StepperCommandDialog>\n * );\n * };\n * ```\n *\n * ## Styling\n *\n * The inherited `pt` / `ptOptions` / `unstyled` props target the inner\n * **Stepper**. Use `dialogPt` / `dialogPtOptions` / `dialogUnstyled` /\n * `dialogClassName` to style the outer **Dialog** independently. See the\n * [pass-through cheat sheet](../../Documentation/Styling/pass-through.md)\n * for the slot reference.\n *\n * @typeParam TCommand - The command class (proxy generated from C# `[Command]`).\n * @typeParam TResponse - The success payload type returned by the command's `Handle()` method on the backend.\n * @param props - {@link StepperCommandDialogProps}.\n */\nconst StepperCommandDialogComponent = <\n TCommand extends object = object,\n TResponse = object,\n>(\n props: StepperCommandDialogProps<TCommand, TResponse>,\n) => {\n const {\n title,\n visible,\n width,\n style,\n contentStyle,\n resizable,\n isValid,\n onClose,\n onConfirm,\n onCancel,\n onBeforeExecute,\n confirmBeforeExecute,\n okLabel,\n nextLabel,\n previousLabel,\n showCancel,\n cancelLabel,\n linear,\n orientation,\n headerPosition,\n start,\n end,\n onChangeStep,\n pt,\n ptOptions,\n unstyled,\n dialogClassName,\n dialogPt,\n dialogPtOptions,\n dialogUnstyled,\n children,\n ...commandFormProps\n } = props;\n\n return (\n <CommandForm<TCommand, TResponse> {...commandFormProps}>\n <StepperCommandDialogWrapper<TCommand, TResponse>\n title={title}\n visible={visible}\n width={width}\n style={style}\n contentStyle={contentStyle}\n resizable={resizable}\n isValid={isValid}\n onClose={onClose}\n onConfirm={onConfirm}\n onCancel={onCancel}\n onSuccess={props.onSuccess}\n onValidationFailure={props.onValidationFailure}\n onFailed={props.onFailed}\n onException={props.onException}\n onUnauthorized={props.onUnauthorized}\n onBeforeExecute={onBeforeExecute}\n confirmBeforeExecute={confirmBeforeExecute}\n okLabel={okLabel}\n nextLabel={nextLabel}\n previousLabel={previousLabel}\n showCancel={showCancel}\n cancelLabel={cancelLabel}\n linear={linear}\n orientation={orientation}\n headerPosition={headerPosition}\n start={start}\n end={end}\n onChangeStep={onChangeStep}\n pt={pt}\n ptOptions={ptOptions}\n unstyled={unstyled}\n dialogClassName={dialogClassName}\n dialogPt={dialogPt}\n dialogPtOptions={dialogPtOptions}\n dialogUnstyled={dialogUnstyled}\n >\n {children}\n </StepperCommandDialogWrapper>\n </CommandForm>\n );\n};\n\n/**\n * A multi-step wizard dialog backed by a single Cratis Arc command. Wraps\n * the Cratis-owned Stepper inside a Cratis {@link Dialog}, tracks per-step\n * visit state, surfaces inline error indicators on steps with invalid\n * fields, and executes the bound command when the user submits the last\n * step. Use it when one command has enough fields that they should be\n * broken into named stages; for single-stage commands, use\n * {@link CommandDialog}.\n *\n * See {@link StepperCommandDialogComponent} for full documentation.\n *\n * @typeParam TCommand - The command class (proxy generated from C# `[Command]`).\n * @typeParam TResponse - The success payload type returned by the command's `Handle()` method on the backend.\n */\nexport const StepperCommandDialog = StepperCommandDialogComponent;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;AAuJA,MAAM,2BAA2B,GAAG,CAA8C,EAC9E,KAAK,EACL,OAAO,GAAG,IAAI,EACd,KAAK,GAAG,OAAO,EACf,KAAK,EACL,YAAY,EACZ,SAAS,GAAG,KAAK,EACjB,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,OAAO,EACP,SAAS,EACT,aAAa,EACb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N,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAAA,QAAA,EAE7B,QAAQ,EAAA,CACiB,EAAA,CACpB;AAEtB,CAAC;AAgBM,MAAM,oBAAoB,GAAG;;"}
1
+ {"version":3,"file":"StepperCommandDialog.js","sources":["../../../CommandDialog/StepperCommandDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React, { useState, type CSSProperties } from 'react';\nimport { DialogResult, useDialogContext } from '@cratis/arc.react/dialogs';\nimport { Button } from '../Common/Button';\nimport { useCratisComponentsConfig } from '../Common/CratisComponentsProvider';\nimport {\n CommandForm,\n useCommandFormContext,\n useCommandInstance,\n type CommandFormProps,\n} from '@cratis/arc.react/commands';\nimport {\n Dialog,\n type DialogProps,\n type CloseDialog,\n type ConfirmCallback,\n type CancelCallback,\n} from '../Dialogs/Dialog';\nimport type { DialogSliceLocation } from '../configuration/DialogSliceLocation';\nimport type { StepperCustomizationProps } from './CommandStepper';\nimport { CommandStepperContent } from './CommandStepperContent';\nimport type { BeforeExecuteCallback } from './applyBeforeExecute';\nimport type { ConfirmBeforeExecute } from './confirmBeforeExecute';\nimport { useCommandExecution } from './useCommandExecution';\nimport { getStepPanels } from './stepChildren';\nimport { transitionStep } from './transitionStep';\n\n/**\n * Props for {@link StepperCommandDialog}. Combines the command-form props,\n * the stepper customization props (`linear`, `pt`, …), and dialog-specific\n * props for the outer modal.\n *\n * The Stepper customization props (`pt`/`ptOptions`/`unstyled`) target the\n * inner Stepper. To customize the outer Dialog use `dialogPt`, `dialogPtOptions`,\n * `dialogUnstyled`, and `dialogClassName`.\n *\n * @typeParam TCommand - The command record type.\n * @typeParam TResponse - The response payload type returned by a successful command.\n */\nexport interface StepperCommandDialogProps<TCommand extends object, TResponse = object>\n extends\n Omit<CommandFormProps<TCommand, TResponse>, 'children' | 'onBeforeExecute'>,\n StepperCustomizationProps {\n /**\n * A transformer invoked with the current command values immediately before\n * the command executes on submit. It **must return** the values to run with\n * (mutated or not) — a callback that returns nothing does not execute the\n * command with `undefined`; the current values are kept and a warning is\n * logged. May be async.\n *\n * ⚠️ It runs **only on submit**, after every step has already been validated,\n * so a value produced here can never satisfy required-field validation. Seed\n * required values through `initialValues`; reserve `onBeforeExecute` for\n * transforms that do not affect validity (for example a generated id).\n */\n onBeforeExecute?: BeforeExecuteCallback<TCommand>;\n /**\n * Ask before executing the transformed command values; only `true` executes.\n * Fields are disabled from submit until the guarded submission settles. If command values change\n * during that time, execution is skipped; confirm the new values again.\n */\n confirmBeforeExecute?: ConfirmBeforeExecute<TCommand>;\n /** Dialog title text. */\n title: string;\n /** Actions rendered in the dialog header before the close button. */\n headerActions?: React.ReactNode;\n /** Suppresses the app-wide header actions registered on `CratisComponentsProvider` for this dialog. */\n hideGlobalHeaderActions?: boolean;\n /** Where this dialog's opener sits in the application; passed to app-wide header actions. */\n sliceLocation?: DialogSliceLocation;\n /** Controls dialog visibility. Defaults to `true`. */\n visible?: boolean;\n /** Dialog width. */\n width?: string;\n /** Custom CSS styles applied to the dialog. */\n style?: CSSProperties;\n /** Custom CSS styles applied to the dialog content area. */\n contentStyle?: CSSProperties;\n /** Whether the dialog can be resized. Defaults to `false`. */\n resizable?: boolean;\n /** Additional validity gate combined with command form validity. */\n isValid?: boolean;\n /** Fallback close callback. */\n onClose?: CloseDialog;\n /** Confirm callback — called only after successful command execution. */\n onConfirm?: ConfirmCallback;\n /**\n * Cancel callback — invoked for every dismissal that is not a successful submit: the X in the\n * dialog header, the Escape key, and the footer Cancel button when `showCancel` is on. Return\n * `true` to let the dialog close through the dialog context. None of the three is offered while\n * the command is executing.\n */\n onCancel?: CancelCallback;\n /** Label for the submit button shown on the last step when valid. Falls back to the provider's `stepper.submit` message, then `'Submit'`. */\n okLabel?: string;\n /** Label for the next step button. Falls back to the provider's `stepper.next` message, then `'Next'`. */\n nextLabel?: string;\n /** Label for the previous step button. Falls back to the provider's `stepper.previous` message, then `'Previous'`. */\n previousLabel?: string;\n /**\n * Show a Cancel action in the footer. Defaults to `false`, leaving the X in the header as the\n * only way to dismiss. Turn it on for a wizard whose dismissal should be as reachable as its\n * submit — a destructive or long flow, or one presented without a visible header.\n */\n showCancel?: boolean;\n /** Label for the footer cancel button. Falls back to the provider's `dialog.cancel` message, then `'Cancel'`. */\n cancelLabel?: string;\n /**\n * Extra CSS class name forwarded to the underlying Cratis Dialog root.\n * Use the inherited `pt`/`ptOptions`/`unstyled` props to customize the Stepper.\n */\n dialogClassName?: string;\n /** Cratis-owned per-part attributes applied to the outer Dialog. */\n dialogPt?: DialogProps['pt'];\n /**\n * @deprecated Cratis dialog parts always merge. Remove this renderer-era option.\n */\n dialogPtOptions?: DialogProps['ptOptions'];\n /**\n * @deprecated Components always uses consumer-owned CSS. Customize through `dialogPt` and CSS instead.\n */\n dialogUnstyled?: boolean;\n /** StepperPanel children defining each wizard step. */\n children?: React.ReactNode;\n}\n\ntype StepperCommandDialogWrapperProps<TCommand extends object, TResponse = object> = {\n title: string;\n headerActions?: React.ReactNode;\n hideGlobalHeaderActions?: boolean;\n sliceLocation?: DialogSliceLocation;\n visible?: boolean;\n width?: string;\n style?: CSSProperties;\n contentStyle?: CSSProperties;\n resizable?: boolean;\n isValid?: boolean;\n onClose?: CloseDialog;\n onConfirm?: ConfirmCallback;\n onCancel?: CancelCallback;\n onSuccess?: CommandFormProps<TCommand, TResponse>['onSuccess'];\n onValidationFailure?: CommandFormProps<TCommand, TResponse>['onValidationFailure'];\n onFailed?: CommandFormProps<TCommand, TResponse>['onFailed'];\n onException?: CommandFormProps<TCommand, TResponse>['onException'];\n onUnauthorized?: CommandFormProps<TCommand, TResponse>['onUnauthorized'];\n onBeforeExecute?: BeforeExecuteCallback<TCommand>;\n confirmBeforeExecute?: ConfirmBeforeExecute<TCommand>;\n okLabel?: string;\n nextLabel?: string;\n previousLabel?: string;\n showCancel?: boolean;\n cancelLabel?: string;\n dialogClassName?: string;\n dialogPt?: DialogProps['pt'];\n dialogPtOptions?: DialogProps['ptOptions'];\n dialogUnstyled?: boolean;\n children?: React.ReactNode;\n} & StepperCustomizationProps;\n\nconst StepperCommandDialogWrapper = <TCommand extends object, TResponse = object>({\n title,\n headerActions,\n hideGlobalHeaderActions,\n sliceLocation,\n visible = true,\n width = '600px',\n style,\n contentStyle,\n resizable = false,\n isValid,\n onClose,\n onConfirm,\n onCancel,\n onSuccess,\n onValidationFailure,\n onFailed,\n onException,\n onUnauthorized,\n onBeforeExecute,\n confirmBeforeExecute,\n okLabel,\n nextLabel,\n previousLabel,\n showCancel = false,\n cancelLabel,\n linear = true,\n orientation,\n headerPosition,\n start,\n end,\n onChangeStep,\n pt,\n ptOptions,\n unstyled,\n dialogClassName,\n dialogPt,\n dialogPtOptions,\n dialogUnstyled,\n children,\n}: StepperCommandDialogWrapperProps<TCommand, TResponse>) => {\n const { messages } = useCratisComponentsConfig();\n const stepperMessages = messages?.stepper;\n const dialogMessages = messages?.dialog;\n const resolvedOkLabel = okLabel ?? stepperMessages?.submit ?? 'Submit';\n const resolvedNextLabel = nextLabel ?? stepperMessages?.next ?? 'Next';\n const resolvedPreviousLabel =\n previousLabel ?? stepperMessages?.previous ?? 'Previous';\n const resolvedCancelLabel = cancelLabel ?? dialogMessages?.cancel ?? 'Cancel';\n const {\n setCommandValues,\n setCommandResult,\n isValid: isCommandFormValid,\n getFieldError,\n } = useCommandFormContext<TCommand>();\n const commandInstance = useCommandInstance<TCommand>();\n const submission = useCommandExecution<TCommand, TResponse>(\n commandInstance, setCommandValues, onBeforeExecute, confirmBeforeExecute, onException,\n );\n const isBusy = submission.isSubmitting;\n const [activeStep, setActiveStep] = useState(0);\n const [visitedSteps, setVisitedSteps] = useState<Set<number>>(new Set([0]));\n const [stepErrors, setStepErrors] = useState<boolean[]>([]);\n\n // useDialogContext() is called unconditionally on every render — the try/catch only suppresses\n // the exception when the dialog is used standalone (outside a provider). React's Rules of Hooks\n // are not violated because the hook is always called; the try/catch never skips the call.\n let contextCloseDialog: ((result: DialogResult) => void) | undefined;\n try {\n const context = useDialogContext();\n contextCloseDialog = context?.closeDialog;\n } catch {\n contextCloseDialog = undefined;\n }\n\n // Only the steps that actually render count. That count is not fixed: a conditional step\n // (`{condition && <StepperPanel/>}`) can disappear after the user has already advanced past\n // it — a late-resolving query or a `currentValues` overlay flipping the condition is enough.\n // The step the wizard is on is therefore clamped into the set that still renders, and the\n // last/first tests are inequalities, so an index left stranded above the end still resolves\n // to the last surviving step instead of a step that is neither last nor navigable. Same\n // shape as CommandStepperContent, which this dialog's body is.\n const stepCount = getStepPanels(children).length;\n const currentStep = Math.min(Math.max(activeStep, 0), Math.max(stepCount - 1, 0));\n const isLastStep = currentStep >= stepCount - 1;\n const isFirstStep = currentStep <= 0;\n const isDialogValid = isValid !== false && isCommandFormValid;\n const isCurrentStepInvalid = stepErrors[currentStep] ?? false;\n const changeStep = (index: number) => transitionStep({\n index,\n currentStep,\n stepCount,\n isCurrentStepInvalid,\n linear,\n visitedSteps,\n onActiveStepChange: setActiveStep,\n onVisitedStepsChange: setVisitedSteps,\n onChangeStep,\n });\n\n // Both close paths this wrapper owns — the footer Cancel and the successful Submit — run the\n // caller's gate before closing through the dialog host. The header X and Escape are owned by\n // the outer Cratis Dialog instead, which runs the same `onCancel` / `onClose` callbacks; that\n // keeps one contract for the caller no matter which affordance was used.\n const handleClose = async (result: DialogResult) => {\n let shouldCloseThroughContext = true;\n\n if (result === DialogResult.Ok || result === DialogResult.Yes) {\n if (onConfirm) {\n const closeResult = await onConfirm();\n shouldCloseThroughContext = closeResult === true;\n } else if (onClose) {\n const closeResult = await onClose(result);\n shouldCloseThroughContext = closeResult !== false;\n }\n } else if (onCancel) {\n const closeResult = await onCancel();\n shouldCloseThroughContext = closeResult === true;\n } else if (onClose) {\n const closeResult = await onClose(result);\n shouldCloseThroughContext = closeResult !== false;\n }\n\n if (shouldCloseThroughContext) {\n contextCloseDialog?.(result);\n }\n };\n\n // Busy is set before anything is awaited, not just around execute(). `onBeforeExecute` may be\n // async, and from the moment Submit is pressed the dialog is committed to running the command -\n // so every dismissal has to be withdrawn for the whole window, not only for the part of it the\n // request is in flight. Setting it after the transform would leave Cancel live while the command\n // is already on its way: the operator cancels, the dialog closes reporting cancellation, the\n // transform resolves, and the command executes anyway. The `finally` is what releases it, so the\n // flag is cleared on the failure paths and on a transform that throws just as it is on success.\n // Result callbacks run after the submission releases busy.\n const handleSubmit = async () => {\n const result = await submission.run();\n if (!result) return;\n\n if (!result.isSuccess) {\n await onFailed?.(result);\n if (result.hasExceptions) {\n await onException?.(result.exceptionMessages, result.exceptionStackTrace);\n }\n if (!result.isAuthorized) await onUnauthorized?.();\n if (!result.isValid) {\n await onValidationFailure?.(result.validationResults);\n }\n if (submission.isMounted()) setCommandResult(result);\n return;\n }\n\n await onSuccess?.(result.response as TResponse);\n await handleClose(DialogResult.Ok);\n };\n\n const footer = (\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n gap: '0.75rem',\n }}\n >\n {showCancel && (\n <Button\n variant='outline'\n onClick={() => handleClose(DialogResult.Cancelled)}\n disabled={isBusy}\n style={{ width: 'auto' }}\n >\n <span>{resolvedCancelLabel}</span>\n </Button>\n )}\n {!isFirstStep && (\n <Button\n variant='outline'\n onClick={() => changeStep(currentStep - 1)}\n disabled={isBusy}\n style={{ width: 'auto' }}\n >\n <span>{resolvedPreviousLabel}</span>\n </Button>\n )}\n <div style={{ flex: 1 }} />\n {!isLastStep && (\n <Button\n onClick={() => changeStep(currentStep + 1)}\n disabled={isBusy || isCurrentStepInvalid}\n style={{ width: 'auto' }}\n >\n <span>{resolvedNextLabel}</span>\n </Button>\n )}\n {isLastStep && isDialogValid && (\n <Button\n onClick={handleSubmit}\n disabled={isBusy}\n autoFocus\n style={{ width: 'auto' }}\n >\n {isBusy && (\n <span className='cratis-dialog__spinner' aria-hidden='true' />\n )}\n <span>{resolvedOkLabel}</span>\n </Button>\n )}\n </div>\n );\n\n // The header X and the Escape key are withdrawn on the same flag as the footer Cancel. A\n // dismissal that still worked mid-flight would close the dialog and then let onSuccess fire on\n // a dialog that is already gone. `dismissable` is the single switch on the Cratis Dialog that\n // governs all three affordances — the header close button, the backdrop click\n // and `closeOnEscape` — so withdrawing it withdraws every dismissal at once.\n return (\n <Dialog\n title={title}\n headerActions={headerActions}\n hideGlobalHeaderActions={hideGlobalHeaderActions}\n sliceLocation={sliceLocation}\n isCommandDialog\n visible={visible}\n width={width}\n style={style}\n contentStyle={contentStyle}\n resizable={resizable}\n dismissable={!isBusy}\n buttons={footer}\n onCancel={onCancel}\n onClose={onClose}\n className={dialogClassName}\n pt={dialogPt}\n ptOptions={dialogPtOptions}\n unstyled={dialogUnstyled}\n >\n <CommandStepperContent\n activeStep={currentStep}\n visitedSteps={visitedSteps}\n getFieldError={getFieldError}\n onActiveStepChange={setActiveStep}\n onVisitedStepsChange={setVisitedSteps}\n onStepErrorsChange={setStepErrors}\n showNavigation={false}\n showSubmit={false}\n isSubmitting={confirmBeforeExecute !== undefined && isBusy}\n disableFieldsWhileSubmitting={confirmBeforeExecute !== undefined}\n linear={linear}\n orientation={orientation}\n headerPosition={headerPosition}\n start={start}\n end={end}\n onChangeStep={onChangeStep}\n pt={pt}\n ptOptions={ptOptions}\n unstyled={unstyled}\n >\n {children}\n </CommandStepperContent>\n </Dialog>\n );\n};\n\n/**\n * A multi-step wizard dialog backed by a single Cratis Arc command. Wraps\n * the Cratis-owned Stepper inside a Cratis {@link Dialog}, tracks per-step\n * visit state, surfaces inline error indicators on steps with invalid\n * fields, and executes the bound command when the user submits the last\n * step. Use it when one command has enough fields that they should be\n * broken into named stages; for single-stage commands, use\n * {@link CommandDialog}.\n *\n * ## What `TCommand` is\n *\n * `TCommand` is the auto-generated TypeScript class produced by the Arc\n * proxy generator from a C# `[Command]` record. The wizard fields all bind\n * to properties on this single command — the multi-step UI is purely a\n * presentation grouping of one command's fields, not multiple commands.\n *\n * ## What's unique vs. {@link CommandDialog}\n *\n * - **Progressive disclosure**: fields are grouped into `<StepperPanel>`\n * children and the user advances through them with explicit Previous /\n * Next buttons before reaching Submit on the last step.\n * - **Per-step error indicators**: the step number circle paints red when\n * any field inside that step has a validation error and the step has\n * been visited, so a long wizard doesn't hide a single-field error on\n * page 1 behind page 4. The CratisStepper handles this by reading\n * `getFieldError` from the form context and inspecting which fields\n * belong to which step.\n * - **Visited tracking**: only visited steps show error indicators; an\n * un-visited step is never marked red just because its fields are blank.\n * - **Linear mode (default)**: the user must complete a step before\n * advancing. Set `linear={false}` to allow free navigation.\n * - **Submit only fires on the last step**: the command runs through Arc's\n * command pipeline only when the user clicks the final Submit button —\n * not on every Next click. Failure paths\n * (`onValidationFailure` / `onFailed`) work exactly like\n * {@link CommandDialog}: dialog stays open, errors surface back to the\n * form.\n *\n * ## Typed dialog host usage\n *\n * Same pattern as {@link CommandDialog} — combine with\n * `useDialog<CommandResult<TResponse>>()` from `@cratis/arc.react/dialogs`\n * to get a fully-typed result at the call site:\n *\n * ```tsx\n * import { useDialog, DialogResult } from '@cratis/arc.react/dialogs';\n * import { StepperCommandDialog, StepperPanel } from '@cratis/components/CommandDialog';\n * import { RegisterOrder } from './RegisterOrder'; // proxy from C#\n *\n * const RegisterOrderDialog = () => {\n * const { closeDialog } = useDialogContext<CommandResult<RegisterOrderResponse>>();\n * return (\n * <StepperCommandDialog<RegisterOrder, RegisterOrderResponse>\n * command={RegisterOrder}\n * title=\"New order\"\n * onSuccess={() => closeDialog(DialogResult.Ok)}\n * onCancel={() => closeDialog(DialogResult.Cancelled)}>\n * <StepperPanel header=\"Customer\">\n * <InputTextField value={c => c.customerName} title=\"Name\" />\n * <InputTextField value={c => c.email} title=\"Email\" />\n * </StepperPanel>\n * <StepperPanel header=\"Items\">\n * <ChipsField value={c => c.items} title=\"Items\" />\n * <NumberField value={c => c.quantity} title=\"Quantity\" min={1} />\n * </StepperPanel>\n * <StepperPanel header=\"Confirm\">\n * <CheckboxField value={c => c.confirmed} label=\"I confirm the order\" />\n * </StepperPanel>\n * </StepperCommandDialog>\n * );\n * };\n * ```\n *\n * ## Styling\n *\n * The inherited `pt` / `ptOptions` / `unstyled` props target the inner\n * **Stepper**. Use `dialogPt` / `dialogPtOptions` / `dialogUnstyled` /\n * `dialogClassName` to style the outer **Dialog** independently. See the\n * [pass-through cheat sheet](../../Documentation/Styling/pass-through.md)\n * for the slot reference.\n *\n * @typeParam TCommand - The command class (proxy generated from C# `[Command]`).\n * @typeParam TResponse - The success payload type returned by the command's `Handle()` method on the backend.\n * @param props - {@link StepperCommandDialogProps}.\n */\nconst StepperCommandDialogComponent = <\n TCommand extends object = object,\n TResponse = object,\n>(\n props: StepperCommandDialogProps<TCommand, TResponse>,\n) => {\n const {\n title,\n headerActions,\n hideGlobalHeaderActions,\n sliceLocation,\n visible,\n width,\n style,\n contentStyle,\n resizable,\n isValid,\n onClose,\n onConfirm,\n onCancel,\n onBeforeExecute,\n confirmBeforeExecute,\n okLabel,\n nextLabel,\n previousLabel,\n showCancel,\n cancelLabel,\n linear,\n orientation,\n headerPosition,\n start,\n end,\n onChangeStep,\n pt,\n ptOptions,\n unstyled,\n dialogClassName,\n dialogPt,\n dialogPtOptions,\n dialogUnstyled,\n children,\n ...commandFormProps\n } = props;\n\n return (\n <CommandForm<TCommand, TResponse> {...commandFormProps}>\n <StepperCommandDialogWrapper<TCommand, TResponse>\n title={title}\n headerActions={headerActions}\n hideGlobalHeaderActions={hideGlobalHeaderActions}\n sliceLocation={sliceLocation}\n visible={visible}\n width={width}\n style={style}\n contentStyle={contentStyle}\n resizable={resizable}\n isValid={isValid}\n onClose={onClose}\n onConfirm={onConfirm}\n onCancel={onCancel}\n onSuccess={props.onSuccess}\n onValidationFailure={props.onValidationFailure}\n onFailed={props.onFailed}\n onException={props.onException}\n onUnauthorized={props.onUnauthorized}\n onBeforeExecute={onBeforeExecute}\n confirmBeforeExecute={confirmBeforeExecute}\n okLabel={okLabel}\n nextLabel={nextLabel}\n previousLabel={previousLabel}\n showCancel={showCancel}\n cancelLabel={cancelLabel}\n linear={linear}\n orientation={orientation}\n headerPosition={headerPosition}\n start={start}\n end={end}\n onChangeStep={onChangeStep}\n pt={pt}\n ptOptions={ptOptions}\n unstyled={unstyled}\n dialogClassName={dialogClassName}\n dialogPt={dialogPt}\n dialogPtOptions={dialogPtOptions}\n dialogUnstyled={dialogUnstyled}\n >\n {children}\n </StepperCommandDialogWrapper>\n </CommandForm>\n );\n};\n\n/**\n * A multi-step wizard dialog backed by a single Cratis Arc command. Wraps\n * the Cratis-owned Stepper inside a Cratis {@link Dialog}, tracks per-step\n * visit state, surfaces inline error indicators on steps with invalid\n * fields, and executes the bound command when the user submits the last\n * step. Use it when one command has enough fields that they should be\n * broken into named stages; for single-stage commands, use\n * {@link CommandDialog}.\n *\n * See {@link StepperCommandDialogComponent} for full documentation.\n *\n * @typeParam TCommand - The command class (proxy generated from C# `[Command]`).\n * @typeParam TResponse - The success payload type returned by the command's `Handle()` method on the backend.\n */\nexport const StepperCommandDialog = StepperCommandDialogComponent;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;AAiKA,MAAM,2BAA2B,GAAG,CAA8C,EAC9E,KAAK,EACL,aAAa,EACb,uBAAuB,EACvB,aAAa,EACb,OAAO,GAAG,IAAI,EACd,KAAK,GAAG,OAAO,EACf,KAAK,EACL,YAAY,EACZ,SAAS,GAAG,KAAK,EACjB,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,OAAO,EACP,SAAS,EACT,aAAa,EACb,UAAU,GAAG,KAAK,EAClB,WAAW,EACX,MAAM,GAAG,IAAI,EACb,WAAW,EACX,cAAc,EACd,KAAK,EACL,GAAG,EACH,YAAY,EACZ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AO,MAAM,aAAa,0NAyEzB,CAAC"}
1
+ {"version":3,"file":"CheckboxField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/CheckboxField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAEH,KAAK,uBAAuB,EAC/B,MAAM,yBAAsB,CAAC;AAI9B,wDAAwD;AACxD,MAAM,WAAW,aAAa;IAC1B,sBAAsB;IACtB,IAAI,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IACxC,6BAA6B;IAC7B,KAAK,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,2BAA2B;IAC3B,GAAG,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;IACtC,gCAAgC;IAChC,SAAS,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;CAC/C;AAKD,UAAU,2BACN,SAAQ,iBAAiB,CAAC,OAAO,CAAC,EAC9B,uBAAuB;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,aAAa,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,sEAAsE;AACtE,eAAO,MAAM,aAAa,0NA0EzB,CAAC"}
@@ -10,7 +10,7 @@ const CheckboxField = asCommandFormField((props) => {
10
10
  });
11
11
  return (jsxs(Fragment, { children: [jsxs("label", { ...props.pt?.root, className: ['cratis-choice-field', props.pt?.root?.className, props.className]
12
12
  .filter(Boolean)
13
- .join(' '), onBlur: props.onBlur, "data-cratis-part": 'root', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-selected": props.value || undefined, children: [jsx("input", { ...props.pt?.input, id: accessibility.controlId, "aria-label": accessibility.ariaLabel, "aria-describedby": accessibility.ariaDescribedBy, type: 'checkbox', checked: props.value, onChange: (event) => props.onChange(event.currentTarget.checked), "aria-invalid": props.invalid || undefined, className: ['cratis-choice-field__native', props.pt?.input?.className]
13
+ .join(' '), onBlur: props.onBlur, "data-cratis-part": 'root', "data-cratis-component": 'CheckboxField', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-selected": props.value || undefined, children: [jsx("input", { ...props.pt?.input, id: accessibility.controlId, "aria-label": accessibility.ariaLabel, "aria-describedby": accessibility.ariaDescribedBy, type: 'checkbox', checked: props.value, onChange: (event) => props.onChange(event.currentTarget.checked), "aria-invalid": props.invalid || undefined, className: ['cratis-choice-field__native', props.pt?.input?.className]
14
14
  .filter(Boolean)
15
15
  .join(' '), "data-cratis-part": 'input', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-selected": props.value || undefined }), jsx("span", { ...props.pt?.box, className: ['cratis-checkbox__box', props.pt?.box?.className]
16
16
  .filter(Boolean)
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxField.js","sources":["../../../../CommandForm/fields/CheckboxField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { HTMLAttributes, InputHTMLAttributes } from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link CheckboxField}. */\nexport interface CheckboxParts {\n /** Wrapping label. */\n root?: HTMLAttributes<HTMLLabelElement>;\n /** Native checkbox input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Visual checkbox box. */\n box?: HTMLAttributes<HTMLSpanElement>;\n /** Visual checked indicator. */\n indicator?: HTMLAttributes<HTMLSpanElement>;\n}\n\nconst checkboxPartsMatchManifest: ExactPartKeys<CheckboxParts, PartsOf<'CheckboxField'>> = true;\nvoid checkboxPartsMatchManifest;\n\ninterface CheckboxFieldComponentProps\n extends WrappedFieldProps<boolean>,\n FieldAccessibilityProps {\n label?: string;\n className?: string;\n pt?: CheckboxParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** A checkbox field bound to a boolean property on an Arc command. */\nexport const CheckboxField = asCommandFormField<CheckboxFieldComponentProps>(\n (props) => {\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'] ?? props.label,\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n return (\n <>\n <label\n {...props.pt?.root}\n className={['cratis-choice-field', props.pt?.root?.className, props.className]\n .filter(Boolean)\n .join(' ')}\n onBlur={props.onBlur}\n data-cratis-part='root'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={props.value || undefined}\n >\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n type='checkbox'\n checked={props.value}\n onChange={(event) => props.onChange(event.currentTarget.checked)}\n aria-invalid={props.invalid || undefined}\n className={['cratis-choice-field__native', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={props.value || undefined}\n />\n <span\n {...props.pt?.box}\n className={['cratis-checkbox__box', props.pt?.box?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='box'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={props.value || undefined}\n aria-hidden='true'\n >\n <span\n {...props.pt?.indicator}\n className={[\n 'cratis-checkbox__indicator',\n props.pt?.indicator?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='indicator'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={props.value || undefined}\n >\n ✓\n </span>\n </span>\n {props.label && (\n <span className='cratis-choice-field__label'>{props.label}</span>\n )}\n </label>\n {accessibility.hiddenError}\n </>\n );\n },\n { defaultValue: false },\n);\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;MAsCa,aAAa,GAAG,kBAAkB,CAC3C,CAAC,KAAK,KAAI;AACN,IAAA,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAC/C,QAAA,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;AACvB,QAAA,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,YAAY,CAAC,IAAI,KAAK,CAAC,KAAK;QACzD,eAAe,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,kBAAkB,CAAC;AACzD,KAAA,CAAC;IACF,QACIA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACJD,IAAA,CAAA,OAAA,EAAA,EAAA,GACQ,KAAK,CAAC,EAAE,EAAE,IAAI,EAClB,SAAS,EAAE,CAAC,qBAAqB,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS;qBACxE,MAAM,CAAC,OAAO;qBACd,IAAI,CAAC,GAAG,CAAC,EACd,MAAM,EAAE,KAAK,CAAC,MAAM,EAAA,kBAAA,EACH,MAAM,mBACR,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,SAAS,EAAA,cAAA,EACvC,KAAK,CAAC,OAAO,IAAI,SAAS,mBACzB,KAAK,CAAC,KAAK,IAAI,SAAS,EAAA,QAAA,EAAA,CAEvCE,GAAA,CAAA,OAAA,EAAA,EAAA,GACQ,KAAK,CAAC,EAAE,EAAE,KAAK,EACnB,EAAE,EAAE,aAAa,CAAC,SAAS,E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C,EAAA,kBAAA,EACG,WAAW,mBACb,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,SAAS,EAAA,cAAA,EACvC,KAAK,CAAC,OAAO,IAAI,SAAS,EAAA,eAAA,EACzB,KAAK,CAAC,KAAK,IAAI,SAAS,EAAA,QAAA,EAAA,QAAA,EAAA,CAGpC,EAAA,CACJ,EACN,KAAK,CAAC,KAAK,KACRA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,4BAA4B,EAAA,QAAA,EAAE,KAAK,CAAC,KAAK,EAAA,CAAQ,CACpE,CAAA,EAAA,CACG,EACC,aAAa,CAAC,WAAW,CAAA,EAAA,CAC3B;AAEX,CAAC,EACD,EAAE,YAAY,EAAE,KAAK,EAAE;;"}
1
+ {"version":3,"file":"CheckboxField.js","sources":["../../../../CommandForm/fields/CheckboxField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { HTMLAttributes, InputHTMLAttributes } from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link CheckboxField}. */\nexport interface CheckboxParts {\n /** Wrapping label. */\n root?: HTMLAttributes<HTMLLabelElement>;\n /** Native checkbox input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Visual checkbox box. */\n box?: HTMLAttributes<HTMLSpanElement>;\n /** Visual checked indicator. */\n indicator?: HTMLAttributes<HTMLSpanElement>;\n}\n\nconst checkboxPartsMatchManifest: ExactPartKeys<CheckboxParts, PartsOf<'CheckboxField'>> = true;\nvoid checkboxPartsMatchManifest;\n\ninterface CheckboxFieldComponentProps\n extends WrappedFieldProps<boolean>,\n FieldAccessibilityProps {\n label?: string;\n className?: string;\n pt?: CheckboxParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** A checkbox field bound to a boolean property on an Arc command. */\nexport const CheckboxField = asCommandFormField<CheckboxFieldComponentProps>(\n (props) => {\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'] ?? props.label,\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n return (\n <>\n <label\n {...props.pt?.root}\n className={['cratis-choice-field', props.pt?.root?.className, props.className]\n .filter(Boolean)\n .join(' ')}\n onBlur={props.onBlur}\n data-cratis-part='root'\n data-cratis-component='CheckboxField'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={props.value || undefined}\n >\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n type='checkbox'\n checked={props.value}\n onChange={(event) => props.onChange(event.currentTarget.checked)}\n aria-invalid={props.invalid || undefined}\n className={['cratis-choice-field__native', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={props.value || undefined}\n />\n <span\n {...props.pt?.box}\n className={['cratis-checkbox__box', props.pt?.box?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='box'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={props.value || undefined}\n aria-hidden='true'\n >\n <span\n {...props.pt?.indicator}\n className={[\n 'cratis-checkbox__indicator',\n props.pt?.indicator?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='indicator'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={props.value || undefined}\n >\n ✓\n </span>\n </span>\n {props.label && (\n <span className='cratis-choice-field__label'>{props.label}</span>\n )}\n </label>\n {accessibility.hiddenError}\n </>\n );\n },\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e,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAmHD,wEAAwE;AACxE,eAAO,MAAM,UAAU,uNAErB,CAAC"}
@@ -33,7 +33,7 @@ const ChipsControl = (props) => {
33
33
  props.onBlur?.();
34
34
  if (props.addOnBlur && !event.currentTarget.contains(event.relatedTarget))
35
35
  commit();
36
- }, "data-cratis-part": 'root', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-readonly": props.pt?.input?.readOnly || undefined, children: [props.value.map((item, index) => (jsxs("span", { ...props.pt?.item, className: ['cratis-chips-field__item', props.pt?.item?.className]
36
+ }, "data-cratis-part": 'root', "data-cratis-component": 'ChipsField', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-readonly": props.pt?.input?.readOnly || undefined, children: [props.value.map((item, index) => (jsxs("span", { ...props.pt?.item, className: ['cratis-chips-field__item', props.pt?.item?.className]
37
37
  .filter(Boolean)
38
38
  .join(' '), "data-cratis-part": 'item', "data-selected": true, children: [jsx("span", { children: item }), jsx("button", { ...props.pt?.remove, type: 'button', className: [
39
39
  'cratis-chips-field__remove',
@@ -1 +1 @@
1
- {"version":3,"file":"ChipsField.js","sources":["../../../../CommandForm/fields/ChipsField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState, type HTMLAttributes, type InputHTMLAttributes } from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport { appendChipCandidates } from './chipValues';\nimport { useCratisIcon } from '../../configuration/useCratisIcon';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link ChipsField}. */\nexport interface ChipsParts {\n /** Field wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** One selected chip. */\n item?: HTMLAttributes<HTMLSpanElement>;\n /** Chip removal button. */\n remove?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n /** Native draft-value input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n}\n\nconst chipsPartsMatchManifest: ExactPartKeys<ChipsParts, PartsOf<'ChipsField'>> = true;\nvoid chipsPartsMatchManifest;\n\ninterface ChipsFieldComponentProps\n extends WrappedFieldProps<string[]>, FieldAccessibilityProps {\n placeholder?: string;\n max?: number;\n separator?: string;\n addOnBlur?: boolean;\n allowDuplicate?: boolean;\n /** Builds a remove-button label, or supplies one shared localized label. */\n removeAriaLabel?: string | ((item: string, index: number) => string);\n className?: string;\n pt?: ChipsParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\nconst ChipsControl = (props: ChipsFieldComponentProps) => {\n const [draft, setDraft] = useState('');\n const icon = useCratisIcon();\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'],\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n\n const commit = () => {\n const candidates = (props.separator ? draft.split(props.separator) : [draft])\n .map((value) => value.trim())\n .filter(Boolean);\n if (candidates.length === 0) return;\n props.onChange(\n appendChipCandidates(\n props.value,\n candidates,\n props.max,\n props.allowDuplicate ?? false,\n ),\n );\n setDraft('');\n };\n\n return (\n <div\n {...props.pt?.root}\n className={[\n 'cratis-chips-field',\n 'cratis:w-full',\n props.pt?.root?.className,\n props.className,\n ]\n .filter(Boolean)\n .join(' ')}\n onBlur={(event) => {\n props.onBlur?.();\n if (props.addOnBlur && !event.currentTarget.contains(event.relatedTarget))\n commit();\n }}\n data-cratis-part='root'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n >\n {props.value.map((item, index) => (\n <span\n key={`${item}-${index}`}\n {...props.pt?.item}\n className={['cratis-chips-field__item', props.pt?.item?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='item'\n data-selected\n >\n <span>{item}</span>\n <button\n {...props.pt?.remove}\n type='button'\n className={[\n 'cratis-chips-field__remove',\n props.pt?.remove?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='remove'\n data-disabled={props.pt?.remove?.disabled || undefined}\n data-selected\n aria-label={\n typeof props.removeAriaLabel === 'function'\n ? props.removeAriaLabel(item, index)\n : (props.removeAriaLabel ?? `Remove ${item}`)\n }\n onClick={() =>\n props.onChange(\n props.value.filter((_, itemIndex) => itemIndex !== index),\n )\n }\n >\n {icon('remove', '×')}\n </button>\n </span>\n ))}\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n commit();\n }\n }}\n placeholder={props.placeholder}\n aria-invalid={props.invalid || undefined}\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n className={['cratis-chips-field__input', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n />\n {accessibility.hiddenError}\n </div>\n );\n};\n\n/** A token input bound to a string array property on an Arc command. */\nexport const ChipsField = asCommandFormField<ChipsFieldComponentProps>(ChipsControl, {\n defaultValue: [],\n});\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AA4CA,MAAM,YAAY,GAAG,CAAC,KAA+B,KAAI;IACrD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ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CAAC,WAAW,CAAA,EAAA,CACxB;AAEd,CAAC;AAGM,MAAM,UAAU,GAAG,kBAAkB,CAA2B,YAAY,EAAE;AACjF,IAAA,YAAY,EAAE,EAAE;AACnB,CAAA;;"}
1
+ {"version":3,"file":"ChipsField.js","sources":["../../../../CommandForm/fields/ChipsField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { useState, type HTMLAttributes, type InputHTMLAttributes } from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport { appendChipCandidates } from './chipValues';\nimport { useCratisIcon } from '../../configuration/useCratisIcon';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link ChipsField}. */\nexport interface ChipsParts {\n /** Field wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** One selected chip. */\n item?: HTMLAttributes<HTMLSpanElement>;\n /** Chip removal button. */\n remove?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n /** Native draft-value input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n}\n\nconst chipsPartsMatchManifest: ExactPartKeys<ChipsParts, PartsOf<'ChipsField'>> = true;\nvoid chipsPartsMatchManifest;\n\ninterface ChipsFieldComponentProps\n extends WrappedFieldProps<string[]>, FieldAccessibilityProps {\n placeholder?: string;\n max?: number;\n separator?: string;\n addOnBlur?: boolean;\n allowDuplicate?: boolean;\n /** Builds a remove-button label, or supplies one shared localized label. */\n removeAriaLabel?: string | ((item: string, index: number) => string);\n className?: string;\n pt?: ChipsParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\nconst ChipsControl = (props: ChipsFieldComponentProps) => {\n const [draft, setDraft] = useState('');\n const icon = useCratisIcon();\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'],\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n\n const commit = () => {\n const candidates = (props.separator ? draft.split(props.separator) : [draft])\n .map((value) => value.trim())\n .filter(Boolean);\n if (candidates.length === 0) return;\n props.onChange(\n appendChipCandidates(\n props.value,\n candidates,\n props.max,\n props.allowDuplicate ?? false,\n ),\n );\n setDraft('');\n };\n\n return (\n <div\n {...props.pt?.root}\n className={[\n 'cratis-chips-field',\n 'cratis:w-full',\n props.pt?.root?.className,\n props.className,\n ]\n .filter(Boolean)\n .join(' ')}\n onBlur={(event) => {\n props.onBlur?.();\n if (props.addOnBlur && !event.currentTarget.contains(event.relatedTarget))\n commit();\n }}\n data-cratis-part='root'\n data-cratis-component='ChipsField'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n >\n {props.value.map((item, index) => (\n <span\n key={`${item}-${index}`}\n {...props.pt?.item}\n className={['cratis-chips-field__item', props.pt?.item?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='item'\n data-selected\n >\n <span>{item}</span>\n <button\n {...props.pt?.remove}\n type='button'\n className={[\n 'cratis-chips-field__remove',\n props.pt?.remove?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='remove'\n data-disabled={props.pt?.remove?.disabled || undefined}\n data-selected\n aria-label={\n typeof props.removeAriaLabel === 'function'\n ? props.removeAriaLabel(item, index)\n : (props.removeAriaLabel ?? `Remove ${item}`)\n }\n onClick={() =>\n props.onChange(\n props.value.filter((_, itemIndex) => itemIndex !== index),\n )\n }\n >\n {icon('remove', '×')}\n </button>\n </span>\n ))}\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n value={draft}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n commit();\n }\n }}\n placeholder={props.placeholder}\n aria-invalid={props.invalid || undefined}\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n className={['cratis-chips-field__input', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n />\n {accessibility.hiddenError}\n </div>\n );\n};\n\n/** A token input bound to a string array property on an Arc command. */\nexport const ChipsField = asCommandFormField<ChipsFieldComponentProps>(ChipsControl, {\n defaultValue: [],\n});\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;AA4CA,MAAM,YAAY,GAAG,CAAC,KAA+B,KAAI;IACrD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC;AACtC,IAAA,MAAM,IAAI,GAAG,aAAa,EAAE;AAC5B,IAAA,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAC/C,QAAA,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,YAAY,CAAC;QAC1C,eAAe,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,kBAAkB,CAAC;AACzD,KAAA,CAAC;IAEF,MAAM,MAAM,GAAG,MAAK;QAChB,MAAM,UAAU,GAAG,CAAC,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC;aACvE,GAAG,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,IAAI,EAAE;aAC3B,MAAM,CAAC,OAAO,CAAC;AACpB,QAAA,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;YAAE;QAC7B,KAAK,CAAC,QAAQ,CACV,oBAAoB,CAChB,KAAK,CAAC,KAAK,EACX,UAAU,EACV,KAAK,CAAC,GAAG,EACT,KAAK,CAAC,cAAc,IAAI,KAAK,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16,7 +16,7 @@ const ColorPickerField = asCommandFormField((props) => {
16
16
  props.className,
17
17
  ]
18
18
  .filter(Boolean)
19
- .join(' '), onBlur: props.onBlur, "data-cratis-part": 'root', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-inline": props.inline || undefined, children: [jsx("input", { ...props.pt?.input, id: accessibility.controlId, "aria-label": accessibility.ariaLabel, "aria-describedby": accessibility.ariaDescribedBy, type: 'color', value: `#${value}`, onChange: (event) => props.onChange(event.currentTarget.value.replace('#', '')), "aria-invalid": props.invalid || undefined, "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, className: ['cratis-color-field__input', props.pt?.input?.className]
19
+ .join(' '), onBlur: props.onBlur, "data-cratis-part": 'root', "data-cratis-component": 'ColorPickerField', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-inline": props.inline || undefined, children: [jsx("input", { ...props.pt?.input, id: accessibility.controlId, "aria-label": accessibility.ariaLabel, "aria-describedby": accessibility.ariaDescribedBy, type: 'color', value: `#${value}`, onChange: (event) => props.onChange(event.currentTarget.value.replace('#', '')), "aria-invalid": props.invalid || undefined, "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, className: ['cratis-color-field__input', props.pt?.input?.className]
20
20
  .filter(Boolean)
21
21
  .join(' '), "data-cratis-part": 'input' }), jsxs("output", { ...props.pt?.value, className: ['cratis-color-field__value', props.pt?.value?.className]
22
22
  .filter(Boolean)
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPickerField.js","sources":["../../../../CommandForm/fields/ColorPickerField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { HTMLAttributes, InputHTMLAttributes } from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link ColorPickerField}. */\nexport interface ColorPickerParts {\n /** Field wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** Native color input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Selected hexadecimal value output. */\n value?: HTMLAttributes<HTMLOutputElement>;\n}\n\nconst colorPickerPartsMatchManifest: ExactPartKeys<ColorPickerParts, PartsOf<'ColorPickerField'>> = true;\nvoid colorPickerPartsMatchManifest;\n\ninterface ColorPickerFieldComponentProps\n extends WrappedFieldProps<string>,\n FieldAccessibilityProps {\n inline?: boolean;\n defaultColor?: string;\n className?: string;\n pt?: ColorPickerParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\nconst normalizeHex = (value: string, fallback: string) =>\n /^[0-9a-f]{6}$/i.test(value) ? value : fallback;\n\n/** A native color picker bound to a bare six-digit hex string on an Arc command. */\nexport const ColorPickerField = asCommandFormField<ColorPickerFieldComponentProps>(\n (props) => {\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'],\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n const value = normalizeHex(\n props.value,\n normalizeHex(props.defaultColor ?? '000000', '000000'),\n );\n return (\n <div\n {...props.pt?.root}\n className={[\n 'cratis-color-field',\n props.pt?.root?.className,\n props.className,\n ]\n .filter(Boolean)\n .join(' ')}\n onBlur={props.onBlur}\n data-cratis-part='root'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-inline={props.inline || undefined}\n >\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n type='color'\n value={`#${value}`}\n onChange={(event) => props.onChange(event.currentTarget.value.replace('#', ''))}\n aria-invalid={props.invalid || undefined}\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n className={['cratis-color-field__input', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n />\n <output\n {...props.pt?.value}\n className={['cratis-color-field__value', props.pt?.value?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='value'\n data-invalid={props.invalid || undefined}\n >\n #{value}\n </output>\n {accessibility.hiddenError}\n </div>\n );\n },\n { defaultValue: '' },\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AAoCA,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,QAAgB,KACjD,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,QAAQ;MAGtC,gBAAgB,GAAG,kBAAkB,CAC9C,CAAC,KAAK,KAAI;AACN,IAAA,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAC/C,QAAA,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,YAAY,CAAC;QAC1C,eAAe,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,kBAAkB,CAAC;AACzD,KAAA,CAAC;AACF,IAAA,MAAM,KAAK,GAAG,YAAY,CACtB,KAAK,CAAC,KAAK,EACX,YAAY,CAAC,KAAK,CAAC,YAAY,IAAI,QAAQ,EAAE,QAAQ,CAAC,CACzD;IACD,QACIA,iBACQ,KAAK,CAAC,EAAE,EAAE,IAAI,EAClB,SAAS,EAAE;YACP,oBAAoB;AACpB,YAAA,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS;AACzB,YAAA,KAAK,CAAC,SAAS;AAClB;aACI,MAAM,CAAC,OAAO;AACd,aAAA,IAAI,CAAC,GAAG,CAAC,EACd,MAAM,EAAE,KAAK,CAAC,MAAM,EAAA,kBAAA,EACH,MAAM,EAAA,eAAA,EACR,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,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CACxB;AAEd,CAAC,EACD,EAAE,YAAY,EAAE,EAAE,EAAE;;"}
1
+ {"version":3,"file":"ColorPickerField.js","sources":["../../../../CommandForm/fields/ColorPickerField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { HTMLAttributes, InputHTMLAttributes } from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link ColorPickerField}. */\nexport interface ColorPickerParts {\n /** Field wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** Native color input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Selected hexadecimal value output. */\n value?: HTMLAttributes<HTMLOutputElement>;\n}\n\nconst colorPickerPartsMatchManifest: ExactPartKeys<ColorPickerParts, PartsOf<'ColorPickerField'>> = true;\nvoid colorPickerPartsMatchManifest;\n\ninterface ColorPickerFieldComponentProps\n extends WrappedFieldProps<string>,\n FieldAccessibilityProps {\n inline?: boolean;\n defaultColor?: string;\n className?: string;\n pt?: ColorPickerParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\nconst normalizeHex = (value: string, fallback: string) =>\n /^[0-9a-f]{6}$/i.test(value) ? value : fallback;\n\n/** A native color picker bound to a bare six-digit hex string on an Arc command. */\nexport const ColorPickerField = asCommandFormField<ColorPickerFieldComponentProps>(\n (props) => {\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'],\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n const value = normalizeHex(\n props.value,\n normalizeHex(props.defaultColor ?? '000000', '000000'),\n );\n return (\n <div\n {...props.pt?.root}\n className={[\n 'cratis-color-field',\n props.pt?.root?.className,\n props.className,\n ]\n .filter(Boolean)\n .join(' ')}\n onBlur={props.onBlur}\n data-cratis-part='root'\n data-cratis-component='ColorPickerField'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-inline={props.inline || undefined}\n >\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n type='color'\n value={`#${value}`}\n onChange={(event) => props.onChange(event.currentTarget.value.replace('#', ''))}\n aria-invalid={props.invalid || undefined}\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n className={['cratis-color-field__input', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n />\n <output\n {...props.pt?.value}\n className={['cratis-color-field__value', props.pt?.value?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='value'\n data-invalid={props.invalid || undefined}\n >\n #{value}\n </output>\n {accessibility.hiddenError}\n </div>\n );\n },\n { defaultValue: '' },\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AAoCA,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,QAAgB,KACjD,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,QAAQ;MAGtC,gBAAgB,GAAG,kBAAkB,CAC9C,CAAC,KAAK,KAAI;AACN,IAAA,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAC/C,QAAA,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,YAAY,CAAC;QAC1C,eAAe,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,kBAAkB,CAAC;AACzD,KAAA,CAAC;AACF,IAAA,MAAM,KAAK,GAAG,YAAY,CACtB,KAAK,CAAC,KAAK,EACX,YAAY,CAAC,KAAK,CAAC,YAAY,IAAI,QAAQ,EAAE,QAAQ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,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,oEAAoE;AACpE,eAAO,MAAM,WAAW,wNAwDvB,CAAC"}
1
+ {"version":3,"file":"NumberField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/NumberField.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAEH,KAAK,uBAAuB,EAC/B,MAAM,yBAAsB,CAAC;AAI9B,sDAAsD;AACtD,MAAM,WAAW,gBAAgB;IAC7B,qBAAqB;IACrB,IAAI,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IACtC,2BAA2B;IAC3B,KAAK,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;CACjD;AAKD,UAAU,yBACN,SAAQ,iBAAiB,CAAC,MAAM,CAAC,EAC7B,uBAAuB;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,gBAAgB,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,oEAAoE;AACpE,eAAO,MAAM,WAAW,wNAyDvB,CAAC"}
@@ -8,7 +8,7 @@ const NumberField = asCommandFormField((props) => {
8
8
  ariaLabel: props.pt?.input?.['aria-label'],
9
9
  ariaDescribedBy: props.pt?.input?.['aria-describedby'],
10
10
  });
11
- return (jsxs("div", { ...props.pt?.root, onBlur: props.onBlur, "data-cratis-part": 'root', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-readonly": props.pt?.input?.readOnly || undefined, className: [
11
+ return (jsxs("div", { ...props.pt?.root, onBlur: props.onBlur, "data-cratis-part": 'root', "data-cratis-component": 'NumberField', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-readonly": props.pt?.input?.readOnly || undefined, className: [
12
12
  'cratis-number-field',
13
13
  'cratis:w-full',
14
14
  props.pt?.root?.className,
@@ -1 +1 @@
1
- {"version":3,"file":"NumberField.js","sources":["../../../../CommandForm/fields/NumberField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { HTMLAttributes, InputHTMLAttributes } from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link NumberField}. */\nexport interface NumberFieldParts {\n /** Field wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** Native number input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n}\n\nconst numberFieldPartsMatchManifest: ExactPartKeys<NumberFieldParts, PartsOf<'NumberField'>> = true;\nvoid numberFieldPartsMatchManifest;\n\ninterface NumberFieldComponentProps\n extends WrappedFieldProps<number>,\n FieldAccessibilityProps {\n placeholder?: string;\n min?: number;\n max?: number;\n step?: number;\n className?: string;\n pt?: NumberFieldParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** A numeric field bound to a number property on an Arc command. */\nexport const NumberField = asCommandFormField<NumberFieldComponentProps>(\n (props) => {\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'],\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n return (\n <div\n {...props.pt?.root}\n onBlur={props.onBlur}\n data-cratis-part='root'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n className={[\n 'cratis-number-field',\n 'cratis:w-full',\n props.pt?.root?.className,\n props.className,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n type='number'\n value={props.value}\n onChange={(event) =>\n props.onChange(\n Number.isNaN(event.currentTarget.valueAsNumber)\n ? 0\n : event.currentTarget.valueAsNumber,\n )\n }\n placeholder={props.placeholder}\n min={props.min}\n max={props.max}\n step={props.step}\n aria-invalid={props.invalid || undefined}\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n data-cratis-part='input'\n className={['cratis-field-input', 'cratis:w-full', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n />\n {accessibility.hiddenError}\n </div>\n );\n },\n { defaultValue: 0 },\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;MAqCa,WAAW,GAAG,kBAAkB,CACzC,CAAC,KAAK,KAAI;AACN,IAAA,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAC/C,QAAA,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,YAAY,CAAC;QAC1C,eAAe,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,kBAAkB,CAAC;AACzD,KAAA,CAAC;AACF,IAAA,QACAA,IAAA,CAAA,KAAA,EAAA,EAAA,GACQ,KAAK,CAAC,EAAE,EAAE,IAAI,EAClB,MAAM,EAAE,KAAK,CAAC,MAAM,EAAA,kBAAA,EACH,MAAM,mBACR,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,SAAS,EAAA,cAAA,E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C,GAAG,CAAC,EAAA,CAChB,EACD,aAAa,CAAC,WAAW,CAAA,EAAA,CACxB;AAEV,CAAC,EACD,EAAE,YAAY,EAAE,CAAC,EAAE;;"}
1
+ {"version":3,"file":"NumberField.js","sources":["../../../../CommandForm/fields/NumberField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { HTMLAttributes, InputHTMLAttributes } from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link NumberField}. */\nexport interface NumberFieldParts {\n /** Field wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** Native number input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n}\n\nconst numberFieldPartsMatchManifest: ExactPartKeys<NumberFieldParts, PartsOf<'NumberField'>> = true;\nvoid numberFieldPartsMatchManifest;\n\ninterface NumberFieldComponentProps\n extends WrappedFieldProps<number>,\n FieldAccessibilityProps {\n placeholder?: string;\n min?: number;\n max?: number;\n step?: number;\n className?: string;\n pt?: NumberFieldParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** A numeric field bound to a number property on an Arc command. */\nexport const NumberField = asCommandFormField<NumberFieldComponentProps>(\n (props) => {\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'],\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n return (\n <div\n {...props.pt?.root}\n onBlur={props.onBlur}\n data-cratis-part='root'\n data-cratis-component='NumberField'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n className={[\n 'cratis-number-field',\n 'cratis:w-full',\n props.pt?.root?.className,\n props.className,\n ]\n .filter(Boolean)\n .join(' ')}\n >\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n type='number'\n value={props.value}\n onChange={(event) =>\n props.onChange(\n Number.isNaN(event.currentTarget.valueAsNumber)\n ? 0\n : event.currentTarget.valueAsNumber,\n )\n }\n placeholder={props.placeholder}\n min={props.min}\n max={props.max}\n step={props.step}\n aria-invalid={props.invalid || undefined}\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n data-cratis-part='input'\n className={['cratis-field-input', 'cratis:w-full', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n />\n {accessibility.hiddenError}\n </div>\n );\n },\n { defaultValue: 0 },\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;MAqCa,WAAW,GAAG,kBAAkB,CACzC,CAAC,KAAK,KAAI;AACN,IAAA,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAC/C,QAAA,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,YAAY,CAAC;QAC1C,eAAe,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,kBAAkB,CAAC;AACzD,KAAA,CAAC;IACF,QACAA,iBACQ,KAAK,CAAC,EAAE,EAAE,IAAI,EAClB,MAAM,EAAE,KAAK,CAAC,MAAM,sBACH,MAAM,EAAA,uBAAA,EACD,aAAa,EAAA,eAAA,EACpB,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,SAAS,EAAA,cAAA,EACvC,KAAK,CAAC,OAAO,IAAI,SAAS,EAAA,eAAA,EACzB,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,SAAS,EACrD,SAAS,EAAE;YACP,qBAAqB;YACrB,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file":"PasswordField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/PasswordField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEH,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EAC3B,MAAM,OAAO,CAAC;AACf,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAEH,KAAK,uBAAuB,EAC/B,MAAM,yBAAsB,CAAC;AAI9B,wDAAwD;AACxD,MAAM,WAAW,aAAa;IAC1B,qBAAqB;IACrB,IAAI,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IACtC,kCAAkC;IAClC,KAAK,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,gCAAgC;IAChC,MAAM,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;CACpD;AAKD,UAAU,2BACN,SAAQ,iBAAiB,CAAC,MAAM,CAAC,EAC7B,uBAAuB;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,aAAa,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAkED,4EAA4E;AAC5E,eAAO,MAAM,aAAa,0NAGzB,CAAC"}
1
+ {"version":3,"file":"PasswordField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/PasswordField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEH,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EAC3B,MAAM,OAAO,CAAC;AACf,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAEH,KAAK,uBAAuB,EAC/B,MAAM,yBAAsB,CAAC;AAI9B,wDAAwD;AACxD,MAAM,WAAW,aAAa;IAC1B,qBAAqB;IACrB,IAAI,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IACtC,kCAAkC;IAClC,KAAK,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,gCAAgC;IAChC,MAAM,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;CACpD;AAKD,UAAU,2BACN,SAAQ,iBAAiB,CAAC,MAAM,CAAC,EAC7B,uBAAuB;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,aAAa,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAmED,4EAA4E;AAC5E,eAAO,MAAM,aAAa,0NAGzB,CAAC"}
@@ -17,7 +17,7 @@ const PasswordControl = (props) => {
17
17
  props.className,
18
18
  ]
19
19
  .filter(Boolean)
20
- .join(' '), "data-cratis-part": 'root', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-readonly": props.pt?.input?.readOnly || undefined, children: [jsx("input", { ...props.pt?.input, id: accessibility.controlId, "aria-label": accessibility.ariaLabel, "aria-describedby": accessibility.ariaDescribedBy, type: visible ? 'text' : 'password', value: props.value, onChange: (event) => props.onChange(event.currentTarget.value), placeholder: props.placeholder, "aria-invalid": props.invalid || undefined, "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-readonly": props.pt?.input?.readOnly || undefined, className: ['cratis-field-input', 'cratis:w-full', props.pt?.input?.className]
20
+ .join(' '), "data-cratis-part": 'root', "data-cratis-component": 'PasswordField', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-readonly": props.pt?.input?.readOnly || undefined, children: [jsx("input", { ...props.pt?.input, id: accessibility.controlId, "aria-label": accessibility.ariaLabel, "aria-describedby": accessibility.ariaDescribedBy, type: visible ? 'text' : 'password', value: props.value, onChange: (event) => props.onChange(event.currentTarget.value), placeholder: props.placeholder, "aria-invalid": props.invalid || undefined, "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-readonly": props.pt?.input?.readOnly || undefined, className: ['cratis-field-input', 'cratis:w-full', props.pt?.input?.className]
21
21
  .filter(Boolean)
22
22
  .join(' '), "data-cratis-part": 'input' }), jsx("button", { ...props.pt?.toggle, type: 'button', className: ['cratis-password-field__toggle', props.pt?.toggle?.className]
23
23
  .filter(Boolean)
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordField.js","sources":["../../../../CommandForm/fields/PasswordField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport {\n useState,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type InputHTMLAttributes,\n} from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link PasswordField}. */\nexport interface PasswordParts {\n /** Field wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** Native password/text input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Visibility toggle button. */\n toggle?: ButtonHTMLAttributes<HTMLButtonElement>;\n}\n\nconst passwordPartsMatchManifest: ExactPartKeys<PasswordParts, PartsOf<'PasswordField'>> = true;\nvoid passwordPartsMatchManifest;\n\ninterface PasswordFieldComponentProps\n extends WrappedFieldProps<string>,\n FieldAccessibilityProps {\n placeholder?: string;\n className?: string;\n pt?: PasswordParts;\n ptOptions?: object;\n unstyled?: boolean;\n showLabel?: string;\n hideLabel?: string;\n}\n\nconst PasswordControl = (props: PasswordFieldComponentProps) => {\n const [visible, setVisible] = useState(false);\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'],\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n return (\n <div\n {...props.pt?.root}\n onBlur={props.onBlur}\n className={[\n 'cratis-password-field',\n 'cratis:w-full',\n props.pt?.root?.className,\n props.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='root'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n >\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n type={visible ? 'text' : 'password'}\n value={props.value}\n onChange={(event) => props.onChange(event.currentTarget.value)}\n placeholder={props.placeholder}\n aria-invalid={props.invalid || undefined}\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n className={['cratis-field-input', 'cratis:w-full', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n />\n <button\n {...props.pt?.toggle}\n type='button'\n className={['cratis-password-field__toggle', props.pt?.toggle?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='toggle'\n data-disabled={props.pt?.toggle?.disabled || undefined}\n aria-label={\n visible\n ? (props.hideLabel ?? 'Hide password')\n : (props.showLabel ?? 'Show password')\n }\n onClick={() => setVisible((current) => !current)}\n >\n <span aria-hidden='true'>{visible ? '◉' : '○'}</span>\n </button>\n {accessibility.hiddenError}\n </div>\n );\n};\n\n/** A masked password field bound to a string property on an Arc command. */\nexport const PasswordField = asCommandFormField<PasswordFieldComponentProps>(\n PasswordControl,\n { defaultValue: '' },\n);\n"],"names":["_jsxs","_jsx"],"m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YAAY,EAAE,EAAE,EAAE;;"}
1
+ {"version":3,"file":"PasswordField.js","sources":["../../../../CommandForm/fields/PasswordField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport {\n useState,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type InputHTMLAttributes,\n} from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link PasswordField}. */\nexport interface PasswordParts {\n /** Field wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** Native password/text input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Visibility toggle button. */\n toggle?: ButtonHTMLAttributes<HTMLButtonElement>;\n}\n\nconst passwordPartsMatchManifest: ExactPartKeys<PasswordParts, PartsOf<'PasswordField'>> = true;\nvoid passwordPartsMatchManifest;\n\ninterface PasswordFieldComponentProps\n extends WrappedFieldProps<string>,\n FieldAccessibilityProps {\n placeholder?: string;\n className?: string;\n pt?: PasswordParts;\n ptOptions?: object;\n unstyled?: boolean;\n showLabel?: string;\n hideLabel?: string;\n}\n\nconst PasswordControl = (props: PasswordFieldComponentProps) => {\n const [visible, setVisible] = useState(false);\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'],\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n return (\n <div\n {...props.pt?.root}\n onBlur={props.onBlur}\n className={[\n 'cratis-password-field',\n 'cratis:w-full',\n props.pt?.root?.className,\n props.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='root'\n data-cratis-component='PasswordField'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n >\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n type={visible ? 'text' : 'password'}\n value={props.value}\n onChange={(event) => props.onChange(event.currentTarget.value)}\n placeholder={props.placeholder}\n aria-invalid={props.invalid || undefined}\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-readonly={props.pt?.input?.readOnly || undefined}\n className={['cratis-field-input', 'cratis:w-full', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n />\n <button\n {...props.pt?.toggle}\n type='button'\n className={['cratis-password-field__toggle', props.pt?.toggle?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='toggle'\n data-disabled={props.pt?.toggle?.disabled || undefined}\n aria-label={\n visible\n ? (props.hideLabel ?? 'Hide password')\n : (props.showLabel ?? 'Show password')\n }\n onClick={() => setVisible((current) => !current)}\n >\n <span aria-hidden='true'>{visible ? '◉' : '○'}</span>\n </button>\n {accessibility.hiddenError}\n </div>\n );\n};\n\n/** A masked password field bound to a string property on an Arc command. */\nexport const PasswordField = asCommandFormField<PasswordFieldComponentProps>(\n PasswordControl,\n { defaultValue: '' },\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;AA0CA,MAAM,eAAe,GAAG,CAAC,KAAkC,KAAI;IAC3D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;AAC7C,IAAA,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAC/C,QAAA,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;QACvB,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,YAAY,CAAC;QAC1C,eAAe,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,kBAAkB,CAAC;AACzD,KAAA,CAAC;AACF,IAAA,QACIA,IAA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;IACtC,iCAAiC;IACjC,SAAS,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;CAC/C;AAKD,UAAU,8BACN,SAAQ,iBAAiB,CAAC,MAAM,GAAG,MAAM,CAAC,EACtC,uBAAuB;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,6NAyE5B,CAAC"}
@@ -11,7 +11,7 @@ const RadioButtonField = asCommandFormField((props) => {
11
11
  const selected = props.value === props.buttonValue;
12
12
  return (jsxs(Fragment, { children: [jsxs("label", { ...props.pt?.root, className: ['cratis-choice-field', props.pt?.root?.className, props.className]
13
13
  .filter(Boolean)
14
- .join(' '), onBlur: props.onBlur, "data-cratis-part": 'root', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-selected": selected || undefined, children: [jsx("input", { ...props.pt?.input, id: accessibility.controlId, "aria-label": accessibility.ariaLabel, "aria-describedby": accessibility.ariaDescribedBy, type: 'radio', name: props.name, checked: selected, onChange: (event) => {
14
+ .join(' '), onBlur: props.onBlur, "data-cratis-part": 'root', "data-cratis-component": 'RadioButtonField', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, "data-selected": selected || undefined, children: [jsx("input", { ...props.pt?.input, id: accessibility.controlId, "aria-label": accessibility.ariaLabel, "aria-describedby": accessibility.ariaDescribedBy, type: 'radio', name: props.name, checked: selected, onChange: (event) => {
15
15
  if (event.currentTarget.checked)
16
16
  props.onChange(props.buttonValue);
17
17
  }, "aria-invalid": props.invalid || undefined, className: ['cratis-choice-field__native', props.pt?.input?.className]
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButtonField.js","sources":["../../../../CommandForm/fields/RadioButtonField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { HTMLAttributes, InputHTMLAttributes } from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link RadioButtonField}. */\nexport interface RadioParts {\n /** Wrapping option label. */\n root?: HTMLAttributes<HTMLLabelElement>;\n /** Native radio input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Visual radio box. */\n box?: HTMLAttributes<HTMLSpanElement>;\n /** Visual selected indicator. */\n indicator?: HTMLAttributes<HTMLSpanElement>;\n}\n\nconst radioPartsMatchManifest: ExactPartKeys<RadioParts, PartsOf<'RadioButtonField'>> = true;\nvoid radioPartsMatchManifest;\n\ninterface RadioButtonFieldComponentProps\n extends WrappedFieldProps<string | number>,\n FieldAccessibilityProps {\n label?: string;\n buttonValue: string | number;\n /** Native group name shared by every option bound to the same property. */\n name: string;\n className?: string;\n pt?: RadioParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** A single radio option bound to a string or number property on an Arc command. */\nexport const RadioButtonField = asCommandFormField<RadioButtonFieldComponentProps>(\n (props) => {\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'] ?? props.label,\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n const selected = props.value === props.buttonValue;\n return (\n <>\n <label\n {...props.pt?.root}\n className={['cratis-choice-field', props.pt?.root?.className, props.className]\n .filter(Boolean)\n .join(' ')}\n onBlur={props.onBlur}\n data-cratis-part='root'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={selected || undefined}\n >\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n type='radio'\n name={props.name}\n checked={selected}\n onChange={(event) => {\n if (event.currentTarget.checked) props.onChange(props.buttonValue);\n }}\n aria-invalid={props.invalid || undefined}\n className={['cratis-choice-field__native', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={selected || undefined}\n />\n <span\n {...props.pt?.box}\n className={['cratis-radio__box', props.pt?.box?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='box'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={selected || undefined}\n aria-hidden='true'\n >\n <span\n {...props.pt?.indicator}\n className={['cratis-radio__indicator', props.pt?.indicator?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='indicator'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={selected || undefined}\n />\n </span>\n {props.label && (\n <span className='cratis-choice-field__label'>{props.label}</span>\n )}\n </label>\n {accessibility.hiddenError}\n </>\n );\n },\n { defaultValue: '' },\n);\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;MAyCa,gBAAgB,GAAG,kBAAkB,CAC9C,CAAC,KAAK,KAAI;AACN,IAAA,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAC/C,QAAA,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;AACvB,QAAA,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,YAAY,CAAC,IAAI,KAAK,CAAC,KAAK;QACzD,eAAe,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,kBAAkB,CAAC;AACzD,KAAA,CAA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"}
1
+ {"version":3,"file":"RadioButtonField.js","sources":["../../../../CommandForm/fields/RadioButtonField.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport type { HTMLAttributes, InputHTMLAttributes } from 'react';\nimport { asCommandFormField, type WrappedFieldProps } from '@cratis/arc.react/commands';\nimport {\n useFieldAccessibility,\n type FieldAccessibilityProps,\n} from './fieldAccessibility';\nimport type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link RadioButtonField}. */\nexport interface RadioParts {\n /** Wrapping option label. */\n root?: HTMLAttributes<HTMLLabelElement>;\n /** Native radio input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Visual radio box. */\n box?: HTMLAttributes<HTMLSpanElement>;\n /** Visual selected indicator. */\n indicator?: HTMLAttributes<HTMLSpanElement>;\n}\n\nconst radioPartsMatchManifest: ExactPartKeys<RadioParts, PartsOf<'RadioButtonField'>> = true;\nvoid radioPartsMatchManifest;\n\ninterface RadioButtonFieldComponentProps\n extends WrappedFieldProps<string | number>,\n FieldAccessibilityProps {\n label?: string;\n buttonValue: string | number;\n /** Native group name shared by every option bound to the same property. */\n name: string;\n className?: string;\n pt?: RadioParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** A single radio option bound to a string or number property on an Arc command. */\nexport const RadioButtonField = asCommandFormField<RadioButtonFieldComponentProps>(\n (props) => {\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.input?.id,\n ariaLabel: props.pt?.input?.['aria-label'] ?? props.label,\n ariaDescribedBy: props.pt?.input?.['aria-describedby'],\n });\n const selected = props.value === props.buttonValue;\n return (\n <>\n <label\n {...props.pt?.root}\n className={['cratis-choice-field', props.pt?.root?.className, props.className]\n .filter(Boolean)\n .join(' ')}\n onBlur={props.onBlur}\n data-cratis-part='root'\n data-cratis-component='RadioButtonField'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={selected || undefined}\n >\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n type='radio'\n name={props.name}\n checked={selected}\n onChange={(event) => {\n if (event.currentTarget.checked) props.onChange(props.buttonValue);\n }}\n aria-invalid={props.invalid || undefined}\n className={['cratis-choice-field__native', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={selected || undefined}\n />\n <span\n {...props.pt?.box}\n className={['cratis-radio__box', props.pt?.box?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='box'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={selected || undefined}\n aria-hidden='true'\n >\n <span\n {...props.pt?.indicator}\n className={['cratis-radio__indicator', props.pt?.indicator?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='indicator'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={selected || undefined}\n />\n </span>\n {props.label && (\n <span className='cratis-choice-field__label'>{props.label}</span>\n )}\n </label>\n {accessibility.hiddenError}\n </>\n );\n },\n { defaultValue: '' },\n);\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;MAyCa,gBAAgB,GAAG,kBAAkB,CAC9C,CAAC,KAAK,KAAI;AACN,IAAA,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAC/C,QAAA,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE;AACvB,QAAA,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,YAAY,CAAC,IAAI,KAAK,CAAC,KAAK;QACzD,eAAe,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,kBAAkB,CAAC;AACzD,KAAA,CAAC;IAC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