refactor: 💡 update scope form to use HDS input and textarea (#1459)
* refactor: 💡 update scope form to use HDS input and textarea * chore: 🤖 tweak "optional" label text color in dark mode * fix: 🐛 add HDS field margins and fix form tests * fix: 🐛 fix acceptance tests and add TextInput event handlers * fix: 🐛 use input event and fix set-from-event to handle empty * fix: 🐛 fix linting and add @type='text' on HDS text input * fix: 🐛 fix HDS field margin overrides * chore: 🤖 simplify selector
This commit is contained in:
1 parent
bdc36b1e59
commit
b08d3affe4
8 files changed
+39
-30
No files matched your search
@@ -5,7 +5,7 @@ export function setFromEvent([context, field]) {
|
||||
// The Ember `set` function is used here because `field` may be in dotted
|
||||
// notation, refering to nested fields within `context`.
|
||||
return (event) =>
|
||||
event?.target?.value ? set(context, field, event.target.value) : null;
|
||||
event?.target ? set(context, field, event.target.value) : null;
|
||||
}
|
||||
|
||||
export default helper(setFromEvent);
|
||||
@@ -1,2 +1,3 @@
|
||||
@import '@hashicorp/design-system-components';
|
||||
@import 'hds/themes/dark-mode';
|
||||
@import 'hds/overrides';
|
||||
@@ -0,0 +1,4 @@
|
||||
// field bottom margin (HDS leaves this to implementers)
|
||||
[class^='hds-form-field'] {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
@@ -79,6 +79,7 @@
|
||||
--token-form-control-base-border-color-default: var(
|
||||
--token-color-palette-neutral-200
|
||||
);
|
||||
--token-form-indicator-optional-color: var(--token-color-palette-neutral-200);
|
||||
}
|
||||
|
||||
// HDS Light Mode
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
// This styles are add to stop the input to apply extra margin (default on forms)
|
||||
.rose-form-input,
|
||||
.rose-form-input-field,
|
||||
.hds-form-select,
|
||||
[class^='hds-form-field-'] .hds-form-select:not(:first-child) {
|
||||
[class^='hds-form-field'],
|
||||
[class^='hds-form-field']:not(:first-child) {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user