@elliemae/ds-global-header 3.60.0-next.32 → 3.60.0-next.34

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.
@@ -107,10 +107,10 @@ const SearchToggleSpinButton = import_react.default.memo((props) => {
107
107
  }
108
108
  const handleKeyDown = import_react.default.useCallback(
109
109
  (event) => {
110
- if (event.key === "ArrowDown") {
110
+ if (event.key === "ArrowUp") {
111
111
  event.preventDefault();
112
112
  onNext();
113
- } else if (event.key === "ArrowUp") {
113
+ } else if (event.key === "ArrowDown") {
114
114
  event.preventDefault();
115
115
  onPrevious();
116
116
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["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 === 'ArrowDown') {\n event.preventDefault();\n onNext();\n } else if (event.key === 'ArrowUp') {\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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoGnB;AApGJ,0BAA2B;AAC3B,sBAAuC;AACvC,uBAAuB;AACvB,mBAAkB;AAClB,mCAAsC;AACtC,uBAAwD;AAExD,MAAM,sCAAkC,yBAAO,OAAO;AAAA,EACpD,MAAM;AAAA,EACN,MAAM,qCAAoB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ACT,WAAW,MAAM,QAAQ,WAAW;AAClC,cAAM,eAAe;AACrB,mBAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,CAAC,QAAQ,UAAU;AAAA,EACrB;AACA,QAAM,gBAAgB,aAAAA,QAAM,YAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAClF,QAAM,yBAAyB,aAAAA,QAAM,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC;AAE/D,SACE,6CAAC,mCAAgC,eAA8B,wBAC7D;AAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,MAAK;AAAA,QACL,iBAAe,qBAAqB;AAAA,QACpC,iBAAe;AAAA,QACf,iBAAe;AAAA,QACf,kBAAgB;AAAA,QAChB,UAAU;AAAA,QACV,WAAW;AAAA,QAEV;AAAA;AAAA,IACH;AAAA,IACA,4CAAC,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,sDAAC,+BAAY,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,sDAAC,6BAAU,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,IAC9C;AAAA,KACF;AAEJ,CAAC;AAED,uBAAuB,cAAc;",
4
+ "sourcesContent": ["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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoGnB;AApGJ,0BAA2B;AAC3B,sBAAuC;AACvC,uBAAuB;AACvB,mBAAkB;AAClB,mCAAsC;AACtC,uBAAwD;AAExD,MAAM,sCAAkC,yBAAO,OAAO;AAAA,EACpD,MAAM;AAAA,EACN,MAAM,qCAAoB;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,0BAAsB,yBAAO,OAAO;AAAA,EACxC,MAAM;AAAA,EACN,MAAM,qCAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOD,MAAM,8BAA0B,yBAAO,OAAO;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,qCAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAKD,MAAM,oBAAgB,yBAAO,gCAAY;AAAA,EACvC,MAAM;AAAA,EACN,MAAM,qCAAoB;AAC5B,CAAC;AACD,MAAM,oBAAgB,yBAAO,gCAAY;AAAA,EACvC,MAAM;AAAA,EACN,MAAM,qCAAoB;AAC5B,CAAC;AASM,MAAM,yBAAyB,aAAAA,QAAM,KAAK,CAAC,UAAwC;AACxF,QAAM,EAAE,QAAQ,YAAY,oBAAoB,aAAa,IAAI;AACjE,QAAM,EAAE,OAAO,iBAAiB,IAAI,aAAAA,QAAM,WAAW,kDAAqB;AAE1E,QAAM,8BAA8B,uBAAuB,MAAM,CAAC;AACl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MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,YAAW;AAAA,QACX,SAAS;AAAA,QACT,cAAW;AAAA,QACX,UAAU;AAAA,QAEV,sDAAC,6BAAU,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,IAC9C;AAAA,KACF;AAEJ,CAAC;AAED,uBAAuB,cAAc;",
6
6
  "names": ["React"]
7
7
  }
@@ -74,10 +74,10 @@ const SearchToggleSpinButton = React2.memo((props) => {
74
74
  }
75
75
  const handleKeyDown = React2.useCallback(
76
76
  (event) => {
77
- if (event.key === "ArrowDown") {
77
+ if (event.key === "ArrowUp") {
78
78
  event.preventDefault();
79
79
  onNext();
80
- } else if (event.key === "ArrowUp") {
80
+ } else if (event.key === "ArrowDown") {
81
81
  event.preventDefault();
82
82
  onPrevious();
83
83
  }
@@ -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 === 'ArrowDown') {\n event.preventDefault();\n onNext();\n } else if (event.key === 'ArrowUp') {\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,SAA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,IAC1B,CAAC,UAAU;AACT,UAAI,MAAM,QAAQ,aAAa;AAC7B,cAAM,eAAe;AACrB,eAAO;AAAA,MACT,WAAW,MAAM,QAAQ,WAAW;AAClC,cAAM,eAAe;AACrB,mBAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,CAAC,QAAQ,UAAU;AAAA,EACrB;AACA,QAAM,gBAAgBA,OAAM,YAAY,MAAM,kBAAkB,CAAC,gBAAgB,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,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;",
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,aAAa,IAAI;AACjE,QAAM,EAAE,OAAO,iBAAiB,IAAIA,OAAM,WAAW,qB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AA;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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-global-header",
3
- "version": "3.60.0-next.32",
3
+ "version": "3.60.0-next.34",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Global Header",
6
6
  "files": [
@@ -37,21 +37,21 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "uid": "^2.0.2",
40
- "@elliemae/ds-app-picker": "3.60.0-next.32",
41
- "@elliemae/ds-floating-context": "3.60.0-next.32",
42
- "@elliemae/ds-form-input-text": "3.60.0-next.32",
43
- "@elliemae/ds-button-v2": "3.60.0-next.32",
44
- "@elliemae/ds-grid": "3.60.0-next.32",
45
- "@elliemae/ds-hooks-fontsize-media": "3.60.0-next.32",
46
- "@elliemae/ds-system": "3.60.0-next.32",
47
- "@elliemae/ds-props-helpers": "3.60.0-next.32",
48
- "@elliemae/ds-icons": "3.60.0-next.32"
40
+ "@elliemae/ds-app-picker": "3.60.0-next.34",
41
+ "@elliemae/ds-button-v2": "3.60.0-next.34",
42
+ "@elliemae/ds-floating-context": "3.60.0-next.34",
43
+ "@elliemae/ds-form-input-text": "3.60.0-next.34",
44
+ "@elliemae/ds-grid": "3.60.0-next.34",
45
+ "@elliemae/ds-hooks-fontsize-media": "3.60.0-next.34",
46
+ "@elliemae/ds-props-helpers": "3.60.0-next.34",
47
+ "@elliemae/ds-icons": "3.60.0-next.34",
48
+ "@elliemae/ds-system": "3.60.0-next.34"
49
49
  },
50
50
  "devDependencies": {
51
51
  "jest": "^30.0.0",
52
52
  "styled-components": "~5.3.9",
53
- "@elliemae/ds-monorepo-devops": "3.60.0-next.32",
54
- "@elliemae/ds-test-utils": "3.60.0-next.32"
53
+ "@elliemae/ds-monorepo-devops": "3.60.0-next.34",
54
+ "@elliemae/ds-test-utils": "3.60.0-next.34"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "lodash-es": "^4.17.21",