@orcestr/ui 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. package/README.md +151 -0
  2. package/README.ru.md +151 -0
  3. package/assets/orcestr-banner.webp +0 -0
  4. package/dist/components/Action/ActionConfirmModal.d.ts +8 -0
  5. package/dist/components/Action/ActionConfirmModal.d.ts.map +1 -0
  6. package/dist/components/Action/ActionConfirmModal.js +13 -0
  7. package/dist/components/Action/ActionTypes.d.ts +47 -0
  8. package/dist/components/Action/ActionTypes.d.ts.map +1 -0
  9. package/dist/components/Action/ActionTypes.js +49 -0
  10. package/dist/components/ActionMenu/ActionMenu.d.ts +3 -0
  11. package/dist/components/ActionMenu/ActionMenu.d.ts.map +1 -0
  12. package/dist/components/ActionMenu/ActionMenu.js +1 -0
  13. package/dist/components/Alert/Alert.d.ts +11 -0
  14. package/dist/components/Alert/Alert.d.ts.map +1 -0
  15. package/dist/components/Alert/Alert.js +7 -0
  16. package/dist/components/AppShell/AppShell.d.ts +102 -0
  17. package/dist/components/AppShell/AppShell.d.ts.map +1 -0
  18. package/dist/components/AppShell/AppShell.js +96 -0
  19. package/dist/components/Badge/Badge.d.ts +15 -0
  20. package/dist/components/Badge/Badge.d.ts.map +1 -0
  21. package/dist/components/Badge/Badge.js +8 -0
  22. package/dist/components/Box/Box.d.ts +11 -0
  23. package/dist/components/Box/Box.d.ts.map +1 -0
  24. package/dist/components/Box/Box.js +8 -0
  25. package/dist/components/Button/Button.d.ts +27 -0
  26. package/dist/components/Button/Button.d.ts.map +1 -0
  27. package/dist/components/Button/Button.js +13 -0
  28. package/dist/components/Checkbox/Checkbox.d.ts +10 -0
  29. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
  30. package/dist/components/Checkbox/Checkbox.js +15 -0
  31. package/dist/components/Collapse/Collapse.d.ts +11 -0
  32. package/dist/components/Collapse/Collapse.d.ts.map +1 -0
  33. package/dist/components/Collapse/Collapse.js +33 -0
  34. package/dist/components/Combobox/Combobox.d.ts +17 -0
  35. package/dist/components/Combobox/Combobox.d.ts.map +1 -0
  36. package/dist/components/Combobox/Combobox.js +32 -0
  37. package/dist/components/CommandPalette/CommandPalette.d.ts +21 -0
  38. package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -0
  39. package/dist/components/CommandPalette/CommandPalette.js +168 -0
  40. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +25 -0
  41. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -0
  42. package/dist/components/ConfirmDialog/ConfirmDialog.js +25 -0
  43. package/dist/components/ContextMenu/ContextMenu.d.ts +11 -0
  44. package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -0
  45. package/dist/components/ContextMenu/ContextMenu.js +68 -0
  46. package/dist/components/DataTable/DataTable.d.ts +88 -0
  47. package/dist/components/DataTable/DataTable.d.ts.map +1 -0
  48. package/dist/components/DataTable/DataTable.js +415 -0
  49. package/dist/components/DataTable/DataTableStateAdapters.d.ts +41 -0
  50. package/dist/components/DataTable/DataTableStateAdapters.d.ts.map +1 -0
  51. package/dist/components/DataTable/DataTableStateAdapters.js +192 -0
  52. package/dist/components/DatePicker/DatePicker.d.ts +21 -0
  53. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -0
  54. package/dist/components/DatePicker/DatePicker.js +39 -0
  55. package/dist/components/DatePicker/DatePickerState.d.ts +30 -0
  56. package/dist/components/DatePicker/DatePickerState.d.ts.map +1 -0
  57. package/dist/components/DatePicker/DatePickerState.js +106 -0
  58. package/dist/components/DateRangePicker/DateRangePicker.d.ts +19 -0
  59. package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -0
  60. package/dist/components/DateRangePicker/DateRangePicker.js +6 -0
  61. package/dist/components/DateRangePresetPicker/DateRangePresetPicker.d.ts +10 -0
  62. package/dist/components/DateRangePresetPicker/DateRangePresetPicker.d.ts.map +1 -0
  63. package/dist/components/DateRangePresetPicker/DateRangePresetPicker.js +26 -0
  64. package/dist/components/DateRangePresetPicker/DateRangePresetPickerState.d.ts +4 -0
  65. package/dist/components/DateRangePresetPicker/DateRangePresetPickerState.d.ts.map +1 -0
  66. package/dist/components/DateRangePresetPicker/DateRangePresetPickerState.js +20 -0
  67. package/dist/components/Dialog/Dialog.d.ts +2 -0
  68. package/dist/components/Dialog/Dialog.d.ts.map +1 -0
  69. package/dist/components/Dialog/Dialog.js +1 -0
  70. package/dist/components/Drawer/Drawer.d.ts +30 -0
  71. package/dist/components/Drawer/Drawer.d.ts.map +1 -0
  72. package/dist/components/Drawer/Drawer.js +83 -0
  73. package/dist/components/EntityPicker/EntityPicker.d.ts +41 -0
  74. package/dist/components/EntityPicker/EntityPicker.d.ts.map +1 -0
  75. package/dist/components/EntityPicker/EntityPicker.js +17 -0
  76. package/dist/components/Field/Field.d.ts +12 -0
  77. package/dist/components/Field/Field.d.ts.map +1 -0
  78. package/dist/components/Field/Field.js +8 -0
  79. package/dist/components/Flex/Flex.d.ts +9 -0
  80. package/dist/components/Flex/Flex.d.ts.map +1 -0
  81. package/dist/components/Flex/Flex.js +8 -0
  82. package/dist/components/Grid/Grid.d.ts +11 -0
  83. package/dist/components/Grid/Grid.d.ts.map +1 -0
  84. package/dist/components/Grid/Grid.js +12 -0
  85. package/dist/components/Highlight/Highlight.d.ts +27 -0
  86. package/dist/components/Highlight/Highlight.d.ts.map +1 -0
  87. package/dist/components/Highlight/Highlight.js +26 -0
  88. package/dist/components/IconButton/IconButton.d.ts +25 -0
  89. package/dist/components/IconButton/IconButton.d.ts.map +1 -0
  90. package/dist/components/IconButton/IconButton.js +13 -0
  91. package/dist/components/IconText/IconText.d.ts +12 -0
  92. package/dist/components/IconText/IconText.d.ts.map +1 -0
  93. package/dist/components/IconText/IconText.js +7 -0
  94. package/dist/components/Listbox/Listbox.d.ts +13 -0
  95. package/dist/components/Listbox/Listbox.d.ts.map +1 -0
  96. package/dist/components/Listbox/Listbox.js +74 -0
  97. package/dist/components/Menu/Menu.d.ts +14 -0
  98. package/dist/components/Menu/Menu.d.ts.map +1 -0
  99. package/dist/components/Menu/Menu.js +168 -0
  100. package/dist/components/Modal/Modal.d.ts +29 -0
  101. package/dist/components/Modal/Modal.d.ts.map +1 -0
  102. package/dist/components/Modal/Modal.js +155 -0
  103. package/dist/components/MultiSelect/MultiSelect.d.ts +21 -0
  104. package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -0
  105. package/dist/components/MultiSelect/MultiSelect.js +139 -0
  106. package/dist/components/NumberField/NumberField.d.ts +4 -0
  107. package/dist/components/NumberField/NumberField.d.ts.map +1 -0
  108. package/dist/components/NumberField/NumberField.js +6 -0
  109. package/dist/components/Overlay/OverlayProvider.d.ts +19 -0
  110. package/dist/components/Overlay/OverlayProvider.d.ts.map +1 -0
  111. package/dist/components/Overlay/OverlayProvider.js +73 -0
  112. package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts +48 -0
  113. package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts.map +1 -0
  114. package/dist/components/PaginatedCombobox/PaginatedCombobox.js +223 -0
  115. package/dist/components/PaginatedCombobox/PaginatedComboboxReactQueryAdapter.d.ts +13 -0
  116. package/dist/components/PaginatedCombobox/PaginatedComboboxReactQueryAdapter.d.ts.map +1 -0
  117. package/dist/components/PaginatedCombobox/PaginatedComboboxReactQueryAdapter.js +10 -0
  118. package/dist/components/Pagination/Pagination.d.ts +7 -0
  119. package/dist/components/Pagination/Pagination.d.ts.map +1 -0
  120. package/dist/components/Pagination/Pagination.js +9 -0
  121. package/dist/components/Popover/Popover.d.ts +19 -0
  122. package/dist/components/Popover/Popover.d.ts.map +1 -0
  123. package/dist/components/Popover/Popover.js +83 -0
  124. package/dist/components/Portal/Portal.d.ts +6 -0
  125. package/dist/components/Portal/Portal.d.ts.map +1 -0
  126. package/dist/components/Portal/Portal.js +23 -0
  127. package/dist/components/RadioGroup/RadioGroup.d.ts +14 -0
  128. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -0
  129. package/dist/components/RadioGroup/RadioGroup.js +6 -0
  130. package/dist/components/ScrollArea/ScrollArea.d.ts +36 -0
  131. package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -0
  132. package/dist/components/ScrollArea/ScrollArea.js +124 -0
  133. package/dist/components/Section/Section.d.ts +14 -0
  134. package/dist/components/Section/Section.d.ts.map +1 -0
  135. package/dist/components/Section/Section.js +20 -0
  136. package/dist/components/SegmentedControl/SegmentedControl.d.ts +13 -0
  137. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -0
  138. package/dist/components/SegmentedControl/SegmentedControl.js +6 -0
  139. package/dist/components/Select/Select.d.ts +27 -0
  140. package/dist/components/Select/Select.d.ts.map +1 -0
  141. package/dist/components/Select/Select.js +142 -0
  142. package/dist/components/Separator/Separator.d.ts +6 -0
  143. package/dist/components/Separator/Separator.d.ts.map +1 -0
  144. package/dist/components/Separator/Separator.js +5 -0
  145. package/dist/components/Skeleton/Skeleton.d.ts +9 -0
  146. package/dist/components/Skeleton/Skeleton.d.ts.map +1 -0
  147. package/dist/components/Skeleton/Skeleton.js +8 -0
  148. package/dist/components/Spinner/Spinner.d.ts +7 -0
  149. package/dist/components/Spinner/Spinner.d.ts.map +1 -0
  150. package/dist/components/Spinner/Spinner.js +5 -0
  151. package/dist/components/Stack/Stack.d.ts +9 -0
  152. package/dist/components/Stack/Stack.d.ts.map +1 -0
  153. package/dist/components/Stack/Stack.js +7 -0
  154. package/dist/components/State/State.d.ts +23 -0
  155. package/dist/components/State/State.d.ts.map +1 -0
  156. package/dist/components/State/State.js +30 -0
  157. package/dist/components/State/stateIcon.d.ts +3 -0
  158. package/dist/components/State/stateIcon.d.ts.map +1 -0
  159. package/dist/components/State/stateIcon.js +11 -0
  160. package/dist/components/StepperInput/StepperInput.d.ts +13 -0
  161. package/dist/components/StepperInput/StepperInput.d.ts.map +1 -0
  162. package/dist/components/StepperInput/StepperInput.js +22 -0
  163. package/dist/components/Switch/Switch.d.ts +10 -0
  164. package/dist/components/Switch/Switch.d.ts.map +1 -0
  165. package/dist/components/Switch/Switch.js +14 -0
  166. package/dist/components/Tabs/Tabs.d.ts +18 -0
  167. package/dist/components/Tabs/Tabs.d.ts.map +1 -0
  168. package/dist/components/Tabs/Tabs.js +104 -0
  169. package/dist/components/Text/Text.d.ts +13 -0
  170. package/dist/components/Text/Text.d.ts.map +1 -0
  171. package/dist/components/Text/Text.js +8 -0
  172. package/dist/components/TextArea/TextArea.d.ts +15 -0
  173. package/dist/components/TextArea/TextArea.d.ts.map +1 -0
  174. package/dist/components/TextArea/TextArea.js +17 -0
  175. package/dist/components/TextField/TextField.d.ts +25 -0
  176. package/dist/components/TextField/TextField.d.ts.map +1 -0
  177. package/dist/components/TextField/TextField.js +31 -0
  178. package/dist/components/Toast/Toast.d.ts +43 -0
  179. package/dist/components/Toast/Toast.d.ts.map +1 -0
  180. package/dist/components/Toast/Toast.js +205 -0
  181. package/dist/components/Tooltip/Tooltip.d.ts +10 -0
  182. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
  183. package/dist/components/Tooltip/Tooltip.js +24 -0
  184. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +8 -0
  185. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -0
  186. package/dist/components/VisuallyHidden/VisuallyHidden.js +6 -0
  187. package/dist/components/Workflow/Workflow.d.ts +82 -0
  188. package/dist/components/Workflow/Workflow.d.ts.map +1 -0
  189. package/dist/components/Workflow/Workflow.js +73 -0
  190. package/dist/example/CodePreview.d.ts +25 -0
  191. package/dist/example/CodePreview.d.ts.map +1 -0
  192. package/dist/example/CodePreview.js +93 -0
  193. package/dist/example/ExampleActionsSection.d.ts +10 -0
  194. package/dist/example/ExampleActionsSection.d.ts.map +1 -0
  195. package/dist/example/ExampleActionsSection.js +10 -0
  196. package/dist/example/ExampleBasicsSections.d.ts +8 -0
  197. package/dist/example/ExampleBasicsSections.d.ts.map +1 -0
  198. package/dist/example/ExampleBasicsSections.js +43 -0
  199. package/dist/example/ExampleDataSection.d.ts +7 -0
  200. package/dist/example/ExampleDataSection.d.ts.map +1 -0
  201. package/dist/example/ExampleDataSection.js +124 -0
  202. package/dist/example/ExampleFieldsSection.d.ts +17 -0
  203. package/dist/example/ExampleFieldsSection.d.ts.map +1 -0
  204. package/dist/example/ExampleFieldsSection.js +10 -0
  205. package/dist/example/ExampleFoundationsSection.d.ts +5 -0
  206. package/dist/example/ExampleFoundationsSection.d.ts.map +1 -0
  207. package/dist/example/ExampleFoundationsSection.js +25 -0
  208. package/dist/example/ExampleOverlays.d.ts +30 -0
  209. package/dist/example/ExampleOverlays.d.ts.map +1 -0
  210. package/dist/example/ExampleOverlays.js +12 -0
  211. package/dist/example/ExampleOverlaysSection.d.ts +14 -0
  212. package/dist/example/ExampleOverlaysSection.d.ts.map +1 -0
  213. package/dist/example/ExampleOverlaysSection.js +126 -0
  214. package/dist/example/ExampleSelectionSection.d.ts +30 -0
  215. package/dist/example/ExampleSelectionSection.d.ts.map +1 -0
  216. package/dist/example/ExampleSelectionSection.js +66 -0
  217. package/dist/example/ExampleStateSection.d.ts +8 -0
  218. package/dist/example/ExampleStateSection.d.ts.map +1 -0
  219. package/dist/example/ExampleStateSection.js +76 -0
  220. package/dist/example/ExampleThemePlayground.d.ts +417 -0
  221. package/dist/example/ExampleThemePlayground.d.ts.map +1 -0
  222. package/dist/example/ExampleThemePlayground.js +596 -0
  223. package/dist/example/UiExamplePage.d.ts +2 -0
  224. package/dist/example/UiExamplePage.d.ts.map +1 -0
  225. package/dist/example/UiExamplePage.js +315 -0
  226. package/dist/example/UiExampleSection.d.ts +8 -0
  227. package/dist/example/UiExampleSection.d.ts.map +1 -0
  228. package/dist/example/UiExampleSection.js +5 -0
  229. package/dist/example/codeSamples.d.ts +30 -0
  230. package/dist/example/codeSamples.d.ts.map +1 -0
  231. package/dist/example/codeSamples.js +976 -0
  232. package/dist/example/exampleData.d.ts +33 -0
  233. package/dist/example/exampleData.d.ts.map +1 -0
  234. package/dist/example/exampleData.js +217 -0
  235. package/dist/example/styles.css +1106 -0
  236. package/dist/hooks/useControllableState.d.ts +6 -0
  237. package/dist/hooks/useControllableState.d.ts.map +1 -0
  238. package/dist/hooks/useControllableState.js +16 -0
  239. package/dist/hooks/useDisclosure.d.ts +12 -0
  240. package/dist/hooks/useDisclosure.d.ts.map +1 -0
  241. package/dist/hooks/useDisclosure.js +14 -0
  242. package/dist/hooks/useEscapeKey.d.ts +2 -0
  243. package/dist/hooks/useEscapeKey.d.ts.map +1 -0
  244. package/dist/hooks/useEscapeKey.js +15 -0
  245. package/dist/hooks/useFloatingLayer.d.ts +19 -0
  246. package/dist/hooks/useFloatingLayer.d.ts.map +1 -0
  247. package/dist/hooks/useFloatingLayer.js +26 -0
  248. package/dist/hooks/useFloatingPosition.d.ts +17 -0
  249. package/dist/hooks/useFloatingPosition.d.ts.map +1 -0
  250. package/dist/hooks/useFloatingPosition.js +132 -0
  251. package/dist/hooks/useFocusTrap.d.ts +3 -0
  252. package/dist/hooks/useFocusTrap.d.ts.map +1 -0
  253. package/dist/hooks/useFocusTrap.js +54 -0
  254. package/dist/hooks/useListNavigation.d.ts +17 -0
  255. package/dist/hooks/useListNavigation.d.ts.map +1 -0
  256. package/dist/hooks/useListNavigation.js +44 -0
  257. package/dist/hooks/useOutsidePointerDown.d.ts +3 -0
  258. package/dist/hooks/useOutsidePointerDown.d.ts.map +1 -0
  259. package/dist/hooks/useOutsidePointerDown.js +20 -0
  260. package/dist/hooks/usePresence.d.ts +5 -0
  261. package/dist/hooks/usePresence.d.ts.map +1 -0
  262. package/dist/hooks/usePresence.js +35 -0
  263. package/dist/hooks/useTypeahead.d.ts +2 -0
  264. package/dist/hooks/useTypeahead.d.ts.map +1 -0
  265. package/dist/hooks/useTypeahead.js +23 -0
  266. package/dist/index.d.ts +64 -0
  267. package/dist/index.d.ts.map +1 -0
  268. package/dist/index.js +64 -0
  269. package/dist/locale/LocaleProvider.d.ts +89 -0
  270. package/dist/locale/LocaleProvider.d.ts.map +1 -0
  271. package/dist/locale/LocaleProvider.js +174 -0
  272. package/dist/provider/OrcestrUiProvider.d.ts +28 -0
  273. package/dist/provider/OrcestrUiProvider.d.ts.map +1 -0
  274. package/dist/provider/OrcestrUiProvider.js +9 -0
  275. package/dist/react-query.d.ts +2 -0
  276. package/dist/react-query.d.ts.map +1 -0
  277. package/dist/react-query.js +1 -0
  278. package/dist/styles/orcestr-ui.css +4676 -0
  279. package/dist/theme/ThemeProvider.d.ts +3 -0
  280. package/dist/theme/ThemeProvider.d.ts.map +1 -0
  281. package/dist/theme/ThemeProvider.js +280 -0
  282. package/dist/theme/defaultTheme.d.ts +12 -0
  283. package/dist/theme/defaultTheme.d.ts.map +1 -0
  284. package/dist/theme/defaultTheme.js +516 -0
  285. package/dist/theme/systemProps.d.ts +53 -0
  286. package/dist/theme/systemProps.d.ts.map +1 -0
  287. package/dist/theme/systemProps.js +240 -0
  288. package/dist/theme/themeTypes.d.ts +197 -0
  289. package/dist/theme/themeTypes.d.ts.map +1 -0
  290. package/dist/theme/themeTypes.js +1 -0
  291. package/dist/theme/useTheme.d.ts +4 -0
  292. package/dist/theme/useTheme.d.ts.map +1 -0
  293. package/dist/theme/useTheme.js +10 -0
  294. package/dist/utils/cn.d.ts +2 -0
  295. package/dist/utils/cn.d.ts.map +1 -0
  296. package/dist/utils/cn.js +3 -0
  297. package/dist/utils/composeRefs.d.ts +3 -0
  298. package/dist/utils/composeRefs.d.ts.map +1 -0
  299. package/dist/utils/composeRefs.js +14 -0
  300. package/dist/utils/mergeProps.d.ts +4 -0
  301. package/dist/utils/mergeProps.d.ts.map +1 -0
  302. package/dist/utils/mergeProps.js +26 -0
  303. package/dist/utils/ownerDocument.d.ts +2 -0
  304. package/dist/utils/ownerDocument.d.ts.map +1 -0
  305. package/dist/utils/ownerDocument.js +3 -0
  306. package/dist/utils/polymorphic.d.ts +6 -0
  307. package/dist/utils/polymorphic.d.ts.map +1 -0
  308. package/dist/utils/polymorphic.js +1 -0
  309. package/package.json +78 -0
