@bytebrand/fe-ui-core-autobahn 1.0.129 → 1.0.131
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/package.json +1 -1
- package/theme/md3.css +11278 -11262
- package/ui/Dropdown.tsx +8 -2
package/ui/Dropdown.tsx
CHANGED
|
@@ -40,6 +40,11 @@ export interface DropdownProps {
|
|
|
40
40
|
placeholder?: string;
|
|
41
41
|
/** leading lucide icon (kebab-case), e.g. 'arrow-up-down'. */
|
|
42
42
|
icon?: string;
|
|
43
|
+
/** custom leading icon element — takes precedence over `icon` when both are given. For a
|
|
44
|
+
* one-off icon that isn't in lucide-react (e.g. a Figma-exported glyph); give it a
|
|
45
|
+
* `className="lucide"` so it picks up the same `.mselect-btn .lucide` sizing/color rules
|
|
46
|
+
* every named `icon` gets. */
|
|
47
|
+
iconNode?: React.ReactNode;
|
|
43
48
|
disabled?: boolean;
|
|
44
49
|
/** full-width trigger (default true for form fields; pass false for inline controls). */
|
|
45
50
|
block?: boolean;
|
|
@@ -84,6 +89,7 @@ const Dropdown: React.FunctionComponent<DropdownProps> = ({
|
|
|
84
89
|
onChange,
|
|
85
90
|
placeholder,
|
|
86
91
|
icon,
|
|
92
|
+
iconNode,
|
|
87
93
|
disabled = false,
|
|
88
94
|
block = true,
|
|
89
95
|
size = 'md',
|
|
@@ -349,7 +355,7 @@ const Dropdown: React.FunctionComponent<DropdownProps> = ({
|
|
|
349
355
|
// inside the popover) — a <button> can't legally contain an <input>, so this is a
|
|
350
356
|
// <div> standing in for it, same `.mselect-btn` class for identical chrome.
|
|
351
357
|
<div className="mselect-btn mselect-btn--editing">
|
|
352
|
-
{icon && <Icon name={icon} />}
|
|
358
|
+
{iconNode || (icon && <Icon name={icon} />)}
|
|
353
359
|
<input
|
|
354
360
|
ref={searchRef}
|
|
355
361
|
type="text"
|
|
@@ -385,7 +391,7 @@ const Dropdown: React.FunctionComponent<DropdownProps> = ({
|
|
|
385
391
|
onClick={() => (open ? close(false) : openMenu())}
|
|
386
392
|
onKeyDown={onTriggerKeyDown}
|
|
387
393
|
>
|
|
388
|
-
{icon && <Icon name={icon} />}
|
|
394
|
+
{iconNode || (icon && <Icon name={icon} />)}
|
|
389
395
|
<span className={'mselect-label' + (hasValue ? '' : ' mselect-label--ph')}>{label}</span>
|
|
390
396
|
<Icon name="chevron-down" cls="mselect-chev" />
|
|
391
397
|
</button>
|