diff options
| author | Adam <[email protected]> | 2025-12-10 12:48:08 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-12-10 15:17:03 -0600 |
| commit | 91d743ef9a5c346fe17bb857db68dca92a6e9ba1 (patch) | |
| tree | eae37157434a8024df90ad55f08d51abc3390207 /packages/ui/src/components | |
| parent | 804ad5897f17cd5f002fbd0c124d5301205efcfb (diff) | |
| download | opencode-91d743ef9a5c346fe17bb857db68dca92a6e9ba1.tar.gz opencode-91d743ef9a5c346fe17bb857db68dca92a6e9ba1.zip | |
wip(desktop): progress
Diffstat (limited to 'packages/ui/src/components')
| -rw-r--r-- | packages/ui/src/components/avatar.tsx | 7 | ||||
| -rw-r--r-- | packages/ui/src/components/button.css | 18 | ||||
| -rw-r--r-- | packages/ui/src/components/select-dialog.css | 1 | ||||
| -rw-r--r-- | packages/ui/src/components/select-dialog.tsx | 6 |
4 files changed, 21 insertions, 11 deletions
diff --git a/packages/ui/src/components/avatar.tsx b/packages/ui/src/components/avatar.tsx index 1ff3008ee..fb5798b08 100644 --- a/packages/ui/src/components/avatar.tsx +++ b/packages/ui/src/components/avatar.tsx @@ -9,22 +9,23 @@ export interface AvatarProps extends ComponentProps<"div"> { export function Avatar(props: AvatarProps) { const [split, rest] = splitProps(props, ["fallback", "src", "background", "size", "class", "classList", "style"]) + const src = split.src // did this so i can zero it out to test fallback return ( <div {...rest} data-component="avatar" data-size={split.size || "normal"} - data-has-image={split.src ? "" : undefined} + data-has-image={src ? "" : undefined} classList={{ ...(split.classList ?? {}), [split.class ?? ""]: !!split.class, }} style={{ ...(typeof split.style === "object" ? split.style : {}), - ...(!split.src && split.background ? { "--avatar-bg": split.background } : {}), + ...(!src && split.background ? { "--avatar-bg": split.background } : {}), }} > - <Show when={split.src} fallback={split.fallback?.[0]}> + <Show when={src} fallback={split.fallback?.[0]}> {(src) => <img src={src()} draggable={false} class="size-full object-cover" />} </Show> </div> diff --git a/packages/ui/src/components/button.css b/packages/ui/src/components/button.css index 192c7b60c..f95317028 100644 --- a/packages/ui/src/components/button.css +++ b/packages/ui/src/components/button.css @@ -102,12 +102,20 @@ height: 24px; padding: 0 6px; &[data-icon] { - padding: 0 8px 0 6px; + padding: 0 12px 0 4px; } font-size: var(--font-size-small); line-height: var(--line-height-large); gap: 6px; + + /* text-12-medium */ + font-family: var(--font-family-sans); + font-size: var(--font-size-small); + font-style: normal; + font-weight: var(--font-weight-medium); + line-height: var(--line-height-large); /* 166.667% */ + letter-spacing: var(--letter-spacing-normal); } &[data-size="large"] { @@ -115,17 +123,17 @@ padding: 0 8px; &[data-icon] { - padding: 0 8px 0 6px; + padding: 0 12px 0 8px; } gap: 8px; - /* text-12-medium */ + /* text-14-medium */ font-family: var(--font-family-sans); - font-size: var(--font-size-small); + font-size: 14px; font-style: normal; font-weight: var(--font-weight-medium); - line-height: var(--line-height-large); /* 166.667% */ + line-height: var(--line-height-large); /* 142.857% */ letter-spacing: var(--letter-spacing-normal); } diff --git a/packages/ui/src/components/select-dialog.css b/packages/ui/src/components/select-dialog.css index 206eade0d..cc834f795 100644 --- a/packages/ui/src/components/select-dialog.css +++ b/packages/ui/src/components/select-dialog.css @@ -75,7 +75,6 @@ position: relative; display: flex; flex-direction: column; - gap: 4px; [data-slot="select-dialog-header"] { display: flex; diff --git a/packages/ui/src/components/select-dialog.tsx b/packages/ui/src/components/select-dialog.tsx index 695791aad..b93993ad4 100644 --- a/packages/ui/src/components/select-dialog.tsx +++ b/packages/ui/src/components/select-dialog.tsx @@ -15,6 +15,7 @@ interface SelectDialogProps<T> children: (item: T) => JSX.Element onSelect?: (value: T | undefined) => void onKeyEvent?: (event: KeyboardEvent, item: T | undefined) => void + actions?: JSX.Element } export function SelectDialog<T>(props: SelectDialogProps<T>) { @@ -98,7 +99,8 @@ export function SelectDialog<T>(props: SelectDialogProps<T>) { <Dialog modal {...dialog} onOpenChange={handleOpenChange}> <Dialog.Header> <Dialog.Title>{others.title}</Dialog.Title> - <Dialog.CloseButton ref={closeButton} tabIndex={-1} /> + <Show when={others.actions}>{others.actions}</Show> + <Dialog.CloseButton ref={closeButton} tabIndex={-1} style={{ display: others.actions ? "none" : undefined }} /> </Dialog.Header> <div data-slot="select-dialog-content"> <div data-component="select-dialog-input"> @@ -136,7 +138,7 @@ export function SelectDialog<T>(props: SelectDialogProps<T>) { fallback={ <div data-slot="select-dialog-empty-state"> <div data-slot="select-dialog-message"> - {props.emptyMessage ?? "No search results"} for{" "} + {props.emptyMessage ?? "No results"} for{" "} <span data-slot="select-dialog-filter">"{filter()}"</span> </div> </div> |
