@elliemae/ds-breadcrumb 3.35.0 → 3.36.0-next.1

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.
@@ -98,7 +98,6 @@ const props = {
98
98
  */
99
99
  children: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.element).isRequired.description("Container items to wrap")
100
100
  };
101
- DSBreadcrumb.propTypes = props;
102
101
  DSBreadcrumb.displayName = "DSBreadcrumb";
103
102
  const DSBreadcrumbWithSchema = (0, import_ds_props_helpers.describe)(DSBreadcrumb);
104
103
  DSBreadcrumbWithSchema.propTypes = props;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSBreadcrumb.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { type WeakValidationMap, cloneElement, useMemo } from 'react';\nimport { PropTypes, describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport DSBreadcrumbItem from './DSBreadcrumbItem.js';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation.js';\nimport type { DSBreadcrumbT } from './react-desc-prop-types.js';\nimport { defaultProps } from './react-desc-prop-types.js';\n\nimport { StyledContainer, StyledList } from './styles.js';\n\nconst htmlElements = ['nav', 'div', 'header', 'footer', 'main'] as const;\n\nconst DSBreadcrumb = (props: DSBreadcrumbT.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSBreadcrumbT.InternalProps>(props, defaultProps);\n const { containerProps, as, label, trailingSlash, isTitle, children, ...rest } = propsWithDefaults;\n const [addRef, onKeyDown] = useKeyboardNavigation();\n\n const safeElement = useMemo(() => (htmlElements.indexOf(as) > -1 ? as : 'nav'), [as]);\n\n return (\n <StyledContainer\n data-testid=\"breadcrumb-nav-container\"\n aria-label={label}\n {...rest}\n {...containerProps}\n as={safeElement}\n >\n <StyledList aria-label={label} data-testid=\"list-container\">\n {React.Children.map(children, (child: React.ReactElement, childIndex) =>\n childIndex < children.length - 1\n ? cloneElement(child, {\n childIndex,\n addRef,\n onKeyDown,\n })\n : cloneElement(child, {\n childIndex,\n addRef,\n onKeyDown,\n trailingSlash,\n isTitle,\n }),\n )}\n </StyledList>\n </StyledContainer>\n );\n};\n\nDSBreadcrumb.Item = DSBreadcrumbItem;\n\nconst props = {\n /** props injected to breadcrumb wrapper */\n containerProps: PropTypes.object.description('props injected to breadcrumb wrapper'),\n /**\n * Type of element you want the main container to be:\n * 'nav', 'div', 'header', 'footer', 'main'\n */\n as: PropTypes.string.description(\n \"Type of element you want the main container to be: 'nav', 'div', 'header', 'footer', 'main'\",\n ),\n /**\n * Whether to show the last element of the breadcrumb as a title\n * Also removes trailing slash to show last element as title\n */\n isTitle: PropTypes.bool.description(\n 'Whether to show the last element of the breadcrumb as a title. Also removes trailing slash to show last element as title',\n ),\n /** breadcrumb label */\n label: PropTypes.string.description('breadcrumb label'),\n /**\n * Container items to wrap\n */\n children: PropTypes.arrayOf(PropTypes.element).isRequired.description('Container items to wrap'),\n};\n\nDSBreadcrumb.propTypes = props;\nDSBreadcrumb.displayName = 'DSBreadcrumb';\n\nconst DSBreadcrumbWithSchema = describe(DSBreadcrumb);\nDSBreadcrumbWithSchema.propTypes = props as WeakValidationMap<unknown>;\n\nexport { DSBreadcrumb, DSBreadcrumbWithSchema, htmlElements };\nexport default DSBreadcrumb;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0BjB;AA1BN,mBAAqE;AACrE,8BAAkE;AAClE,8BAA6B;AAC7B,mCAAsC;AAEtC,mCAA6B;AAE7B,oBAA4C;AAE5C,MAAM,eAAe,CAAC,OAAO,OAAO,UAAU,UAAU,MAAM;AAE9D,MAAM,eAAe,CAACA,WAA+B;AACnD,QAAM,wBAAoB,sDAA0DA,QAAO,yCAAY;AACvG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o } from 'react';\nimport { PropTypes, describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport DSBreadcrumbItem from './DSBreadcrumbItem.js';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation.js';\nimport type { DSBreadcrumbT } from './react-desc-prop-types.js';\nimport { defaultProps } from './react-desc-prop-types.js';\n\nimport { StyledContainer, StyledList } from './styles.js';\n\nconst htmlElements = ['nav', 'div', 'header', 'footer', 'main'] as const;\n\nconst DSBreadcrumb = (props: DSBreadcrumbT.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSBreadcrumbT.InternalProps>(props, defaultProps);\n const { containerProps, as, label, trailingSlash, isTitle, children, ...rest } = propsWithDefaults;\n const [addRef, onKeyDown] = useKeyboardNavigation();\n\n const safeElement = useMemo(() => (htmlElements.indexOf(as) > -1 ? as : 'nav'), [as]);\n\n return (\n <StyledContainer\n data-testid=\"breadcrumb-nav-container\"\n aria-label={label}\n {...rest}\n {...containerProps}\n as={safeElement}\n >\n <StyledList aria-label={label} data-testid=\"list-container\">\n {React.Children.map(children, (child: React.ReactElement, childIndex) =>\n childIndex < children.length - 1\n ? cloneElement(child, {\n childIndex,\n addRef,\n onKeyDown,\n })\n : cloneElement(child, {\n childIndex,\n addRef,\n onKeyDown,\n trailingSlash,\n isTitle,\n }),\n )}\n </StyledList>\n </StyledContainer>\n );\n};\n\nDSBreadcrumb.Item = DSBreadcrumbItem;\n\nconst props = {\n /** props injected to breadcrumb wrapper */\n containerProps: PropTypes.object.description('props injected to breadcrumb wrapper'),\n /**\n * Type of element you want the main container to be:\n * 'nav', 'div', 'header', 'footer', 'main'\n */\n as: PropTypes.string.description(\n \"Type of element you want the main container to be: 'nav', 'div', 'header', 'footer', 'main'\",\n ),\n /**\n * Whether to show the last element of the breadcrumb as a title\n * Also removes trailing slash to show last element as title\n */\n isTitle: PropTypes.bool.description(\n 'Whether to show the last element of the breadcrumb as a title. Also removes trailing slash to show last element as title',\n ),\n /** breadcrumb label */\n label: PropTypes.string.description('breadcrumb label'),\n /**\n * Container items to wrap\n */\n children: PropTypes.arrayOf(PropTypes.element).isRequired.description('Container items to wrap'),\n};\n\nDSBreadcrumb.displayName = 'DSBreadcrumb';\nconst DSBreadcrumbWithSchema = describe(DSBreadcrumb);\nDSBreadcrumbWithSchema.propTypes = props as WeakValidationMap<unknown>;\n\nexport { DSBreadcrumb, DSBreadcrumbWithSchema, htmlElements };\nexport default DSBreadcrumb;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0BjB;AA1BN,mBAAqE;AACrE,8BAAkE;AAClE,8BAA6B;AAC7B,mCAAsC;AAEtC,mCAA6B;AAE7B,oBAA4C;AAE5C,MAAM,eAAe,CAAC,OAAO,OAAO,UAAU,UAAU,MAAM;AAE9D,MAAM,eAAe,CAACA,WAA+B;AACnD,QAAM,wBAAoB,sDAA0DA,QAAO,yCAAY;AACvG,QAAM,EAAE,gBAAgB,IAAI,OAAO,eAAe,SAAS,UAAU,GAAG,KAAK,IAAI;AACjF,QAAM,CAAC,QAAQ,SAAS,QAAI,oDAAsB;AAElD,QAAM,kBAAc,sBAAQ,MAAO,aAAa,QAAQ,EAAE,IAAI,KAAK,KAAK,OAAQ,CAAC,EAAE,CAAC;AAEpF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAY;AAAA,MACZ,cAAY;AAAA,MACX,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,IAAI;AAAA,MAEJ,sDAAC,4BAAW,cAAY,OAAO,eAAY,kBACxC,uBAAAC,QAAM,SAAS;AAAA,QAAI;AAAA,QAAU,CAAC,OAA2B,eACxD,aAAa,SAAS,SAAS,QAC3B,2BAAa,OAAO;AAAA,UAClB;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC,QACD,2BAAa,OAAO;AAAA,UAClB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACP,GACF;AAAA;AAAA,EACF;AAEJ;AAEA,aAAa,OAAO,wBAAAC;AAEpB,MAAM,QAAQ;AAAA;AAAA,EAEZ,gBAAgB,kCAAU,OAAO,YAAY,sCAAsC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKnF,IAAI,kCAAU,OAAO;AAAA,IACnB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS,kCAAU,KAAK;AAAA,IACtB;AAAA,EACF;AAAA;AAAA,EAEA,OAAO,kCAAU,OAAO,YAAY,kBAAkB;AAAA;AAAA;AAAA;AAAA,EAItD,UAAU,kCAAU,QAAQ,kCAAU,OAAO,EAAE,WAAW,YAAY,yBAAyB;AACjG;AAEA,aAAa,cAAc;AAC3B,MAAM,6BAAyB,kCAAS,YAAY;AACpD,uBAAuB,YAAY;AAGnC,IAAO,uBAAQ;",
6
6
  "names": ["props", "React", "DSBreadcrumbItem"]
7
7
  }
@@ -86,7 +86,6 @@ const props = {
86
86
  /** link color */
87
87
  color: import_ds_props_helpers.PropTypes.string.description("link color")
88
88
  };
89
- DSBreadcrumbItem.propTypes = props;
90
89
  DSBreadcrumbItem.displayName = "DSBreadcrumbItem";
91
90
  const DSBreadcrumbItemWithSchema = (0, import_ds_props_helpers.describe)(DSBreadcrumbItem);
92
91
  DSBreadcrumbItemWithSchema.propTypes = props;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSBreadcrumbItem.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { type WeakValidationMap } from 'react';\nimport { PropTypes, describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport type { DSBreadcrumbItemT } from './react-desc-prop-types.js';\nimport { defaultItemProps } from './react-desc-prop-types.js';\n\nimport { StyledLink, StyledCrumbWrapper } from './styles.js';\n\nconst DSBreadcrumbItem = (props: DSBreadcrumbItemT.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSBreadcrumbItemT.InternalProps>(props, defaultItemProps);\n const { as, active, href, onClick, onKeyDown, addRef, isTitle, trailingSlash, label, childIndex, color, ...rest } =\n propsWithDefaults;\n return (\n <StyledCrumbWrapper\n aria-current={active ? 'page' : undefined}\n data-testid=\"breadcrumb-item-container\"\n isTitle={isTitle}\n trailingSlash={trailingSlash}\n >\n <StyledLink\n variant=\"link\"\n component={as}\n href={href}\n onClick={onClick}\n tabIndex={0}\n active={active}\n onKeyDown={(e: React.KeyboardEvent) => onKeyDown(e, childIndex ?? -1, onClick)}\n isTitle={isTitle}\n color={color}\n innerRef={addRef}\n {...rest}\n >\n {label}\n </StyledLink>\n </StyledCrumbWrapper>\n );\n};\n\nconst props = {\n /** render as any html node */\n as: PropTypes.string.description('render as any html node'),\n /** active item */\n active: PropTypes.bool.description('active item'),\n /** href link */\n href: PropTypes.string.description('href link'),\n /** on click handler */\n onClick: PropTypes.func.description('on click handler'),\n /** style item as title */\n isTitle: PropTypes.bool.description('style item as title'),\n /** add trailing slash */\n trailingSlash: PropTypes.bool.description('add trailing slash'),\n /** item label */\n label: PropTypes.string.description('item label'),\n /** link color */\n color: PropTypes.string.description('link color'),\n};\n\nDSBreadcrumbItem.propTypes = props;\nDSBreadcrumbItem.displayName = 'DSBreadcrumbItem';\n\nconst DSBreadcrumbItemWithSchema = describe(DSBreadcrumbItem);\nDSBreadcrumbItemWithSchema.propTypes = props as WeakValidationMap<unknown>;\n\nexport { DSBreadcrumbItem, DSBreadcrumbItemWithSchema };\nexport default DSBreadcrumbItem;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkBjB;AAjBN,8BAAkE;AAElE,mCAAiC;AAEjC,oBAA+C;AAE/C,MAAM,mBAAmB,CAACA,WAAmC;AAC3D,QAAM,wBAAoB,sDAA8DA,QAAO,6CAAgB;AAC/G,QAAM,EAAE,IAAI,QAAQ,MAAM,SAAS,WAAW,QAAQ,SAAS,eAAe,OAAO,YAAY,OAAO,GAAG,KAAK,IAC9G;AACF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,gBAAc,SAAS,SAAS;AAAA,MAChC,eAAY;AAAA,MACZ;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,WAAW;AAAA,UACX;AAAA,UACA;AAAA,UACA,UAAU;AAAA,UACV;AAAA,UACA,WAAW,CAAC,MAA2B,UAAU,GAAG,cAAc,IAAI,OAAO;AAAA,UAC7E;AAAA,UACA;AAAA,UACA,UAAU;AAAA,UACT,GAAG;AAAA,UAEH;AAAA;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;AAEA,MAAM,QAAQ;AAAA;AAAA,EAEZ,IAAI,kCAAU,OAAO,YAAY,yBAAyB;AAAA;AAAA,EAE1D,QAAQ,kCAAU,KAAK,YAAY,aAAa;AAAA;AAAA,EAEhD,MAAM,kCAAU,OAAO,YAAY,WAAW;AAAA;AAAA,EAE9C,SAAS,kCAAU,KAAK,YAAY,kBAAkB;AAAA;AAAA,EAEtD,SAAS,kCAAU,KAAK,YAAY,qBAAqB;AAAA;AAAA,EAEzD,eAAe,kCAAU,KAAK,YAAY,oBAAoB;AAAA;AAAA,EAE9D,OAAO,kCAAU,OAAO,YAAY,YAAY;AAAA;AAAA,EAEhD,OAAO,kCAAU,OAAO,YAAY,YAAY;AAClD;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,cAAc;AAE/B,MAAM,iCAA6B,kCAAS,gBAAgB;AAC5D,2BAA2B,YAAY;AAGvC,IAAO,2BAAQ;",
4
+ "sourcesContent": ["import React, { type WeakValidationMap } from 'react';\nimport { PropTypes, describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport type { DSBreadcrumbItemT } from './react-desc-prop-types.js';\nimport { defaultItemProps } from './react-desc-prop-types.js';\n\nimport { StyledLink, StyledCrumbWrapper } from './styles.js';\n\nconst DSBreadcrumbItem = (props: DSBreadcrumbItemT.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSBreadcrumbItemT.InternalProps>(props, defaultItemProps);\n const { as, active, href, onClick, onKeyDown, addRef, isTitle, trailingSlash, label, childIndex, color, ...rest } =\n propsWithDefaults;\n return (\n <StyledCrumbWrapper\n aria-current={active ? 'page' : undefined}\n data-testid=\"breadcrumb-item-container\"\n isTitle={isTitle}\n trailingSlash={trailingSlash}\n >\n <StyledLink\n variant=\"link\"\n component={as}\n href={href}\n onClick={onClick}\n tabIndex={0}\n active={active}\n onKeyDown={(e: React.KeyboardEvent) => onKeyDown(e, childIndex ?? -1, onClick)}\n isTitle={isTitle}\n color={color}\n innerRef={addRef}\n {...rest}\n >\n {label}\n </StyledLink>\n </StyledCrumbWrapper>\n );\n};\n\nconst props = {\n /** render as any html node */\n as: PropTypes.string.description('render as any html node'),\n /** active item */\n active: PropTypes.bool.description('active item'),\n /** href link */\n href: PropTypes.string.description('href link'),\n /** on click handler */\n onClick: PropTypes.func.description('on click handler'),\n /** style item as title */\n isTitle: PropTypes.bool.description('style item as title'),\n /** add trailing slash */\n trailingSlash: PropTypes.bool.description('add trailing slash'),\n /** item label */\n label: PropTypes.string.description('item label'),\n /** link color */\n color: PropTypes.string.description('link color'),\n};\n\nDSBreadcrumbItem.displayName = 'DSBreadcrumbItem';\nconst DSBreadcrumbItemWithSchema = describe(DSBreadcrumbItem);\nDSBreadcrumbItemWithSchema.propTypes = props as WeakValidationMap<unknown>;\n\nexport { DSBreadcrumbItem, DSBreadcrumbItemWithSchema };\nexport default DSBreadcrumbItem;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkBjB;AAjBN,8BAAk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ae/ds-system");
39
39
  var import_ds_typography = require("@elliemae/ds-typography");
40
40
  const handleColor = (theme, isActive, color, isTitle) => {
41
- if (isActive)
42
- return theme.colors.neutral[800];
43
- if (color)
44
- return color;
45
- if (isTitle)
46
- return theme.colors.neutral[700];
41
+ if (isActive) return theme.colors.neutral[800];
42
+ if (color) return color;
43
+ if (isTitle) return theme.colors.neutral[700];
47
44
  return theme.colors.brand[600];
48
45
  };
49
46
  const StyledList = import_ds_system.styled.ol`
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/styles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable max-params */\nimport type { Theme } from '@elliemae/pui-theme';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport type { DSBreadcrumbItemT } from './react-desc-prop-types.js';\n\nconst handleColor = (theme: Theme, isActive: boolean, color: string, isTitle: boolean): string => {\n if (isActive) return theme.colors.neutral[800];\n if (color) return color;\n if (isTitle) return theme.colors.neutral[700];\n return theme.colors.brand[600];\n};\n\nconst StyledList = styled.ol`\n width: 100%;\n list-style: none;\n display: flex;\n padding: 0;\n margin: 0;\n li:first-child * {\n margin-left: 0;\n }\n`;\n\nconst StyledCrumbWrapper = styled.li<Partial<DSBreadcrumbItemT.Props>>`\n display: inline-flex;\n align-items: center;\n flex-shrink: 20;\n transition: flex-shrink 0.1s cubic-bezier(0.64, 0, 0.35, 1);\n min-height: 1.231rem;\n min-width: 10px;\n &:hover {\n flex-shrink: 0;\n }\n ${({ theme, isTitle, trailingSlash }) =>\n isTitle || !trailingSlash\n ? `&:not(:last-child):after {\n display: inline-block;\n content: '/';\n color: ${theme.colors.neutral[700]};\n }\n `\n : `&:after {\n display: inline-block;\n content: '/';\n color: ${theme.colors.neutral[700]};\n }\n `}\n`;\n\nconst StyledContainer = styled.nav`\n display: flex;\n align-items: center;\n padding: 0;\n`;\n\nconst StyledLink = styled(DSTypography)<Partial<DSBreadcrumbItemT.Props>>`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-decoration: none;\n outline: none;\n margin: 0 2px;\n border: 2px solid transparent;\n -webkit-text-stroke: 0.4px transparent;\n line-height: 20px;\n background: transparent;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n color: ${({ theme, active, color = '', isTitle }) => handleColor(theme, !!active, color, !!isTitle)};\n &:hover {\n color: ${({ theme, color }) => color || theme.colors.brand[800]};\n cursor: pointer;\n ${({ theme, color }) => `-webkit-text-stroke: 0.4px ${color || theme.colors.brand[800]}`};\n }\n &:focus {\n ${({ theme }) => `border: 2px solid ${theme.colors.brand[700]};`}\n border-radius: 2px;\n }\n`;\n\nexport { StyledList, StyledCrumbWrapper, StyledContainer, StyledLink };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,uBAAuB;AACvB,2BAA6B;AAG7B,MAAM,cAAc,CAAC,OAAc,UAAmB,OAAe,YAA6B;AAChG,MAAI;AAAU,WAAO,MAAM,OAAO,QAAQ,GAAG;AAC7C,MAAI;AAAO,WAAO;AAClB,MAAI;AAAS,WAAO,MAAM,OAAO,QAAQ,GAAG;AAC5C,SAAO,MAAM,OAAO,MAAM,GAAG;AAC/B;AAEA,MAAM,aAAa,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAW1B,MAAM,qBAAqB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAU9B,CAAC,EAAE,OAAO,SAAS,cAAc,MACjC,WAAW,CAAC,gBACR;AAAA;AAAA;AAAA,aAGK,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA,MAG7B;AAAA;AAAA;AAAA,aAGK,MAAM,OAAO,QAAQ,GAAG;AAAA;AAAA;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AC;AAAA;AAAA,MAG9B;AAAA;AAAA;AAAA,aAGK,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA,GAEnC;AAAA;AAGH,MAAM,kBAAkB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAM/B,MAAM,iBAAa,yBAAO,iCAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAWrB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY,OAAO;AAAA,WAC9C,CAAC,EAAE,OAAO,QAAQ,QAAQ,IAAI,QAAQ,MAAM,YAAY,OAAO,CAAC,CAAC,QAAQ,OAAO,CAAC,CAAC,OAAO,CAAC;AAAA;AAAA,aAExF,CAAC,EAAE,OAAO,MAAM,MAAM,SAAS,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA,MAE7D,CAAC,EAAE,OAAO,MAAM,MAAM,8BAA8B,SAAS,MAAM,OAAO,MAAM,GAAG,CAAC,EAAE;AAAA;AAAA;AAAA,MAGtF,CAAC,EAAE,MAAM,MAAM,qBAAqB,MAAM,OAAO,MAAM,GAAG,CAAC,GAAG;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -62,7 +62,6 @@ const props = {
62
62
  */
63
63
  children: PropTypes.arrayOf(PropTypes.element).isRequired.description("Container items to wrap")
64
64
  };
65
- DSBreadcrumb.propTypes = props;
66
65
  DSBreadcrumb.displayName = "DSBreadcrumb";
67
66
  const DSBreadcrumbWithSchema = describe(DSBreadcrumb);
68
67
  DSBreadcrumbWithSchema.propTypes = props;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSBreadcrumb.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { type WeakValidationMap, cloneElement, useMemo } from 'react';\nimport { PropTypes, describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport DSBreadcrumbItem from './DSBreadcrumbItem.js';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation.js';\nimport type { DSBreadcrumbT } from './react-desc-prop-types.js';\nimport { defaultProps } from './react-desc-prop-types.js';\n\nimport { StyledContainer, StyledList } from './styles.js';\n\nconst htmlElements = ['nav', 'div', 'header', 'footer', 'main'] as const;\n\nconst DSBreadcrumb = (props: DSBreadcrumbT.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSBreadcrumbT.InternalProps>(props, defaultProps);\n const { containerProps, as, label, trailingSlash, isTitle, children, ...rest } = propsWithDefaults;\n const [addRef, onKeyDown] = useKeyboardNavigation();\n\n const safeElement = useMemo(() => (htmlElements.indexOf(as) > -1 ? as : 'nav'), [as]);\n\n return (\n <StyledContainer\n data-testid=\"breadcrumb-nav-container\"\n aria-label={label}\n {...rest}\n {...containerProps}\n as={safeElement}\n >\n <StyledList aria-label={label} data-testid=\"list-container\">\n {React.Children.map(children, (child: React.ReactElement, childIndex) =>\n childIndex < children.length - 1\n ? cloneElement(child, {\n childIndex,\n addRef,\n onKeyDown,\n })\n : cloneElement(child, {\n childIndex,\n addRef,\n onKeyDown,\n trailingSlash,\n isTitle,\n }),\n )}\n </StyledList>\n </StyledContainer>\n );\n};\n\nDSBreadcrumb.Item = DSBreadcrumbItem;\n\nconst props = {\n /** props injected to breadcrumb wrapper */\n containerProps: PropTypes.object.description('props injected to breadcrumb wrapper'),\n /**\n * Type of element you want the main container to be:\n * 'nav', 'div', 'header', 'footer', 'main'\n */\n as: PropTypes.string.description(\n \"Type of element you want the main container to be: 'nav', 'div', 'header', 'footer', 'main'\",\n ),\n /**\n * Whether to show the last element of the breadcrumb as a title\n * Also removes trailing slash to show last element as title\n */\n isTitle: PropTypes.bool.description(\n 'Whether to show the last element of the breadcrumb as a title. Also removes trailing slash to show last element as title',\n ),\n /** breadcrumb label */\n label: PropTypes.string.description('breadcrumb label'),\n /**\n * Container items to wrap\n */\n children: PropTypes.arrayOf(PropTypes.element).isRequired.description('Container items to wrap'),\n};\n\nDSBreadcrumb.propTypes = props;\nDSBreadcrumb.displayName = 'DSBreadcrumb';\n\nconst DSBreadcrumbWithSchema = describe(DSBreadcrumb);\nDSBreadcrumbWithSchema.propTypes = props as WeakValidationMap<unknown>;\n\nexport { DSBreadcrumb, DSBreadcrumbWithSchema, htmlElements };\nexport default DSBreadcrumb;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC0BjB;AA1BN,OAAOA,UAAiC,cAAc,eAAe;AACrE,SAAS,WAAW,UAAU,oCAAoC;AAClE,OAAO,sBAAsB;AAC7B,SAAS,6BAA6B;AAEtC,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB,kBAAkB;AAE5C,MAAM,eAAe,CAAC,OAAO,OAAO,UAAU,UAAU,MAAM;AAE9D,MAAM,eAAe,CAACC,WAA+B;AACnD,QAAM,oBAAoB,6BAA0DA,QAAO,YAAY;AACvG,QAAM,EAAE,gBAAgB,IAAI,OAAO,eAAe,SAAS,UAAU,GAAG,KAAK,IAAI;AACjF,QAAM,CAAC,QAAQ,SAAS,IAAI,sBAAsB;AAElD,QAAM,cAAc,QAAQ,MAAO,aAAa,QAAQ,EAAE,IAAI,KAAK,KAAK,OAAQ,CAAC,EAAE,CAAC;AAEpF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAY;AAAA,MACZ,cAAY;AAAA,MACX,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,IAAI;AAAA,MAEJ,8BAAC,cAAW,cAAY,OAAO,eAAY,kBACxC,UAAAD,OAAM,SAAS;AAAA,QAAI;AAAA,QAAU,CAAC,OAA2B,eACxD,aAAa,SAAS,SAAS,IAC3B,aAAa,OAAO;AAAA,UAClB;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC,IACD,aAAa,OAAO;AAAA,UAClB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACP,GACF;AAAA;AAAA,EACF;AAEJ;AAEA,aAAa,OAAO;AAEpB,MAAM,QAAQ;AAAA;AAAA,EAEZ,gBAAgB,UAAU,OAAO,YAAY,sCAAsC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKnF,IAAI,UAAU,OAAO;AAAA,IACnB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS,UAAU,KAAK;AAAA,IACtB;AAAA,EACF;AAAA;AAAA,EAEA,OAAO,UAAU,OAAO,YAAY,kBAAkB;AAAA;AAAA;AAAA;AAAA,EAItD,UAAU,UAAU,QAAQ,UAAU,OAAO,EAAE,WAAW,YAAY,yBAAyB;AACjG;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAE3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;AAGnC,IAAO,uBAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { type WeakValidationMap, cloneElement, useMemo } from 'react';\nimport { PropTypes, describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport DSBreadcrumbItem from './DSBreadcrumbItem.js';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation.js';\nimport type { DSBreadcrumbT } from './react-desc-prop-types.js';\nimport { defaultProps } from './react-desc-prop-types.js';\n\nimport { StyledContainer, StyledList } from './styles.js';\n\nconst htmlElements = ['nav', 'div', 'header', 'footer', 'main'] as const;\n\nconst DSBreadcrumb = (props: DSBreadcrumbT.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSBreadcrumbT.InternalProps>(props, defaultProps);\n const { containerProps, as, label, trailingSlash, isTitle, children, ...rest } = propsWithDefaults;\n const [addRef, onKeyDown] = useKeyboardNavigation();\n\n const safeElement = useMemo(() => (htmlElements.indexOf(as) > -1 ? as : 'nav'), [as]);\n\n return (\n <StyledContainer\n data-testid=\"breadcrumb-nav-container\"\n aria-label={label}\n {...rest}\n {...containerProps}\n as={safeElement}\n >\n <StyledList aria-label={label} data-testid=\"list-container\">\n {React.Children.map(children, (child: React.ReactElement, childIndex) =>\n childIndex < children.length - 1\n ? cloneElement(child, {\n childIndex,\n addRef,\n onKeyDown,\n })\n : cloneElement(child, {\n childIndex,\n addRef,\n onKeyDown,\n trailingSlash,\n isTitle,\n }),\n )}\n </StyledList>\n </StyledContainer>\n );\n};\n\nDSBreadcrumb.Item = DSBreadcrumbItem;\n\nconst props = {\n /** props injected to breadcrumb wrapper */\n containerProps: PropTypes.object.description('props injected to breadcrumb wrapper'),\n /**\n * Type of element you want the main container to be:\n * 'nav', 'div', 'header', 'footer', 'main'\n */\n as: PropTypes.string.description(\n \"Type of element you want the main container to be: 'nav', 'div', 'header', 'footer', 'main'\",\n ),\n /**\n * Whether to show the last element of the breadcrumb as a title\n * Also removes trailing slash to show last element as title\n */\n isTitle: PropTypes.bool.description(\n 'Whether to show the last element of the breadcrumb as a title. Also removes trailing slash to show last element as title',\n ),\n /** breadcrumb label */\n label: PropTypes.string.description('breadcrumb label'),\n /**\n * Container items to wrap\n */\n children: PropTypes.arrayOf(PropTypes.element).isRequired.description('Container items to wrap'),\n};\n\nDSBreadcrumb.displayName = 'DSBreadcrumb';\nconst DSBreadcrumbWithSchema = describe(DSBreadcrumb);\nDSBreadcrumbWithSchema.propTypes = props as WeakValidationMap<unknown>;\n\nexport { DSBreadcrumb, DSBreadcrumbWithSchema, htmlElements };\nexport default DSBreadcrumb;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC0BjB;AA1BN,OAAOA,UAAiC,cAAc,eAAe;AACrE,SAAS,WAAW,UAAU,oCAAoC;AAClE,OAAO,sBAAsB;AAC7B,SAAS,6BAA6B;AAEtC,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB,kBAAkB;AAE5C,MAAM,eAAe,CAAC,OAAO,OAAO,UAAU,UAAU,MAAM;AAE9D,MAAM,eAAe,CAACC,WAA+B;AACnD,QAAM,oBAAoB,6BAA0DA,QAAO,YAAY;AACvG,QAAM,EAAE,gBAAgB,IAAI,OAAO,eAAe,SAAS,UAAU,GAAG,KAAK,IAAI;AACjF,QAAM,CAAC,QAAQ,SAAS,IAAI,sBAAsB;AAElD,QAAM,cAAc,QAAQ,MAAO,aAAa,QAAQ,EAAE,IAAI,KAAK,KAAK,OAAQ,CAAC,EAAE,CAAC;AAEpF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAY;AAAA,MACZ,cAAY;AAAA,MACX,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,IAAI;AAAA,MAEJ,8BAAC,cAAW,cAAY,OAAO,eAAY,kBACxC,UAAAD,OAAM,SAAS;AAAA,QAAI;AAAA,QAAU,CAAC,OAA2B,eACxD,aAAa,SAAS,SAAS,IAC3B,aAAa,OAAO;AAAA,UAClB;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC,IACD,aAAa,OAAO;AAAA,UAClB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AAAA,MACP,GACF;AAAA;AAAA,EACF;AAEJ;AAEA,aAAa,OAAO;AAEpB,MAAM,QAAQ;AAAA;AAAA,EAEZ,gBAAgB,UAAU,OAAO,YAAY,sCAAsC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKnF,IAAI,UAAU,OAAO;AAAA,IACnB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS,UAAU,KAAK;AAAA,IACtB;AAAA,EACF;AAAA;AAAA,EAEA,OAAO,UAAU,OAAO,YAAY,kBAAkB;AAAA;AAAA;AAAA;AAAA,EAItD,UAAU,UAAU,QAAQ,UAAU,OAAO,EAAE,WAAW,YAAY,yBAAyB;AACjG;AAEA,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AACpD,uBAAuB,YAAY;AAGnC,IAAO,uBAAQ;",
6
6
  "names": ["React", "props"]
7
7
  }
@@ -51,7 +51,6 @@ const props = {
51
51
  /** link color */
52
52
  color: PropTypes.string.description("link color")
53
53
  };
54
- DSBreadcrumbItem.propTypes = props;
55
54
  DSBreadcrumbItem.displayName = "DSBreadcrumbItem";
56
55
  const DSBreadcrumbItemWithSchema = describe(DSBreadcrumbItem);
57
56
  DSBreadcrumbItemWithSchema.propTypes = props;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSBreadcrumbItem.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { type WeakValidationMap } from 'react';\nimport { PropTypes, describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport type { DSBreadcrumbItemT } from './react-desc-prop-types.js';\nimport { defaultItemProps } from './react-desc-prop-types.js';\n\nimport { StyledLink, StyledCrumbWrapper } from './styles.js';\n\nconst DSBreadcrumbItem = (props: DSBreadcrumbItemT.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSBreadcrumbItemT.InternalProps>(props, defaultItemProps);\n const { as, active, href, onClick, onKeyDown, addRef, isTitle, trailingSlash, label, childIndex, color, ...rest } =\n propsWithDefaults;\n return (\n <StyledCrumbWrapper\n aria-current={active ? 'page' : undefined}\n data-testid=\"breadcrumb-item-container\"\n isTitle={isTitle}\n trailingSlash={trailingSlash}\n >\n <StyledLink\n variant=\"link\"\n component={as}\n href={href}\n onClick={onClick}\n tabIndex={0}\n active={active}\n onKeyDown={(e: React.KeyboardEvent) => onKeyDown(e, childIndex ?? -1, onClick)}\n isTitle={isTitle}\n color={color}\n innerRef={addRef}\n {...rest}\n >\n {label}\n </StyledLink>\n </StyledCrumbWrapper>\n );\n};\n\nconst props = {\n /** render as any html node */\n as: PropTypes.string.description('render as any html node'),\n /** active item */\n active: PropTypes.bool.description('active item'),\n /** href link */\n href: PropTypes.string.description('href link'),\n /** on click handler */\n onClick: PropTypes.func.description('on click handler'),\n /** style item as title */\n isTitle: PropTypes.bool.description('style item as title'),\n /** add trailing slash */\n trailingSlash: PropTypes.bool.description('add trailing slash'),\n /** item label */\n label: PropTypes.string.description('item label'),\n /** link color */\n color: PropTypes.string.description('link color'),\n};\n\nDSBreadcrumbItem.propTypes = props;\nDSBreadcrumbItem.displayName = 'DSBreadcrumbItem';\n\nconst DSBreadcrumbItemWithSchema = describe(DSBreadcrumbItem);\nDSBreadcrumbItemWithSchema.propTypes = props as WeakValidationMap<unknown>;\n\nexport { DSBreadcrumbItem, DSBreadcrumbItemWithSchema };\nexport default DSBreadcrumbItem;\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACkBjB;AAjBN,SAAS,WAAW,UAAU,oCAAoC;AAElE,SAAS,wBAAwB;AAEjC,SAAS,YAAY,0BAA0B;AAE/C,MAAM,mBAAmB,CAACA,WAAmC;AAC3D,QAAM,oBAAoB,6BAA8DA,QAAO,gBAAgB;AAC/G,QAAM,EAAE,IAAI,QAAQ,MAAM,SAAS,WAAW,QAAQ,SAAS,eAAe,OAAO,YAAY,OAAO,GAAG,KAAK,IAC9G;AACF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,gBAAc,SAAS,SAAS;AAAA,MAChC,eAAY;AAAA,MACZ;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,WAAW;AAAA,UACX;AAAA,UACA;AAAA,UACA,UAAU;AAAA,UACV;AAAA,UACA,WAAW,CAAC,MAA2B,UAAU,GAAG,cAAc,IAAI,OAAO;AAAA,UAC7E;AAAA,UACA;AAAA,UACA,UAAU;AAAA,UACT,GAAG;AAAA,UAEH;AAAA;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;AAEA,MAAM,QAAQ;AAAA;AAAA,EAEZ,IAAI,UAAU,OAAO,YAAY,yBAAyB;AAAA;AAAA,EAE1D,QAAQ,UAAU,KAAK,YAAY,aAAa;AAAA;AAAA,EAEhD,MAAM,UAAU,OAAO,YAAY,WAAW;AAAA;AAAA,EAE9C,SAAS,UAAU,KAAK,YAAY,kBAAkB;AAAA;AAAA,EAEtD,SAAS,UAAU,KAAK,YAAY,qBAAqB;AAAA;AAAA,EAEzD,eAAe,UAAU,KAAK,YAAY,oBAAoB;AAAA;AAAA,EAE9D,OAAO,UAAU,OAAO,YAAY,YAAY;AAAA;AAAA,EAEhD,OAAO,UAAU,OAAO,YAAY,YAAY;AAClD;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,cAAc;AAE/B,MAAM,6BAA6B,SAAS,gBAAgB;AAC5D,2BAA2B,YAAY;AAGvC,IAAO,2BAAQ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { type WeakValidationMap } from 'react';\nimport { PropTypes, describe, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport type { DSBreadcrumbItemT } from './react-desc-prop-types.js';\nimport { defaultItemProps } from './react-desc-prop-types.js';\n\nimport { StyledLink, StyledCrumbWrapper } from './styles.js';\n\nconst DSBreadcrumbItem = (props: DSBreadcrumbItemT.Props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSBreadcrumbItemT.InternalProps>(props, defaultItemProps);\n const { as, active, href, onClick, onKeyDown, addRef, isTitle, trailingSlash, label, childIndex, color, ...rest } =\n propsWithDefaults;\n return (\n <StyledCrumbWrapper\n aria-current={active ? 'page' : undefined}\n data-testid=\"breadcrumb-item-container\"\n isTitle={isTitle}\n trailingSlash={trailingSlash}\n >\n <StyledLink\n variant=\"link\"\n component={as}\n href={href}\n onClick={onClick}\n tabIndex={0}\n active={active}\n onKeyDown={(e: React.KeyboardEvent) => onKeyDown(e, childIndex ?? -1, onClick)}\n isTitle={isTitle}\n color={color}\n innerRef={addRef}\n {...rest}\n >\n {label}\n </StyledLink>\n </StyledCrumbWrapper>\n );\n};\n\nconst props = {\n /** render as any html node */\n as: PropTypes.string.description('render as any html node'),\n /** active item */\n active: PropTypes.bool.description('active item'),\n /** href link */\n href: PropTypes.string.description('href link'),\n /** on click handler */\n onClick: PropTypes.func.description('on click handler'),\n /** style item as title */\n isTitle: PropTypes.bool.description('style item as title'),\n /** add trailing slash */\n trailingSlash: PropTypes.bool.description('add trailing slash'),\n /** item label */\n label: PropTypes.string.description('item label'),\n /** link color */\n color: PropTypes.string.description('link color'),\n};\n\nDSBreadcrumbItem.displayName = 'DSBreadcrumbItem';\nconst DSBreadcrumbItemWithSchema = describe(DSBreadcrumbItem);\nDSBreadcrumbItemWithSchema.propTypes = props as WeakValidationMap<unknown>;\n\nexport { DSBreadcrumbItem, DSBreadcrumbItemWithSchema };\nexport default DSBreadcrumbItem;\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkBjB;AAjBN,SAAS,WAAW,UAAU,oCAAoC;AAElE,SAAS,wBAAwB;AAEjC,SAAS,YAAY,0BAA0B;AAE/C,MAAM,mBAAmB,CAACA,WAAmC;AAC3D,QAAM,oBAAoB,6BAA8DA,QAAO,gBAAgB;AAC/G,QAAM,EAAE,IAAI,QAAQ,MAAM,SAAS,WAAW,QAAQ,SAAS,eAAe,OAAO,YAAY,OAAO,GAAG,KAAK,IAC9G;AACF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,gBAAc,SAAS,SAAS;AAAA,MAChC,eAAY;AAAA,MACZ;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,WAAW;AAAA,UACX;AAAA,UACA;AAAA,UACA,UAAU;AAAA,UACV;AAAA,UACA,WAAW,CAAC,MAA2B,UAAU,GAAG,cAAc,IAAI,OAAO;AAAA,UAC7E;AAAA,UACA;AAAA,UACA,UAAU;AAAA,UACT,GAAG;AAAA,UAEH;AAAA;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;AAEA,MAAM,QAAQ;AAAA;AAAA,EAEZ,IAAI,UAAU,OAAO,YAAY,yBAAyB;AAAA;AAAA,EAE1D,QAAQ,UAAU,KAAK,YAAY,aAAa;AAAA;AAAA,EAEhD,MAAM,UAAU,OAAO,YAAY,WAAW;AAAA;AAAA,EAE9C,SAAS,UAAU,KAAK,YAAY,kBAAkB;AAAA;AAAA,EAEtD,SAAS,UAAU,KAAK,YAAY,qBAAqB;AAAA;AAAA,EAEzD,eAAe,UAAU,KAAK,YAAY,oBAAoB;AAAA;AAAA,EAE9D,OAAO,UAAU,OAAO,YAAY,YAAY;AAAA;AAAA,EAEhD,OAAO,UAAU,OAAO,YAAY,YAAY;AAClD;AAEA,iBAAiB,cAAc;AAC/B,MAAM,6BAA6B,SAAS,gBAAgB;AAC5D,2BAA2B,YAAY;AAGvC,IAAO,2BAAQ;",
6
6
  "names": ["props"]
7
7
  }
@@ -2,12 +2,9 @@ import * as React from "react";
2
2
  import { styled } from "@elliemae/ds-system";
3
3
  import { DSTypography } from "@elliemae/ds-typography";
4
4
  const handleColor = (theme, isActive, color, isTitle) => {
5
- if (isActive)
6
- return theme.colors.neutral[800];
7
- if (color)
8
- return color;
9
- if (isTitle)
10
- return theme.colors.neutral[700];
5
+ if (isActive) return theme.colors.neutral[800];
6
+ if (color) return color;
7
+ if (isTitle) return theme.colors.neutral[700];
11
8
  return theme.colors.brand[600];
12
9
  };
13
10
  const StyledList = styled.ol`
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/styles.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport type { Theme } from '@elliemae/pui-theme';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport type { DSBreadcrumbItemT } from './react-desc-prop-types.js';\n\nconst handleColor = (theme: Theme, isActive: boolean, color: string, isTitle: boolean): string => {\n if (isActive) return theme.colors.neutral[800];\n if (color) return color;\n if (isTitle) return theme.colors.neutral[700];\n return theme.colors.brand[600];\n};\n\nconst StyledList = styled.ol`\n width: 100%;\n list-style: none;\n display: flex;\n padding: 0;\n margin: 0;\n li:first-child * {\n margin-left: 0;\n }\n`;\n\nconst StyledCrumbWrapper = styled.li<Partial<DSBreadcrumbItemT.Props>>`\n display: inline-flex;\n align-items: center;\n flex-shrink: 20;\n transition: flex-shrink 0.1s cubic-bezier(0.64, 0, 0.35, 1);\n min-height: 1.231rem;\n min-width: 10px;\n &:hover {\n flex-shrink: 0;\n }\n ${({ theme, isTitle, trailingSlash }) =>\n isTitle || !trailingSlash\n ? `&:not(:last-child):after {\n display: inline-block;\n content: '/';\n color: ${theme.colors.neutral[700]};\n }\n `\n : `&:after {\n display: inline-block;\n content: '/';\n color: ${theme.colors.neutral[700]};\n }\n `}\n`;\n\nconst StyledContainer = styled.nav`\n display: flex;\n align-items: center;\n padding: 0;\n`;\n\nconst StyledLink = styled(DSTypography)<Partial<DSBreadcrumbItemT.Props>>`\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-decoration: none;\n outline: none;\n margin: 0 2px;\n border: 2px solid transparent;\n -webkit-text-stroke: 0.4px transparent;\n line-height: 20px;\n background: transparent;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n color: ${({ theme, active, color = '', isTitle }) => handleColor(theme, !!active, color, !!isTitle)};\n &:hover {\n color: ${({ theme, color }) => color || theme.colors.brand[800]};\n cursor: pointer;\n ${({ theme, color }) => `-webkit-text-stroke: 0.4px ${color || theme.colors.brand[800]}`};\n }\n &:focus {\n ${({ theme }) => `border: 2px solid ${theme.colors.brand[700]};`}\n border-radius: 2px;\n }\n`;\n\nexport { StyledList, StyledCrumbWrapper, StyledContainer, StyledLink };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAG7B,MAAM,cAAc,CAAC,OAAc,UAAmB,OAAe,YAA6B;AAChG,MAAI;AAAU,WAAO,MAAM,OAAO,QAAQ,GAAG;AAC7C,MAAI;AAAO,WAAO;AAClB,MAAI;AAAS,WAAO,MAAM,OAAO,QAAQ,GAAG;AAC5C,SAAO,MAAM,OAAO,MAAM,GAAG;AAC/B;AAEA,MAAM,aAAa,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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;AAAA;AAAA;AAW1B,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAU9B,CAAC,EAAE,OAAO,SAAS,cAAc,MACjC,WAAW,CAAC,gBACR;AAAA;AAAA;AAAA,aAGK,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA,MAG9B;AAAA;AAAA;AAAA,aAGK,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA,GAEnC;AAAA;AAGH,MAAM,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAM/B,MAAM,aAAa,OAAO,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAWrB,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY,OAAO;AAAA,WAC9C,CAAC,EAAE,OAAO,QAAQ,QAAQ,IAAI,QAAQ,MAAM,YAAY,OAAO,CAAC,CAAC,QAAQ,OAAO,CAAC,CAAC,OAAO,CAAC;AAAA;AAAA,aAExF,CAAC,EAAE,OAAO,MAAM,MAAM,SAAS,MAAM,OAAO,MAAM,GAAG,CAAC;AAAA;AAAA,MAE7D,CAAC,EAAE,OAAO,MAAM,MAAM,8BAA8B,SAAS,MAAM,OAAO,MAAM,GAAG,CAAC,EAAE;AAAA;AAAA;AAAA,MAGtF,CAAC,EAAE,MAAM,MAAM,qBAAqB,MAAM,OAAO,MAAM,GAAG,CAAC,GAAG;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -4,38 +4,8 @@ declare const DSBreadcrumb: {
4
4
  (props: DSBreadcrumbT.Props): import("react/jsx-runtime.js").JSX.Element;
5
5
  Item: {
6
6
  (props: import("./react-desc-prop-types.js").DSBreadcrumbItemT.Props): import("react/jsx-runtime.js").JSX.Element;
7
- propTypes: {
8
- as: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
9
- active: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
10
- href: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
11
- onClick: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
12
- isTitle: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
13
- trailingSlash: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
14
- label: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
15
- color: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
16
- };
17
7
  displayName: string;
18
8
  };
19
- propTypes: {
20
- /** props injected to breadcrumb wrapper */
21
- containerProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
22
- /**
23
- * Type of element you want the main container to be:
24
- * 'nav', 'div', 'header', 'footer', 'main'
25
- */
26
- as: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
27
- /**
28
- * Whether to show the last element of the breadcrumb as a title
29
- * Also removes trailing slash to show last element as title
30
- */
31
- isTitle: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
32
- /** breadcrumb label */
33
- label: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
34
- /**
35
- * Container items to wrap
36
- */
37
- children: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
38
- };
39
9
  displayName: string;
40
10
  };
41
11
  declare const DSBreadcrumbWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSBreadcrumbT.Props>;
@@ -1,24 +1,6 @@
1
1
  import type { DSBreadcrumbItemT } from './react-desc-prop-types.js';
2
2
  declare const DSBreadcrumbItem: {
3
3
  (props: DSBreadcrumbItemT.Props): import("react/jsx-runtime.js").JSX.Element;
4
- propTypes: {
5
- /** render as any html node */
6
- as: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
7
- /** active item */
8
- active: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
9
- /** href link */
10
- href: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
11
- /** on click handler */
12
- onClick: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
13
- /** style item as title */
14
- isTitle: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
15
- /** add trailing slash */
16
- trailingSlash: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
17
- /** item label */
18
- label: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
19
- /** link color */
20
- color: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").ReactDescT;
21
- };
22
4
  displayName: string;
23
5
  };
24
6
  declare const DSBreadcrumbItemWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSBreadcrumbItemT.Props>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-breadcrumb",
3
- "version": "3.35.0",
3
+ "version": "3.36.0-next.1",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Breadcrumb",
6
6
  "files": [
@@ -52,15 +52,15 @@
52
52
  "indent": 4
53
53
  },
54
54
  "dependencies": {
55
- "@elliemae/ds-props-helpers": "3.35.0",
56
- "@elliemae/ds-system": "3.35.0",
57
- "@elliemae/ds-typography": "3.35.0"
55
+ "@elliemae/ds-props-helpers": "3.36.0-next.1",
56
+ "@elliemae/ds-system": "3.36.0-next.1",
57
+ "@elliemae/ds-typography": "3.36.0-next.1"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@elliemae/pui-cli": "~9.0.0-next.31",
61
61
  "@elliemae/pui-theme": "~2.9.3",
62
62
  "styled-components": "~5.3.9",
63
- "@elliemae/ds-monorepo-devops": "3.35.0"
63
+ "@elliemae/ds-monorepo-devops": "3.36.0-next.1"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "@elliemae/pui-theme": "~2.9.3",