@elliemae/ds-global-header 2.1.0 → 2.2.0-alpha.3
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/cjs/GlobalHeader.js +55 -35
- package/cjs/GlobalHeader.js.map +7 -0
- package/cjs/GlobalHeaderContainer.js +40 -23
- package/cjs/GlobalHeaderContainer.js.map +7 -0
- package/cjs/GlobalHeaderContext.js +39 -13
- package/cjs/GlobalHeaderContext.js.map +7 -0
- package/cjs/GlobalHeaderTypes.js +27 -2
- package/cjs/GlobalHeaderTypes.js.map +7 -0
- package/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js +59 -59
- package/cjs/components/Breadcrumb/GlobalHeaderBreadcrumb.js.map +7 -0
- package/cjs/components/Breadcrumb/PureBreadcrumb.js +50 -59
- package/cjs/components/Breadcrumb/PureBreadcrumb.js.map +7 -0
- package/cjs/components/Breadcrumb/styles.js +82 -58
- package/cjs/components/Breadcrumb/styles.js.map +7 -0
- package/cjs/components/Title/GlobalHeaderTitle.js +43 -24
- package/cjs/components/Title/GlobalHeaderTitle.js.map +7 -0
- package/cjs/components/Toolbar/GlobalHeaderToolbar.js +41 -22
- package/cjs/components/Toolbar/GlobalHeaderToolbar.js.map +7 -0
- package/cjs/components/Toolbar/ToolbarItems.js +83 -94
- package/cjs/components/Toolbar/ToolbarItems.js.map +7 -0
- package/cjs/components/Toolbar/styles.js +60 -24
- package/cjs/components/Toolbar/styles.js.map +7 -0
- package/cjs/config/useGetPropsWithDefaults.js +42 -30
- package/cjs/config/useGetPropsWithDefaults.js.map +7 -0
- package/cjs/config/useGlobalHeader.js +44 -30
- package/cjs/config/useGlobalHeader.js.map +7 -0
- package/cjs/config/useValidateProps.js +81 -64
- package/cjs/config/useValidateProps.js.map +7 -0
- package/cjs/config/validateHelpers.js +95 -41
- package/cjs/config/validateHelpers.js.map +7 -0
- package/cjs/defaultProps.js +34 -7
- package/cjs/defaultProps.js.map +7 -0
- package/cjs/index.js +36 -11
- package/cjs/index.js.map +7 -0
- package/cjs/outOfTheBox/AppPicker/AppPicker.js +83 -90
- package/cjs/outOfTheBox/AppPicker/AppPicker.js.map +7 -0
- package/cjs/outOfTheBox/PopupMenu/PopupMenu.js +70 -75
- package/cjs/outOfTheBox/PopupMenu/PopupMenu.js.map +7 -0
- package/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js +76 -83
- package/cjs/outOfTheBox/PopupMenu/PopupMenuContent.js.map +7 -0
- package/cjs/outOfTheBox/PopupMenu/styles.js +66 -31
- package/cjs/outOfTheBox/PopupMenu/styles.js.map +7 -0
- package/cjs/outOfTheBox/SearchToggle/SearchToggle.js +80 -85
- package/cjs/outOfTheBox/SearchToggle/SearchToggle.js.map +7 -0
- package/cjs/outOfTheBox/SearchToggle/styles.js +76 -9
- package/cjs/outOfTheBox/SearchToggle/styles.js.map +7 -0
- package/cjs/outOfTheBox/index.js +30 -13
- package/cjs/outOfTheBox/index.js.map +7 -0
- package/cjs/propTypes.js +52 -25
- package/cjs/propTypes.js.map +7 -0
- package/cjs/styles.js +42 -20
- package/cjs/styles.js.map +7 -0
- package/esm/GlobalHeader.js +21 -21
- package/esm/GlobalHeader.js.map +7 -0
- package/esm/GlobalHeaderContainer.js +11 -15
- package/esm/GlobalHeaderContainer.js.map +7 -0
- package/esm/GlobalHeaderContext.js +9 -8
- package/esm/GlobalHeaderContext.js.map +7 -0
- package/esm/GlobalHeaderTypes.js +2 -1
- package/esm/GlobalHeaderTypes.js.map +7 -0
- package/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js +26 -45
- package/esm/components/Breadcrumb/GlobalHeaderBreadcrumb.js.map +7 -0
- package/esm/components/Breadcrumb/PureBreadcrumb.js +22 -49
- package/esm/components/Breadcrumb/PureBreadcrumb.js.map +7 -0
- package/esm/components/Breadcrumb/styles.js +54 -48
- package/esm/components/Breadcrumb/styles.js.map +7 -0
- package/esm/components/Title/GlobalHeaderTitle.js +13 -15
- package/esm/components/Title/GlobalHeaderTitle.js.map +7 -0
- package/esm/components/Toolbar/GlobalHeaderToolbar.js +12 -14
- package/esm/components/Toolbar/GlobalHeaderToolbar.js.map +7 -0
- package/esm/components/Toolbar/ToolbarItems.js +53 -83
- package/esm/components/Toolbar/ToolbarItems.js.map +7 -0
- package/esm/components/Toolbar/styles.js +32 -17
- package/esm/components/Toolbar/styles.js.map +7 -0
- package/esm/config/useGetPropsWithDefaults.js +13 -22
- package/esm/config/useGetPropsWithDefaults.js.map +7 -0
- package/esm/config/useGlobalHeader.js +12 -19
- package/esm/config/useGlobalHeader.js.map +7 -0
- package/esm/config/useValidateProps.js +58 -58
- package/esm/config/useValidateProps.js.map +7 -0
- package/esm/config/validateHelpers.js +66 -28
- package/esm/config/validateHelpers.js.map +7 -0
- package/esm/defaultProps.js +5 -3
- package/esm/defaultProps.js.map +7 -0
- package/esm/index.js +7 -1
- package/esm/index.js.map +7 -0
- package/esm/outOfTheBox/AppPicker/AppPicker.js +50 -76
- package/esm/outOfTheBox/AppPicker/AppPicker.js.map +7 -0
- package/esm/outOfTheBox/PopupMenu/PopupMenu.js +37 -61
- package/esm/outOfTheBox/PopupMenu/PopupMenu.js.map +7 -0
- package/esm/outOfTheBox/PopupMenu/PopupMenuContent.js +45 -71
- package/esm/outOfTheBox/PopupMenu/PopupMenuContent.js.map +7 -0
- package/esm/outOfTheBox/PopupMenu/styles.js +38 -21
- package/esm/outOfTheBox/PopupMenu/styles.js.map +7 -0
- package/esm/outOfTheBox/SearchToggle/SearchToggle.js +46 -70
- package/esm/outOfTheBox/SearchToggle/SearchToggle.js.map +7 -0
- package/esm/outOfTheBox/SearchToggle/styles.js +51 -5
- package/esm/outOfTheBox/SearchToggle/styles.js.map +7 -0
- package/esm/outOfTheBox/index.js +5 -3
- package/esm/outOfTheBox/index.js.map +7 -0
- package/esm/propTypes.js +21 -17
- package/esm/propTypes.js.map +7 -0
- package/esm/styles.js +14 -13
- package/esm/styles.js.map +7 -0
- package/package.json +7 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/PopupMenu/PopupMenu.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState, useCallback, useMemo } from 'react';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { PopupMenuContent } from './PopupMenuContent';\nimport { Button } from '../../components/Toolbar/styles';\nimport { getDataProps } from '@elliemae/ds-props-helpers';\nimport type { PopupPropsT as Props } from '../../GlobalHeaderTypes';\n\nexport const PopupMenu = ({ Icon, title, onClick, id, componentProps, ...otherProps }: Props): JSX.Element => {\n const [isOpen, setIsOpen] = useState<boolean>(false);\n const [buttonRef, setButtonRef] = useState<HTMLButtonElement | null>(null);\n\n const {\n onClickOutside = () => null,\n onKeyPress,\n popupOnKeyPress,\n isOpen: userIsOpen,\n options,\n closeOnClick,\n } = componentProps;\n\n const handleKeyPress = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.code === 'Enter' || e.code === 'Space') {\n setIsOpen(true);\n }\n if (onKeyPress) onKeyPress(e);\n },\n [onKeyPress],\n );\n\n const handleOnClose = useCallback(() => {\n if (userIsOpen === undefined) {\n setIsOpen(false);\n }\n buttonRef?.focus();\n }, [buttonRef, userIsOpen]);\n\n const handleTriggerOnClick = useCallback(\n (e) => {\n if (userIsOpen === undefined) setIsOpen(true);\n onClick(e);\n },\n [onClick, userIsOpen],\n );\n\n const handleItemClick = useCallback(() => {\n if (closeOnClick && userIsOpen === undefined) handleOnClose();\n }, [closeOnClick, handleOnClose, userIsOpen]);\n\n const content = useMemo(\n () => (\n <PopupMenuContent\n options={options}\n onItemClick={handleItemClick}\n onClose={handleOnClose}\n popupOnKeyPress={popupOnKeyPress}\n />\n ),\n [options, handleItemClick, handleOnClose, popupOnKeyPress],\n );\n\n return (\n <div>\n <Button\n onClick={handleTriggerOnClick}\n onKeyPress={handleKeyPress}\n title={title}\n ref={setButtonRef}\n data-testid=\"gh-toolbar-item\"\n id={id}\n {...getDataProps(otherProps)}\n >\n {Icon && <Icon fill=\"#FFF\" size=\"m\" />}\n </Button>\n <DSPopperJS\n referenceElement={buttonRef}\n showPopover={userIsOpen ?? isOpen}\n closeContextMenu={handleOnClose}\n onClickOutside={onClickOutside}\n >\n {content}\n </DSPopperJS>\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AAGO,MAAM,YAAY,CAAC,EAAE,MAAM,OAAO,SAAS,IAAI,mBAAmB,iBAAqC;AAC5G,QAAM,CAAC,QAAQ,aAAa,SAAkB;AAC9C,QAAM,CAAC,WAAW,gBAAgB,SAAmC;AAErE,QAAM;AAAA,IACJ,iBAAiB,MAAM;AAAA,IACvB;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,MACE;AAEJ,QAAM,iBAAiB,YACrB,CAAC,MAA2B;AAC1B,QAAI,EAAE,SAAS,WAAW,EAAE,SAAS,SAAS;AAC5C,gBAAU;AAAA;AAEZ,QAAI;AAAY,iBAAW;AAAA,KAE7B,CAAC;AAGH,QAAM,gBAAgB,YAAY,MAAM;AACtC,QAAI,eAAe,QAAW;AAC5B,gBAAU;AAAA;AAEZ,eAAW;AAAA,KACV,CAAC,WAAW;AAEf,QAAM,uBAAuB,YAC3B,CAAC,MAAM;AACL,QAAI,eAAe;AAAW,gBAAU;AACxC,YAAQ;AAAA,KAEV,CAAC,SAAS;AAGZ,QAAM,kBAAkB,YAAY,MAAM;AACxC,QAAI,gBAAgB,eAAe;AAAW;AAAA,KAC7C,CAAC,cAAc,eAAe;AAEjC,QAAM,UAAU,QACd,MACE,qCAAC,kBAAD;AAAA,IACE;AAAA,IACA,aAAa;AAAA,IACb,SAAS;AAAA,IACT;AAAA,MAGJ,CAAC,SAAS,iBAAiB,eAAe;AAG5C,SACE,qCAAC,OAAD,MACE,qCAAC,QAAD;AAAA,IACE,SAAS;AAAA,IACT,YAAY;AAAA,IACZ;AAAA,IACA,KAAK;AAAA,IACL,eAAY;AAAA,IACZ;AAAA,OACI,aAAa;AAAA,KAEhB,QAAQ,qCAAC,MAAD;AAAA,IAAM,MAAK;AAAA,IAAO,MAAK;AAAA,OAElC,qCAAC,YAAD;AAAA,IACE,kBAAkB;AAAA,IAClB,aAAa,cAAc;AAAA,IAC3B,kBAAkB;AAAA,IAClB;AAAA,KAEC;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,86 +1,60 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
10
|
-
import React, { useContext, useRef, useEffect, useMemo } from 'react';
|
|
11
|
-
import { getDataProps, getAriaProps } from '@elliemae/ds-props-helpers';
|
|
12
|
-
import { ItemWrapper, Separator, List, Label } from './styles.js';
|
|
13
|
-
import { GlobalHeaderContext } from '../../GlobalHeaderContext.js';
|
|
14
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
15
|
-
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
-
const PopupMenuContent = /*#__PURE__*/React.memo(_ref => {
|
|
20
|
-
let {
|
|
21
|
-
options,
|
|
22
|
-
onItemClick,
|
|
23
|
-
onClose,
|
|
24
|
-
popupOnKeyPress
|
|
25
|
-
} = _ref;
|
|
26
|
-
const {
|
|
27
|
-
instanceUID
|
|
28
|
-
} = useContext(GlobalHeaderContext);
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useRef, useEffect, useMemo, useContext } from "react";
|
|
3
|
+
import { getAriaProps, getDataProps } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { Separator, ItemWrapper, Label, List } from "./styles";
|
|
5
|
+
import { GlobalHeaderContext } from "../../GlobalHeaderContext";
|
|
6
|
+
const PopupMenuContent = React2.memo(({ options, onItemClick, onClose, popupOnKeyPress }) => {
|
|
7
|
+
const { instanceUID } = useContext(GlobalHeaderContext);
|
|
29
8
|
const menuRef = useRef(null);
|
|
30
9
|
useEffect(() => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
(_menuRef$current = menuRef.current) === null || _menuRef$current === void 0 ? void 0 : (_menuRef$current$firs = _menuRef$current.firstChild) === null || _menuRef$current$firs === void 0 ? void 0 : _menuRef$current$firs.focus();
|
|
10
|
+
menuRef.current?.firstChild?.focus();
|
|
34
11
|
}, []);
|
|
35
|
-
const content = useMemo(() => options.map(option => {
|
|
36
|
-
const {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
id
|
|
43
|
-
} = option;
|
|
44
|
-
|
|
45
|
-
const ariaAndDataProps = _objectSpread(_objectSpread({}, getAriaProps(option)), getDataProps(option));
|
|
46
|
-
|
|
47
|
-
const handleClick = e => {
|
|
12
|
+
const content = useMemo(() => options.map((option) => {
|
|
13
|
+
const { type, Icon, label = "", onClick, Content, id } = option;
|
|
14
|
+
const ariaAndDataProps = {
|
|
15
|
+
...getAriaProps(option),
|
|
16
|
+
...getDataProps(option)
|
|
17
|
+
};
|
|
18
|
+
const handleClick = (e) => {
|
|
48
19
|
onItemClick(e);
|
|
49
|
-
if (onClick)
|
|
20
|
+
if (onClick)
|
|
21
|
+
onClick(e);
|
|
50
22
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (popupOnKeyPress)
|
|
23
|
+
const handleKeyDown = (e) => {
|
|
24
|
+
if (e.code === "Escape")
|
|
25
|
+
onClose();
|
|
26
|
+
if (popupOnKeyPress)
|
|
27
|
+
popupOnKeyPress(e);
|
|
55
28
|
};
|
|
56
|
-
|
|
57
29
|
switch (type) {
|
|
58
|
-
case
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
30
|
+
case "separator":
|
|
31
|
+
return /* @__PURE__ */ React2.createElement(Separator, {
|
|
32
|
+
key: `${instanceUID}-separator-${label}`,
|
|
33
|
+
...ariaAndDataProps
|
|
34
|
+
});
|
|
35
|
+
case "custom":
|
|
36
|
+
return /* @__PURE__ */ React2.createElement(ItemWrapper, {
|
|
63
37
|
onClick: handleClick,
|
|
64
38
|
onKeyDown: handleKeyDown,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
39
|
+
key: `${instanceUID}-popup-${label}`,
|
|
40
|
+
id,
|
|
41
|
+
...ariaAndDataProps
|
|
42
|
+
}, Content && /* @__PURE__ */ React2.createElement(Content, null));
|
|
70
43
|
default:
|
|
71
|
-
return
|
|
44
|
+
return /* @__PURE__ */ React2.createElement(ItemWrapper, {
|
|
72
45
|
onClick: handleClick,
|
|
73
46
|
onKeyDown: handleKeyDown,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
47
|
+
key: `${instanceUID}-popup-${label}`,
|
|
48
|
+
id,
|
|
49
|
+
...ariaAndDataProps
|
|
50
|
+
}, Icon && /* @__PURE__ */ React2.createElement(Icon, null), Label && /* @__PURE__ */ React2.createElement(Label, null, label));
|
|
78
51
|
}
|
|
79
52
|
}), [options, onItemClick, onClose, popupOnKeyPress, instanceUID]);
|
|
80
|
-
return
|
|
81
|
-
ref: menuRef
|
|
82
|
-
|
|
83
|
-
});
|
|
53
|
+
return /* @__PURE__ */ React2.createElement(List, {
|
|
54
|
+
ref: menuRef
|
|
55
|
+
}, content);
|
|
84
56
|
});
|
|
85
|
-
|
|
86
|
-
|
|
57
|
+
export {
|
|
58
|
+
PopupMenuContent
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=PopupMenuContent.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/PopupMenu/PopupMenuContent.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef, useEffect, useMemo, useContext } from 'react';\nimport { getAriaProps, getDataProps } from '@elliemae/ds-props-helpers';\nimport { Separator, ItemWrapper, Label, List } from './styles';\nimport type { PopupMenuContentPropsT as Props } from '../../GlobalHeaderTypes';\nimport { GlobalHeaderContext } from '../../GlobalHeaderContext';\n\nexport const PopupMenuContent = React.memo(({ options, onItemClick, onClose, popupOnKeyPress }: Props): JSX.Element => {\n const { instanceUID } = useContext(GlobalHeaderContext);\n\n const menuRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n (menuRef.current?.firstChild as HTMLButtonElement)?.focus();\n }, []);\n\n const content = useMemo(\n () =>\n options.map((option) => {\n const { type, Icon, label = '', onClick, Content, id } = option;\n\n const ariaAndDataProps = {\n ...getAriaProps(option),\n ...getDataProps(option),\n };\n\n const handleClick = (e: React.MouseEvent<HTMLElement, MouseEvent>) => {\n onItemClick(e);\n if (onClick) onClick(e);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (e.code === 'Escape') onClose();\n if (popupOnKeyPress) popupOnKeyPress(e);\n };\n\n switch (type) {\n case 'separator':\n return <Separator key={`${instanceUID}-separator-${label}`} {...ariaAndDataProps} />;\n case 'custom':\n return (\n <ItemWrapper\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n key={`${instanceUID}-popup-${label}`}\n id={id}\n {...ariaAndDataProps}\n >\n {Content && <Content />}\n </ItemWrapper>\n );\n default:\n return (\n <ItemWrapper\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n key={`${instanceUID}-popup-${label}`}\n id={id}\n {...ariaAndDataProps}\n >\n {Icon && <Icon />}\n {Label && <Label>{label}</Label>}\n </ItemWrapper>\n );\n }\n }),\n [options, onItemClick, onClose, popupOnKeyPress, instanceUID],\n );\n return <List ref={menuRef}>{content}</List>;\n});\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAEA;AAEO,MAAM,mBAAmB,OAAM,KAAK,CAAC,EAAE,SAAS,aAAa,SAAS,sBAA0C;AACrH,QAAM,EAAE,gBAAgB,WAAW;AAEnC,QAAM,UAAU,OAAuB;AAEvC,YAAU,MAAM;AACd,IAAC,QAAQ,SAAS,YAAkC;AAAA,KACnD;AAEH,QAAM,UAAU,QACd,MACE,QAAQ,IAAI,CAAC,WAAW;AACtB,UAAM,EAAE,MAAM,MAAM,QAAQ,IAAI,SAAS,SAAS,OAAO;AAEzD,UAAM,mBAAmB;AAAA,SACpB,aAAa;AAAA,SACb,aAAa;AAAA;AAGlB,UAAM,cAAc,CAAC,MAAiD;AACpE,kBAAY;AACZ,UAAI;AAAS,gBAAQ;AAAA;AAGvB,UAAM,gBAAgB,CAAC,MAA2B;AAChD,UAAI,EAAE,SAAS;AAAU;AACzB,UAAI;AAAiB,wBAAgB;AAAA;AAGvC,YAAQ;AAAA,WACD;AACH,eAAO,qCAAC,WAAD;AAAA,UAAW,KAAK,GAAG,yBAAyB;AAAA,aAAa;AAAA;AAAA,WAC7D;AACH,eACE,qCAAC,aAAD;AAAA,UACE,SAAS;AAAA,UACT,WAAW;AAAA,UACX,KAAK,GAAG,qBAAqB;AAAA,UAC7B;AAAA,aACI;AAAA,WAEH,WAAW,qCAAC,SAAD;AAAA;AAIhB,eACE,qCAAC,aAAD;AAAA,UACE,SAAS;AAAA,UACT,WAAW;AAAA,UACX,KAAK,GAAG,qBAAqB;AAAA,UAC7B;AAAA,aACI;AAAA,WAEH,QAAQ,qCAAC,MAAD,OACR,SAAS,qCAAC,OAAD,MAAQ;AAAA;AAAA,MAK9B,CAAC,SAAS,aAAa,SAAS,iBAAiB;AAEnD,SAAO,qCAAC,MAAD;AAAA,IAAM,KAAK;AAAA,KAAU;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,21 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const List =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
const List = styled.div`
|
|
4
|
+
padding: 5px 0px;
|
|
5
|
+
background: white;
|
|
6
|
+
`;
|
|
7
|
+
const ItemWrapper = styled.button`
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
width: 100%;
|
|
12
|
+
padding: 0 20px;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
border: 1px solid transparent;
|
|
15
|
+
background-color: transparent;
|
|
16
|
+
outline: none;
|
|
17
|
+
:hover,
|
|
18
|
+
:focus {
|
|
19
|
+
border: ${({ theme }) => `1px solid ${theme.colors.brand[600]}`};
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
const Label = styled.p`
|
|
23
|
+
width: 100%;
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
margin: 10px;
|
|
26
|
+
`;
|
|
27
|
+
const Separator = styled.div`
|
|
28
|
+
width: 100%;
|
|
29
|
+
border: none;
|
|
30
|
+
border-bottom: 1px solid #ccc;
|
|
31
|
+
`;
|
|
32
|
+
export {
|
|
33
|
+
ItemWrapper,
|
|
34
|
+
Label,
|
|
35
|
+
List,
|
|
36
|
+
Separator
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/PopupMenu/styles.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\n\nexport const List = styled.div`\n padding: 5px 0px;\n background: white;\n`;\n\nexport const ItemWrapper = styled.button`\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n padding: 0 20px;\n cursor: pointer;\n border: 1px solid transparent;\n background-color: transparent;\n outline: none;\n :hover,\n :focus {\n border: ${({ theme }) => `1px solid ${theme.colors.brand[600]}`};\n }\n`;\n\nexport const Label = styled.p`\n width: 100%;\n font-size: 14px;\n margin: 10px;\n`;\n\nexport const Separator = styled.div`\n width: 100%;\n border: none;\n border-bottom: 1px solid #ccc;\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,MAAM,OAAO,OAAO;AAAA;AAAA;AAAA;AAKpB,MAAM,cAAc,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAYpB,CAAC,EAAE,YAAY,aAAa,MAAM,OAAO,MAAM;AAAA;AAAA;AAItD,MAAM,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA;AAMrB,MAAM,YAAY,OAAO;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,33 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
import { useState, useRef, useCallback } from 'react';
|
|
11
|
-
import { Search } from '@elliemae/ds-icons';
|
|
12
|
-
import { getDataProps } from '@elliemae/ds-props-helpers';
|
|
13
|
-
import { DSIconColors } from '@elliemae/ds-icon';
|
|
14
|
-
import { DSNavSearchBox } from '@elliemae/ds-form';
|
|
15
|
-
import { StyledNavSearchBoxContainer } from './styles.js';
|
|
16
|
-
import { Button } from '../../components/Toolbar/styles.js';
|
|
17
|
-
import { jsx } from 'react/jsx-runtime';
|
|
18
|
-
|
|
19
|
-
const _excluded = ["id", "componentProps"];
|
|
20
|
-
|
|
21
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
-
|
|
23
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
|
-
const SearchToggle = _ref => {
|
|
25
|
-
let {
|
|
26
|
-
id,
|
|
27
|
-
componentProps
|
|
28
|
-
} = _ref,
|
|
29
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useState, useCallback, useRef } from "react";
|
|
3
|
+
import { Search } from "@elliemae/ds-icons";
|
|
4
|
+
import { getDataProps } from "@elliemae/ds-props-helpers";
|
|
5
|
+
import { DSIconColors } from "@elliemae/ds-icon";
|
|
6
|
+
import { DSNavSearchBox } from "@elliemae/ds-form";
|
|
7
|
+
import { StyledNavSearchBoxContainer } from "./styles";
|
|
8
|
+
import { Button } from "../../components/Toolbar/styles";
|
|
9
|
+
const SearchToggle = ({ id, componentProps, ...otherProps }) => {
|
|
31
10
|
const [isOpen, setIsOpen] = useState(false);
|
|
32
11
|
const inputRef = useRef(null);
|
|
33
12
|
const triggerRef = useRef(null);
|
|
@@ -46,58 +25,55 @@ const SearchToggle = _ref => {
|
|
|
46
25
|
onKeyDown,
|
|
47
26
|
onClick
|
|
48
27
|
} = componentProps;
|
|
49
|
-
const handleOnClick = useCallback(e => {
|
|
50
|
-
if (userIsOpen ===
|
|
51
|
-
|
|
28
|
+
const handleOnClick = useCallback((e) => {
|
|
29
|
+
if (userIsOpen === void 0)
|
|
30
|
+
setIsOpen(true);
|
|
31
|
+
if (onClick)
|
|
32
|
+
onClick(e);
|
|
52
33
|
}, [onClick, userIsOpen]);
|
|
53
|
-
const handleOnKeyDown = useCallback(e => {
|
|
54
|
-
if (userIsOpen ===
|
|
55
|
-
if (e.code ===
|
|
34
|
+
const handleOnKeyDown = useCallback((e) => {
|
|
35
|
+
if (userIsOpen === void 0) {
|
|
36
|
+
if (e.code === "Escape") {
|
|
56
37
|
setIsOpen(false);
|
|
57
|
-
setTimeout(() =>
|
|
58
|
-
var _triggerRef$current;
|
|
59
|
-
|
|
60
|
-
return (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.focus();
|
|
61
|
-
});
|
|
38
|
+
setTimeout(() => triggerRef.current?.focus());
|
|
62
39
|
}
|
|
63
40
|
}
|
|
64
|
-
|
|
65
|
-
|
|
41
|
+
if (onKeyDown)
|
|
42
|
+
onKeyDown(e);
|
|
66
43
|
}, [onKeyDown, userIsOpen]);
|
|
67
44
|
const handleOnBlur = useCallback(() => {
|
|
68
45
|
setTimeout(() => {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (value === '' && !contains) setIsOpen(false);
|
|
46
|
+
const contains = containerRef.current?.contains(document.activeElement);
|
|
47
|
+
if (value === "" && !contains)
|
|
48
|
+
setIsOpen(false);
|
|
73
49
|
});
|
|
74
50
|
}, [value]);
|
|
75
|
-
return userIsOpen || isOpen ?
|
|
51
|
+
return userIsOpen || isOpen ? /* @__PURE__ */ React2.createElement(StyledNavSearchBoxContainer, {
|
|
76
52
|
onKeyDown: handleOnKeyDown,
|
|
77
53
|
ref: containerRef,
|
|
78
|
-
onBlur: handleOnBlur
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}) : /*#__PURE__*/jsx(Button, _objectSpread(_objectSpread({
|
|
54
|
+
onBlur: handleOnBlur
|
|
55
|
+
}, /* @__PURE__ */ React2.createElement(DSNavSearchBox, {
|
|
56
|
+
onNext,
|
|
57
|
+
onPrevious,
|
|
58
|
+
currentResultIndex,
|
|
59
|
+
totalResults,
|
|
60
|
+
onClear,
|
|
61
|
+
placeholder,
|
|
62
|
+
onChange,
|
|
63
|
+
value,
|
|
64
|
+
onBlur,
|
|
65
|
+
innerRef: inputRef,
|
|
66
|
+
autoFocus: true
|
|
67
|
+
})) : /* @__PURE__ */ React2.createElement(Button, {
|
|
93
68
|
onClick: handleOnClick,
|
|
94
69
|
ref: triggerRef,
|
|
95
|
-
id
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
})
|
|
70
|
+
id,
|
|
71
|
+
...getDataProps(otherProps)
|
|
72
|
+
}, /* @__PURE__ */ React2.createElement(Search, {
|
|
73
|
+
color: DSIconColors.WHITE
|
|
100
74
|
}));
|
|
101
75
|
};
|
|
102
|
-
|
|
103
|
-
|
|
76
|
+
export {
|
|
77
|
+
SearchToggle
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=SearchToggle.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/SearchToggle/SearchToggle.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useState, useCallback, useRef } from 'react';\nimport { Search } from '@elliemae/ds-icons';\nimport { getDataProps } from '@elliemae/ds-props-helpers';\nimport { DSIconColors } from '@elliemae/ds-icon';\nimport { DSNavSearchBox } from '@elliemae/ds-form';\nimport { StyledNavSearchBoxContainer } from './styles';\nimport { Button } from '../../components/Toolbar/styles';\nimport type { SearchTogglePropsT } from 'index.d';\n\nexport const SearchToggle = ({ id, componentProps, ...otherProps }: SearchTogglePropsT): JSX.Element => {\n const [isOpen, setIsOpen] = useState<boolean>(false);\n const inputRef = useRef<HTMLInputElement | null>(null);\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const containerRef = useRef<HTMLDivElement | null>(null);\n\n const {\n onNext,\n onPrevious,\n currentResultIndex,\n totalResults,\n placeholder,\n value,\n onChange,\n onBlur,\n onClear,\n isOpen: userIsOpen,\n onKeyDown,\n onClick,\n } = componentProps;\n\n const handleOnClick = useCallback(\n (e) => {\n if (userIsOpen === undefined) setIsOpen(true);\n if (onClick) onClick(e);\n },\n [onClick, userIsOpen],\n );\n\n const handleOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (userIsOpen === undefined) {\n if (e.code === 'Escape') {\n setIsOpen(false);\n setTimeout(() => triggerRef.current?.focus());\n }\n }\n if (onKeyDown) onKeyDown(e);\n },\n [onKeyDown, userIsOpen],\n );\n\n const handleOnBlur = useCallback(() => {\n setTimeout(() => {\n const contains = containerRef.current?.contains(document.activeElement);\n if (value === '' && !contains) setIsOpen(false);\n });\n }, [value]);\n\n return userIsOpen || isOpen ? (\n <StyledNavSearchBoxContainer onKeyDown={handleOnKeyDown} ref={containerRef} onBlur={handleOnBlur}>\n <DSNavSearchBox\n onNext={onNext}\n onPrevious={onPrevious}\n currentResultIndex={currentResultIndex}\n totalResults={totalResults}\n onClear={onClear}\n placeholder={placeholder}\n onChange={onChange}\n value={value}\n onBlur={onBlur}\n innerRef={inputRef}\n autoFocus\n />\n </StyledNavSearchBoxContainer>\n ) : (\n <Button onClick={handleOnClick} ref={triggerRef} id={id} {...getDataProps(otherProps)}>\n <Search color={DSIconColors.WHITE} />\n </Button>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AAGO,MAAM,eAAe,CAAC,EAAE,IAAI,mBAAmB,iBAAkD;AACtG,QAAM,CAAC,QAAQ,aAAa,SAAkB;AAC9C,QAAM,WAAW,OAAgC;AACjD,QAAM,aAAa,OAAiC;AACpD,QAAM,eAAe,OAA8B;AAEnD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,MACE;AAEJ,QAAM,gBAAgB,YACpB,CAAC,MAAM;AACL,QAAI,eAAe;AAAW,gBAAU;AACxC,QAAI;AAAS,cAAQ;AAAA,KAEvB,CAAC,SAAS;AAGZ,QAAM,kBAAkB,YACtB,CAAC,MAA2B;AAC1B,QAAI,eAAe,QAAW;AAC5B,UAAI,EAAE,SAAS,UAAU;AACvB,kBAAU;AACV,mBAAW,MAAM,WAAW,SAAS;AAAA;AAAA;AAGzC,QAAI;AAAW,gBAAU;AAAA,KAE3B,CAAC,WAAW;AAGd,QAAM,eAAe,YAAY,MAAM;AACrC,eAAW,MAAM;AACf,YAAM,WAAW,aAAa,SAAS,SAAS,SAAS;AACzD,UAAI,UAAU,MAAM,CAAC;AAAU,kBAAU;AAAA;AAAA,KAE1C,CAAC;AAEJ,SAAO,cAAc,SACnB,qCAAC,6BAAD;AAAA,IAA6B,WAAW;AAAA,IAAiB,KAAK;AAAA,IAAc,QAAQ;AAAA,KAClF,qCAAC,gBAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,WAAS;AAAA,QAIb,qCAAC,QAAD;AAAA,IAAQ,SAAS;AAAA,IAAe,KAAK;AAAA,IAAY;AAAA,OAAY,aAAa;AAAA,KACxE,qCAAC,QAAD;AAAA,IAAQ,OAAO,aAAa;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,53 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
const StyledNavSearchBoxContainer = styled.div`
|
|
4
|
+
background: white;
|
|
5
|
+
position: relative;
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
componentId: "sc-1dlcqwh-0"
|
|
5
|
-
})(["background:white;position:relative;min-width:260px;& .em-ds-button{margin-right:2px;height:24px;width:24px;}& .em-ds-input{border:none;outline:none;box-shadow:none;}& .em-ds-input:focus{border:none;box-shadow:none;}& .em-ds-input.em-ds-input--clearable:hover{border:none;outline:none;box-shadow:none;}& .em-ds-input-addon-wrapper{box-shadow:none;}& .em-ds-input-addon-wrapper:hover{outline:none;}& .em-ds-input-addon-wrapper__addon:hover{outline:none;}& .em-ds-input:not(.floating-label-input-controller):hover:active{border:none;outline:none;box-shadow:none;}"]);
|
|
7
|
+
min-width: 260px;
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
& .em-ds-button {
|
|
10
|
+
margin-right: 2px;
|
|
11
|
+
height: 24px;
|
|
12
|
+
width: 24px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
& .em-ds-input {
|
|
16
|
+
border: none;
|
|
17
|
+
outline: none;
|
|
18
|
+
box-shadow: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
& .em-ds-input:focus {
|
|
22
|
+
border: none;
|
|
23
|
+
box-shadow: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
& .em-ds-input.em-ds-input--clearable:hover {
|
|
27
|
+
border: none;
|
|
28
|
+
outline: none;
|
|
29
|
+
box-shadow: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
& .em-ds-input-addon-wrapper {
|
|
33
|
+
box-shadow: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
& .em-ds-input-addon-wrapper:hover {
|
|
37
|
+
outline: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
& .em-ds-input-addon-wrapper__addon:hover {
|
|
41
|
+
outline: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
& .em-ds-input:not(.floating-label-input-controller):hover:active {
|
|
45
|
+
border: none;
|
|
46
|
+
outline: none;
|
|
47
|
+
box-shadow: none;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
export {
|
|
51
|
+
StyledNavSearchBoxContainer
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/outOfTheBox/SearchToggle/styles.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\n\nexport const StyledNavSearchBoxContainer = styled.div`\n background: white;\n position: relative;\n\n min-width: 260px;\n\n & .em-ds-button {\n margin-right: 2px;\n height: 24px;\n width: 24px;\n }\n\n & .em-ds-input {\n border: none;\n outline: none;\n box-shadow: none;\n }\n\n & .em-ds-input:focus {\n border: none;\n box-shadow: none;\n }\n\n & .em-ds-input.em-ds-input--clearable:hover {\n border: none;\n outline: none;\n box-shadow: none;\n }\n\n & .em-ds-input-addon-wrapper {\n box-shadow: none;\n }\n\n & .em-ds-input-addon-wrapper:hover {\n outline: none;\n }\n\n & .em-ds-input-addon-wrapper__addon:hover {\n outline: none;\n }\n\n & .em-ds-input:not(.floating-label-input-controller):hover:active {\n border: none;\n outline: none;\n box-shadow: none;\n }\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,MAAM,8BAA8B,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/outOfTheBox/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export * from "./AppPicker/AppPicker";
|
|
3
|
+
export * from "./PopupMenu/PopupMenu";
|
|
4
|
+
export * from "./SearchToggle/SearchToggle";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/outOfTheBox/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './AppPicker/AppPicker';\nexport * from './PopupMenu/PopupMenu';\nexport * from './SearchToggle/SearchToggle';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/propTypes.js
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes } from "react-desc";
|
|
3
3
|
const breadcrumbItem = PropTypes.shape({
|
|
4
|
-
label: PropTypes.string.description(
|
|
5
|
-
hasNext: PropTypes.bool.description(
|
|
6
|
-
isSelected: PropTypes.bool.description(
|
|
7
|
-
onClick: PropTypes.func.description(
|
|
4
|
+
label: PropTypes.string.description("breadrcrumb item label"),
|
|
5
|
+
hasNext: PropTypes.bool.description("whether the item has a child or not"),
|
|
6
|
+
isSelected: PropTypes.bool.description("whether the item is selected or not"),
|
|
7
|
+
onClick: PropTypes.func.description("Callback executed on click")
|
|
8
8
|
});
|
|
9
9
|
const toolbarItem = PropTypes.shape({
|
|
10
|
-
label: PropTypes.string.description(
|
|
11
|
-
type: PropTypes.oneOf([
|
|
12
|
-
componentProps: PropTypes.object.description(
|
|
13
|
-
Icon: PropTypes.func.description(
|
|
14
|
-
onClick: PropTypes.func.description(
|
|
10
|
+
label: PropTypes.string.description("title tag description"),
|
|
11
|
+
type: PropTypes.oneOf(["ds-app-picker", "ds-popup-menu", "ds-search-toggle", "custom"]).description("use to select one of the out-of-the-box types of items"),
|
|
12
|
+
componentProps: PropTypes.object.description("props of out-of-the-box component"),
|
|
13
|
+
Icon: PropTypes.func.description("Icon to display"),
|
|
14
|
+
onClick: PropTypes.func.description("Callback executed on click")
|
|
15
15
|
});
|
|
16
16
|
const globalHeaderProps = {
|
|
17
|
-
Logo: PropTypes.func.description(
|
|
18
|
-
LogoWithBrand: PropTypes.func.description(
|
|
19
|
-
breadcrumb: PropTypes.arrayOf(breadcrumbItem).description(
|
|
20
|
-
toolbar: PropTypes.arrayOf(toolbarItem).description(
|
|
17
|
+
Logo: PropTypes.func.description("Global Header Logo to render. Logo and LogoWithBrand are going to swap during window resizing."),
|
|
18
|
+
LogoWithBrand: PropTypes.func.description("Global Header Logo With Brand title to render. Logo and LogoWithBrand are going to swap during window resizing."),
|
|
19
|
+
breadcrumb: PropTypes.arrayOf(breadcrumbItem).description("Breadcrumb items to display. max 3 levels"),
|
|
20
|
+
toolbar: PropTypes.arrayOf(toolbarItem).description("Toolbar items")
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
export {
|
|
23
|
+
breadcrumbItem,
|
|
24
|
+
globalHeaderProps,
|
|
25
|
+
toolbarItem
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=propTypes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/propTypes.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { PropTypes } from 'react-desc';\n\nexport const breadcrumbItem = 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\nexport const toolbarItem = 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\nexport const globalHeaderProps = {\n Logo: PropTypes.func.description(\n 'Global Header Logo to render. Logo and LogoWithBrand are going to swap during window resizing.',\n ),\n LogoWithBrand: PropTypes.func.description(\n 'Global Header Logo With Brand title to render. Logo and LogoWithBrand are going to swap during window resizing.',\n ),\n breadcrumb: PropTypes.arrayOf(breadcrumbItem).description('Breadcrumb items to display. max 3 levels'),\n toolbar: PropTypes.arrayOf(toolbarItem).description('Toolbar items'),\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,MAAM,iBAAiB,UAAU,MAAM;AAAA,EAC5C,OAAO,UAAU,OAAO,YAAY;AAAA,EACpC,SAAS,UAAU,KAAK,YAAY;AAAA,EACpC,YAAY,UAAU,KAAK,YAAY;AAAA,EACvC,SAAS,UAAU,KAAK,YAAY;AAAA;AAG/B,MAAM,cAAc,UAAU,MAAM;AAAA,EACzC,OAAO,UAAU,OAAO,YAAY;AAAA,EACpC,MAAM,UAAU,MAAM,CAAC,iBAAiB,iBAAiB,oBAAoB,WAAW,YACtF;AAAA,EAEF,gBAAgB,UAAU,OAAO,YAAY;AAAA,EAC7C,MAAM,UAAU,KAAK,YAAY;AAAA,EACjC,SAAS,UAAU,KAAK,YAAY;AAAA;AAG/B,MAAM,oBAAoB;AAAA,EAC/B,MAAM,UAAU,KAAK,YACnB;AAAA,EAEF,eAAe,UAAU,KAAK,YAC5B;AAAA,EAEF,YAAY,UAAU,QAAQ,gBAAgB,YAAY;AAAA,EAC1D,SAAS,UAAU,QAAQ,aAAa,YAAY;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/styles.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const Wrapper =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { GridContainer } from "@elliemae/ds-grid";
|
|
4
|
+
const Wrapper = styled(GridContainer)`
|
|
5
|
+
background-image: linear-gradient(45deg, #0f364a 0%, #1b6392 54%, #164566 100%);
|
|
6
|
+
color: ${({ theme }) => theme.colors.neutral["000"]};
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 40px;
|
|
9
|
+
padding: 0 24px 0 12px;
|
|
10
|
+
`;
|
|
11
|
+
export {
|
|
12
|
+
Wrapper
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled from 'styled-components';\nimport { GridContainer } from '@elliemae/ds-grid';\n\nexport const Wrapper = styled(GridContainer)`\n background-image: linear-gradient(45deg, #0f364a 0%, #1b6392 54%, #164566 100%);\n color: ${({ theme }) => theme.colors.neutral['000']};\n width: 100%;\n height: 40px;\n padding: 0 24px 0 12px;\n`;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEO,MAAM,UAAU,OAAO;AAAA;AAAA,WAEnB,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-global-header",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-alpha.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Global Header",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -132,12 +132,12 @@
|
|
|
132
132
|
"build": "node ../../scripts/build/build.js"
|
|
133
133
|
},
|
|
134
134
|
"dependencies": {
|
|
135
|
-
"@elliemae/ds-app-picker": "2.
|
|
136
|
-
"@elliemae/ds-grid": "2.
|
|
137
|
-
"@elliemae/ds-icons": "2.
|
|
138
|
-
"@elliemae/ds-popperjs": "2.
|
|
139
|
-
"@elliemae/ds-props-helpers": "2.
|
|
140
|
-
"@elliemae/ds-utilities": "2.
|
|
135
|
+
"@elliemae/ds-app-picker": "2.2.0-alpha.3",
|
|
136
|
+
"@elliemae/ds-grid": "2.2.0-alpha.3",
|
|
137
|
+
"@elliemae/ds-icons": "2.2.0-alpha.3",
|
|
138
|
+
"@elliemae/ds-popperjs": "2.2.0-alpha.3",
|
|
139
|
+
"@elliemae/ds-props-helpers": "2.2.0-alpha.3",
|
|
140
|
+
"@elliemae/ds-utilities": "2.2.0-alpha.3",
|
|
141
141
|
"react-desc": "~4.1.3",
|
|
142
142
|
"uid": "~2.0.0"
|
|
143
143
|
},
|