@redocly/theme 0.1.0 → 0.1.3

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 (206) hide show
  1. package/Button/Button.d.ts +17 -0
  2. package/Button/Button.js +34 -0
  3. package/{lib/src/Button/index.ts → Button/index.d.ts} +0 -0
  4. package/Button/index.js +1 -0
  5. package/CodeBlock/CodeBlock.d.ts +1 -0
  6. package/CodeBlock/CodeBlock.js +7 -0
  7. package/{lib/src/CodeBlock/index.ts → CodeBlock/index.d.ts} +0 -0
  8. package/CodeBlock/index.js +1 -0
  9. package/CopyButton/CopyButton.d.ts +6 -0
  10. package/CopyButton/CopyButton.js +69 -0
  11. package/CopyButton/CopyButtonWrapper.d.ts +9 -0
  12. package/CopyButton/CopyButtonWrapper.js +37 -0
  13. package/{lib/src/CopyButton/index.ts → CopyButton/index.d.ts} +0 -0
  14. package/CopyButton/index.js +2 -0
  15. package/Headings/Headings.d.ts +3 -0
  16. package/Headings/Headings.js +10 -0
  17. package/{lib/src/Headings/index.ts → Headings/index.d.ts} +0 -0
  18. package/Headings/index.js +1 -0
  19. package/JsonViewer/JsonViewer.d.ts +10 -0
  20. package/JsonViewer/JsonViewer.js +92 -0
  21. package/{lib/src/JsonViewer/index.ts → JsonViewer/index.d.ts} +0 -0
  22. package/JsonViewer/index.js +1 -0
  23. package/JsonViewer/styled.d.ts +1 -0
  24. package/JsonViewer/styled.js +7 -0
  25. package/Logo/Logo.d.ts +10 -0
  26. package/Logo/Logo.js +25 -0
  27. package/Navbar/Navbar.d.ts +9 -0
  28. package/Navbar/Navbar.js +23 -0
  29. package/Navbar/NavbarItem.d.ts +40 -0
  30. package/Navbar/NavbarItem.js +43 -0
  31. package/Navbar/NavbarMenu.d.ts +4 -0
  32. package/Navbar/NavbarMenu.js +29 -0
  33. package/Panel/CodePanel.d.ts +1 -0
  34. package/Panel/CodePanel.js +13 -0
  35. package/Panel/ContentPanel.d.ts +1 -0
  36. package/Panel/ContentPanel.js +12 -0
  37. package/Panel/DarkHeader.d.ts +1 -0
  38. package/Panel/DarkHeader.js +7 -0
  39. package/Panel/Panel.d.ts +2 -0
  40. package/Panel/Panel.js +10 -0
  41. package/Panel/PanelBody.d.ts +6 -0
  42. package/Panel/PanelBody.js +15 -0
  43. package/Panel/PanelComponent.d.ts +10 -0
  44. package/Panel/PanelComponent.js +40 -0
  45. package/Panel/PanelHeader.d.ts +7 -0
  46. package/Panel/PanelHeader.js +16 -0
  47. package/Panel/PanelHeaderTitle.d.ts +1 -0
  48. package/Panel/PanelHeaderTitle.js +7 -0
  49. package/{lib/src/Panel/index.ts → Panel/index.d.ts} +0 -0
  50. package/Panel/index.js +7 -0
  51. package/SamplesPanelControls/SamplesPanelControls.d.ts +4 -0
  52. package/SamplesPanelControls/SamplesPanelControls.js +17 -0
  53. package/{lib/src/SamplesPanelControls/index.ts → SamplesPanelControls/index.d.ts} +0 -0
  54. package/SamplesPanelControls/index.js +1 -0
  55. package/SidebarLogo/SidebarLogo.d.ts +9 -0
  56. package/SidebarLogo/SidebarLogo.js +29 -0
  57. package/{lib/src/SidebarLogo/index.ts → SidebarLogo/index.d.ts} +0 -0
  58. package/SidebarLogo/index.js +1 -0
  59. package/SourceCode/SourceCode.d.ts +24 -0
  60. package/SourceCode/SourceCode.js +31 -0
  61. package/{lib/src/SourceCode/index.ts → SourceCode/index.d.ts} +0 -0
  62. package/SourceCode/index.js +1 -0
  63. package/Tooltip/Tooltip.d.ts +12 -0
  64. package/Tooltip/Tooltip.js +57 -0
  65. package/{lib/src/Tooltip/index.ts → Tooltip/index.d.ts} +0 -0
  66. package/Tooltip/index.js +1 -0
  67. package/globalStyle.d.ts +1 -0
  68. package/globalStyle.js +7 -0
  69. package/{lib/src/hooks/index.ts → hooks/index.d.ts} +0 -0
  70. package/hooks/index.js +3 -0
  71. package/hooks/useControl.d.ts +6 -0
  72. package/hooks/useControl.js +12 -0
  73. package/hooks/useMount.d.ts +1 -0
  74. package/hooks/useMount.js +7 -0
  75. package/hooks/useUnmount.d.ts +1 -0
  76. package/hooks/useUnmount.js +9 -0
  77. package/icons/ShelfIcon/ShelfIcon.d.ts +10 -0
  78. package/icons/ShelfIcon/ShelfIcon.js +33 -0
  79. package/{lib/src/icons/ShelfIcon/index.ts → icons/ShelfIcon/index.d.ts} +0 -0
  80. package/icons/ShelfIcon/index.js +1 -0
  81. package/{lib/src/icons/index.ts → icons/index.d.ts} +0 -0
  82. package/icons/index.js +1 -0
  83. package/{lib/src/index.ts → index.d.ts} +0 -0
  84. package/index.js +14 -0
  85. package/mocks/Link.d.ts +2 -0
  86. package/mocks/Link.js +17 -0
  87. package/mocks/utils.d.ts +1 -0
  88. package/mocks/utils.js +3 -0
  89. package/package.json +1 -5
  90. package/src/Button/Button.stories.tsx +74 -0
  91. package/{lib/src → src}/Button/Button.tsx +0 -0
  92. package/src/Button/__tests__/Button.test.tsx +42 -0
  93. package/src/Button/__tests__/__snapshots__/Button.test.tsx.snap +274 -0
  94. package/src/Button/index.ts +1 -0
  95. package/{lib/src → src}/CodeBlock/CodeBlock.ts +0 -0
  96. package/src/CodeBlock/__tests__/CodeBlock.test.tsx +12 -0
  97. package/src/CodeBlock/__tests__/__snapshots__/CodeBlock.test.tsx.snap +140 -0
  98. package/src/CodeBlock/index.ts +1 -0
  99. package/src/CopyButton/CopyButton.stories.tsx +18 -0
  100. package/{lib/src → src}/CopyButton/CopyButton.tsx +0 -0
  101. package/{lib/src → src}/CopyButton/CopyButtonWrapper.tsx +0 -0
  102. package/src/CopyButton/__tests__/CopyButton.test.tsx +35 -0
  103. package/src/CopyButton/__tests__/CopyButtonWrapper.test.tsx +16 -0
  104. package/src/CopyButton/__tests__/__snapshots__/CopyButton.test.tsx.snap +55 -0
  105. package/src/CopyButton/__tests__/__snapshots__/CopyButtonWrapper.test.tsx.snap +46 -0
  106. package/src/CopyButton/index.ts +2 -0
  107. package/src/Headings/Headings.stories.tsx +36 -0
  108. package/{lib/src → src}/Headings/Headings.ts +0 -0
  109. package/src/Headings/__tests__/Headings.test.tsx +24 -0
  110. package/src/Headings/__tests__/__snapshots__/Headings.test.tsx.snap +57 -0
  111. package/src/Headings/index.ts +1 -0
  112. package/src/Introduction.stories.mdx +7 -0
  113. package/src/JsonViewer/JsonViewer.stories.tsx +57 -0
  114. package/{lib/src → src}/JsonViewer/JsonViewer.tsx +0 -0
  115. package/src/JsonViewer/__tests__/JsonViewer.test.tsx +82 -0
  116. package/src/JsonViewer/__tests__/__snapshots__/JsonViewer.test.tsx.snap +2728 -0
  117. package/src/JsonViewer/index.ts +1 -0
  118. package/{lib/src → src}/JsonViewer/styled.ts +0 -0
  119. package/{lib/src → src}/Logo/Logo.tsx +0 -0
  120. package/src/Navbar/Navbar.stories.tsx +38 -0
  121. package/{lib/src → src}/Navbar/Navbar.tsx +0 -0
  122. package/{lib/src → src}/Navbar/NavbarItem.tsx +0 -0
  123. package/{lib/src → src}/Navbar/NavbarMenu.tsx +0 -0
  124. package/src/Panel/CodePanel.stories.tsx +27 -0
  125. package/{lib/src → src}/Panel/CodePanel.ts +0 -0
  126. package/src/Panel/ContentPanel.stories.tsx +27 -0
  127. package/{lib/src → src}/Panel/ContentPanel.ts +0 -0
  128. package/{lib/src → src}/Panel/DarkHeader.ts +0 -0
  129. package/src/Panel/Panel.stories.tsx +58 -0
  130. package/{lib/src → src}/Panel/Panel.ts +0 -0
  131. package/{lib/src → src}/Panel/PanelBody.ts +0 -0
  132. package/{lib/src → src}/Panel/PanelComponent.tsx +0 -0
  133. package/{lib/src → src}/Panel/PanelHeader.ts +0 -0
  134. package/{lib/src → src}/Panel/PanelHeaderTitle.ts +0 -0
  135. package/src/Panel/__tests__/CodePanel.test.tsx +26 -0
  136. package/src/Panel/__tests__/ContentPanel.test.tsx +26 -0
  137. package/src/Panel/__tests__/Panel.test.tsx +54 -0
  138. package/src/Panel/__tests__/__snapshots__/CodePanel.test.tsx.snap +258 -0
  139. package/src/Panel/__tests__/__snapshots__/ContentPanel.test.tsx.snap +278 -0
  140. package/src/Panel/__tests__/__snapshots__/Panel.test.tsx.snap +398 -0
  141. package/src/Panel/index.ts +7 -0
  142. package/src/SamplesPanelControls/SamplesControlButton.stories.tsx +18 -0
  143. package/{lib/src → src}/SamplesPanelControls/SamplesPanelControls.ts +0 -0
  144. package/src/SamplesPanelControls/__tests__/SamplesPanelControls.test.tsx +36 -0
  145. package/src/SamplesPanelControls/__tests__/__snapshots__/SamplesPanelControls.test.tsx.snap +228 -0
  146. package/src/SamplesPanelControls/index.ts +1 -0
  147. package/src/SidebarLogo/SidebarLogo.stories.tsx +21 -0
  148. package/{lib/src → src}/SidebarLogo/SidebarLogo.tsx +0 -0
  149. package/src/SidebarLogo/__tests__/SidebarLogo.test.tsx +32 -0
  150. package/src/SidebarLogo/__tests__/__snapshots__/SidebarLogo.test.tsx.snap +62 -0
  151. package/src/SidebarLogo/index.ts +1 -0
  152. package/src/SourceCode/SourceCode.stories.tsx +29 -0
  153. package/{lib/src → src}/SourceCode/SourceCode.tsx +0 -0
  154. package/src/SourceCode/__tests__/SourceCode.test.tsx +47 -0
  155. package/src/SourceCode/__tests__/__snapshots__/SourceCode.test.tsx.snap +786 -0
  156. package/src/SourceCode/index.ts +1 -0
  157. package/src/Tooltip/Tooltip.stories.tsx +27 -0
  158. package/{lib/src → src}/Tooltip/Tooltip.tsx +0 -0
  159. package/src/Tooltip/__tests__/Tooltip.test.tsx +41 -0
  160. package/src/Tooltip/__tests__/__snapshots__/Tooltip.test.tsx.snap +83 -0
  161. package/src/Tooltip/index.ts +1 -0
  162. package/{lib/src → src}/globalStyle.ts +0 -0
  163. package/src/hooks/index.ts +3 -0
  164. package/{lib/src → src}/hooks/useControl.ts +0 -0
  165. package/{lib/src → src}/hooks/useMount.ts +0 -0
  166. package/{lib/src → src}/hooks/useUnmount.ts +0 -0
  167. package/src/icons/ShelfIcon/ShelfIcon.stories.tsx +36 -0
  168. package/{lib/src → src}/icons/ShelfIcon/ShelfIcon.tsx +0 -0
  169. package/src/icons/ShelfIcon/__tests__/ShelfIcon.test.tsx +54 -0
  170. package/src/icons/ShelfIcon/__tests__/__snapshots__/ShelfIcon.test.tsx.snap +235 -0
  171. package/src/icons/ShelfIcon/index.ts +2 -0
  172. package/src/icons/index.ts +1 -0
  173. package/src/index.ts +14 -0
  174. package/{lib/src → src}/mocks/Link.tsx +0 -0
  175. package/{lib/src → src}/mocks/utils.ts +0 -0
  176. package/{lib/src → src}/utils/ClipboardService.ts +0 -0
  177. package/src/utils/__tests__/ClipboardService.test.ts +24 -0
  178. package/src/utils/__tests__/__snapshots__/highlight.test.ts.snap +5 -0
  179. package/src/utils/__tests__/__snapshots__/jsonToHtml.test.ts.snap +5 -0
  180. package/src/utils/__tests__/css-variables.test.ts +20 -0
  181. package/src/utils/__tests__/highlight.test.ts +51 -0
  182. package/src/utils/__tests__/jsonToHtml.test.ts +40 -0
  183. package/src/utils/__tests__/media-css.test.ts +20 -0
  184. package/src/utils/__tests__/theme-helpers.test.ts +25 -0
  185. package/{lib/src → src}/utils/css-variables.ts +0 -0
  186. package/{lib/src → src}/utils/highlight.ts +0 -0
  187. package/{lib/src → src}/utils/index.ts +0 -0
  188. package/{lib/src → src}/utils/jsonToHtml.ts +0 -0
  189. package/{lib/src → src}/utils/media-css.ts +0 -0
  190. package/{lib/src → src}/utils/theme-helpers.ts +0 -0
  191. package/utils/ClipboardService.d.ts +8 -0
  192. package/utils/ClipboardService.js +83 -0
  193. package/utils/css-variables.d.ts +1 -0
  194. package/utils/css-variables.js +4 -0
  195. package/utils/highlight.d.ts +32 -0
  196. package/utils/highlight.js +65 -0
  197. package/utils/index.d.ts +6 -0
  198. package/utils/index.js +6 -0
  199. package/utils/jsonToHtml.d.ts +1 -0
  200. package/utils/jsonToHtml.js +116 -0
  201. package/utils/media-css.d.ts +12 -0
  202. package/utils/media-css.js +9 -0
  203. package/utils/theme-helpers.d.ts +3 -0
  204. package/utils/theme-helpers.js +27 -0
  205. package/LICENSE +0 -1
  206. package/lib/package.json +0 -91
