Skip to content
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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
c533b38
refactor: consolidate width and widthScale into one width prop
Elijbet Sep 1, 2024
448af21
provide new property in the css, extract auto and full from interface
Elijbet Sep 1, 2024
72f1008
deprecate heightScale, define new height prop in the interface
Elijbet Sep 1, 2024
434ac8d
half to be deprecated
Elijbet Sep 4, 2024
d3fe676
remove unnecessary values from Height interface
Elijbet Sep 4, 2024
197f852
Doc for deprecated value
Elijbet Sep 4, 2024
e0bcfc9
cleanup accidental add
Elijbet Sep 7, 2024
bfa503a
remove default value
Elijbet Sep 8, 2024
880bb92
remove default from dropdown
Elijbet Sep 8, 2024
435ce0d
WIP
Elijbet Sep 8, 2024
4b33315
dialog width takes precedence over widthScale if both are defined
Elijbet Sep 20, 2024
0e83ac0
typo
Elijbet Sep 20, 2024
23848e3
simplify selectors'
Elijbet Sep 20, 2024
8515421
WIP and add test for deprecated widthScale
Elijbet Sep 20, 2024
ceec250
WIP and dropdown tests, width priority of width-scale
Elijbet Sep 21, 2024
fe85cbe
cleanup and modal tests
Elijbet Sep 21, 2024
2e78022
sheet scss and test
Elijbet Sep 21, 2024
371babb
shell-panel prop precedence and tests
Elijbet Sep 21, 2024
7296c37
modify test to get the className
Elijbet Sep 21, 2024
d9e5146
extract dynamicCSSConst util
Elijbet Sep 25, 2024
472d15e
typo
Elijbet Sep 25, 2024
e43eafd
merge conflicts
Elijbet Oct 8, 2024
c82417f
apply container and height to shell-center-row
Elijbet Oct 8, 2024
0c83c5b
detached height
Elijbet Oct 8, 2024
697cb89
cleanup
Elijbet Oct 8, 2024
7f22fda
adjust tests to account for added container div instead of fragment
Elijbet Oct 9, 2024
49440fc
merge conflicts
Elijbet Oct 9, 2024
f7016a7
adjust test to the new changes
Elijbet Oct 11, 2024
64522f2
remove deprecation e2e test, adjust expected pixel values for style w…
Elijbet Oct 11, 2024
938e2d7
remove deprecation tests
Elijbet Oct 11, 2024
04f4c4a
remove deprecation tests
Elijbet Oct 11, 2024
1da70bf
merge dev
Elijbet Oct 31, 2024
b8efa8b
cleanup
Elijbet Oct 31, 2024
4321c43
consolidate dynamicClasses const getHeight and getWidth inot getDimen…
Elijbet Oct 31, 2024
347c4ed
add spec test for dynamicClasses to systematically check all valid pe…
Elijbet Oct 31, 2024
8f6209a
use describe block instead of it, to keep it blocks on the same level…
Elijbet Oct 31, 2024
7441e50
typo
Elijbet Oct 31, 2024
7cfdb9d
template literal types
Elijbet Oct 31, 2024
919acb2
use existing interface types
Elijbet Oct 31, 2024
9bf32d5
refactor
Elijbet Nov 1, 2024
36d302c
imports
Elijbet Nov 1, 2024
a6be544
imports
Elijbet Nov 1, 2024
619e739
merge dev
Elijbet Nov 1, 2024
a0899f7
remove new defaults to revert screenshot diffs
Elijbet Nov 8, 2024
e578ab8
remove default value in e2e for dropdown
Elijbet Nov 8, 2024
9fa539d
revert test adjustment
Elijbet Nov 8, 2024
5f2ddba
use vh vs % on container, cleanup
Elijbet Nov 12, 2024
61b3395
tidy up
Elijbet Nov 12, 2024
fba447f
return a valid key from util
Elijbet Nov 13, 2024
754f24d
merge dev
Elijbet Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/calcite-components/.stylelintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const customFunctions = [
"medium-modular-scale",
"modular-scale",
"scale-duration",
"small-modular-scale",
"small-modular-scale"
];
// ⚠️ END OF AUTO-GENERATED CODE

