-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Deprecate bottom margin on BaseControl-based components #64408
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 |
---|---|---|
|
@@ -95,6 +95,7 @@ export function CheckboxControl( | |
return ( | ||
<BaseControl | ||
__nextHasNoMarginBottom={ __nextHasNoMarginBottom } | ||
__associatedWPComponentName="CheckboxControl" | ||
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. We're adding the 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. Correct π |
||
label={ heading } | ||
id={ id } | ||
help={ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,7 @@ const Template: StoryFn< typeof RangeControl > = ( { onChange, ...args } ) => { | |
|
||
export const Default: StoryFn< typeof RangeControl > = Template.bind( {} ); | ||
Default.args = { | ||
__nextHasNoMarginBottom: true, | ||
help: 'Please select how transparent you would like this.', | ||
initialPosition: 50, | ||
label: 'Opacity', | ||
|
@@ -104,6 +105,7 @@ export const WithAnyStep: StoryFn< typeof RangeControl > = ( { | |
); | ||
}; | ||
WithAnyStep.args = { | ||
__nextHasNoMarginBottom: true, | ||
label: 'Brightness', | ||
step: 'any', | ||
}; | ||
|
@@ -167,6 +169,7 @@ export const WithIntegerStepAndMarks: StoryFn< typeof RangeControl > = | |
MarkTemplate.bind( {} ); | ||
|
||
WithIntegerStepAndMarks.args = { | ||
__nextHasNoMarginBottom: true, | ||
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. Ah, would have been nice to have an object to declare common props. Not a blocker of course. 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. Haha yes, I considered abstracting it but decided against doing it here because it would be annoying to review it in this big PR π |
||
label: 'Integer Step', | ||
marks: marksBase, | ||
max: 10, | ||
|
@@ -183,6 +186,7 @@ export const WithDecimalStepAndMarks: StoryFn< typeof RangeControl > = | |
MarkTemplate.bind( {} ); | ||
|
||
WithDecimalStepAndMarks.args = { | ||
__nextHasNoMarginBottom: true, | ||
marks: [ | ||
...marksBase, | ||
{ value: 3.5, label: '3.5' }, | ||
|
@@ -202,6 +206,7 @@ export const WithNegativeMinimumAndMarks: StoryFn< typeof RangeControl > = | |
MarkTemplate.bind( {} ); | ||
|
||
WithNegativeMinimumAndMarks.args = { | ||
__nextHasNoMarginBottom: true, | ||
marks: marksWithNegatives, | ||
max: 10, | ||
min: -10, | ||
|
@@ -217,6 +222,7 @@ export const WithNegativeRangeAndMarks: StoryFn< typeof RangeControl > = | |
MarkTemplate.bind( {} ); | ||
|
||
WithNegativeRangeAndMarks.args = { | ||
__nextHasNoMarginBottom: true, | ||
marks: marksWithNegatives, | ||
max: -1, | ||
min: -10, | ||
|
@@ -232,6 +238,7 @@ export const WithAnyStepAndMarks: StoryFn< typeof RangeControl > = | |
MarkTemplate.bind( {} ); | ||
|
||
WithAnyStepAndMarks.args = { | ||
__nextHasNoMarginBottom: true, | ||
marks: marksBase, | ||
max: 10, | ||
min: 0, | ||
|
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.
Should we disallow usage of this prop outside the
@wordpress/components
package? Right now, anyone can modify it, which shouldn't be allowed outside the package, IMHO. It can be a simple ESLint rule.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 think it's fine. If anyone cares enough to use this prop it's probably for a good reason. I'm imagining an extender that has a component library using BaseControl as a wrapper, and they want to show better deprecation messages to their own consumers.
In the Gutenberg repo, any direct usages of BaseControl moving forward shouldn't throw the deprecation warning in the first place (we lint for this). So I think it's a non-issue for now.