-
Notifications
You must be signed in to change notification settings - Fork 650
[REF-1404] fix: Refactor API Key and Output Modals for improved design consistency #2229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
63a94ed
9fb787a
c4cb0a4
4013fbe
5e112c4
cf12573
c34dd19
cb3c21b
0f2041f
050da42
9d0b19d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,45 @@ | ||
| // Only keep Ant Design overrides that cannot be done with Tailwind | ||
| .api-output-modal { | ||
| .ant-modal-content { | ||
| border-radius: 20px; | ||
| border: none; | ||
| box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08); | ||
| overflow: hidden; | ||
| } | ||
|
|
||
| .ant-modal-header { | ||
| margin: -20px -24px 20px -24px; | ||
| padding: 18px 24px; | ||
| border-bottom: 1px solid var(--refly-line); | ||
|
|
||
| .ant-modal-title { | ||
| margin-bottom: 0; | ||
| } | ||
| } | ||
|
|
||
| .ant-modal-body { | ||
| padding: 0; | ||
| } | ||
|
|
||
| .ant-checkbox-checked .ant-checkbox-inner { | ||
| background-color: var(--refly-text-0); | ||
| border-color: var(--refly-text-0); | ||
|
|
||
| &::after { | ||
| border-color: var(--text-icon-refly-text-flip); | ||
| } | ||
| } | ||
|
|
||
| .ant-checkbox-wrapper:hover .ant-checkbox-inner, | ||
| .ant-checkbox:hover .ant-checkbox-inner, | ||
| .ant-checkbox-input:focus + .ant-checkbox-inner { | ||
| border-color: var(--refly-text-0); | ||
| } | ||
|
|
||
| .ant-checkbox-checked:not(.ant-checkbox-disabled):hover .ant-checkbox-inner, | ||
| .ant-checkbox-wrapper:hover .ant-checkbox-checked:not(.ant-checkbox-disabled) .ant-checkbox-inner, | ||
| label:hover .ant-checkbox-checked:not(.ant-checkbox-disabled) .ant-checkbox-inner { | ||
| background-color: var(--refly-text-0) !important; | ||
| border-color: var(--refly-text-0) !important; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||||||||||||||||||||||||||||||||||
| import { memo } from 'react'; | ||||||||||||||||||||||||||||||||||||||
| import { Button, message } from 'antd'; | ||||||||||||||||||||||||||||||||||||||
| import { useTranslation } from 'react-i18next'; | ||||||||||||||||||||||||||||||||||||||
| import { Copy } from 'refly-icons'; | ||||||||||||||||||||||||||||||||||||||
| import { BiCopy } from 'react-icons/bi'; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| interface CodeExampleProps { | ||||||||||||||||||||||||||||||||||||||
| language: string; | ||||||||||||||||||||||||||||||||||||||
|
|
@@ -18,23 +18,19 @@ export const CodeExample = memo(({ language, code, copyText }: CodeExampleProps) | |||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||
| <div className="relative my-4 rounded-lg overflow-hidden bg-[var(--integration-docs-code-bg)]"> | ||||||||||||||||||||||||||||||||||||||
| <div className="flex items-center justify-between px-3 py-2 bg-[var(--integration-docs-code-header-bg)] border-b border-[var(--integration-docs-code-border)]"> | ||||||||||||||||||||||||||||||||||||||
| <span className="text-xs text-[var(--integration-docs-code-muted)] font-medium"> | ||||||||||||||||||||||||||||||||||||||
| {language} | ||||||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||||||
| <div className="relative my-4 rounded-lg overflow-hidden bg-refly-fill-label border border-solid border-refly-text-4"> | ||||||||||||||||||||||||||||||||||||||
| <div className="flex items-center justify-between px-4 pt-4 bg-refly-fill-label border-b border-[var(--integration-docs-code-border)]"> | ||||||||||||||||||||||||||||||||||||||
| <span className="text-[12px] text-refly-text-2 font-inter">{language}</span> | ||||||||||||||||||||||||||||||||||||||
| <Button | ||||||||||||||||||||||||||||||||||||||
| type="text" | ||||||||||||||||||||||||||||||||||||||
| size="small" | ||||||||||||||||||||||||||||||||||||||
| className="!text-[var(--integration-docs-code-action)] hover:!text-[var(--integration-docs-code-text)]" | ||||||||||||||||||||||||||||||||||||||
| icon={<Copy size={14} />} | ||||||||||||||||||||||||||||||||||||||
| size="middle" | ||||||||||||||||||||||||||||||||||||||
| className="!text-refly-text-1 hover:!text-refly-text-0" | ||||||||||||||||||||||||||||||||||||||
| icon={<BiCopy size={20} />} | ||||||||||||||||||||||||||||||||||||||
| onClick={handleCopy} | ||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
24
to
30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add The copy button contains only an icon without accessible text. Screen readers won't be able to identify its purpose. Based on learnings: "Provide alternative text for images and icons." ♿ Proposed fix to add aria-label <Button
type="text"
size="middle"
className="!text-refly-text-1 hover:!text-refly-text-0"
icon={<BiCopy size={20} />}
onClick={handleCopy}
+ aria-label={t('common.copy')}
/>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
| <pre className="m-0 p-4 overflow-x-auto text-[13px] leading-relaxed bg-[var(--integration-docs-code-content-bg)]"> | ||||||||||||||||||||||||||||||||||||||
| <code className="text-[var(--integration-docs-code-text)] font-mono bg-transparent"> | ||||||||||||||||||||||||||||||||||||||
| {code} | ||||||||||||||||||||||||||||||||||||||
| </code> | ||||||||||||||||||||||||||||||||||||||
| <pre className="m-0 px-4 pb-4 overflow-x-auto text-[14px] leading-relaxed bg-refly-fill-label"> | ||||||||||||||||||||||||||||||||||||||
| <code className="text-refly-text-0 font-mono bg-transparent">{code}</code> | ||||||||||||||||||||||||||||||||||||||
| </pre> | ||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Align modal card radius and border with design tokens.
The modal content uses a 20px radius and removes the border; the design system calls for
rounded-lgand a subtle border for card separation.🎨 Suggested adjustment
As per coding guidelines: "Use consistent border radius (
rounded-lg) for all cards" and "Use subtle borders for card separation".🤖 Prompt for AI Agents