-
-
Notifications
You must be signed in to change notification settings - Fork 53
textArea updated #1663
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
textArea updated #1663
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@radui/ui": minor | ||
| --- | ||
|
|
||
| Addition of color and radius api support in TextArea and new styling |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,11 +2,20 @@ import React from 'react'; | |||||||||||||||||
| import TextArea from '../TextArea'; | ||||||||||||||||||
| import SandboxEditor from '~/components/tools/SandboxEditor/SandboxEditor'; | ||||||||||||||||||
|
|
||||||||||||||||||
| const Variants = ['solid', 'soft', 'outline', 'ghost']; | ||||||||||||||||||
| const Sizes = ['small', 'medium', 'large']; | ||||||||||||||||||
| const Resizes: Array<'none' | 'vertical' | 'horizontal' | 'both' | undefined> = ['none', 'vertical', 'horizontal', 'both', undefined ]; | ||||||||||||||||||
| const Radius = ['none', 'small', 'medium', 'large']; | ||||||||||||||||||
|
Comment on lines
+5
to
+8
Contributor
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. Remove Including 🔎 Proposed fix-const Resizes: Array<'none' | 'vertical' | 'horizontal' | 'both' | undefined> = ['none', 'vertical', 'horizontal', 'both', undefined ];
+const Resizes: Array<'none' | 'vertical' | 'horizontal' | 'both'> = ['none', 'vertical', 'horizontal', 'both'];If you need to test the default/undefined behavior, create a separate story instance rather than including it in the mapped array. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| const Template = (args:any) => { | ||||||||||||||||||
| return <SandboxEditor className="space-y-4 pt-4"> | ||||||||||||||||||
| <TextArea {...args} > | ||||||||||||||||||
|
|
||||||||||||||||||
| </TextArea> | ||||||||||||||||||
|
|
||||||||||||||||||
| <TextArea disabled placeholder='this textarea is disabled'/> | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| <TextArea readonly className='w-10' placeholder='this textarea is readonly'/> | ||||||||||||||||||
|
Contributor
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. Verify the className 'w-10' for the readonly textarea. The Consider removing the className or using 🔎 Proposed fix- <TextArea readonly className='w-10' placeholder='this textarea is readonly'/>
+ <TextArea readonly placeholder='this textarea is readonly'/>📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| </SandboxEditor>; | ||||||||||||||||||
| }; | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -23,3 +32,35 @@ export const All = { | |||||||||||||||||
| placeholder: 'Type something here' | ||||||||||||||||||
| } | ||||||||||||||||||
| }; | ||||||||||||||||||
|
|
||||||||||||||||||
| export const Size = () =>{ | ||||||||||||||||||
| return <SandboxEditor className="space-y-4 pt-4"> | ||||||||||||||||||
| {Sizes.map((size) => ( | ||||||||||||||||||
| <TextArea key={size} size={size} placeholder={size} /> | ||||||||||||||||||
| ))} | ||||||||||||||||||
| </SandboxEditor>; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| export const Variant = () =>{ | ||||||||||||||||||
| return <SandboxEditor className="space-y-4 pt-4"> | ||||||||||||||||||
| {Variants.map((variant) => ( | ||||||||||||||||||
| <TextArea key={variant} variant={variant} placeholder={variant} /> | ||||||||||||||||||
| ))} | ||||||||||||||||||
| </SandboxEditor>; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| export const Resize = () =>{ | ||||||||||||||||||
| return <SandboxEditor className="space-y-4 pt-4"> | ||||||||||||||||||
| {Resizes.map((resize) => ( | ||||||||||||||||||
| <TextArea key={resize} resize={resize} placeholder={resize} /> | ||||||||||||||||||
| ))} | ||||||||||||||||||
| </SandboxEditor>; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| export const TextAreaRadius = () =>{ | ||||||||||||||||||
| return <SandboxEditor className="space-y-4 pt-4"> | ||||||||||||||||||
| {Radius.map((radius) => ( | ||||||||||||||||||
| <TextArea key={radius} radius={radius} placeholder={radius} /> | ||||||||||||||||||
| ))} | ||||||||||||||||||
| </SandboxEditor>; | ||||||||||||||||||
| } | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,143 @@ | ||
| .rad-ui-text-area { | ||
| textarea { | ||
| border: 2px solid var(--rad-ui-color-accent-600); | ||
| font-size: 16px; | ||
| padding: 8px; | ||
| line-height: 1.5; | ||
| border-radius: 8px; | ||
| color: var(--rad-ui-color-gray-1000); | ||
| min-height: 100px; | ||
| background-color: var(--rad-ui-color-accent-100); | ||
|
|
||
| &::placeholder { | ||
| color: var(--rad-ui-color-accent-500); | ||
| } | ||
|
|
||
| &:focus { | ||
| outline: 2px solid var(--rad-ui-color-accent-500); | ||
| } | ||
| } | ||
|
|
||
| &[data-textarea-resize="horizontal"] textarea { | ||
| resize: horizontal; | ||
| } | ||
|
|
||
| &[data-textarea-resize="vertical"] textarea { | ||
| resize: vertical; | ||
| } | ||
|
|
||
| &[data-textarea-resize="none"] textarea { | ||
| resize: none; | ||
| } | ||
|
|
||
| &[data-textarea-resize="both"] textarea { | ||
| resize: both; | ||
| } | ||
| .rad-ui-text-area textarea { | ||
| display: block; | ||
| width: 100%; | ||
| min-height: 100px; | ||
|
|
||
| box-sizing: border-box; | ||
| resize: none; | ||
|
|
||
| font-family: inherit; | ||
| font-size: 16px; | ||
| line-height: 1.5; | ||
|
|
||
| padding: 10px 12px; | ||
| border-radius: 8px; | ||
|
|
||
| color: var(--rad-ui-color-accent-1000); | ||
| background-color: var(--rad-ui-color-accent-100); | ||
|
|
||
| border: 2px solid var(--rad-ui-color-accent-400); | ||
|
|
||
| transition: | ||
| border-color 0.15s ease, | ||
| box-shadow 0.15s ease, | ||
| background-color 0.15s ease; | ||
| } | ||
|
|
||
| .rad-ui-text-area textarea::placeholder { | ||
| color: var(--rad-ui-color-accent-500); | ||
| } | ||
|
|
||
| .rad-ui-text-area textarea:focus { | ||
| outline: none; | ||
| border-color: var(--rad-ui-color-accent-500); | ||
| box-shadow: 0 0 0 2px var(--rad-ui-color-accent-200); | ||
| } | ||
|
|
||
|
|
||
| .rad-ui-text-area textarea::-webkit-scrollbar { | ||
| width: 10px; | ||
| } | ||
|
|
||
| .rad-ui-text-area textarea::-webkit-scrollbar-track { | ||
| background: transparent; | ||
| } | ||
|
|
||
| .rad-ui-text-area textarea::-webkit-scrollbar-thumb { | ||
| background-color: var(--rad-ui-color-accent-400); | ||
| border-radius: 6px; | ||
| border: 3px solid transparent; | ||
| background-clip: content-box; | ||
| } | ||
|
|
||
| .rad-ui-text-area textarea::-webkit-scrollbar-thumb:hover { | ||
| background-color: var(--rad-ui-color-accent-500); | ||
| } | ||
|
|
||
|
|
||
| .rad-ui-text-area[data-textarea-resize="horizontal"] textarea { | ||
| resize: horizontal; | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-resize="vertical"] textarea { | ||
| resize: vertical; | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-resize="none"] textarea { | ||
| resize: none; | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-resize="both"] textarea { | ||
| resize: both; | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-radius="none"] textarea { | ||
| border-radius: 0; | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-radius="small"] textarea { | ||
| border-radius: 4px; | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-radius="medium"] textarea { | ||
| border-radius: 8px; | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-radius="large"] textarea { | ||
| border-radius: 12px; | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-radius="full"] textarea { | ||
| border-radius: 16px; | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-size="small"] textarea { | ||
| font-size: 12px; | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-size="medium"] textarea { | ||
| font-size: 14px; | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-size="large"] textarea { | ||
| font-size: 16px; | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-variant="soft"] textarea { | ||
| border: none; | ||
| background-color: var(--rad-ui-color-accent-200); | ||
| color: var(--rad-ui-color-accent-1000); | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-variant="outline"] textarea { | ||
| background-color: transparent; | ||
| border: 2px solid var(--rad-ui-color-accent-400); | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-variant="solid"] textarea { | ||
| background-color: var(--rad-ui-color-accent-100); | ||
| border: 2px solid var(--rad-ui-color-accent-400); | ||
| } | ||
|
|
||
|
|
||
| .rad-ui-text-area[data-textarea-variant="ghost"] textarea { | ||
| background-color: transparent; | ||
| border: 2px solid transparent; | ||
| } | ||
|
|
||
| .rad-ui-text-area[data-textarea-variant="ghost"] textarea:focus { | ||
| border-color: var(--rad-ui-color-accent-500); | ||
| } | ||
|
|
||
|
|
||
| .rad-ui-text-area textarea:disabled, | ||
| .rad-ui-text-area textarea:read-only { | ||
| background-color: var(--rad-ui-color-accent-200); | ||
| color: var(--rad-ui-color-accent-600); | ||
| cursor: not-allowed; | ||
| } | ||
|
|
||
| .rad-ui-text-area textarea:disabled::placeholder, | ||
| .rad-ui-text-area textarea:read-only::placeholder { | ||
| color: var(--rad-ui-color-accent-500); | ||
| } | ||
|
Comment on lines
+133
to
143
Contributor
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. Fix CSS specificity ordering to resolve pipeline failures. The linter reports that 🔎 Proposed fixMove the disabled and read-only styles before the ghost variant styles: .rad-ui-text-area[data-textarea-variant="solid"] textarea {
background-color: var(--rad-ui-color-accent-100);
border: 2px solid var(--rad-ui-color-accent-400);
}
+.rad-ui-text-area textarea:disabled,
+.rad-ui-text-area textarea:read-only {
+ background-color: var(--rad-ui-color-accent-200);
+ color: var(--rad-ui-color-accent-600);
+ cursor: not-allowed;
+}
+
+.rad-ui-text-area textarea:disabled::placeholder,
+.rad-ui-text-area textarea:read-only::placeholder {
+ color: var(--rad-ui-color-accent-500);
+}
.rad-ui-text-area[data-textarea-variant="ghost"] textarea {
background-color: transparent;
border: 2px solid transparent;
}
.rad-ui-text-area[data-textarea-variant="ghost"] textarea:focus {
border-color: var(--rad-ui-color-accent-500);
}
-.rad-ui-text-area textarea:disabled,
-.rad-ui-text-area textarea:read-only {
- background-color: var(--rad-ui-color-accent-200);
- color: var(--rad-ui-color-accent-600);
- cursor: not-allowed;
-}
-
-.rad-ui-text-area textarea:disabled::placeholder,
-.rad-ui-text-area textarea:read-only::placeholder {
- color: var(--rad-ui-color-accent-500);
-}
🧰 Tools🪛 GitHub Actions: Lint[error] 133-133: no-descending-specificity: Expected selector ".rad-ui-text-area textarea:disabled" to come before selector ".rad-ui-text-area[data-textarea-variant="ghost"] textarea:focus". [error] 134-134: no-descending-specificity: Expected selector ".rad-ui-text-area textarea:read-only" to come before selector ".rad-ui-text-area[data-textarea-variant="ghost"] textarea:focus". 🤖 Prompt for AI Agents |
||
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.
Remove extra spaces before the optional type indicators.
The
readonlyanddisabledprops have unnecessary spaces before the?operator.🔎 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents