@elliemae/ds-global-header 3.70.0-next.6 → 3.70.0-next.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/cjs/constants/index.js +3 -1
  2. package/dist/cjs/constants/index.js.map +2 -2
  3. package/dist/cjs/package.json +1 -4
  4. package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js.map +1 -1
  5. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js +18 -22
  6. package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js.map +2 -2
  7. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js +1 -0
  8. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js.map +2 -2
  9. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js +2 -1
  10. package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js.map +2 -2
  11. package/dist/cjs/react-desc-prop-types.js.map +2 -2
  12. package/dist/esm/constants/index.js +3 -1
  13. package/dist/esm/constants/index.js.map +2 -2
  14. package/dist/esm/package.json +1 -4
  15. package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js.map +1 -1
  16. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js +19 -23
  17. package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js.map +2 -2
  18. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js +7 -1
  19. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js.map +2 -2
  20. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js +2 -1
  21. package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js.map +2 -2
  22. package/dist/esm/react-desc-prop-types.js.map +2 -2
  23. package/dist/types/constants/index.d.ts +1 -0
  24. package/dist/types/parts/Breadcrumb/PureBreadcrumb.d.ts +1 -1
  25. package/dist/types/parts/Breadcrumb/styles.d.ts +1 -1
  26. package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.d.ts +1 -1
  27. package/dist/types/react-desc-prop-types.d.ts +1 -1
  28. package/package.json +16 -16
  29. package/dist/cjs/hooks/useOnClickOutside.js +0 -60
  30. package/dist/cjs/hooks/useOnClickOutside.js.map +0 -7
  31. package/dist/esm/hooks/useOnClickOutside.js +0 -30
  32. package/dist/esm/hooks/useOnClickOutside.js.map +0 -7
  33. package/dist/types/hooks/useOnClickOutside.d.ts +0 -1
  34. package/dist/types/tests/GlobalHeader.a11y.test.d.ts +0 -1
  35. package/dist/types/tests/GlobalHeader.callback.test.d.ts +0 -1
  36. package/dist/types/tests/GlobalHeader.getOwnerProps.test.d.ts +0 -1
  37. package/dist/types/tests/GlobalHeader.keyboard.test.d.ts +0 -1
  38. package/dist/types/tests/GlobalHeader.setup.test.d.ts +0 -113
  39. package/dist/types/typescript-testing/typescript-global-header-breadcrumb-types.d.ts +0 -3
  40. package/dist/types/typescript-testing/typescript-global-header-deprecated.d.ts +0 -1
  41. package/dist/types/typescript-testing/typescript-global-header-toolbar-types.d.ts +0 -3
  42. package/dist/types/typescript-testing/typescript-global-header-valid.d.ts +0 -1
@@ -2,11 +2,10 @@ import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useFloatingContext, PopoverArrow, FloatingWrapper } from "@elliemae/ds-floating-context";
4
4
  import { useGetGlobalAttributes } from "@elliemae/ds-props-helpers";
5
- import { useCallback, useRef } from "react";
5
+ import { useCallback } from "react";
6
6
  import { GLOBAL_HEADER_DATA_TESTID } from "../../../../constants/index.js";
7
7
  import { StyledButton } from "../../../styles.js";
8
8
  import { PopupMenuContent } from "./menuContent/PopupMenuContent.js";
