@cratis/components 4.38.2 → 4.39.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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":"TagGroup.js","sources":["../../../Common/TagGroup.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 useId,\n useState,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type Key,\n type ReactNode,\n} from 'react';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n TagList as AriaTagList,\n} from 'react-aria-components/TagGroup';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport { useCratisIcon } from '../configuration/useCratisIcon';\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 TagGroup} part: class, style, title and data attributes. */\nexport type TagGroupPartAttributes = Pick<\n HTMLAttributes<HTMLElement>,\n 'className' | 'style' | 'title'\n> & {\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n};\n\n/** Stable Cratis-owned parts for styling a {@link TagGroup}. */\nexport interface TagGroupParts {\n /** The element wrapping the tags and the entry. */\n root?: TagGroupPartAttributes;\n /** The tag list. */\n list?: TagGroupPartAttributes;\n /** One tag. */\n tag?: TagGroupPartAttributes;\n /** A tag's remove button. */\n remove?: TagGroupPartAttributes;\n /** The text entry that adds a value. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n}\n\nconst tagGroupPartsMatchManifest: ExactPartKeys<TagGroupParts, PartsOf<'TagGroup'>> = true;\nvoid tagGroupPartsMatchManifest;\n\n/** Props for {@link TagGroup}. */\nexport interface TagGroupProps {\n /** Current values, in display order. */\n value: string[];\n /** Called with the next list whenever a value is added or removed. */\n onChange: (value: string[]) => void;\n /**\n * Whether a text entry is offered for adding values. A group without one is a read-only display\n * of removable tags.\n */\n editable?: boolean;\n /** Placeholder for the text entry. */\n placeholder?: string;\n /**\n * Characters that commit the typed value in addition to Enter. Defaults to a comma. A pasted\n * string is split on the same separators, so pasting a comma-separated list adds each value.\n */\n separators?: string[];\n /** Whether a duplicate of an existing value is accepted. Defaults to `false`. */\n allowDuplicates?: boolean;\n /** Whether the whole control is disabled. */\n disabled?: boolean;\n /** Accessible name for the group. */\n 'aria-label'?: string;\n /** Id of the element naming the group. */\n 'aria-labelledby'?: string;\n /** Id of the element describing the control — typically a field's error or hint text. */\n 'aria-describedby'?: string;\n /** Marks the text entry invalid for assistive technology. */\n invalid?: boolean;\n /** Id forwarded to the text entry so an external `<label htmlFor>` associates with it. */\n id?: string;\n /** Accessible label for a tag's remove button. Receives the tag's value. */\n removeLabel?: (value: string) => string;\n /**\n * Glyph inside a tag's remove button. Names this one tag group and wins over the provider's\n * `icons.remove`; defaults to a multiplication sign when neither is set. The button, its\n * accessible name and its keyboard behaviour are unaffected.\n */\n removeIcon?: ReactNode;\n /** Extra class name for the root element. */\n className?: string;\n /** Cratis-owned per-part attributes. */\n pt?: TagGroupParts;\n}\n\n/**\n * A group of removable values with an optional text entry — the control behind a tag or chips field.\n *\n * Every tag is reachable with the arrow keys and removable with Backspace or Delete, which is what\n * the `grid`/`row` semantics React Aria gives a tag group promise; a row of `<span>`s with a close\n * button cannot be operated from the keyboard at all. In the entry, Enter and each configured\n * separator commit the typed value, Backspace on an empty entry removes the last tag, and a pasted\n * string is split on the separators.\n */\nexport const TagGroup = ({\n value,\n onChange,\n editable = true,\n placeholder,\n separators = [','],\n allowDuplicates = false,\n disabled = false,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n invalid = false,\n id,\n removeLabel,\n removeIcon,\n className,\n pt,\n}: TagGroupProps) => {\n const icon = useCratisIcon();\n const resolvedRemoveIcon = icon('remove', '×', removeIcon);\n const generatedId = useId();\n const inputId = id ?? `cratis-tag-group-${generatedId}`;\n const [draft, setDraft] = useState('');\n\n const add = (candidates: string[]) => {\n const next = [...value];\n for (const candidate of candidates) {\n const trimmed = candidate.trim();\n if (!trimmed) continue;\n if (!allowDuplicates && next.includes(trimmed)) continue;\n next.push(trimmed);\n }\n if (next.length !== value.length) onChange(next);\n setDraft('');\n };\n\n const remove = (keys: Set<Key>) =>\n onChange(value.filter((entry) => !keys.has(entry)));\n\n const splitOn = (text: string) =>\n separators.length === 0\n ? [text]\n : text.split(new RegExp(`[${separators.map(escapeForClass).join('')}]`));\n\n return (\n <div\n {...pt?.root}\n className={classNames('cratis-tag-group', pt?.root?.className, className)}\n data-cratis-part='root'\n data-disabled={disabled || undefined}\n data-invalid={invalid || undefined}\n >\n <AriaTagGroup\n // React Aria renders a wrapper here. It generates a block box, which would trap the\n // tags in their own formatting context — the root's flex layout, and therefore the\n // gap between tags, would never reach them. It has no part on purpose: it is not a\n // styling surface, it just has to disappear from layout.\n className='cratis-tag-group__group'\n selectionMode='none'\n onRemove={remove}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n <AriaTagList\n {...pt?.list}\n items={value.map((entry) => ({ id: entry }))}\n className={classNames('cratis-tag-group__list', pt?.list?.className)}\n data-cratis-part='list'\n >\n {(item: { id: string }) => (\n <AriaTag\n {...pt?.tag}\n id={item.id}\n textValue={item.id}\n isDisabled={disabled}\n className={classNames('cratis-tag-group__tag', pt?.tag?.className)}\n data-cratis-part='tag'\n data-disabled={disabled || undefined}\n >\n <span className='cratis-tag-group__tag-label'>{item.id}</span>\n {!disabled && (\n <AriaButton\n {...pt?.remove}\n slot='remove'\n aria-label={removeLabel?.(item.id)}\n className={classNames(\n 'cratis-tag-group__remove',\n pt?.remove?.className,\n )}\n data-cratis-part='remove'\n >\n <span aria-hidden='true'>{resolvedRemoveIcon}</span>\n </AriaButton>\n )}\n </AriaTag>\n )}\n </AriaTagList>\n </AriaTagGroup>\n {editable && (\n <input\n {...pt?.input}\n id={inputId}\n type='text'\n value={draft}\n disabled={disabled}\n placeholder={placeholder}\n aria-label={ariaLabelledBy ? undefined : ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={invalid || undefined}\n className={classNames('cratis-tag-group__input', pt?.input?.className)}\n data-cratis-part='input'\n data-invalid={invalid || undefined}\n onChange={(event) => setDraft(event.currentTarget.value)}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || separators.includes(event.key)) {\n event.preventDefault();\n add([draft]);\n } else if (\n event.key === 'Backspace' &&\n draft === '' &&\n value.length > 0\n ) {\n onChange(value.slice(0, -1));\n }\n }}\n onPaste={(event) => {\n const text = event.clipboardData.getData('text');\n if (!separators.some((separator) => text.includes(separator))) return;\n event.preventDefault();\n add(splitOn(text));\n }}\n onBlur={() => {\n if (draft.trim()) add([draft]);\n }}\n />\n )}\n </div>\n );\n};\n\n/** Escapes a separator for use inside a character class, so a `-` or `]` cannot reshape it. */\nconst escapeForClass = (separator: string) => separator.replace(/[\\\\\\]^-]/gu, '\\\\$&');\n"],"names":["_jsxs","_jsx","AriaTagGroup","AriaTagList","AriaTag","AriaButton"],"mappings":";;;;;;;AAsG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IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;wBACzD,KAAK,CAAC,cAAc,EAAE;AACtB,wBAAA,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;oBAChB;AAAO,yBAAA,IACH,KAAK,CAAC,GAAG,KAAK,WAAW;AACzB,wBAAA,KAAK,KAAK,EAAE;AACZ,wBAAA,KAAK,CAAC,MAAM,GAAG,CAAC,EAClB;wBACE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBAChC;AACJ,gBAAA,CAAC,EACD,OAAO,EAAE,CAAC,KAAK,KAAI;oBACf,MAAM,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC;AAChD,oBAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;wBAAE;oBAC/D,KAAK,CAAC,cAAc,EAAE;AACtB,oBAAA,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACtB,gBAAA,CAAC,EACD,MAAM,EAAE,MAAK;oBACT,IAAI,KAAK,CAAC,IAAI,EAAE;AAAE,wBAAA,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AAClC,gBAAA,CAAC,EAAA,CACH,CACL,CAAA,EAAA,CACC;AAEd;AAGA,MAAM,cAAc,GAAG,CAAC,SAAiB,KAAK,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;;"}
1
+ {"version":3,"file":"TagGroup.js","sources":["../../../Common/TagGroup.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 useId,\n useState,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type Key,\n type ReactNode,\n} from 'react';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n TagList as AriaTagList,\n} from 'react-aria-components/TagGroup';\nimport { Button as AriaButton } from 'react-aria-components/Button';\nimport { useCratisIcon } from '../configuration/useCratisIcon';\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 TagGroup} part: class, style, title and data attributes. */\nexport type TagGroupPartAttributes = Pick<\n HTMLAttributes<HTMLElement>,\n 'className' | 'style' | 'title'\n> & {\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n};\n\n/** Stable Cratis-owned parts for styling a {@link TagGroup}. */\nexport interface TagGroupParts {\n /** The element wrapping the tags and the entry. */\n root?: TagGroupPartAttributes;\n /** The tag list. */\n list?: TagGroupPartAttributes;\n /** One tag. */\n tag?: TagGroupPartAttributes;\n /** A tag's remove button. */\n remove?: TagGroupPartAttributes;\n /** The text entry that adds a value. */\n input?: InputHTMLAttributes<HTMLInputElement>;\n}\n\nconst tagGroupPartsMatchManifest: ExactPartKeys<TagGroupParts, PartsOf<'TagGroup'>> = true;\nvoid tagGroupPartsMatchManifest;\n\n/** Props for {@link TagGroup}. */\nexport interface TagGroupProps {\n /** Current values, in display order. */\n value: string[];\n /** Called with the next list whenever a value is added or removed. */\n onChange: (value: string[]) => void;\n /**\n * Whether a text entry is offered for adding values. A group without one is a read-only display\n * of removable tags.\n */\n editable?: boolean;\n /** Placeholder for the text entry. */\n placeholder?: string;\n /**\n * Characters that commit the typed value in addition to Enter. Defaults to a comma. A pasted\n * string is split on the same separators, so pasting a comma-separated list adds each value.\n */\n separators?: string[];\n /** Whether a duplicate of an existing value is accepted. Defaults to `false`. */\n allowDuplicates?: boolean;\n /** Whether the whole control is disabled. */\n disabled?: boolean;\n /** Accessible name for the group. */\n 'aria-label'?: string;\n /** Id of the element naming the group. */\n 'aria-labelledby'?: string;\n /** Id of the element describing the control — typically a field's error or hint text. */\n 'aria-describedby'?: string;\n /** Marks the text entry invalid for assistive technology. */\n invalid?: boolean;\n /** Id forwarded to the text entry so an external `<label htmlFor>` associates with it. */\n id?: string;\n /** Accessible label for a tag's remove button. Receives the tag's value. */\n removeLabel?: (value: string) => string;\n /**\n * Glyph inside a tag's remove button. Names this one tag group and wins over the provider's\n * `icons.remove`; defaults to a multiplication sign when neither is set. The button, its\n * accessible name and its keyboard behaviour are unaffected.\n */\n removeIcon?: ReactNode;\n /** Extra class name for the root element. */\n className?: string;\n /** Cratis-owned per-part attributes. */\n pt?: TagGroupParts;\n}\n\n/**\n * A group of removable values with an optional text entry — the control behind a tag or chips field.\n *\n * Every tag is reachable with the arrow keys and removable with Backspace or Delete, which is what\n * the `grid`/`row` semantics React Aria gives a tag group promise; a row of `<span>`s with a close\n * button cannot be operated from the keyboard at all. In the entry, Enter and each configured\n * separator commit the typed value, Backspace on an empty entry removes the last tag, and a pasted\n * string is split on the separators.\n */\nexport const TagGroup = ({\n value,\n onChange,\n editable = true,\n placeholder,\n separators = [','],\n allowDuplicates = false,\n disabled = false,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n invalid = false,\n id,\n removeLabel,\n removeIcon,\n className,\n pt,\n}: TagGroupProps) => {\n const icon = useCratisIcon();\n const resolvedRemoveIcon = icon('remove', '×', removeIcon);\n const generatedId = useId();\n const inputId = id ?? `cratis-tag-group-${generatedId}`;\n const [draft, setDraft] = useState('');\n\n const add = (candidates: string[]) => {\n const next = [...value];\n for (const candidate of candidates) {\n const trimmed = candidate.trim();\n if (!trimmed) continue;\n if (!allowDuplicates && next.includes(trimmed)) continue;\n next.push(trimmed);\n }\n if (next.length !== value.length) onChange(next);\n setDraft('');\n };\n\n const remove = (keys: Set<Key>) =>\n onChange(value.filter((entry) => !keys.has(entry)));\n\n const splitOn = (text: string) =>\n separators.length === 0\n ? [text]\n : text.split(new RegExp(`[${separators.map(escapeForClass).join('')}]`));\n\n return (\n <div\n {...pt?.root}\n className={classNames('cratis-tag-group', pt?.root?.className, className)}\n data-cratis-part='root'\n data-cratis-component='TagGroup'\n data-disabled={disabled || undefined}\n data-invalid={invalid || undefined}\n >\n <AriaTagGroup\n // React Aria renders a wrapper here. It generates a block box, which would trap the\n // tags in their own formatting context — the root's flex layout, and therefore the\n // gap between tags, would never reach them. It has no part on purpose: it is not a\n // styling surface, it just has to disappear from layout.\n className='cratis-tag-group__group'\n selectionMode='none'\n onRemove={remove}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n <AriaTagList\n {...pt?.list}\n items={value.map((entry) => ({ id: entry }))}\n className={classNames('cratis-tag-group__list', pt?.list?.className)}\n data-cratis-part='list'\n >\n {(item: { id: string }) => (\n <AriaTag\n {...pt?.tag}\n id={item.id}\n textValue={item.id}\n isDisabled={disabled}\n className={classNames('cratis-tag-group__tag', pt?.tag?.className)}\n data-cratis-part='tag'\n data-disabled={disabled || undefined}\n >\n <span className='cratis-tag-group__tag-label'>{item.id}</span>\n {!disabled && (\n <AriaButton\n {...pt?.remove}\n slot='remove'\n aria-label={removeLabel?.(item.id)}\n className={classNames(\n 'cratis-tag-group__remove',\n pt?.remove?.className,\n )}\n data-cratis-part='remove'\n >\n <span aria-hidden='true'>{resolvedRemoveIcon}</span>\n </AriaButton>\n )}\n </AriaTag>\n )}\n </AriaTagList>\n </AriaTagGroup>\n {editable && (\n <input\n {...pt?.input}\n id={inputId}\n type='text'\n value={draft}\n disabled={disabled}\n placeholder={placeholder}\n aria-label={ariaLabelledBy ? undefined : ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={invalid || undefined}\n className={classNames('cratis-tag-group__input', pt?.input?.className)}\n data-cratis-part='input'\n data-invalid={invalid || undefined}\n onChange={(event) => setDraft(event.currentTarget.value)}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || separators.includes(event.key)) {\n event.preventDefault();\n add([draft]);\n } else if (\n event.key === 'Backspace' &&\n draft === '' &&\n value.length > 0\n ) {\n onChange(value.slice(0, -1));\n }\n }}\n onPaste={(event) => {\n const text = event.clipboardData.getData('text');\n if (!separators.some((separator) => text.includes(separator))) return;\n event.preventDefault();\n add(splitOn(text));\n }}\n onBlur={() => {\n if (draft.trim()) add([draft]);\n }}\n />\n )}\n </div>\n );\n};\n\n/** Escapes a separator for use inside a character class, so a `-` or `]` cannot reshape it. */\nconst escapeForClass = (separator: string) => separator.replace(/[\\\\\\]^-]/gu, '\\\\$&');\n"],"names":["_jsxs","_jsx","AriaTagGroup","AriaTagList","AriaTag","AriaButton"],"mappings":";;;;;;;AAsGO,MAAM,QAAQ,GAAG,CAAC,EACrB,KAAK,EACL,QAAQ,EACR,QAAQ,GAAG,IAAI,EACf,WAAW,EACX,UAAU,GAAG,CAAC,GAAG,CAAC,EAClB,eAAe,GAAG,KAAK,EACvB,QAAQ,GAAG,KAAK,EAChB,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAAE,eAAe,EACnC,OAAO,GAAG,KAAK,EACf,EAAE,EACF,WAAW,EACX,UAAU,EACV,SAAS,EACT,EAAE,GACU,KAAI;AAChB,IAAA,MAAM,IAAI,GAAG,aAAa,EAAE;IAC5B,MAAM,kBAAkB,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,UAAU,CAAC;AAC1D,IAAA,MAAM,WAAW,GAAG,KAAK,EAAE;AAC3B,IAAA,MAAM,OAAO,GAAG,EAAE,IAAI,CAAA,iBAAA,EAAoB,WAAW,EAAE;IACvD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC;AAEtC,IAAA,MAAM,GAAG,GAAG,CAAC,UAAoB,KAAI;AACjC,QAAA,MAAM,IAAI,GAAG,CAAC,GAAG,KAAK,CAAC;AACvB,QAAA,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;AAChC,YAAA,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,EAAE;AAChC,YAAA,IAAI,CAAC,O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CAAC,CAAC;AAClC,gBAAA,CAAC,EAAA,CACH,CACL,CAAA,EAAA,CACC;AAEd;AAGA,MAAM,cAAc,GAAG,CAAC,SAAiB,KAAK,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../Common/TextArea.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAAwB,CAAC;AAQ5D,gEAAgE;AAChE,MAAM,WAAW,aAAa;IAC1B,+BAA+B;IAC/B,IAAI,CAAC,EAAE,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;CACtD;AAKD,kCAAkC;AAClC,MAAM,WAAW,aAAc,SAAQ,IAAI,CACvC,sBAAsB,CAAC,mBAAmB,CAAC,EAC3C,UAAU,CACb;IACG,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC,wCAAwC;IACxC,EAAE,CAAC,EAAE,aAAa,CAAC;CACtB;AAQD,gGAAgG;AAChG,eAAO,MAAM,QAAQ,+GAQpB,CAAC"}
1
+ {"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../Common/TextArea.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAAwB,CAAC;AAU5D,gEAAgE;AAChE,MAAM,WAAW,aAAa;IAC1B,+BAA+B;IAC/B,IAAI,CAAC,EAAE,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;CACtD;AAKD,kCAAkC;AAClC,MAAM,WAAW,aAAc,SAAQ,IAAI,CACvC,sBAAsB,CAAC,mBAAmB,CAAC,EAC3C,UAAU,CACb;IACG,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC,wCAAwC;IACxC,EAAE,CAAC,EAAE,aAAa,CAAC;CACtB;AAQD,gGAAgG;AAChG,eAAO,MAAM,QAAQ,+GAapB,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 { TextAreaImplementation } from './TextAreaImplementation.js';
5
+ import { useComponentPresentation } from '../configuration/identity/useComponentPresentation.js';
6
+ import { textAreaDescriptor } from './textFieldDescriptors.js';
5
7
 
6
8
  const coreTextAreaDeclaration = Object.freeze({
7
9
  mode: 'presentation',
@@ -10,7 +12,8 @@ const coreTextAreaDeclaration = Object.freeze({
10
12
  });
11
13
  const TextArea = forwardRef(function TextArea(props, ref) {
12
14
  const declaration = unstable_useSlot('common.textArea', coreTextAreaDeclaration);
13
- return renderSlot(declaration, props, ref);
15
+ const [presented, marker] = useComponentPresentation(textAreaDescriptor, props, props.id ?? props.name);
16
+ return renderSlot(declaration, { ...presented, ...marker }, ref);
14
17
  });
15
18
 
16
19
  export { TextArea };
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.js","sources":["../../../Common/TextArea.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, type TextareaHTMLAttributes } from 'react';\nimport type { ChangeHandler } from '../types/ChangeHandler';\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 { TextAreaImplementation } from './TextAreaImplementation';\n\n/** Stable Cratis-owned parts for styling a {@link TextArea}. */\nexport interface TextAreaParts {\n /** Native textarea element. */\n root?: TextareaHTMLAttributes<HTMLTextAreaElement>;\n}\n\nconst textAreaPartsMatchManifest: ExactPartKeys<TextAreaParts, PartsOf<'TextArea'>> = true;\nvoid textAreaPartsMatchManifest;\n\n/** Props for {@link TextArea}. */\nexport interface TextAreaProps extends Omit<\n TextareaHTMLAttributes<HTMLTextAreaElement>,\n 'onChange'\n> {\n /** Marks the textarea invalid and exposes the canonical invalid state. */\n invalid?: boolean;\n /** Receives the next string value and native user-event metadata. */\n onChange?: ChangeHandler<string>;\n /** Cratis-owned per-part attributes. */\n pt?: TextAreaParts;\n}\n\nconst coreTextAreaDeclaration = Object.freeze({\n mode: 'presentation',\n fidelity: 'native',\n render: TextAreaImplementation,\n}) satisfies unstable_SlotDeclaration<'common.textArea'>;\n\n/** A native multi-line text control with semantic value changes and stable Components parts. */\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(props, ref) {\n const declaration = unstable_useSlot(\n 'common.textArea',\n coreTextAreaDeclaration,\n );\n return renderSlot(declaration, props, ref);\n },\n);\n"],"names":[],"mappings":";;;;;AAkCA,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC;AAC1C,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE,sBAAsB;AACjC,CAAA,CAAuD;AAGjD,MAAM,QAAQ,GAAG,UAAU,CAC9B,SAAS,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAA;IACxB,MAAM,WAAW,GAAG,gBAAgB,CAChC,iBAAiB,EACjB,uBAAuB,CAC1B;IACD,OAAO,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC;AAC9C,CAAC;;"}
1
+ {"version":3,"file":"TextArea.js","sources":["../../../Common/TextArea.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, type TextareaHTMLAttributes } from 'react';\nimport type { ChangeHandler } from '../types/ChangeHandler';\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 { TextAreaImplementation } from './TextAreaImplementation';\nimport { useComponentPresentation } from '../configuration/identity/useComponentPresentation';\nimport { textAreaDescriptor } from './textFieldDescriptors';\n\n/** Stable Cratis-owned parts for styling a {@link TextArea}. */\nexport interface TextAreaParts {\n /** Native textarea element. */\n root?: TextareaHTMLAttributes<HTMLTextAreaElement>;\n}\n\nconst textAreaPartsMatchManifest: ExactPartKeys<TextAreaParts, PartsOf<'TextArea'>> = true;\nvoid textAreaPartsMatchManifest;\n\n/** Props for {@link TextArea}. */\nexport interface TextAreaProps extends Omit<\n TextareaHTMLAttributes<HTMLTextAreaElement>,\n 'onChange'\n> {\n /** Marks the textarea invalid and exposes the canonical invalid state. */\n invalid?: boolean;\n /** Receives the next string value and native user-event metadata. */\n onChange?: ChangeHandler<string>;\n /** Cratis-owned per-part attributes. */\n pt?: TextAreaParts;\n}\n\nconst coreTextAreaDeclaration = Object.freeze({\n mode: 'presentation',\n fidelity: 'native',\n render: TextAreaImplementation,\n}) satisfies unstable_SlotDeclaration<'common.textArea'>;\n\n/** A native multi-line text control with semantic value changes and stable Components parts. */\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(props, ref) {\n const declaration = unstable_useSlot(\n 'common.textArea',\n coreTextAreaDeclaration,\n );\n const [presented, marker] = useComponentPresentation(\n textAreaDescriptor,\n props,\n props.id ?? props.name,\n );\n return renderSlot(declaration, { ...presented, ...marker }, ref);\n },\n);\n"],"names":[],"mappings":";;;;;;;AAoCA,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC;AAC1C,IAAA,IAAI,EAAE,c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CAAwC;IACxC,EAAE,CAAC,EAAE,cAAc,CAAC;CACvB;AAQD,mFAAmF;AACnF,eAAO,MAAM,SAAS,6GAQrB,CAAC"}
1
+ {"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../Common/TextInput.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAAwB,CAAC;AAU5D,mEAAmE;AACnE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;AAErF,iEAAiE;AACjE,MAAM,WAAW,cAAc;IAC3B,4BAA4B;IAC5B,IAAI,CAAC,EAAE,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;CAChD;AAQD,mCAAmC;AACnC,MAAM,WAAW,cAAe,SAAQ,IAAI,CACxC,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,UAAU,GAAG,MAAM,CACtB;IACG,uDAAuD;IACvD,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,uEAAuE;IACvE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjC,wCAAwC;IACxC,EAAE,CAAC,EAAE,cAAc,CAAC;CACvB;AAQD,mFAAmF;AACnF,eAAO,MAAM,SAAS,6GAarB,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 { TextInputImplementation } from './TextInputImplementation.js';
5
+ import { useComponentPresentation } from '../configuration/identity/useComponentPresentation.js';
6
+ import { textInputDescriptor } from './textFieldDescriptors.js';
5
7
 
6
8
  const coreTextInputDeclaration = Object.freeze({
7
9
  mode: 'presentation',
@@ -10,7 +12,8 @@ const coreTextInputDeclaration = Object.freeze({
10
12
  });
11
13
  const TextInput = forwardRef(function TextInput(props, ref) {
12
14
  const declaration = unstable_useSlot('common.textInput', coreTextInputDeclaration);
13
- return renderSlot(declaration, props, ref);
15
+ const [presented, marker] = useComponentPresentation(textInputDescriptor, props, props.id ?? props.name);
16
+ return renderSlot(declaration, { ...presented, ...marker }, ref);
14
17
  });
15
18
 
16
19
  export { TextInput };
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.js","sources":["../../../Common/TextInput.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, type InputHTMLAttributes } from 'react';\nimport type { ChangeHandler } from '../types/ChangeHandler';\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 { TextInputImplementation } from './TextInputImplementation';\n\n/** Native text-like input types supported by {@link TextInput}. */\nexport type TextInputType = 'text' | 'email' | 'password' | 'search' | 'tel' | 'url';\n\n/** Stable Cratis-owned parts for styling a {@link TextInput}. */\nexport interface TextInputParts {\n /** Native input element. */\n root?: InputHTMLAttributes<HTMLInputElement>;\n}\n\nconst textInputPartsMatchManifest: ExactPartKeys<\n TextInputParts,\n PartsOf<'TextInput'>\n> = true;\nvoid textInputPartsMatchManifest;\n\n/** Props for {@link TextInput}. */\nexport interface TextInputProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'onChange' | 'type'\n> {\n /** Native text-like input type. Defaults to `text`. */\n type?: TextInputType;\n /** Marks the input invalid and exposes the canonical invalid state. */\n invalid?: boolean;\n /** Receives the next string value and native user-event metadata. */\n onChange?: ChangeHandler<string>;\n /** Cratis-owned per-part attributes. */\n pt?: TextInputParts;\n}\n\nconst coreTextInputDeclaration = Object.freeze({\n mode: 'presentation',\n fidelity: 'native',\n render: TextInputImplementation,\n}) satisfies unstable_SlotDeclaration<'common.textInput'>;\n\n/** A native text input with semantic value changes and stable Components parts. */\nexport const TextInput = forwardRef<HTMLInputElement, TextInputProps>(\n function TextInput(props, ref) {\n const declaration = unstable_useSlot(\n 'common.textInput',\n coreTextInputDeclaration,\n );\n return renderSlot(declaration, props, ref);\n },\n);\n"],"names":[],"mappings":";;;;;AA0CA,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,CAAC;AAC3C,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE,uBAAuB;AAClC,CAAA,CAAwD;AAGlD,MAAM,SAAS,GAAG,UAAU,CAC/B,SAAS,SAAS,CAAC,KAAK,EAAE,GAAG,EAAA;IACzB,MAAM,WAAW,GAAG,gBAAgB,CAChC,kBAAkB,EAClB,wBAAwB,CAC3B;IACD,OAAO,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC;AAC9C,CAAC;;"}
1
+ {"version":3,"file":"TextInput.js","sources":["../../../Common/TextInput.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, type InputHTMLAttributes } from 'react';\nimport type { ChangeHandler } from '../types/ChangeHandler';\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 { TextInputImplementation } from './TextInputImplementation';\nimport { useComponentPresentation } from '../configuration/identity/useComponentPresentation';\nimport { textInputDescriptor } from './textFieldDescriptors';\n\n/** Native text-like input types supported by {@link TextInput}. */\nexport type TextInputType = 'text' | 'email' | 'password' | 'search' | 'tel' | 'url';\n\n/** Stable Cratis-owned parts for styling a {@link TextInput}. */\nexport interface TextInputParts {\n /** Native input element. */\n root?: InputHTMLAttributes<HTMLInputElement>;\n}\n\nconst textInputPartsMatchManifest: ExactPartKeys<\n TextInputParts,\n PartsOf<'TextInput'>\n> = true;\nvoid textInputPartsMatchManifest;\n\n/** Props for {@link TextInput}. */\nexport interface TextInputProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'onChange' | 'type'\n> {\n /** Native text-like input type. Defaults to `text`. */\n type?: TextInputType;\n /** Marks the input invalid and exposes the canonical invalid state. */\n invalid?: boolean;\n /** Receives the next string value and native user-event metadata. */\n onChange?: ChangeHandler<string>;\n /** Cratis-owned per-part attributes. */\n pt?: TextInputParts;\n}\n\nconst coreTextInputDeclaration = Object.freeze({\n mode: 'presentation',\n fidelity: 'native',\n render: TextInputImplementation,\n}) satisfies unstable_SlotDeclaration<'common.textInput'>;\n\n/** A native text input with semantic value changes and stable Components parts. */\nexport const TextInput = forwardRef<HTMLInputElement, TextInputProps>(\n function TextInput(props, ref) {\n const declaration = unstable_useSlot(\n 'common.textInput',\n coreTextInputDeclaration,\n );\n const [presented, marker] = useComponentPresentation(\n textInputDescriptor,\n props,\n props.id ?? props.name,\n );\n return renderSlot(declaration, { ...presented, ...marker }, ref);\n },\n);\n"],"names":[],"mappings":";;;;;;;AA4CA,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,CAAC;AAC3C,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE,uBAAuB;AAClC,CAAA,CAAwD;AAGlD,MAAM,SAAS,GAAG,UAAU,CAC/B,SAAS,SAAS,CAAC,KAAK,EAAE,GAAG,EAAA;IACzB,MAAM,WAAW,GAAG,gBAAgB,CAChC,kBAAkB,EAClB,wBAAwB,CAC3B;IACD,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,wBAAwB,CAChD,mBAAmB,EACnB,KAAK,EACL,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,IAAI,CACzB;AACD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AE,yBAAyB,CAAC;IACnC,kFAAkF;IAClF,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,yBAAyB;IACzB,KAAK,CAAC,EAAE,yBAAyB,CAAC;CACrC;AAQD,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC7B,mFAAmF;IACnF,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,uFAAuF;IACvF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yFAAyF;IACzF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,EAAE,CAAC,EAAE,gBAAgB,CAAC;CACzB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,qKAWrB,gBAAgB,gCA2ElB,CAAC"}
@@ -11,7 +11,7 @@ const ToggleGroup = ({ options, value, onChange, disabled = false, 'aria-label':
11
11
  const [selected] = [...keys];
12
12
  if (selected !== undefined && selected !== value)
13
13
  onChange(String(selected));
14
- }, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, className: classNames('cratis-toggle-group', pt?.root?.className, className), "data-cratis-part": 'root', "data-disabled": disabled || undefined, "data-invalid": invalid || undefined, children: options.map((option) => (jsxs(ToggleButton, { ...pt?.option, id: option.value, isDisabled: disabled || option.disabled, excludeFromTabOrder: option.value !== tabStop, className: classNames('cratis-toggle-group__option', pt?.option?.className), "data-cratis-part": 'option', "data-selected": option.value === value || undefined, "data-disabled": disabled || option.disabled || undefined, "data-invalid": invalid || undefined, children: [option.icon !== undefined && (jsx("span", { ...pt?.icon, "aria-hidden": 'true', className: classNames('cratis-toggle-group__icon', pt?.icon?.className), "data-cratis-part": 'icon', children: option.icon })), jsx("span", { ...pt?.label, className: classNames('cratis-toggle-group__label', pt?.label?.className), "data-cratis-part": 'label', children: option.label })] }, option.value))) }));
14
+ }, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, className: classNames('cratis-toggle-group', pt?.root?.className, className), "data-cratis-part": 'root', "data-cratis-component": 'ToggleGroup', "data-disabled": disabled || undefined, "data-invalid": invalid || undefined, children: options.map((option) => (jsxs(ToggleButton, { ...pt?.option, id: option.value, isDisabled: disabled || option.disabled, excludeFromTabOrder: option.value !== tabStop, className: classNames('cratis-toggle-group__option', pt?.option?.className), "data-cratis-part": 'option', "data-selected": option.value === value || undefined, "data-disabled": disabled || option.disabled || undefined, "data-invalid": invalid || undefined, children: [option.icon !== undefined && (jsx("span", { ...pt?.icon, "aria-hidden": 'true', className: classNames('cratis-toggle-group__icon', pt?.icon?.className), "data-cratis-part": 'icon', children: option.icon })), jsx("span", { ...pt?.label, className: classNames('cratis-toggle-group__label', pt?.label?.className), "data-cratis-part": 'label', children: option.label })] }, option.value))) }));
15
15
  };
