@synerise/ds-cascader 1.1.25 → 1.1.27

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -2
  3. package/dist/Cascader.d.ts +2 -2
  4. package/dist/Cascader.js +85 -143
  5. package/dist/Cascader.styles.d.ts +6 -6
  6. package/dist/Cascader.styles.js +19 -17
  7. package/dist/Cascader.types.d.ts +1 -1
  8. package/dist/Cascader.types.js +1 -1
  9. package/dist/Elements/BackAction/BackAction.d.ts +2 -2
  10. package/dist/Elements/BackAction/BackAction.js +18 -16
  11. package/dist/Elements/BackAction/BackAction.styles.d.ts +4 -4
  12. package/dist/Elements/BackAction/BackAction.styles.js +15 -17
  13. package/dist/Elements/BackAction/BackAction.types.d.ts +1 -1
  14. package/dist/Elements/BackAction/BackAction.types.js +1 -1
  15. package/dist/Elements/BottomAction/BottomAction.d.ts +2 -2
  16. package/dist/Elements/BottomAction/BottomAction.js +14 -13
  17. package/dist/Elements/BottomAction/BottomAction.styles.d.ts +3 -3
  18. package/dist/Elements/BottomAction/BottomAction.styles.js +11 -14
  19. package/dist/Elements/BottomAction/BottomAction.types.d.ts +1 -1
  20. package/dist/Elements/BottomAction/BottomAction.types.js +1 -1
  21. package/dist/Elements/Breadcrumb/Breadcrumb.d.ts +2 -2
  22. package/dist/Elements/Breadcrumb/Breadcrumb.js +47 -73
  23. package/dist/Elements/Breadcrumb/Breadcrumb.styles.d.ts +13 -13
  24. package/dist/Elements/Breadcrumb/Breadcrumb.styles.js +36 -46
  25. package/dist/Elements/Breadcrumb/Breadcrumb.types.d.ts +2 -2
  26. package/dist/Elements/Breadcrumb/Breadcrumb.types.js +1 -1
  27. package/dist/Elements/Breadcrumb/utils.d.ts +1 -1
  28. package/dist/Elements/Breadcrumb/utils.js +15 -9
  29. package/dist/Elements/BreadcrumbsList/BreadcrumbsList.d.ts +4 -4
  30. package/dist/Elements/BreadcrumbsList/BreadcrumbsList.js +28 -35
  31. package/dist/Elements/BreadcrumbsList/BreadcrumbsList.types.d.ts +2 -2
  32. package/dist/Elements/BreadcrumbsList/BreadcrumbsList.types.js +1 -1
  33. package/dist/Elements/CategoriesList/CategoriesList.d.ts +2 -2
  34. package/dist/Elements/CategoriesList/CategoriesList.js +26 -49
  35. package/dist/Elements/CategoriesList/CategoriesList.types.d.ts +2 -2
  36. package/dist/Elements/CategoriesList/CategoriesList.types.js +1 -1
  37. package/dist/Elements/Navigation/Navigation.d.ts +2 -2
  38. package/dist/Elements/Navigation/Navigation.js +32 -40
  39. package/dist/Elements/Navigation/Navigation.types.d.ts +1 -1
  40. package/dist/Elements/Navigation/Navigation.types.js +1 -1
  41. package/dist/index.js +6 -2
  42. package/dist/modules.d.js +1 -1
  43. package/dist/modules.d.ts +0 -0
  44. package/dist/utils.d.ts +1 -1
  45. package/dist/utils.js +37 -43
  46. package/package.json +13 -13
