@redocly/theme 0.58.1 → 0.59.0-next.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/lib/components/Accordion/Accordion.d.ts +12 -0
- package/lib/components/Accordion/Accordion.js +75 -0
- package/lib/components/Accordion/AccordionBody.d.ts +8 -0
- package/lib/components/Accordion/AccordionBody.js +63 -0
- package/lib/components/Accordion/AccordionHeader.d.ts +10 -0
- package/lib/components/Accordion/AccordionHeader.js +37 -0
- package/lib/components/Accordion/AccordionTitle.d.ts +6 -0
- package/lib/components/Accordion/AccordionTitle.js +20 -0
- package/lib/components/Accordion/variables.d.ts +1 -0
- package/lib/components/Accordion/variables.js +59 -0
- package/lib/components/Buttons/AIAssistantButton.d.ts +2 -0
- package/lib/components/Buttons/AIAssistantButton.js +125 -0
- package/lib/components/Buttons/variables.d.ts +1 -0
- package/lib/components/Buttons/variables.dark.d.ts +1 -0
- package/lib/components/Buttons/variables.dark.js +10 -0
- package/lib/components/Buttons/variables.js +51 -0
- package/lib/components/Catalog/Catalog.js +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.js +1 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +1 -1
- package/lib/components/Catalog/CatalogFilter/CatalogFilter.d.ts +6 -0
- package/lib/components/Catalog/CatalogFilter/CatalogFilter.js +35 -0
- package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.d.ts +6 -0
- package/lib/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.js +142 -0
- package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.d.ts +13 -0
- package/lib/components/Catalog/CatalogFilter/CatalogFilterContent.js +92 -0
- package/lib/components/Catalog/CatalogFilter/CatalogFilterDateRange.d.ts +6 -0
- package/lib/components/Catalog/CatalogFilter/CatalogFilterDateRange.js +111 -0
- package/lib/components/Catalog/CatalogFilter/CatalogFilterSelect.d.ts +6 -0
- package/lib/components/Catalog/CatalogFilter/CatalogFilterSelect.js +116 -0
- package/lib/components/Catalog/CatalogSelector.js +0 -1
- package/lib/components/Catalog/variables.js +0 -1
- package/lib/components/Filter/FilterInput.d.ts +1 -0
- package/lib/components/Filter/FilterInput.js +2 -2
- package/lib/components/Filter/FilterOptions.js +2 -0
- package/lib/components/Filter/variables.js +7 -4
- package/lib/components/Search/SearchAiDialog.js +2 -3
- package/lib/components/Search/SearchAiResponse.js +2 -3
- package/lib/components/Search/SearchDialog.d.ts +2 -1
- package/lib/components/Search/SearchDialog.js +2 -2
- package/lib/components/Tag/Tag.d.ts +3 -2
- package/lib/components/Tag/Tag.js +21 -5
- package/lib/components/Tag/variables.dark.js +135 -0
- package/lib/components/Tag/variables.js +120 -58
- package/lib/core/hooks/use-tabs.d.ts +11 -6
- package/lib/core/hooks/use-tabs.js +117 -207
- package/lib/core/styles/dark.js +29 -26
- package/lib/core/styles/global.js +64 -59
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/utils/index.d.ts +1 -0
- package/lib/core/utils/index.js +1 -0
- package/lib/core/utils/tabs.d.ts +1 -0
- package/lib/core/utils/tabs.js +8 -0
- package/lib/icons/RedoclyIcon/RedoclyIcon.d.ts +9 -0
- package/lib/icons/RedoclyIcon/RedoclyIcon.js +27 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -0
- package/lib/layouts/RootLayout.js +6 -1
- package/lib/markdoc/components/Tabs/Tab.js +1 -1
- package/lib/markdoc/components/Tabs/TabList.d.ts +2 -14
- package/lib/markdoc/components/Tabs/TabList.js +63 -16
- package/lib/markdoc/components/Tabs/Tabs.d.ts +2 -2
- package/lib/markdoc/components/Tabs/Tabs.js +11 -87
- package/lib/markdoc/tags/tabs.js +5 -0
- package/package.json +2 -2
- package/src/components/Accordion/Accordion.tsx +100 -0
- package/src/components/Accordion/AccordionBody.tsx +65 -0
- package/src/components/Accordion/AccordionHeader.tsx +68 -0
- package/src/components/Accordion/AccordionTitle.tsx +26 -0
- package/src/components/Accordion/variables.ts +56 -0
- package/src/components/Buttons/AIAssistantButton.tsx +141 -0
- package/src/components/Buttons/variables.dark.ts +7 -0
- package/src/components/Buttons/variables.ts +48 -0
- package/src/components/Catalog/Catalog.tsx +3 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations.tsx +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +1 -1
- package/src/components/Catalog/CatalogFilter/CatalogFilter.tsx +56 -0
- package/src/components/Catalog/CatalogFilter/CatalogFilterCheckboxes.tsx +169 -0
- package/src/components/Catalog/CatalogFilter/CatalogFilterContent.tsx +121 -0
- package/src/components/Catalog/CatalogFilter/CatalogFilterDateRange.tsx +147 -0
- package/src/components/Catalog/CatalogFilter/CatalogFilterSelect.tsx +136 -0
- package/src/components/Catalog/CatalogSelector.tsx +0 -1
- package/src/components/Catalog/variables.ts +0 -1
- package/src/components/Filter/FilterInput.tsx +3 -2
- package/src/components/Filter/FilterOptions.tsx +2 -0
- package/src/components/Filter/variables.ts +7 -4
- package/src/components/Search/SearchAiDialog.tsx +2 -2
- package/src/components/Search/SearchAiResponse.tsx +2 -2
- package/src/components/Search/SearchDialog.tsx +7 -2
- package/src/components/Tag/Tag.tsx +33 -8
- package/src/components/Tag/variables.dark.ts +135 -0
- package/src/components/Tag/variables.ts +120 -58
- package/src/core/hooks/use-tabs.ts +160 -238
- package/src/core/styles/dark.ts +11 -8
- package/src/core/styles/global.ts +7 -2
- package/src/core/types/l10n.ts +1 -0
- package/src/core/utils/index.ts +1 -0
- package/src/core/utils/tabs.ts +4 -0
- package/src/icons/RedoclyIcon/RedoclyIcon.tsx +44 -0
- package/src/index.ts +2 -0
- package/src/layouts/RootLayout.tsx +6 -0
- package/src/markdoc/components/Tabs/Tab.tsx +1 -0
- package/src/markdoc/components/Tabs/TabList.tsx +84 -30
- package/src/markdoc/components/Tabs/Tabs.tsx +12 -125
- package/src/markdoc/tags/tabs.ts +5 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PropsWithChildren, ReactNode, JSX } from 'react';
|
|
2
|
+
import type { AccordionHeaderProps } from '../../components/Accordion/AccordionHeader';
|
|
3
|
+
export type AccordionProps = {
|
|
4
|
+
expanded?: boolean;
|
|
5
|
+
isExpandable?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
renderChildrenHidden?: boolean;
|
|
8
|
+
header?: ReactNode | ((props: AccordionHeaderProps) => ReactNode);
|
|
9
|
+
onToggle?: (expanded: boolean) => void;
|
|
10
|
+
dataTestId?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function Accordion({ expanded, isExpandable, renderChildrenHidden, header, className, children, onToggle, dataTestId, }: PropsWithChildren<AccordionProps>): JSX.Element;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.Accordion = Accordion;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
|
+
const AccordionBody_1 = require("../../components/Accordion/AccordionBody");
|
|
33
|
+
const AccordionHeader_1 = require("../../components/Accordion/AccordionHeader");
|
|
34
|
+
const AccordionTitle_1 = require("../../components/Accordion/AccordionTitle");
|
|
35
|
+
const ChevronDownIcon_1 = require("../../icons/ChevronDownIcon/ChevronDownIcon");
|
|
36
|
+
const ChevronRightIcon_1 = require("../../icons/ChevronRightIcon/ChevronRightIcon");
|
|
37
|
+
function Accordion({ expanded = true, isExpandable = true, renderChildrenHidden = false, header, className, children, onToggle, dataTestId, }) {
|
|
38
|
+
const [isExpanded, setExpanded] = (0, react_1.useState)(expanded);
|
|
39
|
+
const [animate, setAnimate] = (0, react_1.useState)(false);
|
|
40
|
+
const toggle = ({ target }) => {
|
|
41
|
+
if (target instanceof HTMLAnchorElement || !isExpandable)
|
|
42
|
+
return;
|
|
43
|
+
setAnimate(true);
|
|
44
|
+
setExpanded(!isExpanded);
|
|
45
|
+
onToggle === null || onToggle === void 0 ? void 0 : onToggle(!isExpanded);
|
|
46
|
+
};
|
|
47
|
+
(0, react_1.useEffect)(() => setExpanded(expanded), [expanded]);
|
|
48
|
+
return (react_1.default.createElement(AccordionWrapper, { className: className, "data-testid": dataTestId, "data-component-name": "Accordion/Accordion" },
|
|
49
|
+
header &&
|
|
50
|
+
(typeof header === 'function' ? (header({ expanded: isExpanded })) : (react_1.default.createElement(AccordionHeader_1.AccordionHeader, { "data-testid": "accordion-header", onClick: toggle, expanded: isExpanded, isExpandable: isExpandable },
|
|
51
|
+
react_1.default.createElement(HeaderContent, null,
|
|
52
|
+
react_1.default.createElement(AccordionTitle_1.AccordionTitle, { "data-testid": "title" }, header),
|
|
53
|
+
isExpandable &&
|
|
54
|
+
(isExpanded ? (react_1.default.createElement(ChevronDownIcon_1.ChevronDownIcon, { color: "--accordion-chevron-icon-color" })) : (react_1.default.createElement(ChevronRightIcon_1.ChevronRightIcon, { color: "--accordion-chevron-icon-color" }))))))),
|
|
55
|
+
(isExpanded || renderChildrenHidden) && (react_1.default.createElement(AccordionBody_1.AccordionBody, { "data-testid": "accordion-body", hidden: !isExpanded, animate: animate }, children))));
|
|
56
|
+
}
|
|
57
|
+
const AccordionWrapper = styled_components_1.default.div `
|
|
58
|
+
background-color: transparent;
|
|
59
|
+
font-family: var(--accordion-font-family);
|
|
60
|
+
font-size: var(--accordion-font-size);
|
|
61
|
+
font-weight: var(--accordion-font-weight);
|
|
62
|
+
border-radius: var(--accordion-border-radius);
|
|
63
|
+
border: var(--accordion-border);
|
|
64
|
+
|
|
65
|
+
&:not(:last-child) {
|
|
66
|
+
margin-bottom: var(--accordion-gap);
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
const HeaderContent = styled_components_1.default.div `
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
width: 100%;
|
|
73
|
+
gap: var(--spacing-xs);
|
|
74
|
+
`;
|
|
75
|
+
//# sourceMappingURL=Accordion.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
|
+
export type AccordionBodyProps = {
|
|
3
|
+
animate?: boolean;
|
|
4
|
+
hidden?: boolean;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function AccordionBody({ animate, hidden, children, className, }: AccordionBodyProps): JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.AccordionBody = AccordionBody;
|
|
30
|
+
const react_1 = __importDefault(require("react"));
|
|
31
|
+
const styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
+
function AccordionBody({ animate, hidden, children, className, }) {
|
|
33
|
+
return (react_1.default.createElement(AccordionBodyWrapper, { className: className, "$animate": animate, "$hidden": hidden, "data-component-name": "Accordion/AccordionBody" }, children));
|
|
34
|
+
}
|
|
35
|
+
const showAccordion = (0, styled_components_1.keyframes) `
|
|
36
|
+
0% {
|
|
37
|
+
opacity: 0;
|
|
38
|
+
transform: translateY(-5px);
|
|
39
|
+
}
|
|
40
|
+
100% {
|
|
41
|
+
opacity: 1;
|
|
42
|
+
transform: translateY(0);
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
45
|
+
const showAccordionAnimation = (0, styled_components_1.css) `
|
|
46
|
+
animation: ${showAccordion} 0.15s ease-out;
|
|
47
|
+
`;
|
|
48
|
+
const AccordionBodyWrapper = styled_components_1.default.div `
|
|
49
|
+
${({ $animate }) => $animate && showAccordionAnimation};
|
|
50
|
+
${({ $hidden }) => $hidden && 'visibility: hidden'};
|
|
51
|
+
|
|
52
|
+
background-color: var(--accordion-body-bg-color);
|
|
53
|
+
|
|
54
|
+
font-family: var(--accordion-body-font-family);
|
|
55
|
+
font-size: var(--accordion-body-font-size);
|
|
56
|
+
font-weight: var(--accordion-body-font-weight);
|
|
57
|
+
border: var(--accordion-body-border);
|
|
58
|
+
padding: var(--accordion-body-padding);
|
|
59
|
+
color: var(--accordion-body-text-color);
|
|
60
|
+
|
|
61
|
+
border-radius: var(--accordion-border-radius);
|
|
62
|
+
`;
|
|
63
|
+
//# sourceMappingURL=AccordionBody.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BaseSyntheticEvent, JSX, ReactNode } from 'react';
|
|
2
|
+
export type AccordionHeaderProps = {
|
|
3
|
+
isExpandable?: boolean;
|
|
4
|
+
expanded?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
onClick?: (e: BaseSyntheticEvent) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare function AccordionHeader({ isExpandable, expanded, disabled, children, className, onClick, }: AccordionHeaderProps): JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AccordionHeader = AccordionHeader;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
function AccordionHeader({ isExpandable, expanded, disabled, children, className, onClick, }) {
|
|
10
|
+
return (react_1.default.createElement(AccordionHeaderWrapper, { className: className, "$isExpandable": isExpandable, "$expanded": expanded, "$disabled": disabled, onClick: onClick, "data-component-name": "Accordion/AccordionHeader" }, children));
|
|
11
|
+
}
|
|
12
|
+
const AccordionHeaderWrapper = styled_components_1.default.div `
|
|
13
|
+
display: flex;
|
|
14
|
+
gap: var(--spacing-xs);
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
min-height: 32px;
|
|
18
|
+
color: var(--accordion-header-text-color);
|
|
19
|
+
|
|
20
|
+
cursor: ${({ $isExpandable = true }) => ($isExpandable ? 'pointer' : 'default')};
|
|
21
|
+
|
|
22
|
+
line-height: var(--accordion-header-line-height);
|
|
23
|
+
font-size: var(--accordion-header-font-size);
|
|
24
|
+
font-family: var(--accordion-header-font-family);
|
|
25
|
+
font-weight: var(--accordion-header-font-weight);
|
|
26
|
+
padding: var(--accordion-header-padding);
|
|
27
|
+
border: var(--accordion-header-border);
|
|
28
|
+
background-color: var(--accordion-header-bg-color);
|
|
29
|
+
border-radius: var(--accordion-border-radius);
|
|
30
|
+
|
|
31
|
+
pointer-events: ${({ $disabled }) => ($disabled ? 'none' : 'auto')};
|
|
32
|
+
|
|
33
|
+
&:hover {
|
|
34
|
+
color: ${({ $isExpandable = true }) => $isExpandable ? 'var(--text-color-primary)' : 'var(--accordion-header-text-color)'};
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
//# sourceMappingURL=AccordionHeader.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AccordionTitle = AccordionTitle;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
function AccordionTitle({ children, className }) {
|
|
10
|
+
return (react_1.default.createElement(AccordionTitleWrapper, { className: className, "data-component-name": "Accordion/AccordionTitle" }, children));
|
|
11
|
+
}
|
|
12
|
+
const AccordionTitleWrapper = styled_components_1.default.span `
|
|
13
|
+
font-weight: var(--accordion-header-font-weight);
|
|
14
|
+
line-height: var(--line-height-base);
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
text-overflow: ellipsis;
|
|
17
|
+
color: var(--accordion-header-text-color);
|
|
18
|
+
flex: 1;
|
|
19
|
+
`;
|
|
20
|
+
//# sourceMappingURL=AccordionTitle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const accordion: import("styled-components").FlattenSimpleInterpolation;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.accordion = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
exports.accordion = (0, styled_components_1.css) `
|
|
6
|
+
/**
|
|
7
|
+
* @tokens Accordion spacing
|
|
8
|
+
* @presenter Spacing
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
--accordion-gap: var(--spacing-base);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @tokens Accordion common
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
--accordion-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
18
|
+
--accordion-border: none; // @presenter Border
|
|
19
|
+
|
|
20
|
+
--accordion-line-height: var(--line-height-base); // @presenter LineHeight
|
|
21
|
+
--accordion-font-size: var(--font-size-base); // @presenter FontSize
|
|
22
|
+
--accordion-font-family: var(--font-family-base); // @presenter FontFamily
|
|
23
|
+
--accordion-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @tokens Accordion header common
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
--accordion-header-font-family: var(--font-family-base); // @presenter FontFamily
|
|
30
|
+
--accordion-header-font-size: var(--font-size-base); // @presenter FontSize
|
|
31
|
+
--accordion-header-font-weight: var(--font-weight-medium, 500); // @presenter FontWeight
|
|
32
|
+
--accordion-header-text-color: var(--text-color-primary);
|
|
33
|
+
--accordion-header-padding: var(--spacing-sm) var(--spacing-base);
|
|
34
|
+
--accordion-header-line-height: var(--line-height-base); // @presenter LineHeight
|
|
35
|
+
--accordion-header-bg-color: transparent; // @presenter Color
|
|
36
|
+
--accordion-header-border: none; // @presenter Border
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @tokens Accordion body common
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
--accordion-body-font-family: var(--font-family-base); // @presenter FontFamily
|
|
43
|
+
--accordion-body-font-size: var(--font-size-base); // @presenter FontSize
|
|
44
|
+
--accordion-body-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
45
|
+
--accordion-body-text-color: var(--text-color-secondary);
|
|
46
|
+
--accordion-body-padding: 0 var(--spacing-xs) var(--spacing-sm);
|
|
47
|
+
--accordion-body-bg-color: transparent; // @presenter Color
|
|
48
|
+
--accordion-body-border: none; // @presenter Border
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @tokens Accordion chevron icon
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
--accordion-chevron-icon-color: var(--text-color-secondary); // @presenter Color
|
|
55
|
+
--accordion-chevron-icon-size: 16px;
|
|
56
|
+
|
|
57
|
+
// @tokens End
|
|
58
|
+
`;
|
|
59
|
+
//# sourceMappingURL=variables.js.map
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.AIAssistantButton = AIAssistantButton;
|
|
30
|
+
const React = __importStar(require("react"));
|
|
31
|
+
const react_1 = require("react");
|
|
32
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
33
|
+
const Button_1 = require("../../components/Button/Button");
|
|
34
|
+
const SearchDialog_1 = require("../../components/Search/SearchDialog");
|
|
35
|
+
const hooks_1 = require("../../core/hooks");
|
|
36
|
+
const ChatIcon_1 = require("../../icons/ChatIcon/ChatIcon");
|
|
37
|
+
const AiStarsGradientIcon_1 = require("../../icons/AiStarsGradientIcon/AiStarsGradientIcon");
|
|
38
|
+
const RedoclyIcon_1 = require("../../icons/RedoclyIcon/RedoclyIcon");
|
|
39
|
+
const defaultConfig = {
|
|
40
|
+
hide: false,
|
|
41
|
+
inputType: 'button',
|
|
42
|
+
inputIcon: 'redocly',
|
|
43
|
+
};
|
|
44
|
+
const getIcon = (iconType, inputType = 'button') => {
|
|
45
|
+
const iconSize = inputType === 'icon'
|
|
46
|
+
? 'var(--ai-assistant-button-icon-icon-size)'
|
|
47
|
+
: 'var(--ai-assistant-button-text-icon-size)';
|
|
48
|
+
const redoclyIcon = (React.createElement(RedoclyIcon_1.RedoclyIcon, { size: iconSize, color: "var(--ai-assistant-button-redocly-icon-color)" }));
|
|
49
|
+
const sparklesIcon = (React.createElement(AiStarsGradientIcon_1.AiStarsGradientIcon, { size: iconSize, color: "var(--search-ai-button-icon-color)" }));
|
|
50
|
+
const chatIcon = React.createElement(ChatIcon_1.ChatIcon, { size: iconSize });
|
|
51
|
+
switch (iconType) {
|
|
52
|
+
case 'chat':
|
|
53
|
+
return chatIcon;
|
|
54
|
+
case 'sparkles':
|
|
55
|
+
return sparklesIcon;
|
|
56
|
+
case 'redocly':
|
|
57
|
+
return redoclyIcon;
|
|
58
|
+
default:
|
|
59
|
+
return redoclyIcon;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
function AIAssistantButton() {
|
|
63
|
+
var _a, _b;
|
|
64
|
+
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
65
|
+
const themeConfig = (0, hooks_1.useThemeConfig)();
|
|
66
|
+
const { useTranslate } = (0, hooks_1.useThemeHooks)();
|
|
67
|
+
const { translate } = useTranslate();
|
|
68
|
+
const buttonConfig = Object.assign(Object.assign({}, defaultConfig), ((_b = (_a = themeConfig.aiAssistant) === null || _a === void 0 ? void 0 : _a.trigger) !== null && _b !== void 0 ? _b : {}));
|
|
69
|
+
const { hide, inputIcon, inputType } = buttonConfig;
|
|
70
|
+
if (hide) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
const icon = getIcon(inputIcon, inputType);
|
|
74
|
+
const text = translate('aiAssistant.trigger', 'Ask AI');
|
|
75
|
+
const handleOpen = () => {
|
|
76
|
+
setIsOpen(true);
|
|
77
|
+
};
|
|
78
|
+
const handleClose = () => {
|
|
79
|
+
setIsOpen(false);
|
|
80
|
+
};
|
|
81
|
+
return (React.createElement(React.Fragment, null,
|
|
82
|
+
React.createElement(StyledAIAssistantButton, { variant: "outlined", size: "medium", "$inputType": inputType, onClick: handleOpen, "aria-label": `AI Assistant button - ${inputIcon}`, "data-component-name": "Buttons/AIAssistantButton" },
|
|
83
|
+
icon,
|
|
84
|
+
inputType === 'button' && text),
|
|
85
|
+
isOpen && React.createElement(SearchDialog_1.SearchDialog, { onClose: handleClose, initialMode: "ai-dialog" })));
|
|
86
|
+
}
|
|
87
|
+
const StyledAIAssistantButton = (0, styled_components_1.default)(Button_1.Button) `
|
|
88
|
+
position: fixed;
|
|
89
|
+
bottom: var(--ai-assistant-button-bottom);
|
|
90
|
+
right: var(--ai-assistant-button-right);
|
|
91
|
+
${({ $inputType }) => $inputType === 'icon'
|
|
92
|
+
? `
|
|
93
|
+
border-radius: var(--ai-assistant-button-border-radius-icon);
|
|
94
|
+
width: var(--ai-assistant-button-icon-size);
|
|
95
|
+
height: var(--ai-assistant-button-icon-size);
|
|
96
|
+
`
|
|
97
|
+
: `
|
|
98
|
+
border-radius: var(--ai-assistant-button-border-radius-text);
|
|
99
|
+
padding: var(--ai-assistant-button-text-padding);
|
|
100
|
+
height: var(--ai-assistant-button-text-height);
|
|
101
|
+
`}
|
|
102
|
+
min-width: var(--ai-assistant-button-min-width);
|
|
103
|
+
font-size: var(--ai-assistant-button-font-size);
|
|
104
|
+
font-weight: var(--ai-assistant-button-font-weight);
|
|
105
|
+
box-shadow: var(--bg-raised-shadow);
|
|
106
|
+
z-index: var(--ai-assistant-button-z-index);
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
gap: var(--ai-assistant-button-gap);
|
|
111
|
+
background-color: var(--ai-assistant-button-bg-color) !important;
|
|
112
|
+
|
|
113
|
+
transition: var(--ai-assistant-button-transition);
|
|
114
|
+
|
|
115
|
+
&:hover {
|
|
116
|
+
box-shadow: var(--ai-assistant-button-shadow-hover);
|
|
117
|
+
transform: var(--ai-assistant-button-transform-hover);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&:active {
|
|
121
|
+
transform: var(--bg-raised-shadow);
|
|
122
|
+
box-shadow: var(--ai-assistant-button-shadow-active);
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
125
|
+
//# sourceMappingURL=AIAssistantButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const aiAssistantButton: import("styled-components").FlattenSimpleInterpolation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const aiAssistantButtonDarkMode: import("styled-components").FlattenSimpleInterpolation;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aiAssistantButtonDarkMode = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
exports.aiAssistantButtonDarkMode = (0, styled_components_1.css) `
|
|
6
|
+
|
|
7
|
+
/* Background color */
|
|
8
|
+
--ai-assistant-button-bg-color: var(--color-warm-grey-4);
|
|
9
|
+
`;
|
|
10
|
+
//# sourceMappingURL=variables.dark.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aiAssistantButton = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
exports.aiAssistantButton = (0, styled_components_1.css) `
|
|
6
|
+
/**
|
|
7
|
+
* @tokens AI Assistant Button
|
|
8
|
+
* @presenter Color
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/* Button sizing */
|
|
12
|
+
--ai-assistant-button-icon-size: 40px;
|
|
13
|
+
--ai-assistant-button-text-height: 40px;
|
|
14
|
+
--ai-assistant-button-text-padding: var(--spacing-sm) var(--spacing-md);
|
|
15
|
+
--ai-assistant-button-border-radius-icon: 50%;
|
|
16
|
+
--ai-assistant-button-border-radius-text: 1.75rem;
|
|
17
|
+
--ai-assistant-button-min-width: auto;
|
|
18
|
+
|
|
19
|
+
/* Icon sizing */
|
|
20
|
+
--ai-assistant-button-icon-icon-size: 18px;
|
|
21
|
+
--ai-assistant-button-text-icon-size: 20px;
|
|
22
|
+
|
|
23
|
+
/* Positioning */
|
|
24
|
+
--ai-assistant-button-bottom: var(--spacing-xl);
|
|
25
|
+
--ai-assistant-button-right: var(--spacing-xl);
|
|
26
|
+
--ai-assistant-button-z-index: 1000;
|
|
27
|
+
|
|
28
|
+
/* Typography */
|
|
29
|
+
--ai-assistant-button-font-size: var(--font-size-base);
|
|
30
|
+
--ai-assistant-button-font-weight: var(--font-weight-medium);
|
|
31
|
+
--ai-assistant-button-gap: var(--spacing-xs);
|
|
32
|
+
|
|
33
|
+
/* Background color */
|
|
34
|
+
--ai-assistant-button-bg-color: var(--color-static-white);
|
|
35
|
+
|
|
36
|
+
/* Icon colors */
|
|
37
|
+
--ai-assistant-button-redocly-icon-color: #297AFE;
|
|
38
|
+
|
|
39
|
+
/* Transform */
|
|
40
|
+
--ai-assistant-button-transform-hover: none;
|
|
41
|
+
--ai-assistant-button-transform-active: translateY(0);
|
|
42
|
+
|
|
43
|
+
/* Shadow */
|
|
44
|
+
--ai-assistant-button-shadow-hover:
|
|
45
|
+
2px 1px 12px 4px rgba(143, 98, 254, 0.2),
|
|
46
|
+
-3px -2px 24px 0px rgba(41, 122, 254, 0.2);
|
|
47
|
+
|
|
48
|
+
/* Transition */
|
|
49
|
+
--ai-assistant-button-transition: box-shadow 0.3s ease, transform 0.2s ease;
|
|
50
|
+
`;
|
|
51
|
+
//# sourceMappingURL=variables.js.map
|
|
@@ -9,7 +9,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
9
9
|
const utils_1 = require("../../core/utils");
|
|
10
10
|
const hooks_1 = require("../../core/hooks");
|
|
11
11
|
const H3_1 = require("../../components/Typography/H3");
|
|
12
|
-
const
|
|
12
|
+
const CatalogFilterContent_1 = require("../../components/Catalog/CatalogFilter/CatalogFilterContent");
|
|
13
13
|
const Sidebar_1 = require("../../components/Sidebar/Sidebar");
|
|
14
14
|
const CatalogSelector_1 = require("../../components/Catalog/CatalogSelector");
|
|
15
15
|
const SidebarActions_1 = require("../../components/SidebarActions/SidebarActions");
|
|
@@ -38,7 +38,7 @@ function Catalog(props) {
|
|
|
38
38
|
const { filters, searchQuery, setSearchQuery, filterQuery, sortOption, setSortOption, handleSortClick, isColumnSorted, viewMode, setViewMode, entitiesCounter, setEntitiesCounter, onChangeViewClick, onChangeCollapseSidebarClick, layout, collapsedSidebar, } = useCatalog(catalogConfig, (initialEntitiesList === null || initialEntitiesList === void 0 ? void 0 : initialEntitiesList.page.total) || 0, initialViewMode);
|
|
39
39
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
40
40
|
react_1.default.createElement(CatalogPageWrapper, { "data-component-name": "Catalog/Catalog" },
|
|
41
|
-
react_1.default.createElement(FiltersSidebar, { collapsed: collapsedSidebar, header: collapsedSidebar ? null : (react_1.default.createElement(CatalogSelector_1.CatalogSelector, { catalogSwitcherItems: catalogSwitcherItems, setSearchQuery: setSearchQuery, setSortOption: setSortOption })), menu: react_1.default.createElement(
|
|
41
|
+
react_1.default.createElement(FiltersSidebar, { collapsed: collapsedSidebar, header: collapsedSidebar ? null : (react_1.default.createElement(CatalogSelector_1.CatalogSelector, { catalogSwitcherItems: catalogSwitcherItems, setSearchQuery: setSearchQuery, setSortOption: setSortOption })), menu: react_1.default.createElement(CatalogFilterContent_1.CatalogFilterContent, { setFilterTerm: setSearchQuery, filters: filters, filterTerm: searchQuery, hideSearch: true, showCounter: false, filterValuesCasing: customCatalogOptionsCasing }), footer: react_1.default.createElement(SidebarActions_1.SidebarActions, { layout: layout, collapsedSidebar: collapsedSidebar, isApiDocs: false, onChangeViewClick: onChangeViewClick, onChangeCollapseSidebarClick: onChangeCollapseSidebarClick }) }),
|
|
42
42
|
react_1.default.createElement(CatalogPageContent, null,
|
|
43
43
|
react_1.default.createElement(CatalogPageDescription, null,
|
|
44
44
|
react_1.default.createElement(CatalogTitleWrapper, null,
|
|
@@ -51,7 +51,7 @@ function Catalog(props) {
|
|
|
51
51
|
react_1.default.createElement(CatalogDescription, { "data-translation-key": catalogConfig === null || catalogConfig === void 0 ? void 0 : catalogConfig.descriptionTranslationKey }, translate(catalogConfig === null || catalogConfig === void 0 ? void 0 : catalogConfig.descriptionTranslationKey))),
|
|
52
52
|
react_1.default.createElement(CatalogActionsRow, null,
|
|
53
53
|
react_1.default.createElement(CatalogSearchInputWrapper, null,
|
|
54
|
-
react_1.default.createElement(FilterInput_1.FilterInput, { value: searchQuery, onChange: (updatedTerm) => setSearchQuery(updatedTerm) })),
|
|
54
|
+
react_1.default.createElement(FilterInput_1.FilterInput, { value: searchQuery, onChange: (updatedTerm) => setSearchQuery(updatedTerm), dataTestId: "catalog-search-input" })),
|
|
55
55
|
react_1.default.createElement(CatalogControlsWrapper, null,
|
|
56
56
|
react_1.default.createElement(CatalogSortButton_1.CatalogSortButton, { onSortChange: setSortOption, currentSort: sortOption }),
|
|
57
57
|
react_1.default.createElement(CatalogViewModeToggle_1.CatalogViewModeToggle, { viewMode: viewMode, onViewModeChange: setViewMode }))),
|
|
@@ -13,7 +13,7 @@ const MoleculesIcon_1 = require("../../../../icons/MoleculesIcon/MoleculesIcon")
|
|
|
13
13
|
const NetworkIcon_1 = require("../../../../icons/NetworkIcon/NetworkIcon");
|
|
14
14
|
function CatalogEntityApiDescriptionRelations({ entity, relations, query, searchQuery, setSearchQuery, setFilter, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, }) {
|
|
15
15
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityApiDescriptionRelations" },
|
|
16
|
-
react_1.default.createElement(Tabs_1.Tabs, { key: entity.id,
|
|
16
|
+
react_1.default.createElement(Tabs_1.Tabs, { key: entity.id, size: Tabs_1.TabsSize.MEDIUM },
|
|
17
17
|
react_1.default.createElement(TabItem, { label: "Operations", icon: react_1.default.createElement(MoleculesIcon_1.MoleculesIcon, null), onClick: () => setFilter('type:api-operation') },
|
|
18
18
|
react_1.default.createElement(CatalogEntityDefaultRelations_1.CatalogEntityDefaultRelations, { key: "operations-table", entity: entity, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore, shouldShowHeading: false, listType: "api-operation" })),
|
|
19
19
|
react_1.default.createElement(TabItem, { label: "Schemas", icon: react_1.default.createElement(NetworkIcon_1.NetworkIcon, null), onClick: () => setFilter('type:data-schema') },
|
package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js
CHANGED
|
@@ -40,7 +40,7 @@ const teamColumns = [
|
|
|
40
40
|
];
|
|
41
41
|
function CatalogEntityTeamRelations({ entity, relations, query, searchQuery, setSearchQuery, setFilter, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, }) {
|
|
42
42
|
return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations" },
|
|
43
|
-
react_1.default.createElement(Tabs_1.Tabs, {
|
|
43
|
+
react_1.default.createElement(Tabs_1.Tabs, { size: Tabs_1.TabsSize.MEDIUM },
|
|
44
44
|
react_1.default.createElement(TabItem, { label: "Members", icon: react_1.default.createElement(PeopleIcon_1.PeopleIcon, null), onClick: () => setFilter('type:user') },
|
|
45
45
|
react_1.default.createElement(CatalogEntityRelationsTable_1.CatalogEntityRelationsTable, { key: "members-table", entity: entity, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, relations: relations, query: query, searchQuery: searchQuery, setSearchQuery: setSearchQuery, columns: teamColumns, sortOption: sortOption, setSortOption: setSortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, shouldShowLoadMore: shouldShowLoadMore, listType: "team" })),
|
|
46
46
|
react_1.default.createElement(TabItem, { label: "Related entities", icon: react_1.default.createElement(EntityTypeIcon_1.EntityTypeIcon, null), onClick: () => setFilter('-type:user') },
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { FilterProps } from '../../../core/types';
|
|
3
|
+
export type CatalogFilterProps = FilterProps & {
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function CatalogFilter({ filter, filterValuesCasing, showCounter, className, }: CatalogFilterProps): JSX.Element | null;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CatalogFilter = CatalogFilter;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const CatalogFilterSelect_1 = require("../../../components/Catalog/CatalogFilter/CatalogFilterSelect");
|
|
10
|
+
const CatalogFilterCheckboxes_1 = require("../../../components/Catalog/CatalogFilter/CatalogFilterCheckboxes");
|
|
11
|
+
const CatalogFilterDateRange_1 = require("../../../components/Catalog/CatalogFilter/CatalogFilterDateRange");
|
|
12
|
+
const filterComponents = {
|
|
13
|
+
select: CatalogFilterSelect_1.CatalogFilterSelect,
|
|
14
|
+
'date-range': CatalogFilterDateRange_1.CatalogFilterDateRange,
|
|
15
|
+
checkboxes: CatalogFilterCheckboxes_1.CatalogFilterCheckboxes,
|
|
16
|
+
};
|
|
17
|
+
function CatalogFilter({ filter, filterValuesCasing, showCounter = true, className, }) {
|
|
18
|
+
if (!filter.parentUsed)
|
|
19
|
+
return null;
|
|
20
|
+
const FilterComponent = filterComponents[(filter.type || 'checkboxes')];
|
|
21
|
+
return (react_1.default.createElement(CatalogFilterGroup, { className: className, "data-component-name": "Catalog/CatalogFilter", key: filter.property + filter.title },
|
|
22
|
+
react_1.default.createElement(FilterComponent, { filter: filter, filterValuesCasing: filterValuesCasing, showCounter: showCounter })));
|
|
23
|
+
}
|
|
24
|
+
const CatalogFilterGroup = styled_components_1.default.div `
|
|
25
|
+
padding: var(--filter-group-padding);
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
gap: var(--filter-group-gap);
|
|
29
|
+
border-bottom: 1px solid var(--catalog-table-border-color);
|
|
30
|
+
|
|
31
|
+
&:first-child {
|
|
32
|
+
border-top: 1px solid var(--catalog-table-border-color);
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
//# sourceMappingURL=CatalogFilter.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { FilterProps } from '../../../core/types';
|
|
3
|
+
export type CatalogFilterCheckboxesProps = FilterProps & {
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function CatalogFilterCheckboxes({ filter, filterValuesCasing, showCounter, className, }: CatalogFilterCheckboxesProps): JSX.Element;
|