✨ add internationalization support for action labels and enhance button styles
Browse files at this commit8fec2e04e242aae5b211247acc179cbc5533d39fParent: 566b730- feat
- ✨ add internationalization support for action labels and enhance button styles
4 changed files +20 -9
- src/components/layout/app-shell.tsx +3 -1
- src/components/ui/table-row-actions.tsx +6 -2
- src/i18n/messages.ts +3 -0
- src/index.css +8 -6
src/components/layout/app-shell.tsxmodified+3 -1
| @@ -170,10 +170,12 @@ export function AppShell(props: ParentProps) { | |||
| 170 | <button | 170 | <button |
| 171 | type="button" | 171 | type="button" |
| 172 | class="topbar-ai-control hidden h-9 shrink-0 items-center justify-center gap-2 rounded-md px-3 text-xs font-semibold outline-hidden focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.98] sm:flex" | 172 | class="topbar-ai-control hidden h-9 shrink-0 items-center justify-center gap-2 rounded-md px-3 text-xs font-semibold outline-hidden focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.98] sm:flex" |
| 173 | + aria-label={t("ai.askCelebi")} | ||
| 174 | + title={t("ai.askCelebi")} | ||
| 173 | onClick={() => setCelebiOpen(true)} | 175 | onClick={() => setCelebiOpen(true)} |
| 174 | > | 176 | > |
| 175 | <IconSparkles class="h-4 w-4" /> | 177 | <IconSparkles class="h-4 w-4" /> |
| 176 | - <span class="hidden sm:inline">{t("ai.askCelebi")}</span> | 178 | + <span>{t("ai.askCelebi")}</span> |
| 177 | </button> | 179 | </button> |
| 178 | </div> | 180 | </div> |
| 179 | </header> | 181 | </header> |
src/components/ui/table-row-actions.tsxmodified+6 -2
| @@ -7,6 +7,7 @@ import { | |||
| 7 | DropdownMenuTrigger, | 7 | DropdownMenuTrigger, |
| 8 | } from "@/components/ui/dropdown-menu"; | 8 | } from "@/components/ui/dropdown-menu"; |
| 9 | import { IconDotsVertical } from "@/components/ui/icons"; | 9 | import { IconDotsVertical } from "@/components/ui/icons"; |
| 10 | +import { useT } from "@/stores/preferences-context"; | ||
| 10 | 11 | ||
| 11 | type TableRowAction = { | 12 | type TableRowAction = { |
| 12 | label: string; | 13 | label: string; |
| @@ -17,15 +18,18 @@ type TableRowAction = { | |||
| 17 | }; | 18 | }; |
| 18 | 19 | ||
| 19 | export function TableRowActions(props: { label: string; actions: TableRowAction[] }) { | 20 | export function TableRowActions(props: { label: string; actions: TableRowAction[] }) { |
| 21 | + const t = useT(); | ||
| 22 | + | ||
| 20 | return ( | 23 | return ( |
| 21 | <div class="flex justify-center"> | 24 | <div class="flex justify-center"> |
| 22 | <DropdownMenu placement="bottom-end" gutter={6}> | 25 | <DropdownMenu placement="bottom-end" gutter={6}> |
| 23 | <DropdownMenuTrigger | 26 | <DropdownMenuTrigger |
| 24 | - class="inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/70 bg-transparent text-muted-foreground outline-hidden transition-colors hover:border-border hover:bg-muted/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring data-expanded:bg-muted data-expanded:text-foreground" | 27 | + class="inline-flex h-8 min-w-[78px] items-center justify-center gap-1.5 rounded-lg border border-border/80 bg-muted/45 px-2 text-xs font-semibold text-foreground outline-hidden transition-colors hover:border-primary/30 hover:bg-primary/8 hover:text-primary focus-visible:ring-2 focus-visible:ring-ring data-expanded:border-primary/30 data-expanded:bg-primary/10 data-expanded:text-primary" |
| 25 | aria-label={props.label} | 28 | aria-label={props.label} |
| 26 | title={props.label} | 29 | title={props.label} |
| 27 | > | 30 | > |
| 28 | - <IconDotsVertical class="h-4 w-4" /> | 31 | + <span>{t("common.action")}</span> |
| 32 | + <IconDotsVertical class="h-3.5 w-3.5" /> | ||
| 29 | </DropdownMenuTrigger> | 33 | </DropdownMenuTrigger> |
| 30 | <DropdownMenuContent class="w-48"> | 34 | <DropdownMenuContent class="w-48"> |
| 31 | <For each={props.actions}> | 35 | <For each={props.actions}> |
src/i18n/messages.tsmodified+3 -0
| @@ -99,6 +99,7 @@ export type MessageKey = | |||
| 99 | | "common.reply" | 99 | | "common.reply" |
| 100 | | "common.approve" | 100 | | "common.approve" |
| 101 | | "common.reject" | 101 | | "common.reject" |
| 102 | + | "common.action" | ||
| 102 | | "common.actions" | 103 | | "common.actions" |
| 103 | | "common.columns" | 104 | | "common.columns" |
| 104 | | "common.visibleColumns" | 105 | | "common.visibleColumns" |
| @@ -1317,6 +1318,7 @@ const en: Dict = { | |||
| 1317 | "common.reply": "Reply", | 1318 | "common.reply": "Reply", |
| 1318 | "common.approve": "Approve", | 1319 | "common.approve": "Approve", |
| 1319 | "common.reject": "Reject", | 1320 | "common.reject": "Reject", |
| 1321 | + "common.action": "Action", | ||
| 1320 | "common.actions": "Actions", | 1322 | "common.actions": "Actions", |
| 1321 | "common.columns": "Columns", | 1323 | "common.columns": "Columns", |
| 1322 | "common.visibleColumns": "Visible columns", | 1324 | "common.visibleColumns": "Visible columns", |
| @@ -2547,6 +2549,7 @@ const tr: Dict = { | |||
| 2547 | "common.reply": "Yanıtla", | 2549 | "common.reply": "Yanıtla", |
| 2548 | "common.approve": "Onayla", | 2550 | "common.approve": "Onayla", |
| 2549 | "common.reject": "Reddet", | 2551 | "common.reject": "Reddet", |
| 2552 | + "common.action": "İşlem", | ||
| 2550 | "common.actions": "İşlemler", | 2553 | "common.actions": "İşlemler", |
| 2551 | "common.columns": "Sütunlar", | 2554 | "common.columns": "Sütunlar", |
| 2552 | "common.visibleColumns": "Görünür sütunlar", | 2555 | "common.visibleColumns": "Görünür sütunlar", |
src/index.cssmodified+8 -6
| @@ -103,6 +103,11 @@ | |||
| 103 | color utility to any element that depends on these defaults. | 103 | color utility to any element that depends on these defaults. |
| 104 | */ | 104 | */ |
| 105 | @layer base { | 105 | @layer base { |
| 106 | + button:not(:disabled), | ||
| 107 | + [role='button']:not([aria-disabled='true']) { | ||
| 108 | + cursor: pointer; | ||
| 109 | + } | ||
| 110 | + | ||
| 106 | *, | 111 | *, |
| 107 | ::after, | 112 | ::after, |
| 108 | ::before, | 113 | ::before, |
| @@ -120,13 +125,10 @@ | |||
| 120 | @apply border border-border/70 bg-transparent text-muted-foreground transition-colors hover:border-border hover:bg-muted/60 hover:text-foreground; | 125 | @apply border border-border/70 bg-transparent text-muted-foreground transition-colors hover:border-border hover:bg-muted/60 hover:text-foreground; |
| 121 | } | 126 | } |
| 122 | 127 | ||
| 123 | -/* AI action button: violet→indigo gradient + indigo glow. */ | 128 | +/* AI action button: follows the active product palette instead of introducing |
| 129 | + a separate violet brand color in the top bar. */ | ||
| 124 | @utility topbar-ai-control { | 130 | @utility topbar-ai-control { |
| 125 | - color: #fff; | 131 | + @apply border border-primary/20 bg-primary/10 text-primary transition-colors hover:bg-primary/16 hover:text-primary; |
| 126 | - background-image: linear-gradient(to right, #7c3aed, #4f46e5, #7c3aed); | ||
| 127 | - border: 1px solid rgb(129 140 248 / 0.5); | ||
| 128 | - box-shadow: 0 0 20px rgb(99 102 241 / 0.35); | ||
| 129 | - @apply transition-[filter,box-shadow,transform] hover:brightness-110 hover:shadow-[0_0_24px_rgb(99_102_241_/_0.5)]; | ||
| 130 | } | 132 | } |
| 131 | 133 | ||
| 132 | @utility data-shell { | 134 | @utility data-shell { |