@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.
- package/README.md +151 -0
- package/README.ru.md +151 -0
- package/assets/orcestr-banner.webp +0 -0
- package/dist/components/Action/ActionConfirmModal.d.ts +8 -0
- package/dist/components/Action/ActionConfirmModal.d.ts.map +1 -0
- package/dist/components/Action/ActionConfirmModal.js +13 -0
- package/dist/components/Action/ActionTypes.d.ts +47 -0
- package/dist/components/Action/ActionTypes.d.ts.map +1 -0
- package/dist/components/Action/ActionTypes.js +49 -0
- package/dist/components/ActionMenu/ActionMenu.d.ts +3 -0
- package/dist/components/ActionMenu/ActionMenu.d.ts.map +1 -0
- package/dist/components/ActionMenu/ActionMenu.js +1 -0
- package/dist/components/Alert/Alert.d.ts +11 -0
- package/dist/components/Alert/Alert.d.ts.map +1 -0
- package/dist/components/Alert/Alert.js +7 -0
- package/dist/components/AppShell/AppShell.d.ts +102 -0
- package/dist/components/AppShell/AppShell.d.ts.map +1 -0
- package/dist/components/AppShell/AppShell.js +96 -0
- package/dist/components/Badge/Badge.d.ts +15 -0
- package/dist/components/Badge/Badge.d.ts.map +1 -0
- package/dist/components/Badge/Badge.js +8 -0
- package/dist/components/Box/Box.d.ts +11 -0
- package/dist/components/Box/Box.d.ts.map +1 -0
- package/dist/components/Box/Box.js +8 -0
- package/dist/components/Button/Button.d.ts +27 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/Button.js +13 -0
- package/dist/components/Checkbox/Checkbox.d.ts +10 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.js +15 -0
- package/dist/components/Collapse/Collapse.d.ts +11 -0
- package/dist/components/Collapse/Collapse.d.ts.map +1 -0
- package/dist/components/Collapse/Collapse.js +33 -0
- package/dist/components/Combobox/Combobox.d.ts +17 -0
- package/dist/components/Combobox/Combobox.d.ts.map +1 -0
- package/dist/components/Combobox/Combobox.js +32 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts +21 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -0
- package/dist/components/CommandPalette/CommandPalette.js +168 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +25 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.js +25 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +11 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -0
- package/dist/components/ContextMenu/ContextMenu.js +68 -0
- package/dist/components/DataTable/DataTable.d.ts +88 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.js +415 -0
- package/dist/components/DataTable/DataTableStateAdapters.d.ts +41 -0
- package/dist/components/DataTable/DataTableStateAdapters.d.ts.map +1 -0
- package/dist/components/DataTable/DataTableStateAdapters.js +192 -0
- package/dist/components/DatePicker/DatePicker.d.ts +21 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.js +39 -0
- package/dist/components/DatePicker/DatePickerState.d.ts +30 -0
- package/dist/components/DatePicker/DatePickerState.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePickerState.js +106 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +19 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +6 -0
- package/dist/components/DateRangePresetPicker/DateRangePresetPicker.d.ts +10 -0
- package/dist/components/DateRangePresetPicker/DateRangePresetPicker.d.ts.map +1 -0
- package/dist/components/DateRangePresetPicker/DateRangePresetPicker.js +26 -0
- package/dist/components/DateRangePresetPicker/DateRangePresetPickerState.d.ts +4 -0
- package/dist/components/DateRangePresetPicker/DateRangePresetPickerState.d.ts.map +1 -0
- package/dist/components/DateRangePresetPicker/DateRangePresetPickerState.js +20 -0
- package/dist/components/Dialog/Dialog.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.js +1 -0
- package/dist/components/Drawer/Drawer.d.ts +30 -0
- package/dist/components/Drawer/Drawer.d.ts.map +1 -0
- package/dist/components/Drawer/Drawer.js +83 -0
- package/dist/components/EntityPicker/EntityPicker.d.ts +41 -0
- package/dist/components/EntityPicker/EntityPicker.d.ts.map +1 -0
- package/dist/components/EntityPicker/EntityPicker.js +17 -0
- package/dist/components/Field/Field.d.ts +12 -0
- package/dist/components/Field/Field.d.ts.map +1 -0
- package/dist/components/Field/Field.js +8 -0
- package/dist/components/Flex/Flex.d.ts +9 -0
- package/dist/components/Flex/Flex.d.ts.map +1 -0
- package/dist/components/Flex/Flex.js +8 -0
- package/dist/components/Grid/Grid.d.ts +11 -0
- package/dist/components/Grid/Grid.d.ts.map +1 -0
- package/dist/components/Grid/Grid.js +12 -0
- package/dist/components/Highlight/Highlight.d.ts +27 -0
- package/dist/components/Highlight/Highlight.d.ts.map +1 -0
- package/dist/components/Highlight/Highlight.js +26 -0
- package/dist/components/IconButton/IconButton.d.ts +25 -0
- package/dist/components/IconButton/IconButton.d.ts.map +1 -0
- package/dist/components/IconButton/IconButton.js +13 -0
- package/dist/components/IconText/IconText.d.ts +12 -0
- package/dist/components/IconText/IconText.d.ts.map +1 -0
- package/dist/components/IconText/IconText.js +7 -0
- package/dist/components/Listbox/Listbox.d.ts +13 -0
- package/dist/components/Listbox/Listbox.d.ts.map +1 -0
- package/dist/components/Listbox/Listbox.js +74 -0
- package/dist/components/Menu/Menu.d.ts +14 -0
- package/dist/components/Menu/Menu.d.ts.map +1 -0
- package/dist/components/Menu/Menu.js +168 -0
- package/dist/components/Modal/Modal.d.ts +29 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -0
- package/dist/components/Modal/Modal.js +155 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +21 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -0
- package/dist/components/MultiSelect/MultiSelect.js +139 -0
- package/dist/components/NumberField/NumberField.d.ts +4 -0
- package/dist/components/NumberField/NumberField.d.ts.map +1 -0
- package/dist/components/NumberField/NumberField.js +6 -0
- package/dist/components/Overlay/OverlayProvider.d.ts +19 -0
- package/dist/components/Overlay/OverlayProvider.d.ts.map +1 -0
- package/dist/components/Overlay/OverlayProvider.js +73 -0
- package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts +48 -0
- package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts.map +1 -0
- package/dist/components/PaginatedCombobox/PaginatedCombobox.js +223 -0
- package/dist/components/PaginatedCombobox/PaginatedComboboxReactQueryAdapter.d.ts +13 -0
- package/dist/components/PaginatedCombobox/PaginatedComboboxReactQueryAdapter.d.ts.map +1 -0
- package/dist/components/PaginatedCombobox/PaginatedComboboxReactQueryAdapter.js +10 -0
- package/dist/components/Pagination/Pagination.d.ts +7 -0
- package/dist/components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination/Pagination.js +9 -0
- package/dist/components/Popover/Popover.d.ts +19 -0
- package/dist/components/Popover/Popover.d.ts.map +1 -0
- package/dist/components/Popover/Popover.js +83 -0
- package/dist/components/Portal/Portal.d.ts +6 -0
- package/dist/components/Portal/Portal.d.ts.map +1 -0
- package/dist/components/Portal/Portal.js +23 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +14 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/components/RadioGroup/RadioGroup.js +6 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +36 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -0
- package/dist/components/ScrollArea/ScrollArea.js +124 -0
- package/dist/components/Section/Section.d.ts +14 -0
- package/dist/components/Section/Section.d.ts.map +1 -0
- package/dist/components/Section/Section.js +20 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +13 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +6 -0
- package/dist/components/Select/Select.d.ts +27 -0
- package/dist/components/Select/Select.d.ts.map +1 -0
- package/dist/components/Select/Select.js +142 -0
- package/dist/components/Separator/Separator.d.ts +6 -0
- package/dist/components/Separator/Separator.d.ts.map +1 -0
- package/dist/components/Separator/Separator.js +5 -0
- package/dist/components/Skeleton/Skeleton.d.ts +9 -0
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.js +8 -0
- package/dist/components/Spinner/Spinner.d.ts +7 -0
- package/dist/components/Spinner/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner/Spinner.js +5 -0
- package/dist/components/Stack/Stack.d.ts +9 -0
- package/dist/components/Stack/Stack.d.ts.map +1 -0
- package/dist/components/Stack/Stack.js +7 -0
- package/dist/components/State/State.d.ts +23 -0
- package/dist/components/State/State.d.ts.map +1 -0
- package/dist/components/State/State.js +30 -0
- package/dist/components/State/stateIcon.d.ts +3 -0
- package/dist/components/State/stateIcon.d.ts.map +1 -0
- package/dist/components/State/stateIcon.js +11 -0
- package/dist/components/StepperInput/StepperInput.d.ts +13 -0
- package/dist/components/StepperInput/StepperInput.d.ts.map +1 -0
- package/dist/components/StepperInput/StepperInput.js +22 -0
- package/dist/components/Switch/Switch.d.ts +10 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -0
- package/dist/components/Switch/Switch.js +14 -0
- package/dist/components/Tabs/Tabs.d.ts +18 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs/Tabs.js +104 -0
- package/dist/components/Text/Text.d.ts +13 -0
- package/dist/components/Text/Text.d.ts.map +1 -0
- package/dist/components/Text/Text.js +8 -0
- package/dist/components/TextArea/TextArea.d.ts +15 -0
- package/dist/components/TextArea/TextArea.d.ts.map +1 -0
- package/dist/components/TextArea/TextArea.js +17 -0
- package/dist/components/TextField/TextField.d.ts +25 -0
- package/dist/components/TextField/TextField.d.ts.map +1 -0
- package/dist/components/TextField/TextField.js +31 -0
- package/dist/components/Toast/Toast.d.ts +43 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -0
- package/dist/components/Toast/Toast.js +205 -0
- package/dist/components/Tooltip/Tooltip.d.ts +10 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip/Tooltip.js +24 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +8 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +6 -0
- package/dist/components/Workflow/Workflow.d.ts +82 -0
- package/dist/components/Workflow/Workflow.d.ts.map +1 -0
- package/dist/components/Workflow/Workflow.js +73 -0
- package/dist/example/CodePreview.d.ts +25 -0
- package/dist/example/CodePreview.d.ts.map +1 -0
- package/dist/example/CodePreview.js +93 -0
- package/dist/example/ExampleActionsSection.d.ts +10 -0
- package/dist/example/ExampleActionsSection.d.ts.map +1 -0
- package/dist/example/ExampleActionsSection.js +10 -0
- package/dist/example/ExampleBasicsSections.d.ts +8 -0
- package/dist/example/ExampleBasicsSections.d.ts.map +1 -0
- package/dist/example/ExampleBasicsSections.js +43 -0
- package/dist/example/ExampleDataSection.d.ts +7 -0
- package/dist/example/ExampleDataSection.d.ts.map +1 -0
- package/dist/example/ExampleDataSection.js +124 -0
- package/dist/example/ExampleFieldsSection.d.ts +17 -0
- package/dist/example/ExampleFieldsSection.d.ts.map +1 -0
- package/dist/example/ExampleFieldsSection.js +10 -0
- package/dist/example/ExampleFoundationsSection.d.ts +5 -0
- package/dist/example/ExampleFoundationsSection.d.ts.map +1 -0
- package/dist/example/ExampleFoundationsSection.js +25 -0
- package/dist/example/ExampleOverlays.d.ts +30 -0
- package/dist/example/ExampleOverlays.d.ts.map +1 -0
- package/dist/example/ExampleOverlays.js +12 -0
- package/dist/example/ExampleOverlaysSection.d.ts +14 -0
- package/dist/example/ExampleOverlaysSection.d.ts.map +1 -0
- package/dist/example/ExampleOverlaysSection.js +126 -0
- package/dist/example/ExampleSelectionSection.d.ts +30 -0
- package/dist/example/ExampleSelectionSection.d.ts.map +1 -0
- package/dist/example/ExampleSelectionSection.js +66 -0
- package/dist/example/ExampleStateSection.d.ts +8 -0
- package/dist/example/ExampleStateSection.d.ts.map +1 -0
- package/dist/example/ExampleStateSection.js +76 -0
- package/dist/example/ExampleThemePlayground.d.ts +417 -0
- package/dist/example/ExampleThemePlayground.d.ts.map +1 -0
- package/dist/example/ExampleThemePlayground.js +596 -0
- package/dist/example/UiExamplePage.d.ts +2 -0
- package/dist/example/UiExamplePage.d.ts.map +1 -0
- package/dist/example/UiExamplePage.js +315 -0
- package/dist/example/UiExampleSection.d.ts +8 -0
- package/dist/example/UiExampleSection.d.ts.map +1 -0
- package/dist/example/UiExampleSection.js +5 -0
- package/dist/example/codeSamples.d.ts +30 -0
- package/dist/example/codeSamples.d.ts.map +1 -0
- package/dist/example/codeSamples.js +976 -0
- package/dist/example/exampleData.d.ts +33 -0
- package/dist/example/exampleData.d.ts.map +1 -0
- package/dist/example/exampleData.js +217 -0
- package/dist/example/styles.css +1106 -0
- package/dist/hooks/useControllableState.d.ts +6 -0
- package/dist/hooks/useControllableState.d.ts.map +1 -0
- package/dist/hooks/useControllableState.js +16 -0
- package/dist/hooks/useDisclosure.d.ts +12 -0
- package/dist/hooks/useDisclosure.d.ts.map +1 -0
- package/dist/hooks/useDisclosure.js +14 -0
- package/dist/hooks/useEscapeKey.d.ts +2 -0
- package/dist/hooks/useEscapeKey.d.ts.map +1 -0
- package/dist/hooks/useEscapeKey.js +15 -0
- package/dist/hooks/useFloatingLayer.d.ts +19 -0
- package/dist/hooks/useFloatingLayer.d.ts.map +1 -0
- package/dist/hooks/useFloatingLayer.js +26 -0
- package/dist/hooks/useFloatingPosition.d.ts +17 -0
- package/dist/hooks/useFloatingPosition.d.ts.map +1 -0
- package/dist/hooks/useFloatingPosition.js +132 -0
- package/dist/hooks/useFocusTrap.d.ts +3 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -0
- package/dist/hooks/useFocusTrap.js +54 -0
- package/dist/hooks/useListNavigation.d.ts +17 -0
- package/dist/hooks/useListNavigation.d.ts.map +1 -0
- package/dist/hooks/useListNavigation.js +44 -0
- package/dist/hooks/useOutsidePointerDown.d.ts +3 -0
- package/dist/hooks/useOutsidePointerDown.d.ts.map +1 -0
- package/dist/hooks/useOutsidePointerDown.js +20 -0
- package/dist/hooks/usePresence.d.ts +5 -0
- package/dist/hooks/usePresence.d.ts.map +1 -0
- package/dist/hooks/usePresence.js +35 -0
- package/dist/hooks/useTypeahead.d.ts +2 -0
- package/dist/hooks/useTypeahead.d.ts.map +1 -0
- package/dist/hooks/useTypeahead.js +23 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -0
- package/dist/locale/LocaleProvider.d.ts +89 -0
- package/dist/locale/LocaleProvider.d.ts.map +1 -0
- package/dist/locale/LocaleProvider.js +174 -0
- package/dist/provider/OrcestrUiProvider.d.ts +28 -0
- package/dist/provider/OrcestrUiProvider.d.ts.map +1 -0
- package/dist/provider/OrcestrUiProvider.js +9 -0
- package/dist/react-query.d.ts +2 -0
- package/dist/react-query.d.ts.map +1 -0
- package/dist/react-query.js +1 -0
- package/dist/styles/orcestr-ui.css +4676 -0
- package/dist/theme/ThemeProvider.d.ts +3 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/ThemeProvider.js +280 -0
- package/dist/theme/defaultTheme.d.ts +12 -0
- package/dist/theme/defaultTheme.d.ts.map +1 -0
- package/dist/theme/defaultTheme.js +516 -0
- package/dist/theme/systemProps.d.ts +53 -0
- package/dist/theme/systemProps.d.ts.map +1 -0
- package/dist/theme/systemProps.js +240 -0
- package/dist/theme/themeTypes.d.ts +197 -0
- package/dist/theme/themeTypes.d.ts.map +1 -0
- package/dist/theme/themeTypes.js +1 -0
- package/dist/theme/useTheme.d.ts +4 -0
- package/dist/theme/useTheme.d.ts.map +1 -0
- package/dist/theme/useTheme.js +10 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/cn.js +3 -0
- package/dist/utils/composeRefs.d.ts +3 -0
- package/dist/utils/composeRefs.d.ts.map +1 -0
- package/dist/utils/composeRefs.js +14 -0
- package/dist/utils/mergeProps.d.ts +4 -0
- package/dist/utils/mergeProps.d.ts.map +1 -0
- package/dist/utils/mergeProps.js +26 -0
- package/dist/utils/ownerDocument.d.ts +2 -0
- package/dist/utils/ownerDocument.d.ts.map +1 -0
- package/dist/utils/ownerDocument.js +3 -0
- package/dist/utils/polymorphic.d.ts +6 -0
- package/dist/utils/polymorphic.d.ts.map +1 -0
- package/dist/utils/polymorphic.js +1 -0
- package/package.json +78 -0
package/README.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<p align="right">
|
|
2
|
+
<strong>English</strong> · <a href="./README.ru.md">Русский</a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://orcestr.com">
|
|
7
|
+
<img src="./assets/orcestr-banner.webp" alt="Orcestr banner" width="100%" />
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
# Orcestr UI
|
|
12
|
+
|
|
13
|
+
Shared React UI foundation for Orcestr products.
|
|
14
|
+
|
|
15
|
+
Orcestr UI is a public component library extracted from real Orcestr product work. It collects the interface primitives we reuse across product surfaces: app shell patterns, dense operational controls, workflow states, overlays, form fields, data views, design tokens and theme infrastructure.
|
|
16
|
+
|
|
17
|
+
The goal is practical reuse, not a showcase-only design system. Components are built for product screens where people scan data, make decisions, confirm actions, navigate workflows and return to the same tools every day.
|
|
18
|
+
|
|
19
|
+
Part of the [Orcestr](https://orcestr.com) ecosystem.
|
|
20
|
+
|
|
21
|
+
## Status
|
|
22
|
+
|
|
23
|
+
Status: early public UI layer.
|
|
24
|
+
|
|
25
|
+
The package is already used as the shared UI base for Orcestr development. The public API is intentionally small enough to stay understandable, but broad enough to cover real application screens: buttons, fields, pickers, overlays, tables, command surfaces, app shell, workflow components, theme and locale providers.
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @orcestr/ui
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
For local development from an Orcestr product repository:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install ../../orcestr-ui
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
Import the runtime styles once near the application root and wrap the app with `OrcestrUiProvider`.
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import {Button, OrcestrUiProvider} from '@orcestr/ui';
|
|
45
|
+
import '@orcestr/ui/styles.css';
|
|
46
|
+
|
|
47
|
+
export function App() {
|
|
48
|
+
return (
|
|
49
|
+
<OrcestrUiProvider locale='en' defaultMode='dark'>
|
|
50
|
+
<Button>Save</Button>
|
|
51
|
+
</OrcestrUiProvider>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The React Query adapter is optional and kept outside the main entrypoint:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import {usePaginatedComboboxQueryLoader} from '@orcestr/ui/react-query';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The example page is published through a separate entrypoint, with separate demo styles:
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import {UiExamplePage} from '@orcestr/ui/example/UiExamplePage';
|
|
66
|
+
import '@orcestr/ui/example/styles.css';
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## What Is Included
|
|
70
|
+
|
|
71
|
+
- Application shell primitives for product layouts.
|
|
72
|
+
- Theme, tokens, system props and locale provider.
|
|
73
|
+
- Actions, buttons, icon buttons, menus and command surfaces.
|
|
74
|
+
- Fields, selects, comboboxes, pickers, switches, checkboxes and segmented controls.
|
|
75
|
+
- Dialogs, drawers, modals, popovers, tooltips, context menus and confirm flows.
|
|
76
|
+
- Tables, pagination, state views, badges, alerts, skeletons and spinners.
|
|
77
|
+
- Workflow components for lifecycle, status and operational process screens.
|
|
78
|
+
- Utility hooks for disclosure, floating layers, focus, keyboard navigation and controlled state.
|
|
79
|
+
|
|
80
|
+
## Design Direction
|
|
81
|
+
|
|
82
|
+
Orcestr UI is tuned for operational software: dashboards, catalogs, workflows, review screens, finance tools, procurement flows and internal product surfaces.
|
|
83
|
+
|
|
84
|
+
The design direction is quiet and functional:
|
|
85
|
+
|
|
86
|
+
- dense but readable information;
|
|
87
|
+
- predictable controls;
|
|
88
|
+
- clear states and confirmations;
|
|
89
|
+
- reusable theme tokens;
|
|
90
|
+
- components that survive real product usage before becoming public API.
|
|
91
|
+
|
|
92
|
+
## Package Entrypoints
|
|
93
|
+
|
|
94
|
+
| Entrypoint | Purpose |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `@orcestr/ui` | Main React components, providers, hooks and theme API. |
|
|
97
|
+
| `@orcestr/ui/styles.css` | Runtime styles for the component library. |
|
|
98
|
+
| `@orcestr/ui/react-query` | Optional React Query adapter for paginated combobox loaders. |
|
|
99
|
+
| `@orcestr/ui/example/UiExamplePage` | Demo page for visual inspection and internal documentation. |
|
|
100
|
+
| `@orcestr/ui/example/styles.css` | Styles used only by the example page. |
|
|
101
|
+
|
|
102
|
+
## Scripts
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npm run build
|
|
106
|
+
npm run typecheck
|
|
107
|
+
npm test
|
|
108
|
+
npm run pack:dry-run
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
- `npm run build` emits `dist` JavaScript, declarations and CSS.
|
|
112
|
+
- `npm run typecheck` checks TypeScript without emitting files.
|
|
113
|
+
- `npm test` runs contract and state tests.
|
|
114
|
+
- `npm run pack:dry-run` checks the published package contents.
|
|
115
|
+
|
|
116
|
+
## Release
|
|
117
|
+
|
|
118
|
+
NPM publishing is handled by GitHub Actions on tags matching `ui-v*`.
|
|
119
|
+
|
|
120
|
+
Full release guide: [docs/RELEASE.md](./docs/RELEASE.md).
|
|
121
|
+
|
|
122
|
+
Local release helpers:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npm run release:patch
|
|
126
|
+
npm run release:minor
|
|
127
|
+
npm run release:major
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Each helper bumps `package.json` and `package-lock.json`, creates a release commit and creates a tag such as `ui-v0.0.2`. Push the commit and tag to start the release workflow:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
git push
|
|
134
|
+
git push origin ui-v0.0.2
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
For the first `0.0.1` release, commit the prepared package and push tag `ui-v0.0.1`.
|
|
138
|
+
|
|
139
|
+
The workflow runs typecheck, tests, build and `npm pack --dry-run` before publishing `@orcestr/ui` to NPM.
|
|
140
|
+
|
|
141
|
+
## Ecosystem
|
|
142
|
+
|
|
143
|
+
Orcestr UI is one of the first public pieces of the Orcestr ecosystem.
|
|
144
|
+
|
|
145
|
+
- [Orcestr](https://orcestr.com) - main website and product entry point.
|
|
146
|
+
- [Orcestr Overview](https://github.com/Artasov/orcestr-overview) - public product and ecosystem description.
|
|
147
|
+
- [Orcestr Repo Notifier](https://github.com/Artasov/orcestr-repo-notifier) - GitHub Action for Codex-generated Telegram development updates.
|
|
148
|
+
|
|
149
|
+
## Maintainer
|
|
150
|
+
|
|
151
|
+
Public updates are currently maintained by [@Artasov](https://github.com/Artasov).
|
package/README.ru.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<p align="right">
|
|
2
|
+
<a href="./README.md">English</a> · <strong>Русский</strong>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://orcestr.com">
|
|
7
|
+
<img src="./assets/orcestr-banner.webp" alt="Баннер Orcestr" width="100%" />
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
# Orcestr UI
|
|
12
|
+
|
|
13
|
+
Общая React UI-основа для продуктов Orcestr.
|
|
14
|
+
|
|
15
|
+
Orcestr UI - публичная библиотека компонентов, выделенная из реальной продуктовой разработки Orcestr. Здесь собираются интерфейсные примитивы, которые переиспользуются в product surfaces: application shell, плотные операционные контролы, workflow-состояния, overlays, поля, data views, design tokens и инфраструктура темы.
|
|
16
|
+
|
|
17
|
+
Цель - практическое переиспользование, а не витринная дизайн-система. Компоненты делаются для продуктовых экранов, где пользователь сканирует данные, принимает решения, подтверждает действия, проходит workflows и каждый день возвращается к одним и тем же инструментам.
|
|
18
|
+
|
|
19
|
+
Часть экосистемы [Orcestr](https://orcestr.com).
|
|
20
|
+
|
|
21
|
+
## Статус
|
|
22
|
+
|
|
23
|
+
Статус: ранний публичный UI-слой.
|
|
24
|
+
|
|
25
|
+
Пакет уже используется как общая UI-основа для разработки Orcestr. Public API достаточно компактный, чтобы оставаться понятным, но уже покрывает реальные application screens: buttons, fields, pickers, overlays, tables, command surfaces, app shell, workflow components, theme и locale providers.
|
|
26
|
+
|
|
27
|
+
## Установка
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @orcestr/ui
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Для локальной разработки из продуктового репозитория Orcestr:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install ../../orcestr-ui
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Использование
|
|
40
|
+
|
|
41
|
+
Подключи runtime styles один раз рядом с корнем приложения и оберни приложение в `OrcestrUiProvider`.
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import {Button, OrcestrUiProvider} from '@orcestr/ui';
|
|
45
|
+
import '@orcestr/ui/styles.css';
|
|
46
|
+
|
|
47
|
+
export function App() {
|
|
48
|
+
return (
|
|
49
|
+
<OrcestrUiProvider locale='ru' defaultMode='dark'>
|
|
50
|
+
<Button>Сохранить</Button>
|
|
51
|
+
</OrcestrUiProvider>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
React Query adapter опциональный и вынесен из основного entrypoint:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import {usePaginatedComboboxQueryLoader} from '@orcestr/ui/react-query';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Example page опубликована отдельным entrypoint, со своими demo styles:
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import {UiExamplePage} from '@orcestr/ui/example/UiExamplePage';
|
|
66
|
+
import '@orcestr/ui/example/styles.css';
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Что внутри
|
|
70
|
+
|
|
71
|
+
- Application shell primitives для продуктовых layouts.
|
|
72
|
+
- Theme, tokens, system props и locale provider.
|
|
73
|
+
- Actions, buttons, icon buttons, menus и command surfaces.
|
|
74
|
+
- Fields, selects, comboboxes, pickers, switches, checkboxes и segmented controls.
|
|
75
|
+
- Dialogs, drawers, modals, popovers, tooltips, context menus и confirm flows.
|
|
76
|
+
- Tables, pagination, state views, badges, alerts, skeletons и spinners.
|
|
77
|
+
- Workflow components для lifecycle, status и операционных process screens.
|
|
78
|
+
- Utility hooks для disclosure, floating layers, focus, keyboard navigation и controlled state.
|
|
79
|
+
|
|
80
|
+
## Дизайн-направление
|
|
81
|
+
|
|
82
|
+
Orcestr UI рассчитан на операционный софт: dashboards, catalogs, workflows, review screens, finance tools, procurement flows и internal product surfaces.
|
|
83
|
+
|
|
84
|
+
Дизайн-направление спокойное и функциональное:
|
|
85
|
+
|
|
86
|
+
- плотная, но читаемая информация;
|
|
87
|
+
- предсказуемые контролы;
|
|
88
|
+
- понятные состояния и подтверждения;
|
|
89
|
+
- переиспользуемые theme tokens;
|
|
90
|
+
- компоненты, которые проходят реальное продуктовое использование до закрепления в public API.
|
|
91
|
+
|
|
92
|
+
## Package Entrypoints
|
|
93
|
+
|
|
94
|
+
| Entrypoint | Назначение |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `@orcestr/ui` | Основные React components, providers, hooks и theme API. |
|
|
97
|
+
| `@orcestr/ui/styles.css` | Runtime styles библиотеки компонентов. |
|
|
98
|
+
| `@orcestr/ui/react-query` | Optional React Query adapter для paginated combobox loaders. |
|
|
99
|
+
| `@orcestr/ui/example/UiExamplePage` | Demo page для визуальной проверки и внутренней документации. |
|
|
100
|
+
| `@orcestr/ui/example/styles.css` | Styles только для example page. |
|
|
101
|
+
|
|
102
|
+
## Скрипты
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npm run build
|
|
106
|
+
npm run typecheck
|
|
107
|
+
npm test
|
|
108
|
+
npm run pack:dry-run
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
- `npm run build` собирает `dist` JavaScript, declarations и CSS.
|
|
112
|
+
- `npm run typecheck` проверяет TypeScript без emit.
|
|
113
|
+
- `npm test` запускает contract и state tests.
|
|
114
|
+
- `npm run pack:dry-run` проверяет состав публикуемого пакета.
|
|
115
|
+
|
|
116
|
+
## Release
|
|
117
|
+
|
|
118
|
+
Публикация в NPM настроена через GitHub Actions на теги формата `ui-v*`.
|
|
119
|
+
|
|
120
|
+
Полная инструкция по релизу: [docs/RELEASE.md](./docs/RELEASE.md).
|
|
121
|
+
|
|
122
|
+
Локальные release helpers:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npm run release:patch
|
|
126
|
+
npm run release:minor
|
|
127
|
+
npm run release:major
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Каждый helper поднимает версию в `package.json` и `package-lock.json`, создает release commit и tag вроде `ui-v0.0.2`. Чтобы запустить публикацию, push commit и tag:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
git push
|
|
134
|
+
git push origin ui-v0.0.2
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Для первого релиза `0.0.1` закоммить подготовленный пакет и запушь tag `ui-v0.0.1`.
|
|
138
|
+
|
|
139
|
+
Workflow перед публикацией `@orcestr/ui` в NPM запускает typecheck, tests, build и `npm pack --dry-run`.
|
|
140
|
+
|
|
141
|
+
## Экосистема
|
|
142
|
+
|
|
143
|
+
Orcestr UI - одна из первых публичных частей экосистемы Orcestr.
|
|
144
|
+
|
|
145
|
+
- [Orcestr](https://orcestr.com) - основной сайт и вход в продукт.
|
|
146
|
+
- [Orcestr Overview](https://github.com/Artasov/orcestr-overview) - публичное описание продукта и экосистемы.
|
|
147
|
+
- [Orcestr Repo Notifier](https://github.com/Artasov/orcestr-repo-notifier) - GitHub Action для Codex-generated Telegram development updates.
|
|
148
|
+
|
|
149
|
+
## Maintainer
|
|
150
|
+
|
|
151
|
+
Публичные обновления сейчас ведет [@Artasov](https://github.com/Artasov).
|
|
Binary file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { OrcestrActionItem } from './ActionTypes';
|
|
2
|
+
export declare function ActionConfirmModal({ item, open, onConfirm, onCancel, }: {
|
|
3
|
+
item: OrcestrActionItem | null;
|
|
4
|
+
open: boolean;
|
|
5
|
+
onConfirm: () => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=ActionConfirmModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionConfirmModal.d.ts","sourceRoot":"","sources":["../../../src/components/Action/ActionConfirmModal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAErD,wBAAgB,kBAAkB,CAAC,EAC/B,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,QAAQ,GACX,EAAE;IACC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB,2CAsBA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ConfirmDialog } from '../ConfirmDialog/ConfirmDialog';
|
|
4
|
+
export function ActionConfirmModal({ item, open, onConfirm, onCancel, }) {
|
|
5
|
+
const confirmation = item?.confirm;
|
|
6
|
+
const title = confirmation?.title ?? item?.label;
|
|
7
|
+
const confirmLabel = confirmation?.confirmLabel ?? item?.label;
|
|
8
|
+
const tone = confirmation?.tone ?? item?.tone ?? 'neutral';
|
|
9
|
+
return (_jsx(ConfirmDialog, { open: open && Boolean(item), onOpenChange: (nextOpen) => {
|
|
10
|
+
if (!nextOpen)
|
|
11
|
+
onCancel();
|
|
12
|
+
}, title: title, message: confirmation?.message, confirmLabel: confirmLabel, cancelLabel: confirmation?.cancelLabel, tone: tone, loading: item?.loading, onCancel: onCancel, onConfirm: onConfirm }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Tone } from '../../theme/systemProps';
|
|
3
|
+
export type OrcestrActionTone = Extract<Tone, 'danger' | 'info' | 'neutral' | 'success' | 'warning'>;
|
|
4
|
+
export type OrcestrActionConfirmation = {
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
message?: ReactNode;
|
|
7
|
+
confirmLabel?: ReactNode;
|
|
8
|
+
cancelLabel?: ReactNode;
|
|
9
|
+
tone?: OrcestrActionTone;
|
|
10
|
+
};
|
|
11
|
+
export type OrcestrActionItem<TContext = void> = {
|
|
12
|
+
key: string;
|
|
13
|
+
label: ReactNode;
|
|
14
|
+
description?: ReactNode;
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
info?: ReactNode;
|
|
17
|
+
shortcut?: ReactNode;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
tone?: OrcestrActionTone;
|
|
21
|
+
confirm?: OrcestrActionConfirmation;
|
|
22
|
+
separatorBefore?: boolean;
|
|
23
|
+
children?: ReadonlyArray<OrcestrActionItem<TContext>>;
|
|
24
|
+
onSelect?: TContext extends void ? () => void : (context: TContext) => void;
|
|
25
|
+
};
|
|
26
|
+
export type OrcestrNormalizedActionItem<TContext = void> = {
|
|
27
|
+
key: string;
|
|
28
|
+
label: ReactNode;
|
|
29
|
+
description?: ReactNode;
|
|
30
|
+
icon?: ReactNode;
|
|
31
|
+
info?: ReactNode;
|
|
32
|
+
shortcut?: ReactNode;
|
|
33
|
+
disabled: boolean;
|
|
34
|
+
loading: boolean;
|
|
35
|
+
tone?: OrcestrActionTone;
|
|
36
|
+
confirm?: OrcestrActionConfirmation;
|
|
37
|
+
separatorBefore?: boolean;
|
|
38
|
+
searchText: string;
|
|
39
|
+
source: OrcestrActionItem<TContext>;
|
|
40
|
+
children?: ReadonlyArray<OrcestrNormalizedActionItem<TContext>>;
|
|
41
|
+
};
|
|
42
|
+
export declare function actionItemText(label: ReactNode): string;
|
|
43
|
+
export declare function isActionItemDisabled<TContext>(item: OrcestrActionItem<TContext>): boolean;
|
|
44
|
+
export declare function actionItemSearchText<TContext>(item: OrcestrActionItem<TContext>): string;
|
|
45
|
+
export declare function normalizeActionItem<TContext>(item: OrcestrActionItem<TContext>): OrcestrNormalizedActionItem<TContext>;
|
|
46
|
+
export declare function normalizeActionItems<TContext>(items: ReadonlyArray<OrcestrActionItem<TContext>>): OrcestrNormalizedActionItem<TContext>[];
|
|
47
|
+
//# sourceMappingURL=ActionTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionTypes.d.ts","sourceRoot":"","sources":["../../../src/components/Action/ActionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,yBAAyB,CAAC;AAElD,MAAM,MAAM,i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,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,aAAa,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC,CAAC;CACnE,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAUvD;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAAC,GAAG,OAAO,CAEzF;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAAC,GAAG,MAAM,CASxF;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EACxC,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAAC,GAClC,2BAA2B,CAAC,QAAQ,CAAC,CAiBvC;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EACzC,KAAK,EAAE,aAAa,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,GAClD,2BAA2B,CAAC,QAAQ,CAAC,EAAE,CAEzC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function actionItemText(label) {
|
|
2
|
+
if (label === null || label === undefined || label === false)
|
|
3
|
+
return '';
|
|
4
|
+
if (typeof label === 'string')
|
|
5
|
+
return label;
|
|
6
|
+
if (typeof label === 'number')
|
|
7
|
+
return String(label);
|
|
8
|
+
if (Array.isArray(label))
|
|
9
|
+
return label.map(actionItemText).join('');
|
|
10
|
+
if (typeof label === 'object' && 'props' in label) {
|
|
11
|
+
const props = label.props;
|
|
12
|
+
return actionItemText(props.children);
|
|
13
|
+
}
|
|
14
|
+
return '';
|
|
15
|
+
}
|
|
16
|
+
export function isActionItemDisabled(item) {
|
|
17
|
+
return Boolean(item.disabled || item.loading);
|
|
18
|
+
}
|
|
19
|
+
export function actionItemSearchText(item) {
|
|
20
|
+
return [
|
|
21
|
+
actionItemText(item.label),
|
|
22
|
+
actionItemText(item.description),
|
|
23
|
+
actionItemText(item.shortcut),
|
|
24
|
+
]
|
|
25
|
+
.filter(Boolean)
|
|
26
|
+
.join(' ')
|
|
27
|
+
.trim();
|
|
28
|
+
}
|
|
29
|
+
export function normalizeActionItem(item) {
|
|
30
|
+
return {
|
|
31
|
+
key: item.key,
|
|
32
|
+
label: item.label,
|
|
33
|
+
description: item.description,
|
|
34
|
+
icon: item.icon,
|
|
35
|
+
info: item.info,
|
|
36
|
+
shortcut: item.shortcut,
|
|
37
|
+
disabled: isActionItemDisabled(item),
|
|
38
|
+
loading: Boolean(item.loading),
|
|
39
|
+
tone: item.tone,
|
|
40
|
+
confirm: item.confirm,
|
|
41
|
+
separatorBefore: item.separatorBefore,
|
|
42
|
+
searchText: actionItemSearchText(item),
|
|
43
|
+
source: item,
|
|
44
|
+
children: item.children?.map(normalizeActionItem),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function normalizeActionItems(items) {
|
|
48
|
+
return items.map(normalizeActionItem);
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionMenu.d.ts","sourceRoot":"","sources":["../../../src/components/ActionMenu/ActionMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,IAAI,UAAU,EAAE,KAAK,QAAQ,IAAI,cAAc,EAAC,MAAM,cAAc,CAAC;AACjF,YAAY,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Menu as ActionMenu } from '../Menu/Menu';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { Tone } from '../../theme/systemProps';
|
|
3
|
+
export type AlertProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'> & {
|
|
4
|
+
tone?: Exclude<Tone, 'brand'>;
|
|
5
|
+
title?: ReactNode;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
action?: ReactNode;
|
|
8
|
+
testId?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function Alert({ tone, title, icon, action, className, children, testId, ...props }: AlertProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=Alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAC,IAAI,EAAC,MAAM,yBAAyB,CAAC;AAIlD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,GAAG;IACrE,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,KAAK,CAAC,EAClB,IAAa,EACb,KAAK,EACL,IAAI,EACJ,MAAM,EACN,SAAS,EACT,QAAQ,EACR,MAAM,EACN,GAAG,KAAK,EACX,EAAE,UAAU,2CAiBZ"}
|
|
@@ -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 { stateIcon } from '../State/stateIcon';
|
|
5
|
+
export function Alert({ tone = 'info', title, icon, action, className, children, testId, ...props }) {
|
|
6
|
+
return (_jsxs("div", { className: cn('oui-alert', className), "data-tone": tone, "data-testid": testId, role: tone === 'danger' ? 'alert' : 'status', ...props, children: [_jsx("span", { className: 'oui-alert-icon', children: icon ?? stateIcon(tone) }), _jsxs("span", { className: 'oui-alert-main', children: [title ? _jsx("strong", { children: title }) : null, children ? _jsx("span", { children: children }) : null] }), action ? _jsx("span", { className: 'oui-alert-action', children: action }) : null] }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
import { type SystemProps } from '../../theme/systemProps';
|
|
3
|
+
export type AppShellNavItem = {
|
|
4
|
+
key: string;
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
caption?: ReactNode;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
badge?: ReactNode;
|
|
9
|
+
active?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
href?: string;
|
|
12
|
+
onSelect?: () => void;
|
|
13
|
+
};
|
|
14
|
+
export type AppShellProps = ComponentPropsWithoutRef<'div'> & SystemProps & {
|
|
15
|
+
sidebar: ReactNode;
|
|
16
|
+
header?: ReactNode;
|
|
17
|
+
sidebarOpen?: boolean;
|
|
18
|
+
onSidebarOpenChange?: (open: boolean) => void;
|
|
19
|
+
sidebarWidth?: number | string;
|
|
20
|
+
maxWidth?: number | string;
|
|
21
|
+
contentInset?: number | string;
|
|
22
|
+
testId?: string;
|
|
23
|
+
};
|
|
24
|
+
export declare const AppShell: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SystemProps & {
|
|
25
|
+
sidebar: ReactNode;
|
|
26
|
+
header?: ReactNode;
|
|
27
|
+
sidebarOpen?: boolean;
|
|
28
|
+
onSidebarOpenChange?: (open: boolean) => void;
|
|
29
|
+
sidebarWidth?: number | string;
|
|
30
|
+
maxWidth?: number | string;
|
|
31
|
+
contentInset?: number | string;
|
|
32
|
+
testId?: string;
|
|
33
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
34
|
+
export type AppShellHeaderProps = Omit<ComponentPropsWithoutRef<'header'>, 'title'> & SystemProps & {
|
|
35
|
+
title?: ReactNode;
|
|
36
|
+
actions?: ReactNode;
|
|
37
|
+
sidebarOpen?: boolean;
|
|
38
|
+
onSidebarOpenChange?: (open: boolean) => void;
|
|
39
|
+
navigationLabel?: string;
|
|
40
|
+
visibility?: 'always' | 'mobile';
|
|
41
|
+
testId?: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const AppShellHeader: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "title"> & SystemProps & {
|
|
44
|
+
title?: ReactNode;
|
|
45
|
+
actions?: ReactNode;
|
|
46
|
+
sidebarOpen?: boolean;
|
|
47
|
+
onSidebarOpenChange?: (open: boolean) => void;
|
|
48
|
+
navigationLabel?: string;
|
|
49
|
+
visibility?: "always" | "mobile";
|
|
50
|
+
testId?: string;
|
|
51
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
52
|
+
export type AppShellSidebarProps = Omit<ComponentPropsWithoutRef<'aside'>, 'title'> & SystemProps & {
|
|
53
|
+
title?: ReactNode;
|
|
54
|
+
description?: ReactNode;
|
|
55
|
+
footer?: ReactNode;
|
|
56
|
+
onClose?: () => void;
|
|
57
|
+
closeLabel?: string;
|
|
58
|
+
testId?: string;
|
|
59
|
+
};
|
|
60
|
+
export declare const AppShellSidebar: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "title"> & SystemProps & {
|
|
61
|
+
title?: ReactNode;
|
|
62
|
+
description?: ReactNode;
|
|
63
|
+
footer?: ReactNode;
|
|
64
|
+
onClose?: () => void;
|
|
65
|
+
closeLabel?: string;
|
|
66
|
+
testId?: string;
|
|
67
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
68
|
+
export type AppShellContentProps = ComponentPropsWithoutRef<'div'> & SystemProps & {
|
|
69
|
+
scroll?: boolean;
|
|
70
|
+
testId?: string;
|
|
71
|
+
};
|
|
72
|
+
export declare const AppShellContent: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SystemProps & {
|
|
73
|
+
scroll?: boolean;
|
|
74
|
+
testId?: string;
|
|
75
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
76
|
+
export type AppShellNavProps = ComponentPropsWithoutRef<'nav'> & SystemProps & {
|
|
77
|
+
items: AppShellNavItem[];
|
|
78
|
+
onNavigate?: (item: AppShellNavItem) => void;
|
|
79
|
+
label?: string;
|
|
80
|
+
testId?: string;
|
|
81
|
+
};
|
|
82
|
+
export declare const AppShellNav: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & SystemProps & {
|
|
83
|
+
items: AppShellNavItem[];
|
|
84
|
+
onNavigate?: (item: AppShellNavItem) => void;
|
|
85
|
+
label?: string;
|
|
86
|
+
testId?: string;
|
|
87
|
+
} & import("react").RefAttributes<HTMLElement>>;
|
|
88
|
+
export type PageTitleBlockProps = ComponentPropsWithoutRef<'div'> & SystemProps & {
|
|
89
|
+
title: ReactNode;
|
|
90
|
+
caption?: ReactNode;
|
|
91
|
+
action?: ReactNode;
|
|
92
|
+
badge?: ReactNode;
|
|
93
|
+
testId?: string;
|
|
94
|
+
};
|
|
95
|
+
export declare const PageTitleBlock: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SystemProps & {
|
|
96
|
+
title: ReactNode;
|
|
97
|
+
caption?: ReactNode;
|
|
98
|
+
action?: ReactNode;
|
|
99
|
+
badge?: ReactNode;
|
|
100
|
+
testId?: string;
|
|
101
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
102
|
+
//# sourceMappingURL=AppShell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIH,KAAK,wBAAwB,EAE7B,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAIf,OAAO,EAAmB,KAAK,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAS3E,MAAM,MAAM,eAAe,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,wBAAwB,CAAC,KAAK,CAAC,GACvD,WAAW,GAAG;IACV,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;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