@veritone-ce/design-system 1.12.34 → 1.12.35

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,13 +1,20 @@
1
1
  import { SxProps, Theme } from '@mui/material';
2
+ import React from 'react';
2
3
  export type BreadcrumbsProps = {
3
4
  'data-testid'?: string;
4
5
  links: {
5
- href: string;
6
- label: string;
6
+ to: string;
7
+ label: React.ReactNode;
7
8
  }[];
9
+ LinkComponent?: BreadcrumbsLinkComponent;
8
10
  sx?: SxProps<Theme>;
9
11
  className?: string;
10
12
  };
13
+ export type BreadcrumbsLinkComponentProps = {
14
+ to: string;
15
+ children?: React.ReactNode;
16
+ };
17
+ export type BreadcrumbsLinkComponent = React.ComponentType<BreadcrumbsLinkComponentProps>;
11
18
  /**
12
19
  * - This is the breadcrumbs component that is used in the header
13
20
  * - It takes in an array of links and renders them as breadcrumbs
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _material = require("@mui/material");
8
+ var _react = _interopRequireDefault(require("react"));
8
9
  var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
11
  /**
10
12
  * - This is the breadcrumbs component that is used in the header
11
13
  * - It takes in an array of links and renders them as breadcrumbs
@@ -14,6 +16,15 @@ var _jsxRuntime = require("react/jsx-runtime");
14
16
  **/
15
17
 
16
18
  var Breadcrumbs = function Breadcrumbs(props) {
19
+ var LinkComponent = _react["default"].useMemo(function () {
20
+ var _props$LinkComponent;
21
+ return (_props$LinkComponent = props.LinkComponent) !== null && _props$LinkComponent !== void 0 ? _props$LinkComponent : function (linkProps) {
22
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Link, {
23
+ href: linkProps.to,
24
+ children: linkProps.children
25
+ });
26
+ };
27
+ }, [props.LinkComponent]);
17
28
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Breadcrumbs, {
18
29
  "aria-label": "breadcrumbs",
19
30
  "data-testid": props['data-testid'],
@@ -33,10 +44,10 @@ var Breadcrumbs = function Breadcrumbs(props) {
33
44
  textTransform: 'uppercase'
34
45
  },
35
46
  children: link.label
36
- }, link.href);
47
+ }, link.to);
37
48
  } else {
38
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Link, {
39
- href: link.href,
49
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(LinkComponent, {
50
+ to: link.to,
40
51
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
41
52
  sx: {
42
53
  color: function color(theme) {
@@ -46,11 +57,12 @@ var Breadcrumbs = function Breadcrumbs(props) {
46
57
  fontStyle: 'normal',
47
58
  fontWeight: 600,
48
59
  fontSize: '18px',
49
- textTransform: 'uppercase'
60
+ textTransform: 'uppercase',
61
+ textDecoration: 'none'
50
62
  },
51
63
  children: link.label
52
64
  })
53
- }, link.href);
65
+ }, link.to);
54
66
  }
55
67
  })
56
68
  });
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export type { AlertProps } from './components/Alert';
5
5
  export { default as AudioSlider } from './components/AudioSlider';
6
6
  export type { AudioSliderProps } from './components/AudioSlider';
7
7
  export { default as Breadcrumbs } from './components/Breadcrumbs';
8
- export type { BreadcrumbsProps } from './components/Breadcrumbs';
8
+ export type { BreadcrumbsProps, BreadcrumbsLinkComponentProps, BreadcrumbsLinkComponent } from './components/Breadcrumbs';
9
9
  export { default as Button } from './components/Button';
10
10
  export type { ButtonProps } from './components/Button';
11
11
  export { default as Checkbox } from './components/Checkbox';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritone-ce/design-system",
3
- "version": "1.12.34",
3
+ "version": "1.12.35",
4
4
  "private": false,
5
5
  "description": "Design System for Veritone CE",
6
6
  "keywords": [