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

Upgrade to TailwindCSS v2.0 #127

Merged
merged 6 commits into from
Dec 20, 2020
Merged
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
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ module.exports = {
plugins: [],
extends: ['@underline/eslint-config-ember-typescript'],
rules: {
'@typescript-eslint/no-empty-interface': 'off'
'@typescript-eslint/no-empty-interface': 'off',
'ember/no-empty-glimmer-component-classes': 'off'
},
overrides: [
{
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: 10.x
node-version: 12.x
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: 12.x
- name: Install yarn
Expand All @@ -82,7 +82,7 @@ jobs:
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/setup-node@v2
with:
node-version: 12.x
- name: Install yarn
Expand Down
3 changes: 2 additions & 1 deletion .template-lintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
quotes: 'double',
'no-curly-component-invocation': {
allow: ['demo.example', 'nav.item', 'nav.subnav']
}
},
'eol-last': false
}
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"try:one": "yarn workspaces run try:one"
},
"devDependencies": {
"@underline/eslint-config-ember-typescript": "^0.9.3",
"@underline/eslint-config-node": "^0.9.0",
"@underline/eslint-config-ember-typescript": "^0.10.1",
"@underline/eslint-config-node": "^0.10.0",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^2.14.0",
"eslint": "^7.11.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/buttons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
"@types/ember__test-helpers": "^1.7.3",
"@types/qunit": "^2.9.5",
"@types/rsvp": "^4.0.3",
"autoprefixer": "^9.8.0",
"autoprefixer": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^1.6.0",
"ember-cli": "~3.22.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-inject-live-reload": "^2.0.2",
"ember-cli-postcss": "^6.0.1",
"ember-cli-postcss": "^7.0.0",
"ember-cli-typescript-blueprints": "^3.0.0",
"ember-cli-uglify": "^3.0.0",
"ember-disable-prototype-extensions": "^1.1.3",
Expand All @@ -57,7 +57,7 @@
"ember-try": "^1.4.0",
"loader.js": "^4.7.0",
"qunit-dom": "^1.5.0",
"tailwindcss": "^1.9.5",
"tailwindcss": "^2.0.2",
"typescript": "^4.0.3"
},
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions packages/buttons/tailwind/default-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const defaultTheme = require('tailwindcss/resolveConfig')(
).theme;