Expand Down
128 changes: 104 additions & 24 deletions packages/calcite-components/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* It contains typing information for all components that exist in this project.
*/
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
import { Alignment, Appearance, CollapseDirection, FlipContext, IconType, InteractionMode, Kind, Layout, LogicalFlowPosition, Position, Scale, SelectionAppearance as SelectionAppearance1, SelectionMode, Status, Width } from "./components/interfaces";
import { Alignment, Appearance, CollapseDirection, FlipContext, Height, IconType, InteractionMode, Kind, Layout, LogicalFlowPosition, Position, Scale, SelectionAppearance as SelectionAppearance1, SelectionMode, Status, Width } from "./components/interfaces";
import { RequestedItem } from "./components/accordion/interfaces";
import { IconNameOrString } from "./components/icon/interfaces";
import { RequestedItem as RequestedItem1 } from "./components/accordion-item/interfaces";
Expand Down Expand Up @@ -98,7 +98,7 @@ import { TileSelectGroupLayout } from "./components/tile-select-group/interfaces
import { TipMessages } from "./components/tip/assets/tip/t9n";
import { TipManagerMessages } from "./components/tip-manager/assets/tip-manager/t9n";
import { TreeItemSelectDetail } from "./components/tree-item/interfaces";
export { Alignment, Appearance, CollapseDirection, FlipContext, IconType, InteractionMode, Kind, Layout, LogicalFlowPosition, Position, Scale, SelectionAppearance as SelectionAppearance1, SelectionMode, Status, Width } from "./components/interfaces";
export { Alignment, Appearance, CollapseDirection, FlipContext, Height, IconType, InteractionMode, Kind, Layout, LogicalFlowPosition, Position, Scale, SelectionAppearance as SelectionAppearance1, SelectionMode, Status, Width } from "./components/interfaces";
export { RequestedItem } from "./components/accordion/interfaces";
export { IconNameOrString } from "./components/icon/interfaces";
export { RequestedItem as RequestedItem1 } from "./components/accordion-item/interfaces";
Expand Down Expand Up @@ -833,9 +833,9 @@ export namespace Components {
*/
"type": string;
/**
* Specifies the width of the component.
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*/
"width": Width;
"width": Extract<"auto" | "full", Width>;
}
interface CalciteCard {
/**
Expand Down Expand Up @@ -1839,6 +1839,11 @@ export namespace Components {
/**
* Specifies the width of the component.
*/
"width": Extract<"s" | "m" | "l", Width>;
/**
* Specifies the width of the component.
* @deprecated Use the `width` property instead.
*/
"widthScale": Scale;
}
interface CalciteDropdown {
Expand Down Expand Up @@ -1896,6 +1901,11 @@ export namespace Components {
/**
* Specifies the width of the component.
*/
"width": Extract<"s" | "m" | "l", Width>;
/**
* Specifies the width of the component.
* @deprecated Use the `width` property instead.
*/
"widthScale": Scale;
}
interface CalciteDropdownGroup {
Expand Down Expand Up @@ -3689,6 +3699,11 @@ export namespace Components {
/**
* Specifies the width of the component.
*/
"width": Extract<"s" | "m" | "l", Width>;
/**
* Specifies the width of the component.
* @deprecated Use the `width` property instead.
*/
"widthScale": Scale;
}
interface CalciteNavigation {
Expand Down Expand Up @@ -3838,9 +3853,9 @@ export namespace Components {
*/
"setFocus": () => Promise<void>;
/**
* Specifies the width of the component.
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*/
"width": Width;
"width": Extract<"auto" | "full", Width>;
}
interface CalciteOption {
/**
Expand Down Expand Up @@ -4362,7 +4377,7 @@ export namespace Components {
*/
"value": string;
/**
* Specifies the width of the component.
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*/
"width": Extract<"auto" | "full", Width>;
}
Expand Down Expand Up @@ -4457,9 +4472,9 @@ export namespace Components {
*/
"value": string;
/**
* Specifies the width of the component.
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*/
"width": Width;
"width": Extract<"auto" | "full", Width>;
}
interface CalciteSheet {
/**
Expand All @@ -4483,8 +4498,13 @@ export namespace Components {
* When `true`, prevents focus trapping.
*/
"focusTrapDisabled": boolean;
/**
* Specifies the height of the component.
*/
"height": Height;
/**
* When `position` is `"block-start"` or `"block-end"`, specifies the height of the component.
* @deprecated Use the `height` property instead.
*/
"heightScale": Scale;
/**
Expand Down Expand Up @@ -4515,8 +4535,13 @@ export namespace Components {
* Updates the element(s) that are used within the focus-trap of the component.
*/
"updateFocusTrapElements": () => Promise<void>;
/**
* Specifies the width of the component.
*/
"width": Extract<"s" | "m" | "l", Width>;
/**
* When `position` is `"inline-start"` or `"inline-end"`, specifies the width of the component.
* @deprecated Use the `width` property instead.
*/
"widthScale": Scale;
}
Expand All @@ -4534,8 +4559,13 @@ export namespace Components {
* When `true`, the content area displays like a floating panel.
*/
"detached": boolean;
/**
* Specifies the height of the component.
*/
"height": Height;
/**
* Specifies the maximum height of the component.
* @deprecated Use the `height` property instead.
*/
"heightScale": Scale;
/**
Expand All @@ -4555,15 +4585,20 @@ export namespace Components {
"detached": boolean;
/**
* When `displayMode` is `float-content` or `float`, specifies the maximum height of the component.
* @deprecated Use `heightScale` instead.
* @deprecated Use the `height` property instead.
*/
"detachedHeightScale": Scale;
/**
* Specifies the display mode of the component, where: `"dock"` displays at full height adjacent to center content, `"overlay"` displays at full height on top of center content, and `"float"` [Deprecated] does not display at full height with content separately detached from `calcite-action-bar` on top of center content. `"float-content"` does not display at full height with content separately detached from `calcite-action-bar` on top of center content. `"float-all"` detaches the `calcite-panel` and `calcite-action-bar` on top of center content.
*/
"displayMode": DisplayMode1;
/**
* Specifies the height of the component.
*/
"height": Height;
/**
* When `layout` is `horizontal`, specifies the maximum height of the component.
* @deprecated Use the `height` property instead.
*/
"heightScale": Scale;
/**
Expand All @@ -4586,8 +4621,13 @@ export namespace Components {
* When `true` and `displayMode` is not `float-content` or `float`, the component's content area is resizable.
*/
"resizable": boolean;
/**
* Specifies the width of the component.
*/
"width": Extract<"s" | "m" | "l", Width>;
/**
* When `layout` is `vertical`, specifies the width of the component.
* @deprecated Use the `width` property instead.
*/
"widthScale": Scale;
}
Expand Down Expand Up @@ -4900,9 +4940,9 @@ export namespace Components {
*/
"setFocus": () => Promise<void>;
/**
* Specifies the width of the component.
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*/
"width": Width;
"width": Extract<"auto" | "full", Width>;
}
interface CalciteStack {
/**
Expand Down Expand Up @@ -5668,7 +5708,7 @@ export namespace Components {
*/
"value": any;
/**
* Specifies the width of the component.
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*/
"width": Extract<"auto" | "full", Width>;
}
Expand Down Expand Up @@ -8658,9 +8698,9 @@ declare namespace LocalJSX {
*/
"type"?: string;
/**
* Specifies the width of the component.
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*/
"width"?: Width;
"width"?: Extract<"auto" | "full", Width>;
}
interface CalciteCard {
/**
Expand Down Expand Up @@ -9750,6 +9790,11 @@ declare namespace LocalJSX {
/**
* Specifies the width of the component.
*/
"width"?: Extract<"s" | "m" | "l", Width>;
/**
* Specifies the width of the component.
* @deprecated Use the `width` property instead.
*/
"widthScale"?: Scale;
}
interface CalciteDropdown {
Expand Down Expand Up @@ -9818,6 +9863,11 @@ declare namespace LocalJSX {
/**
* Specifies the width of the component.
*/
"width"?: Extract<"s" | "m" | "l", Width>;
/**
* Specifies the width of the component.
* @deprecated Use the `width` property instead.
*/
"widthScale"?: Scale;
}
interface CalciteDropdownGroup {
Expand Down Expand Up @@ -11715,6 +11765,11 @@ declare namespace LocalJSX {
/**
* Specifies the width of the component.
*/
"width"?: Extract<"s" | "m" | "l", Width>;
/**
* Specifies the width of the component.
* @deprecated Use the `width` property instead.
*/
"widthScale"?: Scale;
}
interface CalciteNavigation {
Expand Down Expand Up @@ -11868,9 +11923,9 @@ declare namespace LocalJSX {
*/
"scale"?: Scale;
/**
* Specifies the width of the component.
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*/
"width"?: Width;
"width"?: Extract<"auto" | "full", Width>;
}
interface CalciteOption {
/**
Expand Down Expand Up @@ -12396,7 +12451,7 @@ declare namespace LocalJSX {
*/
"value"?: string;
/**
* Specifies the width of the component.
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*/
"width"?: Extract<"auto" | "full", Width>;
}
Expand Down Expand Up @@ -12495,9 +12550,9 @@ declare namespace LocalJSX {
*/
"value"?: string;
/**
* Specifies the width of the component.
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*/
"width"?: Width;
"width"?: Extract<"auto" | "full", Width>;
}
interface CalciteSheet {
/**
Expand All @@ -12521,8 +12576,13 @@ declare namespace LocalJSX {
* When `true`, prevents focus trapping.
*/
"focusTrapDisabled"?: boolean;
/**
* Specifies the height of the component.
*/
"height"?: Height;
/**
* When `position` is `"block-start"` or `"block-end"`, specifies the height of the component.
* @deprecated Use the `height` property instead.
*/
"heightScale"?: Scale;
/**
Expand Down Expand Up @@ -12561,8 +12621,13 @@ declare namespace LocalJSX {
* Determines where the component will be positioned.
*/
"position"?: LogicalFlowPosition;
/**
* Specifies the width of the component.
*/
"width"?: Extract<"s" | "m" | "l", Width>;
/**
* When `position` is `"inline-start"` or `"inline-end"`, specifies the width of the component.
* @deprecated Use the `width` property instead.
*/
"widthScale"?: Scale;
}
Expand All @@ -12580,8 +12645,13 @@ declare namespace LocalJSX {
* When `true`, the content area displays like a floating panel.
*/
"detached"?: boolean;
/**
* Specifies the height of the component.
*/
"height"?: Height;
/**
* Specifies the maximum height of the component.
* @deprecated Use the `height` property instead.
*/
"heightScale"?: Scale;
/**
Expand All @@ -12601,15 +12671,20 @@ declare namespace LocalJSX {
"detached"?: boolean;
/**
* When `displayMode` is `float-content` or `float`, specifies the maximum height of the component.
* @deprecated Use `heightScale` instead.
* @deprecated Use the `height` property instead.
*/
"detachedHeightScale"?: Scale;
/**
* Specifies the display mode of the component, where: `"dock"` displays at full height adjacent to center content, `"overlay"` displays at full height on top of center content, and `"float"` [Deprecated] does not display at full height with content separately detached from `calcite-action-bar` on top of center content. `"float-content"` does not display at full height with content separately detached from `calcite-action-bar` on top of center content. `"float-all"` detaches the `calcite-panel` and `calcite-action-bar` on top of center content.
*/
"displayMode"?: DisplayMode1;
/**
* Specifies the height of the component.
*/
"height"?: Height;
/**
* When `layout` is `horizontal`, specifies the maximum height of the component.
* @deprecated Use the `height` property instead.
*/
"heightScale"?: Scale;
/**
Expand All @@ -12634,8 +12709,13 @@ declare namespace LocalJSX {
* When `true` and `displayMode` is not `float-content` or `float`, the component's content area is resizable.
*/
"resizable"?: boolean;
/**
* Specifies the width of the component.
*/
"width"?: Extract<"s" | "m" | "l", Width>;
/**
* When `layout` is `vertical`, specifies the width of the component.
* @deprecated Use the `width` property instead.
*/
"widthScale"?: Scale;
}
Expand Down Expand Up @@ -12980,9 +13060,9 @@ declare namespace LocalJSX {
*/
"scale"?: Scale;
/**
* Specifies the width of the component.
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*/
"width"?: Width;
"width"?: Extract<"auto" | "full", Width>;
}
interface CalciteStack {
/**
Expand Down Expand Up @@ -13760,7 +13840,7 @@ declare namespace LocalJSX {
*/
"value"?: any;
/**
* Specifies the width of the component.
* Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead.
*/
"width"?: Extract<"auto" | "full", Width>;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/calcite-components/src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ export class Button
*/
@Prop({ reflect: true }) type = "button";

/** Specifies the width of the component. */
@Prop({ reflect: true }) width: Width = "auto";
/** Specifies the width of the component. [Deprecated] The `"half"` value is deprecated, use `"full"` instead. */
@Prop({ reflect: true }) width: Extract<"auto" | "full", Width> = "auto";

/**
* Made into a prop for testing purposes only
Expand Down
Loading
Loading