-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Allow pt-disabled colors in label, select and input-group, and update documentation #448
Changes from 1 commit
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 |
---|---|---|
|
@@ -51,7 +51,7 @@ Markup: | |
<button class="pt-button pt-minimal pt-intent-primary pt-icon-arrow-right" {{:modifier}}></button> | ||
</div> | ||
|
||
:disabled - Disabled input. Must be added separately to the <code><input></code> and <code><button></code>. | ||
:disabled - Disabled input. Must be added separately to the <code><input></code> and <code><button></code>. Should be used with a <code>.pt-disabled</code> modifier (not shown below). | ||
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. "Also add |
||
.pt-round - Rounded caps. Button will also be rounded. | ||
.pt-large - Large group. Children will adjust size accordingly. | ||
.pt-intent-primary - Primary intent. (All 4 intents are supported.) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,7 +76,7 @@ Markup: | |
<input class="pt-input" {{:modifier}} type="search" placeholder="Search input" dir="auto" /> | ||
</div> | ||
|
||
:disabled - Disabled | ||
:disabled - Disabled. This should be used with a <code>.pt-disabled</code> modifier (not shown below). | ||
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. this shouldn't be necessary. 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. This example includes an icon - reworded to be more obvious. |
||
.pt-large - Large | ||
|
||
Styleguide components.forms.input.search | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ Markup: | |
</select> | ||
</div> | ||
|
||
:disabled - Disabled | ||
:disabled - Disabled. This should be used with a <code>.pt-disabled</code> modifier (not shown below). | ||
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 .pt-disabled to .pt-select for icon coloring." |
||
.pt-large - Large | ||
.pt-fill - Expand to fill parent container | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
import * as classNames from "classnames"; | ||
import * as React from "react"; | ||
|
||
import * as Classes from "../../common/classes"; | ||
import { IProps, removeNonHTMLProps } from "../../common/props"; | ||
import { safeInvoke } from "../../common/utils"; | ||
|
||
|
@@ -39,10 +40,15 @@ export class Control<P extends IControlProps> extends React.Component<React.HTML | |
// generates control markup for given input type. | ||
// optional inputRef in case the component needs reference for itself (don't forget to invoke the prop!). | ||
protected renderControl(type: "checkbox" | "radio", typeClassName: string, inputRef = this.props.inputRef) { | ||
const className = classNames( | ||
Classes.CONTROL, | ||
typeClassName, | ||
this.props.className, | ||
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.
|
||
{[Classes.DISABLED]: this.props.disabled}); | ||
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. spaces inside braces. |
||
return ( | ||
<label className={classNames("pt-control", typeClassName, this.props.className)} style={this.props.style}> | ||
<label className={className} style={this.props.style}> | ||
<input {...removeNonHTMLProps(this.props, ["children"], true)} ref={inputRef} type={type} /> | ||
<span className="pt-control-indicator" /> | ||
<span className={Classes.CONTROL_INDICATOR} /> | ||
{this.props.label} | ||
{this.props.children} | ||
</label> | ||
|
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 doesn't explain how to use it. say something about "add .pt-disabled to .pt-control element to change text color," and for all the similar notes below.