@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import type { JSX } from 'react';
|
|
@@ -9,41 +9,43 @@ import { Dropdown } from '@redocly/theme/components/Dropdown/Dropdown';
|
|
|
9
9
|
import { DropdownMenu } from '@redocly/theme/components/Dropdown/DropdownMenu';
|
|
10
10
|
import { DropdownMenuItem } from '@redocly/theme/components/Dropdown/DropdownMenuItem';
|
|
11
11
|
import { Button } from '@redocly/theme/components/Button/Button';
|
|
12
|
+
import { useTabs } from '@redocly/theme/core/hooks';
|
|
13
|
+
import { getTabId } from '@redocly/theme/core/utils';
|
|
12
14
|
|
|
13
15
|
type TabListProps = {
|
|
14
16
|
childrenArray: React.ReactElement<TabItemProps>[];
|
|
15
17
|
size: TabsSize;
|
|
16
|
-
overflowTabs: number[];
|
|
17
|
-
visibleTabs: number[];
|
|
18
|
-
setTabRef: (element: HTMLButtonElement | null, index: number) => void;
|
|
19
|
-
onTabClick: (labelOrIndex: string | number) => void;
|
|
20
|
-
handleKeyboard: (event: React.KeyboardEvent<HTMLButtonElement>, index: number) => void;
|
|
21
|
-
getTabId: (label: string, index: number) => string;
|
|
22
18
|
activeTab: string;
|
|
23
|
-
|
|
24
|
-
highlightStyle: { left: number; width: number };
|
|
25
|
-
allTabsHidden: boolean;
|
|
26
|
-
tabsContainerRef: React.RefObject<HTMLUListElement | null>;
|
|
19
|
+
onTabChange: (tab: string) => void;
|
|
27
20
|
};
|
|
28
21
|
|
|
29
22
|
export function TabList({
|
|
30
23
|
childrenArray,
|
|
31
24
|
size,
|
|
32
|
-
overflowTabs,
|
|
33
|
-
visibleTabs,
|
|
34
|
-
setTabRef,
|
|
35
|
-
onTabClick,
|
|
36
|
-
handleKeyboard,
|
|
37
|
-
getTabId,
|
|
38
25
|
activeTab,
|
|
39
|
-
|
|
40
|
-
highlightStyle,
|
|
41
|
-
allTabsHidden,
|
|
42
|
-
tabsContainerRef,
|
|
26
|
+
onTabChange,
|
|
43
27
|
}: TabListProps): JSX.Element {
|
|
28
|
+
const tabsContainerRef = useRef<HTMLUListElement>(null);
|
|
29
|
+
|
|
30
|
+
const { allTabsHidden, overflowTabs, visibleTabs, handleKeyboard, onTabClick, setTabRef } =
|
|
31
|
+
useTabs({
|
|
32
|
+
activeTab,
|
|
33
|
+
onTabChange,
|
|
34
|
+
containerRef: tabsContainerRef,
|
|
35
|
+
totalTabs: childrenArray.length,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const { highlightStyle } = useHighlightBarAnimation({
|
|
39
|
+
activeTab,
|
|
40
|
+
childrenArray,
|
|
41
|
+
overflowTabs,
|
|
42
|
+
tabsContainerRef,
|
|
43
|
+
visibleTabs,
|
|
44
|
+
});
|
|
45
|
+
|
|
44
46
|
return (
|
|
45
|
-
<TabListContainer role="tablist" ref={tabsContainerRef}
|
|
46
|
-
<HighlightBar size={size} style={
|
|
47
|
+
<TabListContainer role="tablist" ref={tabsContainerRef}>
|
|
48
|
+
<HighlightBar size={size} style={highlightStyle}>
|
|
47
49
|
<div />
|
|
48
50
|
</HighlightBar>
|
|
49
51
|
{childrenArray.map((child, index) => {
|
|
@@ -58,13 +60,7 @@ export function TabList({
|
|
|
58
60
|
icon={icon}
|
|
59
61
|
size={size}
|
|
60
62
|
disabled={child.props.disable}
|
|
61
|
-
setRef={(el: HTMLButtonElement | null) =>
|
|
62
|
-
setTabRef(el, index);
|
|
63
|
-
if (el) {
|
|
64
|
-
el.setAttribute('data-label', label);
|
|
65
|
-
el.setAttribute('data-animating', isAnimating.toString());
|
|
66
|
-
}
|
|
67
|
-
}}
|
|
63
|
+
setRef={(el: HTMLButtonElement | null) => setTabRef(el, index)}
|
|
68
64
|
onKeyDown={(event) => handleKeyboard(event, index)}
|
|
69
65
|
onClick={() => {
|
|
70
66
|
child.props.onClick?.();
|
|
@@ -121,6 +117,64 @@ export function TabList({
|
|
|
121
117
|
);
|
|
122
118
|
}
|
|
123
119
|
|
|
120
|
+
type UseHighlightBarAnimationProps = {
|
|
121
|
+
childrenArray: React.ReactElement<TabItemProps>[];
|
|
122
|
+
activeTab: string;
|
|
123
|
+
tabsContainerRef: React.RefObject<HTMLElement | null>;
|
|
124
|
+
visibleTabs: number[];
|
|
125
|
+
overflowTabs: number[];
|
|
126
|
+
};
|
|
127
|
+
const useHighlightBarAnimation = (props: UseHighlightBarAnimationProps) => {
|
|
128
|
+
const { childrenArray, activeTab, tabsContainerRef, visibleTabs, overflowTabs } = props;
|
|
129
|
+
|
|
130
|
+
const [highlightStyle, setHighlightStyle] = React.useState<{ left: number; width: number }>({
|
|
131
|
+
left: 0,
|
|
132
|
+
width: 0,
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
useEffect(() => {
|
|
136
|
+
const activeIndex = childrenArray.findIndex((child) => child.props.label === activeTab);
|
|
137
|
+
const container = tabsContainerRef.current;
|
|
138
|
+
|
|
139
|
+
if (!container || activeIndex === -1) {
|
|
140
|
+
setHighlightStyle({ left: 0, width: 0 });
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const activeTabElement: HTMLElement | null = container.querySelector(
|
|
145
|
+
`[data-label="${activeTab}"]`,
|
|
146
|
+
);
|
|
147
|
+
if (!activeTabElement) return;
|
|
148
|
+
|
|
149
|
+
container.querySelectorAll('[data-label]').forEach((el) => {
|
|
150
|
+
el.classList.remove('active');
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
const { offsetLeft, offsetWidth } = activeTabElement;
|
|
154
|
+
|
|
155
|
+
if (visibleTabs.includes(activeIndex)) {
|
|
156
|
+
activeTabElement.classList.add('active');
|
|
157
|
+
setHighlightStyle({ left: offsetLeft, width: offsetWidth });
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (overflowTabs.includes(activeIndex)) {
|
|
162
|
+
const moreButton = container.querySelector('button');
|
|
163
|
+
if (!moreButton) return;
|
|
164
|
+
|
|
165
|
+
const moreButtonRect = moreButton.getBoundingClientRect();
|
|
166
|
+
const containerRect = container.getBoundingClientRect();
|
|
167
|
+
setHighlightStyle({
|
|
168
|
+
left: moreButtonRect.left - containerRect.left,
|
|
169
|
+
width: moreButtonRect.width,
|
|
170
|
+
});
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
}, [activeTab, childrenArray, visibleTabs, overflowTabs, tabsContainerRef]);
|
|
174
|
+
|
|
175
|
+
return { highlightStyle };
|
|
176
|
+
};
|
|
177
|
+
|
|
124
178
|
export const TabListContainer = styled.ul`
|
|
125
179
|
position: relative;
|
|
126
180
|
display: flex;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import styled
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
3
|
|
|
4
4
|
import type { JSX } from 'react';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { useActiveTab } from '@redocly/theme/core/hooks';
|
|
7
7
|
import { TabList } from '@redocly/theme/markdoc/components/Tabs/TabList';
|
|
8
|
+
import { getTabId } from '@redocly/theme/core/utils';
|
|
8
9
|
|
|
9
10
|
export enum TabsSize {
|
|
10
11
|
SMALL = 'small',
|
|
@@ -20,140 +21,38 @@ export type TabItemProps = {
|
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
type TabsProps = {
|
|
24
|
+
id?: string;
|
|
23
25
|
children: React.ReactElement<TabItemProps>[];
|
|
24
26
|
className?: string;
|
|
25
27
|
size: TabsSize;
|
|
26
|
-
forceReady?: boolean;
|
|
27
28
|
initialTab?: string;
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
export function Tabs({
|
|
32
|
+
id,
|
|
31
33
|
children,
|
|
32
34
|
className,
|
|
33
35
|
size,
|
|
34
|
-
forceReady = false,
|
|
35
36
|
initialTab: propInitialTab,
|
|
36
37
|
}: TabsProps): JSX.Element {
|
|
37
38
|
const [childrenArray, setChildrenArray] = useState<React.ReactElement<TabItemProps>[]>(
|
|
38
39
|
React.Children.toArray(children) as React.ReactElement<TabItemProps>[],
|
|
39
40
|
);
|
|
40
41
|
|
|
42
|
+
const initialTab = propInitialTab ?? childrenArray[0]?.props.label ?? '';
|
|
43
|
+
const { activeTab, setActiveTab } = useActiveTab({ tabsId: id, initialTab });
|
|
44
|
+
|
|
41
45
|
useEffect(() => {
|
|
42
46
|
setChildrenArray(React.Children.toArray(children) as React.ReactElement<TabItemProps>[]);
|
|
43
47
|
}, [children]);
|
|
44
|
-
const tabsContainerRef = useRef<HTMLUListElement>(null);
|
|
45
|
-
const [isAnimating, setIsAnimating] = useState<boolean>(false);
|
|
46
|
-
const defaultInitialTab = childrenArray[0]?.props.label ?? '';
|
|
47
|
-
const initialTab = propInitialTab ?? defaultInitialTab;
|
|
48
|
-
const {
|
|
49
|
-
activeTab,
|
|
50
|
-
setTabRef,
|
|
51
|
-
onTabClick,
|
|
52
|
-
handleKeyboard,
|
|
53
|
-
getTabId,
|
|
54
|
-
visibleTabs,
|
|
55
|
-
overflowTabs,
|
|
56
|
-
ready,
|
|
57
|
-
allTabsHidden,
|
|
58
|
-
} = useTabs({
|
|
59
|
-
initialTab,
|
|
60
|
-
totalTabs: childrenArray.length,
|
|
61
|
-
containerRef: tabsContainerRef,
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
const [prevTab, setPrevTab] = React.useState(initialTab);
|
|
65
|
-
const [highlightStyle, setHighlightStyle] = React.useState<{ left: number; width: number }>({
|
|
66
|
-
left: 0,
|
|
67
|
-
width: 0,
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
useEffect(() => {
|
|
71
|
-
setPrevTab(activeTab);
|
|
72
|
-
setIsAnimating(true);
|
|
73
|
-
|
|
74
|
-
const activeIndex = childrenArray.findIndex((child) => child.props.label === activeTab);
|
|
75
|
-
const container = tabsContainerRef.current;
|
|
76
|
-
|
|
77
|
-
if (container) {
|
|
78
|
-
container.querySelectorAll('[data-label]').forEach((el) => {
|
|
79
|
-
el.classList.remove('active');
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
container.getBoundingClientRect();
|
|
83
|
-
|
|
84
|
-
requestAnimationFrame(() => {
|
|
85
|
-
if (activeIndex >= 0) {
|
|
86
|
-
let activeTabElement: HTMLElement | null = null;
|
|
87
|
-
let startPosition = { left: 0, width: 0 };
|
|
88
|
-
|
|
89
|
-
if (visibleTabs.includes(activeIndex)) {
|
|
90
|
-
activeTabElement = container.querySelector(
|
|
91
|
-
`[data-label="${activeTab}"]`,
|
|
92
|
-
) as HTMLElement;
|
|
93
|
-
} else if (overflowTabs.includes(activeIndex)) {
|
|
94
|
-
const moreButton = container.querySelector('button') as HTMLElement;
|
|
95
|
-
if (moreButton) {
|
|
96
|
-
const moreButtonRect = moreButton.getBoundingClientRect();
|
|
97
|
-
const containerRect = container.getBoundingClientRect();
|
|
98
|
-
startPosition = {
|
|
99
|
-
left: moreButtonRect.left - containerRect.left,
|
|
100
|
-
width: moreButtonRect.width,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (activeTabElement) {
|
|
106
|
-
const { offsetLeft, offsetWidth } = activeTabElement;
|
|
107
|
-
|
|
108
|
-
if (overflowTabs.includes(activeIndex)) {
|
|
109
|
-
setHighlightStyle(startPosition);
|
|
110
|
-
requestAnimationFrame(() => {
|
|
111
|
-
setHighlightStyle({ left: offsetLeft, width: offsetWidth });
|
|
112
|
-
});
|
|
113
|
-
} else {
|
|
114
|
-
setHighlightStyle({ left: offsetLeft, width: offsetWidth });
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (visibleTabs.includes(activeIndex)) {
|
|
118
|
-
activeTabElement?.classList.add('active');
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return () => {
|
|
122
|
-
container.querySelectorAll('[data-label]').forEach((el) => {
|
|
123
|
-
el.classList.remove('active');
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
setHighlightStyle({ left: 0, width: 0 });
|
|
129
|
-
setIsAnimating(false);
|
|
130
|
-
});
|
|
131
|
-
} else {
|
|
132
|
-
setHighlightStyle({ left: 0, width: 0 });
|
|
133
|
-
setIsAnimating(false);
|
|
134
|
-
}
|
|
135
|
-
}, [activeTab, prevTab, childrenArray, visibleTabs, overflowTabs]);
|
|
136
48
|
|
|
137
49
|
return (
|
|
138
|
-
<TabsContainer
|
|
139
|
-
data-component-name="Markdoc/Tabs/Tabs"
|
|
140
|
-
className={className}
|
|
141
|
-
isReady={ready || forceReady}
|
|
142
|
-
>
|
|
50
|
+
<TabsContainer data-component-name="Markdoc/Tabs/Tabs" className={className} key={id}>
|
|
143
51
|
<TabList
|
|
144
52
|
size={size}
|
|
145
53
|
childrenArray={childrenArray}
|
|
146
|
-
overflowTabs={overflowTabs}
|
|
147
|
-
setTabRef={setTabRef}
|
|
148
|
-
onTabClick={onTabClick}
|
|
149
|
-
handleKeyboard={handleKeyboard}
|
|
150
|
-
getTabId={getTabId}
|
|
151
54
|
activeTab={activeTab}
|
|
152
|
-
|
|
153
|
-
highlightStyle={highlightStyle}
|
|
154
|
-
visibleTabs={visibleTabs}
|
|
155
|
-
allTabsHidden={allTabsHidden}
|
|
156
|
-
tabsContainerRef={tabsContainerRef}
|
|
55
|
+
onTabChange={setActiveTab}
|
|
157
56
|
/>
|
|
158
57
|
{childrenArray.map((child, index) => {
|
|
159
58
|
const { label } = child.props;
|
|
@@ -173,8 +72,7 @@ export function Tabs({
|
|
|
173
72
|
</TabsContainer>
|
|
174
73
|
);
|
|
175
74
|
}
|
|
176
|
-
|
|
177
|
-
const TabsContainer = styled.div<{ isReady: boolean }>`
|
|
75
|
+
const TabsContainer = styled.div`
|
|
178
76
|
position: relative;
|
|
179
77
|
color: var(--md-tabs-container-text-color);
|
|
180
78
|
font-size: var(--md-tabs-container-font-size);
|
|
@@ -186,17 +84,6 @@ const TabsContainer = styled.div<{ isReady: boolean }>`
|
|
|
186
84
|
padding: var(--md-tabs-container-padding);
|
|
187
85
|
border: var(--md-tabs-container-border);
|
|
188
86
|
|
|
189
|
-
${({ isReady }) =>
|
|
190
|
-
!isReady
|
|
191
|
-
? css`
|
|
192
|
-
visibility: hidden;
|
|
193
|
-
overflow: hidden;
|
|
194
|
-
`
|
|
195
|
-
: css`
|
|
196
|
-
visibility: visible;
|
|
197
|
-
overflow: visible;
|
|
198
|
-
`}
|
|
199
|
-
|
|
200
87
|
ol[class^='Tabs__TabList'] {
|
|
201
88
|
margin: 0;
|
|
202
89
|
padding: 0;
|
package/src/markdoc/tags/tabs.ts
CHANGED
|
@@ -22,6 +22,11 @@ export const tabs: MarkdocSchemaWrapper = {
|
|
|
22
22
|
return new markdoc.Tag('Tabs', attributes, tabsContent);
|
|
23
23
|
},
|
|
24
24
|
attributes: {
|
|
25
|
+
/*
|
|
26
|
+
A unique persistent identifier assigned to a component.
|
|
27
|
+
This value is used as a key for the query parameter that stores the active tab to enable deep linking.
|
|
28
|
+
*/
|
|
29
|
+
id: { type: String },
|
|
25
30
|
size: { type: String, matches: ['small', 'medium'], default: 'medium' },
|
|
26
31
|
},
|
|
27
32
|
},
|