docusaurus-theme-openapi-docs 0.0.0-beta.655 → 0.0.0-beta.657

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 (43) hide show
  1. package/lib/theme/ApiDemoPanel/ApiCodeBlock/Container/_Container.scss +1 -0
  2. package/lib/theme/ApiDemoPanel/ApiCodeBlock/Content/_Content.scss +2 -0
  3. package/lib/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/_ExpandButton.scss +20 -0
  4. package/lib/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.js +2 -17
  5. package/lib/theme/ApiDemoPanel/FormItem/index.js +2 -11
  6. package/lib/theme/ApiDemoPanel/MethodEndpoint/_MethodEndpoint.scss +16 -0
  7. package/lib/theme/ApiDemoPanel/MethodEndpoint/index.js +17 -12
  8. package/lib/theme/ApiDemoPanel/Request/index.js +2 -12
  9. package/lib/theme/ApiItem/index.js +2 -2
  10. package/lib/theme/ApiTabs/_ApiTabs.scss +29 -22
  11. package/lib/theme/ApiTabs/index.js +4 -3
  12. package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +12 -13
  13. package/lib/theme/Markdown/Details/_Details.scss +39 -6
  14. package/lib/theme/MimeTabs/_MimeTabs.scss +13 -8
  15. package/lib/theme/ParamsItem/_ParamsItem.scss +10 -8
  16. package/lib/theme/ParamsItem/index.js +2 -4
  17. package/lib/theme/SchemaItem/_SchemaItem.scss +29 -11
  18. package/lib/theme/SchemaItem/index.js +9 -10
  19. package/lib/theme/SchemaTabs/_SchemaTabs.scss +23 -16
  20. package/lib/theme/SchemaTabs/index.js +50 -54
  21. package/lib/theme/styles.scss +6 -1
  22. package/package.json +3 -3
  23. package/src/theme/ApiDemoPanel/ApiCodeBlock/Container/_Container.scss +1 -0
  24. package/src/theme/ApiDemoPanel/ApiCodeBlock/Content/_Content.scss +2 -0
  25. package/src/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/_ExpandButton.scss +20 -0
  26. package/src/theme/ApiDemoPanel/ApiCodeBlock/ExpandButton/index.js +2 -17
  27. package/src/theme/ApiDemoPanel/FormItem/index.tsx +1 -8
  28. package/src/theme/ApiDemoPanel/MethodEndpoint/_MethodEndpoint.scss +16 -0
  29. package/src/theme/ApiDemoPanel/MethodEndpoint/index.tsx +12 -9
  30. package/src/theme/ApiDemoPanel/Request/index.tsx +3 -8
  31. package/src/theme/ApiItem/index.tsx +2 -2
  32. package/src/theme/ApiTabs/_ApiTabs.scss +29 -22
  33. package/src/theme/ApiTabs/index.js +4 -3
  34. package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +12 -13
  35. package/src/theme/Markdown/Details/_Details.scss +39 -6
  36. package/src/theme/MimeTabs/_MimeTabs.scss +13 -8
  37. package/src/theme/ParamsItem/_ParamsItem.scss +10 -8
  38. package/src/theme/ParamsItem/index.js +2 -4
  39. package/src/theme/SchemaItem/_SchemaItem.scss +29 -11
  40. package/src/theme/SchemaItem/index.js +9 -10
  41. package/src/theme/SchemaTabs/_SchemaTabs.scss +23 -16
  42. package/src/theme/SchemaTabs/index.js +50 -54
  43. package/src/theme/styles.scss +6 -1
@@ -19,14 +19,12 @@
19
19
  content: "";
20
20
  display: inline-block;
21
21
  }
22
- }
23
-
24
- .openapi-params__list-item:hover {
25
- background-color: var(--ifm-menu-color-background-active);
26
- }
27
22
 
28
- .openapi-params__list-item:focus {
29
- background-color: var(--ifm-menu-color-background-active);
23
+ &:hover {
24
+ .openapi-schema__property {
25
+ color: var(--ifm-color-primary);
26
+ }
27
+ }
30
28
  }
31
29
 
