Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(floating-label): separate label module from text-field #2237

Merged
merged 50 commits into from
Feb 28, 2018
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
a9d6c3c
chore(floating-label): moved floating-label to new package and integr…
Feb 6, 2018
9b750cd
chore(floating-label): changed all css classes to floating-label
Feb 7, 2018
4b01134
Merge branch 'master' into chore/text-field/decouple-label
Feb 8, 2018
5a4500f
fix(floating-label): fixed all tests
Feb 8, 2018
324a638
chore(floating-label): created test directory
Feb 8, 2018
51f16f6
fix(floating-label): removed label foundation from text-field
Feb 9, 2018
af02b19
Merge branch 'master' into chore/text-field/decouple-label
Feb 10, 2018
6f9abdf
fix(floating-label): tests
Feb 12, 2018
028c00d
Merge branch 'master' into chore/text-field/decouple-label
Feb 12, 2018
024ff39
fix(floating-label): updated readmes to reflect changes to floating-l…
Feb 12, 2018
2f72c61
fix(floating-label): closure annotation
Feb 12, 2018
c2f6b95
Merge branch 'master' into chore/text-field/decouple-label
Feb 12, 2018
f452125
chore(floating-label): moved text-field-placeholder css rule into tex…
Feb 12, 2018
f00ef39
Merge branch 'chore/text-field/decouple-label' of github.com:material…
Feb 12, 2018
4a9846c
chore(text-field): moved invalid label keyframe animation shakes to t…
Feb 13, 2018
1f2cf62
fix(text-field): removed export of floating label
Feb 13, 2018
ab8b035
Merge branch 'master' into chore/text-field/decouple-label
Feb 13, 2018
040f739
fix(text-field): closure annotations
Feb 13, 2018
d3871a3
Merge branch 'chore/text-field/decouple-label' of github.com:material…
Feb 15, 2018
252ffc4
Merge branch 'master' into chore/text-field/decouple-label
Feb 15, 2018
43bd881
fix(floating-label): sass compliation failure
Feb 15, 2018
9b627e2
fix(text-field): updated foundation methods to guard against !hasLabe…
Feb 16, 2018
808b6ff
Merge branch 'master' into chore/text-field/decouple-label
Feb 16, 2018
bed6857
Merge branch 'master' into chore/text-field/decouple-label
Feb 16, 2018
2c1c55e
fix(text-field): changed floating-label ink color mixin and updated t…
Feb 16, 2018
d7e1776
fix(floating-label): updated API for shake and float in component, an…
Feb 17, 2018
8a03462
Merge branch 'master' into chore/text-field/decouple-label
Feb 20, 2018
5973760
fix(floating-label): reorder scss import statements alphabetical
Feb 20, 2018
8385248
Merge branch 'chore/text-field/decouple-label' of github.com:material…
Feb 20, 2018
182b4b1
Merge branch 'master' into chore/text-field/decouple-label
Feb 21, 2018
ce05cda
fix(floating-label): rename from styleShake to shake and styleFloat t…
Feb 21, 2018
1a0aa6c
Merge branch 'master' into chore/text-field/decouple-label
Feb 21, 2018
7f69180
Merge branch 'master' into chore/text-field/decouple-label
Feb 21, 2018
f8ca6f1
fix(floating-label): moved animationend listeners to the init/destroy…
Feb 22, 2018
161e40a
fix(floating-label): fix floating label animation function
Feb 22, 2018
d6a5606
Merge branch 'master' into chore/text-field/decouple-label
Feb 22, 2018
eb3893f
fix(floating-label): fixed rtl for floating-label
Feb 22, 2018
da53da7
fix(floating-label): updated floating label comments
Feb 22, 2018
ead024d
Merge branch 'master' into chore/text-field/decouple-label
Feb 22, 2018
78f5b2d
fix(floating-label): remove empty parens from scss mixins
Feb 22, 2018
8a05219
Merge branch 'master' into chore/text-field/decouple-label
Feb 22, 2018
67c1ab8
fix(floating-label): fixed some typos and empty white space
Feb 23, 2018
d7e6962
Merge branch 'master' into chore/text-field/decouple-label
Feb 23, 2018
6fdbafc
Merge branch 'master' into chore/text-field/decouple-label
Feb 27, 2018
f03ca0e
fix(floating-label): fixed readme
Feb 28, 2018
957fa3c
fix(text-field): reverted sass mixin name change to ...-label-ink-color
Feb 28, 2018
7d3a17c
Merge branch 'master' into chore/text-field/decouple-label
Feb 28, 2018
5247b43
Merge branch 'master' into chore/text-field/decouple-label
Feb 28, 2018
cf75c3b
fix(text-field): renamed shake animation names and updated readme
Feb 28, 2018
f8a94e7
Merge branch 'master' into chore/text-field/decouple-label
Feb 28, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions demos/snackbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ <h2 class="mdc-typography--title">Basic Example</h2>

