Skip to content

Commit

Permalink
Fix/input groups (#28)
Browse files Browse the repository at this point in the history
* chore: update package lock file

* chore: move inputs that do not have attached controls or buttons together

* chore: move input group css and remove unneeded css

* chore: move text input files

* fix: removed and combined stories, deleted mixin, fixed numeric switch input and css cleanup

* fix: add attributes and control descriptions, change hashed field to obfuscated field

* chore: add disabled, required, and readonly attribute controls

* chore: remove phone number css until dropdown patterns are refactored

* fix: add readonly parameter to stories and empty doc markdown file

* chore: add inputName for search field story

* fix: add aria attributes, remove resize property from textarea css and removed disabled cursor property from css

* fix: error from using 'class' instead of 'className' in MDX

* fix: move aria-label for obfuscated field to js
  • Loading branch information
dannyk3941 authored May 5, 2023
1 parent a030584 commit a6835a1
Show file tree
Hide file tree
Showing 36 changed files with 606 additions and 809 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 0 additions & 36 deletions packages/styles/src/components/form/buttonTagTextField.stories.js

This file was deleted.

22 changes: 0 additions & 22 deletions packages/styles/src/components/form/buttonTextField.stories.js

This file was deleted.

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions packages/styles/src/components/form/hashed-field/hashedField.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions packages/styles/src/components/form/numericField.stories.js

This file was deleted.

19 changes: 0 additions & 19 deletions packages/styles/src/components/form/phoneNumberField.stories.js

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions packages/styles/src/components/form/textAreaField.stories.js

This file was deleted.

19 changes: 0 additions & 19 deletions packages/styles/src/components/form/textField.stories.js

This file was deleted.

27 changes: 27 additions & 0 deletions packages/styles/src/components/text-input/inputs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Text Fields

## Purpose


## Functional Requirements


## Technical Specifications


### User Interactions


### Responsiveness

* TBD

### Accessibility

* `aria-required`
* `aria-readonly`
* `aria-invalid`
* `aria-hidden` (Error Message?)
* `aria-errormessage` (Error Message?)

### Usage Notes and Additional Considerations
31 changes: 31 additions & 0 deletions packages/styles/src/components/text-input/obfuscatedField.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
class ObfuscatedField {
constructor(component) {
this.input = component;
this.btn = component.nextElementSibling;

if (this.btn) {
this.btn.setAttribute('aria-pressed', false);
this.btn.setAttribute('aria-label', 'show entry');
}

this.addListener(this.btn, this.input);
}

addListener(btn, input) {
btn.addEventListener('click', (e) => {
if (input.type === 'password') {
input.type = 'text';
btn.setAttribute('aria-pressed', true);
btn.setAttribute('aria-label', 'hide entry');
btn.firstElementChild.className = 'fas fa-eye';
} else {
input.type = 'password';
btn.setAttribute('aria-pressed', false);
btn.setAttribute('aria-label', 'show entry');
btn.firstElementChild.className = 'fas fa-eye-slash';
}
});
}
}

export default ObfuscatedField;
Loading

0 comments on commit a6835a1

Please sign in to comment.