32
30
  .openapi-schema__type {
@@ -35,10 +33,14 @@
35
33
  }
36
34
 
37
35
  .openapi-schema__required {
36
+ display: inline-flex;
37
+ align-items: center;
38
+ font-size: 10.5px;
39
+ font-weight: bold;
38
40
  color: var(--openapi-required);
39
41
  margin-left: 1%;
40
42
  background-color: transparent;
41
- font-size: 10.5px;
43
+ text-transform: uppercase;
42
44
  }
43
45
 
44
46
  .openapi-schema__divider {
@@ -37,9 +37,7 @@ function ParamsItem({
37
37
  ));
38
38
 
39
39
  const renderSchemaRequired = guard(required, () => (
40
- <span className="badge badge--danger openapi-schema__required">
41
- required
42
- </span>
40
+ <span className="openapi-schema__required">required</span>
43
41
  ));
44
42
 
45
43
  const renderSchema = guard(getQualifierMessage(schema), (message) => (
@@ -121,7 +119,7 @@ function ParamsItem({
121
119
  return (
122
120
  <div className="openapi-params__list-item">
123
121
  <span className="openapi-schema__container">
124
- <strong>{name}</strong>
122
+ <strong className="openapi-schema__property">{name}</strong>
125
123
  {renderSchemaName}
126
124
  {required && <span className="openapi-schema__divider"></span>}
127
125
  {renderSchemaRequired}
@@ -1,3 +1,11 @@
1
+ .openapi-schema__container {
2
+ &:hover {
3
+ .openapi-schema__property {
4
+ color: var(--ifm-color-primary);
5
+ }
6
+ }
7
+ }
8
+
1
9
  .openapi-schema__list-item {
2
10
  list-style: none;
3
11
  position: relative;
@@ -21,44 +29,54 @@
21
29
  }
22
30
  }
23
31
 
24
- .openapi-schema__list-item:hover {
25
- background-color: var(--ifm-menu-color-background-active);
26
- }
27
-
28
- .openapi-schema__list-item:focus {
29
- background-color: var(--ifm-menu-color-background-active);
30
- }
31
-
32
32
  .openapi-schema__name {
33
33
  opacity: 0.6;
34
34
  padding-left: 0.3rem;
35
35
  }
36
36
 
37
37
  .openapi-schema__required {
38
+ display: inline-flex;
39
+ align-items: center;
40
+ font-size: 10.5px;
41
+ font-weight: bold;
42
+ text-transform: uppercase;
38
43
  color: var(--openapi-required);
39
44
  margin-left: 1%;
40
45
  background-color: transparent;
41
- font-size: 10.5px;
42
46
  }
43
47
 
44
48
  .openapi-schema__deprecated {
49
+ display: flex;
50
+ align-items: center;
51
+ font-size: 10.5px;
52
+ font-weight: bold;
53
+ text-transform: uppercase;
45
54
  color: var(--openapi-deprecated);
46
55
  margin-left: 1%;
47
56
  background-color: transparent;
48
- font-size: 10.5px;
49
57
  }
50
58
 
51
59
  .openapi-schema__nullable {
60
+ display: flex;
61
+ align-items: center;
62
+ font-size: 10.5px;
63
+ font-weight: bold;
64
+ text-transform: uppercase;
52
65
  color: var(--openapi-nullable);
53
66
  margin-left: 1%;
54
67
  background-color: transparent;
55
- font-size: 10.5px;
56
68
  }
57
69
 
58
70
  .openapi-schema__strikethrough {
59
71
  text-decoration: line-through;
60
72
  }
61
73
 
74
+ .openapi-schema__property {
75
+ margin-top: 1.25px;
76
+ font-family: var(--ifm-font-family-monospace);
77
+ transition: 300ms;
78
+ }
79
+
62
80
  .openapi-schema__divider {
63
81
  flex-grow: 1;
64
82
  border-bottom: thin solid var(--ifm-toc-border-color);
@@ -9,6 +9,7 @@ import React from "react";
9
9
 
10
10
  import CodeBlock from "@theme/CodeBlock";
11
11
  /* eslint-disable import/no-extraneous-dependencies*/
12
+ import clsx from "clsx";
12
13
  import { createDescription } from "docusaurus-theme-openapi-docs/lib/markdown/createDescription";
13
14
  /* eslint-disable import/no-extraneous-dependencies*/
14
15
  import { guard } from "docusaurus-theme-openapi-docs/lib/markdown/utils";
@@ -37,21 +38,15 @@ function SchemaItem({
37
38
 
38
39
  const renderRequired = guard(
39
40
  Array.isArray(required) ? required.includes(name) : required,
40
- () => (
41
- <span className="badge badge--danger openapi-schema__required">
42
- required
43
- </span>
44
- )
41
+ () => <span className="openapi-schema__required">required</span>
45
42
  );
46
43
 
47
44
  const renderDeprecated = guard(deprecated, () => (
48
- <span className="badge badge--warning openapi-schema__deprecated">
49
- deprecated
50
- </span>
45
+ <span className="openapi-schema__deprecated">deprecated</span>
51
46
  ));
52
47
 
53
48
  const renderNullable = guard(nullable, () => (
54
- <span className="badge badge--info openapi-schema__nullable">nullable</span>
49
+ <span className="openapi-schema__nullable">nullable</span>
55
50
  ));
56
51
 
57
52
  const renderSchemaDescription = guard(schemaDescription, (description) => (
@@ -96,7 +91,11 @@ function SchemaItem({
96
91
  const schemaContent = (
97
92
  <div>
98
93
  <span className="openapi-schema__container">
99
- <strong className={deprecated && "openapi-schema__strikethrough"}>
94
+ <strong
95
+ className={clsx("openapi-schema__property", {
96
+ "openapi-schema__strikethrough": deprecated,
97
+ })}
98
+ >
100
99
  {name}
101
100
  </strong>
102
101
  <span className="openapi-schema__name"> {schemaName}</span>
@@ -5,30 +5,37 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ .openapi-tabs__schema-container {
9
+ margin-top: 1rem;
10
+ }
11
+
8
12
  .openapi-tabs__schema-item {
9
13
  display: flex;
10
14
  align-items: center;
11
15
  justify-content: center;
12
- height: 1.8rem;
16
+ padding: 0.35rem 0.7rem;
17
+ border: 1px solid transparent;
13
18
  margin-top: 0 !important;
14
19
  margin-right: 0.5rem;
15
- border: 1px solid var(--ifm-color-primary);
16
- border-radius: var(--ifm-global-radius);
17
- color: var(--ifm-color-primary);
18
- font-size: 12px;
19
- }
20
+ font-weight: var(--ifm-font-weight-bold);
21
+ font-family: var(--ifm-font-family-monospace);
22
+ font-size: 10px;
23
+ white-space: nowrap;
24
+ transition: 300ms;
20
25
 
21
- .openapi-tabs__schema-item:not(.active) {
22
- opacity: 0.65;
23
- }
26
+ &:hover {
27
+ background-color: transparent;
28
+ border: 1px solid var(--ifm-toc-border-color);
29
+ }
24
30
 
25
- .openapi-tabs__schema-item:hover {
26
- opacity: 1;
27
- background-color: var(--ifm-color-emphasis-100);
28
- }
31
+ &.active {
32
+ border: 1px solid var(--ifm-color-primary);
33
+ color: var(--ifm-color-primary);
34
+ }
29
35
 
30
- .openapi-tabs__schema-item:last-child {
31
- margin-right: 0 !important;
36
+ &:last-child {
37
+ margin-right: 0 !important;
38
+ }
32
39
  }
33
40
 
34
41
  .openapi-tabs__schema-list-container {
@@ -49,7 +56,7 @@
49
56
  white-space: nowrap;
50
57
  }
51
58
 
52
- .openapi-tabs__schema-container {
59
+ .openapi-tabs__schema-tabs-container {
53
60
  width: 100%;
54
61
  display: flex;
55
62
  align-items: center;
@@ -81,60 +81,56 @@ function TabList({ className, block, selectedValue, selectValue, tabValues }) {
81
81
  };
82
82
 
83
83
  return (
84
- <div className="tabs__container">
85
- <div className="openapi-tabs__schema-container">
86
- {showTabArrows && (
87
- <button
88
- className="openapi-tabs__arrow left"
89
- onClick={handleLeftClick}
90
- />
91
- )}
92
- <ul
93
- ref={tabItemListContainerRef}
94
- role="tablist"
95
- aria-orientation="horizontal"
96
- className={clsx(
97
- "openapi-tabs__schema-list-container",
98
- "tabs",
99
- {
100
- "tabs--block": block,
101
- },
102
- className
103
- )}
104
- >
105
- {tabValues.map(({ value, label, attributes }) => (
106
- <li
107
- // TODO extract TabListItem
108
- role="tab"
109
- tabIndex={selectedValue === value ? 0 : -1}
110
- aria-selected={selectedValue === value}
111
- key={value}
112
- ref={(tabControl) => tabRefs.push(tabControl)}
113
- onKeyDown={handleKeydown}
114
- onClick={handleTabChange}
115
- {...attributes}
116
- className={clsx(
117
- "tabs__item",
118
- "openapi-tabs__schema-item",
119
- attributes?.className,
120
- {
121
- active: selectedValue === value,
122
- }
123
- )}
124
- >
125
- <span className="openapi-tabs__schema-label">
126
- {label ?? value}
127
- </span>
128
- </li>
129
- ))}
130
- </ul>
131
- {showTabArrows && (
132
- <button
133
- className="openapi-tabs__arrow right"
134
- onClick={handleRightClick}
135
- />
84
+ <div className="openapi-tabs__schema-tabs-container">
85
+ {showTabArrows && (
86
+ <button
87
+ className="openapi-tabs__arrow left"
88
+ onClick={handleLeftClick}
89
+ />
90
+ )}
91
+ <ul
92
+ ref={tabItemListContainerRef}
93
+ role="tablist"
94
+ aria-orientation="horizontal"
95
+ className={clsx(
96
+ "openapi-tabs__schema-list-container",
97
+ "tabs",
98
+ {
99
+ "tabs--block": block,
100
+ },
101
+ className
136
102
  )}
137
- </div>
103
+ >
104
+ {tabValues.map(({ value, label, attributes }) => (
105
+ <li
106
+ // TODO extract TabListItem
107
+ role="tab"
108
+ tabIndex={selectedValue === value ? 0 : -1}
109
+ aria-selected={selectedValue === value}
110
+ key={value}
111
+ ref={(tabControl) => tabRefs.push(tabControl)}
112
+ onKeyDown={handleKeydown}
113
+ onClick={handleTabChange}
114
+ {...attributes}
115
+ className={clsx(
116
+ "tabs__item",
117
+ "openapi-tabs__schema-item",
118
+ attributes?.className,
119
+ {
120
+ active: selectedValue === value,
121
+ }
122
+ )}
123
+ >
124
+ <span className="openapi-tabs__schema-label">{label ?? value}</span>
125
+ </li>
126
+ ))}
127
+ </ul>
128
+ {showTabArrows && (
129
+ <button
130
+ className="openapi-tabs__arrow right"
131
+ onClick={handleRightClick}
132
+ />
133
+ )}
138
134
  </div>
139
135
  );
140
136
  }
@@ -167,7 +163,7 @@ function TabContent({ lazy, children, selectedValue }) {
167
163
  function TabsComponent(props) {
168
164
  const tabs = useTabs(props);
169
165
  return (
170
- <div className="tabs-container">
166
+ <div className="openapi-tabs__schema-container">
171
167
  <TabList {...props} {...tabs} />
172
168
  <TabContent {...props} {...tabs} />
173
169
  </div>
@@ -151,5 +151,10 @@
151
151
  }
152
152
 
153
153
  .openapi__heading {
154
- font-size: var(--ifm-h1-font-size);
154
+ font-size: 2rem;
155
+ margin-bottom: 0.5rem !important;
156
+ }
157
+
158
+ .openapi-left-panel__container {
159
+ border-right: thin solid var(--ifm-toc-border-color);
155
160
  }