• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

alma-oss / spirit-design-system / 25500013980

07 May 2026 01:50PM UTC coverage: 84.089% (-0.3%) from 84.395%
25500013980

Pull #2631

github

adamkudrna
feat(web,web-react)!: drop `Tag` appearance feature flag #DS-2456

BREAKING CHANGE: The new `Tag` appearance (`inline-flex` layout with explicit
height and inside spacing) is now default. Delete the `$enable-v5-tag-appearance`
Sass variable and the `spirit-feature-enable-v5-tag-appearance` CSS class from
your project — they have no effect. See the Tag: Appearance Feature Flag Removed
sections in the web and web-react package Migration Guides to version 5.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pull Request #2631: feat(web,web-react)!: drop `Tag` appearance feature flag #DS-2456

2274 of 3120 branches covered (72.88%)

Branch coverage included in aggregate %.

7149 of 8086 relevant lines covered (88.41%)

197.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/packages/web-react/src/components/Dropdown/Dropdown.tsx
1
'use client';
2

3
import classNames from 'classnames';
189✔
4
import React, { type KeyboardEventHandler, type MutableRefObject, useCallback, useRef } from 'react';
189✔
5
import { useOverlay, useStyleProps } from '../../hooks';
189✔
6
import { type SpiritDropdownProps } from '../../types';
7
import { DropdownProvider } from './DropdownContext';
189✔
8
import { useDropdownStyleProps } from './useDropdownStyleProps';
189✔
9

10
const Dropdown = (props: SpiritDropdownProps) => {
189✔
11
  const {
12
    children,
13
    enableAutoClose = true,
164✔
14
    fullWidthMode,
15
    id,
16
    isOpen = false,
5✔
17
    onAutoClose,
18
    onToggle,
19
    placement,
20
    triggerRef: externalTriggerRef,
21
    ...rest
22
  } = props;
164✔
23
  const { classProps, props: modifiedProps } = useDropdownStyleProps({ isOpen, ...rest });
164✔
24
  const { styleProps, props: transferProps } = useStyleProps(modifiedProps);
164✔
25
  const { onKeyDown: onUserKeyDown, ...otherProps } = transferProps;
164✔
26

27
  const dropdownRef = useRef<HTMLDivElement>(null);
164✔
28
  const internalTriggerRef = useRef<HTMLElement | null>(null);
164✔
29
  const triggerRef: MutableRefObject<HTMLElement | null | undefined> = externalTriggerRef ?? internalTriggerRef;
164✔
30

31
  const closeOverlay = useCallback(() => {
164✔
32
    if (!isOpen) {
1!
33
      return;
×
34
    }
35

36
    onToggle();
1✔
37

38
    queueMicrotask(() => {
1✔
39
      triggerRef.current?.focus();
1✔
40
    });
41
  }, [isOpen, onToggle, triggerRef]);
42

43
  const closeOverlayFromOutside = useCallback(
164✔
44
    (event: Event) => {
45
      if (!isOpen) {
×
46
        return;
×
47
      }
48

49
      onAutoClose?.(event);
×
50
      onToggle();
×
51
    },
52
    [isOpen, onAutoClose, onToggle],
53
  );
54

55
  const { onOverlayKeyDown } = useOverlay({
164✔
56
    isOpen,
57
    overlayRef: dropdownRef,
58
    onClose: closeOverlay,
59
    closeOnInteractOutside: enableAutoClose,
60
    onCloseOnInteractOutside: closeOverlayFromOutside,
61
  });
62

63
  const handleKeyDown: KeyboardEventHandler<HTMLElement> = useCallback(
164✔
64
    (event) => {
65
      onUserKeyDown?.(event);
7✔
66
      onOverlayKeyDown(event);
7✔
67
    },
68
    [onOverlayKeyDown, onUserKeyDown],
69
  );
70
  const mergedProps = { ...otherProps, onKeyDown: handleKeyDown };
164✔
71

72
  return (
164✔
73
    <DropdownProvider value={{ id, isOpen, fullWidthMode, placement, onToggle, dropdownRef, triggerRef }}>
74
      <div
75
        ref={dropdownRef}
76
        className={classNames(classProps.root, styleProps.className)}
77
        style={styleProps.style}
78
        {...mergedProps}
79
      >
80
        {children}
81
      </div>
82
    </DropdownProvider>
83
  );
84
};
85

86
Dropdown.spiritComponent = 'Dropdown';
189✔
87

88
export default Dropdown;
189✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc