@orcestr/ui 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/README.ru.md +10 -10
- package/dist/components/Action/ActionConfirmModal.d.ts.map +1 -1
- package/dist/components/Action/ActionTypes.d.ts +1 -1
- package/dist/components/Action/ActionTypes.d.ts.map +1 -1
- package/dist/components/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/AppShell/AppShell.d.ts +11 -0
- package/dist/components/AppShell/AppShell.d.ts.map +1 -1
- package/dist/components/AppShell/AppShell.js +15 -14
- package/dist/components/AppSidebar/AppSidebar.d.ts.map +1 -1
- package/dist/components/AppSidebar/AppSidebar.js +84 -15
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +1 -1
- package/dist/components/BadgeSelectMenu/BadgeSelectMenu.d.ts.map +1 -1
- package/dist/components/BadgeSelectMenu/BadgeSelectMenu.js +5 -5
- package/dist/components/Box/Box.d.ts.map +1 -1
- package/dist/components/Box/Box.js +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Collapse/Collapse.d.ts.map +1 -1
- package/dist/components/Collapse/Collapse.js +5 -25
- package/dist/components/Combobox/Combobox.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.js +7 -2
- package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/components/CommandPalette/CommandPalette.js +6 -12
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +3 -3
- package/dist/components/CopyButton/CopyButton.d.ts +24 -0
- package/dist/components/CopyButton/CopyButton.d.ts.map +1 -0
- package/dist/components/CopyButton/CopyButton.js +81 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +29 -22
- package/dist/components/DataTable/DataTableStateAdapters.d.ts.map +1 -1
- package/dist/components/DataTable/DataTableStateAdapters.js +3 -4
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/DatePicker/DatePickerState.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePickerState.js +3 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/DateRangePresetPicker/DateRangePresetPicker.d.ts.map +1 -1
- package/dist/components/DateRangePresetPicker/DateRangePresetPicker.js +1 -1
- package/dist/components/DateRangePresetPicker/DateRangePresetPickerState.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +2 -1
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.js +3 -3
- package/dist/components/EntityPicker/EntityPicker.d.ts.map +1 -1
- package/dist/components/EntityPicker/EntityPicker.js +2 -2
- package/dist/components/Field/Field.d.ts.map +1 -1
- package/dist/components/Field/Field.js +1 -1
- package/dist/components/Flex/Flex.d.ts.map +1 -1
- package/dist/components/Flex/Flex.js +1 -1
- package/dist/components/Grid/Grid.d.ts.map +1 -1
- package/dist/components/Highlight/Highlight.d.ts.map +1 -1
- package/dist/components/Highlight/Highlight.js +1 -1
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.js +3 -3
- package/dist/components/IconText/IconText.d.ts.map +1 -1
- package/dist/components/IconText/IconText.js +3 -1
- package/dist/components/IconTextButton/IconTextButton.d.ts.map +1 -1
- package/dist/components/InlineEdit/InlineEdit.d.ts.map +1 -1
- package/dist/components/InlineEdit/InlineEdit.js +22 -7
- package/dist/components/LinkButton/LinkButton.d.ts.map +1 -1
- package/dist/components/LinkButton/LinkButton.js +2 -2
- package/dist/components/Listbox/Listbox.js +2 -2
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/Menu/Menu.js +5 -5
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +4 -8
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +5 -7
- package/dist/components/NumberField/NumberField.d.ts.map +1 -1
- package/dist/components/NumberField/NumberField.js +1 -1
- package/dist/components/Overlay/OverlayProvider.d.ts +1 -1
- package/dist/components/Overlay/OverlayProvider.d.ts.map +1 -1
- package/dist/components/Overlay/OverlayProvider.js +3 -7
- package/dist/components/PaginatedCombobox/PaginatedCombobox.d.ts.map +1 -1
- package/dist/components/PaginatedCombobox/PaginatedCombobox.js +9 -8
- package/dist/components/PaginatedCombobox/PaginatedComboboxReactQueryAdapter.d.ts.map +1 -1
- package/dist/components/PaginatedCombobox/PaginatedComboboxReactQueryAdapter.js +2 -2
- package/dist/components/Pagination/Pagination.js +1 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Popover/Popover.js +16 -18
- package/dist/components/Portal/Portal.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +10 -23
- package/dist/components/Section/Section.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +4 -4
- package/dist/components/Separator/Separator.d.ts.map +1 -1
- package/dist/components/Separator/Separator.js +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/SpecialModal/SpecialModal.d.ts.map +1 -1
- package/dist/components/SpecialModal/SpecialModal.js +2 -2
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.js +1 -1
- package/dist/components/Stack/Stack.d.ts.map +1 -1
- package/dist/components/Stack/Stack.js +1 -1
- package/dist/components/State/State.d.ts.map +1 -1
- package/dist/components/State/State.js +5 -5
- package/dist/components/State/stateIcon.d.ts.map +1 -1
- package/dist/components/StepperInput/StepperInput.js +2 -2
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Table/Table.d.ts.map +1 -1
- package/dist/components/Table/Table.js +2 -2
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +24 -15
- package/dist/components/Text/Text.d.ts.map +1 -1
- package/dist/components/Text/Text.js +1 -1
- package/dist/components/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/TextArea/TextArea.js +2 -2
- package/dist/components/TextField/TextField.d.ts.map +1 -1
- package/dist/components/TextField/TextField.js +3 -3
- package/dist/components/Toast/Toast.d.ts +0 -4
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/Toast.js +63 -45
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +7 -9
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/example/CodePreview.d.ts +2 -1
- package/dist/example/CodePreview.d.ts.map +1 -1
- package/dist/example/CodePreview.js +18 -53
- package/dist/example/ExampleActionsSection.d.ts +1 -1
- package/dist/example/ExampleActionsSection.d.ts.map +1 -1
- package/dist/example/ExampleActionsSection.js +3 -3
- package/dist/example/ExampleApplicationSection.d.ts.map +1 -1
- package/dist/example/ExampleApplicationSection.js +91 -23
- package/dist/example/ExampleBasicsSections.d.ts +1 -1
- package/dist/example/ExampleBasicsSections.d.ts.map +1 -1
- package/dist/example/ExampleBasicsSections.js +22 -8
- package/dist/example/ExampleDataSection.d.ts.map +1 -1
- package/dist/example/ExampleDataSection.js +5 -5
- package/dist/example/ExampleFieldsSection.d.ts.map +1 -1
- package/dist/example/ExampleFieldsSection.js +8 -10
- package/dist/example/ExampleFoundationsSection.d.ts +1 -1
- package/dist/example/ExampleFoundationsSection.d.ts.map +1 -1
- package/dist/example/ExampleFoundationsSection.js +4 -4
- package/dist/example/ExampleOverlays.d.ts.map +1 -1
- package/dist/example/ExampleOverlays.js +4 -4
- package/dist/example/ExampleOverlaysSection.d.ts.map +1 -1
- package/dist/example/ExampleOverlaysSection.js +22 -35
- package/dist/example/ExampleSelectionSection.d.ts.map +1 -1
- package/dist/example/ExampleSelectionSection.js +8 -8
- package/dist/example/ExampleStateSection.d.ts +3 -3
- package/dist/example/ExampleStateSection.d.ts.map +1 -1
- package/dist/example/ExampleStateSection.js +15 -14
- package/dist/example/ExampleThemePlayground.d.ts +26 -26
- package/dist/example/ExampleThemePlayground.d.ts.map +1 -1
- package/dist/example/ExampleThemePlayground.js +58 -44
- package/dist/example/UiExamplePage.d.ts.map +1 -1
- package/dist/example/UiExamplePage.js +42 -55
- package/dist/example/UiExampleSection.d.ts.map +1 -1
- package/dist/example/UiExampleSection.js +1 -1
- package/dist/example/codeSamples.d.ts +1 -1
- package/dist/example/codeSamples.d.ts.map +1 -1
- package/dist/example/codeSamples.js +172 -70
- package/dist/example/exampleData.d.ts.map +1 -1
- package/dist/example/exampleData.js +5 -11
- package/dist/example/styles.css +79 -119
- package/dist/hooks/useControllableState.d.ts.map +1 -1
- package/dist/hooks/useControllableState.js +1 -3
- package/dist/hooks/useFloatingLayer.d.ts.map +1 -1
- package/dist/hooks/useFloatingLayer.js +1 -1
- package/dist/hooks/useFloatingPosition.d.ts.map +1 -1
- package/dist/hooks/useFloatingPosition.js +10 -15
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useListNavigation.d.ts.map +1 -1
- package/dist/hooks/useListNavigation.js +2 -4
- package/dist/hooks/useOutsidePointerDown.d.ts.map +1 -1
- package/dist/hooks/useTypeahead.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/locale/LocaleProvider.d.ts.map +1 -1
- package/dist/locale/LocaleProvider.js +1 -1
- package/dist/provider/OrcestrUiProvider.d.ts.map +1 -1
- package/dist/styles/orcestr-ui.css +658 -1033
- package/dist/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/theme/ThemeProvider.js +21 -29
- package/dist/theme/defaultTheme.d.ts.map +1 -1
- package/dist/theme/defaultTheme.js +200 -89
- package/dist/theme/systemProps.d.ts +2 -2
- package/dist/theme/systemProps.d.ts.map +1 -1
- package/dist/theme/systemProps.js +4 -35
- package/dist/theme/themeTypes.d.ts +24 -19
- package/dist/theme/themeTypes.d.ts.map +1 -1
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/composeRefs.d.ts.map +1 -1
- package/dist/utils/mergeProps.d.ts.map +1 -1
- package/dist/utils/polymorphic.d.ts.map +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -45,12 +45,12 @@ npm install ../../orcestr-ui
|
|
|
45
45
|
Import the runtime styles once near the application root and wrap the app with `OrcestrUiProvider`.
|
|
46
46
|
|
|
47
47
|
```tsx
|
|
48
|
-
import {Button, OrcestrUiProvider} from '@orcestr/ui';
|
|
48
|
+
import { Button, OrcestrUiProvider } from '@orcestr/ui';
|
|
49
49
|
import '@orcestr/ui/styles.css';
|
|
50
50
|
|
|
51
51
|
export function App() {
|
|
52
52
|
return (
|
|
53
|
-
<OrcestrUiProvider locale=
|
|
53
|
+
<OrcestrUiProvider locale="en" defaultMode="dark">
|
|
54
54
|
<Button>Save</Button>
|
|
55
55
|
</OrcestrUiProvider>
|
|
56
56
|
);
|
|
@@ -60,13 +60,13 @@ export function App() {
|
|
|
60
60
|
The React Query adapter is optional and kept outside the main entrypoint:
|
|
61
61
|
|
|
62
62
|
```ts
|
|
63
|
-
import {usePaginatedComboboxQueryLoader} from '@orcestr/ui/react-query';
|
|
63
|
+
import { usePaginatedComboboxQueryLoader } from '@orcestr/ui/react-query';
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
The example page is published through a separate entrypoint, with separate demo styles:
|
|
67
67
|
|
|
68
68
|
```tsx
|
|
69
|
-
import {UiExamplePage} from '@orcestr/ui/example/UiExamplePage';
|
|
69
|
+
import { UiExamplePage } from '@orcestr/ui/example/UiExamplePage';
|
|
70
70
|
import '@orcestr/ui/example/styles.css';
|
|
71
71
|
```
|
|
72
72
|
|
|
@@ -95,13 +95,13 @@ The design direction is quiet and functional:
|
|
|
95
95
|
|
|
96
96
|
## Package Entrypoints
|
|
97
97
|
|
|
98
|
-
| Entrypoint
|
|
99
|
-
|
|
|
100
|
-
| `@orcestr/ui`
|
|
101
|
-
| `@orcestr/ui/styles.css`
|
|
102
|
-
| `@orcestr/ui/react-query`
|
|
103
|
-
| `@orcestr/ui/example/UiExamplePage` | Demo page for visual inspection and internal documentation.
|
|
104
|
-
| `@orcestr/ui/example/styles.css`
|
|
98
|
+
| Entrypoint | Purpose |
|
|
99
|
+
| ----------------------------------- | ------------------------------------------------------------ |
|
|
100
|
+
| `@orcestr/ui` | Main React components, providers, hooks and theme API. |
|
|
101
|
+
| `@orcestr/ui/styles.css` | Runtime styles for the component library. |
|
|
102
|
+
| `@orcestr/ui/react-query` | Optional React Query adapter for paginated combobox loaders. |
|
|
103
|
+
| `@orcestr/ui/example/UiExamplePage` | Demo page for visual inspection and internal documentation. |
|
|
104
|
+
| `@orcestr/ui/example/styles.css` | Styles used only by the example page. |
|
|
105
105
|
|
|
106
106
|
## Scripts
|
|
107
107
|
|
package/README.ru.md
CHANGED
|
@@ -45,12 +45,12 @@ npm install ../../orcestr-ui
|
|
|
45
45
|
Подключи runtime styles один раз рядом с корнем приложения и оберни приложение в `OrcestrUiProvider`.
|
|
46
46
|
|
|
47
47
|
```tsx
|
|
48
|
-
import {Button, OrcestrUiProvider} from '@orcestr/ui';
|
|
48
|
+
import { Button, OrcestrUiProvider } from '@orcestr/ui';
|
|
49
49
|
import '@orcestr/ui/styles.css';
|
|
50
50
|
|
|
51
51
|
export function App() {
|
|
52
52
|
return (
|
|
53
|
-
<OrcestrUiProvider locale=
|
|
53
|
+
<OrcestrUiProvider locale="ru" defaultMode="dark">
|
|
54
54
|
<Button>Сохранить</Button>
|
|
55
55
|
</OrcestrUiProvider>
|
|
56
56
|
);
|
|
@@ -60,13 +60,13 @@ export function App() {
|
|
|
60
60
|
React Query adapter опциональный и вынесен из основного entrypoint:
|
|
61
61
|
|
|
62
62
|
```ts
|
|
63
|
-
import {usePaginatedComboboxQueryLoader} from '@orcestr/ui/react-query';
|
|
63
|
+
import { usePaginatedComboboxQueryLoader } from '@orcestr/ui/react-query';
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
Example page опубликована отдельным entrypoint, со своими demo styles:
|
|
67
67
|
|
|
68
68
|
```tsx
|
|
69
|
-
import {UiExamplePage} from '@orcestr/ui/example/UiExamplePage';
|
|
69
|
+
import { UiExamplePage } from '@orcestr/ui/example/UiExamplePage';
|
|
70
70
|
import '@orcestr/ui/example/styles.css';
|
|
71
71
|
```
|
|
72
72
|
|
|
@@ -95,13 +95,13 @@ Orcestr UI рассчитан на операционный софт: dashboards
|
|
|
95
95
|
|
|
96
96
|
## Package Entrypoints
|
|
97
97
|
|
|
98
|
-
| Entrypoint
|
|
99
|
-
|
|
|
100
|
-
| `@orcestr/ui`
|
|
101
|
-
| `@orcestr/ui/styles.css`
|
|
102
|
-
| `@orcestr/ui/react-query`
|
|
98
|
+
| Entrypoint | Назначение |
|
|
99
|
+
| ----------------------------------- | ------------------------------------------------------------ |
|
|
100
|
+
| `@orcestr/ui` | Основные React components, providers, hooks и theme API. |
|
|
101
|
+
| `@orcestr/ui/styles.css` | Runtime styles библиотеки компонентов. |
|
|
102
|
+
| `@orcestr/ui/react-query` | Optional React Query adapter для paginated combobox loaders. |
|
|
103
103
|
| `@orcestr/ui/example/UiExamplePage` | Demo page для визуальной проверки и внутренней документации. |
|
|
104
|
-
| `@orcestr/ui/example/styles.css`
|
|
104
|
+
| `@orcestr/ui/example/styles.css` | Styles только для example page. |
|
|
105
105
|
|
|
106
106
|
## Скрипты
|
|
107
107
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionConfirmModal.d.ts","sourceRoot":"","sources":["../../../src/components/Action/ActionConfirmModal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ActionConfirmModal.d.ts","sourceRoot":"","sources":["../../../src/components/Action/ActionConfirmModal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { Tone } from '../../theme/systemProps';
|
|
3
|
-
export type OrcestrActionTone =
|
|
3
|
+
export type OrcestrActionTone = Tone;
|
|
4
4
|
export type OrcestrActionConfirmation = {
|
|
5
5
|
title?: ReactNode;
|
|
6
6
|
message?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionTypes.d.ts","sourceRoot":"","sources":["../../../src/components/Action/ActionTyp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version":3,"file":"ActionMenu.d.ts","sourceRoot":"","sources":["../../../src/components/ActionMenu/ActionMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,KAAK,QAAQ,IAAI,cAAc,EAAE,MAAM,cAAc,CAAC;AACnF,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAGH,KAAK,WAAW,EAChB,KAAK,SAAS,EACjB,MAAM,yBAAyB,CAAC;AAIjC,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,GAClE,WAAW,GAAG;IACV,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC,CAAC;IAC7D,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvB,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;AAEN,wBAAgB,KAAK,CAAC,EAClB,IAAa,EACb,CAAU,EACV,KAAK,EACL,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,GAAG,KAAK,EACX,EAAE,UAAU,2CAsBZ"}
|
|
@@ -6,5 +6,5 @@ import { stateIcon } from '../State/stateIcon';
|
|
|
6
6
|
export function Alert({ tone = 'info', v = 'soft', title, icon, action, className, style, children, testId, ...props }) {
|
|
7
7
|
const { systemStyle, restProps } = splitSystemProps(props);
|
|
8
8
|
const actualTone = normalizeTone(tone, 'info');
|
|
9
|
-
return (_jsxs("div", { className: cn('oui-alert', className), "data-tone": actualTone, "data-variant": v, "data-testid": testId, role: actualTone === 'danger' ? 'alert' : 'status', style: { ...systemStyle, ...style }, ...restProps, children: [_jsx("span", { className:
|
|
9
|
+
return (_jsxs("div", { className: cn('oui-alert', className), "data-tone": actualTone, "data-variant": v, "data-testid": testId, role: actualTone === 'danger' ? 'alert' : 'status', style: { ...systemStyle, ...style }, ...restProps, children: [_jsx("span", { className: "oui-alert-icon", children: icon ?? stateIcon(actualTone) }), _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] }));
|
|
10
10
|
}
|
|
@@ -11,13 +11,18 @@ export type AppShellNavItem = {
|
|
|
11
11
|
href?: string;
|
|
12
12
|
onSelect?: () => void;
|
|
13
13
|
};
|
|
14
|
+
export type AppShellSide = 'left' | 'right';
|
|
14
15
|
export type AppShellProps = ComponentPropsWithoutRef<'div'> & SystemProps & {
|
|
15
16
|
sidebar: ReactNode;
|
|
16
17
|
header?: ReactNode;
|
|
17
18
|
sidebarMode?: 'auto' | 'desktop' | 'mobile';
|
|
19
|
+
sidebarSide?: AppShellSide;
|
|
18
20
|
sidebarOpen?: boolean;
|
|
21
|
+
desktopSidebarOpen?: boolean;
|
|
19
22
|
onSidebarOpenChange?: (open: boolean) => void;
|
|
20
23
|
sidebarWidth?: number | string;
|
|
24
|
+
headerHeight?: number | string;
|
|
25
|
+
mobileBreakpoint?: number;
|
|
21
26
|
maxWidth?: number | string;
|
|
22
27
|
contentInset?: number | string;
|
|
23
28
|
testId?: string;
|
|
@@ -26,9 +31,13 @@ export declare const AppShell: import("react").ForwardRefExoticComponent<Omit<im
|
|
|
26
31
|
sidebar: ReactNode;
|
|
27
32
|
header?: ReactNode;
|
|
28
33
|
sidebarMode?: "auto" | "desktop" | "mobile";
|
|
34
|
+
sidebarSide?: AppShellSide;
|
|
29
35
|
sidebarOpen?: boolean;
|
|
36
|
+
desktopSidebarOpen?: boolean;
|
|
30
37
|
onSidebarOpenChange?: (open: boolean) => void;
|
|
31
38
|
sidebarWidth?: number | string;
|
|
39
|
+
headerHeight?: number | string;
|
|
40
|
+
mobileBreakpoint?: number;
|
|
32
41
|
maxWidth?: number | string;
|
|
33
42
|
contentInset?: number | string;
|
|
34
43
|
testId?: string;
|
|
@@ -39,6 +48,7 @@ export type AppShellHeaderProps = Omit<ComponentPropsWithoutRef<'header'>, 'titl
|
|
|
39
48
|
sidebarOpen?: boolean;
|
|
40
49
|
onSidebarOpenChange?: (open: boolean) => void;
|
|
41
50
|
navigationLabel?: string;
|
|
51
|
+
navigationVisibility?: 'always' | 'mobile';
|
|
42
52
|
visibility?: 'always' | 'mobile';
|
|
43
53
|
testId?: string;
|
|
44
54
|
};
|
|
@@ -48,6 +58,7 @@ export declare const AppShellHeader: import("react").ForwardRefExoticComponent<O
|
|
|
48
58
|
sidebarOpen?: boolean;
|
|
49
59
|
onSidebarOpenChange?: (open: boolean) => void;
|
|
50
60
|
navigationLabel?: string;
|
|
61
|
+
navigationVisibility?: "always" | "mobile";
|
|
51
62
|
visibility?: "always" | "mobile";
|
|
52
63
|
testId?: string;
|
|
53
64
|
} & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AAEA,OA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ea } from '../ScrollArea/ScrollArea';
|
|
12
12
|
import { Separator } from '../Separator/Separator';
|
|
13
13
|
import { Text } from '../Text/Text';
|
|
14
|
-
export const AppShell = forwardRef(function AppShell({ className, style, sidebar, header, sidebarMode = 'auto', sidebarOpen = false, onSidebarOpenChange, sidebarWidth = 260, maxWidth = 1440, contentInset = 28, children, testId, ...props }, ref) {
|
|
14
|
+
export const AppShell = forwardRef(function AppShell({ className, style, sidebar, header, sidebarMode = 'auto', sidebarSide = 'left', sidebarOpen = false, desktopSidebarOpen = true, onSidebarOpenChange, sidebarWidth = 260, headerHeight = 56, mobileBreakpoint = 860, maxWidth = 1440, contentInset = 28, children, testId, ...props }, ref) {
|
|
15
15
|
const [autoDrawerMode, setAutoDrawerMode] = useState(false);
|
|
16
|
+
const [drawerPortalContainer, setDrawerPortalContainer] = useState(null);
|
|
16
17
|
const { systemStyle, restProps } = splitSystemProps(props);
|
|
17
18
|
const drawerMode = sidebarMode === 'auto' ? autoDrawerMode : sidebarMode === 'mobile';
|
|
18
19
|
const shellStyle = {
|
|
19
20
|
'--oui-app-shell-sidebar-width': shellSizeValue(sidebarWidth),
|
|
21
|
+
'--oui-app-shell-header-h': shellSizeValue(headerHeight),
|
|
20
22
|
'--oui-app-shell-max-width': shellSizeValue(maxWidth),
|
|
21
23
|
'--oui-app-shell-inset': shellSizeValue(contentInset),
|
|
22
24
|
...systemStyle,
|
|
@@ -25,25 +27,24 @@ export const AppShell = forwardRef(function AppShell({ className, style, sidebar
|
|
|
25
27
|
useEffect(() => {
|
|
26
28
|
if (sidebarMode !== 'auto')
|
|
27
29
|
return;
|
|
28
|
-
const media = window.matchMedia(
|
|
30
|
+
const media = window.matchMedia(`(max-width: ${mobileBreakpoint}px)`);
|
|
29
31
|
const update = () => setAutoDrawerMode(media.matches);
|
|
30
32
|
update();
|
|
31
33
|
media.addEventListener('change', update);
|
|
32
34
|
return () => media.removeEventListener('change', update);
|
|
33
|
-
}, [sidebarMode]);
|
|
34
|
-
return (_jsxs("div", { ref: ref, className: cn('oui-app-shell', className), "data-sidebar-open": sidebarOpen ? 'true' : 'false', "data-testid": testId, style: shellStyle, ...restProps, children: [
|
|
35
|
+
}, [mobileBreakpoint, sidebarMode]);
|
|
36
|
+
return (_jsxs("div", { ref: ref, className: cn('oui-app-shell', className), "data-sidebar-open": sidebarOpen ? 'true' : 'false', "data-desktop-sidebar-open": desktopSidebarOpen ? 'true' : 'false', "data-sidebar-side": sidebarSide, "data-sidebar-mode": drawerMode ? 'mobile' : 'desktop', "data-has-header": header ? 'true' : undefined, "data-testid": testId, style: shellStyle, ...restProps, children: [_jsxs("div", { className: "oui-app-shell-frame", children: [!drawerMode ? (_jsx("div", { className: "oui-app-shell-sidebar-desktop", children: sidebar })) : null, drawerMode && drawerPortalContainer ? (_jsx(Drawer, { open: sidebarOpen, onOpenChange: (nextOpen) => onSidebarOpenChange?.(nextOpen), side: sidebarSide, size: sidebarWidth, lockScroll: false, portalContainer: drawerPortalContainer, showCloseButton: false, backdropClassName: "oui-app-shell-sidebar-drawer-overlay", panelClassName: "oui-app-shell-sidebar-drawer-panel", bodyClassName: "oui-app-shell-sidebar-drawer-body", testId: testId ? `${testId}-sidebar-drawer` : undefined, children: sidebar })) : null, _jsxs("main", { className: "oui-app-shell-main", children: [header, children] })] }), drawerMode ? (_jsx("div", { ref: setDrawerPortalContainer, className: "oui-app-shell-drawer-root" })) : null] }));
|
|
35
37
|
});
|
|
36
|
-
export const AppShellHeader = forwardRef(function AppShellHeader({ className, style, title, actions, sidebarOpen = false, onSidebarOpenChange, navigationLabel, visibility = 'always', children, testId, ...props }, ref) {
|
|
38
|
+
export const AppShellHeader = forwardRef(function AppShellHeader({ className, style, title, actions, sidebarOpen = false, onSidebarOpenChange, navigationLabel, navigationVisibility = 'always', visibility = 'always', children, testId, ...props }, ref) {
|
|
37
39
|
const { copy } = useOrcestrUiLocale();
|
|
38
|
-
const actualNavigationLabel = navigationLabel ??
|
|
39
|
-
(sidebarOpen ? copy.common.closeNavigation : copy.common.openNavigation);
|
|
40
|
+
const actualNavigationLabel = navigationLabel ?? (sidebarOpen ? copy.common.closeNavigation : copy.common.openNavigation);
|
|
40
41
|
const { systemStyle, restProps } = splitSystemProps(props);
|
|
41
|
-
return (_jsxs("header", { ref: ref, className: cn('oui-app-shell-header', className), "data-visibility": visibility, "data-testid": testId, style: { ...systemStyle, ...style }, ...restProps, children: [onSidebarOpenChange ? (_jsx(IconButton, { v:
|
|
42
|
+
return (_jsxs("header", { ref: ref, className: cn('oui-app-shell-header', className), "data-visibility": visibility, "data-testid": testId, style: { ...systemStyle, ...style }, ...restProps, children: [onSidebarOpenChange ? (_jsx(IconButton, { className: "oui-app-shell-header-nav-button", v: "pad", icon: sidebarOpen ? _jsx(LuX, { size: 19 }) : _jsx(LuMenu, { size: 19 }), "aria-label": actualNavigationLabel, "aria-expanded": sidebarOpen, "data-navigation-visibility": navigationVisibility, onClick: () => onSidebarOpenChange(!sidebarOpen) })) : null, title ? _jsx("div", { className: "oui-app-shell-header-title", children: title }) : null, children, actions ? _jsx("div", { className: "oui-app-shell-header-actions", children: actions }) : null] }));
|
|
42
43
|
});
|
|
43
44
|
export const AppShellSidebar = forwardRef(function AppShellSidebar({ className, style, title, description, footer, onClose, closeLabel, children, testId, ...props }, ref) {
|
|
44
45
|
const { copy } = useOrcestrUiLocale();
|
|
45
46
|
const { systemStyle, restProps } = splitSystemProps(props);
|
|
46
|
-
return (_jsxs("aside", { ref: ref, className: cn('oui-app-shell-sidebar', className), "data-testid": testId, style: { ...systemStyle, ...style }, ...restProps, children: [title || description || onClose ? (_jsxs("div", { className:
|
|
47
|
+
return (_jsxs("aside", { ref: ref, className: cn('oui-app-shell-sidebar', className), "data-testid": testId, style: { ...systemStyle, ...style }, ...restProps, children: [title || description || onClose ? (_jsxs("div", { className: "oui-app-shell-sidebar-head", children: [_jsxs("div", { className: "oui-app-shell-sidebar-head-main", children: [title ? (_jsx("div", { className: "oui-app-shell-sidebar-title", children: title })) : null, description ? (_jsx(Text, { className: "oui-app-shell-sidebar-description", color: "var(--oui-muted)", fs: "13px", lh: 1.45, children: description })) : null] }), onClose ? (_jsx(IconButton, { className: "oui-app-shell-sidebar-close", v: "ghost", icon: _jsx(LuX, { size: 18 }), "aria-label": closeLabel ?? copy.common.closeNavigation, onClick: onClose })) : null] })) : null, (title || description) && children ? (_jsx(Separator, { className: "oui-app-shell-sidebar-separator" })) : null, _jsx(ScrollArea, { className: "oui-app-shell-sidebar-scroll", highlights: true, highlightH: 52, highlightColor: "var(--oui-app-shell-sidebar-highlight-bg)", highlightTop: {
|
|
47
48
|
start: 50,
|
|
48
49
|
fadeDistance: 200,
|
|
49
50
|
maxOpacity: 0.92,
|
|
@@ -51,14 +52,14 @@ export const AppShellSidebar = forwardRef(function AppShellSidebar({ className,
|
|
|
51
52
|
start: 16,
|
|
52
53
|
fadeDistance: 140,
|
|
53
54
|
maxOpacity: 0.92,
|
|
54
|
-
}, children: _jsx("div", { className:
|
|
55
|
+
}, children: _jsx("div", { className: "oui-app-shell-sidebar-body", children: children }) }), footer ? _jsx("div", { className: "oui-app-shell-sidebar-footer", children: footer }) : null] }));
|
|
55
56
|
});
|
|
56
57
|
export const AppShellContent = forwardRef(function AppShellContent({ className, style, scroll = true, children, testId, ...props }, ref) {
|
|
57
58
|
const { systemStyle, restProps } = splitSystemProps(props);
|
|
58
59
|
const content = (_jsx("div", { ref: ref, className: cn('oui-app-shell-content', className), "data-testid": testId, style: { ...systemStyle, ...style }, ...restProps, children: children }));
|
|
59
60
|
if (!scroll)
|
|
60
61
|
return content;
|
|
61
|
-
return (_jsx(ScrollArea, { className:
|
|
62
|
+
return (_jsx(ScrollArea, { className: "oui-app-shell-content-scroll", highlights: true, highlightH: 52, highlightColor: "var(--oui-bg)", highlightTop: {
|
|
62
63
|
start: 50,
|
|
63
64
|
fadeDistance: 200,
|
|
64
65
|
maxOpacity: 0.94,
|
|
@@ -75,10 +76,10 @@ export const AppShellNav = forwardRef(function AppShellNav({ className, style, i
|
|
|
75
76
|
});
|
|
76
77
|
export const PageTitleBlock = forwardRef(function PageTitleBlock({ className, style, title, caption, action, badge, testId, ...props }, ref) {
|
|
77
78
|
const { systemStyle, restProps } = splitSystemProps(props);
|
|
78
|
-
return (_jsxs("div", { ref: ref, className: cn('oui-page-title-block', className), "data-testid": testId, style: { ...systemStyle, ...style }, ...restProps, children: [_jsxs("div", { className:
|
|
79
|
+
return (_jsxs("div", { ref: ref, className: cn('oui-page-title-block', className), "data-testid": testId, style: { ...systemStyle, ...style }, ...restProps, children: [_jsxs("div", { className: "oui-page-title-main", children: [_jsxs("div", { className: "oui-page-title-row", children: [_jsx("h1", { className: "oui-page-title", children: title }), badge ? _jsx(Badge, { tone: "primary", children: badge }) : null] }), caption ? _jsx("p", { className: "oui-page-title-caption", children: caption }) : null] }), action ? _jsx("div", { className: "oui-page-title-actions", children: action }) : null] }));
|
|
79
80
|
});
|
|
80
81
|
function AppShellNavButton({ item, onNavigate, testId, }) {
|
|
81
|
-
const content = (_jsxs(_Fragment, { children: [item.icon ? _jsx("span", { className:
|
|
82
|
+
const content = (_jsxs(_Fragment, { children: [item.icon ? _jsx("span", { className: "oui-app-shell-nav-icon", children: item.icon }) : null, _jsxs("span", { className: "oui-app-shell-nav-text", children: [_jsx("span", { className: "oui-app-shell-nav-label", children: item.label }), item.caption ? (_jsx("span", { className: "oui-app-shell-nav-caption", children: item.caption })) : null] }), item.badge ? _jsx("span", { className: "oui-app-shell-nav-badge", children: item.badge }) : null] }));
|
|
82
83
|
const commonProps = {
|
|
83
84
|
className: 'oui-app-shell-nav-item',
|
|
84
85
|
'data-active': item.active ? 'true' : undefined,
|
|
@@ -92,7 +93,7 @@ function AppShellNavButton({ item, onNavigate, testId, }) {
|
|
|
92
93
|
if (item.href && !item.disabled) {
|
|
93
94
|
return (_jsx("a", { href: item.href, ...commonProps, children: content }));
|
|
94
95
|
}
|
|
95
|
-
return (_jsx("button", { type:
|
|
96
|
+
return (_jsx("button", { type: "button", disabled: item.disabled, ...commonProps, children: content }));
|
|
96
97
|
}
|
|
97
98
|
function shellSizeValue(value) {
|
|
98
99
|
return typeof value === 'number' ? `${value}px` : value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/AppSidebar/AppSidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"AppSidebar.d.ts","sourceRoot":"","sources":["../../../src/components/AppSidebar/AppSidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKH,KAAK,wBAAwB,EAE7B,KAAK,WAAW,EAChB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK7E,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9C,MAAM,MAAM,cAAc,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,GAC1E,WAAW,GAAG;IACV,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;IACnC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,UAAU;aATN,SAAS;YACV,SAAS,eAAe,EAAE;aACzB,SAAS;WACX,cAAc;YACb,MAAM;iBACD,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI;aAClC,MAAM;+CAkJrB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, useLayoutEffect, useRef, } from 'react';
|
|
3
|
+
import { forwardRef, useCallback, useLayoutEffect, useRef, } from 'react';
|
|
4
4
|
import { splitSystemProps } from '../../theme/systemProps';
|
|
5
5
|
import { cn } from '../../utils/cn';
|
|
6
6
|
import { ScrollArea } from '../ScrollArea/ScrollArea';
|
|
@@ -8,34 +8,103 @@ import { Separator } from '../Separator/Separator';
|
|
|
8
8
|
export const AppSidebar = forwardRef(function AppSidebar({ className, style, header, groups, footer, side = 'left', itemH = 40, onNavigate, testId, ...props }, ref) {
|
|
9
9
|
const contentRef = useRef(null);
|
|
10
10
|
const indicatorRef = useRef(null);
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
.find((item) => item.active)?.key;
|
|
11
|
+
const indicatorPlacedRef = useRef(false);
|
|
12
|
+
const activeKey = appSidebarActiveKey(groups);
|
|
14
13
|
const { systemStyle, restProps } = splitSystemProps(props);
|
|
15
14
|
const sidebarStyle = {
|
|
16
15
|
'--oui-app-sidebar-item-h': `${itemH}px`,
|
|
17
16
|
...systemStyle,
|
|
18
17
|
...style,
|
|
19
18
|
};
|
|
20
|
-
|
|
19
|
+
const updateActiveIndicator = useCallback((animate = true) => {
|
|
21
20
|
const root = contentRef.current;
|
|
22
21
|
const indicator = indicatorRef.current;
|
|
23
22
|
const activeItem = root?.querySelector('[data-sidebar-active="true"]');
|
|
24
23
|
if (!root || !indicator || !activeItem) {
|
|
25
24
|
if (indicator)
|
|
26
|
-
indicator.
|
|
25
|
+
indicator.dataset.ready = 'false';
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const itemHeight = activeItem.offsetHeight;
|
|
29
|
+
if (itemHeight <= 0) {
|
|
30
|
+
indicator.dataset.ready = 'false';
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const skipTransition = !indicatorPlacedRef.current || !animate;
|
|
34
|
+
if (skipTransition) {
|
|
35
|
+
indicator.dataset.ready = 'false';
|
|
36
|
+
}
|
|
37
|
+
indicator.style.height = `${itemHeight}px`;
|
|
38
|
+
indicator.style.transform = `translateY(${sidebarItemOffsetTop(root, activeItem)}px)`;
|
|
39
|
+
if (skipTransition) {
|
|
40
|
+
indicatorPlacedRef.current = true;
|
|
41
|
+
indicator.getBoundingClientRect();
|
|
42
|
+
requestAnimationFrame(() => {
|
|
43
|
+
indicator.dataset.ready = 'true';
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
indicator.dataset.ready = 'true';
|
|
48
|
+
}
|
|
49
|
+
}, []);
|
|
50
|
+
useLayoutEffect(() => {
|
|
51
|
+
const root = contentRef.current;
|
|
52
|
+
const indicator = indicatorRef.current;
|
|
53
|
+
if (!root || !indicator) {
|
|
54
|
+
if (indicator)
|
|
55
|
+
indicator.dataset.ready = 'false';
|
|
27
56
|
return;
|
|
28
57
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
58
|
+
if (!indicatorPlacedRef.current) {
|
|
59
|
+
updateActiveIndicator(false);
|
|
60
|
+
}
|
|
61
|
+
let frame = 0;
|
|
62
|
+
let nextFrame = 0;
|
|
63
|
+
const scheduleUpdate = () => {
|
|
64
|
+
cancelAnimationFrame(frame);
|
|
65
|
+
cancelAnimationFrame(nextFrame);
|
|
66
|
+
frame = requestAnimationFrame(() => {
|
|
67
|
+
nextFrame = requestAnimationFrame(() => updateActiveIndicator());
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
scheduleUpdate();
|
|
71
|
+
let resizeObserver = null;
|
|
72
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
73
|
+
resizeObserver = new ResizeObserver(scheduleUpdate);
|
|
74
|
+
resizeObserver.observe(root);
|
|
75
|
+
const activeItem = root.querySelector('[data-sidebar-active="true"]');
|
|
76
|
+
if (activeItem)
|
|
77
|
+
resizeObserver.observe(activeItem);
|
|
78
|
+
}
|
|
79
|
+
window.addEventListener('resize', scheduleUpdate);
|
|
80
|
+
return () => {
|
|
81
|
+
cancelAnimationFrame(frame);
|
|
82
|
+
cancelAnimationFrame(nextFrame);
|
|
83
|
+
resizeObserver?.disconnect();
|
|
84
|
+
window.removeEventListener('resize', scheduleUpdate);
|
|
85
|
+
};
|
|
86
|
+
}, [activeKey, updateActiveIndicator]);
|
|
87
|
+
return (_jsxs("aside", { ref: ref, className: cn('oui-app-sidebar', className), "data-side": side, "data-testid": testId, style: sidebarStyle, ...restProps, children: [header ? _jsx("div", { className: "oui-app-sidebar-head", children: header }) : null, _jsx(ScrollArea, { type: "auto", scrollbars: "vertical", className: "oui-app-sidebar-scroll", children: _jsxs("div", { ref: contentRef, className: "oui-app-sidebar-content", children: [_jsx("div", { ref: indicatorRef, className: "oui-app-sidebar-indicator" }), _jsx("div", { className: "oui-app-sidebar-groups", children: groups.map((group, index) => (_jsxs("div", { className: "oui-app-sidebar-group", children: [index > 0 ? (_jsx(Separator, { className: "oui-app-sidebar-separator" })) : null, _jsx("nav", { className: "oui-app-sidebar-nav", children: group.items.map((item) => (_jsx(AppSidebarNavItem, { item: item, onNavigate: onNavigate }, item.key))) })] }, group.key))) })] }) }), footer ? (_jsxs(_Fragment, { children: [_jsx(Separator, { className: "oui-app-sidebar-footer-separator" }), _jsx("div", { className: "oui-app-sidebar-footer", children: footer })] })) : null] }));
|
|
36
88
|
});
|
|
89
|
+
function sidebarItemOffsetTop(root, item) {
|
|
90
|
+
let top = 0;
|
|
91
|
+
let node = item;
|
|
92
|
+
while (node && node !== root) {
|
|
93
|
+
top += node.offsetTop;
|
|
94
|
+
node = node.offsetParent;
|
|
95
|
+
}
|
|
96
|
+
return node === root ? top : item.offsetTop;
|
|
97
|
+
}
|
|
98
|
+
function appSidebarActiveKey(groups) {
|
|
99
|
+
for (const group of groups) {
|
|
100
|
+
const activeItem = group.items.find((item) => item.active);
|
|
101
|
+
if (activeItem)
|
|
102
|
+
return activeItem.key;
|
|
103
|
+
}
|
|
104
|
+
return '';
|
|
105
|
+
}
|
|
37
106
|
function AppSidebarNavItem({ item, onNavigate, }) {
|
|
38
|
-
const content = (_jsxs(_Fragment, { children: [item.icon ? _jsx("span", { className:
|
|
107
|
+
const content = (_jsxs(_Fragment, { children: [item.icon ? _jsx("span", { className: "oui-app-sidebar-item-icon", children: item.icon }) : null, _jsx("span", { className: "oui-app-sidebar-item-label", children: item.label })] }));
|
|
39
108
|
const commonProps = {
|
|
40
109
|
className: 'oui-app-sidebar-item',
|
|
41
110
|
'data-sidebar-active': item.active ? 'true' : undefined,
|
|
@@ -49,5 +118,5 @@ function AppSidebarNavItem({ item, onNavigate, }) {
|
|
|
49
118
|
const LinkComponent = item.component ?? 'a';
|
|
50
119
|
return (_jsx(LinkComponent, { href: item.href, ...commonProps, children: content }));
|
|
51
120
|
}
|
|
52
|
-
return (_jsx("button", { type:
|
|
121
|
+
return (_jsx("button", { type: "button", disabled: item.disabled, ...commonProps, children: content }));
|
|
53
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlF,OAAO,EAEH,KAAK,WAAW,EAEhB,KAAK,SAAS,EACd,KAAK,MAAM,EAEd,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,UAAU,GAAG,wBAAwB,CAAC,MAAM,CAAC,GACrD,WAAW,GAAG;IACV,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;IAC7C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,KAAK;WAPH,SAAS;WACT,MAAM;QACT,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS;WACrC,SAAS;aACP,MAAM;mDAuBrB,CAAC"}
|
|
@@ -4,5 +4,5 @@ import { cn } from '../../utils/cn';
|
|
|
4
4
|
import { splitSystemProps, normalizeTone, } from '../../theme/systemProps';
|
|
5
5
|
export const Badge = forwardRef(function Badge({ className, style, tone = 'neutral', size = 2, v = 'soft', icon, testId, children, ...props }, ref) {
|
|
6
6
|
const { systemStyle, restProps } = splitSystemProps(props);
|
|
7
|
-
return (_jsxs("span", { ref: ref, className: cn('oui-badge', className), "data-tone": normalizeTone(tone), "data-size": size, "data-variant": v, "data-testid": testId, style: { ...systemStyle, ...style }, ...restProps, children: [icon ? _jsx("span", { className:
|
|
7
|
+
return (_jsxs("span", { ref: ref, className: cn('oui-badge', className), "data-tone": normalizeTone(tone), "data-size": size, "data-variant": v, "data-testid": testId, style: { ...systemStyle, ...style }, ...restProps, children: [icon ? _jsx("span", { className: "oui-badge-icon", children: icon }) : null, children] }));
|
|
8
8
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeSelectMenu.d.ts","sourceRoot":"","sources":["../../../src/components/BadgeSelectMenu/BadgeSelectMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"BadgeSelectMenu.d.ts","sourceRoot":"","sources":["../../../src/components/BadgeSelectMenu/BadgeSelectMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK9E,OAAO,EAEH,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,MAAM,EACd,MAAM,yBAAyB,CAAC;AAGjC,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IACrD,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,WAAW,GAAG;IACxE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAChB,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAClC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EACvD,KAAK,EACL,KAAK,EACL,aAAa,EACb,IAAgB,EAChB,KAAW,EACX,SAAe,EACf,QAAgB,EAChB,IAAI,EACJ,UAAU,EACV,SAAS,EACT,MAAM,EACN,GAAG,KAAK,EACX,EAAE,oBAAoB,CAAC,CAAC,CAAC,2CA4FzB"}
|
|
@@ -4,7 +4,7 @@ import { useMemo, useState } from 'react';
|
|
|
4
4
|
import { LuCheck } from 'react-icons/lu';
|
|
5
5
|
import { Badge } from '../Badge/Badge';
|
|
6
6
|
import { Popover } from '../Popover/Popover';
|
|
7
|
-
import { splitSystemProps } from '../../theme/systemProps';
|
|
7
|
+
import { splitSystemProps, } from '../../theme/systemProps';
|
|
8
8
|
import { cn } from '../../utils/cn';
|
|
9
9
|
export function BadgeSelectMenu({ value, items, onValueChange, tone = 'neutral', width = 220, maxHeight = 280, disabled = false, size, badgeStyle, className, testId, ...props }) {
|
|
10
10
|
const [open, setOpen] = useState(false);
|
|
@@ -13,7 +13,7 @@ export function BadgeSelectMenu({ value, items, onValueChange, tone = 'neutral',
|
|
|
13
13
|
const currentValue = value ?? items[0]?.value ?? null;
|
|
14
14
|
const currentItem = useMemo(() => items.find((item) => item.value === currentValue) ?? null, [currentValue, items]);
|
|
15
15
|
const currentLabel = currentItem?.label ?? currentValue;
|
|
16
|
-
const triggerBadge = (_jsx(Badge, { tone: tone, v:
|
|
16
|
+
const triggerBadge = (_jsx(Badge, { tone: tone, v: "soft", r: 7, size: size, "data-state": open ? 'open' : 'closed', className: "oui-badge-select-trigger", testId: testId, style: {
|
|
17
17
|
cursor: disabled ? 'default' : 'pointer',
|
|
18
18
|
flexShrink: 0,
|
|
19
19
|
opacity: disabled ? 0.6 : 1,
|
|
@@ -30,10 +30,10 @@ export function BadgeSelectMenu({ value, items, onValueChange, tone = 'neutral',
|
|
|
30
30
|
}, trigger: triggerBadge, className: cn('oui-select-content oui-badge-select-content', className), contentStyle: {
|
|
31
31
|
width,
|
|
32
32
|
maxWidth: 320,
|
|
33
|
-
}, sideOffset: 4, testId: testId ? `${testId}-menu` : undefined, ...restProps, children: _jsx("div", { className:
|
|
33
|
+
}, sideOffset: 4, testId: testId ? `${testId}-menu` : undefined, ...restProps, children: _jsx("div", { className: "oui-combobox-scroll oui-combobox-options oui-badge-select-options", style: { maxHeight }, children: items.map((item) => {
|
|
34
34
|
const isSelected = item.value === currentValue;
|
|
35
35
|
const isHighlighted = item.value === highlightedValue;
|
|
36
|
-
return (_jsxs("button", { type:
|
|
36
|
+
return (_jsxs("button", { type: "button", className: "oui-combobox-option oui-badge-select-option", "data-selected": isSelected ? 'true' : 'false', "data-highlighted": isHighlighted ? 'true' : 'false', disabled: item.disabled, onMouseEnter: () => {
|
|
37
37
|
if (!item.disabled)
|
|
38
38
|
setHighlightedValue(item.value);
|
|
39
39
|
}, onFocus: () => {
|
|
@@ -45,6 +45,6 @@ export function BadgeSelectMenu({ value, items, onValueChange, tone = 'neutral',
|
|
|
45
45
|
setOpen(false);
|
|
46
46
|
setHighlightedValue(null);
|
|
47
47
|
onValueChange(item.value);
|
|
48
|
-
}, children: [_jsx("span", { className:
|
|
48
|
+
}, children: [_jsx("span", { className: "oui-combobox-option-main", children: item.label }), isSelected ? (_jsx(LuCheck, { className: "oui-combobox-check", size: 15 })) : null] }, item.value));
|
|
49
49
|
}) }) }));
|
|
50
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../src/components/Box/Box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,wBAAwB,EAAE,KAAK,WAAW,EAAY,MAAM,OAAO,CAAC;AAG9F,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG7E,MAAM,MAAM,QAAQ,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAClD,WAAW,GAAG;IACV,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,GAAG;SALH,WAAW;cACN,OAAO;aACR,MAAM;+CA2BrB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
3
|
import { cn } from '../../utils/cn';
|
|
4
4
|
import { splitSystemProps } from '../../theme/systemProps';
|
|
5
5
|
import { renderSlot } from '../../utils/slot';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA0B,KAAK,oBAAoB,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGpG,OAAO,EAEH,KAAK,WAAW,EAEhB,KAAK,SAAS,EACd,KAAK,MAAM,EAEd,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAInE,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvF,MAAM,MAAM,WAAW,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,GAC7D,WAAW,GAAG;IACV,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,aAAa,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,oBAAoB,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,eAAO,MAAM,MAAM;WAbJ,MAAM;QACT,aAAa;WACV,SAAS;cACN,OAAO;gBACL,OAAO;eACR,SAAS;gBACR,SAAS;qBACJ,oBAAoB;cAC3B,OAAO;eACN,SAAS;aACX,MAAM;qDAwDrB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef, useContext
|
|
3
|
+
import { forwardRef, useContext } from 'react';
|
|
4
4
|
import { cn } from '../../utils/cn';
|
|
5
5
|
import { splitSystemProps, normalizeTone, } from '../../theme/systemProps';
|
|
6
6
|
import { OrcestrThemeContext } from '../../theme/useTheme';
|
|
@@ -29,5 +29,5 @@ export const Button = forwardRef(function Button({ className, style, size = 3, v
|
|
|
29
29
|
'aria-disabled': disabled || loading ? true : undefined,
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
return (_jsxs("button", { ref: ref, type: type, ...commonProps, disabled: disabled || loading, children: [loading ? _jsx(Spinner, { size: 1 }) : leftIcon, _jsx("span", { className:
|
|
32
|
+
return (_jsxs("button", { ref: ref, type: type, ...commonProps, disabled: disabled || loading, children: [loading ? _jsx(Spinner, { size: 1 }) : leftIcon, _jsx("span", { className: "oui-button-label", children: children }), rightIcon] }));
|
|
33
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EAEhB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EAEhB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAoB,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAI1F,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAEnE,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,WAAW,GAAG,KAAK,IAAI,WAAW,GAAG;IACjE,EAAE,CAAC,EAAE,CAAC,CAAC;IACP,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,CAAC,CAAC,EAAE,WAAW,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,IAAI,CACA,wBAAwB,CAAC,CAAC,CAAC,EAC3B,MAAM,WAAW,GAAG,IAAI,GAAG,UAAU,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CACzE,CAAC;AAEN,eAAO,MAAM,IAAI;;eAbF,SAAS;gBACR,MAAM;YACV,wBAAwB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;WACzC,MAAM;QACT,WAAW;kBACD,OAAO;cACX,OAAO;aACR,MAAM;wOA6CjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAMH,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAMf,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG;IAC1F,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IACpC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,QAAQ;YANT,SAAS;cACP,OAAO,GAAG,eAAe;sBACjB,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI;aACnC,MAAM;
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAMH,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAMf,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG;IAC1F,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IACpC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,QAAQ;YANT,SAAS;cACP,OAAO,GAAG,eAAe;sBACjB,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI;aACnC,MAAM;oDAyDjB,CAAC"}
|