@@ -0,0 +1 @@
1
+ export * from './JsonViewer';
File without changes
File without changes
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+
4
+ import Navbar from './Navbar';
5
+ import NavbarMenu from './NavbarMenu';
6
+
7
+ import { Logo } from '@theme/Logo/Logo';
8
+
9
+ export default {
10
+ title: 'Navbar',
11
+ component: Navbar,
12
+ // argTypes: {
13
+ // size: {
14
+ // control: 'radio',
15
+ // options: ['small', 'medium', 'large', 'xlarge'],
16
+ // },
17
+ // color: {
18
+ // control: 'radio',
19
+ // options: ['primary', 'secondary', 'default'],
20
+ // },
21
+ // },
22
+ } as ComponentMeta<typeof Navbar>;
23
+
24
+ const Template: ComponentStory<typeof Navbar> = (args) => <Navbar {...args}>Click</Navbar>;
25
+
26
+ export const Main = Template.bind({});
27
+ Main.args = {
28
+ logo: <Logo logo={{ link: '/test/', image: 'https://picsum.photos/400/100' }} />,
29
+ menu: (
30
+ <NavbarMenu
31
+ menuItems={[
32
+ { type: 'link', link: 'https://google.com', label: 'Google' },
33
+ { type: 'link', link: '/test/', label: 'Test' },
34
+ ]}
35
+ />
36
+ ),
37
+ search: <span> search </span>,
38
+ };
File without changes
File without changes
File without changes
@@ -0,0 +1,27 @@
1
+ import React, { JSXElementConstructor } from 'react';
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+
4
+ import { CodePanel } from './CodePanel';
5
+ import { PanelComponentProps } from './PanelComponent';
6
+
7
+ export default {
8
+ title: 'Components/Panels/CodePanel',
9
+ component: CodePanel,
10
+ } as ComponentMeta<typeof CodePanel>;
11
+
12
+ // TODO: find the way to avoid using JSXElementConstructor<PanelComponentProps> and fix types for ComponentStory<typeof CodePanel>
13
+ const Template: ComponentStory<JSXElementConstructor<PanelComponentProps>> = (args) => (
14
+ <CodePanel {...args}>Code Panel body</CodePanel>
15
+ );
16
+
17
+ export const Collapsed = Template.bind({});
18
+ Collapsed.args = {
19
+ header: 'Code Panel header',
20
+ expanded: false,
21
+ };
22
+
23
+ export const Expanded = Template.bind({});
24
+ Expanded.args = {
25
+ header: 'Code Panel header',
26
+ expanded: true,
27
+ };
File without changes
@@ -0,0 +1,27 @@
1
+ import React, { JSXElementConstructor } from 'react';
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+
4
+ import { ContentPanel } from './ContentPanel';
5
+ import { PanelComponentProps } from './PanelComponent';
6
+
7
+ export default {
8
+ title: 'Components/Panels/ContentPanel',
9
+ component: ContentPanel,
10
+ } as ComponentMeta<typeof ContentPanel>;
11
+
12
+ // TODO: find the way to avoid using JSXElementConstructor<PanelComponentProps> and fix types for ComponentStory<typeof CodePanel>
13
+ const Template: ComponentStory<JSXElementConstructor<PanelComponentProps>> = (args) => (
14
+ <ContentPanel {...args}>Content Panel Body</ContentPanel>
15
+ );
16
+
17
+ export const Collapsed = Template.bind({});
18
+ Collapsed.args = {
19
+ header: 'Content Panel Header',
20
+ expanded: false,
21
+ };
22
+
23
+ export const Expanded = Template.bind({});
24
+ Expanded.args = {
25
+ header: 'Content Panel Header',
26
+ expanded: true,
27
+ };
File without changes
File without changes
@@ -0,0 +1,58 @@
1
+ import React, { JSXElementConstructor } from 'react';
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+ import { within, userEvent } from '@storybook/testing-library';
4
+
5
+ import { Panel } from './Panel';
6
+ import { PanelHeaderProps } from './PanelHeader';
7
+ import { PanelComponentProps } from './PanelComponent';
8
+
9
+ export default {
10
+ title: 'Components/Panels/Panel (base)',
11
+ component: Panel,
12
+ } as ComponentMeta<typeof Panel>;
13
+
14
+ const Template: ComponentStory<JSXElementConstructor<PanelComponentProps>> = (args) => (
15
+ <Panel {...args}>Panel body</Panel>
16
+ );
17
+
18
+ export const Default = Template.bind({});
19
+ Default.args = {
20
+ header: 'Panel header',
21
+ };
22
+
23
+ export const Collapsed = Template.bind({});
24
+ Collapsed.args = {
25
+ header: 'Panel header (click me)',
26
+ expanded: false,
27
+ };
28
+
29
+ export const Expanded = Template.bind({});
30
+ Expanded.args = {
31
+ header: 'Panel header (click me)',
32
+ expanded: true,
33
+ };
34
+
35
+ export const HeaderAsFunction = Template.bind({});
36
+ HeaderAsFunction.args = {
37
+ header: (props: PanelHeaderProps) => <div>Custom Header component: {JSON.stringify(props)}</div>,
38
+ };
39
+
40
+ export const HeaderAsComponent = Template.bind({});
41
+ HeaderAsComponent.args = {
42
+ header: <i>Header component</i>,
43
+ };
44
+
45
+ export const WithoutHeader = Template.bind({});
46
+ WithoutHeader.args = {};
47
+
48
+ // TODO: change to normal name after fixing problem with stories order!
49
+ export const WithDemoAnimation = Template.bind({});
50
+ WithDemoAnimation.args = {
51
+ expanded: false,
52
+ header: 'Panel header',
53
+ };
54
+ WithDemoAnimation.play = async ({ canvasElement }) => {
55
+ const canvas = within(canvasElement);
56
+
57
+ await userEvent.click(canvas.getByTestId('panel-header'));
58
+ };
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+
4
+ import { CodePanel } from '../CodePanel';
5
+
6
+ describe('CodePanel', () => {
7
+ it('renders collapsed', () => {
8
+ const { container } = render(
9
+ <CodePanel header={'CodePanel header'} expanded={false}>
10
+ CodePanel body
11
+ </CodePanel>,
12
+ );
13
+
14
+ expect(container.firstChild).toMatchSnapshot();
15
+ });
16
+
17
+ it('renders expanded', () => {
18
+ const { container } = render(
19
+ <CodePanel header={'CodePanel header'} expanded={true}>
20
+ CodePanel body
21
+ </CodePanel>,
22
+ );
23
+
24
+ expect(container.firstChild).toMatchSnapshot();
25
+ });
26
+ });
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+
4
+ import { ContentPanel } from '../ContentPanel';
5
+
6
+ describe('ContentPanel', () => {
7
+ it('renders collapsed', () => {
8
+ const { container } = render(
9
+ <ContentPanel header={'ContentPanel header'} expanded={false}>
10
+ ContentPanel body
11
+ </ContentPanel>,
12
+ );
13
+
14
+ expect(container.firstChild).toMatchSnapshot();
15
+ });
16
+
17
+ it('renders expanded', () => {
18
+ const { container } = render(
19
+ <ContentPanel header={'ContentPanel header'} expanded={true}>
20
+ ContentPanel body
21
+ </ContentPanel>,
22
+ );
23
+
24
+ expect(container.firstChild).toMatchSnapshot();
25
+ });
26
+ });
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+
4
+ import { Panel } from '../Panel';
5
+ import { PanelHeaderProps } from '../PanelHeader';
6
+
7
+ describe('Panel', () => {
8
+ it('renders without header', () => {
9
+ const { container } = render(<Panel>Panel body</Panel>);
10
+
11
+ expect(container.firstChild).toMatchSnapshot();
12
+ });
13
+
14
+ it('renders with header', () => {
15
+ const { container } = render(<Panel header={'Panel header'}>Panel body</Panel>);
16
+
17
+ expect(container.firstChild).toMatchSnapshot();
18
+ });
19
+
20
+ it('renders collapsed', () => {
21
+ const { container } = render(
22
+ <Panel header={'Panel header'} expanded={false}>
23
+ Panel body
24
+ </Panel>,
25
+ );
26
+
27
+ expect(container.firstChild).toMatchSnapshot();
28
+ });
29
+
30
+ it('renders expanded', () => {
31
+ const { container } = render(
32
+ <Panel header={'Panel header'} expanded={true}>
33
+ Panel body
34
+ </Panel>,
35
+ );
36
+
37
+ expect(container.firstChild).toMatchSnapshot();
38
+ });
39
+
40
+ it('renders with header as function', () => {
41
+ const { container } = render(
42
+ <Panel
43
+ header={(props: PanelHeaderProps) => (
44
+ <div>Custom Header component: {JSON.stringify(props)}</div>
45
+ )}
46
+ expanded={true}
47
+ >
48
+ Panel body
49
+ </Panel>,
50
+ );
51
+
52
+ expect(container.firstChild).toMatchSnapshot();
53
+ });
54
+ });
@@ -0,0 +1,258 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`CodePanel renders collapsed 1`] = `
4
+ .c8 {
5
+ height: 9px;
6
+ width: 9px;
7
+ -webkit-transform: rotateZ(0deg);
8
+ -ms-transform: rotateZ(0deg);
9
+ transform: rotateZ(0deg);
10
+ fill: inherit;
11
+ vertical-align: middle;
12
+ -webkit-transition: -webkit-transform 0.2s ease-out;
13
+ -webkit-transition: transform 0.2s ease-out;
14
+ transition: transform 0.2s ease-out;
15
+ }
16
+
17
+ .c3 {
18
+ position: relative;
19
+ z-index: 1;
20
+ display: -webkit-box;
21
+ display: -webkit-flex;
22
+ display: -ms-flexbox;
23
+ display: flex;
24
+ -webkit-align-items: center;
25
+ -webkit-box-align: center;
26
+ -ms-flex-align: center;
27
+ align-items: center;
28
+ -webkit-box-pack: justify;
29
+ -webkit-justify-content: space-between;
30
+ -ms-flex-pack: justify;
31
+ justify-content: space-between;
32
+ white-space: nowrap;
33
+ cursor: pointer;
34
+ border-top-left-radius: var(--panels-border-radius);
35
+ border-top-right-radius: var(--panels-border-radius);
36
+ border-bottom-right-radius: var(--panels-border-radius);
37
+ border-bottom-left-radius: var(--panels-border-radius);
38
+ pointer-events: auto;
39
+ }
40
+
41
+ .c6 {
42
+ line-height: 1;
43
+ margin-right: 5px;
44
+ font-weight: 700;
45
+ color: var(--color-content);
46
+ }
47
+
48
+ .c4 {
49
+ display: -webkit-inline-box;
50
+ display: -webkit-inline-flex;
51
+ display: -ms-inline-flexbox;
52
+ display: inline-flex;
53
+ -webkit-align-items: center;
54
+ -webkit-box-align: center;
55
+ -ms-flex-align: center;
56
+ align-items: center;
57
+ }
58
+
59
+ .c0 {
60
+ border-radius: var(--panels-border-radius);
61
+ }
62
+
63
+ .c0:not(:last-child) {
64
+ margin-bottom: 10px;
65
+ }
66
+
67
+ .c1 > .c2 {
68
+ padding: 10px 20px;
69
+ line-height: 30px;
70
+ z-index: 0;
71
+ background-color: var(--samples-panel-controls-background-color);
72
+ min-height: 50px;
73
+ }
74
+
75
+ .c1 > .c2 .c7 {
76
+ fill: var(--color-content-inverse);
77
+ position: relative;
78
+ }
79
+
80
+ .c1 > .c2 .c5 {
81
+ color: var(--color-content-inverse);
82
+ }
83
+
84
+ <div
85
+ class="c0 c1"
86
+ data-cy="panel-codepanel-header"
87
+ >
88
+ <div
89
+ class="c2 c3"
90
+ data-cy="panel-header"
91
+ >
92
+ <div
93
+ class="c4"
94
+ >
95
+ <span
96
+ class="c5 c6"
97
+ data-cy="title"
98
+ >
99
+ CodePanel header
100
+ </span>
101
+ <svg
102
+ aria-hidden="true"
103
+ class="c7 c8"
104
+ viewBox="0 0 4.25 7"
105
+ xmlns="http://www.w3.org/2000/svg"
106
+ >
107
+ <path
108
+ d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
109
+ />
110
+ <path
111
+ d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
112
+ />
113
+ </svg>
114
+ </div>
115
+ </div>
116
+ </div>
117
+ `;
118
+
119
+ exports[`CodePanel renders expanded 1`] = `
120
+ .c8 {
121
+ height: 9px;
122
+ width: 9px;
123
+ -webkit-transform: rotateZ(90deg);
124
+ -ms-transform: rotateZ(90deg);
125
+ transform: rotateZ(90deg);
126
+ fill: inherit;
127
+ vertical-align: middle;
128
+ -webkit-transition: -webkit-transform 0.2s ease-out;
129
+ -webkit-transition: transform 0.2s ease-out;
130
+ transition: transform 0.2s ease-out;
131
+ }
132
+
133
+ .c10 {
134
+ border-top-left-radius: var(--panels-border-radius);
135
+ border-top-right-radius: var(--panels-border-radius);
136
+ border-bottom-right-radius: var(--panels-border-radius);
137
+ border-bottom-left-radius: var(--panels-border-radius);
138
+ background-color: var(--panels-background-color);
139
+ }
140
+
141
+ .c3 {
142
+ position: relative;
143
+ z-index: 1;
144
+ display: -webkit-box;
145
+ display: -webkit-flex;
146
+ display: -ms-flexbox;
147
+ display: flex;
148
+ -webkit-align-items: center;
149
+ -webkit-box-align: center;
150
+ -ms-flex-align: center;
151
+ align-items: center;
152
+ -webkit-box-pack: justify;
153
+ -webkit-justify-content: space-between;
154
+ -ms-flex-pack: justify;
155
+ justify-content: space-between;
156
+ white-space: nowrap;
157
+ cursor: pointer;
158
+ border-top-left-radius: var(--panels-border-radius);
159
+ border-top-right-radius: var(--panels-border-radius);
160
+ border-bottom-right-radius: 0;
161
+ border-bottom-left-radius: 0;
162
+ pointer-events: auto;
163
+ }
164
+
165
+ .c6 {
166
+ line-height: 1;
167
+ margin-right: 5px;
168
+ font-weight: 700;
169
+ color: var(--color-content);
170
+ }
171
+
172
+ .c4 {
173
+ display: -webkit-inline-box;
174
+ display: -webkit-inline-flex;
175
+ display: -ms-inline-flexbox;
176
+ display: inline-flex;
177
+ -webkit-align-items: center;
178
+ -webkit-box-align: center;
179
+ -ms-flex-align: center;
180
+ align-items: center;
181
+ }
182
+
183
+ .c0 {
184
+ border-radius: var(--panels-border-radius);
185
+ }
186
+
187
+ .c0 .c2 + .c9 {
188
+ border-top-left-radius: 0;
189
+ border-top-right-radius: 0;
190
+ }
191
+
192
+ .c0:not(:last-child) {
193
+ margin-bottom: 10px;
194
+ }
195
+
196
+ .c1 > .c2 {
197
+ padding: 10px 20px;
198
+ line-height: 30px;
199
+ z-index: 0;
200
+ background-color: var(--samples-panel-controls-background-color);
201
+ min-height: 50px;
202
+ }
203
+
204
+ .c1 > .c2 .c7 {
205
+ fill: var(--color-content-inverse);
206
+ position: relative;
207
+ }
208
+
209
+ .c1 > .c2 .c5 {
210
+ color: var(--color-content-inverse);
211
+ }
212
+
213
+ .c1.c1 .c9 {
214
+ padding: 10px 20px 20px;
215
+ background-color: var(--samples-panel-background-color);
216
+ color: var(--color-content-inverse);
217
+ }
218
+
219
+ <div
220
+ class="c0 c1"
221
+ data-cy="panel-codepanel-header"
222
+ >
223
+ <div
224
+ class="c2 c3"
225
+ data-cy="panel-header"
226
+ >
227
+ <div
228
+ class="c4"
229
+ >
230
+ <span
231
+ class="c5 c6"
232
+ data-cy="title"
233
+ >
234
+ CodePanel header
235
+ </span>
236
+ <svg
237
+ aria-hidden="true"
238
+ class="c7 c8"
239
+ viewBox="0 0 4.25 7"
240
+ xmlns="http://www.w3.org/2000/svg"
241
+ >
242
+ <path
243
+ d="M0.205025 1.19467L3.00503 3.99467C3.27839 4.26804 3.72161 4.26804 3.99497 3.99467C4.26834 3.7213 4.26834 3.27809 3.99497 3.00472L1.19497 0.20472C0.921608 -0.0686469 0.478392 -0.0686469 0.205025 0.20472C-0.0683418 0.478087 -0.0683417 0.921303 0.205025 1.19467Z"
244
+ />
245
+ <path
246
+ d="M3.00503 3.00501L0.205025 5.80501C-0.0683417 6.07838 -0.0683417 6.5216 0.205025 6.79496C0.478392 7.06833 0.921608 7.06833 1.19497 6.79496L3.99497 3.99496C4.26834 3.7216 4.26834 3.27838 3.99497 3.00501C3.72161 2.73165 3.27839 2.73165 3.00503 3.00501Z"
247
+ />
248
+ </svg>
249
+ </div>
250
+ </div>
251
+ <div
252
+ class="c9 c10"
253
+ data-cy="panel-body"
254
+ >
255
+ CodePanel body
256
+ </div>
257
+ </div>
258
+ `;