@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,32 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DisclosureChevron } from "./DisclosureChevron.js";
|
|
3
|
+
import s from "./Select.module.css";
|
|
4
|
+
import t from "./SelectTrigger.module.css";
|
|
5
|
+
function SelectTrigger({
|
|
6
|
+
expanded,
|
|
7
|
+
children,
|
|
8
|
+
icon,
|
|
9
|
+
className = "",
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsxs(
|
|
13
|
+
"button",
|
|
14
|
+
{
|
|
15
|
+
type: "button",
|
|
16
|
+
role: "combobox",
|
|
17
|
+
...props,
|
|
18
|
+
"aria-expanded": expanded,
|
|
19
|
+
className: s.select + " " + t.trigger + " " + className,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ jsxs("span", { className: t.value, children: [
|
|
22
|
+
icon,
|
|
23
|
+
children
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ jsx(DisclosureChevron, { expanded })
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
SelectTrigger
|
|
32
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.trigger {
|
|
2
|
+
height: var(--control-height);
|
|
3
|
+
min-height: var(--control-height);
|
|
4
|
+
flex-shrink: 0;
|
|
5
|
+
max-width: 100%;
|
|
6
|
+
}
|
|
7
|
+
.value {
|
|
8
|
+
min-width: 0;
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 8px;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
text-overflow: ellipsis;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
}
|
|
16
|
+
.value > span {
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
text-overflow: ellipsis;
|
|
19
|
+
}
|
|
20
|
+
.value > svg {
|
|
21
|
+
flex-shrink: 0;
|
|
22
|
+
width: 16px;
|
|
23
|
+
height: 16px;
|
|
24
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import s from "./SettingRow.module.css";
|
|
3
|
+
function SettingRow({
|
|
4
|
+
title,
|
|
5
|
+
description,
|
|
6
|
+
children,
|
|
7
|
+
divider = true
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", { className: s.settingRow, "data-divider": divider, children: [
|
|
10
|
+
/* @__PURE__ */ jsxs("div", { className: s.settingCopy, children: [
|
|
11
|
+
/* @__PURE__ */ jsx("h3", { children: title }),
|
|
12
|
+
description && /* @__PURE__ */ jsx("p", { children: description })
|
|
13
|
+
] }),
|
|
14
|
+
/* @__PURE__ */ jsx("div", { className: s.settingControl, children })
|
|
15
|
+
] });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
SettingRow
|
|
19
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
.settingRow {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
gap: 24px;
|
|
6
|
+
min-height: var(--row-height);
|
|
7
|
+
padding: 15px 0;
|
|
8
|
+
}
|
|
9
|
+
.settingRow + .settingRow[data-divider="true"] {
|
|
10
|
+
border-top: var(--separator-width) var(--separator-style)
|
|
11
|
+
var(--separator-color);
|
|
12
|
+
}
|
|
13
|
+
.settingCopy {
|
|
14
|
+
flex: 1;
|
|
15
|
+
min-width: 0;
|
|
16
|
+
}
|
|
17
|
+
.settingCopy h3 {
|
|
18
|
+
font-size: 13px;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
}
|
|
21
|
+
.settingCopy p {
|
|
22
|
+
font-size: 11px;
|
|
23
|
+
color: var(--muted);
|
|
24
|
+
margin-top: 4px;
|
|
25
|
+
max-width: 440px;
|
|
26
|
+
}
|
|
27
|
+
.settingControl {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: flex-end;
|
|
31
|
+
gap: 12px;
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
max-width: 55%;
|
|
34
|
+
}
|
|
35
|
+
@media (max-width: 760px) {
|
|
36
|
+
.settingRow {
|
|
37
|
+
flex-wrap: wrap;
|
|
38
|
+
gap: 12px;
|
|
39
|
+
}
|
|
40
|
+
.settingControl {
|
|
41
|
+
margin-left: auto;
|
|
42
|
+
max-width: 100%;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare function SettingsLayout({ value, onChange, children, }: {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange(value: string): void;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export declare function SettingsCard({ children }: {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Settings2, Palette } from "lucide-react";
|
|
3
|
+
import { Indicator } from "./Indicator.js";
|
|
4
|
+
import s from "./SettingsLayout.module.css";
|
|
5
|
+
function SettingsLayout({
|
|
6
|
+
value,
|
|
7
|
+
onChange,
|
|
8
|
+
children
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", { className: s.layout, children: [
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
Indicator,
|
|
13
|
+
{
|
|
14
|
+
label: "\u8BBE\u7F6E\u5206\u7C7B",
|
|
15
|
+
value,
|
|
16
|
+
onChange,
|
|
17
|
+
groups: [
|
|
18
|
+
{
|
|
19
|
+
id: "settings",
|
|
20
|
+
items: [
|
|
21
|
+
{
|
|
22
|
+
value: "general",
|
|
23
|
+
label: "\u901A\u7528",
|
|
24
|
+
icon: /* @__PURE__ */ jsx(Settings2, { size: 17 })
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: "appearance",
|
|
28
|
+
label: "\u5916\u89C2",
|
|
29
|
+
icon: /* @__PURE__ */ jsx(Palette, { size: 17 })
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ jsx("div", { className: s.panel, children })
|
|
37
|
+
] });
|
|
38
|
+
}
|
|
39
|
+
function SettingsCard({ children }) {
|
|
40
|
+
return /* @__PURE__ */ jsx("div", { className: s.card, children });
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
SettingsCard,
|
|
44
|
+
SettingsLayout
|
|
45
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.layout {
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: 140px minmax(0, 1fr);
|
|
4
|
+
gap: 32px;
|
|
5
|
+
align-items: start;
|
|
6
|
+
}
|
|
7
|
+
.layout > nav {
|
|
8
|
+
position: sticky;
|
|
9
|
+
top: 0;
|
|
10
|
+
}
|
|
11
|
+
.panel {
|
|
12
|
+
min-width: 0;
|
|
13
|
+
}
|
|
14
|
+
.panel > h2 {
|
|
15
|
+
font-size: 16px;
|
|
16
|
+
margin: 2px 0 18px;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
}
|
|
19
|
+
.card {
|
|
20
|
+
padding: 0 18px;
|
|
21
|
+
border: 1px solid var(--line);
|
|
22
|
+
border-radius: var(--radius);
|
|
23
|
+
background: var(--surface);
|
|
24
|
+
margin-bottom: 28px;
|
|
25
|
+
}
|
|
26
|
+
.card > :last-child {
|
|
27
|
+
border-bottom: 0;
|
|
28
|
+
}
|
|
29
|
+
@media (max-width: 800px) {
|
|
30
|
+
.layout {
|
|
31
|
+
grid-template-columns: 1fr;
|
|
32
|
+
gap: 24px;
|
|
33
|
+
}
|
|
34
|
+
.layout > nav {
|
|
35
|
+
position: relative;
|
|
36
|
+
}
|
|
37
|
+
.layout > nav > div {
|
|
38
|
+
display: flex;
|
|
39
|
+
gap: 8px;
|
|
40
|
+
}
|
|
41
|
+
.layout > nav button {
|
|
42
|
+
width: auto;
|
|
43
|
+
min-width: 100px;
|
|
44
|
+
}
|
|
45
|
+
.card {
|
|
46
|
+
padding: 0 14px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function ShortcutInput({ value, onChange, label, disabled, error, validate, }: {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange(value: string): void;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
error?: string;
|
|
7
|
+
validate?: (value: string) => string | undefined;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FieldMessages } from "./FieldMessages.js";
|
|
3
|
+
import { FieldLabel } from "./FieldLabel.js";
|
|
4
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
5
|
+
import { X, Keyboard } from "lucide-react";
|
|
6
|
+
import s from "./ShortcutInput.module.css";
|
|
7
|
+
function ShortcutInput({
|
|
8
|
+
value,
|
|
9
|
+
onChange,
|
|
10
|
+
label,
|
|
11
|
+
disabled = false,
|
|
12
|
+
error,
|
|
13
|
+
validate
|
|
14
|
+
}) {
|
|
15
|
+
const id = useId(), input = useRef(null), [recording, setRecording] = useState(false), [draft, setDraft] = useState(""), [localError, setLocalError] = useState(""), accepted = useRef(false);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const stop = () => setRecording(false);
|
|
18
|
+
window.addEventListener("blur", stop);
|
|
19
|
+
return () => window.removeEventListener("blur", stop);
|
|
20
|
+
}, []);
|
|
21
|
+
const message = error || localError;
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", { className: s.field, children: [
|
|
23
|
+
/* @__PURE__ */ jsx(FieldLabel, { htmlFor: id, label }),
|
|
24
|
+
/* @__PURE__ */ jsxs(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
className: s.control,
|
|
28
|
+
"data-disabled": disabled,
|
|
29
|
+
"aria-invalid": !!message,
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsx(Keyboard, {}),
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
"input",
|
|
34
|
+
{
|
|
35
|
+
ref: input,
|
|
36
|
+
id,
|
|
37
|
+
readOnly: true,
|
|
38
|
+
disabled,
|
|
39
|
+
value: recording ? draft : value,
|
|
40
|
+
placeholder: recording ? "\u6309\u4E0B\u7EC4\u5408\u952E" : "\u70B9\u51FB\u5F55\u5165\u5FEB\u6377\u952E",
|
|
41
|
+
"aria-invalid": !!message,
|
|
42
|
+
"aria-describedby": message ? id + "-error" : void 0,
|
|
43
|
+
onFocus: () => {
|
|
44
|
+
setRecording(true);
|
|
45
|
+
setDraft("");
|
|
46
|
+
accepted.current = false;
|
|
47
|
+
setLocalError("");
|
|
48
|
+
},
|
|
49
|
+
onBlur: () => setRecording(false),
|
|
50
|
+
onPointerDown: () => {
|
|
51
|
+
if (document.activeElement === input.current && !recording) {
|
|
52
|
+
setRecording(true);
|
|
53
|
+
setDraft("");
|
|
54
|
+
accepted.current = false;
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
onKeyDown: (e) => {
|
|
58
|
+
if (e.key === "Tab" && !e.ctrlKey && !e.altKey && !e.metaKey)
|
|
59
|
+
return;
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
e.stopPropagation();
|
|
62
|
+
if (e.key === "Escape") {
|
|
63
|
+
setRecording(false);
|
|
64
|
+
input.current?.blur();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (["Control", "Shift", "Alt", "Meta"].includes(e.key)) {
|
|
68
|
+
setDraft(
|
|
69
|
+
[
|
|
70
|
+
e.ctrlKey ? "Ctrl" : "",
|
|
71
|
+
e.altKey ? "Alt" : "",
|
|
72
|
+
e.shiftKey ? "Shift" : "",
|
|
73
|
+
e.metaKey ? "Win" : ""
|
|
74
|
+
].filter(Boolean).join(" + ")
|
|
75
|
+
);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if ((e.key === "Backspace" || e.key === "Delete") && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
|
79
|
+
onChange("");
|
|
80
|
+
setDraft("");
|
|
81
|
+
accepted.current = true;
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const key = e.code.startsWith("Key") ? e.code.slice(3) : e.code.startsWith("Digit") ? e.code.slice(5) : e.key === " " ? "Space" : e.key;
|
|
85
|
+
if (!/^(?:[A-Z0-9]|F(?:[1-9]|1\d|2[0-4])|Space|Tab|Enter|Backspace|Delete|Home|End|PageUp|PageDown|ArrowUp|ArrowDown|ArrowLeft|ArrowRight)$/i.test(
|
|
86
|
+
key
|
|
87
|
+
))
|
|
88
|
+
return;
|
|
89
|
+
const next = [
|
|
90
|
+
e.ctrlKey ? "Ctrl" : "",
|
|
91
|
+
e.altKey ? "Alt" : "",
|
|
92
|
+
e.shiftKey ? "Shift" : "",
|
|
93
|
+
e.metaKey ? "Win" : "",
|
|
94
|
+
key
|
|
95
|
+
].filter(Boolean).join("+"), problem = validate?.(next);
|
|
96
|
+
setLocalError(problem || "");
|
|
97
|
+
if (problem) return;
|
|
98
|
+
onChange(next);
|
|
99
|
+
setDraft(next);
|
|
100
|
+
accepted.current = true;
|
|
101
|
+
},
|
|
102
|
+
onKeyUp: () => {
|
|
103
|
+
if (accepted.current) {
|
|
104
|
+
setRecording(false);
|
|
105
|
+
input.current?.blur();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
value && /* @__PURE__ */ jsx(
|
|
111
|
+
"button",
|
|
112
|
+
{
|
|
113
|
+
type: "button",
|
|
114
|
+
disabled,
|
|
115
|
+
"aria-label": "\u6E05\u9664" + label,
|
|
116
|
+
onClick: () => {
|
|
117
|
+
onChange("");
|
|
118
|
+
setLocalError("");
|
|
119
|
+
},
|
|
120
|
+
children: /* @__PURE__ */ jsx(X, {})
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ jsx(FieldMessages, { id, error: message })
|
|
127
|
+
] });
|
|
128
|
+
}
|
|
129
|
+
export {
|
|
130
|
+
ShortcutInput
|
|
131
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.field {
|
|
2
|
+
composes: field from "./FormField.module.css";
|
|
3
|
+
}
|
|
4
|
+
.control {
|
|
5
|
+
composes: surface from "./Control.module.css";
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 9px;
|
|
9
|
+
padding: 0 10px;
|
|
10
|
+
}
|
|
11
|
+
.control > svg {
|
|
12
|
+
width: 16px;
|
|
13
|
+
height: 16px;
|
|
14
|
+
color: var(--muted);
|
|
15
|
+
}
|
|
16
|
+
.control input {
|
|
17
|
+
border: 0;
|
|
18
|
+
outline: 0;
|
|
19
|
+
background: transparent;
|
|
20
|
+
width: 100%;
|
|
21
|
+
min-width: 0;
|
|
22
|
+
font-size: inherit;
|
|
23
|
+
}
|
|
24
|
+
.control button {
|
|
25
|
+
display: grid;
|
|
26
|
+
place-items: center;
|
|
27
|
+
border: 0;
|
|
28
|
+
background: transparent;
|
|
29
|
+
padding: 3px;
|
|
30
|
+
border-radius: 4px;
|
|
31
|
+
color: var(--muted);
|
|
32
|
+
}
|
|
33
|
+
.control button:hover {
|
|
34
|
+
background: var(--hover);
|
|
35
|
+
}
|
|
36
|
+
.control button svg {
|
|
37
|
+
width: 13px;
|
|
38
|
+
height: 13px;
|
|
39
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import s from "./Skeleton.module.css";
|
|
3
|
+
function Skeleton({
|
|
4
|
+
width = "100%",
|
|
5
|
+
height = 12,
|
|
6
|
+
rounded = false
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
"span",
|
|
10
|
+
{
|
|
11
|
+
"aria-hidden": "true",
|
|
12
|
+
className: s.skeleton,
|
|
13
|
+
style: { width, height, borderRadius: rounded ? "50%" : void 0 }
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
Skeleton
|
|
19
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.skeleton {
|
|
2
|
+
display: block;
|
|
3
|
+
position: relative;
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
border-radius: 5px;
|
|
6
|
+
background: var(--soft);
|
|
7
|
+
}
|
|
8
|
+
.skeleton::after {
|
|
9
|
+
content: "";
|
|
10
|
+
position: absolute;
|
|
11
|
+
inset: 0;
|
|
12
|
+
background: linear-gradient(
|
|
13
|
+
90deg,
|
|
14
|
+
transparent,
|
|
15
|
+
color-mix(in srgb, var(--fg) 4%, transparent),
|
|
16
|
+
transparent
|
|
17
|
+
);
|
|
18
|
+
animation: shimmer 1.5s ease-in-out infinite;
|
|
19
|
+
}
|
|
20
|
+
@keyframes shimmer {
|
|
21
|
+
from {
|
|
22
|
+
transform: translateX(-100%);
|
|
23
|
+
}
|
|
24
|
+
to {
|
|
25
|
+
transform: translateX(100%);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton } from "./Skeleton.js";
|
|
3
|
+
import s from "./SkeletonRows.module.css";
|
|
4
|
+
function SkeletonRows({
|
|
5
|
+
count = 3,
|
|
6
|
+
label = "\u6B63\u5728\u52A0\u8F7D"
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ jsx("div", { role: "status", "aria-label": label, className: s.skeletonRows, children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsxs("div", { className: s.skeletonRow, children: [
|
|
9
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 38, height: 38 }),
|
|
10
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
11
|
+
/* @__PURE__ */ jsx(Skeleton, { width: `${75 - i * 12}%` }),
|
|
12
|
+
/* @__PURE__ */ jsx(Skeleton, { width: "38%", height: 9 })
|
|
13
|
+
] }),
|
|
14
|
+
/* @__PURE__ */ jsx(Skeleton, { width: 45 })
|
|
15
|
+
] }, i)) });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
SkeletonRows
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.skeletonRows {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
.skeletonRow {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 13px;
|
|
8
|
+
padding: 16px 0;
|
|
9
|
+
}
|
|
10
|
+
.skeletonRow + .skeletonRow {
|
|
11
|
+
border-top: var(--separator-width) var(--separator-style)
|
|
12
|
+
var(--separator-color);
|
|
13
|
+
}
|
|
14
|
+
.skeletonRow > div {
|
|
15
|
+
flex: 1;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: 9px;
|
|
19
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import s from "./SkinTonePicker.module.css";
|
|
3
|
+
const tones = [
|
|
4
|
+
{ value: 0, label: "\u9ED8\u8BA4", color: "#f7c94b" },
|
|
5
|
+
{ value: 1, label: "\u6D45\u8272", color: "#f3d6bc" },
|
|
6
|
+
{ value: 2, label: "\u4E2D\u6D45", color: "#deb496" },
|
|
7
|
+
{ value: 3, label: "\u4E2D\u7B49", color: "#bb8663" },
|
|
8
|
+
{ value: 4, label: "\u4E2D\u6DF1", color: "#966445" },
|
|
9
|
+
{ value: 5, label: "\u6DF1\u8272", color: "#634637" }
|
|
10
|
+
];
|
|
11
|
+
function SkinTonePicker({
|
|
12
|
+
value,
|
|
13
|
+
onChange
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", { className: s.bar, children: [
|
|
16
|
+
/* @__PURE__ */ jsx("span", { children: "\u80A4\u8272" }),
|
|
17
|
+
/* @__PURE__ */ jsx("div", { className: s.tones, role: "radiogroup", "aria-label": "Emoji \u80A4\u8272", children: tones.map((t) => /* @__PURE__ */ jsx(
|
|
18
|
+
"button",
|
|
19
|
+
{
|
|
20
|
+
type: "button",
|
|
21
|
+
role: "radio",
|
|
22
|
+
"aria-label": t.label + "\u80A4\u8272",
|
|
23
|
+
"aria-checked": value === t.value,
|
|
24
|
+
title: t.label,
|
|
25
|
+
tabIndex: value === t.value ? 0 : -1,
|
|
26
|
+
onClick: () => onChange(t.value),
|
|
27
|
+
onKeyDown: (e) => {
|
|
28
|
+
const delta = e.key === "ArrowRight" || e.key === "ArrowDown" ? 1 : e.key === "ArrowLeft" || e.key === "ArrowUp" ? -1 : 0;
|
|
29
|
+
if (!delta) return;
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
const next = (value + delta + 6) % 6;
|
|
32
|
+
onChange(next);
|
|
33
|
+
e.currentTarget.parentElement.children[next].focus();
|
|
34
|
+
},
|
|
35
|
+
children: /* @__PURE__ */ jsx("span", { style: { background: t.color } })
|
|
36
|
+
},
|
|
37
|
+
t.value
|
|
38
|
+
)) })
|
|
39
|
+
] });
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
SkinTonePicker
|
|
43
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.bar {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
gap: 12px;
|
|
6
|
+
padding: 0 2px;
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
color: var(--muted);
|
|
9
|
+
}
|
|
10
|
+
.tones {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: 3px;
|
|
14
|
+
}
|
|
15
|
+
.tones button {
|
|
16
|
+
border: 1px solid transparent;
|
|
17
|
+
border-radius: 50%;
|
|
18
|
+
width: 26px;
|
|
19
|
+
height: 26px;
|
|
20
|
+
padding: 4px;
|
|
21
|
+
display: grid;
|
|
22
|
+
place-items: center;
|
|
23
|
+
background: transparent;
|
|
24
|
+
transition:
|
|
25
|
+
border-color var(--motion-hover),
|
|
26
|
+
background var(--motion-hover),
|
|
27
|
+
transform var(--motion-press);
|
|
28
|
+
}
|
|
29
|
+
.tones button > span {
|
|
30
|
+
width: 16px;
|
|
31
|
+
height: 16px;
|
|
32
|
+
border-radius: 50%;
|
|
33
|
+
box-shadow: inset 0 0 0 1px #0000000a;
|
|
34
|
+
transition: transform var(--motion-hover);
|
|
35
|
+
}
|
|
36
|
+
.tones button:hover {
|
|
37
|
+
background: var(--hover);
|
|
38
|
+
}
|
|
39
|
+
.tones button[aria-checked="true"] {
|
|
40
|
+
border-color: var(--accent);
|
|
41
|
+
}
|
|
42
|
+
.tones button[aria-checked="true"] > span {
|
|
43
|
+
transform: scale(0.85);
|
|
44
|
+
}
|
|
45
|
+
.tones button:active {
|
|
46
|
+
transform: scale(0.93);
|
|
47
|
+
}
|
|
48
|
+
.tones button:focus-visible {
|
|
49
|
+
outline-offset: 1px;
|
|
50
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function Slider({ label, value, onChange, min, max, step, disabled, suffix, }: {
|
|
2
|
+
label: string;
|
|
3
|
+
value: number;
|
|
4
|
+
onChange(value: number): void;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
step?: number;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
suffix?: string;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import s from "./Slider.module.css";
|
|
4
|
+
function Slider({
|
|
5
|
+
label,
|
|
6
|
+
value,
|
|
7
|
+
onChange,
|
|
8
|
+
min = 0,
|
|
9
|
+
max = 100,
|
|
10
|
+
step = 1,
|
|
11
|
+
disabled = false,
|
|
12
|
+
suffix = ""
|
|
13
|
+
}) {
|
|
14
|
+
const id = useId();
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", { className: s.field, children: [
|
|
16
|
+
/* @__PURE__ */ jsxs("label", { htmlFor: id, children: [
|
|
17
|
+
label,
|
|
18
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
19
|
+
value,
|
|
20
|
+
suffix
|
|
21
|
+
] })
|
|
22
|
+
] }),
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
"input",
|
|
25
|
+
{
|
|
26
|
+
id,
|
|
27
|
+
type: "range",
|
|
28
|
+
min,
|
|
29
|
+
max,
|
|
30
|
+
step,
|
|
31
|
+
value,
|
|
32
|
+
disabled,
|
|
33
|
+
onChange: (e) => onChange(Number(e.target.value))
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
Slider
|
|
40
|
+
};
|