Skip to content

Commit

Permalink
feat: add inset, label_spacing, and panel_spacing props to sche…
Browse files Browse the repository at this point in the history
…ms, $ref support
  • Loading branch information
Daniel Morse committed Aug 30, 2019
1 parent 0b0e19b commit 1057bf0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
3 changes: 2 additions & 1 deletion packages/build-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
"webpack-merge": "^4.2.1",
"write-file-webpack-plugin": "^4.5.0",
"yaml-loader": "^0.5.0",
"yargs": "^13.2.4"
"yargs": "^13.2.4",
"json-schema-ref-parser": "^7.1.0"
},
"publishConfig": {
"access": "public"
Expand Down
8 changes: 6 additions & 2 deletions packages/build-tools/utils/manifest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* eslint-disable no-await-in-loop */
const { promisify } = require('util');
const resolve = require('resolve');
const fs = require('fs');
const path = require('path');
const $RefParser = require('json-schema-ref-parser');
const log = require('./log');
const { ensureFileExists } = require('./general');
const writeFile = promisify(fs.writeFile);
Expand Down Expand Up @@ -158,13 +160,15 @@ async function getPkgInfo(pkgName) {
.replace(/ /g, '-')
.toLowerCase();

info.schema[schemaMachineName] = schema;
const dereferencedSchema = await $RefParser.dereference(schema);
info.schema[schemaMachineName] = dereferencedSchema;
}
} else {
const schemaFilePath = path.join(dir, pkg.schema);
const schema = await getDataFile(schemaFilePath);
validateSchemaSchema(schema, `Schema not valid for: ${schemaFilePath}`);
info.schema = schema;
const dereferencedSchema = await $RefParser.dereference(schemaFilePath);
info.schema = dereferencedSchema;
}
}
// @todo Allow verbosity settings
Expand Down
33 changes: 24 additions & 9 deletions packages/components/bolt-tabs/tabs.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,33 @@ properties:
type: boolean
description: Set active state on tab. Only one active tab allowed at a time. Defaults to first tab.
default: false
label_spacing:
type: string
hidden: true
description: Override label spacing. By default inherits `spacing` set on `<bolt-tabs>`.
$ref: '#/definitions/spacing'
panel_spacing:
type: string
hidden: true
description: Override panel spacing. By default inherits `spacing` set on `<bolt-tabs>`.
$ref: '#/definitions/spacing'
align:
description: Horizontal alignment of tab labels
description: Horizontal alignment of tab labels.
type: string
enum:
- start
- center
- end
default: start
spacing:
$ref: '#/definitions/spacing'
type: string
description: Controls the inset spacing of each item.
default: medium
enum:
- none
- xsmall
- small
- medium
- large
description: Controls the spacing of each item.
default: small
inset:
type: boolean
description: Set spacing on the inside of each item.
default: false
variant:
type: string
description: Controls the tab label style (WIP).
Expand All @@ -52,3 +61,9 @@ properties:
description: Set selected tab by index. *This* index is 1-based (i.e. first tab is `1` not `0`), as opposed to the Web Component API which is 0-based.
default: 1
minimum: 1
definitions:
spacing:
enum:
- none
- small
- medium

0 comments on commit 1057bf0

Please sign in to comment.