@redocly/theme 0.55.0-next.8 → 0.55.0-next.9

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.
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function SkipContent(): React.JSX.Element;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.SkipContent = SkipContent;
30
+ const react_1 = __importStar(require("react"));
31
+ const styled_components_1 = __importDefault(require("styled-components"));
32
+ const hooks_1 = require("../../core/hooks");
33
+ const constants_1 = require("../../core/constants");
34
+ function SkipContent() {
35
+ const { useTranslate } = (0, hooks_1.useThemeHooks)();
36
+ const { translate } = useTranslate();
37
+ const handleSkipClick = (0, react_1.useCallback)((event) => {
38
+ event.preventDefault();
39
+ const mainElement = document.getElementById(constants_1.CONTENT_ID);
40
+ if (mainElement) {
41
+ mainElement.focus();
42
+ }
43
+ }, []);
44
+ return (react_1.default.createElement(SkipContentLint, { href: `#${constants_1.CONTENT_ID}`, onClick: handleSkipClick }, translate('page.skipToContent.label', 'Skip to content')));
45
+ }
46
+ const SkipContentLint = styled_components_1.default.a `
47
+ position: absolute;
48
+ left: -9999px;
49
+ top: 8px;
50
+ z-index: 1000;
51
+ opacity: 0;
52
+ text-decoration: none;
53
+
54
+ background: var(--skip-content-background-color);
55
+ color: var(--skip-content-text-color);
56
+ padding: var(--skip-content-padding);
57
+
58
+ border-radius: var(--skip-content-border-radius);
59
+ border: var(--skip-content-border);
60
+ font-size: var(--skip-content-font-size);
61
+ font-weight: var(--skip-content-font-weight);
62
+
63
+ &:focus {
64
+ left: 8px;
65
+ opacity: 1;
66
+ }
67
+ `;
68
+ //# sourceMappingURL=SkipContent.js.map
@@ -0,0 +1 @@
1
+ export declare const skipContent: import("styled-components").FlattenSimpleInterpolation;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.skipContent = void 0;
4
+ const styled_components_1 = require("styled-components");
5
+ exports.skipContent = (0, styled_components_1.css) `
6
+ /**
7
+ * @tokens SkipContent Base
8
+ */
9
+
10
+ --skip-content-text-color: var(--color-blue-7);
11
+ --skip-content-font-size: var(--font-size-xl);
12
+ --skip-content-font-weight: var(--font-weight-bold);
13
+ --skip-content-background-color: var(--bg-color);
14
+ --skip-content-border-color: var(--color-blue-7);
15
+ --skip-content-padding: var(--spacing-xs) var(--spacing-md);
16
+ --skip-content-border-radius: 100px;
17
+ --skip-content-border: 1px solid var(--skip-content-border-color);
18
+ --tooltip-padding: var(--tooltip-padding-vertical) var(--tooltip-padding-horizontal);
19
+ --tooltip-max-width: 250px;
20
+
21
+ // @tokens End
22
+ `;
23
+ //# sourceMappingURL=variables.js.map
@@ -1,5 +1,6 @@
1
1
  export { REDOCLY_TEAMS_RBAC } from '@redocly/config';
2
2
  export declare const DEFAULT_LOCALE_PLACEHOLDER = "default_locale";
