-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
140 additions
and
657 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { JSONSchema4 } from 'json-schema'; | ||
|
||
export const schemaWithRefs: JSONSchema4 = { | ||
$schema: 'http://json-schema.org/draft-07/schema#', | ||
definitions: { | ||
address: { | ||
type: 'object', | ||
properties: { | ||
street_address: { | ||
type: 'string', | ||
}, | ||
city: { | ||
type: 'string', | ||
}, | ||
state: { | ||
type: 'string', | ||
}, | ||
}, | ||
required: ['street_address', 'city', 'state'], | ||
}, | ||
}, | ||
type: 'object', | ||
properties: { | ||
billing_address: { | ||
$ref: '#/definitions/address', | ||
}, | ||
shipping_address: { | ||
$ref: '#/definitions/address', | ||
}, | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { JSONSchema4 } from 'json-schema'; | ||
|
||
export const dereferencedSchema: JSONSchema4 = { | ||
$schema: 'http://json-schema.org/draft-07/schema#', | ||
definitions: { | ||
address: { | ||
type: 'object', | ||
properties: { | ||
street_address: { | ||
type: 'string', | ||
}, | ||
city: { | ||
type: 'string', | ||
}, | ||
state: { | ||
type: 'string', | ||
}, | ||
}, | ||
required: ['street_address', 'city', 'state'], | ||
}, | ||
}, | ||
type: 'object', | ||
properties: { | ||
billing_address: { | ||
type: 'object', | ||
properties: { | ||
street_address: { | ||
type: 'string', | ||
}, | ||
city: { | ||
type: 'string', | ||
}, | ||
state: { | ||
type: 'string', | ||
}, | ||
}, | ||
required: ['street_address', 'city', 'state'], | ||
}, | ||
shipping_address: { | ||
type: 'object', | ||
properties: { | ||
street_address: { | ||
type: 'string', | ||
}, | ||
city: { | ||
type: 'string', | ||
}, | ||
state: { | ||
type: 'string', | ||
}, | ||
}, | ||
required: ['street_address', 'city', 'state'], | ||
}, | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
import { Box, Flex, IFlex } from '@stoplight/ui-kit'; | ||
import * as React from 'react'; | ||
import { IJsonSchemaViewerTheme, useTheme } from '../theme'; | ||
import { MutedText } from './common/MutedText'; | ||
|
||
export const Divider: React.FunctionComponent<IFlex> = ({ children, ...props }) => { | ||
const theme = useTheme() as IJsonSchemaViewerTheme; | ||
|
||
export const Divider: React.FunctionComponent<React.HTMLAttributes<HTMLDivElement>> = ({ children, ...props }) => { | ||
return ( | ||
<Flex alignItems="center" position="absolute" top="-16px" left="0" height="10px" {...props}> | ||
<MutedText fontSize=".8rem" textTransform="uppercase" fontWeight={700} pr={7}> | ||
{children} | ||
</MutedText> | ||
<Box backgroundColor={theme.divider.bg} height="2px" flex="1 1 0%" /> | ||
</Flex> | ||
<div className="flex items-center w-full h-2 absolute" style={{ top: -16, left: -16 }} {...props}> | ||
<div className="uppercase font-bold text-darken-7 pr-2">{children}</div> | ||
<div className="flex-1 bg-darken-5" style={{ height: 2 }} /> | ||
</div> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { Dialog } from '@stoplight/ui-kit'; | ||
import * as React from 'react'; | ||
import { IJsonSchemaViewer, JsonSchemaViewer } from './JsonSchemaViewer'; | ||
import { IJsonSchemaViewer, JsonSchemaViewer } from './'; | ||
|
||
export interface IMaskedSchema extends IJsonSchemaViewer { | ||
onClose(): void; | ||
} | ||
|
||
export const MaskedSchema: React.FunctionComponent<IMaskedSchema> = ({ onClose, ...props }) => { | ||
return ( | ||
<Dialog show onClickOutside={onClose} width="50vh" height="50vh" position="relative"> | ||
<JsonSchemaViewer {...props} canSelect /> | ||
<Dialog isOpen={true} onClose={onClose}> | ||
<JsonSchemaViewer {...props} style={{ height: 500 }} canSelect /> | ||
</Dialog> | ||
); | ||
}; |
Oops, something went wrong.