1
0
mirror of synced 2024-11-26 07:16:02 +03:00

Fixes help text bleeding through on box classification, adds full specimen sheet

This commit is contained in:
Justin Schroeder 2020-05-17 15:06:55 -04:00
parent 75e59c6269
commit 58ce5db539
16 changed files with 329 additions and 69 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3
dist/snow.css vendored
View File

@ -75,7 +75,8 @@
padding-left: 2em; } padding-left: 2em; }
.formulate-input[data-classification='text'] input[type="color"] { .formulate-input[data-classification='text'] input[type="color"] {
height: 1.1em; height: 1.1em;
box-sizing: content-box; } box-sizing: content-box;
width: auto; }
.formulate-input[data-classification='text'] input[type="color"]::-webkit-color-swatch-wrapper { .formulate-input[data-classification='text'] input[type="color"]::-webkit-color-swatch-wrapper {
padding: 0 0 0 1.5em; padding: 0 0 0 1.5em;
display: flex; display: flex;

2
dist/snow.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -1,19 +1,40 @@
<template> <template>
<div id="app"> <div
id="app"
class="specimen-list"
>
<SpecimenButton />
<SpecimenBox />
<SpecimenFile />
<SpecimenGroup /> <SpecimenGroup />
<SpecimenSelect />
<SpecimenSlider />
<SpecimenText /> <SpecimenText />
<SpecimenTextarea />
</div> </div>
</template> </template>
<script> <script>
import SpecimenText from './specimens/SpecimenText' import SpecimenText from './specimens/SpecimenText'
import SpecimenTextarea from './specimens/SpecimenTextarea'
import SpecimenGroup from './specimens/SpecimenGroup' import SpecimenGroup from './specimens/SpecimenGroup'
import SpecimenFile from './specimens/SpecimenFile'
import SpecimenButton from './specimens/SpecimenButton'
import SpecimenBox from './specimens/SpecimenBox'
import SpecimenSlider from './specimens/SpecimenSlider'
import SpecimenSelect from './specimens/SpecimenSelect'
export default { export default {
name: 'App', name: 'App',
components: { components: {
SpecimenButton,
SpecimenBox,
SpecimenText, SpecimenText,
SpecimenGroup SpecimenTextarea,
SpecimenGroup,
SpecimenFile,
SpecimenSlider,
SpecimenSelect
}, },
data () { data () {
return { return {
@ -25,15 +46,62 @@ export default {
<style lang="scss"> <style lang="scss">
@import '../themes/snow/snow.scss'; @import '../themes/snow/snow.scss';
body { body {
margin: 0;
padding: 0;
font-family: $formulate-font-stack; font-family: $formulate-font-stack;
} }
.specimens { h2 {
margin-bottom: 2em; display: block;
padding-bottom: 2em; width: 100%;
border-bottom: 1px solid gray; position: sticky;
top: 0;
background-color: white;
padding: .5em 0;
color: $formulate-green;
border-bottom: 1px solid $formulate-gray;
margin: 2em 0 0 0;
z-index: 10;
}
.specimen-list {
padding: 1em;
max-width: 1200px;
margin: 0 auto;
@media (min-width: 756px) {
padding: 2em;
}
}
.specimens {
@media (min-width: 500px) {
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
}
&:last-child { &:last-child {
border-bottom: 0; border-bottom: 0;
} }
} }
.specimen {
max-width: 400px;
padding: 1em;
box-sizing: border-box;
@media (min-width: 500px) {
width: 50%;
border-bottom: 1px solid $formulate-gray;
&:nth-of-type(odd) {
border-right: 1px solid $formulate-gray;
}
}
@media (min-width: 900px) {
width: 33.332%;
border-right: 1px solid $formulate-gray;
&:nth-of-type(3n) {
border-right: 0;
}
}
}
</style> </style>

View File

@ -0,0 +1,30 @@
<template>
<div class="specimens specimens--text">
<h2>Box classification</h2>
<div class="specimen">
<h3>Single Checkbox</h3>
<FormulateInput
type="checkbox"
label="Are you attractive?"
help="In your own opinion at least."
/>
</div>
<div class="specimen">
<h3>Multi checkbox</h3>
<FormulateInput
type="checkbox"
label="Which recent U.S. president is your favorite?"
:options="{trump: 'Trump', obama: 'Obama', bush: 'Bush', clinton: 'Clinton'}"
help="Your selection will be transmitted directly to the NSA."
/>
</div>
<div class="specimen">
<h3>Radio</h3>
<FormulateInput
type="radio"
label="What heavily body would you like to visit?"
:options="{moon: 'Moon', mars: 'Mars', venus: 'Venus', mercury: 'Mercury', sun: 'Sun'}"
/>
</div>
</div>
</template>

View File

@ -0,0 +1,19 @@
<template>
<div class="specimens">
<h2>Button classification</h2>
<div class="specimen">
<h3>Button</h3>
<FormulateInput
label="Click me"
type="button"
/>
</div>
<div class="specimen">
<h3>Submit</h3>
<FormulateInput
label="Submit me"
type="submit"
/>
</div>
</div>
</template>

View File

@ -0,0 +1,21 @@
<template>
<div class="specimens specimens--text">
<h2>File classifications</h2>
<div class="specimen specimen">
<h3>Text</h3>
<FormulateInput
label="Upload a file"
type="file"
help="Select any file to upload"
/>
</div>
<div class="specimen">
<h3>Image</h3>
<FormulateInput
label="What do you look like?"
type="image"
help="Select a picture to upload."
/>
</div>
</div>
</template>

View File

@ -1,6 +1,8 @@
<template> <template>
<div class="specimens specimens--group"> <div class="specimens specimens--group">
<h2>Non-repeatable group</h2> <h2>Group classification</h2>
<div class="specimen">
<h3>Non-repeatable group</h3>
<FormulateInput <FormulateInput
type="group" type="group"
> >
@ -16,13 +18,10 @@
placeholder="Select a state" placeholder="Select a state"
/> />
</FormulateInput> </FormulateInput>
<h2>Repeatable group</h2> </div>
<FormulateForm <div class="specimen">
v-model="formData" <h3>Repeatable group</h3>
@submit="save"
>
<FormulateInput <FormulateInput
v-model="users"
name="users" name="users"
label="Invite some new users" label="Invite some new users"
type="group" type="group"
@ -38,7 +37,6 @@
validation="required" validation="required"
/> />
<FormulateInput <FormulateInput
v-model="email"
name="email" name="email"
label="Email address" label="Email address"
type="email" type="email"
@ -49,34 +47,11 @@
<FormulateInput <FormulateInput
type="submit" type="submit"
/> />
</FormulateForm> </div>
<!-- <span>Form Values</span>
<pre>{{ formData }}</pre>
<span>Save Values</span> -->
<pre>{{ saveValues }}</pre>
<!-- <pre>{{ email }}</pre>
<pre>{{ users }}</pre> -->
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data () {
return {
formData: {
},
users: [
{ name: 'Justin' },
{}
],
email: 'justin@wearebraid.com',
saveValues: null
}
},
methods: {
save (values) {
this.saveValues = values
}
}
} }
</script> </script>

View File

@ -0,0 +1,14 @@
<template>
<div class="specimens specimens--text">
<h2>Select classification</h2>
<div class="specimen specimen--single">
<h3>Select</h3>
<FormulateInput
label="What planet is the hottest?"
type="select"
:options="{mercury: 'Mercury', venus: 'Venus', earth: 'Earth', mars: 'Mars'}"
help="Average temperature on the surface of the planet."
/>
</div>
</div>
</template>

View File

@ -0,0 +1,16 @@
<template>
<div class="specimens specimens--text">
<h2>Slider classification</h2>
<div class="specimen specimen--single">
<h3>Range</h3>
<FormulateInput
label="How far should we crank it up?"
type="range"
min="0"
max="11"
:show-value="true"
help="Whenever were allowed to have a party again..."
/>
</div>
</div>
</template>

View File

@ -1,11 +1,49 @@
<template> <template>
<div class="specimens specimens--text"> <div class="specimens specimens--text">
<h2>Text classifications</h2>
<div class="specimen">
<h3>Color</h3>
<FormulateInput <FormulateInput
label="Username" label="Pick a color?"
type="text" type="color"
placeholder="Username" help="Choose your favorite."
help="Select a username"
/> />
</div>
<div class="specimen">
<h3>Date</h3>
<FormulateInput
label="Select a day."
type="date"
help="Choose your birthday."
/>
</div>
<div class="specimen">
<h3>Datetime-local</h3>
<FormulateInput
label="Select a day and time."
type="datetime-local"
help="When is the meeting?"
/>
</div>
<div class="specimen">
<h3>Email</h3>
<FormulateInput
label="What is your email?"
type="email"
placeholder="placeholder@example.com"
help="What is your email address?"
/>
</div>
<div class="specimen">
<h3>Month</h3>
<FormulateInput
label="Favorite month"
type="month"
help="When is Christmas?"
/>
</div>
<div class="specimen">
<h3>Number</h3>
<FormulateInput <FormulateInput
label="How old are you?" label="How old are you?"
type="number" type="number"
@ -13,4 +51,67 @@
help="Select your age" help="Select your age"
/> />
</div> </div>
<div class="specimen">
<h3>Password</h3>
<FormulateInput
label="Enter a password."
type="password"
help="Choose something long and tricky."
/>
</div>
<div class="specimen">
<h3>Search</h3>
<FormulateInput
label="But I still haven't found."
type="search"
placeholder="What im looking for..."
help="I have climbed the highest mountains."
/>
</div>
<div class="specimen">
<h3>Tel</h3>
<FormulateInput
label="Oh you like Mike & Ikes?"
type="tel"
placeholder="Can I have you number..."
help="Can I have it?"
/>
</div>
<div class="specimen">
<h3>Time</h3>
<FormulateInput
label="What time is dinner?"
type="time"
placeholder="Pick a time"
help="When will you eat your food?"
/>
</div>
<div class="specimen">
<h3>Text</h3>
<FormulateInput
label="Username"
type="text"
placeholder="Username"
help="Select a username"
/>
</div>
<div class="specimen">
<h3>Url</h3>
<FormulateInput
label="Personal website"
type="url"
placeholder="https://"
help="What is the url for your website?"
/>
</div>
<div class="specimen">
<h3>Week</h3>
<FormulateInput
label="I dont know who would use this field."
type="week"
placeholder="Pick a week"
help="What week is it?"
/>
</div>
</div>
</template> </template>

View File

@ -0,0 +1,13 @@
<template>
<div class="specimens specimens--text">
<h2>Textarea classification</h2>
<div class="specimen specimen--single">
<h3>Textarea</h3>
<FormulateInput
label="What is your life story?"
type="textarea"
help="I want to hear all about it!"
/>
</div>
</div>
</template>

View File

@ -75,6 +75,7 @@ export default {
slotComponents, slotComponents,
validationErrors, validationErrors,
visibleValidationErrors, visibleValidationErrors,
help,
...context ...context
} = this.context } = this.context
return this.options.map(option => this.groupItemContext( return this.options.map(option => this.groupItemContext(

View File

@ -103,6 +103,7 @@
input[type="color"] { input[type="color"] {
height: 1.1em; height: 1.1em;
box-sizing: content-box; box-sizing: content-box;
width: auto;
@mixin color-swatch { @mixin color-swatch {
display: block; display: block;