Skip to content

Commit ab650eb

Browse files
authored
Merge pull request #3048 from carbon-design-system/master
Merging master into next
2 parents cf939ce + d4adac4 commit ab650eb

File tree

9 files changed

+269
-181
lines changed

9 files changed

+269
-181
lines changed

package-lock.json

Lines changed: 54 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/input/input.directive.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,14 @@ export class TextInput {
5353
}
5454

5555
@HostBinding("class.cds--text-input--invalid") @Input() invalid = false;
56-
@HostBinding("class.cds--text-input__field-wrapper--warning") @Input() warn = false;
56+
@HostBinding("class.cds--text-input--warning") @Input() warn = false;
5757
@HostBinding("class.cds--skeleton") @Input() skeleton = false;
5858
@HostBinding("class.cds--text-input--light") get isLightTheme() {
5959
return this.theme === "light";
6060
}
61+
62+
@HostBinding("attr.data-invalid") get getInvalidAttribute() {
63+
return this.invalid ? true : undefined;
64+
}
65+
6166
}

src/input/input.stories.ts

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,36 @@ export default {
1010
imports: [InputModule]
1111
})
1212
],
13+
args: {
14+
disabled: false,
15+
invalid: false,
16+
invalidText: "Invalid entry",
17+
warn: false,
18+
warnText: "This is a warning!",
19+
label: "Text input label",
20+
helperText: "Optional helper text",
21+
placeholder: "Placeholder",
22+
autocomplete: "on",
23+
theme: "dark",
24+
size: "md",
25+
readonly: false,
26+
fluid: false,
27+
skeleton: false
28+
},
29+
argTypes: {
30+
autocomplete: {
31+
options: ["on", "off"],
32+
control: "radio"
33+
},
34+
theme: {
35+
options: ["light", "dark"],
36+
control: "radio"
37+
},
38+
size: {
39+
options: ["sm", "md", "lg"],
40+
control: "select"
41+
}
42+
},
1343
component: TextInputLabelComponent
1444
} as Meta;
1545

@@ -22,6 +52,8 @@ const Template = (args) => ({
2252
[invalidText]="invalidText"
2353
[warn]="warn"
2454
[disabled]="disabled"
55+
[fluid]="fluid"
56+
[skeleton]="skeleton"
2557
[warnText]="warnText">
2658
{{label}}
2759
<input
@@ -38,35 +70,11 @@ const Template = (args) => ({
3870
`
3971
});
4072
export const Basic = Template.bind({});
41-
Basic.args = {
42-
disabled: false,
43-
invalid: false,
44-
invalidText: "Invalid entry",
45-
warn: false,
46-
warnText: "This is a warning!",
47-
label: "Text input label",
48-
helperText: "Optional helper text",
49-
placeholder: "Placeholder",
50-
autocomplete: "on",
51-
theme: "dark",
52-
size: "md",
53-
readonly: false
54-
};
55-
Basic.argTypes = {
56-
autocomplete: {
57-
options: ["on", "off"],
58-
control: "radio"
59-
},
60-
theme: {
61-
options: ["light", "dark"],
62-
control: "radio"
63-
},
64-
size: {
65-
options: ["sm", "md", "lg"],
66-
control: "select"
67-
}
68-
};
6973

74+
export const Fluid = Template.bind({});
75+
Fluid.args = {
76+
fluid: true
77+
};
7078

7179
const SkeletonTemplate = (args) => ({
7280
props: args,

0 commit comments

Comments
 (0)