@elliemae/ds-breadcrumb 3.0.0-next.2 → 3.0.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.
- package/dist/cjs/DSBreadcrumb.js +121 -0
- package/dist/cjs/DSBreadcrumb.js.map +7 -0
- package/dist/cjs/DSBreadcrumbItem.js +123 -0
- package/dist/cjs/DSBreadcrumbItem.js.map +7 -0
- package/dist/cjs/hooks/useKeyboardNavigation.js +57 -0
- package/dist/cjs/hooks/useKeyboardNavigation.js.map +7 -0
- package/dist/cjs/index.d.js +27 -0
- package/dist/cjs/index.d.js.map +7 -0
- package/dist/cjs/index.js +37 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/styles.js +107 -0
- package/dist/cjs/styles.js.map +7 -0
- package/dist/esm/DSBreadcrumb.js +94 -0
- package/dist/esm/DSBreadcrumb.js.map +7 -0
- package/dist/esm/DSBreadcrumbItem.js +96 -0
- package/dist/esm/DSBreadcrumbItem.js.map +7 -0
- package/{esm → dist/esm}/hooks/useKeyboardNavigation.js +11 -9
- package/dist/esm/hooks/useKeyboardNavigation.js.map +7 -0
- package/dist/esm/index.d.js +2 -0
- package/dist/esm/index.d.js.map +7 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/styles.js +78 -0
- package/dist/esm/styles.js.map +7 -0
- package/package.json +35 -26
- package/cjs/DSBreadcrumb.js +0 -102
- package/cjs/DSBreadcrumbItem.js +0 -98
- package/cjs/hooks/useKeyboardNavigation.js +0 -30
- package/cjs/index.d.js +0 -2
- package/cjs/index.js +0 -15
- package/cjs/styles.js +0 -68
- package/esm/DSBreadcrumb.js +0 -88
- package/esm/DSBreadcrumbItem.js +0 -87
- package/esm/index.d.js +0 -1
- package/esm/index.js +0 -2
- package/esm/styles.js +0 -57
- package/types/DSBreadcrumb.d.ts +0 -56
- package/types/DSBreadcrumbItem.d.ts +0 -78
- package/types/hooks/useKeyboardNavigation.d.ts +0 -2
- package/types/index.d.d.ts +0 -27
- package/types/index.d.ts +0 -3
- package/types/styles.d.ts +0 -6
- package/types/tests/DSBreadcrumb.test.d.ts +0 -1
- package/types/tests/DSBreadcrumbItem.test.d.ts +0 -1
package/cjs/styles.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var styled = require('styled-components');
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
10
|
-
|
|
11
|
-
const handleColor = (theme, isActive, color, isTitle) => {
|
|
12
|
-
if (isActive) return theme.colors.neutral[800];else if (color) return color;else if (isTitle) return theme.colors.neutral[700];else return theme.colors.brand[600];
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const StyledList = /*#__PURE__*/styled__default["default"].ol.withConfig({
|
|
16
|
-
componentId: "sc-12gvmg4-0"
|
|
17
|
-
})(["width:100%;list-style:none;display:flex;padding:0;margin:0;li:first-child *{margin-left:0;}"]);
|
|
18
|
-
const StyledCrumbWrapper = /*#__PURE__*/styled__default["default"].li.withConfig({
|
|
19
|
-
componentId: "sc-12gvmg4-1"
|
|
20
|
-
})(["display:inline-flex;align-items:center;flex-shrink:20;transition:flex-shrink 0.1s cubic-bezier(0.64,0,0.35,1);height:16px;min-width:10px;&:hover{flex-shrink:0;}", ""], _ref => {
|
|
21
|
-
let {
|
|
22
|
-
theme,
|
|
23
|
-
isTitle,
|
|
24
|
-
trailingSlash
|
|
25
|
-
} = _ref;
|
|
26
|
-
return isTitle || !trailingSlash ? "&:not(:last-child):after {\n display: inline-block;\n content: '/';\n color: ".concat(theme.colors.neutral[700], ";\n }\n ") : "&:after {\n display: inline-block;\n content: '/';\n color: ".concat(theme.colors.neutral[700], ";\n }\n ");
|
|
27
|
-
});
|
|
28
|
-
const StyledContainer = /*#__PURE__*/styled__default["default"].nav.withConfig({
|
|
29
|
-
componentId: "sc-12gvmg4-2"
|
|
30
|
-
})(["display:flex;align-items:center;padding:0;"]);
|
|
31
|
-
const StyledLink = /*#__PURE__*/styled__default["default"].a.withConfig({
|
|
32
|
-
componentId: "sc-12gvmg4-3"
|
|
33
|
-
})(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-decoration:none;font-size:12px;outline:none;margin:0 2px;border:2px solid transparent;-webkit-text-stroke:0.4px transparent;font-weight:", ";color:", ";&:hover{color:", ";cursor:pointer;", ";}&:focus{", " border-radius:2px;}"], _ref2 => {
|
|
34
|
-
let {
|
|
35
|
-
theme
|
|
36
|
-
} = _ref2;
|
|
37
|
-
return theme.fontWeights.regular;
|
|
38
|
-
}, _ref3 => {
|
|
39
|
-
let {
|
|
40
|
-
theme,
|
|
41
|
-
isActive,
|
|
42
|
-
color,
|
|
43
|
-
isTitle
|
|
44
|
-
} = _ref3;
|
|
45
|
-
return handleColor(theme, isActive, color, isTitle);
|
|
46
|
-
}, _ref4 => {
|
|
47
|
-
let {
|
|
48
|
-
theme,
|
|
49
|
-
color
|
|
50
|
-
} = _ref4;
|
|
51
|
-
return color ? color : theme.colors.brand[800];
|
|
52
|
-
}, _ref5 => {
|
|
53
|
-
let {
|
|
54
|
-
theme,
|
|
55
|
-
color
|
|
56
|
-
} = _ref5;
|
|
57
|
-
return "-webkit-text-stroke: 0.4px ".concat(color ? color : theme.colors.brand[800]);
|
|
58
|
-
}, _ref6 => {
|
|
59
|
-
let {
|
|
60
|
-
theme
|
|
61
|
-
} = _ref6;
|
|
62
|
-
return "border: 2px solid ".concat(theme.colors.brand[700], ";");
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
exports.StyledContainer = StyledContainer;
|
|
66
|
-
exports.StyledCrumbWrapper = StyledCrumbWrapper;
|
|
67
|
-
exports.StyledLink = StyledLink;
|
|
68
|
-
exports.StyledList = StyledList;
|
package/esm/DSBreadcrumb.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
7
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
8
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
9
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
10
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
11
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
12
|
-
import React, { useMemo, cloneElement } from 'react';
|
|
13
|
-
import { PropTypes, describe } from 'react-desc';
|
|
14
|
-
import { DSBreadcrumbItem } from './DSBreadcrumbItem.js';
|
|
15
|
-
import { useKeyboardNavigation } from './hooks/useKeyboardNavigation.js';
|
|
16
|
-
import { StyledContainer, StyledList } from './styles.js';
|
|
17
|
-
import { jsx } from 'react/jsx-runtime';
|
|
18
|
-
|
|
19
|
-
const _excluded = ["containerProps", "as", "label", "isTitle", "children", "trailingSlash"];
|
|
20
|
-
|
|
21
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
-
|
|
23
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
|
-
const htmlElements = ['nav', 'div', 'header', 'footer', 'main'];
|
|
25
|
-
|
|
26
|
-
const DSBreadcrumb = _ref => {
|
|
27
|
-
let {
|
|
28
|
-
containerProps = {},
|
|
29
|
-
as = 'nav',
|
|
30
|
-
label = 'Breadcrumb',
|
|
31
|
-
isTitle = false,
|
|
32
|
-
children,
|
|
33
|
-
trailingSlash = true
|
|
34
|
-
} = _ref,
|
|
35
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
-
|
|
37
|
-
const [addRef, onKeyDown] = useKeyboardNavigation();
|
|
38
|
-
const safeElement = useMemo(() => htmlElements.indexOf(as) > -1 ? as : 'nav', [as]);
|
|
39
|
-
return /*#__PURE__*/jsx(StyledContainer, _objectSpread(_objectSpread(_objectSpread({
|
|
40
|
-
"aria-label": label,
|
|
41
|
-
"data-testid": "breadcrumb-nav-container"
|
|
42
|
-
}, rest), containerProps), {}, {
|
|
43
|
-
as: safeElement,
|
|
44
|
-
children: /*#__PURE__*/_jsx(StyledList, {
|
|
45
|
-
"data-testid": "list-container"
|
|
46
|
-
}, void 0, React.Children.map(children, (child, childIndex) => childIndex < children.length - 1 ? /*#__PURE__*/cloneElement(child, {
|
|
47
|
-
childIndex,
|
|
48
|
-
addRef,
|
|
49
|
-
onKeyDown
|
|
50
|
-
}) : /*#__PURE__*/cloneElement(child, {
|
|
51
|
-
childIndex,
|
|
52
|
-
addRef,
|
|
53
|
-
onKeyDown,
|
|
54
|
-
trailingSlash,
|
|
55
|
-
isTitle
|
|
56
|
-
})))
|
|
57
|
-
}));
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
DSBreadcrumb.Item = DSBreadcrumbItem;
|
|
61
|
-
const props = {
|
|
62
|
-
/** props injected to breadcrumb wrapper */
|
|
63
|
-
containerProps: PropTypes.object.description('props injected to breadcrumb wrapper'),
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Type of element you want the main container to be:
|
|
67
|
-
* 'nav', 'div', 'header', 'footer', 'main'
|
|
68
|
-
*/
|
|
69
|
-
as: PropTypes.string.description("Type of element you want the main container to be: 'nav', 'div', 'header', 'footer', 'main'"),
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Whether to show the last element of the breadcrumb as a title
|
|
73
|
-
* Also removes trailing slash to show last element as title
|
|
74
|
-
*/
|
|
75
|
-
isTitle: PropTypes.bool.description('Whether to show the last element of the breadcrumb as a title. Also removes trailing slash to show last element as title'),
|
|
76
|
-
|
|
77
|
-
/** breadcrumb label */
|
|
78
|
-
label: PropTypes.string.description('breadcrumb label'),
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Container items to wrap
|
|
82
|
-
*/
|
|
83
|
-
children: PropTypes.arrayOf(DSBreadcrumbItem).isRequired.description('Container items to wrap')
|
|
84
|
-
};
|
|
85
|
-
const DSBreadcrumbWithSchema = describe(DSBreadcrumb);
|
|
86
|
-
DSBreadcrumbWithSchema.propTypes = props;
|
|
87
|
-
|
|
88
|
-
export { DSBreadcrumb, DSBreadcrumbWithSchema, DSBreadcrumb as default, htmlElements };
|
package/esm/DSBreadcrumbItem.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
8
|
-
import 'react';
|
|
9
|
-
import { PropTypes, describe } from 'react-desc';
|
|
10
|
-
import { StyledCrumbWrapper, StyledLink } from './styles.js';
|
|
11
|
-
import { jsx } from 'react/jsx-runtime';
|
|
12
|
-
|
|
13
|
-
const _excluded = ["active", "as", "href", "isTitle", "onClick", "label", "color", "addRef", "childIndex", "trailingSlash", "onKeyDown"];
|
|
14
|
-
|
|
15
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
16
|
-
|
|
17
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18
|
-
|
|
19
|
-
function DSBreadcrumbItem(_ref) {
|
|
20
|
-
let {
|
|
21
|
-
active = false,
|
|
22
|
-
as = 'a',
|
|
23
|
-
href = undefined,
|
|
24
|
-
isTitle,
|
|
25
|
-
onClick = () => null,
|
|
26
|
-
label = '',
|
|
27
|
-
color = null,
|
|
28
|
-
addRef,
|
|
29
|
-
childIndex,
|
|
30
|
-
trailingSlash,
|
|
31
|
-
onKeyDown = () => null
|
|
32
|
-
} = _ref,
|
|
33
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
|
-
|
|
35
|
-
return /*#__PURE__*/jsx(StyledCrumbWrapper, _objectSpread(_objectSpread({
|
|
36
|
-
"aria-current": active ? 'page' : undefined,
|
|
37
|
-
"data-testid": "breadcrumb-item-container",
|
|
38
|
-
isTitle: isTitle,
|
|
39
|
-
trailingSlash: trailingSlash
|
|
40
|
-
}, rest), {}, {
|
|
41
|
-
children: /*#__PURE__*/jsx(StyledLink, {
|
|
42
|
-
as: as,
|
|
43
|
-
href: href,
|
|
44
|
-
onClick: onClick,
|
|
45
|
-
ref: addRef,
|
|
46
|
-
tabIndex: 0,
|
|
47
|
-
isActive: active,
|
|
48
|
-
onKeyDown: e => onKeyDown(e, childIndex, onClick),
|
|
49
|
-
isTitle: isTitle,
|
|
50
|
-
color: color,
|
|
51
|
-
children: label
|
|
52
|
-
})
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const props = {
|
|
57
|
-
/** inject props to wrapper */
|
|
58
|
-
containerComponent: PropTypes.string.description('inject props to wrapper'),
|
|
59
|
-
|
|
60
|
-
/** render as any html node */
|
|
61
|
-
as: PropTypes.string.description('render as any html node'),
|
|
62
|
-
|
|
63
|
-
/** active item */
|
|
64
|
-
active: PropTypes.bool.description('active item'),
|
|
65
|
-
|
|
66
|
-
/** href link */
|
|
67
|
-
href: PropTypes.string.description('href link'),
|
|
68
|
-
|
|
69
|
-
/** on click handler */
|
|
70
|
-
onClick: PropTypes.func.description('on click handler'),
|
|
71
|
-
|
|
72
|
-
/** style item as title */
|
|
73
|
-
isTitle: PropTypes.bool.description('style item as title'),
|
|
74
|
-
|
|
75
|
-
/** add trailing slash */
|
|
76
|
-
trailingSlash: PropTypes.bool.description('add trailing slash'),
|
|
77
|
-
|
|
78
|
-
/** item label */
|
|
79
|
-
label: PropTypes.string.description('item label'),
|
|
80
|
-
|
|
81
|
-
/** link color */
|
|
82
|
-
color: PropTypes.string.description('link color')
|
|
83
|
-
};
|
|
84
|
-
const DSBreadcrumbItemWithSchema = describe(DSBreadcrumbItem);
|
|
85
|
-
DSBreadcrumbItemWithSchema.propTypes = props;
|
|
86
|
-
|
|
87
|
-
export { DSBreadcrumbItem, DSBreadcrumbItemWithSchema, DSBreadcrumbItem as default };
|
package/esm/index.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
package/esm/index.js
DELETED
package/esm/styles.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
|
|
3
|
-
const handleColor = (theme, isActive, color, isTitle) => {
|
|
4
|
-
if (isActive) return theme.colors.neutral[800];else if (color) return color;else if (isTitle) return theme.colors.neutral[700];else return theme.colors.brand[600];
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
const StyledList = /*#__PURE__*/styled.ol.withConfig({
|
|
8
|
-
componentId: "sc-12gvmg4-0"
|
|
9
|
-
})(["width:100%;list-style:none;display:flex;padding:0;margin:0;li:first-child *{margin-left:0;}"]);
|
|
10
|
-
const StyledCrumbWrapper = /*#__PURE__*/styled.li.withConfig({
|
|
11
|
-
componentId: "sc-12gvmg4-1"
|
|
12
|
-
})(["display:inline-flex;align-items:center;flex-shrink:20;transition:flex-shrink 0.1s cubic-bezier(0.64,0,0.35,1);height:16px;min-width:10px;&:hover{flex-shrink:0;}", ""], _ref => {
|
|
13
|
-
let {
|
|
14
|
-
theme,
|
|
15
|
-
isTitle,
|
|
16
|
-
trailingSlash
|
|
17
|
-
} = _ref;
|
|
18
|
-
return isTitle || !trailingSlash ? "&:not(:last-child):after {\n display: inline-block;\n content: '/';\n color: ".concat(theme.colors.neutral[700], ";\n }\n ") : "&:after {\n display: inline-block;\n content: '/';\n color: ".concat(theme.colors.neutral[700], ";\n }\n ");
|
|
19
|
-
});
|
|
20
|
-
const StyledContainer = /*#__PURE__*/styled.nav.withConfig({
|
|
21
|
-
componentId: "sc-12gvmg4-2"
|
|
22
|
-
})(["display:flex;align-items:center;padding:0;"]);
|
|
23
|
-
const StyledLink = /*#__PURE__*/styled.a.withConfig({
|
|
24
|
-
componentId: "sc-12gvmg4-3"
|
|
25
|
-
})(["white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-decoration:none;font-size:12px;outline:none;margin:0 2px;border:2px solid transparent;-webkit-text-stroke:0.4px transparent;font-weight:", ";color:", ";&:hover{color:", ";cursor:pointer;", ";}&:focus{", " border-radius:2px;}"], _ref2 => {
|
|
26
|
-
let {
|
|
27
|
-
theme
|
|
28
|
-
} = _ref2;
|
|
29
|
-
return theme.fontWeights.regular;
|
|
30
|
-
}, _ref3 => {
|
|
31
|
-
let {
|
|
32
|
-
theme,
|
|
33
|
-
isActive,
|
|
34
|
-
color,
|
|
35
|
-
isTitle
|
|
36
|
-
} = _ref3;
|
|
37
|
-
return handleColor(theme, isActive, color, isTitle);
|
|
38
|
-
}, _ref4 => {
|
|
39
|
-
let {
|
|
40
|
-
theme,
|
|
41
|
-
color
|
|
42
|
-
} = _ref4;
|
|
43
|
-
return color ? color : theme.colors.brand[800];
|
|
44
|
-
}, _ref5 => {
|
|
45
|
-
let {
|
|
46
|
-
theme,
|
|
47
|
-
color
|
|
48
|
-
} = _ref5;
|
|
49
|
-
return "-webkit-text-stroke: 0.4px ".concat(color ? color : theme.colors.brand[800]);
|
|
50
|
-
}, _ref6 => {
|
|
51
|
-
let {
|
|
52
|
-
theme
|
|
53
|
-
} = _ref6;
|
|
54
|
-
return "border: 2px solid ".concat(theme.colors.brand[700], ";");
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
export { StyledContainer, StyledCrumbWrapper, StyledLink, StyledList };
|
package/types/DSBreadcrumb.d.ts
DELETED
|
@@ -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?: DSBreadcrumbPropsT | undefined): 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?: DSBreadcrumbItemPropsT | undefined): JSX.Element;
|
|
74
|
-
propTypes: unknown;
|
|
75
|
-
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
76
|
-
};
|
|
77
|
-
export { DSBreadcrumbItem, DSBreadcrumbItemWithSchema };
|
|
78
|
-
export default DSBreadcrumbItem;
|
package/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/types/index.d.ts
DELETED
package/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 {};
|