@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useMemo, useState } from 'react';
|
|
4
4
|
import { LuInfo, LuX } from 'react-icons/lu';
|
|
5
|
-
import { Flex, IconButton, Modal, ScrollArea } from '..';
|
|
5
|
+
import { CopyIconButton, Flex, IconButton, Modal, ScrollArea } from '..';
|
|
6
6
|
import { cn } from '../utils/cn';
|
|
7
7
|
import {} from './codeSamples';
|
|
8
8
|
function highlightedCode(code) {
|
|
@@ -23,71 +23,36 @@ function highlightedCode(code) {
|
|
|
23
23
|
return (_jsx("span", { className: className, children: part }, `${lineIndex}-${partIndex}`));
|
|
24
24
|
});
|
|
25
25
|
return [
|
|
26
|
-
_jsx("span", { className:
|
|
26
|
+
_jsx("span", { className: "oui-code-line", children: rendered.length > 0 ? rendered : ' ' }, `line-${lineIndex}`),
|
|
27
27
|
];
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
export function CodeInfoButton({ title, code, onOpen, }) {
|
|
31
|
-
return (_jsx(IconButton, { className:
|
|
31
|
+
return (_jsx(IconButton, { className: "oui-code-info-button", size: 1, v: "pad", tone: "info", icon: _jsx(LuInfo, { size: 14 }), "aria-label": `Show ${title} code`, onClick: () => onOpen({ title, code }) }));
|
|
32
32
|
}
|
|
33
33
|
export function ExampleTileHeader({ title, code, onOpen, }) {
|
|
34
|
-
return (_jsx(Flex, { className:
|
|
34
|
+
return (_jsx(Flex, { className: "oui-ui-tile-head", a: "s", g: 1, wrap: true, children: _jsx(CodeInfoButton, { title: title, code: code, onOpen: onOpen }) }));
|
|
35
35
|
}
|
|
36
36
|
export function ExampleTile({ id, title, code, onOpen, className, children, }) {
|
|
37
|
-
return (_jsxs("div", { id: id, className: cn('oui-section oui-ui-tile', className), children: [_jsxs("div", { className:
|
|
37
|
+
return (_jsxs("div", { id: id, className: cn('oui-section oui-ui-tile', className), children: [_jsxs("div", { className: "oui-ui-tile-body", children: [_jsx(ExampleTileHeader, { title: title, code: code, onOpen: onOpen }), children] }), _jsx(InlineCodeBlock, { code: code })] }));
|
|
38
38
|
}
|
|
39
39
|
export function InlineCodeBlock({ code }) {
|
|
40
40
|
const [expanded, setExpanded] = useState(false);
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const nextHeight = element.scrollHeight;
|
|
53
|
-
setContentHeight((current) => current === nextHeight ? current : nextHeight);
|
|
54
|
-
}, []);
|
|
55
|
-
useLayoutEffect(() => {
|
|
56
|
-
measure();
|
|
57
|
-
}, [code, measure]);
|
|
58
|
-
useLayoutEffect(() => {
|
|
59
|
-
const element = contentRef.current;
|
|
60
|
-
if (!element || typeof ResizeObserver === 'undefined')
|
|
61
|
-
return;
|
|
62
|
-
const observer = new ResizeObserver(() => measure());
|
|
63
|
-
observer.observe(element);
|
|
64
|
-
return () => observer.disconnect();
|
|
65
|
-
}, [measure]);
|
|
66
|
-
const handleWheelCapture = useCallback((event) => {
|
|
67
|
-
if (event.ctrlKey || event.shiftKey || Math.abs(event.deltaY) <= Math.abs(event.deltaX))
|
|
68
|
-
return;
|
|
69
|
-
const scrollRoot = document.querySelector('.oui-app-shell-content-scroll .oui-scroll-area-viewport');
|
|
70
|
-
if (!scrollRoot)
|
|
71
|
-
return;
|
|
72
|
-
event.preventDefault();
|
|
73
|
-
event.stopPropagation();
|
|
74
|
-
scrollRoot.scrollTop += normalizedWheelDeltaY(event);
|
|
75
|
-
}, []);
|
|
76
|
-
return (_jsxs("div", { className: 'oui-code-inline-panel', "data-expanded": expanded ? 'true' : 'false', "data-collapsible": collapsible ? 'true' : 'false', style: { height: panelHeight || undefined }, onWheelCapture: handleWheelCapture, children: [_jsx("div", { ref: contentRef, className: 'oui-code-inline-content', children: _jsx(CodeBlock, { code: code }) }), collapsible && !expanded ? _jsx("div", { className: 'oui-code-inline-fade', "aria-hidden": true }) : null, collapsible ? (_jsx("button", { type: 'button', className: 'oui-code-inline-toggle', "aria-expanded": expanded, onClick: () => setExpanded((current) => !current), children: expanded ? 'Hide code' : 'Show code' })) : null] }));
|
|
77
|
-
}
|
|
78
|
-
function normalizedWheelDeltaY(event) {
|
|
79
|
-
if (event.deltaMode === 1)
|
|
80
|
-
return event.deltaY * 16;
|
|
81
|
-
if (event.deltaMode === 2)
|
|
82
|
-
return event.deltaY * window.innerHeight;
|
|
83
|
-
return event.deltaY;
|
|
84
|
-
}
|
|
85
|
-
export function CodeBlock({ code }) {
|
|
86
|
-
return (_jsx(ScrollArea, { className: 'oui-code-preview-scroll', children: _jsx("pre", { className: 'oui-code-preview', children: _jsx("code", { children: highlightedCode(code) }) }) }));
|
|
41
|
+
const lineCount = code.split('\n').length;
|
|
42
|
+
const collapsible = lineCount > 9;
|
|
43
|
+
return (_jsxs("div", { className: "oui-code-inline-panel", "data-expanded": expanded ? 'true' : 'false', "data-collapsible": collapsible ? 'true' : 'false', style: { '--oui-code-lines': lineCount }, children: [_jsx("div", { className: "oui-code-inline-content", children: _jsx(CodeBlock, { code: code, mode: "inline" }) }), collapsible ? _jsx("div", { className: "oui-code-inline-fade", "aria-hidden": true }) : null, collapsible ? (_jsx("button", { type: "button", className: "oui-code-inline-toggle", "aria-expanded": expanded, onClick: () => setExpanded((current) => !current), children: expanded ? 'Hide code' : 'Show code' })) : null] }));
|
|
44
|
+
}
|
|
45
|
+
export function CodeBlock({ code, mode = 'scroll' }) {
|
|
46
|
+
const content = useMemo(() => highlightedCode(code), [code]);
|
|
47
|
+
const codeNode = (_jsx("pre", { className: "oui-code-preview", children: _jsx("code", { children: content }) }));
|
|
48
|
+
if (mode === 'inline') {
|
|
49
|
+
return (_jsxs("div", { className: "oui-code-preview-wrap", children: [_jsx(CopyIconButton, { className: "oui-code-preview-copy", text: code, label: "Copy code", successMessage: "Code copied", size: 1, v: "soft" }), _jsx(ScrollArea, { className: "oui-code-preview-scroll oui-code-preview-scroll-inline", scrollbars: "horizontal", children: codeNode })] }));
|
|
50
|
+
}
|
|
51
|
+
return (_jsxs("div", { className: "oui-code-preview-wrap", children: [_jsx(CopyIconButton, { className: "oui-code-preview-copy", text: code, label: "Copy code", successMessage: "Code copied", size: 1, v: "soft" }), _jsx(ScrollArea, { className: "oui-code-preview-scroll", children: codeNode })] }));
|
|
87
52
|
}
|
|
88
53
|
export function CodePreviewModal({ example, onClose, }) {
|
|
89
54
|
return (_jsxs(Modal, { open: example !== null, onOpenChange: (open) => {
|
|
90
55
|
if (!open)
|
|
91
56
|
onClose();
|
|
92
|
-
}, maxWidth: 760, children: [_jsxs(Modal.Header, { children: [_jsxs("div", { className:
|
|
57
|
+
}, maxWidth: 760, children: [_jsxs(Modal.Header, { children: [_jsxs("div", { className: "oui-modal-title-wrap", children: [_jsx("h2", { className: "oui-modal-title", children: example?.title ?? 'Component code' }), _jsx("p", { className: "oui-modal-description", children: "Import and usage example." })] }), _jsx(IconButton, { v: "ghost", icon: _jsx(LuX, { size: 18 }), "aria-label": "Close", onClick: onClose })] }), _jsx(Modal.Body, { children: example ? _jsx(CodeBlock, { code: example.code }) : null })] }));
|
|
93
58
|
}
|
|
@@ -5,6 +5,6 @@ type ActionsSectionProps = {
|
|
|
5
5
|
onOpenCode: (example: CodeExample) => void;
|
|
6
6
|
onOpenPalette: () => void;
|
|
7
7
|
};
|
|
8
|
-
export declare function ActionsSection({ menuItems, onOpenCode, onOpenPalette
|
|
8
|
+
export declare function ActionsSection({ menuItems, onOpenCode, onOpenPalette }: ActionsSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=ExampleActionsSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleActionsSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleActionsSection.tsx"],"names":[],"mappings":"AAsBA,OAAO,
|
|
1
|
+
{"version":3,"file":"ExampleActionsSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleActionsSection.tsx"],"names":[],"mappings":"AAsBA,OAAO,EAYH,KAAK,QAAQ,EAChB,MAAM,IAAI,CAAC;AAEZ,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAG9D,KAAK,mBAAmB,GAAG;IACvB,SAAS,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACnC,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C,aAAa,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,mBAAmB,2CA6V3F"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { LuBell, LuCheck, LuCommand, LuCopy, LuDownload, LuEllipsis, LuExternalLink, LuInfo, LuMessageSquare, LuPackagePlus, LuRefreshCw, LuSearch, LuSettings, LuShield, LuTrash2, LuTriangleAlert, LuUpload, } from 'react-icons/lu';
|
|
4
|
-
import { Button, ContextMenu, Flex, IconButton, IconTextButton, Menu, Spinner, Text, Tooltip, } from '..';
|
|
4
|
+
import { Button, ContextMenu, CopyButton, CopyIconButton, Flex, IconButton, IconTextButton, Menu, Spinner, Text, Tooltip, } from '..';
|
|
5
5
|
import { ExampleTile } from './CodePreview';
|
|
6
6
|
import { codeSamples } from './codeSamples';
|
|
7
7
|
import { UiExampleSection } from './UiExampleSection';
|
|
8
|
-
export function ActionsSection({ menuItems, onOpenCode, onOpenPalette
|
|
9
|
-
return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id:
|
|
8
|
+
export function ActionsSection({ menuItems, onOpenCode, onOpenPalette }) {
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id: "buttons-example", title: "Buttons", description: "Button variants, tones, sizes, loading states and press animation.", children: _jsxs(ExampleTile, { title: "Buttons", code: codeSamples.buttons, onOpen: onOpenCode, children: [_jsxs("div", { className: "oui-ui-row", children: [_jsx(Button, { size: 3, children: "Solid" }), _jsx(Button, { size: 3, v: "soft", children: "Soft" }), _jsx(Button, { size: 3, v: "surface", children: "Surface" }), _jsx(Button, { size: 3, v: "pad", children: "Pad" }), _jsx(Button, { size: 3, v: "outline", children: "Outline" }), _jsx(Button, { size: 3, v: "ghost", children: "Ghost" })] }), _jsxs("div", { className: "oui-ui-row", children: [_jsx(Button, { size: 3, tone: "success", leftIcon: _jsx(LuCheck, { size: 16 }), children: "Success" }), _jsx(Button, { size: 3, tone: "warning", v: "soft", leftIcon: _jsx(LuTriangleAlert, { size: 16 }), children: "Warning" }), _jsx(Button, { size: 3, tone: "info", v: "soft", leftIcon: _jsx(LuInfo, { size: 16 }), children: "Info" }), _jsx(Button, { size: 3, tone: "danger", v: "soft", leftIcon: _jsx(LuTrash2, { size: 16 }), children: "Delete" }), _jsx(Button, { size: 3, loading: true, children: "Loading" }), _jsx(Button, { size: 3, v: "surface", loading: true, leftIcon: _jsx(LuCheck, { size: 16 }), children: "Save" }), _jsx(Button, { size: 3, tone: "success", loading: true, leftIcon: _jsx(LuCheck, { size: 16 }), children: "Success" }), _jsx(Spinner, {})] }), _jsxs("div", { className: "oui-ui-row", children: [_jsx(Button, { size: 1, v: "surface", children: "Size 1" }), _jsx(Button, { size: 2, v: "surface", children: "Size 2" }), _jsx(Button, { size: 3, v: "surface", children: "Size 3" }), _jsx(Button, { size: 4, v: "surface", children: "Size 4" })] }), _jsxs("div", { className: "oui-ui-row", children: [_jsx(Button, { size: 1, children: "Solid 1" }), _jsx(Button, { size: 2, v: "soft", children: "Soft 2" }), _jsx(Button, { size: 3, v: "surface", children: "Surface 3" }), _jsx(Button, { size: 3, v: "pad", children: "Pad 3" }), _jsx(Button, { size: 4, v: "outline", children: "Outline 4" }), _jsx(Button, { size: 2, v: "ghost", children: "Ghost 2" })] }), _jsxs("div", { className: "oui-ui-row", children: [_jsx(Button, { v: "surface", pressAnimation: "translate", children: "Press translate" }), _jsx(Button, { v: "surface", pressAnimation: "scale", children: "Press scale" }), _jsx(Button, { v: "surface", pressAnimation: "soft", children: "Press soft" }), _jsx(Button, { v: "surface", pressAnimation: "none", children: "Press none" })] }), _jsxs("div", { className: "oui-ui-row", children: [_jsx(CopyButton, { text: "https://orcestr.dev/requests/PR-2026-0900", label: "Copy link", successMessage: "Link copied", v: "surface" }), _jsx(CopyIconButton, { text: "PR-2026-0900", label: "Copy request number", successMessage: "Request number copied", v: "surface" })] })] }) }), _jsx(UiExampleSection, { id: "icon-text-buttons-example", title: "Icon text buttons", description: "Button and link-button behavior with library-owned icon spacing.", children: _jsx(ExampleTile, { title: "IconTextButton", code: codeSamples.iconTextButton, onOpen: onOpenCode, children: _jsxs(Flex, { g: 2, a: "c", wrap: true, children: [_jsx(IconTextButton, { icon: _jsx(LuPackagePlus, { size: 16 }), children: "Create PO" }), _jsx(IconTextButton, { v: "soft", tone: "info", icon: _jsx(LuCopy, { size: 16 }), children: "Duplicate" }), _jsx(IconTextButton, { href: "#icon-text-buttons-example", v: "surface", icon: _jsx(LuExternalLink, { size: 16 }), children: "Link action" }), _jsx(IconTextButton, { v: "outline", iconSide: "end", icon: _jsx(LuExternalLink, { size: 16 }), children: "Open details" })] }) }) }), _jsx(UiExampleSection, { id: "icon-buttons-example", title: "Icon buttons", description: "Icon-only actions, loading state, menu trigger and command entry.", children: _jsxs(ExampleTile, { title: "Icon buttons", code: codeSamples.iconButtons, onOpen: onOpenCode, children: [_jsxs(Flex, { g: 2, a: "c", wrap: true, children: [_jsx(IconButton, { v: "solid", icon: _jsx(LuCheck, { size: 17 }), "aria-label": "Solid icon" }), _jsx(IconButton, { v: "soft", icon: _jsx(LuSearch, { size: 17 }), "aria-label": "Search icon" }), _jsx(IconButton, { v: "surface", icon: _jsx(LuUpload, { size: 17 }), "aria-label": "Upload icon" }), _jsx(IconButton, { v: "pad", icon: _jsx(LuShield, { size: 17 }), "aria-label": "Security icon" }), _jsx(IconButton, { v: "outline", icon: _jsx(LuInfo, { size: 17 }), "aria-label": "Outline icon" }), _jsx(IconButton, { v: "ghost", icon: _jsx(LuEllipsis, { size: 17 }), "aria-label": "Ghost icon" })] }), _jsxs(Flex, { g: 2, a: "c", wrap: true, children: [_jsx(IconButton, { size: 1, v: "surface", icon: _jsx(LuSearch, { size: 13 }), "aria-label": "Size 1 search" }), _jsx(IconButton, { size: 2, v: "surface", icon: _jsx(LuDownload, { size: 15 }), "aria-label": "Size 2 download" }), _jsx(IconButton, { size: 3, v: "surface", icon: _jsx(LuRefreshCw, { size: 17 }), "aria-label": "Size 3 refresh" }), _jsx(IconButton, { size: 4, v: "surface", icon: _jsx(LuSettings, { size: 19 }), "aria-label": "Size 4 settings" }), _jsx(IconButton, { size: 3, v: "pad", round: false, r: 3, icon: _jsx(LuCommand, { size: 17 }), "aria-label": "Square pad icon" }), _jsx(IconButton, { size: 3, v: "outline", loading: true, icon: _jsx(LuRefreshCw, { size: 17 }), "aria-label": "Loading icon" })] }), _jsxs(Flex, { g: 2, a: "c", wrap: true, children: [_jsx(IconButton, { v: "surface", icon: _jsx(LuBell, { size: 17 }), badge: 64, "aria-label": "Notifications" }), _jsx(IconButton, { v: "surface", icon: _jsx(LuMessageSquare, { size: 17 }), badge: 99, "aria-label": "Unread chats" }), _jsx(IconButton, { v: "pad", icon: _jsx(LuShield, { size: 17 }), badge: 3, badgeTone: "warning", "aria-label": "Security warnings" }), _jsx(IconButton, { v: "ghost", icon: _jsx(LuDownload, { size: 17 }), badge: "new", badgeTone: "info", "aria-label": "New export" })] }), _jsxs(Flex, { g: 2, a: "c", wrap: true, children: [_jsx(IconButton, { size: 1, v: "ghost", icon: _jsx(LuEllipsis, { size: 13 }), "aria-label": "Ghost size 1" }), _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuEllipsis, { size: 15 }), "aria-label": "Ghost size 2" }), _jsx(IconButton, { size: 3, v: "ghost", icon: _jsx(LuEllipsis, { size: 17 }), "aria-label": "Ghost size 3" }), _jsx(IconButton, { size: 4, v: "ghost", icon: _jsx(LuEllipsis, { size: 19 }), "aria-label": "Ghost size 4" })] }), _jsxs("div", { className: "oui-ui-row", children: [_jsx(Tooltip, { content: "Notifications", children: _jsx(IconButton, { v: "surface", icon: _jsx(LuBell, { size: 17 }), badge: 8, "aria-label": "Notifications" }) }), _jsx(IconButton, { v: "surface", loading: true, icon: _jsx(LuRefreshCw, { size: 17 }), "aria-label": "Loading action" }), _jsx(IconButton, { v: "pad", icon: _jsx(LuSettings, { size: 17 }), "aria-label": "Pad action" }), _jsx(Menu, { trigger: _jsx(IconButton, { v: "surface", icon: _jsx(LuEllipsis, { size: 17 }), "aria-label": "Actions" }), items: menuItems }), _jsx(Button, { v: "surface", leftIcon: _jsx(LuCommand, { size: 16 }), onClick: onOpenPalette, children: "Commands" })] })] }) }), _jsx(UiExampleSection, { id: "context-menu-example", title: "Context menu", description: "Right-click menu layer using shared action menu items.", children: _jsx(ExampleTile, { title: "ContextMenu", code: codeSamples.contextMenu, onOpen: onOpenCode, children: _jsx(ContextMenu, { items: menuItems, children: _jsxs("div", { className: "oui-ui-context-menu-demo", children: [_jsx(Text, { fs: "13px", fw: 760, children: "Right-click this row" }), _jsx(Text, { fs: "12px", tone: "muted", children: "ContextMenu reuses Menu item sizing, tones and confirm actions." })] }) }) }) })] }));
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleApplicationSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleApplicationSection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExampleApplicationSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleApplicationSection.tsx"],"names":[],"mappings":"AAgDA,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAG9D,KAAK,mBAAmB,GAAG;IACvB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,CAAC;AAIF,wBAAgB,kBAAkB,CAAC,EAAE,UAAU,EAAE,EAAE,mBAAmB,2CA4RrE"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import { LuArrowLeft, LuArrowLeftRight, LuBell, LuBox, LuBraces, LuCalendar, LuClipboardList, LuCog, LuEllipsis, LuFlaskConical, LuHeadphones, LuLanguages, LuLayoutDashboard, LuMessageSquare, LuSearch, LuSettings, LuShield, LuSun, LuTruck, } from 'react-icons/lu';
|
|
5
|
-
import { AppShell, AppShellContent, AppShellHeader, AppSidebar, Badge, Button, Flex, IconButton, IconTextButton, PageTitleBlock, SpecialModal, Stack, Text, } from '..';
|
|
4
|
+
import { LuArrowLeft, LuArrowLeftRight, LuBell, LuBox, LuBraces, LuCalendar, LuCheck, LuClipboardList, LuCog, LuEllipsis, LuFlaskConical, LuHeadphones, LuLanguages, LuLayoutDashboard, LuMessageSquare, LuSearch, LuSettings, LuShield, LuSun, LuTruck, } from 'react-icons/lu';
|
|
5
|
+
import { AppShell, AppShellContent, AppShellHeader, AppSidebar, Badge, Button, Flex, IconButton, IconTextButton, Menu, PageTitleBlock, SpecialModal, Stack, Text, Tooltip, } from '..';
|
|
6
6
|
import { ExampleTile } from './CodePreview';
|
|
7
7
|
import { codeSamples } from './codeSamples';
|
|
8
8
|
import { UiExampleSection } from './UiExampleSection';
|
|
9
9
|
export function ApplicationSection({ onOpenCode }) {
|
|
10
10
|
const [appShellOpen, setAppShellOpen] = useState(false);
|
|
11
11
|
const [appShellPreviewMode, setAppShellPreviewMode] = useState('desktop');
|
|
12
|
+
const [appShellSidebarSide, setAppShellSidebarSide] = useState('left');
|
|
12
13
|
const [specialModalOpen, setSpecialModalOpen] = useState(false);
|
|
13
14
|
const [shellMobileOpen, setShellMobileOpen] = useState(false);
|
|
14
15
|
const [shellActiveKey, setShellActiveKey] = useState('requests');
|
|
@@ -17,52 +18,119 @@ export function ApplicationSection({ onOpenCode }) {
|
|
|
17
18
|
{
|
|
18
19
|
key: 'demand',
|
|
19
20
|
items: [
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
{
|
|
22
|
+
key: 'overview',
|
|
23
|
+
label: 'Overview',
|
|
24
|
+
icon: _jsx(LuLayoutDashboard, { size: 17 }),
|
|
25
|
+
active: shellActiveKey === 'overview',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
key: 'requests',
|
|
29
|
+
label: 'Requests',
|
|
30
|
+
icon: _jsx(LuTruck, { size: 17 }),
|
|
31
|
+
active: shellActiveKey === 'requests',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: 'orders',
|
|
35
|
+
label: 'Supplier orders',
|
|
36
|
+
icon: _jsx(LuClipboardList, { size: 17 }),
|
|
37
|
+
active: shellActiveKey === 'orders',
|
|
38
|
+
},
|
|
23
39
|
],
|
|
24
40
|
},
|
|
25
41
|
{
|
|
26
|
-
key: '
|
|
42
|
+
key: 'inventory',
|
|
27
43
|
items: [
|
|
28
|
-
{
|
|
29
|
-
|
|
44
|
+
{
|
|
45
|
+
key: 'products',
|
|
46
|
+
label: 'Products',
|
|
47
|
+
icon: _jsx(LuBox, { size: 17 }),
|
|
48
|
+
active: shellActiveKey === 'products',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: 'calendar',
|
|
52
|
+
label: 'Calendar',
|
|
53
|
+
icon: _jsx(LuCalendar, { size: 17 }),
|
|
54
|
+
active: shellActiveKey === 'calendar',
|
|
55
|
+
},
|
|
30
56
|
],
|
|
31
57
|
},
|
|
32
58
|
];
|
|
33
|
-
return (_jsxs(_Fragment, { children: [_jsxs(UiExampleSection, { id:
|
|
59
|
+
return (_jsxs(_Fragment, { children: [_jsxs(UiExampleSection, { id: "app-shell-example", title: "AppShell", description: "Application shell primitives for module frames.", children: [_jsx(ExampleTile, { title: "Fullscreen AppShell preview", code: codeSamples.appShell, onOpen: onOpenCode, children: _jsx(IconTextButton, { icon: _jsx(LuLayoutDashboard, { size: 16 }), onClick: () => setAppShellOpen(true), children: "Open AppShell preview" }) }), _jsxs(SpecialModal, { open: appShellOpen, onOpenChange: setAppShellOpen, size: "full", scroll: "body", density: "compact", contentClassName: "oui-ui-app-shell-modal", children: [_jsxs(SpecialModal.Header, { className: "oui-ui-app-shell-modal-header", children: [_jsx(Flex, { a: "c", g: 2, minW: 0, children: _jsx(Text, { fw: 760, children: "AppShell preview" }) }), _jsxs(Flex, { a: "c", g: 1, children: [_jsx(Button, { className: "oui-ui-app-shell-mode-toggle", size: 2, v: "surface", onClick: () => {
|
|
34
60
|
setShellMobileOpen(false);
|
|
35
61
|
setAppShellPreviewMode((mode) => mode === 'desktop' ? 'phone' : 'desktop');
|
|
36
|
-
}, children: appShellPreviewMode === 'desktop'
|
|
37
|
-
? 'Phone view'
|
|
38
|
-
: 'Desktop view' }), _jsx(SpecialModal.Close, {})] })] }), _jsx(SpecialModal.Body, { className: 'oui-ui-app-shell-modal-body', children: _jsx("div", { className: 'oui-ui-app-shell-preview-stage', "data-mode": appShellPreviewMode, children: _jsx(DemoAppShellPreview, { mode: appShellPreviewMode, mobileOpen: shellMobileOpen, onMobileOpenChange: setShellMobileOpen, groups: shellGroups, onNavigate: (item) => setShellActiveKey(item.key) }) }) })] })] }), _jsx(UiExampleSection, { id: 'app-sidebar-example', title: 'AppSidebar', description: 'Deliveries-style sidebar with active indicator and footer actions.', children: _jsx(ExampleTile, { title: 'AppSidebar', code: codeSamples.appSidebar, onOpen: onOpenCode, children: _jsx("div", { className: 'oui-ui-app-sidebar-demo', children: _jsx(AppSidebar, { header: (_jsxs(_Fragment, { children: [_jsxs("div", { className: 'oui-app-sidebar-brand', children: [_jsx("span", { className: 'oui-app-sidebar-logo', children: _jsx("span", { className: 'oui-ui-demo-logo', children: "O" }) }), _jsx("span", { className: 'oui-app-sidebar-title', children: "Deliveries" })] }), _jsx("div", { className: 'oui-app-sidebar-actions', children: _jsx(IconButton, { size: 2, v: 'ghost', icon: _jsx(LuEllipsis, { size: 16 }), "aria-label": 'Sidebar actions' }) })] })), itemH: 38, onNavigate: (item) => setSidebarActiveKey(item.key), groups: [
|
|
62
|
+
}, children: appShellPreviewMode === 'desktop' ? 'Phone view' : 'Desktop view' }), _jsx(SpecialModal.Close, {})] })] }), _jsx(SpecialModal.Body, { className: "oui-ui-app-shell-modal-body", children: _jsx("div", { className: "oui-ui-app-shell-preview-stage", "data-mode": appShellPreviewMode, children: _jsx(DemoAppShellPreview, { mode: appShellPreviewMode, mobileOpen: shellMobileOpen, onMobileOpenChange: setShellMobileOpen, sidebarSide: appShellSidebarSide, onToggleSidebarSide: () => setAppShellSidebarSide((side) => side === 'left' ? 'right' : 'left'), groups: shellGroups, onNavigate: (item) => setShellActiveKey(item.key) }) }) })] })] }), _jsx(UiExampleSection, { id: "app-sidebar-example", title: "AppSidebar", description: "Deliveries-style sidebar with active indicator and footer actions.", children: _jsx(ExampleTile, { title: "AppSidebar", code: codeSamples.appSidebar, onOpen: onOpenCode, children: _jsx("div", { className: "oui-ui-app-sidebar-demo", children: _jsx(AppSidebar, { header: _jsxs(_Fragment, { children: [_jsxs("div", { className: "oui-app-sidebar-brand", children: [_jsx("span", { className: "oui-app-sidebar-logo", children: _jsx("span", { className: "oui-ui-demo-logo", children: "O" }) }), _jsx("span", { className: "oui-app-sidebar-title", children: "Deliveries" })] }), _jsx("div", { className: "oui-app-sidebar-actions", children: _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuEllipsis, { size: 16 }), "aria-label": "Sidebar actions" }) })] }), itemH: 38, onNavigate: (item) => setSidebarActiveKey(item.key), groups: [
|
|
39
63
|
{
|
|
40
64
|
key: 'main',
|
|
41
65
|
items: [
|
|
42
|
-
{
|
|
43
|
-
|
|
44
|
-
|
|
66
|
+
{
|
|
67
|
+
key: 'overview',
|
|
68
|
+
label: 'Overview',
|
|
69
|
+
icon: _jsx(LuLayoutDashboard, { size: 17 }),
|
|
70
|
+
active: sidebarActiveKey === 'overview',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: 'requests',
|
|
74
|
+
label: 'Requests',
|
|
75
|
+
icon: _jsx(LuTruck, { size: 17 }),
|
|
76
|
+
active: sidebarActiveKey === 'requests',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: 'orders',
|
|
80
|
+
label: 'Supplier orders',
|
|
81
|
+
icon: _jsx(LuClipboardList, { size: 17 }),
|
|
82
|
+
active: sidebarActiveKey === 'orders',
|
|
83
|
+
},
|
|
45
84
|
],
|
|
46
85
|
},
|
|
47
86
|
{
|
|
48
87
|
key: 'inventory',
|
|
49
88
|
items: [
|
|
50
|
-
{
|
|
51
|
-
|
|
89
|
+
{
|
|
90
|
+
key: 'products',
|
|
91
|
+
label: 'Products',
|
|
92
|
+
icon: _jsx(LuBox, { size: 17 }),
|
|
93
|
+
active: sidebarActiveKey === 'products',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
key: 'calendar',
|
|
97
|
+
label: 'Calendar',
|
|
98
|
+
icon: _jsx(LuCalendar, { size: 17 }),
|
|
99
|
+
disabled: true,
|
|
100
|
+
},
|
|
52
101
|
],
|
|
53
102
|
},
|
|
54
|
-
], footer:
|
|
103
|
+
], footer: _jsxs(Flex, { col: true, g: 2, children: [_jsxs(Flex, { g: 1, a: "c", children: [_jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuBell, { size: 15 }), badge: 64, "aria-label": "Notifications" }), _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuSettings, { size: 15 }), "aria-label": "Settings" }), _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuCog, { size: 15 }), "aria-label": "Developer tools" })] }), _jsx(Text, { fs: "12px", tone: "muted", children: "Admin workspace" })] }) }) }) }) }), _jsxs(UiExampleSection, { id: "special-modal-example", title: "SpecialModal", description: "Large entity modal shell for rich operational dialogs.", children: [_jsx(ExampleTile, { title: "SpecialModal", code: codeSamples.specialModal, onOpen: onOpenCode, children: _jsx(Button, { onClick: () => setSpecialModalOpen(true), children: "Open special modal" }) }), _jsxs(SpecialModal, { open: specialModalOpen, onOpenChange: setSpecialModalOpen, size: "lg", scroll: "body", children: [_jsx(SpecialModal.Header, { title: "Request PR-2026-0900", meta: _jsxs(Flex, { g: 2, a: "c", wrap: true, children: [_jsx(Badge, { tone: "success", children: "Closed" }), _jsx(Badge, { tone: "neutral", children: "RUB" })] }), actions: _jsx(SpecialModal.Close, {}) }), _jsx(SpecialModal.Body, { children: _jsxs(Stack, { g: 3, children: [_jsxs(Flex, { g: 4, wrap: true, children: [_jsxs(Stack, { g: 0, w: "min(100%, 220px)", children: [_jsx(Text, { fs: "12px", tone: "muted", children: "Supplier" }), _jsx(Text, { fw: 760, children: "Northwind Trading LLC" })] }), _jsxs(Stack, { g: 0, w: "min(100%, 180px)", children: [_jsx(Text, { fs: "12px", tone: "muted", children: "Plan arrival" }), _jsx(Text, { fw: 760, children: "25.06.2026" })] })] }), _jsx(TableLikePreview, {})] }) }), _jsx(SpecialModal.Footer, { children: _jsxs(Flex, { g: 2, j: "e", w: "100%", children: [_jsx(Button, { v: "surface", onClick: () => setSpecialModalOpen(false), children: "Close" }), _jsx(Button, { children: "Save" })] }) })] })] })] }));
|
|
55
104
|
}
|
|
56
|
-
function DemoAppShellPreview({ mode, mobileOpen, onMobileOpenChange, groups, onNavigate, }) {
|
|
105
|
+
function DemoAppShellPreview({ mode, mobileOpen, onMobileOpenChange, sidebarSide, onToggleSidebarSide, groups, onNavigate, }) {
|
|
57
106
|
const isPhone = mode === 'phone';
|
|
58
|
-
|
|
107
|
+
const isRight = sidebarSide === 'right';
|
|
108
|
+
return (_jsx(AppShell, { className: "oui-ui-app-shell-preview", sidebarMode: isPhone ? 'mobile' : 'desktop', sidebarSide: sidebarSide, sidebarWidth: 300, maxWidth: "100%", contentInset: 0, sidebarOpen: mobileOpen, desktopSidebarOpen: true, onSidebarOpenChange: onMobileOpenChange, header: _jsx(AppShellHeader, { visibility: "always", sidebarOpen: mobileOpen, onSidebarOpenChange: onMobileOpenChange, navigationVisibility: "mobile", actions: _jsx(DemoHeaderActions, {}) }), sidebar: _jsx(AppSidebar, { side: sidebarSide, header: _jsxs(_Fragment, { children: [_jsx(DemoShellBrand, {}), _jsxs("div", { className: "oui-app-sidebar-actions", children: [_jsx(Tooltip, { content: "Back", children: _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuArrowLeft, { size: 17 }), "aria-label": "Back" }) }), _jsx(Tooltip, { content: isRight ? 'Move sidebar left' : 'Move sidebar right', children: _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuArrowLeftRight, { size: 17 }), "aria-label": isRight ? 'Move sidebar left' : 'Move sidebar right', onClick: onToggleSidebarSide }) }), _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuEllipsis, { size: 16 }), "aria-label": "Sidebar actions" })] })] }), itemH: 38, onNavigate: onNavigate, groups: groups, footer: _jsx(DemoSidebarFooter, {}) }), children: _jsxs(AppShellContent, { scroll: false, children: [_jsx(PageTitleBlock, { title: "Requests", caption: "Module workspace with responsive header and AppSidebar navigation.", action: _jsx(IconButton, { size: 2, v: "pad", icon: _jsx(LuEllipsis, { size: 16 }), "aria-label": "More actions" }) }), _jsx(TableLikePreview, {})] }) }));
|
|
109
|
+
}
|
|
110
|
+
function DemoShellBrand() {
|
|
111
|
+
return (_jsxs("div", { className: "oui-app-sidebar-brand", children: [_jsx("span", { className: "oui-app-sidebar-logo", children: _jsx("span", { className: "oui-ui-demo-logo", children: "O" }) }), _jsx("span", { className: "oui-app-sidebar-title", children: "Deliveries" })] }));
|
|
59
112
|
}
|
|
60
113
|
function DemoHeaderActions() {
|
|
61
|
-
|
|
114
|
+
const [locale, setLocale] = useState('en');
|
|
115
|
+
const languageItems = [
|
|
116
|
+
{
|
|
117
|
+
key: 'ru',
|
|
118
|
+
label: 'RU',
|
|
119
|
+
icon: locale === 'ru' ? _jsx(LuCheck, { size: 14 }) : undefined,
|
|
120
|
+
onSelect: () => setLocale('ru'),
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
key: 'en',
|
|
124
|
+
label: 'EN',
|
|
125
|
+
icon: locale === 'en' ? _jsx(LuCheck, { size: 14 }) : undefined,
|
|
126
|
+
onSelect: () => setLocale('en'),
|
|
127
|
+
},
|
|
128
|
+
];
|
|
129
|
+
return (_jsxs(Flex, { className: "oui-ui-app-shell-header-actions-demo", a: "c", g: 1, children: [_jsx(IconTextButton, { className: "oui-ui-app-shell-quick-jump", size: 2, v: "soft", tone: "neutral", icon: _jsx(LuSearch, { size: 14 }), children: "Quick jump" }), _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuBell, { size: 18 }), badge: 64, "aria-label": "Notifications" }), _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuMessageSquare, { size: 18 }), badge: 99, "aria-label": "Messages" }), _jsx(Menu, { align: "end", items: languageItems, trigger: _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuLanguages, { size: 18 }), "aria-label": `Language: ${locale.toUpperCase()}` }) }), _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuSun, { size: 18 }), "aria-label": "Theme" }), _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuShield, { size: 18 }), "aria-label": "Admin" })] }));
|
|
62
130
|
}
|
|
63
131
|
function DemoSidebarFooter() {
|
|
64
|
-
return (_jsxs(Flex, { col: true, g: 2, children: [_jsxs(Flex, { g: 1, a:
|
|
132
|
+
return (_jsxs(Flex, { col: true, g: 2, children: [_jsxs(Flex, { g: 1, a: "c", children: [_jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuHeadphones, { size: 15 }), "aria-label": "Support" }), _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuBell, { size: 15 }), badge: 64, "aria-label": "Notifications" }), _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuSettings, { size: 15 }), "aria-label": "Settings" }), _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuFlaskConical, { size: 15 }), "aria-label": "Demo data" }), _jsx(IconButton, { size: 2, v: "ghost", icon: _jsx(LuBraces, { size: 15 }), "aria-label": "API" })] }), _jsx(Text, { fs: "12px", tone: "muted", children: "Admin workspace" })] }));
|
|
65
133
|
}
|
|
66
134
|
function TableLikePreview() {
|
|
67
|
-
return (_jsxs("div", { className:
|
|
135
|
+
return (_jsxs("div", { className: "oui-ui-application-table-preview", children: [['Brand', 'Name', 'Article', 'Qty', 'Price'].map((item) => (_jsx(Text, { fs: "12px", fw: 760, children: item }, item))), ['Stalex', 'Lathe machine', 'LATHE-8191', '22', '1250'].map((item) => (_jsx(Text, { fs: "13px", children: item }, item)))] }));
|
|
68
136
|
}
|
|
@@ -2,7 +2,7 @@ import { type CodeExample } from './codeSamples';
|
|
|
2
2
|
type ExampleSectionProps = {
|
|
3
3
|
onOpenCode: (example: CodeExample) => void;
|
|
4
4
|
};
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function TextSection({ onOpenCode }: ExampleSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare function LayoutSection({ onOpenCode }: ExampleSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=ExampleBasicsSections.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleBasicsSections.d.ts","sourceRoot":"","sources":["../../src/example/ExampleBasicsSections.tsx"],"names":[],"mappings":"AAuBA,OAAO,
|
|
1
|
+
{"version":3,"file":"ExampleBasicsSections.d.ts","sourceRoot":"","sources":["../../src/example/ExampleBasicsSections.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAG9D,KAAK,mBAAmB,GAAG;IACvB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,EAAE,mBAAmB,2CA8E9D;AAED,wBAAgB,aAAa,CAAC,EAAE,UAAU,EAAE,EAAE,mBAAmB,2CAgXhE"}
|
|
@@ -5,16 +5,30 @@ import { Alert, Badge, Box, Button, Card, Collapse, Flex, Grid, ScrollArea, Sect
|
|
|
5
5
|
import { ExampleTile } from './CodePreview';
|
|
6
6
|
import { codeSamples } from './codeSamples';
|
|
7
7
|
import { UiExampleSection } from './UiExampleSection';
|
|
8
|
-
export function
|
|
9
|
-
return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id:
|
|
8
|
+
export function TextSection({ onOpenCode }) {
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id: "text", title: "Text", description: "Text and shared system props.", children: _jsx(ExampleTile, { title: "Text", code: codeSamples.text, onOpen: onOpenCode, children: _jsxs(Stack, { g: 3, children: [_jsxs(Stack, { g: 1, children: [_jsx(Text, { as: "h1", fs: "28px", fw: 780, lh: 1.1, children: "Operations review" }), _jsx(Text, { as: "h2", fs: "20px", fw: 720, lh: 1.2, children: "Review window and status" }), _jsx(Text, { tone: "muted", fs: "13px", lh: 1.5, children: "Compact operational text with muted metadata and predictable line height." })] }), _jsxs(Stack, { g: 1, children: [_jsx(Text, { fs: "15px", fw: 700, children: "Body strong text" }), _jsx(Text, { fs: "14px", lh: 1.55, children: "Body regular text for dense forms and tables." }), _jsx(Text, { fs: "12px", tone: "muted", lh: 1.4, children: "Caption text, helper text and quiet labels." })] }), _jsxs(Flex, { g: 2, wrap: true, children: [_jsx(Text, { tone: "primary", fw: 700, children: "Primary" }), _jsx(Text, { tone: "success", fw: 700, children: "Success" }), _jsx(Text, { tone: "warning", fw: 700, children: "Warning" }), _jsx(Text, { tone: "danger", fw: 700, children: "Danger" }), _jsx(Text, { tone: "info", fw: 700, children: "Info" })] }), _jsx(Box, { w: "100%", p: 2, r: 3, style: { background: 'var(--oui-pad-bg)' }, children: _jsx(Text, { display: "block", truncate: true, children: "This is a long single line value that truncates cleanly inside a constrained row." }) }), _jsxs(Flex, { g: 2, wrap: true, children: [_jsx(Badge, { children: "Neutral" }), _jsx(Badge, { tone: "primary", children: "Primary" }), _jsx(Badge, { tone: "success", children: "Success" }), _jsx(Badge, { tone: "warning", children: "Warning" }), _jsx(Badge, { tone: "danger", children: "Danger" }), _jsx(Badge, { tone: "info", children: "Info" })] })] }) }) }), _jsx(UiExampleSection, { id: "skeleton-example", title: "Skeleton", description: "Loading placeholder primitives.", children: _jsx(ExampleTile, { title: "Skeleton", code: codeSamples.skeleton, onOpen: onOpenCode, children: _jsxs(Stack, { g: 2, children: [_jsx(Skeleton, { h: 16, w: "80%" }), _jsx(Skeleton, { h: 16, w: "64%" }), _jsx(Skeleton, { h: 36 })] }) }) })] }));
|
|
10
10
|
}
|
|
11
11
|
export function LayoutSection({ onOpenCode }) {
|
|
12
12
|
const [detailsOpen, setDetailsOpen] = useState(true);
|
|
13
|
-
return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id:
|
|
14
|
-
[
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id: "flex-example", title: "Flex", description: "Row and column alignment primitive.", children: _jsx(ExampleTile, { title: "Flex", code: codeSamples.layoutFlex, onOpen: onOpenCode, children: _jsxs(Flex, { col: true, g: 3, children: [_jsxs(Flex, { row: true, g: 2, a: "c", j: "sb", wrap: true, children: [_jsxs(Flex, { row: true, g: 2, a: "c", wrap: true, children: [_jsx(Badge, { tone: "primary", children: "status" }), _jsx(Text, { fw: 700, children: "Task TASK-2048" })] }), _jsxs(Flex, { row: true, g: 1, a: "c", children: [_jsx(Button, { size: 1, v: "surface", children: "Cancel" }), _jsx(Button, { size: 1, children: "Apply" })] })] }), _jsx(Flex, { row: true, g: 2, wrap: true, children: ['Intake', 'Review', 'Complete'].map((item, index) => (_jsxs(Flex, { col: true, g: 1, p: 2, r: 3, flex: "1 1 150px", style: { background: 'var(--oui-pad-bg)' }, children: [_jsxs(Text, { fs: "12px", tone: "muted", children: ["Step ", index + 1] }), _jsx(Text, { fw: 700, children: item })] }, item))) })] }) }) }), _jsx(UiExampleSection, { id: "stack-example", title: "Stack", description: "Vertical spacing primitive.", children: _jsx(ExampleTile, { title: "Stack", code: codeSamples.layoutStack, onOpen: onOpenCode, children: _jsx(Stack, { g: 2, children: [
|
|
14
|
+
[
|
|
15
|
+
'/gallery/cyberpunk-rain.webp',
|
|
16
|
+
'Created',
|
|
17
|
+
'Draft created from intake',
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
'/gallery/hollywood-star.webp',
|
|
21
|
+
'Reserved',
|
|
22
|
+
'Capacity is reserved for review',
|
|
23
|
+
],
|
|
24
|
+
['/gallery/ice-cave.webp', 'Scheduled', 'Review window is confirmed'],
|
|
25
|
+
].map(([image, title, description]) => (_jsxs(Flex, { row: true, g: 2, a: "c", w: "min(100%, 360px)", p: "8px 10px", r: 2, style: { background: 'var(--oui-pad-bg)' }, children: [_jsx("img", { src: image, alt: "", style: {
|
|
26
|
+
width: 34,
|
|
27
|
+
height: 34,
|
|
28
|
+
flex: '0 0 34px',
|
|
29
|
+
borderRadius: 999,
|
|
30
|
+
objectFit: 'cover',
|
|
31
|
+
} }), _jsxs(Stack, { g: 0, children: [_jsx(Text, { fs: "13px", fw: 700, children: title }), _jsx(Text, { fs: "12px", tone: "muted", lh: 1.45, children: description })] })] }, title))) }) }) }), _jsx(UiExampleSection, { id: "collapse-example", title: "Collapse", description: "Expandable content primitive.", children: _jsx(ExampleTile, { title: "Collapse", code: codeSamples.layoutCollapse, onOpen: onOpenCode, children: _jsxs(Stack, { g: 2, children: [_jsxs(Flex, { row: true, g: 2, a: "c", j: "sb", children: [_jsx(Text, { fw: 700, children: "Item details" }), _jsx(Button, { size: 1, v: "surface", onClick: () => setDetailsOpen((open) => !open), children: detailsOpen ? 'Hide' : 'Show' })] }), _jsx(Collapse, { open: detailsOpen, children: _jsxs(Stack, { g: 2, p: 2, r: 3, style: { background: 'var(--oui-pad-bg)' }, children: [_jsxs(Flex, { row: true, g: 2, j: "sb", children: [_jsx(Text, { tone: "muted", children: "Owner" }), _jsx(Text, { fw: 700, children: "Core team" })] }), _jsxs(Flex, { row: true, g: 2, j: "sb", children: [_jsx(Text, { tone: "muted", children: "Window" }), _jsx(Text, { fw: 700, children: "09:00 - 12:00" })] }), _jsxs(Flex, { row: true, g: 2, j: "sb", children: [_jsx(Text, { tone: "muted", children: "Priority" }), _jsx(Badge, { tone: "warning", children: "High" })] })] }) })] }) }) }), _jsx(UiExampleSection, { id: "surfaces-example", title: "Surfaces", description: "Card, Section, Separator and Alert primitives.", children: _jsx(ExampleTile, { title: "Surfaces", code: codeSamples.surfaces, onOpen: onOpenCode, children: _jsxs(Section, { g: 3, children: [_jsxs(Grid, { columns: "repeat(auto-fit, minmax(min(100%, 180px), 1fr))", g: 2, children: [_jsx(Card, { v: "surface", interactive: true, children: _jsxs(Stack, { g: 1, children: [_jsx(Text, { fw: 760, children: "Surface card" }), _jsx(Text, { fs: "12px", tone: "muted", children: "Default operational surface." })] }) }), _jsx(Card, { v: "soft", children: _jsxs(Stack, { g: 1, children: [_jsx(Text, { fw: 760, children: "Soft card" }), _jsx(Text, { fs: "12px", tone: "muted", children: "Quiet grouped content." })] }) }), _jsx(Card, { v: "classic", children: _jsxs(Stack, { g: 1, children: [_jsx(Text, { fw: 760, children: "Classic card" }), _jsx(Text, { fs: "12px", tone: "muted", children: "More explicit border and background." })] }) })] }), _jsx(Separator, {}), _jsx(Alert, { title: "Inventory sync delayed", action: _jsx(Button, { size: 1, v: "surface", children: "Retry" }), children: "Check this status before creating the next shipment." })] }) }) }), _jsx(UiExampleSection, { id: "grid-example", title: "Grid", description: "Grid layout primitive.", children: _jsx(ExampleTile, { title: "Grid", code: codeSamples.layoutGrid, onOpen: onOpenCode, children: _jsx(Grid, { columns: "repeat(3, minmax(0, 1fr))", g: 2, children: ['A', 'B', 'C', 'D', 'E', 'F'].map((item) => (_jsx(Box, { p: 2, r: 3, ta: "center", style: { background: 'var(--oui-pad-bg)' }, children: _jsx(Text, { fs: "13px", fw: 700, children: item }) }, item))) }) }) }), _jsx(UiExampleSection, { id: "highlight-primitives-example", title: "Highlight primitives", description: "Standalone edge mask primitives.", children: _jsx(ExampleTile, { title: "Highlight primitives", code: codeSamples.highlights, onOpen: onOpenCode, children: _jsxs("div", { className: "oui-highlight-demo-surface", style: { background: 'var(--oui-section-nested-solid-bg)' }, children: [_jsx(TopHighlight, { h: 32, color: "var(--oui-section-nested-solid-bg)", position: "absolute" }), _jsx(Text, { fs: "13px", fw: 700, children: "Top and bottom highlights" }), _jsx(Text, { fs: "12px", tone: "muted", children: "One surface shows both edge masks at the same time." }), _jsx(BottomHighlight, { h: 32, color: "var(--oui-section-nested-solid-bg)", position: "absolute" })] }) }) }), _jsx(UiExampleSection, { id: "scroll-area-example", title: "ScrollArea", description: "Themed scroll container with optional edge highlights.", children: _jsx(ExampleTile, { title: "ScrollArea", code: codeSamples.scrollArea, onOpen: onOpenCode, children: _jsxs(Stack, { g: 2, children: [_jsx(ScrollArea, { h: 116, pr: 1, children: _jsx(Stack, { g: 1, children: Array.from({ length: 10 }, (_, index) => (_jsx(Box, { p: 2, r: 3, style: { background: 'var(--oui-pad-bg)' }, children: _jsxs(Text, { fs: "13px", children: ["Scroll row ", index + 1] }) }, index))) }) }), _jsx(ScrollArea, { h: 112, pr: 1, highlights: true, highlightColor: "var(--oui-section-nested-solid-bg)", highlightTop: { h: 28, mode: 'static', maxOpacity: 0.96 }, highlightBottom: { h: 28, mode: 'static', maxOpacity: 0.96 }, children: _jsx(Stack, { g: 1, children: Array.from({ length: 8 }, (_, index) => (_jsx(Box, { p: 2, r: 3, style: { background: 'var(--oui-pad-bg)' }, children: _jsxs(Text, { fs: "13px", children: ["Both edges row ", index + 1] }) }, index))) }) }), _jsx(ScrollArea, { h: 176, pr: 1, highlights: true, highlightColor: "var(--oui-section-nested-solid-bg)", highlightTop: {
|
|
18
32
|
h: 42,
|
|
19
33
|
mode: 'scroll',
|
|
20
34
|
start: 50,
|
|
@@ -35,5 +49,5 @@ export function LayoutSection({ onOpenCode }) {
|
|
|
35
49
|
['Delivered', 'The gradient uses the solid surface color.'],
|
|
36
50
|
['Checked', 'Content remains readable under the fade.'],
|
|
37
51
|
['Archived', 'The bottom edge disappears at the end.'],
|
|
38
|
-
].map(([title, description], index) => (_jsxs(Flex, { row: true, g: 2, p: 2, r: 3, a:
|
|
52
|
+
].map(([title, description], index) => (_jsxs(Flex, { row: true, g: 2, p: 2, r: 3, a: "c", style: { background: 'var(--oui-pad-bg)' }, children: [_jsx(Badge, { tone: index < 3 ? 'primary' : 'info', children: index + 1 }), _jsxs(Stack, { g: 0, children: [_jsx(Text, { fs: "13px", fw: 700, children: title }), _jsx(Text, { fs: "12px", tone: "muted", children: description })] })] }, title))) }) })] }) }) }), _jsx(UiExampleSection, { id: "system-radius-example", title: "System radius", description: "Radius system prop scale.", children: _jsxs(ExampleTile, { title: "System radius", code: codeSamples.systemRadius, onOpen: onOpenCode, children: [_jsx(Flex, { g: 2, a: "c", wrap: true, children: [0, 2, 4, 6, 7].map((radius) => (_jsx(Box, { size: 32, r: radius, display: "flex", a: "c", j: "c", style: { background: 'var(--oui-pad-bg)' }, children: _jsx(Text, { fs: "12px", fw: 700, children: radius }) }, radius))) }), _jsx(Button, { mt: 2, v: "pad", r: 7, children: "Button r=7" })] }) })] }));
|
|
39
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleDataSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleDataSection.tsx"],"names":[],"mappings":"AAkBA,OAAO,
|
|
1
|
+
{"version":3,"file":"ExampleDataSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleDataSection.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAG9D,KAAK,gBAAgB,GAAG;IACpB,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,CAAC;AA2DF,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,EAAE,gBAAgB,2CAwK3D"}
|
|
@@ -64,11 +64,11 @@ export function DataSection({ onOpenCode }) {
|
|
|
64
64
|
const [columnWidths, setColumnWidths] = useState({});
|
|
65
65
|
const [page, setPage] = useState(2);
|
|
66
66
|
const filteredRows = useMemo(() => sortRows(rows.filter((row) => rowMatches(row, query)), sort), [query, sort]);
|
|
67
|
-
return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id:
|
|
67
|
+
return (_jsxs(_Fragment, { children: [_jsx(UiExampleSection, { id: "data-table-example", title: "DataTable", description: "Reusable DataTable without CRUD or page-level entity logic.", children: _jsx(ExampleTile, { className: "oui-ui-table-tile", title: "DataTable", code: codeSamples.data, onOpen: onOpenCode, children: _jsxs("div", { className: "oui-ui-table-demo", children: [_jsx(DataTable, { toolbar: _jsxs(_Fragment, { children: [_jsx(TextField, { value: query, placeholder: "Filter rows", clearable: true, onChange: (event) => setQuery(event.target.value), onClear: () => setQuery('') }), _jsx(Button, { size: 3, v: "surface", onClick: () => {
|
|
68
68
|
setVisibleColumnKeys(defaultVisibleColumnKeys);
|
|
69
69
|
setColumnOrder(defaultColumnOrder);
|
|
70
70
|
setColumnWidths({});
|
|
71
|
-
}, children: "Reset" })] })
|
|
71
|
+
}, children: "Reset" })] }), rowKey: (row) => row.name, rows: filteredRows, columns: columns, sort: sort, onSortChange: (nextSort) => setSort(Array.isArray(nextSort) ? (nextSort[0] ?? null) : nextSort), selectable: true, selectedRowKeys: selectedRowKeys, onSelectedRowKeysChange: setSelectedRowKeys, total: rows.length, emptyText: "No rows match the filter.", columnSettings: {
|
|
72
72
|
columns,
|
|
73
73
|
visibleColumnKeys,
|
|
74
74
|
onVisibleColumnKeysChange: setVisibleColumnKeys,
|
|
@@ -93,9 +93,9 @@ export function DataSection({ onOpenCode }) {
|
|
|
93
93
|
tone: 'danger',
|
|
94
94
|
onSelect: () => undefined,
|
|
95
95
|
},
|
|
96
|
-
] }), _jsx("div", { className:
|
|
97
|
-
? nextSort[0] ?? null
|
|
98
|
-
: nextSort), total: rows.length, emptyText:
|
|
96
|
+
] }), _jsx("div", { className: "oui-ui-table-variants", children: _jsxs("div", { className: "oui-ui-table-variant", children: [_jsx(Text, { fs: "13px", fw: 760, children: "Plain table" }), _jsx(DataTable, { rowKey: (row) => row.name, rows: rows.slice(0, 4), columns: columns, sort: sort, onSortChange: (nextSort) => setSort(Array.isArray(nextSort)
|
|
97
|
+
? (nextSort[0] ?? null)
|
|
98
|
+
: nextSort), total: rows.length, emptyText: "No rows." })] }) })] }) }) }), _jsx(UiExampleSection, { id: "table-primitives-example", title: "Table and pagination", description: "Low-level Table primitive and page navigation.", children: _jsx(ExampleTile, { title: "Table and pagination", code: codeSamples.tablePagination, onOpen: onOpenCode, children: _jsxs(Stack, { g: 3, children: [_jsxs(Table, { v: "surface", w: "100%", children: [_jsx(Table.Header, { children: _jsxs(Table.Row, { children: [_jsx(Table.ColumnHeaderCell, { children: "Document" }), _jsx(Table.ColumnHeaderCell, { children: "Status" }), _jsx(Table.ColumnHeaderCell, { align: "right", children: "Qty" })] }) }), _jsx(Table.Body, { children: rows.slice(0, 3).map((row) => (_jsxs(Table.Row, { children: [_jsx(Table.RowHeaderCell, { children: row.name }), _jsx(Table.Cell, { children: _jsx(Badge, { tone: statusTone(row.status), children: row.status }) }), _jsx(Table.Cell, { align: "right", children: row.quantity })] }, row.name))) })] }), _jsxs(Flex, { j: "sb", a: "c", wrap: true, g: 2, children: [_jsx(Text, { fs: "13px", tone: "muted", children: "Showing 25 items per page" }), _jsx(Pagination, { page: page, pageCount: 4, onPageChange: setPage })] })] }) }) })] }));
|
|
99
99
|
}
|
|
100
100
|
function sortRows(rows, sort) {
|
|
101
101
|
if (!sort)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExampleFieldsSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleFieldsSection.tsx"],"names":[],"mappings":"AA4BA,OAAO,
|
|
1
|
+
{"version":3,"file":"ExampleFieldsSection.d.ts","sourceRoot":"","sources":["../../src/example/ExampleFieldsSection.tsx"],"names":[],"mappings":"AA4BA,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAG9D,KAAK,cAAc,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,SAAS,EAAE,cAAc,CAAC;IAC1B,iBAAiB,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IACnD,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,CAAC;AAqBF,wBAAgB,aAAa,CAAC,EAC1B,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,UAAU,GACb,EAAE,kBAAkB,2CA4RpB"}
|