diff options
| author | Adam <[email protected]> | 2026-01-06 15:21:00 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2026-01-20 07:33:44 -0600 |
| commit | 8bcbfd63960120efa3cb770f8e07de1bb57e93b0 (patch) | |
| tree | 75429fd33bf5bc2d3a81e27db72b5671a2eb7629 /packages/ui/src | |
| parent | e521fee0023a604bb6d5ef39b4b892cbf1a0f9d4 (diff) | |
| download | opencode-8bcbfd63960120efa3cb770f8e07de1bb57e93b0.tar.gz opencode-8bcbfd63960120efa3cb770f8e07de1bb57e93b0.zip | |
wip(app): settings
Diffstat (limited to 'packages/ui/src')
| -rw-r--r-- | packages/ui/src/components/dialog.css | 16 | ||||
| -rw-r--r-- | packages/ui/src/components/dialog.tsx | 4 | ||||
| -rw-r--r-- | packages/ui/src/components/tabs.css | 122 | ||||
| -rw-r--r-- | packages/ui/src/components/tabs.tsx | 9 |
4 files changed, 126 insertions, 25 deletions
diff --git a/packages/ui/src/components/dialog.css b/packages/ui/src/components/dialog.css index 177dc0a79..96e967a6f 100644 --- a/packages/ui/src/components/dialog.css +++ b/packages/ui/src/components/dialog.css @@ -30,6 +30,7 @@ flex-direction: column; align-items: center; justify-items: start; + overflow: visible; [data-slot="dialog-content"] { display: flex; @@ -39,6 +40,14 @@ width: 100%; max-height: 100%; min-height: 280px; + overflow: auto; + + /* Hide scrollbar */ + scrollbar-width: none; + -ms-overflow-style: none; + &::-webkit-scrollbar { + display: none; + } /* padding: 8px; */ /* padding: 8px 8px 0 8px; */ @@ -108,7 +117,7 @@ display: flex; flex-direction: column; flex: 1; - overflow-y: auto; + overflow: hidden; &:focus-visible { outline: none; @@ -129,6 +138,11 @@ } } } + + &[data-size="large"] [data-slot="dialog-container"] { + width: min(calc(100vw - 32px), 800px); + height: min(calc(100vh - 32px), 600px); + } } @keyframes overlayShow { diff --git a/packages/ui/src/components/dialog.tsx b/packages/ui/src/components/dialog.tsx index 797fbcbfc..1aff55030 100644 --- a/packages/ui/src/components/dialog.tsx +++ b/packages/ui/src/components/dialog.tsx @@ -6,6 +6,7 @@ export interface DialogProps extends ParentProps { title?: JSXElement description?: JSXElement action?: JSXElement + size?: "normal" | "large" class?: ComponentProps<"div">["class"] classList?: ComponentProps<"div">["classList"] fit?: boolean @@ -13,10 +14,11 @@ export interface DialogProps extends ParentProps { export function Dialog(props: DialogProps) { return ( - <div data-component="dialog" data-fit={props.fit ? true : undefined}> + <div data-component="dialog" data-fit={props.fit ? true : undefined} data-size={props.size || "normal"}> <div data-slot="dialog-container"> <Kobalte.Content data-slot="dialog-content" + data-no-header={!props.title && !props.action ? "" : undefined} classList={{ ...(props.classList ?? {}), [props.class ?? ""]: !!props.class, diff --git a/packages/ui/src/components/tabs.css b/packages/ui/src/components/tabs.css index 3ec7ece90..a74bcc5d5 100644 --- a/packages/ui/src/components/tabs.css +++ b/packages/ui/src/components/tabs.css @@ -215,24 +215,36 @@ height: 100%; overflow-x: hidden; overflow-y: auto; + padding: 8px; + gap: 4px; + background-color: var(--background-base); + border-right: 1px solid var(--border-weak-base); &::after { - width: 100%; - height: auto; - flex-grow: 1; - border-bottom: none; - border-right: 1px solid var(--border-weak-base); + display: none; } } [data-slot="tabs-trigger-wrapper"] { width: 100%; - height: auto; - border-bottom: none; - border-right: 1px solid var(--border-weak-base); + height: 32px; + border: none; + border-radius: 8px; + background-color: transparent; + + [data-slot="tabs-trigger"] { + padding: 0 8px; + gap: 8px; + justify-content: flex-start; + } + + &:hover:not(:disabled) { + background-color: var(--surface-raised-base-hover); + } &:has([data-selected]) { - border-right-color: transparent; + background-color: var(--surface-raised-base-hover); + color: var(--text-strong); } } @@ -243,32 +255,100 @@ &[data-variant="alt"] { [data-slot="tabs-list"] { - padding-left: 0; - padding-right: 0; - padding-top: 24px; - padding-bottom: 24px; - border-bottom: none; - border-right: 1px solid var(--border-weak-base); + padding: 8px; + gap: 4px; + border: none; &::after { + display: none; + } + } + + [data-slot="tabs-trigger-wrapper"] { + height: 32px; + border: none; + border-radius: 8px; + + [data-slot="tabs-trigger"] { border: none; + padding: 0 8px; + gap: 8px; + justify-content: flex-start; + } + + &:hover:not(:disabled) { + background-color: var(--surface-raised-base-hover); + } + + &:has([data-selected]) { + background-color: var(--surface-raised-base-hover); + color: var(--text-strong); + } + } + } + + &[data-variant="settings"] { + [data-slot="tabs-list"] { + width: 180px; + min-width: 180px; + padding: 12px; + gap: 0; + background-color: var(--background-base); + border-right: 1px solid var(--border-weak-base); + + &::after { + display: none; } } + [data-slot="tabs-section-title"] { + padding: 8px 8px 4px 8px; + font-family: var(--font-family-sans); + font-size: var(--font-size-small); + font-weight: var(--font-weight-medium); + color: var(--text-weak); + } + [data-slot="tabs-trigger-wrapper"] { - border-bottom: none; - border-right-width: 2px; - border-right-style: solid; - border-right-color: transparent; + height: 32px; + border: none; + border-radius: var(--radius-md); + + /* text-14-regular */ + font-family: var(--font-family-sans); + font-size: var(--font-size-base); + font-weight: var(--font-weight-regular); + line-height: var(--line-height-large); [data-slot="tabs-trigger"] { - border-bottom: none; + border: none; + padding: 0 8px; + gap: 8px; + justify-content: flex-start; + width: 100%; + } + + [data-component="icon"] { + color: var(--icon-base); + } + + &:hover:not(:disabled) { + background-color: var(--surface-raised-base-hover); } &:has([data-selected]) { - border-right-color: var(--icon-strong-base); + background-color: var(--surface-raised-base-hover); + color: var(--text-strong); + + [data-component="icon"] { + color: var(--icon-strong-base); + } } } + + [data-slot="tabs-content"] { + background-color: var(--surface-raised-stronger-non-alpha); + } } } } diff --git a/packages/ui/src/components/tabs.tsx b/packages/ui/src/components/tabs.tsx index 8c892a6e5..825bfa859 100644 --- a/packages/ui/src/components/tabs.tsx +++ b/packages/ui/src/components/tabs.tsx @@ -1,9 +1,9 @@ import { Tabs as Kobalte } from "@kobalte/core/tabs" import { Show, splitProps, type JSX } from "solid-js" -import type { ComponentProps, ParentProps } from "solid-js" +import type { ComponentProps, ParentProps, Component } from "solid-js" export interface TabsProps extends ComponentProps<typeof Kobalte> { - variant?: "normal" | "alt" + variant?: "normal" | "alt" | "settings" orientation?: "horizontal" | "vertical" } export interface TabsListProps extends ComponentProps<typeof Kobalte.List> {} @@ -106,8 +106,13 @@ function TabsContent(props: ParentProps<TabsContentProps>) { ) } +const TabsSectionTitle: Component<ParentProps> = (props) => { + return <div data-slot="tabs-section-title">{props.children}</div> +} + export const Tabs = Object.assign(TabsRoot, { List: TabsList, Trigger: TabsTrigger, Content: TabsContent, + SectionTitle: TabsSectionTitle, }) |
