* Revert "Revert "Add (updated) mention autocomplete to post comments (#13061)" (#13116)"
This reverts commit e28bde043c.
* Fix issues with editing comments and arrow key navigation, update tests
* Update app/javascript/crayons/MentionAutocompleteTextArea/MentionAutocompleteTextArea.jsx
Co-authored-by: Nick Taylor <nick@forem.com>
* refactor adding of attributes
* destructure
Co-authored-by: Nick Taylor <nick@forem.com>
* add mention autocomplete functionality to article and notification comments
* add cypress tests
* make sure entry transitions dont replay
* undo change to async useeffect covered in other pr
* move search into dynamic import
* exit search if enter pressed in middle of search term
* refactor button activation code
* add a space after a mention is selected
* tweak cypress test for reply to ensure it awaits combobox
* small refactor
* initial setup of component
* initial styles applied
* add some initial docs
* small tweaks to story
* add some very initial tests
* tweaks to styles to add border bottom
* add some preact tests
* import default style in jsx, ignore in jest
* WIP - create MentionAutocompleteListener, attempt to position popover
* position dropdown correctly, exit selection in various scenarios
* refactor
* make sure cursor placed correctly after selection
* only import autocomplete when needed
* rename files, add jsdoc
* update tests and story notes
* tidy up scss file
* fix story styling
* fix aria label in story
* fix issue with key event not triggering in mobile
* position dropdown at input left if small screen
* fix issue with deleting and re-entering
* don't trigger search if directly following a letter or number
* stop change event being fired with highihted text
* move regex out of function into constant
* adds focusTrap wrapper to preact Modal component
* add view specific code for focus trap in admin add nav link
* add script to return a focustrap toggle, use in add nav link modal partial
* add trap to edit nav link modal
* add handlers for sign up modal
* update modal controller for admin section, update nav link modals to use
* update other admin modals with new data values for trap
* remove unneeded erb script file
* remove unneeded target
* refactor to remove extra unneeded param
* remove duplicate code, store getFocusTrapToggle in window
* trap focus in comment and bookmark showModal instances for not logged in user
* remove need for activator id
* clean up id refs no longer needed
* remove custom code and re-use focsu-trap lib
* update storybook docs
* update default export in focusTrap
* prevent close button click triggering a modal toggle twice
* ensure if user navigates from a modal the trap is deactivated
* add jsdoc comments and add dynamic import
* ensure admin controller modal traps are cleaned up on disconnect
* update sign up modal to use crayons
* update modal controller and admin nav links modals to use preact modal
* update profile fields modals for new controller
* tweak styling of sign up and admin modals to match previous
* update listings modal to use crayons modal, adapt focus trap to work with click outside
* memoize deactivate callback to ensure modal can be presented on first page load
* add missed focustrap changes
* fix focus trap issues in onboarding flow
* refactor onboarding focus trap, remove getFocusTrapToggle
* tweaks for styling and article modal toggle
* add click outside tests to modal
* add cypress tests for the login modal
* update liquid tag tests affected by change
* refactors to address review comments
* fix issue with login modal presented twice on comment add
* change ids to selectors in admin modals
* small pr comment refactors
* add listings e2e tests
* add nav link modal tests
* fix issue with help modal
* tweak to fix ui bug from merge
* remove context from showLoginModal
* rename toggleModal
* rename state property for clarity
Co-authored-by: Nick Taylor <nick@dev.to>
* allow keyboard access to dropdown stories
* add accessibility notes to dropdown stories
* manage focus in html example
* Update reference to aria attributes in notes
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
* add focus style to link for keyboard users
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
* flare tag line height
* .
* dropdown fix + actions bar fix
* actions bar on mob
* fixing typography and improving font handling
* cleanup
* variables naming
* fonts swapping
* Makes user's default font render as SiteConfig.default_font
* Trigger checks
* Fixes missing user model specs
* Fixes storybook CI error import & logged out user font set with default
* Limits default_font config to serif, sans-serif & open-dyslexic
* Default font description text
Co-authored-by: Fernando Valverde <fdov88@gmail.com>
* Added story sorting to Storybook.
* Added design system guidelines.
* Made Base in Storybook tree 2nd in the tree view.
* Now Components are 3rd in the treeview of Storybook.
* Now App Components are 4th in the treeview of Storybook.
* Froze node version to 12.16.0
* Revert "Froze node version to 12.16.0"
This reverts commit 093b119c7d7ca05ecb4e1c0234b24bcf8e7b10a4.
* wip
* no comment
* tests
* typo
* typo
* crayons example page
* doc
* boxes fix
* fix
* Update index.html.erb
* Small refactor to return null when the modal is not visible.
* Update app/assets/stylesheets/components/modals.scss
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* tiny fixes & improvements
Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
* wip <Button > component.
* wip button components.
* Fixed issue when icon does not exist.
* Removed subfolder JSX for Preact components in Storybook sidebar.
* Touched up some Storybook stories.
* Now <Button /> component supports a or button for HTML.
* Now the <Button /> component supports the disabled prop
* A nice little refactor.
* Added onClick, onMouseOver, onMouseOut, onFocus and onBlur events to the <Button /> component.
* Set the cursor to default when a <Button /> component is disabled.
* Added tests for <Button /> component.
* Added tests for <SecondaryButton />, <OutlineButton /> and <DangerButton />.
* Updated disabled cursor.
* Removed link href when button is disabled and is an <a />.
* Added the icon alone option for the <Button /> component.
* Now active and hover states are disabled for <Button /> when an HTML button is rendered.
* Now the disabled <Button /> component deactivates hover/active states properly.
* Removed global button hover styling as per @ludwiczakpawel's request.
* Renamed the as prop to tagName.
* Removed components that were wrapping different variants.
* Created barrel files so we can import directly from @crayons.
* Added stories for Dropdown for JSX.
* Tweaked Dropdown Storybook stories.
* Tweaked <Dropdown /> component.
* Added module mapping to jest for @crayons.
* Added tests for <Dropdown /> component.
* Removed Storybook custom decorator that is no longer required.
* Renamed designSystem to crayons.
* Restructured how Storybook stories are laid out in Storybook's sidebar.
* wip
* More folder restructuring for Storybook sidebar.
* Fixed Dropdown description story.
* There no longer is a Dropdown for no padding. Just add additional utility classes.
* Showing dropdowns by default in Storybook as they are hidden by default.