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

v2.1.0 #944

Merged
merged 91 commits into from
May 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
82a57e7
Fixes Lexicon Grid pattern link
May 17, 2018
aaec012
Changes the validation of grid.x.lines.value and grid.y.lines.value t…
matuzalemsteles May 17, 2018
9b68042
Merge pull request #906 from alexandervalencia/900
jbalsas May 18, 2018
456ae26
Add test to cover the use case | Fixes #901
matuzalemsteles May 18, 2018
8bb3778
Writes the index of the element as date attribute in DOM and retrieve…
matuzalemsteles May 18, 2018
2ea7ea9
Regen snapshots | Fixes #901
matuzalemsteles May 18, 2018
ee0dd70
Regen expected testSoy fixtures | Fixes #901
matuzalemsteles May 18, 2018
39b15a2
New: (Fixes #886) Stickers added support for `.inline-item`. Icons in…
pat270 May 21, 2018
f1edc31
Site: Wrap icons in `.sticker` with `.inline-item`
pat270 May 21, 2018
b22ef25
Add `.inline-item` to cases that use the icon in ClaySticker | Fixes …
matuzalemsteles May 21, 2018
34463a1
Regen snapshots | Fixes #886
matuzalemsteles May 21, 2018
28de92c
Regen expected testSoy fixtures | Fixes #886
matuzalemsteles May 21, 2018
1e00c2a
Update: (Fixes #879) Dropdown increase spacing of `.dropdown-header` …
pat270 May 21, 2018
b963edd
Update: (Fixes #883) Change hover and active background colors of `.b…
pat270 May 21, 2018
0362475
Update: (#910) Alerts move `.alert-notifications-fixed` to the bottom…
pat270 May 21, 2018
a9e4f7f
Adds a new `delayTime` option in ClayAlertBase | Fixes #910
matuzalemsteles May 21, 2018
346c01a
Update tests for new case | Fixes #910
matuzalemsteles May 21, 2018
77e9d07
SF | Fixes #910
matuzalemsteles May 21, 2018
16d8a27
(#777) Clay UI Docs update Label and Badge markup to new pattern
pat270 May 21, 2018
35e7847
(Fixes #885) Clay UI Docs Modal Footer spacing between footer border …
pat270 May 21, 2018
ff22640
(Fixes #918) Table List border-radius should be 4px
pat270 May 21, 2018
597c014
(Fixes #870) Atlas set color for `$input-placeholder-disabled-color`
pat270 May 22, 2018
b9f6ca1
Merge pull request #908 from matuzalemsteles/FixGridXYLinesValue
jbalsas May 22, 2018
4108a9d
Merge pull request #919 from pat270/clay-918
jbalsas May 22, 2018
fee392a
Merge pull request #913 from pat270/clay-879
marcoscv-work May 22, 2018
b9bf15d
Merge pull request #914 from pat270/clay-883
marcoscv-work May 22, 2018
e997e4e
Merge pull request #917 from pat270/clayui-777
marcoscv-work May 22, 2018
7511ea7
Merge pull request #920 from pat270/clay-870
marcoscv-work May 22, 2018
8402e1e
Remove `delayTime` from API and set `autoClose` boolean and number | …
matuzalemsteles May 22, 2018
235609d
Rename `_delayTime` in favor of `_timeToDisappear` and `_startDelayTi…
matuzalemsteles May 22, 2018
d03e338
SF | Fixes #910
matuzalemsteles May 22, 2018
9ba61bf
Update: (Fixes #882) Application Bar, Navigation Bar, Management Bar …
pat270 May 22, 2018
2bf6b09
Update: (#871) Apply `list-unstyled` mixin to `.autofit-row` with `ul…
pat270 May 21, 2018
f705769
Site: (#871) Update Localizable Input Fields markup to use `.autofit-…
pat270 May 21, 2018
8313234
(Fixes #871) Clay UI Docs update Localization Dropdown to use `.autof…
pat270 May 21, 2018
04e56ef
Fixes tests with new cases | Fixes #910
matuzalemsteles May 22, 2018
a44f0c2
Fix JSDOC
matuzalemsteles May 22, 2018
f6ed3f4
Merge pull request #924 from pat270/clay-882
marcoscv-work May 23, 2018
38fbe6c
Merge pull request #912 from matuzalemsteles/pr-911
carloslancha May 23, 2018
387ae04
Removes the alert type check and default time setting | Fixes #910
matuzalemsteles May 23, 2018
2a7cadd
Sets the default time in the ClayStripe and ClayToast components and …
matuzalemsteles May 23, 2018
8a9fa11
Sets the autoClose validation in soy from ClayAlertBase to any | Fixe…
matuzalemsteles May 23, 2018
2df744f
Updates the ClayAlertBase isomorphic test | Fixes #910
matuzalemsteles May 23, 2018
bbec783
Rename data-clay-index in favor of data-quick-action-index | Fixes #901
matuzalemsteles May 23, 2018
e954861
Regen snapshots | Fixes #901
matuzalemsteles May 23, 2018
5121a04
Regen expected testSoy fixtures | Fixes #901
matuzalemsteles May 23, 2018
3b0a559
Update: (Fixes #931) Atlas `.btn-sm` padding left and right should be…
pat270 May 23, 2018
90bcf39
New: (Fixes #936) Icons add Lexicon icon merge
pat270 May 23, 2018
1d1f161
Merge pull request #937 from pat270/clay-936
jbalsas May 24, 2018
6918784
Create ClayTooltip component | Fixes #929
May 24, 2018
7d2e0b8
Merge pull request #909 from matuzalemsteles/issue-901
carloslancha May 24, 2018
bd59971
Add customData to deltemplate in management toolbar | Fixes #938
May 24, 2018
06bd445
Merge pull request #916 from matuzalemsteles/issue-910
carloslancha May 24, 2018
1fae98e
Merge pull request #935 from pat270/clay-931
marcoscv-work May 24, 2018
92d0824
Merge pull request #925 from pat270/clay-871
marcoscv-work May 24, 2018
297f639
Fixes code demonstration the introduction
matuzalemsteles May 24, 2018
055d317
Add new page Typography in clayui.com
matuzalemsteles May 24, 2018
b316c5f
Makes page popovers_tooltips consistent with lexicon page popovers_to…
matuzalemsteles May 24, 2018
fc6192d
Merge pull request #939 from carloslancha/issue-938-custom-data
jbalsas May 24, 2018
a3f9c8e
Use {msg} for internationalizable strings | Fixes #576
May 22, 2018
2a30cbb
Add descriptions for {msg} | Fixes #576
May 22, 2018
b140e05
Regen snapshots | Fixes #576
May 22, 2018
0ec01b3
Regen testSoy | Fixes #576
May 22, 2018
ea9e9e9
Merge pull request #923 from carloslancha/issue-576_language
jbalsas May 24, 2018
7b22ae7
Add new `searchPlaceholder` option to customize placeholder of the se…
matuzalemsteles May 23, 2018
9af777a
Add test | Fixes #928
matuzalemsteles May 23, 2018
6e5e978
Regen snapshots | Fixes #928
matuzalemsteles May 23, 2018
6ea0375
Update demo with searchPlaceholder case | Fixes #928
matuzalemsteles May 23, 2018
6e390ac
Rename searchPlaceholder in favor of searchInputPlaceholder | Fixes #928
matuzalemsteles May 24, 2018
4851030
Add searchInputPlaceholder with default value using {msg} | Fixes #928
matuzalemsteles May 24, 2018
97ece20
Regen expected testSoy fixtures | Fixes #928
matuzalemsteles May 24, 2018
416f530
Merge pull request #932 from matuzalemsteles/issue-928
carloslancha May 25, 2018
6a7b859
Adds the possibility of passing the `id` to the nav items and emits a…
matuzalemsteles May 23, 2018
857db5d
Add tests | Fixes #933
matuzalemsteles May 23, 2018
7e8bb54
Regen snapshots | Fixes #933
matuzalemsteles May 23, 2018
b15f19d
Fix to SSR | Fixes #933
matuzalemsteles May 23, 2018
95bff2f
Update test with id in ClayNavigationBar.navitem
matuzalemsteles May 23, 2018
d3192bc
Regen expected testSoy fixtures | Fixes #933
matuzalemsteles May 23, 2018
37db0bc
Fix JSDOC | Fixes #933
matuzalemsteles May 23, 2018
ea8fa4d
_handleNavItemClicked now returns the data with the respective item a…
matuzalemsteles May 24, 2018
490e89c
Update test | Fixes #933
matuzalemsteles May 24, 2018
b306d02
Regen snapshot | Fixes #933
matuzalemsteles May 24, 2018
5f75eab
Regen expected testSoy fixtures | Fixes #933
matuzalemsteles May 24, 2018
7386736
Fix JSDOC | Fixes #933
matuzalemsteles May 24, 2018
65f6329
Remove id option on items | Fixes #933
matuzalemsteles May 24, 2018
2ac0431
SF | Fixes #933
May 25, 2018
682091d
Merge pull request #915 from pat270/clay-910
jbalsas May 25, 2018
5f8ffed
Merge pull request #942 from matuzalemsteles/ReviewClayDoc
jbalsas May 25, 2018
5a4ad54
Merge pull request #943 from carloslancha/pr-934
jbalsas May 25, 2018
06e5450
Removes use of `Symbol` and fixes `title` attribute
May 25, 2018
73d68ae
Merge pull request #940 from julien/issue-929
carloslancha May 25, 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
62 changes: 31 additions & 31 deletions packages/clay-alert/src/ClayAlertBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,22 @@ class ClayAlertBase extends Component {
/**
* @inheritDoc
*/
rendered() {
if (isServerSide()) {
return;
}

if (
this.autoClose &&
(this.type === 'stripe' || this.type === 'toast')
) {
if (this._delayTime === undefined || this._delayTime > 0) {
this._delayTime =
(this.element.querySelector('a') ? 10 : 5) * 1000;
}

this._resumeTimeout();
disposed() {
if (this._timer) {
clearTimeout(this._timer);
this._timer = undefined;
}
this._timeToDisappear = undefined;
this._startedTime = undefined;
}

/**
* @inheritDoc
*/
disposed() {
if (this._timer) {
clearTimeout(this._timer);
this._timer = undefined;
rendered(firstRender) {
if (firstRender && !isServerSide()) {
this._startTimer();
}
this._delayTime = undefined;
this._startDelayTime = undefined;
}

/**
Expand Down Expand Up @@ -104,7 +92,7 @@ class ClayAlertBase extends Component {
if (this._timer) {
clearTimeout(this._timer);
this._timer = undefined;
this._delayTime -= new Date() - this._startDelayTime;
this._timeToDisappear -= new Date() - this._startedTime;
}
}

Expand All @@ -113,11 +101,23 @@ class ClayAlertBase extends Component {
* @private
*/
_resumeTimeout() {
if (this._delayTime > 0) {
this._startDelayTime = new Date();
if (this._timeToDisappear > 0) {
this._startedTime = new Date();
this._timer = setTimeout(() => {
this.close();
}, this._delayTime);
}, this._timeToDisappear);
}
}

/**
* Sets the delayTime if passed, if it does not set the default, and starts.
* @private
*/
_startTimer() {
if (this.autoClose) {
this._timeToDisappear = this.autoClose * 1000;

this._resumeTimeout();
}
}

Expand Down Expand Up @@ -148,13 +148,13 @@ ClayAlertBase.STATE = {
.value(true),

/**
* Flag to indicate if alert should be automatically closed.
* @default false
* Set the duration time to auto close the alert.
* @default undfined
* @instance
* @memberof ClayAlertBase
* @type {?bool}
* @type {?number}
*/
autoClose: Config.bool().value(false),
autoClose: Config.number(),

/**
* Flag to indicate if the alert is closeable.
Expand All @@ -179,7 +179,7 @@ ClayAlertBase.STATE = {
* @default undefined
* @instance
* @memberof ClayAlert
* @type {(?string|undefined)}
* @type {?(string|undefined)}
*/
elementClasses: Config.string(),

Expand All @@ -188,7 +188,7 @@ ClayAlertBase.STATE = {
* @default undefined
* @instance
* @memberof ClayAlert
* @type {(?string|undefined)}
* @type {?(string|undefined)}
*/
id: Config.string(),

Expand Down
9 changes: 7 additions & 2 deletions packages/clay-alert/src/ClayAlertBase.soy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{@param title: string}
{@param? _handleCloseClick: any}
{@param? _visible: bool}
{@param? autoClose: bool}
{@param? autoClose: any}
{@param? closeable: bool}
{@param? elementClasses: string}
{@param? id: string}
Expand Down Expand Up @@ -81,7 +81,12 @@

{if $closeable}
{call ClayButton.render}
{param ariaLabel: 'Close' /}
{param ariaLabel kind="text"}
{msg desc="The word 'Close' used as a verb"}
close
{/msg}
{/param}

{param elementClasses: 'close' /}
{param events: [ 'click': $_handleCloseClick ] /}
{param icon: 'times' /}
Expand Down
7 changes: 4 additions & 3 deletions packages/clay-alert/src/ClayStripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ class ClayStripe extends Component {
*/
ClayStripe.STATE = {
/**
* Flag to indicate if alert should be automatically closed.
* Flag to `true` to indicate whether the alert should be closed
* automatically with the default time.
* @default false
* @instance
* @memberof ClayStripe
* @type {?bool}
* @type {?(bool|number)}
*/
autoClose: Config.bool().value(false),
autoClose: Config.oneOfType([Config.bool(), Config.number()]).value(false),

/**
* Flag to indicate if the alert should be destroyen when close.
Expand Down
8 changes: 5 additions & 3 deletions packages/clay-alert/src/ClayStripe.soy
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
{@param spritemap: string}
{@param title: string}
{@param? _handleHide: any}
{@param? autoClose: bool}
{@param? autoClose: bool|int}
{@param? elementClasses: string}
{@param? id: string}
{@param? style: string}

{let $timeToDisappear: $autoClose == true ? 5 : $autoClose == false ? null : $autoClose /}

{call ClayAlertBase.render}
{param autoClose: $autoClose /}
{param autoClose: $timeToDisappear /}
{param closeable: true /}
{param elementClasses: $elementClasses /}
{param events: ['hide': $_handleHide ] /}
Expand All @@ -26,4 +28,4 @@
{param title: $title /}
{param type: 'stripe' /}
{/call}
{/template}
{/template}
7 changes: 4 additions & 3 deletions packages/clay-alert/src/ClayToast.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ class ClayToast extends Component {
*/
ClayToast.STATE = {
/**
* Flag to indicate if alert should be automatically closed.
* Flag to `true` to indicate whether the alert should be closed
* automatically with the default time.
* @default false
* @instance
* @memberof ClayToast
* @type {?bool}
* @type {?(bool|number)}
*/
autoClose: Config.bool().value(false),
autoClose: Config.oneOfType([Config.bool(), Config.number()]).value(false),

/**
* Flag to indicate if the alert should be destroyen when close.
Expand Down
8 changes: 5 additions & 3 deletions packages/clay-alert/src/ClayToast.soy
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
{@param spritemap: string}
{@param title: string}
{@param? _handleHide: any}
{@param? autoClose: bool}
{@param? autoClose: bool|int}
{@param? elementClasses: string}
{@param? id: string}
{@param? style: string}

{let $timeToDisappear: $autoClose == true ? 8 : $autoClose == false ? null : $autoClose /}

{call ClayAlertBase.render}
{param autoClose: $autoClose /}
{param autoClose: $timeToDisappear /}
{param closeable: true /}
{param elementClasses: $elementClasses /}
{param events: ['hide': $_handleHide ] /}
Expand All @@ -26,4 +28,4 @@
{param title: $title /}
{param type: 'toast' /}
{/call}
{/template}
{/template}
6 changes: 3 additions & 3 deletions packages/clay-alert/src/__tests__/ClayStripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('ClayStripe', function() {
});

// eslint-disable-next-line
it('should close automatically an stripe after 5 seconds when message has no links', function() {
it('should close automatically an stripe after 5 seconds', function() {
jest.useFakeTimers();

stripe = new ClayStripe({
Expand All @@ -131,11 +131,11 @@ describe('ClayStripe', function() {
});

// eslint-disable-next-line
it('should close automatically an stripe after 5 seconds when message has links', function() {
it('should close automatically an stripe after 10 seconds', function() {
jest.useFakeTimers();

stripe = new ClayStripe({
autoClose: true,
autoClose: 10,
message: 'message<a href="#">Link</a>',
spritemap: spritemap,
title: 'Success!',
Expand Down
10 changes: 5 additions & 5 deletions packages/clay-alert/src/__tests__/ClayToast.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe('ClayToast', function() {
});

// eslint-disable-next-line
it('should close automatically a toast after 5 seconds when message has no links', function() {
it('should close automatically a toast after 8 seconds', function() {
jest.useFakeTimers();

toast = new ClayToast({
Expand All @@ -124,25 +124,25 @@ describe('ClayToast', function() {
});

expect(setTimeout.mock.calls.length).toBe(1);
expect(setTimeout.mock.calls[0][1]).toBe(5000);
expect(setTimeout.mock.calls[0][1]).toBe(8000);

jest.runAllTimers();
expect(toast._visible).toBeFalsy();
});

// eslint-disable-next-line
it('should close automatically a toast after 5 seconds when message has links', function() {
it('should close automatically a toast after 12 seconds', function() {
jest.useFakeTimers();

toast = new ClayToast({
autoClose: true,
autoClose: 12,
message: 'message<a href="#">Link</a>',
spritemap: spritemap,
title: 'Success!',
});

expect(setTimeout.mock.calls.length).toBe(1);
expect(setTimeout.mock.calls[0][1]).toBe(10000);
expect(setTimeout.mock.calls[0][1]).toBe(12000);

jest.runAllTimers();
expect(toast._visible).toBeFalsy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ exports[`ClayAlert should render a "warning" style alert 1`] = `

exports[`ClayAlert should render a closeable alert 1`] = `
<div class="alert alert-warning fade alert-dismissible show" role="alert">
<button class="btn close btn-unstyled" aria-label="Close" type="button">
<button class="btn close btn-unstyled" aria-label="close" type="button">
<svg aria-hidden="true" class="lexicon-icon lexicon-icon-times" focusable="false">
<title>times</title>
<use xlink:href="../node_modules/clay-css/lib/images/icons/icons.svg#times"></use>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`ClayStripe should render a "danger" style stripe 1`] = `
<div class="alert alert-danger fade alert-dismissible alert-fluid show" role="alert">
<div class="container-fluid container-fluid-max-xl">
<button class="btn close btn-unstyled" aria-label="Close" type="button">
<button class="btn close btn-unstyled" aria-label="close" type="button">
<svg aria-hidden="true" class="lexicon-icon lexicon-icon-times" focusable="false">
<title>times</title>
<use xlink:href="../node_modules/clay-css/lib/images/icons/icons.svg#times"></use>
Expand All @@ -22,7 +22,7 @@ exports[`ClayStripe should render a "danger" style stripe 1`] = `
exports[`ClayStripe should render a "success" style stripe 1`] = `
<div class="alert alert-success fade alert-dismissible alert-fluid show" role="alert">
<div class="container-fluid container-fluid-max-xl">
<button class="btn close btn-unstyled" aria-label="Close" type="button">
<button class="btn close btn-unstyled" aria-label="close" type="button">
<svg aria-hidden="true" class="lexicon-icon lexicon-icon-times" focusable="false">
<title>times</title>
<use xlink:href="../node_modules/clay-css/lib/images/icons/icons.svg#times"></use>
Expand All @@ -41,7 +41,7 @@ exports[`ClayStripe should render a "success" style stripe 1`] = `
exports[`ClayStripe should render a "warning" style stripe 1`] = `
<div class="alert alert-warning fade alert-dismissible alert-fluid show" role="alert">
<div class="container-fluid container-fluid-max-xl">
<button class="btn close btn-unstyled" aria-label="Close" type="button">
<button class="btn close btn-unstyled" aria-label="close" type="button">
<svg aria-hidden="true" class="lexicon-icon lexicon-icon-times" focusable="false">
<title>times</title>
<use xlink:href="../node_modules/clay-css/lib/images/icons/icons.svg#times"></use>
Expand All @@ -60,7 +60,7 @@ exports[`ClayStripe should render a "warning" style stripe 1`] = `
exports[`ClayStripe should render an "info" style stripe 1`] = `
<div class="alert alert-info fade alert-dismissible alert-fluid show" role="alert">
<div class="container-fluid container-fluid-max-xl">
<button class="btn close btn-unstyled" aria-label="Close" type="button">
<button class="btn close btn-unstyled" aria-label="close" type="button">
<svg aria-hidden="true" class="lexicon-icon lexicon-icon-times" focusable="false">
<title>times</title>
<use xlink:href="../node_modules/clay-css/lib/images/icons/icons.svg#times"></use>
Expand All @@ -79,7 +79,7 @@ exports[`ClayStripe should render an "info" style stripe 1`] = `
exports[`ClayStripe should render an stripe with classes 1`] = `
<div class="alert alert-info fade alert-dismissible my-custom-class alert-fluid show" role="alert">
<div class="container-fluid container-fluid-max-xl">
<button class="btn close btn-unstyled" aria-label="Close" type="button">
<button class="btn close btn-unstyled" aria-label="close" type="button">
<svg aria-hidden="true" class="lexicon-icon lexicon-icon-times" focusable="false">
<title>times</title>
<use xlink:href="../node_modules/clay-css/lib/images/icons/icons.svg#times"></use>
Expand All @@ -98,7 +98,7 @@ exports[`ClayStripe should render an stripe with classes 1`] = `
exports[`ClayStripe should render an stripe with id 1`] = `
<div class="alert alert-info fade alert-dismissible alert-fluid show" id="myId" role="alert">
<div class="container-fluid container-fluid-max-xl">
<button class="btn close btn-unstyled" aria-label="Close" type="button">
<button class="btn close btn-unstyled" aria-label="close" type="button">
<svg aria-hidden="true" class="lexicon-icon lexicon-icon-times" focusable="false">
<title>times</title>
<use xlink:href="../node_modules/clay-css/lib/images/icons/icons.svg#times"></use>
Expand All @@ -117,7 +117,7 @@ exports[`ClayStripe should render an stripe with id 1`] = `
exports[`ClayStripe should render default markup 1`] = `
<div class="alert alert-info fade alert-dismissible alert-fluid show" role="alert">
<div class="container-fluid container-fluid-max-xl">
<button class="btn close btn-unstyled" aria-label="Close" type="button">
<button class="btn close btn-unstyled" aria-label="close" type="button">
<svg aria-hidden="true" class="lexicon-icon lexicon-icon-times" focusable="false">
<title>times</title>
<use xlink:href="../node_modules/clay-css/lib/images/icons/icons.svg#times"></use>
Expand Down
Loading