9
- import { useOnClickOutside } from "../../../../hooks/useOnClickOutside.js";
10
9
  const PopupMenu = ({
11
10
  Icon,
12
11
  onClick,
@@ -15,12 +14,6 @@ const PopupMenu = ({
15
14
  ownerProps,
16
15
  ...otherProps
17
16
  }) => {
18
- const { arrowStyles, floatingStyles, isOpen, refs, context, showTooltip, hideTooltip } = useFloatingContext({
19
- externallyControlledIsOpen: componentProps.isOpen,
20
- placement: "bottom",
21
- withoutAnimation: true,
22
- withoutPortal: true
23
- });
24
17
  const {
25
18
  onClickOutside = () => null,
26
19
  onKeyPress,
@@ -29,7 +22,22 @@ const PopupMenu = ({
29
22
  options,
30
23
  closeOnClick
31
24
  } = componentProps;
32
- const boundaryRef = useRef(null);
25
+ const { arrowStyles, floatingStyles, isOpen, refs, context, showTooltip, hideTooltip } = useFloatingContext({
26
+ externallyControlledIsOpen: componentProps.isOpen,
27
+ placement: "bottom",
28
+ withoutAnimation: true,
29
+ withoutPortal: true,
30
+ // The hook auto-excludes clicks inside the floating element and the reference, so the
31
+ // outside boundary is now { reference, floating } — no boundary <div> needed.
32
+ // Gated internally on `isOpen`, so it only fires while open.
33
+ onClickOutside: (event) => {
34
+ onClickOutside(event);
35
+ if (userIsOpen === void 0) {
36
+ hideTooltip();
37
+ refs.reference?.focus();
38
+ }
39
+ }
40
+ });
33
41
  const handleOnKeyDown = useCallback(
34
42
  (e) => {
35
43
  if (e.code === "ArrowDown") {
@@ -47,7 +55,7 @@ const PopupMenu = ({
47
55
  }, [hideTooltip, refs.reference, userIsOpen]);
48
56
  const handleTriggerOnClick = useCallback(
49
57
  (e) => {
50
- if (userIsOpen === void 0) showTooltip();
58
+ if (userIsOpen === void 0) showTooltip(e);
51
59
  if (onClick) onClick(e);
52
60
  },
53
61
  [onClick, userIsOpen, showTooltip]
@@ -55,18 +63,6 @@ const PopupMenu = ({
55
63
  const handleItemClick = useCallback(() => {
56
64
  if (closeOnClick && userIsOpen === void 0) handleOnClose();
57
65
  }, [closeOnClick, handleOnClose, userIsOpen]);
58
- const handleOutside = useCallback(
59
- (event) => {
60
- onClickOutside(event);
61
- const actuallyOpen = userIsOpen ?? isOpen;
62
- if (!actuallyOpen) return;
63
- if (userIsOpen === void 0) {
64
- handleOnClose();
65
- }
66
- },
67
- [handleOnClose, isOpen, onClickOutside, userIsOpen]
68
- );
69
- useOnClickOutside(userIsOpen ?? isOpen ? boundaryRef.current : null, handleOutside);
70
66
  const handleRefs = useCallback(
71
67
  (ref) => {
72
68
  setRef(ref);
@@ -74,7 +70,7 @@ const PopupMenu = ({
74
70
  },
75
71
  [refs, setRef]
76
72
  );
77
- return /* @__PURE__ */ jsxs("div", { ref: boundaryRef, children: [
73
+ return /* @__PURE__ */ jsxs("div", { children: [
78
74
  /* @__PURE__ */ jsx(
79
75
  StyledButton,
80
76
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport React, { useCallback, useRef } from 'react';\nimport { GLOBAL_HEADER_DATA_TESTID } from '../../../../constants/index.js';\nimport type { DSGlobalHeaderT } from '../../../../react-desc-prop-types.js';\nimport { StyledButton } from '../../../styles.js';\nimport { PopupMenuContent } from './menuContent/PopupMenuContent.js';\nimport { useOnClickOutside } from '../../../../hooks/useOnClickOutside.js';\nexport const PopupMenu = ({\n Icon,\n onClick,\n setRef,\n componentProps,\n ownerProps,\n ...otherProps\n}: DSGlobalHeaderT.PopupProps): JSX.Element => {\n const { arrowStyles, floatingStyles, isOpen, refs, context, showTooltip, hideTooltip } = useFloatingContext({\n externallyControlledIsOpen: componentProps.isOpen,\n placement: 'bottom',\n withoutAnimation: true,\n withoutPortal: true,\n });\n\n const {\n onClickOutside = () => null,\n onKeyPress,\n popupOnKeyPress,\n isOpen: userIsOpen,\n options,\n closeOnClick,\n } = componentProps;\n\n /**\n * We want \"outside\" to mean: outside BOTH the trigger and the floating panel.\n * So wrap them in a single DOM node and use that as the boundary.\n */\n const boundaryRef = useRef<HTMLDivElement | null>(null);\n\n const handleOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.code === 'ArrowDown') {\n showTooltip();\n }\n if (onKeyPress) onKeyPress(e);\n },\n [onKeyPress, showTooltip],\n );\n\n const handleOnClose = useCallback(() => {\n if (userIsOpen === undefined) {\n hideTooltip();\n }\n (refs.reference as HTMLElement)?.focus();\n }, [hideTooltip, refs.reference, userIsOpen]);\n\n const handleTriggerOnClick = useCallback(\n (e: React.MouseEvent) => {\n if (userIsOpen === undefined) showTooltip();\n if (onClick) onClick(e);\n },\n [onClick, userIsOpen, showTooltip],\n );\n\n const handleItemClick = useCallback(() => {\n if (closeOnClick && userIsOpen === undefined) handleOnClose();\n }, [closeOnClick, handleOnClose, userIsOpen]);\n\n // Close on outside click, but:\n // - always notify consumer via onClickOutside\n // - only actually close when uncontrolled (userIsOpen === undefined)\n // - only run while open\n const handleOutside = useCallback(\n (event: Event) => {\n onClickOutside(event as MouseEvent | TouchEvent);\n\n const actuallyOpen = userIsOpen ?? isOpen;\n if (!actuallyOpen) return;\n\n if (userIsOpen === undefined) {\n handleOnClose();\n }\n },\n [handleOnClose, isOpen, onClickOutside, userIsOpen],\n );\n\n // If you only want to listen when open, pass `null` when closed\n useOnClickOutside((userIsOpen ?? isOpen) ? boundaryRef.current : null, handleOutside);\n\n const handleRefs = useCallback(\n (ref: HTMLButtonElement) => {\n setRef(ref);\n refs.setReference(ref);\n },\n [refs, setRef],\n );\n return (\n <div ref={boundaryRef}>\n <StyledButton\n onClick={handleTriggerOnClick}\n onKeyDown={handleOnKeyDown}\n innerRef={handleRefs}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM_BUTTON}\n aria-haspopup\n aria-expanded={userIsOpen ?? isOpen}\n {...useGetGlobalAttributes(otherProps)}\n type=\"button\"\n {...ownerProps}\n >\n {Icon && <Icon size=\"m\" />}\n </StyledButton>\n\n {refs.reference ? (\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={userIsOpen ?? isOpen}\n floatingStyles={floatingStyles}\n context={context}\n >\n <PopupMenuContent\n options={options}\n onItemClick={handleItemClick}\n onClose={handleOnClose}\n setIsOpen={hideTooltip}\n popupOnKeyPress={popupOnKeyPress}\n ownerProps={ownerProps}\n />\n <PopoverArrow {...arrowStyles} />\n </FloatingWrapper>\n ) : null}\n </div>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC4GN,cAIT,YAJS;AA5GjB,SAAS,oBAAoB,cAAc,uBAAuB;AAClE,SAAS,8BAA8B;AACvC,SAAgB,aAAa,cAAc;AAC3C,SAAS,iCAAiC;AAE1C,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAC3B,MAAM,YAAY,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA+C;AAC7C,QAAM,EAAE,aAAa,gBAAgB,QAAQ,MAAM,SAAS,aAAa,YAAY,IAAI,mBAAmB;AAAA,IAC1G,4BAA4B,eAAe;AAAA,IAC3C,WAAW;AAAA,IACX,kBAAkB;AAAA,IAClB,eAAe;AAAA,EACjB,CAAC;AAED,QAAM;AAAA,IACJ,iBAAiB,MAAM;AAAA,IACvB;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,IAAI;AAMJ,QAAM,cAAc,OAA8B,IAAI;AAEtD,QAAM,kBAAkB;AAAA,IACtB,CAAC,MAA2B;AAC1B,UAAI,EAAE,SAAS,aAAa;AAC1B,oBAAY;AAAA,MACd;AACA,UAAI,WAAY,YAAW,CAAC;AAAA,IAC9B;AAAA,IACA,CAAC,YAAY,WAAW;AA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,MAAC;AAAA;AAAA,QACC,UAAU,KAAK;AAAA,QACf,QAAQ,cAAc;AAAA,QACtB;AAAA,QACA;AAAA,QAEA;AAAA;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,aAAa;AAAA,cACb,SAAS;AAAA,cACT,WAAW;AAAA,cACX;AAAA,cACA;AAAA;AAAA,UACF;AAAA,UACA,oBAAC,gBAAc,GAAG,aAAa;AAAA;AAAA;AAAA,IACjC,IACE;AAAA,KACN;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useFloatingContext, PopoverArrow, FloatingWrapper } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes } from '@elliemae/ds-props-helpers';\nimport React, { useCallback } from 'react';\nimport { GLOBAL_HEADER_DATA_TESTID } from '../../../../constants/index.js';\nimport type { DSGlobalHeaderT } from '../../../../react-desc-prop-types.js';\nimport { StyledButton } from '../../../styles.js';\nimport { PopupMenuContent } from './menuContent/PopupMenuContent.js';\n\nexport const PopupMenu = ({\n Icon,\n onClick,\n setRef,\n componentProps,\n ownerProps,\n ...otherProps\n}: DSGlobalHeaderT.PopupProps): JSX.Element => {\n const {\n onClickOutside = () => null,\n onKeyPress,\n popupOnKeyPress,\n isOpen: userIsOpen,\n options,\n closeOnClick,\n } = componentProps;\n\n // We need to declare the floating context before we can reference its hideTooltip in\n // handleOutside; but handleOutside is passed into the same hook call. We resolve this by\n // pulling hideTooltip / refs.reference via the latest-ref pattern of the hook itself \u2014\n // see comments on `onClickOutside` below.\n const { arrowStyles, floatingStyles, isOpen, refs, context, showTooltip, hideTooltip } = useFloatingContext({\n externallyControlledIsOpen: componentProps.isOpen,\n placement: 'bottom',\n withoutAnimation: true,\n withoutPortal: true,\n // The hook auto-excludes clicks inside the floating element and the reference, so the\n // outside boundary is now { reference, floating } \u2014 no boundary <div> needed.\n // Gated internally on `isOpen`, so it only fires while open.\n onClickOutside: (event) => {\n onClickOutside(event);\n if (userIsOpen === undefined) {\n hideTooltip();\n (refs.reference as HTMLElement)?.focus();\n }\n },\n });\n\n const handleOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.code === 'ArrowDown') {\n showTooltip();\n }\n if (onKeyPress) onKeyPress(e);\n },\n [onKeyPress, showTooltip],\n );\n\n const handleOnClose = useCallback(() => {\n if (userIsOpen === undefined) {\n hideTooltip();\n }\n (refs.reference as HTMLElement)?.focus();\n }, [hideTooltip, refs.reference, userIsOpen]);\n\n const handleTriggerOnClick = useCallback(\n (e: React.MouseEvent) => {\n if (userIsOpen === undefined) showTooltip(e);\n if (onClick) onClick(e);\n },\n [onClick, userIsOpen, showTooltip],\n );\n\n const handleItemClick = useCallback(() => {\n if (closeOnClick && userIsOpen === undefined) handleOnClose();\n }, [closeOnClick, handleOnClose, userIsOpen]);\n\n const handleRefs = useCallback(\n (ref: HTMLButtonElement) => {\n setRef(ref);\n refs.setReference(ref);\n },\n [refs, setRef],\n );\n return (\n <div>\n <StyledButton\n onClick={handleTriggerOnClick}\n onKeyDown={handleOnKeyDown}\n innerRef={handleRefs}\n data-testid={GLOBAL_HEADER_DATA_TESTID.MENUBAR_ITEM_BUTTON}\n aria-haspopup\n aria-expanded={userIsOpen ?? isOpen}\n {...useGetGlobalAttributes(otherProps)}\n type=\"button\"\n {...ownerProps}\n >\n {Icon && <Icon size=\"m\" />}\n </StyledButton>\n\n {refs.reference ? (\n <FloatingWrapper\n innerRef={refs.setFloating}\n isOpen={userIsOpen ?? isOpen}\n floatingStyles={floatingStyles}\n context={context}\n >\n <PopupMenuContent\n options={options}\n onItemClick={handleItemClick}\n onClose={handleOnClose}\n setIsOpen={hideTooltip}\n popupOnKeyPress={popupOnKeyPress}\n ownerProps={ownerProps}\n />\n <PopoverArrow {...arrowStyles} />\n </FloatingWrapper>\n ) : null}\n </div>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC+FN,cAIT,YAJS;AA/FjB,SAAS,oBAAoB,cAAc,uBAAuB;AAClE,SAAS,8B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I,gBAAgB,eAAe,OAAW,eAAc;AAAA,EAC9D,GAAG,CAAC,cAAc,eAAe,UAAU,CAAC;AAE5C,QAAM,aAAa;AAAA,IACjB,CAAC,QAA2B;AAC1B,aAAO,GAAG;AACV,WAAK,aAAa,GAAG;AAAA,IACvB;AAAA,IACA,CAAC,MAAM,MAAM;AAAA,EACf;AACA,SACE,qBAAC,SACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS;AAAA,QACT,WAAW;AAAA,QACX,UAAU;AAAA,QACV,eAAa,0BAA0B;AAAA,QACvC,iBAAa;AAAA,QACb,iBAAe,cAAc;AAAA,QAC5B,GAAG,uBAAuB,UAAU;AAAA,QACrC,MAAK;AAAA,QACJ,GAAG;AAAA,QAEH,kBAAQ,oBAAC,QAAK,MAAK,KAAI;AAAA;AAAA,IAC1B;AAAA,IAEC,KAAK,YACJ;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,KAAK;AAAA,QACf,QAAQ,cAAc;AAAA,QACtB;AAAA,QACA;AAAA,QAEA;AAAA;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,aAAa;AAAA,cACb,SAAS;AAAA,cACT,WAAW;AAAA,cACX;AAAA,cACA;AAAA;AAAA,UACF;AAAA,UACA,oBAAC,gBAAc,GAAG,aAAa;AAAA;AAAA;AAAA,IACjC,IACE;AAAA,KACN;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -7,7 +7,12 @@ import { Search } from "@elliemae/ds-icons";
7
7
  import { css, mergeRefs, styled } from "@elliemae/ds-system";
8
8
  import React2 from "react";
9
9
  import { DSGlobalHeaderContext } from "../../../../DSGlobalHeaderContext.js";
10
- import { DSGlobalHeaderName, GLOBAL_HEADER_DATA_TESTID, GLOBAL_HEADER_SLOTS } from "../../../../constants/index.js";
10
+ import {
11
+ DSGlobalHeaderName,
12
+ GLOBAL_HEADER_DATA_TESTID,
13
+ GLOBAL_HEADER_SLOTS,
14
+ SEARCH_TOGGLE_DEFAULT_ARIA_LABEL
15
+ } from "../../../../constants/index.js";
11
16
  import { SearchToggleSpinButton } from "./SearchToggleSpinButton.js";
12
17
  import { useSearchToggle } from "./useSearchToggle.js";
13
18
  const StyledNavSearchBoxContainer = styled("div", {
@@ -165,6 +170,7 @@ const SearchToggle = (outOfTheBoxDrilledDownProps) => {
165
170
  getOwnerProps,
166
171
  getOwnerPropsArguments,
167
172
  id: inputId,
173
+ "aria-label": SEARCH_TOGGLE_DEFAULT_ARIA_LABEL,
168
174
  placeholder: placeholder || "Search...",
169
175
  value,
170
176
  clearable: true,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { DSInputText } from '@elliemae/ds-form-input-text';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Search } from '@elliemae/ds-icons';\nimport { css, mergeRefs, styled } from '@elliemae/ds-system';\nimport React from 'react';\nimport { DSGlobalHeaderContext } from '../../../../DSGlobalHeaderContext.js';\nimport { DSGlobalHeaderName, GLOBAL_HEADER_DATA_TESTID, GLOBAL_HEADER_SLOTS } from '../../../../constants/index.js';\nimport type { DSGlobalHeaderT } from '../../../../react-desc-prop-types.js';\nimport { SearchToggleSpinButton } from './SearchToggleSpinButton.js';\nimport { useSearchToggle } from './useSearchToggle.js';\n\nconst StyledNavSearchBoxContainer = styled('div', {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.MENUBAR_SEARCH_TOGGLE_CONTAINER,\n})<{ isOpen: boolean }>`\n background: ${({ theme, isOpen }) => (isOpen ? theme.colors.neutral['000'] : 'transparent')};\n position: relative;\n display: flex;\n align-items: center;\n width: ${({ isOpen }) => (isOpen ? '260px' : 'auto')};\n & .em-ds-button {\n margin-right: 2px;\n height: 24px;\n width: 24px;\n }\n`;\n\nconst StyledSearchNavContainer = styled(Grid, {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_EXPANDED_CONTENT_WRAPPER,\n})`\n background: ${({ theme }) => theme.colors.neutral['000']};\n position: relative;\n padding: 2px;\n`;\n\nconst StyledSearchInput = styled(DSInputText, {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_TEXTINPUT,\n})``;\n\nconst ExpandedToggleBtnStyles = css`\n margin-left: 2px;\n`;\nconst CollapsedToggleBtnStyles = css`\n height: 3.077rem;\n width: 3.077rem;\n border: none;\n background-color: transparent;\n cursor: pointer;\n position: relative;\n\n // we want to avoid the pseudo-border in the nested buttons\n & button:focus .pseudo-border {\n outline: none;\n border: none;\n }\n && span.pseudo-border {\n display: none;\n }\n\n // our \"ad-hoc\" styling of the DSButtonV3 that re-implement changed colors/focus-borders\n & .em-ds-icon svg {\n fill: ${({ theme }) => theme.colors.neutral['000']};\n }\n\n &&:hover {\n background-color: ${({ theme }) => theme.colors.brand[700]};\n }\n\n &&:focus-visible {\n background-color: transparent;\n }\n\n &&:focus-visible::before {\n content: '';\n position: absolute;\n z-index: 2;\n top: 2px;\n left: 2px;\n width: calc(100% - 4px);\n height: calc(100% - 4px);\n border: 2px solid ${({ theme }) => theme.colors.neutral['000']};\n border-radius: 4px;\n pointer-events: none;\n }\n`;\n\nconst StyledToggleBtn = styled(DSButtonV3, {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_TRIGGER_BUTTON,\n})<{ isOpen: boolean }>`\n ${({ isOpen }) => (!isOpen ? CollapsedToggleBtnStyles : ExpandedToggleBtnStyles)}\n`;\n\nexport const SearchToggle = (outOfTheBoxDrilledDownProps: DSGlobalHeaderT.SearchToggleProps): JSX.Element => {\n const {\n componentProps,\n label,\n // added in https://jira.elliemae.io/browse/PUI-17852\n // keeping the default value as \"Close search\" for backward compatibility\n // we expect authors to provide descriptive aria-labels that fit their specific context, we do so in our example stories.\n ariaLabelExpanded = 'Close search',\n } = outOfTheBoxDrilledDownProps;\n\n const {\n isOpenUncontrolled,\n containerRef,\n handleToggleSearch,\n handleContainerKeyDown,\n handleChange,\n handleInputKeyDown,\n handleTriggerRefs,\n inputId,\n panelId,\n } = useSearchToggle(outOfTheBoxDrilledDownProps);\n const { props: propsWithDefault } = React.useContext(DSGlobalHeaderContext);\n\n const {\n onNext,\n onPrevious,\n currentResultIndex,\n totalResults,\n placeholder,\n value,\n onBlur,\n onClear,\n isOpen: userIsOpen,\n searchContainerRef,\n } = componentProps;\n\n const getOwnerProps = React.useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n const isOpen = userIsOpen ?? isOpenUncontrolled;\n\n return (\n <StyledNavSearchBoxContainer\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n onKeyDown={handleContainerKeyDown}\n innerRef={mergeRefs(searchContainerRef, containerRef)}\n isOpen={isOpen}\n >\n <StyledToggleBtn\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n buttonType=\"icon\"\n innerRef={handleTriggerRefs}\n aria-label={isOpen ? ariaLabelExpanded : label}\n aria-expanded={isOpen}\n aria-controls={panelId}\n onClick={handleToggleSearch}\n isOpen={isOpen}\n data-testid={GLOBAL_HEADER_DATA_TESTID.SEARCH_TOGGLE_TRIGGER_BUTTON}\n >\n <Search color={isOpen ? ['brand-primary', '800'] : ['neutral', '0']} />\n </StyledToggleBtn>\n\n {isOpen ? (\n <StyledSearchNavContainer\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n id={panelId}\n alignItems=\"center\"\n cols={['1fr', '1fr']}\n >\n <StyledSearchInput\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n id={inputId}\n placeholder={placeholder || 'Search...'}\n value={value}\n clearable\n // passing onBlur as {undefined} breaks the input text focus ring management\n // if onBlur is not provided, we don't pass the prop at all\n // this is not expected as confirmed in conversation with Gerardo\n // we are not going to implement the fix right now to avoid potential breaking changes,\n // but we will keep an eye on this behavior and consider a fix in the future if needed.\n {...(onBlur && { onBlur })}\n onChange={handleChange}\n onKeyDown={handleInputKeyDown}\n onClear={onClear}\n />\n\n <SearchToggleSpinButton\n onNext={onNext}\n onPrevious={onPrevious}\n currentResultIndex={currentResultIndex}\n totalResults={totalResults}\n />\n </StyledSearchNavContainer>\n ) : null}\n </StyledNavSearchBoxContainer>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC4Jf,cAIA,YAJA;AA5JR,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,SAAS,KAAK,WAAW,cAAc;AACvC,OAAOA,YAAW;AAClB,SAAS,6BAA6B;AACtC,SAAS,oBAAoB,2BAA2B,2BAA2B;AAEnF,SAAS,8BAA8B;AACvC,SAAS,uBAAuB;AAEhC,MAAM,8BAA8B,OAAO,OAAO;AAAA,EAChD,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA,gBACe,CAAC,EAAE,OAAO,OAAO,MAAO,SAAS,MAAM,OAAO,QAAQ,KAAK,IAAI,aAAc;AAAA;AAAA;AAAA;AAAA,WAIlF,CAAC,EAAE,OAAO,MAAO,SAAS,UAAU,MAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQtD,MAAM,2BAA2B,OAAO,MAAM;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA,gBACe,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA;AAK1D,MAAM,oBAAoB,OAAO,aAAa;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAED,MAAM,0BA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AC,IAAI,CAAC,CAAC;AAC/D,QAAM,SAAS,cAAc;AAE7B,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX,UAAU,UAAU,oBAAoB,YAAY;AAAA,MACpD;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA,YAAW;AAAA,YACX,UAAU;AAAA,YACV,cAAY,SAAS,oBAAoB;AAAA,YACzC,iBAAe;AAAA,YACf,iBAAe;AAAA,YACf,SAAS;AAAA,YACT;AAAA,YACA,eAAa,0BAA0B;AAAA,YAEvC,8BAAC,UAAO,OAAO,SAAS,CAAC,iBAAiB,KAAK,IAAI,CAAC,WAAW,GAAG,GAAG;AAAA;AAAA,QACvE;AAAA,QAEC,SACC;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA,IAAI;AAAA,YACJ,YAAW;AAAA,YACX,MAAM,CAAC,OAAO,KAAK;AAAA,YAEnB;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC;AAAA,kBACA;AAAA,kBACA,IAAI;AAAA,kBACJ,aAAa,eAAe;AAAA,kBAC5B;AAAA,kBACA,WAAS;AAAA,kBAMR,GAAI,UAAU,EAAE,OAAO;AAAA,kBACxB,UAAU;AAAA,kBACV,WAAW;AAAA,kBACX;AAAA;AAAA,cACF;AAAA,cAEA;AAAA,gBAAC;AAAA;AAAA,kBACC;AAAA,kBACA;AAAA,kBACA;AAAA,kBACA;AAAA;AAAA,cACF;AAAA;AAAA;AAAA,QACF,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { DSInputText } from '@elliemae/ds-form-input-text';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Search } from '@elliemae/ds-icons';\nimport { css, mergeRefs, styled } from '@elliemae/ds-system';\nimport React from 'react';\nimport { DSGlobalHeaderContext } from '../../../../DSGlobalHeaderContext.js';\nimport {\n DSGlobalHeaderName,\n GLOBAL_HEADER_DATA_TESTID,\n GLOBAL_HEADER_SLOTS,\n SEARCH_TOGGLE_DEFAULT_ARIA_LABEL,\n} from '../../../../constants/index.js';\nimport type { DSGlobalHeaderT } from '../../../../react-desc-prop-types.js';\nimport { SearchToggleSpinButton } from './SearchToggleSpinButton.js';\nimport { useSearchToggle } from './useSearchToggle.js';\n\nconst StyledNavSearchBoxContainer = styled('div', {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.MENUBAR_SEARCH_TOGGLE_CONTAINER,\n})<{ isOpen: boolean }>`\n background: ${({ theme, isOpen }) => (isOpen ? theme.colors.neutral['000'] : 'transparent')};\n position: relative;\n display: flex;\n align-items: center;\n width: ${({ isOpen }) => (isOpen ? '260px' : 'auto')};\n & .em-ds-button {\n margin-right: 2px;\n height: 24px;\n width: 24px;\n }\n`;\n\nconst StyledSearchNavContainer = styled(Grid, {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_EXPANDED_CONTENT_WRAPPER,\n})`\n background: ${({ theme }) => theme.colors.neutral['000']};\n position: relative;\n padding: 2px;\n`;\n\nconst StyledSearchInput = styled(DSInputText, {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_TEXTINPUT,\n})``;\n\nconst ExpandedToggleBtnStyles = css`\n margin-left: 2px;\n`;\nconst CollapsedToggleBtnStyles = css`\n height: 3.077rem;\n width: 3.077rem;\n border: none;\n background-color: transparent;\n cursor: pointer;\n position: relative;\n\n // we want to avoid the pseudo-border in the nested buttons\n & button:focus .pseudo-border {\n outline: none;\n border: none;\n }\n && span.pseudo-border {\n display: none;\n }\n\n // our \"ad-hoc\" styling of the DSButtonV3 that re-implement changed colors/focus-borders\n & .em-ds-icon svg {\n fill: ${({ theme }) => theme.colors.neutral['000']};\n }\n\n &&:hover {\n background-color: ${({ theme }) => theme.colors.brand[700]};\n }\n\n &&:focus-visible {\n background-color: transparent;\n }\n\n &&:focus-visible::before {\n content: '';\n position: absolute;\n z-index: 2;\n top: 2px;\n left: 2px;\n width: calc(100% - 4px);\n height: calc(100% - 4px);\n border: 2px solid ${({ theme }) => theme.colors.neutral['000']};\n border-radius: 4px;\n pointer-events: none;\n }\n`;\n\nconst StyledToggleBtn = styled(DSButtonV3, {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_TRIGGER_BUTTON,\n})<{ isOpen: boolean }>`\n ${({ isOpen }) => (!isOpen ? CollapsedToggleBtnStyles : ExpandedToggleBtnStyles)}\n`;\n\nexport const SearchToggle = (outOfTheBoxDrilledDownProps: DSGlobalHeaderT.SearchToggleProps): JSX.Element => {\n const {\n componentProps,\n label,\n // added in https://jira.elliemae.io/browse/PUI-17852\n // keeping the default value as \"Close search\" for backward compatibility\n // we expect authors to provide descriptive aria-labels that fit their specific context, we do so in our example stories.\n ariaLabelExpanded = 'Close search',\n } = outOfTheBoxDrilledDownProps;\n\n const {\n isOpenUncontrolled,\n containerRef,\n handleToggleSearch,\n handleContainerKeyDown,\n handleChange,\n handleInputKeyDown,\n handleTriggerRefs,\n inputId,\n panelId,\n } = useSearchToggle(outOfTheBoxDrilledDownProps);\n const { props: propsWithDefault } = React.useContext(DSGlobalHeaderContext);\n\n const {\n onNext,\n onPrevious,\n currentResultIndex,\n totalResults,\n placeholder,\n value,\n onBlur,\n onClear,\n isOpen: userIsOpen,\n searchContainerRef,\n } = componentProps;\n\n const getOwnerProps = React.useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n const isOpen = userIsOpen ?? isOpenUncontrolled;\n\n return (\n <StyledNavSearchBoxContainer\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n onKeyDown={handleContainerKeyDown}\n innerRef={mergeRefs(searchContainerRef, containerRef)}\n isOpen={isOpen}\n >\n <StyledToggleBtn\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n buttonType=\"icon\"\n innerRef={handleTriggerRefs}\n aria-label={isOpen ? ariaLabelExpanded : label}\n aria-expanded={isOpen}\n aria-controls={panelId}\n onClick={handleToggleSearch}\n isOpen={isOpen}\n data-testid={GLOBAL_HEADER_DATA_TESTID.SEARCH_TOGGLE_TRIGGER_BUTTON}\n >\n <Search color={isOpen ? ['brand-primary', '800'] : ['neutral', '0']} />\n </StyledToggleBtn>\n\n {isOpen ? (\n <StyledSearchNavContainer\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n id={panelId}\n alignItems=\"center\"\n cols={['1fr', '1fr']}\n >\n <StyledSearchInput\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n id={inputId}\n // PUI-17973 \u2014 default accessible name guiding users to the result navigation; a\n // consumer-supplied aria-label (via the textinput slot) overrides this.\n aria-label={SEARCH_TOGGLE_DEFAULT_ARIA_LABEL}\n placeholder={placeholder || 'Search...'}\n value={value}\n clearable\n // passing onBlur as {undefined} breaks the input text focus ring management\n // if onBlur is not provided, we don't pass the prop at all\n // this is not expected as confirmed in conversation with Gerardo\n // we are not going to implement the fix right now to avoid potential breaking changes,\n // but we will keep an eye on this behavior and consider a fix in the future if needed.\n {...(onBlur && { onBlur })}\n onChange={handleChange}\n onKeyDown={handleInputKeyDown}\n onClear={onClear}\n />\n <SearchToggleSpinButton\n onNext={onNext}\n onPrevious={onPrevious}\n currentResultIndex={currentResultIndex}\n totalResults={totalResults}\n />\n </StyledSearchNavContainer>\n ) : null}\n </StyledNavSearchBoxContainer>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACiKf,cAIA,YAJA;AAjKR,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,SAAS,KAAK,WAAW,cAAc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AA,YACC;AAAA,YACA;AAAA,YACA,IAAI;AAAA,YACJ,YAAW;AAAA,YACX,MAAM,CAAC,OAAO,KAAK;AAAA,YAEnB;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC;AAAA,kBACA;AAAA,kBACA,IAAI;AAAA,kBAGJ,cAAY;AAAA,kBACZ,aAAa,eAAe;AAAA,kBAC5B;AAAA,kBACA,WAAS;AAAA,kBAMR,GAAI,UAAU,EAAE,OAAO;AAAA,kBACxB,UAAU;AAAA,kBACV,WAAW;AAAA,kBACX;AAAA;AAAA,cACF;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC;AAAA,kBACA;AAAA,kBACA;AAAA,kBACA;AAAA;AAAA,cACF;AAAA;AAAA;AAAA,QACF,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;",
6
6
  "names": ["React"]
7
7
  }
@@ -36,7 +36,7 @@ const StyledResultTracker = styled("div", {
36
36
  slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_TEXT
37
37
  })`
38
38
  padding: 0 8px;
39
- color: #a2a9b6; // this is color picked from the placeholder, specs doesn't specify
39
+ color: ${({ theme }) => theme.colors.neutral["500"]};
40
40
  white-space: nowrap;
41
41
  word-spacing: 2px;
42
42
  outline: none;
@@ -93,6 +93,7 @@ const SearchToggleSpinButton = React2.memo((props) => {
93
93
  getOwnerProps,
94
94
  getOwnerPropsArguments,
95
95
  role: "spinbutton",
96
+ "aria-label": "Search results",
96
97
  "aria-valuenow": currentResultIndex + 1,
97
98
  "aria-valuemin": 1,
98
99
  "aria-valuemax": totalResults,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { ChevronDown, ChevronUp } from '@elliemae/ds-icons';\nimport { styled } from '@elliemae/ds-system';\nimport React from 'react';\nimport { DSGlobalHeaderContext } from '../../../../DSGlobalHeaderContext.js';\nimport { DSGlobalHeaderName, GLOBAL_HEADER_SLOTS } from '../../../../constants/index.js';\n\nconst StyledToolbarRightAddonsWrapper = styled('div', {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_WRAPPER,\n})`\n display: flex;\n align-items: center;\n justify-content: flex-end;\n position: relative; // to position the focus-within outline\n :focus-within {\n ::after {\n content: '';\n position: absolute;\n width: calc(100% - 2px);\n height: 100%;\n border: brand-700 2px solid;\n margin: -1px;\n pointer-events: none;\n }\n }\n // we want to avoid the pseudo-border in the nested buttons\n & button:focus .pseudo-border {\n outline: none;\n border: none;\n }\n`;\nconst StyledResultTracker = styled('div', {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_TEXT,\n})`\n padding: 0 8px;\n color: #a2a9b6; // this is color picked from the placeholder, specs doesn't specify\n white-space: nowrap;\n word-spacing: 2px;\n outline: none;\n`;\nconst StyledVerticalSeparator = styled('div', {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_SEPARATOR,\n})`\n height: 20px;\n border-right: 1px solid #a2a9b6;\n`;\n// why? because when we add slots support, this should be a slot too, to customize aria-labels\nconst StyledPrevBtn = styled(DSButtonV3, {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_PREV,\n})``;\nconst StyledNextBtn = styled(DSButtonV3, {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_NEXT,\n})``;\n\ninterface SearchToggleSpinButtonPropsT {\n onNext: () => void;\n onPrevious: () => void;\n currentResultIndex: number;\n totalResults: number;\n}\n\nexport const SearchToggleSpinButton = React.memo((props: SearchToggleSpinButtonPropsT) => {\n const { onNext, onPrevious, currentResultIndex, totalResults } = props;\n const { props: propsWithDefault } = React.useContext(DSGlobalHeaderContext);\n\n const shouldShowNoResearchOngoing = currentResultIndex === -1 && !totalResults;\n const canShowFullResults = !shouldShowNoResearchOngoing && currentResultIndex !== -1;\n const shouldFallbackToTotalResultsOnly = !shouldShowNoResearchOngoing && !canShowFullResults;\n let resultText = 'n/a';\n let ariaResultsText = 'no research ongoing';\n if (canShowFullResults) {\n resultText = `${currentResultIndex + 1} / ${totalResults}`;\n ariaResultsText = `result ${currentResultIndex + 1} of ${totalResults}`;\n }\n if (shouldFallbackToTotalResultsOnly) {\n resultText = `${totalResults}`;\n ariaResultsText = `${totalResults} total results`;\n }\n\n const handleKeyDown = React.useCallback<React.KeyboardEventHandler<HTMLDivElement>>(\n (event) => {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n onNext();\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n onPrevious();\n }\n },\n [onNext, onPrevious],\n );\n const getOwnerProps = React.useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n\n return (\n <StyledToolbarRightAddonsWrapper getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <StyledResultTracker\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n role=\"spinbutton\"\n aria-valuenow={currentResultIndex + 1}\n aria-valuemin={1}\n aria-valuemax={totalResults}\n aria-valuetext={ariaResultsText}\n tabIndex={0}\n onKeyDown={handleKeyDown}\n >\n {resultText}\n </StyledResultTracker>\n <StyledVerticalSeparator getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments} />\n <StyledPrevBtn\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n buttonType=\"icon\"\n onClick={onNext}\n aria-label=\"Next search result\"\n tabIndex={-1} // part of a spinbutton, so remove from tab order\n >\n <ChevronDown color={['brand-primary', '800']} />\n </StyledPrevBtn>\n <StyledNextBtn\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n buttonType=\"icon\"\n onClick={onPrevious}\n aria-label=\"Previous search result\"\n tabIndex={-1} // part of a spinbutton, so remove from tab order\n >\n <ChevronUp color={['brand-primary', '800']} />\n </StyledNextBtn>\n </StyledToolbarRightAddonsWrapper>\n );\n});\n\nSearchToggleSpinButton.displayName = 'SearchToggleSpinButton';\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACoGnB,SACE,KADF;AApGJ,SAAS,kBAAkB;AAC3B,SAAS,aAAa,iBAAiB;AACvC,SAAS,cAAc;AACvB,OAAOA,YAAW;AAClB,SAAS,6BAA6B;AACtC,SAAS,oBAAoB,2BAA2B;AAExD,MAAM,kCAAkC,OAAO,OAAO;AAAA,EACpD,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBD,MAAM,sBAAsB,OAAO,OAAO;AAAA,EACxC,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOD,MAAM,0BAA0B,OAAO,OAAO;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAKD,MAAM,gBAAgB,OAAO,YAAY;AAAA,EACvC,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AACD,MAAM,gBAAgB,OAAO,YAAY;AAAA,EACvC,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AASM,MAAM,yBAAyBA,OAAM,KAAK,CAAC,UAAwC;AACxF,QAAM,EAAE,QAAQ,YAAY,oBAAoB,aA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AU;AAAA,QAEV,8BAAC,eAAY,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,IAChD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,YAAW;AAAA,QACX,SAAS;AAAA,QACT,cAAW;AAAA,QACX,UAAU;AAAA,QAEV,8BAAC,aAAU,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,IAC9C;AAAA,KACF;AAEJ,CAAC;AAED,uBAAuB,cAAc;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { ChevronDown, ChevronUp } from '@elliemae/ds-icons';\nimport { styled } from '@elliemae/ds-system';\nimport React from 'react';\nimport { DSGlobalHeaderContext } from '../../../../DSGlobalHeaderContext.js';\nimport { DSGlobalHeaderName, GLOBAL_HEADER_SLOTS } from '../../../../constants/index.js';\n\nconst StyledToolbarRightAddonsWrapper = styled('div', {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_WRAPPER,\n})`\n display: flex;\n align-items: center;\n justify-content: flex-end;\n position: relative; // to position the focus-within outline\n :focus-within {\n ::after {\n content: '';\n position: absolute;\n width: calc(100% - 2px);\n height: 100%;\n border: brand-700 2px solid;\n margin: -1px;\n pointer-events: none;\n }\n }\n // we want to avoid the pseudo-border in the nested buttons\n & button:focus .pseudo-border {\n outline: none;\n border: none;\n }\n`;\nconst StyledResultTracker = styled('div', {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_TEXT,\n})`\n padding: 0 8px;\n color: ${({ theme }) => theme.colors.neutral['500']};\n white-space: nowrap;\n word-spacing: 2px;\n outline: none;\n`;\nconst StyledVerticalSeparator = styled('div', {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_SEPARATOR,\n})`\n height: 20px;\n border-right: 1px solid #a2a9b6;\n`;\n// why? because when we add slots support, this should be a slot too, to customize aria-labels\nconst StyledPrevBtn = styled(DSButtonV3, {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_PREV,\n})``;\nconst StyledNextBtn = styled(DSButtonV3, {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_NEXT,\n})``;\n\ninterface SearchToggleSpinButtonPropsT {\n onNext: () => void;\n onPrevious: () => void;\n currentResultIndex: number;\n totalResults: number;\n}\n\nexport const SearchToggleSpinButton = React.memo((props: SearchToggleSpinButtonPropsT) => {\n const { onNext, onPrevious, currentResultIndex, totalResults } = props;\n const { props: propsWithDefault } = React.useContext(DSGlobalHeaderContext);\n\n const shouldShowNoResearchOngoing = currentResultIndex === -1 && !totalResults;\n const canShowFullResults = !shouldShowNoResearchOngoing && currentResultIndex !== -1;\n const shouldFallbackToTotalResultsOnly = !shouldShowNoResearchOngoing && !canShowFullResults;\n let resultText = 'n/a';\n let ariaResultsText = 'no research ongoing';\n if (canShowFullResults) {\n resultText = `${currentResultIndex + 1} / ${totalResults}`;\n ariaResultsText = `result ${currentResultIndex + 1} of ${totalResults}`;\n }\n if (shouldFallbackToTotalResultsOnly) {\n resultText = `${totalResults}`;\n ariaResultsText = `${totalResults} total results`;\n }\n\n const handleKeyDown = React.useCallback<React.KeyboardEventHandler<HTMLDivElement>>(\n (event) => {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n onNext();\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n onPrevious();\n }\n },\n [onNext, onPrevious],\n );\n const getOwnerProps = React.useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = React.useCallback(() => ({}), []);\n\n return (\n <StyledToolbarRightAddonsWrapper getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n <StyledResultTracker\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n role=\"spinbutton\"\n aria-label=\"Search results\"\n aria-valuenow={currentResultIndex + 1}\n aria-valuemin={1}\n aria-valuemax={totalResults}\n aria-valuetext={ariaResultsText}\n tabIndex={0}\n onKeyDown={handleKeyDown}\n >\n {resultText}\n </StyledResultTracker>\n <StyledVerticalSeparator getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments} />\n <StyledPrevBtn\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n buttonType=\"icon\"\n onClick={onNext}\n aria-label=\"Next search result\"\n tabIndex={-1} // part of a spinbutton, so remove from tab order\n >\n <ChevronDown color={['brand-primary', '800']} />\n </StyledPrevBtn>\n <StyledNextBtn\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n buttonType=\"icon\"\n onClick={onPrevious}\n aria-label=\"Previous search result\"\n tabIndex={-1} // part of a spinbutton, so remove from tab order\n >\n <ChevronUp color={['brand-primary', '800']} />\n </StyledNextBtn>\n </StyledToolbarRightAddonsWrapper>\n );\n});\n\nSearchToggleSpinButton.displayName = 'SearchToggleSpinButton';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACoGnB,SACE,KADF;AApGJ,SAAS,kBAAkB;AAC3B,SAAS,aAAa,iBAAiB;AACvC,SAAS,cAAc;AACvB,OAAOA,YAAW;AAClB,SAAS,6BAA6B;AACtC,SAAS,oBAAoB,2BAA2B;AAExD,MAAM,kCAAkC,OAAO,OAAO;AAAA,EACpD,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBD,MAAM,sBAAsB,OAAO,OAAO;AAAA,EACxC,MAAM;AAAA,EACN,MAAM,oBAAoB;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AgB,CAAC;AAClF,QAAM,yBAAyBA,OAAM,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC;AAE/D,SACE,qBAAC,mCAAgC,eAA8B,wBAC7D;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,MAAK;AAAA,QACL,cAAW;AAAA,QACX,iBAAe,qBAAqB;AAAA,QACpC,iBAAe;AAAA,QACf,iBAAe;AAAA,QACf,kBAAgB;AAAA,QAChB,UAAU;AAAA,QACV,WAAW;AAAA,QAEV;AAAA;AAAA,IACH;AAAA,IACA,oBAAC,2BAAwB,eAA8B,wBAAgD;AAAA,IACvG;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,YAAW;AAAA,QACX,SAAS;AAAA,QACT,cAAW;AAAA,QACX,UAAU;AAAA,QAEV,8BAAC,eAAY,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,IAChD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,YAAW;AAAA,QACX,SAAS;AAAA,QACT,cAAW;AAAA,QACX,UAAU;AAAA,QAEV,8BAAC,aAAU,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,IAC9C;AAAA,KACF;AAEJ,CAAC;AAED,uBAAuB,cAAc;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport type { DSAppPicker } from '@elliemae/ds-app-picker';\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n getPropsPerSlotPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type React from 'react';\nimport { DSGlobalHeaderName, GLOBAL_HEADER_SLOTS } from './constants/index.js';\n\nconst noop = () => null;\n\nexport const defaultProps = {\n breadcrumb: [],\n toolbar: [],\n LogoWithBrand: noop,\n Logo: noop,\n};\n\nexport declare namespace DSGlobalHeaderT {\n export interface Context {\n showIconOnly: boolean;\n fontDetector: number;\n setShowIconOnly: React.Dispatch<React.SetStateAction<boolean>>;\n instanceUID: string;\n globalHeaderToolbarGrid: string[];\n props: InternalProps;\n ownerProps: {\n getOwnerProps: () => Partial<DSGlobalHeaderT.DefaultProps>;\n getOwnerPropsArguments: () => object;\n };\n }\n /* *************************************************************************************\n \"Breadcrumb widget\" configuration types\n ****************************************************************************************\n The breadcrumb items ARE SPREADING GLOBAL PROPS!!!\n + The breadcrumb items have a logic that force the onClick to be invoked on spacebar/enter too\n forcing it even if not the standard browser behaviour as per our buttons too\n ************************************************************************************** */\n export interface BreadcrumbItemOptionals {\n hasNext?: boolean;\n isSelected?: boolean;\n onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;\n }\n export interface BreadcrumbItemRequired {\n label: string;\n }\n export interface BreadcrumbItemOptionalsGlobals\n extends Omit<GlobalAttributesT, keyof BreadcrumbItemOptionals | keyof BreadcrumbItemRequired> {}\n\n export interface BreadcrumbItem\n extends BreadcrumbItemRequired,\n BreadcrumbItemOptionals,\n BreadcrumbItemOptionalsGlobals {}\n /* *************************************************************************************\n \"Toolbar widget\" configuration types\n ****************************************************************************************\n The toolbar item can be mainly of 4 different types\n - app-picker \n more or less map to ds-app-picker interface\n - popup-menu\n should more less map to dropdownmenu-v2 but should be changed to menu-button when possible\n - search-toggle\n a custom ad hoc implementation that expands in place and expose an input text,\n kinda problematic and force-added due to unrestrained \"yes man\" attitude with PM/PO\n we will be suggesting against using it officially in the later releases and try to find a better solution.\n - custom\n a way to allow app to provide their own render props along other pre-configured widgets out of the box\n ************************************************************************************** */\n\n /* *************************************************************************************\n toolbar -> type === 'custom'\n ************************************************************************************** */\n export interface ToolbarCustomComponentProps {\n item: Record<string, unknown> & {\n type: 'custom';\n CustomComponent: React.ComponentType<ToolbarCustomComponentProps>;\n };\n setRef: (ref: HTMLElement | null) => void;\n }\n export interface ToolbarCustomItem extends Record<string, unknown> {\n type: 'custom';\n label: string;\n CustomComponent: React.ComponentType<ToolbarCustomComponentProps>;\n }\n /* *************************************************************************************\n toolbar -> type === 'ds-search-toggle'\n ************************************************************************************** */\n // this props are actually required for the out-of-the-box to actually do what it needs to do\n // it's meant to be provided from the application, so this is kind of a weird way to do controlled components\n export interface ToggleSearchComponentProps {\n onNext: () => void;\n onPrevious: () => void;\n currentResultIndex: number;\n totalResults: number;\n placeholder: string;\n value: string;\n onChange: (value: string) => void;\n onBlur?: () => void;\n onClear: () => void;\n isOpen: boolean;\n onKeyDown: (event: React.KeyboardEvent) => void;\n onClick: (event: React.MouseEvent) => void;\n triggerRef: React.MutableRefObject<HTMLButtonElement>;\n searchContainerRef: React.MutableRefObject<HTMLDivElement>;\n }\n // WE ARE SPREADING GLOBAL PROPS!!!\n export interface SearchToggleProps extends GlobalAttributesT {\n setRef: (ref: HTMLButtonElement | null) => void;\n label: string;\n componentProps: ToggleSearchComponentProps;\n // https://jira.elliemae.io/browse/PUI-17852\n // - Generic aria-labels\n // -> allows users to specify a custom aria-label when the search toggle is expanded\n // -> it's an incremental change, so its \"optional\", we fall back to the previous hardcoded \"Close search\" if not provided\n // but authors are encouraged to improve the Aria-label with context-specific information when possible, to improve the overall accessibility of the component.\n ariaLabelExpanded?: string;\n // aria-controls needs to point to a DOM id, we need to make sure there are no conflicts in case of multiple search toggles on the same page\n instanceUID: Context['instanceUID'];\n }\n export interface ToolbarSearchToggleItem {\n type: 'ds-search-toggle';\n label: string;\n componentProps: ToggleSearchComponentProps;\n }\n /* *************************************************************************************\n toolbar -> type === 'ds-popup-menu'\n ************************************************************************************** */\n\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface PopupMenuContentItem extends Omit<GlobalAttributesT, 'type' | 'label' | 'onClick'> {\n type?: 'separator' | 'custom';\n Icon?: React.ComponentType<{ fill?: string; size?: string }>;\n label?: string;\n onClick?: (event: React.MouseEvent) => void;\n closeOnClick?: boolean;\n Content?: React.ComponentType;\n }\n export interface PopupMenuComponentProps {\n onClickOutside?: (e: MouseEvent | TouchEvent) => void;\n onKeyPress: (event: React.KeyboardEvent) => void;\n popupOnKeyPress: (event: React.KeyboardEvent) => void;\n isOpen: boolean;\n options: PopupMenuContentItem[];\n closeOnClick: boolean;\n }\n // this is the only type that was pre-existing (even if differently defined)\n // and that's why it doesn't include Toolbar at the start\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface PopupMenuItem extends Omit<GlobalAttributesT, 'type' | 'label' | 'onClick'> {\n type: 'ds-popup-menu';\n Icon?: React.ComponentType<{ fill?: string; size?: string }>;\n label?: string;\n onClick?: (event: React.MouseEvent) => void;\n Content?: React.ComponentType;\n componentProps: PopupMenuComponentProps;\n }\n\n export interface PopupMenuContentProps {\n options: PopupMenuContentItem[];\n onItemClick: () => void;\n onClose: () => void;\n popupOnKeyPress: (event: React.KeyboardEvent) => void;\n setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;\n ownerProps: {\n getOwnerProps: () => Partial<DSGlobalHeaderT.DefaultProps>;\n getOwnerPropsArguments: () => object;\n };\n }\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface PopupProps extends Omit<GlobalAttributesT, 'title' | 'label' | 'onClick'> {\n Icon?: React.ComponentType<{ fill?: string; size?: string }>;\n onClick?: (event: React.MouseEvent) => void;\n setRef: (ref: HTMLElement) => void;\n componentProps: PopupMenuComponentProps;\n title?: string; // this was probably not intended, but removing this means the HTML will not print the title={label}\n // keeping this for now, if A11y says otherwise we will do the proper steps to remove it\n ownerProps: {\n getOwnerProps: () => Partial<DSGlobalHeaderT.DefaultProps>;\n getOwnerPropsArguments: () => object;\n };\n }\n\n /* *************************************************************************************\n toolbar -> type === 'ds-app-picker'\n ************************************************************************************** */\n export type AppPickerComponentProps = React.ComponentProps<typeof DSAppPicker> & {\n triggerOnClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface AppPickerProps extends Omit<GlobalAttributesT, 'label'> {\n label: string;\n componentProps: AppPickerComponentProps;\n }\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface ToolbarAppPickerItem extends Omit<GlobalAttributesT, 'type' | 'label'> {\n type: 'ds-app-picker';\n label: string;\n componentProps: AppPickerComponentProps;\n }\n\n /* *************************************************************************************\n toolbar -> type === undefined (fallback default)\n ************************************************************************************** */\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface ToolbarItemTypelessDefault extends Omit<GlobalAttributesT, 'label'> {\n type?: undefined;\n label: string;\n Icon: React.ComponentType<{ fill?: string; size?: string }>;\n }\n\n export type ToolbarItem =\n | ToolbarCustomItem\n | ToolbarSearchToggleItem\n | ToolbarAppPickerItem\n | PopupMenuItem // this is the only type that was pre-existing and that's why it doesn't include Toolbar at the start\n | ToolbarItemTypelessDefault;\n\n export type SlotFunctionArguments = {\n dsGlobalheaderRoot: () => Record<string, never>;\n dsGlobalheaderLogoContainer: () => Record<string, never>;\n dsGlobalheaderBreadcrumbContainer: () => Record<string, never>;\n dsGlobalheaderBreadcrumbPipe: () => Record<string, never>;\n dsGlobalheaderBreadcrumbChevron: () => Record<string, never>;\n dsGlobalheaderBreadcrumbList: () => Record<string, never>;\n dsGlobalheaderBreadcrumbItem: () => Record<string, never>;\n dsGlobalheaderBreadcrumbItemLink: () => Record<string, never>;\n dsGlobalheaderBreadcrumbItemLinkLabel: () => Record<string, never>;\n dsGlobalheaderMenubarContainer: () => Record<string, never>;\n dsGlobalheaderMenubarList: () => Record<string, never>;\n dsGlobalheaderMenubarItem: () => Record<string, never>;\n dsGlobalheaderMenubarItemButton: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuList: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuItem: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuItemButton: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuSeparator: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuItemLabel: () => Record<string, never>;\n dsGlobalheaderMenubarItemSearchtoggleContainer: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonWrapper: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonText: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonSeparator: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonPrev: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonNext: () => Record<string, never>;\n dsGlobalheaderSearchtoggleTextinput: () => Record<string, never>;\n dsGlobalheaderSearchtoggleTriggerButton: () => Record<string, never>;\n dsGlobalheaderSearchtoggleExpandedContentWrapper: () => Record<string, never>;\n };\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n Logo: React.ComponentType;\n LogoWithBrand: React.ComponentType;\n breadcrumb: DSGlobalHeaderT.BreadcrumbItem[];\n toolbar: DSGlobalHeaderT.ToolbarItem[];\n CustomNavigation: React.ComponentType;\n }\n\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSGlobalHeaderName, typeof GLOBAL_HEADER_SLOTS> {}\n\n export interface Props\n extends Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const DSGlobalHeaderPropTypes: DSPropTypesSchema<DSGlobalHeaderT.Props> = {\n ...getPropsPerSlotPropTypes(DSGlobalHeaderName, GLOBAL_HEADER_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n CustomNavigation: PropTypes.func\n .description(\n 'Component to use instead of the standard breadcrumb out of the box configuration for custom scenarios',\n )\n .defaultValue('() => JSX.Element'),\n Logo: PropTypes.func\n .description('Global Header Logo to render. Logo and LogoWithBrand are going to swap during window resizing.')\n .defaultValue('() => JSX.Element'),\n LogoWithBrand: PropTypes.func\n .description(\n 'Global Header Logo With Brand title to render. Logo and LogoWithBrand are going to swap during window resizing.',\n )\n .defaultValue('() => JSX.Element'),\n breadcrumb: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string.description('breadrcrumb item label'),\n hasNext: PropTypes.bool.description('whether the item has a child or not'),\n isSelected: PropTypes.bool.description('whether the item is selected or not'),\n onClick: PropTypes.func.description('Callback executed on click'),\n }),\n )\n .description('Breadcrumb items to display. Max 3 levels. Compatible with GlobalAttributes.')\n .defaultValue('[]'),\n toolbar: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string.description('title tag description'),\n type: PropTypes.oneOf(['ds-app-picker', 'ds-popup-menu', 'ds-search-toggle', 'custom']).description(\n 'use to select one of the out-of-the-box types of items',\n ),\n componentProps: PropTypes.object.description('props of out-of-the-box component'),\n Icon: PropTypes.func.description('Icon to display'),\n onClick: PropTypes.func.description('Callback executed on click'),\n }),\n )\n .description('Toolbar items. Compatible with GlobalAttributes.')\n .defaultValue('[]'),\n};\n// kept for legacy reasons, this is now named differently, but we want no breaking changes.\nexport const propTypes = DSGlobalHeaderPropTypes;\n\nexport const DSGlobalHeaderPropTypesSchema = DSGlobalHeaderPropTypes as unknown as ValidationMap<DSGlobalHeaderT.Props>;\n"],
5
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C9D,aAAa,IAAI;AACtB;AAEO,MAAM,YAAY;AAElB,MAAM,gCAAgC;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport type { DSAppPicker } from '@elliemae/ds-app-picker';\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n globalAttributesPropTypes,\n getPropsPerSlotPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type React from 'react';\nimport { DSGlobalHeaderName, GLOBAL_HEADER_SLOTS } from './constants/index.js';\n\nconst noop = () => null;\n\nexport const defaultProps = {\n breadcrumb: [],\n toolbar: [],\n LogoWithBrand: noop,\n Logo: noop,\n};\n\nexport declare namespace DSGlobalHeaderT {\n export interface Context {\n showIconOnly: boolean;\n fontDetector: number;\n setShowIconOnly: React.Dispatch<React.SetStateAction<boolean>>;\n instanceUID: string;\n globalHeaderToolbarGrid: string[];\n props: InternalProps;\n ownerProps: {\n getOwnerProps: () => Partial<DSGlobalHeaderT.DefaultProps>;\n getOwnerPropsArguments: () => object;\n };\n }\n /* *************************************************************************************\n \"Breadcrumb widget\" configuration types\n ****************************************************************************************\n The breadcrumb items ARE SPREADING GLOBAL PROPS!!!\n + The breadcrumb items have a logic that force the onClick to be invoked on spacebar/enter too\n forcing it even if not the standard browser behaviour as per our buttons too\n ************************************************************************************** */\n export interface BreadcrumbItemOptionals {\n hasNext?: boolean;\n isSelected?: boolean;\n onClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;\n }\n export interface BreadcrumbItemRequired {\n label: string;\n }\n export interface BreadcrumbItemOptionalsGlobals extends Omit<\n GlobalAttributesT,\n keyof BreadcrumbItemOptionals | keyof BreadcrumbItemRequired\n > {}\n\n export interface BreadcrumbItem\n extends BreadcrumbItemRequired, BreadcrumbItemOptionals, BreadcrumbItemOptionalsGlobals {}\n /* *************************************************************************************\n \"Toolbar widget\" configuration types\n ****************************************************************************************\n The toolbar item can be mainly of 4 different types\n - app-picker \n more or less map to ds-app-picker interface\n - popup-menu\n should more less map to dropdownmenu-v2 but should be changed to menu-button when possible\n - search-toggle\n a custom ad hoc implementation that expands in place and expose an input text,\n kinda problematic and force-added due to unrestrained \"yes man\" attitude with PM/PO\n we will be suggesting against using it officially in the later releases and try to find a better solution.\n - custom\n a way to allow app to provide their own render props along other pre-configured widgets out of the box\n ************************************************************************************** */\n\n /* *************************************************************************************\n toolbar -> type === 'custom'\n ************************************************************************************** */\n export interface ToolbarCustomComponentProps {\n item: Record<string, unknown> & {\n type: 'custom';\n CustomComponent: React.ComponentType<ToolbarCustomComponentProps>;\n };\n setRef: (ref: HTMLElement | null) => void;\n }\n export interface ToolbarCustomItem extends Record<string, unknown> {\n type: 'custom';\n label: string;\n CustomComponent: React.ComponentType<ToolbarCustomComponentProps>;\n }\n /* *************************************************************************************\n toolbar -> type === 'ds-search-toggle'\n ************************************************************************************** */\n // this props are actually required for the out-of-the-box to actually do what it needs to do\n // it's meant to be provided from the application, so this is kind of a weird way to do controlled components\n export interface ToggleSearchComponentProps {\n onNext: () => void;\n onPrevious: () => void;\n currentResultIndex: number;\n totalResults: number;\n placeholder: string;\n value: string;\n onChange: (value: string) => void;\n onBlur?: () => void;\n onClear: () => void;\n isOpen: boolean;\n onKeyDown: (event: React.KeyboardEvent) => void;\n onClick: (event: React.MouseEvent) => void;\n triggerRef: React.MutableRefObject<HTMLButtonElement>;\n searchContainerRef: React.MutableRefObject<HTMLDivElement>;\n }\n // WE ARE SPREADING GLOBAL PROPS!!!\n export interface SearchToggleProps extends GlobalAttributesT {\n setRef: (ref: HTMLButtonElement | null) => void;\n label: string;\n componentProps: ToggleSearchComponentProps;\n // https://jira.elliemae.io/browse/PUI-17852\n // - Generic aria-labels\n // -> allows users to specify a custom aria-label when the search toggle is expanded\n // -> it's an incremental change, so its \"optional\", we fall back to the previous hardcoded \"Close search\" if not provided\n // but authors are encouraged to improve the Aria-label with context-specific information when possible, to improve the overall accessibility of the component.\n ariaLabelExpanded?: string;\n // aria-controls needs to point to a DOM id, we need to make sure there are no conflicts in case of multiple search toggles on the same page\n instanceUID: Context['instanceUID'];\n }\n export interface ToolbarSearchToggleItem {\n type: 'ds-search-toggle';\n label: string;\n componentProps: ToggleSearchComponentProps;\n }\n /* *************************************************************************************\n toolbar -> type === 'ds-popup-menu'\n ************************************************************************************** */\n\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface PopupMenuContentItem extends Omit<GlobalAttributesT, 'type' | 'label' | 'onClick'> {\n type?: 'separator' | 'custom';\n Icon?: React.ComponentType<{ fill?: string; size?: string }>;\n label?: string;\n onClick?: (event: React.MouseEvent) => void;\n closeOnClick?: boolean;\n Content?: React.ComponentType;\n }\n export interface PopupMenuComponentProps {\n onClickOutside?: (e: MouseEvent | TouchEvent) => void;\n onKeyPress: (event: React.KeyboardEvent) => void;\n popupOnKeyPress: (event: React.KeyboardEvent) => void;\n isOpen: boolean;\n options: PopupMenuContentItem[];\n closeOnClick: boolean;\n }\n // this is the only type that was pre-existing (even if differently defined)\n // and that's why it doesn't include Toolbar at the start\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface PopupMenuItem extends Omit<GlobalAttributesT, 'type' | 'label' | 'onClick'> {\n type: 'ds-popup-menu';\n Icon?: React.ComponentType<{ fill?: string; size?: string }>;\n label?: string;\n onClick?: (event: React.MouseEvent) => void;\n Content?: React.ComponentType;\n componentProps: PopupMenuComponentProps;\n }\n\n export interface PopupMenuContentProps {\n options: PopupMenuContentItem[];\n onItemClick: () => void;\n onClose: () => void;\n popupOnKeyPress: (event: React.KeyboardEvent) => void;\n setIsOpen: () => void;\n ownerProps: {\n getOwnerProps: () => Partial<DSGlobalHeaderT.DefaultProps>;\n getOwnerPropsArguments: () => object;\n };\n }\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface PopupProps extends Omit<GlobalAttributesT, 'title' | 'label' | 'onClick'> {\n Icon?: React.ComponentType<{ fill?: string; size?: string }>;\n onClick?: (event: React.MouseEvent) => void;\n setRef: (ref: HTMLElement) => void;\n componentProps: PopupMenuComponentProps;\n title?: string; // this was probably not intended, but removing this means the HTML will not print the title={label}\n // keeping this for now, if A11y says otherwise we will do the proper steps to remove it\n ownerProps: {\n getOwnerProps: () => Partial<DSGlobalHeaderT.DefaultProps>;\n getOwnerPropsArguments: () => object;\n };\n }\n\n /* *************************************************************************************\n toolbar -> type === 'ds-app-picker'\n ************************************************************************************** */\n export type AppPickerComponentProps = React.ComponentProps<typeof DSAppPicker> & {\n triggerOnClick?: React.MouseEventHandler<HTMLButtonElement>;\n };\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface AppPickerProps extends Omit<GlobalAttributesT, 'label'> {\n label: string;\n componentProps: AppPickerComponentProps;\n }\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface ToolbarAppPickerItem extends Omit<GlobalAttributesT, 'type' | 'label'> {\n type: 'ds-app-picker';\n label: string;\n componentProps: AppPickerComponentProps;\n }\n\n /* *************************************************************************************\n toolbar -> type === undefined (fallback default)\n ************************************************************************************** */\n // WE ARE SPREADING GLOBAL PROPS!!!\n // WE ARE ALSO OVERRIDING SOME GLOBAL KEYS!\n export interface ToolbarItemTypelessDefault extends Omit<GlobalAttributesT, 'label'> {\n type?: undefined;\n label: string;\n Icon: React.ComponentType<{ fill?: string; size?: string }>;\n }\n\n export type ToolbarItem =\n | ToolbarCustomItem\n | ToolbarSearchToggleItem\n | ToolbarAppPickerItem\n | PopupMenuItem // this is the only type that was pre-existing and that's why it doesn't include Toolbar at the start\n | ToolbarItemTypelessDefault;\n\n export type SlotFunctionArguments = {\n dsGlobalheaderRoot: () => Record<string, never>;\n dsGlobalheaderLogoContainer: () => Record<string, never>;\n dsGlobalheaderBreadcrumbContainer: () => Record<string, never>;\n dsGlobalheaderBreadcrumbPipe: () => Record<string, never>;\n dsGlobalheaderBreadcrumbChevron: () => Record<string, never>;\n dsGlobalheaderBreadcrumbList: () => Record<string, never>;\n dsGlobalheaderBreadcrumbItem: () => Record<string, never>;\n dsGlobalheaderBreadcrumbItemLink: () => Record<string, never>;\n dsGlobalheaderBreadcrumbItemLinkLabel: () => Record<string, never>;\n dsGlobalheaderMenubarContainer: () => Record<string, never>;\n dsGlobalheaderMenubarList: () => Record<string, never>;\n dsGlobalheaderMenubarItem: () => Record<string, never>;\n dsGlobalheaderMenubarItemButton: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuList: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuItem: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuItemButton: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuSeparator: () => Record<string, never>;\n dsGlobalheaderMenubarItemPopupmenuItemLabel: () => Record<string, never>;\n dsGlobalheaderMenubarItemSearchtoggleContainer: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonWrapper: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonText: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonSeparator: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonPrev: () => Record<string, never>;\n dsGlobalheaderSearchtoggleSpinbuttonNext: () => Record<string, never>;\n dsGlobalheaderSearchtoggleTextinput: () => Record<string, never>;\n dsGlobalheaderSearchtoggleTriggerButton: () => Record<string, never>;\n dsGlobalheaderSearchtoggleExpandedContentWrapper: () => Record<string, never>;\n };\n\n export interface RequiredProps {}\n\n export interface DefaultProps {\n Logo: React.ComponentType;\n LogoWithBrand: React.ComponentType;\n breadcrumb: DSGlobalHeaderT.BreadcrumbItem[];\n toolbar: DSGlobalHeaderT.ToolbarItem[];\n CustomNavigation: React.ComponentType;\n }\n\n export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSGlobalHeaderName,\n typeof GLOBAL_HEADER_SLOTS\n > {}\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\nexport const DSGlobalHeaderPropTypes: DSPropTypesSchema<DSGlobalHeaderT.Props> = {\n ...getPropsPerSlotPropTypes(DSGlobalHeaderName, GLOBAL_HEADER_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n CustomNavigation: PropTypes.func\n .description(\n 'Component to use instead of the standard breadcrumb out of the box configuration for custom scenarios',\n )\n .defaultValue('() => JSX.Element'),\n Logo: PropTypes.func\n .description('Global Header Logo to render. Logo and LogoWithBrand are going to swap during window resizing.')\n .defaultValue('() => JSX.Element'),\n LogoWithBrand: PropTypes.func\n .description(\n 'Global Header Logo With Brand title to render. Logo and LogoWithBrand are going to swap during window resizing.',\n )\n .defaultValue('() => JSX.Element'),\n breadcrumb: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string.description('breadrcrumb item label'),\n hasNext: PropTypes.bool.description('whether the item has a child or not'),\n isSelected: PropTypes.bool.description('whether the item is selected or not'),\n onClick: PropTypes.func.description('Callback executed on click'),\n }),\n )\n .description('Breadcrumb items to display. Max 3 levels. Compatible with GlobalAttributes.')\n .defaultValue('[]'),\n toolbar: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string.description('title tag description'),\n type: PropTypes.oneOf(['ds-app-picker', 'ds-popup-menu', 'ds-search-toggle', 'custom']).description(\n 'use to select one of the out-of-the-box types of items',\n ),\n componentProps: PropTypes.object.description('props of out-of-the-box component'),\n Icon: PropTypes.func.description('Icon to display'),\n onClick: PropTypes.func.description('Callback executed on click'),\n }),\n )\n .description('Toolbar items. Compatible with GlobalAttributes.')\n .defaultValue('[]'),\n};\n// kept for legacy reasons, this is now named differently, but we want no breaking changes.\nexport const propTypes = DSGlobalHeaderPropTypes;\n\nexport const DSGlobalHeaderPropTypesSchema = DSGlobalHeaderPropTypes as unknown as ValidationMap<DSGlobalHeaderT.Props>;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACGvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,oBAAoB,2BAA2B;AAExD,MAAM,OAAO,MAAM;AAEZ,MAAM,eAAe;AAAA,EAC1B,YAAY,CAAC;AAAA,EACb,SAAS,CAAC;AAAA,EACV,eAAe;AAAA,EACf,MAAM;AACR;AA6QO,MAAM,0BAAoE;AAAA,EAC/E,GAAG,yBAAyB,oBAAoB,mBAAmB;AAAA,EACnE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,kBAAkB,UAAU,KACzB;AAAA,IACC;AAAA,EACF,EACC,aAAa,mBAAmB;AAAA,EACnC,MAAM,UAAU,KACb,YAAY,gGAAgG,EAC5G,aAAa,mBAAmB;AAAA,EACnC,eAAe,UAAU,KACtB;AAAA,IACC;AAAA,EACF,EACC,aAAa,mBAAmB;AAAA,EACnC,YAAY,UAAU;AAAA,IACpB,UAAU,MAAM;AAAA,MACd,OAAO,UAAU,OAAO,YAAY,wBAAwB;AAAA,MAC5D,SAAS,UAAU,KAAK,YAAY,qCAAqC;AAAA,MACzE,YAAY,UAAU,KAAK,YAAY,qCAAqC;AAAA,MAC5E,SAAS,UAAU,KAAK,YAAY,4BAA4B;AAAA,IAClE,CAAC;AAAA,EACH,EACG,YAAY,8EAA8E,EAC1F,aAAa,IAAI;AAAA,EACpB,SAAS,UAAU;AAAA,IACjB,UAAU,MAAM;AAAA,MACd,OAAO,UAAU,OAAO,YAAY,uBAAuB;AAAA,MAC3D,MAAM,UAAU,MAAM,CAAC,iBAAiB,iBAAiB,oBAAoB,QAAQ,CAAC,EAAE;AAAA,QACtF;AAAA,MACF;AAAA,MACA,gBAAgB,UAAU,OAAO,YAAY,mCAAmC;AAAA,MAChF,MAAM,UAAU,KAAK,YAAY,iBAAiB;AAAA,MAClD,SAAS,UAAU,KAAK,YAAY,4BAA4B;AAAA,IAClE,CAAC;AAAA,EACH,EACG,YAAY,kDAAkD,EAC9D,aAAa,IAAI;AACtB;AAEO,MAAM,YAAY;AAElB,MAAM,gCAAgC;",
6
6
  "names": []
7
7
  }
@@ -151,6 +151,7 @@ export declare const GLOBAL_HEADER_SLOTS: {
151
151
  readonly MENUBAR_POPUP_MENU_ITEM_BUTTON_LABEL: string;
152
152
  readonly MENUBAR_SEARCH_TOGGLE_CONTAINER: string;
153
153
  };
154
+ export declare const SEARCH_TOGGLE_DEFAULT_ARIA_LABEL = "Search. Press Tab twice to reach the result navigation.";
154
155
  export declare const GLOBAL_HEADER_DATA_TESTID: {
155
156
  SEARCH_TOGGLE_TRIGGER_BUTTON: string;
156
157
  CONTAINER: string;
@@ -7,5 +7,5 @@ type PureBreadcrumbProps = DSGlobalHeaderT.BreadcrumbItem & {
7
7
  getOwnerPropsArguments: () => object;
8
8
  };
9
9
  };
10
- export declare const PureBreadcrumb: React.MemoExoticComponent<({ onClick, isSelected, fullBreadcrumbListLength, label, hasNext, ownerProps, ...rest }: PureBreadcrumbProps) => import("react/jsx-runtime.js").JSX.Element>;
10
+ export declare const PureBreadcrumb: React.MemoExoticComponent<({ onClick, isSelected, fullBreadcrumbListLength, label, hasNext, ownerProps, ...rest }: PureBreadcrumbProps) => React.JSX.Element>;
11
11
  export {};
@@ -11,7 +11,7 @@ interface LabelT {
11
11
  export declare const StyledBreadcrumbContainer: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>>, never>;
12
12
  export declare const StyledBreadcrumbList: import("styled-components").StyledComponent<"ul", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"ul">, never>;
13
13
  export declare const StyledPipe: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, PipeT & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
14
- export declare const StyledChevron: import("styled-components").StyledComponent<(rest: import("@elliemae/ds-icons").SvgIconT.Props) => import("react/jsx-runtime.js").JSX.Element, import("@elliemae/ds-system").Theme, ChevronT & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<(rest: import("@elliemae/ds-icons").SvgIconT.Props) => import("react/jsx-runtime.js").JSX.Element>, never>;
14
+ export declare const StyledChevron: import("styled-components").StyledComponent<(rest: import("@elliemae/ds-icons").SvgIconT.Props) => import("react").JSX.Element, import("@elliemae/ds-system").Theme, ChevronT & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<(rest: import("@elliemae/ds-icons").SvgIconT.Props) => import("react").JSX.Element>, never>;
15
15
  export declare const StyledBreadcrumbItem: import("styled-components").StyledComponent<"li", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"li">, never>;
16
16
  export declare const StyledLink: import("styled-components").StyledComponent<"a", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"a">, never>;
17
17
  export declare const StyledLabel: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, LabelT & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
@@ -5,5 +5,5 @@ interface SearchToggleSpinButtonPropsT {
5
5
  currentResultIndex: number;
6
6
  totalResults: number;
7
7
  }
8
- export declare const SearchToggleSpinButton: React.MemoExoticComponent<(props: SearchToggleSpinButtonPropsT) => import("react/jsx-runtime.js").JSX.Element>;
8
+ export declare const SearchToggleSpinButton: React.MemoExoticComponent<(props: SearchToggleSpinButtonPropsT) => React.JSX.Element>;
9
9
  export {};
@@ -109,7 +109,7 @@ export declare namespace DSGlobalHeaderT {
109
109
  onItemClick: () => void;
110
110
  onClose: () => void;
111
111
  popupOnKeyPress: (event: React.KeyboardEvent) => void;
112
- setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
112
+ setIsOpen: () => void;
113
113
  ownerProps: {
114
114
  getOwnerProps: () => Partial<DSGlobalHeaderT.DefaultProps>;
115
115
  getOwnerPropsArguments: () => object;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-global-header",
3
- "version": "3.70.0-next.6",
3
+ "version": "3.70.0-next.60",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Global Header",
6
6
  "files": [
@@ -37,27 +37,27 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "uid": "^2.0.2",
40
- "@elliemae/ds-button-v2": "3.70.0-next.6",
41
- "@elliemae/ds-floating-context": "3.70.0-next.6",
42
- "@elliemae/ds-hooks-fontsize-media": "3.70.0-next.6",
43
- "@elliemae/ds-form-input-text": "3.70.0-next.6",
44
- "@elliemae/ds-app-picker": "3.70.0-next.6",
45
- "@elliemae/ds-grid": "3.70.0-next.6",
46
- "@elliemae/ds-props-helpers": "3.70.0-next.6",
47
- "@elliemae/ds-icons": "3.70.0-next.6",
48
- "@elliemae/ds-system": "3.70.0-next.6"
40
+ "@elliemae/ds-app-picker": "3.70.0-next.60",
41
+ "@elliemae/ds-form-input-text": "3.70.0-next.60",
42
+ "@elliemae/ds-button-v2": "3.70.0-next.60",
43
+ "@elliemae/ds-floating-context": "3.70.0-next.60",
44
+ "@elliemae/ds-grid": "3.70.0-next.60",
45
+ "@elliemae/ds-hooks-fontsize-media": "3.70.0-next.60",
46
+ "@elliemae/ds-props-helpers": "3.70.0-next.60",
47
+ "@elliemae/ds-system": "3.70.0-next.60",
48
+ "@elliemae/ds-icons": "3.70.0-next.60"
49
49
  },
50
50
  "devDependencies": {
51
51
  "jest": "^30.0.0",
52
- "styled-components": "~5.3.9",
53
- "@elliemae/ds-monorepo-devops": "3.70.0-next.6",
54
- "@elliemae/ds-test-utils": "3.70.0-next.6"
52
+ "styled-components": "~5.3.11",
53
+ "@elliemae/ds-monorepo-devops": "3.70.0-next.60",
54
+ "@elliemae/ds-test-utils": "3.70.0-next.60"
55
55
  },
56
56
  "peerDependencies": {
57
- "lodash-es": "^4.17.21",
57
+ "lodash-es": "^4.18.1",
58
58
  "react": "^18.3.1",
59
59
  "react-dom": "^18.3.1",
60
- "styled-components": "~5.3.9"
60
+ "styled-components": "~5.3.11"
61
61
  },
62
62
  "publishConfig": {
63
63
  "access": "public",
@@ -72,4 +72,4 @@
72
72
  "build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
73
73
  "checkDeps": "npx -yes ../../util/ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
74
74
  }
75
- }
75
+ }
@@ -1,60 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var useOnClickOutside_exports = {};
30
- __export(useOnClickOutside_exports, {
31
- useOnClickOutside: () => useOnClickOutside
32
- });
33
- module.exports = __toCommonJS(useOnClickOutside_exports);
34
- var React = __toESM(require("react"));
35
- var import_react = __toESM(require("react"));
36
- function useOnClickOutside(ref, cb) {
37
- const cbRef = import_react.default.useRef(cb);
38
- (0, import_react.useEffect)(() => {
39
- cbRef.current = cb;
40
- }, [cb]);
41
- (0, import_react.useEffect)(() => {
42
- if (!ref) {
43
- return () => {
44
- };
45
- }
46
- const listener = (event) => {
47
- const target = event.target;
48
- if (!target) return;
49
- if (ref.contains(target)) return;
50
- cbRef.current(event);
51
- };
52
- document.addEventListener("mousedown", listener, true);
53
- document.addEventListener("touchstart", listener, true);
54
- return () => {
55
- document.removeEventListener("mousedown", listener, true);
56
- document.removeEventListener("touchstart", listener, true);
57
- };
58
- }, [ref]);
59
- }
60
- //# sourceMappingURL=useOnClickOutside.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/hooks/useOnClickOutside.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useEffect } from 'react';\n\nexport function useOnClickOutside<T extends Node>(ref: T | null, cb: (event: Event) => void): void {\n const cbRef = React.useRef(cb);\n\n useEffect(() => {\n cbRef.current = cb;\n }, [cb]);\n\n useEffect(() => {\n if (!ref) {\n return () => {};\n }\n\n const listener = (event: MouseEvent | TouchEvent) => {\n const target = event.target as Node | null;\n if (!target) return;\n\n if (ref.contains(target)) return;\n\n cbRef.current(event);\n };\n\n document.addEventListener('mousedown', listener, true);\n document.addEventListener('touchstart', listener, true);\n\n return () => {\n document.removeEventListener('mousedown', listener, true);\n document.removeEventListener('touchstart', listener, true);\n };\n }, [ref]);\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAiC;AAE1B,SAAS,kBAAkC,KAAe,IAAkC;AACjG,QAAM,QAAQ,aAAAA,QAAM,OAAO,EAAE;AAE7B,8BAAU,MAAM;AACd,UAAM,UAAU;AAAA,EAClB,GAAG,CAAC,EAAE,CAAC;AAEP,8BAAU,MAAM;AACd,QAAI,CAAC,KAAK;AACR,aAAO,MAAM;AAAA,MAAC;AAAA,IAChB;AAEA,UAAM,WAAW,CAAC,UAAmC;AACnD,YAAM,SAAS,MAAM;AACrB,UAAI,CAAC,OAAQ;AAEb,UAAI,IAAI,SAAS,MAAM,EAAG;AAE1B,YAAM,QAAQ,KAAK;AAAA,IACrB;AAEA,aAAS,iBAAiB,aAAa,UAAU,IAAI;AACrD,aAAS,iBAAiB,cAAc,UAAU,IAAI;AAEtD,WAAO,MAAM;AACX,eAAS,oBAAoB,aAAa,UAAU,IAAI;AACxD,eAAS,oBAAoB,cAAc,UAAU,IAAI;AAAA,IAC3D;AAAA,EACF,GAAG,CAAC,GAAG,CAAC;AACV;",
6
- "names": ["React"]
7
- }
@@ -1,30 +0,0 @@
1
- import * as React from "react";
2
- import React2, { useEffect } from "react";
3
- function useOnClickOutside(ref, cb) {
4
- const cbRef = React2.useRef(cb);
5
- useEffect(() => {
6
- cbRef.current = cb;
7
- }, [cb]);
8
- useEffect(() => {
9
- if (!ref) {
10
- return () => {
11
- };
12
- }
13
- const listener = (event) => {
14
- const target = event.target;
15
- if (!target) return;
16
- if (ref.contains(target)) return;
17
- cbRef.current(event);
18
- };
19
- document.addEventListener("mousedown", listener, true);
20
- document.addEventListener("touchstart", listener, true);
21
- return () => {
22
- document.removeEventListener("mousedown", listener, true);
23
- document.removeEventListener("touchstart", listener, true);
24
- };
25
- }, [ref]);
26
- }
27
- export {
28
- useOnClickOutside
29
- };
30
- //# sourceMappingURL=useOnClickOutside.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/hooks/useOnClickOutside.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useEffect } from 'react';\n\nexport function useOnClickOutside<T extends Node>(ref: T | null, cb: (event: Event) => void): void {\n const cbRef = React.useRef(cb);\n\n useEffect(() => {\n cbRef.current = cb;\n }, [cb]);\n\n useEffect(() => {\n if (!ref) {\n return () => {};\n }\n\n const listener = (event: MouseEvent | TouchEvent) => {\n const target = event.target as Node | null;\n if (!target) return;\n\n if (ref.contains(target)) return;\n\n cbRef.current(event);\n };\n\n document.addEventListener('mousedown', listener, true);\n document.addEventListener('touchstart', listener, true);\n\n return () => {\n document.removeEventListener('mousedown', listener, true);\n document.removeEventListener('touchstart', listener, true);\n };\n }, [ref]);\n}\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,UAAS,iBAAiB;AAE1B,SAAS,kBAAkC,KAAe,IAAkC;AACjG,QAAM,QAAQA,OAAM,OAAO,EAAE;AAE7B,YAAU,MAAM;AACd,UAAM,UAAU;AAAA,EAClB,GAAG,CAAC,EAAE,CAAC;AAEP,YAAU,MAAM;AACd,QAAI,CAAC,KAAK;AACR,aAAO,MAAM;AAAA,MAAC;AAAA,IAChB;AAEA,UAAM,WAAW,CAAC,UAAmC;AACnD,YAAM,SAAS,MAAM;AACrB,UAAI,CAAC,OAAQ;AAEb,UAAI,IAAI,SAAS,MAAM,EAAG;AAE1B,YAAM,QAAQ,KAAK;AAAA,IACrB;AAEA,aAAS,iBAAiB,aAAa,UAAU,IAAI;AACrD,aAAS,iBAAiB,cAAc,UAAU,IAAI;AAEtD,WAAO,MAAM;AACX,eAAS,oBAAoB,aAAa,UAAU,IAAI;AACxD,eAAS,oBAAoB,cAAc,UAAU,IAAI;AAAA,IAC3D;AAAA,EACF,GAAG,CAAC,GAAG,CAAC;AACV;",
6
- "names": ["React"]
7
- }
@@ -1 +0,0 @@
1
- export declare function useOnClickOutside<T extends Node>(ref: T | null, cb: (event: Event) => void): void;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};