16
16
 
17
17
  export { ToggleGroup };
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleGroup.js","sources":["../../../Common/ToggleGroup.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 Key, type ReactNode } from 'react';\nimport {\n ToggleButton as AriaToggleButton,\n ToggleButtonGroup as AriaToggleButtonGroup,\n} from 'react-aria-components/ToggleButtonGroup';\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 ToggleGroup} part: class, style, title and data attributes. */\nexport type ToggleGroupPartAttributes = Pick<\n HTMLAttributes<HTMLElement>,\n 'className' | 'style' | 'title'\n> & {\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n};\n\n/** One choice in a {@link ToggleGroup}. */\nexport interface ToggleGroupOption {\n /** Value this option selects. */\n value: string;\n /** Visible label. */\n label: ReactNode;\n /** Content rendered before the label — an icon, a swatch. Decorative. */\n icon?: ReactNode;\n /** Whether this option cannot be chosen. */\n disabled?: boolean;\n}\n\n/** Stable Cratis-owned parts for styling a {@link ToggleGroup}. */\nexport interface ToggleGroupParts {\n /** The group element. */\n root?: ToggleGroupPartAttributes;\n /** One selectable option. */\n option?: ToggleGroupPartAttributes;\n /** An option's leading icon wrapper, rendered only for an option that has one. */\n icon?: ToggleGroupPartAttributes;\n /** An option's label. */\n label?: ToggleGroupPartAttributes;\n}\n\nconst toggleGroupPartsMatchManifest: ExactPartKeys<\n ToggleGroupParts,\n PartsOf<'ToggleGroup'>\n> = true;\nvoid toggleGroupPartsMatchManifest;\n\n/** Props for {@link ToggleGroup}. */\nexport interface ToggleGroupProps {\n /** The choices, in display order. Two to four is the shape this control is for. */\n options: ToggleGroupOption[];\n /** Currently selected value. */\n value: string;\n /** Called with the newly selected value. A click on the selected option is ignored. */\n onChange: (value: string) => void;\n /** Whether every option is disabled. */\n disabled?: boolean;\n /**\n * Id of the element naming this control. A group has no single labelable element, so an external\n * `<label>` associates by id rather than `htmlFor`.\n */\n 'aria-labelledby'?: string;\n /** Accessible name, when no visible label names the control. */\n 'aria-label'?: string;\n /** Id of the element describing the control — typically a field's error or hint text. */\n 'aria-describedby'?: string;\n /** Marks the control invalid for assistive technology. */\n invalid?: boolean;\n /** Extra class name for the group element. */\n className?: string;\n /** Cratis-owned per-part attributes. */\n pt?: ToggleGroupParts;\n}\n\n/**\n * A single-selection group of exclusive choices — a segmented control.\n *\n * This is a *value* choice, not a panel switcher: it carries `radiogroup`/`radio` semantics from\n * React Aria's `ToggleButtonGroup`, not `tablist`/`tab`, and the arrow keys those semantics promise\n * move the selection. Reach for `Tabs` when the choice reveals a panel of content instead.\n *\n * The group is a single tab stop, as a radio group is: `Tab` moves into and out of it, and the arrow\n * keys move within it. The selected option carries the stop, or the first enabled option when the\n * value matches none.\n */\nexport const ToggleGroup = ({\n options,\n value,\n onChange,\n disabled = false,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n invalid = false,\n className,\n pt,\n}: ToggleGroupProps) => {\n // A radio group is one tab stop: Tab reaches the group, the arrows move inside it. React Aria's\n // ToggleButtonGroup keeps every button tabbable, which is toolbar behaviour and would make a\n // four-option group cost four stops, so the stop is placed here instead.\n const enabled = options.filter((option) => !option.disabled);\n const tabStop = enabled.some((option) => option.value === value)\n ? value\n : enabled[0]?.value;\n\n return (\n <AriaToggleButtonGroup\n {...pt?.root}\n selectionMode='single'\n disallowEmptySelection\n selectedKeys={[value]}\n isDisabled={disabled}\n onSelectionChange={(keys: Set<Key>) => {\n // React Aria reports the whole selection; single selection with an empty set disallowed\n // means exactly one key, and re-selecting the current one reports it unchanged.\n const [selected] = [...keys];\n if (selected !== undefined && selected !== value)\n onChange(String(selected));\n }}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n className={classNames('cratis-toggle-group', pt?.root?.className, className)}\n data-cratis-part='root'\n data-disabled={disabled || undefined}\n data-invalid={invalid || undefined}\n >\n {options.map((option) => (\n <AriaToggleButton\n key={option.value}\n {...pt?.option}\n id={option.value}\n isDisabled={disabled || option.disabled}\n excludeFromTabOrder={option.value !== tabStop}\n className={classNames(\n 'cratis-toggle-group__option',\n pt?.option?.className,\n )}\n data-cratis-part='option'\n data-selected={option.value === value || undefined}\n data-disabled={disabled || option.disabled || undefined}\n data-invalid={invalid || undefined}\n >\n {option.icon !== undefined && (\n <span\n {...pt?.icon}\n aria-hidden='true'\n className={classNames(\n 'cratis-toggle-group__icon',\n pt?.icon?.className,\n )}\n data-cratis-part='icon'\n >\n {option.icon}\n </span>\n )}\n <span\n {...pt?.label}\n className={classNames(\n 'cratis-toggle-group__label',\n pt?.label?.className,\n )}\n data-cratis-part='label'\n >\n {option.label}\n </span>\n </AriaToggleButton>\n ))}\n </AriaToggleButtonGroup>\n );\n};\n"],"names":["_jsx","AriaToggleButtonGroup","_jsxs","AriaToggleButton"],"mappings":";;;;AAwFO,MAAM,WAAW,GAAG,CAAC,EACxB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAAE,eAAe,EACnC,OAAO,GAAG,KAAK,EACf,SAAS,EACT,EAAE,GACa,KAAI;AAInB,IAAA,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC5D,IAAA,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,KAAK,KAAK;AAC3D,UAAE;AACF,UAAE,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK;AAEvB,IAAA,QACIA,GAAA,CAACC,iBAAqB,EAAA,EAAA,GACd,EAAE,EAAE,IAAI,EACZ,aAAa,EAAC,QAAQ,EACtB,sBAAsB,EAAA,IAAA,EACtB,YAAY,EAAE,CAAC,KAAK,CAAC,EACrB,UAAU,EAAE,QAAQ,EACpB,iBAAiB,EAAE,CAAC,IAAc,KAAI;YAGlC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AAC5B,YAAA,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,KAAK;AAC5C,gBAAA,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAClC,QAAA,CAAC,gBACW,SAAS,EAAA,iBAAA,EACJ,cAAc,EA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AC,KAAK,CAqCF,CACtB,CAAC,EAAA,CACkB;AAEhC;;"}
1
+ {"version":3,"file":"ToggleGroup.js","sources":["../../../Common/ToggleGroup.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 Key, type ReactNode } from 'react';\nimport {\n ToggleButton as AriaToggleButton,\n ToggleButtonGroup as AriaToggleButtonGroup,\n} from 'react-aria-components/ToggleButtonGroup';\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 ToggleGroup} part: class, style, title and data attributes. */\nexport type ToggleGroupPartAttributes = Pick<\n HTMLAttributes<HTMLElement>,\n 'className' | 'style' | 'title'\n> & {\n [dataAttribute: `data-${string}`]: string | number | boolean | undefined;\n};\n\n/** One choice in a {@link ToggleGroup}. */\nexport interface ToggleGroupOption {\n /** Value this option selects. */\n value: string;\n /** Visible label. */\n label: ReactNode;\n /** Content rendered before the label — an icon, a swatch. Decorative. */\n icon?: ReactNode;\n /** Whether this option cannot be chosen. */\n disabled?: boolean;\n}\n\n/** Stable Cratis-owned parts for styling a {@link ToggleGroup}. */\nexport interface ToggleGroupParts {\n /** The group element. */\n root?: ToggleGroupPartAttributes;\n /** One selectable option. */\n option?: ToggleGroupPartAttributes;\n /** An option's leading icon wrapper, rendered only for an option that has one. */\n icon?: ToggleGroupPartAttributes;\n /** An option's label. */\n label?: ToggleGroupPartAttributes;\n}\n\nconst toggleGroupPartsMatchManifest: ExactPartKeys<\n ToggleGroupParts,\n PartsOf<'ToggleGroup'>\n> = true;\nvoid toggleGroupPartsMatchManifest;\n\n/** Props for {@link ToggleGroup}. */\nexport interface ToggleGroupProps {\n /** The choices, in display order. Two to four is the shape this control is for. */\n options: ToggleGroupOption[];\n /** Currently selected value. */\n value: string;\n /** Called with the newly selected value. A click on the selected option is ignored. */\n onChange: (value: string) => void;\n /** Whether every option is disabled. */\n disabled?: boolean;\n /**\n * Id of the element naming this control. A group has no single labelable element, so an external\n * `<label>` associates by id rather than `htmlFor`.\n */\n 'aria-labelledby'?: string;\n /** Accessible name, when no visible label names the control. */\n 'aria-label'?: string;\n /** Id of the element describing the control — typically a field's error or hint text. */\n 'aria-describedby'?: string;\n /** Marks the control invalid for assistive technology. */\n invalid?: boolean;\n /** Extra class name for the group element. */\n className?: string;\n /** Cratis-owned per-part attributes. */\n pt?: ToggleGroupParts;\n}\n\n/**\n * A single-selection group of exclusive choices — a segmented control.\n *\n * This is a *value* choice, not a panel switcher: it carries `radiogroup`/`radio` semantics from\n * React Aria's `ToggleButtonGroup`, not `tablist`/`tab`, and the arrow keys those semantics promise\n * move the selection. Reach for `Tabs` when the choice reveals a panel of content instead.\n *\n * The group is a single tab stop, as a radio group is: `Tab` moves into and out of it, and the arrow\n * keys move within it. The selected option carries the stop, or the first enabled option when the\n * value matches none.\n */\nexport const ToggleGroup = ({\n options,\n value,\n onChange,\n disabled = false,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n invalid = false,\n className,\n pt,\n}: ToggleGroupProps) => {\n // A radio group is one tab stop: Tab reaches the group, the arrows move inside it. React Aria's\n // ToggleButtonGroup keeps every button tabbable, which is toolbar behaviour and would make a\n // four-option group cost four stops, so the stop is placed here instead.\n const enabled = options.filter((option) => !option.disabled);\n const tabStop = enabled.some((option) => option.value === value)\n ? value\n : enabled[0]?.value;\n\n return (\n <AriaToggleButtonGroup\n {...pt?.root}\n selectionMode='single'\n disallowEmptySelection\n selectedKeys={[value]}\n isDisabled={disabled}\n onSelectionChange={(keys: Set<Key>) => {\n // React Aria reports the whole selection; single selection with an empty set disallowed\n // means exactly one key, and re-selecting the current one reports it unchanged.\n const [selected] = [...keys];\n if (selected !== undefined && selected !== value)\n onChange(String(selected));\n }}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n className={classNames('cratis-toggle-group', pt?.root?.className, className)}\n data-cratis-part='root'\n data-cratis-component='ToggleGroup'\n data-disabled={disabled || undefined}\n data-invalid={invalid || undefined}\n >\n {options.map((option) => (\n <AriaToggleButton\n key={option.value}\n {...pt?.option}\n id={option.value}\n isDisabled={disabled || option.disabled}\n excludeFromTabOrder={option.value !== tabStop}\n className={classNames(\n 'cratis-toggle-group__option',\n pt?.option?.className,\n )}\n data-cratis-part='option'\n data-selected={option.value === value || undefined}\n data-disabled={disabled || option.disabled || undefined}\n data-invalid={invalid || undefined}\n >\n {option.icon !== undefined && (\n <span\n {...pt?.icon}\n aria-hidden='true'\n className={classNames(\n 'cratis-toggle-group__icon',\n pt?.icon?.className,\n )}\n data-cratis-part='icon'\n >\n {option.icon}\n </span>\n )}\n <span\n {...pt?.label}\n className={classNames(\n 'cratis-toggle-group__label',\n pt?.label?.className,\n )}\n data-cratis-part='label'\n >\n {option.label}\n </span>\n </AriaToggleButton>\n ))}\n </AriaToggleButtonGroup>\n );\n};\n"],"names":["_jsx","AriaToggleButtonGroup","_jsxs","AriaToggleButton"],"mappings":";;;;AAwFO,MAAM,WAAW,GAAG,CAAC,EACxB,OAAO,EACP,KAAK,EACL,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAAE,eAAe,EACnC,OAAO,GAAG,KAAK,EACf,SAAS,EACT,EAAE,GACa,KAAI;AAInB,IAAA,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC5D,IAAA,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,KAAK,KAAK;AAC3D,UAAE;AACF,UAAE,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK;AAEvB,IAAA,QACIA,GA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,EAAE,EAAE,IAAI,EAAA,aAAA,EACA,MAAM,EAClB,SAAS,EAAE,UAAU,CACjB,2BAA2B,EAC3B,EAAE,EAAE,IAAI,EAAE,SAAS,CACtB,EAAA,kBAAA,EACgB,MAAM,EAAA,QAAA,EAEtB,MAAM,CAAC,IAAI,EAAA,CACT,CACV,EACDA,GAAA,CAAA,MAAA,EAAA,EAAA,GACQ,EAAE,EAAE,KAAK,EACb,SAAS,EAAE,UAAU,CACjB,4BAA4B,EAC5B,EAAE,EAAE,KAAK,EAAE,SAAS,CACvB,sBACgB,OAAO,EAAA,QAAA,EAEvB,MAAM,CAAC,KAAK,GACV,CAAA,EAAA,EApCF,MAAM,CAAC,KAAK,CAqCF,CACtB,CAAC,EAAA,CACkB;AAEhC;;"}
@@ -0,0 +1,7 @@
1
+ import type { ButtonProps } from './Button.js';
2
+ import type { IconButtonProps } from './IconButton.js';
3
+ /** Presentation props of {@link Button}. */
4
+ export declare const buttonDescriptor: import("../ComponentPicker/index.js").ComponentDescriptor<ButtonProps>;
5
+ /** Presentation props of {@link IconButton}. */
6
+ export declare const iconButtonDescriptor: import("../ComponentPicker/index.js").ComponentDescriptor<IconButtonProps>;
7
+ //# sourceMappingURL=buttonDescriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buttonDescriptor.d.ts","sourceRoot":"","sources":["../../../Common/buttonDescriptor.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAc,CAAC;AAsBpD,4CAA4C;AAC5C,eAAO,MAAM,gBAAgB,wEAA6D,CAAC;AAE3F,gDAAgD;AAChD,eAAO,MAAM,oBAAoB,4EAI/B,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { describeComponent } from '../configuration/identity/describeComponent.js';
2
+
3
+ const buttonProperties = [
4
+ { name: 'label', label: 'Label', type: 'string', description: 'The text on the button.' },
5
+ { name: 'tooltip', label: 'Tooltip', type: 'string', description: 'Text shown on hover and focus.' },
6
+ {
7
+ name: 'variant',
8
+ label: 'Variant',
9
+ type: 'enum',
10
+ values: ['solid', 'outline', 'ghost', 'link'],
11
+ defaultValue: 'solid',
12
+ },
13
+ {
14
+ name: 'tone',
15
+ label: 'Tone',
16
+ type: 'enum',
17
+ values: ['neutral', 'accent', 'positive', 'caution', 'critical'],
18
+ },
19
+ { name: 'shape', label: 'Shape', type: 'enum', values: ['default', 'pill'], defaultValue: 'default' },
20
+ { name: 'size', label: 'Size', type: 'enum', values: ['small', 'normal', 'large'], defaultValue: 'normal' },
21
+ ];
22
+ const buttonDescriptor = describeComponent('Button', buttonProperties);
23
+ const iconButtonDescriptor = describeComponent('IconButton', [
24
+ ...buttonProperties.filter((property) => property.name !== 'label'),
25
+ ]);
26
+
27
+ export { buttonDescriptor, iconButtonDescriptor };
28
+ //# sourceMappingURL=buttonDescriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buttonDescriptor.js","sources":["../../../Common/buttonDescriptor.ts"],"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 { describeComponent } from '../configuration/identity/describeComponent';\nimport type { PresentationPropertyDescriptor } from '../configuration/identity/PresentationPropertyDescriptor';\nimport type { ButtonProps } from './Button';\nimport type { IconButtonProps } from './IconButton';\n\nconst buttonProperties: readonly PresentationPropertyDescriptor<ButtonProps>[] = [\n { name: 'label', label: 'Label', type: 'string', description: 'The text on the button.' },\n { name: 'tooltip', label: 'Tooltip', type: 'string', description: 'Text shown on hover and focus.' },\n {\n name: 'variant',\n label: 'Variant',\n type: 'enum',\n values: ['solid', 'outline', 'ghost', 'link'],\n defaultValue: 'solid',\n },\n {\n name: 'tone',\n label: 'Tone',\n type: 'enum',\n values: ['neutral', 'accent', 'positive', 'caution', 'critical'],\n },\n { name: 'shape', label: 'Shape', type: 'enum', values: ['default', 'pill'], defaultValue: 'default' },\n { name: 'size', label: 'Size', type: 'enum', values: ['small', 'normal', 'large'], defaultValue: 'normal' },\n];\n\n/** Presentation props of {@link Button}. */\nexport const buttonDescriptor = describeComponent<ButtonProps>('Button', buttonProperties);\n\n/** Presentation props of {@link IconButton}. */\nexport const iconButtonDescriptor = describeComponent<IconButtonProps>('IconButton', [\n ...(buttonProperties.filter(\n (property) => property.name !== 'label',\n ) as unknown as PresentationPropertyDescriptor<IconButtonProps>[]),\n]);\n"],"names":[],"mappings":";;AAQA,MAAM,gBAAgB,GAA2D;AAC7E,IAAA,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB,EAAE;AACzF,IAAA,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;AACpG,IAAA;AACI,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC;AAC7C,QAAA,YAAY,EAAE,OAAO;AACxB,KAAA;AACD,IAAA;AACI,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,KAAK,EAAE,MAAM;AACb,QAAA,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC;AACnE,KAAA;IACD,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE;IACrG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE;CAC9G;AAGM,MAAM,gBAAgB,GAAG,iBAAiB,CAAc,QAAQ,EAAE,gBAAgB;AAGlF,MAAM,oBAAoB,GAAG,iBAAiB,CAAkB,YAAY,EAAE;AACjF,IAAA,GAAI,gBAAgB,CAAC,MAAM,CACvB,CAAC,QAAQ,KAAK,QAAQ,CAAC,IAAI,KAAK,OAAO,CACuB;AACrE,CAAA;;"}
@@ -0,0 +1,7 @@
1
+ import type { TextAreaProps } from './TextArea.js';
2
+ import type { TextInputProps } from './TextInput.js';
3
+ /** Presentation props of {@link TextInput}. */
4
+ export declare const textInputDescriptor: import("../ComponentPicker/index.js").ComponentDescriptor<TextInputProps>;
5
+ /** Presentation props of {@link TextArea}. */
6
+ export declare const textAreaDescriptor: import("../ComponentPicker/index.js").ComponentDescriptor<TextAreaProps>;
7
+ //# sourceMappingURL=textFieldDescriptors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textFieldDescriptors.d.ts","sourceRoot":"","sources":["../../../Common/textFieldDescriptors.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAY,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAa,CAAC;AAElD,+CAA+C;AAC/C,eAAO,MAAM,mBAAmB,2EAY9B,CAAC;AAEH,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,0EAM7B,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { describeComponent } from '../configuration/identity/describeComponent.js';
2
+
3
+ const textInputDescriptor = describeComponent('TextInput', [
4
+ { name: 'placeholder', label: 'Placeholder', type: 'string', description: 'Hint shown while the field is empty.' },
5
+ { name: 'invalid', label: 'Invalid', type: 'boolean', defaultValue: false },
6
+ { name: 'disabled', label: 'Disabled', type: 'boolean', defaultValue: false },
7
+ { name: 'readOnly', label: 'Read only', type: 'boolean', defaultValue: false },
8
+ {
9
+ name: 'type',
10
+ label: 'Input type',
11
+ type: 'enum',
12
+ values: ['text', 'email', 'password', 'search', 'tel', 'url'],
13
+ defaultValue: 'text',
14
+ },
15
+ ]);
16
+ const textAreaDescriptor = describeComponent('TextArea', [
17
+ { name: 'placeholder', label: 'Placeholder', type: 'string', description: 'Hint shown while the field is empty.' },
18
+ { name: 'rows', label: 'Rows', type: 'number' },
19
+ { name: 'invalid', label: 'Invalid', type: 'boolean', defaultValue: false },
20
+ { name: 'disabled', label: 'Disabled', type: 'boolean', defaultValue: false },
21
+ { name: 'readOnly', label: 'Read only', type: 'boolean', defaultValue: false },
22
+ ]);
23
+
24
+ export { textAreaDescriptor, textInputDescriptor };
25
+ //# sourceMappingURL=textFieldDescriptors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textFieldDescriptors.js","sources":["../../../Common/textFieldDescriptors.ts"],"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 { describeComponent } from '../configuration/identity/describeComponent';\nimport type { TextAreaProps } from './TextArea';\nimport type { TextInputProps } from './TextInput';\n\n/** Presentation props of {@link TextInput}. */\nexport const textInputDescriptor = describeComponent<TextInputProps>('TextInput', [\n { name: 'placeholder', label: 'Placeholder', type: 'string', description: 'Hint shown while the field is empty.' },\n { name: 'invalid', label: 'Invalid', type: 'boolean', defaultValue: false },\n { name: 'disabled', label: 'Disabled', type: 'boolean', defaultValue: false },\n { name: 'readOnly', label: 'Read only', type: 'boolean', defaultValue: false },\n {\n name: 'type',\n label: 'Input type',\n type: 'enum',\n values: ['text', 'email', 'password', 'search', 'tel', 'url'],\n defaultValue: 'text',\n },\n]);\n\n/** Presentation props of {@link TextArea}. */\nexport const textAreaDescriptor = describeComponent<TextAreaProps>('TextArea', [\n { name: 'placeholder', label: 'Placeholder', type: 'string', description: 'Hint shown while the field is empty.' },\n { name: 'rows', label: 'Rows', type: 'number' },\n { name: 'invalid', label: 'Invalid', type: 'boolean', defaultValue: false },\n { name: 'disabled', label: 'Disabled', type: 'boolean', defaultValue: false },\n { name: 'readOnly', label: 'Read only', type: 'boolean', defaultValue: false },\n]);\n"],"names":[],"mappings":";;AAQO,MAAM,mBAAmB,GAAG,iBAAiB,CAAiB,WAAW,EAAE;AAC9E,IAAA,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sCAAsC,EAAE;AAClH,IAAA,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE;AAC3E,IAAA,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE;AAC7E,IAAA,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE;AAC9E,IAAA;AACI,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,KAAK,EAAE,YAAY;AACnB,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC;AAC7D,QAAA,YAAY,EAAE,MAAM;AACvB,KAAA;AACJ,CAAA;AAGM,MAAM,kBAAkB,GAAG,iBAAiB,CAAgB,UAAU,EAAE;AAC3E,IAAA,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sCAAsC,EAAE;IAClH,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC/C,IAAA,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE;AAC3E,IAAA,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE;AAC7E,IAAA,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE;AACjF,CAAA;;"}
@@ -0,0 +1,14 @@
1
+ import type { PickedComponent } from './PickedComponent.js';
2
+ /** Props for {@link ComponentHighlight}. */
3
+ export interface ComponentHighlightProps {
4
+ /** The element or picked component to highlight. `null` draws nothing. */
5
+ target: Element | PickedComponent | null;
6
+ /** Overrides the name shown on the highlight. Defaults to the component name. */
7
+ label?: string;
8
+ }
9
+ /**
10
+ * A passive highlight of a component, for showing what a piece of feedback is about after picking.
11
+ * It never takes focus or pointer input, and is hidden from assistive technology.
12
+ */
13
+ export declare const ComponentHighlight: ({ target, label }: ComponentHighlightProps) => import("react").JSX.Element;
14
+ //# sourceMappingURL=ComponentHighlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentHighlight.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/ComponentHighlight.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAmB,CAAC;AAEzD,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACpC,0EAA0E;IAC1E,MAAM,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAAC;IACzC,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,sBAAuB,uBAAuB,gCAI5E,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { componentAttribute } from '../configuration/identity/componentIdentityAttributes.js';
3
+ import { HighlightFrame } from './HighlightFrame.js';
4
+
5
+ const ComponentHighlight = ({ target, label }) => {
6
+ const element = target === null ? null : 'element' in target ? target.element : target;
7
+ const name = label ?? element?.getAttribute(componentAttribute) ?? undefined;
8
+ return jsx(HighlightFrame, { element: element, label: name, kind: 'highlight' });
9
+ };
10
+
11
+ export { ComponentHighlight };
12
+ //# sourceMappingURL=ComponentHighlight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentHighlight.js","sources":["../../../ComponentPicker/ComponentHighlight.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 { componentAttribute } from '../configuration/identity/componentIdentityAttributes';\nimport { HighlightFrame } from './HighlightFrame';\nimport type { PickedComponent } from './PickedComponent';\n\n/** Props for {@link ComponentHighlight}. */\nexport interface ComponentHighlightProps {\n /** The element or picked component to highlight. `null` draws nothing. */\n target: Element | PickedComponent | null;\n /** Overrides the name shown on the highlight. Defaults to the component name. */\n label?: string;\n}\n\n/**\n * A passive highlight of a component, for showing what a piece of feedback is about after picking.\n * It never takes focus or pointer input, and is hidden from assistive technology.\n */\nexport const ComponentHighlight = ({ target, label }: ComponentHighlightProps) => {\n const element = target === null ? null : 'element' in target ? target.element : target;\n const name = label ?? element?.getAttribute(componentAttribute) ?? undefined;\n return <HighlightFrame element={element} label={name} kind='highlight' />;\n};\n"],"names":["_jsx"],"mappings":";;;;AAmBO,MAAM,kBAAkB,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAA2B,KAAI;IAC7E,MAAM,OAAO,GAAG,MAAM,KAAK,IAAI,GAAG,IAAI,GAAG,SAAS,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,GAAG,MAAM;AACtF,IAAA,MAAM,IAAI,GAAG,KAAK,IAAI,OAAO,EAAE,YAAY,CAAC,kBAAkB,CAAC,IAAI,SAAS;AAC5E,IAAA,OAAOA,GAAA,CAAC,cAAc,EAAA,EAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAC,WAAW,GAAG;AAC7E;;"}
@@ -0,0 +1,24 @@
1
+ import type { ComponentResolver } from './ComponentResolver.js';
2
+ import type { PickedComponent } from './PickedComponent.js';
3
+ /** Props for {@link ComponentPicker}. */
4
+ export interface ComponentPickerProps {
5
+ /** Whether picking is on. While it is off the picker listens to nothing and draws nothing. */
6
+ active: boolean;
7
+ /** Called with the component the user confirmed with a click or Enter. */
8
+ onPick: (picked: PickedComponent) => void;
9
+ /** Called when the user pressed Escape. */
10
+ onCancel: () => void;
11
+ /** Adds context from outside the library to each picked component. */
12
+ resolve?: ComponentResolver;
13
+ }
14
+ /**
15
+ * An overlay that lets the user point at a component. It highlights the component root under the
16
+ * pointer or the keyboard cursor and names it in a tooltip; a click or Enter confirms and Escape
17
+ * cancels. Arrow Up moves to the enclosing component, Arrow Down to its first child component and
18
+ * Arrow Left and Right to the neighbouring component. Inside an open dialog the keyboard stays in
19
+ * the topmost dialog, and the overlay stacks above it.
20
+ *
21
+ * Prefer {@link useComponentPicker}, which starts and stops picking imperatively.
22
+ */
23
+ export declare const ComponentPicker: ({ active, onPick, onCancel, resolve }: ComponentPickerProps) => import("react").JSX.Element | null;
24
+ //# sourceMappingURL=ComponentPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentPicker.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/ComponentPicker.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAqB,CAAC;AAE7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAmB,CAAC;AAEzD,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACjC,8FAA8F;IAC9F,MAAM,EAAE,OAAO,CAAC;IAChB,0EAA0E;IAC1E,MAAM,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1C,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,sEAAsE;IACtE,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC/B;AAYD;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,0CAA2C,oBAAoB,uCAwG1F,CAAC"}
@@ -0,0 +1,116 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useState, useRef, useEffect } from 'react';
3
+ import { componentAttribute, componentIdAttribute } from '../configuration/identity/componentIdentityAttributes.js';
4
+ import { nearestComponent, navigationScope, siblingComponents, childComponents, parentComponent } from './componentElements.js';
5
+ import { describeComponentElement } from './describeComponentElement.js';
6
+ import { HighlightFrame } from './HighlightFrame.js';
7
+
8
+ const insidePicker = (target) => target instanceof Element && target.closest('[data-cratis-picker-ignore]') !== null;
9
+ const nameOf = (component) => {
10
+ if (!component)
11
+ return undefined;
12
+ const name = component.getAttribute(componentAttribute);
13
+ const id = component.getAttribute(componentIdAttribute);
14
+ return id ? `${name} ${id}` : (name ?? undefined);
15
+ };
16
+ const ComponentPicker = ({ active, onPick, onCancel, resolve }) => {
17
+ const [current, setCurrent] = useState(null);
18
+ const latest = useRef({ current, onPick, onCancel, resolve });
19
+ latest.current = { current, onPick, onCancel, resolve };
20
+ useEffect(() => {
21
+ if (!active) {
22
+ setCurrent(null);
23
+ return;
24
+ }
25
+ setCurrent(nearestComponent(document.activeElement));
26
+ const hover = (event) => {
27
+ if (insidePicker(event.target))
28
+ return;
29
+ const target = event.target instanceof Element ? event.target : null;
30
+ setCurrent(nearestComponent(target));
31
+ };
32
+ const swallow = (event) => {
33
+ if (insidePicker(event.target))
34
+ return;
35
+ event.preventDefault();
36
+ event.stopImmediatePropagation();
37
+ };
38
+ const confirm = (component, target) => {
39
+ if (!component)
40
+ return;
41
+ latest.current.onPick(describeComponentElement(component, target, latest.current.resolve));
42
+ };
43
+ const click = (event) => {
44
+ if (insidePicker(event.target))
45
+ return;
46
+ swallow(event);
47
+ const target = event.target instanceof Element ? event.target : null;
48
+ confirm(nearestComponent(target), target);
49
+ };
50
+ const key = (event) => {
51
+ const handled = () => {
52
+ event.preventDefault();
53
+ event.stopImmediatePropagation();
54
+ };
55
+ const here = latest.current.current;
56
+ const scope = navigationScope(document);
57
+ const move = (next) => {
58
+ handled();
59
+ if (next)
60
+ setCurrent(next);
61
+ };
62
+ const first = () => scope.querySelector(`[${componentAttribute}]`);
63
+ switch (event.key) {
64
+ case 'Escape':
65
+ handled();
66
+ latest.current.onCancel();
67
+ break;
68
+ case 'Enter':
69
+ handled();
70
+ confirm(here, document.activeElement);
71
+ break;
72
+ case 'ArrowUp':
73
+ move(here ? (parentComponent(here) ?? here) : first());
74
+ break;
75
+ case 'ArrowDown':
76
+ move(here ? (childComponents(here)[0] ?? here) : first());
77
+ break;
78
+ case 'ArrowLeft':
79
+ case 'ArrowRight': {
80
+ if (!here) {
81
+ move(first());
82
+ break;
83
+ }
84
+ const siblings = siblingComponents(here, scope);
85
+ const index = siblings.indexOf(here);
86
+ const step = event.key === 'ArrowRight' ? 1 : -1;
87
+ move(siblings[(index + step + siblings.length) % siblings.length]);
88
+ break;
89
+ }
90
+ }
91
+ };
92
+ const swallowed = ['pointerdown', 'pointerup', 'mousedown', 'mouseup', 'touchstart', 'touchend', 'contextmenu'];
93
+ const hovering = ['pointermove', 'mousemove', 'focusin'];
94
+ for (const type of swallowed)
95
+ window.addEventListener(type, swallow, true);
96
+ for (const type of hovering)
97
+ window.addEventListener(type, hover, true);
98
+ window.addEventListener('click', click, true);
99
+ window.addEventListener('keydown', key, true);
100
+ return () => {
101
+ for (const type of swallowed)
102
+ window.removeEventListener(type, swallow, true);
103
+ for (const type of hovering)
104
+ window.removeEventListener(type, hover, true);
105
+ window.removeEventListener('click', click, true);
106
+ window.removeEventListener('keydown', key, true);
107
+ };
108
+ }, [active]);
109
+ if (!active)
110
+ return null;
111
+ const name = nameOf(current);
112
+ return (jsx(HighlightFrame, { element: current, label: name, kind: 'picker', announcement: name ? `${name}. Press Enter to pick, Escape to cancel.` : 'Move to a component, then press Enter to pick it or Escape to cancel.' }));
113
+ };
114
+
115
+ export { ComponentPicker };
116
+ //# sourceMappingURL=ComponentPicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentPicker.js","sources":["../../../ComponentPicker/ComponentPicker.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 { useEffect, useRef, useState } from 'react';\nimport {\n componentAttribute,\n componentIdAttribute,\n} from '../configuration/identity/componentIdentityAttributes';\nimport {\n childComponents,\n navigationScope,\n nearestComponent,\n parentComponent,\n siblingComponents,\n} from './componentElements';\nimport { describeComponentElement } from './describeComponentElement';\nimport type { ComponentResolver } from './ComponentResolver';\nimport { HighlightFrame } from './HighlightFrame';\nimport type { PickedComponent } from './PickedComponent';\n\n/** Props for {@link ComponentPicker}. */\nexport interface ComponentPickerProps {\n /** Whether picking is on. While it is off the picker listens to nothing and draws nothing. */\n active: boolean;\n /** Called with the component the user confirmed with a click or Enter. */\n onPick: (picked: PickedComponent) => void;\n /** Called when the user pressed Escape. */\n onCancel: () => void;\n /** Adds context from outside the library to each picked component. */\n resolve?: ComponentResolver;\n}\n\nconst insidePicker = (target: EventTarget | null) =>\n target instanceof Element && target.closest('[data-cratis-picker-ignore]') !== null;\n\nconst nameOf = (component: Element | null) => {\n if (!component) return undefined;\n const name = component.getAttribute(componentAttribute);\n const id = component.getAttribute(componentIdAttribute);\n return id ? `${name} ${id}` : (name ?? undefined);\n};\n\n/**\n * An overlay that lets the user point at a component. It highlights the component root under the\n * pointer or the keyboard cursor and names it in a tooltip; a click or Enter confirms and Escape\n * cancels. Arrow Up moves to the enclosing component, Arrow Down to its first child component and\n * Arrow Left and Right to the neighbouring component. Inside an open dialog the keyboard stays in\n * the topmost dialog, and the overlay stacks above it.\n *\n * Prefer {@link useComponentPicker}, which starts and stops picking imperatively.\n */\nexport const ComponentPicker = ({ active, onPick, onCancel, resolve }: ComponentPickerProps) => {\n const [current, setCurrent] = useState<Element | null>(null);\n const latest = useRef({ current, onPick, onCancel, resolve });\n latest.current = { current, onPick, onCancel, resolve };\n\n useEffect(() => {\n if (!active) {\n setCurrent(null);\n return;\n }\n setCurrent(nearestComponent(document.activeElement));\n\n const hover = (event: Event) => {\n if (insidePicker(event.target)) return;\n const target = event.target instanceof Element ? event.target : null;\n setCurrent(nearestComponent(target));\n };\n\n const swallow = (event: Event) => {\n if (insidePicker(event.target)) return;\n event.preventDefault();\n event.stopImmediatePropagation();\n };\n\n const confirm = (component: Element | null, target: Element | null) => {\n if (!component) return;\n latest.current.onPick(describeComponentElement(component, target, latest.current.resolve));\n };\n\n const click = (event: MouseEvent) => {\n if (insidePicker(event.target)) return;\n swallow(event);\n const target = event.target instanceof Element ? event.target : null;\n confirm(nearestComponent(target), target);\n };\n\n const key = (event: KeyboardEvent) => {\n const handled = () => {\n event.preventDefault();\n event.stopImmediatePropagation();\n };\n const here = latest.current.current;\n const scope = navigationScope(document);\n const move = (next: Element | null | undefined) => {\n handled();\n if (next) setCurrent(next);\n };\n const first = () => scope.querySelector(`[${componentAttribute}]`);\n switch (event.key) {\n case 'Escape':\n handled();\n latest.current.onCancel();\n break;\n case 'Enter':\n handled();\n confirm(here, document.activeElement);\n break;\n case 'ArrowUp':\n move(here ? (parentComponent(here) ?? here) : first());\n break;\n case 'ArrowDown':\n move(here ? (childComponents(here)[0] ?? here) : first());\n break;\n case 'ArrowLeft':\n case 'ArrowRight': {\n if (!here) {\n move(first());\n break;\n }\n const siblings = siblingComponents(here, scope);\n const index = siblings.indexOf(here);\n const step = event.key === 'ArrowRight' ? 1 : -1;\n move(siblings[(index + step + siblings.length) % siblings.length]);\n break;\n }\n default:\n break;\n }\n };\n\n const swallowed = ['pointerdown', 'pointerup', 'mousedown', 'mouseup', 'touchstart', 'touchend', 'contextmenu'];\n const hovering = ['pointermove', 'mousemove', 'focusin'];\n for (const type of swallowed) window.addEventListener(type, swallow, true);\n for (const type of hovering) window.addEventListener(type, hover, true);\n window.addEventListener('click', click, true);\n window.addEventListener('keydown', key, true);\n return () => {\n for (const type of swallowed) window.removeEventListener(type, swallow, true);\n for (const type of hovering) window.removeEventListener(type, hover, true);\n window.removeEventListener('click', click, true);\n window.removeEventListener('keydown', key, true);\n };\n }, [active]);\n\n if (!active) return null;\n const name = nameOf(current);\n return (\n <HighlightFrame\n element={current}\n label={name}\n kind='picker'\n announcement={name ? `${name}. Press Enter to pick, Escape to cancel.` : 'Move to a component, then press Enter to pick it or Escape to cancel.'}\n />\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;;AAgCA,MAAM,YAAY,GAAG,CAAC,MAA0B,KAC5C,MAAM,YAAY,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,6BAA6B,CAAC,KAAK,IAAI;AAEvF,MAAM,MAAM,GAAG,CAAC,SAAyB,KAAI;AACzC,IAAA,IAAI,CAAC,SAAS;AAAE,QAAA,OAAO,SAAS;IAChC,MAAM,IAAI,GAAG,SAAS,CAAC,YAAY,CAAC,kBAAkB,CAAC;IACvD,MAAM,EAAE,GAAG,SAAS,CAAC,YAAY,CAAC,oBAAoB,CAAC;AACvD,IAAA,OAAO,EAAE,GAAG,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,EAAE,CAAA,CAAE,IAAI,IAAI,IAAI,SAAS,CAAC;AACrD,CAAC;AAWM,MAAM,eAAe,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAwB,KAAI;IAC3F,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAiB,IAAI,CAAC;AAC5D,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC7D,IAAA,MAAM,CAAC,OAAO,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE;IAEvD,SAAS,CAAC,MAAK;QACX,IAAI,CAAC,MAA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CAAC;AAEZ,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,IAAI;AACxB,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC;AAC5B,IAAA,QACIA,GAAA,CAAC,cAAc,EAAA,EACX,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,IAAI,EACX,IAAI,EAAC,QAAQ,EACb,YAAY,EAAE,IAAI,GAAG,CAAA,EAAG,IAAI,CAAA,wCAAA,CAA0C,GAAG,uEAAuE,EAAA,CAClJ;AAEV;;"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Lets the host add context the library cannot know, for example a screen identity or the
3
+ * application slice an element belongs to. Receives the picked component root.
4
+ */
5
+ export type ComponentResolver = (element: Element) => Record<string, unknown> | undefined;
6
+ //# sourceMappingURL=ComponentResolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentResolver.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/ComponentResolver.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=ComponentResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentResolver.js","sourceRoot":"","sources":["../../../ComponentPicker/ComponentResolver.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG","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\n/**\n * Lets the host add context the library cannot know, for example a screen identity or the\n * application slice an element belongs to. Receives the picked component root.\n */\nexport type ComponentResolver = (element: Element) => Record<string, unknown> | undefined;\n"]}
@@ -0,0 +1,14 @@
1
+ /** Props for {@link HighlightFrame}. */
2
+ export interface HighlightFrameProps {
3
+ /** The element to frame. */
4
+ element: Element | null;
5
+ /** Text for the tooltip above (or below) the frame. */
6
+ label?: string;
7
+ /** Announced politely when the framed element changes. Omit for a passive, silent frame. */
8
+ announcement?: string;
9
+ /** Which overlay this is, rendered as `data-cratis-kind` so the two can be told apart. */
10
+ kind: 'picker' | 'highlight';
11
+ }
12
+ /** The shared outline and name tooltip drawn by {@link ComponentPicker} and {@link ComponentHighlight}. */
13
+ export declare const HighlightFrame: ({ element, label, announcement, kind }: HighlightFrameProps) => import("react").ReactPortal | null;
14
+ //# sourceMappingURL=HighlightFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HighlightFrame.d.ts","sourceRoot":"","sources":["../../../ComponentPicker/HighlightFrame.tsx"],"names":[],"mappings":"AAQA,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAChC,4BAA4B;IAC5B,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4FAA4F;IAC5F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0FAA0F;IAC1F,IAAI,EAAE,QAAQ,GAAG,WAAW,CAAC;CAChC;AA0BD,2GAA2G;AAC3G,eAAO,MAAM,cAAc,2CAA4C,mBAAmB,uCA2EzF,CAAC"}