@elliemae/ds-breadcrumb 3.3.0-next.3 → 3.3.0-next.6

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.
@@ -1,39 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __objRest = (source, exclude) => {
26
- var target = {};
27
- for (var prop in source)
28
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
- target[prop] = source[prop];
30
- if (source != null && __getOwnPropSymbols)
31
- for (var prop of __getOwnPropSymbols(source)) {
32
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
- target[prop] = source[prop];
34
- }
35
- return target;
36
- };
37
8
  var __export = (target, all) => {
38
9
  for (var name in all)
39
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -63,30 +34,24 @@ var import_DSBreadcrumbItem = __toESM(require("./DSBreadcrumbItem"));
63
34
  var import_useKeyboardNavigation = require("./hooks/useKeyboardNavigation");
64
35
  var import_styles = require("./styles");
65
36
  const htmlElements = ["nav", "div", "header", "footer", "main"];
66
- const DSBreadcrumb = (_a) => {
67
- var _b = _a, {
68
- containerProps = {},
69
- as = "nav",
70
- label = "Breadcrumb",
71
- isTitle = false,
72
- children,
73
- trailingSlash = true
74
- } = _b, rest = __objRest(_b, [
75
- "containerProps",
76
- "as",
77
- "label",
78
- "isTitle",
79
- "children",
80
- "trailingSlash"
81
- ]);
37
+ const DSBreadcrumb = ({
38
+ containerProps = {},
39
+ as = "nav",
40
+ label = "Breadcrumb",
41
+ isTitle = false,
42
+ children,
43
+ trailingSlash = true,
44
+ ...rest
45
+ }) => {
82
46
  const [addRef, onKeyDown] = (0, import_useKeyboardNavigation.useKeyboardNavigation)();
83
47
  const safeElement = (0, import_react.useMemo)(() => htmlElements.indexOf(as) > -1 ? as : "nav", [as]);
84
- return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledContainer, __spreadProps(__spreadValues(__spreadValues({
48
+ return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledContainer, {
85
49
  "aria-label": label,
86
- "data-testid": "breadcrumb-nav-container"
87
- }, rest), containerProps), {
50
+ "data-testid": "breadcrumb-nav-container",
51
+ ...rest,
52
+ ...containerProps,
88
53
  as: safeElement
89
- }), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledList, {
54
+ }, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledList, {
90
55
  "data-testid": "list-container"
91
56
  }, import_react.default.Children.map(children, (child, childIndex) => childIndex < children.length - 1 ? (0, import_react.cloneElement)(child, {
92
57
  childIndex,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSBreadcrumb.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React, { cloneElement, useMemo } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport DSBreadcrumbItem from './DSBreadcrumbItem';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\nimport type { DSBreadcrumbPropsT } from './index.d';\nimport { StyledContainer, StyledList } from './styles';\n\nconst htmlElements = ['nav', 'div', 'header', 'footer', 'main'] as const;\n\nconst DSBreadcrumb = ({\n containerProps = {},\n as = 'nav',\n label = 'Breadcrumb',\n isTitle = false,\n children,\n trailingSlash = true,\n ...rest\n}: DSBreadcrumbPropsT): React.ReactElement => {\n const [addRef, onKeyDown] = useKeyboardNavigation();\n\n const safeElement = useMemo(() => (htmlElements.indexOf(as) > -1 ? as : 'nav'), [as]);\n\n return (\n <StyledContainer\n aria-label={label}\n data-testid=\"breadcrumb-nav-container\"\n {...rest}\n {...containerProps}\n as={safeElement}\n >\n <StyledList 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(\n 'Container items to wrap',\n ),\n};\n\nDSBreadcrumb.propTypes = props;\nDSBreadcrumb.displayName = 'DSBreadcrumb';\n\nconst DSBreadcrumbWithSchema = describe(DSBreadcrumb);\nDSBreadcrumbWithSchema.propTypes = props;\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;ADAvB,mBAA6C;AAC7C,0BAAoC;AACpC,8BAA6B;AAC7B,mCAAsC;AAEtC,oBAA4C;AAE5C,MAAM,eAAe,CAAC,OAAO,OAAO,UAAU,UAAU,MAAM;AAE9D,MAAM,eAAe,CAAC,OAQwB;AARxB,eACpB;AAAA,qBAAiB,CAAC;AAAA,IAClB,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,UAAU;AAAA,IACV;AAAA,IACA,gBAAgB;AAAA,MANI,IAOjB,iBAPiB,IAOjB;AAAA,IANH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,CAAC,QAAQ,aAAa,wDAAsB;AAElD,QAAM,cAAc,0BAAQ,MAAO,aAAa,QAAQ,EAAE,IAAI,KAAK,KAAK,OAAQ,CAAC,EAAE,CAAC;AAEpF,SACE,mDAAC;AAAA,IACC,cAAY;AAAA,IACZ,eAAY;AAAA,KACR,OACA,iBAJL;AAAA,IAKC,IAAI;AAAA,MAEJ,mDAAC;AAAA,IAAW,eAAY;AAAA,KACrB,qBAAM,SAAS,IAAI,UAAU,CAAC,OAA2B,eACxD,aAAa,SAAS,SAAS,IAC3B,+BAAa,OAAO;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,IACD,+BAAa,OAAO;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,CACP,CACF,CACF;AAEJ;AAEA,aAAa,OAAO;AAEpB,MAA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,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,CACP,CACF,CACF;AAEJ;AAEA,aAAa,OAAO;AAEpB,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,8BAAU,OAAO,YAAY,sCAAsC;AAAA,EAKnF,IAAI,8BAAU,OAAO,YACnB,6FACF;AAAA,EAKA,SAAS,8BAAU,KAAK,YACtB,0HACF;AAAA,EAEA,OAAO,8BAAU,OAAO,YAAY,kBAAkB;AAAA,EAItD,UAAU,8BAAU,QAAQ,8BAAU,OAAO,EAAE,WAAW,YACxD,yBACF;AACF;AAEA,aAAa,YAAY;AACzB,aAAa,cAAc;AAE3B,MAAM,yBAAyB,kCAAS,YAAY;AACpD,uBAAuB,YAAY;AAGnC,IAAO,uBAAQ;",
6
6
  "names": []
7
7
  }
@@ -3,34 +3,8 @@ var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
6
  var __getProtoOf = Object.getPrototypeOf;
8
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
- var __spreadValues = (a, b) => {
12
- for (var prop in b || (b = {}))
13
- if (__hasOwnProp.call(b, prop))
14
- __defNormalProp(a, prop, b[prop]);
15
- if (__getOwnPropSymbols)
16
- for (var prop of __getOwnPropSymbols(b)) {
17
- if (__propIsEnum.call(b, prop))
18
- __defNormalProp(a, prop, b[prop]);
19
- }
20
- return a;
21
- };
22
- var __objRest = (source, exclude) => {
23
- var target = {};
24
- for (var prop in source)
25
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
26
- target[prop] = source[prop];
27
- if (source != null && __getOwnPropSymbols)
28
- for (var prop of __getOwnPropSymbols(source)) {
29
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
30
- target[prop] = source[prop];
31
- }
32
- return target;
33
- };
34
8
  var __export = (target, all) => {
35
9
  for (var name in all)
36
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -56,38 +30,27 @@ var React = __toESM(require("react"));
56
30
  var import_react = __toESM(require("react"));
57
31
  var import_ds_utilities = require("@elliemae/ds-utilities");
58
32
  var import_styles = require("./styles");
59
- function DSBreadcrumbItem(_a) {
60
- var _b = _a, {
61
- active = false,
62
- as = "a",
63
- href = void 0,
64
- isTitle,
65
- onClick = () => null,
66
- label = "",
67
- color = null,
68
- addRef,
69
- childIndex,
70
- trailingSlash,
71
- onKeyDown = () => null
72
- } = _b, rest = __objRest(_b, [
73
- "active",
74
- "as",
75
- "href",
76
- "isTitle",
77
- "onClick",
78
- "label",
79
- "color",
80
- "addRef",
81
- "childIndex",
82
- "trailingSlash",
83
- "onKeyDown"
84
- ]);
85
- return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledCrumbWrapper, __spreadValues({
33
+ function DSBreadcrumbItem({
34
+ active = false,
35
+ as = "a",
36
+ href = void 0,
37
+ isTitle,
38
+ onClick = () => null,
39
+ label = "",
40
+ color = null,
41
+ addRef,
42
+ childIndex,
43
+ trailingSlash,
44
+ onKeyDown = () => null,
45
+ ...rest
46
+ }) {
47
+ return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledCrumbWrapper, {
86
48
  "aria-current": active ? "page" : void 0,
87
49
  "data-testid": "breadcrumb-item-container",
88
50
  isTitle,
89
- trailingSlash
90
- }, rest), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledLink, {
51
+ trailingSlash,
52
+ ...rest
53
+ }, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledLink, {
91
54
  as,
92
55
  href,
93
56
  onClick,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/DSBreadcrumbItem.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport type { DSBreadcrumbItemPropsT } from './index.d';\nimport { StyledLink, StyledCrumbWrapper } from './styles';\n\nfunction DSBreadcrumbItem({\n active = false,\n as = 'a',\n href = undefined,\n isTitle,\n onClick = () => null,\n label = '',\n color = null,\n addRef,\n childIndex,\n trailingSlash,\n onKeyDown = () => null,\n ...rest\n}: DSBreadcrumbItemPropsT): React.ReactElement {\n return (\n <StyledCrumbWrapper\n aria-current={active ? 'page' : undefined}\n data-testid=\"breadcrumb-item-container\"\n isTitle={isTitle}\n trailingSlash={trailingSlash}\n {...rest}\n >\n <StyledLink\n as={as}\n href={href}\n onClick={onClick}\n ref={addRef}\n tabIndex={0}\n isActive={active}\n onKeyDown={(e: React.KeyboardEvent) =>\n onKeyDown(e, childIndex, onClick)\n }\n isTitle={isTitle}\n color={color}\n >\n {label}\n </StyledLink>\n </StyledCrumbWrapper>\n );\n}\n\nconst props = {\n /** inject props to wrapper */\n containerComponent: PropTypes.string.description('inject props to wrapper'),\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;\n\nexport { DSBreadcrumbItem, DSBreadcrumbItemWithSchema };\nexport default DSBreadcrumbItem;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings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EAEhD,OAAO,8BAAU,OAAO,YAAY,YAAY;AAClD;AAEA,iBAAiB,YAAY;AAC7B,iBAAiB,cAAc;AAE/B,MAAM,6BAA6B,kCAAS,gBAAgB;AAC5D,2BAA2B,YAAY;AAGvC,IAAO,2BAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,35 +1,4 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
10
- for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- }
18
- return a;
19
- };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
- var __objRest = (source, exclude) => {
22
- var target = {};
23
- for (var prop in source)
24
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
- target[prop] = source[prop];
26
- if (source != null && __getOwnPropSymbols)
27
- for (var prop of __getOwnPropSymbols(source)) {
28
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
- target[prop] = source[prop];
30
- }
31
- return target;
32
- };
33
2
  import * as React from "react";
34
3
  import React2, { cloneElement, useMemo } from "react";
35
4
  import { PropTypes, describe } from "@elliemae/ds-utilities";
@@ -37,30 +6,24 @@ import DSBreadcrumbItem from "./DSBreadcrumbItem";
37
6
  import { useKeyboardNavigation } from "./hooks/useKeyboardNavigation";
38
7
  import { StyledContainer, StyledList } from "./styles";
39
8
  const htmlElements = ["nav", "div", "header", "footer", "main"];
40
- const DSBreadcrumb = (_a) => {
41
- var _b = _a, {
42
- containerProps = {},
43
- as = "nav",
44
- label = "Breadcrumb",
45
- isTitle = false,
46
- children,
47
- trailingSlash = true
48
- } = _b, rest = __objRest(_b, [
49
- "containerProps",
50
- "as",
51
- "label",
52
- "isTitle",
53
- "children",
54
- "trailingSlash"
55
- ]);
9
+ const DSBreadcrumb = ({
10
+ containerProps = {},
11
+ as = "nav",
12
+ label = "Breadcrumb",
13
+ isTitle = false,
14
+ children,
15
+ trailingSlash = true,
16
+ ...rest
17
+ }) => {
56
18
  const [addRef, onKeyDown] = useKeyboardNavigation();
57
19
  const safeElement = useMemo(() => htmlElements.indexOf(as) > -1 ? as : "nav", [as]);
58
- return /* @__PURE__ */ React2.createElement(StyledContainer, __spreadProps(__spreadValues(__spreadValues({
20
+ return /* @__PURE__ */ React2.createElement(StyledContainer, {
59
21
  "aria-label": label,
60
- "data-testid": "breadcrumb-nav-container"
61
- }, rest), containerProps), {
22
+ "data-testid": "breadcrumb-nav-container",
23
+ ...rest,
24
+ ...containerProps,
62
25
  as: safeElement
63
- }), /* @__PURE__ */ React2.createElement(StyledList, {
26
+ }, /* @__PURE__ */ React2.createElement(StyledList, {
64
27
  "data-testid": "list-container"
65
28
  }, React2.Children.map(children, (child, childIndex) => childIndex < children.length - 1 ? cloneElement(child, {
66
29
  childIndex,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSBreadcrumb.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { cloneElement, useMemo } from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport DSBreadcrumbItem from './DSBreadcrumbItem';\nimport { useKeyboardNavigation } from './hooks/useKeyboardNavigation';\nimport type { DSBreadcrumbPropsT } from './index.d';\nimport { StyledContainer, StyledList } from './styles';\n\nconst htmlElements = ['nav', 'div', 'header', 'footer', 'main'] as const;\n\nconst DSBreadcrumb = ({\n containerProps = {},\n as = 'nav',\n label = 'Breadcrumb',\n isTitle = false,\n children,\n trailingSlash = true,\n ...rest\n}: DSBreadcrumbPropsT): React.ReactElement => {\n const [addRef, onKeyDown] = useKeyboardNavigation();\n\n const safeElement = useMemo(() => (htmlElements.indexOf(as) > -1 ? as : 'nav'), [as]);\n\n return (\n <StyledContainer\n aria-label={label}\n data-testid=\"breadcrumb-nav-container\"\n {...rest}\n {...containerProps}\n as={safeElement}\n >\n <StyledList 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(\n 'Container items to wrap',\n ),\n};\n\nDSBreadcrumb.propTypes = props;\nDSBreadcrumb.displayName = 'DSBreadcrumb';\n\nconst DSBreadcrumbWithSchema = describe(DSBreadcrumb);\nDSBreadcrumbWithSchema.propTypes = props;\n\nexport { DSBreadcrumb, DSBreadcrumbWithSchema, htmlElements };\nexport default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yB,SAAS,YAAY;AACpD,uBAAuB,YAAY;AAGnC,IAAO,uBAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,68 +1,29 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
6
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
- var __spreadValues = (a, b) => {
8
- for (var prop in b || (b = {}))
9
- if (__hasOwnProp.call(b, prop))
10
- __defNormalProp(a, prop, b[prop]);
11
- if (__getOwnPropSymbols)
12
- for (var prop of __getOwnPropSymbols(b)) {
13
- if (__propIsEnum.call(b, prop))
14
- __defNormalProp(a, prop, b[prop]);
15
- }
16
- return a;
17
- };
18
- var __objRest = (source, exclude) => {
19
- var target = {};
20
- for (var prop in source)
21
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
22
- target[prop] = source[prop];
23
- if (source != null && __getOwnPropSymbols)
24
- for (var prop of __getOwnPropSymbols(source)) {
25
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
26
- target[prop] = source[prop];
27
- }
28
- return target;
29
- };
30
2
  import * as React from "react";
31
3
  import React2 from "react";
32
4
  import { PropTypes, describe } from "@elliemae/ds-utilities";
33
5
  import { StyledLink, StyledCrumbWrapper } from "./styles";
34
- function DSBreadcrumbItem(_a) {
35
- var _b = _a, {
36
- active = false,
37
- as = "a",
38
- href = void 0,
39
- isTitle,
40
- onClick = () => null,
41
- label = "",
42
- color = null,
43
- addRef,
44
- childIndex,
45
- trailingSlash,
46
- onKeyDown = () => null
47
- } = _b, rest = __objRest(_b, [
48
- "active",
49
- "as",
50
- "href",
51
- "isTitle",
52
- "onClick",
53
- "label",
54
- "color",
55
- "addRef",
56
- "childIndex",
57
- "trailingSlash",
58
- "onKeyDown"
59
- ]);
60
- return /* @__PURE__ */ React2.createElement(StyledCrumbWrapper, __spreadValues({
6
+ function DSBreadcrumbItem({
7
+ active = false,
8
+ as = "a",
9
+ href = void 0,
10
+ isTitle,
11
+ onClick = () => null,
12
+ label = "",
13
+ color = null,
14
+ addRef,
15
+ childIndex,
16
+ trailingSlash,
17
+ onKeyDown = () => null,
18
+ ...rest
19
+ }) {
20
+ return /* @__PURE__ */ React2.createElement(StyledCrumbWrapper, {
61
21
  "aria-current": active ? "page" : void 0,
62
22
  "data-testid": "breadcrumb-item-container",
63
23
  isTitle,
64
- trailingSlash
65
- }, rest), /* @__PURE__ */ React2.createElement(StyledLink, {
24
+ trailingSlash,
25
+ ...rest
26
+ }, /* @__PURE__ */ React2.createElement(StyledLink, {
66
27
  as,
67
28
  href,
68
29
  onClick,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSBreadcrumbItem.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from '@elliemae/ds-utilities';\nimport type { DSBreadcrumbItemPropsT } from './index.d';\nimport { StyledLink, StyledCrumbWrapper } from './styles';\n\nfunction DSBreadcrumbItem({\n active = false,\n as = 'a',\n href = undefined,\n isTitle,\n onClick = () => null,\n label = '',\n color = null,\n addRef,\n childIndex,\n trailingSlash,\n onKeyDown = () => null,\n ...rest\n}: DSBreadcrumbItemPropsT): React.ReactElement {\n return (\n <StyledCrumbWrapper\n aria-current={active ? 'page' : undefined}\n data-testid=\"breadcrumb-item-container\"\n isTitle={isTitle}\n trailingSlash={trailingSlash}\n {...rest}\n >\n <StyledLink\n as={as}\n href={href}\n onClick={onClick}\n ref={addRef}\n tabIndex={0}\n isActive={active}\n onKeyDown={(e: React.KeyboardEvent) =>\n onKeyDown(e, childIndex, onClick)\n }\n isTitle={isTitle}\n color={color}\n >\n {label}\n </StyledLink>\n </StyledCrumbWrapper>\n );\n}\n\nconst props = {\n /** inject props to wrapper */\n containerComponent: PropTypes.string.description('inject props to wrapper'),\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;\n\nexport { DSBreadcrumbItem, DSBreadcrumbItemWithSchema };\nexport default DSBreadcrumbItem;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AAEA;AAEA,0BAA0B,IAaqB;AAbrB,eACxB;AAAA,aAAS;AAAA,IACT,KAAK;AAAA,IACL,OAAO;AAAA,IACP;AAAA,IACA,UAAU,MAAM;AAAA,IAChB,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,MAAM;AAAA,MAXM,IAYrB,iBAZqB,IAYrB;AAAA,IAXH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,SACE,qCAAC;AAAA,IACC,gBAAc,SAAS,SAAS;AAAA,IAChC,eAAY;AAAA,IACZ;AAAA,IACA;AAAA,KACI,OAEJ,qCAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW,CAAC,MACV,UAAU,GAA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U,OAAO,YAAY,yBAAyB;AAAA,EAE1E,IAAI,UAAU,OAAO,YAAY,yBAAyB;AAAA,EAE1D,QAAQ,UAAU,KAAK,YAAY,aAAa;AAAA,EAEhD,MAAM,UAAU,OAAO,YAAY,WAAW;AAAA,EAE9C,SAAS,UAAU,KAAK,YAAY,kBAAkB;AAAA,EAEtD,SAAS,UAAU,KAAK,YAAY,qBAAqB;AAAA,EAEzD,eAAe,UAAU,KAAK,YAAY,oBAAoB;AAAA,EAE9D,OAAO,UAAU,OAAO,YAAY,YAAY;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;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-breadcrumb",
3
- "version": "3.3.0-next.3",
3
+ "version": "3.3.0-next.6",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Breadcrumb",
6
6
  "files": [
@@ -51,8 +51,8 @@
51
51
  "indent": 4
52
52
  },
53
53
  "dependencies": {
54
- "@elliemae/ds-system": "3.3.0-next.3",
55
- "@elliemae/ds-utilities": "3.3.0-next.3"
54
+ "@elliemae/ds-system": "3.3.0-next.6",
55
+ "@elliemae/ds-utilities": "3.3.0-next.6"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@elliemae/pui-theme": "~2.6.0",