@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,201 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Check, RotateCcw } from "lucide-react";
|
|
3
|
+
import { ThemeStylePicker } from "./ThemeStylePicker.js";
|
|
4
|
+
import { ThemePicker } from "./ThemePicker.js";
|
|
5
|
+
import { ColorField } from "./ColorField.js";
|
|
6
|
+
import { SettingsCard } from "./SettingsLayout.js";
|
|
7
|
+
import { SettingRow } from "./SettingRow.js";
|
|
8
|
+
import { Select } from "./Select.js";
|
|
9
|
+
import { NumberInput } from "./NumberInput.js";
|
|
10
|
+
import { Switch } from "./Switch.js";
|
|
11
|
+
import { Button } from "./Button.js";
|
|
12
|
+
import { useToast } from "./ToastProvider.js";
|
|
13
|
+
import { appearanceDefaults } from "./appearance.js";
|
|
14
|
+
import s from "./AppearanceSettings.module.css";
|
|
15
|
+
const toastOptions = [
|
|
16
|
+
{ value: "top-left", label: "\u9876\u90E8\u5DE6\u4FA7" },
|
|
17
|
+
{ value: "top-center", label: "\u9876\u90E8\u4E2D\u95F4" },
|
|
18
|
+
{ value: "top-right", label: "\u9876\u90E8\u53F3\u4FA7" },
|
|
19
|
+
{ value: "bottom-left", label: "\u5E95\u90E8\u5DE6\u4FA7" },
|
|
20
|
+
{ value: "bottom-center", label: "\u5E95\u90E8\u4E2D\u95F4" },
|
|
21
|
+
{ value: "bottom-right", label: "\u5E95\u90E8\u53F3\u4FA7" }
|
|
22
|
+
];
|
|
23
|
+
const tooltipOptions = [
|
|
24
|
+
{ value: "top", label: "\u4E0A\u65B9" },
|
|
25
|
+
{ value: "bottom", label: "\u4E0B\u65B9" },
|
|
26
|
+
{ value: "left", label: "\u5DE6\u4FA7" },
|
|
27
|
+
{ value: "right", label: "\u53F3\u4FA7" }
|
|
28
|
+
];
|
|
29
|
+
function AppearanceSettings({
|
|
30
|
+
settings,
|
|
31
|
+
dark,
|
|
32
|
+
onChange: update,
|
|
33
|
+
onReset
|
|
34
|
+
}) {
|
|
35
|
+
const notify = useToast();
|
|
36
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37
|
+
/* @__PURE__ */ jsx("h2", { children: "\u5916\u89C2" }),
|
|
38
|
+
/* @__PURE__ */ jsx(SettingsCard, { children: /* @__PURE__ */ jsx(SettingRow, { title: "\u754C\u9762\u98CE\u683C", children: /* @__PURE__ */ jsx(
|
|
39
|
+
ThemeStylePicker,
|
|
40
|
+
{
|
|
41
|
+
value: settings.designTheme,
|
|
42
|
+
onChange: (designTheme) => update({
|
|
43
|
+
...appearanceDefaults(designTheme),
|
|
44
|
+
mode: settings.mode,
|
|
45
|
+
motion: settings.motion
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
) }) }),
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
ThemePicker,
|
|
51
|
+
{
|
|
52
|
+
value: settings.mode,
|
|
53
|
+
onChange: (mode) => update({ mode })
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ jsxs(SettingsCard, { children: [
|
|
57
|
+
/* @__PURE__ */ jsx(SettingRow, { title: "\u5F3A\u8C03\u8272", children: /* @__PURE__ */ jsx("div", { className: s.swatches, children: [
|
|
58
|
+
settings.designTheme === "blue" ? "#5269b6" : "#303030",
|
|
59
|
+
"#4479d8",
|
|
60
|
+
"#6d61bd",
|
|
61
|
+
settings.designTheme === "blue" ? "#397c67" : "#41886c",
|
|
62
|
+
"#b67838",
|
|
63
|
+
"#b55875"
|
|
64
|
+
].map((color) => /* @__PURE__ */ jsx(
|
|
65
|
+
"button",
|
|
66
|
+
{
|
|
67
|
+
"aria-label": color === "#397c67" || color === "#41886c" ? "\u677E\u7EFF" : `\u5F3A\u8C03\u8272 ${color}`,
|
|
68
|
+
"aria-pressed": settings.accent === color,
|
|
69
|
+
style: { background: color },
|
|
70
|
+
onClick: () => update({ accent: color }),
|
|
71
|
+
children: settings.accent === color && /* @__PURE__ */ jsx(Check, {})
|
|
72
|
+
},
|
|
73
|
+
color
|
|
74
|
+
)) }) }),
|
|
75
|
+
/* @__PURE__ */ jsx(SettingRow, { title: "\u81EA\u5B9A\u4E49\u5F3A\u8C03\u8272", children: /* @__PURE__ */ jsx(
|
|
76
|
+
ColorField,
|
|
77
|
+
{
|
|
78
|
+
label: "\u81EA\u5B9A\u4E49\u5F3A\u8C03\u8272",
|
|
79
|
+
value: settings.accent,
|
|
80
|
+
onChange: (accent) => update({ accent })
|
|
81
|
+
}
|
|
82
|
+
) }),
|
|
83
|
+
/* @__PURE__ */ jsx(SettingRow, { title: "\u80CC\u666F\u989C\u8272", children: /* @__PURE__ */ jsx(
|
|
84
|
+
ColorField,
|
|
85
|
+
{
|
|
86
|
+
label: "\u80CC\u666F\u989C\u8272",
|
|
87
|
+
value: dark ? settings.darkBackground : settings.lightBackground,
|
|
88
|
+
onChange: (color) => update(
|
|
89
|
+
dark ? { darkBackground: color } : { lightBackground: color }
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
) }),
|
|
93
|
+
/* @__PURE__ */ jsx(SettingRow, { title: "\u6587\u5B57\u989C\u8272", children: /* @__PURE__ */ jsx(
|
|
94
|
+
ColorField,
|
|
95
|
+
{
|
|
96
|
+
label: "\u6587\u5B57\u989C\u8272",
|
|
97
|
+
value: dark ? settings.darkForeground : settings.lightForeground,
|
|
98
|
+
onChange: (color) => update(
|
|
99
|
+
dark ? { darkForeground: color } : { lightForeground: color }
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
) }),
|
|
103
|
+
/* @__PURE__ */ jsx(SettingRow, { title: "\u5B57\u4F53", children: /* @__PURE__ */ jsx(
|
|
104
|
+
Select,
|
|
105
|
+
{
|
|
106
|
+
label: "\u5B57\u4F53",
|
|
107
|
+
value: settings.font,
|
|
108
|
+
onChange: (font) => update({ font }),
|
|
109
|
+
options: [
|
|
110
|
+
{ value: "system", label: "\u7CFB\u7EDF\u9ED8\u8BA4" },
|
|
111
|
+
{ value: "Segoe UI", label: "Segoe UI" },
|
|
112
|
+
{ value: "Microsoft YaHei UI", label: "\u5FAE\u8F6F\u96C5\u9ED1 UI" },
|
|
113
|
+
{ value: "sans-serif", label: "\u65E0\u886C\u7EBF" }
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
) }),
|
|
117
|
+
/* @__PURE__ */ jsx(SettingRow, { title: "\u95F4\u8DDD", children: /* @__PURE__ */ jsx(
|
|
118
|
+
Select,
|
|
119
|
+
{
|
|
120
|
+
label: "\u754C\u9762\u95F4\u8DDD",
|
|
121
|
+
value: settings.density,
|
|
122
|
+
onChange: (density) => update({ density }),
|
|
123
|
+
options: [
|
|
124
|
+
{ value: "comfortable", label: "\u8212\u9002" },
|
|
125
|
+
{ value: "compact", label: "\u7D27\u51D1" }
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
) }),
|
|
129
|
+
/* @__PURE__ */ jsxs(SettingRow, { title: "\u5706\u89D2", children: [
|
|
130
|
+
/* @__PURE__ */ jsx(
|
|
131
|
+
NumberInput,
|
|
132
|
+
{
|
|
133
|
+
label: "\u5706\u89D2",
|
|
134
|
+
min: 4,
|
|
135
|
+
max: 16,
|
|
136
|
+
value: settings.radius,
|
|
137
|
+
onChange: (radius) => update({ radius })
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ jsx("span", { className: s.muted, children: "px" })
|
|
141
|
+
] })
|
|
142
|
+
] }),
|
|
143
|
+
/* @__PURE__ */ jsx("h2", { children: "\u63D0\u793A\u4E0E\u52A8\u6548" }),
|
|
144
|
+
/* @__PURE__ */ jsxs(SettingsCard, { children: [
|
|
145
|
+
/* @__PURE__ */ jsx(
|
|
146
|
+
SettingRow,
|
|
147
|
+
{
|
|
148
|
+
title: "Tooltip \u4F4D\u7F6E",
|
|
149
|
+
description: "\u7A7A\u95F4\u4E0D\u8DB3\u65F6\u81EA\u52A8\u907F\u8BA9\u7A97\u53E3\u8FB9\u7F18\u3002",
|
|
150
|
+
children: /* @__PURE__ */ jsx(
|
|
151
|
+
Select,
|
|
152
|
+
{
|
|
153
|
+
label: "Tooltip \u4F4D\u7F6E",
|
|
154
|
+
value: settings.tooltipPlacement,
|
|
155
|
+
onChange: (tooltipPlacement) => update({
|
|
156
|
+
tooltipPlacement
|
|
157
|
+
}),
|
|
158
|
+
options: tooltipOptions
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
/* @__PURE__ */ jsx(SettingRow, { title: "Toast \u4F4D\u7F6E", children: /* @__PURE__ */ jsx(
|
|
164
|
+
Select,
|
|
165
|
+
{
|
|
166
|
+
label: "Toast \u4F4D\u7F6E",
|
|
167
|
+
value: settings.toastPosition,
|
|
168
|
+
onChange: (toastPosition) => update({
|
|
169
|
+
toastPosition
|
|
170
|
+
}),
|
|
171
|
+
options: toastOptions
|
|
172
|
+
}
|
|
173
|
+
) }),
|
|
174
|
+
/* @__PURE__ */ jsx(
|
|
175
|
+
SettingRow,
|
|
176
|
+
{
|
|
177
|
+
title: "\u754C\u9762\u52A8\u6548",
|
|
178
|
+
description: "\u540C\u65F6\u9075\u5FAA\u7CFB\u7EDF\u51CF\u5C11\u52A8\u6001\u6548\u679C\u7684\u504F\u597D\u3002",
|
|
179
|
+
children: /* @__PURE__ */ jsx(
|
|
180
|
+
Switch,
|
|
181
|
+
{
|
|
182
|
+
label: "\u542F\u7528\u754C\u9762\u52A8\u6548",
|
|
183
|
+
checked: settings.motion,
|
|
184
|
+
onChange: (motion) => update({ motion })
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
] }),
|
|
190
|
+
/* @__PURE__ */ jsxs("div", { className: s.controlRow, children: [
|
|
191
|
+
/* @__PURE__ */ jsx(Button, { onClick: () => notify("\u63D0\u793A\u663E\u793A\u5728\u4F60\u9009\u62E9\u7684\u4F4D\u7F6E"), children: "\u9884\u89C8\u63D0\u793A" }),
|
|
192
|
+
/* @__PURE__ */ jsxs(Button, { variant: "ghost", onClick: onReset, children: [
|
|
193
|
+
/* @__PURE__ */ jsx(RotateCcw, {}),
|
|
194
|
+
"\u6062\u590D\u9ED8\u8BA4\u5916\u89C2"
|
|
195
|
+
] })
|
|
196
|
+
] })
|
|
197
|
+
] });
|
|
198
|
+
}
|
|
199
|
+
export {
|
|
200
|
+
AppearanceSettings
|
|
201
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.controlRow {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
}
|
|
7
|
+
.swatches {
|
|
8
|
+
display: flex;
|
|
9
|
+
gap: 9px;
|
|
10
|
+
}
|
|
11
|
+
.swatches button {
|
|
12
|
+
display: grid;
|
|
13
|
+
place-items: center;
|
|
14
|
+
width: 20px;
|
|
15
|
+
height: 20px;
|
|
16
|
+
padding: 3px;
|
|
17
|
+
border: 1px solid #0001;
|
|
18
|
+
border-radius: 50%;
|
|
19
|
+
color: white;
|
|
20
|
+
}
|
|
21
|
+
.swatches svg {
|
|
22
|
+
width: 11px;
|
|
23
|
+
height: 11px;
|
|
24
|
+
stroke-width: 2.5;
|
|
25
|
+
}
|
|
26
|
+
.swatches button[aria-pressed="true"] {
|
|
27
|
+
outline: 1px solid var(--muted);
|
|
28
|
+
outline-offset: 3px;
|
|
29
|
+
}
|
|
30
|
+
.swatches {
|
|
31
|
+
flex-wrap: wrap;
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type AvatarStatus = "online" | "offline" | "busy" | "away";
|
|
3
|
+
export type AvatarProps = {
|
|
4
|
+
name: string;
|
|
5
|
+
src?: string;
|
|
6
|
+
fallback?: ReactNode;
|
|
7
|
+
size?: number;
|
|
8
|
+
shape?: "circle" | "square";
|
|
9
|
+
status?: AvatarStatus;
|
|
10
|
+
decorative?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const avatarStatusLabels: Record<AvatarStatus, string>;
|
|
14
|
+
export declare function Avatar({ name, src, fallback, size, shape, status, decorative, className, }: AvatarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { User } from "lucide-react";
|
|
4
|
+
import s from "./Avatar.module.css";
|
|
5
|
+
const avatarStatusLabels = {
|
|
6
|
+
online: "\u5728\u7EBF",
|
|
7
|
+
offline: "\u79BB\u7EBF",
|
|
8
|
+
busy: "\u5FD9\u788C",
|
|
9
|
+
away: "\u79BB\u5F00"
|
|
10
|
+
};
|
|
11
|
+
const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
12
|
+
const graphemes = (text) => [...segmenter.segment(text)].map((part) => part.segment);
|
|
13
|
+
function AvatarPicture({ src }) {
|
|
14
|
+
const [state, setState] = useState("loading");
|
|
15
|
+
if (state === "error") return null;
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
"img",
|
|
18
|
+
{
|
|
19
|
+
src,
|
|
20
|
+
alt: "",
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
draggable: false,
|
|
23
|
+
className: s.picture,
|
|
24
|
+
"data-loaded": state === "loaded",
|
|
25
|
+
onLoad: () => setState("loaded"),
|
|
26
|
+
onError: () => setState("error")
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
function Avatar({
|
|
31
|
+
name,
|
|
32
|
+
src,
|
|
33
|
+
fallback,
|
|
34
|
+
size = 32,
|
|
35
|
+
shape = "circle",
|
|
36
|
+
status,
|
|
37
|
+
decorative = false,
|
|
38
|
+
className = ""
|
|
39
|
+
}) {
|
|
40
|
+
const length = Number.isFinite(size) ? Math.max(16, Math.min(96, size)) : 32;
|
|
41
|
+
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
42
|
+
const derived = words.length > 1 ? words.slice(0, 2).map((word) => graphemes(word)[0]).join("").toLocaleUpperCase() : graphemes(words[0] || "").slice(0, 2).join("").toLocaleUpperCase();
|
|
43
|
+
const initials = length < 24 ? graphemes(derived)[0] : derived;
|
|
44
|
+
return /* @__PURE__ */ jsxs(
|
|
45
|
+
"span",
|
|
46
|
+
{
|
|
47
|
+
className: `${s.avatar} ${className}`,
|
|
48
|
+
role: decorative ? void 0 : "img",
|
|
49
|
+
"aria-hidden": decorative || void 0,
|
|
50
|
+
"aria-label": decorative ? void 0 : `${name.trim() || "\u672A\u547D\u540D"}${status ? `\uFF0C${avatarStatusLabels[status]}` : ""}`,
|
|
51
|
+
"data-shape": shape,
|
|
52
|
+
style: {
|
|
53
|
+
"--avatar-size": `${length}px`,
|
|
54
|
+
"--avatar-font": `${Math.max(9, Math.round(length * 0.36))}px`
|
|
55
|
+
},
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsxs("span", { className: s.face, "aria-hidden": "true", children: [
|
|
58
|
+
/* @__PURE__ */ jsx("span", { className: s.fallback, children: fallback ?? (initials || /* @__PURE__ */ jsx(User, {})) }),
|
|
59
|
+
src && /* @__PURE__ */ jsx(AvatarPicture, { src }, src)
|
|
60
|
+
] }),
|
|
61
|
+
status && /* @__PURE__ */ jsx("span", { className: s.status, "data-status": status, "aria-hidden": "true" })
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
Avatar,
|
|
68
|
+
avatarStatusLabels
|
|
69
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
.avatar {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
flex: none;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
width: var(--avatar-size);
|
|
8
|
+
height: var(--avatar-size);
|
|
9
|
+
vertical-align: middle;
|
|
10
|
+
color: var(--fg);
|
|
11
|
+
}
|
|
12
|
+
.face {
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
border: 1px solid var(--line);
|
|
20
|
+
background: var(--soft);
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
}
|
|
24
|
+
.avatar[data-shape="square"] .face {
|
|
25
|
+
border-radius: min(var(--radius), calc(var(--avatar-size) * 0.25));
|
|
26
|
+
}
|
|
27
|
+
.fallback {
|
|
28
|
+
display: inline-flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
font-size: var(--avatar-font);
|
|
32
|
+
font-weight: 500;
|
|
33
|
+
line-height: 1;
|
|
34
|
+
}
|
|
35
|
+
.fallback > svg {
|
|
36
|
+
width: calc(var(--avatar-size) * 0.5);
|
|
37
|
+
height: calc(var(--avatar-size) * 0.5);
|
|
38
|
+
color: var(--muted);
|
|
39
|
+
}
|
|
40
|
+
.picture {
|
|
41
|
+
position: absolute;
|
|
42
|
+
inset: 0;
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
object-fit: cover;
|
|
46
|
+
opacity: 0;
|
|
47
|
+
transition: opacity var(--motion-hover) var(--ease);
|
|
48
|
+
}
|
|
49
|
+
.picture[data-loaded="true"] {
|
|
50
|
+
opacity: 1;
|
|
51
|
+
}
|
|
52
|
+
.status {
|
|
53
|
+
position: absolute;
|
|
54
|
+
right: -1px;
|
|
55
|
+
bottom: -1px;
|
|
56
|
+
width: max(6px, calc(var(--avatar-size) * 0.24));
|
|
57
|
+
height: max(6px, calc(var(--avatar-size) * 0.24));
|
|
58
|
+
border: 2px solid var(--surface);
|
|
59
|
+
border-radius: 50%;
|
|
60
|
+
background: var(--muted);
|
|
61
|
+
}
|
|
62
|
+
.status[data-status="online"] {
|
|
63
|
+
background: var(--success);
|
|
64
|
+
}
|
|
65
|
+
.status[data-status="busy"] {
|
|
66
|
+
background: var(--danger);
|
|
67
|
+
}
|
|
68
|
+
.status[data-status="away"] {
|
|
69
|
+
background: var(--warning);
|
|
70
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type AvatarProps } from "./Avatar";
|
|
2
|
+
export type AvatarGroupItem = Pick<AvatarProps, "name" | "src" | "fallback" | "status"> & {
|
|
3
|
+
value: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type AvatarGroupProps = {
|
|
7
|
+
items: AvatarGroupItem[];
|
|
8
|
+
max?: number;
|
|
9
|
+
size?: number;
|
|
10
|
+
shape?: AvatarProps["shape"];
|
|
11
|
+
label?: string;
|
|
12
|
+
onSelect?(item: AvatarGroupItem): void;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function AvatarGroup({ items, max, size, shape, label, onSelect, className, }: AvatarGroupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { moveMenuFocus } from "./menuFocus.js";
|
|
3
|
+
import { useEffect, useId, useRef } from "react";
|
|
4
|
+
import { Avatar, avatarStatusLabels } from "./Avatar.js";
|
|
5
|
+
import { Tooltip } from "./Tooltip.js";
|
|
6
|
+
import { Popover } from "./Popover.js";
|
|
7
|
+
import { MenuItem } from "./MenuItem.js";
|
|
8
|
+
import { usePopover } from "./usePopover.js";
|
|
9
|
+
import s from "./AvatarGroup.module.css";
|
|
10
|
+
function AvatarGroup({
|
|
11
|
+
items,
|
|
12
|
+
max = 4,
|
|
13
|
+
size = 32,
|
|
14
|
+
shape = "circle",
|
|
15
|
+
label = "\u6210\u5458",
|
|
16
|
+
onSelect,
|
|
17
|
+
className = ""
|
|
18
|
+
}) {
|
|
19
|
+
const pop = usePopover(), id = useId(), list = useRef(null);
|
|
20
|
+
const count = Number.isFinite(max) ? Math.max(0, Math.floor(max)) : items.length;
|
|
21
|
+
const shown = items.slice(0, count), hidden = items.slice(count);
|
|
22
|
+
useEffect(() => pop.close(), [items, max, pop.close]);
|
|
23
|
+
const select = (item) => {
|
|
24
|
+
if (item.disabled || !onSelect) return;
|
|
25
|
+
if (pop.open) {
|
|
26
|
+
pop.closeAndFocus();
|
|
27
|
+
}
|
|
28
|
+
onSelect(item);
|
|
29
|
+
};
|
|
30
|
+
const length = Number.isFinite(size) ? Math.max(16, Math.min(96, size)) : 32;
|
|
31
|
+
return /* @__PURE__ */ jsxs("div", { className: `${s.group} ${className}`, role: "group", "aria-label": label, children: [
|
|
32
|
+
shown.map((item) => /* @__PURE__ */ jsx(
|
|
33
|
+
Tooltip,
|
|
34
|
+
{
|
|
35
|
+
content: `${item.name}${item.status ? ` \xB7 ${avatarStatusLabels[item.status]}` : ""}`,
|
|
36
|
+
children: onSelect ? /* @__PURE__ */ jsx(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
type: "button",
|
|
40
|
+
className: s.member,
|
|
41
|
+
"data-shape": shape,
|
|
42
|
+
disabled: item.disabled,
|
|
43
|
+
"aria-label": `${item.name}${item.status ? `\uFF0C${avatarStatusLabels[item.status]}` : ""}`,
|
|
44
|
+
onClick: () => select(item),
|
|
45
|
+
children: /* @__PURE__ */ jsx(Avatar, { ...item, size: length, shape, decorative: true })
|
|
46
|
+
}
|
|
47
|
+
) : /* @__PURE__ */ jsx("span", { className: s.member, "data-shape": shape, children: /* @__PURE__ */ jsx(Avatar, { ...item, size: length, shape }) })
|
|
48
|
+
},
|
|
49
|
+
item.value
|
|
50
|
+
)),
|
|
51
|
+
hidden.length > 0 && /* @__PURE__ */ jsxs(
|
|
52
|
+
"button",
|
|
53
|
+
{
|
|
54
|
+
ref: pop.anchor,
|
|
55
|
+
type: "button",
|
|
56
|
+
className: s.more,
|
|
57
|
+
"data-shape": shape,
|
|
58
|
+
style: { width: length, height: length },
|
|
59
|
+
"aria-label": `\u663E\u793A\u5176\u4F59 ${hidden.length} \u4F4D${label}`,
|
|
60
|
+
"aria-expanded": pop.open,
|
|
61
|
+
"aria-haspopup": onSelect ? "menu" : "dialog",
|
|
62
|
+
"aria-controls": id,
|
|
63
|
+
onClick: pop.toggle,
|
|
64
|
+
onKeyDown: (event) => {
|
|
65
|
+
if (event.key === "ArrowDown" && !pop.open) {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
pop.toggle();
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
children: [
|
|
71
|
+
"+",
|
|
72
|
+
hidden.length
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ jsx(
|
|
77
|
+
Popover,
|
|
78
|
+
{
|
|
79
|
+
anchor: pop.anchor,
|
|
80
|
+
open: pop.open && hidden.length > 0,
|
|
81
|
+
onClose: pop.close,
|
|
82
|
+
id,
|
|
83
|
+
role: onSelect ? "menu" : "dialog",
|
|
84
|
+
label: `${label}\u5217\u8868`,
|
|
85
|
+
width: 260,
|
|
86
|
+
onKeyDown: (event) => moveMenuFocus(event, list.current),
|
|
87
|
+
children: /* @__PURE__ */ jsx(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
ref: list,
|
|
91
|
+
className: s.list,
|
|
92
|
+
tabIndex: onSelect ? void 0 : -1,
|
|
93
|
+
"data-autofocus": onSelect ? void 0 : "",
|
|
94
|
+
children: hidden.map((item) => /* @__PURE__ */ jsx(
|
|
95
|
+
MenuItem,
|
|
96
|
+
{
|
|
97
|
+
as: onSelect ? "button" : "div",
|
|
98
|
+
role: onSelect ? "menuitem" : void 0,
|
|
99
|
+
label: item.name,
|
|
100
|
+
description: item.status && avatarStatusLabels[item.status],
|
|
101
|
+
icon: /* @__PURE__ */ jsx(Avatar, { ...item, size: 16, decorative: true }),
|
|
102
|
+
disabled: item.disabled,
|
|
103
|
+
onClick: () => select(item)
|
|
104
|
+
},
|
|
105
|
+
item.value
|
|
106
|
+
))
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
] });
|
|
112
|
+
}
|
|
113
|
+
export {
|
|
114
|
+
AvatarGroup
|
|
115
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
.group {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
gap: 6px 0;
|
|
6
|
+
isolation: isolate;
|
|
7
|
+
padding: 2px 10px;
|
|
8
|
+
}
|
|
9
|
+
.group > * {
|
|
10
|
+
margin-left: -8px;
|
|
11
|
+
}
|
|
12
|
+
.member,
|
|
13
|
+
.more {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
flex: none;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
border: 0;
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
padding: 0;
|
|
22
|
+
box-shadow: 0 0 0 2px var(--surface);
|
|
23
|
+
background: var(--soft);
|
|
24
|
+
color: var(--fg);
|
|
25
|
+
transition:
|
|
26
|
+
transform var(--motion-hover) var(--ease),
|
|
27
|
+
background var(--motion-hover);
|
|
28
|
+
}
|
|
29
|
+
.member[data-shape="square"],
|
|
30
|
+
.more[data-shape="square"] {
|
|
31
|
+
border-radius: max(4px, calc(var(--radius) - 2px));
|
|
32
|
+
}
|
|
33
|
+
.group > :hover,
|
|
34
|
+
.group > :focus-within {
|
|
35
|
+
z-index: 1;
|
|
36
|
+
}
|
|
37
|
+
.member:is(button):hover:not(:disabled),
|
|
38
|
+
.more:hover {
|
|
39
|
+
transform: translateY(-2px);
|
|
40
|
+
background: var(--hover);
|
|
41
|
+
}
|
|
42
|
+
.more {
|
|
43
|
+
font-size: 11px;
|
|
44
|
+
min-width: 0;
|
|
45
|
+
}
|
|
46
|
+
.more[aria-expanded="true"] {
|
|
47
|
+
background: var(--selected);
|
|
48
|
+
}
|
|
49
|
+
.list {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
gap: var(--menu-item-spacing);
|
|
53
|
+
outline: none;
|
|
54
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.badge {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 5px;
|
|
5
|
+
padding: 3px 8px;
|
|
6
|
+
font-size: 10px;
|
|
7
|
+
border-radius: 5px;
|
|
8
|
+
background: var(--soft);
|
|
9
|
+
color: var(--muted);
|
|
10
|
+
white-space: nowrap;
|
|
11
|
+
}
|
|
12
|
+
.success {
|
|
13
|
+
color: var(--success);
|
|
14
|
+
background: color-mix(in srgb, var(--success) 8%, var(--surface));
|
|
15
|
+
}
|
|
16
|
+
.warning {
|
|
17
|
+
color: var(--warning);
|
|
18
|
+
background: color-mix(in srgb, var(--warning) 8%, var(--surface));
|
|
19
|
+
}
|
|
20
|
+
.neutral {
|
|
21
|
+
color: var(--muted);
|
|
22
|
+
}
|
|
23
|
+
.accent {
|
|
24
|
+
color: var(--accent);
|
|
25
|
+
background: var(--accent-soft);
|
|
26
|
+
}
|
|
27
|
+
.danger {
|
|
28
|
+
color: var(--danger);
|
|
29
|
+
background: var(--danger-soft);
|
|
30
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from "react";
|
|
3
|
+
import { TabList } from "./TabList.js";
|
|
4
|
+
function BlockedTabView(props) {
|
|
5
|
+
return /* @__PURE__ */ jsx(TabList, { ...props, variant: "blocked" });
|
|
6
|
+
}
|
|
7
|
+
const BlockedTab = memo(BlockedTabView);
|
|
8
|
+
export {
|
|
9
|
+
BlockedTab
|
|
10
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type BreadcrumbItem = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
href?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type BreadcrumbProps = {
|
|
10
|
+
items: BreadcrumbItem[];
|
|
11
|
+
onNavigate?(value: string): void;
|
|
12
|
+
maxItems?: number;
|
|
13
|
+
label?: string;
|
|
14
|
+
className?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function Breadcrumb({ items, onNavigate, maxItems, label, className, }: BreadcrumbProps): import("react").JSX.Element;
|