@elliemae/ds-global-header 3.70.0-next.61 → 3.70.0-next.63
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.
- package/dist/cjs/DSGlobalHeader.js +16 -2
- package/dist/cjs/DSGlobalHeader.js.map +2 -2
- package/dist/cjs/DSGlobalHeaderContext.js.map +2 -2
- package/dist/cjs/config/useGlobalHeader.js +13 -2
- package/dist/cjs/config/useGlobalHeader.js.map +2 -2
- package/dist/cjs/constants/index.js +4 -3
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/index.js +3 -6
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js +33 -1
- package/dist/cjs/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js.map +2 -2
- package/dist/cjs/parts/Logo/GlobalHeaderLogo.js +16 -2
- package/dist/cjs/parts/Logo/GlobalHeaderLogo.js.map +2 -2
- package/dist/cjs/parts/Toolbar/GlobalHeaderToolbar.js +54 -16
- package/dist/cjs/parts/Toolbar/GlobalHeaderToolbar.js.map +2 -2
- package/dist/cjs/{utils/useCallbackAfterRender.js → parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.js} +7 -16
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.js +43 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.js +52 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.js +84 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.js +50 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.js +64 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js +106 -55
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js.map +3 -3
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js +27 -11
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js.map +2 -2
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.js +52 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.js +23 -15
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.js.map +2 -2
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.js +54 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js +26 -16
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js.map +2 -2
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js +60 -50
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js.map +2 -2
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.js +58 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.js +33 -25
- package/dist/cjs/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.js.map +2 -2
- package/dist/cjs/parts/Toolbar/outOfTheBox/index.js +12 -4
- package/dist/cjs/parts/Toolbar/outOfTheBox/index.js.map +2 -2
- package/dist/cjs/parts/Toolbar/styles.js +6 -1
- package/dist/cjs/parts/Toolbar/styles.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/sharedTypes.js.map +1 -1
- package/dist/cjs/typescript-testing/typescript-global-header-toolbar-types.js +52 -0
- package/dist/cjs/typescript-testing/typescript-global-header-toolbar-types.js.map +2 -2
- package/dist/esm/DSGlobalHeader.js +16 -2
- package/dist/esm/DSGlobalHeader.js.map +2 -2
- package/dist/esm/DSGlobalHeaderContext.js.map +2 -2
- package/dist/esm/config/useGlobalHeader.js +13 -2
- package/dist/esm/config/useGlobalHeader.js.map +2 -2
- package/dist/esm/constants/index.js +4 -3
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/index.js +3 -6
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js +34 -2
- package/dist/esm/parts/Breadcrumb/useGlobalHeaderBreadcrumb.js.map +2 -2
- package/dist/esm/parts/Logo/GlobalHeaderLogo.js +16 -2
- package/dist/esm/parts/Logo/GlobalHeaderLogo.js.map +2 -2
- package/dist/esm/parts/Toolbar/GlobalHeaderToolbar.js +55 -17
- package/dist/esm/parts/Toolbar/GlobalHeaderToolbar.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.js +8 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.js +13 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.js +22 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.js +54 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.js +20 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.js +34 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js +108 -57
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js +28 -12
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.js +22 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.js +24 -16
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.js +24 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js +26 -16
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js +60 -50
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.js +28 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.js.map +7 -0
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.js +33 -25
- package/dist/esm/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.js.map +2 -2
- package/dist/esm/parts/Toolbar/outOfTheBox/index.js +8 -3
- package/dist/esm/parts/Toolbar/outOfTheBox/index.js.map +2 -2
- package/dist/esm/parts/Toolbar/styles.js +6 -1
- package/dist/esm/parts/Toolbar/styles.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/typescript-testing/typescript-global-header-toolbar-types.js +52 -0
- package/dist/esm/typescript-testing/typescript-global-header-toolbar-types.js.map +2 -2
- package/dist/types/DSGlobalHeaderContext.d.ts +10 -2
- package/dist/types/config/useGlobalHeader.d.ts +3 -4
- package/dist/types/constants/index.d.ts +3 -3
- package/dist/types/index.d.ts +0 -2
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTX.d.ts +4 -0
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/AppPickerCTXRenderer.d.ts +2 -0
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/AppPickerRenderer.d.ts +1 -0
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/TriggerDefaultComponent.d.ts +2 -0
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/react-desc-prop-types.d.ts +23 -0
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/useAppPickerCTX.d.ts +456 -0
- package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/PopupMenu.d.ts +2 -2
- package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/PopupMenuContent.d.ts +2 -2
- package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/react-desc-prop-types.d.ts +28 -0
- package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/menuContent/usePopupMenuContent.d.ts +9 -1
- package/dist/types/parts/Toolbar/outOfTheBox/PopupMenu/react-desc-prop-types.d.ts +26 -0
- package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.d.ts +2 -2
- package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggleSpinButton.d.ts +2 -0
- package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.d.ts +26 -0
- package/dist/types/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.d.ts +2 -3
- package/dist/types/parts/Toolbar/outOfTheBox/index.d.ts +3 -3
- package/dist/types/parts/Toolbar/styles.d.ts +1 -0
- package/dist/types/react-desc-prop-types.d.ts +63 -72
- package/dist/types/sharedTypes.d.ts +16 -6
- package/package.json +16 -13
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js +0 -127
- package/dist/cjs/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js.map +0 -7
- package/dist/cjs/utils/useCallbackAfterRender.js.map +0 -7
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js +0 -97
- package/dist/esm/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.js.map +0 -7
- package/dist/esm/utils/useCallbackAfterRender.js +0 -17
- package/dist/esm/utils/useCallbackAfterRender.js.map +0 -7
- package/dist/types/parts/Toolbar/outOfTheBox/AppPicker/AppPicker.d.ts +0 -6
- package/dist/types/utils/useCallbackAfterRender.d.ts +0 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/SearchToggle/SearchToggle.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["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 {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["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 { getGlobalAttributes, getXstyledProps } from '@elliemae/ds-props-helpers';\nimport { css, mergeRefs, styled } from '@elliemae/ds-system';\nimport React from 'react';\nimport {\n DSGlobalHeaderName,\n GLOBAL_HEADER_DATA_TESTID,\n GLOBAL_HEADER_SLOTS,\n SEARCH_TOGGLE_DEFAULT_ARIA_LABEL,\n} from '../../../../constants/index.js';\nimport { SearchToggleSpinButton } from './SearchToggleSpinButton.js';\nimport { defaultProps, type SearchToggleT } from './react-desc-prop-types.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: SearchToggleT.Props): JSX.Element => {\n const {\n componentProps,\n label,\n getOwnerPropsAwareOfPropsPassedToGlobalHeader,\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 // The default now comes from this part's own defaultProps rather than being repeated inline, so the\n // documented contract and the runtime behaviour cannot drift apart.\n ariaLabelExpanded = defaultProps.ariaLabelExpanded,\n // Everything else the toolbar drilled down, which is where item-level global attributes arrive.\n // `setRef` and `instanceUID` ride along in here too and are filtered out by getGlobalAttributes'\n // own whitelist, so they never reach the DOM.\n ...restIncludingItemLevelGlobalAttributes\n } = outOfTheBoxDrilledDownProps;\n\n const {\n isOpenUncontrolled,\n containerRef,\n handleToggleSearch,\n handleContainerKeyDown,\n handleChange,\n handleTriggerRefs,\n inputId,\n panelId,\n } = useSearchToggle(outOfTheBoxDrilledDownProps);\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 /*\n * Explicit and empty hydrator, shared by this part's slot render sites: `getOwnerPropsArguments` feeds\n * function-form slot props and nothing else, and none of the elements below carry render-time values\n * worth passing. Stated so \"what arguments does this slot get?\" is always answerable at the call site.\n */\n const noSlotArguments = React.useCallback(() => ({}), []);\n const isOpen = userIsOpen ?? isOpenUncontrolled;\n /*\n * Item-level global attributes, forwarded onto this part's ROOT container \u2014 NOT onto its trigger button,\n * which is where the sibling item types put theirs. Two reasons, and both matter if you move it:\n *\n * - The trigger is a DSButtonV3, whose own prop vocabulary collides with the HTML global set: `shape`\n * is `ButtonShapesT` there and the `<area>` attribute in GlobalAttributesT, and `onClick` takes a\n * wider event union. Spreading the whole set onto it does not type-check, and narrowing it would\n * forward less than the siblings do.\n * - The container is what this item type renders AS; the button is a child of it. Attributes describing\n * the toolbar item belong on the item's root.\n *\n * Consequence for selector authors: `data-public` lands on the element wrapping the whole search area,\n * not on the icon button.\n */\n const itemLevelGlobalAttributes = getGlobalAttributes<typeof restIncludingItemLevelGlobalAttributes, HTMLDivElement>(\n restIncludingItemLevelGlobalAttributes,\n );\n\n return (\n <StyledNavSearchBoxContainer\n // Spread FIRST, so the props below win on the keys they own \u2014 the opposite order from PopupMenu and\n // AppPicker, which spread theirs last. Here the internal keys are live state rather than defaults:\n // `onKeyDown` carries Escape-collapses and `innerRef` carries the consumer's own searchContainerRef.\n // An item-level attribute overwriting either is a regression, not an override. Everything a consumer\n // legitimately sets at this level \u2014 data attributes, id, title \u2014 is unaffected, since nothing below\n // claims those keys.\n {...itemLevelGlobalAttributes}\n // The part-level xstyled layer, which the contract advertises \u2014 this is the element that serves it.\n {...getXstyledProps(restIncludingItemLevelGlobalAttributes)}\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n onKeyDown={handleContainerKeyDown}\n innerRef={mergeRefs(searchContainerRef, containerRef)}\n isOpen={isOpen}\n >\n <StyledToggleBtn\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\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={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n id={panelId}\n alignItems=\"center\"\n cols={['1fr', '1fr']}\n >\n <StyledSearchInput\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\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 onClear={onClear}\n />\n <SearchToggleSpinButton\n onNext={onNext}\n onPrevious={onPrevious}\n currentResultIndex={currentResultIndex}\n totalResults={totalResults}\n getOwnerPropsAwareOfPropsPassedToGlobalHeader={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n />\n </StyledSearchNavContainer>\n ) : null}\n </StyledNavSearchBoxContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoMf;AApMR,0BAA2B;AAC3B,gCAA4B;AAC5B,qBAAqB;AACrB,sBAAuB;AACvB,8BAAqD;AACrD,uBAAuC;AACvC,mBAAkB;AAClB,uBAKO;AACP,oCAAuC;AACvC,mCAAiD;AACjD,6BAAgC;AAEhC,MAAM,kCAA8B,yBAAO,OAAO;AAAA,EAChD,MAAM;AAAA,EACN,MAAM,qCAAoB;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,+BAA2B,yBAAO,qBAAM;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,qCAAoB;AAC5B,CAAC;AAAA,gBACe,CAAC,EAAE,MAAM,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC;AAAA;AAAA;AAAA;AAK1D,MAAM,wBAAoB,yBAAO,uCAAa;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,qCAAoB;AAC5B,CAAC;AAED,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37
37
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
38
38
|
var import_ds_system = require("@elliemae/ds-system");
|
|
39
39
|
var import_react = __toESM(require("react"));
|
|
40
|
-
var import_DSGlobalHeaderContext = require("../../../../DSGlobalHeaderContext.js");
|
|
41
40
|
var import_constants = require("../../../../constants/index.js");
|
|
42
41
|
const StyledToolbarRightAddonsWrapper = (0, import_ds_system.styled)("div", {
|
|
43
42
|
name: import_constants.DSGlobalHeaderName,
|
|
@@ -81,17 +80,16 @@ const StyledVerticalSeparator = (0, import_ds_system.styled)("div", {
|
|
|
81
80
|
height: 20px;
|
|
82
81
|
border-right: 1px solid #a2a9b6;
|
|
83
82
|
`;
|
|
84
|
-
const
|
|
83
|
+
const StyledSpinbuttonPrevSlotBtn = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV3, {
|
|
85
84
|
name: import_constants.DSGlobalHeaderName,
|
|
86
85
|
slot: import_constants.GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_PREV
|
|
87
86
|
})``;
|
|
88
|
-
const
|
|
87
|
+
const StyledSpinbuttonNextSlotBtn = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV3, {
|
|
89
88
|
name: import_constants.DSGlobalHeaderName,
|
|
90
89
|
slot: import_constants.GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_NEXT
|
|
91
90
|
})``;
|
|
92
91
|
const SearchToggleSpinButton = import_react.default.memo((props) => {
|
|
93
|
-
const { onNext, onPrevious, currentResultIndex, totalResults } = props;
|
|
94
|
-
const { props: propsWithDefault } = import_react.default.useContext(import_DSGlobalHeaderContext.DSGlobalHeaderContext);
|
|
92
|
+
const { onNext, onPrevious, currentResultIndex, totalResults, getOwnerPropsAwareOfPropsPassedToGlobalHeader } = props;
|
|
95
93
|
const shouldShowNoResearchOngoing = currentResultIndex === -1 && !totalResults;
|
|
96
94
|
const canShowFullResults = !shouldShowNoResearchOngoing && currentResultIndex !== -1;
|
|
97
95
|
const shouldFallbackToTotalResultsOnly = !shouldShowNoResearchOngoing && !canShowFullResults;
|
|
@@ -117,51 +115,63 @@ const SearchToggleSpinButton = import_react.default.memo((props) => {
|
|
|
117
115
|
},
|
|
118
116
|
[onNext, onPrevious]
|
|
119
117
|
);
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
118
|
+
const noSlotArguments = import_react.default.useCallback(() => ({}), []);
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
120
|
+
StyledToolbarRightAddonsWrapper,
|
|
121
|
+
{
|
|
122
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
123
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
126
|
+
StyledResultTracker,
|
|
127
|
+
{
|
|
128
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
129
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
130
|
+
role: "spinbutton",
|
|
131
|
+
"aria-label": "Search results",
|
|
132
|
+
"aria-valuenow": currentResultIndex + 1,
|
|
133
|
+
"aria-valuemin": 1,
|
|
134
|
+
"aria-valuemax": totalResults,
|
|
135
|
+
"aria-valuetext": ariaResultsText,
|
|
136
|
+
tabIndex: 0,
|
|
137
|
+
onKeyDown: handleKeyDown,
|
|
138
|
+
children: resultText
|
|
139
|
+
}
|
|
140
|
+
),
|
|
141
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
142
|
+
StyledVerticalSeparator,
|
|
143
|
+
{
|
|
144
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
145
|
+
getOwnerPropsArguments: noSlotArguments
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
149
|
+
StyledSpinbuttonNextSlotBtn,
|
|
150
|
+
{
|
|
151
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
152
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
153
|
+
buttonType: "icon",
|
|
154
|
+
onClick: onNext,
|
|
155
|
+
"aria-label": "Next search result",
|
|
156
|
+
tabIndex: -1,
|
|
157
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.ChevronDown, { color: ["brand-primary", "800"] })
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
161
|
+
StyledSpinbuttonPrevSlotBtn,
|
|
162
|
+
{
|
|
163
|
+
getOwnerProps: getOwnerPropsAwareOfPropsPassedToGlobalHeader,
|
|
164
|
+
getOwnerPropsArguments: noSlotArguments,
|
|
165
|
+
buttonType: "icon",
|
|
166
|
+
onClick: onPrevious,
|
|
167
|
+
"aria-label": "Previous search result",
|
|
168
|
+
tabIndex: -1,
|
|
169
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.ChevronUp, { color: ["brand-primary", "800"] })
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
]
|
|
173
|
+
}
|
|
174
|
+
);
|
|
165
175
|
});
|
|
166
176
|
SearchToggleSpinButton.displayName = "SearchToggleSpinButton";
|
|
167
177
|
//# sourceMappingURL=SearchToggleSpinButton.js.map
|
|
@@ -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 {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
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 { DSGlobalHeaderName, GLOBAL_HEADER_SLOTS } from '../../../../constants/index.js';\nimport type { SearchToggleT } from './react-desc-prop-types.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 StyledSpinbuttonPrevSlotBtn = styled(DSButtonV3, {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.SEARCH_TOGGLE_SPINBUTTON_PREV,\n})``;\nconst StyledSpinbuttonNextSlotBtn = 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 // Drilled through SearchToggle from DSGlobalHeader \u2014 the slot lookup table, never the hydrator.\n getOwnerPropsAwareOfPropsPassedToGlobalHeader: SearchToggleT.Props['getOwnerPropsAwareOfPropsPassedToGlobalHeader'];\n}\n\nexport const SearchToggleSpinButton = React.memo((props: SearchToggleSpinButtonPropsT) => {\n const { onNext, onPrevious, currentResultIndex, totalResults, getOwnerPropsAwareOfPropsPassedToGlobalHeader } = props;\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 // Explicit and empty: none of the spinbutton elements have render-time values worth handing to a\n // function-form slot prop. Stated rather than omitted.\n const noSlotArguments = React.useCallback(() => ({}), []);\n\n return (\n <StyledToolbarRightAddonsWrapper\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n >\n <StyledResultTracker\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\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\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\n />\n <StyledSpinbuttonNextSlotBtn\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\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 </StyledSpinbuttonNextSlotBtn>\n <StyledSpinbuttonPrevSlotBtn\n getOwnerProps={getOwnerPropsAwareOfPropsPassedToGlobalHeader}\n getOwnerPropsArguments={noSlotArguments}\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 </StyledSpinbuttonPrevSlotBtn>\n </StyledToolbar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,YACxB,YAAW;AAAA,YACX,SAAS;AAAA,YACT,cAAW;AAAA,YACX,UAAU;AAAA,YAEV,sDAAC,6BAAU,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,QAC9C;AAAA;AAAA;AAAA,EACF;AAEJ,CAAC;AAED,uBAAuB,cAAc;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 react_desc_prop_types_exports = {};
|
|
30
|
+
__export(react_desc_prop_types_exports, {
|
|
31
|
+
SearchTogglePropTypes: () => SearchTogglePropTypes,
|
|
32
|
+
SearchTogglePropTypesSchema: () => SearchTogglePropTypesSchema,
|
|
33
|
+
defaultProps: () => defaultProps
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
+
const defaultProps = {
|
|
39
|
+
ariaLabelExpanded: "Close search"
|
|
40
|
+
};
|
|
41
|
+
const SearchTogglePropTypes = {
|
|
42
|
+
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
43
|
+
...import_ds_props_helpers.xstyledPropTypes,
|
|
44
|
+
label: import_ds_props_helpers.PropTypes.string.description("Accessible name for the collapsed trigger, and the toolbar label").isRequired,
|
|
45
|
+
componentProps: import_ds_props_helpers.PropTypes.object.description(
|
|
46
|
+
"The consumer-authored search configuration: value, result counters and the change/clear/navigation handlers"
|
|
47
|
+
).isRequired,
|
|
48
|
+
getOwnerPropsAwareOfPropsPassedToGlobalHeader: import_ds_props_helpers.PropTypes.func.description(
|
|
49
|
+
"Returns the props passed to DSGlobalHeader, so getPartProps can look up this slot consumer-supplied props. Must come from DSGlobalHeader; the function-form hydrator is supplied per slot render site instead"
|
|
50
|
+
).signature("(() => Partial<DSGlobalHeaderT.DefaultProps> )").isRequired,
|
|
51
|
+
setRef: import_ds_props_helpers.PropTypes.func.description("Registers the trigger node with the toolbar focus management for arrow-key navigation").signature("(( ref: HTMLButtonElement | null ) => void )").isRequired,
|
|
52
|
+
instanceUID: import_ds_props_helpers.PropTypes.string.description(
|
|
53
|
+
"Namespaces the input and panel DOM ids so multiple headers on a page do not collide on aria-controls"
|
|
54
|
+
).isRequired,
|
|
55
|
+
ariaLabelExpanded: import_ds_props_helpers.PropTypes.string.description("Accessible name for the trigger once expanded (PUI-17852)").defaultValue("Close search")
|
|
56
|
+
};
|
|
57
|
+
const SearchTogglePropTypesSchema = SearchTogglePropTypes;
|
|
58
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/SearchToggle/react-desc-prop-types.ts", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-props-helpers';\nimport type { DSGlobalHeaderT } from '../../../../react-desc-prop-types.js';\n\n/*\n * Relocated here from DSGlobalHeaderT.SearchToggleProps, per the convention every other part in the repo\n * follows. Consumed by SearchToggle.tsx, useSearchToggle.tsx and SearchToggleSpinButton.tsx.\n *\n * This namespace describes what DSGlobalHeader passes DOWN to its own out-of-the-box Search Toggle.\n * It is NOT the shape an application developer authors \u2014 that is\n * DSGlobalHeaderT.ToolbarSearchToggleItem and, inside it, DSGlobalHeaderT.ToggleSearchComponentProps.\n * The two old names are the sharpest illustration of the problem this relocation solves:\n * `SearchToggleProps` (internal) and `ToggleSearchComponentProps` (consumer-authored) are near-anagrams\n * of each other, adjacent in the same public namespace, with opposite audiences.\n *\n * All three IoC layers present and wired, as on the siblings:\n * 1. item-level global attributes, forwarded onto this part's ROOT container\n * 2. the slot layer, via `getOwnerPropsAwareOfPropsPassedToGlobalHeader`\n * 3. `componentProps`, the search configuration's own contract\n *\n * Two things about layer 1 that differ from the siblings and are worth knowing when writing selectors:\n * the attributes land on the container rather than the trigger button, because the container is what\n * this item type renders as and the trigger is a DSButtonV3 whose own props collide with the HTML global\n * set (`shape` is ButtonShapesT there and the <area> attribute in GlobalAttributesT); and they are spread\n * BEFORE the internal props rather than after, so `onKeyDown` (Escape-collapses) and `innerRef` (the\n * consumer's searchContainerRef) cannot be clobbered. Both are stated at the spread site in\n * SearchToggle.tsx. Until PUI-18647 this layer was declared here and forwarded nowhere, so `data-public`\n * on a 'ds-search-toggle' item never reached the DOM at all; that is fixed and covered by\n * GlobalHeader.SearchToggle.pui-18647.test.js.\n *\n * No slots of its own \u2014 see the AppPicker sibling file for why.\n */\nexport declare namespace SearchToggleT {\n export interface RequiredProps {\n /** Accessible name for the collapsed trigger, and the toolbar item's label. */\n label: string;\n /** The consumer-authored configuration object for this toolbar item. */\n componentProps: DSGlobalHeaderT.ToggleSearchComponentProps;\n /*\n * The slot lookup table, and the only half of the slot IoC layer that may be drilled down \u2014 the\n * function-form hydrator is supplied per slot render site instead. See the AppPicker sibling for the\n * full reasoning and the getPartProps mechanics behind the name.\n */\n getOwnerPropsAwareOfPropsPassedToGlobalHeader: () => Partial<DSGlobalHeaderT.DefaultProps>;\n /** Focus-management registration, supplied by useGlobalHeaderToolbar for arrow-key navigation. */\n setRef: (ref: HTMLButtonElement | null) => void;\n /*\n * Namespaces the input and panel DOM ids so multiple headers on one page cannot collide on the\n * aria-controls relationship. Typed here rather than aliased from the parent's Context: this part\n * only needs \"an id-safe string\", and coupling it to the parent's shape would tie the two together\n * for no benefit.\n */\n instanceUID: string;\n }\n\n export interface DefaultProps {\n /*\n * Accessible name for the trigger once expanded. Defaults to the pre-PUI-17852 hardcoded string for\n * backward compatibility; authors are encouraged to supply context-specific text.\n */\n ariaLabelExpanded: string;\n }\n\n export interface OptionalProps {}\n\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof RequiredProps | keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLElement>, keyof RequiredProps | keyof DefaultProps | keyof XstyledProps>,\n XstyledProps,\n RequiredProps {}\n}\n\n// Part-level defaultProps, per the part generator's shape. Consumed by SearchToggle.tsx so the\n// documented default and the runtime default cannot drift. The name intentionally matches the package's\n// own `defaultProps`; fallow's duplicate-export grouping for that convention is handled once in\n// fallow.internals.jsonc rather than suppressed per file.\nexport const defaultProps: SearchToggleT.DefaultProps = {\n ariaLabelExpanded: 'Close search',\n};\n\nexport const SearchTogglePropTypes: DSPropTypesSchema<SearchToggleT.Props> = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n label: PropTypes.string.description('Accessible name for the collapsed trigger, and the toolbar label').isRequired,\n componentProps: PropTypes.object.description(\n 'The consumer-authored search configuration: value, result counters and the change/clear/navigation handlers',\n ).isRequired,\n getOwnerPropsAwareOfPropsPassedToGlobalHeader: PropTypes.func\n .description(\n 'Returns the props passed to DSGlobalHeader, so getPartProps can look up this slot consumer-supplied props. Must come from DSGlobalHeader; the function-form hydrator is supplied per slot render site instead',\n )\n .signature('(() => Partial<DSGlobalHeaderT.DefaultProps> )').isRequired,\n setRef: PropTypes.func\n .description('Registers the trigger node with the toolbar focus management for arrow-key navigation')\n .signature('(( ref: HTMLButtonElement | null ) => void )').isRequired,\n instanceUID: PropTypes.string.description(\n 'Namespaces the input and panel DOM ids so multiple headers on a page do not collide on aria-controls',\n ).isRequired,\n ariaLabelExpanded: PropTypes.string\n .description('Accessible name for the trigger once expanded (PUI-17852)')\n .defaultValue('Close search'),\n};\n\nexport const SearchTogglePropTypesSchema = SearchTogglePropTypes as unknown as ValidationMap<SearchToggleT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAuE;AAqFhE,MAAM,eAA2C;AAAA,EACtD,mBAAmB;AACrB;AAEO,MAAM,wBAAgE;AAAA,EAC3E,GAAG;AAAA,EACH,GAAG;AAAA,EACH,OAAO,kCAAU,OAAO,YAAY,kEAAkE,EAAE;AAAA,EACxG,gBAAgB,kCAAU,OAAO;AAAA,IAC/B;AAAA,EACF,EAAE;AAAA,EACF,+CAA+C,kCAAU,KACtD;AAAA,IACC;AAAA,EACF,EACC,UAAU,gDAAgD,EAAE;AAAA,EAC/D,QAAQ,kCAAU,KACf,YAAY,uFAAuF,EACnG,UAAU,8CAA8C,EAAE;AAAA,EAC7D,aAAa,kCAAU,OAAO;AAAA,IAC5B;AAAA,EACF,EAAE;AAAA,EACF,mBAAmB,kCAAU,OAC1B,YAAY,2DAA2D,EACvE,aAAa,cAAc;AAChC;AAEO,MAAM,8BAA8B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -36,38 +36,57 @@ var import_ds_system = require("@elliemae/ds-system");
|
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
const useSearchToggle = (outOfTheBoxDrilledDownProps) => {
|
|
38
38
|
const { setRef, componentProps, instanceUID } = outOfTheBoxDrilledDownProps;
|
|
39
|
-
const {
|
|
39
|
+
const {
|
|
40
|
+
onChange,
|
|
41
|
+
onClear,
|
|
42
|
+
isOpen: userIsOpen,
|
|
43
|
+
onKeyDown,
|
|
44
|
+
onClick,
|
|
45
|
+
triggerRef,
|
|
46
|
+
onExpand,
|
|
47
|
+
onCollapse
|
|
48
|
+
} = componentProps;
|
|
40
49
|
const [isOpenUncontrolled, setIsOpenUncontrolled] = import_react.default.useState(false);
|
|
41
50
|
const internalInputRef = import_react.default.useRef(null);
|
|
42
51
|
const containerRef = import_react.default.useRef(null);
|
|
43
52
|
const internalTriggerRef = import_react.default.useRef(null);
|
|
44
53
|
const isControlled = userIsOpen !== void 0;
|
|
45
54
|
const isOpen = userIsOpen ?? isOpenUncontrolled;
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
const expand = import_react.default.useCallback(
|
|
56
|
+
(info) => {
|
|
57
|
+
if (!isControlled) setIsOpenUncontrolled(true);
|
|
58
|
+
onExpand?.(info);
|
|
59
|
+
},
|
|
60
|
+
[isControlled, onExpand]
|
|
61
|
+
);
|
|
62
|
+
const collapse = import_react.default.useCallback(
|
|
63
|
+
(info) => {
|
|
64
|
+
if (!isControlled) {
|
|
65
|
+
setIsOpenUncontrolled(false);
|
|
66
|
+
internalTriggerRef.current?.focus();
|
|
67
|
+
onClear();
|
|
68
|
+
}
|
|
69
|
+
onCollapse?.(info);
|
|
70
|
+
},
|
|
71
|
+
[isControlled, onClear, onCollapse]
|
|
72
|
+
);
|
|
54
73
|
const handleToggleSearch = import_react.default.useCallback(
|
|
55
74
|
(e) => {
|
|
56
75
|
if (isOpen) {
|
|
57
|
-
|
|
76
|
+
collapse({ reason: "trigger", event: e });
|
|
58
77
|
} else {
|
|
59
|
-
|
|
78
|
+
expand({ reason: "trigger", event: e });
|
|
60
79
|
}
|
|
61
80
|
onClick?.(e);
|
|
62
81
|
},
|
|
63
|
-
[
|
|
82
|
+
[collapse, expand, isOpen, onClick]
|
|
64
83
|
);
|
|
65
84
|
const handleContainerKeyDown = import_react.default.useCallback(
|
|
66
85
|
(e) => {
|
|
67
|
-
if (
|
|
86
|
+
if (e.key === "Escape" && isOpen) collapse({ reason: "escape", event: e });
|
|
68
87
|
onKeyDown?.(e);
|
|
69
88
|
},
|
|
70
|
-
[
|
|
89
|
+
[collapse, isOpen, onKeyDown]
|
|
71
90
|
);
|
|
72
91
|
const handleChange = import_react.default.useCallback(
|
|
73
92
|
(e) => {
|
|
@@ -75,15 +94,6 @@ const useSearchToggle = (outOfTheBoxDrilledDownProps) => {
|
|
|
75
94
|
},
|
|
76
95
|
[onChange]
|
|
77
96
|
);
|
|
78
|
-
const handleInputKeyDown = import_react.default.useCallback(
|
|
79
|
-
(e) => {
|
|
80
|
-
if (e.key === "Escape") {
|
|
81
|
-
onClear();
|
|
82
|
-
closeUncontrolled();
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
[onClear, closeUncontrolled]
|
|
86
|
-
);
|
|
87
97
|
const handleTriggerRefs = import_react.default.useCallback(
|
|
88
98
|
(buttonRef) => {
|
|
89
99
|
(0, import_ds_system.mergeRefs)(triggerRef, internalTriggerRef)(buttonRef);
|
|
@@ -101,7 +111,6 @@ const useSearchToggle = (outOfTheBoxDrilledDownProps) => {
|
|
|
101
111
|
handleToggleSearch,
|
|
102
112
|
handleContainerKeyDown,
|
|
103
113
|
handleChange,
|
|
104
|
-
handleInputKeyDown,
|
|
105
114
|
handleTriggerRefs,
|
|
106
115
|
inputId,
|
|
107
116
|
panelId
|
|
@@ -112,7 +121,6 @@ const useSearchToggle = (outOfTheBoxDrilledDownProps) => {
|
|
|
112
121
|
handleToggleSearch,
|
|
113
122
|
handleContainerKeyDown,
|
|
114
123
|
handleChange,
|
|
115
|
-
handleInputKeyDown,
|
|
116
124
|
handleTriggerRefs,
|
|
117
125
|
inputId,
|
|
118
126
|
panelId
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/parts/Toolbar/outOfTheBox/SearchToggle/useSearchToggle.tsx", "../../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { mergeRefs } from '@elliemae/ds-system';\nimport React from 'react';\nimport type { DSGlobalHeaderT } from '../../../../react-desc-prop-types.js';\n\nexport const useSearchToggle = (outOfTheBoxDrilledDownProps:
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA0B;AAC1B,mBAAkB;
|
|
4
|
+
"sourcesContent": ["import { mergeRefs } from '@elliemae/ds-system';\nimport React from 'react';\nimport type { DSGlobalHeaderT } from '../../../../react-desc-prop-types.js';\nimport type { SearchToggleT } from './react-desc-prop-types.js';\n\nexport const useSearchToggle = (outOfTheBoxDrilledDownProps: SearchToggleT.Props) => {\n const { setRef, componentProps, instanceUID } = outOfTheBoxDrilledDownProps;\n const {\n onChange,\n onClear,\n isOpen: userIsOpen,\n onKeyDown,\n onClick,\n triggerRef,\n onExpand,\n onCollapse,\n } = componentProps;\n\n const [isOpenUncontrolled, setIsOpenUncontrolled] = React.useState<boolean>(false);\n const internalInputRef = React.useRef<HTMLInputElement | null>(null);\n const containerRef = React.useRef<HTMLDivElement | null>(null);\n const internalTriggerRef = React.useRef<HTMLButtonElement | null>(null);\n\n const isControlled = userIsOpen !== undefined;\n const isOpen = userIsOpen ?? isOpenUncontrolled;\n\n /*\n * The notification fires for BOTH modes \u2014 that is the point of a passive signal \u2014 while everything that\n * ACTS on the transition stays behind `!isControlled`.\n *\n * That gate covers the focus return and the clear, not just the state flip. For a controlled consumer\n * the flip is inert, so their region can stay expanded; moving focus to the trigger and wiping their\n * search value at that moment would be acting on a transition that did not happen. They own the\n * collapse, so they own the refocus and the clear \u2014 `onCollapse` is where they hook both.\n */\n const expand = React.useCallback(\n (info: DSGlobalHeaderT.SearchToggleExpandChange) => {\n if (!isControlled) setIsOpenUncontrolled(true);\n onExpand?.(info);\n },\n [isControlled, onExpand],\n );\n\n const collapse = React.useCallback(\n (info: DSGlobalHeaderT.SearchToggleExpandChange) => {\n if (!isControlled) {\n setIsOpenUncontrolled(false);\n internalTriggerRef.current?.focus();\n onClear();\n }\n onCollapse?.(info);\n },\n [isControlled, onClear, onCollapse],\n );\n\n const handleToggleSearch = React.useCallback(\n (e: React.MouseEvent<HTMLButtonElement, MouseEvent> | React.KeyboardEvent<HTMLButtonElement>) => {\n if (isOpen) {\n collapse({ reason: 'trigger', event: e });\n } else {\n expand({ reason: 'trigger', event: e });\n }\n\n onClick?.(e as React.MouseEvent<HTMLButtonElement, MouseEvent>);\n },\n [collapse, expand, isOpen, onClick],\n );\n\n /*\n * The ONE Escape handler for this item. It sits on the container, so it also catches an Escape typed\n * in the search input by bubbling \u2014 the input deliberately has no handler of its own. Two handlers\n * meant every input Escape collapsed twice, and now would notify twice as well.\n */\n const handleContainerKeyDown = React.useCallback<React.KeyboardEventHandler<HTMLDivElement>>(\n (e) => {\n // No `!isControlled` here any more: `collapse` gates the acting half itself, and a controlled\n // consumer should still be TOLD that Escape asked for a collapse.\n if (e.key === 'Escape' && isOpen) collapse({ reason: 'escape', event: e });\n onKeyDown?.(e);\n },\n [collapse, isOpen, onKeyDown],\n );\n\n const handleChange = React.useCallback<React.ChangeEventHandler<HTMLInputElement>>(\n (e) => {\n onChange?.(e.target.value);\n },\n [onChange],\n );\n\n const handleTriggerRefs = React.useCallback(\n (buttonRef: HTMLButtonElement) => {\n mergeRefs(triggerRef, internalTriggerRef)(buttonRef);\n setRef(buttonRef); // this is used for left/arrow navigation in the region.\n },\n [setRef, triggerRef],\n );\n\n const inputId = `${instanceUID}-nav-searchbox-input`;\n const panelId = `${instanceUID}-nav-searchbox-panel`;\n return React.useMemo(\n () => ({\n isOpenUncontrolled,\n internalInputRef,\n containerRef,\n handleToggleSearch,\n handleContainerKeyDown,\n handleChange,\n handleTriggerRefs,\n inputId,\n panelId,\n }),\n [\n isOpenUncontrolled,\n containerRef,\n handleToggleSearch,\n handleContainerKeyDown,\n handleChange,\n handleTriggerRefs,\n inputId,\n panelId,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAA0B;AAC1B,mBAAkB;AAIX,MAAM,kBAAkB,CAAC,gCAAqD;AACnF,QAAM,EAAE,QAAQ,gBAAgB,YAAY,IAAI;AAChD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ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AAW,EAAE,OAAO,KAAK;AAAA,IAC3B;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,QAAM,oBAAoB,aAAAA,QAAM;AAAA,IAC9B,CAAC,cAAiC;AAChC,sCAAU,YAAY,kBAAkB,EAAE,SAAS;AACnD,aAAO,SAAS;AAAA,IAClB;AAAA,IACA,CAAC,QAAQ,UAAU;AAAA,EACrB;AAEA,QAAM,UAAU,GAAG,WAAW;AAC9B,QAAM,UAAU,GAAG,WAAW;AAC9B,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -5,6 +5,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
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
|
+
};
|
|
8
12
|
var __copyProps = (to, from, except, desc) => {
|
|
9
13
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
14
|
for (let key of __getOwnPropNames(from))
|
|
@@ -13,7 +17,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
13
17
|
}
|
|
14
18
|
return to;
|
|
15
19
|
};
|
|
16
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
17
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
22
|
// file that has been converted to a CommonJS file using a Babel-
|
|
@@ -24,9 +27,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
27
|
));
|
|
25
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
29
|
var outOfTheBox_exports = {};
|
|
30
|
+
__export(outOfTheBox_exports, {
|
|
31
|
+
AppPickerCTXRenderer: () => import_AppPickerCTXRenderer.AppPickerCTXRenderer,
|
|
32
|
+
PopupMenu: () => import_PopupMenu.PopupMenu,
|
|
33
|
+
SearchToggle: () => import_SearchToggle.SearchToggle
|
|
34
|
+
});
|
|
27
35
|
module.exports = __toCommonJS(outOfTheBox_exports);
|
|
28
36
|
var React = __toESM(require("react"));
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
37
|
+
var import_AppPickerCTXRenderer = require("./AppPicker/AppPickerCTXRenderer.js");
|
|
38
|
+
var import_PopupMenu = require("./PopupMenu/PopupMenu.js");
|
|
39
|
+
var import_SearchToggle = require("./SearchToggle/SearchToggle.js");
|
|
32
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Toolbar/outOfTheBox/index.tsx", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export { AppPickerCTXRenderer } from './AppPicker/AppPickerCTXRenderer.js';\nexport { PopupMenu } from './PopupMenu/PopupMenu.js';\nexport { SearchToggle } from './SearchToggle/SearchToggle.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,kCAAqC;AACrC,uBAA0B;AAC1B,0BAA6B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -30,12 +30,13 @@ var styles_exports = {};
|
|
|
30
30
|
__export(styles_exports, {
|
|
31
31
|
StyledList: () => StyledList,
|
|
32
32
|
StyledMenubarContainer: () => StyledMenubarContainer,
|
|
33
|
+
StyledPopupMenuContainer: () => StyledPopupMenuContainer,
|
|
33
34
|
StyledToolbarItem: () => StyledToolbarItem
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(styles_exports);
|
|
36
37
|
var React = __toESM(require("react"));
|
|
37
|
-
var import_ds_system = require("@elliemae/ds-system");
|
|
38
38
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
39
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
39
40
|
var import_constants = require("../../constants/index.js");
|
|
40
41
|
const StyledMenubarContainer = (0, import_ds_system.styled)("div", {
|
|
41
42
|
name: import_constants.DSGlobalHeaderName,
|
|
@@ -48,4 +49,8 @@ const StyledList = (0, import_ds_system.styled)(import_ds_grid.Grid, { name: imp
|
|
|
48
49
|
margin: 0;
|
|
49
50
|
`;
|
|
50
51
|
const StyledToolbarItem = (0, import_ds_system.styled)("div", { name: import_constants.DSGlobalHeaderName, slot: import_constants.GLOBAL_HEADER_SLOTS.MENUBAR_ITEM })``;
|
|
52
|
+
const StyledPopupMenuContainer = (0, import_ds_system.styled)(import_ds_grid.Grid, {
|
|
53
|
+
name: import_constants.DSGlobalHeaderName,
|
|
54
|
+
slot: import_constants.GLOBAL_HEADER_SLOTS.MENUBAR_ITEM_POPUPMENU_CONTAINER
|
|
55
|
+
})``;
|
|
51
56
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/Toolbar/styles.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAuB;AACvB,
|
|
4
|
+
"sourcesContent": ["import { Grid } from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\nimport { DSGlobalHeaderName, GLOBAL_HEADER_SLOTS } from '../../constants/index.js';\n\nexport const StyledMenubarContainer = styled('div', {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.MENUBAR_CONTAINER,\n})<{ withSpan: boolean }>`\n ${({ withSpan, theme }) => (withSpan && !theme.layoutMode ? 'grid-column: span 2;' : '')}\n`;\n\nexport const StyledList = styled(Grid, { name: DSGlobalHeaderName, slot: GLOBAL_HEADER_SLOTS.MENUBAR_LIST })`\n padding: 0;\n margin: 0;\n`;\n\nexport const StyledToolbarItem = styled('div', { name: DSGlobalHeaderName, slot: GLOBAL_HEADER_SLOTS.MENUBAR_ITEM })``;\n\n// PUI-18647 \u2014 the popup menu item's own root. It was a bare unstyled `<div>`, which left this\n// out-of-the-box type without a root injection point: no slot for consumers to target, no data-testid,\n// and no styled element to forward xstyled props to. A Grid rather than a plain div so it participates in\n// the same layout vocabulary as its siblings; no styles of its own, so replacing the div changes nothing\n// visually \u2014 a `<div>` and an unstyled `display: block` Grid lay out identically here.\nexport const StyledPopupMenuContainer = styled(Grid, {\n name: DSGlobalHeaderName,\n slot: GLOBAL_HEADER_SLOTS.MENUBAR_ITEM_POPUPMENU_CONTAINER,\n})``;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qBAAqB;AACrB,uBAAuB;AACvB,uBAAwD;AAEjD,MAAM,6BAAyB,yBAAO,OAAO;AAAA,EAClD,MAAM;AAAA,EACN,MAAM,qCAAoB;AAC5B,CAAC;AAAA,IACG,CAAC,EAAE,UAAU,MAAM,MAAO,YAAY,CAAC,MAAM,aAAa,yBAAyB,EAAG;AAAA;AAGnF,MAAM,iBAAa,yBAAO,qBAAM,EAAE,MAAM,qCAAoB,MAAM,qCAAoB,aAAa,CAAC;AAAA;AAAA;AAAA;AAKpG,MAAM,wBAAoB,yBAAO,OAAO,EAAE,MAAM,qCAAoB,MAAM,qCAAoB,aAAa,CAAC;AAO5G,MAAM,+BAA2B,yBAAO,qBAAM;AAAA,EACnD,MAAM;AAAA,EACN,MAAM,qCAAoB;AAC5B,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|