Skip to content

feat(label): deprecate status prop #3984

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

Merged
merged 35 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9fabc75
fix(label, input, input-message)!: deprecate and no longer support st…
Jan 21, 2022
a771d5c
alter tests for status being passed in calcite label
Jan 21, 2022
37716bd
update the readme for labels using status and add status prop to inpu…
Jan 22, 2022
a2738e4
add deprecated comment for status prop
Jan 24, 2022
e59ccc7
refactor(panel, shell, tree-item): Add keys to conditionally rendered…
driskull Jan 20, 2022
fd14009
feat(panel): Add method to scroll content. #3924 (#3960)
driskull Jan 20, 2022
a9d4750
ci(screener): updating to Chrome 97 (#3940)
eriklharper Jan 20, 2022
dae25ab
1.0.0-next.373
github-actions[bot] Jan 20, 2022
32bbf5f
docs: update component READMEs (#3972)
benelan Jan 21, 2022
b26160c
ci(screener): enlarging screen resolution (#3977)
eriklharper Jan 21, 2022
6908cfe
refactor(input): fix all types that are any (#3981)
benelan Jan 21, 2022
1842265
refactor: Update relevant components to handle slotting after init (#…
driskull Jan 22, 2022
4d7540b
refactor(slider): remove drag event listeners on component disconnect…
anveshmekala Jan 22, 2022
364f623
build: update browserslist db (#3985)
benelan Jan 24, 2022
c18cdac
test(input): when both 'ArrowUp' and 'ArrowDown' are pressed at the s…
Elijbet Jan 24, 2022
9c64cb1
Merge branch 'master' of github.com:Esri/calcite-components into y0n4…
Jan 24, 2022
fe1dc20
alter verbiage of deprecated prop
Jan 24, 2022
0021719
Merge branch 'master' of github.com:Esri/calcite-components into y0n4…
Jan 24, 2022
29e4af8
Merge branch 'master' of github.com:Esri/calcite-components into y0n4…
Jan 25, 2022
6456cae
Merge branch 'master' of github.com:Esri/calcite-components into y0n…
Jan 26, 2022
c2b3327
ci(screener): restoring pre-Sauce integration settings (#3994)
eriklharper Jan 24, 2022
34f9f4b
docs(template): provide context for the repro samples (#3970)
benelan Jan 24, 2022
57a556b
chore: pin node 16 and npm 8 for volta (#3964)
benelan Jan 24, 2022
479a155
docs(readme): remove sketch info until it is up to date (#3996)
benelan Jan 24, 2022
73d50ae
fix(date-picker): update utils locale to get the lang code if regiona…
Jan 25, 2022
c719371
1.0.0-next.374
github-actions[bot] Jan 25, 2022
ac039d8
ci: allow primary and secondary contacts to merge on all prs (#3999)
benelan Jan 25, 2022
c43f01b
fix(date-picker, input-date-picker): update pt-BR and pt-PT localizat…
jcfranco Jan 25, 2022
a4efa6b
feat(tree): multi-selection no longer requires holding shift key (#3…
anveshmekala Jan 25, 2022
1cc7b2d
1.0.0-next.375
github-actions[bot] Jan 25, 2022
fbff2f3
test(dropdown): correct logical errors in the test (#3998)
Elijbet Jan 26, 2022
f4b80ec
deprecate and restore the use of status prop
Jan 27, 2022
f9626ae
Merge branch 'y0n4/3755-input-status' of github.com:Esri/calcite-comp…
Jan 27, 2022
55563bb
restore reading status prop from label
Jan 27, 2022
cb8e3d9
Merge branch 'master' of github.com:Esri/calcite-components into y0n4…
Jan 27, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ describe("calcite-input-message", () => {
</calcite-label>
`);

const element = await page.find("calcite-input-message");
expect(element).toEqualAttribute("status", "invalid");
const deprecatedLabelStatusElement = await page.find("calcite-input-message");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

expect(deprecatedLabelStatusElement).toEqualAttribute("status", "invalid");
});

it("does not render an icon if not requested", async () => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/calcite-input-message/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Displays a contextual message to a user. Allows the passing of content, links, e
### Basic

```html
<calcite-label status="“invalid”">
<calcite-label>
My great label
<calcite-input placeholder="“Enter" your information”></calcite-input>
<calcite-input-message active
<calcite-input placeholder="“Enter" your information” status="invalid"></calcite-input>
<calcite-input-message active status="invalid"
>That's not going to work out.
<calcite-button appearance="inline" href="">Learn more</calcite-button></calcite-input-message
>
Expand Down
6 changes: 3 additions & 3 deletions src/components/calcite-input/calcite-input.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ describe("calcite-input", () => {
</calcite-label>
`);

const element = await page.find("calcite-input");
expect(await element.getProperty("status")).toEqual("invalid");
expect(await element.getProperty("scale")).toEqual("s");
const deprecatedLabelStatusElement = await page.find("calcite-input");
expect(await deprecatedLabelStatusElement.getProperty("status")).toEqual("invalid");
expect(await deprecatedLabelStatusElement.getProperty("scale")).toEqual("s");
});

it("renders an icon when explicit Calcite UI is requested, and is a type without a default icon", async () => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/calcite-input/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ function logChange() {
Using a wrapping `calcite-label` component lets consumers set the status attribute once and have it propagate to child `calcite-input` and `calcite-input-message` elements

```html
<calcite-label status="invalid" for="invalid-input">
<calcite-label for="invalid-input">
Invalid input
<calcite-input id="invalid-input" placeholder="Filter your files" value="adfo2h2"></calcite-input>
<calcite-input-message active icon> Something doesn't look right </calcite-input-message>
<calcite-input id="invalid-input" placeholder="Filter your files" status="invalid" value="adfo2h2"></calcite-input>
<calcite-input-message active icon status="invalid"> Something doesn't look right </calcite-input-message>
</calcite-label>
```

Expand Down
6 changes: 2 additions & 4 deletions src/components/calcite-label/calcite-label.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ describe("calcite-label", () => {
it("renders requested props when valid props are provided", async () => {
const page = await newE2EPage();
await page.setContent(`
<calcite-label status="invalid" layout="inline-space-between">
<calcite-label layout="inline-space-between">
Label text
<calcite-input></calcite-input>
</calcite-label>
`);

const element = await page.find("calcite-label");
expect(element).toEqualAttribute("status", "invalid");
expect(element).toEqualAttribute("layout", "inline-space-between");
});

Expand Down Expand Up @@ -128,7 +127,7 @@ describe("calcite-label", () => {
it("does not pass id to child label element", async () => {
const page = await newE2EPage();
await page.setContent(`
<calcite-label id="dont-duplicate-me" status="invalid" layout="inline-space-between">
<calcite-label id="dont-duplicate-me" layout="inline-space-between">
Label text
<calcite-input></calcite-input>
</calcite-label>
Expand All @@ -138,7 +137,6 @@ describe("calcite-label", () => {
const childElement = await page.find("calcite-label >>> .container");
expect(element).toEqualAttribute("id", "dont-duplicate-me");
expect(childElement).not.toHaveAttribute("id");
expect(element).toEqualAttribute("status", "invalid");
expect(element).toEqualAttribute("layout", "inline-space-between");
});

Expand Down
5 changes: 4 additions & 1 deletion src/components/calcite-label/calcite-label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export class CalciteLabel {
/** specify the text alignment of the label */
@Prop({ reflect: true }) alignment: Alignment = "start";

/** specify the status of the label and any child input / input messages */
/**
* specify the status of the label and any child input / input messages
* @deprecated set directly on child element instead
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+@benelan for editorial glance. 👀

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for changing it Yona!

Copy link
Member

@benelan benelan Jan 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the prop description is kinda confusing to me (I'll do an audit at some point before v1) but that was already there lol. The new deprecation notice is 👨‍🍳 👌

*/
@Prop({ reflect: true }) status: Status = "idle";

/** The id of the input associated with the label */
Expand Down
8 changes: 3 additions & 5 deletions src/components/calcite-label/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ Renders a `<label>` around its children and can be used with any [labelable nati

### Basic

It also allows consumers to set a `status` attribute for child `calcite-input` and `calcite-input-message` components to use to set their own properties.

```html
<calcite-label status="invalid">
<calcite-label>
Invalid input
<calcite-input type="search" placeholder="Filter your files" value="adfo2h2"></calcite-input>
<calcite-input-message active icon> Something doesn't look right </calcite-input-message>
<calcite-input type="search" placeholder="Filter your files" value="adfo2h2" status="invalid"></calcite-input>
<calcite-input-message active icon status="invalid"> Something doesn't look right </calcite-input-message>
</calcite-label>
```

Expand Down