3
+ export declare const CONTENT_ID = "content";
3
4
  export declare enum FEEDBACK_TYPES {
4
5
  RATING = "rating",
5
6
  SENTIMENT = "sentiment",
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MobileMenuType = exports.MenuItemType = exports.DEFAULT_FEEDBACK_TYPE = exports.FEEDBACK_TYPES = exports.DEFAULT_LOCALE_PLACEHOLDER = exports.REDOCLY_TEAMS_RBAC = void 0;
3
+ exports.MobileMenuType = exports.MenuItemType = exports.DEFAULT_FEEDBACK_TYPE = exports.FEEDBACK_TYPES = exports.CONTENT_ID = exports.DEFAULT_LOCALE_PLACEHOLDER = exports.REDOCLY_TEAMS_RBAC = void 0;
4
4
  var config_1 = require("@redocly/config");
5
5
  Object.defineProperty(exports, "REDOCLY_TEAMS_RBAC", { enumerable: true, get: function () { return config_1.REDOCLY_TEAMS_RBAC; } });
6
6
  exports.DEFAULT_LOCALE_PLACEHOLDER = 'default_locale';
7
+ exports.CONTENT_ID = 'content';
7
8
  var FEEDBACK_TYPES;
8
9
  (function (FEEDBACK_TYPES) {
9
10
  FEEDBACK_TYPES["RATING"] = "rating";
@@ -40,6 +40,7 @@ const variables_34 = require("../../components/DatePicker/variables");
40
40
  const variables_35 = require("../../components/Switch/variables");
41
41
  const variables_36 = require("../../markdoc/components/Cards/variables");
42
42
  const variables_37 = require("../../markdoc/components/CodeWalkthrough/variables");
43
+ const variables_38 = require("../../components/SkipContent/variables");
43
44
  const themeColors = (0, styled_components_1.css) `
44
45
  /* === Palette === */
45
46
  /**
@@ -1243,6 +1244,7 @@ exports.styles = (0, styled_components_1.css) `
1243
1244
  ${variables_2.scorecard}
1244
1245
  ${variables_34.datePicker}
1245
1246
  ${replay}
1247
+ ${variables_38.skipContent}
1246
1248
 
1247
1249
  background-color: var(--bg-color);
1248
1250
  color: var(--text-color-primary);
@@ -1,5 +1,5 @@
1
1
  import type { TOptions } from 'i18next';
2
- export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.notFound.title' | 'page.notFound.description' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.properties.apiDescription.title' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeLayout' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.implementedInterfaces' | 'graphql.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description';
2
+ export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.notFound.title' | 'page.notFound.description' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.properties.apiDescription.title' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeLayout' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.implementedInterfaces' | 'graphql.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description' | 'page.skipToContent.label';
3
3
  export type Locale = {
4
4
  code: string;
5
5
  name: string;
@@ -7,10 +7,11 @@ exports.PageLayout = PageLayout;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const styled_components_1 = __importDefault(require("styled-components"));
9
9
  const utils_1 = require("../core/utils");
10
+ const constants_1 = require("../core/constants");
10
11
  function PageLayout({ sidebar, children, }) {
11
12
  return (react_1.default.createElement(Container, { "data-component-name": "Layout/PageLayout" },
12
13
  sidebar,
13
- react_1.default.createElement(ContentContainer, null, children)));
14
+ react_1.default.createElement(ContentContainer, { id: constants_1.CONTENT_ID, tabIndex: 0 }, children)));
14
15
  }
15
16
  const Container = styled_components_1.default.div `
16
17
  display: flex;
@@ -7,8 +7,10 @@ exports.RootLayout = RootLayout;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const Navbar_1 = require("../components/Navbar/Navbar");
9
9
  const Footer_1 = require("../components/Footer/Footer");
10
+ const SkipContent_1 = require("../components/SkipContent/SkipContent");
10
11
  function RootLayout({ children }) {
11
12
  return (react_1.default.createElement("div", { "data-component-name": "layouts/RootLayout" },
13
+ react_1.default.createElement(SkipContent_1.SkipContent, null),
12
14
  react_1.default.createElement(Navbar_1.Navbar, null),
13
15
  children,
14
16
  react_1.default.createElement(Footer_1.Footer, null)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.55.0-next.8",
3
+ "version": "0.55.0-next.9",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -0,0 +1,47 @@
1
+ import React, { useCallback } from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { useThemeHooks } from '@redocly/theme/core/hooks';
5
+ import { CONTENT_ID } from '@redocly/theme/core/constants';
6
+
7
+ export function SkipContent(): React.JSX.Element {
8
+ const { useTranslate } = useThemeHooks();
9
+ const { translate } = useTranslate();
10
+
11
+ const handleSkipClick = useCallback((event: React.MouseEvent<HTMLAnchorElement>) => {
12
+ event.preventDefault();
13
+ const mainElement = document.getElementById(CONTENT_ID);
14
+ if (mainElement) {
15
+ mainElement.focus();
16
+ }
17
+ }, []);
18
+
19
+ return (
20
+ <SkipContentLint href={`#${CONTENT_ID}`} onClick={handleSkipClick}>
21
+ {translate('page.skipToContent.label', 'Skip to content')}
22
+ </SkipContentLint>
23
+ );
24
+ }
25
+
26
+ const SkipContentLint = styled.a`
27
+ position: absolute;
28
+ left: -9999px;
29
+ top: 8px;
30
+ z-index: 1000;
31
+ opacity: 0;
32
+ text-decoration: none;
33
+
34
+ background: var(--skip-content-background-color);
35
+ color: var(--skip-content-text-color);
36
+ padding: var(--skip-content-padding);
37
+
38
+ border-radius: var(--skip-content-border-radius);
39
+ border: var(--skip-content-border);
40
+ font-size: var(--skip-content-font-size);
41
+ font-weight: var(--skip-content-font-weight);
42
+
43
+ &:focus {
44
+ left: 8px;
45
+ opacity: 1;
46
+ }
47
+ `;
@@ -0,0 +1,20 @@
1
+ import { css } from 'styled-components';
2
+
3
+ export const skipContent = css`
4
+ /**
5
+ * @tokens SkipContent Base
6
+ */
7
+
8
+ --skip-content-text-color: var(--color-blue-7);
9
+ --skip-content-font-size: var(--font-size-xl);
10
+ --skip-content-font-weight: var(--font-weight-bold);
11
+ --skip-content-background-color: var(--bg-color);
12
+ --skip-content-border-color: var(--color-blue-7);
13
+ --skip-content-padding: var(--spacing-xs) var(--spacing-md);
14
+ --skip-content-border-radius: 100px;
15
+ --skip-content-border: 1px solid var(--skip-content-border-color);
16
+ --tooltip-padding: var(--tooltip-padding-vertical) var(--tooltip-padding-horizontal);
17
+ --tooltip-max-width: 250px;
18
+
19
+ // @tokens End
20
+ `;
@@ -1,5 +1,6 @@
1
1
  export { REDOCLY_TEAMS_RBAC } from '@redocly/config';
