@robert-stackflow/oneui 0.0.0-stage → 0.1.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 +45 -2
- package/assets/LUCIDE-LICENSE.txt +43 -0
- package/assets/character-metadata.json +1 -0
- package/assets/emoji.json +1 -0
- package/assets/icon-catalog.json +1 -0
- package/assets/symbols.json +1 -0
- package/components/Accessibility.module.css +8 -0
- package/components/Accordion.d.ts +7 -0
- package/components/Accordion.js +41 -0
- package/components/Accordion.module.css +38 -0
- package/components/Alert.d.ts +9 -0
- package/components/Alert.js +42 -0
- package/components/Alert.module.css +56 -0
- package/components/AppShell.d.ts +30 -0
- package/components/AppShell.js +152 -0
- package/components/AppShell.module.css +239 -0
- package/components/AppearanceSettings.d.ts +7 -0
- package/components/AppearanceSettings.js +201 -0
- package/components/AppearanceSettings.module.css +32 -0
- package/components/Avatar.d.ts +14 -0
- package/components/Avatar.js +69 -0
- package/components/Avatar.module.css +70 -0
- package/components/AvatarGroup.d.ts +15 -0
- package/components/AvatarGroup.js +115 -0
- package/components/AvatarGroup.module.css +54 -0
- package/components/Badge.d.ts +5 -0
- package/components/Badge.js +11 -0
- package/components/Badge.module.css +30 -0
- package/components/BlockedTab.d.ts +4 -0
- package/components/BlockedTab.js +10 -0
- package/components/Breadcrumb.d.ts +16 -0
- package/components/Breadcrumb.js +157 -0
- package/components/Breadcrumb.module.css +97 -0
- package/components/Button.d.ts +6 -0
- package/components/Button.js +29 -0
- package/components/Button.module.css +79 -0
- package/components/Calendar.d.ts +10 -0
- package/components/Calendar.js +260 -0
- package/components/Calendar.module.css +106 -0
- package/components/Card.d.ts +7 -0
- package/components/Card.js +19 -0
- package/components/Card.module.css +28 -0
- package/components/Cascader.d.ts +14 -0
- package/components/Cascader.js +296 -0
- package/components/CatalogIcon.d.ts +3 -0
- package/components/CatalogIcon.js +11 -0
- package/components/CharacterPicker.d.ts +15 -0
- package/components/CharacterPicker.js +200 -0
- package/components/Checkbox.d.ts +12 -0
- package/components/Checkbox.js +82 -0
- package/components/Checkbox.module.css +95 -0
- package/components/ColorField.d.ts +6 -0
- package/components/ColorField.js +61 -0
- package/components/ColorField.module.css +15 -0
- package/components/ColorPicker.d.ts +5 -0
- package/components/ColorPicker.js +188 -0
- package/components/ColorPicker.module.css +90 -0
- package/components/Combobox.d.ts +11 -0
- package/components/Combobox.js +252 -0
- package/components/Combobox.module.css +26 -0
- package/components/CommandPalette.d.ts +25 -0
- package/components/CommandPalette.js +269 -0
- package/components/CommandPalette.module.css +49 -0
- package/components/ContextMenu.d.ts +9 -0
- package/components/ContextMenu.js +363 -0
- package/components/ContextMenu.module.css +42 -0
- package/components/ContextMenuPanel.d.ts +22 -0
- package/components/ContextMenuPanel.js +155 -0
- package/components/ContributionCalendar.d.ts +18 -0
- package/components/ContributionCalendar.js +201 -0
- package/components/ContributionCalendar.module.css +114 -0
- package/components/ContributionCell.d.ts +11 -0
- package/components/ContributionCell.js +41 -0
- package/components/Control.module.css +73 -0
- package/components/DataTable.d.ts +49 -0
- package/components/DataTable.js +220 -0
- package/components/DataTable.module.css +112 -0
- package/components/DatePicker.d.ts +15 -0
- package/components/DatePicker.js +186 -0
- package/components/DatePicker.module.css +85 -0
- package/components/DateRangePicker.d.ts +9 -0
- package/components/DateRangePicker.js +168 -0
- package/components/Descriptions.d.ts +21 -0
- package/components/Descriptions.js +162 -0
- package/components/Descriptions.module.css +117 -0
- package/components/Dialog.d.ts +9 -0
- package/components/Dialog.js +112 -0
- package/components/Dialog.module.css +71 -0
- package/components/DisclosureChevron.d.ts +3 -0
- package/components/DisclosureChevron.js +17 -0
- package/components/DisclosureChevron.module.css +17 -0
- package/components/Divider.d.ts +5 -0
- package/components/Divider.js +24 -0
- package/components/Divider.module.css +19 -0
- package/components/Drawer.d.ts +18 -0
- package/components/Drawer.js +145 -0
- package/components/Drawer.module.css +109 -0
- package/components/EmojiPicker.d.ts +6 -0
- package/components/EmojiPicker.js +19 -0
- package/components/EmptyState.d.ts +8 -0
- package/components/EmptyState.js +20 -0
- package/components/EmptyState.module.css +30 -0
- package/components/FieldLabel.d.ts +8 -0
- package/components/FieldLabel.js +20 -0
- package/components/FieldMessages.d.ts +5 -0
- package/components/FieldMessages.js +15 -0
- package/components/FileDropOverlay.d.ts +5 -0
- package/components/FileDropOverlay.js +26 -0
- package/components/FileDropOverlay.module.css +55 -0
- package/components/FileDropZone.d.ts +15 -0
- package/components/FileDropZone.js +113 -0
- package/components/FileDropZone.module.css +6 -0
- package/components/FilePicker.d.ts +10 -0
- package/components/FilePicker.js +59 -0
- package/components/FileSelectionFeedback.d.ts +5 -0
- package/components/FileSelectionFeedback.js +23 -0
- package/components/FileSelectionFeedback.module.css +14 -0
- package/components/FileTree.d.ts +13 -0
- package/components/FileTree.js +125 -0
- package/components/FileTree.module.css +66 -0
- package/components/Form.d.ts +7 -0
- package/components/Form.js +26 -0
- package/components/Form.module.css +7 -0
- package/components/FormErrorSummary.d.ts +6 -0
- package/components/FormErrorSummary.js +27 -0
- package/components/FormErrorSummary.module.css +27 -0
- package/components/FormField.d.ts +9 -0
- package/components/FormField.js +59 -0
- package/components/FormField.module.css +85 -0
- package/components/FormGroup.d.ts +9 -0
- package/components/FormGroup.js +32 -0
- package/components/HierarchyPicker.module.css +146 -0
- package/components/IconButton.d.ts +7 -0
- package/components/IconButton.js +30 -0
- package/components/IconButton.module.css +39 -0
- package/components/IconPicker.d.ts +6 -0
- package/components/IconPicker.js +111 -0
- package/components/Indicator.d.ts +18 -0
- package/components/Indicator.js +97 -0
- package/components/Indicator.module.css +83 -0
- package/components/Input.d.ts +7 -0
- package/components/Input.js +29 -0
- package/components/Input.module.css +23 -0
- package/components/LoadingOverlay.d.ts +6 -0
- package/components/LoadingOverlay.js +16 -0
- package/components/LoadingOverlay.module.css +22 -0
- package/components/LoadingState.d.ts +5 -0
- package/components/LoadingState.js +29 -0
- package/components/LoadingState.module.css +14 -0
- package/components/Menu.d.ts +11 -0
- package/components/Menu.js +82 -0
- package/components/MenuItem.d.ts +14 -0
- package/components/MenuItem.js +49 -0
- package/components/MenuItem.module.css +163 -0
- package/components/MenuItemContent.d.ts +8 -0
- package/components/MenuItemContent.js +19 -0
- package/components/MultiSelect.d.ts +12 -0
- package/components/MultiSelect.js +161 -0
- package/components/MultiSelect.module.css +61 -0
- package/components/NumberInput.d.ts +12 -0
- package/components/NumberInput.js +113 -0
- package/components/NumberInput.module.css +33 -0
- package/components/Page.d.ts +7 -0
- package/components/Page.js +22 -0
- package/components/Page.module.css +44 -0
- package/components/Pagination.d.ts +11 -0
- package/components/Pagination.js +160 -0
- package/components/Pagination.module.css +70 -0
- package/components/PasswordField.d.ts +9 -0
- package/components/PasswordField.js +101 -0
- package/components/PasswordField.module.css +64 -0
- package/components/Picker.module.css +52 -0
- package/components/PinInput.d.ts +13 -0
- package/components/PinInput.js +172 -0
- package/components/PinInput.module.css +72 -0
- package/components/Placeholder.d.ts +31 -0
- package/components/Placeholder.js +36 -0
- package/components/Popconfirm.d.ts +17 -0
- package/components/Popconfirm.js +159 -0
- package/components/Popconfirm.module.css +49 -0
- package/components/Popover.d.ts +13 -0
- package/components/Popover.js +150 -0
- package/components/Popover.module.css +16 -0
- package/components/Progress.d.ts +5 -0
- package/components/Progress.js +31 -0
- package/components/Progress.module.css +33 -0
- package/components/RadioGroup.d.ts +15 -0
- package/components/RadioGroup.js +73 -0
- package/components/RadioGroup.module.css +87 -0
- package/components/RangeSlider.d.ts +22 -0
- package/components/RangeSlider.js +278 -0
- package/components/RangeSlider.module.css +141 -0
- package/components/ResizablePanel.d.ts +21 -0
- package/components/ResizablePanel.js +219 -0
- package/components/ResizablePanel.module.css +101 -0
- package/components/SearchField.d.ts +11 -0
- package/components/SearchField.js +66 -0
- package/components/SearchField.module.css +37 -0
- package/components/Section.d.ts +6 -0
- package/components/Section.js +18 -0
- package/components/Section.module.css +14 -0
- package/components/Segmented.d.ts +11 -0
- package/components/Segmented.js +77 -0
- package/components/Segmented.module.css +82 -0
- package/components/Select.d.ts +11 -0
- package/components/Select.js +171 -0
- package/components/Select.module.css +21 -0
- package/components/SelectOptionContent.d.ts +5 -0
- package/components/SelectOptionContent.js +20 -0
- package/components/SelectOptionContent.module.css +7 -0
- package/components/SelectTrigger.d.ts +5 -0
- package/components/SelectTrigger.js +32 -0
- package/components/SelectTrigger.module.css +24 -0
- package/components/SettingRow.d.ts +7 -0
- package/components/SettingRow.js +19 -0
- package/components/SettingRow.module.css +44 -0
- package/components/SettingsLayout.d.ts +9 -0
- package/components/SettingsLayout.js +45 -0
- package/components/SettingsLayout.module.css +48 -0
- package/components/ShortcutInput.d.ts +8 -0
- package/components/ShortcutInput.js +131 -0
- package/components/ShortcutInput.module.css +39 -0
- package/components/Skeleton.d.ts +5 -0
- package/components/Skeleton.js +19 -0
- package/components/Skeleton.module.css +27 -0
- package/components/SkeletonRows.d.ts +4 -0
- package/components/SkeletonRows.js +19 -0
- package/components/SkeletonRows.module.css +19 -0
- package/components/SkinTonePicker.d.ts +4 -0
- package/components/SkinTonePicker.js +43 -0
- package/components/SkinTonePicker.module.css +50 -0
- package/components/Slider.d.ts +10 -0
- package/components/Slider.js +40 -0
- package/components/Slider.module.css +19 -0
- package/components/Spinner.d.ts +6 -0
- package/components/Spinner.js +31 -0
- package/components/Spinner.module.css +57 -0
- package/components/SplitButton.d.ts +17 -0
- package/components/SplitButton.js +102 -0
- package/components/SplitButton.module.css +56 -0
- package/components/Statistic.d.ts +22 -0
- package/components/Statistic.js +102 -0
- package/components/Statistic.module.css +55 -0
- package/components/Steps.d.ts +19 -0
- package/components/Steps.js +102 -0
- package/components/Steps.module.css +176 -0
- package/components/Switch.d.ts +6 -0
- package/components/Switch.js +25 -0
- package/components/Switch.module.css +56 -0
- package/components/SymbolPicker.d.ts +6 -0
- package/components/SymbolPicker.js +18 -0
- package/components/Tab.module.css +145 -0
- package/components/TabList.d.ts +11 -0
- package/components/TabList.js +51 -0
- package/components/Table.d.ts +12 -0
- package/components/Table.js +20 -0
- package/components/Table.module.css +48 -0
- package/components/TableColumnFilter.d.ts +6 -0
- package/components/TableColumnFilter.js +76 -0
- package/components/TableColumnVisibility.d.ts +11 -0
- package/components/TableColumnVisibility.js +76 -0
- package/components/Tabs.d.ts +13 -0
- package/components/Tabs.js +49 -0
- package/components/Tabs.module.css +3 -0
- package/components/TagInput.d.ts +11 -0
- package/components/TagInput.js +154 -0
- package/components/TagInput.module.css +64 -0
- package/components/Textarea.d.ts +6 -0
- package/components/Textarea.js +24 -0
- package/components/Textarea.module.css +9 -0
- package/components/ThemePicker.d.ts +6 -0
- package/components/ThemePicker.js +78 -0
- package/components/ThemePicker.module.css +178 -0
- package/components/ThemeProvider.d.ts +11 -0
- package/components/ThemeProvider.js +80 -0
- package/components/ThemeStylePicker.d.ts +5 -0
- package/components/ThemeStylePicker.js +22 -0
- package/components/TimeColumns.d.ts +6 -0
- package/components/TimeColumns.js +55 -0
- package/components/TimeColumns.module.css +47 -0
- package/components/Timeline.d.ts +26 -0
- package/components/Timeline.js +131 -0
- package/components/Timeline.module.css +202 -0
- package/components/Toast.d.ts +6 -0
- package/components/Toast.js +181 -0
- package/components/Toast.module.css +175 -0
- package/components/ToastProvider.d.ts +35 -0
- package/components/ToastProvider.js +47 -0
- package/components/Tooltip.d.ts +10 -0
- package/components/Tooltip.js +169 -0
- package/components/Tooltip.module.css +53 -0
- package/components/TreeSelect.d.ts +23 -0
- package/components/TreeSelect.js +309 -0
- package/components/UIProvider.d.ts +10 -0
- package/components/UIProvider.js +20 -0
- package/components/UnderlinedTab.d.ts +2 -0
- package/components/UnderlinedTab.js +8 -0
- package/components/Upload.d.ts +22 -0
- package/components/Upload.js +165 -0
- package/components/Upload.module.css +36 -0
- package/components/UploadList.d.ts +9 -0
- package/components/UploadList.js +14 -0
- package/components/UploadList.module.css +130 -0
- package/components/UploadListItem.d.ts +13 -0
- package/components/UploadListItem.js +122 -0
- package/components/VirtualPickerList.d.ts +25 -0
- package/components/VirtualPickerList.js +269 -0
- package/components/VirtualPickerList.module.css +89 -0
- package/components/appearance.d.ts +19 -0
- package/components/appearance.js +60 -0
- package/components/characterCatalog.d.ts +9 -0
- package/components/characterCatalog.js +55 -0
- package/components/color.d.ts +7 -0
- package/components/color.js +18 -0
- package/components/contribution.d.ts +57 -0
- package/components/contribution.js +86 -0
- package/components/dateConstraints.d.ts +13 -0
- package/components/dateConstraints.js +44 -0
- package/components/field.d.ts +58 -0
- package/components/field.js +57 -0
- package/components/fileSelection.d.ts +21 -0
- package/components/fileSelection.js +43 -0
- package/components/hierarchy.d.ts +22 -0
- package/components/hierarchy.js +33 -0
- package/components/iconCatalog.d.ts +13 -0
- package/components/iconCatalog.js +80 -0
- package/components/index.d.ts +150 -0
- package/components/index.js +219 -0
- package/components/menuFocus.d.ts +7 -0
- package/components/menuFocus.js +21 -0
- package/components/menuPointer.d.ts +6 -0
- package/components/menuPointer.js +13 -0
- package/components/menuTypes.d.ts +24 -0
- package/components/menuTypes.js +0 -0
- package/components/motion.d.ts +9 -0
- package/components/motion.js +82 -0
- package/components/rangeMath.d.ts +12 -0
- package/components/rangeMath.js +30 -0
- package/components/surfacePortal.d.ts +13 -0
- package/components/surfacePortal.js +22 -0
- package/components/tooltipState.d.ts +5 -0
- package/components/tooltipState.js +48 -0
- package/components/types.d.ts +9 -0
- package/components/types.js +0 -0
- package/components/uploadTypes.d.ts +21 -0
- package/components/uploadTypes.js +0 -0
- package/components/useFormState.d.ts +51 -0
- package/components/useFormState.js +218 -0
- package/components/useHierarchy.d.ts +8 -0
- package/components/useHierarchy.js +80 -0
- package/components/useMenuLayers.d.ts +17 -0
- package/components/useMenuLayers.js +23 -0
- package/components/useModalScrollLock.d.ts +1 -0
- package/components/useModalScrollLock.js +18 -0
- package/components/usePopover.d.ts +8 -0
- package/components/usePopover.js +22 -0
- package/components/useTabIndicator.d.ts +12 -0
- package/components/useTabIndicator.js +63 -0
- package/components/useUploadQueue.d.ts +20 -0
- package/components/useUploadQueue.js +175 -0
- package/package.json +783 -3
- package/styles/base.css +189 -0
- package/styles/blue.css +254 -0
- package/styles/desktop.css +2 -0
- package/styles/minimal.css +337 -0
- package/styles/themes.css +2 -0
- package/styles/web.css +2 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.accordion {
|
|
2
|
+
border: 1px solid var(--line);
|
|
3
|
+
border-radius: var(--radius);
|
|
4
|
+
padding: 0 14px;
|
|
5
|
+
}
|
|
6
|
+
.accordion > button {
|
|
7
|
+
display: flex;
|
|
8
|
+
width: 100%;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
gap: 12px;
|
|
12
|
+
padding: 12px 0;
|
|
13
|
+
border: 0;
|
|
14
|
+
background: transparent;
|
|
15
|
+
text-align: left;
|
|
16
|
+
font-size: 12px;
|
|
17
|
+
}
|
|
18
|
+
.grid {
|
|
19
|
+
display: grid;
|
|
20
|
+
grid-template-rows: 0fr;
|
|
21
|
+
opacity: 0;
|
|
22
|
+
transition:
|
|
23
|
+
grid-template-rows var(--motion-panel) var(--ease),
|
|
24
|
+
opacity var(--motion-panel) var(--ease);
|
|
25
|
+
}
|
|
26
|
+
.grid[data-open="true"] {
|
|
27
|
+
grid-template-rows: 1fr;
|
|
28
|
+
opacity: 1;
|
|
29
|
+
}
|
|
30
|
+
.grid > div {
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
min-height: 0;
|
|
33
|
+
}
|
|
34
|
+
.content {
|
|
35
|
+
padding-bottom: 14px;
|
|
36
|
+
color: var(--muted);
|
|
37
|
+
font-size: 12px;
|
|
38
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare function Alert({ tone, title, children, icon, action, onClose, }: {
|
|
3
|
+
tone?: "info" | "success" | "warning" | "danger" | "neutral";
|
|
4
|
+
title?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
icon?: boolean | ReactNode;
|
|
7
|
+
action?: ReactNode;
|
|
8
|
+
onClose?(): void;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Info, CircleCheck, TriangleAlert, CircleX, X } from "lucide-react";
|
|
3
|
+
import s from "./Alert.module.css";
|
|
4
|
+
function Alert({
|
|
5
|
+
tone = "info",
|
|
6
|
+
title,
|
|
7
|
+
children,
|
|
8
|
+
icon = true,
|
|
9
|
+
action,
|
|
10
|
+
onClose
|
|
11
|
+
}) {
|
|
12
|
+
const Icon = tone === "success" ? CircleCheck : tone === "warning" ? TriangleAlert : tone === "danger" ? CircleX : Info, color = tone === "success" ? "var(--success)" : tone === "warning" ? "var(--warning)" : tone === "danger" ? "var(--danger)" : tone === "neutral" ? "var(--muted)" : "var(--accent)";
|
|
13
|
+
return /* @__PURE__ */ jsxs(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: s.alert,
|
|
17
|
+
style: { "--alert-color": color },
|
|
18
|
+
role: tone === "danger" ? "alert" : "status",
|
|
19
|
+
children: [
|
|
20
|
+
icon && /* @__PURE__ */ jsx("span", { className: s.icon, children: icon === true ? /* @__PURE__ */ jsx(Icon, {}) : icon }),
|
|
21
|
+
/* @__PURE__ */ jsxs("div", { className: s.copy, children: [
|
|
22
|
+
title && /* @__PURE__ */ jsx("strong", { children: title }),
|
|
23
|
+
children && /* @__PURE__ */ jsx("div", { children })
|
|
24
|
+
] }),
|
|
25
|
+
action && /* @__PURE__ */ jsx("div", { className: s.action, children: action }),
|
|
26
|
+
onClose && /* @__PURE__ */ jsx(
|
|
27
|
+
"button",
|
|
28
|
+
{
|
|
29
|
+
type: "button",
|
|
30
|
+
className: s.close,
|
|
31
|
+
"aria-label": "\u5173\u95ED\u63D0\u793A",
|
|
32
|
+
onClick: onClose,
|
|
33
|
+
children: /* @__PURE__ */ jsx(X, {})
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
Alert
|
|
42
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.alert {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
min-width: 0;
|
|
6
|
+
padding: 13px 15px;
|
|
7
|
+
border: 1px solid color-mix(in srgb, var(--alert-color) 24%, var(--surface));
|
|
8
|
+
border-radius: var(--radius);
|
|
9
|
+
background: color-mix(in srgb, var(--alert-color) 5%, var(--surface));
|
|
10
|
+
}
|
|
11
|
+
.icon {
|
|
12
|
+
display: grid;
|
|
13
|
+
place-items: center;
|
|
14
|
+
color: var(--alert-color);
|
|
15
|
+
flex-shrink: 0;
|
|
16
|
+
}
|
|
17
|
+
.icon svg {
|
|
18
|
+
width: 19px;
|
|
19
|
+
height: 19px;
|
|
20
|
+
}
|
|
21
|
+
.copy {
|
|
22
|
+
flex: 1;
|
|
23
|
+
min-width: 0;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
gap: 3px;
|
|
27
|
+
font-size: 12px;
|
|
28
|
+
line-height: 1.55;
|
|
29
|
+
}
|
|
30
|
+
.copy strong {
|
|
31
|
+
font-weight: 550;
|
|
32
|
+
}
|
|
33
|
+
.action {
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
}
|
|
38
|
+
.close {
|
|
39
|
+
display: grid;
|
|
40
|
+
place-items: center;
|
|
41
|
+
width: 25px;
|
|
42
|
+
height: 25px;
|
|
43
|
+
border: 0;
|
|
44
|
+
border-radius: 5px;
|
|
45
|
+
padding: 0;
|
|
46
|
+
background: transparent;
|
|
47
|
+
color: var(--muted);
|
|
48
|
+
}
|
|
49
|
+
.close:hover {
|
|
50
|
+
background: var(--hover);
|
|
51
|
+
color: var(--fg);
|
|
52
|
+
}
|
|
53
|
+
.close svg {
|
|
54
|
+
width: 14px;
|
|
55
|
+
height: 14px;
|
|
56
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export interface NavigationItem {
|
|
3
|
+
id: string;
|
|
4
|
+
path: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function ShellHeader({ title, collapsed, onToggle, onMenu, actions, windowControls, draggable, }: {
|
|
9
|
+
title: string;
|
|
10
|
+
collapsed?: boolean;
|
|
11
|
+
onToggle?(): void;
|
|
12
|
+
onMenu?(): void;
|
|
13
|
+
actions?: ReactNode;
|
|
14
|
+
windowControls?: ReactNode;
|
|
15
|
+
draggable?: boolean;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
export declare function AppShell({ navigation, settingsItem, active, title, collapsed, onCollapsedChange, onNavigate, children, headerActions, sidebarFooter, windowControls, draggable, }: {
|
|
18
|
+
navigation: readonly NavigationItem[];
|
|
19
|
+
settingsItem: NavigationItem;
|
|
20
|
+
active: string;
|
|
21
|
+
title: string;
|
|
22
|
+
collapsed?: boolean;
|
|
23
|
+
onCollapsedChange(value: boolean): void;
|
|
24
|
+
onNavigate(path: string): void;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
headerActions?: ReactNode;
|
|
27
|
+
sidebarFooter?: ReactNode;
|
|
28
|
+
windowControls?: ReactNode;
|
|
29
|
+
draggable?: boolean;
|
|
30
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { Layers2, Menu, PanelLeftClose, PanelLeftOpen } from "lucide-react";
|
|
4
|
+
import { Drawer } from "./Drawer.js";
|
|
5
|
+
import { IconButton } from "./IconButton.js";
|
|
6
|
+
import s from "./AppShell.module.css";
|
|
7
|
+
function ShellHeader({
|
|
8
|
+
title,
|
|
9
|
+
collapsed,
|
|
10
|
+
onToggle,
|
|
11
|
+
onMenu,
|
|
12
|
+
actions,
|
|
13
|
+
windowControls,
|
|
14
|
+
draggable = false
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ jsxs(
|
|
17
|
+
"header",
|
|
18
|
+
{
|
|
19
|
+
className: s.header,
|
|
20
|
+
"data-draggable": draggable || void 0,
|
|
21
|
+
"data-window-controls": windowControls ? true : void 0,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ jsxs("div", { className: s.headerStart, children: [
|
|
24
|
+
onMenu && /* @__PURE__ */ jsx(
|
|
25
|
+
IconButton,
|
|
26
|
+
{
|
|
27
|
+
className: s.mobileToggle,
|
|
28
|
+
label: "\u6253\u5F00\u5BFC\u822A",
|
|
29
|
+
variant: "ghost",
|
|
30
|
+
onClick: onMenu,
|
|
31
|
+
children: /* @__PURE__ */ jsx(Menu, { size: 18 })
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
onToggle && /* @__PURE__ */ jsx(
|
|
35
|
+
IconButton,
|
|
36
|
+
{
|
|
37
|
+
className: s.desktopToggle,
|
|
38
|
+
label: collapsed ? "\u5C55\u5F00\u4FA7\u680F" : "\u6298\u53E0\u4FA7\u680F",
|
|
39
|
+
variant: "ghost",
|
|
40
|
+
onClick: onToggle,
|
|
41
|
+
children: collapsed ? /* @__PURE__ */ jsx(PanelLeftOpen, { size: 18 }) : /* @__PURE__ */ jsx(PanelLeftClose, { size: 18 })
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ jsx("span", { className: s.title, children: title })
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ jsxs("div", { className: s.headerEnd, children: [
|
|
47
|
+
actions,
|
|
48
|
+
windowControls
|
|
49
|
+
] })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function AppShell({
|
|
55
|
+
navigation,
|
|
56
|
+
settingsItem,
|
|
57
|
+
active,
|
|
58
|
+
title,
|
|
59
|
+
collapsed = false,
|
|
60
|
+
onCollapsedChange,
|
|
61
|
+
onNavigate,
|
|
62
|
+
children,
|
|
63
|
+
headerActions,
|
|
64
|
+
sidebarFooter,
|
|
65
|
+
windowControls,
|
|
66
|
+
draggable = false
|
|
67
|
+
}) {
|
|
68
|
+
const [mobile, setMobile] = useState(false);
|
|
69
|
+
const scroll = useRef(null);
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
setMobile(false);
|
|
72
|
+
scroll.current?.scrollTo({ top: 0 });
|
|
73
|
+
}, [active]);
|
|
74
|
+
const item = (n) => /* @__PURE__ */ jsxs(
|
|
75
|
+
"a",
|
|
76
|
+
{
|
|
77
|
+
href: n.path,
|
|
78
|
+
"aria-current": active === n.id ? "page" : void 0,
|
|
79
|
+
title: collapsed ? n.label : void 0,
|
|
80
|
+
onClick: (e) => {
|
|
81
|
+
if (e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey) {
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
onNavigate(n.path);
|
|
84
|
+
setMobile(false);
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
children: [
|
|
88
|
+
n.icon,
|
|
89
|
+
/* @__PURE__ */ jsx("span", { children: n.label })
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
n.id
|
|
93
|
+
);
|
|
94
|
+
const nav = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
95
|
+
/* @__PURE__ */ jsxs(
|
|
96
|
+
"a",
|
|
97
|
+
{
|
|
98
|
+
href: "/",
|
|
99
|
+
className: s.brand,
|
|
100
|
+
"aria-label": "OneUI \u9996\u9875",
|
|
101
|
+
onClick: (e) => {
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
onNavigate("/");
|
|
104
|
+
setMobile(false);
|
|
105
|
+
},
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ jsx("span", { className: s.mark, children: /* @__PURE__ */ jsx(Layers2, { size: 20 }) }),
|
|
108
|
+
/* @__PURE__ */ jsx("strong", { children: "OneUI" })
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ jsx("nav", { "aria-label": "\u4E3B\u5BFC\u822A", className: s.navigation, children: navigation.map(item) }),
|
|
113
|
+
/* @__PURE__ */ jsxs("div", { className: s.bottom, children: [
|
|
114
|
+
/* @__PURE__ */ jsx("nav", { "aria-label": "\u8BBE\u7F6E", className: s.navigation, children: item(settingsItem) }),
|
|
115
|
+
sidebarFooter
|
|
116
|
+
] })
|
|
117
|
+
] });
|
|
118
|
+
return /* @__PURE__ */ jsxs("div", { className: s.shell, "data-collapsed": collapsed, children: [
|
|
119
|
+
/* @__PURE__ */ jsx("a", { className: s.skip, href: "#main", children: "\u8DF3\u8F6C\u5230\u5185\u5BB9" }),
|
|
120
|
+
/* @__PURE__ */ jsx("aside", { className: s.sidebar, children: nav }),
|
|
121
|
+
/* @__PURE__ */ jsx(
|
|
122
|
+
Drawer,
|
|
123
|
+
{
|
|
124
|
+
placement: "left",
|
|
125
|
+
size: 280,
|
|
126
|
+
open: mobile,
|
|
127
|
+
onClose: () => setMobile(false),
|
|
128
|
+
title: "\u5BFC\u822A",
|
|
129
|
+
children: /* @__PURE__ */ jsx("div", { className: s.mobileNav, children: nav })
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
/* @__PURE__ */ jsxs("div", { className: s.workspace, children: [
|
|
133
|
+
/* @__PURE__ */ jsx(
|
|
134
|
+
ShellHeader,
|
|
135
|
+
{
|
|
136
|
+
title,
|
|
137
|
+
collapsed,
|
|
138
|
+
onToggle: () => onCollapsedChange(!collapsed),
|
|
139
|
+
onMenu: () => setMobile(true),
|
|
140
|
+
actions: headerActions,
|
|
141
|
+
windowControls,
|
|
142
|
+
draggable
|
|
143
|
+
}
|
|
144
|
+
),
|
|
145
|
+
/* @__PURE__ */ jsx("main", { ref: scroll, id: "main", tabIndex: -1, className: s.main, children: /* @__PURE__ */ jsx("div", { className: s.page, children }) })
|
|
146
|
+
] })
|
|
147
|
+
] });
|
|
148
|
+
}
|
|
149
|
+
export {
|
|
150
|
+
AppShell,
|
|
151
|
+
ShellHeader
|
|
152
|
+
};
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
.shell {
|
|
2
|
+
height: 100dvh;
|
|
3
|
+
display: grid;
|
|
4
|
+
grid-template-columns: 228px minmax(0, 1fr);
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
color: var(--fg);
|
|
7
|
+
background: var(--app-background, var(--canvas));
|
|
8
|
+
font: 14px/1.6 var(--ui-font, "Segoe UI", "Microsoft YaHei", sans-serif);
|
|
9
|
+
transition: grid-template-columns var(--motion-panel) var(--ease);
|
|
10
|
+
}
|
|
11
|
+
.shell[data-collapsed="true"] {
|
|
12
|
+
grid-template-columns: 76px minmax(0, 1fr);
|
|
13
|
+
}
|
|
14
|
+
.sidebar {
|
|
15
|
+
min-width: 0;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: 24px;
|
|
19
|
+
padding: 24px 16px 18px;
|
|
20
|
+
background: var(--navigation);
|
|
21
|
+
border-right: 1px solid var(--line);
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
}
|
|
24
|
+
.brand {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: 10px;
|
|
28
|
+
min-height: 38px;
|
|
29
|
+
padding: 0 10px;
|
|
30
|
+
color: var(--fg);
|
|
31
|
+
text-decoration: none;
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
}
|
|
34
|
+
.brand strong {
|
|
35
|
+
font-size: 16px;
|
|
36
|
+
letter-spacing: -0.4px;
|
|
37
|
+
}
|
|
38
|
+
.mark {
|
|
39
|
+
display: grid;
|
|
40
|
+
place-items: center;
|
|
41
|
+
width: 32px;
|
|
42
|
+
height: 32px;
|
|
43
|
+
flex-shrink: 0;
|
|
44
|
+
border-radius: 10px;
|
|
45
|
+
background: var(--accent);
|
|
46
|
+
color: var(--on-accent);
|
|
47
|
+
}
|
|
48
|
+
.navigation {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: 4px;
|
|
52
|
+
min-height: 0;
|
|
53
|
+
overflow: auto;
|
|
54
|
+
}
|
|
55
|
+
.navigation a {
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: 11px;
|
|
59
|
+
min-height: 40px;
|
|
60
|
+
padding: 9px 12px;
|
|
61
|
+
border-radius: 8px;
|
|
62
|
+
color: var(--muted);
|
|
63
|
+
font-size: 13px;
|
|
64
|
+
text-decoration: none;
|
|
65
|
+
white-space: nowrap;
|
|
66
|
+
transition:
|
|
67
|
+
background var(--motion-hover),
|
|
68
|
+
color var(--motion-hover);
|
|
69
|
+
}
|
|
70
|
+
.navigation a > svg {
|
|
71
|
+
width: 18px;
|
|
72
|
+
height: 18px;
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
}
|
|
75
|
+
.navigation a:hover {
|
|
76
|
+
background: var(--hover);
|
|
77
|
+
color: var(--fg);
|
|
78
|
+
}
|
|
79
|
+
.navigation a[aria-current="page"] {
|
|
80
|
+
background: var(--selected);
|
|
81
|
+
color: var(--accent);
|
|
82
|
+
}
|
|
83
|
+
.bottom {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
gap: 16px;
|
|
87
|
+
margin-top: auto;
|
|
88
|
+
flex-shrink: 0;
|
|
89
|
+
}
|
|
90
|
+
.workspace {
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
min-width: 0;
|
|
94
|
+
min-height: 0;
|
|
95
|
+
}
|
|
96
|
+
.header {
|
|
97
|
+
height: 60px;
|
|
98
|
+
min-height: 60px;
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: space-between;
|
|
102
|
+
gap: 16px;
|
|
103
|
+
padding: 0 12px;
|
|
104
|
+
border-bottom: 1px solid var(--line);
|
|
105
|
+
background: var(--surface);
|
|
106
|
+
color: var(--fg);
|
|
107
|
+
}
|
|
108
|
+
.header[data-draggable="true"] {
|
|
109
|
+
-webkit-app-region: drag;
|
|
110
|
+
}
|
|
111
|
+
.header button,
|
|
112
|
+
.header a,
|
|
113
|
+
.headerEnd {
|
|
114
|
+
-webkit-app-region: no-drag;
|
|
115
|
+
}
|
|
116
|
+
.headerStart,
|
|
117
|
+
.headerEnd {
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
gap: 12px;
|
|
121
|
+
min-width: 0;
|
|
122
|
+
}
|
|
123
|
+
.headerEnd {
|
|
124
|
+
flex-shrink: 0;
|
|
125
|
+
}
|
|
126
|
+
.title {
|
|
127
|
+
font-size: 13px;
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
text-overflow: ellipsis;
|
|
130
|
+
white-space: nowrap;
|
|
131
|
+
}
|
|
132
|
+
.main {
|
|
133
|
+
flex: 1;
|
|
134
|
+
min-height: 0;
|
|
135
|
+
overflow: auto;
|
|
136
|
+
outline: none;
|
|
137
|
+
scrollbar-gutter: stable;
|
|
138
|
+
overscroll-behavior: contain;
|
|
139
|
+
}
|
|
140
|
+
.page {
|
|
141
|
+
width: 100%;
|
|
142
|
+
max-width: 1390px;
|
|
143
|
+
margin: 0 auto;
|
|
144
|
+
padding: 42px 40px 52px;
|
|
145
|
+
--page-max-width: none;
|
|
146
|
+
--page-margin: 0;
|
|
147
|
+
--page-inset: 0;
|
|
148
|
+
--page-wide-top: 0;
|
|
149
|
+
--page-title-size: 28px;
|
|
150
|
+
--page-title-line-height: 1.3;
|
|
151
|
+
}
|
|
152
|
+
.page h1 {
|
|
153
|
+
margin: 0;
|
|
154
|
+
font-size: 28px;
|
|
155
|
+
line-height: 1.3;
|
|
156
|
+
}
|
|
157
|
+
.shell[data-collapsed="true"] > .sidebar .brand strong,
|
|
158
|
+
.shell[data-collapsed="true"] > .sidebar .navigation a span {
|
|
159
|
+
display: none;
|
|
160
|
+
}
|
|
161
|
+
.shell[data-collapsed="true"] > .sidebar {
|
|
162
|
+
padding-inline: 12px;
|
|
163
|
+
}
|
|
164
|
+
.shell[data-collapsed="true"] > .sidebar .brand {
|
|
165
|
+
padding: 0;
|
|
166
|
+
justify-content: center;
|
|
167
|
+
}
|
|
168
|
+
.shell[data-collapsed="true"] > .sidebar .navigation a {
|
|
169
|
+
justify-content: center;
|
|
170
|
+
padding-inline: 0;
|
|
171
|
+
}
|
|
172
|
+
.mobileToggle {
|
|
173
|
+
display: none;
|
|
174
|
+
}
|
|
175
|
+
.mobileNav {
|
|
176
|
+
display: flex;
|
|
177
|
+
flex-direction: column;
|
|
178
|
+
gap: 24px;
|
|
179
|
+
min-height: 100%;
|
|
180
|
+
padding: 8px 0;
|
|
181
|
+
}
|
|
182
|
+
.mobileNav .bottom {
|
|
183
|
+
margin-top: 24px;
|
|
184
|
+
}
|
|
185
|
+
.skip {
|
|
186
|
+
position: fixed;
|
|
187
|
+
top: -60px;
|
|
188
|
+
left: 12px;
|
|
189
|
+
z-index: 5000;
|
|
190
|
+
padding: 10px 16px;
|
|
191
|
+
background: var(--surface);
|
|
192
|
+
color: var(--fg);
|
|
193
|
+
}
|
|
194
|
+
.skip:focus {
|
|
195
|
+
top: 12px;
|
|
196
|
+
}
|
|
197
|
+
@media (max-width: 800px) {
|
|
198
|
+
.shell,
|
|
199
|
+
.shell[data-collapsed="true"] {
|
|
200
|
+
grid-template-columns: minmax(0, 1fr);
|
|
201
|
+
}
|
|
202
|
+
.sidebar {
|
|
203
|
+
display: none;
|
|
204
|
+
}
|
|
205
|
+
.desktopToggle {
|
|
206
|
+
display: none;
|
|
207
|
+
}
|
|
208
|
+
.mobileToggle {
|
|
209
|
+
display: inline-flex;
|
|
210
|
+
}
|
|
211
|
+
.header {
|
|
212
|
+
padding-inline: 8px;
|
|
213
|
+
gap: 8px;
|
|
214
|
+
}
|
|
215
|
+
.headerStart,
|
|
216
|
+
.headerEnd {
|
|
217
|
+
gap: 8px;
|
|
218
|
+
}
|
|
219
|
+
.page {
|
|
220
|
+
padding: 28px 24px 40px;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
@media (max-width: 540px) {
|
|
224
|
+
.page {
|
|
225
|
+
padding: 24px 16px 36px;
|
|
226
|
+
}
|
|
227
|
+
.page h1 {
|
|
228
|
+
font-size: 25px;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.page {
|
|
233
|
+
font-size: 13px;
|
|
234
|
+
line-height: 1.6;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.header[data-window-controls="true"] {
|
|
238
|
+
padding-right: 4px;
|
|
239
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type AppearancePreferences } from "./appearance";
|
|
2
|
+
export declare function AppearanceSettings({ settings, dark, onChange: update, onReset, }: {
|
|
3
|
+
settings: AppearancePreferences;
|
|
4
|
+
dark: boolean;
|
|
5
|
+
onChange(patch: Partial<AppearancePreferences>): void;
|
|
6
|
+
onReset(): void;
|
|
7
|
+
}): import("react").JSX.Element;
|