@@ -1,81 +1,55 @@
1
- var _excluded = ["path", "disabled", "highlight", "description", "onPathClick", "compact", "startWithArrow", "gradientOverlap", "highlightActivePath", "className", "prefixel", "isNavigation"];
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
- import React, { useEffect, useMemo, useRef, useState } from 'react';
5
- import { theme } from '@synerise/ds-core';
6
- import Icon, { AngleRightS } from '@synerise/ds-icon';
7
- import { renderWithHighlight } from '@synerise/ds-utils';
8
- import * as S from './Breadcrumb.styles';
9
- import { attachActiveClassName, isOverflown, shouldHaveArrowPlaceholder, shouldRenderArrow } from './utils';
10
- export var Breadcrumb = function Breadcrumb(_ref) {
11
- var path = _ref.path,
12
- disabled = _ref.disabled,
13
- highlight = _ref.highlight,
14
- description = _ref.description,
15
- onPathClick = _ref.onPathClick,
16
- compact = _ref.compact,
17
- startWithArrow = _ref.startWithArrow,
18
- gradientOverlap = _ref.gradientOverlap,
19
- highlightActivePath = _ref.highlightActivePath,
20
- className = _ref.className,
21
- prefixel = _ref.prefixel,
22
- isNavigation = _ref.isNavigation,
23
- rest = _objectWithoutPropertiesLoose(_ref, _excluded);
24
- var pathToDisplay = useMemo(function () {
25
- var breadcrumbsArray = [].concat(path);
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useRef, useState, useEffect } from "react";
3
+ import { theme } from "@synerise/ds-core";
4
+ import Icon, { AngleRightS } from "@synerise/ds-icon";
5
+ import { renderWithHighlight } from "@synerise/ds-utils";
6
+ import { Breadcrumb as Breadcrumb$1, OuterWrapper, PrefixWrapper, InnerWrapper, Description, ContentWrapper, BreadcrumbContent, BreadcrumbRoute, BreadcrumbName, ArrowRight } from "./Breadcrumb.styles.js";
7
+ import { isOverflown, attachActiveClassName, shouldHaveArrowPlaceholder, shouldRenderArrow } from "./utils.js";
8
+ const Breadcrumb = ({
9
+ path,
10
+ disabled,
11
+ highlight,
12
+ description,
13
+ onPathClick,
14
+ compact,
15
+ startWithArrow,
16
+ gradientOverlap,
17
+ highlightActivePath,
18
+ className,
19
+ prefixel,
20
+ isNavigation,
21
+ ...rest
22
+ }) => {
23
+ const pathToDisplay = useMemo(() => {
24
+ const breadcrumbsArray = [...path];
26
25
  return compact ? breadcrumbsArray.reverse() : breadcrumbsArray;
27
26
  }, [compact, path]);
28
- var contentRef = useRef(null);
29
- var _useState = useState(false),
30
- gradient = _useState[0],
31
- setGradient = _useState[1];
32
- useEffect(function () {
33
- var shouldRenderGradientOverlap = gradientOverlap && isOverflown(contentRef);
27
+ const contentRef = useRef(null);
28
+ const [gradient, setGradient] = useState(false);
29
+ useEffect(() => {
30
+ const shouldRenderGradientOverlap = gradientOverlap && isOverflown(contentRef);
34
31
  setGradient(!!shouldRenderGradientOverlap);
35
32
  }, [path, contentRef, gradientOverlap]);
36
- var descriptionWithHighlight = useMemo(function () {
37
- if (description && typeof description === 'string' && highlight) {
38
- return renderWithHighlight(description, highlight, 'search-highlight', 'search-highlight');
33
+ const descriptionWithHighlight = useMemo(() => {
34
+ if (description && typeof description === "string" && highlight) {
35
+ return renderWithHighlight(description, highlight, "search-highlight", "search-highlight");
39
36
  }
40
37
  return description;
41
38
  }, [description, highlight]);
42
- return /*#__PURE__*/React.createElement(S.Breadcrumb, _extends({
43
- tabIndex: 0,
44
- role: "menuitem",
45
- "data-testid": "ds-cascader-breadrumb",
46
- className: className + " ds-breadcrumb",
47
- prefixel: !!prefixel,
48
- disabled: disabled,
49
- compact: compact,
50
- clickable: !!onPathClick,
51
- isNavigation: isNavigation
52
- }, rest), /*#__PURE__*/React.createElement(S.OuterWrapper, null, prefixel && /*#__PURE__*/React.createElement(S.PrefixWrapper, {
53
- "data-testid": "list-item-prefix",
54
- disabled: disabled
55
- }, prefixel), /*#__PURE__*/React.createElement(S.InnerWrapper, null, !!description && /*#__PURE__*/React.createElement(S.Description, {
56
- "data-testid": "ds-cascader-breadcrumb-description"
57
- }, descriptionWithHighlight), /*#__PURE__*/React.createElement(S.ContentWrapper, {
58
- "data-testid": "ds-cascader-breadcrumb-content",
59
- gradientOverlap: gradient
60
- }, /*#__PURE__*/React.createElement(S.BreadcrumbContent, {
61
- className: "breadcrumb-content",
62
- ref: contentRef
63
- }, pathToDisplay.map(function (item, index) {
64
- return /*#__PURE__*/React.createElement(S.BreadcrumbRoute, {
65
- className: "route",
66
- key: item + "-" + index
67
- }, /*#__PURE__*/React.createElement(S.BreadcrumbName, {
68
- className: "ds-breadcrumb-name " + attachActiveClassName(index, !!highlightActivePath, path, !!compact),
69
- onClick: function onClick() {
70
- onPathClick == null || onPathClick(item);
71
- }
72
- }, renderWithHighlight(item, highlight)), shouldHaveArrowPlaceholder(index, path, !!compact, !!startWithArrow) && /*#__PURE__*/React.createElement(S.ArrowRight, {
73
- className: "ds-arrow",
74
- visible: shouldRenderArrow(path, index, !!startWithArrow)
75
- }, /*#__PURE__*/React.createElement(Icon, {
76
- component: /*#__PURE__*/React.createElement(AngleRightS, null),
77
- color: theme.palette['grey-600']
78
- })));
79
- }))))));
39
+ return /* @__PURE__ */ jsx(Breadcrumb$1, { tabIndex: 0, role: "menuitem", "data-testid": "ds-cascader-breadrumb", className: `${className} ds-breadcrumb`, prefixel: !!prefixel, disabled, compact, clickable: !!onPathClick, isNavigation, ...rest, children: /* @__PURE__ */ jsxs(OuterWrapper, { children: [
40
+ prefixel && /* @__PURE__ */ jsx(PrefixWrapper, { "data-testid": "list-item-prefix", disabled, children: prefixel }),
41
+ /* @__PURE__ */ jsxs(InnerWrapper, { children: [
42
+ !!description && /* @__PURE__ */ jsx(Description, { "data-testid": "ds-cascader-breadcrumb-description", children: descriptionWithHighlight }),
43
+ /* @__PURE__ */ jsx(ContentWrapper, { "data-testid": "ds-cascader-breadcrumb-content", gradientOverlap: gradient, children: /* @__PURE__ */ jsx(BreadcrumbContent, { className: "breadcrumb-content", ref: contentRef, children: pathToDisplay.map((item, index) => /* @__PURE__ */ jsxs(BreadcrumbRoute, { className: "route", children: [
44
+ /* @__PURE__ */ jsx(BreadcrumbName, { className: `ds-breadcrumb-name ${attachActiveClassName(index, !!highlightActivePath, path, !!compact)}`, onClick: () => {
45
+ onPathClick?.(item);
46
+ }, children: renderWithHighlight(item, highlight) }),
47
+ shouldHaveArrowPlaceholder(index, path, !!compact, !!startWithArrow) && /* @__PURE__ */ jsx(ArrowRight, { className: "ds-arrow", visible: shouldRenderArrow(path, index, !!startWithArrow), children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleRightS, {}), color: theme.palette["grey-600"] }) })
48
+ ] }, `${item}-${index}`)) }) })
49
+ ] })
50
+ ] }) });
51
+ };
52
+ export {
53
+ Breadcrumb,
54
+ Breadcrumb as default
80
55
  };
81
- export default Breadcrumb;
@@ -1,26 +1,26 @@
1
- import { type ThemeProps } from '@synerise/ds-core';
2
- import { type StyledListItem } from '@synerise/ds-list-item';
3
- export declare const PrefixWrapper: import("styled-components").StyledComponent<"div", any, {
1
+ import { ThemeProps } from '@synerise/ds-core';
2
+ import { StyledListItem } from '@synerise/ds-list-item';
3
+ export declare const PrefixWrapper: import('styled-components').StyledComponent<"div", any, {
4
4
  visible?: boolean;
5
5
  disabled?: boolean;
6
6
  }, never>;
7
- export declare const Highlight: import("styled-components").StyledComponent<"span", any, {}, never>;
8
- export declare const ArrowRight: import("styled-components").StyledComponent<"div", any, {
7
+ export declare const Highlight: import('styled-components').StyledComponent<"span", any, {}, never>;
8
+ export declare const ArrowRight: import('styled-components').StyledComponent<"div", any, {
9
9
  visible: boolean;
10
10
  }, never>;
11
- export declare const BreadcrumbContent: import("styled-components").StyledComponent<"div", any, {
11
+ export declare const BreadcrumbContent: import('styled-components').StyledComponent<"div", any, {
12
12
  prefixel?: boolean;
13
13
  }, never>;
14
- export declare const Description: import("styled-components").StyledComponent<"div", any, {}, never>;
15
- export declare const ContentWrapper: import("styled-components").StyledComponent<"div", any, {
14
+ export declare const Description: import('styled-components').StyledComponent<"div", any, {}, never>;
15
+ export declare const ContentWrapper: import('styled-components').StyledComponent<"div", any, {
16
16
  gradientOverlap?: boolean;
17
17
  }, never>;
18
- export declare const BreadcrumbName: import("styled-components").StyledComponent<"div", any, {}, never>;
18
+ export declare const BreadcrumbName: import('styled-components').StyledComponent<"div", any, {}, never>;
19
19
  export declare const disableDefaultClickingStyles: (props: ThemeProps & {
20
20
  disabled?: boolean;
21
- }) => import("styled-components").FlattenSimpleInterpolation;
22
- export declare const OuterWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
23
- export declare const InnerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
21
+ }) => import('styled-components').FlattenSimpleInterpolation;
22
+ export declare const OuterWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
23
+ export declare const InnerWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
24
24
  type BreadcrumbProps = {
25
25
  clickable?: boolean;
26
26
  prefixel?: boolean;
@@ -30,5 +30,5 @@ type BreadcrumbProps = {
30
30
  isNavigation?: boolean;
31
31
  };
32
32
  export declare const Breadcrumb: StyledListItem<BreadcrumbProps>;
33
- export declare const BreadcrumbRoute: import("styled-components").StyledComponent<"div", any, {}, never>;
33
+ export declare const BreadcrumbRoute: import('styled-components').StyledComponent<"div", any, {}, never>;
34
34
  export {};
@@ -1,73 +1,63 @@
1
- import styled, { css } from 'styled-components';
2
- import ListItem from '@synerise/ds-list-item';
3
- import { Inner } from '@synerise/ds-list-item/dist/components/Text/Text.styles';
4
- var TRANSITION_FN = '0.3s ease-in-out';
5
- export var PrefixWrapper = styled.div.withConfig({
1
+ import styled, { css } from "styled-components";
2
+ import ListItem from "@synerise/ds-list-item";
3
+ import { Inner } from "@synerise/ds-list-item/dist/components/Text/Text.styles";
4
+ const TRANSITION_FN = "0.3s ease-in-out";
5
+ const PrefixWrapper = /* @__PURE__ */ styled.div.withConfig({
6
6
  displayName: "Breadcrumbstyles__PrefixWrapper",
7
7
  componentId: "sc-1rgfkd8-0"
8
8
  })(["display:flex;order:1;opacity:1;transition:opacity ", ";margin-top:-7px;margin-bottom:-7px;margin-left:-4px;margin-right:12px;align-items:center;"], TRANSITION_FN);
9
- export var Highlight = styled.span.withConfig({
9
+ const Highlight = /* @__PURE__ */ styled.span.withConfig({
10
10
  displayName: "Breadcrumbstyles__Highlight",
11
11
  componentId: "sc-1rgfkd8-1"
12
12
  })([""]);
13
- export var ArrowRight = styled.div.withConfig({
13
+ const ArrowRight = /* @__PURE__ */ styled.div.withConfig({
14
14
  displayName: "Breadcrumbstyles__ArrowRight",
15
15
  componentId: "sc-1rgfkd8-2"
16
- })(["transition:opacity ", ";opacity:", ";svg{transition:fill ", ";}"], TRANSITION_FN, function (props) {
17
- return props.visible ? '1' : '0';
18
- }, TRANSITION_FN);
19
- export var BreadcrumbContent = styled.div.withConfig({
16
+ })(["transition:opacity ", ";opacity:", ";svg{transition:fill ", ";}"], TRANSITION_FN, (props) => props.visible ? "1" : "0", TRANSITION_FN);
17
+ const BreadcrumbContent = /* @__PURE__ */ styled.div.withConfig({
20
18
  displayName: "Breadcrumbstyles__BreadcrumbContent",
21
19
  componentId: "sc-1rgfkd8-3"
22
20
  })(["display:flex;align-items:center;"]);
23
- export var Description = styled.div.withConfig({
21
+ const Description = /* @__PURE__ */ styled.div.withConfig({
24
22
  displayName: "Breadcrumbstyles__Description",
25
23
  componentId: "sc-1rgfkd8-4"
26
- })(["direction:ltr;width:100%;font-weight:400;color:", ";.search-highlight{font-weight:500;}text-overflow:ellipsis;overflow:hidden;"], function (props) {
27
- return props.theme.palette['grey-600'];
28
- });
29
- export var ContentWrapper = styled.div.withConfig({
24
+ })(["direction:ltr;width:100%;font-weight:400;color:", ";.search-highlight{font-weight:500;}text-overflow:ellipsis;overflow:hidden;"], (props) => props.theme.palette["grey-600"]);
25
+ const ContentWrapper = /* @__PURE__ */ styled.div.withConfig({
30
26
  displayName: "Breadcrumbstyles__ContentWrapper",
31
27
  componentId: "sc-1rgfkd8-5"
32
- })(["position:relative;&::before{pointer-events:none;content:'';opacity:", ";position:absolute;display:block;width:50px;height:18px;transition:opacity ", ";background-image:", ";}&::after{pointer-events:none;content:'';opacity:", ";position:absolute;left:0;top:0;display:block;width:50px;height:18px;transition:opacity ", ";background-image:", ";}"], function (props) {
33
- return props.gradientOverlap ? '1' : '0';
34
- }, TRANSITION_FN, function (props) {
35
- return "-webkit-linear-gradient( left, " + props.theme.palette['grey-050'] + " 0%, rgba(255,255,255,0) 100% )";
36
- }, function (props) {
37
- return props.gradientOverlap ? '1' : '0';
38
- }, TRANSITION_FN, function (props) {
39
- return "-webkit-linear-gradient( left, " + props.theme.palette.white + " 0%, rgba(255,255,255,0) 100% )";
40
- });
41
- export var BreadcrumbName = styled.div.withConfig({
28
+ })(["position:relative;&::before{pointer-events:none;content:'';opacity:", ";position:absolute;display:block;width:50px;height:18px;transition:opacity ", ";background-image:", ";}&::after{pointer-events:none;content:'';opacity:", ";position:absolute;left:0;top:0;display:block;width:50px;height:18px;transition:opacity ", ";background-image:", ";}"], (props) => props.gradientOverlap ? "1" : "0", TRANSITION_FN, (props) => `-webkit-linear-gradient( left, ${props.theme.palette["grey-050"]} 0%, rgba(255,255,255,0) 100% )`, (props) => props.gradientOverlap ? "1" : "0", TRANSITION_FN, (props) => `-webkit-linear-gradient( left, ${props.theme.palette.white} 0%, rgba(255,255,255,0) 100% )`);
29
+ const BreadcrumbName = /* @__PURE__ */ styled.div.withConfig({
42
30
  displayName: "Breadcrumbstyles__BreadcrumbName",
43
31
  componentId: "sc-1rgfkd8-6"
44
- })(["direction:ltr;font-weight:400;transition:color ", ";color:", ";.search-highlight{font-weight:500;}"], TRANSITION_FN, function (props) {
45
- return props.theme.palette['grey-600'];
46
- });
47
- export var disableDefaultClickingStyles = function disableDefaultClickingStyles(props) {
48
- return css(["&,&:focus,&:hover{background:", " !important;box-shadow:inset 0 0 0 2px transparent !important;", ",", "{color:", ";}", " > .ds-icon > svg{fill:", ";}}", ":hover,", ":hover{color:", ";}&&&:hover{", "{.ds-icon > svg{fill:", " !important;}}}&&&{", ":hover{.ds-icon > svg{fill:", " !important;}}"], props.theme.palette.white, BreadcrumbName, Description, props.theme.palette['grey-600'], ArrowRight, props.theme.palette['grey-600'], BreadcrumbName, Description, props.disabled ? props.theme.palette['grey-600'] : props.theme.palette['blue-600'], PrefixWrapper, props.theme.palette['grey-600'], PrefixWrapper, props.theme.palette['blue-600']);
49
- };
50
- export var OuterWrapper = styled.div.withConfig({
32
+ })(["direction:ltr;font-weight:400;transition:color ", ";color:", ";.search-highlight{font-weight:500;}"], TRANSITION_FN, (props) => props.theme.palette["grey-600"]);
33
+ const disableDefaultClickingStyles = (props) => css(["&,&:focus,&:hover{background:", " !important;box-shadow:inset 0 0 0 2px transparent !important;", ",", "{color:", ";}", " > .ds-icon > svg{fill:", ";}}", ":hover,", ":hover{color:", ";}&&&:hover{", "{.ds-icon > svg{fill:", " !important;}}}&&&{", ":hover{.ds-icon > svg{fill:", " !important;}}"], props.theme.palette.white, BreadcrumbName, Description, props.theme.palette["grey-600"], ArrowRight, props.theme.palette["grey-600"], BreadcrumbName, Description, props.disabled ? props.theme.palette["grey-600"] : props.theme.palette["blue-600"], PrefixWrapper, props.theme.palette["grey-600"], PrefixWrapper, props.theme.palette["blue-600"]);
34
+ const OuterWrapper = /* @__PURE__ */ styled.div.withConfig({
51
35
  displayName: "Breadcrumbstyles__OuterWrapper",
52
36
  componentId: "sc-1rgfkd8-7"
53
37
  })(["padding:7px 0;width:100%;display:flex;align-items:center;flex-wrap:nowrap;user-select:none;"]);
54
- export var InnerWrapper = styled.div.withConfig({
38
+ const InnerWrapper = /* @__PURE__ */ styled.div.withConfig({
55
39
  displayName: "Breadcrumbstyles__InnerWrapper",
56
40
  componentId: "sc-1rgfkd8-8"
57
41
  })(["text-overflow:ellipsis;order:2;overflow:hidden;white-space:nowrap;font-size:13px;line-height:1.39;min-height:18px;user-select:none;"]);
58
- export var Breadcrumb = styled(ListItem).withConfig({
42
+ const Breadcrumb = /* @__PURE__ */ styled(ListItem).withConfig({
59
43
  displayName: "Breadcrumbstyles__Breadcrumb",
60
44
  componentId: "sc-1rgfkd8-9"
61
- })(["", "{direction:", ";flex-wrap:", ";}&:hover{", "::after{opacity:0;}", "::before{opacity:0;}}", " ", ""], BreadcrumbContent, function (props) {
62
- return props.compact ? 'rtl' : 'ltr';
63
- }, function (props) {
64
- return props.compact ? 'no-wrap' : 'wrap';
65
- }, ContentWrapper, ContentWrapper, function (props) {
66
- return props.isNavigation ? css(["&:hover,&:active,&:focus,&:focus:active{", "{background:transparent;}}", ",", "{&:hover{color:", ";}}&&&{", ":hover{.ds-icon > svg{fill:", " !important;}}&:focus{", "{box-shadow:none;}}"], Inner, BreadcrumbName, Description, props.disabled ? props.theme.palette['grey-600'] : props.theme.palette['blue-600'], PrefixWrapper, props.theme.palette['blue-600'], Inner) : css(["&:hover{background:", ";color:", ";", " > .ds-icon > svg{fill:", ";}", ",", "{color:", ";}}&:focus:not(:active){box-shadow:inset 0 0 0 2px ", ";}&:focus:active{", "::before{background-image:", ";}}"], props.theme.palette['grey-050'], props.theme.palette['blue-600'], ArrowRight, props.disabled ? props.theme.palette['grey-600'] : props.theme.palette['blue-600'], BreadcrumbName, Description, props.disabled ? props.theme.palette['grey-600'] : props.theme.palette['blue-600'], props.theme.palette['blue-600'], ContentWrapper, "-webkit-linear-gradient( left, " + props.theme.palette['grey-100'] + " 0%, rgba(255,255,255,0) 100%)");
67
- }, function (props) {
68
- return props.clickable && !props.isNavigation && disableDefaultClickingStyles(props);
69
- });
70
- export var BreadcrumbRoute = styled.div.withConfig({
45
+ })(["", "{direction:", ";flex-wrap:", ";}&:hover{", "::after{opacity:0;}", "::before{opacity:0;}}", " ", ""], BreadcrumbContent, (props) => props.compact ? "rtl" : "ltr", (props) => props.compact ? "no-wrap" : "wrap", ContentWrapper, ContentWrapper, (props) => props.isNavigation ? css(["&:hover,&:active,&:focus,&:focus:active{", "{background:transparent;}}", ",", "{&:hover{color:", ";}}&&&{", ":hover{.ds-icon > svg{fill:", " !important;}}&:focus{", "{box-shadow:none;}}"], Inner, BreadcrumbName, Description, props.disabled ? props.theme.palette["grey-600"] : props.theme.palette["blue-600"], PrefixWrapper, props.theme.palette["blue-600"], Inner) : css(["&:hover{background:", ";color:", ";", " > .ds-icon > svg{fill:", ";}", ",", "{color:", ";}}&:focus:not(:active){box-shadow:inset 0 0 0 2px ", ";}&:focus:active{", "::before{background-image:", ";}}"], props.theme.palette["grey-050"], props.theme.palette["blue-600"], ArrowRight, props.disabled ? props.theme.palette["grey-600"] : props.theme.palette["blue-600"], BreadcrumbName, Description, props.disabled ? props.theme.palette["grey-600"] : props.theme.palette["blue-600"], props.theme.palette["blue-600"], ContentWrapper, `-webkit-linear-gradient( left, ${props.theme.palette["grey-100"]} 0%, rgba(255,255,255,0) 100%)`), (props) => props.clickable && !props.isNavigation && disableDefaultClickingStyles(props));
46
+ const BreadcrumbRoute = /* @__PURE__ */ styled.div.withConfig({
71
47
  displayName: "Breadcrumbstyles__BreadcrumbRoute",
72
48
  componentId: "sc-1rgfkd8-10"
73
- })(["display:flex;align-items:center;padding-top:height:18px;.active{font-weight:500;}"]);
49
+ })(["display:flex;align-items:center;padding-top:height:18px;.active{font-weight:500;}"]);
50
+ export {
51
+ ArrowRight,
52
+ Breadcrumb,
53
+ BreadcrumbContent,
54
+ BreadcrumbName,
55
+ BreadcrumbRoute,
56
+ ContentWrapper,
57
+ Description,
58
+ Highlight,
59
+ InnerWrapper,
60
+ OuterWrapper,
61
+ PrefixWrapper,
62
+ disableDefaultClickingStyles
63
+ };
@@ -1,5 +1,5 @@
1
- import type { CSSProperties, ReactNode } from 'react';
2
- import { type ListItemProps } from '@synerise/ds-list-item';
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { ListItemProps } from '@synerise/ds-list-item';
3
3
  export type BreadcrumbProps = ListItemProps & {
4
4
  prefixel?: ReactNode;
5
5
  disabled?: boolean;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import type { RefObject } from 'react';
1
+ import { RefObject } from 'react';
2
2
  export declare const attachActiveClassName: (index: number, highlightActivePath: boolean, path: Array<string>, compact: boolean) => "" | "active";
3
3
  export declare const shouldRenderArrow: (breadCrumbPath: string[], index: number, startWithArrow: boolean) => boolean;
4
4
  export declare const shouldHaveArrowPlaceholder: (index: number, path: string[], compact: boolean, startWithArrow: boolean) => boolean;
@@ -1,29 +1,35 @@
1
- export var attachActiveClassName = function attachActiveClassName(index, highlightActivePath, path, compact) {
1
+ const attachActiveClassName = (index, highlightActivePath, path, compact) => {
2
2
  if (compact) {
3
- return highlightActivePath && index === 0 ? 'active' : '';
3
+ return highlightActivePath && index === 0 ? "active" : "";
4
4
  }
5
- return highlightActivePath && index === path.length - 1 ? 'active' : '';
5
+ return highlightActivePath && index === path.length - 1 ? "active" : "";
6
6
  };
7
- export var shouldRenderArrow = function shouldRenderArrow(breadCrumbPath, index, startWithArrow) {
7
+ const shouldRenderArrow = (breadCrumbPath, index, startWithArrow) => {
8
8
  if (!breadCrumbPath || !breadCrumbPath.length) {
9
9
  return false;
10
10
  }
11
- var nextBreadcrumb = breadCrumbPath[index + 1];
11
+ const nextBreadcrumb = breadCrumbPath[index + 1];
12
12
  if (!nextBreadcrumb) {
13
13
  return startWithArrow;
14
14
  }
15
15
  return true;
16
16
  };
17
- export var shouldHaveArrowPlaceholder = function shouldHaveArrowPlaceholder(index, path, compact, startWithArrow) {
17
+ const shouldHaveArrowPlaceholder = (index, path, compact, startWithArrow) => {
18
18
  if (compact) {
19
19
  return startWithArrow || index < path.length - 1 && path.length > 1;
20
20
  }
21
21
  return startWithArrow || path.length > 1 || index > 0;
22
22
  };
23
- export var isOverflown = function isOverflown(elementRef) {
23
+ const isOverflown = (elementRef) => {
24
24
  if (elementRef !== null && elementRef.current !== null) {
25
- var element = elementRef.current;
25
+ const element = elementRef.current;
26
26
  return element.scrollWidth > element.clientWidth;
27
27
  }
28
28
  return false;
29
- };
29
+ };
30
+ export {
31
+ attachActiveClassName,
32
+ isOverflown,
33
+ shouldHaveArrowPlaceholder,
34
+ shouldRenderArrow
35
+ };
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { type Path } from '../../Cascader.types';
3
- import { type BreadcrumbsListProps } from './BreadcrumbsList.types';
4
- export declare const BreadcrumbsList: ({ paths, highlight, width, visibleRows, onBreadCrumbClick, rowHeight, scrollTop, selectedIds, }: BreadcrumbsListProps) => React.ReactElement<import("@synerise/ds-search/dist/Elements/SearchItems/SearchItems.types").SearchItemListProps<Path>, string | React.JSXElementConstructor<any>>;
1
+ import { default as React } from 'react';
2
+ import { Path } from '../../Cascader.types';
3
+ import { BreadcrumbsListProps } from './BreadcrumbsList.types';
4
+ export declare const BreadcrumbsList: ({ paths, highlight, width, visibleRows, onBreadCrumbClick, rowHeight, scrollTop, selectedIds, }: BreadcrumbsListProps) => React.ReactElement<import('@synerise/ds-search/dist/Elements/SearchItems/SearchItems.types').SearchItemListProps<Path>, string | React.JSXElementConstructor<any>>;
5
5
  export default BreadcrumbsList;
@@ -1,45 +1,38 @@
1
- import React from 'react';
2
- import { theme } from '@synerise/ds-core';
3
- import Icon, { CheckS } from '@synerise/ds-icon';
4
- import { renderSearchList } from '@synerise/ds-search/dist/Elements/SearchItems/SearchItems';
5
- import Breadcrumb from '../Breadcrumb/Breadcrumb';
6
- var DEFAULT_VISIBLE_ROWS = 6;
7
- var DEFAULT_ROW_HEIGHT = 50;
8
- export var BreadcrumbsList = function BreadcrumbsList(_ref) {
9
- var paths = _ref.paths,
10
- highlight = _ref.highlight,
11
- width = _ref.width,
12
- visibleRows = _ref.visibleRows,
13
- onBreadCrumbClick = _ref.onBreadCrumbClick,
14
- rowHeight = _ref.rowHeight,
15
- scrollTop = _ref.scrollTop,
16
- selectedIds = _ref.selectedIds;
17
- var listPropsObject = {
18
- scrollTop: scrollTop
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { theme } from "@synerise/ds-core";
3
+ import Icon, { CheckS } from "@synerise/ds-icon";
4
+ import { renderSearchList } from "@synerise/ds-search/dist/Elements/SearchItems/SearchItems";
5
+ import { Breadcrumb } from "../Breadcrumb/Breadcrumb.js";
6
+ const DEFAULT_VISIBLE_ROWS = 6;
7
+ const DEFAULT_ROW_HEIGHT = 50;
8
+ const BreadcrumbsList = ({
9
+ paths,
10
+ highlight,
11
+ width,
12
+ visibleRows,
13
+ onBreadCrumbClick,
14
+ rowHeight,
15
+ scrollTop,
16
+ selectedIds
17
+ }) => {
18
+ const listPropsObject = {
19
+ scrollTop
19
20
  };
20
21
  return renderSearchList({
21
22
  data: paths,
22
23
  visibleRows: visibleRows || DEFAULT_VISIBLE_ROWS,
23
- highlight: highlight,
24
- width: width,
24
+ highlight,
25
+ width,
25
26
  rowHeight: rowHeight || DEFAULT_ROW_HEIGHT,
26
27
  onItemClick: onBreadCrumbClick,
27
- itemRender: function itemRender(item) {
28
- var tickIcon = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Icon, {
29
- color: theme.palette['green-600'],
30
- component: /*#__PURE__*/React.createElement(CheckS, null)
31
- }));
32
- return /*#__PURE__*/React.createElement(Breadcrumb, {
33
- gradientOverlap: true,
34
- compact: true,
35
- path: item.path,
36
- key: "" + item.id,
37
- suffixel: selectedIds.includes(item.id) ? tickIcon : undefined,
38
- description: item.path[item.path.length - 1],
39
- highlight: highlight
40
- });
28
+ itemRender: (item) => {
29
+ const tickIcon = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Icon, { color: theme.palette["green-600"], component: /* @__PURE__ */ jsx(CheckS, {}) }) });
30
+ return /* @__PURE__ */ jsx(Breadcrumb, { gradientOverlap: true, compact: true, path: item.path, suffixel: selectedIds.includes(item.id) ? tickIcon : void 0, description: item.path[item.path.length - 1], highlight }, `${item.id}`);
41
31
  },
42
32
  listProps: listPropsObject
43
33
  });
44
34
  };
45
- export default BreadcrumbsList;
35
+ export {
36
+ BreadcrumbsList,
37
+ BreadcrumbsList as default
38
+ };
@@ -1,5 +1,5 @@
1
- import type { ReactText } from 'react';
2
- import type { Path } from '../../Cascader.types';
1
+ import { ReactText } from 'react';
2
+ import { Path } from '../../Cascader.types';
3
3
  export type BreadcrumbsListProps = {
4
4
  paths: Path[];
5
5
  width: number | string;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type CategoriesListProps } from './CategoriesList.types';
1
+ import { default as React } from 'react';
2
+ import { CategoriesListProps } from './CategoriesList.types';
3
3
  export declare const CategoriesList: ({ rootCategory, onCategoryClick, suffixel, onSuffixelClick, selectedIds, }: CategoriesListProps) => React.JSX.Element;
4
4
  export default CategoriesList;
@@ -1,58 +1,35 @@
1
- import React, { useCallback } from 'react';
2
- import styled from 'styled-components';
3
- import { theme } from '@synerise/ds-core';
4
- import Icon, { CheckS } from '@synerise/ds-icon';
5
- import ListItem from '@synerise/ds-list-item';
6
- import { hasNestedCategories } from '../../utils';
7
- var CategoriesSuffix = styled.div.withConfig({
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import styled from "styled-components";
4
+ import { theme } from "@synerise/ds-core";
5
+ import Icon, { CheckS } from "@synerise/ds-icon";
6
+ import ListItem from "@synerise/ds-list-item";
7
+ import { hasNestedCategories } from "../../utils.js";
8
+ const CategoriesSuffix = /* @__PURE__ */ styled.div.withConfig({
8
9
  displayName: "CategoriesList__CategoriesSuffix",
9
10
  componentId: "sc-zu5q3f-0"
10
11
  })([""]);
11
- export var CategoriesList = function CategoriesList(_ref) {
12
- var rootCategory = _ref.rootCategory,
13
- onCategoryClick = _ref.onCategoryClick,
14
- suffixel = _ref.suffixel,
15
- onSuffixelClick = _ref.onSuffixelClick,
16
- selectedIds = _ref.selectedIds;
17
- var onCategoryClickHandler = useCallback(function (item) {
12
+ const CategoriesList = ({
13
+ rootCategory,
14
+ onCategoryClick,
15
+ suffixel,
16
+ onSuffixelClick,
17
+ selectedIds
18
+ }) => {
19
+ const onCategoryClickHandler = useCallback((item) => {
18
20
  onCategoryClick && onCategoryClick(item);
19
21
  }, [onCategoryClick]);
20
- var onSuffixelClickHandler = useCallback(function (item, event) {
22
+ const onSuffixelClickHandler = useCallback((item, event) => {
21
23
  event.stopPropagation();
22
24
  onSuffixelClick && onSuffixelClick(item);
23
25
  }, [onSuffixelClick]);
24
- var renderSuffix = function renderSuffix(item) {
25
- return /*#__PURE__*/React.createElement(CategoriesSuffix, {
26
- onClick: function onClick(event) {
27
- return onSuffixelClickHandler(item, event);
28
- }
29
- }, selectedIds.includes(item.id) ? /*#__PURE__*/React.createElement(Icon, {
30
- color: theme.palette['green-600'],
31
- component: /*#__PURE__*/React.createElement(CheckS, null)
32
- }) : suffixel);
33
- };
34
- return /*#__PURE__*/React.createElement(React.Fragment, null, Object.keys(rootCategory)
35
- // @ts-expect-error rootCategory is in fact more than what Category type defines
36
- // apart from id, name and path it can have nested categories with any key
37
- // STOR-1904
38
- .filter(function (key) {
39
- var _rootCategory$key;
40
- return (_rootCategory$key = rootCategory[key]) == null ? void 0 : _rootCategory$key.name;
41
- }).map(function (key) {
42
- // @ts-expect-error rootCategory is in fact more than what Category type defines
43
- // apart from id, name and path it can have nested categories with any key
44
- // STOR-1904
45
- var item = rootCategory[key];
46
- return /*#__PURE__*/React.createElement(ListItem, {
47
- text: item.name,
48
- key: "" + item.id,
49
- type: selectedIds.includes(item.id) ? undefined : 'select',
50
- suffixel: renderSuffix(item),
51
- parent: hasNestedCategories(item),
52
- onClick: function onClick() {
53
- return onCategoryClickHandler(item);
54
- }
55
- });
56
- }));
26
+ const renderSuffix = (item) => /* @__PURE__ */ jsx(CategoriesSuffix, { onClick: (event) => onSuffixelClickHandler(item, event), children: selectedIds.includes(item.id) ? /* @__PURE__ */ jsx(Icon, { color: theme.palette["green-600"], component: /* @__PURE__ */ jsx(CheckS, {}) }) : suffixel });
27
+ return /* @__PURE__ */ jsx(Fragment, { children: Object.keys(rootCategory).filter((key) => rootCategory[key]?.name).map((key) => {
28
+ const item = rootCategory[key];
29
+ return /* @__PURE__ */ jsx(ListItem, { text: item.name, type: selectedIds.includes(item.id) ? void 0 : "select", suffixel: renderSuffix(item), parent: hasNestedCategories(item), onClick: () => onCategoryClickHandler(item) }, `${item.id}`);
30
+ }) });
31
+ };
32
+ export {
33
+ CategoriesList,
34
+ CategoriesList as default
57
35
  };
58
- export default CategoriesList;
@@ -1,5 +1,5 @@
1
- import type { ReactNode, ReactText } from 'react';
2
- import type { Category } from '../../Cascader.types';
1
+ import { ReactNode, ReactText } from 'react';
2
+ import { Category } from '../../Cascader.types';
3
3
  export interface CategoriesListProps {
4
4
  rootCategory: Category;
5
5
  onCategoryClick: (item: Category) => void;
@@ -1 +1 @@
1
- export {};
1
+
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { type NavigationProps } from './Navigation.types';
1
+ import { default as React } from 'react';
2
+ import { NavigationProps } from './Navigation.types';
3
3
  export declare const Navigation: ({ backActionVisible, onHomeIconClick, onPathClick, activeCategory, previousCategory, breadcrumbVisible, }: NavigationProps) => React.JSX.Element;
4
4
  export default Navigation;