@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":"RadioGroupField.d.ts","sourceRoot":"","sources":["../../../../CommandForm/fields/RadioGroupField.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAS,KAAK,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAEH,KAAK,uBAAuB,EAC/B,MAAM,yBAAsB,CAAC;AAI9B,0DAA0D;AAC1D,MAAM,WAAW,eAAe;IAC5B,mCAAmC;IACnC,IAAI,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IACtC,wBAAwB;IACxB,MAAM,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAC1C,0BAA0B;IAC1B,KAAK,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,wBAAwB;IACxB,GAAG,CAAC,EAAE,cAAc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,CAAC;IACtC,iCAAiC;IACjC,SAAS,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;CAC/C;AAKD,UAAU,6BACN,SAAQ,iBAAiB,CAAC,MAAM,GAAG,MAAM,CAAC,EACtC,uBAAuB;IAC3B,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACnC,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,eAAe,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,oFAAoF;AACpF,eAAO,MAAM,eAAe,4NAyG3B,CAAC"}
@@ -18,7 +18,7 @@ const RadioGroupField = asCommandFormField((props) => {
18
18
  props.className,
19
19
  ]
20
20
  .filter(Boolean)
21
- .join(' '), "data-cratis-part": 'root', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, children: [props.options.map((option) => {
21
+ .join(' '), "data-cratis-part": 'root', "data-cratis-component": 'RadioGroupField', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, children: [props.options.map((option) => {
22
22
  const value = option[props.optionValue];
23
23
  const label = String(option[props.optionLabel] ?? value);
24
24
  const selected = props.value === value;
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroupField.js","sources":["../../../../CommandForm/fields/RadioGroupField.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 { useId, 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 type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link RadioGroupField}. */\nexport interface RadioGroupParts {\n /** Semantic radiogroup wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** One option label. */\n option?: 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 radioGroupPartsMatchManifest: ExactPartKeys<RadioGroupParts, PartsOf<'RadioGroupField'>> = true;\nvoid radioGroupPartsMatchManifest;\n\ninterface RadioGroupFieldComponentProps\n extends WrappedFieldProps<string | number>,\n FieldAccessibilityProps {\n options: Array<Record<string, unknown>>;\n optionLabel: string;\n optionValue: string;\n layout?: 'horizontal' | 'vertical';\n /** Native radio-group name. Generated automatically when omitted. */\n name?: string;\n className?: string;\n pt?: RadioGroupParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** A visible radio group bound to a string or number property on an Arc command. */\nexport const RadioGroupField = asCommandFormField<RadioGroupFieldComponentProps>(\n (props) => {\n const generatedName = useId();\n const name = props.name ?? generatedName;\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.root?.id,\n ariaLabel: props.pt?.root?.['aria-label'],\n ariaDescribedBy: props.pt?.root?.['aria-describedby'],\n });\n\n return (\n <div\n {...props.pt?.root}\n id={accessibility.controlId}\n role='radiogroup'\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n aria-invalid={props.invalid || undefined}\n className={[\n 'cratis-radio-group',\n `cratis-radio-group--${props.layout ?? 'vertical'}`,\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 >\n {props.options.map((option) => {\n const value = option[props.optionValue] as string | number;\n const label = String(option[props.optionLabel] ?? value);\n const selected = props.value === value;\n return (\n <label\n key={String(value)}\n {...props.pt?.option}\n className={[\n 'cratis-choice-field',\n props.pt?.option?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n onBlur={props.onBlur}\n data-cratis-part='option'\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 type='radio'\n name={name}\n checked={selected}\n onChange={(event) => {\n if (event.currentTarget.checked) props.onChange(value);\n }}\n aria-invalid={props.invalid || undefined}\n className={[\n 'cratis-choice-field__native',\n props.pt?.input?.className,\n ]\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={[\n 'cratis-radio__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={selected || undefined}\n />\n </span>\n <span className='cratis-choice-field__label'>{label}</span>\n </label>\n );\n })}\n {accessibility.hiddenError}\n </div>\n );\n },\n { defaultValue: '' },\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;MA6Ca,eAAe,GAAG,kBAAkB,CAC7C,CAAC,KAAK,KAAI;AACN,IAAA,MAAM,aAAa,GAAG,KAAK,EAAE;AAC7B,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,aAAa;AACxC,IAAA,MAAM,aAA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E,GAAG,EAAE,SAAS;iCACpD,MAAM,CAAC,OAAO;AACd,iCAAA,IAAI,CAAC,GAAG,CAAC,EAAA,kBAAA,EACG,KAAK,mBACP,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,SAAS,kBACvC,KAAK,CAAC,OAAO,IAAI,SAAS,EAAA,eAAA,EACzB,QAAQ,IAAI,SAAS,iBACxB,MAAM,EAAA,QAAA,EAElBA,GAAA,CAAA,MAAA,EAAA,EAAA,GACQ,KAAK,CAAC,EAAE,EAAE,SAAS,EACvB,SAAS,EAAE;oCACP,yBAAyB;AACzB,oCAAA,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS;AACjC;qCACI,MAAM,CAAC,OAAO;AACd,qCAAA,IAAI,CAAC,GAAG,CAAC,sBACG,WAAW,EAAA,eAAA,EACb,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,SAAS,kBACvC,KAAK,CAAC,OAAO,IAAI,SAAS,EAAA,eAAA,EACzB,QAAQ,IAAI,SAAS,EAAA,CACtC,GACC,EACPA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,4BAA4B,YAAE,KAAK,EAAA,CAAQ,KA3DtD,MAAM,CAAC,KAAK,CAAC,CA4Dd;AAEhB,YAAA,CAAC,CAAC,EACD,aAAa,CAAC,WAAW,CAAA,EAAA,CACxB;AAEd,CAAC,EACD,EAAE,YAAY,EAAE,EAAE,EAAE;;"}
1
+ {"version":3,"file":"RadioGroupField.js","sources":["../../../../CommandForm/fields/RadioGroupField.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 { useId, 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 type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link RadioGroupField}. */\nexport interface RadioGroupParts {\n /** Semantic radiogroup wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** One option label. */\n option?: 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 radioGroupPartsMatchManifest: ExactPartKeys<RadioGroupParts, PartsOf<'RadioGroupField'>> = true;\nvoid radioGroupPartsMatchManifest;\n\ninterface RadioGroupFieldComponentProps\n extends WrappedFieldProps<string | number>,\n FieldAccessibilityProps {\n options: Array<Record<string, unknown>>;\n optionLabel: string;\n optionValue: string;\n layout?: 'horizontal' | 'vertical';\n /** Native radio-group name. Generated automatically when omitted. */\n name?: string;\n className?: string;\n pt?: RadioGroupParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** A visible radio group bound to a string or number property on an Arc command. */\nexport const RadioGroupField = asCommandFormField<RadioGroupFieldComponentProps>(\n (props) => {\n const generatedName = useId();\n const name = props.name ?? generatedName;\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.root?.id,\n ariaLabel: props.pt?.root?.['aria-label'],\n ariaDescribedBy: props.pt?.root?.['aria-describedby'],\n });\n\n return (\n <div\n {...props.pt?.root}\n id={accessibility.controlId}\n role='radiogroup'\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n aria-invalid={props.invalid || undefined}\n className={[\n 'cratis-radio-group',\n `cratis-radio-group--${props.layout ?? 'vertical'}`,\n props.pt?.root?.className,\n props.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='root'\n data-cratis-component='RadioGroupField'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n >\n {props.options.map((option) => {\n const value = option[props.optionValue] as string | number;\n const label = String(option[props.optionLabel] ?? value);\n const selected = props.value === value;\n return (\n <label\n key={String(value)}\n {...props.pt?.option}\n className={[\n 'cratis-choice-field',\n props.pt?.option?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n onBlur={props.onBlur}\n data-cratis-part='option'\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 type='radio'\n name={name}\n checked={selected}\n onChange={(event) => {\n if (event.currentTarget.checked) props.onChange(value);\n }}\n aria-invalid={props.invalid || undefined}\n className={[\n 'cratis-choice-field__native',\n props.pt?.input?.className,\n ]\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={[\n 'cratis-radio__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={selected || undefined}\n />\n </span>\n <span className='cratis-choice-field__label'>{label}</span>\n </label>\n );\n })}\n {accessibility.hiddenError}\n </div>\n );\n },\n { defaultValue: '' },\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;MA6Ca,eAAe,GAAG,kBAAkB,CAC7C,CAAC,KAAK,KAAI;AACN,IAAA,MAAM,aAAa,GAAG,KAAK,EAAE;AAC7B,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,aAAa;AACxC,IAAA,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAC/C,QAAA,EAAE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AAmB,CAAC,gBAAgB,CAAC,CAAC;IAC9C,mBAAmB;IACnB,IAAI,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;CAC1C;AAKD,UAAU,yBACN,SAAQ,iBAAiB,CAAC,MAAM,CAAC,EAC7B,uBAAuB;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,kEAAkE;AAClE,eAAO,MAAM,WAAW,wNAiGvB,CAAC"}
@@ -17,7 +17,7 @@ const RatingField = asCommandFormField((props) => {
17
17
  props.className,
18
18
  ]
19
19
  .filter(Boolean)
20
- .join(' '), onBlur: props.onBlur, "data-cratis-part": 'root', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, children: [Array.from({ length: props.stars ?? 5 }, (_, index) => {
20
+ .join(' '), onBlur: props.onBlur, "data-cratis-part": 'root', "data-cratis-component": 'RatingField', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, children: [Array.from({ length: props.stars ?? 5 }, (_, index) => {
21
21
  const starValue = index + 1;
22
22
  const selected = starValue === props.value;
23
23
  const label = (props.starAriaLabel ??
@@ -1 +1 @@
1
- {"version":3,"file":"RatingField.js","sources":["../../../../CommandForm/fields/RatingField.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 { useId, 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 type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link RatingField}. */\nexport interface RatingParts {\n /** Semantic radiogroup wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** One rating option label. */\n option?: HTMLAttributes<HTMLLabelElement>;\n /** Native radio input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Visual star. */\n star?: HTMLAttributes<HTMLSpanElement>;\n}\n\nconst ratingPartsMatchManifest: ExactPartKeys<RatingParts, PartsOf<'RatingField'>> = true;\nvoid ratingPartsMatchManifest;\n\ninterface RatingFieldComponentProps\n extends WrappedFieldProps<number>,\n FieldAccessibilityProps {\n stars?: number;\n /** Native radio-group name. Generated automatically when omitted. */\n name?: string;\n starAriaLabel?: (starValue: number) => string;\n className?: string;\n pt?: RatingParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** A star rating bound to a number property on an Arc command. */\nexport const RatingField = asCommandFormField<RatingFieldComponentProps>(\n (props) => {\n const generatedName = useId();\n const name = props.name ?? generatedName;\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.root?.id,\n ariaLabel: props.pt?.root?.['aria-label'],\n ariaDescribedBy: props.pt?.root?.['aria-describedby'],\n });\n\n return (\n <div\n {...props.pt?.root}\n id={accessibility.controlId}\n role='radiogroup'\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n aria-invalid={props.invalid || undefined}\n className={[\n 'cratis-rating-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 >\n {Array.from({ length: props.stars ?? 5 }, (_, index) => {\n const starValue = index + 1;\n const selected = starValue === props.value;\n const label = (\n props.starAriaLabel ??\n ((value: number) => `${value} ${value === 1 ? 'star' : 'stars'}`)\n )(starValue);\n return (\n <label\n key={starValue}\n {...props.pt?.option}\n className={[\n 'cratis-rating-field__option',\n props.pt?.option?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='option'\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 type='radio'\n name={name}\n checked={selected}\n onChange={(event) => {\n if (event.currentTarget.checked) props.onChange(starValue);\n }}\n aria-label={label}\n className={[\n 'cratis-choice-field__native',\n props.pt?.input?.className,\n ]\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?.star}\n className={[\n 'cratis-rating-field__star',\n props.pt?.star?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='star'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={starValue <= props.value || undefined}\n aria-hidden='true'\n >\n ★\n </span>\n </label>\n );\n })}\n {accessibility.hiddenError}\n </div>\n );\n },\n { defaultValue: 0 },\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;MAyCa,WAAW,GAAG,kBAAkB,CACzC,CAAC,KAAK,KAAI;AACN,IAAA,MAAM,aAAa,GAAG,KAAK,EAAE;AAC7B,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,aAAa;AACxC,IAAA,MAAM,aAAa,GAAG,qBAAqB,CAAC,KAAK,EAAE;AAC/C,QAAA,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE;QACtB,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,GAAG,YAAY,CAAC;QACzC,eAAe,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,GAAG,kBAAkB,CAAC;AACxD,KAAA,CAAC;AAEF,IAAA,QACIA,IAAA,CAAA,KAAA,EAAA,EAAA,GACQ,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AK,IAAI,SAAS,EAAA,aAAA,EACxC,MAAM,EAAA,QAAA,EAAA,QAAA,EAAA,CAGf,CAAA,EAAA,EAhDF,SAAS,CAiDV;AAEhB,YAAA,CAAC,CAAC,EACD,aAAa,CAAC,WAAW,CAAA,EAAA,CACxB;AAEd,CAAC,EACD,EAAE,YAAY,EAAE,CAAC,EAAE;;"}
1
+ {"version":3,"file":"RatingField.js","sources":["../../../../CommandForm/fields/RatingField.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 { useId, 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 type { ExactPartKeys } from '../../types/ExactPartKeys';\nimport type { PartsOf } from '../../types/parts';\n\n/** Stable part attributes for {@link RatingField}. */\nexport interface RatingParts {\n /** Semantic radiogroup wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** One rating option label. */\n option?: HTMLAttributes<HTMLLabelElement>;\n /** Native radio input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Visual star. */\n star?: HTMLAttributes<HTMLSpanElement>;\n}\n\nconst ratingPartsMatchManifest: ExactPartKeys<RatingParts, PartsOf<'RatingField'>> = true;\nvoid ratingPartsMatchManifest;\n\ninterface RatingFieldComponentProps\n extends WrappedFieldProps<number>,\n FieldAccessibilityProps {\n stars?: number;\n /** Native radio-group name. Generated automatically when omitted. */\n name?: string;\n starAriaLabel?: (starValue: number) => string;\n className?: string;\n pt?: RatingParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** A star rating bound to a number property on an Arc command. */\nexport const RatingField = asCommandFormField<RatingFieldComponentProps>(\n (props) => {\n const generatedName = useId();\n const name = props.name ?? generatedName;\n const accessibility = useFieldAccessibility(props, {\n id: props.pt?.root?.id,\n ariaLabel: props.pt?.root?.['aria-label'],\n ariaDescribedBy: props.pt?.root?.['aria-describedby'],\n });\n\n return (\n <div\n {...props.pt?.root}\n id={accessibility.controlId}\n role='radiogroup'\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n aria-invalid={props.invalid || undefined}\n className={[\n 'cratis-rating-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='RatingField'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n >\n {Array.from({ length: props.stars ?? 5 }, (_, index) => {\n const starValue = index + 1;\n const selected = starValue === props.value;\n const label = (\n props.starAriaLabel ??\n ((value: number) => `${value} ${value === 1 ? 'star' : 'stars'}`)\n )(starValue);\n return (\n <label\n key={starValue}\n {...props.pt?.option}\n className={[\n 'cratis-rating-field__option',\n props.pt?.option?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='option'\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 type='radio'\n name={name}\n checked={selected}\n onChange={(event) => {\n if (event.currentTarget.checked) props.onChange(starValue);\n }}\n aria-label={label}\n className={[\n 'cratis-choice-field__native',\n props.pt?.input?.className,\n ]\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?.star}\n className={[\n 'cratis-rating-field__star',\n props.pt?.star?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='star'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n data-selected={starValue <= props.value || undefined}\n aria-hidden='true'\n >\n ★\n </span>\n </label>\n );\n })}\n {accessibility.hiddenError}\n </div>\n );\n },\n { defaultValue: 0 },\n);\n"],"names":["_jsxs","_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CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,mEAAmE;AACnE,eAAO,MAAM,WAAW,wNA0DvB,CAAC"}
@@ -15,7 +15,7 @@ const SliderField = asCommandFormField((props) => {
15
15
  props.className,
16
16
  ]
17
17
  .filter(Boolean)
18
- .join(' '), onBlur: props.onBlur, "data-cratis-part": 'root', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, children: [jsx("input", { ...props.pt?.input, id: accessibility.controlId, "aria-label": accessibility.ariaLabel, "aria-describedby": accessibility.ariaDescribedBy, type: 'range', value: props.value, onChange: (event) => props.onChange(event.currentTarget.valueAsNumber), min: props.min ?? 0, max: props.max ?? 100, step: props.step ?? 1, "aria-invalid": props.invalid || undefined, "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, className: ['cratis-slider-field__input', props.pt?.input?.className]
18
+ .join(' '), onBlur: props.onBlur, "data-cratis-part": 'root', "data-cratis-component": 'SliderField', "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, children: [jsx("input", { ...props.pt?.input, id: accessibility.controlId, "aria-label": accessibility.ariaLabel, "aria-describedby": accessibility.ariaDescribedBy, type: 'range', value: props.value, onChange: (event) => props.onChange(event.currentTarget.valueAsNumber), min: props.min ?? 0, max: props.max ?? 100, step: props.step ?? 1, "aria-invalid": props.invalid || undefined, "data-disabled": props.pt?.input?.disabled || undefined, "data-invalid": props.invalid || undefined, className: ['cratis-slider-field__input', props.pt?.input?.className]
19
19
  .filter(Boolean)
20
20
  .join(' '), "data-cratis-part": 'input' }), jsx("span", { ...props.pt?.value, className: ['cratis-slider-field__value', props.pt?.value?.className]
21
21
  .filter(Boolean)
@@ -1 +1 @@
1
- {"version":3,"file":"SliderField.js","sources":["../../../../CommandForm/fields/SliderField.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 SliderField}. */\nexport interface SliderParts {\n /** Field wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** Native range input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Current-value display. */\n value?: HTMLAttributes<HTMLSpanElement>;\n}\n\nconst sliderPartsMatchManifest: ExactPartKeys<SliderParts, PartsOf<'SliderField'>> = true;\nvoid sliderPartsMatchManifest;\n\ninterface SliderFieldComponentProps\n extends WrappedFieldProps<number>,\n FieldAccessibilityProps {\n min?: number;\n max?: number;\n step?: number;\n className?: string;\n pt?: SliderParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** A range slider bound to a number property on an Arc command. */\nexport const SliderField = asCommandFormField<SliderFieldComponentProps>(\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 className={[\n 'cratis-slider-field',\n 'cratis:w-full',\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 >\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n type='range'\n value={props.value}\n onChange={(event) => props.onChange(event.currentTarget.valueAsNumber)}\n min={props.min ?? 0}\n max={props.max ?? 100}\n step={props.step ?? 1}\n aria-invalid={props.invalid || undefined}\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n className={['cratis-slider-field__input', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n />\n <span\n {...props.pt?.value}\n className={['cratis-slider-field__value', props.pt?.value?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='value'\n data-invalid={props.invalid || undefined}\n >\n {props.value}\n </span>\n {accessibility.hiddenError}\n </div>\n );\n },\n { defaultValue: 0 },\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;MAsCa,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,SAAS,EAAE;YACP,qBAAqB;YACrB,eAAe;AACf,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,SAAS,EAAA,cAAA,EACvC,KAAK,CAAC,OAAO,IAAI,SAAS,EAAA,QAAA,EAAA,CAExCC,GAAA,CAAA,OAAA,EAAA,EAAA,GACQ,KAAK,CAAC,EAAE,EAAE,KAAK,EACnB,EAAE,EAAE,aAAa,CAAC,SAAS,EAAA,YAAA,EACf,aAAa,CAAC,SAAS,EAAA,kBAAA,EACjB,aAAa,CAAC,eAAe,EAC/C,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,QAAQ,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,EACtE,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,EACnB,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,GAAG,EACrB,IAAI,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,EAAA,cAAA,EACP,KAAK,CAAC,OAAO,IAAI,SAAS,EAAA,eAAA,EACzB,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,SAAS,kBACvC,KAAK,CAAC,OAAO,IAAI,SAAS,EACxC,SAAS,EAAE,CAAC,4BAA4B,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS;qBAC/D,MAAM,CAAC,OAAO;qBACd,IAAI,CAAC,GAAG,CAAC,EAAA,kBAAA,EACG,OAAO,EAAA,CAC1B,EACFA,GAAA,CAAA,MAAA,EAAA,EAAA,GACQ,KAAK,CAAC,EAAE,EAAE,KAAK,EACnB,SAAS,EAAE,CAAC,4BAA4B,EAAE,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS;qBAC/D,MAAM,CAAC,OAAO;qBACd,IAAI,CAAC,GAAG,CAAC,EAAA,kBAAA,EACG,OAAO,EAAA,cAAA,EACV,KAAK,CAAC,OAAO,IAAI,SAAS,YAEvC,KAAK,CAAC,KAAK,EAAA,CACT,EACN,aAAa,CAAC,WAAW,CAAA,EAAA,CACxB;AAEV,CAAC,EACD,EAAE,YAAY,EAAE,CAAC,EAAE;;"}
1
+ {"version":3,"file":"SliderField.js","sources":["../../../../CommandForm/fields/SliderField.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 SliderField}. */\nexport interface SliderParts {\n /** Field wrapper. */\n root?: HTMLAttributes<HTMLDivElement>;\n /** Native range input. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Current-value display. */\n value?: HTMLAttributes<HTMLSpanElement>;\n}\n\nconst sliderPartsMatchManifest: ExactPartKeys<SliderParts, PartsOf<'SliderField'>> = true;\nvoid sliderPartsMatchManifest;\n\ninterface SliderFieldComponentProps\n extends WrappedFieldProps<number>,\n FieldAccessibilityProps {\n min?: number;\n max?: number;\n step?: number;\n className?: string;\n pt?: SliderParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** A range slider bound to a number property on an Arc command. */\nexport const SliderField = asCommandFormField<SliderFieldComponentProps>(\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 className={[\n 'cratis-slider-field',\n 'cratis:w-full',\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='SliderField'\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n >\n <input\n {...props.pt?.input}\n id={accessibility.controlId}\n aria-label={accessibility.ariaLabel}\n aria-describedby={accessibility.ariaDescribedBy}\n type='range'\n value={props.value}\n onChange={(event) => props.onChange(event.currentTarget.valueAsNumber)}\n min={props.min ?? 0}\n max={props.max ?? 100}\n step={props.step ?? 1}\n aria-invalid={props.invalid || undefined}\n data-disabled={props.pt?.input?.disabled || undefined}\n data-invalid={props.invalid || undefined}\n className={['cratis-slider-field__input', props.pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n />\n <span\n {...props.pt?.value}\n className={['cratis-slider-field__value', props.pt?.value?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='value'\n data-invalid={props.invalid || undefined}\n >\n {props.value}\n </span>\n {accessibility.hiddenError}\n </div>\n );\n },\n { defaultValue: 0 },\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;MAsCa,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,SAAS,EAAE;YACP,qBAAqB;YACrB,eAAe;AACf,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,uBAAA,EACD,aAAa,EAAA,eAAA,EACpB,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,IAAI,SAAS,EAAA,cAAA,EACvC,KAAK,CAAC,OAAO,IAAI,SAAS,EAAA,QAAA,EAAA,CAExCC,kBACQ,KAAK,CAAC,EAAE,EAAE,KAAK,EACnB,EAAE,EAAE,aAAa,CAAC,SAAS,EAAA,YAAA,EACf,aAAa,CAAC,SAAS,EAAA,kBAAA,EACjB,aAAa,CAAC,eAAe,E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AAC,CAAC;IAC9C,2BAA2B;IAC3B,OAAO,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;IAC1C,4BAA4B;IAC5B,MAAM,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;CAC5C;AAKD,UAAU,+BACN,SAAQ,iBAAiB,CAAC,OAAO,CAAC,EAC9B,uBAAuB;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,sEAAsE;AACtE,eAAO,MAAM,iBAAiB,8NAsE7B,CAAC"}
@@ -10,7 +10,7 @@ const ToggleSwitchField = 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', role: 'switch', 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": 'ToggleSwitchField', "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', role: 'switch', 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?.control, className: ['cratis-switch__control', props.pt?.control?.className]
16
16
  .filter(Boolean)
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleSwitchField.js","sources":["../../../../CommandForm/fields/ToggleSwitchField.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 ToggleSwitchField}. */\nexport interface ToggleSwitchParts {\n /** Wrapping label. */\n root?: HTMLAttributes<HTMLLabelElement>;\n /** Native checkbox with switch semantics. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Visual switch track. */\n control?: HTMLAttributes<HTMLSpanElement>;\n /** Visual switch handle. */\n handle?: HTMLAttributes<HTMLSpanElement>;\n}\n\nconst toggleSwitchPartsMatchManifest: ExactPartKeys<ToggleSwitchParts, PartsOf<'ToggleSwitchField'>> = true;\nvoid toggleSwitchPartsMatchManifest;\n\ninterface ToggleSwitchFieldComponentProps\n extends WrappedFieldProps<boolean>,\n FieldAccessibilityProps {\n label?: string;\n className?: string;\n pt?: ToggleSwitchParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** An on/off switch bound to a boolean property on an Arc command. */\nexport const ToggleSwitchField = asCommandFormField<ToggleSwitchFieldComponentProps>(\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 role='switch'\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?.control}\n className={['cratis-switch__control', props.pt?.control?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='control'\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?.handle}\n className={['cratis-switch__handle', props.pt?.handle?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='handle'\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.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,iBAAiB,GAAG,kBAAkB,CAC/C,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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AAY,EAAE,KAAK,EAAE;;"}
1
+ {"version":3,"file":"ToggleSwitchField.js","sources":["../../../../CommandForm/fields/ToggleSwitchField.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 ToggleSwitchField}. */\nexport interface ToggleSwitchParts {\n /** Wrapping label. */\n root?: HTMLAttributes<HTMLLabelElement>;\n /** Native checkbox with switch semantics. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n /** Visual switch track. */\n control?: HTMLAttributes<HTMLSpanElement>;\n /** Visual switch handle. */\n handle?: HTMLAttributes<HTMLSpanElement>;\n}\n\nconst toggleSwitchPartsMatchManifest: ExactPartKeys<ToggleSwitchParts, PartsOf<'ToggleSwitchField'>> = true;\nvoid toggleSwitchPartsMatchManifest;\n\ninterface ToggleSwitchFieldComponentProps\n extends WrappedFieldProps<boolean>,\n FieldAccessibilityProps {\n label?: string;\n className?: string;\n pt?: ToggleSwitchParts;\n ptOptions?: object;\n unstyled?: boolean;\n}\n\n/** An on/off switch bound to a boolean property on an Arc command. */\nexport const ToggleSwitchField = asCommandFormField<ToggleSwitchFieldComponentProps>(\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='ToggleSwitchField'\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 role='switch'\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?.control}\n className={['cratis-switch__control', props.pt?.control?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='control'\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?.handle}\n className={['cratis-switch__handle', props.pt?.handle?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='handle'\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.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,iBAAiB,GAAG,kBAAkB,CAC/C,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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AK,WAAW,EAAE,KAAK,cAAc,EAAmB,MAAM,aAAU,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAoB,CAAC;AAItD,mDAAmD;AACnD,MAAM,WAAW,cAAc;IAC3B,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,yCAAyC;IACzC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,SAAS,CAAC;CAClD;AAED,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IAC/B,0EAA0E;IAC1E,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,4CAA4C;IAC5C,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAkCD,2DAA2D;AAC3D,eAAO,MAAM,aAAa,kEAMvB,kBAAkB,gCAoBpB,CAAC"}
@@ -20,7 +20,7 @@ const ActionMenubarButton = ({ item, pt }) => {
20
20
  };
21
21
  const ActionMenubar = ({ model, focusMode = ToolbarFocusMode.Arrows, className, pt, 'aria-label': ariaLabel, }) => {
22
22
  const { rootRef, onKeyDown, roving } = useToolbarKeyboardNavigation('horizontal', focusMode);
23
- return jsx("div", { ref: rootRef, onKeyDown: onKeyDown, role: 'toolbar', className: ['cratis-action-menubar', className].filter(Boolean).join(' '), "data-cratis-part": 'root', "aria-label": ariaLabel, children: jsx(ToolbarRovingContext.Provider, { value: roving, children: model.map((item, index) => {
23
+ return jsx("div", { ref: rootRef, onKeyDown: onKeyDown, role: 'toolbar', className: ['cratis-action-menubar', className].filter(Boolean).join(' '), "data-cratis-part": 'root', "data-cratis-component": 'ActionMenubar', "aria-label": ariaLabel, children: jsx(ToolbarRovingContext.Provider, { value: roving, children: model.map((item, index) => {
24
24
  if (item.template)
25
25
  return jsx(Fragment, { children: item.template(item) }, index);
26
26
  return jsx(ActionMenubarButton, { item: item, pt: pt }, index);
@@ -1 +1 @@
1
- {"version":3,"file":"ActionMenubar.js","sources":["../../../Common/ActionMenubar.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 { Fragment, type ReactNode } from 'react';\nimport { Button, type ButtonParts, type ButtonSeverity, type ButtonTone } from './Button';\nimport { ToolbarFocusMode } from './ToolbarFocusMode';\nimport { useToolbarKeyboardNavigation } from './useToolbarKeyboardNavigation';\nimport { ToolbarRovingContext, useRovingTool } from './ToolbarRovingContext';\n\n/** A single action in an {@link ActionMenubar}. */\nexport interface ActionMenuItem {\n /** The visible label. */\n label?: string;\n /** An icon element rendered before the label. */\n icon?: ReactNode;\n /** Invoked when the item is activated. */\n command?: () => void;\n /** When true, the item is greyed out and not clickable. */\n disabled?: boolean;\n /** Extra class name for the item. */\n className?: string;\n /** Severity styling for the action. */\n severity?: ButtonSeverity;\n /** Fully custom render for this item. */\n template?: (item: ActionMenuItem) => ReactNode;\n}\n\n/** Props for {@link ActionMenubar}. */\nexport interface ActionMenubarProps {\n /** Keyboard focus behavior (default: {@link ToolbarFocusMode.Arrows}). */\n focusMode?: ToolbarFocusMode;\n /** Actions to render from left to right. */\n model: ActionMenuItem[];\n /** Extra class name for the toolbar container. */\n className?: string;\n /** Accessible label for the toolbar. */\n 'aria-label'?: string;\n /** Cratis-owned per-part attributes applied to each action button. */\n pt?: ButtonParts;\n /**\n * @deprecated Cratis parts always merge. Remove this renderer-era option.\n */\n ptOptions?: object;\n /**\n * @deprecated Components always uses consumer-owned CSS. Customize through `pt` and CSS instead.\n */\n unstyled?: boolean;\n}\n\nconst buttonToneForSeverity: Record<ButtonSeverity, ButtonTone> = {\n secondary: 'neutral',\n info: 'accent',\n help: 'accent',\n success: 'positive',\n warn: 'caution',\n danger: 'critical',\n contrast: 'neutral',\n};\n\n/** One Components-owned action button, which takes part in the menubar's single Tab stop. */\nconst ActionMenubarButton = ({ item, pt }: { item: ActionMenuItem; pt: ActionMenubarProps['pt'] }) => {\n // The consumer's pt.root tab index and focus handler are composed, because props passed\n // directly to Button take precedence over pt.root.\n const rovingTool = useRovingTool<HTMLButtonElement>(pt?.root?.tabIndex, pt?.root?.onFocus);\n return (\n <Button\n variant='ghost'\n tone={item.severity ? buttonToneForSeverity[item.severity] : undefined}\n onClick={item.command}\n disabled={item.disabled}\n className={item.className}\n icon={item.icon}\n label={item.label}\n pt={pt}\n ref={rovingTool.ref}\n tabIndex={rovingTool.tabIndex}\n onFocus={rovingTool.onFocus}\n />\n );\n};\n\n/** A horizontal, accessible toolbar of command actions. */\nexport const ActionMenubar = ({\n model,\n focusMode = ToolbarFocusMode.Arrows,\n className,\n pt,\n 'aria-label': ariaLabel,\n}: ActionMenubarProps) => {\n const { rootRef, onKeyDown, roving } = useToolbarKeyboardNavigation('horizontal', focusMode);\n return <div\n ref={rootRef}\n onKeyDown={onKeyDown}\n role='toolbar'\n className={['cratis-action-menubar', className].filter(Boolean).join(' ')}\n data-cratis-part='root'\n aria-label={ariaLabel}\n >\n <ToolbarRovingContext.Provider value={roving}>\n {model.map((item, index) => {\n if (item.template)\n return <Fragment key={index}>{item.template(item)}</Fragment>;\n\n return <ActionMenubarButton key={index} item={item} pt={pt} />;\n })}\n </ToolbarRovingContext.Provider>\n </div>;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,KAAA,EAAA,EACH,GAAG,EAAE,OAAO,EACZ,SAAS,EAAE,SAAS,EACpB,IAAI,EAAC,SAAS,EACd,SAAS,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAA,kBAAA,EACxD,MAAM,EAAA,YAAA,EACX,SAAS,EAAA,QAAA,EAErBA,GAAA,CAAC,oBAAoB,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,MAAM,EAAA,QAAA,EAC3C,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,KAAI;gBACvB,IAAI,IAAI,CAAC,QAAQ;AACb,oBAAA,OAAOA,GAAA,CAAC,QAAQ,EAAA,EAAA,QAAA,EAAc,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAA,EAA3B,KAAK,CAAkC;AAEjE,gBAAA,OAAOA,GAAA,CAAC,mBAAmB,EAAA,EAAa,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAA,EAAzB,KAAK,CAAwB;YAClE,CAAC,CAAC,EAAA,CAC8B,EAAA,CAC9B;AACV;;"}
1
+ {"version":3,"file":"ActionMenubar.js","sources":["../../../Common/ActionMenubar.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 { Fragment, type ReactNode } from 'react';\nimport { Button, type ButtonParts, type ButtonSeverity, type ButtonTone } from './Button';\nimport { ToolbarFocusMode } from './ToolbarFocusMode';\nimport { useToolbarKeyboardNavigation } from './useToolbarKeyboardNavigation';\nimport { ToolbarRovingContext, useRovingTool } from './ToolbarRovingContext';\n\n/** A single action in an {@link ActionMenubar}. */\nexport interface ActionMenuItem {\n /** The visible label. */\n label?: string;\n /** An icon element rendered before the label. */\n icon?: ReactNode;\n /** Invoked when the item is activated. */\n command?: () => void;\n /** When true, the item is greyed out and not clickable. */\n disabled?: boolean;\n /** Extra class name for the item. */\n className?: string;\n /** Severity styling for the action. */\n severity?: ButtonSeverity;\n /** Fully custom render for this item. */\n template?: (item: ActionMenuItem) => ReactNode;\n}\n\n/** Props for {@link ActionMenubar}. */\nexport interface ActionMenubarProps {\n /** Keyboard focus behavior (default: {@link ToolbarFocusMode.Arrows}). */\n focusMode?: ToolbarFocusMode;\n /** Actions to render from left to right. */\n model: ActionMenuItem[];\n /** Extra class name for the toolbar container. */\n className?: string;\n /** Accessible label for the toolbar. */\n 'aria-label'?: string;\n /** Cratis-owned per-part attributes applied to each action button. */\n pt?: ButtonParts;\n /**\n * @deprecated Cratis parts always merge. Remove this renderer-era option.\n */\n ptOptions?: object;\n /**\n * @deprecated Components always uses consumer-owned CSS. Customize through `pt` and CSS instead.\n */\n unstyled?: boolean;\n}\n\nconst buttonToneForSeverity: Record<ButtonSeverity, ButtonTone> = {\n secondary: 'neutral',\n info: 'accent',\n help: 'accent',\n success: 'positive',\n warn: 'caution',\n danger: 'critical',\n contrast: 'neutral',\n};\n\n/** One Components-owned action button, which takes part in the menubar's single Tab stop. */\nconst ActionMenubarButton = ({ item, pt }: { item: ActionMenuItem; pt: ActionMenubarProps['pt'] }) => {\n // The consumer's pt.root tab index and focus handler are composed, because props passed\n // directly to Button take precedence over pt.root.\n const rovingTool = useRovingTool<HTMLButtonElement>(pt?.root?.tabIndex, pt?.root?.onFocus);\n return (\n <Button\n variant='ghost'\n tone={item.severity ? buttonToneForSeverity[item.severity] : undefined}\n onClick={item.command}\n disabled={item.disabled}\n className={item.className}\n icon={item.icon}\n label={item.label}\n pt={pt}\n ref={rovingTool.ref}\n tabIndex={rovingTool.tabIndex}\n onFocus={rovingTool.onFocus}\n />\n );\n};\n\n/** A horizontal, accessible toolbar of command actions. */\nexport const ActionMenubar = ({\n model,\n focusMode = ToolbarFocusMode.Arrows,\n className,\n pt,\n 'aria-label': ariaLabel,\n}: ActionMenubarProps) => {\n const { rootRef, onKeyDown, roving } = useToolbarKeyboardNavigation('horizontal', focusMode);\n return <div\n ref={rootRef}\n onKeyDown={onKeyDown}\n role='toolbar'\n className={['cratis-action-menubar', className].filter(Boolean).join(' ')}\n data-cratis-part='root'\n data-cratis-component='ActionMenubar'\n aria-label={ariaLabel}\n >\n <ToolbarRovingContext.Provider value={roving}>\n {model.map((item, index) => {\n if (item.template)\n return <Fragment key={index}>{item.template(item)}</Fragment>;\n\n return <ActionMenubarButton key={index} item={item} pt={pt} />;\n })}\n </ToolbarRovingContext.Provider>\n </div>;\n};\n"],"names":["_jsx"],"mappings":";;;;;;;AAiDA,MAAM,qBAAqB,GAAuC;AAC9D,IAAA,SAAS,EAAE,SAAS;AACpB,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,IAAI,EAAE,QAAQ;AACd,IAAA,OAAO,EAAE,UAAU;AACnB,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,MAAM,EAAE,UAAU;AAClB,IAAA,QAAQ,EAAE,SAAS;CACtB;AAGD,MAAM,mBAAmB,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAA0D,KAAI;AAGjG,IAAA,MAAM,UAAU,GAAG,aAAa,CAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC;AAC1F,IAAA,QACIA,GAAA,CAAC,MAAM,EAAA,EACH,OAAO,EAAC,OAAO,EACf,IAAI,EAAE,IAAI,CAAC,QAAQ,GAAG,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,SAAS,EACtE,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,UAAU,CAAC,GAAG,EACnB,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAC7B,OAAO,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E,MAAM,OAAO,CAAC;AAU5D,+GAA+G;AAC/G,MAAM,MAAM,yBAAyB,GAAG,IAAI,CACxC,cAAc,CAAC,WAAW,CAAC,EAC3B,WAAW,GAAG,OAAO,GAAG,OAAO,CAClC,GAAG;IACA,CAAC,aAAa,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAC5E,CAAC;AAEF,kDAAkD;AAClD,MAAM,WAAW,cAAc;IAC3B,qBAAqB;IACrB,KAAK,EAAE,SAAS,CAAC;IACjB,8FAA8F;IAC9F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6GAA6G;IAC7G,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,yEAAyE;AACzE,MAAM,WAAW,gBAAgB;IAC7B,kDAAkD;IAClD,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,mBAAmB;IACnB,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,iFAAiF;IACjF,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,yBAAyB,CAAC;CACzC;AAQD,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC7B,qEAAqE;IACrE,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,uFAAuF;IACvF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,yFAAyF;IACzF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,EAAE,CAAC,EAAE,gBAAgB,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,kEAMrB,gBAAgB,gCAwDlB,CAAC"}
@@ -2,7 +2,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { Breadcrumbs as Breadcrumbs$1, Breadcrumb, Link } from 'react-aria-components/Breadcrumbs';
3
3
  import { classNames } from '../ClassNames/classNames.js';
4
4
 
5
- const Breadcrumbs = ({ items, separator = '/', 'aria-label': ariaLabel, className, pt, }) => (jsx("nav", { "aria-label": ariaLabel, children: jsx(Breadcrumbs$1, { ...pt?.root, className: classNames('cratis-breadcrumbs', pt?.root?.className, className), "data-cratis-part": 'root', children: items.map((item, index) => {
5
+ const Breadcrumbs = ({ items, separator = '/', 'aria-label': ariaLabel, className, pt, }) => (jsx("nav", { "aria-label": ariaLabel, children: jsx(Breadcrumbs$1, { ...pt?.root, className: classNames('cratis-breadcrumbs', pt?.root?.className, className), "data-cratis-part": 'root', "data-cratis-component": 'Breadcrumbs', children: items.map((item, index) => {
6
6
  const current = index === items.length - 1;
7
7
  return (jsxs(Breadcrumb, { ...pt?.item, className: classNames('cratis-breadcrumbs__item', pt?.item?.className), "data-cratis-part": 'item', "data-selected": current || undefined, children: [jsx(Link, { ...pt?.link, href: current ? undefined : item.href, onPress: current ? undefined : item.onNavigate, className: classNames('cratis-breadcrumbs__link', pt?.link?.className), "data-cratis-part": 'link', "data-selected": current || undefined, children: item.label }), !current && (jsx("span", { ...pt?.separator, "aria-hidden": 'true', className: classNames('cratis-breadcrumbs__separator', pt?.separator?.className), "data-cratis-part": 'separator', children: separator }))] }, `${index}-${String(item.href ?? '')}`));
8
8
  }) }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.js","sources":["../../../Common/Breadcrumbs.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, type ReactNode } from 'react';\nimport {\n Breadcrumb as AriaBreadcrumb,\n Breadcrumbs as AriaBreadcrumbs,\n Link as AriaLink,\n} from 'react-aria-components/Breadcrumbs';\nimport type { ExactPartKeys } from '../types/ExactPartKeys';\nimport type { PartsOf } from '../types/parts';\nimport { classNames } from '../ClassNames/classNames';\n\n/** Attributes a consumer may hand to one {@link Breadcrumbs} part: class, style, title and data attributes. */\nexport type BreadcrumbsPartAttributes = Pick<\n HTMLAttributes<HTMLElement>,\n 'className' | 'style' | 'title'\n> & {\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n};\n\n/** One segment of a {@link Breadcrumbs} trail. */\nexport interface BreadcrumbItem {\n /** Visible label. */\n label: ReactNode;\n /** Destination. A segment without one is text rather than a link — as the last segment is. */\n href?: string;\n /** Legacy press callback. Prefer provider routing with href; manually navigating here can navigate twice. */\n onNavigate?: () => void;\n}\n\n/** Stable Cratis-owned parts for styling a {@link Breadcrumbs} trail. */\nexport interface BreadcrumbsParts {\n /** The navigation landmark wrapping the trail. */\n root?: BreadcrumbsPartAttributes;\n /** One segment. */\n item?: BreadcrumbsPartAttributes;\n /** A segment's link, rendered for every segment that is not the current page. */\n link?: BreadcrumbsPartAttributes;\n /** The separator between two segments. */\n separator?: BreadcrumbsPartAttributes;\n}\n\nconst breadcrumbsPartsMatchManifest: ExactPartKeys<\n BreadcrumbsParts,\n PartsOf<'Breadcrumbs'>\n> = true;\nvoid breadcrumbsPartsMatchManifest;\n\n/** Props for {@link Breadcrumbs}. */\nexport interface BreadcrumbsProps {\n /** The trail, outermost first. The last item is the current page. */\n items: BreadcrumbItem[];\n /** Separator rendered between segments. Defaults to a slash; decorative either way. */\n separator?: ReactNode;\n /** Accessible name for the landmark. Name it when a page carries more than one trail. */\n 'aria-label'?: string;\n /** Extra class name for the root element. */\n className?: string;\n /** Cratis-owned per-part attributes. */\n pt?: BreadcrumbsParts;\n}\n\n/**\n * A breadcrumb trail.\n *\n * The last segment is the current page: it carries `aria-current=\"page\"` and is never a link, which\n * is what tells a screen-reader user where the trail ends. Earlier segments are links when they have\n * a destination. The trail is an ordered list inside a navigation landmark, so it can be jumped to\n * and its length announced.\n */\nexport const Breadcrumbs = ({\n items,\n separator = '/',\n 'aria-label': ariaLabel,\n className,\n pt,\n}: BreadcrumbsProps) => (\n // React Aria renders the ordered list; the navigation landmark around it is ours, because a\n // trail a screen-reader user cannot jump to is only a list of links.\n <nav aria-label={ariaLabel}>\n <AriaBreadcrumbs\n {...pt?.root}\n className={classNames('cratis-breadcrumbs', pt?.root?.className, className)}\n data-cratis-part='root'\n >\n {items.map((item, index) => {\n const current = index === items.length - 1;\n return (\n <AriaBreadcrumb\n key={`${index}-${String(item.href ?? '')}`}\n {...pt?.item}\n className={classNames('cratis-breadcrumbs__item', pt?.item?.className)}\n data-cratis-part='item'\n data-selected={current || undefined}\n >\n {/*\n * Every segment is a link, including the current page: React Aria hands\n * aria-current=\"page\" and the disabled state to the last one through its link\n * context, so a segment rendered as plain text would silently lose both.\n */}\n <AriaLink\n {...pt?.link}\n href={current ? undefined : item.href}\n onPress={current ? undefined : item.onNavigate}\n className={classNames(\n 'cratis-breadcrumbs__link',\n pt?.link?.className,\n )}\n data-cratis-part='link'\n data-selected={current || undefined}\n >\n {item.label}\n </AriaLink>\n {!current && (\n <span\n {...pt?.separator}\n aria-hidden='true'\n className={classNames(\n 'cratis-breadcrumbs__separator',\n pt?.separator?.className,\n )}\n data-cratis-part='separator'\n >\n {separator}\n </span>\n )}\n </AriaBreadcrumb>\n );\n })}\n </AriaBreadcrumbs>\n </nav>\n);\n"],"names":["_jsx","AriaBreadcrumbs","_jsxs","AriaBreadcrumb","AriaLink"],"mappings":";;;;AAuEO,MAAM,WAAW,GAAG,CAAC,EACxB,KAAK,EACL,SAAS,GAAG,GAAG,EACf,YAAY,EAAE,SAAS,EACvB,SAAS,EACT,EAAE,GACa,MAGfA,GAAA,CAAA,KAAA,EAAA,EAAA,YAAA,EAAiB,SAAS,EAAA,QAAA,EACtBA,GAAA,CAACC,aAAe,EAAA,EAAA,GACR,EAAE,EAAE,IAAI,EACZ,SAAS,EAAE,UAAU,CAAC,oBAAoB,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,CAAC,EAAA,kBAAA,EAC1D,MAAM,EAAA,QAAA,EAE1B,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,KAAI;YACvB,MAAM,OAAO,GAAG,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC;AAC1C,YAAA,QACIC,IAAA,CAACC,UAAc,EAAA,EAAA,GAEP,EAAE,EAAE,IAAI,EACZ,SAAS,EAAE,UAAU,CAAC,0BAA0B,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,EAAA,kBAAA,EACrD,MAAM,EAAA,eAAA,EACR,OAAO,IAAI,SAAS,EAAA,QAAA,EAAA,CAOnCH,GAAA,CAACI,IAAQ,EAAA,EAAA,GACD,EAAE,EAAE,IAAI,EACZ,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC,IAAI,EACrC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC,UAAU,EAC9C,SAAS,EAAE,UAAU,CACjB,0BAA0B,EAC1B,EAAE,EAAE,IAAI,EAAE,SAAS,CACtB,EAAA,kBAAA,EACgB,MAAM,EAAA,eAAA,EACR,OAAO,IAAI,SAAS,EAAA,QAAA,EAElC,IAAI,CAAC,KAAK,EAAA,CACJ,EACV,CAAC,OAAO,KACLJ,GAAA,CAAA,MAAA,EAAA,EAAA,GACQ,EAAE,EAAE,SAAS,EAAA,aAAA,EACL,MAAM,EAClB,SAAS,EAAE,UAAU,CACjB,+BAA+B,EAC/B,EAAE,EAAE,SAAS,EAAE,SAAS,CAC3B,EAAA,kBAAA,EACgB,WAAW,EAAA,QAAA,EAE3B,SAAS,EAAA,CACP,CACV,CAAA,EAAA,EApCI,CAAA,EAAG,KAAK,CAAA,CAAA,EAAI,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAA,CAAE,CAqC7B;AAErB,QAAA,CAAC,CAAC,EAAA,CACY,EAAA,CAChB;;"}
1
+ {"version":3,"file":"Breadcrumbs.js","sources":["../../../Common/Breadcrumbs.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, type ReactNode } from 'react';\nimport {\n Breadcrumb as AriaBreadcrumb,\n Breadcrumbs as AriaBreadcrumbs,\n Link as AriaLink,\n} from 'react-aria-components/Breadcrumbs';\nimport type { ExactPartKeys } from '../types/ExactPartKeys';\nimport type { PartsOf } from '../types/parts';\nimport { classNames } from '../ClassNames/classNames';\n\n/** Attributes a consumer may hand to one {@link Breadcrumbs} part: class, style, title and data attributes. */\nexport type BreadcrumbsPartAttributes = Pick<\n HTMLAttributes<HTMLElement>,\n 'className' | 'style' | 'title'\n> & {\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n};\n\n/** One segment of a {@link Breadcrumbs} trail. */\nexport interface BreadcrumbItem {\n /** Visible label. */\n label: ReactNode;\n /** Destination. A segment without one is text rather than a link — as the last segment is. */\n href?: string;\n /** Legacy press callback. Prefer provider routing with href; manually navigating here can navigate twice. */\n onNavigate?: () => void;\n}\n\n/** Stable Cratis-owned parts for styling a {@link Breadcrumbs} trail. */\nexport interface BreadcrumbsParts {\n /** The navigation landmark wrapping the trail. */\n root?: BreadcrumbsPartAttributes;\n /** One segment. */\n item?: BreadcrumbsPartAttributes;\n /** A segment's link, rendered for every segment that is not the current page. */\n link?: BreadcrumbsPartAttributes;\n /** The separator between two segments. */\n separator?: BreadcrumbsPartAttributes;\n}\n\nconst breadcrumbsPartsMatchManifest: ExactPartKeys<\n BreadcrumbsParts,\n PartsOf<'Breadcrumbs'>\n> = true;\nvoid breadcrumbsPartsMatchManifest;\n\n/** Props for {@link Breadcrumbs}. */\nexport interface BreadcrumbsProps {\n /** The trail, outermost first. The last item is the current page. */\n items: BreadcrumbItem[];\n /** Separator rendered between segments. Defaults to a slash; decorative either way. */\n separator?: ReactNode;\n /** Accessible name for the landmark. Name it when a page carries more than one trail. */\n 'aria-label'?: string;\n /** Extra class name for the root element. */\n className?: string;\n /** Cratis-owned per-part attributes. */\n pt?: BreadcrumbsParts;\n}\n\n/**\n * A breadcrumb trail.\n *\n * The last segment is the current page: it carries `aria-current=\"page\"` and is never a link, which\n * is what tells a screen-reader user where the trail ends. Earlier segments are links when they have\n * a destination. The trail is an ordered list inside a navigation landmark, so it can be jumped to\n * and its length announced.\n */\nexport const Breadcrumbs = ({\n items,\n separator = '/',\n 'aria-label': ariaLabel,\n className,\n pt,\n}: BreadcrumbsProps) => (\n // React Aria renders the ordered list; the navigation landmark around it is ours, because a\n // trail a screen-reader user cannot jump to is only a list of links.\n <nav aria-label={ariaLabel}>\n <AriaBreadcrumbs\n {...pt?.root}\n className={classNames('cratis-breadcrumbs', pt?.root?.className, className)}\n data-cratis-part='root'\n data-cratis-component='Breadcrumbs'\n >\n {items.map((item, index) => {\n const current = index === items.length - 1;\n return (\n <AriaBreadcrumb\n key={`${index}-${String(item.href ?? '')}`}\n {...pt?.item}\n className={classNames('cratis-breadcrumbs__item', pt?.item?.className)}\n data-cratis-part='item'\n data-selected={current || undefined}\n >\n {/*\n * Every segment is a link, including the current page: React Aria hands\n * aria-current=\"page\" and the disabled state to the last one through its link\n * context, so a segment rendered as plain text would silently lose both.\n */}\n <AriaLink\n {...pt?.link}\n href={current ? undefined : item.href}\n onPress={current ? undefined : item.onNavigate}\n className={classNames(\n 'cratis-breadcrumbs__link',\n pt?.link?.className,\n )}\n data-cratis-part='link'\n data-selected={current || undefined}\n >\n {item.label}\n </AriaLink>\n {!current && (\n <span\n {...pt?.separator}\n aria-hidden='true'\n className={classNames(\n 'cratis-breadcrumbs__separator',\n pt?.separator?.className,\n )}\n data-cratis-part='separator'\n >\n {separator}\n </span>\n )}\n </AriaBreadcrumb>\n );\n })}\n </AriaBreadcrumbs>\n </nav>\n);\n"],"names":["_jsx","AriaBreadcrumbs","_jsxs","AriaBreadcrumb","AriaLink"],"mappings":";;;;AAuEO,MAAM,WAAW,GAAG,CAAC,EACxB,KAAK,EACL,SAAS,GAAG,GAAG,EACf,YAAY,EAAE,SAAS,EACvB,SAAS,EACT,EAAE,GACa,MAGfA,GAAA,CAAA,KAAA,EAAA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C;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAQD,gFAAgF;AAChF,eAAO,MAAM,MAAM,2GAOjB,CAAC"}
@@ -2,6 +2,8 @@ import { forwardRef } from 'react';
2
2
  import { unstable_useSlot } from '../renderer/RendererContext.js';
3
3
  import { renderSlot } from '../renderer/renderSlot.js';
4
4
  import { ButtonImplementation } from './ButtonImplementation.js';
5
+ import { useComponentPresentation } from '../configuration/identity/useComponentPresentation.js';
6
+ import { buttonDescriptor } from './buttonDescriptor.js';
5
7
 
6
8
  const coreButtonDeclaration = Object.freeze({
7
9
  mode: 'presentation',
@@ -10,7 +12,8 @@ const coreButtonDeclaration = Object.freeze({
10
12
  });
11
13
  const Button = forwardRef(function Button(props, ref) {
12
14
  const declaration = unstable_useSlot('common.button', coreButtonDeclaration);
13
- return renderSlot(declaration, props, ref);
15
+ const [presented, marker] = useComponentPresentation(buttonDescriptor, props, props.id);
16
+ return renderSlot(declaration, { ...presented, ...marker }, ref);
14
17
  });
15
18
 
16
19
  export { Button };
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sources":["../../../Common/Button.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 forwardRef,\n type ButtonHTMLAttributes,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport type { TooltipPosition } from './Tooltip';\nimport type { ExactPartKeys } from '../types/ExactPartKeys';\nimport type { PartsOf } from '../types/parts';\nimport { unstable_useSlot } from '../renderer/RendererContext';\nimport { renderSlot } from '../renderer/renderSlot';\nimport type { unstable_SlotDeclaration } from '../renderer/slots';\nimport { ButtonImplementation } from './ButtonImplementation';\n\n/** Visual treatment of a {@link Button}. */\nexport type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'link';\n\n/** Semantic color of a {@link Button}. */\nexport type ButtonTone = 'neutral' | 'accent' | 'positive' | 'caution' | 'critical';\n\n/** Border shape of a {@link Button}. */\nexport type ButtonShape = 'default' | 'pill';\n\n/**\n * Severity tone of a {@link Button}.\n *\n * @deprecated Use {@link ButtonTone} instead. Removed in 5.0.\n */\nexport type ButtonSeverity =\n 'secondary' | 'info' | 'success' | 'warn' | 'help' | 'danger' | 'contrast';\n\n/** Stable Cratis-owned parts for styling a {@link Button}. */\nexport interface ButtonParts {\n /** Native button element. */\n root?: ButtonHTMLAttributes<HTMLButtonElement>;\n /** Icon wrapper. */\n icon?: HTMLAttributes<HTMLSpanElement>;\n /** Label/content wrapper. */\n label?: HTMLAttributes<HTMLSpanElement>;\n /** Loading spinner. */\n spinner?: HTMLAttributes<HTMLSpanElement>;\n}\n\nconst buttonPartsMatchManifest: ExactPartKeys<ButtonParts, PartsOf<'Button'>> = true;\nvoid buttonPartsMatchManifest;\n\n/** Props for {@link Button}. */\nexport interface ButtonProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'children' | 'className' | 'disabled' | 'size' | 'style' | 'type'\n> {\n /** The button's text. */\n label?: ReactNode;\n /** The button's icon, rendered before the label. */\n icon?: ReactNode;\n /** Replaces the icon with a spinner and disables the button. */\n loading?: boolean;\n /** Text shown on hover and keyboard focus. */\n tooltip?: string;\n /** Placement of the tooltip. */\n tooltipOptions?: { position?: TooltipPosition; className?: string };\n /** Cratis-owned per-part attributes. */\n pt?: ButtonParts;\n /** Visual treatment. Defaults to `solid`. */\n variant?: ButtonVariant;\n /** Semantic color. Omit for the familiar primary action. */\n tone?: ButtonTone;\n /** Border shape. Defaults to `default`. */\n shape?: ButtonShape;\n /**\n * Renders the button borderless.\n *\n * @deprecated Use `variant='ghost'` instead. Removed in 5.0.\n */\n text?: boolean;\n /**\n * Renders the button as an inline link.\n *\n * @deprecated Use `variant='link'` instead. Removed in 5.0.\n */\n link?: boolean;\n /**\n * Renders the button with an outline instead of a fill.\n *\n * @deprecated Use `variant='outline'` instead. Removed in 5.0.\n */\n outlined?: boolean;\n /**\n * Renders the button fully rounded.\n *\n * @deprecated Use `shape='pill'` instead. Removed in 5.0.\n */\n rounded?: boolean;\n /**\n * Controls the button's coloring. Omit for the familiar primary action.\n *\n * @deprecated Use `tone` instead. Removed in 5.0.\n */\n severity?: ButtonSeverity;\n /** Sizes the button. */\n size?: 'small' | 'normal' | 'large';\n /** Whether the button is disabled. */\n disabled?: boolean;\n /** Native button type. */\n type?: 'button' | 'submit' | 'reset';\n /** Native title attribute. */\n title?: string;\n /** Focuses the button when it mounts. */\n autoFocus?: boolean;\n /** Applied to the button element. */\n className?: string;\n /** Applied to the button element. */\n style?: CSSProperties;\n /** Accessible name, required for an icon-only button. */\n 'aria-label'?: string;\n /** Rendered inside the button, after the icon and label. */\n children?: ReactNode;\n}\n\nconst coreButtonDeclaration = Object.freeze({\n mode: 'presentation',\n fidelity: 'native',\n render: ButtonImplementation,\n}) satisfies unstable_SlotDeclaration<'common.button'>;\n\n/** A Cratis-owned button with stable parts and renderer-independent styling. */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n props,\n ref,\n) {\n const declaration = unstable_useSlot('common.button', coreButtonDeclaration);\n return renderSlot(declaration, props, ref);\n});\n"],"names":[],"mappings":";;;;;AA2HA,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC;AACxC,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE,oBAAoB;AAC/B,CAAA,CAAqD;AAG/C,MAAM,MAAM,GAAG,UAAU,CAAiC,SAAS,MAAM,CAC5E,KAAK,EACL,GAAG,EAAA;IAEH,MAAM,WAAW,GAAG,gBAAgB,CAAC,eAAe,EAAE,qBAAqB,CAAC;IAC5E,OAAO,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC;AAC9C,CAAC;;"}
1
+ {"version":3,"file":"Button.js","sources":["../../../Common/Button.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 forwardRef,\n type ButtonHTMLAttributes,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport type { TooltipPosition } from './Tooltip';\nimport type { ExactPartKeys } from '../types/ExactPartKeys';\nimport type { PartsOf } from '../types/parts';\nimport { unstable_useSlot } from '../renderer/RendererContext';\nimport { renderSlot } from '../renderer/renderSlot';\nimport type { unstable_SlotDeclaration } from '../renderer/slots';\nimport { ButtonImplementation } from './ButtonImplementation';\nimport { useComponentPresentation } from '../configuration/identity/useComponentPresentation';\nimport { buttonDescriptor } from './buttonDescriptor';\n\n/** Visual treatment of a {@link Button}. */\nexport type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'link';\n\n/** Semantic color of a {@link Button}. */\nexport type ButtonTone = 'neutral' | 'accent' | 'positive' | 'caution' | 'critical';\n\n/** Border shape of a {@link Button}. */\nexport type ButtonShape = 'default' | 'pill';\n\n/**\n * Severity tone of a {@link Button}.\n *\n * @deprecated Use {@link ButtonTone} instead. Removed in 5.0.\n */\nexport type ButtonSeverity =\n 'secondary' | 'info' | 'success' | 'warn' | 'help' | 'danger' | 'contrast';\n\n/** Stable Cratis-owned parts for styling a {@link Button}. */\nexport interface ButtonParts {\n /** Native button element. */\n root?: ButtonHTMLAttributes<HTMLButtonElement>;\n /** Icon wrapper. */\n icon?: HTMLAttributes<HTMLSpanElement>;\n /** Label/content wrapper. */\n label?: HTMLAttributes<HTMLSpanElement>;\n /** Loading spinner. */\n spinner?: HTMLAttributes<HTMLSpanElement>;\n}\n\nconst buttonPartsMatchManifest: ExactPartKeys<ButtonParts, PartsOf<'Button'>> = true;\nvoid buttonPartsMatchManifest;\n\n/** Props for {@link Button}. */\nexport interface ButtonProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'children' | 'className' | 'disabled' | 'size' | 'style' | 'type'\n> {\n /** The button's text. */\n label?: ReactNode;\n /** The button's icon, rendered before the label. */\n icon?: ReactNode;\n /** Replaces the icon with a spinner and disables the button. */\n loading?: boolean;\n /** Text shown on hover and keyboard focus. */\n tooltip?: string;\n /** Placement of the tooltip. */\n tooltipOptions?: { position?: TooltipPosition; className?: string };\n /** Cratis-owned per-part attributes. */\n pt?: ButtonParts;\n /** Visual treatment. Defaults to `solid`. */\n variant?: ButtonVariant;\n /** Semantic color. Omit for the familiar primary action. */\n tone?: ButtonTone;\n /** Border shape. Defaults to `default`. */\n shape?: ButtonShape;\n /**\n * Renders the button borderless.\n *\n * @deprecated Use `variant='ghost'` instead. Removed in 5.0.\n */\n text?: boolean;\n /**\n * Renders the button as an inline link.\n *\n * @deprecated Use `variant='link'` instead. Removed in 5.0.\n */\n link?: boolean;\n /**\n * Renders the button with an outline instead of a fill.\n *\n * @deprecated Use `variant='outline'` instead. Removed in 5.0.\n */\n outlined?: boolean;\n /**\n * Renders the button fully rounded.\n *\n * @deprecated Use `shape='pill'` instead. Removed in 5.0.\n */\n rounded?: boolean;\n /**\n * Controls the button's coloring. Omit for the familiar primary action.\n *\n * @deprecated Use `tone` instead. Removed in 5.0.\n */\n severity?: ButtonSeverity;\n /** Sizes the button. */\n size?: 'small' | 'normal' | 'large';\n /** Whether the button is disabled. */\n disabled?: boolean;\n /** Native button type. */\n type?: 'button' | 'submit' | 'reset';\n /** Native title attribute. */\n title?: string;\n /** Focuses the button when it mounts. */\n autoFocus?: boolean;\n /** Applied to the button element. */\n className?: string;\n /** Applied to the button element. */\n style?: CSSProperties;\n /** Accessible name, required for an icon-only button. */\n 'aria-label'?: string;\n /** Rendered inside the button, after the icon and label. */\n children?: ReactNode;\n}\n\nconst coreButtonDeclaration = Object.freeze({\n mode: 'presentation',\n fidelity: 'native',\n render: ButtonImplementation,\n}) satisfies unstable_SlotDeclaration<'common.button'>;\n\n/** A Cratis-owned button with stable parts and renderer-independent styling. */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n props,\n ref,\n) {\n const declaration = unstable_useSlot('common.button', coreButtonDeclaration);\n const [presented, marker] = useComponentPresentation(buttonDescriptor, props, props.id);\n return renderSlot(declaration, { ...presented, ...marker }, ref);\n});\n"],"names":[],"mappings":";;;;;;;AA6HA,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,CAAC;AACxC,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE,oBAAoB;AAC/B,CAAA,CAAqD;AAG/C,MAAM,MAAM,GAAG,UAAU,CAAiC,SAAS,MAAM,CAC5E,KAAK,EACL,GAAG,EAAA;IAEH,MAAM,WAAW,GAAG,gBAAgB,CAAC,eAAe,EAAE,qBAAqB,CAAC;AAC5E,IAAA,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,wBAAwB,CAAC,gBAAgB,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;AACvF,IAAA,OAAO,UAAU,CAAC,WAAW,EAAE,EAAE,GAAG,SAAS,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,CAAC;AACpE,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxImplementation.d.ts","sourceRoot":"","sources":["../../../Common/CheckboxImplementation.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAY,CAAC;AAGhD,qEAAqE;AACrE,eAAO,MAAM,sBAAsB,4GA+HjC,CAAC"}
1
+ {"version":3,"file":"CheckboxImplementation.d.ts","sourceRoot":"","sources":["../../../Common/CheckboxImplementation.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAY,CAAC;AAGhD,qEAAqE;AACrE,eAAO,MAAM,sBAAsB,4GAgIjC,CAAC"}
@@ -12,7 +12,7 @@ const CheckboxImplementation = forwardRef(function CheckboxImplementation({ labe
12
12
  const { ref, selected, synchronize } = useNativeCheckedState(effectiveChecked, effectiveDefaultChecked, forwardedRef);
13
13
  return (jsxs("label", { ...pt?.root, className: ['cratis-choice', pt?.root?.className, className]
14
14
  .filter(Boolean)
15
- .join(' '), style: { ...pt?.root?.style, ...style }, "data-cratis-part": 'root', "data-disabled": effectiveDisabled || undefined, "data-invalid": effectiveInvalid || undefined, "data-readonly": effectiveReadOnly || undefined, "data-selected": selected || undefined, children: [jsx("input", { ...pt?.input, ...nativeProps, ref: ref, type: 'checkbox', checked: effectiveChecked, defaultChecked: effectiveDefaultChecked, disabled: effectiveDisabled, readOnly: undefined, "aria-invalid": effectiveAriaInvalid, "aria-readonly": effectiveReadOnly || undefined, onClick: (event) => {
15
+ .join(' '), style: { ...pt?.root?.style, ...style }, "data-cratis-part": 'root', "data-cratis-component": 'Checkbox', "data-disabled": effectiveDisabled || undefined, "data-invalid": effectiveInvalid || undefined, "data-readonly": effectiveReadOnly || undefined, "data-selected": selected || undefined, children: [jsx("input", { ...pt?.input, ...nativeProps, ref: ref, type: 'checkbox', checked: effectiveChecked, defaultChecked: effectiveDefaultChecked, disabled: effectiveDisabled, readOnly: undefined, "aria-invalid": effectiveAriaInvalid, "aria-readonly": effectiveReadOnly || undefined, onClick: (event) => {
16
16
  pt?.input?.onClick?.(event);
17
17
  onClick?.(event);
18
18
  if (effectiveReadOnly)
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxImplementation.js","sources":["../../../Common/CheckboxImplementation.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 { forwardRef } from 'react';\nimport type { CheckboxProps } from './Checkbox';\nimport { useNativeCheckedState } from './useNativeCheckedState';\n\n/** Core implementation for the native checkbox presentation slot. */\nexport const CheckboxImplementation = forwardRef<\n HTMLInputElement,\n CheckboxProps\n>(function CheckboxImplementation(\n {\n label,\n readOnly,\n invalid = false,\n onChange,\n className,\n style,\n pt,\n checked,\n defaultChecked,\n disabled,\n onClick,\n 'aria-invalid': ariaInvalid,\n ...nativeProps\n },\n forwardedRef,\n) {\n const effectiveChecked = checked ?? pt?.input?.checked;\n const effectiveDefaultChecked = defaultChecked ?? pt?.input?.defaultChecked;\n const effectiveDisabled = disabled ?? pt?.input?.disabled;\n const effectiveReadOnly = readOnly ?? pt?.input?.readOnly;\n const effectiveAriaInvalid =\n ariaInvalid ?? pt?.input?.['aria-invalid'] ?? (invalid || undefined);\n const effectiveInvalid =\n invalid || effectiveAriaInvalid === true || effectiveAriaInvalid === 'true';\n const { ref, selected, synchronize } = useNativeCheckedState(\n effectiveChecked,\n effectiveDefaultChecked,\n forwardedRef,\n );\n return (\n <label\n {...pt?.root}\n className={['cratis-choice', pt?.root?.className, className]\n .filter(Boolean)\n .join(' ')}\n style={{ ...pt?.root?.style, ...style }}\n data-cratis-part='root'\n data-disabled={effectiveDisabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-readonly={effectiveReadOnly || undefined}\n data-selected={selected || undefined}\n >\n <input\n {...pt?.input}\n {...nativeProps}\n ref={ref}\n type='checkbox'\n checked={effectiveChecked}\n defaultChecked={effectiveDefaultChecked}\n disabled={effectiveDisabled}\n readOnly={undefined}\n aria-invalid={effectiveAriaInvalid}\n aria-readonly={effectiveReadOnly || undefined}\n onClick={(event) => {\n pt?.input?.onClick?.(event);\n onClick?.(event);\n if (effectiveReadOnly) event.preventDefault();\n }}\n onChange={(event) => {\n pt?.input?.onChange?.(event);\n if (effectiveReadOnly) return;\n synchronize(event.currentTarget.checked);\n onChange?.(event.currentTarget.checked, {\n source: 'user',\n nativeEvent: event.nativeEvent,\n });\n }}\n className={['cratis-choice__input', pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n data-disabled={effectiveDisabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-readonly={effectiveReadOnly || undefined}\n data-selected={selected || undefined}\n />\n <span\n {...pt?.box}\n className={['cratis-checkbox__box', pt?.box?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='box'\n data-disabled={effectiveDisabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-readonly={effectiveReadOnly || undefined}\n data-selected={selected || undefined}\n aria-hidden='true'\n >\n <span\n {...pt?.indicator}\n className={[\n 'cratis-checkbox__indicator',\n pt?.indicator?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='indicator'\n data-disabled={effectiveDisabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-readonly={effectiveReadOnly || undefined}\n data-selected={selected || undefined}\n >\n ✓\n </span>\n </span>\n {label !== undefined && (\n <span\n {...pt?.label}\n className={['cratis-choice__label', pt?.label?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='label'\n data-disabled={effectiveDisabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-readonly={effectiveReadOnly || undefined}\n data-selected={selected || undefined}\n >\n {label}\n </span>\n )}\n </label>\n );\n});\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AAQO,MAAM,sBAAsB,GAAG,UAAU,CAG9C,SAAS,sBAAsB,CAC7B,EACI,KAAK,EACL,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,QAAQ,EACR,SAAS,EACT,KAAK,EACL,EAAE,EACF,OAAO,EACP,cAAc,EACd,QAAQ,EACR,OAAO,EACP,cAAc,EAAE,WAAW,EAC3B,GAAG,WAAW,EACjB,EACD,YAAY,EAAA;IAEZ,MAAM,gBAAgB,GAAG,OAAO,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO;IACtD,MAAM,uBAAuB,GAAG,cAAc,IAAI,EAAE,EAAE,KAAK,EAAE,cAAc;IAC3E,MAAM,iBAAiB,GAAG,QAAQ,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ;IACzD,MAAM,iBAAiB,GAAG,QAAQ,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ;AACzD,IAAA,MAAM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O;yBACd,IAAI,CAAC,GAAG,CAAC,EAAA,kBAAA,EACG,WAAW,EAAA,eAAA,EACb,iBAAiB,IAAI,SAAS,EAAA,cAAA,EAC/B,gBAAgB,IAAI,SAAS,mBAC5B,iBAAiB,IAAI,SAAS,EAAA,eAAA,EAC9B,QAAQ,IAAI,SAAS,EAAA,QAAA,EAAA,QAAA,EAAA,CAGjC,GACJ,EACN,KAAK,KAAK,SAAS,KAChBA,GAAA,CAAA,MAAA,EAAA,EAAA,GACQ,EAAE,EAAE,KAAK,EACb,SAAS,EAAE,CAAC,sBAAsB,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS;qBACnD,MAAM,CAAC,OAAO;qBACd,IAAI,CAAC,GAAG,CAAC,EAAA,kBAAA,EACG,OAAO,EAAA,eAAA,EACT,iBAAiB,IAAI,SAAS,EAAA,cAAA,EAC/B,gBAAgB,IAAI,SAAS,EAAA,eAAA,EAC5B,iBAAiB,IAAI,SAAS,EAAA,eAAA,EAC9B,QAAQ,IAAI,SAAS,EAAA,QAAA,EAEnC,KAAK,EAAA,CACH,CACV,CAAA,EAAA,CACG;AAEhB,CAAC;;"}
1
+ {"version":3,"file":"CheckboxImplementation.js","sources":["../../../Common/CheckboxImplementation.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 { forwardRef } from 'react';\nimport type { CheckboxProps } from './Checkbox';\nimport { useNativeCheckedState } from './useNativeCheckedState';\n\n/** Core implementation for the native checkbox presentation slot. */\nexport const CheckboxImplementation = forwardRef<\n HTMLInputElement,\n CheckboxProps\n>(function CheckboxImplementation(\n {\n label,\n readOnly,\n invalid = false,\n onChange,\n className,\n style,\n pt,\n checked,\n defaultChecked,\n disabled,\n onClick,\n 'aria-invalid': ariaInvalid,\n ...nativeProps\n },\n forwardedRef,\n) {\n const effectiveChecked = checked ?? pt?.input?.checked;\n const effectiveDefaultChecked = defaultChecked ?? pt?.input?.defaultChecked;\n const effectiveDisabled = disabled ?? pt?.input?.disabled;\n const effectiveReadOnly = readOnly ?? pt?.input?.readOnly;\n const effectiveAriaInvalid =\n ariaInvalid ?? pt?.input?.['aria-invalid'] ?? (invalid || undefined);\n const effectiveInvalid =\n invalid || effectiveAriaInvalid === true || effectiveAriaInvalid === 'true';\n const { ref, selected, synchronize } = useNativeCheckedState(\n effectiveChecked,\n effectiveDefaultChecked,\n forwardedRef,\n );\n return (\n <label\n {...pt?.root}\n className={['cratis-choice', pt?.root?.className, className]\n .filter(Boolean)\n .join(' ')}\n style={{ ...pt?.root?.style, ...style }}\n data-cratis-part='root'\n data-cratis-component='Checkbox'\n data-disabled={effectiveDisabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-readonly={effectiveReadOnly || undefined}\n data-selected={selected || undefined}\n >\n <input\n {...pt?.input}\n {...nativeProps}\n ref={ref}\n type='checkbox'\n checked={effectiveChecked}\n defaultChecked={effectiveDefaultChecked}\n disabled={effectiveDisabled}\n readOnly={undefined}\n aria-invalid={effectiveAriaInvalid}\n aria-readonly={effectiveReadOnly || undefined}\n onClick={(event) => {\n pt?.input?.onClick?.(event);\n onClick?.(event);\n if (effectiveReadOnly) event.preventDefault();\n }}\n onChange={(event) => {\n pt?.input?.onChange?.(event);\n if (effectiveReadOnly) return;\n synchronize(event.currentTarget.checked);\n onChange?.(event.currentTarget.checked, {\n source: 'user',\n nativeEvent: event.nativeEvent,\n });\n }}\n className={['cratis-choice__input', pt?.input?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='input'\n data-disabled={effectiveDisabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-readonly={effectiveReadOnly || undefined}\n data-selected={selected || undefined}\n />\n <span\n {...pt?.box}\n className={['cratis-checkbox__box', pt?.box?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='box'\n data-disabled={effectiveDisabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-readonly={effectiveReadOnly || undefined}\n data-selected={selected || undefined}\n aria-hidden='true'\n >\n <span\n {...pt?.indicator}\n className={[\n 'cratis-checkbox__indicator',\n pt?.indicator?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='indicator'\n data-disabled={effectiveDisabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-readonly={effectiveReadOnly || undefined}\n data-selected={selected || undefined}\n >\n ✓\n </span>\n </span>\n {label !== undefined && (\n <span\n {...pt?.label}\n className={['cratis-choice__label', pt?.label?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='label'\n data-disabled={effectiveDisabled || undefined}\n data-invalid={effectiveInvalid || undefined}\n data-readonly={effectiveReadOnly || undefined}\n data-selected={selected || undefined}\n >\n {label}\n </span>\n )}\n </label>\n );\n});\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AAQO,MAAM,sBAAsB,GAAG,UAAU,CAG9C,SAAS,sBAAsB,CAC7B,EACI,KAAK,EACL,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,QAAQ,EACR,SAAS,EACT,KAAK,EACL,EAAE,EACF,OAAO,EACP,cAAc,EACd,QAAQ,EACR,OAAO,EACP,cAAc,EAAE,WAAW,EAC3B,GAAG,WAAW,EACjB,EACD,YAAY,EAAA;IAEZ,MAAM,gBAAgB,GAAG,OAAO,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO;IACtD,MAAM,uBAAuB,GAAG,cAAc,IAAI,EAAE,EAAE,KAAK,EAAE,cAAc;IAC3E,MAAM,iBAAiB,GAAG,QAAQ,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ;IACzD,MAAM,iBAAiB,GAAG,QAAQ,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ;AACzD,IAAA,MAAM,oBAAoB,GACtB,WAAW,IAAI,EAAE,EAAE,KAAK,GAAG,cAAc,CAAC,KAAK,OAAO,IAAI,SAAS,CAAC;IACxE,MAAM,gBAAgB,GAClB,OAAO,IAAI,oBAAoB,KAAK,IAAI,IAAI,oBAAoB,KAAK,MA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SAAS,EAAA,eAAA,EAC9B,QAAQ,IAAI,SAAS,EAAA,QAAA,EAAA,QAAA,EAAA,CAGjC,GACJ,EACN,KAAK,KAAK,SAAS,KAChBA,GAAA,CAAA,MAAA,EAAA,EAAA,GACQ,EAAE,EAAE,KAAK,EACb,SAAS,EAAE,CAAC,sBAAsB,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS;qBACnD,MAAM,CAAC,OAAO;qBACd,IAAI,CAAC,GAAG,CAAC,EAAA,kBAAA,EACG,OAAO,EAAA,eAAA,EACT,iBAAiB,IAAI,SAAS,EAAA,cAAA,EAC/B,gBAAgB,IAAI,SAAS,EAAA,eAAA,EAC5B,iBAAiB,IAAI,SAAS,EAAA,eAAA,EAC9B,QAAQ,IAAI,SAAS,EAAA,QAAA,EAEnC,KAAK,EAAA,CACH,CACV,CAAA,EAAA,CACG;AAEhB,CAAC;;"}
@@ -85,7 +85,7 @@ const ComboBox = ({ options, value, onChange, inputValue: controlledInputValue,
85
85
  : (options.find((option) => option.key === next)?.label ?? ''));
86
86
  };
87
87
  const renderMessage = () => loading ? (jsx("div", { ...partAttributes(pt?.loading), role: 'status', "aria-busy": 'true', className: classNames('cratis-combobox__message', 'cratis-combobox__loading', pt?.loading?.className), "data-cratis-part": 'loading', children: loadingMessage })) : failure !== undefined ? (jsx("div", { ...partAttributes(pt?.failure), role: 'alert', className: classNames('cratis-combobox__message', 'cratis-combobox__failure', pt?.failure?.className), "data-cratis-part": 'failure', children: failure })) : (jsx("div", { ...partAttributes(pt?.empty), role: 'status', className: classNames('cratis-combobox__message', 'cratis-combobox__empty', pt?.empty?.className), "data-cratis-part": 'empty', children: emptyMessage }));
88
- return (jsx(ComboBox$1, { ...partAttributes(pt?.root), selectedKey: value, onSelectionChange: select, inputValue: inputValue, onInputChange: setInputValue, items: items, isDisabled: disabled, isReadOnly: readOnly, isInvalid: invalid, isRequired: required, name: name, onOpenChange: openChanged, onFocusChange: setEditing, menuTrigger: openOnFocus ? 'focus' : 'input', allowsEmptyCollection: true, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": describedBy, className: classNames('cratis-combobox', pt?.root?.className, className), "data-cratis-part": 'root', "data-disabled": disabled || undefined, "data-invalid": invalid || undefined, "data-readonly": readOnly || undefined, "data-loading": loading || undefined, children: ({ isOpen }) => (jsxs(Fragment, { children: [jsxs("div", { className: 'cratis-combobox__control', children: [jsx(Input, { ...partAttributes(pt?.input), id: inputId, placeholder: placeholder, "aria-errormessage": errorId, className: classNames('cratis-combobox__input', pt?.input?.className), "data-cratis-part": 'input', "data-disabled": disabled || undefined, "data-invalid": invalid || undefined, "data-readonly": readOnly || undefined, "data-open": isOpen || undefined }), jsx(Button, { ...asReactAriaButtonProps(partAttributes(pt?.trigger)), className: classNames('cratis-combobox__trigger', pt?.trigger?.className), "data-cratis-part": 'trigger', "data-disabled": disabled || undefined, "data-open": isOpen || undefined, children: jsx("span", { "aria-hidden": 'true', children: expandIcon }) })] }), jsx(UNSAFE_PortalProvider, { getContainer: overlayEnvironment.getContainer, children: jsx(Popover, { ...partAttributes(pt?.popover), className: classNames('cratis-combobox__popover', pt?.popover?.className), style: {
88
+ return (jsx(ComboBox$1, { ...partAttributes(pt?.root), selectedKey: value, onSelectionChange: select, inputValue: inputValue, onInputChange: setInputValue, items: items, isDisabled: disabled, isReadOnly: readOnly, isInvalid: invalid, isRequired: required, name: name, onOpenChange: openChanged, onFocusChange: setEditing, menuTrigger: openOnFocus ? 'focus' : 'input', allowsEmptyCollection: true, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": describedBy, className: classNames('cratis-combobox', pt?.root?.className, className), "data-cratis-part": 'root', "data-cratis-component": 'ComboBox', "data-disabled": disabled || undefined, "data-invalid": invalid || undefined, "data-readonly": readOnly || undefined, "data-loading": loading || undefined, children: ({ isOpen }) => (jsxs(Fragment, { children: [jsxs("div", { className: 'cratis-combobox__control', children: [jsx(Input, { ...partAttributes(pt?.input), id: inputId, placeholder: placeholder, "aria-errormessage": errorId, className: classNames('cratis-combobox__input', pt?.input?.className), "data-cratis-part": 'input', "data-disabled": disabled || undefined, "data-invalid": invalid || undefined, "data-readonly": readOnly || undefined, "data-open": isOpen || undefined }), jsx(Button, { ...asReactAriaButtonProps(partAttributes(pt?.trigger)), className: classNames('cratis-combobox__trigger', pt?.trigger?.className), "data-cratis-part": 'trigger', "data-disabled": disabled || undefined, "data-open": isOpen || undefined, children: jsx("span", { "aria-hidden": 'true', children: expandIcon }) })] }), jsx(UNSAFE_PortalProvider, { getContainer: overlayEnvironment.getContainer, children: jsx(Popover, { ...partAttributes(pt?.popover), className: classNames('cratis-combobox__popover', pt?.popover?.className), style: {
89
89
  zIndex: popoverZIndex,
90
90
  ...pt?.popover?.style,
91
91
  }, "data-cratis-part": 'popover', "data-open": true, children: jsx(ListBox, { ...asReactAriaListBoxProps(partAttributes(pt?.listbox)), items: items, className: classNames('cratis-combobox__listbox', pt?.listbox?.className), "data-cratis-part": 'listbox', "data-option-layout": optionLayout, renderEmptyState: renderMessage, children: (option) => option.key === ACTION_KEY ? (jsx(ListBoxItem, { ...asReactAriaListBoxItemProps(partAttributes(pt?.action)), id: ACTION_KEY, textValue: action?.label ?? '', className: classNames('cratis-combobox__action', pt?.action?.className), "data-cratis-part": 'action', children: action?.label })) : (jsxs(ListBoxItem, { ...asReactAriaListBoxItemProps(partAttributes(pt?.option)), id: option.key, textValue: option.label, isDisabled: option.disabled, className: classNames('cratis-combobox__option', pt?.option?.className), "data-cratis-part": 'option', "data-disabled": option.disabled || undefined, "data-selected": option.key === value || undefined, children: [jsx("span", { ...partAttributes(pt?.optionLabel), className: classNames('cratis-combobox__option-label', pt?.optionLabel?.className), "data-cratis-part": 'optionLabel', children: option.label }), option.description !== undefined && (jsx("span", { ...partAttributes(pt?.optionDescription), className: classNames('cratis-combobox__option-description', pt?.optionDescription?.className), "data-cratis-part": 'optionDescription', children: option.description }))] })) }) }) }), descriptionId && (jsx("span", { ...partAttributes(pt?.description), id: descriptionId, className: classNames('cratis-combobox__description', pt?.description?.className), "data-cratis-part": 'description', children: description })), errorId && (jsx("span", { ...partAttributes(pt?.error), id: errorId, className: classNames('cratis-combobox__error', pt?.error?.className), "data-cratis-part": 'error', "data-invalid": 'true', children: errorMessage }))] })) }));