@stoplight/elements-core 7.16.6 → 8.0.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.
Files changed (33) hide show
  1. package/components/Docs/Article/Article.stories.d.ts +4 -4
  2. package/components/Docs/Docs.stories.d.ts +1 -1
  3. package/components/Docs/HttpOperation/HttpOperation.d.ts +2 -2
  4. package/components/Docs/HttpOperation/HttpOperation.stories.d.ts +2 -2
  5. package/components/Docs/HttpOperation/Request.d.ts +2 -2
  6. package/components/Docs/HttpService/HttpService.stories.d.ts +2 -2
  7. package/components/Docs/Model/Model.stories.d.ts +2 -2
  8. package/components/Layout/MobileTopNav.d.ts +9 -0
  9. package/components/Layout/ResponsiveSidebarLayout.d.ts +22 -0
  10. package/components/Logo.d.ts +4 -10
  11. package/components/RequestSamples/RequestSamples.stories.d.ts +2 -2
  12. package/components/ResponseExamples/ResponseExamples.d.ts +2 -2
  13. package/components/ResponseExamples/ResponseExamples.stories.d.ts +2 -2
  14. package/components/{MosaicTableOfContents → TableOfContents}/constants.d.ts +6 -4
  15. package/components/{MosaicTableOfContents → TableOfContents}/index.d.ts +1 -0
  16. package/components/{MosaicTableOfContents → TableOfContents}/types.d.ts +2 -1
  17. package/components/TryIt/Parameters/useOperationParameters.d.ts +2 -2
  18. package/components/TryIt/TryIt.d.ts +2 -2
  19. package/components/TryIt/TryIt.stories.d.ts +11 -11
  20. package/components/TryIt/TryItWithRequestSamples.stories.d.ts +3 -3
  21. package/hooks/useResponsiveLayout.d.ts +13 -0
  22. package/index.d.ts +7 -4
  23. package/index.esm.js +387 -191
  24. package/index.js +388 -188
  25. package/index.mjs +387 -191
  26. package/package.json +3 -3
  27. package/styles.min.css +1 -1
  28. package/types.d.ts +10 -1
  29. package/utils/guards.d.ts +2 -1
  30. /package/components/{MosaicTableOfContents → TableOfContents}/TableOfContents.d.ts +0 -0
  31. /package/components/{MosaicTableOfContents → TableOfContents}/TableOfContents.spec.d.ts +0 -0
  32. /package/components/{MosaicTableOfContents → TableOfContents}/TableOfContents.stories.d.ts +0 -0
  33. /package/components/{MosaicTableOfContents → TableOfContents}/utils.d.ts +0 -0
