1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-25 12:15:18 +01:00

[CL-113] add readonly styles to bitInput (#6220)

* add readonly styles and story

* only add style to input & textarea
This commit is contained in:
Will Martin 2023-09-21 10:23:20 -04:00 committed by GitHub
parent 5b69d52f02
commit 02af0fed4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -157,6 +157,24 @@ export const Disabled: Story = {
args: {}, args: {},
}; };
export const Readonly: Story = {
render: (args) => ({
props: args,
template: `
<bit-form-field>
<bit-label>Input</bit-label>
<input bitInput value="Foobar" readonly />
</bit-form-field>
<bit-form-field>
<bit-label>Textarea</bit-label>
<textarea bitInput rows="4" readonly>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</textarea>
</bit-form-field>
`,
}),
args: {},
};
export const InputGroup: Story = { export const InputGroup: Story = {
render: (args) => ({ render: (args) => ({
props: args, props: args,

View File

@ -44,6 +44,7 @@ export class BitInputDirective implements BitFormFieldControl {
"focus:tw-ring-primary-700", "focus:tw-ring-primary-700",
"focus:tw-z-10", "focus:tw-z-10",
"disabled:tw-bg-secondary-100", "disabled:tw-bg-secondary-100",
"[&:is(input,textarea):read-only]:tw-bg-secondary-100",
].filter((s) => s != ""); ].filter((s) => s != "");
} }