Commit Graph

841 Commits

Author SHA1 Message Date
Mark Otto 9691b474bb Fix some JS todos and warnings (#41998)
* Fix some JS todos and warnings

* Undo some
2026-01-08 20:14:09 -08:00
Mark Otto b0c0ff3e25 New Datepicker plugin via Vanilla Calendar Pro, new `.form-adorn` component (#41965)
* First pass at datepicker via Vanilla Calendar Pro

* fixes

* optimize

* Docs updates, add advanced config

* rename attr

* edits

* Update datepicker docs, improve color modes, add tests

* New .form-adorn component for overlaying icons and text with inputs

* temp

* bump limits

* cleanup and simpler selectors

* few more tweaks

* Remove comment

* Fix multi-month, reorg some docs content, fix selections
2026-01-08 20:14:09 -08:00
Mark Otto 35dc869220 Add tests for new form components 2026-01-08 20:14:09 -08:00
Mark Otto 9c32c543a3 New OTP input (#41981)
* feat: add OTP input component

- Add OtpInput JavaScript component with keyboard navigation and paste support
- Add SCSS styles for OTP input fields
- Add documentation page for OTP input
- Add unit tests for OTP input

* Bump bundlewatch

* Missed file
2026-01-08 20:14:09 -08:00
Mark Otto 25f33a86d5 Password strength plugin (#41980)
* feat: add password strength component

- Add Strength JavaScript component with customizable scoring
- Add SCSS styles for strength meter and bar variants
- Add documentation page for password strength
- Add unit tests for strength component

* Bundle bump

* More bundle
2026-01-08 20:14:09 -08:00
Mark Otto 8c66e3b814 New Toggler plugin (#41966)
* Toggler compontent from upstrea PR

* Update docs

* Fix comments, data_key, and cleanup some code; add tests too

* bump

* edits
2026-01-08 20:14:09 -08:00
Mark Otto 1731460a2c First pass at submenu support (#41967)
* First pass at submenu support

* Remove unused constants

* Fix up linter errors

* Logical properties for placement

* Better docs playground for dropdowns

* refactor and update bundles

* more tests, fix broken tests

* more tests

* more

* more
2026-01-08 20:14:09 -08:00
Mark Otto 52012a8557 Migrate from Popper to Floating UI (#41941)
* Migrate to Floating UI for tooltips, popovers, dropdowns

* Bump bundlewatch

* Dropdown tests

* add floating ui tests from claude

* more

* build sri

* more tests while here
2026-01-08 20:09:03 -08:00
Mark Otto a19a8fb911 Replace Modal with new Dialog component (#41917)
* Add Dialog component using native HTML dialog element

New component that leverages the native HTML <dialog> element for modals
and non-modal dialogs with built-in backdrop and accessibility support.

Features:
- Modal dialogs using showModal() with automatic backdrop
- Non-modal dialogs using show() for persistent UI elements
- Static backdrop option (prevents close on outside click)
- Keyboard support (Escape to close, focus trapping for modals)
- Smooth open/close animations via CSS
- Events: show, shown, hide, hidden, hidePrevented
- Data API for toggling with data-bs-toggle="dialog"

JavaScript:
- js/src/dialog.js - Main component class
- js/tests/unit/dialog.spec.js - Unit tests
- js/tests/visual/dialog.html - Visual test page

SCSS:
- scss/_dialog.scss - Component styles

Docs:
- Add dialog component documentation
- Update modal docs with dialog references

* Modal examples now Dialog examples, needs improvement

* Remove all of Modal

* real words

* Fix layout while I'm here

* Lint Markdown

* New dialog size options
2026-01-08 20:08:32 -08:00
Mark Otto b690f11076 Remove jQuery support in plugins (#41682) 2026-01-08 20:02:49 -08:00
Amit Rathiesh 13aa16a99b
Fix: Popover with hover and click triggers closes on mouseleave (#41511)
* Fix: Popover with hover and click triggers closes on mouseleave

When a popover is configured with `trigger: 'hover click'`,
if you open it by a click, it would incorrectly close when the
mouse pointer leaves the trigger element. This was because the
`mouseleave` event (part of the hover trigger) would hide the
popover without adequately respecting the click trigger's intent
to keep it open.

This commit modifies the click event listener within `Tooltip.js`
(which Popover extends) to explicitly manage the `_activeTrigger[TRIGGER_CLICK]`
state:
- When a click opens the popover or makes a hover-opened popover
  sticky, `_activeTrigger[TRIGGER_CLICK]` is set to `true`.
- When a click closes an already click-activated popover,
  `_activeTrigger[TRIGGER_CLICK]` is set to `false`.

The `_leave()` method, called by `mouseleave`, already checks
`_isWithActiveTrigger()`. With `_activeTrigger[TRIGGER_CLICK]`
now accurately reflecting the click state, `_leave()` will not
hide a click-activated popover when the mouse leaves the trigger
element. The popover will now correctly remain open until a
subsequent click closes it.

* Removed `test-popover.html`

* Fix linting issues

* Add unit test

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Julien Déramond <juderamond@gmail.com>
2025-06-03 12:19:24 -07:00
Louis-Maxime Piton 49a5ccfd4f
Docs: From Twitter to X (#40706)
* From Twitter to X

* .

* Use Bootstrap Icons

* Set X card to use `twitter` again

* Update `tests/unit/popover.spec.js`

---------

Co-authored-by: Julien Déramond <juderamond@gmail.com>
2025-04-02 22:47:45 -07:00
Dmitry fecd219983
Fix popover remaining open when toggled after being shown (#40803)
Co-authored-by: Dmitry Sergienko <dmitry.sergienko@codefirst.net>
Co-authored-by: Julien Déramond <juderamond@gmail.com>
2024-09-12 09:45:08 +02:00
Nathan Sarang-Walters 16d80a4ff7
Fix `this` reference for JavaScript functions (#38725) 2024-07-19 07:05:21 +02:00
GeoSot 6ed1cdd43e
Selector Engine: fix multiple IDs (#39201)
* fix: regression of #38989

* Add unit test in selector-engine.spec.js

---------

Co-authored-by: Julien Déramond <juderamond@gmail.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2024-02-18 08:58:07 +02:00
dependabot[bot] 40c6d8a4bc
Build(deps-dev): Bump eslint-config-xo from 0.43.1 to 0.44.0 (#39651)
* Build(deps-dev): Bump eslint-config-xo from 0.43.1 to 0.44.0

Bumps [eslint-config-xo](https://github.com/xojs/eslint-config-xo) from 0.43.1 to 0.44.0.
- [Release notes](https://github.com/xojs/eslint-config-xo/releases)
- [Commits](https://github.com/xojs/eslint-config-xo/compare/v0.43.1...v0.44.0)

---
updated-dependencies:
- dependency-name: eslint-config-xo
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .eslintrc.json

* Update .eslintrc.json

* autofix

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2024-02-06 21:46:52 +02:00
Louis-Maxime Piton 9900cf33c0
Fix collapse multiple ids target (#38989) 2023-09-13 09:30:32 +02:00
Kyle Tsang d45cc7ef51
Support `Home` and `End` keys in tabs (#38498)
* Support `Home` and `End` keys in tabs

* Update tab.js

* simplify tests

* Update navs-tabs.md

* Update .bundlewatch.config.json

---------

Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
Co-authored-by: Mark Otto <markdotto@gmail.com>
2023-07-23 22:06:14 +03:00
Kyle Tsang d5dee316f7
Update URL sanitizer to allow more protocols (#38531)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2023-05-01 00:33:09 +03:00
Alejandro Mendoza a06c2e6b5f
Fix scrollspy and accented anchor links (#38502) 2023-05-01 00:31:26 +03:00
XhmikosR 4f24144a31
dropdown.spec.js: expect nothing in constructor (#38442) 2023-04-11 18:03:34 +03:00
XhmikosR ae43f0c48b
Tweak and re-organize ESLint config (#38369)
* Tweak and re-organize ESLint config

* merge individual configs to the root config
* enable more eslint-plugin-import rules
* lint markdown files

* Lint
2023-03-29 13:49:30 -04:00
Jan Bensch e00d06e45b
Fix wrong generation of `aria-labelledby` in tab navigation (#38223)
* fix wrong generation of aria-labelledby in tab navigation

* fix wrong test

---------

Co-authored-by: Jan Bensch <github@bensch.dev>
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
2023-03-14 06:50:08 +02:00
Julien Déramond f44feabe16
Tests: remove unnecessary `id`/`aria-labelledby` from collapse unit tests (#38089) 2023-02-21 19:33:52 +01:00
Julien Déramond f5f6c5c4e3
Minor fix to avoid creating void elements in tooltip test file (#38034) 2023-02-11 10:18:39 +01:00
Patrick H. Lauke 0446e22b5a
Docs: use `<button>` for dropdown/popover examples, explain preference over `<a>` for dropdowns, tweak collapse prose (#37432)
* Expand dropdown explanation for use of `<a>`, use `<button>`s for modal examples

* Remove redundant `role="button"` from collapse test `<button>` elements

* Tweak language

* Tweak collapse prose
2022-11-12 09:21:33 -08:00
XhmikosR 5208dd10c4
ESLint: enable prefer-template rule (#37484) 2022-11-12 10:09:36 +02:00
Pierre Souchay ef4e2daa48
Properly escape IDs in getSelector() to handle weird IDs (#35565) (#35566) 2022-11-07 14:43:06 +02:00
GeoSot e81e7cda90
Move `getElementFromSelector` & `getSelectorFromElement` to SelectorEngine (#36027)
* Move `getElementFromSelector` & getSelectorFromElement` inside selector-engine.js, in order to use SelectorEngine methods, avoiding raw querySelector usage

* add `getMultipleElementsFromSelector` helper

Co-authored-by: Julien Déramond <juderamond@gmail.com>
2022-11-06 20:31:43 +02:00
GeoSot 4cb046a6b8
Boost `execute` function, being able to handle arguments (#36652) 2022-10-07 15:25:00 +03:00
Julien Déramond 1b3c38d2cd
Rename some vars in tab unit tests for consistency (#37248) 2022-10-03 17:44:37 +03:00
GeoSot d49d8ce583
Ensure Tab keyboard functionality after #37146 (#37200)
* fix: keyboard functionality

* test: add tests

* Add some focus spies in 2 other unit tests

Co-authored-by: Julien Déramond <juderamond@gmail.com>
2022-10-02 13:05:30 +03:00
GeoSot 597c402314
Dropdown: fix case with invalid markup (#37190)
This fixes a backward incompatible change in v5.2.1 where `.drodown-toggle` isn't present in the markup.
2022-09-27 10:39:11 +03:00
GeoSot 24f6e2764a
Tests: add testcase to Tabs, keyboard handler (#37189) 2022-09-23 22:18:57 +02:00
Carson Sievert 2b46842af9
Fix active class toggling of tabs within dropdown (#37151)
* Close #36947: fix active class toggling tabs within dropdown
2022-09-22 02:29:58 +03:00
GeoSot 1510c25e9b
Drop tabs auto-focus (#37146)
* fix: drop tabs auto-focus
2022-09-20 17:20:47 +03:00
Jérémie Broutier 6f65df4fae
Fix modal event listeners (#37128)
* Fix modal event listeners (#37126)

Co-authored-by: GeoSot <geo.sotis@gmail.com>
2022-09-15 13:30:51 +03:00
GeoSot 23fb7a7915
Fix modal event-listeners during dismiss click (#36863)
ref: #36855
2022-09-07 11:56:33 +03:00
Louis-Maxime Piton 337068f8b1
fix(dropdowns): Fix multiple dropdowns when they are inside the same tag (#37011) 2022-09-02 10:52:33 +03:00
GeoSot db86607c08
ScrollSpy: make the threshold option configurable (#36750)
* feat(ScrollSpy): make the threshold option configurable
2022-07-28 11:58:28 +03:00
GeoSot dfae892801
Re-set tooltip title, on disposal (#36751)
fix(reg): Re-set tooltip title, on disposal
2022-07-27 17:40:05 +03:00
GeoSot f451b4161e
Fix failing test on EventHandler (#36772) 2022-07-19 15:46:36 +03:00
Marc Wrobel 705d6857ad Fix typos in code (#36763)
Shoutout is correct but has been replaced by its more common form : Shout-out (https://www.merriam-webster.com/dictionary/shout-out).
2022-07-18 13:30:29 -07:00
Julien Déramond aa8d0b3439
Standardization of `spyOn` usage (#36742) 2022-07-15 16:52:03 +03:00
GeoSot 713d7140f1
Offcanvas: activate focustrap when backdrop is enabled (#36717)
* fix(offcanvas): activate focustrap when backdrop is enabled
* Adding tabindex='-1' for both offcanvases in the docs
* Remove useless aria-expanded='false' in togglers
* Update js/tests/unit/offcanvas.spec.js

Co-authored-by: Julien Déramond <julien.deramond@orange.com>
Co-authored-by: Julien Déramond <juderamond@gmail.com>
Co-authored-by: Patrick H. Lauke <redux@splintered.co.uk>
2022-07-14 10:06:06 +01:00
Nathan Walters 3f324eed02
Handle non-empty whitespace `textContent` in Tooltip trigger (#36588) 2022-07-06 07:15:50 +02:00
Julien Déramond c1813ef2bc
ref(tests): Minor fix to use self-closing input HTML tag (#36667) 2022-07-04 14:12:10 +03:00
Aleksander Machniak 505e0235b9
Fix interoperability issue regarding Event properties (#36386)
* Fix interoperability issue regarding Event properties

- make possible to re-set read-only event properties
- use hydrateObj() to set delegateTarget property

Fixes #36207

Co-authored-by: GeoSot <geo.sotis@gmail.com>
Co-authored-by: Julien Déramond <julien.deramond@orange.com>
2022-06-30 22:52:47 +03:00
GeoSot 4f4b42dd14
Force tooltip and popover to recreate content every time it opens (#35679) 2022-06-27 12:58:27 +03:00
GeoSot f14c58f494
ref(tab): remove show from panels dependent-less they have `.fade` class or not (simplify checks) (#36622) 2022-06-27 12:43:11 +03:00