mirror of
https://github.com/pebble-dev/clay.git
synced 2026-09-05 16:47:37 -04:00
Add description field to all input type components.
This commit is contained in:
@@ -178,6 +178,7 @@ Standard text input field.
|
|||||||
| appKey | string (unique) | The AppMessage key matching the `appKey` item defined in your `appinfo.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByAppKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
|
| appKey | string (unique) | The AppMessage key matching the `appKey` item defined in your `appinfo.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByAppKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
|
||||||
| label | string | The label that should appear next to this item. |
|
| label | string | The label that should appear next to this item. |
|
||||||
| defaultValue | string | The default value of the input field. |
|
| defaultValue | string | The default value of the input field. |
|
||||||
|
| description | string | Optional sub-text to include below the component |
|
||||||
| attributes | object | An object containing HTML attributes to set on the input field. You can add basic HTML5 validation this way by setting attributes such as `required` or `type`. |
|
| attributes | object | An object containing HTML attributes to set on the input field. You can add basic HTML5 validation this way by setting attributes such as `required` or `type`. |
|
||||||
|
|
||||||
|
|
||||||
@@ -215,6 +216,7 @@ Switch for a single item.
|
|||||||
| appKey | string (unique) | The AppMessage key matching the `appKey` item defined in your `appinfo.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByAppKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
|
| appKey | string (unique) | The AppMessage key matching the `appKey` item defined in your `appinfo.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByAppKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
|
||||||
| label | string | The label that should appear next to this item. |
|
| label | string | The label that should appear next to this item. |
|
||||||
| defaultValue | int\|boolean | The default value of the toggle. Defaults to `false` if not specified. |
|
| defaultValue | int\|boolean | The default value of the toggle. Defaults to `false` if not specified. |
|
||||||
|
| description | string | Optional sub-text to include below the component |
|
||||||
| attributes | object | An object containing HTML attributes to set on the input field. You can add basic HTML5 validation this way by setting attribute such as `required`. |
|
| attributes | object | An object containing HTML attributes to set on the input field. You can add basic HTML5 validation this way by setting attribute such as `required`. |
|
||||||
|
|
||||||
|
|
||||||
@@ -249,6 +251,7 @@ A dropdown menu containing multiple options.
|
|||||||
| appKey | string (unique) | The AppMessage key matching the `appKey` item defined in your `appinfo.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByAppKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
|
| appKey | string (unique) | The AppMessage key matching the `appKey` item defined in your `appinfo.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByAppKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
|
||||||
| label | string | The label that should appear next to this item. |
|
| label | string | The label that should appear next to this item. |
|
||||||
| defaultValue | string | The default value of the dropdown menu. Must match a value in the `options` array. |
|
| defaultValue | string | The default value of the dropdown menu. Must match a value in the `options` array. |
|
||||||
|
| description | string | Optional sub-text to include below the component |
|
||||||
| attributes | object | An object containing HTML attributes to set on the input field. You can add basic HTML5 validation this way by setting attribute such as `required`. |
|
| attributes | object | An object containing HTML attributes to set on the input field. You can add basic HTML5 validation this way by setting attribute such as `required`. |
|
||||||
| options | array of objects | The options you want to appear in the dropdown menu. Each option is an object with a `label` and `value` property. |
|
| options | array of objects | The options you want to appear in the dropdown menu. Each option is an object with a `label` and `value` property. |
|
||||||
|
|
||||||
@@ -301,6 +304,7 @@ A color picker containing the 64 supported colors on Basalt and Chalk.
|
|||||||
| appKey | string (unique) | The AppMessage key matching the `appKey` item defined in your `appinfo.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByAppKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
|
| appKey | string (unique) | The AppMessage key matching the `appKey` item defined in your `appinfo.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByAppKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
|
||||||
| label | string | The label that should appear next to this item. |
|
| label | string | The label that should appear next to this item. |
|
||||||
| defaultValue | string OR int | The default color. Always use the uncorrected value even if `sunlight` is true. The component will do the conversion internally. |
|
| defaultValue | string OR int | The default color. Always use the uncorrected value even if `sunlight` is true. The component will do the conversion internally. |
|
||||||
|
| description | string | Optional sub-text to include below the component |
|
||||||
| sunlight | boolean | Use the color-corrected sunlight color palette if `true`, else the uncorrected version. Defaults to `true` if not specified. |
|
| sunlight | boolean | Use the color-corrected sunlight color palette if `true`, else the uncorrected version. Defaults to `true` if not specified. |
|
||||||
|
|
||||||
##### Example
|
##### Example
|
||||||
@@ -332,6 +336,7 @@ A list of options allowing the user can only choose one option to submit.
|
|||||||
| appKey | string (unique) | The AppMessage key matching the `appKey` item defined in your `appinfo.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByAppKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
|
| appKey | string (unique) | The AppMessage key matching the `appKey` item defined in your `appinfo.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByAppKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
|
||||||
| label | string | The label that should appear next to this item. |
|
| label | string | The label that should appear next to this item. |
|
||||||
| defaultValue | string | The default selected item. Must match a value in the `options` array. |
|
| defaultValue | string | The default selected item. Must match a value in the `options` array. |
|
||||||
|
| description | string | Optional sub-text to include below the component |
|
||||||
| attributes | object | An object containing HTML attributes to set on the input field. You can add basic HTML5 validation this way by setting attribute such as `required`. |
|
| attributes | object | An object containing HTML attributes to set on the input field. You can add basic HTML5 validation this way by setting attribute such as `required`. |
|
||||||
| options | array of objects | The options you want to appear in the radio group. Each option is an object with a `label` and `value` property. |
|
| options | array of objects | The options you want to appear in the radio group. Each option is an object with a `label` and `value` property. |
|
||||||
|
|
||||||
@@ -376,6 +381,7 @@ A list of options where a user may choose more than one option to submit.
|
|||||||
| appKey | string (unique) | The AppMessage key matching the `appKey` item defined in your `appinfo.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByAppKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
|
| appKey | string (unique) | The AppMessage key matching the `appKey` item defined in your `appinfo.json`. Set this to a unique string to allow this item to be looked up using `Clay.getItemsByAppKey()` in your custom function. You must set this if you wish for the value of this item to be persisted after the user closes the config page. |
|
||||||
| label | string | The label that should appear next to this item. |
|
| label | string | The label that should appear next to this item. |
|
||||||
| defaultValue | array of strings | The default selected items. Each value must match one in the `options` array. |
|
| defaultValue | array of strings | The default selected items. Each value must match one in the `options` array. |
|
||||||
|
| description | string | Optional sub-text to include below the component |
|
||||||
| attributes | object | An object containing HTML attributes to set on the input field. You can add basic HTML5 validation this way by setting attribute such as `required`. |
|
| attributes | object | An object containing HTML attributes to set on the input field. You can add basic HTML5 validation this way by setting attribute such as `required`. |
|
||||||
| options | array of objects | The options you want to appear in the checkbox group. Each option is an object with a `label` and `value` property. |
|
| options | array of objects | The options you want to appear in the checkbox group. Each option is an object with a `label` and `value` property. |
|
||||||
|
|
||||||
|
|||||||
+19
-6
@@ -30,13 +30,18 @@ module.exports = [
|
|||||||
"limit": 10,
|
"limit": 10,
|
||||||
"required": "required",
|
"required": "required",
|
||||||
type: "email"
|
type: "email"
|
||||||
}
|
},
|
||||||
|
"description": "Some arbitrary text explaining how this all works. " +
|
||||||
|
"It's cool if this wraps across multiple lines"
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "toggle",
|
"type": "toggle",
|
||||||
"appKey": "cool_stuff",
|
"appKey": "cool_stuff",
|
||||||
"label": "Enable Cool Stuff",
|
"label": "Enable Cool Stuff",
|
||||||
"defaultValue": false
|
"defaultValue": false,
|
||||||
|
"description": "Some arbitrary text explaining how this all works. " +
|
||||||
|
"It's cool if this wraps across multiple lines"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "color",
|
"type": "color",
|
||||||
@@ -50,7 +55,9 @@ module.exports = [
|
|||||||
"appKey": "sunnyColorTest",
|
"appKey": "sunnyColorTest",
|
||||||
"defaultValue": "00FF00",
|
"defaultValue": "00FF00",
|
||||||
"label": "Sunny Color",
|
"label": "Sunny Color",
|
||||||
"sunlight": true
|
"sunlight": true,
|
||||||
|
"description": "Some arbitrary text explaining how this all works. " +
|
||||||
|
"It's cool if this wraps across multiple lines"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -71,7 +78,9 @@ module.exports = [
|
|||||||
{ "label": "One really long thing that would not fit", "value": "three" },
|
{ "label": "One really long thing that would not fit", "value": "three" },
|
||||||
{ "label": "Small", "value": "quote' \"test" },
|
{ "label": "Small", "value": "quote' \"test" },
|
||||||
{ "label": "Final thing", "value": "three" }
|
{ "label": "Final thing", "value": "three" }
|
||||||
]
|
],
|
||||||
|
"description": "Some arbitrary text explaining how this all works. " +
|
||||||
|
"It's cool if this wraps across multiple lines"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "checkboxgroup",
|
"type": "checkboxgroup",
|
||||||
@@ -84,7 +93,9 @@ module.exports = [
|
|||||||
{ "label": "One really long thing that would not fit", "value": "three" },
|
{ "label": "One really long thing that would not fit", "value": "three" },
|
||||||
{ "label": "Small", "value": "quote' \"test" },
|
{ "label": "Small", "value": "quote' \"test" },
|
||||||
{ "label": "Final thing", "value": "three" }
|
{ "label": "Final thing", "value": "three" }
|
||||||
]
|
],
|
||||||
|
"description": "Some arbitrary text explaining how this all works. " +
|
||||||
|
"It's cool if this wraps across multiple lines"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "input",
|
"type": "input",
|
||||||
@@ -108,7 +119,9 @@ module.exports = [
|
|||||||
],
|
],
|
||||||
"attributes": {
|
"attributes": {
|
||||||
"required": "required"
|
"required": "required"
|
||||||
}
|
},
|
||||||
|
"description": "Some arbitrary text explaining how this all works. " +
|
||||||
|
"It's cool if this wraps across multiple lines"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
Vendored
+3
-3
File diff suppressed because one or more lines are too long
@@ -8,6 +8,7 @@ module.exports = {
|
|||||||
defaults: {
|
defaults: {
|
||||||
label: '',
|
label: '',
|
||||||
options: [],
|
options: [],
|
||||||
|
description: '',
|
||||||
attributes: {}
|
attributes: {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ module.exports = {
|
|||||||
style: require('../../styles/clay/components/color.scss'),
|
style: require('../../styles/clay/components/color.scss'),
|
||||||
manipulator: 'color',
|
manipulator: 'color',
|
||||||
defaults: {
|
defaults: {
|
||||||
label: ''
|
label: '',
|
||||||
|
description: ''
|
||||||
},
|
},
|
||||||
initialize: function(minified) {
|
initialize: function(minified) {
|
||||||
var HTML = minified.HTML;
|
var HTML = minified.HTML;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ module.exports = {
|
|||||||
manipulator: 'val',
|
manipulator: 'val',
|
||||||
defaults: {
|
defaults: {
|
||||||
label: '',
|
label: '',
|
||||||
|
description: '',
|
||||||
attributes: {}
|
attributes: {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ module.exports = {
|
|||||||
defaults: {
|
defaults: {
|
||||||
label: '',
|
label: '',
|
||||||
options: [],
|
options: [],
|
||||||
|
description: '',
|
||||||
attributes: {}
|
attributes: {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ module.exports = {
|
|||||||
defaults: {
|
defaults: {
|
||||||
label: '',
|
label: '',
|
||||||
options: [],
|
options: [],
|
||||||
|
description: '',
|
||||||
attributes: {}
|
attributes: {}
|
||||||
},
|
},
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ module.exports = {
|
|||||||
manipulator: 'checked',
|
manipulator: 'checked',
|
||||||
defaults: {
|
defaults: {
|
||||||
label: '',
|
label: '',
|
||||||
|
description: '',
|
||||||
attributes: {}
|
attributes: {}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+49
-42
@@ -147,52 +147,59 @@ a {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.description {
|
||||||
|
padding-top: $item-spacing-v;
|
||||||
|
@include font-size(0.9);
|
||||||
|
color: $color-gray-9;
|
||||||
|
}
|
||||||
|
|
||||||
.inputs {
|
.inputs {
|
||||||
display: block;
|
display: block;
|
||||||
width:100%;
|
width:100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
|
|
||||||
.section & .component {
|
//.section & .component {
|
||||||
display: table;
|
// display: table;
|
||||||
width:100%;
|
// width:100%;
|
||||||
|
//
|
||||||
.label,
|
// .label,
|
||||||
.input {
|
// .input {
|
||||||
display: table-cell;
|
// display: table-cell;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// .input {
|
||||||
|
// text-align: right;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// &.invalid {
|
||||||
|
// .input:after {
|
||||||
|
// content: "!";
|
||||||
|
// display: inline-block;
|
||||||
|
// color: $color-white;
|
||||||
|
// background: $color-orange;
|
||||||
|
// border-radius: $border-radius;
|
||||||
|
// width: 1.2em;
|
||||||
|
// text-align: center;
|
||||||
|
// height: 1.2em;
|
||||||
|
// font-size: 1em;
|
||||||
|
// vertical-align: middle;
|
||||||
|
// line-height: 1.3em;
|
||||||
|
// margin-left: -0.7em;
|
||||||
|
// position:absolute;
|
||||||
|
// @include font-pfdin(regular);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// .input input {
|
||||||
|
// color: $color-orange;
|
||||||
|
// padding-right: 1em;
|
||||||
|
//
|
||||||
|
// @include placeholder {
|
||||||
|
// color: $color-orange;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
.input {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.invalid {
|
|
||||||
.input:after {
|
|
||||||
content: "!";
|
|
||||||
display: inline-block;
|
|
||||||
color: $color-white;
|
|
||||||
background: $color-orange;
|
|
||||||
border-radius: $border-radius;
|
|
||||||
width: 1.2em;
|
|
||||||
text-align: center;
|
|
||||||
height: 1.2em;
|
|
||||||
font-size: 1em;
|
|
||||||
vertical-align: middle;
|
|
||||||
line-height: 1.3em;
|
|
||||||
margin-left: -0.7em;
|
|
||||||
position:absolute;
|
|
||||||
@include font-pfdin(regular);
|
|
||||||
}
|
|
||||||
|
|
||||||
.input input {
|
|
||||||
color: $color-orange;
|
|
||||||
padding-right: 1em;
|
|
||||||
|
|
||||||
@include placeholder {
|
|
||||||
color: $color-orange;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,7 +2,10 @@
|
|||||||
@import "clay";
|
@import "clay";
|
||||||
|
|
||||||
.component-select {
|
.component-select {
|
||||||
|
|
||||||
|
label {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
.value {
|
.value {
|
||||||
$triangle-size: 0.85rem;
|
$triangle-size: 0.85rem;
|
||||||
|
|||||||
@@ -15,4 +15,7 @@
|
|||||||
</label>
|
</label>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
{{if description}}
|
||||||
|
<div class="description">{{{description}}}</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
<span class="label">{{{label}}}</span>
|
<span class="label">{{{label}}}</span>
|
||||||
<span class="value"></span>
|
<span class="value"></span>
|
||||||
</label>
|
</label>
|
||||||
|
{{if description}}
|
||||||
|
<div class="description">{{{description}}}</div>
|
||||||
|
{{/if}}
|
||||||
<div class="picker-wrap">
|
<div class="picker-wrap">
|
||||||
<div class="picker">
|
<div class="picker">
|
||||||
<div class="color-box-wrap">
|
<div class="color-box-wrap">
|
||||||
|
|||||||
@@ -6,4 +6,7 @@
|
|||||||
{{each key: attributes}}{{key}}="{{this}}"{{/each}}
|
{{each key: attributes}}{{key}}="{{this}}"{{/each}}
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
{{if description}}
|
||||||
|
<div class="description">{{{description}}}</div>
|
||||||
|
{{/if}}
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
@@ -15,4 +15,7 @@
|
|||||||
</label>
|
</label>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
{{if description}}
|
||||||
|
<div class="description">{{{description}}}</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<label class="component component-select">
|
<div class="component component-select">
|
||||||
|
<label>
|
||||||
<span class="label">{{{label}}}</span>
|
<span class="label">{{{label}}}</span>
|
||||||
<span class="value"></span>
|
<span class="value"></span>
|
||||||
<select data-manipulator-target {{each key: attributes}}{{key}}="{{this}}"{{/each}}>
|
<select data-manipulator-target {{each key: attributes}}{{key}}="{{this}}"{{/each}}>
|
||||||
@@ -7,3 +8,7 @@
|
|||||||
{{/each}}
|
{{/each}}
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
|
{{if description}}
|
||||||
|
<div class="description">{{{description}}}</div>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<label class="component component-toggle">
|
<div class="component component-toggle">
|
||||||
|
<label>
|
||||||
<span class="label">{{{label}}}</span>
|
<span class="label">{{{label}}}</span>
|
||||||
<span class="input">
|
<span class="input">
|
||||||
<input
|
<input
|
||||||
@@ -12,3 +13,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
|
{{if description}}
|
||||||
|
<div class="description">{{{description}}}</div>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user