<div class="mdc-text-field">
<input type="text" id="message" class="mdc-text-field__input" value="Message deleted">
<label class="mdc-text-field__label" for="message">Message Text</label>
<label class="mdc-floating-label" for="message">Message Text</label>
<div class="mdc-line-ripple"></div>
</div>
<br/>

<div class="mdc-text-field">
<input type="text" id="action" class="mdc-text-field__input" value="Undo">
<label class="mdc-text-field__label" for="action">Action Text</label>
<label class="mdc-floating-label" for="action">Action Text</label>
<div class="mdc-line-ripple"></div>
</div>
<br/>
Expand Down
24 changes: 12 additions & 12 deletions demos/text-field.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<section class="hero">
<div class="mdc-text-field">
<input type="text" class="mdc-text-field__input" id="my-text-field" aria-controls="my-text-field-helper-text">
<label for="my-text-field" class="mdc-text-field__label">Text Field</label>
<label for="my-text-field" class="mdc-floating-label">Text Field</label>
<div class="mdc-line-ripple"></div>
</div>
</section>
Expand All @@ -74,7 +74,7 @@ <h2>Full Functionality JS Component (Floating Label, Validation)</h2>
<section id="demo-text-field-wrapper">
<div class="mdc-text-field">
<input type="text" class="mdc-text-field__input" id="full-func-text-field" aria-controls="my-text-field-helper-text">
<label for="full-func-text-field" class="mdc-text-field__label">Email Address</label>
<label for="full-func-text-field" class="mdc-floating-label">Email Address</label>
<div class="mdc-line-ripple"></div>
</div>
<p id="my-text-field-helper-text" class="mdc-text-field-helper-text"
Expand Down Expand Up @@ -124,7 +124,7 @@ <h2>Password field with validation</h2>
<input required pattern=".{8,}" type="password" class="mdc-text-field__input" id="pw"
aria-controls="pw-validation-msg"
autocomplete="current-password">
<label for="pw" class="mdc-text-field__label">Choose password</label>
<label for="pw" class="mdc-floating-label">Choose password</label>
<div class="mdc-line-ripple"></div>
</div>
<p class="mdc-text-field-helper-text mdc-text-field-helper-text--persistent mdc-text-field-helper-text--validation-msg"
Expand All @@ -139,7 +139,7 @@ <h2>Outlined Text Field</h2>
<div id="tf-outlined-example" class="mdc-text-field mdc-text-field--outlined" data-demo-no-auto-js>
<input required pattern=".{8,}" type="text" id="tf-outlined-input" class="mdc-text-field__input"
aria-controls="name-validation-message">
<label for="tf-outlined-input" class="mdc-text-field__label">Your Name</label>
<label for="tf-outlined-input" class="mdc-floating-label">Your Name</label>
<div class="mdc-text-field__outline">
<svg>
<path class="mdc-text-field__outline-path"/>
Expand Down Expand Up @@ -175,7 +175,7 @@ <h2>Text Field box</h2>
<div id="tf-box-example" class="mdc-text-field mdc-text-field--box" data-demo-no-auto-js>
<input type="text" id="tf-box" class="mdc-text-field__input"
aria-controls="name-validation-message">
<label for="tf-box" class="mdc-text-field__label">Your Name</label>
<label for="tf-box" class="mdc-floating-label">Your Name</label>
<div class="mdc-line-ripple"></div>
</div>
<p class="mdc-text-field-helper-text mdc-text-field-helper-text--validation-msg"
Expand Down Expand Up @@ -220,15 +220,15 @@ <h2>Text Field - Leading/Trailing icons</h2>
class="mdc-text-field mdc-text-field--box mdc-text-field--with-leading-icon" data-demo-no-auto-js>
<i class="material-icons mdc-text-field__icon" tabindex="0">event</i>
<input type="text" id="tf-box-leading" class="mdc-text-field__input">
<label for="tf-box-leading" class="mdc-text-field__label">Your name</label>
<label for="tf-box-leading" class="mdc-floating-label">Your name</label>
<div class="mdc-line-ripple"></div>
</div>
</div>
<div id="demo-tf-box-trailing-wrapper">
<div id="tf-box-trailing-example"
class="mdc-text-field mdc-text-field--box mdc-text-field--with-trailing-icon" data-demo-no-auto-js>
<input type="text" id="tf-box-trailing" class="mdc-text-field__input">
<label for="tf-box-trailing" class="mdc-text-field__label">Your other name</label>
<label for="tf-box-trailing" class="mdc-floating-label">Your other name</label>
<i class="material-icons mdc-text-field__icon" tabindex="0">delete</i>
<div class="mdc-line-ripple"></div>
</div>
Expand All @@ -238,7 +238,7 @@ <h2>Text Field - Leading/Trailing icons</h2>
class="mdc-text-field mdc-text-field--outlined mdc-text-field--with-leading-icon" data-demo-no-auto-js>
<i class="material-icons mdc-text-field__icon" tabindex="0">event</i>
<input type="text" id="tf-outlined-leading" class="mdc-text-field__input">
<label for="tf-outlined-leading" class="mdc-text-field__label">Your other name</label>
<label for="tf-outlined-leading" class="mdc-floating-label">Your other name</label>
<div class="mdc-text-field__outline">
<svg>
<path class="mdc-text-field__outline-path"/>
Expand All @@ -251,7 +251,7 @@ <h2>Text Field - Leading/Trailing icons</h2>
<div id="tf-outlined-trailing-example"
class="mdc-text-field mdc-text-field--outlined mdc-text-field--with-trailing-icon" data-demo-no-auto-js>
<input type="text" id="tf-outlined-trailing" class="mdc-text-field__input">
<label for="tf-outlined-trailing" class="mdc-text-field__label">Your other name</label>
<label for="tf-outlined-trailing" class="mdc-floating-label">Your other name</label>
<i class="material-icons mdc-text-field__icon" tabindex="0">delete</i>
<div class="mdc-text-field__outline">
<svg>
Expand Down Expand Up @@ -291,7 +291,7 @@ <h2>Text Field - Leading/Trailing icons</h2>
<h2>Preventing FOUC</h2>
<div class="mdc-text-field mdc-text-field--upgraded">
<input id="fouc" type="text" class="mdc-text-field__input" value="Pre-filled value">
<label for="fouc" class="mdc-text-field__label mdc-text-field__label--float-above">
<label for="fouc" class="mdc-floating-label mdc-floating-label--float-above">
Label floating above
</label>
<div class="mdc-line-ripple"></div>
Expand All @@ -303,7 +303,7 @@ <h2>Textarea</h2>
<section id="demo-text-field-textarea-wrapper">
<div class="mdc-text-field mdc-text-field--textarea">
<textarea id="textarea" class="mdc-text-field__input" rows="8" cols="40"></textarea>
<label for="textarea" class="mdc-text-field__label">Textarea Label</label>
<label for="textarea" class="mdc-floating-label">Textarea Label</label>
</div>
</section>
<div>
Expand Down Expand Up @@ -333,7 +333,7 @@ <h2>Full-Width Text Field and Textarea</h2>
</div>
<div class="mdc-text-field mdc-text-field--textarea mdc-text-field--fullwidth full-width-textarea-example">
<textarea id="full-width-textarea" class="mdc-text-field__input" rows="8"></textarea>
<label for="full-width-textarea" class="mdc-text-field__label">Textarea Label</label>
<label for="full-width-textarea" class="mdc-floating-label">Textarea Label</label>
</div>
</div>
<div>
Expand Down
6 changes: 3 additions & 3 deletions demos/theme/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ <h3 class="mdc-typography--headline demo-component-section__heading">
id="demo-text-field-default"
aria-controls="demo-text-field-default-helper-text"
autocomplete="email">
<label for="demo-text-field-default" class="mdc-text-field__label">Name (optional)</label>
<label for="demo-text-field-default" class="mdc-floating-label">Name (optional)</label>
<div class="mdc-line-ripple"></div>
</div>
<p class="mdc-text-field-helper-text" id="demo-text-field-default-helper-text"
Expand All @@ -851,7 +851,7 @@ <h3 class="mdc-typography--headline demo-component-section__heading">
aria-controls="demo-text-field-required-helper-text"
autocomplete="email"
required>
<label for="demo-text-field-required" class="mdc-text-field__label">Email (required)</label>
<label for="demo-text-field-required" class="mdc-floating-label">Email (required)</label>
<div class="mdc-line-ripple"></div>
</div>
<p class="mdc-text-field-helper-text mdc-text-field-helper-text--validation-msg" id="demo-text-field-required-helper-text">
Expand All @@ -863,7 +863,7 @@ <h3 class="mdc-typography--headline demo-component-section__heading">
<input type="text" class="mdc-text-field__input"
id="demo-text-field-box"
aria-controls="name-validation-message">
<label for="demo-text-field-box" class="mdc-text-field__label">With <code>--box</code> modifier</label>
<label for="demo-text-field-box" class="mdc-floating-label">With <code>--box</code> modifier</label>
<div class="mdc-line-ripple"></div>
</div>
<p class="mdc-text-field-helper-text" id="demo-text-field-box-helper-text"
Expand Down
12 changes: 6 additions & 6 deletions docs/docsite-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Get up and running with Material Components for web
```

2. {: .step-list-item } ### Include the stylesheet

Include the MDC Web stylesheet in the head of your file

```html
<html>
<head>
Expand All @@ -56,22 +56,22 @@ Get up and running with Material Components for web
<h2 class="mdc-typography--display2">Hello, Material Components!</h2>
<div class="mdc-text-field" data-mdc-auto-init="MDCTextField">
<input type="text" class="mdc-text-field__input" id="demo-input">
<label for="demo-input" class="mdc-text-field__label">Tell us how you feel!</label>
<label for="demo-input" class="mdc-floating-label">Tell us how you feel!</label>
</div>
</body>
```

4. {: .step-list-item } ### Add scripts and instantiate

Add the MDC Web scripts and call MDC Auto Init.
Add the MDC Web scripts and call MDC Auto Init.

```html
<script src="node_modules/material-components-web/dist/material-components-web.js"></script>
<script>mdc.autoInit()</script>
```

A full example of the HTML could look like this:

```html
<!DOCTYPE html>
<html>
Expand All @@ -84,7 +84,7 @@ Get up and running with Material Components for web
<h2 class="mdc-typography--display2">Hello, Material Components!</h2>
<div class="mdc-text-field" data-mdc-auto-init="MDCTextField">
<input type="text" class="mdc-text-field__input" id="demo-input">
<label for="demo-input" class="mdc-text-field__label">Tell us how you feel!</label>
<label for="demo-input" class="mdc-floating-label">Tell us how you feel!</label>
</div>
<script src="node_modules/material-components-web/dist/material-components-web.js"></script>
<script>mdc.autoInit()</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module.exports = [{
output: {
// This is necessary for webpack to compile
// But we never use style-bundle.js
filename: 'style-bundle.js',
filename: 'style-bundle.js',
},
module: {
rules: [{
Expand Down
6 changes: 3 additions & 3 deletions docs/migrating-from-mdl.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ MDC Web:
```html
<div class="mdc-text-field">
<input class="mdc-text-field__input" type="text" id="input">
<label for="input" class="mdc-text-field__label">Input Label</label>
<label for="input" class="mdc-floating-label">Input Label</label>
<div class="mdc-line-ripple"></div>
</div>
```
Expand All @@ -118,7 +118,7 @@ element, with the component’s class name as the value. For example:
```html
<div class="mdc-text-field" data-mdc-auto-init="MDCTextField">
<input class="mdc-text-field__input" type="text" id="input">
<label for="input" class="mdc-text-field__label">Input Label</label>
<label for="input" class="mdc-floating-label">Input Label</label>
<div class="mdc-line-ripple"></div>
</div>
```
Expand Down Expand Up @@ -199,7 +199,7 @@ Like in MDL, styling components with CSS classes is simply a matter of applied t
```html
<div class="mdc-text-field">
<input type="text" id="my-text-field" class="mdc-text-field__input">
<label class="mdc-text-field__label" for="my-text-field">Hint text</label>
<label class="mdc-floating-label" for="my-text-field">Hint text</label>
<div class="mdc-line-ripple"></div>
</div>
```
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"drawer",
"elevation",
"fab",
"floating-label",
"form-field",
"grid-list",
"icon-toggle",
Expand Down Expand Up @@ -168,6 +169,7 @@
"mdc-base",
"mdc-checkbox",
"mdc-chips",
"mdc-floating-label",
"mdc-form-field",
"mdc-icon-toggle",
"mdc-line-ripple",
Expand Down
3 changes: 3 additions & 0 deletions packages/material-components-web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import * as checkbox from '@material/checkbox/index';
import * as chips from '@material/chips/index';
import * as dialog from '@material/dialog/index';
import * as drawer from '@material/drawer/index';
import * as floatingLabel from '@material/floating-label/index';
import * as formField from '@material/form-field/index';
import * as gridList from '@material/grid-list/index';
import * as iconToggle from '@material/icon-toggle/index';
Expand All @@ -44,6 +45,7 @@ autoInit.register('MDCChipSet', chips.MDCChipSet);
autoInit.register('MDCDialog', dialog.MDCDialog);
autoInit.register('MDCPersistentDrawer', drawer.MDCPersistentDrawer);
autoInit.register('MDCTemporaryDrawer', drawer.MDCTemporaryDrawer);
autoInit.register('MDCFloatingLabel', floatingLabel.MDCFloatingLabel);
autoInit.register('MDCFormField', formField.MDCFormField);
autoInit.register('MDCRipple', ripple.MDCRipple);
autoInit.register('MDCGridList', gridList.MDCGridList);
Expand All @@ -69,6 +71,7 @@ export {
chips,
dialog,
drawer,
floatingLabel,
formField,
gridList,
iconToggle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@import "@material/drawer/mdc-drawer";
@import "@material/elevation/mdc-elevation";
@import "@material/fab/mdc-fab";
@import "@material/floating-label/mdc-floating-label";
@import "@material/form-field/mdc-form-field";
@import "@material/grid-list/mdc-grid-list";
@import "@material/icon-toggle/mdc-icon-toggle";
Expand Down
1 change: 1 addition & 0 deletions packages/material-components-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@material/drawer": "^0.30.0",
"@material/elevation": "^0.28.0",
"@material/fab": "^0.31.0",
"@material/floating-label": "0.0.0",
"@material/form-field": "^0.31.0",
"@material/grid-list": "^0.30.0",
"@material/icon-toggle": "^0.31.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/mdc-auto-init/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ writing the markup, simply insert a script tag that calls `mdc.autoInit()`. Make
```html
<div class="mdc-text-field" data-mdc-auto-init="MDCTextField">
<input class="mdc-text-field__input" type="text" id="input">
<label for="input" class="mdc-text-field__label">Input Label</label>
<label for="input" class="mdc-floating-label">Input Label</label>
<div class="mdc-line-ripple"></div>
</div>

Expand All @@ -52,7 +52,7 @@ using a property whose name is the value of `data-mdc-auto-init`. For example, g
```html
<div class="mdc-text-field" data-mdc-auto-init="MDCTextField">
<input class="mdc-text-field__input" type="text" id="input">
<label for="input" class="mdc-text-field__label">Input Label</label>
<label for="input" class="mdc-floating-label">Input Label</label>
<div class="mdc-line-ripple"></div>
</div>
```
Expand Down
Loading