-
Notifications
You must be signed in to change notification settings - Fork 77
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: deprecate widthScale/heightScale
in favor of width/height
#10202
deprecate: deprecate widthScale/heightScale
in favor of width/height
#10202
Conversation
width
and widthScale
into a single propertywidth
and widthScale
into a single property
width
and widthScale
into a single propertywidth
and widthScale
into a single property
width
and widthScale
into a single propertywidth/height
and widthScale/heightScale
into a single property
width/height
and widthScale/heightScale
into a single propertywidth/height
and widthScale/heightScale
into a single property
packages/calcite-components/src/components/segmented-control/segmented-control.tsx
Show resolved
Hide resolved
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
…, as jest does not support nesting of it blocks
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.
Once feedback is addressed, this should be good to merge!
📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏
📏📐📏📏📏📐📏📏📐📐📏📏📐📐📐📏📏📐📐📐📏📐📐📐📐📏📐📏
📏📐📐📏📏📐📏📐📏📏📐📏📏📐📏📏📐📏📏📏📏📐📏📏📏📏📐📏
📏📐📏📐📏📐📏📐📏📏📐📏📏📐📏📏📐📏📏📏📏📐📐📐📏📏📐📏
📏📐📏📏📐📐📏📐📏📏📐📏📏📐📏📏📐📏📏📏📏📐📏📏📏📏📏📏
📏📐📏📏📏📐📏📏📐📐📏📏📐📐📐📏📏📐📐📐📏📐📐📐📐📏📐📏
📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏📏
packages/calcite-components/src/components/dropdown/resources.ts
Outdated
Show resolved
Hide resolved
widthScale/heightScale
in favor of width/height
widthScale/heightScale
in favor of width/height
widthScale/heightScale
in favor of width/height
widthScale/heightScale
in favor of width/height
export type Scale = "s" | "m" | "l"; | ||
export type Status = "invalid" | "valid" | "idle"; | ||
export type Width = "auto" | "half" | "full"; | ||
export type Width = "s" | "m" | "l" | "auto" | "half" | "full"; |
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.
Could you do export type Width = Scale & "auto" | "half" | "full";
? Same for Height
above.
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 guess Height
would just be export type Height = Scale;
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.
On the second thought, I feel like it might make things a bit confusing to read. Height
, Width
, and Scale
are different props even though they have an overlap in type (with type Scale). s/m/l for scale does something else for width/height. Should they just have their own type names? It hurts my eyes to read type Height = Scale :)
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 suggested that purely for DRY reasons. Its really just a union type to keep from having to define "s" | "m" | "l"
in 3 different places.
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.
But yeah for type Height = Scale
, agree it does look weird, but it has more semantics at least. I'll let others chime in on it, curious to hear other opinions. @jcfranco
This PR has had test timeout issues on local machine and coupled with lumina migration it was cleaner to start a new branch deprecate: deprecate widthScale/heightScale in favor of width/height #10786 |
Related Issue: #6172
Summary
Refactor to consolidate
width/height
andwidthScale/heightScale
into a single propertywidth
withs / m / l / auto / full
as options, andheight
withs / m / l
. DeprecatewidthScale
andheightScale
properties and thehalf
value.