2
2
  export const DEFAULT_LOCALE_PLACEHOLDER = 'default_locale';
3
+ export const CONTENT_ID = 'content';
3
4
 
4
5
  export enum FEEDBACK_TYPES {
5
6
  RATING = 'rating',
@@ -38,6 +38,7 @@ import { datePicker } from '@redocly/theme/components/DatePicker/variables'
38
38
  import { switcher } from '@redocly/theme/components/Switch/variables';
39
39
  import { cards } from '@redocly/theme/markdoc/components/Cards/variables';
40
40
  import { codeWalkthrough } from '@redocly/theme/markdoc/components/CodeWalkthrough/variables';
41
+ import { skipContent } from '@redocly/theme/components/SkipContent/variables';
41
42
 
42
43
  const themeColors = css`
43
44
  /* === Palette === */
@@ -1265,6 +1266,7 @@ export const styles = css`
1265
1266
  ${scorecard}
1266
1267
  ${datePicker}
1267
1268
  ${replay}
1269
+ ${skipContent}
1268
1270
 
1269
1271
  background-color: var(--bg-color);
1270
1272
  color: var(--text-color-primary);
@@ -307,7 +307,8 @@ export type TranslationKey =
307
307
  | 'time.past.year'
308
308
  | 'time.past.years'
309
309
  | 'page.internalServerError.title'
310
- | 'page.internalServerError.description';
310
+ | 'page.internalServerError.description'
311
+ | 'page.skipToContent.label';
311
312
 
312
313
  export type Locale = { code: string; name: string };
313
314
 
@@ -4,6 +4,7 @@ import styled from 'styled-components';
4
4
  import type { JSX } from 'react';
5
5
 
6
6
  import { breakpoints } from '@redocly/theme/core/utils';
7
+ import { CONTENT_ID } from '@redocly/theme/core/constants';
7
8
 
8
9
  interface PageLayoutProps {
9
10
  sidebar?: React.ReactNode;
@@ -16,7 +17,9 @@ export function PageLayout({
16
17
  return (
17
18
  <Container data-component-name="Layout/PageLayout">
18
19
  {sidebar}
19
- <ContentContainer>{children}</ContentContainer>
20
+ <ContentContainer id={CONTENT_ID} tabIndex={0}>
21
+ {children}
22
+ </ContentContainer>
20
23
  </Container>
21
24
  );
22
25
  }
@@ -4,6 +4,7 @@ import type { JSX } from 'react';
4
4
 
5
5
  import { Navbar } from '@redocly/theme/components/Navbar/Navbar';
6
6
  import { Footer } from '@redocly/theme/components/Footer/Footer';
7
+ import { SkipContent } from '@redocly/theme/components/SkipContent/SkipContent';
7
8
 
8
9
  export type LayoutConfig = {
9
10
  children: React.ReactNode;
@@ -12,6 +13,7 @@ export type LayoutConfig = {
12
13
  export function RootLayout({ children }: LayoutConfig): JSX.Element {
13
14
  return (
14
15
  <div data-component-name="layouts/RootLayout">
16
+ <SkipContent />
15
17
  <Navbar />
16
18
  {children}
17
19
  <Footer />