diff --git a/components/SettingsUI/CustomStatusItem.tsx b/components/SettingsUI/CustomStatusItem.tsx index 5198cfd..24b8efa 100644 --- a/components/SettingsUI/CustomStatusItem.tsx +++ b/components/SettingsUI/CustomStatusItem.tsx @@ -2,7 +2,7 @@ import { NoteStatus } from "@/types/noteStatus"; import React from "react"; import { Input } from "@/components/atoms/Input"; import { StatusIcon } from "@/components/atoms/StatusIcon"; -import { LucideIconPicker } from "./LucideIconPicker"; +import { IconSelectionField } from "./IconSelectionField"; export type Props = { status: NoteStatus; @@ -32,44 +32,23 @@ export const CustomStatusItem: React.FC = ({ const isValid = status.name.trim().length > 0; return (
-
-
- - - onCustomStatusChange(index, "icon", value || "") - } - placeholder="Example: ✅ or 🚧" - className="custom-status-item__input custom-status-item__input--icon" - /> -

- This fallback icon is shown anywhere Lucide is not - available. -

-
- -
- - - onCustomStatusChange(index, "lucideIcon", value) - } - placeholder="Browse Lucide icons" - allowClear - /> -

- Matches Obsidian's toolbar icons so your status - button blends in. -

-
-
+ + onCustomStatusChange(index, "icon", value || "") + } + emojiLabel="Emoji icon" + emojiPlaceholder="Example: ✅ or 🚧" + emojiHint="Shown anywhere Lucide is not available." + lucideValue={status.lucideIcon || ""} + onLucideChange={(value) => + onCustomStatusChange(index, "lucideIcon", value) + } + lucideLabel="Lucide icon (optional)" + lucidePlaceholder="Browse Lucide icons" + lucideHint="Matches Obsidian's toolbar icons so your status button blends in." + /> {/* Simple horizontal layout with remaining inputs */}
diff --git a/components/SettingsUI/IconSelectionField.tsx b/components/SettingsUI/IconSelectionField.tsx new file mode 100644 index 0000000..96561e6 --- /dev/null +++ b/components/SettingsUI/IconSelectionField.tsx @@ -0,0 +1,75 @@ +import React from "react"; +import { Input } from "@/components/atoms/Input"; +import { LucideIconPicker } from "./LucideIconPicker"; + +export interface IconSelectionFieldProps { + className?: string; + emojiValue: string; + onEmojiChange: (value: string) => void; + emojiLabel?: string; + emojiPlaceholder?: string; + emojiHint?: string; + lucideValue?: string; + onLucideChange?: (value: string) => void; + lucideLabel?: string; + lucidePlaceholder?: string; + lucideHint?: string; + lucideAllowClear?: boolean; +} + +export const IconSelectionField: React.FC = ({ + className = "", + emojiValue, + onEmojiChange, + emojiLabel = "Emoji fallback", + emojiPlaceholder = "Example: ✅", + emojiHint, + lucideValue, + onLucideChange, + lucideLabel = "Lucide icon", + lucidePlaceholder = "Choose Lucide icon", + lucideHint, + lucideAllowClear = true, +}) => { + const containerClass = ["icon-selection-field", className] + .filter(Boolean) + .join(" "); + + return ( +
+
+ + + {emojiHint && ( +

{emojiHint}

+ )} +
+ {onLucideChange && ( +
+ + + {lucideHint && ( +

+ {lucideHint} +

+ )} +
+ )} +
+ ); +}; diff --git a/components/SettingsUI/UISettings.tsx b/components/SettingsUI/UISettings.tsx index 53750d6..c32b708 100644 --- a/components/SettingsUI/UISettings.tsx +++ b/components/SettingsUI/UISettings.tsx @@ -3,7 +3,7 @@ import React from "react"; import { Input } from "../atoms/Input"; import { Select } from "../atoms/Select"; import { SettingItem } from "./SettingItem"; -import { LucideIconPicker } from "./LucideIconPicker"; +import { IconSelectionField } from "./IconSelectionField"; export type Props = { settings: PluginSettings; @@ -270,13 +270,21 @@ export const UISettings: React.FC = ({ settings, onChange }) => { - onChange("unknownStatusIcon", value)} - placeholder="Emoji or Lucide icon" - allowTextInput - allowClear + + onChange("unknownStatusIcon", value) + } + emojiPlaceholder="❓" + emojiHint="Type any emoji or text fallback." + lucideValue={settings.unknownStatusIcon} + onLucideChange={(value) => + onChange("unknownStatusIcon", value) + } + lucidePlaceholder="Choose Lucide icon" + lucideHint="Matches the Obsidian toolbar style." /> diff --git a/styles/components/lucide-icon-picker.css b/styles/components/lucide-icon-picker.css index b84d679..ee39771 100644 --- a/styles/components/lucide-icon-picker.css +++ b/styles/components/lucide-icon-picker.css @@ -155,3 +155,32 @@ color: var(--text-muted); padding: var(--size-4-2); } + +.icon-selection-field { + display: flex; + flex-wrap: wrap; + gap: var(--size-4-2); +} + +.icon-selection-field__column { + flex: 1; + min-width: 220px; +} + +.icon-selection-field__label { + display: block; + font-size: var(--font-ui-smaller); + font-weight: var(--font-medium); + color: var(--text-muted); + margin-bottom: var(--size-2-1); +} + +.icon-selection-field__emoji-input { + max-width: 260px; +} + +.icon-selection-field__hint { + margin-top: var(--size-2-1); + font-size: var(--font-ui-smaller); + color: var(--text-muted); +}