@elliemae/ds-toolbar 1.61.10 → 1.61.13
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/DSToolbarItemV2.js.map +1 -1
- package/cjs/DSToolbarSeparatorV2.js.map +1 -1
- package/cjs/DSToolbarV2.js.map +1 -1
- package/cjs/DSToolbarV2Context.js.map +1 -1
- package/cjs/deprecated/DSToolbar.js.map +1 -1
- package/cjs/deprecated/ToolbarGroup.js.map +1 -1
- package/cjs/deprecated/ToolbarItem.js.map +1 -1
- package/cjs/deprecated/decorateToolbarChildren.js.map +1 -1
- package/cjs/props.js.map +1 -1
- package/cjs/styled.js.map +1 -1
- package/cjs/useToolbarItemHandlers.js.map +1 -1
- package/esm/DSToolbarItemV2.js.map +1 -1
- package/esm/DSToolbarSeparatorV2.js.map +1 -1
- package/esm/DSToolbarV2.js.map +1 -1
- package/esm/DSToolbarV2Context.js.map +1 -1
- package/esm/deprecated/DSToolbar.js.map +1 -1
- package/esm/deprecated/ToolbarGroup.js.map +1 -1
- package/esm/deprecated/ToolbarItem.js.map +1 -1
- package/esm/deprecated/decorateToolbarChildren.js.map +1 -1
- package/esm/props.js.map +1 -1
- package/esm/styled.js.map +1 -1
- package/esm/useToolbarItemHandlers.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSToolbarItemV2.js","sources":["../../src/DSToolbarItemV2.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { MutableRefObject, useContext, useMemo, useRef } from 'react';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { StyledToolbarItem } from './styled';\nimport { useToolbarItemHandlers } from './useToolbarItemHandlers';\n\ninterface ToolbarItemProps {\n render: (props: { innerRef: MutableRefObject<HTMLElement> }) => JSX.Element;\n}\n\nexport const DSToolbarItemV2: React.ComponentType<ToolbarItemProps> = ({ render }) => {\n const { registerReference } = useContext(DSToolbarV2Context);\n const ref = useRef(null);\n\n const toolbarItemId = useMemo(() => {\n const id = `ds-toolbar-item-${uid()}`;\n registerReference(id, ref);\n return id;\n }, [registerReference, ref]);\n\n const handlers = useToolbarItemHandlers(toolbarItemId);\n\n return (\n <StyledToolbarItem id={toolbarItemId} data-testid=\"ds-toolbar-item\" className=\"ds-toolbar-item\" {...handlers}>\n {render({ innerRef: ref })}\n </StyledToolbarItem>\n );\n};\n"],"names":["DSToolbarItemV2","render","useContext","DSToolbarV2Context","registerReference","ref","useRef","toolbarItemId","useMemo","id","uid","handlers","useToolbarItemHandlers","React","StyledToolbarItem","innerRef"],"mappings":";;;;;;;;;;;;;;;;;;;IAWaA,eAAsD,GAAG,SAAzDA,eAAyD,OAAgB;
|
|
1
|
+
{"version":3,"file":"DSToolbarItemV2.js","sources":["../../src/DSToolbarItemV2.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { MutableRefObject, useContext, useMemo, useRef } from 'react';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { StyledToolbarItem } from './styled';\nimport { useToolbarItemHandlers } from './useToolbarItemHandlers';\n\ninterface ToolbarItemProps {\n render: (props: { innerRef: MutableRefObject<HTMLElement> }) => JSX.Element;\n}\n\nexport const DSToolbarItemV2: React.ComponentType<ToolbarItemProps> = ({ render }) => {\n const { registerReference } = useContext(DSToolbarV2Context);\n const ref = useRef(null);\n\n const toolbarItemId = useMemo(() => {\n const id = `ds-toolbar-item-${uid()}`;\n registerReference(id, ref);\n return id;\n }, [registerReference, ref]);\n\n const handlers = useToolbarItemHandlers(toolbarItemId);\n\n return (\n <StyledToolbarItem id={toolbarItemId} data-testid=\"ds-toolbar-item\" className=\"ds-toolbar-item\" {...handlers}>\n {render({ innerRef: ref })}\n </StyledToolbarItem>\n );\n};\n"],"names":["DSToolbarItemV2","render","useContext","DSToolbarV2Context","registerReference","ref","useRef","toolbarItemId","useMemo","id","uid","handlers","useToolbarItemHandlers","React","StyledToolbarItem","innerRef"],"mappings":";;;;;;;;;;;;;;;;;;;IAWaA,eAAsD,GAAG,SAAzDA,eAAyD,OAAgB;EAAA,IAAbC,MAAa,QAAbA,MAAa;;EACpF,kBAA8BC,gBAAU,CAACC,qCAAD,CAAxC;MAAQC,iBAAR,eAAQA,iBAAR;;EACA,IAAMC,GAAG,GAAGC,YAAM,CAAC,IAAD,CAAlB;EAEA,IAAMC,aAAa,GAAGC,aAAO,CAAC,YAAM;IAClC,IAAMC,EAAE,6BAAsBC,OAAG,EAAzB,CAAR;IACAN,iBAAiB,CAACK,EAAD,EAAKJ,GAAL,CAAjB;IACA,OAAOI,EAAP;GAH2B,EAI1B,CAACL,iBAAD,EAAoBC,GAApB,CAJ0B,CAA7B;EAMA,IAAMM,QAAQ,GAAGC,6CAAsB,CAACL,aAAD,CAAvC;EAEA,oBACEM,wCAACC,wBAAD;IAAmB,EAAE,EAAEP,aAAvB;IAAsC,eAAY,iBAAlD;IAAoE,SAAS,EAAC;KAAsBI,QAApG,GACGV,MAAM,CAAC;IAAEc,QAAQ,EAAEV;GAAb,CADT,CADF;AAKD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSToolbarSeparatorV2.js","sources":["../../src/DSToolbarSeparatorV2.tsx"],"sourcesContent":["import React from 'react';\nimport { StyledSeparator } from './styled';\n\nexport const DSToolbarSeparatorV2: React.ComponentType = () => <StyledSeparator className=\"ds-toolbar-separator\" />;\n"],"names":["DSToolbarSeparatorV2","React","StyledSeparator"],"mappings":";;;;;;;;;;;;;IAGaA,oBAAyC,GAAG,SAA5CA,oBAA4C;
|
|
1
|
+
{"version":3,"file":"DSToolbarSeparatorV2.js","sources":["../../src/DSToolbarSeparatorV2.tsx"],"sourcesContent":["import React from 'react';\nimport { StyledSeparator } from './styled';\n\nexport const DSToolbarSeparatorV2: React.ComponentType = () => <StyledSeparator className=\"ds-toolbar-separator\" />;\n"],"names":["DSToolbarSeparatorV2","React","StyledSeparator"],"mappings":";;;;;;;;;;;;;IAGaA,oBAAyC,GAAG,SAA5CA,oBAA4C;EAAA,oBAAMC,wCAACC,sBAAD;IAAiB,SAAS,EAAC;IAAjC;AAAA;;;;"}
|
package/cjs/DSToolbarV2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSToolbarV2.js","sources":["../../src/DSToolbarV2.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { describe } from 'react-desc';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { DSToolbarV2Schema } from './props';\nimport { StyledToolbarWrapper } from './styled';\ninterface ToolbarProps {\n alignment?: 'left' | 'right';\n withDepth?: boolean;\n compact?: boolean;\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n}\n\nconst DSToolbarV2: React.ComponentType<ToolbarProps> = (props) => {\n const { alignment, withDepth, compact, innerRef, children } = props;\n\n useValidateTypescriptPropTypes(props, DSToolbarV2WithSchema.toTypescript());\n\n const toolbarUid = useMemo(() => `ds-toolbar-${uid()}`, []);\n\n const [itemReferences, setItemReferences] = useState({});\n\n const registerReference = useCallback(\n (itemId: string, ref: React.MutableRefObject<HTMLElement>) => {\n setItemReferences((prevItemReferences) => ({ ...prevItemReferences, [itemId]: ref }));\n },\n [setItemReferences],\n );\n\n return (\n <DSToolbarV2Context.Provider value={{ toolbarUid, registerReference, itemReferences }}>\n <StyledToolbarWrapper\n role=\"toolbar\"\n data-testid=\"ds-toolbar-wrapper\"\n id={toolbarUid}\n alignItems=\"center\"\n justifyContent={alignment === 'left' ? 'flex-start' : 'flex-end'}\n withDepth={withDepth}\n cols={React.Children.map(children, () => ['auto'])}\n gutter=\"xxs2\"\n compact={compact}\n ref={innerRef}\n >\n {children}\n </StyledToolbarWrapper>\n </DSToolbarV2Context.Provider>\n );\n};\n\nDSToolbarV2.propTypes = DSToolbarV2Schema;\nDSToolbarV2.defaultProps = {\n alignment: 'right',\n withDepth: true,\n compact: false,\n};\nconst DSToolbarV2WithSchema = describe(DSToolbarV2).description('Toolbar');\nDSToolbarV2WithSchema.propTypes = DSToolbarV2Schema;\n\nexport { DSToolbarV2, DSToolbarV2WithSchema };\n"],"names":["DSToolbarV2","props","alignment","withDepth","compact","innerRef","children","useValidateTypescriptPropTypes","DSToolbarV2WithSchema","toTypescript","toolbarUid","useMemo","uid","useState","itemReferences","setItemReferences","registerReference","useCallback","itemId","ref","prevItemReferences","React","DSToolbarV2Context","StyledToolbarWrapper","Children","map","propTypes","DSToolbarV2Schema","defaultProps","describe","description"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IAeMA,WAA8C,GAAG,SAAjDA,WAAiD,CAACC,KAAD,EAAW;
|
|
1
|
+
{"version":3,"file":"DSToolbarV2.js","sources":["../../src/DSToolbarV2.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { describe } from 'react-desc';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { DSToolbarV2Schema } from './props';\nimport { StyledToolbarWrapper } from './styled';\ninterface ToolbarProps {\n alignment?: 'left' | 'right';\n withDepth?: boolean;\n compact?: boolean;\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n}\n\nconst DSToolbarV2: React.ComponentType<ToolbarProps> = (props) => {\n const { alignment, withDepth, compact, innerRef, children } = props;\n\n useValidateTypescriptPropTypes(props, DSToolbarV2WithSchema.toTypescript());\n\n const toolbarUid = useMemo(() => `ds-toolbar-${uid()}`, []);\n\n const [itemReferences, setItemReferences] = useState({});\n\n const registerReference = useCallback(\n (itemId: string, ref: React.MutableRefObject<HTMLElement>) => {\n setItemReferences((prevItemReferences) => ({ ...prevItemReferences, [itemId]: ref }));\n },\n [setItemReferences],\n );\n\n return (\n <DSToolbarV2Context.Provider value={{ toolbarUid, registerReference, itemReferences }}>\n <StyledToolbarWrapper\n role=\"toolbar\"\n data-testid=\"ds-toolbar-wrapper\"\n id={toolbarUid}\n alignItems=\"center\"\n justifyContent={alignment === 'left' ? 'flex-start' : 'flex-end'}\n withDepth={withDepth}\n cols={React.Children.map(children, () => ['auto'])}\n gutter=\"xxs2\"\n compact={compact}\n ref={innerRef}\n >\n {children}\n </StyledToolbarWrapper>\n </DSToolbarV2Context.Provider>\n );\n};\n\nDSToolbarV2.propTypes = DSToolbarV2Schema;\nDSToolbarV2.defaultProps = {\n alignment: 'right',\n withDepth: true,\n compact: false,\n};\nconst DSToolbarV2WithSchema = describe(DSToolbarV2).description('Toolbar');\nDSToolbarV2WithSchema.propTypes = DSToolbarV2Schema;\n\nexport { DSToolbarV2, DSToolbarV2WithSchema };\n"],"names":["DSToolbarV2","props","alignment","withDepth","compact","innerRef","children","useValidateTypescriptPropTypes","DSToolbarV2WithSchema","toTypescript","toolbarUid","useMemo","uid","useState","itemReferences","setItemReferences","registerReference","useCallback","itemId","ref","prevItemReferences","React","DSToolbarV2Context","StyledToolbarWrapper","Children","map","propTypes","DSToolbarV2Schema","defaultProps","describe","description"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;IAeMA,WAA8C,GAAG,SAAjDA,WAAiD,CAACC,KAAD,EAAW;EAChE,IAAQC,SAAR,GAA8DD,KAA9D,CAAQC,SAAR;MAAmBC,SAAnB,GAA8DF,KAA9D,CAAmBE,SAAnB;MAA8BC,OAA9B,GAA8DH,KAA9D,CAA8BG,OAA9B;MAAuCC,QAAvC,GAA8DJ,KAA9D,CAAuCI,QAAvC;MAAiDC,QAAjD,GAA8DL,KAA9D,CAAiDK,QAAjD;EAEAC,6CAA8B,CAACN,KAAD,EAAQO,qBAAqB,CAACC,YAAtB,EAAR,CAA9B;EAEA,IAAMC,UAAU,GAAGC,aAAO,CAAC;IAAA,4BAAoBC,OAAG,EAAvB;GAAD,EAA8B,EAA9B,CAA1B;;EAEA,gBAA4CC,cAAQ,CAAC,EAAD,CAApD;;MAAOC,cAAP;MAAuBC,iBAAvB;;EAEA,IAAMC,iBAAiB,GAAGC,iBAAW,CACnC,UAACC,MAAD,EAAiBC,GAAjB,EAA8D;IAC5DJ,iBAAiB,CAAC,UAACK,kBAAD;MAAA,uCAA8BA,kBAA9B,+CAAmDF,MAAnD,EAA4DC,GAA5D;KAAD,CAAjB;GAFiC,EAInC,CAACJ,iBAAD,CAJmC,CAArC;EAOA,oBACEM,wCAACC,qCAAD,CAAoB,QAApB;IAA6B,KAAK,EAAE;MAAEZ,UAAU,EAAVA,UAAF;MAAcM,iBAAiB,EAAjBA,iBAAd;MAAiCF,cAAc,EAAdA;;kBACnEO,wCAACE,2BAAD;IACE,IAAI,EAAC,SADP;IAEE,eAAY,oBAFd;IAGE,EAAE,EAAEb,UAHN;IAIE,UAAU,EAAC,QAJb;IAKE,cAAc,EAAER,SAAS,KAAK,MAAd,GAAuB,YAAvB,GAAsC,UALxD;IAME,SAAS,EAAEC,SANb;IAOE,IAAI,EAAEkB,yBAAK,CAACG,QAAN,CAAeC,GAAf,CAAmBnB,QAAnB,EAA6B;MAAA,OAAM,CAAC,MAAD,CAAN;KAA7B,CAPR;IAQE,MAAM,EAAC,MART;IASE,OAAO,EAAEF,OATX;IAUE,GAAG,EAAEC;KAEJC,QAZH,CADF,CADF;AAkBD;;AAEDN,WAAW,CAAC0B,SAAZ,GAAwBC,uBAAxB;AACA3B,WAAW,CAAC4B,YAAZ,GAA2B;EACzB1B,SAAS,EAAE,OADc;EAEzBC,SAAS,EAAE,IAFc;EAGzBC,OAAO,EAAE;AAHgB,CAA3B;IAKMI,qBAAqB,GAAGqB,kBAAQ,CAAC7B,WAAD,CAAR,CAAsB8B,WAAtB,CAAkC,SAAlC;AAC9BtB,qBAAqB,CAACkB,SAAtB,GAAkCC,uBAAlC;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSToolbarV2Context.js","sources":["../../src/DSToolbarV2Context.tsx"],"sourcesContent":["import { createContext, MutableRefObject } from 'react';\n\ninterface IDSToolbarV2Context {\n registerReference: (uid: string, ref: MutableRefObject<HTMLElement>) => void;\n itemReferences: Record<string, MutableRefObject<HTMLElement>>;\n toolbarUid: string;\n}\n\nexport const DSToolbarV2Context = createContext<IDSToolbarV2Context>({\n registerReference: () => null,\n itemReferences: {},\n toolbarUid: '',\n});\n"],"names":["DSToolbarV2Context","createContext","registerReference","itemReferences","toolbarUid"],"mappings":";;;;;;IAQaA,kBAAkB,gBAAGC,mBAAa,CAAsB;
|
|
1
|
+
{"version":3,"file":"DSToolbarV2Context.js","sources":["../../src/DSToolbarV2Context.tsx"],"sourcesContent":["import { createContext, MutableRefObject } from 'react';\n\ninterface IDSToolbarV2Context {\n registerReference: (uid: string, ref: MutableRefObject<HTMLElement>) => void;\n itemReferences: Record<string, MutableRefObject<HTMLElement>>;\n toolbarUid: string;\n}\n\nexport const DSToolbarV2Context = createContext<IDSToolbarV2Context>({\n registerReference: () => null,\n itemReferences: {},\n toolbarUid: '',\n});\n"],"names":["DSToolbarV2Context","createContext","registerReference","itemReferences","toolbarUid"],"mappings":";;;;;;IAQaA,kBAAkB,gBAAGC,mBAAa,CAAsB;EACnEC,iBAAiB,EAAE;IAAA,OAAM,IAAN;GADgD;EAEnEC,cAAc,EAAE,EAFmD;EAGnEC,UAAU,EAAE;AAHuD,CAAtB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSToolbar.js","sources":["../../../src/deprecated/DSToolbar.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport FocusGroupProvider from '@elliemae/ds-shared/FocusGroup/FocusGroupManager';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport decorateToolbarChildren from './decorateToolbarChildren';\nimport Item from './ToolbarItem';\nimport ToolbarGroup from './ToolbarGroup';\nimport Divider from './ToolbarDivider';\n\nconst blockName = 'toolbar';\n\nconst ToolbarContainer = aggregatedClasses('div')(\n blockName,\n null,\n ({ withDepth, alignment, size }) => ({\n 'without-depth': !withDepth,\n [alignment]: !!alignment,\n [size]: size,\n }),\n);\n\nconst DSToolbar = ({\n containerProps = {},\n innerRef,\n withDepth = true,\n alignment = 'right', // left || right\n autoFocusOnMount = true,\n children = [],\n size = 'normal',\n ...otherProps\n}) => {\n const containerRef = useRef(null);\n return (\n <FocusGroupProvider\n autoFocusOnMount={autoFocusOnMount}\n getContainer={() => containerRef.current}\n keyBindings={{\n Tab: 'next',\n }}\n orientation=\"horizontal\"\n >\n <ToolbarContainer\n {...containerProps}\n {...otherProps}\n classProps={{ withDepth, alignment, size }}\n innerRef={mergeRefs(innerRef, containerRef)}\n >\n {decorateToolbarChildren(children)}\n </ToolbarContainer>\n </FocusGroupProvider>\n );\n};\n\nconst toolbarProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n withDepth: PropTypes.bool\n .description('Shows a shadow rear the toolbar')\n .defaultValue(true),\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Aligns the toolbar to the left or right')\n .defaultValue('right'),\n size: PropTypes.oneOf(['normal', 'compact'])\n .description('Toolbar size')\n .defaultValue('normal'),\n autoFocusOnMount: PropTypes.bool\n .description('Wheter to focus the component when it mounts or not')\n .defaultValue(true),\n children: PropTypes.oneOfType([\n PropTypes.array,\n PropTypes.func,\n PropTypes.node,\n ]).description('Toolbar items').isRequired,\n innerRef: PropTypes.object.description(\n 'Ref to the Toolbar container element',\n ),\n};\n\nDSToolbar.propTypes = toolbarProps;\n\nconst ToolbarWithSchema = describe(DSToolbar);\nToolbarWithSchema.propTypes = toolbarProps;\n\nexport {\n DSToolbar,\n Item as ToolbarItem,\n ToolbarGroup,\n Divider as ToolbarDivider,\n ToolbarWithSchema,\n};\n\nexport default DSToolbar;\n"],"names":["blockName","ToolbarContainer","aggregatedClasses","withDepth","alignment","size","DSToolbar","containerProps","innerRef","autoFocusOnMount","children","otherProps","containerRef","useRef","React","FocusGroupProvider","current","Tab","mergeRefs","decorateToolbarChildren","toolbarProps","PropTypes","object","description","bool","defaultValue","oneOf","oneOfType","array","func","node","isRequired","propTypes","ToolbarWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAMA,SAAS,GAAG,SAAlB;AAEA,IAAMC,gBAAgB,GAAGC,8BAAiB,CAAC,KAAD,CAAjB,CACvBF,SADuB,EAEvB,IAFuB,EAGvB;
|
|
1
|
+
{"version":3,"file":"DSToolbar.js","sources":["../../../src/deprecated/DSToolbar.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport FocusGroupProvider from '@elliemae/ds-shared/FocusGroup/FocusGroupManager';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport decorateToolbarChildren from './decorateToolbarChildren';\nimport Item from './ToolbarItem';\nimport ToolbarGroup from './ToolbarGroup';\nimport Divider from './ToolbarDivider';\n\nconst blockName = 'toolbar';\n\nconst ToolbarContainer = aggregatedClasses('div')(\n blockName,\n null,\n ({ withDepth, alignment, size }) => ({\n 'without-depth': !withDepth,\n [alignment]: !!alignment,\n [size]: size,\n }),\n);\n\nconst DSToolbar = ({\n containerProps = {},\n innerRef,\n withDepth = true,\n alignment = 'right', // left || right\n autoFocusOnMount = true,\n children = [],\n size = 'normal',\n ...otherProps\n}) => {\n const containerRef = useRef(null);\n return (\n <FocusGroupProvider\n autoFocusOnMount={autoFocusOnMount}\n getContainer={() => containerRef.current}\n keyBindings={{\n Tab: 'next',\n }}\n orientation=\"horizontal\"\n >\n <ToolbarContainer\n {...containerProps}\n {...otherProps}\n classProps={{ withDepth, alignment, size }}\n innerRef={mergeRefs(innerRef, containerRef)}\n >\n {decorateToolbarChildren(children)}\n </ToolbarContainer>\n </FocusGroupProvider>\n );\n};\n\nconst toolbarProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n withDepth: PropTypes.bool\n .description('Shows a shadow rear the toolbar')\n .defaultValue(true),\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Aligns the toolbar to the left or right')\n .defaultValue('right'),\n size: PropTypes.oneOf(['normal', 'compact'])\n .description('Toolbar size')\n .defaultValue('normal'),\n autoFocusOnMount: PropTypes.bool\n .description('Wheter to focus the component when it mounts or not')\n .defaultValue(true),\n children: PropTypes.oneOfType([\n PropTypes.array,\n PropTypes.func,\n PropTypes.node,\n ]).description('Toolbar items').isRequired,\n innerRef: PropTypes.object.description(\n 'Ref to the Toolbar container element',\n ),\n};\n\nDSToolbar.propTypes = toolbarProps;\n\nconst ToolbarWithSchema = describe(DSToolbar);\nToolbarWithSchema.propTypes = toolbarProps;\n\nexport {\n DSToolbar,\n Item as ToolbarItem,\n ToolbarGroup,\n Divider as ToolbarDivider,\n ToolbarWithSchema,\n};\n\nexport default DSToolbar;\n"],"names":["blockName","ToolbarContainer","aggregatedClasses","withDepth","alignment","size","DSToolbar","containerProps","innerRef","autoFocusOnMount","children","otherProps","containerRef","useRef","React","FocusGroupProvider","current","Tab","mergeRefs","decorateToolbarChildren","toolbarProps","PropTypes","object","description","bool","defaultValue","oneOf","oneOfType","array","func","node","isRequired","propTypes","ToolbarWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAMA,SAAS,GAAG,SAAlB;AAEA,IAAMC,gBAAgB,GAAGC,8BAAiB,CAAC,KAAD,CAAjB,CACvBF,SADuB,EAEvB,IAFuB,EAGvB;EAAA;;EAAA,IAAGG,SAAH,QAAGA,SAAH;MAAcC,SAAd,QAAcA,SAAd;MAAyBC,IAAzB,QAAyBA,IAAzB;EAAA;IACE,iBAAiB,CAACF;gDACjBC,SAFH,EAEe,CAAC,CAACA,SAFjB,8CAGGC,IAHH,EAGUA,IAHV;AAAA,CAHuB,CAAzB;;IAUMC,SAAS,GAAG,SAAZA,SAAY,QASZ;EAAA,iCARJC,cAQI;MARJA,cAQI,qCARa,EAQb;MAPJC,QAOI,SAPJA,QAOI;8BANJL,SAMI;MANJA,SAMI,gCANQ,IAMR;8BALJC,SAKI;MALJA,SAKI,gCALQ,OAKR;oCAJJK,gBAII;MAJJA,gBAII,sCAJe,IAIf;6BAHJC,QAGI;MAHJA,QAGI,+BAHO,EAGP;yBAFJL,IAEI;MAFJA,IAEI,2BAFG,QAEH;MADDM,UACC;;EACJ,IAAMC,YAAY,GAAGC,YAAM,CAAC,IAAD,CAA3B;EACA,oBACEC,wCAACC,sCAAD;IACE,gBAAgB,EAAEN,gBADpB;IAEE,YAAY,EAAE;MAAA,OAAMG,YAAY,CAACI,OAAnB;KAFhB;IAGE,WAAW,EAAE;MACXC,GAAG,EAAE;KAJT;IAME,WAAW,EAAC;kBAEZH,wCAAC,gBAAD,mCACMP,cADN,EAEMI,UAFN;IAGE,UAAU,EAAE;MAAER,SAAS,EAATA,SAAF;MAAaC,SAAS,EAATA,SAAb;MAAwBC,IAAI,EAAJA;KAHtC;IAIE,QAAQ,EAAEa,qBAAS,CAACV,QAAD,EAAWI,YAAX;MAElBO,kCAAuB,CAACT,QAAD,CAN1B,CARF,CADF;AAmBD;;AAED,IAAMU,YAAY,GAAG;EACnBb,cAAc,EAAEc,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,CACd,kDADc,CADG;EAInBpB,SAAS,EAAEkB,mBAAS,CAACG,IAAV,CACRD,WADQ,CACI,iCADJ,EAERE,YAFQ,CAEK,IAFL,CAJQ;EAOnBrB,SAAS,EAAEiB,mBAAS,CAACK,KAAV,CAAgB,CAAC,OAAD,EAAU,MAAV,CAAhB,EACRH,WADQ,CACI,yCADJ,EAERE,YAFQ,CAEK,OAFL,CAPQ;EAUnBpB,IAAI,EAAEgB,mBAAS,CAACK,KAAV,CAAgB,CAAC,QAAD,EAAW,SAAX,CAAhB,EACHH,WADG,CACS,cADT,EAEHE,YAFG,CAEU,QAFV,CAVa;EAanBhB,gBAAgB,EAAEY,mBAAS,CAACG,IAAV,CACfD,WADe,CACH,qDADG,EAEfE,YAFe,CAEF,IAFE,CAbC;EAgBnBf,QAAQ,EAAEW,mBAAS,CAACM,SAAV,CAAoB,CAC5BN,mBAAS,CAACO,KADkB,EAE5BP,mBAAS,CAACQ,IAFkB,EAG5BR,mBAAS,CAACS,IAHkB,CAApB,EAIPP,WAJO,CAIK,eAJL,EAIsBQ,UApBb;EAqBnBvB,QAAQ,EAAEa,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,CACR,sCADQ;AArBS,CAArB;AA0BAjB,SAAS,CAAC0B,SAAV,GAAsBZ,YAAtB;IAEMa,iBAAiB,GAAGC,kBAAQ,CAAC5B,SAAD;AAClC2B,iBAAiB,CAACD,SAAlB,GAA8BZ,YAA9B;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarGroup.js","sources":["../../../src/deprecated/ToolbarGroup.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport decorateToolbarChildren from './decorateToolbarChildren';\n\nconst blockName = 'toolbar-group';\n\nconst ToolbarGroupContainer = aggregatedClasses('div')(\n blockName,\n null,\n ({ space }) => ({\n [`space-${space}`]: !!space,\n }),\n);\n\nconst ToolbarGroup = ({ children, size, space = 0 }) => (\n <ToolbarGroupContainer classProps={{ space }}>\n {decorateToolbarChildren(children, { size })}\n </ToolbarGroupContainer>\n);\n\nToolbarGroup.propTypes = {\n children: PropTypes.any,\n size: PropTypes.number,\n space: PropTypes.number,\n};\n\nexport default ToolbarGroup;\n"],"names":["blockName","ToolbarGroupContainer","aggregatedClasses","space","ToolbarGroup","children","size","React","decorateToolbarChildren","propTypes","PropTypes","any","number"],"mappings":";;;;;;;;;;;;;;AAKA,IAAMA,SAAS,GAAG,eAAlB;AAEA,IAAMC,qBAAqB,GAAGC,8BAAiB,CAAC,KAAD,CAAjB,CAC5BF,SAD4B,EAE5B,IAF4B,EAG5B;
|
|
1
|
+
{"version":3,"file":"ToolbarGroup.js","sources":["../../../src/deprecated/ToolbarGroup.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport decorateToolbarChildren from './decorateToolbarChildren';\n\nconst blockName = 'toolbar-group';\n\nconst ToolbarGroupContainer = aggregatedClasses('div')(\n blockName,\n null,\n ({ space }) => ({\n [`space-${space}`]: !!space,\n }),\n);\n\nconst ToolbarGroup = ({ children, size, space = 0 }) => (\n <ToolbarGroupContainer classProps={{ space }}>\n {decorateToolbarChildren(children, { size })}\n </ToolbarGroupContainer>\n);\n\nToolbarGroup.propTypes = {\n children: PropTypes.any,\n size: PropTypes.number,\n space: PropTypes.number,\n};\n\nexport default ToolbarGroup;\n"],"names":["blockName","ToolbarGroupContainer","aggregatedClasses","space","ToolbarGroup","children","size","React","decorateToolbarChildren","propTypes","PropTypes","any","number"],"mappings":";;;;;;;;;;;;;;AAKA,IAAMA,SAAS,GAAG,eAAlB;AAEA,IAAMC,qBAAqB,GAAGC,8BAAiB,CAAC,KAAD,CAAjB,CAC5BF,SAD4B,EAE5B,IAF4B,EAG5B;EAAA,IAAGG,KAAH,QAAGA,KAAH;EAAA,+DACYA,KADZ,GACsB,CAAC,CAACA,KADxB;AAAA,CAH4B,CAA9B;;IAQMC,YAAY,GAAG,SAAfA,YAAe;EAAA,IAAGC,QAAH,SAAGA,QAAH;MAAaC,IAAb,SAAaA,IAAb;0BAAmBH,KAAnB;MAAmBA,KAAnB,4BAA2B,CAA3B;EAAA,oBACnBI,wCAAC,qBAAD;IAAuB,UAAU,EAAE;MAAEJ,KAAK,EAALA;;KAClCK,kCAAuB,CAACH,QAAD,EAAW;IAAEC,IAAI,EAAJA;GAAb,CAD1B,CADmB;AAAA;;AAMrBF,YAAY,CAACK,SAAb,GAAyB;EACvBJ,QAAQ,EAAEK,6BAAS,CAACC,GADG;EAEvBL,IAAI,EAAEI,6BAAS,CAACE,MAFO;EAGvBT,KAAK,EAAEO,6BAAS,CAACE;AAHM,CAAzB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarItem.js","sources":["../../../src/deprecated/ToolbarItem.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useFocusGroupWithState } from '@elliemae/ds-shared/FocusGroup';\nimport DSButton from '@elliemae/ds-button';\nimport { PopperPositions as Position } from '@elliemae/ds-popper';\n\nconst ToolbarItem = ({ icon, labelText, menu = undefined, ...otherProps }) => {\n const [ref, setRef] = useState(null);\n\n useFocusGroupWithState(ref);\n const btn = (\n <DSButton {...otherProps} buttonType=\"text\" icon={icon} innerRef={(r) => setRef(r)} labelText={labelText} />\n );\n if (menu) {\n return React.cloneElement(menu, {\n ...menu.props,\n placement: Position.BOTTOM_END,\n triggerComponent: btn,\n });\n }\n return btn;\n};\n\nToolbarItem.displayName = 'ToolbarItem';\n\nToolbarItem.propTypes = {\n icon: PropTypes.element,\n labelText: PropTypes.string,\n};\n\nexport default ToolbarItem;\n"],"names":["ToolbarItem","icon","labelText","menu","undefined","otherProps","useState","ref","setRef","useFocusGroupWithState","btn","React","DSButton","r","cloneElement","props","placement","Position","BOTTOM_END","triggerComponent","displayName","propTypes","PropTypes","element","string"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;IAMMA,WAAW,GAAG,SAAdA,WAAc,OAA0D;
|
|
1
|
+
{"version":3,"file":"ToolbarItem.js","sources":["../../../src/deprecated/ToolbarItem.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useFocusGroupWithState } from '@elliemae/ds-shared/FocusGroup';\nimport DSButton from '@elliemae/ds-button';\nimport { PopperPositions as Position } from '@elliemae/ds-popper';\n\nconst ToolbarItem = ({ icon, labelText, menu = undefined, ...otherProps }) => {\n const [ref, setRef] = useState(null);\n\n useFocusGroupWithState(ref);\n const btn = (\n <DSButton {...otherProps} buttonType=\"text\" icon={icon} innerRef={(r) => setRef(r)} labelText={labelText} />\n );\n if (menu) {\n return React.cloneElement(menu, {\n ...menu.props,\n placement: Position.BOTTOM_END,\n triggerComponent: btn,\n });\n }\n return btn;\n};\n\nToolbarItem.displayName = 'ToolbarItem';\n\nToolbarItem.propTypes = {\n icon: PropTypes.element,\n labelText: PropTypes.string,\n};\n\nexport default ToolbarItem;\n"],"names":["ToolbarItem","icon","labelText","menu","undefined","otherProps","useState","ref","setRef","useFocusGroupWithState","btn","React","DSButton","r","cloneElement","props","placement","Position","BOTTOM_END","triggerComponent","displayName","propTypes","PropTypes","element","string"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;IAMMA,WAAW,GAAG,SAAdA,WAAc,OAA0D;EAAA,IAAvDC,IAAuD,QAAvDA,IAAuD;MAAjDC,SAAiD,QAAjDA,SAAiD;uBAAtCC,IAAsC;MAAtCA,IAAsC,0BAA/BC,SAA+B;MAAjBC,UAAiB;;EAC5E,gBAAsBC,cAAQ,CAAC,IAAD,CAA9B;;MAAOC,GAAP;MAAYC,MAAZ;;EAEAC,iCAAsB,CAACF,GAAD,CAAtB;EACA,IAAMG,GAAG,gBACPC,wCAACC,4BAAD,mCAAcP,UAAd;IAA0B,UAAU,EAAC,MAArC;IAA4C,IAAI,EAAEJ,IAAlD;IAAwD,QAAQ,EAAE,kBAACY,CAAD;MAAA,OAAOL,MAAM,CAACK,CAAD,CAAb;KAAlE;IAAoF,SAAS,EAAEX;KADjG;;EAGA,IAAIC,IAAJ,EAAU;IACR,oBAAOQ,yBAAK,CAACG,YAAN,CAAmBX,IAAnB,kCACFA,IAAI,CAACY,KADH;MAELC,SAAS,EAAEC,wBAAQ,CAACC,UAFf;MAGLC,gBAAgB,EAAET;OAHpB;;;EAMF,OAAOA,GAAP;AACD;;AAEDV,WAAW,CAACoB,WAAZ,GAA0B,aAA1B;AAEApB,WAAW,CAACqB,SAAZ,GAAwB;EACtBpB,IAAI,EAAEqB,6BAAS,CAACC,OADM;EAEtBrB,SAAS,EAAEoB,6BAAS,CAACE;AAFC,CAAxB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorateToolbarChildren.js","sources":["../../../src/deprecated/decorateToolbarChildren.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\n\nexport default (children, extraProps = {}) =>\n React.Children.map(\n children,\n component =>\n component\n ? cloneElement(component, {\n ...extraProps,\n ...component.props,\n className: `${component.props.className} toolbar-item`,\n })\n : component,\n null,\n );\n"],"names":["children","extraProps","React","Children","map","component","cloneElement","props","className"],"mappings":";;;;;;;;;;;;;AAEA,+BAAe,UAACA,QAAD;
|
|
1
|
+
{"version":3,"file":"decorateToolbarChildren.js","sources":["../../../src/deprecated/decorateToolbarChildren.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\n\nexport default (children, extraProps = {}) =>\n React.Children.map(\n children,\n component =>\n component\n ? cloneElement(component, {\n ...extraProps,\n ...component.props,\n className: `${component.props.className} toolbar-item`,\n })\n : component,\n null,\n );\n"],"names":["children","extraProps","React","Children","map","component","cloneElement","props","className"],"mappings":";;;;;;;;;;;;;AAEA,+BAAe,UAACA,QAAD;EAAA,IAAWC,UAAX,uEAAwB,EAAxB;EAAA,OACbC,yBAAK,CAACC,QAAN,CAAeC,GAAf,CACEJ,QADF,EAEE,UAAAK,SAAS;IAAA,OACPA,SAAS,gBACLC,kBAAY,CAACD,SAAD,gDACPJ,UADO,GAEPI,SAAS,CAACE,KAFH;MAGVC,SAAS,YAAKH,SAAS,CAACE,KAAV,CAAgBC,SAArB;OAJN,GAMLH,SAPG;GAFX,EAUE,IAVF,CADa;AAAA,CAAf;;;;"}
|
package/cjs/props.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../src/props.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const DSToolbarV2Schema = {\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Whether to align the content left or right')\n .defaultValue('right'),\n withDepth: PropTypes.bool.description('Whether to add a box-shadow to the container').defaultValue(true),\n compact: PropTypes.bool.description('Whether you want the compact version of the toolbar').defaultValue(false),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Reference to attach to the wrapper'),\n};\n"],"names":["DSToolbarV2Schema","alignment","PropTypes","oneOf","description","defaultValue","withDepth","bool","compact","innerRef","oneOfType","func","object"],"mappings":";;;;;;IAEaA,iBAAiB,GAAG;
|
|
1
|
+
{"version":3,"file":"props.js","sources":["../../src/props.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const DSToolbarV2Schema = {\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Whether to align the content left or right')\n .defaultValue('right'),\n withDepth: PropTypes.bool.description('Whether to add a box-shadow to the container').defaultValue(true),\n compact: PropTypes.bool.description('Whether you want the compact version of the toolbar').defaultValue(false),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Reference to attach to the wrapper'),\n};\n"],"names":["DSToolbarV2Schema","alignment","PropTypes","oneOf","description","defaultValue","withDepth","bool","compact","innerRef","oneOfType","func","object"],"mappings":";;;;;;IAEaA,iBAAiB,GAAG;EAC/BC,SAAS,EAAEC,mBAAS,CAACC,KAAV,CAAgB,CAAC,OAAD,EAAU,MAAV,CAAhB,EACRC,WADQ,CACI,4CADJ,EAERC,YAFQ,CAEK,OAFL,CADoB;EAI/BC,SAAS,EAAEJ,mBAAS,CAACK,IAAV,CAAeH,WAAf,CAA2B,8CAA3B,EAA2EC,YAA3E,CAAwF,IAAxF,CAJoB;EAK/BG,OAAO,EAAEN,mBAAS,CAACK,IAAV,CAAeH,WAAf,CAA2B,qDAA3B,EAAkFC,YAAlF,CAA+F,KAA/F,CALsB;EAM/BI,QAAQ,EAAEP,mBAAS,CAACQ,SAAV,CAAoB,CAACR,mBAAS,CAACS,IAAX,EAAiBT,mBAAS,CAACU,MAA3B,CAApB,EAAwDR,WAAxD,CAAoE,oCAApE;AANqB;;;;"}
|
package/cjs/styled.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../src/styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport Grid from '@elliemae/ds-grid';\n\nexport const StyledToolbarWrapper = styled(Grid)`\n background-color: ${(props) => props.theme.colors.neutral['000']};\n\n min-height: ${(props) => (props.compact ? '28px' : '40px')};\n max-height: ${(props) => props.theme.space.xxl};\n\n padding: 0 ${(props) => props.theme.space.xxs};\n\n box-shadow: ${(props) => (!props.withDepth ? 'none' : '0 1px 5px 0 rgb(0 0 0 / 13%), 0 2px 4px 0 rgb(0 0 0 / 20%)')};\n`;\n\nexport const StyledToolbarItem = styled(Grid)``;\n\nexport const StyledSeparator = styled(Grid)`\n height: 30px;\n width: 1px;\n background-color: ${(props) => props.theme.colors.neutral[200]};\n`;\n"],"names":["StyledToolbarWrapper","styled","Grid","props","theme","colors","neutral","compact","space","xxl","xxs","withDepth","StyledToolbarItem","StyledSeparator"],"mappings":";;;;;;;;;;;;IAGaA,oBAAoB,gBAAGC,0BAAM,CAACC,wBAAD,CAAT;
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../src/styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport Grid from '@elliemae/ds-grid';\n\nexport const StyledToolbarWrapper = styled(Grid)`\n background-color: ${(props) => props.theme.colors.neutral['000']};\n\n min-height: ${(props) => (props.compact ? '28px' : '40px')};\n max-height: ${(props) => props.theme.space.xxl};\n\n padding: 0 ${(props) => props.theme.space.xxs};\n\n box-shadow: ${(props) => (!props.withDepth ? 'none' : '0 1px 5px 0 rgb(0 0 0 / 13%), 0 2px 4px 0 rgb(0 0 0 / 20%)')};\n`;\n\nexport const StyledToolbarItem = styled(Grid)``;\n\nexport const StyledSeparator = styled(Grid)`\n height: 30px;\n width: 1px;\n background-color: ${(props) => props.theme.colors.neutral[200]};\n`;\n"],"names":["StyledToolbarWrapper","styled","Grid","props","theme","colors","neutral","compact","space","xxl","xxs","withDepth","StyledToolbarItem","StyledSeparator"],"mappings":";;;;;;;;;;;;IAGaA,oBAAoB,gBAAGC,0BAAM,CAACC,wBAAD,CAAT;EAAA;AAAA,8FACX,UAACC,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CADW,EAGjB,UAACH,KAAD;EAAA,OAAYA,KAAK,CAACI,OAAN,GAAgB,MAAhB,GAAyB,MAArC;AAAA,CAHiB,EAIjB,UAACJ,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYI,KAAZ,CAAkBC,GAA7B;AAAA,CAJiB,EAMlB,UAACN,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYI,KAAZ,CAAkBE,GAA7B;AAAA,CANkB,EAQjB,UAACP,KAAD;EAAA,OAAY,CAACA,KAAK,CAACQ,SAAP,GAAmB,MAAnB,GAA4B,4DAAxC;AAAA,CARiB;IAWpBC,iBAAiB,gBAAGX,0BAAM,CAACC,wBAAD,CAAT;EAAA;AAAA;IAEjBW,eAAe,gBAAGZ,0BAAM,CAACC,wBAAD,CAAT;EAAA;AAAA,qDAGN,UAACC,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,GAA3B,CAAX;AAAA,CAHM;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolbarItemHandlers.js","sources":["../../src/useToolbarItemHandlers.tsx"],"sourcesContent":["import { useCallback, useContext } from 'react';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\n\nexport const useToolbarItemHandlers = (\n toolbarItemId: string,\n): {\n onKeyDown: React.KeyboardEventHandler;\n} => {\n const { toolbarUid, itemReferences } = useContext(DSToolbarV2Context);\n\n const onKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n const toolbarItems = [...document.querySelectorAll(`#${toolbarUid} .ds-toolbar-item`)];\n let nextToolbarItemIndex = -1;\n\n if (['ArrowLeft', 'ArrowRight'].includes(e.code)) {\n const toolbarItemIndex = toolbarItems.findIndex((domElem) => domElem.id === toolbarItemId);\n nextToolbarItemIndex = toolbarItemIndex + (e.code === 'ArrowLeft' ? -1 : 1);\n } else if (e.code === 'Home') {\n nextToolbarItemIndex = 0;\n } else if (e.code === 'End') {\n nextToolbarItemIndex = toolbarItems.length - 1;\n }\n\n if (nextToolbarItemIndex >= 0 && nextToolbarItemIndex < toolbarItems.length) {\n e.preventDefault();\n e.stopPropagation();\n const ref = itemReferences[toolbarItems[nextToolbarItemIndex].id];\n if (ref.current) ref.current.focus();\n }\n },\n [toolbarUid, toolbarItemId, itemReferences],\n );\n\n return { onKeyDown };\n};\n"],"names":["useToolbarItemHandlers","toolbarItemId","useContext","DSToolbarV2Context","toolbarUid","itemReferences","onKeyDown","useCallback","e","toolbarItems","document","querySelectorAll","nextToolbarItemIndex","includes","code","toolbarItemIndex","findIndex","domElem","id","length","preventDefault","stopPropagation","ref","current","focus"],"mappings":";;;;;;;;;;;;IAGaA,sBAAsB,GAAG,SAAzBA,sBAAyB,CACpCC,aADoC,EAIjC;
|
|
1
|
+
{"version":3,"file":"useToolbarItemHandlers.js","sources":["../../src/useToolbarItemHandlers.tsx"],"sourcesContent":["import { useCallback, useContext } from 'react';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\n\nexport const useToolbarItemHandlers = (\n toolbarItemId: string,\n): {\n onKeyDown: React.KeyboardEventHandler;\n} => {\n const { toolbarUid, itemReferences } = useContext(DSToolbarV2Context);\n\n const onKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n const toolbarItems = [...document.querySelectorAll(`#${toolbarUid} .ds-toolbar-item`)];\n let nextToolbarItemIndex = -1;\n\n if (['ArrowLeft', 'ArrowRight'].includes(e.code)) {\n const toolbarItemIndex = toolbarItems.findIndex((domElem) => domElem.id === toolbarItemId);\n nextToolbarItemIndex = toolbarItemIndex + (e.code === 'ArrowLeft' ? -1 : 1);\n } else if (e.code === 'Home') {\n nextToolbarItemIndex = 0;\n } else if (e.code === 'End') {\n nextToolbarItemIndex = toolbarItems.length - 1;\n }\n\n if (nextToolbarItemIndex >= 0 && nextToolbarItemIndex < toolbarItems.length) {\n e.preventDefault();\n e.stopPropagation();\n const ref = itemReferences[toolbarItems[nextToolbarItemIndex].id];\n if (ref.current) ref.current.focus();\n }\n },\n [toolbarUid, toolbarItemId, itemReferences],\n );\n\n return { onKeyDown };\n};\n"],"names":["useToolbarItemHandlers","toolbarItemId","useContext","DSToolbarV2Context","toolbarUid","itemReferences","onKeyDown","useCallback","e","toolbarItems","document","querySelectorAll","nextToolbarItemIndex","includes","code","toolbarItemIndex","findIndex","domElem","id","length","preventDefault","stopPropagation","ref","current","focus"],"mappings":";;;;;;;;;;;;IAGaA,sBAAsB,GAAG,SAAzBA,sBAAyB,CACpCC,aADoC,EAIjC;EACH,kBAAuCC,gBAAU,CAACC,qCAAD,CAAjD;MAAQC,UAAR,eAAQA,UAAR;MAAoBC,cAApB,eAAoBA,cAApB;;EAEA,IAAMC,SAAqC,GAAGC,iBAAW,CACvD,UAACC,CAAD,EAAO;IACL,IAAMC,YAAY,0CAAOC,QAAQ,CAACC,gBAAT,YAA8BP,UAA9B,uBAAP,CAAlB;;IACA,IAAIQ,oBAAoB,GAAG,CAAC,CAA5B;;IAEA,IAAI,CAAC,WAAD,EAAc,YAAd,EAA4BC,QAA5B,CAAqCL,CAAC,CAACM,IAAvC,CAAJ,EAAkD;MAChD,IAAMC,gBAAgB,GAAGN,YAAY,CAACO,SAAb,CAAuB,UAACC,OAAD;QAAA,OAAaA,OAAO,CAACC,EAAR,KAAejB,aAA5B;OAAvB,CAAzB;MACAW,oBAAoB,GAAGG,gBAAgB,IAAIP,CAAC,CAACM,IAAF,KAAW,WAAX,GAAyB,CAAC,CAA1B,GAA8B,CAAlC,CAAvC;KAFF,MAGO,IAAIN,CAAC,CAACM,IAAF,KAAW,MAAf,EAAuB;MAC5BF,oBAAoB,GAAG,CAAvB;KADK,MAEA,IAAIJ,CAAC,CAACM,IAAF,KAAW,KAAf,EAAsB;MAC3BF,oBAAoB,GAAGH,YAAY,CAACU,MAAb,GAAsB,CAA7C;;;IAGF,IAAIP,oBAAoB,IAAI,CAAxB,IAA6BA,oBAAoB,GAAGH,YAAY,CAACU,MAArE,EAA6E;MAC3EX,CAAC,CAACY,cAAF;MACAZ,CAAC,CAACa,eAAF;MACA,IAAMC,GAAG,GAAGjB,cAAc,CAACI,YAAY,CAACG,oBAAD,CAAZ,CAAmCM,EAApC,CAA1B;MACA,IAAII,GAAG,CAACC,OAAR,EAAiBD,GAAG,CAACC,OAAJ,CAAYC,KAAZ;;GAlBkC,EAqBvD,CAACpB,UAAD,EAAaH,aAAb,EAA4BI,cAA5B,CArBuD,CAAzD;EAwBA,OAAO;IAAEC,SAAS,EAATA;GAAT;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSToolbarItemV2.js","sources":["../../src/DSToolbarItemV2.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { MutableRefObject, useContext, useMemo, useRef } from 'react';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { StyledToolbarItem } from './styled';\nimport { useToolbarItemHandlers } from './useToolbarItemHandlers';\n\ninterface ToolbarItemProps {\n render: (props: { innerRef: MutableRefObject<HTMLElement> }) => JSX.Element;\n}\n\nexport const DSToolbarItemV2: React.ComponentType<ToolbarItemProps> = ({ render }) => {\n const { registerReference } = useContext(DSToolbarV2Context);\n const ref = useRef(null);\n\n const toolbarItemId = useMemo(() => {\n const id = `ds-toolbar-item-${uid()}`;\n registerReference(id, ref);\n return id;\n }, [registerReference, ref]);\n\n const handlers = useToolbarItemHandlers(toolbarItemId);\n\n return (\n <StyledToolbarItem id={toolbarItemId} data-testid=\"ds-toolbar-item\" className=\"ds-toolbar-item\" {...handlers}>\n {render({ innerRef: ref })}\n </StyledToolbarItem>\n );\n};\n"],"names":["DSToolbarItemV2","render","useContext","DSToolbarV2Context","registerReference","ref","useRef","toolbarItemId","useMemo","id","uid","handlers","useToolbarItemHandlers","innerRef"],"mappings":";;;;;;;;;;IAWaA,eAAsD,GAAG,SAAzDA,eAAyD,OAAgB;
|
|
1
|
+
{"version":3,"file":"DSToolbarItemV2.js","sources":["../../src/DSToolbarItemV2.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { MutableRefObject, useContext, useMemo, useRef } from 'react';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { StyledToolbarItem } from './styled';\nimport { useToolbarItemHandlers } from './useToolbarItemHandlers';\n\ninterface ToolbarItemProps {\n render: (props: { innerRef: MutableRefObject<HTMLElement> }) => JSX.Element;\n}\n\nexport const DSToolbarItemV2: React.ComponentType<ToolbarItemProps> = ({ render }) => {\n const { registerReference } = useContext(DSToolbarV2Context);\n const ref = useRef(null);\n\n const toolbarItemId = useMemo(() => {\n const id = `ds-toolbar-item-${uid()}`;\n registerReference(id, ref);\n return id;\n }, [registerReference, ref]);\n\n const handlers = useToolbarItemHandlers(toolbarItemId);\n\n return (\n <StyledToolbarItem id={toolbarItemId} data-testid=\"ds-toolbar-item\" className=\"ds-toolbar-item\" {...handlers}>\n {render({ innerRef: ref })}\n </StyledToolbarItem>\n );\n};\n"],"names":["DSToolbarItemV2","render","useContext","DSToolbarV2Context","registerReference","ref","useRef","toolbarItemId","useMemo","id","uid","handlers","useToolbarItemHandlers","innerRef"],"mappings":";;;;;;;;;;IAWaA,eAAsD,GAAG,SAAzDA,eAAyD,OAAgB;EAAA,IAAbC,MAAa,QAAbA,MAAa;;EACpF,kBAA8BC,UAAU,CAACC,kBAAD,CAAxC;MAAQC,iBAAR,eAAQA,iBAAR;;EACA,IAAMC,GAAG,GAAGC,MAAM,CAAC,IAAD,CAAlB;EAEA,IAAMC,aAAa,GAAGC,OAAO,CAAC,YAAM;IAClC,IAAMC,EAAE,6BAAsBC,GAAG,EAAzB,CAAR;IACAN,iBAAiB,CAACK,EAAD,EAAKJ,GAAL,CAAjB;IACA,OAAOI,EAAP;GAH2B,EAI1B,CAACL,iBAAD,EAAoBC,GAApB,CAJ0B,CAA7B;EAMA,IAAMM,QAAQ,GAAGC,sBAAsB,CAACL,aAAD,CAAvC;EAEA,oBACE,oBAAC,iBAAD;IAAmB,EAAE,EAAEA,aAAvB;IAAsC,eAAY,iBAAlD;IAAoE,SAAS,EAAC;KAAsBI,QAApG,GACGV,MAAM,CAAC;IAAEY,QAAQ,EAAER;GAAb,CADT,CADF;AAKD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSToolbarSeparatorV2.js","sources":["../../src/DSToolbarSeparatorV2.tsx"],"sourcesContent":["import React from 'react';\nimport { StyledSeparator } from './styled';\n\nexport const DSToolbarSeparatorV2: React.ComponentType = () => <StyledSeparator className=\"ds-toolbar-separator\" />;\n"],"names":["DSToolbarSeparatorV2"],"mappings":";;;;;IAGaA,oBAAyC,GAAG,SAA5CA,oBAA4C;
|
|
1
|
+
{"version":3,"file":"DSToolbarSeparatorV2.js","sources":["../../src/DSToolbarSeparatorV2.tsx"],"sourcesContent":["import React from 'react';\nimport { StyledSeparator } from './styled';\n\nexport const DSToolbarSeparatorV2: React.ComponentType = () => <StyledSeparator className=\"ds-toolbar-separator\" />;\n"],"names":["DSToolbarSeparatorV2"],"mappings":";;;;;IAGaA,oBAAyC,GAAG,SAA5CA,oBAA4C;EAAA,oBAAM,oBAAC,eAAD;IAAiB,SAAS,EAAC;IAAjC;AAAA;;;;"}
|
package/esm/DSToolbarV2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSToolbarV2.js","sources":["../../src/DSToolbarV2.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { describe } from 'react-desc';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { DSToolbarV2Schema } from './props';\nimport { StyledToolbarWrapper } from './styled';\ninterface ToolbarProps {\n alignment?: 'left' | 'right';\n withDepth?: boolean;\n compact?: boolean;\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n}\n\nconst DSToolbarV2: React.ComponentType<ToolbarProps> = (props) => {\n const { alignment, withDepth, compact, innerRef, children } = props;\n\n useValidateTypescriptPropTypes(props, DSToolbarV2WithSchema.toTypescript());\n\n const toolbarUid = useMemo(() => `ds-toolbar-${uid()}`, []);\n\n const [itemReferences, setItemReferences] = useState({});\n\n const registerReference = useCallback(\n (itemId: string, ref: React.MutableRefObject<HTMLElement>) => {\n setItemReferences((prevItemReferences) => ({ ...prevItemReferences, [itemId]: ref }));\n },\n [setItemReferences],\n );\n\n return (\n <DSToolbarV2Context.Provider value={{ toolbarUid, registerReference, itemReferences }}>\n <StyledToolbarWrapper\n role=\"toolbar\"\n data-testid=\"ds-toolbar-wrapper\"\n id={toolbarUid}\n alignItems=\"center\"\n justifyContent={alignment === 'left' ? 'flex-start' : 'flex-end'}\n withDepth={withDepth}\n cols={React.Children.map(children, () => ['auto'])}\n gutter=\"xxs2\"\n compact={compact}\n ref={innerRef}\n >\n {children}\n </StyledToolbarWrapper>\n </DSToolbarV2Context.Provider>\n );\n};\n\nDSToolbarV2.propTypes = DSToolbarV2Schema;\nDSToolbarV2.defaultProps = {\n alignment: 'right',\n withDepth: true,\n compact: false,\n};\nconst DSToolbarV2WithSchema = describe(DSToolbarV2).description('Toolbar');\nDSToolbarV2WithSchema.propTypes = DSToolbarV2Schema;\n\nexport { DSToolbarV2, DSToolbarV2WithSchema };\n"],"names":["DSToolbarV2","props","alignment","withDepth","compact","innerRef","children","useValidateTypescriptPropTypes","DSToolbarV2WithSchema","toTypescript","toolbarUid","useMemo","uid","useState","itemReferences","setItemReferences","registerReference","useCallback","itemId","ref","prevItemReferences","React","Children","map","propTypes","DSToolbarV2Schema","defaultProps","describe","description"],"mappings":";;;;;;;;;;;;;;;;IAeMA,WAA8C,GAAG,SAAjDA,WAAiD,CAACC,KAAD,EAAW;
|
|
1
|
+
{"version":3,"file":"DSToolbarV2.js","sources":["../../src/DSToolbarV2.tsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { describe } from 'react-desc';\nimport { uid } from 'uid';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\nimport { DSToolbarV2Schema } from './props';\nimport { StyledToolbarWrapper } from './styled';\ninterface ToolbarProps {\n alignment?: 'left' | 'right';\n withDepth?: boolean;\n compact?: boolean;\n innerRef?: React.MutableRefObject<HTMLDivElement>;\n}\n\nconst DSToolbarV2: React.ComponentType<ToolbarProps> = (props) => {\n const { alignment, withDepth, compact, innerRef, children } = props;\n\n useValidateTypescriptPropTypes(props, DSToolbarV2WithSchema.toTypescript());\n\n const toolbarUid = useMemo(() => `ds-toolbar-${uid()}`, []);\n\n const [itemReferences, setItemReferences] = useState({});\n\n const registerReference = useCallback(\n (itemId: string, ref: React.MutableRefObject<HTMLElement>) => {\n setItemReferences((prevItemReferences) => ({ ...prevItemReferences, [itemId]: ref }));\n },\n [setItemReferences],\n );\n\n return (\n <DSToolbarV2Context.Provider value={{ toolbarUid, registerReference, itemReferences }}>\n <StyledToolbarWrapper\n role=\"toolbar\"\n data-testid=\"ds-toolbar-wrapper\"\n id={toolbarUid}\n alignItems=\"center\"\n justifyContent={alignment === 'left' ? 'flex-start' : 'flex-end'}\n withDepth={withDepth}\n cols={React.Children.map(children, () => ['auto'])}\n gutter=\"xxs2\"\n compact={compact}\n ref={innerRef}\n >\n {children}\n </StyledToolbarWrapper>\n </DSToolbarV2Context.Provider>\n );\n};\n\nDSToolbarV2.propTypes = DSToolbarV2Schema;\nDSToolbarV2.defaultProps = {\n alignment: 'right',\n withDepth: true,\n compact: false,\n};\nconst DSToolbarV2WithSchema = describe(DSToolbarV2).description('Toolbar');\nDSToolbarV2WithSchema.propTypes = DSToolbarV2Schema;\n\nexport { DSToolbarV2, DSToolbarV2WithSchema };\n"],"names":["DSToolbarV2","props","alignment","withDepth","compact","innerRef","children","useValidateTypescriptPropTypes","DSToolbarV2WithSchema","toTypescript","toolbarUid","useMemo","uid","useState","itemReferences","setItemReferences","registerReference","useCallback","itemId","ref","prevItemReferences","React","Children","map","propTypes","DSToolbarV2Schema","defaultProps","describe","description"],"mappings":";;;;;;;;;;;;;;;;IAeMA,WAA8C,GAAG,SAAjDA,WAAiD,CAACC,KAAD,EAAW;EAChE,IAAQC,SAAR,GAA8DD,KAA9D,CAAQC,SAAR;MAAmBC,SAAnB,GAA8DF,KAA9D,CAAmBE,SAAnB;MAA8BC,OAA9B,GAA8DH,KAA9D,CAA8BG,OAA9B;MAAuCC,QAAvC,GAA8DJ,KAA9D,CAAuCI,QAAvC;MAAiDC,QAAjD,GAA8DL,KAA9D,CAAiDK,QAAjD;EAEAC,8BAA8B,CAACN,KAAD,EAAQO,qBAAqB,CAACC,YAAtB,EAAR,CAA9B;EAEA,IAAMC,UAAU,GAAGC,OAAO,CAAC;IAAA,4BAAoBC,GAAG,EAAvB;GAAD,EAA8B,EAA9B,CAA1B;;EAEA,gBAA4CC,QAAQ,CAAC,EAAD,CAApD;;MAAOC,cAAP;MAAuBC,iBAAvB;;EAEA,IAAMC,iBAAiB,GAAGC,WAAW,CACnC,UAACC,MAAD,EAAiBC,GAAjB,EAA8D;IAC5DJ,iBAAiB,CAAC,UAACK,kBAAD;MAAA,uCAA8BA,kBAA9B,2BAAmDF,MAAnD,EAA4DC,GAA5D;KAAD,CAAjB;GAFiC,EAInC,CAACJ,iBAAD,CAJmC,CAArC;EAOA,oBACE,oBAAC,kBAAD,CAAoB,QAApB;IAA6B,KAAK,EAAE;MAAEL,UAAU,EAAVA,UAAF;MAAcM,iBAAiB,EAAjBA,iBAAd;MAAiCF,cAAc,EAAdA;;kBACnE,oBAAC,oBAAD;IACE,IAAI,EAAC,SADP;IAEE,eAAY,oBAFd;IAGE,EAAE,EAAEJ,UAHN;IAIE,UAAU,EAAC,QAJb;IAKE,cAAc,EAAER,SAAS,KAAK,MAAd,GAAuB,YAAvB,GAAsC,UALxD;IAME,SAAS,EAAEC,SANb;IAOE,IAAI,EAAEkB,KAAK,CAACC,QAAN,CAAeC,GAAf,CAAmBjB,QAAnB,EAA6B;MAAA,OAAM,CAAC,MAAD,CAAN;KAA7B,CAPR;IAQE,MAAM,EAAC,MART;IASE,OAAO,EAAEF,OATX;IAUE,GAAG,EAAEC;KAEJC,QAZH,CADF,CADF;AAkBD;;AAEDN,WAAW,CAACwB,SAAZ,GAAwBC,iBAAxB;AACAzB,WAAW,CAAC0B,YAAZ,GAA2B;EACzBxB,SAAS,EAAE,OADc;EAEzBC,SAAS,EAAE,IAFc;EAGzBC,OAAO,EAAE;AAHgB,CAA3B;IAKMI,qBAAqB,GAAGmB,QAAQ,CAAC3B,WAAD,CAAR,CAAsB4B,WAAtB,CAAkC,SAAlC;AAC9BpB,qBAAqB,CAACgB,SAAtB,GAAkCC,iBAAlC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSToolbarV2Context.js","sources":["../../src/DSToolbarV2Context.tsx"],"sourcesContent":["import { createContext, MutableRefObject } from 'react';\n\ninterface IDSToolbarV2Context {\n registerReference: (uid: string, ref: MutableRefObject<HTMLElement>) => void;\n itemReferences: Record<string, MutableRefObject<HTMLElement>>;\n toolbarUid: string;\n}\n\nexport const DSToolbarV2Context = createContext<IDSToolbarV2Context>({\n registerReference: () => null,\n itemReferences: {},\n toolbarUid: '',\n});\n"],"names":["DSToolbarV2Context","createContext","registerReference","itemReferences","toolbarUid"],"mappings":";;IAQaA,kBAAkB,gBAAGC,aAAa,CAAsB;
|
|
1
|
+
{"version":3,"file":"DSToolbarV2Context.js","sources":["../../src/DSToolbarV2Context.tsx"],"sourcesContent":["import { createContext, MutableRefObject } from 'react';\n\ninterface IDSToolbarV2Context {\n registerReference: (uid: string, ref: MutableRefObject<HTMLElement>) => void;\n itemReferences: Record<string, MutableRefObject<HTMLElement>>;\n toolbarUid: string;\n}\n\nexport const DSToolbarV2Context = createContext<IDSToolbarV2Context>({\n registerReference: () => null,\n itemReferences: {},\n toolbarUid: '',\n});\n"],"names":["DSToolbarV2Context","createContext","registerReference","itemReferences","toolbarUid"],"mappings":";;IAQaA,kBAAkB,gBAAGC,aAAa,CAAsB;EACnEC,iBAAiB,EAAE;IAAA,OAAM,IAAN;GADgD;EAEnEC,cAAc,EAAE,EAFmD;EAGnEC,UAAU,EAAE;AAHuD,CAAtB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DSToolbar.js","sources":["../../../src/deprecated/DSToolbar.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport FocusGroupProvider from '@elliemae/ds-shared/FocusGroup/FocusGroupManager';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport decorateToolbarChildren from './decorateToolbarChildren';\nimport Item from './ToolbarItem';\nimport ToolbarGroup from './ToolbarGroup';\nimport Divider from './ToolbarDivider';\n\nconst blockName = 'toolbar';\n\nconst ToolbarContainer = aggregatedClasses('div')(\n blockName,\n null,\n ({ withDepth, alignment, size }) => ({\n 'without-depth': !withDepth,\n [alignment]: !!alignment,\n [size]: size,\n }),\n);\n\nconst DSToolbar = ({\n containerProps = {},\n innerRef,\n withDepth = true,\n alignment = 'right', // left || right\n autoFocusOnMount = true,\n children = [],\n size = 'normal',\n ...otherProps\n}) => {\n const containerRef = useRef(null);\n return (\n <FocusGroupProvider\n autoFocusOnMount={autoFocusOnMount}\n getContainer={() => containerRef.current}\n keyBindings={{\n Tab: 'next',\n }}\n orientation=\"horizontal\"\n >\n <ToolbarContainer\n {...containerProps}\n {...otherProps}\n classProps={{ withDepth, alignment, size }}\n innerRef={mergeRefs(innerRef, containerRef)}\n >\n {decorateToolbarChildren(children)}\n </ToolbarContainer>\n </FocusGroupProvider>\n );\n};\n\nconst toolbarProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n withDepth: PropTypes.bool\n .description('Shows a shadow rear the toolbar')\n .defaultValue(true),\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Aligns the toolbar to the left or right')\n .defaultValue('right'),\n size: PropTypes.oneOf(['normal', 'compact'])\n .description('Toolbar size')\n .defaultValue('normal'),\n autoFocusOnMount: PropTypes.bool\n .description('Wheter to focus the component when it mounts or not')\n .defaultValue(true),\n children: PropTypes.oneOfType([\n PropTypes.array,\n PropTypes.func,\n PropTypes.node,\n ]).description('Toolbar items').isRequired,\n innerRef: PropTypes.object.description(\n 'Ref to the Toolbar container element',\n ),\n};\n\nDSToolbar.propTypes = toolbarProps;\n\nconst ToolbarWithSchema = describe(DSToolbar);\nToolbarWithSchema.propTypes = toolbarProps;\n\nexport {\n DSToolbar,\n Item as ToolbarItem,\n ToolbarGroup,\n Divider as ToolbarDivider,\n ToolbarWithSchema,\n};\n\nexport default DSToolbar;\n"],"names":["blockName","ToolbarContainer","aggregatedClasses","withDepth","alignment","size","DSToolbar","containerProps","innerRef","autoFocusOnMount","children","otherProps","containerRef","useRef","current","Tab","mergeRefs","decorateToolbarChildren","toolbarProps","PropTypes","object","description","bool","defaultValue","oneOf","oneOfType","array","func","node","isRequired","propTypes","ToolbarWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,IAAMA,SAAS,GAAG,SAAlB;AAEA,IAAMC,gBAAgB,GAAGC,iBAAiB,CAAC,KAAD,CAAjB,CACvBF,SADuB,EAEvB,IAFuB,EAGvB;
|
|
1
|
+
{"version":3,"file":"DSToolbar.js","sources":["../../../src/deprecated/DSToolbar.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport FocusGroupProvider from '@elliemae/ds-shared/FocusGroup/FocusGroupManager';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport decorateToolbarChildren from './decorateToolbarChildren';\nimport Item from './ToolbarItem';\nimport ToolbarGroup from './ToolbarGroup';\nimport Divider from './ToolbarDivider';\n\nconst blockName = 'toolbar';\n\nconst ToolbarContainer = aggregatedClasses('div')(\n blockName,\n null,\n ({ withDepth, alignment, size }) => ({\n 'without-depth': !withDepth,\n [alignment]: !!alignment,\n [size]: size,\n }),\n);\n\nconst DSToolbar = ({\n containerProps = {},\n innerRef,\n withDepth = true,\n alignment = 'right', // left || right\n autoFocusOnMount = true,\n children = [],\n size = 'normal',\n ...otherProps\n}) => {\n const containerRef = useRef(null);\n return (\n <FocusGroupProvider\n autoFocusOnMount={autoFocusOnMount}\n getContainer={() => containerRef.current}\n keyBindings={{\n Tab: 'next',\n }}\n orientation=\"horizontal\"\n >\n <ToolbarContainer\n {...containerProps}\n {...otherProps}\n classProps={{ withDepth, alignment, size }}\n innerRef={mergeRefs(innerRef, containerRef)}\n >\n {decorateToolbarChildren(children)}\n </ToolbarContainer>\n </FocusGroupProvider>\n );\n};\n\nconst toolbarProps = {\n containerProps: PropTypes.object.description(\n 'Set of Properties attached to the main container',\n ),\n withDepth: PropTypes.bool\n .description('Shows a shadow rear the toolbar')\n .defaultValue(true),\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Aligns the toolbar to the left or right')\n .defaultValue('right'),\n size: PropTypes.oneOf(['normal', 'compact'])\n .description('Toolbar size')\n .defaultValue('normal'),\n autoFocusOnMount: PropTypes.bool\n .description('Wheter to focus the component when it mounts or not')\n .defaultValue(true),\n children: PropTypes.oneOfType([\n PropTypes.array,\n PropTypes.func,\n PropTypes.node,\n ]).description('Toolbar items').isRequired,\n innerRef: PropTypes.object.description(\n 'Ref to the Toolbar container element',\n ),\n};\n\nDSToolbar.propTypes = toolbarProps;\n\nconst ToolbarWithSchema = describe(DSToolbar);\nToolbarWithSchema.propTypes = toolbarProps;\n\nexport {\n DSToolbar,\n Item as ToolbarItem,\n ToolbarGroup,\n Divider as ToolbarDivider,\n ToolbarWithSchema,\n};\n\nexport default DSToolbar;\n"],"names":["blockName","ToolbarContainer","aggregatedClasses","withDepth","alignment","size","DSToolbar","containerProps","innerRef","autoFocusOnMount","children","otherProps","containerRef","useRef","current","Tab","mergeRefs","decorateToolbarChildren","toolbarProps","PropTypes","object","description","bool","defaultValue","oneOf","oneOfType","array","func","node","isRequired","propTypes","ToolbarWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,IAAMA,SAAS,GAAG,SAAlB;AAEA,IAAMC,gBAAgB,GAAGC,iBAAiB,CAAC,KAAD,CAAjB,CACvBF,SADuB,EAEvB,IAFuB,EAGvB;EAAA;;EAAA,IAAGG,SAAH,QAAGA,SAAH;MAAcC,SAAd,QAAcA,SAAd;MAAyBC,IAAzB,QAAyBA,IAAzB;EAAA;IACE,iBAAiB,CAACF;4BACjBC,SAFH,EAEe,CAAC,CAACA,SAFjB,0BAGGC,IAHH,EAGUA,IAHV;AAAA,CAHuB,CAAzB;;IAUMC,SAAS,GAAG,SAAZA,SAAY,QASZ;EAAA,iCARJC,cAQI;MARJA,cAQI,qCARa,EAQb;MAPJC,QAOI,SAPJA,QAOI;8BANJL,SAMI;MANJA,SAMI,gCANQ,IAMR;8BALJC,SAKI;MALJA,SAKI,gCALQ,OAKR;oCAJJK,gBAII;MAJJA,gBAII,sCAJe,IAIf;6BAHJC,QAGI;MAHJA,QAGI,+BAHO,EAGP;yBAFJL,IAEI;MAFJA,IAEI,2BAFG,QAEH;MADDM,UACC;;EACJ,IAAMC,YAAY,GAAGC,MAAM,CAAC,IAAD,CAA3B;EACA,oBACE,oBAAC,kBAAD;IACE,gBAAgB,EAAEJ,gBADpB;IAEE,YAAY,EAAE;MAAA,OAAMG,YAAY,CAACE,OAAnB;KAFhB;IAGE,WAAW,EAAE;MACXC,GAAG,EAAE;KAJT;IAME,WAAW,EAAC;kBAEZ,oBAAC,gBAAD,eACMR,cADN,EAEMI,UAFN;IAGE,UAAU,EAAE;MAAER,SAAS,EAATA,SAAF;MAAaC,SAAS,EAATA,SAAb;MAAwBC,IAAI,EAAJA;KAHtC;IAIE,QAAQ,EAAEW,SAAS,CAACR,QAAD,EAAWI,YAAX;MAElBK,uBAAuB,CAACP,QAAD,CAN1B,CARF,CADF;AAmBD;;AAED,IAAMQ,YAAY,GAAG;EACnBX,cAAc,EAAEY,SAAS,CAACC,MAAV,CAAiBC,WAAjB,CACd,kDADc,CADG;EAInBlB,SAAS,EAAEgB,SAAS,CAACG,IAAV,CACRD,WADQ,CACI,iCADJ,EAERE,YAFQ,CAEK,IAFL,CAJQ;EAOnBnB,SAAS,EAAEe,SAAS,CAACK,KAAV,CAAgB,CAAC,OAAD,EAAU,MAAV,CAAhB,EACRH,WADQ,CACI,yCADJ,EAERE,YAFQ,CAEK,OAFL,CAPQ;EAUnBlB,IAAI,EAAEc,SAAS,CAACK,KAAV,CAAgB,CAAC,QAAD,EAAW,SAAX,CAAhB,EACHH,WADG,CACS,cADT,EAEHE,YAFG,CAEU,QAFV,CAVa;EAanBd,gBAAgB,EAAEU,SAAS,CAACG,IAAV,CACfD,WADe,CACH,qDADG,EAEfE,YAFe,CAEF,IAFE,CAbC;EAgBnBb,QAAQ,EAAES,SAAS,CAACM,SAAV,CAAoB,CAC5BN,SAAS,CAACO,KADkB,EAE5BP,SAAS,CAACQ,IAFkB,EAG5BR,SAAS,CAACS,IAHkB,CAApB,EAIPP,WAJO,CAIK,eAJL,EAIsBQ,UApBb;EAqBnBrB,QAAQ,EAAEW,SAAS,CAACC,MAAV,CAAiBC,WAAjB,CACR,sCADQ;AArBS,CAArB;AA0BAf,SAAS,CAACwB,SAAV,GAAsBZ,YAAtB;IAEMa,iBAAiB,GAAGC,QAAQ,CAAC1B,SAAD;AAClCyB,iBAAiB,CAACD,SAAlB,GAA8BZ,YAA9B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarGroup.js","sources":["../../../src/deprecated/ToolbarGroup.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport decorateToolbarChildren from './decorateToolbarChildren';\n\nconst blockName = 'toolbar-group';\n\nconst ToolbarGroupContainer = aggregatedClasses('div')(\n blockName,\n null,\n ({ space }) => ({\n [`space-${space}`]: !!space,\n }),\n);\n\nconst ToolbarGroup = ({ children, size, space = 0 }) => (\n <ToolbarGroupContainer classProps={{ space }}>\n {decorateToolbarChildren(children, { size })}\n </ToolbarGroupContainer>\n);\n\nToolbarGroup.propTypes = {\n children: PropTypes.any,\n size: PropTypes.number,\n space: PropTypes.number,\n};\n\nexport default ToolbarGroup;\n"],"names":["blockName","ToolbarGroupContainer","aggregatedClasses","space","ToolbarGroup","children","size","decorateToolbarChildren","propTypes","PropTypes","any","number"],"mappings":";;;;;;AAKA,IAAMA,SAAS,GAAG,eAAlB;AAEA,IAAMC,qBAAqB,GAAGC,iBAAiB,CAAC,KAAD,CAAjB,CAC5BF,SAD4B,EAE5B,IAF4B,EAG5B;
|
|
1
|
+
{"version":3,"file":"ToolbarGroup.js","sources":["../../../src/deprecated/ToolbarGroup.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport decorateToolbarChildren from './decorateToolbarChildren';\n\nconst blockName = 'toolbar-group';\n\nconst ToolbarGroupContainer = aggregatedClasses('div')(\n blockName,\n null,\n ({ space }) => ({\n [`space-${space}`]: !!space,\n }),\n);\n\nconst ToolbarGroup = ({ children, size, space = 0 }) => (\n <ToolbarGroupContainer classProps={{ space }}>\n {decorateToolbarChildren(children, { size })}\n </ToolbarGroupContainer>\n);\n\nToolbarGroup.propTypes = {\n children: PropTypes.any,\n size: PropTypes.number,\n space: PropTypes.number,\n};\n\nexport default ToolbarGroup;\n"],"names":["blockName","ToolbarGroupContainer","aggregatedClasses","space","ToolbarGroup","children","size","decorateToolbarChildren","propTypes","PropTypes","any","number"],"mappings":";;;;;;AAKA,IAAMA,SAAS,GAAG,eAAlB;AAEA,IAAMC,qBAAqB,GAAGC,iBAAiB,CAAC,KAAD,CAAjB,CAC5BF,SAD4B,EAE5B,IAF4B,EAG5B;EAAA,IAAGG,KAAH,QAAGA,KAAH;EAAA,2CACYA,KADZ,GACsB,CAAC,CAACA,KADxB;AAAA,CAH4B,CAA9B;;IAQMC,YAAY,GAAG,SAAfA,YAAe;EAAA,IAAGC,QAAH,SAAGA,QAAH;MAAaC,IAAb,SAAaA,IAAb;0BAAmBH,KAAnB;MAAmBA,KAAnB,4BAA2B,CAA3B;EAAA,oBACnB,oBAAC,qBAAD;IAAuB,UAAU,EAAE;MAAEA,KAAK,EAALA;;KAClCI,uBAAuB,CAACF,QAAD,EAAW;IAAEC,IAAI,EAAJA;GAAb,CAD1B,CADmB;AAAA;;AAMrBF,YAAY,CAACI,SAAb,GAAyB;EACvBH,QAAQ,EAAEI,SAAS,CAACC,GADG;EAEvBJ,IAAI,EAAEG,SAAS,CAACE,MAFO;EAGvBR,KAAK,EAAEM,SAAS,CAACE;AAHM,CAAzB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarItem.js","sources":["../../../src/deprecated/ToolbarItem.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useFocusGroupWithState } from '@elliemae/ds-shared/FocusGroup';\nimport DSButton from '@elliemae/ds-button';\nimport { PopperPositions as Position } from '@elliemae/ds-popper';\n\nconst ToolbarItem = ({ icon, labelText, menu = undefined, ...otherProps }) => {\n const [ref, setRef] = useState(null);\n\n useFocusGroupWithState(ref);\n const btn = (\n <DSButton {...otherProps} buttonType=\"text\" icon={icon} innerRef={(r) => setRef(r)} labelText={labelText} />\n );\n if (menu) {\n return React.cloneElement(menu, {\n ...menu.props,\n placement: Position.BOTTOM_END,\n triggerComponent: btn,\n });\n }\n return btn;\n};\n\nToolbarItem.displayName = 'ToolbarItem';\n\nToolbarItem.propTypes = {\n icon: PropTypes.element,\n labelText: PropTypes.string,\n};\n\nexport default ToolbarItem;\n"],"names":["ToolbarItem","icon","labelText","menu","undefined","otherProps","useState","ref","setRef","useFocusGroupWithState","btn","r","React","cloneElement","props","placement","Position","BOTTOM_END","triggerComponent","displayName","propTypes","PropTypes","element","string"],"mappings":";;;;;;;;;;;;;;;;IAMMA,WAAW,GAAG,SAAdA,WAAc,OAA0D;
|
|
1
|
+
{"version":3,"file":"ToolbarItem.js","sources":["../../../src/deprecated/ToolbarItem.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useFocusGroupWithState } from '@elliemae/ds-shared/FocusGroup';\nimport DSButton from '@elliemae/ds-button';\nimport { PopperPositions as Position } from '@elliemae/ds-popper';\n\nconst ToolbarItem = ({ icon, labelText, menu = undefined, ...otherProps }) => {\n const [ref, setRef] = useState(null);\n\n useFocusGroupWithState(ref);\n const btn = (\n <DSButton {...otherProps} buttonType=\"text\" icon={icon} innerRef={(r) => setRef(r)} labelText={labelText} />\n );\n if (menu) {\n return React.cloneElement(menu, {\n ...menu.props,\n placement: Position.BOTTOM_END,\n triggerComponent: btn,\n });\n }\n return btn;\n};\n\nToolbarItem.displayName = 'ToolbarItem';\n\nToolbarItem.propTypes = {\n icon: PropTypes.element,\n labelText: PropTypes.string,\n};\n\nexport default ToolbarItem;\n"],"names":["ToolbarItem","icon","labelText","menu","undefined","otherProps","useState","ref","setRef","useFocusGroupWithState","btn","r","React","cloneElement","props","placement","Position","BOTTOM_END","triggerComponent","displayName","propTypes","PropTypes","element","string"],"mappings":";;;;;;;;;;;;;;;;IAMMA,WAAW,GAAG,SAAdA,WAAc,OAA0D;EAAA,IAAvDC,IAAuD,QAAvDA,IAAuD;MAAjDC,SAAiD,QAAjDA,SAAiD;uBAAtCC,IAAsC;MAAtCA,IAAsC,0BAA/BC,SAA+B;MAAjBC,UAAiB;;EAC5E,gBAAsBC,QAAQ,CAAC,IAAD,CAA9B;;MAAOC,GAAP;MAAYC,MAAZ;;EAEAC,sBAAsB,CAACF,GAAD,CAAtB;EACA,IAAMG,GAAG,gBACP,oBAAC,QAAD,eAAcL,UAAd;IAA0B,UAAU,EAAC,MAArC;IAA4C,IAAI,EAAEJ,IAAlD;IAAwD,QAAQ,EAAE,kBAACU,CAAD;MAAA,OAAOH,MAAM,CAACG,CAAD,CAAb;KAAlE;IAAoF,SAAS,EAAET;KADjG;;EAGA,IAAIC,IAAJ,EAAU;IACR,oBAAOS,KAAK,CAACC,YAAN,CAAmBV,IAAnB,kCACFA,IAAI,CAACW,KADH;MAELC,SAAS,EAAEC,eAAQ,CAACC,UAFf;MAGLC,gBAAgB,EAAER;OAHpB;;;EAMF,OAAOA,GAAP;AACD;;AAEDV,WAAW,CAACmB,WAAZ,GAA0B,aAA1B;AAEAnB,WAAW,CAACoB,SAAZ,GAAwB;EACtBnB,IAAI,EAAEoB,SAAS,CAACC,OADM;EAEtBpB,SAAS,EAAEmB,SAAS,CAACE;AAFC,CAAxB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorateToolbarChildren.js","sources":["../../../src/deprecated/decorateToolbarChildren.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\n\nexport default (children, extraProps = {}) =>\n React.Children.map(\n children,\n component =>\n component\n ? cloneElement(component, {\n ...extraProps,\n ...component.props,\n className: `${component.props.className} toolbar-item`,\n })\n : component,\n null,\n );\n"],"names":["children","extraProps","React","Children","map","component","cloneElement","props","className"],"mappings":";;;;;;AAEA,+BAAe,UAACA,QAAD;
|
|
1
|
+
{"version":3,"file":"decorateToolbarChildren.js","sources":["../../../src/deprecated/decorateToolbarChildren.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\n\nexport default (children, extraProps = {}) =>\n React.Children.map(\n children,\n component =>\n component\n ? cloneElement(component, {\n ...extraProps,\n ...component.props,\n className: `${component.props.className} toolbar-item`,\n })\n : component,\n null,\n );\n"],"names":["children","extraProps","React","Children","map","component","cloneElement","props","className"],"mappings":";;;;;;AAEA,+BAAe,UAACA,QAAD;EAAA,IAAWC,UAAX,uEAAwB,EAAxB;EAAA,OACbC,KAAK,CAACC,QAAN,CAAeC,GAAf,CACEJ,QADF,EAEE,UAAAK,SAAS;IAAA,OACPA,SAAS,gBACLC,YAAY,CAACD,SAAD,gDACPJ,UADO,GAEPI,SAAS,CAACE,KAFH;MAGVC,SAAS,YAAKH,SAAS,CAACE,KAAV,CAAgBC,SAArB;OAJN,GAMLH,SAPG;GAFX,EAUE,IAVF,CADa;AAAA,CAAf;;;;"}
|
package/esm/props.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../src/props.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const DSToolbarV2Schema = {\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Whether to align the content left or right')\n .defaultValue('right'),\n withDepth: PropTypes.bool.description('Whether to add a box-shadow to the container').defaultValue(true),\n compact: PropTypes.bool.description('Whether you want the compact version of the toolbar').defaultValue(false),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Reference to attach to the wrapper'),\n};\n"],"names":["DSToolbarV2Schema","alignment","PropTypes","oneOf","description","defaultValue","withDepth","bool","compact","innerRef","oneOfType","func","object"],"mappings":";;IAEaA,iBAAiB,GAAG;
|
|
1
|
+
{"version":3,"file":"props.js","sources":["../../src/props.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\n\nexport const DSToolbarV2Schema = {\n alignment: PropTypes.oneOf(['right', 'left'])\n .description('Whether to align the content left or right')\n .defaultValue('right'),\n withDepth: PropTypes.bool.description('Whether to add a box-shadow to the container').defaultValue(true),\n compact: PropTypes.bool.description('Whether you want the compact version of the toolbar').defaultValue(false),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).description('Reference to attach to the wrapper'),\n};\n"],"names":["DSToolbarV2Schema","alignment","PropTypes","oneOf","description","defaultValue","withDepth","bool","compact","innerRef","oneOfType","func","object"],"mappings":";;IAEaA,iBAAiB,GAAG;EAC/BC,SAAS,EAAEC,SAAS,CAACC,KAAV,CAAgB,CAAC,OAAD,EAAU,MAAV,CAAhB,EACRC,WADQ,CACI,4CADJ,EAERC,YAFQ,CAEK,OAFL,CADoB;EAI/BC,SAAS,EAAEJ,SAAS,CAACK,IAAV,CAAeH,WAAf,CAA2B,8CAA3B,EAA2EC,YAA3E,CAAwF,IAAxF,CAJoB;EAK/BG,OAAO,EAAEN,SAAS,CAACK,IAAV,CAAeH,WAAf,CAA2B,qDAA3B,EAAkFC,YAAlF,CAA+F,KAA/F,CALsB;EAM/BI,QAAQ,EAAEP,SAAS,CAACQ,SAAV,CAAoB,CAACR,SAAS,CAACS,IAAX,EAAiBT,SAAS,CAACU,MAA3B,CAApB,EAAwDR,WAAxD,CAAoE,oCAApE;AANqB;;;;"}
|
package/esm/styled.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../src/styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport Grid from '@elliemae/ds-grid';\n\nexport const StyledToolbarWrapper = styled(Grid)`\n background-color: ${(props) => props.theme.colors.neutral['000']};\n\n min-height: ${(props) => (props.compact ? '28px' : '40px')};\n max-height: ${(props) => props.theme.space.xxl};\n\n padding: 0 ${(props) => props.theme.space.xxs};\n\n box-shadow: ${(props) => (!props.withDepth ? 'none' : '0 1px 5px 0 rgb(0 0 0 / 13%), 0 2px 4px 0 rgb(0 0 0 / 20%)')};\n`;\n\nexport const StyledToolbarItem = styled(Grid)``;\n\nexport const StyledSeparator = styled(Grid)`\n height: 30px;\n width: 1px;\n background-color: ${(props) => props.theme.colors.neutral[200]};\n`;\n"],"names":["StyledToolbarWrapper","styled","Grid","props","theme","colors","neutral","compact","space","xxl","xxs","withDepth","StyledToolbarItem","StyledSeparator"],"mappings":";;;IAGaA,oBAAoB,gBAAGC,MAAM,CAACC,IAAD,CAAT;
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../src/styled.tsx"],"sourcesContent":["import styled from 'styled-components';\nimport Grid from '@elliemae/ds-grid';\n\nexport const StyledToolbarWrapper = styled(Grid)`\n background-color: ${(props) => props.theme.colors.neutral['000']};\n\n min-height: ${(props) => (props.compact ? '28px' : '40px')};\n max-height: ${(props) => props.theme.space.xxl};\n\n padding: 0 ${(props) => props.theme.space.xxs};\n\n box-shadow: ${(props) => (!props.withDepth ? 'none' : '0 1px 5px 0 rgb(0 0 0 / 13%), 0 2px 4px 0 rgb(0 0 0 / 20%)')};\n`;\n\nexport const StyledToolbarItem = styled(Grid)``;\n\nexport const StyledSeparator = styled(Grid)`\n height: 30px;\n width: 1px;\n background-color: ${(props) => props.theme.colors.neutral[200]};\n`;\n"],"names":["StyledToolbarWrapper","styled","Grid","props","theme","colors","neutral","compact","space","xxl","xxs","withDepth","StyledToolbarItem","StyledSeparator"],"mappings":";;;IAGaA,oBAAoB,gBAAGC,MAAM,CAACC,IAAD,CAAT;EAAA;AAAA,8FACX,UAACC,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,KAA3B,CAAX;AAAA,CADW,EAGjB,UAACH,KAAD;EAAA,OAAYA,KAAK,CAACI,OAAN,GAAgB,MAAhB,GAAyB,MAArC;AAAA,CAHiB,EAIjB,UAACJ,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYI,KAAZ,CAAkBC,GAA7B;AAAA,CAJiB,EAMlB,UAACN,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYI,KAAZ,CAAkBE,GAA7B;AAAA,CANkB,EAQjB,UAACP,KAAD;EAAA,OAAY,CAACA,KAAK,CAACQ,SAAP,GAAmB,MAAnB,GAA4B,4DAAxC;AAAA,CARiB;IAWpBC,iBAAiB,gBAAGX,MAAM,CAACC,IAAD,CAAT;EAAA;AAAA;IAEjBW,eAAe,gBAAGZ,MAAM,CAACC,IAAD,CAAT;EAAA;AAAA,qDAGN,UAACC,KAAD;EAAA,OAAWA,KAAK,CAACC,KAAN,CAAYC,MAAZ,CAAmBC,OAAnB,CAA2B,GAA3B,CAAX;AAAA,CAHM;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolbarItemHandlers.js","sources":["../../src/useToolbarItemHandlers.tsx"],"sourcesContent":["import { useCallback, useContext } from 'react';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\n\nexport const useToolbarItemHandlers = (\n toolbarItemId: string,\n): {\n onKeyDown: React.KeyboardEventHandler;\n} => {\n const { toolbarUid, itemReferences } = useContext(DSToolbarV2Context);\n\n const onKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n const toolbarItems = [...document.querySelectorAll(`#${toolbarUid} .ds-toolbar-item`)];\n let nextToolbarItemIndex = -1;\n\n if (['ArrowLeft', 'ArrowRight'].includes(e.code)) {\n const toolbarItemIndex = toolbarItems.findIndex((domElem) => domElem.id === toolbarItemId);\n nextToolbarItemIndex = toolbarItemIndex + (e.code === 'ArrowLeft' ? -1 : 1);\n } else if (e.code === 'Home') {\n nextToolbarItemIndex = 0;\n } else if (e.code === 'End') {\n nextToolbarItemIndex = toolbarItems.length - 1;\n }\n\n if (nextToolbarItemIndex >= 0 && nextToolbarItemIndex < toolbarItems.length) {\n e.preventDefault();\n e.stopPropagation();\n const ref = itemReferences[toolbarItems[nextToolbarItemIndex].id];\n if (ref.current) ref.current.focus();\n }\n },\n [toolbarUid, toolbarItemId, itemReferences],\n );\n\n return { onKeyDown };\n};\n"],"names":["useToolbarItemHandlers","toolbarItemId","useContext","DSToolbarV2Context","toolbarUid","itemReferences","onKeyDown","useCallback","e","toolbarItems","document","querySelectorAll","nextToolbarItemIndex","includes","code","toolbarItemIndex","findIndex","domElem","id","length","preventDefault","stopPropagation","ref","current","focus"],"mappings":";;;;IAGaA,sBAAsB,GAAG,SAAzBA,sBAAyB,CACpCC,aADoC,EAIjC;
|
|
1
|
+
{"version":3,"file":"useToolbarItemHandlers.js","sources":["../../src/useToolbarItemHandlers.tsx"],"sourcesContent":["import { useCallback, useContext } from 'react';\nimport { DSToolbarV2Context } from './DSToolbarV2Context';\n\nexport const useToolbarItemHandlers = (\n toolbarItemId: string,\n): {\n onKeyDown: React.KeyboardEventHandler;\n} => {\n const { toolbarUid, itemReferences } = useContext(DSToolbarV2Context);\n\n const onKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n const toolbarItems = [...document.querySelectorAll(`#${toolbarUid} .ds-toolbar-item`)];\n let nextToolbarItemIndex = -1;\n\n if (['ArrowLeft', 'ArrowRight'].includes(e.code)) {\n const toolbarItemIndex = toolbarItems.findIndex((domElem) => domElem.id === toolbarItemId);\n nextToolbarItemIndex = toolbarItemIndex + (e.code === 'ArrowLeft' ? -1 : 1);\n } else if (e.code === 'Home') {\n nextToolbarItemIndex = 0;\n } else if (e.code === 'End') {\n nextToolbarItemIndex = toolbarItems.length - 1;\n }\n\n if (nextToolbarItemIndex >= 0 && nextToolbarItemIndex < toolbarItems.length) {\n e.preventDefault();\n e.stopPropagation();\n const ref = itemReferences[toolbarItems[nextToolbarItemIndex].id];\n if (ref.current) ref.current.focus();\n }\n },\n [toolbarUid, toolbarItemId, itemReferences],\n );\n\n return { onKeyDown };\n};\n"],"names":["useToolbarItemHandlers","toolbarItemId","useContext","DSToolbarV2Context","toolbarUid","itemReferences","onKeyDown","useCallback","e","toolbarItems","document","querySelectorAll","nextToolbarItemIndex","includes","code","toolbarItemIndex","findIndex","domElem","id","length","preventDefault","stopPropagation","ref","current","focus"],"mappings":";;;;IAGaA,sBAAsB,GAAG,SAAzBA,sBAAyB,CACpCC,aADoC,EAIjC;EACH,kBAAuCC,UAAU,CAACC,kBAAD,CAAjD;MAAQC,UAAR,eAAQA,UAAR;MAAoBC,cAApB,eAAoBA,cAApB;;EAEA,IAAMC,SAAqC,GAAGC,WAAW,CACvD,UAACC,CAAD,EAAO;IACL,IAAMC,YAAY,sBAAOC,QAAQ,CAACC,gBAAT,YAA8BP,UAA9B,uBAAP,CAAlB;;IACA,IAAIQ,oBAAoB,GAAG,CAAC,CAA5B;;IAEA,IAAI,CAAC,WAAD,EAAc,YAAd,EAA4BC,QAA5B,CAAqCL,CAAC,CAACM,IAAvC,CAAJ,EAAkD;MAChD,IAAMC,gBAAgB,GAAGN,YAAY,CAACO,SAAb,CAAuB,UAACC,OAAD;QAAA,OAAaA,OAAO,CAACC,EAAR,KAAejB,aAA5B;OAAvB,CAAzB;MACAW,oBAAoB,GAAGG,gBAAgB,IAAIP,CAAC,CAACM,IAAF,KAAW,WAAX,GAAyB,CAAC,CAA1B,GAA8B,CAAlC,CAAvC;KAFF,MAGO,IAAIN,CAAC,CAACM,IAAF,KAAW,MAAf,EAAuB;MAC5BF,oBAAoB,GAAG,CAAvB;KADK,MAEA,IAAIJ,CAAC,CAACM,IAAF,KAAW,KAAf,EAAsB;MAC3BF,oBAAoB,GAAGH,YAAY,CAACU,MAAb,GAAsB,CAA7C;;;IAGF,IAAIP,oBAAoB,IAAI,CAAxB,IAA6BA,oBAAoB,GAAGH,YAAY,CAACU,MAArE,EAA6E;MAC3EX,CAAC,CAACY,cAAF;MACAZ,CAAC,CAACa,eAAF;MACA,IAAMC,GAAG,GAAGjB,cAAc,CAACI,YAAY,CAACG,oBAAD,CAAZ,CAAmCM,EAApC,CAA1B;MACA,IAAII,GAAG,CAACC,OAAR,EAAiBD,GAAG,CAACC,OAAJ,CAAYC,KAAZ;;GAlBkC,EAqBvD,CAACpB,UAAD,EAAaH,aAAb,EAA4BI,cAA5B,CArBuD,CAAzD;EAwBA,OAAO;IAAEC,SAAS,EAATA;GAAT;AACD;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-toolbar",
|
|
3
|
-
"version": "1.61.
|
|
3
|
+
"version": "1.61.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Ellie Mae - Dim Sum - Toolbar",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
"build": "node ../../scripts/build/build.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@elliemae/ds-button": "1.61.
|
|
20
|
-
"@elliemae/ds-classnames": "1.61.
|
|
21
|
-
"@elliemae/ds-icons": "1.61.
|
|
22
|
-
"@elliemae/ds-popper": "1.61.
|
|
23
|
-
"@elliemae/ds-shared": "1.61.
|
|
24
|
-
"@elliemae/ds-utilities": "1.61.
|
|
19
|
+
"@elliemae/ds-button": "1.61.13",
|
|
20
|
+
"@elliemae/ds-classnames": "1.61.13",
|
|
21
|
+
"@elliemae/ds-icons": "1.61.13",
|
|
22
|
+
"@elliemae/ds-popper": "1.61.13",
|
|
23
|
+
"@elliemae/ds-shared": "1.61.13",
|
|
24
|
+
"@elliemae/ds-utilities": "1.61.13",
|
|
25
25
|
"prop-types": "~15.7.2",
|
|
26
26
|
"react-desc": "^4.1.2"
|
|
27
27
|
},
|