-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add schema for BoltActionElement in element package
- Loading branch information
1 parent
d2ce4eb
commit 864f38c
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
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,5 @@ | ||
const boltActionElement = require('./src/BoltActionElement.schema'); | ||
|
||
module.exports = { | ||
boltActionElement, | ||
}; |
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 |
---|---|---|
|
@@ -11,5 +11,6 @@ | |
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
}, | ||
"schema": "element.schemas.js" | ||
} |
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,36 @@ | ||
module.exports = { | ||
$schema: 'http://json-schema.org/draft-04/schema#', | ||
title: 'Bolt Action Element', | ||
description: | ||
'A starting point for components that have an "action" (e.g. button, link, etc.)', | ||
type: 'object', | ||
properties: { | ||
url: { | ||
type: 'string', | ||
description: | ||
'If present, users will be directed to this URL when clicking this element.', | ||
}, | ||
target: { | ||
type: 'string', | ||
description: | ||
'A valid HTML target attribute to modify the behavior when clicking this element. Only valid when "url" is also present.', | ||
enum: ['_blank', '_self', '_parent', '_top', 'framename'], | ||
}, | ||
disabled: { | ||
type: 'boolean', | ||
description: | ||
'Whether the click action should be disabled for this element.', | ||
default: false, | ||
}, | ||
onClick: { | ||
type: 'string', | ||
description: | ||
'When used with onClickTarget, an event to fire on the targeted elements when this element is clicked. When used without onClickTarget, arbitrary javascript to execute when this element is clicked.', | ||
}, | ||
onClickTarget: { | ||
type: 'string', | ||
description: | ||
'Requires onClick. A CSS selector for elements that the onClick event will fire on when this element is clicked.', | ||
}, | ||
}, | ||
}; |