@@ -1,13 +1,13 @@
1
- declare const meta: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, {
1
+ declare const meta: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, {
2
2
  data: any;
3
3
  } & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
4
4
  export default meta;
5
- export declare const Basic: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, {
5
+ export declare const Basic: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
6
6
  data: any;
7
7
  } & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
8
- export declare const KitchenSink: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, {
8
+ export declare const KitchenSink: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
9
9
  data: any;
10
10
  } & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
11
- export declare const MultipleTryIts: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, {
11
+ export declare const MultipleTryIts: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
12
12
  data: any;
13
13
  } & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
@@ -1,5 +1,5 @@
1
1
  import { Story } from '@storybook/react';
2
2
  import { DocsProps } from './Docs';
3
- declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, DocsProps>;
3
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, DocsProps>;
4
4
  export default _default;
5
5
  export declare const DocsStory: Story<DocsProps>;
@@ -1,7 +1,7 @@
1
- import { IHttpOperation } from '@stoplight/types';
1
+ import { IHttpEndpointOperation } from '@stoplight/types';
2
2
  import * as React from 'react';
3
3
  import { DocsComponentProps } from '..';
4
- export declare type HttpOperationProps = DocsComponentProps<IHttpOperation>;
4
+ export declare type HttpOperationProps = DocsComponentProps<IHttpEndpointOperation>;
5
5
  export declare const HttpOperation: React.FunctionComponent<HttpOperationProps & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
6
6
  export declare function OperationHeader({ id, noHeading, hasBadges, name, isDeprecated, isInternal, hideServerUrl, method, path, }: {
7
7
  id: string;
@@ -1,7 +1,7 @@
1
- declare const meta: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, {
1
+ declare const meta: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, {
2
2
  data: any;
3
3
  } & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
4
4
  export default meta;
5
- export declare const Story: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, {
5
+ export declare const Story: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
6
6
  data: any;
7
7
  } & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
@@ -1,7 +1,7 @@
1
- import { IHttpOperation } from '@stoplight/types';
1
+ import { IHttpEndpointOperation } from '@stoplight/types';
2
2
  import * as React from 'react';
3
3
  interface IRequestProps {
4
- operation: IHttpOperation;
4
+ operation: IHttpEndpointOperation;
5
5
  onChange?: (requestBodyIndex: number) => void;
6
6
  }
7
7
  export declare const Request: React.FunctionComponent<IRequestProps>;
@@ -1,7 +1,7 @@
1
- declare const meta: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, {
1
+ declare const meta: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, {
2
2
  data: any;
3
3
  } & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
4
4
  export default meta;
5
- export declare const Story: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, {
5
+ export declare const Story: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
6
6
  data: any;
7
7
  } & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
@@ -1,7 +1,7 @@
1
- declare const meta: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, {
1
+ declare const meta: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, {
2
2
  data: any;
3
3
  } & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
4
4
  export default meta;
5
- export declare const Story: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, {
5
+ export declare const Story: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, {
6
6
  data: any;
7
7
  } & import("@stoplight/react-error-boundary").ErrorBoundaryProps<{}>>;
@@ -0,0 +1,9 @@
1
+ import { LogoProps } from '../../types';
2
+ import type { TableOfContentsItem } from '../TableOfContents';
3
+ export declare const MobileTopNav: ({ name, logo, tree, pathname, onTocClick, }: {
4
+ name: string;
5
+ logo?: string | LogoProps | undefined;
6
+ tree: TableOfContentsItem[];
7
+ pathname: string;
8
+ onTocClick(): void;
9
+ }) => JSX.Element;
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+ import { LogoProps } from '../../types';
3
+ import type { TableOfContentsItem } from '../TableOfContents';
4
+ declare type ResponsiveSidebarLayoutProps = {
5
+ maxContentWidth?: number;
6
+ sidebarWidth?: number;
7
+ children?: React.ReactNode;
8
+ name: string;
9
+ logo?: string | LogoProps;
10
+ tree?: TableOfContentsItem[];
11
+ onTocClick?(): void;
12
+ };
13
+ export declare const ResponsiveSidebarLayout: React.ForwardRefExoticComponent<ResponsiveSidebarLayoutProps & React.RefAttributes<HTMLDivElement>>;
14
+ export declare const Sidebar: ({ name, logo, tree, pathname, onTocClick, isInResponsiveMode, }: {
15
+ name: string;
16
+ logo?: string | LogoProps | undefined;
17
+ tree: TableOfContentsItem[];
18
+ pathname: string;
19
+ onTocClick?(): void;
20
+ isInResponsiveMode: boolean;
21
+ }) => JSX.Element;
22
+ export {};
@@ -1,11 +1,5 @@
1
1
  import * as React from 'react';
2
- interface LogoProps {
3
- logo: {
4
- altText: string;
5
- url?: string;
6
- backgroundColor?: string;
7
- href?: string;
8
- };
9
- }
10
- export declare const Logo: React.FC<LogoProps>;
11
- export {};
2
+ import { LogoProps } from '../types';
3
+ export declare const Logo: React.FC<{
4
+ logo: LogoProps;
5
+ }>;
@@ -1,4 +1,4 @@
1
1
  import { RequestSamplesProps } from './RequestSamples';
2
- declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, RequestSamplesProps>;
2
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, RequestSamplesProps>;
3
3
  export default _default;
4
- export declare const HoistedStory: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, RequestSamplesProps>;
4
+ export declare const HoistedStory: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, RequestSamplesProps>;
@@ -1,6 +1,6 @@
1
- import { IHttpOperation } from '@stoplight/types';
1
+ import { IHttpEndpointOperation } from '@stoplight/types';
2
2
  export interface ResponseExamplesProps {
3
- httpOperation: IHttpOperation;
3
+ httpOperation: IHttpEndpointOperation;
4
4
  responseStatusCode?: string;
5
5
  responseMediaType?: string;
6
6
  }
@@ -1,4 +1,4 @@
1
1
  import { ResponseExamplesProps } from './ResponseExamples';
2
- declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, ResponseExamplesProps>;
2
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, ResponseExamplesProps>;
3
3
  export default _default;
4
- export declare const HoistedStory: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, ResponseExamplesProps>;
4
+ export declare const HoistedStory: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ResponseExamplesProps>;
@@ -2,8 +2,8 @@ import { IIconProps } from '@stoplight/mosaic';
2
2
  export declare const NODE_TYPE_TITLE_ICON: {
3
3
  [nodeType: string]: IIconProps['icon'];
4
4
  };
5
- export declare const NODE_TITLE_ICON: {
6
- [nodeTitle: string]: IIconProps['icon'];
5
+ export declare const NODE_GROUP_ICON: {
6
+ [itemType: string]: IIconProps['icon'];
7
7
  };
8
8
  export declare const NODE_TYPE_META_ICON: {
9
9
  [nodeType: string]: IIconProps['icon'];
@@ -12,9 +12,11 @@ export declare const NODE_TYPE_ICON_COLOR: {
12
12
  model: string;
13
13
  http_service: string;
14
14
  http_operation: string;
15
+ http_webhook: string;
15
16
  };
16
- export declare const NODE_TITLE_ICON_COLOR: {
17
- Schemas: string;
17
+ export declare const NODE_GROUP_ICON_COLOR: {
18
+ http_webhook: string;
19
+ model: string;
18
20
  };
19
21
  export declare const NODE_META_COLOR: {
20
22
  get: string;
@@ -1 +1,2 @@
1
1
  export * from './TableOfContents';
2
+ export * from './types';
@@ -20,12 +20,13 @@ export declare type TableOfContentsGroupItem = TableOfContentsGroup | TableOfCon
20
20
  export declare type TableOfContentsGroup = {
21
21
  title: string;
22
22
  items: TableOfContentsGroupItem[];
23
+ itemsType?: 'article' | 'http_operation' | 'http_webhook' | 'model';
23
24
  };
24
25
  export declare type TableOfContentsExternalLink = {
25
26
  title: string;
26
27
  url: string;
27
28
  };
28
- export declare type TableOfContentsNode<T = 'http_service' | 'http_operation' | 'model' | 'article' | 'overview'> = {
29
+ export declare type TableOfContentsNode<T = 'http_service' | 'http_operation' | 'http_webhook' | 'model' | 'article' | 'overview'> = {
29
30
  id: string;
30
31
  slug: string;
31
32
  title: string;
@@ -1,6 +1,6 @@
1
- import { IHttpOperation } from '@stoplight/types';
1
+ import { IHttpEndpointOperation } from '@stoplight/types';
2
2
  import { ParameterSpec } from './parameter-utils';
3
- export declare const useRequestParameters: (httpOperation: IHttpOperation) => {
3
+ export declare const useRequestParameters: (httpOperation: IHttpEndpointOperation) => {
4
4
  allParameters: ParameterSpec[];
5
5
  parameterValuesWithDefaults: {
6
6
  [k: string]: any;
@@ -1,8 +1,8 @@
1
- import type { IHttpOperation } from '@stoplight/types';
1
+ import type { IHttpEndpointOperation } from '@stoplight/types';
2
2
  import { Request as HarRequest } from 'har-format';
3
3
  import * as React from 'react';
4
4
  export interface TryItProps {
5
- httpOperation: IHttpOperation;
5
+ httpOperation: IHttpEndpointOperation;
6
6
  mockUrl?: string;
7
7
  onRequestChange?: (currentRequest: HarRequest) => void;
8
8
  requestBodyIndex?: number;
@@ -1,13 +1,13 @@
1
1
  import { TryItProps } from './TryIt';
2
- declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, TryItProps>;
2
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, TryItProps>;
3
3
  export default _default;
4
- export declare const SimpleGET: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, TryItProps>;
5
- export declare const WithParameters: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, TryItProps>;
6
- export declare const WithVariables: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, TryItProps>;
7
- export declare const UrlEncoded: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, TryItProps>;
8
- export declare const UrlEncodedOneOf: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, TryItProps>;
9
- export declare const Multipart: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, TryItProps>;
10
- export declare const RequestBodySchema: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, TryItProps>;
11
- export declare const RequestBodyExamples: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, TryItProps>;
12
- export declare const TryItAuth: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, TryItProps>;
13
- export declare const TryItAuthDuplicated: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, TryItProps>;
4
+ export declare const SimpleGET: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TryItProps>;
5
+ export declare const WithParameters: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TryItProps>;
6
+ export declare const WithVariables: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TryItProps>;
7
+ export declare const UrlEncoded: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TryItProps>;
8
+ export declare const UrlEncodedOneOf: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TryItProps>;
9
+ export declare const Multipart: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TryItProps>;
10
+ export declare const RequestBodySchema: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TryItProps>;
11
+ export declare const RequestBodyExamples: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TryItProps>;
12
+ export declare const TryItAuth: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TryItProps>;
13
+ export declare const TryItAuthDuplicated: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TryItProps>;
@@ -1,5 +1,5 @@
1
1
  import { TryItWithRequestSamplesProps } from './TryItWithRequestSamples';
2
- declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0fc72a6d").R, TryItWithRequestSamplesProps>;
2
+ declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, TryItWithRequestSamplesProps>;
3
3
  export default _default;
4
- export declare const WithParameters: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, TryItWithRequestSamplesProps>;
5
- export declare const WithVariables: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, TryItWithRequestSamplesProps>;
4
+ export declare const WithParameters: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TryItWithRequestSamplesProps>;
5
+ export declare const WithVariables: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TryItWithRequestSamplesProps>;
@@ -0,0 +1,13 @@
1
+ declare type ElementsNode = 'docs';
2
+ export declare enum ScreenType {
3
+ Phone = 415,
4
+ Tablet = 750,
5
+ Resized_Browser = 980,
6
+ Normal_Browser = 1000000
7
+ }
8
+ export declare const useResponsiveLayout: () => {
9
+ isResponsiveLayoutEnabled: boolean;
10
+ screenType: ScreenType | undefined;
11
+ getElementsBreakpoint: (node: ElementsNode) => number;
12
+ };
13
+ export {};
package/index.d.ts CHANGED
@@ -1,16 +1,18 @@
1
1
  export { Docs, DocsProps, ParsedDocs } from './components/Docs';
2
2
  export { DeprecatedBadge } from './components/Docs/HttpOperation/Badges';
3
3
  export { ExportButton, ExportButtonProps } from './components/Docs/HttpService/ExportButton';
4
+ export { ResponsiveSidebarLayout } from './components/Layout/ResponsiveSidebarLayout';
4
5
  export { SidebarLayout } from './components/Layout/SidebarLayout';
6
+ export { LinkHeading } from './components/LinkHeading';
5
7
  export { Logo } from './components/Logo';
6
8
  export { DefaultSMDComponents } from './components/MarkdownViewer/CustomComponents/CodeComponent';
7
9
  export { CustomComponentMapping, MarkdownComponentsProvider, } from './components/MarkdownViewer/CustomComponents/Provider';
8
10
  export { ReactRouterMarkdownLink } from './components/MarkdownViewer/CustomComponents/ReactRouterLink';
9
- export { TableOfContents } from './components/MosaicTableOfContents';
10
- export { CustomLinkComponent, TableOfContentsItem, TableOfContentsNode, TableOfContentsNodeGroup, } from './components/MosaicTableOfContents/types';
11
- export { findFirstNode } from './components/MosaicTableOfContents/utils';
12
11
  export { NonIdealState } from './components/NonIdealState';
13
12
  export { PoweredByLink } from './components/PoweredByLink';
13
+ export { TableOfContents } from './components/TableOfContents';
14
+ export { CustomLinkComponent, TableOfContentsItem, TableOfContentsNode, TableOfContentsNodeGroup, } from './components/TableOfContents/types';
15
+ export { findFirstNode } from './components/TableOfContents/utils';
14
16
  export { TryIt, TryItProps, TryItWithRequestSamples, TryItWithRequestSamplesProps } from './components/TryIt';
15
17
  export { HttpMethodColors, NodeTypeColors, NodeTypeIconDefs, NodeTypePrettyName } from './constants';
16
18
  export { MockingProvider } from './containers/MockingProvider';
@@ -23,10 +25,11 @@ export { withRouter } from './hoc/withRouter';
23
25
  export { useBundleRefsIntoDocument } from './hooks/useBundleRefsIntoDocument';
24
26
  export { useParsedData } from './hooks/useParsedData';
25
27
  export { useParsedValue } from './hooks/useParsedValue';
28
+ export { useResponsiveLayout } from './hooks/useResponsiveLayout';
26
29
  export { useRouter } from './hooks/useRouter';
27
30
  export { Styled, withStyles } from './styled';
28
31
  export { Divider, Group, ITableOfContentsTree, Item, ParsedNode, RoutingProps, TableOfContentItem } from './types';
29
- export { isHttpOperation, isHttpService } from './utils/guards';
32
+ export { isHttpOperation, isHttpService, isHttpWebhookOperation } from './utils/guards';
30
33
  export { ReferenceResolver } from './utils/ref-resolving/ReferenceResolver';
31
34
  export { createResolvedObject } from './utils/ref-resolving/resolvedObject';
32
35
  export { slugify } from './utils/string';