@elliemae/ds-breadcrumb 3.0.0-alpha.0 → 3.0.0-alpha.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.
- package/dist/cjs/DSBreadcrumb.js +49 -14
- package/dist/cjs/DSBreadcrumb.js.map +1 -1
- package/dist/cjs/DSBreadcrumbItem.js +55 -18
- package/dist/cjs/DSBreadcrumbItem.js.map +1 -1
- package/dist/esm/DSBreadcrumb.js +51 -14
- package/dist/esm/DSBreadcrumb.js.map +1 -1
- package/dist/esm/DSBreadcrumbItem.js +57 -18
- package/dist/esm/DSBreadcrumbItem.js.map +1 -1
- package/package.json +3 -2
- package/dist/types/DSBreadcrumb.d.ts +0 -56
- package/dist/types/DSBreadcrumbItem.d.ts +0 -78
- package/dist/types/hooks/useKeyboardNavigation.d.ts +0 -2
- package/dist/types/index.d.d.ts +0 -27
- package/dist/types/index.d.ts +0 -3
- package/dist/types/styles.d.ts +0 -6
- package/dist/types/tests/DSBreadcrumb.test.d.ts +0 -1
- package/dist/types/tests/DSBreadcrumbItem.test.d.ts +0 -1
package/dist/cjs/DSBreadcrumb.js
CHANGED
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
7
24
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
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
|
+
};
|
|
8
37
|
var __export = (target, all) => {
|
|
9
38
|
for (var name in all)
|
|
10
39
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -39,24 +68,30 @@ var import_DSBreadcrumbItem = __toESM(require("./DSBreadcrumbItem"));
|
|
|
39
68
|
var import_useKeyboardNavigation = require("./hooks/useKeyboardNavigation");
|
|
40
69
|
var import_styles = require("./styles");
|
|
41
70
|
const htmlElements = ["nav", "div", "header", "footer", "main"];
|
|
42
|
-
const DSBreadcrumb = ({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
71
|
+
const DSBreadcrumb = (_a) => {
|
|
72
|
+
var _b = _a, {
|
|
73
|
+
containerProps = {},
|
|
74
|
+
as = "nav",
|
|
75
|
+
label = "Breadcrumb",
|
|
76
|
+
isTitle = false,
|
|
77
|
+
children,
|
|
78
|
+
trailingSlash = true
|
|
79
|
+
} = _b, rest = __objRest(_b, [
|
|
80
|
+
"containerProps",
|
|
81
|
+
"as",
|
|
82
|
+
"label",
|
|
83
|
+
"isTitle",
|
|
84
|
+
"children",
|
|
85
|
+
"trailingSlash"
|
|
86
|
+
]);
|
|
51
87
|
const [addRef, onKeyDown] = (0, import_useKeyboardNavigation.useKeyboardNavigation)();
|
|
52
88
|
const safeElement = (0, import_react.useMemo)(() => htmlElements.indexOf(as) > -1 ? as : "nav", [as]);
|
|
53
|
-
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledContainer, {
|
|
89
|
+
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledContainer, __spreadProps(__spreadValues(__spreadValues({
|
|
54
90
|
"aria-label": label,
|
|
55
|
-
"data-testid": "breadcrumb-nav-container"
|
|
56
|
-
|
|
57
|
-
...containerProps,
|
|
91
|
+
"data-testid": "breadcrumb-nav-container"
|
|
92
|
+
}, rest), containerProps), {
|
|
58
93
|
as: safeElement
|
|
59
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledList, {
|
|
94
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledList, {
|
|
60
95
|
"data-testid": "list-container"
|
|
61
96
|
}, import_react.default.Children.map(children, (child, childIndex) => childIndex < children.length - 1 ? (0, import_react.cloneElement)(child, {
|
|
62
97
|
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 'react-desc';\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(\n () => (htmlElements.indexOf(as) > -1 ? as : 'nav'),\n [as],\n );\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(\n 'props injected to breadcrumb wrapper',\n ),\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(DSBreadcrumbItem).isRequired.description(\n 'Container items to wrap',\n ),\n};\n\nDSBreadcrumb.propTypes = props;\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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA6C;AAC7C,wBAAoC;AACpC,8BAA6B;AAC7B,mCAAsC;AAEtC,oBAA4C;AAE5C,MAAM,eAAe,CAAC,OAAO,OAAO,UAAU,UAAU;AAExD,MAAM,eAAe,CAAC,OAQwB;AARxB,eACpB;AAAA,qBAAiB;AAAA,IACjB,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;AAE5B,QAAM,cAAc,0BAClB,MAAO,aAAa,QAAQ,MAAM,KAAK,KAAK,OAC5C,CAAC;AAGH,SACE,mDAAC,+BAAD;AAAA,IACE,cAAY;AAAA,IACZ,eAAY;AAAA,KACR,OACA,iBAJN;AAAA,IAKE,IAAI;AAAA,MAEJ,mDAAC,0BAAD;AAAA,IAAY,eAAY;AAAA,KACrB,qBAAM,SAAS,IAAI,UAAU,CAAC,OAA2B,eACxD,aAAa,SAAS,SAAS,IAC3B,+BAAa,OAAO;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,OAEF,+BAAa,OAAO;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAQhB,aAAa,OAAO;AAEpB,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,4BAAU,OAAO,YAC/B;AAAA,EAMF,IAAI,4BAAU,OAAO,YACnB;AAAA,EAMF,SAAS,4BAAU,KAAK,YACtB;AAAA,EAGF,OAAO,4BAAU,OAAO,YAAY;AAAA,EAIpC,UAAU,4BAAU,QAAQ,iCAAkB,WAAW,YACvD;AAAA;AAIJ,aAAa,YAAY;AAEzB,MAAM,yBAAyB,gCAAS;AACxC,uBAAuB,YAAY;AAGnC,IAAO,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,9 +2,35 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
7
21
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
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
|
+
};
|
|
8
34
|
var __export = (target, all) => {
|
|
9
35
|
for (var name in all)
|
|
10
36
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -35,27 +61,38 @@ var React = __toESM(require("react"));
|
|
|
35
61
|
var import_react = __toESM(require("react"));
|
|
36
62
|
var import_react_desc = require("react-desc");
|
|
37
63
|
var import_styles = require("./styles");
|
|
38
|
-
function DSBreadcrumbItem({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
64
|
+
function DSBreadcrumbItem(_a) {
|
|
65
|
+
var _b = _a, {
|
|
66
|
+
active = false,
|
|
67
|
+
as = "a",
|
|
68
|
+
href = void 0,
|
|
69
|
+
isTitle,
|
|
70
|
+
onClick = () => null,
|
|
71
|
+
label = "",
|
|
72
|
+
color = null,
|
|
73
|
+
addRef,
|
|
74
|
+
childIndex,
|
|
75
|
+
trailingSlash,
|
|
76
|
+
onKeyDown = () => null
|
|
77
|
+
} = _b, rest = __objRest(_b, [
|
|
78
|
+
"active",
|
|
79
|
+
"as",
|
|
80
|
+
"href",
|
|
81
|
+
"isTitle",
|
|
82
|
+
"onClick",
|
|
83
|
+
"label",
|
|
84
|
+
"color",
|
|
85
|
+
"addRef",
|
|
86
|
+
"childIndex",
|
|
87
|
+
"trailingSlash",
|
|
88
|
+
"onKeyDown"
|
|
89
|
+
]);
|
|
90
|
+
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledCrumbWrapper, __spreadValues({
|
|
53
91
|
"aria-current": active ? "page" : void 0,
|
|
54
92
|
"data-testid": "breadcrumb-item-container",
|
|
55
93
|
isTitle,
|
|
56
|
-
trailingSlash
|
|
57
|
-
|
|
58
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledLink, {
|
|
94
|
+
trailingSlash
|
|
95
|
+
}, rest), /* @__PURE__ */ import_react.default.createElement(import_styles.StyledLink, {
|
|
59
96
|
as,
|
|
60
97
|
href,
|
|
61
98
|
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 'react-desc';\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;\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": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,wBAAoC;AAEpC,oBAA+C;AAE/C,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,mDAAC,kCAAD;AAAA,IACE,gBAAc,SAAS,SAAS;AAAA,IAChC,eAAY;AAAA,IACZ;AAAA,IACA;AAAA,KACI,OAEJ,mDAAC,0BAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW,CAAC,MACV,UAAU,GAAG,YAAY;AAAA,IAE3B;AAAA,IACA;AAAA,KAEC;AAAA;AAMT,MAAM,QAAQ;AAAA,EAEZ,oBAAoB,4BAAU,OAAO,YAAY;AAAA,EAEjD,IAAI,4BAAU,OAAO,YAAY;AAAA,EAEjC,QAAQ,4BAAU,KAAK,YAAY;AAAA,EAEnC,MAAM,4BAAU,OAAO,YAAY;AAAA,EAEnC,SAAS,4BAAU,KAAK,YAAY;AAAA,EAEpC,SAAS,4BAAU,KAAK,YAAY;AAAA,EAEpC,eAAe,4BAAU,KAAK,YAAY;AAAA,EAE1C,OAAO,4BAAU,OAAO,YAAY;AAAA,EAEpC,OAAO,4BAAU,OAAO,YAAY;AAAA;AAGtC,iBAAiB,YAAY;AAE7B,MAAM,6BAA6B,gCAAS;AAC5C,2BAA2B,YAAY;AAGvC,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/DSBreadcrumb.js
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
1
32
|
import * as React from "react";
|
|
2
33
|
import React2, { cloneElement, useMemo } from "react";
|
|
3
34
|
import { PropTypes, describe } from "react-desc";
|
|
@@ -5,24 +36,30 @@ import DSBreadcrumbItem from "./DSBreadcrumbItem";
|
|
|
5
36
|
import { useKeyboardNavigation } from "./hooks/useKeyboardNavigation";
|
|
6
37
|
import { StyledContainer, StyledList } from "./styles";
|
|
7
38
|
const htmlElements = ["nav", "div", "header", "footer", "main"];
|
|
8
|
-
const DSBreadcrumb = ({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
39
|
+
const DSBreadcrumb = (_a) => {
|
|
40
|
+
var _b = _a, {
|
|
41
|
+
containerProps = {},
|
|
42
|
+
as = "nav",
|
|
43
|
+
label = "Breadcrumb",
|
|
44
|
+
isTitle = false,
|
|
45
|
+
children,
|
|
46
|
+
trailingSlash = true
|
|
47
|
+
} = _b, rest = __objRest(_b, [
|
|
48
|
+
"containerProps",
|
|
49
|
+
"as",
|
|
50
|
+
"label",
|
|
51
|
+
"isTitle",
|
|
52
|
+
"children",
|
|
53
|
+
"trailingSlash"
|
|
54
|
+
]);
|
|
17
55
|
const [addRef, onKeyDown] = useKeyboardNavigation();
|
|
18
56
|
const safeElement = useMemo(() => htmlElements.indexOf(as) > -1 ? as : "nav", [as]);
|
|
19
|
-
return /* @__PURE__ */ React2.createElement(StyledContainer, {
|
|
57
|
+
return /* @__PURE__ */ React2.createElement(StyledContainer, __spreadProps(__spreadValues(__spreadValues({
|
|
20
58
|
"aria-label": label,
|
|
21
|
-
"data-testid": "breadcrumb-nav-container"
|
|
22
|
-
|
|
23
|
-
...containerProps,
|
|
59
|
+
"data-testid": "breadcrumb-nav-container"
|
|
60
|
+
}, rest), containerProps), {
|
|
24
61
|
as: safeElement
|
|
25
|
-
}, /* @__PURE__ */ React2.createElement(StyledList, {
|
|
62
|
+
}), /* @__PURE__ */ React2.createElement(StyledList, {
|
|
26
63
|
"data-testid": "list-container"
|
|
27
64
|
}, React2.Children.map(children, (child, childIndex) => childIndex < children.length - 1 ? cloneElement(child, {
|
|
28
65
|
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 'react-desc';\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(\n () => (htmlElements.indexOf(as) > -1 ? as : 'nav'),\n [as],\n );\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(\n 'props injected to breadcrumb wrapper',\n ),\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(DSBreadcrumbItem).isRequired.description(\n 'Container items to wrap',\n ),\n};\n\nDSBreadcrumb.propTypes = props;\n\nconst DSBreadcrumbWithSchema = describe(DSBreadcrumb);\nDSBreadcrumbWithSchema.propTypes = props;\n\nexport { DSBreadcrumb, DSBreadcrumbWithSchema, htmlElements };\nexport default DSBreadcrumb;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA;AAEA,MAAM,eAAe,CAAC,OAAO,OAAO,UAAU,UAAU;AAExD,MAAM,eAAe,CAAC;AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AAEA;AAEA,MAAM,eAAe,CAAC,OAAO,OAAO,UAAU,UAAU;AAExD,MAAM,eAAe,CAAC,OAQwB;AARxB,eACpB;AAAA,qBAAiB;AAAA,IACjB,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;AAE5B,QAAM,cAAc,QAClB,MAAO,aAAa,QAAQ,MAAM,KAAK,KAAK,OAC5C,CAAC;AAGH,SACE,qCAAC,iBAAD;AAAA,IACE,cAAY;AAAA,IACZ,eAAY;AAAA,KACR,OACA,iBAJN;AAAA,IAKE,IAAI;AAAA,MAEJ,qCAAC,YAAD;AAAA,IAAY,eAAY;AAAA,KACrB,OAAM,SAAS,IAAI,UAAU,CAAC,OAA2B,eACxD,aAAa,SAAS,SAAS,IAC3B,aAAa,OAAO;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,OAEF,aAAa,OAAO;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAQhB,aAAa,OAAO;AAEpB,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,UAAU,OAAO,YAC/B;AAAA,EAMF,IAAI,UAAU,OAAO,YACnB;AAAA,EAMF,SAAS,UAAU,KAAK,YACtB;AAAA,EAGF,OAAO,UAAU,OAAO,YAAY;AAAA,EAIpC,UAAU,UAAU,QAAQ,kBAAkB,WAAW,YACvD;AAAA;AAIJ,aAAa,YAAY;AAEzB,MAAM,yBAAyB,SAAS;AACxC,uBAAuB,YAAY;AAGnC,IAAO,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,28 +1,67 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __objRest = (source, exclude) => {
|
|
18
|
+
var target = {};
|
|
19
|
+
for (var prop in source)
|
|
20
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
21
|
+
target[prop] = source[prop];
|
|
22
|
+
if (source != null && __getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
24
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
1
29
|
import * as React from "react";
|
|
2
30
|
import React2 from "react";
|
|
3
31
|
import { PropTypes, describe } from "react-desc";
|
|
4
32
|
import { StyledLink, StyledCrumbWrapper } from "./styles";
|
|
5
|
-
function DSBreadcrumbItem({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
33
|
+
function DSBreadcrumbItem(_a) {
|
|
34
|
+
var _b = _a, {
|
|
35
|
+
active = false,
|
|
36
|
+
as = "a",
|
|
37
|
+
href = void 0,
|
|
38
|
+
isTitle,
|
|
39
|
+
onClick = () => null,
|
|
40
|
+
label = "",
|
|
41
|
+
color = null,
|
|
42
|
+
addRef,
|
|
43
|
+
childIndex,
|
|
44
|
+
trailingSlash,
|
|
45
|
+
onKeyDown = () => null
|
|
46
|
+
} = _b, rest = __objRest(_b, [
|
|
47
|
+
"active",
|
|
48
|
+
"as",
|
|
49
|
+
"href",
|
|
50
|
+
"isTitle",
|
|
51
|
+
"onClick",
|
|
52
|
+
"label",
|
|
53
|
+
"color",
|
|
54
|
+
"addRef",
|
|
55
|
+
"childIndex",
|
|
56
|
+
"trailingSlash",
|
|
57
|
+
"onKeyDown"
|
|
58
|
+
]);
|
|
59
|
+
return /* @__PURE__ */ React2.createElement(StyledCrumbWrapper, __spreadValues({
|
|
20
60
|
"aria-current": active ? "page" : void 0,
|
|
21
61
|
"data-testid": "breadcrumb-item-container",
|
|
22
62
|
isTitle,
|
|
23
|
-
trailingSlash
|
|
24
|
-
|
|
25
|
-
}, /* @__PURE__ */ React2.createElement(StyledLink, {
|
|
63
|
+
trailingSlash
|
|
64
|
+
}, rest), /* @__PURE__ */ React2.createElement(StyledLink, {
|
|
26
65
|
as,
|
|
27
66
|
href,
|
|
28
67
|
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 'react-desc';\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;\n\nconst DSBreadcrumbItemWithSchema = describe(DSBreadcrumbItem);\nDSBreadcrumbItemWithSchema.propTypes = props;\n\nexport { DSBreadcrumbItem, DSBreadcrumbItemWithSchema };\nexport default DSBreadcrumbItem;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAEA;AAEA,0BAA0B;AAAA,
|
|
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,oBAAD;AAAA,IACE,gBAAc,SAAS,SAAS;AAAA,IAChC,eAAY;AAAA,IACZ;AAAA,IACA;AAAA,KACI,OAEJ,qCAAC,YAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW,CAAC,MACV,UAAU,GAAG,YAAY;AAAA,IAE3B;AAAA,IACA;AAAA,KAEC;AAAA;AAMT,MAAM,QAAQ;AAAA,EAEZ,oBAAoB,UAAU,OAAO,YAAY;AAAA,EAEjD,IAAI,UAAU,OAAO,YAAY;AAAA,EAEjC,QAAQ,UAAU,KAAK,YAAY;AAAA,EAEnC,MAAM,UAAU,OAAO,YAAY;AAAA,EAEnC,SAAS,UAAU,KAAK,YAAY;AAAA,EAEpC,SAAS,UAAU,KAAK,YAAY;AAAA,EAEpC,eAAe,UAAU,KAAK,YAAY;AAAA,EAE1C,OAAO,UAAU,OAAO,YAAY;AAAA,EAEpC,OAAO,UAAU,OAAO,YAAY;AAAA;AAGtC,iBAAiB,YAAY;AAE7B,MAAM,6BAA6B,SAAS;AAC5C,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.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Breadcrumb",
|
|
6
6
|
"files": [
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"indent": 4
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@elliemae/ds-system": "3.0.0-alpha.
|
|
54
|
+
"@elliemae/ds-system": "3.0.0-alpha.1",
|
|
55
55
|
"react-desc": "~4.1.3"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
76
76
|
"test": "node ../../scripts/testing/test.mjs",
|
|
77
77
|
"lint": "node ../../scripts/lint.mjs",
|
|
78
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
78
79
|
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
79
80
|
}
|
|
80
81
|
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import DSBreadcrumbItem from './DSBreadcrumbItem';
|
|
4
|
-
import type { DSBreadcrumbPropsT } from './index.d';
|
|
5
|
-
declare const htmlElements: readonly ["nav", "div", "header", "footer", "main"];
|
|
6
|
-
declare const DSBreadcrumb: {
|
|
7
|
-
({ containerProps, as, label, isTitle, children, trailingSlash, ...rest }: DSBreadcrumbPropsT): React.ReactElement;
|
|
8
|
-
Item: typeof DSBreadcrumbItem;
|
|
9
|
-
propTypes: {
|
|
10
|
-
/** props injected to breadcrumb wrapper */
|
|
11
|
-
containerProps: {
|
|
12
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
13
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
14
|
-
};
|
|
15
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Type of element you want the main container to be:
|
|
19
|
-
* 'nav', 'div', 'header', 'footer', 'main'
|
|
20
|
-
*/
|
|
21
|
-
as: {
|
|
22
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
23
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
24
|
-
};
|
|
25
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
26
|
-
};
|
|
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: {
|
|
32
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
33
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
34
|
-
};
|
|
35
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
36
|
-
};
|
|
37
|
-
/** breadcrumb label */
|
|
38
|
-
label: {
|
|
39
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
40
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
41
|
-
};
|
|
42
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Container items to wrap
|
|
46
|
-
*/
|
|
47
|
-
children: any;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
declare const DSBreadcrumbWithSchema: {
|
|
51
|
-
(props?: unknown): JSX.Element;
|
|
52
|
-
propTypes: unknown;
|
|
53
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
54
|
-
};
|
|
55
|
-
export { DSBreadcrumb, DSBreadcrumbWithSchema, htmlElements };
|
|
56
|
-
export default DSBreadcrumb;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { DSBreadcrumbItemPropsT } from './index.d';
|
|
4
|
-
declare function DSBreadcrumbItem({ active, as, href, isTitle, onClick, label, color, addRef, childIndex, trailingSlash, onKeyDown, ...rest }: DSBreadcrumbItemPropsT): React.ReactElement;
|
|
5
|
-
declare namespace DSBreadcrumbItem {
|
|
6
|
-
var propTypes: {
|
|
7
|
-
/** inject props to wrapper */
|
|
8
|
-
containerComponent: {
|
|
9
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
10
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
11
|
-
};
|
|
12
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
13
|
-
};
|
|
14
|
-
/** render as any html node */
|
|
15
|
-
as: {
|
|
16
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
17
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
18
|
-
};
|
|
19
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
20
|
-
};
|
|
21
|
-
/** active item */
|
|
22
|
-
active: {
|
|
23
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
24
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
25
|
-
};
|
|
26
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
27
|
-
};
|
|
28
|
-
/** href link */
|
|
29
|
-
href: {
|
|
30
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
31
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
32
|
-
};
|
|
33
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
34
|
-
};
|
|
35
|
-
/** on click handler */
|
|
36
|
-
onClick: {
|
|
37
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
38
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
39
|
-
};
|
|
40
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
41
|
-
};
|
|
42
|
-
/** style item as title */
|
|
43
|
-
isTitle: {
|
|
44
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
45
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
46
|
-
};
|
|
47
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
48
|
-
};
|
|
49
|
-
/** add trailing slash */
|
|
50
|
-
trailingSlash: {
|
|
51
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
52
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
53
|
-
};
|
|
54
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
55
|
-
};
|
|
56
|
-
/** item label */
|
|
57
|
-
label: {
|
|
58
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
59
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
60
|
-
};
|
|
61
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
62
|
-
};
|
|
63
|
-
/** link color */
|
|
64
|
-
color: {
|
|
65
|
-
defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
|
|
66
|
-
deprecated: import("react-desc").PropTypesDescValidator;
|
|
67
|
-
};
|
|
68
|
-
isRequired: import("react-desc").PropTypesDescValue;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
declare const DSBreadcrumbItemWithSchema: {
|
|
73
|
-
(props?: unknown): JSX.Element;
|
|
74
|
-
propTypes: unknown;
|
|
75
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
76
|
-
};
|
|
77
|
-
export { DSBreadcrumbItem, DSBreadcrumbItemWithSchema };
|
|
78
|
-
export default DSBreadcrumbItem;
|
package/dist/types/index.d.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { htmlElements } from './DSBreadcrumb';
|
|
3
|
-
declare type SafeComponentsT = typeof htmlElements[number];
|
|
4
|
-
declare type SafeItemComponentT = 'a' | 'button' | 'div' | 'span' | 'p';
|
|
5
|
-
interface DSBreadcrumbPropsT {
|
|
6
|
-
containerProps?: unknown;
|
|
7
|
-
as?: SafeComponentsT;
|
|
8
|
-
label?: string;
|
|
9
|
-
isTitle?: boolean;
|
|
10
|
-
trailingSlash?: boolean;
|
|
11
|
-
children: React.ReactElement[];
|
|
12
|
-
}
|
|
13
|
-
interface DSBreadcrumbItemPropsT {
|
|
14
|
-
active?: boolean;
|
|
15
|
-
isActive?: boolean;
|
|
16
|
-
as?: SafeItemComponentT;
|
|
17
|
-
href?: string;
|
|
18
|
-
isTitle?: boolean;
|
|
19
|
-
trailingSlash?: boolean;
|
|
20
|
-
addRef: (ref: HTMLElement) => void;
|
|
21
|
-
onKeyDown: (e: React.KeyboardEvent, componentRefIndex: number, onClick: () => void) => void;
|
|
22
|
-
onClick?: () => void;
|
|
23
|
-
label?: string;
|
|
24
|
-
childIndex: number;
|
|
25
|
-
color?: string | null;
|
|
26
|
-
}
|
|
27
|
-
export { DSBreadcrumbPropsT, DSBreadcrumbItemPropsT, SafeComponentsT, SafeItemComponentT, };
|
package/dist/types/index.d.ts
DELETED
package/dist/types/styles.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { DSBreadcrumbItemPropsT } from './index.d';
|
|
2
|
-
declare const StyledList: import("styled-components").StyledComponent<"ol", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
-
declare const StyledCrumbWrapper: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, Partial<DSBreadcrumbItemPropsT>, never>;
|
|
4
|
-
declare const StyledContainer: import("styled-components").StyledComponent<"nav", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
-
declare const StyledLink: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme, Partial<DSBreadcrumbItemPropsT>, never>;
|
|
6
|
-
export { StyledList, StyledCrumbWrapper, StyledContainer, StyledLink };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|