-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: carbon design system theme #3883
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
Conversation
packages/carbon/.eslintrc
Outdated
"plugins": ["@typescript-eslint", "jsx-a11y", "react", "import", "@emotion"], | ||
"rules": { "@emotion/jsx-import": "error" } |
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.
I'm guessing that carbon uses emotion?
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.
Carbon doesn't use emotion, I copy most settings from @rjsf/chakra-ui. Going to remove code about emotion.
F extends FormContextType = any | ||
>(props: FieldErrorProps<T, S, F>) { | ||
const { errors = [], idSchema } = props; | ||
console.log('FieldErrorTemplate errors', errors); |
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.
This probably wants to be removed
import { Button } from '@carbon/react'; | ||
import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils'; | ||
|
||
export default function AddButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>({ |
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.
Can you add Documentation similar to what is in other themes?
import { useMemo } from 'react'; | ||
import { ArrayFieldTemplateItemType, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils'; | ||
|
||
export default function ArrayFieldItemTemplate< |
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.
Can you add Documentation similar to what is in other themes?
import { ReactNode } from 'react'; | ||
import { CarbonOptionsContextType, useCarbonOptions } from '../contexts'; | ||
|
||
function getMark(required: boolean, labelMark: CarbonOptionsContextType['labelMark']) { |
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.
Can you add Documentation?
import { ReactNode } from 'react'; | ||
import { NestDepth, useNestDepth } from '../contexts'; | ||
|
||
export function Layer({ children }: { children: ReactNode }) { |
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.
Can you add Documentation?
@@ -248,6 +248,28 @@ export default function Header({ | |||
return ( | |||
<div className='page-header'> | |||
<h1>react-jsonschema-form</h1> | |||
{/* TODO remove this before merge */} |
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.
Yes please!
@@ -23,7 +23,7 @@ export default function Playground({ themes, validators }: PlaygroundProps) { | |||
const [formData, setFormData] = useState<any>(samples.Simple.formData); | |||
const [extraErrors, setExtraErrors] = useState<ErrorSchema | undefined>(); | |||
const [shareURL, setShareURL] = useState<string | null>(null); | |||
const [theme, setTheme] = useState<string>('default'); | |||
const [theme, setTheme] = useState<string>('carbon'); |
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.
Why make this change?
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.
For dev convenience. I'll add a TODO and remove before merge.
Maybe we need |
packages/carbon/README.md
Outdated
### Installation | ||
|
||
```bash | ||
yarn add @carbon/react |
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.
Probably need to add
yarn add @carbon/react | |
yarn add @carbon/react @carbon/styles |
packages/carbon/README.md
Outdated
## Usage | ||
|
||
```js | ||
import Form from '@rjsf/carbon'; |
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.
However you decide to make custom styles work, you might need something like this
import Form from '@rjsf/carbon';
import '@rjsf/carbon/styles.css'
@YuJianghao How goes the work on this theme? You seemed to have stalled out. Do you need anything from us? |
This reverts commit 8144e24.
@YuJianghao FYI, we are preparing a v6 beta so you theme will need to migrate to that branch |
@YuJianghao are you planning on finishing this theme? Or shall we just close the PR? |
Hi, thanks for checking in. I’ve taken a long break from this and, to be honest, I don’t currently have plans to pick it up again. I'll close the PR. Appreciate your patience!
…________________________________
发件人: Heath C ***@***.***>
发送时间: 星期四, 五月 1, 2025 06:32
收件人: rjsf-team/react-jsonschema-form ***@***.***>
抄送: winwin2011 ***@***.***>; Mention ***@***.***>
主题: Re: [rjsf-team/react-jsonschema-form] feat: carbon design system theme (PR #3883)
[https://avatars.githubusercontent.com/u/51679588?s=20&v=4]heath-freenome left a comment (rjsf-team/react-jsonschema-form#3883)<#3883 (comment)>
@YuJianghao<https://github.com/YuJianghao> are you planning on finishing this theme? Or shall we just close the PR?
―
Reply to this email directly, view it on GitHub<#3883 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AED552TZSJCGZME3Z6ETNUD24FFO3AVCNFSM6AAAAAA5MKDKCWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNBTGUYTQOBTHE>.
You are receiving this because you were mentioned.
|
Reasons for making this change
Add Carbon Design System theme. Also see #3857.
I use this Theme too. So, I'm here and try to make a PR for that.
If your PR is non-trivial and you'd like to schedule a synchronous review, please add it to the weekly meeting agenda: https://docs.google.com/document/d/12PjTvv21k6LIky6bNQVnsplMLLnmEuypTLQF8a-8Wss/edit
Checklist
npm run test:update
to update snapshots, if needed.Additional Information
I build a site to preview the theme: rjsf playground with carbon
Dev TODOs
formContext
orglobalUISchema
.Could not find a declaration file for module "@rjsf/utils"