@@ -0,0 +1,41 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { UiSize } from '../../theme/systemProps';
3
+ import { type PaginatedResult } from '../PaginatedCombobox/PaginatedCombobox';
4
+ export type EntityPickerCreateAction = {
5
+ label?: string | ((search: string) => string);
6
+ onCreate: (search: string) => void;
7
+ disabled?: boolean;
8
+ };
9
+ export type EntityPickerOptionAction<T> = {
10
+ label: (item: T) => string;
11
+ icon: ReactNode;
12
+ onClick: (item: T, close?: () => void) => void;
13
+ disabled?: (item: T) => boolean;
14
+ };
15
+ export type EntityPickerProps<T> = {
16
+ loadPage: (page: number, search: string) => Promise<PaginatedResult<T>>;
17
+ getEntityId: (item: T) => string | number;
18
+ renderEntity: (item: T) => ReactNode;
19
+ value: T | null;
20
+ onValueChange: (item: T | null) => void;
21
+ renderValue?: (item: T) => ReactNode;
22
+ placeholder?: string;
23
+ emptyText?: ReactNode;
24
+ loadingText?: ReactNode;
25
+ errorText?: ReactNode;
26
+ retryLabel?: ReactNode;
27
+ disabled?: boolean;
28
+ clearable?: boolean;
29
+ showChevron?: boolean;
30
+ size?: UiSize;
31
+ maxHeight?: number;
32
+ closeOnSelect?: boolean;
33
+ isEntitySelected?: (item: T) => boolean;
34
+ createAction?: EntityPickerCreateAction;
35
+ optionAction?: EntityPickerOptionAction<T>;
36
+ resetKey?: unknown;
37
+ debounceMs?: number;
38
+ testId?: string;
39
+ };
40
+ export declare function EntityPicker<T>({ loadPage, getEntityId, renderEntity, renderValue, value, onValueChange, placeholder, emptyText, loadingText, errorText, retryLabel, disabled, clearable, showChevron, size, maxHeight, closeOnSelect, isEntitySelected, createAction, optionAction, resetKey, debounceMs, testId, }: EntityPickerProps<T>): import("react/jsx-runtime").JSX.Element;
41
+ //# sourceMappingURL=EntityPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EntityPicker.d.ts","sourceRoot":"","sources":["../../../src/components/EntityPicker/EntityPicker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAGH,KAAK,eAAe,EACvB,MAAM,wCAAwC,CAAC;AAEhD,MAAM,MAAM,wBAAwB,GAAG;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IAC9C,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAAI;IACtC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC;IAC1C,YAAY,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,CAAC;IACrC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,aAAa,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,SAAS,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IACxC,YAAY,CAAC,EAAE,wBAAwB,CAAC;IACxC,YAAY,CAAC,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC5B,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,WAAW,EACX,KAAK,EACL,aAAa,EACb,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,UAAU,EACV,QAAgB,EAChB,SAAgB,EAChB,WAAkB,EAClB,IAAQ,EACR,SAAe,EACf,aAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,MAAM,GACT,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CA8CtB"}
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useOrcestrUiLocale } from '../../locale/LocaleProvider';
4
+ import { PaginatedCombobox, } from '../PaginatedCombobox/PaginatedCombobox';
5
+ export function EntityPicker({ loadPage, getEntityId, renderEntity, renderValue, value, onValueChange, placeholder, emptyText, loadingText, errorText, retryLabel, disabled = false, clearable = true, showChevron = true, size = 3, maxHeight = 280, closeOnSelect = true, isEntitySelected, createAction, optionAction, resetKey, debounceMs, testId, }) {
6
+ const { copy } = useOrcestrUiLocale();
7
+ const searchAction = createAction
8
+ ? {
9
+ label: typeof createAction.label === 'string'
10
+ ? createAction.label
11
+ : createAction.label ?? copy.common.selectEntity,
12
+ disabled: createAction.disabled,
13
+ onClick: (search) => createAction.onCreate(search),
14
+ }
15
+ : undefined;
16
+ return (_jsx(PaginatedCombobox, { loadPage: loadPage, getItemId: getEntityId, renderOption: (item) => (_jsx("div", { className: 'oui-entity-picker-option', children: renderEntity(item) })), renderSelectedLabel: (item) => (_jsx("span", { className: 'oui-entity-picker-value', children: renderValue?.(item) ?? renderEntity(item) })), value: value, onChange: onValueChange, placeholder: placeholder ?? copy.common.selectEntity, emptyText: emptyText ?? copy.common.noOptions, loadingText: loadingText, errorText: errorText, retryLabel: retryLabel, disabled: disabled, clearable: clearable, showChevron: showChevron, size: size, maxHeight: maxHeight, closeOnSelect: closeOnSelect, isItemSelected: isEntitySelected, searchAction: searchAction, optionAction: optionAction, resetKey: resetKey, debounceMs: debounceMs, testId: testId }));
17
+ }
@@ -0,0 +1,12 @@
1
+ import { type ReactNode } from 'react';
2
+ export declare function Field({ label, helperText, error, required, htmlFor, children, className, testId, }: {
3
+ label?: ReactNode;
4
+ helperText?: ReactNode;
5
+ error?: ReactNode;
6
+ required?: boolean;
7
+ htmlFor?: string;
8
+ children: ReactNode;
9
+ className?: string;
10
+ testId?: string;
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ //# sourceMappingURL=Field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/components/Field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAK5C,wBAAgB,KAAK,CAAC,EAClB,KAAK,EACL,UAAU,EACV,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,SAAS,EACT,MAAM,GACT,EAAE;IACC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,2CAsBA"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from 'react';
3
+ import { cn } from '../../utils/cn';
4
+ import { Text } from '../Text/Text';
5
+ export function Field({ label, helperText, error, required, htmlFor, children, className, testId, }) {
6
+ const helperId = useId();
7
+ return (_jsxs("div", { className: cn('oui-field', className), "data-testid": testId, children: [label ? (_jsxs("label", { className: 'oui-field-label', htmlFor: htmlFor, children: [label, required ? _jsx("span", { className: 'oui-field-required', children: "*" }) : null] })) : null, children, error ? (_jsx(Text, { id: helperId, className: 'oui-field-error', fs: '12px', children: error })) : helperText ? (_jsx(Text, { id: helperId, className: 'oui-field-helper', fs: '12px', children: helperText })) : null] }));
8
+ }
@@ -0,0 +1,9 @@
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
+ import { type SystemProps } from '../../theme/systemProps';
3
+ export type FlexProps = ComponentPropsWithoutRef<'div'> & SystemProps & {
4
+ testId?: string;
5
+ };
6
+ export declare const Flex: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SystemProps & {
7
+ testId?: string;
8
+ } & import("react").RefAttributes<HTMLDivElement>>;
9
+ //# sourceMappingURL=Flex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../src/components/Flex/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,wBAAwB,EAAC,MAAM,OAAO,CAAC;AAGhE,OAAO,EAAmB,KAAK,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAE3E,MAAM,MAAM,SAAS,GAAG,wBAAwB,CAAC,KAAK,CAAC,GACnD,WAAW,GAAG;IACV,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,IAAI;aAHA,MAAM;kDAiBrB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { cn } from '../../utils/cn';
4
+ import { splitSystemProps } from '../../theme/systemProps';
5
+ export const Flex = forwardRef(function Flex({ className, style, testId, ...props }, ref) {
6
+ const { systemStyle, restProps } = splitSystemProps(props);
7
+ return (_jsx("div", { ref: ref, className: cn('oui-flex', className), "data-testid": testId, style: { ...systemStyle, ...style }, ...restProps }));
8
+ });
@@ -0,0 +1,11 @@
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
+ import { type SystemProps } from '../../theme/systemProps';
3
+ export type GridProps = ComponentPropsWithoutRef<'div'> & SystemProps & {
4
+ columns?: string;
5
+ testId?: string;
6
+ };
7
+ export declare const Grid: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SystemProps & {
8
+ columns?: string;
9
+ testId?: string;
10
+ } & import("react").RefAttributes<HTMLDivElement>>;
11
+ //# sourceMappingURL=Grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,wBAAwB,EAAC,MAAM,OAAO,CAAC;AAGhE,OAAO,EAAmB,KAAK,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAE3E,MAAM,MAAM,SAAS,GAAG,wBAAwB,CAAC,KAAK,CAAC,GACnD,WAAW,GAAG;IACV,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,IAAI;cAJC,MAAM;aACP,MAAM;kDAqBrB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { cn } from '../../utils/cn';
4
+ import { splitSystemProps } from '../../theme/systemProps';
5
+ export const Grid = forwardRef(function Grid({ className, style, columns, testId, ...props }, ref) {
6
+ const { systemStyle, restProps } = splitSystemProps(props);
7
+ return (_jsx("div", { ref: ref, className: cn('oui-grid', className), "data-testid": testId, style: {
8
+ gridTemplateColumns: columns,
9
+ ...systemStyle,
10
+ ...style,
11
+ }, ...restProps }));
12
+ });
@@ -0,0 +1,27 @@
1
+ import { type ComponentPropsWithoutRef } from 'react';
2
+ import { type SystemProps } from '../../theme/systemProps';
3
+ export type HighlightProps = ComponentPropsWithoutRef<'div'> & SystemProps & {
4
+ h?: number | string;
5
+ color?: string;
6
+ visible?: boolean;
7
+ testId?: string;
8
+ };
9
+ export declare const TopHighlight: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SystemProps & {
10
+ h?: number | string;
11
+ color?: string;
12
+ visible?: boolean;
13
+ testId?: string;
14
+ } & import("react").RefAttributes<HTMLDivElement>>;
15
+ export declare const BottomHighlight: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SystemProps & {
16
+ h?: number | string;
17
+ color?: string;
18
+ visible?: boolean;
19
+ testId?: string;
20
+ } & import("react").RefAttributes<HTMLDivElement>>;
21
+ export declare const DownHighlight: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SystemProps & {
22
+ h?: number | string;
23
+ color?: string;
24
+ visible?: boolean;
25
+ testId?: string;
26
+ } & import("react").RefAttributes<HTMLDivElement>>;
27
+ //# sourceMappingURL=Highlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Highlight.d.ts","sourceRoot":"","sources":["../../../src/components/Highlight/Highlight.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,wBAAwB,EAAqB,MAAM,OAAO,CAAC;AAEpF,OAAO,EAAmB,KAAK,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAG3E,MAAM,MAAM,cAAc,GAAG,wBAAwB,CAAC,KAAK,CAAC,GACxD,WAAW,GAAG;IACV,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAON,eAAO,MAAM,YAAY;QAXb,MAAM,GAAG,MAAM;YACX,MAAM;cACJ,OAAO;aACR,MAAM;kDAsBtB,CAAC;AAEF,eAAO,MAAM,eAAe;QA3BhB,MAAM,GAAG,MAAM;YACX,MAAM;cACJ,OAAO;aACR,MAAM;kDAsCtB,CAAC;AAEF,eAAO,MAAM,aAAa;QA3Cd,MAAM,GAAG,MAAM;YACX,MAAM;cACJ,OAAO;aACR,MAAM;kDAwCqB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { splitSystemProps } from '../../theme/systemProps';
4
+ import { cn } from '../../utils/cn';
5
+ export const TopHighlight = forwardRef(function TopHighlight({ className, style, h = 32, color, visible, ...props }, ref) {
6
+ return (_jsx(Highlight, { ref: ref, className: cn('oui-highlight-top', className), h: h, color: color, visible: visible, style: style, ...props }));
7
+ });
8
+ export const BottomHighlight = forwardRef(function BottomHighlight({ className, style, h = 32, color, visible, ...props }, ref) {
9
+ return (_jsx(Highlight, { ref: ref, className: cn('oui-highlight-bottom', className), h: h, color: color, visible: visible, style: style, ...props }));
10
+ });
11
+ export const DownHighlight = BottomHighlight;
12
+ const Highlight = forwardRef(function Highlight({ className, style, h = 32, color, visible = true, testId, ...props }, ref) {
13
+ if (!visible)
14
+ return null;
15
+ const { systemStyle, restProps } = splitSystemProps(props);
16
+ const highlightStyle = {
17
+ ...systemStyle,
18
+ ...style,
19
+ '--oui-highlight-height': highlightHeight(h),
20
+ ...(color ? { '--oui-highlight-color': color } : null),
21
+ };
22
+ return (_jsx("div", { ref: ref, "aria-hidden": 'true', className: cn('oui-highlight', className), "data-testid": testId, style: highlightStyle, ...restProps }));
23
+ });
24
+ function highlightHeight(value) {
25
+ return typeof value === 'number' ? `${value}px` : value;
26
+ }
@@ -0,0 +1,25 @@
1
+ import { type ButtonHTMLAttributes, type ReactNode } from 'react';
2
+ import { type SystemProps, type Tone, type UiSize } from '../../theme/systemProps';
3
+ import type { ButtonPressAnimation } from '../../theme/themeTypes';
4
+ import type { ButtonVariant } from '../Button/Button';
5
+ export type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & SystemProps & {
6
+ size?: UiSize;
7
+ v?: ButtonVariant;
8
+ tone?: Tone;
9
+ icon: ReactNode;
10
+ loading?: boolean;
11
+ round?: boolean;
12
+ pressAnimation?: ButtonPressAnimation;
13
+ testId?: string;
14
+ };
15
+ export declare const IconButton: import("react").ForwardRefExoticComponent<Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & SystemProps & {
16
+ size?: UiSize;
17
+ v?: ButtonVariant;
18
+ tone?: Tone;
19
+ icon: ReactNode;
20
+ loading?: boolean;
21
+ round?: boolean;
22
+ pressAnimation?: ButtonPressAnimation;
23
+ testId?: string;
24
+ } & import("react").RefAttributes<HTMLButtonElement>>;
25
+ //# sourceMappingURL=IconButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/components/IconButton/IconButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAyB,KAAK,oBAAoB,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGxF,OAAO,EAEH,KAAK,WAAW,EAChB,KAAK,IAAI,EACT,KAAK,MAAM,EACd,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAGpD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,GACnF,WAAW,GAAG;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,aAAa,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,UAAU;WAVR,MAAM;QACT,aAAa;WACV,IAAI;UACL,SAAS;cACL,OAAO;YACT,OAAO;qBACE,oBAAoB;aAC5B,MAAM;qDA+CtB,CAAC"}
@@ -0,0 +1,13 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { forwardRef, useContext } from 'react';
4
+ import { cn } from '../../utils/cn';
5
+ import { splitSystemProps, } from '../../theme/systemProps';
6
+ import { OrcestrThemeContext } from '../../theme/useTheme';
7
+ import { Spinner } from '../Spinner/Spinner';
8
+ export const IconButton = forwardRef(function IconButton({ className, style, size = 3, v = 'soft', tone = 'neutral', loading = false, round = true, pressAnimation, testId, icon, disabled, type = 'button', ...props }, ref) {
9
+ const themeContext = useContext(OrcestrThemeContext);
10
+ const actualPressAnimation = pressAnimation ?? themeContext?.theme.motion.pressAnimation ?? 'soft';
11
+ const { systemStyle, restProps } = splitSystemProps(props);
12
+ return (_jsx("button", { ref: ref, type: type, className: cn('oui-icon-button', className), "data-size": size, "data-variant": v, "data-tone": tone, "data-round": round ? 'true' : undefined, "data-press-animation": actualPressAnimation, "data-loading": loading ? 'true' : undefined, "data-testid": testId, "aria-busy": loading ? 'true' : undefined, disabled: disabled || loading, style: { ...systemStyle, ...style }, ...restProps, children: loading ? _jsx(Spinner, { size: 1 }) : icon }));
13
+ });
@@ -0,0 +1,12 @@
1
+ import type { CSSProperties, ReactNode } from 'react';
2
+ import type { Tone } from '../../theme/systemProps';
3
+ import { type TextProps } from '../Text/Text';
4
+ export type IconTextProps = TextProps & {
5
+ icon?: ReactNode;
6
+ iconTone?: Tone | 'muted';
7
+ iconColor?: CSSProperties['color'];
8
+ iconClassName?: string;
9
+ iconSpin?: boolean;
10
+ };
11
+ export declare function IconText({ icon, iconTone, iconColor, iconClassName, iconSpin, className, children, ...props }: IconTextProps): import("react/jsx-runtime").JSX.Element;
12
+ //# sourceMappingURL=IconText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconText.d.ts","sourceRoot":"","sources":["../../../src/components/IconText/IconText.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,aAAa,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAEpD,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,yBAAyB,CAAC;AAElD,OAAO,EAAO,KAAK,SAAS,EAAC,MAAM,cAAc,CAAC;AAElD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG;IACpC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EACrB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,aAAa,EACb,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,aAAa,2CAgBf"}
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from '../../utils/cn';
4
+ import { Text } from '../Text/Text';
5
+ export function IconText({ icon, iconTone, iconColor, iconClassName, iconSpin, className, children, ...props }) {
6
+ return (_jsxs(Text, { className: cn('oui-icon-text', className), ...props, children: [icon ? (_jsx("span", { className: cn('oui-icon-text-icon', iconClassName), "data-spin": iconSpin ? 'true' : undefined, "data-tone": iconTone, style: iconColor ? { '--oui-icon-text-icon-color': iconColor } : undefined, children: icon })) : null, children] }));
7
+ }
@@ -0,0 +1,13 @@
1
+ export type ListboxItem = {
2
+ value: string;
3
+ label: string;
4
+ disabled?: boolean;
5
+ };
6
+ export declare function Listbox({ items, value, onValueChange, className, testId, }: {
7
+ items: ReadonlyArray<ListboxItem>;
8
+ value?: string | null;
9
+ onValueChange: (value: string) => void;
10
+ className?: string;
11
+ testId?: string;
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ //# sourceMappingURL=Listbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Listbox.d.ts","sourceRoot":"","sources":["../../../src/components/Listbox/Listbox.tsx"],"names":[],"mappings":"AAQA,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,OAAO,CAAC,EACpB,KAAK,EACL,KAAK,EACL,aAAa,EACb,SAAS,EACT,MAAM,GACT,EAAE;IACC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,2CA2GA"}
@@ -0,0 +1,74 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useCallback, useEffect, useMemo, useRef } from 'react';
4
+ import { useListNavigation } from '../../hooks/useListNavigation';
5
+ import { useTypeahead } from '../../hooks/useTypeahead';
6
+ import { cn } from '../../utils/cn';
7
+ export function Listbox({ items, value, onValueChange, className, testId, }) {
8
+ const listboxRef = useRef(null);
9
+ const navigationItems = useMemo(() => items.map((item) => ({
10
+ value: item.value,
11
+ disabled: item.disabled,
12
+ searchText: item.label,
13
+ })), [items]);
14
+ const navigation = useListNavigation(navigationItems, { value });
15
+ const highlighted = navigation.highlightedValue;
16
+ useEffect(() => {
17
+ if (highlighted === null)
18
+ return;
19
+ const node = listboxRef.current?.querySelector(`[data-oui-listbox-value="${cssAttr(highlighted)}"]`);
20
+ node?.scrollIntoView({ block: 'nearest' });
21
+ }, [highlighted]);
22
+ const commit = useCallback((next) => {
23
+ if (next !== null)
24
+ onValueChange(next);
25
+ }, [onValueChange]);
26
+ const handleTypeahead = useTypeahead((query) => {
27
+ const match = navigation.enabledItems.find((item) => item.searchText?.toLowerCase().startsWith(query));
28
+ if (match)
29
+ navigation.setHighlightedValue(match.value);
30
+ });
31
+ const handleKeyDown = useCallback((event) => {
32
+ switch (event.key) {
33
+ case 'ArrowDown':
34
+ event.preventDefault();
35
+ navigation.move(1);
36
+ break;
37
+ case 'ArrowUp':
38
+ event.preventDefault();
39
+ navigation.move(-1);
40
+ break;
41
+ case 'Home':
42
+ event.preventDefault();
43
+ navigation.first();
44
+ break;
45
+ case 'End':
46
+ event.preventDefault();
47
+ navigation.last();
48
+ break;
49
+ case 'Enter':
50
+ case ' ':
51
+ event.preventDefault();
52
+ commit(highlighted);
53
+ break;
54
+ default:
55
+ if (event.key.length === 1 && !event.metaKey && !event.ctrlKey) {
56
+ handleTypeahead(event.key);
57
+ }
58
+ }
59
+ }, [commit, handleTypeahead, highlighted, navigation]);
60
+ return (_jsx("div", { ref: listboxRef, className: cn('oui-listbox', className), role: 'listbox', tabIndex: 0, "data-testid": testId, onKeyDown: handleKeyDown, children: items.map((item) => {
61
+ const isSelected = value === item.value;
62
+ const isHighlighted = highlighted === item.value;
63
+ return (_jsx("button", { type: 'button', role: 'option', "aria-selected": isSelected, className: 'oui-listbox-item', "data-oui-listbox-value": item.value, "data-selected": isSelected ? 'true' : undefined, "data-highlighted": isHighlighted ? 'true' : undefined, "data-testid": testId ? `${testId}-${item.value}` : undefined, disabled: item.disabled, tabIndex: -1, onMouseEnter: () => {
64
+ if (!item.disabled)
65
+ navigation.setHighlightedValue(item.value);
66
+ }, onClick: () => {
67
+ if (!item.disabled)
68
+ commit(item.value);
69
+ }, children: item.label }, item.value));
70
+ }) }));
71
+ }
72
+ function cssAttr(value) {
73
+ return value.replace(/"/g, '\\"');
74
+ }
@@ -0,0 +1,14 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type OrcestrActionItem } from '../Action/ActionTypes';
3
+ import { type PopoverProps } from '../Popover/Popover';
4
+ export type MenuItem = OrcestrActionItem;
5
+ export declare function Menu({ trigger, items, className, align, side, sideOffset, testId, }: {
6
+ trigger: ReactNode;
7
+ items: ReadonlyArray<MenuItem>;
8
+ className?: string;
9
+ align?: PopoverProps['align'];
10
+ side?: PopoverProps['side'];
11
+ sideOffset?: number;
12
+ testId?: string;
13
+ }): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
14
+ //# sourceMappingURL=Menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAOH,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAQf,OAAO,EAGH,KAAK,iBAAiB,EACzB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAU,KAAK,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAI9D,MAAM,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AAEzC,wBAAgB,IAAI,CAAC,EACjB,OAAO,EACP,KAAK,EACL,SAAS,EACT,KAAa,EACb,IAAe,EACf,UAAc,EACd,MAAM,GACT,EAAE;IACC,OAAO,EAAE,SAAS,CAAC;IACnB,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,2UA6CA"}
@@ -0,0 +1,168 @@
1
+ 'use client';
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
4
+ import { LuChevronRight, LuInfo } from 'react-icons/lu';
5
+ import { useListNavigation } from '../../hooks/useListNavigation';
6
+ import { usePresence } from '../../hooks/usePresence';
7
+ import { useTypeahead } from '../../hooks/useTypeahead';
8
+ import { useOrcestrUiLocale } from '../../locale/LocaleProvider';
9
+ import { cn } from '../../utils/cn';
10
+ import { actionItemText, isActionItemDisabled, } from '../Action/ActionTypes';
11
+ import { ActionConfirmModal } from '../Action/ActionConfirmModal';
12
+ import { Popover } from '../Popover/Popover';
13
+ import { Spinner } from '../Spinner/Spinner';
14
+ import { Tooltip } from '../Tooltip/Tooltip';
15
+ export function Menu({ trigger, items, className, align = 'end', side = 'bottom', sideOffset = 6, testId, }) {
16
+ const [open, setOpen] = useState(false);
17
+ const [confirmItem, setConfirmItem] = useState(null);
18
+ const inlineState = useInlineSubmenus();
19
+ const reserveIconSpace = useMemo(() => menuHasIcons(items), [items]);
20
+ if (items.length === 0)
21
+ return trigger;
22
+ return (_jsxs(_Fragment, { children: [_jsx(Popover, { open: open, onOpenChange: (next) => {
23
+ setOpen(next);
24
+ if (!next)
25
+ inlineState.reset();
26
+ }, trigger: trigger, className: cn('oui-menu oui-action-menu-content', className), align: align, side: side, sideOffset: sideOffset, collisionPadding: 12, testId: testId, children: _jsx(MenuList, { items: items, reserveIconSpace: reserveIconSpace, inlineState: inlineState, close: () => setOpen(false), requestConfirmation: setConfirmItem, autoFocus: true, testId: testId ? `${testId}-list` : undefined }) }), _jsx(ActionConfirmModal, { item: confirmItem, open: confirmItem !== null, onCancel: () => setConfirmItem(null), onConfirm: () => {
27
+ confirmItem?.onSelect?.();
28
+ setConfirmItem(null);
29
+ } })] }));
30
+ }
31
+ function MenuList({ items, reserveIconSpace, inlineState, close, requestConfirmation, autoFocus = false, testId, }) {
32
+ const listRef = useRef(null);
33
+ const navigationItems = useMemo(() => items.map((item) => ({
34
+ value: item.key,
35
+ disabled: isActionItemDisabled(item),
36
+ searchText: menuItemText(item),
37
+ })), [items]);
38
+ const navigation = useListNavigation(navigationItems);
39
+ const highlightedKey = navigation.highlightedValue;
40
+ useEffect(() => {
41
+ if (autoFocus)
42
+ listRef.current?.focus();
43
+ }, [autoFocus]);
44
+ const selectHighlighted = useCallback(() => {
45
+ if (highlightedKey === null)
46
+ return;
47
+ const item = items.find((candidate) => candidate.key === highlightedKey);
48
+ if (!item || isActionItemDisabled(item))
49
+ return;
50
+ if (item.children?.length) {
51
+ inlineState.toggle(item.key);
52
+ return;
53
+ }
54
+ if (item.confirm) {
55
+ close();
56
+ requestConfirmation(item);
57
+ return;
58
+ }
59
+ item.onSelect?.();
60
+ close();
61
+ }, [close, highlightedKey, inlineState, items, requestConfirmation]);
62
+ const handleTypeahead = useTypeahead((query) => {
63
+ const match = navigation.enabledItems.find((item) => item.searchText?.toLowerCase().startsWith(query));
64
+ if (match)
65
+ navigation.setHighlightedValue(match.value);
66
+ });
67
+ const handleKeyDown = useCallback((event) => {
68
+ switch (event.key) {
69
+ case 'ArrowDown':
70
+ event.preventDefault();
71
+ navigation.move(1);
72
+ break;
73
+ case 'ArrowUp':
74
+ event.preventDefault();
75
+ navigation.move(-1);
76
+ break;
77
+ case 'Home':
78
+ event.preventDefault();
79
+ navigation.first();
80
+ break;
81
+ case 'End':
82
+ event.preventDefault();
83
+ navigation.last();
84
+ break;
85
+ case 'Enter':
86
+ case ' ':
87
+ event.preventDefault();
88
+ selectHighlighted();
89
+ break;
90
+ case 'Escape':
91
+ event.preventDefault();
92
+ close();
93
+ break;
94
+ default:
95
+ if (event.key.length === 1 && !event.metaKey && !event.ctrlKey) {
96
+ handleTypeahead(event.key);
97
+ }
98
+ }
99
+ }, [close, handleTypeahead, navigation, selectHighlighted]);
100
+ return (_jsx("div", { ref: listRef, className: 'oui-menu-list', role: 'menu', tabIndex: 0, "data-testid": testId, onKeyDown: handleKeyDown, children: items.map((item) => (_jsx(MenuRow, { item: item, reserveIconSpace: reserveIconSpace, inlineState: inlineState, close: close, requestConfirmation: requestConfirmation, highlighted: highlightedKey === item.key, setHighlighted: () => navigation.setHighlightedValue(item.key), testId: testId ? `${testId}-${item.key}` : undefined }, item.key))) }));
101
+ }
102
+ function MenuRow({ item, reserveIconSpace, inlineState, close, requestConfirmation, highlighted, setHighlighted, testId, }) {
103
+ const [hoverOpen, setHoverOpen] = useState(false);
104
+ const hasChildren = Boolean(item.children?.length);
105
+ const inlineOpen = inlineState.openSubmenus.has(item.key);
106
+ const submenuPresence = usePresence(hoverOpen, 180);
107
+ return (_jsxs("div", { className: 'oui-menu-row', onMouseEnter: () => {
108
+ setHighlighted();
109
+ setHoverOpen(true);
110
+ }, onMouseLeave: () => setHoverOpen(false), children: [item.separatorBefore ? _jsx("div", { className: 'oui-menu-separator' }) : null, _jsxs("button", { type: 'button', className: 'oui-menu-item oui-combobox-option', "data-tone": item.tone, "data-selected": 'false', "data-highlighted": highlighted ? 'true' : undefined, "data-submenu-state": inlineOpen || hoverOpen ? 'open' : 'closed', "data-loading": item.loading ? 'true' : undefined, "data-testid": testId, "aria-busy": item.loading ? 'true' : undefined, disabled: isActionItemDisabled(item), tabIndex: -1, onClick: (event) => {
111
+ event.stopPropagation();
112
+ if (isActionItemDisabled(item))
113
+ return;
114
+ if (hasChildren) {
115
+ inlineState.toggle(item.key);
116
+ return;
117
+ }
118
+ if (item.confirm) {
119
+ close();
120
+ requestConfirmation(item);
121
+ return;
122
+ }
123
+ item.onSelect?.();
124
+ close();
125
+ }, role: 'menuitem', children: [_jsx(MenuItemContent, { item: item, reserveIconSpace: reserveIconSpace }), hasChildren ? (_jsx(LuChevronRight, { className: 'oui-menu-sub-chevron', size: 15, "aria-hidden": true })) : null] }), hasChildren && item.children ? (inlineState.inlineSubmenus ? (_jsx("div", { className: 'oui-menu-inline-subitems', "data-state": inlineOpen ? 'open' : 'closed', children: inlineOpen ? (_jsx(MenuList, { items: item.children, reserveIconSpace: menuHasIcons(item.children), inlineState: inlineState, close: close, requestConfirmation: requestConfirmation, autoFocus: false, testId: testId ? `${testId}-subitems` : undefined })) : null })) : submenuPresence.present ? (_jsx("div", { className: 'oui-menu-subcontent oui-popover-content', "data-state": submenuPresence.state, "data-testid": testId ? `${testId}-subcontent` : undefined, children: _jsx(MenuList, { items: item.children, reserveIconSpace: menuHasIcons(item.children), inlineState: inlineState, close: close, requestConfirmation: requestConfirmation, autoFocus: false, testId: testId ? `${testId}-subitems` : undefined }) })) : null) : null] }));
126
+ }
127
+ function MenuItemContent({ item, reserveIconSpace, }) {
128
+ const { copy } = useOrcestrUiLocale();
129
+ return (_jsxs(_Fragment, { children: [_jsxs("span", { className: 'oui-menu-item-main', children: [item.icon || item.loading || reserveIconSpace ? (_jsx("span", { className: 'oui-menu-icon', "aria-hidden": !item.icon && !item.loading, children: item.loading ? _jsx(Spinner, { size: 1 }) : item.icon })) : null, _jsx("span", { className: 'oui-menu-label', children: item.label }), item.description ? (_jsx("span", { className: 'oui-menu-description', children: item.description })) : null] }), item.shortcut ? (_jsx("span", { className: 'oui-menu-shortcut', children: item.shortcut })) : null, item.info ? (_jsx(Tooltip, { content: item.info, children: _jsx("span", { className: 'oui-menu-info', "aria-label": copy.common.details, onPointerDown: (event) => {
130
+ event.preventDefault();
131
+ event.stopPropagation();
132
+ }, onClick: (event) => {
133
+ event.preventDefault();
134
+ event.stopPropagation();
135
+ }, children: _jsx(LuInfo, { size: 14 }) }) })) : null] }));
136
+ }
137
+ function useInlineSubmenus() {
138
+ const [inlineSubmenus, setInlineSubmenus] = useState(false);
139
+ const [openSubmenus, setOpenSubmenus] = useState(() => new Set());
140
+ useEffect(() => {
141
+ const media = window.matchMedia('(max-width: 640px), (pointer: coarse)');
142
+ const update = () => setInlineSubmenus(media.matches);
143
+ update();
144
+ media.addEventListener('change', update);
145
+ return () => media.removeEventListener('change', update);
146
+ }, []);
147
+ return {
148
+ inlineSubmenus,
149
+ openSubmenus,
150
+ toggle: (key) => {
151
+ setOpenSubmenus((current) => {
152
+ const next = new Set(current);
153
+ if (next.has(key))
154
+ next.delete(key);
155
+ else
156
+ next.add(key);
157
+ return next;
158
+ });
159
+ },
160
+ reset: () => setOpenSubmenus(new Set()),
161
+ };
162
+ }
163
+ function menuHasIcons(items) {
164
+ return items.some((item) => item.icon || (item.children && menuHasIcons(item.children)));
165
+ }
166
+ function menuItemText(item) {
167
+ return actionItemText(item.label);
168
+ }
@@ -0,0 +1,29 @@
1
+ import { type CSSProperties, type ReactNode } from 'react';
2
+ import type { ModalAnimation } from '../../theme/themeTypes';
3
+ export type ModalProps = {
4
+ open: boolean;
5
+ onOpenChange: (open: boolean) => void;
6
+ title?: ReactNode;
7
+ description?: ReactNode;
8
+ children: ReactNode;
9
+ footer?: ReactNode;
10
+ maxWidth?: number | string;
11
+ minHeight?: number | string;
12
+ overlayColor?: string;
13
+ overlayOpacity?: number;
14
+ overlayBlur?: number | string;
15
+ borderColor?: string;
16
+ radius?: number | string;
17
+ shadow?: string;
18
+ animationDuration?: number | string;
19
+ animation?: ModalAnimation;
20
+ overlayClassName?: string;
21
+ overlayStyle?: CSSProperties;
22
+ className?: string;
23
+ contentClassName?: string;
24
+ bodyClassName?: string;
25
+ closeOnOverlayClick?: boolean;
26
+ testId?: string;
27
+ };
28
+ export declare function Modal({ open, onOpenChange, title, description, children, footer, maxWidth, minHeight, overlayColor, overlayOpacity, overlayBlur, borderColor, radius, shadow, animationDuration, animation, overlayClassName, overlayStyle, className, contentClassName, bodyClassName, closeOnOverlayClick, testId, }: ModalProps): import("react/jsx-runtime").JSX.Element | null;
29
+ //# sourceMappingURL=Modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAMH,KAAK,aAAa,EAClB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,wBAAwB,CAAC;AAU3D,MAAM,MAAM,UAAU,GAAG;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpC,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,KAAK,CAAC,EAClB,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,WAAW,EACX,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,WAAW,EACX,WAAW,EACX,MAAM,EACN,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,mBAA0B,EAC1B,MAAM,GACT,EAAE,UAAU,kDAiKZ"}