-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathStyleGuide.tsx
More file actions
152 lines (139 loc) · 4.17 KB
/
StyleGuide.tsx
File metadata and controls
152 lines (139 loc) · 4.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/* eslint-disable react/jsx-props-no-spreading */
import React from 'react';
import cl from 'classnames';
import {
ContextMenuRoot,
ThemePicker,
useTheme,
Flex,
ToastContainer,
} from '@deephaven/components';
import Buttons from './Buttons';
import Charts from './Charts';
import Colors from './Colors';
import ContextMenus from './ContextMenus';
import Dialog from './Dialog';
import DropdownMenus from './DropdownMenus';
import Editors from './Editors';
import Grids from './Grids';
import Icons from './Icons';
import Inputs from './Inputs';
import ItemListInputs from './ItemListInputs';
import Modals from './Modals';
import Progress from './Progress';
import TimeSliderInputs from './TimeSliderInputs';
import Tooltips from './Tooltips';
import Toast from './Toast';
import Typograpy from './Typography';
import './StyleGuide.scss';
import DraggableLists from './DraggableLists';
import Navigations from './Navigations';
import ThemeColors from './ThemeColors';
import SpectrumComponents from './SpectrumComponents';
import SamplesMenu, { SampleMenuCategory } from './SamplesMenu';
import GotoTopButton from './GotoTopButton';
import { ISOLATED_SECTION_QUERY_CLASS, useIsolateSectionHash } from './utils';
import { GoldenLayout } from './GoldenLayout';
import { RandomAreaPlotAnimation } from './RandomAreaPlotAnimation';
import SpectrumComparison from './SpectrumComparison';
import Pickers from './Pickers';
import ListViews from './ListViews';
import ErrorViews from './ErrorViews';
import XComponents from './XComponents';
import CheckboxGroups from './CheckboxGroups';
const stickyProps = {
position: 'sticky',
justifyContent: 'end',
zIndex: 1,
UNSAFE_style: {
float: 'right',
},
} as const;
function StyleGuide(): React.ReactElement {
const { themes } = useTheme();
const hasMultipleThemes = themes.length > 1;
const isIsolatedSection = useIsolateSectionHash() !== '';
return (
// Needs a tabindex to capture focus on popper blur
// AppMainContainer has a tabindex of -1 in the app itself
<div tabIndex={-1} role="main">
<div
className={cl(
'container',
'style-guide-container',
isIsolatedSection && ISOLATED_SECTION_QUERY_CLASS
)}
>
<Flex
justifyContent="space-between"
alignItems="center"
marginTop="2rem"
marginBottom="1rem"
>
<h1 style={{ paddingTop: '2rem' }}>Deephaven UI Components</h1>
</Flex>
<Flex
{...stickyProps}
UNSAFE_className={
isIsolatedSection ? 'hide-when-isolated' : undefined
}
marginTop={-56}
top={20}
gap={10}
alignItems="end"
>
{hasMultipleThemes ? <ThemePicker /> : null}
<SamplesMenu />
</Flex>
<Flex
{...stickyProps}
UNSAFE_className={
isIsolatedSection ? 'hide-when-isolated' : undefined
}
top="calc(100vh - 40px)"
marginTop={-32}
marginEnd={hasMultipleThemes ? -234 : 0}
>
<GotoTopButton />
</Flex>
<Typograpy />
<SampleMenuCategory data-menu-category="Colors" />
<Colors />
<ThemeColors />
<SampleMenuCategory data-menu-category="Layout" />
<GoldenLayout />
<SampleMenuCategory data-menu-category="Components" />
<Buttons />
<Progress />
<Inputs />
<ListViews />
<Pickers />
<ItemListInputs />
<DraggableLists />
<TimeSliderInputs />
<CheckboxGroups />
<Dialog />
<Modals />
<ContextMenus />
<DropdownMenus />
<Navigations />
<Toast />
<Tooltips />
<Icons />
<Editors />
<Grids />
<Charts />
<ContextMenuRoot />
<RandomAreaPlotAnimation />
<ErrorViews />
<XComponents />
<SampleMenuCategory data-menu-category="Spectrum Components" />
<SpectrumComponents />
<SampleMenuCategory data-menu-category="Spectrum Comparison" />
<SpectrumComparison />
<ToastContainer />
</div>
</div>
);
}
export default StyleGuide;