const defaultConfig = {
borderRadius: defaultTheme.borderRadius.default,
borderRadius: defaultTheme.borderRadius.DEFAULT,
default: {
contrastColor: defaultTheme.colors.white,
color: defaultTheme.colors.gray[700],
Expand Down Expand Up @@ -102,7 +102,7 @@ function defaultOptions({ config }) {
paddingBottom: defaultTheme.spacing[3],
paddingLeft: defaultTheme.spacing[4],
borderRadius: config.borderRadius,
borderWidth: defaultTheme.borderWidth.default,
borderWidth: defaultTheme.borderWidth.DEFAULT,
borderColor: defaultTheme.colors.transparent,
'&.focus-visible:focus': {
outline: 'none',
Expand All @@ -115,7 +115,7 @@ function defaultOptions({ config }) {
},
variants: {
xs: {
fontSize: defaultTheme.fontSize.sm,
fontSize: defaultTheme.fontSize.sm[0],
paddingTop: defaultTheme.spacing[1],
paddingRight: defaultTheme.spacing[2],
paddingBottom: defaultTheme.spacing[1],
Expand All @@ -134,7 +134,7 @@ function defaultOptions({ config }) {
paddingLeft: defaultTheme.spacing[4]
},
xl: {
fontSize: defaultTheme.fontSize.xl,
fontSize: defaultTheme.fontSize.xl[0],
paddingTop: defaultTheme.spacing[5],
paddingRight: defaultTheme.spacing[6],
paddingBottom: defaultTheme.spacing[5],
Expand Down
8 changes: 5 additions & 3 deletions packages/buttons/tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
@frontile/buttons
</h2>

<a href="/tests?hidepassed" class="px-4 py-2 text-teal-600 border border-teal-600 rounded hover:bg-teal-700 hover:text-white">
<a
href="/tests?hidepassed"
class="px-4 py-2 text-gray-800 border rounded hover:bg-gray-700 hover:text-white"
>
Go to Tests
</a>
</div>

{{outlet}}

</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ interface ChangesetFormFieldsGroupArgs {
onChange?: (value: unknown, event: Event) => void;
}

export default class ChangesetFormFieldsCheckboxGroup extends Component<
ChangesetFormFieldsGroupArgs
> {
export default class ChangesetFormFieldsCheckboxGroup extends Component<ChangesetFormFieldsGroupArgs> {
constructor(owner: unknown, args: ChangesetFormFieldsGroupArgs) {
super(owner, args);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ interface ChangesetFormFieldsCheckboxArgs extends BaseArgs {
onChange?: (value: unknown, event: Event) => void;
}

export default class ChangesetFormFieldsCheckbox extends Base<
ChangesetFormFieldsCheckboxArgs
> {
export default class ChangesetFormFieldsCheckbox extends Base<ChangesetFormFieldsCheckboxArgs> {
get fullFieldName(): string {
return this.args._groupName
? `${this.args._groupName}.${this.args.fieldName}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ interface ChangesetFormFieldsInputArgs extends BaseArgs {
onInput?: (value: string, event: InputEvent) => void;
}

export default class ChangesetFormFieldsInput extends Base<
ChangesetFormFieldsInputArgs
> {
export default class ChangesetFormFieldsInput extends Base<ChangesetFormFieldsInputArgs> {
@action handleInput(value: string, event: InputEvent): void {
this.args.changeset.set(this.args.fieldName, value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ interface ChangesetFormFieldsRadioArgs extends BaseArgs {
onChange?: (value: unknown, event: Event) => void;
}

export default class ChangesetFormFieldsRadio extends Base<
ChangesetFormFieldsRadioArgs
> {
export default class ChangesetFormFieldsRadio extends Base<ChangesetFormFieldsRadioArgs> {
@action handleChange(value: unknown, event: Event): void {
event.preventDefault();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ interface ChangesetFormFieldsSelectArgs extends BaseArgs {
onClose?: (select: Select, event: Event) => void;
}

export default class ChangesetFormFieldsSelect extends Base<
ChangesetFormFieldsSelectArgs
> {
export default class ChangesetFormFieldsSelect extends Base<ChangesetFormFieldsSelectArgs> {
@action
handleChange(selection: unknown, select: Select, event?: Event): void {
this.args.changeset.set(this.args.fieldName, selection);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ interface ChangesetFormFieldsTextareaArgs extends BaseArgs {
onInput?: (value: string, event: InputEvent) => void;
}

export default class ChangesetFormFieldsTextarea extends Base<
ChangesetFormFieldsTextareaArgs
> {
export default class ChangesetFormFieldsTextarea extends Base<ChangesetFormFieldsTextareaArgs> {
@action handleInput(value: string, event: InputEvent): void {
this.args.changeset.set(this.args.fieldName, value);

Expand Down
6 changes: 3 additions & 3 deletions packages/changeset-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
"@types/ember__test-helpers": "^1.7.3",
"@types/qunit": "^2.9.5",
"@types/rsvp": "^4.0.3",
"autoprefixer": "^9.8.0",
"autoprefixer": "^10.1.0",
"broccoli-asset-rev": "^3.0.0",
"ember-auto-import": "^1.6.0",
"ember-cli": "~3.22.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-inject-live-reload": "^2.0.1",
"ember-cli-postcss": "^6.0.1",
"ember-cli-postcss": "^7.0.0",
"ember-cli-typescript-blueprints": "^3.0.0",
"ember-cli-uglify": "^3.0.0",
"ember-disable-prototype-extensions": "^1.1.3",
Expand All @@ -59,7 +59,7 @@
"ember-try": "^1.4.0",
"loader.js": "^4.7.0",
"qunit-dom": "^1.5.0",
"tailwindcss": "^1.9.5",
"tailwindcss": "^2.0.2",
"typescript": "^4.0.3"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ import hbs from 'htmlbars-inline-precompile';
import { Changeset } from 'ember-changeset';
import { run } from '@ember/runloop';

module('Integration | Component | ChangesetForm::Fields::Checkbox', function (
hooks
) {
setupRenderingTest(hooks);
module(
'Integration | Component | ChangesetForm::Fields::Checkbox',
function (hooks) {
setupRenderingTest(hooks);

hooks.beforeEach(async function beforeEach(this: {
set: (key: string, val: unknown) => void;
}) {
const model = {
blue: true,
green: false,
red: false
};
this.set('changeset', Changeset(model));
hooks.beforeEach(async function beforeEach(this: {
set: (key: string, val: unknown) => void;
}) {
const model = {
blue: true,
green: false,
red: false
};
this.set('changeset', Changeset(model));

await render(hbs`
await render(hbs`
<ChangesetForm::Fields::Checkbox
@changeset={{this.changeset}}
@fieldName="blue"
Expand All @@ -40,35 +40,36 @@ module('Integration | Component | ChangesetForm::Fields::Checkbox', function (
data-test-checkbox-red
/>
`);
});
});

test('it renders with initial model value', async function (assert) {
assert.dom('[data-test-checkbox-blue]').isChecked();
assert.dom('[data-test-checkbox-green]').isNotChecked();
assert.dom('[data-test-checkbox-red]').isNotChecked();
});
test('it renders with initial model value', async function (assert) {
assert.dom('[data-test-checkbox-blue]').isChecked();
assert.dom('[data-test-checkbox-green]').isNotChecked();
assert.dom('[data-test-checkbox-red]').isNotChecked();
});

test('it updates the changeset on input', async function (assert) {
await click('[data-test-checkbox-blue]');
await click('[data-test-checkbox-green]');
await click('[data-test-checkbox-red]');
test('it updates the changeset on input', async function (assert) {
await click('[data-test-checkbox-blue]');
await click('[data-test-checkbox-green]');
await click('[data-test-checkbox-red]');

assert.equal(this.changeset.get('blue'), false);
assert.equal(this.changeset.get('green'), true);
assert.equal(this.changeset.get('red'), true);
});
assert.equal(this.changeset.get('blue'), false);
assert.equal(this.changeset.get('green'), true);
assert.equal(this.changeset.get('red'), true);
});

test('it receives original input values on rollback', async function (assert) {
await click('[data-test-checkbox-green]');
test('it receives original input values on rollback', async function (assert) {
await click('[data-test-checkbox-green]');

assert.dom('[data-test-checkbox-blue]').isChecked();
assert.dom('[data-test-checkbox-red]').isNotChecked();
assert.dom('[data-test-checkbox-blue]').isChecked();
assert.dom('[data-test-checkbox-red]').isNotChecked();

run(() => {
this.changeset.rollback();
run(() => {
this.changeset.rollback();
});
assert.dom('[data-test-checkbox-blue]').isChecked();
assert.dom('[data-test-checkbox-green]').isNotChecked();
assert.dom('[data-test-checkbox-red]').isNotChecked();
});
assert.dom('[data-test-checkbox-blue]').isChecked();
assert.dom('[data-test-checkbox-green]').isNotChecked();
assert.dom('[data-test-checkbox-red]').isNotChecked();
});
});
}
);
Loading