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

feat: use @forbidExtraArgs on all components #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright 2020, Verizon Media
Copyright Yahoo 2021

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
2 changes: 1 addition & 1 deletion addon/components/color-enums.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2020, Verizon Media
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
export const COLORS = [
Expand Down
2 changes: 1 addition & 1 deletion addon/components/denali-alert-enums.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021, Verizon Media
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/

Expand Down
2 changes: 1 addition & 1 deletion addon/components/denali-alert-inline.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<div class="alert is-inline {{this.styleClass}}" ...attributes>
<p>
{{#if (has-block)}}
Expand Down
5 changes: 3 additions & 2 deletions addon/components/denali-alert-inline.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/**
* Copyright 2020, Verizon Media
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
import Component from '@glimmer/component';
import { arg } from 'ember-arg-types';
import { arg, forbidExtraArgs } from 'ember-arg-types';
import { oneOf, string } from 'prop-types';
import { STYLES } from './denali-alert-enums';

@forbidExtraArgs
export default class DenaliAlertInlineComponent extends Component {
@arg(oneOf(STYLES))
style = STYLES[0];
Expand Down
2 changes: 1 addition & 1 deletion addon/components/denali-alert.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<div class="alert {{this.typeClass}} {{this.isBlockClass}}" ...attributes>
<span class="d-icon {{this.iconClass}}"></span>
<div>
Expand Down
3 changes: 2 additions & 1 deletion addon/components/denali-alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
import Component from '@glimmer/component';
import { arg } from 'ember-arg-types';
import { arg, forbidExtraArgs } from 'ember-arg-types';
import { boolean, func, oneOf, oneOfType, instanceOf, string } from 'prop-types';
import { STYLES } from './denali-alert-enums';
import { htmlSafe } from '@ember/template';

const SafeString = htmlSafe().constructor;

@forbidExtraArgs
export default class DenaliAlertComponent extends Component {
@arg(oneOf(STYLES))
style = STYLES[0];
Expand Down
2 changes: 1 addition & 1 deletion addon/components/denali-alert/context.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<p ...attributes>
{{yield}}
</p>
2 changes: 1 addition & 1 deletion addon/components/denali-alert/title.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<h5 ...attributes>
{{yield}}
</h5>
14 changes: 8 additions & 6 deletions addon/components/denali-box.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<div class="box" ...attributes>
{{yield (hash
Header=(component "denali-box/header")
SubHeader=(component "denali-box/sub-header")
Footer=(component "denali-box/footer")
)}}
{{yield
(hash
Header=(component "denali-box/header")
SubHeader=(component "denali-box/sub-header")
Footer=(component "denali-box/footer")
)
}}
</div>
2 changes: 1 addition & 1 deletion addon/components/denali-box/footer.hbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<footer>{{yield}}</footer>
2 changes: 1 addition & 1 deletion addon/components/denali-box/header.hbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<h3>{{yield}}</h3>
2 changes: 1 addition & 1 deletion addon/components/denali-box/sub-header.hbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<h5>{{yield}}</h5>
4 changes: 2 additions & 2 deletions addon/components/denali-breadcrumb.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<ul class="breadcrumb" ...attributes>
{{#each @items as | item |}}
{{#each this.items as |item|}}
<li>{{yield item}}</li>
{{/each}}
</ul>
13 changes: 13 additions & 0 deletions addon/components/denali-breadcrumb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
import Component from '@glimmer/component';
import { arg, forbidExtraArgs } from 'ember-arg-types';
import { array } from 'prop-types';

@forbidExtraArgs
export default class DenaliBreadcrumbComponent extends Component {
@arg(array)
items = [];
}
2 changes: 1 addition & 1 deletion addon/components/denali-button-enums.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2020, Verizon Media
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/

Expand Down
11 changes: 9 additions & 2 deletions addon/components/denali-button.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<button
class="button {{this.isActiveClass}} {{this.styleClass}} {{this.sizeClass}} {{this.isInverseClass}} {{this.hasIconClass}} {{this.hasLoaderClass}} {{this.isFullClass}}"
class="button
{{this.isActiveClass}}
{{this.styleClass}}
{{this.sizeClass}}
{{this.isInverseClass}}
{{this.hasIconClass}}
{{this.hasLoaderClass}}
{{this.isFullClass}}"
type={{this.type}}
...attributes
>
Expand Down
5 changes: 3 additions & 2 deletions addon/components/denali-button.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/**
* Copyright 2020, Verizon Media
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
import Component from '@glimmer/component';
import { arg } from 'ember-arg-types';
import { arg, forbidExtraArgs } from 'ember-arg-types';
import { boolean, oneOf, string } from 'prop-types';
import { STYLES, SIZES, TYPES } from './denali-button-enums';

@forbidExtraArgs
export default class DenaliButtonComponent extends Component {
@arg(boolean)
isActive = false;
Expand Down
2 changes: 1 addition & 1 deletion addon/components/denali-checkbox.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<div class="checkbox denali-checkbox">
<input id="denali-checkbox-{{this.checkboxId}}" type="checkbox" ...attributes>
<label for="denali-checkbox-{{this.checkboxId}}">
Expand Down
4 changes: 3 additions & 1 deletion addon/components/denali-checkbox.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/**
* Copyright 2020, Verizon Media
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
import Component from '@glimmer/component';
import { forbidExtraArgs } from 'ember-arg-types';
import { guidFor } from '@ember/object/internals';

@forbidExtraArgs
export default class DenaliCheckboxComponent extends Component {
checkboxId = guidFor(this);
}
2 changes: 1 addition & 1 deletion addon/components/denali-chip-enums.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2020, Verizon Media
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
export const SIZES = ['default', 'small'];
2 changes: 1 addition & 1 deletion addon/components/denali-chip-group.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<span class="chip-group" ...attributes>
{{yield (hash Chip=(component "denali-chip"))}}
</span>
12 changes: 2 additions & 10 deletions addon/components/denali-chip.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<span
class="
chips
{{this.sizeClass}}
{{this.backgroundColorClass}}
{{this.textColorClass}}
"
...attributes
>
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<span class="chips {{this.sizeClass}} {{this.backgroundColorClass}} {{this.textColorClass}} " ...attributes>
{{yield}}
</span>
5 changes: 3 additions & 2 deletions addon/components/denali-chip.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/**
* Copyright 2020, Verizon Media
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
import { arg } from 'ember-arg-types';
import { arg, forbidExtraArgs } from 'ember-arg-types';
import { oneOf } from 'prop-types';
import Component from '@glimmer/component';
import { COLORS, SHADES } from './color-enums';
import { SIZES } from './denali-chip-enums';

@forbidExtraArgs
export default class DenaliChipComponent extends Component {
@arg(oneOf(SIZES))
size;
Expand Down
4 changes: 2 additions & 2 deletions addon/components/denali-div.hbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<div class={{@class}} ...attributes>{{yield}}</div>
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<div class={{this.class}} ...attributes>{{yield}}</div>
13 changes: 13 additions & 0 deletions addon/components/denali-div.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright 2021, Yahoo Holdings Inc.
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
import Component from '@glimmer/component';
import { arg, forbidExtraArgs } from 'ember-arg-types';
import { string } from 'prop-types';

@forbidExtraArgs
export default class DenaliDivComponent extends Component {
@arg(string)
class;
}
2 changes: 1 addition & 1 deletion addon/components/denali-icon-enums.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2020, Verizon Media
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/

Expand Down
8 changes: 2 additions & 6 deletions addon/components/denali-icon.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<i class="d-icon
{{this.iconClass}}
{{this.sizeClass}}"
...attributes
></i>
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<i class="d-icon {{this.iconClass}} {{this.sizeClass}}" ...attributes></i>
5 changes: 3 additions & 2 deletions addon/components/denali-icon.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/**
* Copyright 2020, Verizon Media
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
import Component from '@glimmer/component';
import { arg } from 'ember-arg-types';
import { arg, forbidExtraArgs } from 'ember-arg-types';
import { oneOf, string } from 'prop-types';
import { SIZES } from './denali-icon-enums';

@forbidExtraArgs
export default class DenaliIconComponent extends Component {
@arg(string.isRequired)
icon;
Expand Down
2 changes: 1 addition & 1 deletion addon/components/denali-input-enums.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2020, Verizon Media
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
export const SIZES = ['default', 'small', 'medium'];
Expand Down
2 changes: 1 addition & 1 deletion addon/components/denali-input-group.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<div class="input-group {{this.isStackedClass}} {{this.isResponsiveClass}} {{this.autoWidthClass}}" ...attributes>
<label>{{this.label}}</label>
{{yield}}
Expand Down
3 changes: 2 additions & 1 deletion addon/components/denali-input-group.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Component from '@glimmer/component';
import { arg } from 'ember-arg-types';
import { arg, forbidExtraArgs } from 'ember-arg-types';
import { string, boolean } from 'prop-types';

@forbidExtraArgs
export default class DenaliInputGroupComponent extends Component {
@arg(string)
label;
Expand Down
27 changes: 14 additions & 13 deletions addon/components/denali-input.hbs
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<div class="input
{{this.hasIconFrontClass}}
{{this.hasIconBackClass}}
{{this.inverseClass}}
{{this.sizeClass}}
{{this.activeClass}}
{{this.errorClass}}
{{this.wrapperClass}}
"
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
<div
class="input
{{this.hasIconFrontClass}}
{{this.hasIconBackClass}}
{{this.inverseClass}}
{{this.sizeClass}}
{{this.activeClass}}
{{this.errorClass}}
{{this.wrapperClass}}
"
>
{{#if @iconFront}}
<span class="d-icon d-{{@iconFront}} {{this.iconFrontClass}}"></span>
{{#if this.iconFront}}
<span class="d-icon d-{{this.iconFront}} {{this.iconFrontClass}}"></span>
{{/if}}
<input ...attributes>
{{#if @iconBack}}
{{#if this.iconBack}}
<span class="d-icon d-{{this.iconBack}} {{this.iconBackClass}}"></span>
{{/if}}

Expand Down
5 changes: 3 additions & 2 deletions addon/components/denali-input.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/**
* Copyright 2020, Verizon Media
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/
import Component from '@glimmer/component';
import { arg } from 'ember-arg-types';
import { arg, forbidExtraArgs } from 'ember-arg-types';
import { boolean, oneOf, string } from 'prop-types';
import { SIZES, STATES } from './denali-input-enums';

@forbidExtraArgs
export default class DenaliInputComponent extends Component {
@arg(oneOf(SIZES))
size;
Expand Down
2 changes: 1 addition & 1 deletion addon/components/denali-link-enums.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2020, Verizon Media
* Copyright Yahoo 2021
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*/

Expand Down
6 changes: 3 additions & 3 deletions addon/components/denali-link-to.hbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{! Copyright 2020, Verizon Media. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{! Copyright Yahoo 2021. Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms. }}
{{#if this.iconFront}}
<DenaliIcon class={{this.iconFrontClass}} @icon={{this.iconFront}}/>
<DenaliIcon class={{this.iconFrontClass}} @icon={{this.iconFront}} />
{{/if}}

{{yield}}

{{#if this.iconBack}}
<DenaliIcon class={{this.iconBackClass}} @icon={{this.iconBack}}/>
<DenaliIcon class={{this.iconBackClass}} @icon={{this.iconBack}} />
{{/if}}
Loading