Skip to content

Commit

Permalink
refactor: groupe component and stories and test into dedicated folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaudAV committed Jan 5, 2022
1 parent c0429eb commit 69db1c9
Show file tree
Hide file tree
Showing 272 changed files with 1,822 additions and 590 deletions.
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
features: {
previewCsfV3: true,
},
stories: ['../stories/**/*.stories.@(js|ts|mdx)'],
stories: ['../stories/**/*.stories.@(js|ts|mdx)', '../src/**/*.stories.@(js|ts|mdx)'],

addons: ['@storybook/addon-essentials', '@storybook/addon-a11y'],

Expand Down
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { setCustomElements } from '@storybook/web-components';
import '../assets/css/gravitee-theme.generated.css';
import '../assets/css/documentation.css';
import { defaultLanguages, i18nDecorator, languages } from '../stories/lib/i18n-decorator';
import { defaultLanguages, i18nDecorator, languages } from '../testing/lib/i18n-decorator';
import customElements from '../.docs/custom-elements.json';

export const globalTypes = {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"generate:dist": "yarn tsc && cp -R assets dist/ && cp package.json dist/",
"generate:icons": "node tasks/generate-icons.js && yarn lint:fix",
"generate:theme": "node tasks/generate-theme.js && yarn lint:fix",
"lint": "eslint src stories tasks && yarn prettier",
"lint": "eslint src testing tasks && yarn prettier",
"lint:commit": "commitlint --from $(git describe --tags --abbrev=0) --to HEAD --verbose",
"lint:fix": "eslint --fix src stories tasks && yarn prettier:fix",
"lint:fix": "eslint --fix src testing tasks && yarn prettier:fix",
"lint:license": "license-check-and-add check -f license-check-config.json",
"lint:license:fix": "license-check-and-add add -f license-check-config.json -r $(date +%Y)",
"lint:package": "sort-package-json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import { css, LitElement, unsafeCSS, html } from 'lit';
import { dispatchCustomEvent } from '../lib/events';
import { dispatchCustomEvent } from '../../lib/events';
import { repeat } from 'lit/directives/repeat';
import { classMap } from 'lit/directives/class-map';
import { styleMap } from 'lit/directives/style-map';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import '../../src/atoms/gv-autocomplete';
import '../../src/atoms/gv-input';
import '../../src/atoms/gv-image';
import { makeStory } from '../lib/make-story';
import picture from '../../assets/images/avatar.png';
import './gv-autocomplete';
import '../gv-input';
import '../gv-image';
import { makeStory } from '../../../testing/lib/make-story';
import picture from '../../../assets/images/avatar.png';

export default {
title: 'Atoms/gv-autocomplete',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import '../../src/atoms/gv-autocomplete';
import '../../src/atoms/gv-input';
import '../../src/atoms/gv-image';
import './gv-autocomplete';
import '../gv-input';
import '../gv-image';
import { afterEach, beforeEach, describe, expect, test } from '@jest/globals';
import { Page, querySelector } from '../lib/test-utils';
import { Page, querySelector } from '../../../testing/lib/test-utils';

describe('A U T O C O M P L E T E', () => {
let page;
Expand Down
16 changes: 16 additions & 0 deletions src/atoms/gv-autocomplete/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (C) 2021 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './gv-autocomplete';
8 changes: 4 additions & 4 deletions src/atoms/gv-button.js → src/atoms/gv-button/gv-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
*/
import { classMap } from 'lit/directives/class-map';
import { LitElement, html, css } from 'lit';
import { skeleton } from '../styles/skeleton';
import { link } from '../styles/link';
import '../atoms/gv-icon';
import { skeleton } from '../../styles/skeleton';
import { link } from '../../styles/link';
import '../gv-icon';
import { ifDefined } from 'lit/directives/if-defined';
import { dispatchCustomEvent } from '../lib/events';
import { dispatchCustomEvent } from '../../lib/events';

/**
* A button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import '../../src/atoms/gv-button';
import { makeStory } from '../lib/make-story';
import './gv-button';
import { makeStory } from '../../../testing/lib/make-story';

const items = [
{ innerHTML: 'Default' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/
import { afterEach, beforeEach, describe, expect, test, jest } from '@jest/globals';
import { Page, querySelector } from '../lib/test-utils';
import '../../src/atoms/gv-button';
import { Page, querySelector } from '../../../testing/lib/test-utils';
import './gv-button';

describe('B U T T O N', () => {
describe('<gv-button>', () => {
Expand Down
16 changes: 16 additions & 0 deletions src/atoms/gv-button/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (C) 2021 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './gv-button';
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import { classMap } from 'lit/directives/class-map';

import { LitElement, html, css } from 'lit';
import { skeleton } from '../styles/skeleton';
import { dispatchCustomEvent } from '../lib/events';
import { InputElement } from '../mixins/input-element';
import { skeleton } from '../../styles/skeleton';
import { dispatchCustomEvent } from '../../lib/events';
import { InputElement } from '../../mixins/input-element';

/**
* A wrapper of a <checkbox> component.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import '../../src/atoms/gv-checkbox';
import { makeStory } from '../lib/make-story';
import './gv-checkbox';
import { makeStory } from '../../../testing/lib/make-story';

const items = [{ innerHTML: 'Default' }, { innerHTML: 'With label', label: 'Default with label' }];

Expand Down
16 changes: 16 additions & 0 deletions src/atoms/gv-checkbox/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (C) 2021 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './gv-checkbox';
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import './gv-date-picker-cell';
import '../gv-date-picker-cell';
import {
addDays,
addMonths,
Expand All @@ -33,8 +33,8 @@ import {
subYears,
} from 'date-fns';
import { classMap } from 'lit/directives/class-map';
import { dispatchCustomEvent } from '../lib/events';
import { i18n } from '../lib/i18n';
import { dispatchCustomEvent } from '../../lib/events';
import { i18n } from '../../lib/i18n';
import { LitElement, css, html } from 'lit';

import { until } from 'lit/directives/until';
Expand Down
16 changes: 16 additions & 0 deletions src/atoms/gv-date-picker-calendar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (C) 2021 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './gv-date-picker-calendar';
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/
import { LitElement, html, css } from 'lit';
import { classMap } from 'lit/directives/class-map';
import { dispatchCustomEvent } from '../lib/events';
import { dispatchCustomEvent } from '../../lib/events';
import { startOfDay } from 'date-fns';
import { until } from 'lit/directives/until';
import { isInvalid } from '../lib/date';
import { isInvalid } from '../../lib/date';

/**
* Date Picker Cell
Expand Down
16 changes: 16 additions & 0 deletions src/atoms/gv-date-picker-cell/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (C) 2021 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './gv-date-picker-cell';
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import './gv-date-picker-calendar';
import '../gv-date-picker-calendar';
import enUS from 'date-fns/locale/en-US';
import { format, getMonth, getYear, parse } from 'date-fns';
import { classMap } from 'lit/directives/class-map';
import { css, LitElement, html } from 'lit';
import { getLanguage, i18n } from '../lib/i18n';
import { getLanguage, i18n } from '../../lib/i18n';

import { isInvalid } from '../lib/date';
import { isInvalid } from '../../lib/date';
import { until } from 'lit/directives/until';
import { dispatchCustomEvent } from '../lib/events';
import { dispatchCustomEvent } from '../../lib/events';

const locales = { en: enUS };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import '../../src/atoms/gv-input';
import '../../src/atoms/gv-date-picker';
import { makeStory } from '../lib/make-story';
import '../gv-input';
import './gv-date-picker';
import { makeStory } from '../../../testing/lib/make-story';

export default {
title: 'Atoms/gv-date-picker',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/
import { afterEach, beforeEach, describe, expect, test } from '@jest/globals';
import { Page, querySelector } from '../lib/test-utils';
import '../../src/atoms/gv-date-picker';
import { Page, querySelector } from '../../../testing/lib/test-utils';
import './gv-date-picker';

describe('D A T E P I C K E R', () => {
let page;
Expand Down
16 changes: 16 additions & 0 deletions src/atoms/gv-date-picker/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (C) 2021 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './gv-date-picker';
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/
import { css, LitElement, html } from 'lit';
import { link } from '../styles/link';
import { dispatchCustomEvent } from '../lib/events';
import { link } from '../../styles/link';
import { dispatchCustomEvent } from '../../lib/events';
import { ifDefined } from 'lit/directives/if-defined';
import { i18n } from '../lib/i18n';
import { i18n } from '../../lib/i18n';
import { classMap } from 'lit/directives/class-map';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import '../../src/atoms/gv-file-upload';
import { makeStory } from '../lib/make-story';
import img from '../../assets/images/gravitee-logo-white.svg';
import './gv-file-upload';
import { makeStory } from '../../../testing/lib/make-story';
import img from '../../../assets/images/gravitee-logo-white.svg';

export default {
title: 'Atoms/gv-file-upload',
Expand Down
16 changes: 16 additions & 0 deletions src/atoms/gv-file-upload/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (C) 2021 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './gv-file-upload';
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import '../../src/atoms/gv-icon';
import { icons } from '../../.docs/icons.json';
import './gv-icon';
import { icons } from '../../../.docs/icons.json';
import { html } from 'lit';
import { styleMap } from 'lit/directives/style-map';
import { repeat } from 'lit/directives/repeat';
Expand Down
16 changes: 16 additions & 0 deletions src/atoms/gv-icon/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (C) 2021 The Gravitee team (http://gravitee.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './gv-icon';
4 changes: 2 additions & 2 deletions src/atoms/gv-image.js → src/atoms/gv-image/gv-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/
import { LitElement, html, css } from 'lit';
import { dispatchCustomEvent } from '../lib/events';
import { dispatchCustomEvent } from '../../lib/events';
import { classMap } from 'lit/directives/class-map';
import { ifDefined } from 'lit/directives/if-defined';
import { skeleton } from '../styles/skeleton';
import { skeleton } from '../../styles/skeleton';

/**
* An image
Expand Down
Loading

0 comments on commit 69db1c9

Please sign in to comment.