@redocly/theme 0.17.1 → 0.18.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/I18n/LanguagePicker.js +53 -85
- package/lib/components/Catalog/Catalog.d.ts +1 -1
- package/lib/components/Catalog/useCatalog.d.ts +2 -1
- package/lib/components/Dropdown/Dropdown.d.ts +16 -0
- package/lib/components/Dropdown/Dropdown.js +113 -0
- package/lib/components/Dropdown/index.d.ts +1 -0
- package/lib/components/Dropdown/index.js +18 -0
- package/lib/components/Menu/MenuGroup.js +2 -0
- package/lib/components/Menu/MenuItem.js +2 -0
- package/lib/components/Menu/MobileMenu.d.ts +2 -9
- package/lib/components/Menu/MobileMenu.js +35 -65
- package/lib/components/Menu/MobileMenuGroup.js +2 -0
- package/lib/components/Menu/constants.d.ts +5 -0
- package/lib/components/Menu/constants.js +10 -0
- package/lib/components/Menu/hooks/use-mobile-menu-items.d.ts +2 -0
- package/lib/components/Menu/hooks/use-mobile-menu-items.js +83 -0
- package/lib/components/Menu/hooks/use-mobile-menu-levels.d.ts +5 -0
- package/lib/components/Menu/hooks/use-mobile-menu-levels.js +50 -0
- package/lib/components/Menu/types.d.ts +3 -0
- package/lib/components/Menu/types.js +3 -0
- package/lib/components/Menu/utils.d.ts +7 -0
- package/lib/components/Menu/utils.js +76 -0
- package/lib/components/Navbar/MobileUserProfile.d.ts +1 -1
- package/lib/components/Navbar/MobileUserProfile.js +4 -7
- package/lib/components/Navbar/Navbar.d.ts +0 -3
- package/lib/components/Navbar/Navbar.js +9 -12
- package/lib/components/Navbar/NavbarItem.d.ts +5 -1
- package/lib/components/Navbar/NavbarItem.js +15 -16
- package/lib/components/Navbar/NavbarMenu.js +1 -1
- package/lib/components/OpenApiDocs/Dropdown.js +5 -5
- package/lib/components/Product/Product.d.ts +7 -0
- package/lib/components/Product/Product.js +23 -0
- package/lib/components/Product/ProductPicker.d.ts +2 -0
- package/lib/components/Product/ProductPicker.js +83 -0
- package/lib/components/Product/index.d.ts +2 -0
- package/lib/components/Product/index.js +19 -0
- package/lib/components/Profile/UserProfile.js +54 -6
- package/lib/components/Search/InputWrapper.js +1 -7
- package/lib/components/Search/ProductTag.d.ts +6 -0
- package/lib/components/Search/ProductTag.js +61 -0
- package/lib/components/Search/SearchDialog.js +19 -4
- package/lib/components/Search/SearchItem.d.ts +2 -1
- package/lib/components/Search/SearchItem.js +13 -2
- package/lib/components/Search/index.d.ts +1 -0
- package/lib/components/Search/index.js +1 -0
- package/lib/components/Select/Select.d.ts +18 -0
- package/lib/components/Select/Select.js +118 -0
- package/lib/components/Select/index.d.ts +1 -0
- package/lib/components/Select/index.js +18 -0
- package/lib/components/Sidebar/DrilldownMenuItem.js +2 -9
- package/lib/components/Sidebar/SidebarItemIcon.d.ts +1 -0
- package/lib/components/Sidebar/SidebarItemIcon.js +16 -0
- package/lib/components/Sidebar/VersionPicker.d.ts +7 -0
- package/lib/components/Sidebar/VersionPicker.js +51 -0
- package/lib/components/Sidebar/index.d.ts +2 -0
- package/lib/components/Sidebar/index.js +2 -0
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.js +3 -0
- package/lib/config.d.ts +952 -25
- package/lib/config.js +115 -2
- package/lib/globalStyle.js +177 -16
- package/lib/hooks/useThemeConfig.d.ts +1 -1
- package/lib/hooks/useThemeConfig.js +7 -2
- package/lib/mocks/hooks/index.d.ts +4 -3
- package/lib/mocks/hooks/index.js +6 -2
- package/lib/mocks/search.d.ts +1 -1
- package/lib/mocks/search.js +1 -1
- package/lib/types/portal/src/shared/types/catalog.d.ts +2 -24
- package/lib/types/portal/src/shared/types/nav.d.ts +4 -0
- package/lib/types/portal/src/shared/types/searchDocument.d.ts +2 -0
- package/lib/ui/darkColors.js +2 -0
- package/lib/ui/index.d.ts +0 -1
- package/lib/ui/index.js +0 -1
- package/package.json +1 -1
- package/src/I18n/LanguagePicker.tsx +62 -89
- package/src/components/Catalog/Catalog.tsx +1 -1
- package/src/components/Catalog/useCatalog.ts +2 -3
- package/src/components/Dropdown/Dropdown.tsx +138 -0
- package/src/components/Dropdown/index.ts +1 -0
- package/src/components/Menu/MenuGroup.tsx +2 -0
- package/src/components/Menu/MenuItem.tsx +2 -0
- package/src/components/Menu/MobileMenu.tsx +43 -96
- package/src/components/Menu/MobileMenuGroup.tsx +2 -0
- package/src/components/Menu/constants.ts +5 -0
- package/src/components/Menu/hooks/use-mobile-menu-items.ts +100 -0
- package/src/components/Menu/hooks/use-mobile-menu-levels.ts +55 -0
- package/src/components/Menu/types.ts +3 -0
- package/src/components/Menu/utils.ts +109 -0
- package/src/components/Navbar/MobileUserProfile.tsx +19 -20
- package/src/components/Navbar/Navbar.tsx +12 -22
- package/src/components/Navbar/NavbarItem.tsx +20 -15
- package/src/components/Navbar/NavbarMenu.tsx +1 -1
- package/src/components/OpenApiDocs/Dropdown.tsx +5 -5
- package/src/components/Product/Product.tsx +28 -0
- package/src/components/Product/ProductPicker.tsx +97 -0
- package/src/components/Product/index.ts +2 -0
- package/src/components/Profile/UserProfile.tsx +80 -21
- package/src/components/Search/InputWrapper.tsx +1 -7
- package/src/components/Search/ProductTag.tsx +46 -0
- package/src/components/Search/SearchDialog.tsx +21 -5
- package/src/components/Search/SearchItem.tsx +17 -3
- package/src/components/Search/index.ts +1 -0
- package/src/components/Select/Select.tsx +140 -0
- package/src/components/Select/index.ts +1 -0
- package/src/components/Sidebar/DrilldownMenuItem.tsx +2 -10
- package/src/components/Sidebar/SidebarItemIcon.tsx +10 -0
- package/src/components/Sidebar/VersionPicker.tsx +48 -0
- package/src/components/Sidebar/index.ts +2 -0
- package/src/components/index.ts +3 -0
- package/src/config.ts +140 -6
- package/src/globalStyle.ts +181 -16
- package/src/hooks/useThemeConfig.ts +18 -3
- package/src/mocks/hooks/index.ts +9 -3
- package/src/mocks/search.ts +1 -1
- package/src/types/portal/src/shared/types/catalog.ts +2 -26
- package/src/types/portal/src/shared/types/i18n.d.ts +3 -1
- package/src/types/portal/src/shared/types/nav.ts +41 -37
- package/src/types/portal/src/shared/types/searchDocument.ts +7 -4
- package/src/ui/darkColors.tsx +2 -0
- package/src/ui/index.tsx +0 -1
- package/lib/components/Navbar/NavbarDropdown.d.ts +0 -9
- package/lib/components/Navbar/NavbarDropdown.js +0 -40
- package/lib/components/Profile/UserProfileMenu.d.ts +0 -8
- package/lib/components/Profile/UserProfileMenu.js +0 -93
- package/src/components/Navbar/NavbarDropdown.tsx +0 -48
- package/src/components/Profile/UserProfileMenu.tsx +0 -97
package/lib/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.themeConfigSchema = void 0;
|
|
3
|
+
exports.productThemeOverrideSchema = exports.themeConfigSchema = void 0;
|
|
4
4
|
const logoConfigSchema = {
|
|
5
5
|
type: 'object',
|
|
6
6
|
properties: {
|
|
@@ -78,7 +78,7 @@ const markdownConfigSchema = {
|
|
|
78
78
|
},
|
|
79
79
|
toc: {
|
|
80
80
|
type: 'object',
|
|
81
|
-
properties: Object.assign({ header: { type: 'string', default: 'On this page' }, depth: { type: '
|
|
81
|
+
properties: Object.assign({ header: { type: 'string', default: 'On this page' }, depth: { type: 'integer', default: 3, minimum: 1 } }, hideConfigSchema.properties),
|
|
82
82
|
additionalProperties: false,
|
|
83
83
|
default: {},
|
|
84
84
|
},
|
|
@@ -239,6 +239,16 @@ const navItemsSchema = {
|
|
|
239
239
|
type: 'array',
|
|
240
240
|
items: Object.assign(Object.assign({}, navItemSchema), { properties: Object.assign(Object.assign({}, navItemSchema.properties), { items: { type: 'array', items: navItemSchema } }) }),
|
|
241
241
|
};
|
|
242
|
+
const productConfigSchema = {
|
|
243
|
+
type: 'object',
|
|
244
|
+
properties: {
|
|
245
|
+
name: { type: 'string' },
|
|
246
|
+
icon: { type: 'string' },
|
|
247
|
+
folder: { type: 'string' },
|
|
248
|
+
},
|
|
249
|
+
additionalProperties: false,
|
|
250
|
+
required: ['name', 'icon', 'folder'],
|
|
251
|
+
};
|
|
242
252
|
const suggestedPageSchema = {
|
|
243
253
|
type: 'object',
|
|
244
254
|
properties: {
|
|
@@ -248,6 +258,89 @@ const suggestedPageSchema = {
|
|
|
248
258
|
},
|
|
249
259
|
required: ['page'],
|
|
250
260
|
};
|
|
261
|
+
const catalogFilterSchema = {
|
|
262
|
+
type: 'object',
|
|
263
|
+
additionalProperties: false,
|
|
264
|
+
required: ['title', 'property'],
|
|
265
|
+
properties: {
|
|
266
|
+
type: { type: 'string', enum: ['select', 'checkboxes', 'date-range'] },
|
|
267
|
+
title: { type: 'string' },
|
|
268
|
+
titleTranslationKey: { type: 'string' },
|
|
269
|
+
property: { type: 'string' },
|
|
270
|
+
parentFilter: { type: 'string' },
|
|
271
|
+
missingCategoryName: { type: 'string' },
|
|
272
|
+
missingCategoryNameTranslationKey: { type: 'string' },
|
|
273
|
+
options: { type: 'array', items: { type: 'string' } },
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
const scorecardConfigSchema = {
|
|
277
|
+
type: 'object',
|
|
278
|
+
additionalProperties: true,
|
|
279
|
+
required: ['levels'],
|
|
280
|
+
properties: {
|
|
281
|
+
failBuildIfBelowMinimum: { type: 'boolean', default: false },
|
|
282
|
+
levels: {
|
|
283
|
+
type: 'array',
|
|
284
|
+
items: {
|
|
285
|
+
type: 'object',
|
|
286
|
+
required: ['name'],
|
|
287
|
+
properties: {
|
|
288
|
+
name: { type: 'string' },
|
|
289
|
+
extends: { type: 'array', items: { type: 'string' } },
|
|
290
|
+
rules: {
|
|
291
|
+
type: 'object',
|
|
292
|
+
additionalProperties: {
|
|
293
|
+
type: ['object', 'string'],
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
additionalProperties: false,
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
targets: {
|
|
301
|
+
type: 'array',
|
|
302
|
+
items: {
|
|
303
|
+
type: 'object',
|
|
304
|
+
required: ['where'],
|
|
305
|
+
properties: {
|
|
306
|
+
minimumLevel: { type: 'string' },
|
|
307
|
+
where: {
|
|
308
|
+
type: 'object',
|
|
309
|
+
required: ['metadata'],
|
|
310
|
+
properties: {
|
|
311
|
+
metadata: { type: 'object', additionalProperties: { type: 'string' } },
|
|
312
|
+
},
|
|
313
|
+
additionalProperties: false,
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
additionalProperties: false,
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
};
|
|
321
|
+
const catalogSchema = {
|
|
322
|
+
type: 'object',
|
|
323
|
+
additionalProperties: true,
|
|
324
|
+
required: ['slug', 'filters', 'groupByFirstFilter', 'items'],
|
|
325
|
+
properties: {
|
|
326
|
+
slug: { type: 'string' },
|
|
327
|
+
filters: { type: 'array', items: catalogFilterSchema },
|
|
328
|
+
groupByFirstFilter: { type: 'boolean' },
|
|
329
|
+
items: navItemsSchema,
|
|
330
|
+
requiredPermission: { type: 'string' },
|
|
331
|
+
separateVersions: { type: 'boolean' },
|
|
332
|
+
title: { type: 'string' },
|
|
333
|
+
titleTranslationKey: { type: 'string' },
|
|
334
|
+
description: { type: 'string' },
|
|
335
|
+
descriptionTranslationKey: { type: 'string' },
|
|
336
|
+
},
|
|
337
|
+
};
|
|
338
|
+
const catalogsConfigSchema = {
|
|
339
|
+
type: 'object',
|
|
340
|
+
patternProperties: {
|
|
341
|
+
'.*': catalogSchema,
|
|
342
|
+
},
|
|
343
|
+
};
|
|
251
344
|
exports.themeConfigSchema = {
|
|
252
345
|
type: 'object',
|
|
253
346
|
properties: {
|
|
@@ -262,6 +355,10 @@ exports.themeConfigSchema = {
|
|
|
262
355
|
properties: Object.assign({ items: navItemsSchema }, hideConfigSchema.properties),
|
|
263
356
|
additionalProperties: false,
|
|
264
357
|
},
|
|
358
|
+
products: {
|
|
359
|
+
type: 'object',
|
|
360
|
+
additionalProperties: productConfigSchema,
|
|
361
|
+
},
|
|
265
362
|
footer: {
|
|
266
363
|
type: 'object',
|
|
267
364
|
properties: Object.assign({ items: navItemsSchema, copyrightText: { type: 'string' } }, hideConfigSchema.properties),
|
|
@@ -454,6 +551,22 @@ exports.themeConfigSchema = {
|
|
|
454
551
|
additionalProperties: false,
|
|
455
552
|
default: {},
|
|
456
553
|
},
|
|
554
|
+
catalog: catalogsConfigSchema,
|
|
555
|
+
scorecard: scorecardConfigSchema,
|
|
556
|
+
},
|
|
557
|
+
additionalProperties: true,
|
|
558
|
+
default: {},
|
|
559
|
+
};
|
|
560
|
+
exports.productThemeOverrideSchema = {
|
|
561
|
+
type: 'object',
|
|
562
|
+
properties: {
|
|
563
|
+
logo: exports.themeConfigSchema.properties.logo,
|
|
564
|
+
navbar: exports.themeConfigSchema.properties.navbar,
|
|
565
|
+
footer: exports.themeConfigSchema.properties.footer,
|
|
566
|
+
sidebar: exports.themeConfigSchema.properties.sidebar,
|
|
567
|
+
search: exports.themeConfigSchema.properties.search,
|
|
568
|
+
codeSnippet: exports.themeConfigSchema.properties.codeSnippet,
|
|
569
|
+
breadcrumbs: exports.themeConfigSchema.properties.breadcrumbs,
|
|
457
570
|
},
|
|
458
571
|
additionalProperties: true,
|
|
459
572
|
default: {},
|
package/lib/globalStyle.js
CHANGED
|
@@ -458,7 +458,7 @@ const sidebar = (0, styled_components_1.css) `
|
|
|
458
458
|
/**
|
|
459
459
|
* @tokens Sidebar item icon
|
|
460
460
|
*/
|
|
461
|
-
--sidebar-item-icon-size:
|
|
461
|
+
--sidebar-item-icon-size: 20px;
|
|
462
462
|
--sidebar-item-icon-border-radius: 100%;
|
|
463
463
|
|
|
464
464
|
/**
|
|
@@ -1339,9 +1339,9 @@ const apiReferenceDocs = (0, styled_components_1.css) `
|
|
|
1339
1339
|
*/
|
|
1340
1340
|
|
|
1341
1341
|
--schemas-mime-type-dropdown-padding: 0px 26px 0px 4px;
|
|
1342
|
-
--schemas-mime-type-dropdown-border: var(--dropdown-border); // @presenter Border
|
|
1343
|
-
--schemas-mime-type-dropdown-font-size: var(--dropdown-font-size); // @presenter FontSize
|
|
1344
|
-
--schemas-mime-type-dropdown-text-color: var(--dropdown-
|
|
1342
|
+
--schemas-mime-type-dropdown-border: var(--docs-dropdown-border); // @presenter Border
|
|
1343
|
+
--schemas-mime-type-dropdown-font-size: var(--docs-dropdown-font-size); // @presenter FontSize
|
|
1344
|
+
--schemas-mime-type-dropdown-text-color: var(--docs-dropdown-font-size); // @presenter Color
|
|
1345
1345
|
|
|
1346
1346
|
/**
|
|
1347
1347
|
* @tokens API Reference Schemas Discriminator Dropdown
|
|
@@ -1349,8 +1349,8 @@ const apiReferenceDocs = (0, styled_components_1.css) `
|
|
|
1349
1349
|
|
|
1350
1350
|
--schemas-discriminator-dropdown-padding: 2px 24px 2px 8px;
|
|
1351
1351
|
--schemas-discriminator-dropdown-border: 1px solid var(--border-color); // @presenter Border
|
|
1352
|
-
--schemas-discriminator-font-size: var(--dropdown-font-size); // @presenter FontSize
|
|
1353
|
-
--schemas-discriminator-dropdown-text-color: var(--dropdown-text-color); // @presenter Color
|
|
1352
|
+
--schemas-discriminator-font-size: var(--docs-dropdown-font-size); // @presenter FontSize
|
|
1353
|
+
--schemas-discriminator-dropdown-text-color: var(--docs-dropdown-text-color); // @presenter Color
|
|
1354
1354
|
|
|
1355
1355
|
/**
|
|
1356
1356
|
* @tokens API Reference Schemas Titles
|
|
@@ -1615,7 +1615,7 @@ const navbar = (0, styled_components_1.css) `
|
|
|
1615
1615
|
--navbar-item-font-size: 16px; // @presenter FontSize
|
|
1616
1616
|
--navbar-item-padding-horizontal: 16px; // @presenter Spacing
|
|
1617
1617
|
--navbar-item-padding-vertical: 8px; // @presenter Spacing
|
|
1618
|
-
--navbar-item-
|
|
1618
|
+
--navbar-item-gap: 5px;
|
|
1619
1619
|
--navbar-item-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
1620
1620
|
--navbar-item-font-weight: var(--font-weight-bold); // @presenter FontWeight
|
|
1621
1621
|
--navbar-item-hover-background-color: var(--color-primary-300);
|
|
@@ -1653,6 +1653,16 @@ const breadcrumbs = (0, styled_components_1.css) `
|
|
|
1653
1653
|
|
|
1654
1654
|
// @tokens End
|
|
1655
1655
|
`;
|
|
1656
|
+
const product = (0, styled_components_1.css) `
|
|
1657
|
+
/**
|
|
1658
|
+
* @tokens Product
|
|
1659
|
+
*/
|
|
1660
|
+
--product-padding-horizontal: 8px; // @presenter Spacing
|
|
1661
|
+
--product-padding-vertical: 8px; // @presenter Spacing
|
|
1662
|
+
--product-logo-margin: 10px; // @presenter Spacing
|
|
1663
|
+
|
|
1664
|
+
// @tokens End
|
|
1665
|
+
`;
|
|
1656
1666
|
const mobileMenu = (0, styled_components_1.css) `
|
|
1657
1667
|
/**
|
|
1658
1668
|
* @tokens Mobile Menu icons
|
|
@@ -1997,17 +2007,165 @@ const search = (0, styled_components_1.css) `
|
|
|
1997
2007
|
|
|
1998
2008
|
// @tokens End
|
|
1999
2009
|
`;
|
|
2000
|
-
const
|
|
2001
|
-
--dropdown-font-size: 14px;
|
|
2002
|
-
--dropdown-text-color: var(--text-color);
|
|
2010
|
+
const docsDropdown = (0, styled_components_1.css) `
|
|
2011
|
+
--docs-dropdown-font-size: 14px;
|
|
2012
|
+
--docs-dropdown-text-color: var(--text-color);
|
|
2003
2013
|
|
|
2004
|
-
--dropdown-padding-vertical: 8px;
|
|
2005
|
-
--dropdown-padding-left: 10px;
|
|
2006
|
-
--dropdown-padding-right: 26px;
|
|
2007
|
-
--dropdown-padding: var(--dropdown-padding-vertical) var(--dropdown-padding-right)
|
|
2008
|
-
var(--dropdown-padding-vertical) var(--dropdown-padding-left);
|
|
2014
|
+
--docs-dropdown-padding-vertical: 8px;
|
|
2015
|
+
--docs-dropdown-padding-left: 10px;
|
|
2016
|
+
--docs-dropdown-padding-right: 26px;
|
|
2017
|
+
--docs-dropdown-padding: var(--docs-dropdown-padding-vertical) var(--docs-dropdown-padding-right)
|
|
2018
|
+
var(--docs-dropdown-padding-vertical) var(--docs-dropdown-padding-left);
|
|
2009
2019
|
|
|
2010
|
-
--dropdown-border: none;
|
|
2020
|
+
--docs-dropdown-border: none;
|
|
2021
|
+
`;
|
|
2022
|
+
const dropdown = (0, styled_components_1.css) `
|
|
2023
|
+
--dropdown-font-size: 16px; // @presenter FontSize
|
|
2024
|
+
--dropdown-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
2025
|
+
--dropdown-line-height: var(--line-height-base); // @presenter LineHeight
|
|
2026
|
+
--dropdown-text-color: var(--text-color); // @presenter Color
|
|
2027
|
+
--dropdown-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
2028
|
+
|
|
2029
|
+
--dropdown-list-min-width: 100px;
|
|
2030
|
+
--dropdown-list-max-width: 300px;
|
|
2031
|
+
--dropdown-list-padding: 4px; // @presenter Spacing
|
|
2032
|
+
--dropdown-list-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
2033
|
+
--dropdown-list-background-color: var(--background-color); // @presenter Color
|
|
2034
|
+
--dropdown-list-box-shadow: 0px 9px 28px 8px rgba(0, 0, 0, 0.05), 0px 6px 16px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12); // @presenter Shadow
|
|
2035
|
+
|
|
2036
|
+
--dropdown-list-item-horizontal-padding: 16px; // @presenter Spacing
|
|
2037
|
+
--dropdown-list-item-vertical-padding: 8px; // @presenter Spacing
|
|
2038
|
+
--dropdown-list-item-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
2039
|
+
--dropdown-list-item-active-background-color: #0000000a; // @presenter Color
|
|
2040
|
+
--dropdown-list-item-separator-color: var(--border-color); // @presenter Color
|
|
2041
|
+
|
|
2042
|
+
/**
|
|
2043
|
+
* @tokens User profile menu dropdown
|
|
2044
|
+
* */
|
|
2045
|
+
|
|
2046
|
+
--profile-dropdown-font-size: var(--dropdown-font-size); // @presenter FontSize
|
|
2047
|
+
--profile-dropdown-font-weight: var(--dropdown-font-weight); // @presenter FontWeight
|
|
2048
|
+
--profile-dropdown-line-height: var(--dropdown-line-height); // @presenter LineHeight
|
|
2049
|
+
--profile-dropdown-text-color: var(--dropdown-text-color); // @presenter Color
|
|
2050
|
+
--profile-dropdown-border-radius: var(--dropdown-border-radius); // @presenter BorderRadius
|
|
2051
|
+
|
|
2052
|
+
--profile-dropdown-list-min-width: var(--dropdown-list-min-width);
|
|
2053
|
+
--profile-dropdown-list-max-width: var(--dropdown-list-max-width);
|
|
2054
|
+
--profile-dropdown-list-padding: var(--dropdown-list-padding); // @presenter Spacing
|
|
2055
|
+
--profile-dropdown-list-border-radius: var(--dropdown-list-border-radius); // @presenter BorderRadius
|
|
2056
|
+
--profile-dropdown-list-background-color: var(--dropdown-list-background-color); // @presenter Color
|
|
2057
|
+
--profile-dropdown-list-box-shadow: var(--dropdown-list-box-shadow); // @presenter Shadow
|
|
2058
|
+
|
|
2059
|
+
--profile-dropdown-list-item-horizontal-padding: var(--dropdown-list-item-horizontal-padding); // @presenter Spacing
|
|
2060
|
+
--profile-dropdown-list-item-vertical-padding: var(--dropdown-list-item-vertical-padding); // @presenter Spacing
|
|
2061
|
+
--profile-dropdown-list-item-border-radius: var(--dropdown-list-item-border-radius); // @presenter BorderRadius
|
|
2062
|
+
--profile-dropdown-list-item-active-background-color: var(--dropdown-list-item-active-background-color); // @presenter Color
|
|
2063
|
+
--profile-dropdown-list-item-separator-color: var(--dropdown-list-item-separator-color); // @presenter Color
|
|
2064
|
+
`;
|
|
2065
|
+
const select = (0, styled_components_1.css) `
|
|
2066
|
+
--select-font-size: 16px; // @presenter FontSize
|
|
2067
|
+
--select-font-weight: var(--font-weight-regular); // @presenter FontWeight
|
|
2068
|
+
--select-line-height: var(--line-height-base); // @presenter LineHeight
|
|
2069
|
+
--select-text-color: var(--text-color); // @presenter Color
|
|
2070
|
+
--select-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
2071
|
+
|
|
2072
|
+
--select-input-padding-horizontal: 16px; // @presenter Spacing
|
|
2073
|
+
--select-input-padding-vertical: 6px; // @presenter Spacing
|
|
2074
|
+
--select-input-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
2075
|
+
|
|
2076
|
+
--select-list-min-width: 100px;
|
|
2077
|
+
--select-list-max-width: 300px;
|
|
2078
|
+
--select-list-padding: 4px; // @presenter Spacing
|
|
2079
|
+
--select-list-border-radius: var(--border-radius-lg); // @presenter BorderRadius
|
|
2080
|
+
--select-list-background-color: var(--background-color); // @presenter Color
|
|
2081
|
+
--select-list-box-shadow: 0px 9px 28px 8px rgba(0, 0, 0, 0.05), 0px 6px 16px rgba(0, 0, 0, 0.08), 0px 3px 6px -4px rgba(0, 0, 0, 0.12);
|
|
2082
|
+
|
|
2083
|
+
--select-list-item-horizontal-padding: 16px; // @presenter Spacing
|
|
2084
|
+
--select-list-item-vertical-padding: 8px; // @presenter Spacing
|
|
2085
|
+
--select-list-item-border-radius: var(--border-radius); // @presenter BorderRadius
|
|
2086
|
+
--select-list-item-active-background-color: #0000000a; // @presenter Color
|
|
2087
|
+
|
|
2088
|
+
/**
|
|
2089
|
+
* @tokens Version picker
|
|
2090
|
+
* */
|
|
2091
|
+
|
|
2092
|
+
--version-picker-font-size: var(--font-size-base); // @presenter FontSize
|
|
2093
|
+
--version-picker-font-weight: var(--select-font-weight); // @presenter FontWeight
|
|
2094
|
+
--version-picker-line-height: var(--select-line-height); // @presenter LineHeight
|
|
2095
|
+
--version-picker-text-color: var(--select-text-color); // @presenter Color
|
|
2096
|
+
--version-picker-border-radius: var(--select-border-radius); // @presenter BorderRadius
|
|
2097
|
+
--version-picker-margin-vertical: 10px; // @presenter Spacing
|
|
2098
|
+
--version-picker-margin-horizontal: 15px; // @presenter Spacing
|
|
2099
|
+
|
|
2100
|
+
--version-picker-input-padding-horizontal: var(--select-input-padding-horizontal); // @presenter Spacing
|
|
2101
|
+
--version-picker-input-padding-vertical: var(--select-input-padding-vertical); // @presenter Spacing
|
|
2102
|
+
--version-picker-input-border: 1px solid var(--border-color); // @presenter Border
|
|
2103
|
+
--version-picker-input-border-radius: var(--select-input-border-radius); // @presenter BorderRadius
|
|
2104
|
+
|
|
2105
|
+
--version-picker-list-min-width: var(--select-list-min-width);
|
|
2106
|
+
--version-picker-list-max-width: var(--select-list-max-width);
|
|
2107
|
+
--version-picker-list-padding: var(--select-list-padding); // @presenter Spacing
|
|
2108
|
+
--version-picker-list-border-radius: var(--select-list-border-radius); // @presenter BorderRadius
|
|
2109
|
+
--version-picker-list-background-color: var(--select-list-background-color); // @presenter Color
|
|
2110
|
+
--version-picker-list-box-shadow: var(--select-list-box-shadow); // @presenter Shadow
|
|
2111
|
+
|
|
2112
|
+
--version-picker-list-item-horizontal-padding: var(--select-list-item-horizontal-padding); // @presenter Spacing
|
|
2113
|
+
--version-picker-list-item-vertical-padding: var(--select-list-item-vertical-padding); // @presenter Spacing
|
|
2114
|
+
--version-picker-list-item-border-radius: var(--select-list-item-border-radius); // @presenter BorderRadius
|
|
2115
|
+
--version-picker-list-item-active-background-color: var(--select-list-item-active-background-color); // @presenter Color
|
|
2116
|
+
|
|
2117
|
+
|
|
2118
|
+
/**
|
|
2119
|
+
* @tokens Language picker
|
|
2120
|
+
* */
|
|
2121
|
+
|
|
2122
|
+
--language-picker-font-size: var(--select-font-size); // @presenter FontSize
|
|
2123
|
+
--language-picker-font-weight: var(--select-font-weight); // @presenter FontWeight
|
|
2124
|
+
--language-picker-line-height: var(--select-line-height); // @presenter LineHeight
|
|
2125
|
+
--language-picker-text-color: var(--select-text-color); // @presenter Color
|
|
2126
|
+
--language-picker-border-radius: var(--select-border-radius); // @presenter BorderRadius
|
|
2127
|
+
|
|
2128
|
+
--language-picker-input-padding-horizontal: var(--select-input-padding-horizontal); // @presenter Spacing
|
|
2129
|
+
--language-picker-input-padding-vertical: var(--select-input-padding-vertical); // @presenter Spacing
|
|
2130
|
+
--language-picker-input-border-radius: var(--select-input-border-radius); // @presenter BorderRadius
|
|
2131
|
+
|
|
2132
|
+
--language-picker-list-min-width: var(--select-list-min-width);
|
|
2133
|
+
--language-picker-list-max-width: var(--select-list-max-width);
|
|
2134
|
+
--language-picker-list-padding: var(--select-list-padding); // @presenter Spacing
|
|
2135
|
+
--language-picker-list-border-radius: var(--select-list-border-radius); // @presenter BorderRadius
|
|
2136
|
+
--language-picker-list-background-color: var(--select-list-background-color); // @presenter Color
|
|
2137
|
+
--language-picker-list-box-shadow: var(--select-list-box-shadow); // @presenter Shadow
|
|
2138
|
+
|
|
2139
|
+
--language-picker-list-item-horizontal-padding: var(--select-list-item-horizontal-padding); // @presenter Spacing
|
|
2140
|
+
--language-picker-list-item-vertical-padding: var(--select-list-item-vertical-padding); // @presenter Spacing
|
|
2141
|
+
--language-picker-list-item-border-radius: var(--select-list-item-border-radius); // @presenter BorderRadius
|
|
2142
|
+
--language-picker-list-item-active-background-color: var(--select-list-item-active-background-color); // @presenter Color
|
|
2143
|
+
|
|
2144
|
+
/**
|
|
2145
|
+
* @tokens Product picker
|
|
2146
|
+
* */
|
|
2147
|
+
|
|
2148
|
+
--product-picker-font-size: var(--select-font-size); // @presenter FontSize
|
|
2149
|
+
--product-picker-font-weight: var(--select-font-weight); // @presenter FontWeight
|
|
2150
|
+
--product-picker-line-height: var(--select-line-height); // @presenter LineHeight
|
|
2151
|
+
--product-picker-text-color: var(--select-text-color); // @presenter Color
|
|
2152
|
+
--product-picker-border-radius: var(--select-border-radius); // @presenter BorderRadius
|
|
2153
|
+
|
|
2154
|
+
--product-picker-input-padding-horizontal: var(--select-input-padding-horizontal); // @presenter Spacing
|
|
2155
|
+
--product-picker-input-padding-vertical: var(--select-input-padding-vertical); // @presenter Spacing
|
|
2156
|
+
--product-picker-input-border-radius: var(--select-input-border-radius); // @presenter BorderRadius
|
|
2157
|
+
|
|
2158
|
+
--product-picker-list-min-width: var(--select-list-min-width);
|
|
2159
|
+
--product-picker-list-max-width: var(--select-list-max-width);
|
|
2160
|
+
--product-picker-list-padding: var(--select-list-padding); // @presenter Spacing
|
|
2161
|
+
--product-picker-list-border-radius: var(--select-list-border-radius); // @presenter BorderRadius
|
|
2162
|
+
--product-picker-list-background-color: var(--select-list-background-color); // @presenter Color
|
|
2163
|
+
--product-picker-list-box-shadow: var(--select-list-box-shadow); // @presenter Shadow
|
|
2164
|
+
|
|
2165
|
+
--product-picker-list-item-horizontal-padding: var(--select-list-item-horizontal-padding); // @presenter Spacing
|
|
2166
|
+
--product-picker-list-item-vertical-padding: var(--select-list-item-vertical-padding); // @presenter Spacing
|
|
2167
|
+
--product-picker-list-item-border-radius: var(--select-list-item-border-radius); // @presenter BorderRadius
|
|
2168
|
+
--product-picker-list-item-active-background-color: var(--select-list-item-active-background-color); // @presenter Color
|
|
2011
2169
|
`;
|
|
2012
2170
|
const lastUpdated = (0, styled_components_1.css) `
|
|
2013
2171
|
--last-updated-text-color: var(--text-color);
|
|
@@ -2158,6 +2316,7 @@ exports.styles = (0, styled_components_1.css) `
|
|
|
2158
2316
|
${logo}
|
|
2159
2317
|
${badges}
|
|
2160
2318
|
${breadcrumbs}
|
|
2319
|
+
${product}
|
|
2161
2320
|
${toc}
|
|
2162
2321
|
${inputs}
|
|
2163
2322
|
${tooltip}
|
|
@@ -2166,6 +2325,8 @@ exports.styles = (0, styled_components_1.css) `
|
|
|
2166
2325
|
${markdown}
|
|
2167
2326
|
${search}
|
|
2168
2327
|
${dropdown}
|
|
2328
|
+
${docsDropdown}
|
|
2329
|
+
${select}
|
|
2169
2330
|
${apiReferencePanels}
|
|
2170
2331
|
${apiReferenceDocs}
|
|
2171
2332
|
${lastUpdated}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ThemeUIConfig } from '../index.js';
|
|
3
3
|
export declare const ThemeConfigContext: import("react").Context<ThemeUIConfig>;
|
|
4
|
-
export declare function useThemeConfig<T extends Record<string, unknown>>(): T & NonNullable<ThemeUIConfig>;
|
|
4
|
+
export declare function useThemeConfig<T extends Record<string, unknown>>(useProductConfig?: boolean): T & NonNullable<ThemeUIConfig>;
|
|
@@ -2,9 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useThemeConfig = exports.ThemeConfigContext = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
+
const hooks_1 = require("../mocks/hooks");
|
|
5
6
|
exports.ThemeConfigContext = (0, react_1.createContext)({});
|
|
6
|
-
function useThemeConfig() {
|
|
7
|
-
|
|
7
|
+
function useThemeConfig(useProductConfig = true) {
|
|
8
|
+
const themeConfig = (0, react_1.useContext)(exports.ThemeConfigContext) || {};
|
|
9
|
+
const currentProduct = (0, hooks_1.useCurrentProduct)();
|
|
10
|
+
const mergedTheme = useProductConfig && (currentProduct === null || currentProduct === void 0 ? void 0 : currentProduct.themeOverride)
|
|
11
|
+
? Object.assign(Object.assign({}, themeConfig), currentProduct.themeOverride) : themeConfig;
|
|
12
|
+
return mergedTheme;
|
|
8
13
|
}
|
|
9
14
|
exports.useThemeConfig = useThemeConfig;
|
|
10
15
|
//# sourceMappingURL=useThemeConfig.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { ThemeUIConfig } from '../../config';
|
|
1
|
+
import type { CatalogConfig, ProductUiConfig, ThemeUIConfig } from '../../config';
|
|
2
2
|
import type { ResolvedNavItem, TFunction, Version } from '../../types/portal';
|
|
3
|
-
import type {
|
|
3
|
+
import type { FilteredCatalog } from '../../types/portal/src/shared/types/catalog';
|
|
4
4
|
interface PageLink {
|
|
5
5
|
label: string;
|
|
6
6
|
link: string;
|
|
7
7
|
type: 'link';
|
|
8
8
|
}
|
|
9
|
-
export declare function useThemeConfig<T extends Record<string, unknown>>(): T & ThemeUIConfig;
|
|
9
|
+
export declare function useThemeConfig<T extends Record<string, unknown>>(_useProductConfig?: boolean): T & ThemeUIConfig;
|
|
10
10
|
export declare function useSidebarSiblingsData(): {
|
|
11
11
|
nextPage: PageLink | null;
|
|
12
12
|
prevPage: PageLink | null;
|
|
@@ -28,6 +28,7 @@ export declare function useI18nConfig(): {
|
|
|
28
28
|
name: string;
|
|
29
29
|
}[];
|
|
30
30
|
};
|
|
31
|
+
export declare function useCurrentProduct(): ProductUiConfig | undefined;
|
|
31
32
|
export declare function usePageVersions(): {
|
|
32
33
|
versions: Version[];
|
|
33
34
|
};
|
package/lib/mocks/hooks/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.usePageVersions = exports.useI18nConfig = exports.useGlobalData = exports.useI18n = exports.useTranslate = exports.useCatalog = exports.usePageSharedData = exports.useSidebarSiblingsData = exports.useThemeConfig = void 0;
|
|
4
|
-
function useThemeConfig() {
|
|
3
|
+
exports.usePageVersions = exports.useCurrentProduct = exports.useI18nConfig = exports.useGlobalData = exports.useI18n = exports.useTranslate = exports.useCatalog = exports.usePageSharedData = exports.useSidebarSiblingsData = exports.useThemeConfig = void 0;
|
|
4
|
+
function useThemeConfig(_useProductConfig = true) {
|
|
5
5
|
return {
|
|
6
6
|
search: {
|
|
7
7
|
hide: false,
|
|
@@ -89,6 +89,10 @@ function useI18nConfig() {
|
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
exports.useI18nConfig = useI18nConfig;
|
|
92
|
+
function useCurrentProduct() {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
exports.useCurrentProduct = useCurrentProduct;
|
|
92
96
|
function usePageVersions() {
|
|
93
97
|
return {
|
|
94
98
|
versions: [
|
package/lib/mocks/search.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ interface SearchDocument {
|
|
|
14
14
|
pathName?: string | string[];
|
|
15
15
|
parameters?: OperationParameter[];
|
|
16
16
|
}
|
|
17
|
-
export declare function useFuseSearch(): {
|
|
17
|
+
export declare function useFuseSearch(_product?: string): {
|
|
18
18
|
query: string;
|
|
19
19
|
setQuery: (val: string) => void;
|
|
20
20
|
items: SearchDocument[] | null;
|
package/lib/mocks/search.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useSuggestedPages = exports.useRecentSearches = exports.useFuseSearch = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
function useFuseSearch() {
|
|
5
|
+
function useFuseSearch(_product) {
|
|
6
6
|
const [query, setQuery] = (0, react_1.useState)('');
|
|
7
7
|
return {
|
|
8
8
|
query,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CatalogFilterConfig } from "../../../../../config";
|
|
2
2
|
export type FilteredCatalog = {
|
|
3
3
|
groups: {
|
|
4
4
|
title: string;
|
|
@@ -8,29 +8,7 @@ export type FilteredCatalog = {
|
|
|
8
8
|
filterTerm: string;
|
|
9
9
|
setFilterTerm: (term: string) => void;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
12
|
-
type?: 'select' | 'checkboxes' | 'date-range';
|
|
13
|
-
title: string;
|
|
14
|
-
titleTranslationKey?: string;
|
|
15
|
-
property: string;
|
|
16
|
-
parentFilter?: string;
|
|
17
|
-
missingCategoryName?: string;
|
|
18
|
-
missingCategoryNameTranslationKey?: string;
|
|
19
|
-
options?: string[];
|
|
20
|
-
};
|
|
21
|
-
export type CatalogConfig = {
|
|
22
|
-
slug: string;
|
|
23
|
-
filters: Filter[];
|
|
24
|
-
groupByFirstFilter: boolean;
|
|
25
|
-
items: NavItem[];
|
|
26
|
-
requiredPermission?: string;
|
|
27
|
-
separateVersions?: boolean;
|
|
28
|
-
title?: string;
|
|
29
|
-
titleTranslationKey?: string;
|
|
30
|
-
description?: string;
|
|
31
|
-
descriptionTranslationKey?: string;
|
|
32
|
-
};
|
|
33
|
-
export type ResolvedFilter = Omit<Filter, 'options'> & {
|
|
11
|
+
export type ResolvedFilter = Omit<CatalogFilterConfig, 'options'> & {
|
|
34
12
|
options: {
|
|
35
13
|
value: string;
|
|
36
14
|
count: number;
|
|
@@ -10,6 +10,7 @@ export type ResolvedNavLinkItem = {
|
|
|
10
10
|
sidebar?: ResolvedNavItem[];
|
|
11
11
|
external?: boolean;
|
|
12
12
|
target?: '_self' | '_blank';
|
|
13
|
+
languageInsensitive?: boolean;
|
|
13
14
|
version?: string;
|
|
14
15
|
isDefault?: boolean;
|
|
15
16
|
versionFolderId?: string;
|
|
@@ -32,6 +33,7 @@ export type ResolvedNavGroupItem = {
|
|
|
32
33
|
target?: '_self' | '_blank';
|
|
33
34
|
expanded?: string;
|
|
34
35
|
selectFirstItemOnExpand?: boolean;
|
|
36
|
+
languageInsensitive?: boolean;
|
|
35
37
|
version?: string;
|
|
36
38
|
isDefault?: boolean;
|
|
37
39
|
versionFolderId?: string;
|
|
@@ -56,6 +58,7 @@ export type ResolvedNavItem = ResolvedNavLinkItem | ResolvedNavGroupItem | {
|
|
|
56
58
|
items?: ResolvedNavItem[];
|
|
57
59
|
sidebar?: ResolvedNavItem[];
|
|
58
60
|
icon?: string;
|
|
61
|
+
languageInsensitive?: boolean;
|
|
59
62
|
[REDOCLY_TEAMS_RBAC]?: Rbac;
|
|
60
63
|
} | {
|
|
61
64
|
type: 'error';
|
|
@@ -70,6 +73,7 @@ export type ResolvedNavItem = ResolvedNavLinkItem | ResolvedNavGroupItem | {
|
|
|
70
73
|
items?: ResolvedNavItem[];
|
|
71
74
|
sidebar?: ResolvedNavItem[];
|
|
72
75
|
icon?: string;
|
|
76
|
+
languageInsensitive?: boolean;
|
|
73
77
|
[REDOCLY_TEAMS_RBAC]?: Rbac;
|
|
74
78
|
};
|
|
75
79
|
export type ResolvedNavItemWithLink = (ResolvedNavLinkItem | ResolvedNavGroupItem) & {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ProductConfig } from "../../../../../config";
|
|
1
2
|
export interface OperationParameter {
|
|
2
3
|
name: string | string[];
|
|
3
4
|
description: string | string[];
|
|
@@ -15,5 +16,6 @@ export interface SearchDocument {
|
|
|
15
16
|
pathName?: string | string[];
|
|
16
17
|
parameters?: OperationParameter[];
|
|
17
18
|
metadata?: Record<string, any>;
|
|
19
|
+
product?: ProductConfig;
|
|
18
20
|
[PERMISSION_PROP_NAME]?: string;
|
|
19
21
|
}
|
package/lib/ui/darkColors.js
CHANGED
|
@@ -83,6 +83,8 @@ exports.darkMode = (0, styled_components_1.css) `
|
|
|
83
83
|
--page-403-description-text-color: #fff;
|
|
84
84
|
--checkbox-backround-color: var(--color-secondary-900);
|
|
85
85
|
--checkbox-checked-backround-color: var(--color-primary-400);
|
|
86
|
+
--select-list-item-active-background-color: #282828;
|
|
87
|
+
--dropdown-list-item-active-background-color: #282828;
|
|
86
88
|
|
|
87
89
|
background-color: var(--background-color);
|
|
88
90
|
color: var(--text-color);
|
package/lib/ui/index.d.ts
CHANGED
package/lib/ui/index.js
CHANGED
|
@@ -17,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.EmptyLayout = exports.LandingLayout = void 0;
|
|
18
18
|
__exportStar(require("../ui/Background"), exports);
|
|
19
19
|
__exportStar(require("../ui/Box"), exports);
|
|
20
|
-
__exportStar(require("../ui/Dropdown"), exports);
|
|
21
20
|
__exportStar(require("../ui/Flex"), exports);
|
|
22
21
|
__exportStar(require("../ui/Jumbotron"), exports);
|
|
23
22
|
__exportStar(require("../ui/ArrowBack"), exports);
|