├── .babelrc.json ├── .editorconfig ├── .eslintrc ├── .gitignore ├── .gitlab-ci.yml ├── .gitlab ├── issue_templates │ └── Default.md └── merge_request_templates │ └── Default.md ├── .npmrc ├── .storybook ├── addons │ └── versioning │ │ ├── index.js │ │ └── register.js ├── main.js ├── manager-head.html ├── manager.js ├── preview-head.html ├── preview.js └── theme.js ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── TODO_NEXT_MAJOR_RELEASE.md ├── angular ├── .editorconfig ├── .gitignore ├── .npmrc ├── README.md ├── angular.json ├── package-lock.json ├── package.json ├── projects │ ├── wcs-angular │ │ ├── .npmrc │ │ ├── README.md │ │ ├── karma.conf.js │ │ ├── ng-package.json │ │ ├── package.json │ │ ├── src │ │ │ ├── lib │ │ │ │ ├── angular-component-lib │ │ │ │ │ └── utils.ts │ │ │ │ ├── directives │ │ │ │ │ ├── checkbox-value-accessor.directive.ts │ │ │ │ │ ├── counter-value-accessor.directive.ts │ │ │ │ │ ├── grid-value-accessor.directive.ts │ │ │ │ │ ├── input-value-accessor.directive.ts │ │ │ │ │ ├── radio-group-value-accessor.directive.ts │ │ │ │ │ ├── select-value-accessor.directive.ts │ │ │ │ │ ├── switch-value-accessor.directive.ts │ │ │ │ │ └── textarea-value-accessor.directive.ts │ │ │ │ ├── proxies.ts │ │ │ │ └── wcs-angular.module.ts │ │ │ └── public-api.ts │ │ ├── tsconfig.lib.json │ │ ├── tsconfig.lib.prod.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json │ └── wcs-formly │ │ ├── .npmrc │ │ ├── README.md │ │ ├── karma.conf.js │ │ ├── ng-package.json │ │ ├── package.json │ │ ├── src │ │ ├── lib │ │ │ ├── formly-wcs-boolean-field-wrapper.component.ts │ │ │ ├── formly-wcs-field-checkbox.component.ts │ │ │ ├── formly-wcs-field-counter.component.ts │ │ │ ├── formly-wcs-field-input.component.ts │ │ │ ├── formly-wcs-field-native-select.component.ts │ │ │ ├── formly-wcs-field-radio.component.ts │ │ │ ├── formly-wcs-field-select.component.ts │ │ │ ├── formly-wcs-field-switch.component.ts │ │ │ ├── formly-wcs-field-textarea.component.ts │ │ │ ├── formly-wcs-field-wrapper.component.ts │ │ │ ├── pipes │ │ │ │ └── wcs-formly-options.pipe.ts │ │ │ ├── types │ │ │ │ └── formly-props-types.ts │ │ │ └── wcs-formly.module.ts │ │ └── public-api.ts │ │ ├── tsconfig.lib.json │ │ ├── tsconfig.lib.prod.json │ │ ├── tsconfig.spec.json │ │ └── tslint.json ├── tsconfig.json └── tslint.json ├── custom-elements.json ├── design-tokens ├── README.md ├── doc │ ├── design-token-json-to-css-wcs.drawio │ └── design-token-json-to-css-wcs.png ├── index.mjs ├── manifest.mjs ├── overrides │ ├── sncf-holding.css │ ├── sncf-reseau.css │ └── sncf-voyageurs.css ├── token-builder.mjs └── tokens │ ├── sncf-holding-primitive.json │ ├── sncf-holding-semantic.json │ ├── sncf-reseau-primitive.json │ ├── sncf-reseau-semantic.json │ ├── sncf-voyageurs-primitive.json │ ├── sncf-voyageurs-semantic.json │ └── wcs-design-tokens-manifest.json ├── doc ├── base.scss └── gitlab-pages-redirect-root │ └── index.html ├── example ├── angular-standalone │ ├── .editorconfig │ ├── .gitignore │ ├── README.md │ ├── angular.json │ ├── package-lock.json │ ├── package.json │ ├── public │ │ └── favicon.ico │ ├── src │ │ ├── app │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.ts │ │ │ ├── app.config.ts │ │ │ └── app.routes.ts │ │ ├── assets │ │ │ ├── fonts │ │ │ │ ├── avenir-black.woff │ │ │ │ ├── avenir-book.woff │ │ │ │ ├── avenir-heavy.woff │ │ │ │ ├── avenir-lighter.woff │ │ │ │ ├── avenir-medium.woff │ │ │ │ ├── avenir-roman.woff │ │ │ │ └── icons │ │ │ │ │ ├── icons.eot │ │ │ │ │ ├── icons.svg │ │ │ │ │ ├── icons.ttf │ │ │ │ │ ├── icons.woff │ │ │ │ │ └── icons.woff2 │ │ │ └── sncf-logo.png │ │ ├── index.html │ │ ├── main.ts │ │ └── styles.scss │ ├── tsconfig.app.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── angular │ ├── .browserslistrc │ ├── .editorconfig │ ├── .gitignore │ ├── .npmrc │ ├── README.md │ ├── angular.json │ ├── e2e │ │ ├── protractor.conf.js │ │ ├── src │ │ │ ├── app.e2e-spec.ts │ │ │ └── app.po.ts │ │ └── tsconfig.json │ ├── karma.conf.js │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── app │ │ │ ├── about │ │ │ │ ├── about-article.component.ts │ │ │ │ ├── about-intro.component.ts │ │ │ │ └── about.component.ts │ │ │ ├── app-routing.module.ts │ │ │ ├── app.component.ts │ │ │ ├── app.module.ts │ │ │ ├── aria-current.directive.ts │ │ │ ├── components │ │ │ │ └── breadcrumb │ │ │ │ │ ├── breadcrumb.component.ts │ │ │ │ │ └── breadcrumb.service.ts │ │ │ ├── data │ │ │ │ ├── aboutArticles.ts │ │ │ │ └── article-title.resolver.ts │ │ │ ├── example │ │ │ │ ├── counter-example │ │ │ │ │ ├── counter-example.component.ts │ │ │ │ │ ├── counter-formly-default-value.component.ts │ │ │ │ │ └── counter-formly-passengers-example.component.ts │ │ │ │ ├── formly-example │ │ │ │ │ ├── formly-example.component.ts │ │ │ │ │ ├── formly-input-examples.component.ts │ │ │ │ │ └── formly-styling-example.component.ts │ │ │ │ ├── grid-example │ │ │ │ │ ├── grid-example.component.ts │ │ │ │ │ └── grid-server-pagination-example.component.ts │ │ │ │ ├── input-example │ │ │ │ │ └── input-example.component.ts │ │ │ │ ├── main-example.component.ts │ │ │ │ ├── modal-example │ │ │ │ │ └── modal-example.component.ts │ │ │ │ ├── radio-group-example │ │ │ │ │ └── radio-group-example.component.ts │ │ │ │ └── select-example │ │ │ │ │ ├── autocomplete-select-example.component.ts │ │ │ │ │ ├── native-select-example.component.ts │ │ │ │ │ └── select-example.component.ts │ │ │ └── layouts │ │ │ │ └── main-layout.component.ts │ │ ├── assets │ │ │ ├── .gitkeep │ │ │ ├── fonts │ │ │ │ ├── avenir-black.woff │ │ │ │ ├── avenir-book.woff │ │ │ │ ├── avenir-heavy.woff │ │ │ │ ├── avenir-lighter.woff │ │ │ │ ├── avenir-medium.woff │ │ │ │ ├── avenir-roman.woff │ │ │ │ └── icons │ │ │ │ │ ├── icons.eot │ │ │ │ │ ├── icons.svg │ │ │ │ │ ├── icons.ttf │ │ │ │ │ ├── icons.woff │ │ │ │ │ └── icons.woff2 │ │ │ └── sncf-logo.png │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── styles.scss │ │ └── test.ts │ ├── tsconfig.app.json │ ├── tsconfig.json │ ├── tsconfig.spec.json │ └── tslint.json └── react │ ├── .gitignore │ ├── README.md │ ├── config-overrides.js │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── favicon.ico │ ├── fonts │ │ ├── avenir-black.woff │ │ ├── avenir-book.woff │ │ ├── avenir-heavy.woff │ │ ├── avenir-lighter.woff │ │ ├── avenir-medium.woff │ │ ├── avenir-roman.woff │ │ └── icons │ │ │ ├── icons.eot │ │ │ ├── icons.svg │ │ │ ├── icons.ttf │ │ │ ├── icons.woff │ │ │ └── icons.woff2 │ ├── index.html │ ├── logo192.png │ ├── logo512.png │ ├── manifest.json │ ├── robots.txt │ └── sncf-logo.png │ ├── src │ ├── App.css │ ├── App.test.tsx │ ├── App.tsx │ ├── components │ │ ├── com-nav.tsx │ │ ├── header.tsx │ │ ├── input-demo.tsx │ │ ├── nav.tsx │ │ └── textarea-demo.tsx │ ├── index.css │ ├── index.tsx │ ├── react-app-env.d.ts │ ├── reportWebVitals.ts │ ├── routes │ │ ├── about.tsx │ │ └── example.tsx │ └── setupTests.ts │ └── tsconfig.json ├── package-lock.json ├── package.d.ts ├── package.json ├── react ├── .gitignore ├── README.md ├── lib │ ├── components │ │ └── stencil-generated │ │ │ ├── index.ts │ │ │ └── react-component-lib │ │ │ ├── createComponent.tsx │ │ │ ├── createOverlayComponent.tsx │ │ │ ├── index.ts │ │ │ ├── interfaces.ts │ │ │ └── utils │ │ │ ├── attachProps.ts │ │ │ ├── case.ts │ │ │ ├── dev.ts │ │ │ └── index.tsx │ └── index.ts ├── package-lock.json ├── package.json ├── rollup.config.mjs └── tsconfig.json ├── scripts ├── custom-elements-output-storybook.ts ├── update-develop-from-master.js └── update-version.js ├── src ├── assets │ ├── fonts │ │ ├── avenir-black.woff │ │ ├── avenir-book.woff │ │ ├── avenir-heavy.woff │ │ ├── avenir-lighter.woff │ │ ├── avenir-medium.woff │ │ ├── avenir-roman.woff │ │ └── icons │ │ │ ├── icons.eot │ │ │ ├── icons.svg │ │ │ ├── icons.ttf │ │ │ ├── icons.woff │ │ │ └── icons.woff2 │ ├── github-32px.png │ └── sncf-logo.png ├── components.d.ts ├── components │ ├── accordion-content │ │ ├── accordion-content.scss │ │ ├── accordion-content.tsx │ │ └── readme.md │ ├── accordion-header │ │ ├── accordion-header.scss │ │ ├── accordion-header.tsx │ │ └── readme.md │ ├── accordion-panel │ │ ├── accordion-panel.scss │ │ ├── accordion-panel.tsx │ │ └── readme.md │ ├── accordion │ │ ├── accordion.scss │ │ ├── accordion.tsx │ │ └── readme.md │ ├── action-bar │ │ ├── action-bar.scss │ │ ├── action-bar.tsx │ │ └── readme.md │ ├── app │ │ ├── app.scss │ │ ├── app.tsx │ │ └── readme.md │ ├── badge │ │ ├── badge-interface.ts │ │ ├── badge.scss │ │ ├── badge.tsx │ │ └── readme.md │ ├── breadcrumb-item │ │ ├── breadcrumb-item.scss │ │ ├── breadcrumb-item.tsx │ │ └── readme.md │ ├── breadcrumb │ │ ├── breadcrumb-constants.ts │ │ ├── breadcrumb.e2e.ts │ │ ├── breadcrumb.scss │ │ ├── breadcrumb.tsx │ │ └── readme.md │ ├── button │ │ ├── button-interface.ts │ │ ├── button.e2e.ts │ │ ├── button.scss │ │ ├── button.tsx │ │ └── readme.md │ ├── card-body │ │ ├── card-body.scss │ │ ├── card-body.tsx │ │ └── readme.md │ ├── card │ │ ├── card-interface.ts │ │ ├── card.scss │ │ ├── card.tsx │ │ └── readme.md │ ├── checkbox │ │ ├── checkbox-interface.ts │ │ ├── checkbox.e2e.ts │ │ ├── checkbox.scss │ │ ├── checkbox.tsx │ │ └── readme.md │ ├── com-nav-category │ │ ├── com-nav-category.scss │ │ ├── com-nav-category.tsx │ │ └── readme.md │ ├── com-nav-item │ │ ├── com-nav-item.scss │ │ ├── com-nav-item.tsx │ │ └── readme.md │ ├── com-nav-submenu │ │ ├── com-nav-submenu.scss │ │ ├── com-nav-submenu.tsx │ │ └── readme.md │ ├── com-nav │ │ ├── com-nav-focus.scss │ │ ├── com-nav-interface.ts │ │ ├── com-nav-size.ts │ │ ├── com-nav-utils.ts │ │ ├── com-nav.e2e.ts │ │ ├── com-nav.scss │ │ ├── com-nav.tsx │ │ └── readme.md │ ├── counter │ │ ├── counter-interface.ts │ │ ├── counter.e2e.ts │ │ ├── counter.scss │ │ ├── counter.tsx │ │ └── readme.md │ ├── divider │ │ ├── divider.scss │ │ ├── divider.tsx │ │ └── readme.md │ ├── dropdown-divider │ │ ├── dropdown-divider.scss │ │ ├── dropdown-divider.tsx │ │ └── readme.md │ ├── dropdown-header │ │ ├── dropdown-header.scss │ │ ├── dropdown-header.tsx │ │ └── readme.md │ ├── dropdown-item │ │ ├── dropdown-item.scss │ │ ├── dropdown-item.tsx │ │ └── readme.md │ ├── dropdown │ │ ├── dropdown-interface.ts │ │ ├── dropdown-keyboard-event.ts │ │ ├── dropdown.e2e.ts │ │ ├── dropdown.scss │ │ ├── dropdown.tsx │ │ └── readme.md │ ├── editable-field │ │ ├── editable-field-interface.tsx │ │ ├── editable-field.e2e.ts │ │ ├── editable-field.scss │ │ ├── editable-field.tsx │ │ └── readme.md │ ├── error │ │ ├── error.scss │ │ ├── error.tsx │ │ └── readme.md │ ├── field-content │ │ ├── field-content.tsx │ │ └── readme.md │ ├── field-label │ │ ├── field-label.tsx │ │ └── readme.md │ ├── field │ │ ├── field.scss │ │ ├── field.tsx │ │ └── readme.md │ ├── footer │ │ ├── footer.scss │ │ ├── footer.tsx │ │ └── readme.md │ ├── form-field │ │ ├── form-field.e2e.ts │ │ ├── form-field.scss │ │ ├── form-field.tsx │ │ └── readme.md │ ├── galactic-menu │ │ ├── galactic-menu.scss │ │ ├── galactic-menu.tsx │ │ └── readme.md │ ├── galactic │ │ ├── galactic.scss │ │ ├── galactic.tsx │ │ └── readme.md │ ├── grid-column │ │ ├── grid-column.scss │ │ ├── grid-column.tsx │ │ ├── grid-sort-arrow.scss │ │ ├── grid-sort-arrow.tsx │ │ └── readme.md │ ├── grid-custom-cell │ │ ├── grid-custom-cell.tsx │ │ └── readme.md │ ├── grid-pagination │ │ ├── grid-pagination-arrow.tsx │ │ ├── grid-pagination.scss │ │ ├── grid-pagination.tsx │ │ └── readme.md │ ├── grid │ │ ├── grid-interface.ts │ │ ├── grid-keyboard-event.ts │ │ ├── grid-radio.scss │ │ ├── grid-radio.tsx │ │ ├── grid.e2e.ts │ │ ├── grid.scss │ │ ├── grid.tsx │ │ └── readme.md │ ├── header │ │ ├── header.scss │ │ ├── header.tsx │ │ └── readme.md │ ├── hint │ │ ├── hint.scss │ │ ├── hint.tsx │ │ └── readme.md │ ├── horizontal-stepper │ │ ├── horizontal-step.tsx │ │ ├── horizontal-stepper-interface.ts │ │ ├── horizontal-stepper.scss │ │ ├── horizontal-stepper.tsx │ │ └── readme.md │ ├── icon │ │ ├── icon.tsx │ │ └── readme.md │ ├── input │ │ ├── input-interface.ts │ │ ├── input.e2e.ts │ │ ├── input.scss │ │ ├── input.tsx │ │ └── readme.md │ ├── label │ │ ├── label.scss │ │ ├── label.tsx │ │ └── readme.md │ ├── list-item-properties │ │ ├── list-item-properties.scss │ │ ├── list-item-properties.tsx │ │ └── readme.md │ ├── list-item-property │ │ ├── list-item-property.scss │ │ ├── list-item-property.tsx │ │ └── readme.md │ ├── list-item │ │ ├── list-item.scss │ │ ├── list-item.tsx │ │ └── readme.md │ ├── mat-icon │ │ ├── mat-icon-google-stylesheets.scss │ │ ├── mat-icon-interface.tsx │ │ ├── mat-icon.scss │ │ ├── mat-icon.tsx │ │ └── readme.md │ ├── modal │ │ ├── modal-interface.ts │ │ ├── modal.e2e.ts │ │ ├── modal.scss │ │ ├── modal.tsx │ │ └── readme.md │ ├── native-select │ │ ├── native-select-interface.ts │ │ ├── native-select.scss │ │ ├── native-select.tsx │ │ └── readme.md │ ├── nav-item │ │ ├── nav-item.scss │ │ ├── nav-item.tsx │ │ └── readme.md │ ├── nav │ │ ├── nav.scss │ │ ├── nav.tsx │ │ └── readme.md │ ├── progress-bar │ │ ├── progress-bar.scss │ │ ├── progress-bar.tsx │ │ └── readme.md │ ├── progress-radial │ │ ├── progress-radial.scss │ │ ├── progress-radial.tsx │ │ └── readme.md │ ├── radio-group │ │ ├── radio-group-interface.ts │ │ ├── radio-group.e2e.ts │ │ ├── radio-group.scss │ │ ├── radio-group.tsx │ │ └── readme.md │ ├── radio │ │ ├── radio-interface.ts │ │ ├── radio.scss │ │ ├── radio.tsx │ │ └── readme.md │ ├── select-option │ │ ├── readme.md │ │ ├── select-option-interface.ts │ │ ├── select-option.scss │ │ └── select-option.tsx │ ├── select │ │ ├── readme.md │ │ ├── select-arrow.tsx │ │ ├── select-chips.tsx │ │ ├── select-interface.ts │ │ ├── select-keyboard-event.ts │ │ ├── select.e2e.ts │ │ ├── select.scss │ │ └── select.tsx │ ├── skeleton-circle │ │ ├── readme.md │ │ ├── skeleton-circle.scss │ │ └── skeleton-circle.tsx │ ├── skeleton-rectangle │ │ ├── readme.md │ │ ├── skeleton-rectangle.scss │ │ └── skeleton-rectangle.tsx │ ├── skeleton-text │ │ ├── readme.md │ │ ├── skeleton-text.scss │ │ └── skeleton-text.tsx │ ├── skeleton │ │ ├── skeleton-interface.ts │ │ └── skeleton.scss │ ├── spinner │ │ ├── readme.md │ │ ├── spinner-interface.ts │ │ ├── spinner.scss │ │ └── spinner.tsx │ ├── switch │ │ ├── readme.md │ │ ├── switch-interface.ts │ │ ├── switch.e2e.ts │ │ ├── switch.scss │ │ └── switch.tsx │ ├── tab │ │ ├── readme.md │ │ ├── tab.scss │ │ └── tab.tsx │ ├── tabs │ │ ├── readme.md │ │ ├── tabs-interface.ts │ │ ├── tabs.e2e.ts │ │ ├── tabs.scss │ │ └── tabs.tsx │ ├── textarea │ │ ├── readme.md │ │ ├── textarea-interface.ts │ │ ├── textarea.e2e.ts │ │ ├── textarea.scss │ │ └── textarea.tsx │ └── tooltip │ │ ├── readme.md │ │ ├── tooltip-interface.ts │ │ ├── tooltip.scss │ │ └── tooltip.tsx ├── index.ts ├── shared-types.ts ├── style │ ├── breakpoints.scss │ ├── elevation.scss │ ├── focus-outline.scss │ ├── global.scss │ ├── overlay.scss │ ├── placeholder.scss │ └── tooltip.scss └── utils │ ├── accessibility.ts │ ├── control-component-interface.ts │ ├── helpers.ts │ ├── keyboard-event.ts │ ├── mutable-aria-attribute.ts │ ├── overlay.ts │ └── tests.ts ├── stencil.config.ts ├── stories ├── assets │ └── images │ │ ├── Cover-Design-Tokens.webp │ │ ├── accessibility-contrast.png │ │ ├── accessibility.svg │ │ ├── components-overview │ │ ├── accordion.png │ │ ├── actionbar.png │ │ ├── badge.png │ │ ├── breadcrumb.png │ │ ├── button.png │ │ ├── card.png │ │ ├── checkbox.png │ │ ├── com-nav.png │ │ ├── counter.png │ │ ├── divider.png │ │ ├── dropdown.png │ │ ├── editable-field.png │ │ ├── field.png │ │ ├── footer.png │ │ ├── form-field.png │ │ ├── galactic.png │ │ ├── grid.png │ │ ├── header.png │ │ ├── horizontalstepper.png │ │ ├── input.png │ │ ├── list-item.png │ │ ├── mat-icon.png │ │ ├── modal.png │ │ ├── native-select.png │ │ ├── nav.png │ │ ├── progress-bar.png │ │ ├── progress-radial.png │ │ ├── radio.png │ │ ├── select.png │ │ ├── skeleton.gif │ │ ├── spinner.gif │ │ ├── switch.png │ │ ├── tabs.png │ │ ├── textarea.png │ │ └── tooltip.png │ │ ├── cover.webp │ │ ├── form-example1.png │ │ ├── form-example2.png │ │ ├── gitlab-logo.png │ │ ├── npm-logo.png │ │ ├── sncf-groupe.svg │ │ ├── sncf-logo.png │ │ ├── sncf-reseau.svg │ │ ├── sncf-voyageurs.svg │ │ ├── train.svg │ │ ├── train_autumn.jpg │ │ ├── train_spring.jpg │ │ ├── train_summer.jpg │ │ ├── train_winter.jpg │ │ ├── wcs-logo-black.png │ │ └── wcs-logo-white.png ├── components │ ├── accordion │ │ ├── accordion-content.stories.ts │ │ ├── accordion-header.stories.ts │ │ ├── accordion-panel.stories.ts │ │ └── accordion.stories.ts │ ├── action-bar │ │ ├── action-bar.stories.ts │ │ └── tab-inside-documentation.md │ ├── badge │ │ └── badge.stories.ts │ ├── breadcrumb │ │ ├── breadcrumb-item.stories.ts │ │ └── breadcrumb.stories.ts │ ├── button │ │ └── button.stories.ts │ ├── card │ │ ├── card-body.stories.ts │ │ └── card.stories.ts │ ├── checkbox │ │ └── checkbox.stories.ts │ ├── com-nav │ │ ├── com-nav-category.stories.ts │ │ ├── com-nav-documentation.md │ │ ├── com-nav-item.stories.ts │ │ ├── com-nav-submenu.stories.ts │ │ └── com-nav.stories.ts │ ├── counter │ │ └── counter.stories.ts │ ├── divider │ │ └── divider.stories.ts │ ├── dropdown │ │ ├── dropdown-divider.stories.ts │ │ ├── dropdown-header.stories.ts │ │ ├── dropdown-item.stories.ts │ │ └── dropdown.stories.ts │ ├── editable-field │ │ └── editable-field.stories.ts │ ├── field │ │ ├── field-content.stories.ts │ │ ├── field-label.stories.ts │ │ └── field.stories.ts │ ├── footer │ │ ├── footer-documentation.md │ │ └── footer.stories.ts │ ├── form-field │ │ ├── error.stories.ts │ │ ├── form-field.stories.ts │ │ ├── hint.stories.ts │ │ └── label.stories.ts │ ├── galactic │ │ ├── galactic-documentation.md │ │ ├── galactic-menu.stories.ts │ │ └── galactic.stories.ts │ ├── grid │ │ ├── grid-column.stories.ts │ │ ├── grid-custom-cell.stories.ts │ │ ├── grid-pagination.stories.ts │ │ ├── grid.stories.ts │ │ └── pagination-sample-data.ts │ ├── header │ │ └── header.stories.ts │ ├── horizontal-stepper │ │ └── horizontal-stepper.stories.ts │ ├── input │ │ └── input.stories.ts │ ├── list-item │ │ ├── list-item-properties.stories.ts │ │ ├── list-item-property.stories.ts │ │ └── list-item.stories.ts │ ├── mat-icon │ │ ├── mat-icon-documentation.md │ │ └── mat-icon.stories.ts │ ├── modal │ │ └── modal.stories.ts │ ├── native-select │ │ └── native-select.stories.ts │ ├── nav │ │ ├── nav-documentation.md │ │ ├── nav-item.stories.ts │ │ └── nav.stories.ts │ ├── progress-bar │ │ └── progress-bar.stories.ts │ ├── progress-radial │ │ └── progress-radial.stories.ts │ ├── radio-group │ │ ├── radio-group.stories.ts │ │ └── radio.stories.ts │ ├── select │ │ ├── select-option.stories.ts │ │ ├── select-sample-data.ts │ │ └── select.stories.ts │ ├── skeleton │ │ ├── skeleton-circle.stories.ts │ │ ├── skeleton-rectangle.stories.ts │ │ ├── skeleton-text.stories.ts │ │ └── skeleton.stories.ts │ ├── spinner │ │ └── spinner.stories.ts │ ├── switch │ │ └── switch.stories.ts │ ├── tabs │ │ ├── tab.stories.ts │ │ └── tabs.stories.ts │ ├── textarea │ │ └── textarea.stories.ts │ └── tooltip │ │ └── tooltip.stories.ts ├── documentation │ ├── Components-Overview.mdx │ ├── Getting Started │ │ ├── angular.stories.mdx │ │ ├── formly.stories.mdx │ │ └── react.stories.mdx │ ├── Introduction.stories.mdx │ ├── Palette-Autogen.mdx │ ├── accessibility.mdx │ ├── changelog.stories.mdx │ ├── design-tokens │ │ ├── Holding.mdx │ │ ├── Reseau.mdx │ │ └── Voyageurs.mdx │ ├── generated │ │ ├── docs.d.ts │ │ └── docs.json │ ├── migrations │ │ ├── v2-v3.stories.mdx │ │ ├── v3-v4.stories.mdx │ │ ├── v4-v5.stories.mdx │ │ ├── v5-v6.stories.mdx │ │ └── v6-v7.stories.mdx │ ├── template.stories.mdx │ ├── testing.stories.mdx │ └── theming.stories.mdx ├── internal-documentation │ ├── Introduction.stories.mdx │ └── design-tokens │ │ ├── design-token-wcs.drawio │ │ ├── design-tokens.stories.mdx │ │ ├── wcs-design-tokens-diagram.png │ │ ├── wcs-design-tokens-from-JSON-to-css.drawio │ │ └── wcs-design-tokens-from-JSON-to-css.png └── utils │ └── args-generation.ts └── tsconfig.json /.babelrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "sourceType": "unambiguous", 3 | "presets": [ 4 | [ 5 | "@babel/preset-env", 6 | { 7 | "targets": { 8 | "chrome": 100 9 | } 10 | } 11 | ], 12 | "@babel/preset-typescript" 13 | ], 14 | "plugins": [] 15 | } 16 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 4 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | max_line_length = 120 12 | quote_type = single 13 | 14 | [*.{stories.ts,tsx,stories.mdx}] 15 | trim_trailing_whitespace = false 16 | 17 | [*.md] 18 | insert_final_newline = false 19 | trim_trailing_whitespace = false 20 | 21 | [*.yml] 22 | indent_size = 2 23 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "extends": "@ionic/eslint-config/recommended", 4 | "plugins": [ 5 | "@typescript-eslint" 6 | ], 7 | "rules": { 8 | "@typescript-eslint/consistent-type-imports": 0, 9 | "sort-imports": "off", 10 | "import/newline-after-import": 0, 11 | "import/order": 0, 12 | "@typescript-eslint/ban-ts-comment": 0, 13 | "@typescript-eslint/explicit-module-boundary-types": "off" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /www 2 | /dist 3 | /loader 4 | /public 5 | /storybook-static 6 | 7 | # Generated file 8 | /src/index.html 9 | # src/components.d.ts TODO: If the file is not committed, the build does not generate the interfaces that depend on the types present in this file (which is normally generated). 10 | 11 | *~ 12 | *.sw[mnpcod] 13 | *.log 14 | *.lock 15 | *.tmp 16 | *.tmp.* 17 | log.txt 18 | *.sublime-project 19 | *.sublime-workspace 20 | 21 | .stencil/ 22 | .idea/ 23 | .vscode/ 24 | .sass-cache/ 25 | .versions/ 26 | node_modules/ 27 | $RECYCLE.BIN/ 28 | 29 | .DS_Store 30 | Thumbs.db 31 | UserInterfaceState.xcuserstate 32 | .env 33 | /design-tokens/dist/ 34 | -------------------------------------------------------------------------------- /.gitlab/issue_templates/Default.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | 4 | 5 | # Reproducing 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.gitlab/merge_request_templates/Default.md: -------------------------------------------------------------------------------- 1 | ### To check 2 | 3 | - [ ] **Explain what has changed in the changelog** 4 | - [ ] _For newly created web components only :_ Declare all new angular proxy components in the file `angular/projects/wcs-angular/src/lib/wcs-angular.module.ts` 5 | - [ ] _For newly created web components only :_ Add the component name in `Components-Overview.mdx` with its corresponding image into `assets/images/components-overview` 6 | - [ ] _For newly created web components only :_ Add the component name in the left or right list in `accessibility.mdx` 7 | 8 | #### Design token migration (specific task) 9 | 10 | - [ ] check that css variables for which you change the name are not setter / read in typescript code. Rename them in the ts code if necessary. 11 | - [ ] Document all renamed css variables in the migration guide. 12 | - [ ] Document all component token (css variable) in the component doc (with ts annotation) so that they can be used by the projects. -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org/ 2 | -------------------------------------------------------------------------------- /.storybook/addons/versioning/index.js: -------------------------------------------------------------------------------- 1 | function managerEntries(entry = []) { 2 | return [...entry, require.resolve('./manager')]; 3 | } 4 | 5 | module.exports = { managerEntries }; 6 | -------------------------------------------------------------------------------- /.storybook/main.js: -------------------------------------------------------------------------------- 1 | const WatchExternalFilesPlugin = require('webpack-watch-files-plugin').default; 2 | 3 | const config = { 4 | docs: { 5 | autodocs: true, 6 | defaultName: 'Documentation' 7 | }, 8 | staticDirs: [ 9 | './../dist/wcs', 10 | './../design-tokens/dist', 11 | './../design-tokens/tokens', 12 | './../src/assets/fonts', 13 | './../stories/assets/images', 14 | ], 15 | framework: '@storybook/web-components-webpack5', 16 | stories: [ 17 | "../stories/**/*.stories.mdx", 18 | "../stories/**/**.mdx", 19 | "../stories/**/*.stories.@(js|jsx|ts|tsx)" 20 | ], 21 | addons: [ 22 | "@storybook/addon-links", 23 | "@storybook/addon-essentials", 24 | "@storybook/addon-docs", 25 | "@storybook/addon-a11y", 26 | // Custom addons located in .storybook/addons 27 | "./addons/versioning/register.js" 28 | ], 29 | previewBody: (body) => ` 30 | 31 | ${body} 32 | 33 | `, 34 | async webpackFinal(config) { 35 | config.plugins.push(new WatchExternalFilesPlugin({ 36 | files: [ 37 | 'dist/**/*.*' 38 | ] 39 | })); 40 | return config; 41 | } 42 | } 43 | export default config; 44 | -------------------------------------------------------------------------------- /.storybook/manager-head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.storybook/manager.js: -------------------------------------------------------------------------------- 1 | import { addons } from '@storybook/addons'; 2 | import theme from './theme'; 3 | 4 | addons.setConfig({ 5 | theme: theme, 6 | }); 7 | -------------------------------------------------------------------------------- /.storybook/theme.js: -------------------------------------------------------------------------------- 1 | import { create } from '@storybook/theming'; 2 | 3 | import logo from '../stories/assets/images/wcs-logo-white.png'; 4 | 5 | const theme = create({ 6 | base: 'dark', 7 | fontBase: 8 | '"Avenir", -apple-system, BlinkMacSystemFont, "Segoe UI", "Segoe UI Web (West European)", Roboto, "Helvetica Neue", sans-serif;', 9 | fontCode: 'monospace', 10 | 11 | // Form colors 12 | inputBorderRadius: 4, 13 | 14 | // SNCF / WCS branding for the upper left image 15 | brandTitle: 'WCS • Web Components SNCF', 16 | brandImage: logo, 17 | colorSecondary: '#6558b1', 18 | colorPrimary: '#c7b2de', 19 | }); 20 | 21 | export default theme; 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 SNCF 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /TODO_NEXT_MAJOR_RELEASE.md: -------------------------------------------------------------------------------- 1 | # Breaking changes for next-release 2 | 3 | Make sure these changes are made before releasing the next release of WCS. 4 | 5 | ## v8 6 | 7 | - [ ] Add token `semantic.color.border.focus.base.on-primary` 8 | - [ ] Add token `semantic.color.border.focus.alt.on-primary` 9 | - [ ] Rename token `semantic.color.border.focus.base-on-secondary` to `semantic.color.border.focus.base.on-secondary` (make a group named `base`) 10 | - [ ] Rename token `semantic.color.border.focus.alt-on-secondary` to `semantic.color.border.focus.alt.on-secondary` (make a group named `alt`) 11 | -------------------------------------------------------------------------------- /angular/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /angular/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | .angular/cache 4 | 5 | # compiled output 6 | /dist 7 | /tmp 8 | /out-tsc 9 | # Only exists if Bazel was run 10 | /bazel-out 11 | 12 | # dependencies 13 | /node_modules 14 | 15 | # profiling files 16 | chrome-profiler-events*.json 17 | speed-measure-plugin*.json 18 | 19 | # IDEs and editors 20 | /.idea 21 | .project 22 | .classpath 23 | .c9/ 24 | *.launch 25 | .settings/ 26 | *.sublime-workspace 27 | 28 | # IDE - VSCode 29 | .vscode/* 30 | !.vscode/settings.json 31 | !.vscode/tasks.json 32 | !.vscode/launch.json 33 | !.vscode/extensions.json 34 | .history/* 35 | 36 | # misc 37 | /.sass-cache 38 | /connect.lock 39 | /coverage 40 | /libpeerconnection.log 41 | npm-debug.log 42 | yarn-error.log 43 | testem.log 44 | /typings 45 | 46 | # System Files 47 | .DS_Store 48 | Thumbs.db 49 | -------------------------------------------------------------------------------- /angular/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org/ 2 | -------------------------------------------------------------------------------- /angular/README.md: -------------------------------------------------------------------------------- 1 | # Angular 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.1.1. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /angular/projects/wcs-angular/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org/ 2 | -------------------------------------------------------------------------------- /angular/projects/wcs-angular/README.md: -------------------------------------------------------------------------------- 1 | # WcsAngular 2 | 3 | [![npm version](https://img.shields.io/npm/v/wcs-angular)](https://www.npmjs.com/package/wcs-angular) 4 | [![Angular](https://img.shields.io/badge/Angular-fff.svg?logo=angular&logoColor=DD0031)](https://angular.io/) 5 | 6 | 7 | This project is the Angular integration of the [wcs-core package](https://www.npmjs.com/package/wcs-core). 8 | It contains : 9 | * **WcsAngularModule** importing all component and directive declarations 10 | * **Proxies** to make web component declarations for Angular 11 | * **Directives** containing value accessors to bridge between Angular forms API and web components 12 | 13 | ## Requirements 14 | 15 | - Generated with [Angular CLI](https://github.com/angular/angular-cli) version 10.1.1 16 | - Requires Angular >= 13 17 | 18 | ## Build 19 | 20 | Run `npm run build:wcs-angular` from the wcs-core/angular folder. 21 | 22 | ## Integration in your project 23 | 24 | Read the official [WCS documentation](https://wcs.dev.sncf/?path=/docs/documentation-getting-started-angular--documentation) 25 | for Angular integration. 26 | 27 | ## Further help 28 | 29 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 30 | 31 | ## Licence 32 | 33 | [MIT](https://gitlab.com/SNCF/wcs/-/blob/master/LICENSE) 34 | -------------------------------------------------------------------------------- /angular/projects/wcs-angular/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../../coverage/wcs-angular'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /angular/projects/wcs-angular/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "../../dist/wcs-angular", 4 | "lib": { 5 | "entryFile": "src/public-api.ts" 6 | } 7 | } -------------------------------------------------------------------------------- /angular/projects/wcs-angular/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wcs-angular", 3 | "version": "7.1.0", 4 | "peerDependencies": { 5 | "@angular/common": ">=13.2.0", 6 | "@angular/core": ">=13.2.0", 7 | "wcs-core": "7.1.0" 8 | }, 9 | "dependencies": { 10 | "tslib": "^2.0.0" 11 | } 12 | } -------------------------------------------------------------------------------- /angular/projects/wcs-angular/src/public-api.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of wcs-angular 3 | */ 4 | 5 | export * from './lib/wcs-angular.module'; 6 | export * from './lib/directives/select-value-accessor.directive'; 7 | export * from './lib/directives/radio-group-value-accessor.directive'; 8 | export * from './lib/directives/checkbox-value-accessor.directive'; 9 | export * from './lib/directives/switch-value-accessor.directive'; 10 | export * from './lib/directives/input-value-accessor.directive'; 11 | export * from './lib/directives/textarea-value-accessor.directive'; 12 | export * from './lib/directives/grid-value-accessor.directive'; 13 | export * from './lib/directives/counter-value-accessor.directive'; 14 | 15 | export * from './lib/proxies'; 16 | -------------------------------------------------------------------------------- /angular/projects/wcs-angular/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/lib", 6 | "target": "es2015", 7 | "declaration": true, 8 | "declarationMap": true, 9 | "inlineSources": true, 10 | "types": [], 11 | "lib": [ 12 | "dom", 13 | "es2018" 14 | ] 15 | }, 16 | "angularCompilerOptions": { 17 | "skipTemplateCodegen": true, 18 | "strictMetadataEmit": true, 19 | "enableResourceInlining": true 20 | }, 21 | "exclude": [ 22 | "**/*.spec.ts" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /angular/projects/wcs-angular/tsconfig.lib.prod.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.lib.json", 4 | "compilerOptions": { 5 | "declarationMap": false 6 | }, 7 | "angularCompilerOptions": { 8 | "enableIvy": false 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /angular/projects/wcs-angular/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "**/*.spec.ts", 12 | "**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /angular/projects/wcs-angular/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "lib", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "lib", 14 | "kebab-case" 15 | ], 16 | "semicolon": [true, "always"] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /angular/projects/wcs-formly/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org/ 2 | -------------------------------------------------------------------------------- /angular/projects/wcs-formly/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../../coverage/wcs-formly'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /angular/projects/wcs-formly/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "../../dist/wcs-formly", 4 | "lib": { 5 | "entryFile": "src/public-api.ts" 6 | } 7 | } -------------------------------------------------------------------------------- /angular/projects/wcs-formly/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wcs-formly", 3 | "version": "7.1.0", 4 | "peerDependencies": { 5 | "@angular/common": ">=13.2.0", 6 | "@angular/core": ">=13.2.0", 7 | "@ngx-formly/core": "^6.0.1", 8 | "wcs-angular": "7.1.0", 9 | "wcs-core": "7.1.0" 10 | }, 11 | "dependencies": { 12 | "tslib": "^2.0.0" 13 | } 14 | } -------------------------------------------------------------------------------- /angular/projects/wcs-formly/src/lib/formly-wcs-boolean-field-wrapper.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input } from '@angular/core'; 2 | import { FormlyFieldConfig, FormlyFieldProps } from '@ngx-formly/core'; 3 | import { WcsFormlyStylesProps, WcsFormlyTooltipProps } from './types/formly-props-types'; 4 | 5 | export type WcsFormlyBooleanFieldWrapperProps = FormlyFieldProps & WcsFormlyTooltipProps & WcsFormlyStylesProps; 6 | 7 | /** 8 | * See formly-wcs-field-wrapper.component.ts for more information on the purpose of this component 9 | */ 10 | @Component({ 11 | // tslint:disable-next-line:component-selector 12 | selector: 'formly-wcs-boolean-field-wrapper', 13 | template: ` 14 | 15 | 16 | 17 | 18 | 19 | {{ props.description }} 20 | 21 | ` 22 | }) 23 | export class FormlyWcsBooleanFieldWrapperComponent { 24 | @Input() showError: boolean; 25 | @Input() props: WcsFormlyBooleanFieldWrapperProps; 26 | @Input() field: FormlyFieldConfig; 27 | } 28 | -------------------------------------------------------------------------------- /angular/projects/wcs-formly/src/lib/formly-wcs-field-checkbox.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { FieldType, FieldTypeConfig } from '@ngx-formly/core'; 3 | import { WcsFormlyBooleanFieldWrapperProps } from './formly-wcs-boolean-field-wrapper.component'; 4 | 5 | export type WcsFormlyCheckboxProps = WcsFormlyBooleanFieldWrapperProps; 6 | 7 | @Component({ 8 | // tslint:disable-next-line:component-selector 9 | selector: 'formly-wcs-field-checkbox', 10 | template: ` 11 | 12 | {{props.label}} 17 | 18 | `, 19 | styles: [] 20 | }) 21 | export class FormlyWcsFieldCheckboxComponent extends FieldType> { 22 | } 23 | -------------------------------------------------------------------------------- /angular/projects/wcs-formly/src/lib/formly-wcs-field-counter.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { FieldType, FieldTypeConfig } from '@ngx-formly/core'; 3 | import { WcsFormlyFieldWrapperProps } from './formly-wcs-field-wrapper.component'; 4 | import { WcsCounterSize } from 'wcs-core'; 5 | 6 | export type WcsFormlyCounterProps = WcsFormlyFieldWrapperProps & { 7 | value?: number, 8 | min?: number, 9 | max?: number, 10 | step?: number, 11 | size?: WcsCounterSize 12 | }; 13 | 14 | @Component({ 15 | // tslint:disable-next-line:component-selector 16 | selector: 'formly-wcs-field-counter', 17 | template: ` 18 | 19 | 28 | 29 | 30 | `, 31 | styles: [] 32 | }) 33 | export class FormlyWcsFieldCounterComponent extends FieldType> { 34 | } 35 | -------------------------------------------------------------------------------- /angular/projects/wcs-formly/src/lib/formly-wcs-field-switch.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { FieldType, FieldTypeConfig } from '@ngx-formly/core'; 3 | import { WcsFormlyBooleanFieldWrapperProps } from './formly-wcs-boolean-field-wrapper.component'; 4 | 5 | export type WcsFormlySwitchProps = WcsFormlyBooleanFieldWrapperProps & { 6 | id: string, 7 | hideLabel?: boolean 8 | }; 9 | 10 | @Component({ 11 | // tslint:disable-next-line:component-selector 12 | selector: 'formly-wcs-field-switch', 13 | template: ` 14 | 15 | 20 | 21 | {{ props.label }} 22 | 23 | 24 | 25 | `, 26 | styles: [] 27 | }) 28 | export class FormlyWcsFieldSwitchComponent extends FieldType> { 29 | } 30 | -------------------------------------------------------------------------------- /angular/projects/wcs-formly/src/lib/pipes/wcs-formly-options.pipe.ts: -------------------------------------------------------------------------------- 1 | import { Pipe, PipeTransform } from '@angular/core'; 2 | import { Observable, of as observableOf } from 'rxjs'; 3 | 4 | @Pipe({ 5 | name: 'wcsFormlyOptions' 6 | }) 7 | export class WcsFormlyOptionsPipe implements PipeTransform { 8 | transform(options: any): Observable { 9 | if (!(options instanceof Observable)) { 10 | options = observableOf(options); 11 | } 12 | 13 | return options; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /angular/projects/wcs-formly/src/lib/types/formly-props-types.ts: -------------------------------------------------------------------------------- 1 | import { MaterialIconSize } from 'wcs-core'; 2 | 3 | export type WcsFormlyTooltipProps = { 4 | tooltip?: { 5 | content: string, 6 | dynamicContent: string, 7 | interactive: boolean, 8 | icon: string, 9 | size: MaterialIconSize, 10 | color: string 11 | } 12 | }; 13 | 14 | export type WcsFormlyStylesProps = { 15 | styles?: { 16 | label?: {[p: string]: any}, 17 | input?: {[p: string]: any}, 18 | error?: {[p: string]: any}, 19 | hint?: {[p: string]: any} 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /angular/projects/wcs-formly/src/public-api.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of wcs-formly 3 | */ 4 | 5 | export * from './lib/formly-wcs-field-input.component'; 6 | export * from './lib/formly-wcs-field-radio.component'; 7 | export * from './lib/formly-wcs-field-select.component'; 8 | export * from './lib/formly-wcs-field-native-select.component'; 9 | export * from './lib/formly-wcs-field-textarea.component'; 10 | export * from './lib/formly-wcs-field-checkbox.component'; 11 | export * from './lib/formly-wcs-field-switch.component'; 12 | export * from './lib/formly-wcs-field-wrapper.component'; 13 | export * from './lib/formly-wcs-field-counter.component'; 14 | export * from './lib/formly-wcs-boolean-field-wrapper.component'; 15 | export * from './lib/pipes/wcs-formly-options.pipe'; 16 | export * from './lib/wcs-formly.module'; 17 | -------------------------------------------------------------------------------- /angular/projects/wcs-formly/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/lib", 6 | "target": "es2015", 7 | "declaration": true, 8 | "declarationMap": true, 9 | "inlineSources": true, 10 | "types": [], 11 | "lib": [ 12 | "dom", 13 | "es2018" 14 | ] 15 | }, 16 | "angularCompilerOptions": { 17 | "skipTemplateCodegen": true, 18 | "strictMetadataEmit": true, 19 | "enableResourceInlining": true 20 | }, 21 | "exclude": [ 22 | "src/test.ts", 23 | "**/*.spec.ts" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /angular/projects/wcs-formly/tsconfig.lib.prod.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.lib.json", 4 | "compilerOptions": { 5 | "declarationMap": false 6 | }, 7 | "angularCompilerOptions": { 8 | "enableIvy": false, 9 | "fullTemplateTypeCheck": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /angular/projects/wcs-formly/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "**/*.spec.ts", 12 | "**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /angular/projects/wcs-formly/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "lib", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "lib", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "downlevelIteration": true, 9 | "experimentalDecorators": true, 10 | "moduleResolution": "node", 11 | "importHelpers": true, 12 | "target": "es2015", 13 | "module": "es2020", 14 | "lib": [ 15 | "es2018", 16 | "dom" 17 | ], 18 | "paths": { 19 | "wcs-angular": [ 20 | "dist/wcs-angular/wcs-angular", 21 | "dist/wcs-angular" 22 | ], 23 | "wcs-formly": [ 24 | "dist/wcs-formly/wcs-formly", 25 | "dist/wcs-formly" 26 | ] 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /design-tokens/doc/design-token-json-to-css-wcs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/design-tokens/doc/design-token-json-to-css-wcs.png -------------------------------------------------------------------------------- /design-tokens/tokens/wcs-design-tokens-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "WCS", 3 | "collections": { 4 | "Primitive": { 5 | "modes": { 6 | "sncf holding": [ "sncf-holding-primitive.json" ], 7 | "sncf voyageurs": [ "sncf-voyageurs-primitive.json" ], 8 | "sncf reseau": [ "sncf-reseau-primitive.json" ] 9 | } 10 | }, 11 | "Semantic": { 12 | "modes": { 13 | "sncf holding": [ "sncf-holding-semantic.json" ], 14 | "sncf voyageurs": [ "sncf-voyageurs-semantic.json" ], 15 | "sncf reseau": [ "sncf-reseau-semantic.json" ] 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /doc/gitlab-pages-redirect-root/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WCS - Documentation has moved 5 | 6 | 7 | 9 | 27 | 28 | 29 | Logo SNCF 30 |

The WCS documentation has been moved.

31 |

If you are not redirected within 5 seconds, click here to go to the new website.

33 | 34 | 35 | -------------------------------------------------------------------------------- /example/angular-standalone/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /example/angular-standalone/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /example/angular-standalone/README.md: -------------------------------------------------------------------------------- 1 | # WcsAngularStandaloneExample 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.0.3. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page. 28 | -------------------------------------------------------------------------------- /example/angular-standalone/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wcs-angular-standalone-example", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "test": "ng test" 10 | }, 11 | "private": true, 12 | "dependencies": { 13 | "@angular/animations": "^18.0.0", 14 | "@angular/common": "^18.0.0", 15 | "@angular/compiler": "^18.0.0", 16 | "@angular/core": "^18.0.0", 17 | "@angular/forms": "^18.0.0", 18 | "@angular/platform-browser": "^18.0.0", 19 | "@angular/platform-browser-dynamic": "^18.0.0", 20 | "@angular/router": "^18.0.0", 21 | "rxjs": "~7.8.0", 22 | "tslib": "^2.3.0", 23 | "zone.js": "~0.14.3", 24 | "wcs-core": "file:../../", 25 | "wcs-angular": "file:../../angular/dist/wcs-angular/" 26 | }, 27 | "devDependencies": { 28 | "@angular-devkit/build-angular": "^18.0.3", 29 | "@angular/cli": "^18.0.3", 30 | "@angular/compiler-cli": "^18.0.0", 31 | "@types/jasmine": "~5.1.0", 32 | "jasmine-core": "~5.1.0", 33 | "karma": "~6.4.0", 34 | "karma-chrome-launcher": "~3.2.0", 35 | "karma-coverage": "~2.2.0", 36 | "karma-jasmine": "~5.1.0", 37 | "karma-jasmine-html-reporter": "~2.1.0", 38 | "typescript": "~5.4.2" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /example/angular-standalone/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular-standalone/public/favicon.ico -------------------------------------------------------------------------------- /example/angular-standalone/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(async () => { 6 | await TestBed.configureTestingModule({ 7 | imports: [AppComponent], 8 | }).compileComponents(); 9 | }); 10 | 11 | it('should create the app', () => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.componentInstance; 14 | expect(app).toBeTruthy(); 15 | }); 16 | 17 | it(`should have the 'wcs-angular-standalone-example' title`, () => { 18 | const fixture = TestBed.createComponent(AppComponent); 19 | const app = fixture.componentInstance; 20 | expect(app.title).toEqual('wcs-angular-standalone-example'); 21 | }); 22 | 23 | it('should render title', () => { 24 | const fixture = TestBed.createComponent(AppComponent); 25 | fixture.detectChanges(); 26 | const compiled = fixture.nativeElement as HTMLElement; 27 | expect(compiled.querySelector('h1')?.textContent).toContain('Hello, wcs-angular-standalone-example'); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /example/angular-standalone/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { RouterOutlet } from '@angular/router'; 3 | import { WcsAngularModule } from 'wcs-angular'; 4 | 5 | @Component({ 6 | selector: 'app-root', 7 | standalone: true, 8 | imports: [RouterOutlet, WcsAngularModule], 9 | template: ` 10 |

Angular Standalone Example

11 | Hello From Angular Standalone App 12 | `, 13 | styles: [` 14 | `] 15 | }) 16 | export class AppComponent { 17 | title = 'wcs-angular-standalone-example'; 18 | 19 | onButtonClick($event: MouseEvent) { 20 | window.alert("Hello from Angular Standalone App!"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /example/angular-standalone/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; 2 | import { provideRouter } from '@angular/router'; 3 | 4 | import { routes } from './app.routes'; 5 | 6 | export const appConfig: ApplicationConfig = { 7 | providers: [provideZoneChangeDetection({ eventCoalescing: true }), provideRouter(routes)] 8 | }; 9 | -------------------------------------------------------------------------------- /example/angular-standalone/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from '@angular/router'; 2 | 3 | export const routes: Routes = []; 4 | -------------------------------------------------------------------------------- /example/angular-standalone/src/assets/fonts/avenir-black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular-standalone/src/assets/fonts/avenir-black.woff -------------------------------------------------------------------------------- /example/angular-standalone/src/assets/fonts/avenir-book.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular-standalone/src/assets/fonts/avenir-book.woff -------------------------------------------------------------------------------- /example/angular-standalone/src/assets/fonts/avenir-heavy.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular-standalone/src/assets/fonts/avenir-heavy.woff -------------------------------------------------------------------------------- /example/angular-standalone/src/assets/fonts/avenir-lighter.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular-standalone/src/assets/fonts/avenir-lighter.woff -------------------------------------------------------------------------------- /example/angular-standalone/src/assets/fonts/avenir-medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular-standalone/src/assets/fonts/avenir-medium.woff -------------------------------------------------------------------------------- /example/angular-standalone/src/assets/fonts/avenir-roman.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular-standalone/src/assets/fonts/avenir-roman.woff -------------------------------------------------------------------------------- /example/angular-standalone/src/assets/fonts/icons/icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular-standalone/src/assets/fonts/icons/icons.eot -------------------------------------------------------------------------------- /example/angular-standalone/src/assets/fonts/icons/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular-standalone/src/assets/fonts/icons/icons.ttf -------------------------------------------------------------------------------- /example/angular-standalone/src/assets/fonts/icons/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular-standalone/src/assets/fonts/icons/icons.woff -------------------------------------------------------------------------------- /example/angular-standalone/src/assets/fonts/icons/icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular-standalone/src/assets/fonts/icons/icons.woff2 -------------------------------------------------------------------------------- /example/angular-standalone/src/assets/sncf-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular-standalone/src/assets/sncf-logo.png -------------------------------------------------------------------------------- /example/angular-standalone/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | WcsAngularStandaloneExample 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /example/angular-standalone/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser'; 2 | import { appConfig } from './app/app.config'; 3 | import { AppComponent } from './app/app.component'; 4 | import { applyPolyfills, defineCustomElements } from 'wcs-core/loader'; 5 | 6 | bootstrapApplication(AppComponent, appConfig) 7 | .catch((err) => console.error(err)); 8 | 9 | applyPolyfills().then(() => { 10 | defineCustomElements(window); 11 | }); 12 | 13 | -------------------------------------------------------------------------------- /example/angular-standalone/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import "wcs-core/dist/wcs/wcs.css"; 3 | 4 | @font-face { 5 | font-family: Avenir; 6 | src: url("assets/fonts/avenir-lighter.woff"); 7 | font-weight: 100; 8 | } 9 | 10 | @font-face { 11 | font-family: Avenir; 12 | src: url("assets/fonts/avenir-book.woff"); 13 | font-weight: 300; 14 | } 15 | 16 | @font-face { 17 | font-family: Avenir; 18 | src: url("assets/fonts/avenir-roman.woff"); 19 | font-weight: 400; 20 | } 21 | 22 | @font-face { 23 | font-family: Avenir; 24 | src: url("assets/fonts/avenir-medium.woff"); 25 | font-weight: 500; 26 | } 27 | 28 | @font-face { 29 | font-family: Avenir; 30 | src: url("assets/fonts/avenir-heavy.woff"); 31 | font-weight: 800; 32 | } 33 | 34 | @font-face { 35 | font-family: Avenir; 36 | src: url("assets/fonts/avenir-black.woff"); 37 | font-weight: 900; 38 | } 39 | -------------------------------------------------------------------------------- /example/angular-standalone/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ 2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ 3 | { 4 | "extends": "./tsconfig.json", 5 | "compilerOptions": { 6 | "outDir": "./out-tsc/app", 7 | "types": [] 8 | }, 9 | "files": [ 10 | "src/main.ts" 11 | ], 12 | "include": [ 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /example/angular-standalone/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ 2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ 3 | { 4 | "compileOnSave": false, 5 | "compilerOptions": { 6 | "outDir": "./dist/out-tsc", 7 | "strict": true, 8 | "noImplicitOverride": true, 9 | "noPropertyAccessFromIndexSignature": true, 10 | "noImplicitReturns": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "skipLibCheck": true, 13 | "esModuleInterop": true, 14 | "sourceMap": true, 15 | "declaration": false, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "bundler", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "useDefineForClassFields": false, 22 | "lib": [ 23 | "ES2022", 24 | "dom" 25 | ] 26 | }, 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /example/angular-standalone/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ 2 | /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ 3 | { 4 | "extends": "./tsconfig.json", 5 | "compilerOptions": { 6 | "outDir": "./out-tsc/spec", 7 | "types": [ 8 | "jasmine" 9 | ] 10 | }, 11 | "include": [ 12 | "src/**/*.spec.ts", 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /example/angular/.browserslistrc: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /example/angular/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /example/angular/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | .angular/cache 4 | 5 | # compiled output 6 | /dist 7 | /tmp 8 | /out-tsc 9 | # Only exists if Bazel was run 10 | /bazel-out 11 | 12 | # dependencies 13 | /node_modules 14 | 15 | # profiling files 16 | chrome-profiler-events*.json 17 | speed-measure-plugin*.json 18 | 19 | # IDEs and editors 20 | /.idea 21 | .project 22 | .classpath 23 | .c9/ 24 | *.launch 25 | .settings/ 26 | *.sublime-workspace 27 | 28 | # IDE - VSCode 29 | .vscode/* 30 | !.vscode/settings.json 31 | !.vscode/tasks.json 32 | !.vscode/launch.json 33 | !.vscode/extensions.json 34 | .history/* 35 | 36 | # misc 37 | /.sass-cache 38 | /connect.lock 39 | /coverage 40 | /libpeerconnection.log 41 | npm-debug.log 42 | yarn-error.log 43 | testem.log 44 | /typings 45 | 46 | # System Files 47 | .DS_Store 48 | Thumbs.db 49 | -------------------------------------------------------------------------------- /example/angular/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org/ 2 | -------------------------------------------------------------------------------- /example/angular/README.md: -------------------------------------------------------------------------------- 1 | # Example 2 | 3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.3.18. 4 | 5 | ## Development server 6 | 7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. 8 | 9 | ## Code scaffolding 10 | 11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. 12 | 13 | ## Build 14 | 15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 16 | 17 | ## Running unit tests 18 | 19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 20 | 21 | ## Running end-to-end tests 22 | 23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). 24 | 25 | ## Further help 26 | 27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). 28 | -------------------------------------------------------------------------------- /example/angular/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | browserName: 'chrome' 17 | }, 18 | directConnect: true, 19 | baseUrl: 'http://localhost:4200/', 20 | framework: 'jasmine', 21 | jasmineNodeOpts: { 22 | showColors: true, 23 | defaultTimeoutInterval: 30000, 24 | print: function() {} 25 | }, 26 | onPrepare() { 27 | require('ts-node').register({ 28 | project: require('path').join(__dirname, './tsconfig.json') 29 | }); 30 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 31 | } 32 | }; -------------------------------------------------------------------------------- /example/angular/e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | import { browser, logging } from 'protractor'; 3 | 4 | describe('workspace-project App', () => { 5 | let page: AppPage; 6 | 7 | beforeEach(() => { 8 | page = new AppPage(); 9 | }); 10 | 11 | it('should display welcome message', () => { 12 | page.navigateTo(); 13 | expect(page.getTitleText()).toEqual('example app is running!'); 14 | }); 15 | 16 | afterEach(async () => { 17 | // Assert that there are no errors emitted from the browser 18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER); 19 | expect(logs).not.toContain(jasmine.objectContaining({ 20 | level: logging.Level.SEVERE, 21 | } as logging.Entry)); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /example/angular/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | 8 | getTitleText() { 9 | return element(by.css('app-root .content span')).getText() as Promise; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /example/angular/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "module": "commonjs", 6 | "target": "es2018", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/angular/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, './coverage/example'), 20 | reports: ['html', 'lcovonly', 'text-summary'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false, 30 | restartOnFileChange: true 31 | }); 32 | }; 33 | -------------------------------------------------------------------------------- /example/angular/src/app/about/about-intro.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import aboutArticles from '../data/aboutArticles'; 4 | 5 | @Component({ 6 | selector: 'app-about', 7 | template: ` 8 |

About

9 |

Découvrir le groupe SNCF.

10 |
Détails :
11 | 18 | `, 19 | styles: [` 20 | .links-container { 21 | display: flex; 22 | flex-direction: column; 23 | align-items: flex-start; 24 | } 25 | `] 26 | }) 27 | export class AboutIntroComponent implements OnInit { 28 | aboutArticles = []; 29 | 30 | ngOnInit(): void { 31 | this.aboutArticles = this.getAllAboutArticles(); 32 | } 33 | 34 | // Service mock 35 | getAllAboutArticles() { 36 | return aboutArticles; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /example/angular/src/app/about/about.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-about', 5 | template: ` 6 | 7 | 8 | `, 9 | styles: [] 10 | }) 11 | export class AboutComponent {} 12 | -------------------------------------------------------------------------------- /example/angular/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | template: ` 6 | 7 | `, 8 | styles: [] 9 | }) 10 | export class AppComponent {} 11 | -------------------------------------------------------------------------------- /example/angular/src/app/aria-current.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive, HostBinding, Host } from "@angular/core"; 2 | import { RouterLinkActive } from "@angular/router"; 3 | 4 | @Directive({ 5 | selector: '[routerLinkActive]' 6 | }) 7 | export class AriaCurrentDirective { 8 | constructor(@Host() private rla: RouterLinkActive) {} 9 | 10 | get isActive() { 11 | return this.rla.isActive; 12 | } 13 | 14 | @HostBinding("attr.aria-current") get ariaCurrent() { 15 | return this.isActive ? "page" : undefined; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /example/angular/src/app/components/breadcrumb/breadcrumb.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; 2 | import { Subscription } from 'rxjs'; 3 | 4 | import { BreadcrumbService, BreadcrumbItemData } from './breadcrumb.service'; 5 | 6 | @Component({ 7 | selector: 'app-breadcrumb', 8 | template: ` 9 | 10 | 13 | 14 | {{ breadcrumb.label }} 15 | 16 | 17 | {{ breadcrumb.label }} 18 | 19 | 20 | 21 | `, 22 | }) 23 | export class BreadcrumbComponent implements OnInit, OnDestroy { 24 | breadcrumbs: BreadcrumbItemData[] = []; 25 | private subscription: Subscription | null = null; 26 | 27 | constructor(private breadcrumbService: BreadcrumbService) {} 28 | 29 | ngOnInit(): void { 30 | this.subscription = this.breadcrumbService.breadcrumbs$.subscribe( 31 | (breadcrumbs) => { 32 | this.breadcrumbs = breadcrumbs; 33 | } 34 | ); 35 | } 36 | 37 | ngOnDestroy(): void { 38 | this.subscription?.unsubscribe(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /example/angular/src/app/data/aboutArticles.ts: -------------------------------------------------------------------------------- 1 | export type AboutArticle = { 2 | title: string; 3 | slug: string; 4 | textContent: string; 5 | }; 6 | 7 | const aboutArticles = [ 8 | { 9 | title: 'Qui sommes-nous ?', 10 | slug: 'qui-sommes-nous', 11 | textContent: 12 | 'De notre organisation, en passant par nos valeurs, jusqu’à notre raison d’être… Découvrez ce qui constitue l’identité et les fondamentaux du groupe SNCF.', 13 | }, 14 | { 15 | title: 'Notre stratégie', 16 | slug: 'notre-strategie', 17 | textContent: 18 | 'Notre ambition : devenir un champion mondial de la mobilité durable, pour les voyageurs comme pour les marchandises, avec un cœur de métier centré sur le ferroviaire et un pays de référence, la France.', 19 | }, 20 | { 21 | title: 'Fournisseurs', 22 | slug: 'fournisseurs', 23 | textContent: 24 | 'Vous êtes fournisseur ? Découvrez notre espace dédié, créé spécialement pour faciliter et optimiser votre collaboration avec le groupe SNCF. Naviguez efficacement à travers de nombreux documents et informations utiles.' 25 | } 26 | ]; 27 | 28 | export default aboutArticles; 29 | -------------------------------------------------------------------------------- /example/angular/src/app/data/article-title.resolver.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Resolve, ActivatedRouteSnapshot } from '@angular/router'; 3 | 4 | import aboutArticles from 'src/app/data/aboutArticles'; 5 | 6 | @Injectable({ providedIn: 'root' }) 7 | export class ArticleTitleResolver implements Resolve { 8 | constructor() {} 9 | 10 | resolve(route: ActivatedRouteSnapshot) { 11 | const slug = route.paramMap.get('slug'); 12 | const articleData = aboutArticles.find((article) => article.slug === slug); 13 | if (articleData) return articleData.title; 14 | return 'Not Found'; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /example/angular/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular/src/assets/.gitkeep -------------------------------------------------------------------------------- /example/angular/src/assets/fonts/avenir-black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular/src/assets/fonts/avenir-black.woff -------------------------------------------------------------------------------- /example/angular/src/assets/fonts/avenir-book.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular/src/assets/fonts/avenir-book.woff -------------------------------------------------------------------------------- /example/angular/src/assets/fonts/avenir-heavy.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular/src/assets/fonts/avenir-heavy.woff -------------------------------------------------------------------------------- /example/angular/src/assets/fonts/avenir-lighter.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular/src/assets/fonts/avenir-lighter.woff -------------------------------------------------------------------------------- /example/angular/src/assets/fonts/avenir-medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular/src/assets/fonts/avenir-medium.woff -------------------------------------------------------------------------------- /example/angular/src/assets/fonts/avenir-roman.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular/src/assets/fonts/avenir-roman.woff -------------------------------------------------------------------------------- /example/angular/src/assets/fonts/icons/icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular/src/assets/fonts/icons/icons.eot -------------------------------------------------------------------------------- /example/angular/src/assets/fonts/icons/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular/src/assets/fonts/icons/icons.ttf -------------------------------------------------------------------------------- /example/angular/src/assets/fonts/icons/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular/src/assets/fonts/icons/icons.woff -------------------------------------------------------------------------------- /example/angular/src/assets/fonts/icons/icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular/src/assets/fonts/icons/icons.woff2 -------------------------------------------------------------------------------- /example/angular/src/assets/sncf-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular/src/assets/sncf-logo.png -------------------------------------------------------------------------------- /example/angular/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /example/angular/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /example/angular/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/angular/src/favicon.ico -------------------------------------------------------------------------------- /example/angular/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Example 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /example/angular/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | import { applyPolyfills, defineCustomElements } from 'wcs-core/loader'; 7 | 8 | if (environment.production) { 9 | enableProdMode(); 10 | } 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule) 13 | .catch(err => console.error(err)); 14 | 15 | applyPolyfills().then(() => { 16 | defineCustomElements(window); 17 | }); 18 | -------------------------------------------------------------------------------- /example/angular/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /example/angular/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "src/main.ts", 9 | "src/polyfills.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /example/angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "downlevelIteration": true, 9 | "experimentalDecorators": true, 10 | "module": "es2020", 11 | "moduleResolution": "node", 12 | "importHelpers": true, 13 | "target": "es2020", 14 | "typeRoots": [ 15 | "node_modules/@types" 16 | ], 17 | "lib": [ 18 | "es2018", 19 | "dom" 20 | ] 21 | }, 22 | "angularCompilerOptions": { 23 | "fullTemplateTypeCheck": true, 24 | "strictInjectionParameters": true, 25 | "strictTemplates": true 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /example/angular/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/spec", 5 | "types": [ 6 | "jasmine", 7 | "node" 8 | ] 9 | }, 10 | "files": [ 11 | "src/test.ts", 12 | "src/polyfills.ts" 13 | ], 14 | "include": [ 15 | "src/**/*.spec.ts", 16 | "src/**/*.d.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /example/react/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /example/react/config-overrides.js: -------------------------------------------------------------------------------- 1 | const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin'); 2 | 3 | module.exports = function override(config, env) { 4 | config.resolve.plugins = config.resolve.plugins.filter(plugin => !(plugin instanceof ModuleScopePlugin)); 5 | 6 | return config; 7 | }; 8 | -------------------------------------------------------------------------------- /example/react/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/favicon.ico -------------------------------------------------------------------------------- /example/react/public/fonts/avenir-black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/fonts/avenir-black.woff -------------------------------------------------------------------------------- /example/react/public/fonts/avenir-book.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/fonts/avenir-book.woff -------------------------------------------------------------------------------- /example/react/public/fonts/avenir-heavy.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/fonts/avenir-heavy.woff -------------------------------------------------------------------------------- /example/react/public/fonts/avenir-lighter.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/fonts/avenir-lighter.woff -------------------------------------------------------------------------------- /example/react/public/fonts/avenir-medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/fonts/avenir-medium.woff -------------------------------------------------------------------------------- /example/react/public/fonts/avenir-roman.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/fonts/avenir-roman.woff -------------------------------------------------------------------------------- /example/react/public/fonts/icons/icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/fonts/icons/icons.eot -------------------------------------------------------------------------------- /example/react/public/fonts/icons/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/fonts/icons/icons.ttf -------------------------------------------------------------------------------- /example/react/public/fonts/icons/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/fonts/icons/icons.woff -------------------------------------------------------------------------------- /example/react/public/fonts/icons/icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/fonts/icons/icons.woff2 -------------------------------------------------------------------------------- /example/react/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/logo192.png -------------------------------------------------------------------------------- /example/react/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/logo512.png -------------------------------------------------------------------------------- /example/react/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /example/react/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /example/react/public/sncf-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/example/react/public/sncf-logo.png -------------------------------------------------------------------------------- /example/react/src/App.css: -------------------------------------------------------------------------------- 1 | .main-nav { 2 | height: 100vh; 3 | } 4 | 5 | .main-container[data-business-mode] { 6 | display: flex; 7 | flex-direction: row; 8 | height: 100vh; 9 | } 10 | 11 | .main-container[data-communication-mode] { 12 | width: var(--wcs-com-content-max-width); 13 | margin: 0px auto; 14 | flex-grow: 1; 15 | } 16 | 17 | main { 18 | flex-grow: 1; 19 | margin: var(--wcs-semantic-spacing-large); 20 | } 21 | 22 | .switch-mode-description { 23 | margin: var(--wcs-semantic-spacing-base) 0; 24 | } 25 | 26 | .switch-mode { 27 | display: flex; 28 | flex-direction: row; 29 | gap: var(--wcs-semantic-spacing-base); 30 | margin-bottom: calc(var(--wcs-semantic-spacing-large) * 3); 31 | } 32 | -------------------------------------------------------------------------------- /example/react/src/App.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render, screen } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | render(); 7 | const linkElement = screen.getByText(/learn react/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /example/react/src/components/com-nav.tsx: -------------------------------------------------------------------------------- 1 | import { ReactElement } from 'react'; 2 | import { WcsButton, WcsComNav, WcsComNavItem } from 'wcs-react'; 3 | import { NavLink } from 'react-router-dom'; 4 | 5 | export default function ComNav(): ReactElement { 6 | return ( 7 | 8 | 9 | Example 10 | 11 | 12 | About 13 | 14 |
15 | Connexion 16 |
17 |
18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /example/react/src/components/header.tsx: -------------------------------------------------------------------------------- 1 | import { ReactElement } from 'react'; 2 | import { WcsButton, WcsHeader } from 'wcs-react'; 3 | 4 | export default function Header(): ReactElement { 5 | 6 | return ( 7 | 8 | Logo SNCF 9 |

WcsReact Example

10 |
11 | 12 | Connexion 13 | 14 |
15 |
16 | ); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /example/react/src/components/input-demo.tsx: -------------------------------------------------------------------------------- 1 | // @flow 2 | import * as React from 'react'; 3 | import { useState } from 'react'; 4 | import { WcsInput } from 'wcs-react'; 5 | 6 | type Props = {}; 7 | export const InputDemo = (props: Props) => { 8 | const [firstNameWcsInput, setFirstNameWcsInput] = useState(""); 9 | const [firstNameWcsChange, setFirstNameWcsChange] = useState(""); 10 | return ( 11 |
12 |

Demo of the input component

13 |
14 |
15 | 16 | setFirstNameWcsInput(event.target.value?.toString() ?? '')}> 18 |

Hi! {firstNameWcsInput}

19 |
20 |
21 | 22 | setFirstNameWcsChange(event.detail.value?.toString() ?? '')}> 24 |

Hi! {firstNameWcsChange}

25 |
26 |
27 |
28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /example/react/src/components/nav.tsx: -------------------------------------------------------------------------------- 1 | import { ReactElement } from 'react'; 2 | import { WcsMatIcon, WcsNav, WcsNavItem } from 'wcs-react'; 3 | import { NavLink } from 'react-router-dom'; 4 | 5 | export default function Nav(): ReactElement { 6 | return ( 7 | 8 | 9 | 10 | 11 | Example 12 | 13 | 14 | 15 | 16 | 17 | About 18 | 19 | 20 | 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /example/react/src/components/textarea-demo.tsx: -------------------------------------------------------------------------------- 1 | // @flow 2 | import * as React from 'react'; 3 | import { useState } from 'react'; 4 | import { WcsTextarea } from 'wcs-react'; 5 | 6 | type Props = {}; 7 | export const TextareaDemo = (props: Props) => { 8 | const [firstNameWcsInput, setFirstNameWcsInput] = useState(""); 9 | const [firstNameWcsChange, setFirstNameWcsChange] = useState(""); 10 | return ( 11 |
12 |

Demo of the textarea component

13 |
14 |
15 | 16 | setFirstNameWcsInput(event.target.value?.toString() ?? '')}> 18 |

Hi! {firstNameWcsInput}

19 |
20 |
21 | 22 | setFirstNameWcsChange(event.detail.value?.toString() ?? '')}> 24 |

Hi! {firstNameWcsChange}

25 |
26 |
27 |
28 | ); 29 | }; 30 | -------------------------------------------------------------------------------- /example/react/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | const root = ReactDOM.createRoot( 8 | document.getElementById('root') as HTMLElement 9 | ); 10 | root.render( 11 | 12 | 13 | 14 | ); 15 | 16 | // If you want to start measuring performance in your app, pass a function 17 | // to log results (for example: reportWebVitals(console.log)) 18 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 19 | reportWebVitals(); 20 | -------------------------------------------------------------------------------- /example/react/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /example/react/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals'; 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry); 7 | getFID(onPerfEntry); 8 | getFCP(onPerfEntry); 9 | getLCP(onPerfEntry); 10 | getTTFB(onPerfEntry); 11 | }); 12 | } 13 | }; 14 | 15 | export default reportWebVitals; 16 | -------------------------------------------------------------------------------- /example/react/src/routes/about.tsx: -------------------------------------------------------------------------------- 1 | import { ReactElement } from 'react'; 2 | import { Link } from 'react-router-dom'; 3 | import { WcsBreadcrumb, WcsBreadcrumbItem } from 'wcs-react'; 4 | 5 | export default function About(): ReactElement { 6 | return ( 7 | <> 8 | 9 | 10 | Home 11 | 12 | About 13 | 14 | 15 |

About

16 |

This is the about page

17 | 18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /example/react/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /example/react/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "module": "esnext", 17 | "moduleResolution": "node", 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "noEmit": true, 21 | "jsx": "react-jsx" 22 | }, 23 | "include": [ 24 | "src" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /react/.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | node_modules/ 3 | *.tgz 4 | dist-transpiled/ 5 | -------------------------------------------------------------------------------- /react/README.md: -------------------------------------------------------------------------------- 1 | # WcsReact 2 | 3 | [![npm version](https://img.shields.io/npm/v/wcs-react)](https://www.npmjs.com/package/wcs-react) 4 | [![React](https://img.shields.io/badge/React-222.svg?logo=react&logoColor=61DAFB)](https://react.dev/) 5 | 6 | 7 | This project is the React integration of the [wcs-core package](https://www.npmjs.com/package/wcs-core). 8 | It contains : 9 | * **Custom elements** definition as functional React component 10 | * **Props** handling 11 | * **Utils** functions 12 | 13 | ## Requirements 14 | 15 | - Generated with [Create-React-App](https://create-react-app.dev/) version 5.0.1 16 | - Requires React >= 18 17 | 18 | ## Build 19 | 20 | Run `npm run build` from the wcs-core/react folder. 21 | 22 | ## Integration in your project 23 | 24 | Read the official [WCS documentation](https://wcs.dev.sncf/?path=/docs/documentation-getting-started-react--documentation) 25 | for React integration. 26 | 27 | ## Further help 28 | 29 | To get more help on the Create-React-App CLI use `npx create-react-app --help` or go check out the [Create-React-App documentation](https://create-react-app.dev/docs/getting-started). 30 | 31 | ## Licence 32 | 33 | [MIT](https://gitlab.com/SNCF/wcs/-/blob/master/LICENSE) 34 | -------------------------------------------------------------------------------- /react/lib/components/stencil-generated/react-component-lib/index.ts: -------------------------------------------------------------------------------- 1 | export { createReactComponent } from './createComponent'; 2 | export { createOverlayComponent } from './createOverlayComponent'; 3 | -------------------------------------------------------------------------------- /react/lib/components/stencil-generated/react-component-lib/interfaces.ts: -------------------------------------------------------------------------------- 1 | // General types important to applications using stencil built components 2 | export interface EventEmitter { 3 | emit: (data?: T) => CustomEvent; 4 | } 5 | 6 | export interface StyleReactProps { 7 | class?: string; 8 | className?: string; 9 | style?: { [key: string]: any }; 10 | } 11 | 12 | export interface OverlayEventDetail { 13 | data?: T; 14 | role?: string; 15 | } 16 | 17 | export interface OverlayInterface { 18 | el: HTMLElement; 19 | animated: boolean; 20 | keyboardClose: boolean; 21 | overlayIndex: number; 22 | presented: boolean; 23 | 24 | enterAnimation?: any; 25 | leaveAnimation?: any; 26 | 27 | didPresent: EventEmitter; 28 | willPresent: EventEmitter; 29 | willDismiss: EventEmitter; 30 | didDismiss: EventEmitter; 31 | 32 | present(): Promise; 33 | dismiss(data?: any, role?: string): Promise; 34 | } 35 | -------------------------------------------------------------------------------- /react/lib/components/stencil-generated/react-component-lib/utils/case.ts: -------------------------------------------------------------------------------- 1 | export const dashToPascalCase = (str: string) => 2 | str 3 | .toLowerCase() 4 | .split('-') 5 | .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)) 6 | .join(''); 7 | export const camelToDashCase = (str: string) => str.replace(/([A-Z])/g, (m: string) => `-${m[0].toLowerCase()}`); 8 | -------------------------------------------------------------------------------- /react/lib/components/stencil-generated/react-component-lib/utils/dev.ts: -------------------------------------------------------------------------------- 1 | export const isDevMode = () => { 2 | return process && process.env && process.env.NODE_ENV === 'development'; 3 | }; 4 | 5 | const warnings: { [key: string]: boolean } = {}; 6 | 7 | export const deprecationWarning = (key: string, message: string) => { 8 | if (isDevMode()) { 9 | if (!warnings[key]) { 10 | console.warn(message); 11 | warnings[key] = true; 12 | } 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /react/lib/index.ts: -------------------------------------------------------------------------------- 1 | export * from './components/stencil-generated'; 2 | export { defineCustomElements } from "wcs-core/loader"; 3 | -------------------------------------------------------------------------------- /react/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wcs-react", 3 | "version": "7.1.0", 4 | "description": "React components wrapper for WCS", 5 | "main": "./dist/index.js", 6 | "module": "./dist/index.js", 7 | "types": "./dist/types/index.d.ts", 8 | "scripts": { 9 | "test": "node ./__tests__/react-library.test.js", 10 | "build": "npm run clean && npm run compile", 11 | "tsc": "tsc -p .", 12 | "clean": "rimraf dist && rimraf dist-transpiled", 13 | "compile": "npm run tsc && rollup -c" 14 | }, 15 | "files": [ 16 | "dist/" 17 | ], 18 | "workspaces": [ 19 | "../" 20 | ], 21 | "author": "SNCF", 22 | "license": "ISC", 23 | "devDependencies": { 24 | "@types/react": "^18.2.21", 25 | "@types/node": "20.14.8", 26 | "react": "^18.2.0", 27 | "react-dom": "^18.2.0", 28 | "typescript": "^5.2.2", 29 | "rollup": "3.29.0", 30 | "rollup-plugin-sourcemaps": "0.6.3", 31 | "@rollup/plugin-node-resolve": "15.2.1", 32 | "rimraf": "5.0.1" 33 | }, 34 | "publishConfig": { 35 | "access": "public" 36 | }, 37 | "dependencies": { 38 | "wcs-core": "7.1.0", 39 | "tslib": "*" 40 | } 41 | } -------------------------------------------------------------------------------- /react/rollup.config.mjs: -------------------------------------------------------------------------------- 1 | import resolve from '@rollup/plugin-node-resolve'; 2 | import sourcemaps from 'rollup-plugin-sourcemaps'; 3 | 4 | /** @type {import('rollup').RollupOptions} */ 5 | const options = { 6 | input: { 7 | index: 'dist-transpiled/index', 8 | }, 9 | output: [ 10 | { 11 | dir: 'dist/', 12 | entryFileNames: '[name].js', 13 | chunkFileNames: '[name]-[hash].js', 14 | format: 'es', 15 | sourcemap: true, 16 | }], 17 | external: (id) => { 18 | return ( 19 | id.startsWith('react') || 20 | id.startsWith('react-dom') || 21 | id.startsWith('wcs-core') 22 | ); 23 | }, 24 | plugins: [ 25 | resolve(), 26 | sourcemaps(), 27 | ], 28 | }; 29 | 30 | export default options; 31 | -------------------------------------------------------------------------------- /react/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "declaration": true, 5 | "declarationDir": "dist/types", 6 | "emitDecoratorMetadata": true, 7 | "esModuleInterop": true, 8 | "experimentalDecorators": true, 9 | "importHelpers": true, 10 | "jsx": "react", 11 | "lib": [ 12 | "dom", 13 | "es2015" 14 | ], 15 | "module": "esnext", 16 | "moduleResolution": "node", 17 | "noImplicitAny": false, 18 | "noLib": false, 19 | "outDir": "dist-transpiled", 20 | "removeComments": true, 21 | "resolveJsonModule": true, 22 | "skipLibCheck": true, 23 | "target": "es2017" 24 | }, 25 | "exclude": [ 26 | "node_modules" 27 | ], 28 | "include": [ 29 | "lib" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /scripts/update-develop-from-master.js: -------------------------------------------------------------------------------- 1 | const execSync = require('child_process').execSync; 2 | function main() { 3 | const commandToExec = `git checkout develop && git pull && git merge master && git push`; 4 | console.log(`[EXEC] ${commandToExec}`); 5 | console.log(execSync(commandToExec, { 6 | cwd: './' 7 | }).toString()); 8 | } 9 | 10 | main(); 11 | -------------------------------------------------------------------------------- /src/assets/fonts/avenir-black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/src/assets/fonts/avenir-black.woff -------------------------------------------------------------------------------- /src/assets/fonts/avenir-book.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/src/assets/fonts/avenir-book.woff -------------------------------------------------------------------------------- /src/assets/fonts/avenir-heavy.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/src/assets/fonts/avenir-heavy.woff -------------------------------------------------------------------------------- /src/assets/fonts/avenir-lighter.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/src/assets/fonts/avenir-lighter.woff -------------------------------------------------------------------------------- /src/assets/fonts/avenir-medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/src/assets/fonts/avenir-medium.woff -------------------------------------------------------------------------------- /src/assets/fonts/avenir-roman.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/src/assets/fonts/avenir-roman.woff -------------------------------------------------------------------------------- /src/assets/fonts/icons/icons.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/src/assets/fonts/icons/icons.eot -------------------------------------------------------------------------------- /src/assets/fonts/icons/icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/src/assets/fonts/icons/icons.ttf -------------------------------------------------------------------------------- /src/assets/fonts/icons/icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/src/assets/fonts/icons/icons.woff -------------------------------------------------------------------------------- /src/assets/fonts/icons/icons.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/src/assets/fonts/icons/icons.woff2 -------------------------------------------------------------------------------- /src/assets/github-32px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/src/assets/github-32px.png -------------------------------------------------------------------------------- /src/assets/sncf-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/src/assets/sncf-logo.png -------------------------------------------------------------------------------- /src/components/accordion-content/accordion-content.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | --wcs-accordion-content-padding: var(--wcs-semantic-spacing-base) calc(3 * var(--wcs-semantic-spacing-base)) var(--wcs-semantic-spacing-large) calc(3 * var(--wcs-semantic-spacing-base)); 3 | --wcs-accordion-content-text-color: var(--wcs-semantic-color-text-secondary); 4 | 5 | padding: var(--wcs-accordion-content-padding); 6 | color: var(--wcs-accordion-content-text-color); 7 | display: block; 8 | } 9 | -------------------------------------------------------------------------------- /src/components/accordion-content/accordion-content.tsx: -------------------------------------------------------------------------------- 1 | import { Component, h, Host } from '@stencil/core'; 2 | 3 | /** 4 | * The accordion-content is a subcomponent of `wcs-accordion`. It represents the text / content below an expanded accordion. 5 | * 6 | * @cssprop --wcs-accordion-content-padding - Padding of the content 7 | * @cssprop --wcs-accordion-content-text-color - Text color of the content 8 | */ 9 | @Component({ 10 | tag: 'wcs-accordion-content', 11 | styleUrl: 'accordion-content.scss', 12 | shadow: true 13 | }) 14 | export class AccordionContent { 15 | render() { 16 | return ( 17 | 18 | 19 | 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/components/accordion-content/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-accordion-content 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | The accordion-content is a subcomponent of `wcs-accordion`. It represents the text / content below an expanded accordion. 11 | 12 | ---------------------------------------------- 13 | 14 | *Built with [StencilJS](https://stenciljs.com/)* 15 | -------------------------------------------------------------------------------- /src/components/accordion-header/accordion-header.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | text-align: left; 3 | } 4 | -------------------------------------------------------------------------------- /src/components/accordion-header/accordion-header.tsx: -------------------------------------------------------------------------------- 1 | import { Component, h, Host } from '@stencil/core'; 2 | 3 | /** 4 | * The accordion-header is a subcomponent of `wcs-accordion`. It represents the heading text inside the accordion panel. 5 | */ 6 | @Component({ 7 | tag: 'wcs-accordion-header', 8 | styleUrl: 'accordion-header.scss', 9 | shadow: true 10 | }) 11 | export class AccordionHeader { 12 | render() { 13 | return ( 14 | 15 | 16 | 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/components/accordion-header/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-accordion-header 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | The accordion-header is a subcomponent of `wcs-accordion`. It represents the heading text inside the accordion panel. 11 | 12 | ---------------------------------------------- 13 | 14 | *Built with [StencilJS](https://stenciljs.com/)* 15 | -------------------------------------------------------------------------------- /src/components/accordion/accordion.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | --wcs-accordion-gap: var(--wcs-semantic-spacing-base); 3 | 4 | display: flex; 5 | flex-direction: column; 6 | gap: var(--wcs-accordion-gap); 7 | } 8 | -------------------------------------------------------------------------------- /src/components/action-bar/readme.md: -------------------------------------------------------------------------------- 1 | # Action bar 2 | 3 | 4 | 5 | 6 | 7 | ## Overview 8 | 9 | The action-bar component is a group of elements appearing across the top of all pages on a business application. 10 | 11 | ## Properties 12 | 13 | | Property | Attribute | Description | Type | Default | 14 | | -------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------- | --------- | ----------- | 15 | | `gutter` | `gutter` | Determines if the action bar should have a border at the bottom. You should not use this property if a gutter is already present on tabs | `boolean` | `undefined` | 16 | 17 | 18 | ---------------------------------------------- 19 | 20 | *Built with [StencilJS](https://stenciljs.com/)* 21 | -------------------------------------------------------------------------------- /src/components/app/app.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | background-color: var(--wcs-semantic-color-background-surface-secondary); 3 | margin: 0; 4 | display: grid; 5 | grid-template-areas: 6 | "header header" 7 | "sidebar content"; 8 | grid-template-columns: min-content auto; 9 | overflow-y: hidden; 10 | } 11 | 12 | ::slotted(main) { 13 | padding: 8px; 14 | grid-area: content; 15 | overflow-y: scroll; 16 | height: calc(100vh - 64px); 17 | } 18 | 19 | ::slotted(wcs-header) { 20 | grid-area: header; 21 | } 22 | 23 | @media screen and (max-width: 768px) { 24 | :host { 25 | grid-template-areas: 26 | "header" 27 | "sidebar" 28 | "content"; 29 | grid-template-columns: auto; 30 | } 31 | 32 | ::slotted(header) { 33 | position: relative; 34 | } 35 | 36 | ::slotted(main) { 37 | overflow-y: visible; 38 | height: initial; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/components/app/app.tsx: -------------------------------------------------------------------------------- 1 | import { Component, ComponentInterface, h } from '@stencil/core'; 2 | 3 | 4 | @Component({ 5 | tag: 'wcs-app', 6 | styleUrl: 'app.scss', 7 | shadow: true 8 | }) 9 | export class App implements ComponentInterface { 10 | 11 | render() { 12 | return [ 13 | , 14 | , 15 | 16 | ]; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/components/app/readme.md: -------------------------------------------------------------------------------- 1 | # App 2 | 3 | 4 | 5 | 6 | 7 | 8 | ---------------------------------------------- 9 | 10 | *Built with [StencilJS](https://stenciljs.com/)* 11 | -------------------------------------------------------------------------------- /src/components/badge/badge-interface.ts: -------------------------------------------------------------------------------- 1 | import { WcsSize } from "../../shared-types"; 2 | 3 | export type BadgeShape = 'normal' | 'rounded'; 4 | 5 | export type BadgeColor = 'initial' | 'lighter'; 6 | 7 | export type BadgeSize = Extract 8 | -------------------------------------------------------------------------------- /src/components/badge/readme.md: -------------------------------------------------------------------------------- 1 | # Badge 2 | 3 | 4 | 5 | 6 | ## Overview 7 | 8 | The badge component is a small label, generally appearing inside or in proximity to another larger interface component, 9 | representing a status, property, or some other metadata. 10 | 11 | ## Properties 12 | 13 | | Property | Attribute | Description | Type | Default | 14 | | -------- | --------- | ---------------------------------------------------------------------------------------------------------------- | ------------------------ | ----------- | 15 | | `color` | `color` | Allows you to change the color of the badge to make it less bright (based on the color chosen by the CSS class). | `"initial" \| "lighter"` | `'initial'` | 16 | | `shape` | `shape` | Define the shape of the badge | `"normal" \| "rounded"` | `'normal'` | 17 | | `size` | `size` | Specify the size of the badge. | `"l" \| "m" \| "s"` | `'m'` | 18 | 19 | 20 | ---------------------------------------------- 21 | 22 | *Built with [StencilJS](https://stenciljs.com/)* 23 | -------------------------------------------------------------------------------- /src/components/breadcrumb-item/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-breadcrumb-item 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | The breadcrumb item represents a link inside a breadcrumb. 11 | 12 | ## Slots 13 | 14 | | Slot | Description | 15 | | --------------------------------- | ----------- | 16 | | `" Main container slot"` | | 17 | 18 | 19 | ---------------------------------------------- 20 | 21 | *Built with [StencilJS](https://stenciljs.com/)* 22 | -------------------------------------------------------------------------------- /src/components/breadcrumb/breadcrumb-constants.ts: -------------------------------------------------------------------------------- 1 | export const NAV_ARIA_LABEL_DEFAULT = 'Fil d\'Ariane'; 2 | export const EXPAND_BTN_ARIA_LABEL_DEFAULT = 'Étendre le fil d\'Ariane'; 3 | 4 | export const ICONS_FONT_CHEVRON_UNICODE = '\uF107'; 5 | -------------------------------------------------------------------------------- /src/components/button/button-interface.ts: -------------------------------------------------------------------------------- 1 | import { WcsSize } from '../../shared-types'; 2 | 3 | export type WcsButtonType = 'button' | 'submit'; 4 | 5 | export type WcsButtonShape = 'normal' | 'round' | 'square'; 6 | 7 | export type WcsButtonMode = 'plain' | 'stroked' | 'clear'; 8 | 9 | export const WcsButtonSizeValues = ['s', 'm', 'l'] as const; // as const keyword is used to infer and preserve the exact literal values of an array or object. 10 | 11 | export type WcsButtonSize = Extract; 12 | 13 | export function isWcsButtonSize(size: string): size is WcsButtonSize { 14 | // @ts-ignore : ignore size type, as it is checked with WcsButtonSizeValues 15 | return WcsButtonSizeValues.includes(size); 16 | } 17 | -------------------------------------------------------------------------------- /src/components/button/button.e2e.ts: -------------------------------------------------------------------------------- 1 | import { newE2EPage } from "@stencil/core/testing"; 2 | import { setWcsContent } from "../../utils/tests"; 3 | 4 | describe('button', () => { 5 | // XXX: this test display an error in console but actually works 6 | // This is maybe due to the form submiting making the page reload ? 7 | it('should trigger submit when in a form', async () => { 8 | // Given 9 | const page = await newE2EPage(); 10 | await setWcsContent(page, ` 11 |
12 | 13 |
14 | `); 15 | const form = await page.find('form'); 16 | const formSubmit = await form.spyOnEvent('submit'); 17 | // When 18 | // XXX temporary fix see : https://github.com/GoogleChrome/puppeteer/issues/2977 19 | await page.evaluate(() => { 20 | document.querySelector('wcs-button').click(); 21 | }); 22 | // Then 23 | expect(formSubmit).toHaveReceivedEvent(); 24 | }); 25 | }); 26 | 27 | -------------------------------------------------------------------------------- /src/components/card-body/card-body.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | --wcs-card-body-padding: var(--wcs-semantic-spacing-large); 3 | 4 | flex: 1 1 auto; 5 | padding: var(--wcs-card-body-padding); 6 | } 7 | -------------------------------------------------------------------------------- /src/components/card-body/card-body.tsx: -------------------------------------------------------------------------------- 1 | import { Component, ComponentInterface, h } from '@stencil/core'; 2 | 3 | /** 4 | * The card-body is a subcomponent of `wcs-card`. It represents content of the card with an extra padding around. 5 | * 6 | * @cssprop --wcs-card-body-padding - Padding of the card body 7 | */ 8 | @Component({ 9 | tag: 'wcs-card-body', 10 | styleUrl: 'card-body.scss', 11 | shadow: true 12 | }) 13 | export class CardBody implements ComponentInterface { 14 | render() { 15 | return (); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/components/card-body/readme.md: -------------------------------------------------------------------------------- 1 | # Card body 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | The card-body is a subcomponent of `wcs-card`. It represents content of the card with an extra padding around. 11 | 12 | ---------------------------------------------- 13 | 14 | *Built with [StencilJS](https://stenciljs.com/)* 15 | -------------------------------------------------------------------------------- /src/components/card/card-interface.ts: -------------------------------------------------------------------------------- 1 | export type CardMode = 'flat' | 'raised'; 2 | -------------------------------------------------------------------------------- /src/components/card/card.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | --wcs-card-border-color: var(--wcs-semantic-color-border-secondary); 3 | --wcs-card-border-radius: var(--wcs-semantic-border-radius-base); 4 | --wcs-card-border-width: var(--wcs-semantic-border-width-default); 5 | --wcs-card-background-color: var(--wcs-semantic-color-background-surface-primary); 6 | --wcs-card-text-color: var(--wcs-semantic-color-text-primary); 7 | 8 | position: relative; 9 | display: flex; 10 | flex-direction: column; 11 | min-width: 0; 12 | word-wrap: break-word; 13 | background-clip: border-box; 14 | border-radius: var(--wcs-card-border-radius); 15 | background-color: var(--wcs-card-background-color); 16 | color: var(--wcs-card-text-color); 17 | } 18 | 19 | :host([mode="raised"]) { 20 | /* Card mode raised is deprecated in the new design system */ 21 | box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .12), 0 1px 5px 0 rgba(0, 0, 0, .20) 22 | } 23 | 24 | :host([mode="flat"]) { 25 | border: solid var(--wcs-card-border-width) var(--wcs-card-border-color); 26 | } 27 | -------------------------------------------------------------------------------- /src/components/card/card.tsx: -------------------------------------------------------------------------------- 1 | import { Component, ComponentInterface, h, Prop } from '@stencil/core'; 2 | import { CardMode } from './card-interface'; 3 | 4 | /** 5 | * The card component is a container that display content such as text, images, buttons, and lists. 6 | * A card can be a single component, but is often made up of a header, title, subtitle, and content. 7 | * 8 | * @cssprop --wcs-card-border-color - Border color of the card 9 | * @cssprop --wcs-card-border-radius - Border radius of the card 10 | * @cssprop --wcs-card-border-width - Border width of the card 11 | * @cssprop --wcs-card-background-color - Background color of the card 12 | * @cssprop --wcs-card-text-color - Text color of the card 13 | */ 14 | @Component({ 15 | tag: 'wcs-card', 16 | styleUrl: 'card.scss', 17 | shadow: true 18 | }) 19 | export class Card implements ComponentInterface { 20 | @Prop({reflect: true, mutable: true}) 21 | mode: CardMode = 'flat'; 22 | 23 | 24 | render() { 25 | return ( 26 | 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/components/card/readme.md: -------------------------------------------------------------------------------- 1 | # Card 2 | 3 | 4 | 5 | 6 | ## Overview 7 | 8 | The card component is a container that display content such as text, images, buttons, and lists. 9 | A card can be a single component, but is often made up of a header, title, subtitle, and content. 10 | 11 | ## Properties 12 | 13 | | Property | Attribute | Description | Type | Default | 14 | | -------- | --------- | ----------- | -------------------- | -------- | 15 | | `mode` | `mode` | | `"flat" \| "raised"` | `'flat'` | 16 | 17 | 18 | ---------------------------------------------- 19 | 20 | *Built with [StencilJS](https://stenciljs.com/)* 21 | -------------------------------------------------------------------------------- /src/components/checkbox/checkbox-interface.ts: -------------------------------------------------------------------------------- 1 | export interface CheckboxChangeEventDetail { 2 | checked: boolean; 3 | } 4 | 5 | export type CheckboxLabelAlignment = 'top' | 'center' | 'bottom'; 6 | -------------------------------------------------------------------------------- /src/components/com-nav-item/readme.md: -------------------------------------------------------------------------------- 1 | # com-nav-item 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | The com-nav-item is a subcomponent of `wcs-com-nav`. It represents a list-item wrapper around a link. 11 | 12 | ## Events 13 | 14 | | Event | Description | Type | 15 | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------- | 16 | | `wcsClickOnFinalAction` | Emitted when a user click on a final navigation action. Used by the com-nav component to close the mobile menu overlay when a user click on a final action. | `CustomEvent` | 17 | 18 | 19 | ---------------------------------------------- 20 | 21 | *Built with [StencilJS](https://stenciljs.com/)* 22 | -------------------------------------------------------------------------------- /src/components/com-nav/com-nav-focus.scss: -------------------------------------------------------------------------------- 1 | @import '../../style/focus-outline.scss'; 2 | 3 | @mixin com-nav-item-mobile-focus-outline($outline-color) { 4 | @include focus-outline($outline-color, 2px, 0.5rem); 5 | } 6 | 7 | // Focus outline for com nav item in menu-bar 8 | @mixin com-nav-item-desktop-focus-outline($outline-color) { 9 | @include focus-outline($outline-color, 2px, 0.1rem); 10 | } 11 | 12 | // Focus outline for sub-menu item and category item 13 | @mixin com-nav-submenu-item-desktop-focus-outline($outline-color) { 14 | @include focus-outline($outline-color, 2px, 0.1rem); 15 | } 16 | -------------------------------------------------------------------------------- /src/components/com-nav/com-nav-interface.ts: -------------------------------------------------------------------------------- 1 | export interface MenuOpenedEventDetail { 2 | menuElement: HTMLWcsComNavSubmenuElement; 3 | } 4 | export interface CategoryOpenedEventDetail { 5 | categoryElement: HTMLWcsComNavCategoryElement; 6 | } 7 | -------------------------------------------------------------------------------- /src/components/com-nav/com-nav-size.ts: -------------------------------------------------------------------------------- 1 | export type ComNavSize = 'desktop' | 'mobile' 2 | -------------------------------------------------------------------------------- /src/components/counter/counter-interface.ts: -------------------------------------------------------------------------------- 1 | import { WcsSize } from "../../shared-types"; 2 | 3 | export interface CounterChangeEventDetail { 4 | value: number; 5 | } 6 | 7 | export const WcsCounterSizeValues = ['m', 'l'] as const; // as const keyword is used to infer and preserve the exact literal values of an array or object. 8 | 9 | export type WcsCounterSize = Extract; 10 | 11 | export function isWcsCounterSize(size: string): size is WcsCounterSize { 12 | // @ts-ignore : ignore size type, as it is checked with WcsInputSizeValues 13 | return WcsCounterSizeValues.includes(size); 14 | } 15 | -------------------------------------------------------------------------------- /src/components/divider/divider.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | --wcs-divider-color: var(--wcs-semantic-color-border-secondary); 3 | --wcs-divider-height: var(--wcs-semantic-border-width-default); 4 | 5 | display: block; 6 | border-bottom: solid var(--wcs-divider-height) var(--wcs-divider-color); 7 | } 8 | -------------------------------------------------------------------------------- /src/components/divider/divider.tsx: -------------------------------------------------------------------------------- 1 | import { Component, ComponentInterface, h, Host } from '@stencil/core'; 2 | 3 | /** 4 | * The divider is a separator between two elements, consisting of a horizontal line. 5 | * 6 | * @cssprop --wcs-divider-color - Color of the divider 7 | * @cssprop --wcs-divider-height - Height (border-width) of the divider 8 | */ 9 | @Component({ 10 | tag: 'wcs-divider', 11 | styleUrl: 'divider.scss', 12 | shadow: true 13 | }) 14 | export class Divider implements ComponentInterface { 15 | render() { 16 | return ( 17 | 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/components/divider/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-divider 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | The divider is a separator between two elements, consisting of a horizontal line. 11 | 12 | ---------------------------------------------- 13 | 14 | *Built with [StencilJS](https://stenciljs.com/)* 15 | -------------------------------------------------------------------------------- /src/components/dropdown-divider/dropdown-divider.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | --wcs-dropdown-divider-margin: var(--wcs-semantic-spacing-base) 0; 3 | --wcs-dropdown-divider-color: var(--wcs-semantic-color-border-secondary); 4 | 5 | display: block; 6 | margin: var(--wcs-dropdown-divider-margin); 7 | overflow: hidden; 8 | border-top: 1px solid var(--wcs-dropdown-divider-color); 9 | } 10 | -------------------------------------------------------------------------------- /src/components/dropdown-divider/dropdown-divider.tsx: -------------------------------------------------------------------------------- 1 | import { Component, h, Host } from '@stencil/core'; 2 | 3 | /** 4 | * You can add a divider between groups of items 5 | * 6 | * @cssprop --wcs-dropdown-divider-margin - Margin of the divider 7 | * @cssprop --wcs-dropdown-divider-color - Color of the divider 8 | * 9 | */ 10 | @Component({ 11 | tag: 'wcs-dropdown-divider', 12 | styleUrl: 'dropdown-divider.scss', 13 | shadow: true 14 | }) 15 | export class DropdownDivider { 16 | render() { 17 | return ( 18 | 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/components/dropdown-divider/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-dropdown-divider 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | You can add a divider between groups of items 11 | 12 | ---------------------------------------------- 13 | 14 | *Built with [StencilJS](https://stenciljs.com/)* 15 | -------------------------------------------------------------------------------- /src/components/dropdown-header/dropdown-header.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | --wcs-dropdown-header-color: var(--wcs-semantic-color-text-tertiary); 3 | --wcs-dropdown-header-padding-vertical: var(--wcs-semantic-spacing-base); 4 | --wcs-dropdown-header-padding-horizontal: var(--wcs-semantic-spacing-base); 5 | --wcs-dropdown-header-font-size: var(--wcs-semantic-font-size-label-2); 6 | --wcs-dropdown-header-font-weight: var(--wcs-semantic-font-weight-medium); 7 | 8 | display: block; 9 | padding: var(--wcs-dropdown-header-padding-vertical) var(--wcs-dropdown-header-padding-horizontal); 10 | font-size: var(--wcs-dropdown-header-font-size); 11 | font-weight: var(--wcs-dropdown-header-font-weight); 12 | text-transform: uppercase; 13 | color: var(--wcs-dropdown-header-color); 14 | white-space: nowrap; 15 | } 16 | -------------------------------------------------------------------------------- /src/components/dropdown-header/dropdown-header.tsx: -------------------------------------------------------------------------------- 1 | import { Component, h, Host } from '@stencil/core'; 2 | 3 | 4 | /** 5 | * You can add `wcs-dropdown-header` before a group of items to describe it 6 | * @slot the slot that contains the header's name 7 | * 8 | * @cssprop --wcs-dropdown-header-color - Text color of the header 9 | * @cssprop --wcs-dropdown-header-padding-vertical - Vertical padding of the header 10 | * @cssprop --wcs-dropdown-header-padding-horizontal - Horizontal padding of the header 11 | * @cssprop --wcs-dropdown-header-font-size - Font size of the header 12 | * @cssprop --wcs-dropdown-header-font-weight - Font weight of the header 13 | * 14 | */ 15 | @Component({ 16 | tag: 'wcs-dropdown-header', 17 | styleUrl: 'dropdown-header.scss', 18 | shadow: true 19 | }) 20 | export class DropdownHeader { 21 | 22 | render() { 23 | return ( 24 | 25 | 26 | 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/components/dropdown-header/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-dropdown-header 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | You can add `wcs-dropdown-header` before a group of items to describe it 11 | 12 | ## Slots 13 | 14 | | Slot | Description | 15 | | ------------------------------------------------------ | ----------- | 16 | | `" the slot that contains the header's name"` | | 17 | 18 | 19 | ---------------------------------------------- 20 | 21 | *Built with [StencilJS](https://stenciljs.com/)* 22 | -------------------------------------------------------------------------------- /src/components/dropdown-item/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-dropdown-item 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | You must add `wcs-dropdown-item` to `wcs-dropdown` 11 | 12 | ## Events 13 | 14 | | Event | Description | Type | 15 | | ---------------------- | ----------------------------------------------- | ------------------- | 16 | | `wcsDropdownItemClick` | Event emitted when the dropdown item is clicked | `CustomEvent` | 17 | 18 | 19 | ## Slots 20 | 21 | | Slot | Description | 22 | | ---------------------------------------------------- | ----------- | 23 | | `" the slot that contains the item's name"` | | 24 | 25 | 26 | ---------------------------------------------- 27 | 28 | *Built with [StencilJS](https://stenciljs.com/)* 29 | -------------------------------------------------------------------------------- /src/components/dropdown/dropdown-interface.ts: -------------------------------------------------------------------------------- 1 | export type WcsDropdownPlacement = 2 | | 'auto' 3 | | 'auto-start' 4 | | 'auto-end' 5 | | 'top' 6 | | 'top-start' 7 | | 'top-end' 8 | | 'bottom' 9 | | 'bottom-start' 10 | | 'bottom-end' 11 | | 'right' 12 | | 'right-start' 13 | | 'right-end' 14 | | 'left' 15 | | 'left-start' 16 | | 'left-end'; 17 | -------------------------------------------------------------------------------- /src/components/error/error.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | --wcs-error-color: var(--wcs-semantic-color-text-critical); 3 | --wcs-error-font-size: var(--wcs-semantic-font-size-caption-2); 4 | --wcs-error-font-weight: var(--wcs-semantic-font-weight-book); 5 | 6 | color: var(--wcs-error-color); 7 | font-size: var(--wcs-error-font-size); 8 | font-weight: var(--wcs-error-font-weight); 9 | } 10 | -------------------------------------------------------------------------------- /src/components/error/error.tsx: -------------------------------------------------------------------------------- 1 | import { Component, ComponentInterface, h, Host } from '@stencil/core'; 2 | 3 | /** 4 | * The `wcs-error` should always be wrapped in a `wcs-form-field`. 5 | * It is used to display a red message under the field indicating an incorrect user input. 6 | * 7 | * ## Accessibility guidelines 💡 8 | * - Provide a relevant error message to inform the users what they should change to make the field valid 9 | * - Always add the error icon, to ensure the visual indication of the error state other than the color 10 | * - `aria-description` will be automatically added to the field for screen readers 11 | * - `aria-invalid="true"` will be automatically added to the field for screen readers 12 | * 13 | * @cssprop --wcs-error-color - Color of the text 14 | * @cssprop --wcs-error-font-size - Font size 15 | * @cssprop --wcs-error-font-weight - Font weight 16 | */ 17 | @Component({ 18 | tag: 'wcs-error', 19 | styleUrl: 'error.scss', 20 | shadow: true, 21 | }) 22 | export class Label implements ComponentInterface { 23 | render() { 24 | return ( 25 | 26 | 27 | 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/components/error/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-error 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | The `wcs-error` should always be wrapped in a `wcs-form-field`. 11 | It is used to display a red message under the field indicating an incorrect user input. 12 | 13 | ## Accessibility guidelines 💡 14 | - Provide a relevant error message to inform the users what they should change to make the field valid 15 | - Always add the error icon, to ensure the visual indication of the error state other than the color 16 | - `aria-description` will be automatically added to the field for screen readers 17 | - `aria-invalid="true"` will be automatically added to the field for screen readers 18 | 19 | ## Dependencies 20 | 21 | ### Used by 22 | 23 | - [wcs-editable-field](../editable-field) 24 | 25 | ### Graph 26 | ```mermaid 27 | graph TD; 28 | wcs-editable-field --> wcs-error 29 | style wcs-error fill:#f9f,stroke:#333,stroke-width:4px 30 | ``` 31 | 32 | ---------------------------------------------- 33 | 34 | *Built with [StencilJS](https://stenciljs.com/)* 35 | -------------------------------------------------------------------------------- /src/components/field-content/field-content.tsx: -------------------------------------------------------------------------------- 1 | import { Component, ComponentInterface, h, Host } from '@stencil/core'; 2 | 3 | /** 4 | * The field-content is a subcomponent of `wcs-field`. It represents the text content of the field. 5 | * 6 | * @cssprop --wcs-field-content-color - Color of the content 7 | * @cssprop --wcs-field-content-font-weight - Font weight of the content 8 | * @cssprop --wcs-field-content-font-size - Font size of the content 9 | * @cssprop --wcs-field-content-line-height - Line height of the content 10 | */ 11 | @Component({ 12 | tag: 'wcs-field-content', 13 | shadow: true 14 | }) 15 | export class FieldContent implements ComponentInterface { 16 | render() { 17 | return ( 18 | 19 | 20 | 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/components/field-content/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-field-content 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | The field-content is a subcomponent of `wcs-field`. It represents the text content of the field. 11 | 12 | ---------------------------------------------- 13 | 14 | *Built with [StencilJS](https://stenciljs.com/)* 15 | -------------------------------------------------------------------------------- /src/components/field-label/field-label.tsx: -------------------------------------------------------------------------------- 1 | import { Component, ComponentInterface, h, Host, } from '@stencil/core'; 2 | 3 | /** 4 | * The field-label is a subcomponent of `wcs-field`. It represents the label or title of the field. 5 | * 6 | * @cssprop --wcs-field-label-color - Color of the label 7 | * @cssprop --wcs-field-label-font-weight - Font weight of the label 8 | * @cssprop --wcs-field-label-font-size - Font size of the label 9 | * @cssprop --wcs-field-label-line-height - Line height of the label 10 | */ 11 | @Component({ 12 | tag: 'wcs-field-label', 13 | shadow: true 14 | }) 15 | export class FieldLabel implements ComponentInterface { 16 | render() { 17 | return ( 18 | 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/components/field-label/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-field-label 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | The field-label is a subcomponent of `wcs-field`. It represents the label or title of the field. 11 | 12 | ---------------------------------------------- 13 | 14 | *Built with [StencilJS](https://stenciljs.com/)* 15 | -------------------------------------------------------------------------------- /src/components/field/readme.md: -------------------------------------------------------------------------------- 1 | # Field 2 | 3 | 4 | 5 | 6 | ## Overview 7 | 8 | This field component can be used to display the details of an entity. It is built around the label and the content of the field. 9 | 10 | ## Slots 11 | 12 | | Slot | Description | 13 | | -------------------------------- | ----------- | 14 | | `"content Content of the field"` | | 15 | | `"label Label of the field"` | | 16 | 17 | 18 | ---------------------------------------------- 19 | 20 | *Built with [StencilJS](https://stenciljs.com/)* 21 | -------------------------------------------------------------------------------- /src/components/footer/readme.md: -------------------------------------------------------------------------------- 1 | # Footer 2 | 3 | 4 | 5 | 6 | ## Overview 7 | 8 | The footer component has been designed to leave as much customization as possible to the developer. The footers are often specific to the application developed. 9 | 10 | ## Slots 11 | 12 | | Slot | Description | 13 | | --------------------------------------------- | ----------- | 14 | | `" Main container slot"` | | 15 | | `"end-left Bottom-left part of the footer"` | | 16 | | `"end-right Bottom-right part of the footer"` | | 17 | 18 | 19 | ---------------------------------------------- 20 | 21 | *Built with [StencilJS](https://stenciljs.com/)* 22 | -------------------------------------------------------------------------------- /src/components/galactic/readme.md: -------------------------------------------------------------------------------- 1 | # Galactic Bar 2 | 3 | 4 | 5 | 6 | ## Overview 7 | 8 | *Part of communication design system* 9 | This component replaces the vertical navbar for sites and applications that use the communication design system 10 | 11 | ## Properties 12 | 13 | | Property | Attribute | Description | Type | Default | 14 | | -------- | --------- | -------------------------- | -------- | ----------- | 15 | | `text` | `text` | Text to display in the bar | `string` | `undefined` | 16 | 17 | 18 | ## Slots 19 | 20 | | Slot | Description | 21 | | --------------------------------- | ----------- | 22 | | `" Main container slot"` | | 23 | 24 | 25 | ---------------------------------------------- 26 | 27 | *Built with [StencilJS](https://stenciljs.com/)* 28 | -------------------------------------------------------------------------------- /src/components/grid-column/grid-sort-arrow.scss: -------------------------------------------------------------------------------- 1 | .arrow-group { 2 | transform-origin: 50% 50%; 3 | transition: transform var(--wcs-semantic-motion-duration-feedback-base, 150ms) ease-in-out; 4 | } 5 | 6 | .arrow { 7 | fill: var(--wcs-grid-header-sort-arrow-color, transparent); 8 | } 9 | 10 | .desc { 11 | transform: rotate(180deg); 12 | } 13 | -------------------------------------------------------------------------------- /src/components/grid-column/grid-sort-arrow.tsx: -------------------------------------------------------------------------------- 1 | import { FunctionalComponent, h } from '@stencil/core'; 2 | import { WcsSortOrder } from '../grid/grid-interface'; 3 | 4 | interface GridSortArrowProps { 5 | state: WcsSortOrder; 6 | } 7 | 8 | export const GridSortArrow: FunctionalComponent = ({state}) => ( 9 | 17 | 18 | ); 19 | -------------------------------------------------------------------------------- /src/components/grid-custom-cell/grid-custom-cell.tsx: -------------------------------------------------------------------------------- 1 | import { Component, ComponentInterface, h, Host, Prop } from '@stencil/core'; 2 | 3 | /** 4 | * The grid custom cell is a subcomponent of `wcs-grid`. 5 | */ 6 | @Component({ 7 | tag: 'wcs-grid-custom-cell', 8 | shadow: true 9 | }) 10 | export class GridCustomCell implements ComponentInterface { 11 | /** 12 | * ID of the column for which to render the cell 13 | */ 14 | @Prop() columnId: string; 15 | /** 16 | * Key value of the object rendered for the cell's row 17 | */ 18 | @Prop() rowId: any; 19 | 20 | render(): any { 21 | return ( 22 | 23 | 24 | 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/components/grid-custom-cell/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-grid-custom-cell 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | The grid custom cell is a subcomponent of `wcs-grid`. 11 | 12 | ## Properties 13 | 14 | | Property | Attribute | Description | Type | Default | 15 | | ---------- | ----------- | --------------------------------------------------- | -------- | ----------- | 16 | | `columnId` | `column-id` | ID of the column for which to render the cell | `string` | `undefined` | 17 | | `rowId` | `row-id` | Key value of the object rendered for the cell's row | `any` | `undefined` | 18 | 19 | 20 | ---------------------------------------------- 21 | 22 | *Built with [StencilJS](https://stenciljs.com/)* 23 | -------------------------------------------------------------------------------- /src/components/grid/grid-radio.tsx: -------------------------------------------------------------------------------- 1 | import { FunctionalComponent, h } from '@stencil/core'; 2 | import { WcsGridRow } from "./grid-interface"; 3 | 4 | interface GridRadioProps { 5 | checked: boolean; 6 | row: WcsGridRow; 7 | rowIndex: number, 8 | totalRows: number, 9 | onClick: (row: WcsGridRow) => void; 10 | } 11 | 12 | export const GridRadio: FunctionalComponent = ( 13 | { 14 | checked, 15 | row, 16 | rowIndex, 17 | totalRows, 18 | onClick 19 | }) => { 20 | let input: HTMLInputElement; 21 | return ( 22 |
input.click()}> 23 | (input = el)} 31 | onClick={_ => onClick(row)}> 32 | 33 |
34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /src/components/hint/hint.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | --wcs-hint-font-size-default: var(--wcs-semantic-font-size-caption-2); 3 | --wcs-hint-font-size-small: var(--wcs-semantic-font-size-caption-3); 4 | --wcs-hint-font-weight: var(--wcs-semantic-font-weight-book); 5 | --wcs-hint-color: var(--wcs-semantic-color-text-secondary); 6 | 7 | font-size: var(--wcs-hint-font-size-default); 8 | font-weight: var(--wcs-hint-font-weight); 9 | color: var(--wcs-hint-color); 10 | } 11 | 12 | :host([small]) { 13 | font-size: var(--wcs-hint-font-size-small); 14 | font-weight: var(--wcs-hint-font-weight); 15 | } 16 | -------------------------------------------------------------------------------- /src/components/hint/hint.tsx: -------------------------------------------------------------------------------- 1 | import { Component, ComponentInterface, h, Host, Prop } from '@stencil/core'; 2 | 3 | /** 4 | * The `wcs-hint` should always be wrapped in a `wcs-form-field`. 5 | * It is used to display an informative message under the field indicating an incorrect user input. 6 | * 7 | * ## Accessibility guidelines 💡 8 | * - Provide a relevant hint message to inform the users about the format, how the data should be filled in, or what is the purpose of the field 9 | * - `aria-description` will be automatically added to the field for screen readers 10 | * 11 | * @cssprop --wcs-hint-color - Color of the text 12 | * @cssprop --wcs-hint-font-weight - Font weight of the text 13 | * @cssprop --wcs-hint-font-size-default - Font size default of the text 14 | * @cssprop --wcs-hint-font-size-small - Font size small of the text 15 | */ 16 | @Component({ 17 | tag: 'wcs-hint', 18 | styleUrl: 'hint.scss', 19 | shadow: true, 20 | }) 21 | export class Hint implements ComponentInterface { 22 | /** 23 | * Whether the component should display the small version of the hint 24 | */ 25 | @Prop({ reflect: true, mutable: true }) 26 | small: boolean = false; 27 | 28 | render() { 29 | return ( 30 | 31 | 32 | 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/components/hint/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-hint 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | The `wcs-hint` should always be wrapped in a `wcs-form-field`. 11 | It is used to display an informative message under the field indicating an incorrect user input. 12 | 13 | ## Accessibility guidelines 💡 14 | - Provide a relevant hint message to inform the users about the format, how the data should be filled in, or what is the purpose of the field 15 | - `aria-description` will be automatically added to the field for screen readers 16 | 17 | ## Properties 18 | 19 | | Property | Attribute | Description | Type | Default | 20 | | -------- | --------- | ------------------------------------------------------------------ | --------- | ------- | 21 | | `small` | `small` | Whether the component should display the small version of the hint | `boolean` | `false` | 22 | 23 | 24 | ---------------------------------------------- 25 | 26 | *Built with [StencilJS](https://stenciljs.com/)* 27 | -------------------------------------------------------------------------------- /src/components/horizontal-stepper/horizontal-stepper-interface.ts: -------------------------------------------------------------------------------- 1 | import { MaterialIconFamily } from '../mat-icon/mat-icon-interface'; 2 | 3 | /** 4 | * Stepper configuration interface 5 | */ 6 | export interface HorizontalStepConfig { 7 | /** Text displayed below the step button */ 8 | text?: string; 9 | /** Specifies if the step is clickable or not */ 10 | disable?: boolean; 11 | /** Specifies if the step is completed */ 12 | complete?: boolean; 13 | /** Step button configuration */ 14 | button: StepButton; 15 | } 16 | 17 | export type HorizontalStepperMode = 'linear' | 'nonLinear'; 18 | 19 | export type StepButton = StepIconButton | StepTextButton; 20 | 21 | export interface StepIconButton { 22 | kind: 'Icon'; 23 | iconName: string; 24 | family?: MaterialIconFamily; 25 | } 26 | 27 | export interface StepTextButton { 28 | kind: 'Text'; 29 | text: string; 30 | } 31 | 32 | export interface HorizontalStepClickEvent { 33 | step: HorizontalStepConfig; 34 | index: number; 35 | } 36 | -------------------------------------------------------------------------------- /src/components/label/label.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | --wcs-label-font-weight: var(--wcs-semantic-font-weight-book); 3 | --wcs-label-color: var(--wcs-semantic-color-text-primary); 4 | --wcs-label-required-marker-color: var(--wcs-semantic-color-text-critical); 5 | 6 | --wcs-label-gap: var(--wcs-semantic-spacing-small); 7 | 8 | font-weight: var(--wcs-label-font-weight); 9 | } 10 | 11 | :host([required]) > label::after { 12 | font-weight: var(--wcs-label-font-weight); 13 | color: var(--wcs-label-required-marker-color); 14 | content: ' *'; 15 | } 16 | 17 | label { 18 | display: inline-block; 19 | color: var(--wcs-label-color); 20 | font-weight: var(--wcs-label-font-weight); 21 | 22 | // Add margin before tooltip icon 23 | ::slotted(wcs-mat-icon) { 24 | display: inline; 25 | vertical-align: middle; 26 | margin-left: var(--wcs-label-gap); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/components/list-item-properties/list-item-properties.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | --wcs-list-item-properties-margin-bottom: var(--wcs-semantic-spacing-small); 3 | --wcs-list-item-properties-gap: calc(4 * var(--wcs-semantic-spacing-base)); 4 | --wcs-list-item-properties-separator-width: var(--wcs-semantic-border-width-large); 5 | --wcs-list-item-properties-separator-color: var(--wcs-semantic-color-border-secondary); 6 | 7 | display: flex; 8 | margin-bottom: var(--wcs-list-item-properties-margin-bottom); 9 | gap: var(--wcs-list-item-properties-gap); 10 | } 11 | 12 | ::slotted(*:not(:last-of-type)) { 13 | position: relative; 14 | 15 | &::after { 16 | position: absolute; 17 | content: ''; 18 | top: 0; 19 | height: 100%; 20 | width: var(--wcs-list-item-properties-separator-width); 21 | background-color: var(--wcs-list-item-properties-separator-color); 22 | right: calc(-0.5 * var(--wcs-list-item-properties-gap) - 0.5 * var(--wcs-list-item-properties-separator-width)); 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/components/list-item-properties/list-item-properties.tsx: -------------------------------------------------------------------------------- 1 | import { Component, ComponentInterface, h, Host } from '@stencil/core'; 2 | 3 | /** 4 | * The list-item-properties is a subcomponent of `wcs-list-item`. It represents a wrapper for a list of several `wcs-property`. 5 | * 6 | * @slot property - Slot containing the `` elements 7 | * 8 | * @cssprop --wcs-list-item-properties-margin-bottom - Margin bottom of the properties 9 | * @cssprop --wcs-list-item-properties-gap - Gap between all list item properties 10 | * @cssprop --wcs-list-item-properties-separator-width - Separator width between all list item properties 11 | * @cssprop --wcs-list-item-properties-separator-color - Separator color between all list item properties 12 | */ 13 | @Component({ 14 | tag: 'wcs-list-item-properties', 15 | styleUrl: 'list-item-properties.scss', 16 | shadow: true 17 | }) 18 | export class ListItemProperties implements ComponentInterface { 19 | render() { 20 | return ( 21 | 22 | 23 | 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/components/list-item-properties/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-list-item-properties 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | The list-item-properties is a subcomponent of `wcs-list-item`. It represents a wrapper for a list of several `wcs-property`. 11 | 12 | ## Slots 13 | 14 | | Slot | Description | 15 | | ------------ | --------------------------------------------- | 16 | | `"property"` | Slot containing the `` elements | 17 | 18 | 19 | ---------------------------------------------- 20 | 21 | *Built with [StencilJS](https://stenciljs.com/)* 22 | -------------------------------------------------------------------------------- /src/components/list-item-property/list-item-property.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | --wcs-list-item-property-font-weight: var(--wcs-semantic-font-weight-medium); 3 | --wcs-list-item-property-color: var(--wcs-semantic-color-text-secondary); 4 | 5 | font-weight: var(--wcs-list-item-property-font-weight); 6 | color: var(--wcs-list-item-property-color); 7 | } 8 | -------------------------------------------------------------------------------- /src/components/list-item-property/list-item-property.tsx: -------------------------------------------------------------------------------- 1 | import { Component, ComponentInterface, h, Host } from '@stencil/core'; 2 | 3 | /** 4 | * The list-item-property is a subcomponent of `wcs-list-item`. 5 | * Wrapped in a `wcs-list-item-properties`, it represents a property to describe an item. 6 | * 7 | * @slot - Main container slot 8 | * 9 | * @cssprop --wcs-list-item-property-font-weight - Font weight of the property 10 | * @cssprop --wcs-list-item-property-color - Color of the property 11 | */ 12 | @Component({ 13 | tag: 'wcs-list-item-property', 14 | styleUrl: 'list-item-property.scss', 15 | shadow: true 16 | }) 17 | export class ListItemProperty implements ComponentInterface { 18 | render() { 19 | return ( 20 | 21 | 22 | 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/components/list-item-property/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-list-item-property 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | The list-item-property is a subcomponent of `wcs-list-item`. 11 | Wrapped in a `wcs-list-item-properties`, it represents a property to describe an item. 12 | 13 | ## Slots 14 | 15 | | Slot | Description | 16 | | ------------- | ------------------- | 17 | | `""` | Main container slot | 18 | 19 | 20 | ---------------------------------------------- 21 | 22 | *Built with [StencilJS](https://stenciljs.com/)* 23 | -------------------------------------------------------------------------------- /src/components/mat-icon/mat-icon-interface.tsx: -------------------------------------------------------------------------------- 1 | export type MaterialIconFamily = 'filled' | 'outlined' | 'twotone' | 'rounded' | 'sharp'; 2 | 3 | export type MaterialIconSize = 's' | 'm' | 'l' | 'xl'; 4 | -------------------------------------------------------------------------------- /src/components/mat-icon/mat-icon.scss: -------------------------------------------------------------------------------- 1 | @use 'mat-icon-google-stylesheets'; 2 | 3 | :host { 4 | display: flex; 5 | flex-direction: column; 6 | justify-content: center; 7 | 8 | .size-s { 9 | font-size: 18px !important; 10 | } 11 | 12 | .size-m { 13 | font-size: 24px !important; 14 | } 15 | 16 | .size-l { 17 | font-size: 36px !important; 18 | } 19 | 20 | .size-xl { 21 | font-size: 48px !important; 22 | } 23 | 24 | @include mat-icon-google-stylesheets.material-icons-classes 25 | } 26 | -------------------------------------------------------------------------------- /src/components/modal/modal-interface.ts: -------------------------------------------------------------------------------- 1 | export type ModalSize = 's' | 'm' | 'l' | 'xl'; 2 | -------------------------------------------------------------------------------- /src/components/native-select/native-select-interface.ts: -------------------------------------------------------------------------------- 1 | import { WcsSize } from "../../shared-types"; 2 | 3 | export type WcsNativeSelectSize = Extract; 4 | -------------------------------------------------------------------------------- /src/components/nav-item/readme.md: -------------------------------------------------------------------------------- 1 | # Nav Item 2 | 3 | 4 | 5 | 6 | 7 | ## Overview 8 | 9 | The nav-item component is a subcomponent of `wcs-nav` and should always be used inside it. 10 | They contain links to navigate to other pages of the website. 11 | 12 | ---------------------------------------------- 13 | 14 | *Built with [StencilJS](https://stenciljs.com/)* 15 | -------------------------------------------------------------------------------- /src/components/nav/nav.scss: -------------------------------------------------------------------------------- 1 | @import '../../style/breakpoints'; 2 | 3 | :host { 4 | --wcs-nav-background-color: var(--wcs-semantic-color-background-surface-brand); 5 | --wcs-nav-width-desktop: calc(12 * var(--wcs-semantic-size-base)); 6 | --wcs-nav-height-mobile: calc(6 * var(--wcs-semantic-size-base)); 7 | } 8 | 9 | nav { 10 | background-color: var(--wcs-nav-background-color); 11 | display: flex; 12 | z-index: 1055; 13 | flex-direction: column; 14 | width: var(--wcs-nav-width-desktop); 15 | height: 100%; 16 | 17 | div[role="list"] { 18 | list-style-type: none; 19 | display: flex; 20 | flex-direction: column; 21 | flex-grow: 1; 22 | 23 | @include for-tablet-landscape-down { 24 | flex-direction: row; 25 | } 26 | } 27 | 28 | @include for-tablet-landscape-down { 29 | flex-direction: row; 30 | width: 100%; 31 | height: var(--wcs-nav-height-mobile); 32 | } 33 | } 34 | 35 | ::slotted(wcs-nav-item) { 36 | @include for-tablet-landscape-down { 37 | flex: 1; 38 | } 39 | } 40 | 41 | // Place bottom items at the bottom 42 | slot[name=bottom], 43 | // Same for ff < 63 44 | wcs-nav-item:not([slot=bottom]) + wcs-nav-item[slot=bottom] { 45 | @include for-desktop-up { 46 | display: block; 47 | margin-top: auto; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/components/nav/readme.md: -------------------------------------------------------------------------------- 1 | # Nav 2 | 3 | 4 | 5 | 6 | ## Overview 7 | 8 | The nav component is a container for navigation links to other pages of the website. 9 | 10 | ## Methods 11 | 12 | ### `setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) => Promise` 13 | 14 | 15 | 16 | #### Parameters 17 | 18 | | Name | Type | Description | 19 | | ------- | ---------------------------- | ----------- | 20 | | `attr` | `"role" \| `aria-${string}`` | | 21 | | `value` | `string` | | 22 | 23 | #### Returns 24 | 25 | Type: `Promise` 26 | 27 | 28 | 29 | 30 | ## Slots 31 | 32 | | Slot | Description | 33 | | ---------------------------------------------------------------- | ----------- | 34 | | `"bottom Bottom part of the nav to put to nav-items at the end"` | | 35 | 36 | 37 | ---------------------------------------------- 38 | 39 | *Built with [StencilJS](https://stenciljs.com/)* 40 | -------------------------------------------------------------------------------- /src/components/radio-group/radio-group-interface.ts: -------------------------------------------------------------------------------- 1 | export interface RadioGroupChangeEventDetail { 2 | value: any | any[] | undefined | null; 3 | } 4 | 5 | export type RadioGroupMode = 'radio' | 'option' | 'horizontal'; 6 | -------------------------------------------------------------------------------- /src/components/radio-group/radio-group.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | display: flex; 3 | 4 | // region Radio 5 | --wcs-radio-group-gap: var(--wcs-semantic-spacing-base); 6 | // endregion 7 | 8 | // region Option 9 | --wcs-radio-group-option-height: var(--wcs-semantic-size-m); 10 | --wcs-radio-group-option-gap: var(--wcs-semantic-spacing-small); 11 | --wcs-radio-group-option-padding: var(--wcs-semantic-spacing-small) var(--wcs-semantic-spacing-small); 12 | --wcs-radio-group-option-border-radius: var(--wcs-semantic-border-radius-base); 13 | --wcs-radio-group-option-background-color: var(--wcs-semantic-color-background-surface-accent-lightest); 14 | // endregion 15 | } 16 | 17 | :host([mode=radio]) { 18 | flex-direction: column; 19 | gap: var(--wcs-radio-group-gap); 20 | } 21 | 22 | :host([mode=option]) { 23 | box-sizing: border-box; 24 | height: var(--wcs-radio-group-option-height); 25 | display: inline-flex; 26 | flex-direction: row; 27 | align-items: center; 28 | gap: var(--wcs-radio-group-option-gap); 29 | padding: var(--wcs-radio-group-option-padding); 30 | background-color: var(--wcs-radio-group-option-background-color); 31 | border-radius: var(--wcs-radio-group-option-border-radius); 32 | } 33 | 34 | :host([mode=horizontal]) { 35 | justify-content: space-between; 36 | } 37 | -------------------------------------------------------------------------------- /src/components/radio/radio-interface.ts: -------------------------------------------------------------------------------- 1 | export interface RadioValue { 2 | value: any | any[] | undefined | null; 3 | label: string; 4 | } 5 | 6 | export interface RadioChosedEvent extends RadioValue { 7 | source: HTMLWcsRadioElement; 8 | } 9 | -------------------------------------------------------------------------------- /src/components/select-option/select-option-interface.ts: -------------------------------------------------------------------------------- 1 | export interface SelectOptionValue { 2 | value: any | any[] | undefined | null; 3 | displayText: string; 4 | chipColor?: string; 5 | chipBackgroundColor?: string; 6 | } 7 | 8 | export interface SelectOptionChosedEvent extends SelectOptionValue { 9 | source: HTMLWcsSelectOptionElement; 10 | } 11 | -------------------------------------------------------------------------------- /src/components/select/select-interface.ts: -------------------------------------------------------------------------------- 1 | import { WcsSize } from "../../shared-types"; 2 | 3 | export interface SelectChangeEventDetail { 4 | value: any | any[] | undefined | null; 5 | } 6 | 7 | export interface SelectFilterChangeEventDetail { 8 | value: string | number | undefined | null; 9 | } 10 | 11 | export type WcsSelectFilterFn = (optionEl: HTMLWcsSelectOptionElement, filter: string) => boolean; 12 | 13 | /** 14 | * Default filtering function. Compares the string start of wcs-select-option element's text content 15 | * with your filter input. 16 | * @param optionEl - wcs-select-option element 17 | * @param filter - input filter field value 18 | * @constructor 19 | */ 20 | export const WcsDefaultSelectFilterFn: WcsSelectFilterFn = (optionEl, filter): boolean => { 21 | return optionEl.textContent.toLowerCase().startsWith(filter.toLowerCase()); 22 | } 23 | 24 | export const WcsSelectSizeValue = ['m', 'l'] as const; // as const keyword is used to infer and preserve the exact literal values of an array or object. 25 | 26 | export type WcsSelectSize = Extract; 27 | 28 | export function isWcsSelectSize(size: string): size is WcsSelectSize { 29 | // @ts-ignore : ignore size type, as it is checked with WcsInputSizeValues 30 | return WcsSelectSizeValue.includes(size); 31 | } 32 | -------------------------------------------------------------------------------- /src/components/skeleton-circle/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-skeleton-circle 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | Use a skeleton circle as a placeholder round images, illustrations or components 11 | 12 | ## Properties 13 | 14 | | Property | Attribute | Description | Type | Default | 15 | | ----------- | ----------- | ---------------------------------------- | ------------------------------ | --------- | 16 | | `animation` | `animation` | Specifies the animation of the skeleton | `"glide" \| "none" \| "pulse"` | `'glide'` | 17 | | `radius` | `radius` | Specifies the radius of the circle in px | `number` | `50` | 18 | 19 | 20 | ---------------------------------------------- 21 | 22 | *Built with [StencilJS](https://stenciljs.com/)* 23 | -------------------------------------------------------------------------------- /src/components/skeleton-circle/skeleton-circle.scss: -------------------------------------------------------------------------------- 1 | @import "../skeleton/skeleton.scss"; 2 | 3 | :host { 4 | --wcs-skeleton-circle-border-radius: var(--wcs-semantic-border-radius-full); 5 | 6 | aspect-ratio: 1/1; 7 | border-radius: var(--wcs-skeleton-circle-border-radius); 8 | } 9 | -------------------------------------------------------------------------------- /src/components/skeleton-rectangle/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-skeleton-rectangle 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | Use a skeleton rectangle as a placeholder for large images or square-shaped components 11 | 12 | ## Properties 13 | 14 | | Property | Attribute | Description | Type | Default | 15 | | ----------- | ----------- | ----------------------------------------------------------------- | ----------------------------------------- | --------- | 16 | | `animation` | `animation` | Specifies the animation of the skeleton | `"glide" \| "none" \| "pulse"` | `'glide'` | 17 | | `height` | `height` | Specifies the height of the skeleton (can be any valid CSS value) | `LengthOrPercentage \| Keyword \| Global` | `'auto'` | 18 | | `rounded` | `rounded` | Adds a border radius on the skeleton if true | `boolean` | `false` | 19 | | `width` | `width` | Specifies the width of the skeleton (can be any valid CSS value) | `LengthOrPercentage \| Keyword \| Global` | `'auto'` | 20 | 21 | 22 | ---------------------------------------------- 23 | 24 | *Built with [StencilJS](https://stenciljs.com/)* 25 | -------------------------------------------------------------------------------- /src/components/skeleton-rectangle/skeleton-rectangle.scss: -------------------------------------------------------------------------------- 1 | @import "../skeleton/skeleton.scss"; 2 | 3 | :host { 4 | --wcs-skeleton-border-radius: 0rem; 5 | 6 | span { 7 | border-radius: var(--wcs-skeleton-border-radius); 8 | } 9 | } 10 | 11 | :host([rounded]) { 12 | --wcs-skeleton-border-radius: var(--wcs-semantic-border-radius-base); 13 | } 14 | -------------------------------------------------------------------------------- /src/components/skeleton-text/readme.md: -------------------------------------------------------------------------------- 1 | # wcs-skeleton-text 2 | 3 | 4 | 5 | 6 | 7 | 8 | ## Overview 9 | 10 | Use a skeleton text as a placeholder for titles or paragraphs. 11 | 12 | ## Properties 13 | 14 | | Property | Attribute | Description | Type | Default | 15 | | ----------- | ----------- | ---------------------------------------------- | --------------------------------------------- | --------- | 16 | | `animation` | `animation` | Specifies the animation of the skeleton | `"glide" \| "none" \| "pulse"` | `'glide'` | 17 | | `height` | `height` | Specifies the line height of the text skeleton | `"body" \| "caption" \| "h1" \| "h2" \| "h3"` | `'body'` | 18 | 19 | 20 | ---------------------------------------------- 21 | 22 | *Built with [StencilJS](https://stenciljs.com/)* 23 | -------------------------------------------------------------------------------- /src/components/skeleton-text/skeleton-text.scss: -------------------------------------------------------------------------------- 1 | @import "../skeleton/skeleton.scss"; 2 | 3 | :host { 4 | --wcs-skeleton-text-height: var(--wcs-semantic-font-size-base); 5 | --wcs-skeleton-text-height-h1: var(--wcs-semantic-font-size-heading-1); 6 | --wcs-skeleton-text-height-h2: var(--wcs-semantic-font-size-heading-2); 7 | --wcs-skeleton-text-height-h3: var(--wcs-semantic-font-size-heading-3); 8 | --wcs-skeleton-text-height-body: var(--wcs-semantic-font-size-body-3); 9 | --wcs-skeleton-text-height-caption: var(--wcs-semantic-font-size-caption-1); 10 | } 11 | 12 | :host([height=h1]) { 13 | height: var(--wcs-skeleton-text-height-h1); 14 | } 15 | 16 | :host([height=h2]) { 17 | height: var(--wcs-skeleton-text-height-h2); 18 | } 19 | 20 | :host([height=h3]) { 21 | height: var(--wcs-skeleton-text-height-h3); 22 | } 23 | 24 | :host([height=body]) { 25 | height: var(--wcs-skeleton-text-height-body); 26 | } 27 | 28 | :host([height=caption]) { 29 | height: var(--wcs-skeleton-text-height-caption); 30 | } 31 | -------------------------------------------------------------------------------- /src/components/skeleton/skeleton-interface.ts: -------------------------------------------------------------------------------- 1 | export type WcsSkeletonAnimation = 'none' | 'glide' | 'pulse'; 2 | -------------------------------------------------------------------------------- /src/components/spinner/spinner-interface.ts: -------------------------------------------------------------------------------- 1 | export type WcsSpinnerMode = 'border' | 'growing'; 2 | -------------------------------------------------------------------------------- /src/components/switch/switch-interface.ts: -------------------------------------------------------------------------------- 1 | export interface SwitchChangeEventDetail { 2 | checked: boolean; 3 | } 4 | 5 | export type SwitchLabelAlignment = 'top' | 'center' | 'bottom'; 6 | 7 | -------------------------------------------------------------------------------- /src/components/tab/readme.md: -------------------------------------------------------------------------------- 1 | # Tab 2 | 3 | 4 | 5 | 6 | ## Overview 7 | 8 | Tab content component. 9 | Use this component to specify the content of a component. 10 | 11 | ## Properties 12 | 13 | | Property | Attribute | Description | Type | Default | 14 | | --------- | ---------- | ------------------------------------------------- | -------- | ----------- | 15 | | `header` | `header` | The header you want to be displayed for this tab. | `string` | `undefined` | 16 | | `itemKey` | `item-key` | The id of the tab. It should be unique. | `any` | `undefined` | 17 | 18 | 19 | ## Events 20 | 21 | | Event | Description | Type | 22 | | ----------- | ---------------------------------------- | ------------------- | 23 | | `tabLoaded` | Do not use, meant for internal use only. | `CustomEvent` | 24 | 25 | 26 | ---------------------------------------------- 27 | 28 | *Built with [StencilJS](https://stenciljs.com/)* 29 | -------------------------------------------------------------------------------- /src/components/tab/tab.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | display: block; 3 | } 4 | 5 | :host([hidden]) { 6 | display: none; 7 | } 8 | -------------------------------------------------------------------------------- /src/components/tab/tab.tsx: -------------------------------------------------------------------------------- 1 | import { Component, Prop, h, Host, Event, EventEmitter, ComponentInterface } from '@stencil/core'; 2 | 3 | /** 4 | * Tab content component. 5 | * Use this component to specify the content of a component. 6 | */ 7 | @Component({ 8 | tag: 'wcs-tab', 9 | styleUrl: 'tab.scss', 10 | shadow: true, 11 | }) 12 | export class Tab implements ComponentInterface { 13 | /** 14 | * The header you want to be displayed for this tab. 15 | */ 16 | @Prop({ reflect: true }) header: string; 17 | 18 | /** 19 | * The id of the tab. It should be unique. 20 | */ 21 | @Prop() itemKey: any; 22 | 23 | // TODO: See if there is a solution that doesn't pollute the API. 24 | /** 25 | * Do not use, meant for internal use only. 26 | * @inner 27 | * @ignore 28 | */ 29 | @Event() 30 | tabLoaded!: EventEmitter; 31 | 32 | componentDidLoad() { 33 | this.tabLoaded.emit(); 34 | } 35 | 36 | render() { 37 | return ( 38 | 39 | 40 | 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/components/tabs/tabs-interface.ts: -------------------------------------------------------------------------------- 1 | export type WcsTabsAlignment = 'start' | 'center' | 'end'; 2 | 3 | export interface WcsTabChangeEvent { 4 | tabName: string; 5 | tabIndex: number; 6 | selectedKey: any; 7 | } 8 | -------------------------------------------------------------------------------- /src/components/textarea/textarea-interface.ts: -------------------------------------------------------------------------------- 1 | export interface TextareaChangeEventDetail { 2 | value: string | undefined | null; 3 | } 4 | 5 | export type WcsTextareaInputMode = 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'; 6 | 7 | export type WcsTextareaEnterKeyHint = 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'; 8 | 9 | export type WcsTextareaResize = 'both' | 'none' | 'vertical' | 'horizontal'; 10 | 11 | export type WcsTextareaInputState = 'initial' | 'error'; 12 | 13 | export type WcsTextareaWrap = 'hard' | 'soft' | 'off'; 14 | -------------------------------------------------------------------------------- /src/components/tooltip/tooltip-interface.ts: -------------------------------------------------------------------------------- 1 | export type WcsTooltipPosition = 'top' | 'bottom' | 'right' | 'left'; 2 | export type WcsTooltipAppendTo = Element | 'parent' | ((ref: Element) => Element); -------------------------------------------------------------------------------- /src/components/tooltip/tooltip.scss: -------------------------------------------------------------------------------- 1 | /* Tippy stylesheet and specific styles are imported in the global tooltip.scss file */ 2 | 3 | :host { 4 | display: none; 5 | } 6 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './components'; 2 | export * from './shared-types'; 3 | -------------------------------------------------------------------------------- /src/style/breakpoints.scss: -------------------------------------------------------------------------------- 1 | // Based on this article https://www.freecodecamp.org/news/the-100-correct-way-to-do-css-breakpoints-88d6a5ba1862/ 2 | // TODO: Verify this is working with the resolution we have at SNCF 3 | 4 | $wcs-phone-breakpoint-max-width: 575px; 5 | $wcs-tablet-portrait-breakpoint-min-width: 576px; 6 | $wcs-tablet-landscape-breakpoint-min-width: 900px; 7 | $wcs-tablet-landscape-breakpoint-max-width: 1199px; 8 | $wcs-desktop-breakpoint-min-width: 1200px; 9 | $wcs-big-desktop-breakpoint-min-width: 1800px; 10 | 11 | @mixin for-phone-only { 12 | @media (max-width: $wcs-phone-breakpoint-max-width) { @content; } 13 | } 14 | 15 | /// 600 -> 900 16 | /// This is a doc comment :/ 17 | @mixin for-tablet-portrait-up { 18 | @media (min-width: $wcs-tablet-portrait-breakpoint-min-width) { @content; } 19 | } 20 | 21 | @mixin for-tablet-landscape-up { 22 | @media (min-width: $wcs-tablet-landscape-breakpoint-min-width) { @content; } 23 | } 24 | 25 | @mixin for-tablet-landscape-down { 26 | @media (max-width: $wcs-tablet-landscape-breakpoint-max-width) { @content; } 27 | } 28 | 29 | @mixin for-desktop-up { 30 | @media (min-width: $wcs-desktop-breakpoint-min-width) { @content; } 31 | } 32 | 33 | @mixin for-big-desktop-up { 34 | @media (min-width: $wcs-big-desktop-breakpoint-min-width) { @content; } 35 | } 36 | -------------------------------------------------------------------------------- /src/style/focus-outline.scss: -------------------------------------------------------------------------------- 1 | /** 2 | Applies all the outline properties useful to show a dashed-focus ring around a component. 3 | TODO: replace `$border-radius: 0.1rem` with semantic border-radius but keep in mind some components that must stay at 2px border-radius: checkbox, radio, links, ... 4 | */ 5 | @mixin focus-outline 6 | ( $outline-color: var(--wcs-semantic-color-border-focus-base) 7 | , $border-radius: 0.1rem 8 | , $outline-offset: var(--wcs-semantic-spacing-small) 9 | , $border-width: var(--wcs-semantic-border-width-large) 10 | ) { 11 | outline: $border-width dashed $outline-color; 12 | outline-offset: $outline-offset; 13 | border-radius: $border-radius; 14 | } 15 | -------------------------------------------------------------------------------- /src/style/overlay.scss: -------------------------------------------------------------------------------- 1 | $over9999: 9999999; 2 | 3 | .wcs-overlay { 4 | height: 100vh; 5 | width: 100vw; 6 | pointer-events: none; 7 | top: 0; 8 | position: absolute; 9 | z-index: $over9999; 10 | } 11 | -------------------------------------------------------------------------------- /src/style/placeholder.scss: -------------------------------------------------------------------------------- 1 | @mixin placeholder($color: var(--wcs-semantic-color-text-tertiary), $font-weight: 300, $font-style: var(--wcs-semantic-font-style-form-field-placeholder, italic)) { 2 | color: $color; 3 | opacity: 1; 4 | font-weight: $font-weight; 5 | font-style: $font-style; 6 | } 7 | -------------------------------------------------------------------------------- /src/utils/mutable-aria-attribute.ts: -------------------------------------------------------------------------------- 1 | export type AriaAttributeName = `aria-${string}` | 'role'; 2 | 3 | export interface MutableAriaAttribute { 4 | setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined): void; 5 | } 6 | 7 | export function isMutableAriaAttribute(el: any): el is MutableAriaAttribute { 8 | if (typeof el !== 'object' || el === null || el === undefined) return false; 9 | return 'setAriaAttribute' in el; 10 | } 11 | -------------------------------------------------------------------------------- /src/utils/overlay.ts: -------------------------------------------------------------------------------- 1 | let overlayElement: HTMLElement; 2 | 3 | export function getOverlay() { 4 | if (!overlayElement) { 5 | createOverlay(); 6 | } 7 | return overlayElement; 8 | } 9 | 10 | function createOverlay() { 11 | const existent = document.querySelector('.wcs-overlay') as HTMLElement; 12 | overlayElement = existent 13 | ? existent 14 | : document.createElement('div'); 15 | overlayElement.classList.add('wcs-overlay'); 16 | document.body.appendChild(overlayElement); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/utils/tests.ts: -------------------------------------------------------------------------------- 1 | import { SerializedAXNode } from 'puppeteer'; 2 | import { E2EPage } from "@stencil/core/testing"; 3 | 4 | export const findFocusedNode = (node: SerializedAXNode): SerializedAXNode => { 5 | if (node.focused) { 6 | return node; 7 | } 8 | 9 | for (const child of node.children || []) { 10 | const focusedNode = findFocusedNode(child); 11 | if (focusedNode) { 12 | return focusedNode; 13 | } 14 | } 15 | } 16 | 17 | // Add sncf-holding class to body and add sncf-holding.css to the page after setting the content 18 | export async function setWcsContent(page: E2EPage, content: string) { 19 | await page.setContent(content); 20 | await page.evaluate(() => { 21 | document.body.classList.add('sncf-holding'); 22 | }) 23 | await page.addStyleTag({ 24 | path: './design-tokens/dist/sncf-holding.css', 25 | }); 26 | await page.waitForChanges(); 27 | } 28 | -------------------------------------------------------------------------------- /stories/assets/images/Cover-Design-Tokens.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/Cover-Design-Tokens.webp -------------------------------------------------------------------------------- /stories/assets/images/accessibility-contrast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/accessibility-contrast.png -------------------------------------------------------------------------------- /stories/assets/images/accessibility.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /stories/assets/images/components-overview/accordion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/accordion.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/actionbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/actionbar.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/badge.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/breadcrumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/breadcrumb.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/button.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/card.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/checkbox.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/com-nav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/com-nav.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/counter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/counter.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/divider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/divider.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/dropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/dropdown.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/editable-field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/editable-field.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/field.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/footer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/footer.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/form-field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/form-field.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/galactic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/galactic.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/grid.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/header.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/horizontalstepper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/horizontalstepper.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/input.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/list-item.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/list-item.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/mat-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/mat-icon.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/modal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/modal.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/native-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/native-select.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/nav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/nav.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/progress-bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/progress-bar.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/progress-radial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/progress-radial.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/radio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/radio.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/select.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/skeleton.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/skeleton.gif -------------------------------------------------------------------------------- /stories/assets/images/components-overview/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/spinner.gif -------------------------------------------------------------------------------- /stories/assets/images/components-overview/switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/switch.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/tabs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/tabs.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/textarea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/textarea.png -------------------------------------------------------------------------------- /stories/assets/images/components-overview/tooltip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/components-overview/tooltip.png -------------------------------------------------------------------------------- /stories/assets/images/cover.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/cover.webp -------------------------------------------------------------------------------- /stories/assets/images/form-example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/form-example1.png -------------------------------------------------------------------------------- /stories/assets/images/form-example2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/form-example2.png -------------------------------------------------------------------------------- /stories/assets/images/gitlab-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/gitlab-logo.png -------------------------------------------------------------------------------- /stories/assets/images/npm-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/npm-logo.png -------------------------------------------------------------------------------- /stories/assets/images/sncf-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/sncf-logo.png -------------------------------------------------------------------------------- /stories/assets/images/train_autumn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/train_autumn.jpg -------------------------------------------------------------------------------- /stories/assets/images/train_spring.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/train_spring.jpg -------------------------------------------------------------------------------- /stories/assets/images/train_summer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/train_summer.jpg -------------------------------------------------------------------------------- /stories/assets/images/train_winter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/train_winter.jpg -------------------------------------------------------------------------------- /stories/assets/images/wcs-logo-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/wcs-logo-black.png -------------------------------------------------------------------------------- /stories/assets/images/wcs-logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/assets/images/wcs-logo-white.png -------------------------------------------------------------------------------- /stories/components/accordion/accordion-content.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryFn, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | 4 | const meta: Meta = { 5 | title: 'Components/Accordion/Accordion Content', 6 | component: 'wcs-accordion-content' 7 | }; 8 | 9 | export default meta; 10 | const Template: StoryFn> = () => html``; 11 | export const Default: StoryObj = Template.bind({}); 12 | -------------------------------------------------------------------------------- /stories/components/accordion/accordion-header.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryFn, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | 4 | const meta: Meta = { 5 | title: 'Components/Accordion/Accordion Header', 6 | component: 'wcs-accordion-header', 7 | }; 8 | 9 | export default meta; 10 | 11 | const Template: StoryFn> = () => html``; 12 | export const Default: StoryObj = Template.bind({}); 13 | -------------------------------------------------------------------------------- /stories/components/accordion/accordion-panel.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryFn, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | import { getComponentArgs } from '../../utils/args-generation'; 4 | 5 | const meta: Meta = { 6 | title: 'Components/Accordion/Accordion Panel', 7 | component: 'wcs-accordion-panel', 8 | argTypes: getComponentArgs('wcs-accordion-panel'), 9 | }; 10 | 11 | export default meta; 12 | 13 | const Template: StoryFn> = () => html``; 14 | export const Default: StoryObj = Template.bind({}); 15 | -------------------------------------------------------------------------------- /stories/components/action-bar/tab-inside-documentation.md: -------------------------------------------------------------------------------- 1 | The tabs gutter should be added for applications that use the communication design system but not for the business one. 2 | 3 | If you add tabs in the action slot of the `wcs-action-bar` component (especially in the case of an application using the 4 | communication's design system), you must enable the gutter of the `wcs-action-bar` component and disable the gutter attribute 5 | on the `wcs-tabs` component so the border applies fill the available width of the page. 6 | -------------------------------------------------------------------------------- /stories/components/breadcrumb/breadcrumb-item.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | 4 | import { getComponentArgs } from '../../utils/args-generation'; 5 | 6 | const meta: Meta = { 7 | title: 'Components/Breadcrumb/Breadcrumb Item', 8 | component: 'wcs-breadcrumb-item', 9 | argTypes: { 10 | ...getComponentArgs('wcs-breadcrumb-item'), 11 | text: { 12 | description: 'The text node you put inside the slotted anchor', 13 | type: 'string', 14 | }, 15 | href: { 16 | description: 'The href attribut you put on the slotted anchor', 17 | type: 'string', 18 | } 19 | } 20 | }; 21 | export default meta; 22 | 23 | type BreadcrumbItemStoryArgs = { 24 | text: string; 25 | href?: string; 26 | }; 27 | 28 | const handleItemClick = (e: MouseEvent) => { 29 | e.preventDefault(); 30 | }; 31 | 32 | export const Default: StoryObj = { 33 | render: (args: BreadcrumbItemStoryArgs) => html` 34 | 35 | 36 | ${args.text} 37 | 38 | 39 | `, 40 | args: { 41 | text: 'Accueil', 42 | href: '/' 43 | } 44 | }; 45 | -------------------------------------------------------------------------------- /stories/components/card/card-body.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryFn, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | 4 | const meta: Meta = { 5 | title: 'Components/Card/Card Body', 6 | component: 'wcs-card-body', 7 | }; 8 | 9 | export default meta; 10 | 11 | const Template: StoryFn> = () => html``; 12 | export const Default: StoryObj = Template.bind({}); 13 | -------------------------------------------------------------------------------- /stories/components/com-nav/com-nav-item.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta } from '@storybook/web-components'; 2 | import { getComponentArgs } from '../../utils/args-generation'; 3 | import { html } from "lit-html"; 4 | 5 | const meta: Meta = { 6 | title: 'Components/DS Communication/Nav/Com Nav Item', 7 | component: 'wcs-com-nav-item', 8 | argTypes: getComponentArgs('wcs-com-nav-item'), 9 | }; 10 | 11 | export default meta; 12 | 13 | export const Default = { 14 | render: () => html` 15 | 16 | ev.preventDefault()}>Link 17 | 18 | `, 19 | } 20 | -------------------------------------------------------------------------------- /stories/components/com-nav/com-nav-submenu.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | import { getComponentArgs } from '../../utils/args-generation'; 4 | 5 | const meta: Meta = { 6 | title: 'Components/DS Communication/Nav/Com Nav Submenu', 7 | component: 'wcs-com-nav-submenu', 8 | argTypes: getComponentArgs('wcs-com-nav-submenu'), 9 | }; 10 | 11 | export default meta; 12 | 13 | export const Default = { 14 | render: () => html` 15 | 16 | 19 | 20 | 21 |
23 | Contenu du site 24 |
25 | `, 26 | } 27 | -------------------------------------------------------------------------------- /stories/components/divider/divider.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryFn } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | import { getComponentArgs } from '../../utils/args-generation'; 4 | 5 | const meta: Meta = { 6 | title: 'Components/Divider', 7 | component: 'wcs-divider', 8 | argTypes: getComponentArgs('wcs-divider'), 9 | }; 10 | export default meta; 11 | 12 | const Template: StoryFn = () => html` 13 |

Text before divider

14 | 15 |

Text after divider

16 | `; 17 | 18 | const DividerInCardTemplate: StoryFn = () => html` 19 | 20 | 21 | Before divider 22 | 23 | 24 | 25 | After divider 26 | 27 | 28 | `; 29 | 30 | export const Default = Template.bind({}); 31 | Default.args = {}; 32 | 33 | export const DividerInCard = DividerInCardTemplate.bind({}); 34 | DividerInCard.args = {}; 35 | -------------------------------------------------------------------------------- /stories/components/dropdown/dropdown-divider.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | 4 | const meta: Meta = { 5 | title: 'Components/Dropdown/Subcomponents/Dropdown Divider', 6 | component: 'wcs-dropdown-divider', 7 | }; 8 | 9 | export default meta; 10 | 11 | 12 | export const Default: StoryObj = { 13 | render: () => html` 14 |
15 |
16 | 17 | Dropdown 18 | Premier item 19 | 20 | Second item 21 | 22 |
23 |
24 | ` 25 | } 26 | -------------------------------------------------------------------------------- /stories/components/dropdown/dropdown-header.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | 4 | const meta: Meta = { 5 | title: 'Components/Dropdown/Subcomponents/Dropdown Header', 6 | component: 'wcs-dropdown-header', 7 | }; 8 | 9 | export default meta; 10 | 11 | export const Default: StoryObj = { 12 | render: () => html` 13 |
14 |
15 | 16 | Dropdown 17 | ACTION HEADER GROUP 1 18 | Item 1 group 1 19 | Item 2 group 1 20 | 21 |
22 |
23 | ` 24 | } 25 | -------------------------------------------------------------------------------- /stories/components/dropdown/dropdown-item.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | import { DropdownStoryArgs } from "./dropdown.stories"; 4 | import { getComponentArgs } from "../../utils/args-generation"; 5 | 6 | const meta: Meta = { 7 | title: 'Components/Dropdown/Subcomponents/Dropdown Item', 8 | component: 'wcs-dropdown-item', 9 | argTypes: getComponentArgs('wcs-dropdown-item') 10 | }; 11 | 12 | export default meta; 13 | 14 | export const Default: StoryObj = { 15 | render: () => html` 16 |
17 |
18 | 19 | Dropdown 20 | Action 1 21 | Action 2 22 | 23 |
24 |
25 | ` 26 | } 27 | -------------------------------------------------------------------------------- /stories/components/field/field-content.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryFn, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | import { getComponentArgs } from "../../utils/args-generation"; 4 | 5 | const meta: Meta = { 6 | title: 'Components/Field/Field Content', 7 | component: 'wcs-field-content', 8 | argTypes: getComponentArgs('wcs-field-content'), 9 | }; 10 | 11 | export default meta; 12 | 13 | export const Default = { 14 | render: () => html` 15 | 16 | Le nom du champ 17 | 18 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec massa mi, hendrerit dictum dui sed, porttitor ullamcorper diam. 👈 (This is the field content) 19 | 20 | 21 | 22 | Autre label 23 | In hac habitasse platea dictumst. 👈 (This is the field content) 24 | 25 | `, 26 | } 27 | -------------------------------------------------------------------------------- /stories/components/field/field-label.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryFn, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | import { getComponentArgs } from "../../utils/args-generation"; 4 | 5 | const meta: Meta = { 6 | title: 'Components/Field/Field Label', 7 | component: 'wcs-field-label', 8 | argTypes: getComponentArgs('wcs-field-label'), 9 | }; 10 | 11 | export default meta; 12 | 13 | export const Default = { 14 | render: () => html` 15 | 16 | Le nom du champ 👈 (This is the field label) 17 | 18 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec massa mi, hendrerit dictum dui sed, porttitor ullamcorper diam. 19 | 20 | 21 | 22 | Autre label 👈 (This is the field label) 23 | In hac habitasse platea dictumst. 24 | 25 | `, 26 | } 27 | -------------------------------------------------------------------------------- /stories/components/field/field.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta } from '@storybook/web-components'; 2 | 3 | // @ts-ignore 4 | import fieldDocumentation from './field-documentation.md' 5 | import { html } from 'lit-html'; 6 | import { getComponentArgs } from "../../utils/args-generation"; 7 | 8 | const meta: Meta = { 9 | title: 'Components/Field', 10 | component: 'wcs-field', 11 | argTypes: getComponentArgs('wcs-field'), 12 | subcomponents: { 13 | 'WcsFieldLabel': 'wcs-field-label', 14 | 'WcsFieldContent': 'wcs-field-content', 15 | } 16 | }; 17 | export default meta; 18 | 19 | export const Default = { 20 | render: () => html` 21 | 22 | Le nom du champ 23 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec massa mi, hendrerit dictum 24 | dui 25 | sed, porttitor ullamcorper diam. 26 | 27 | 28 | 29 | Autre label 30 | In hac habitasse platea dictumst. 31 | 32 | `, 33 | } 34 | -------------------------------------------------------------------------------- /stories/components/form-field/error.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | 4 | const meta: Meta = { 5 | title: 'Components/Form Field/Error', 6 | component: 'wcs-error', 7 | }; 8 | 9 | export default meta; 10 | 11 | export const Default: StoryObj = { 12 | render: () => html` 13 | 14 | Full name 15 | 16 | 17 | 18 | 19 | Your name is not valid, please do what is necessary 20 | here. 21 | 22 | 23 | 24 | ` 25 | } 26 | -------------------------------------------------------------------------------- /stories/components/form-field/label.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | 4 | const meta: Meta = { 5 | title: 'Components/Form Field/Label', 6 | component: 'wcs-label', 7 | }; 8 | 9 | export default meta; 10 | 11 | export const Default: StoryObj = { 12 | render: (args) => html` 13 | 14 | Full name 15 | 16 | 17 | `, 18 | args: { 19 | required: false, 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /stories/components/galactic/galactic-documentation.md: -------------------------------------------------------------------------------- 1 | *Part of communication design system* 2 | 3 | This component replaces the vertical navbar for sites and applications that use the communication design system -------------------------------------------------------------------------------- /stories/components/galactic/galactic-menu.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryFn, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | import { getComponentArgs } from '../../utils/args-generation'; 4 | 5 | const meta: Meta = { 6 | title: 'Components/DS Communication/Galactic/Galactic Menu', 7 | component: 'wcs-galactic-menu', 8 | argTypes: getComponentArgs('wcs-galactic-menu'), 9 | }; 10 | 11 | export default meta; 12 | 13 | const Template: StoryFn> = () => html``; 14 | export const Default: StoryObj = Template.bind({}); 15 | -------------------------------------------------------------------------------- /stories/components/list-item/list-item-properties.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | 4 | const meta: Meta = { 5 | title: 'Components/List-item/List-item Properties', 6 | component: 'wcs-list-item-properties', 7 | }; 8 | 9 | export default meta; 10 | 11 | export const Default = { 12 | render: () => html` 13 | 14 | Mise à jour le 4 avril 2017 15 | Entité : SNCF 16 | Agent : Marcel Patoulatchi 17 | `, 18 | } 19 | 20 | -------------------------------------------------------------------------------- /stories/components/list-item/list-item-property.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | 4 | const meta: Meta = { 5 | title: 'Components/List-item/List-item Property', 6 | component: 'wcs-list-item-property', 7 | }; 8 | 9 | export default meta; 10 | 11 | export const Default = { 12 | render: () => html` 13 | Mise à jour le 4 avril 2017 14 | `, 15 | } 16 | -------------------------------------------------------------------------------- /stories/components/nav/nav-item.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | import { classMap } from 'lit-html/directives/class-map.js'; 4 | import { getComponentArgs } from '../../utils/args-generation'; 5 | 6 | const meta: Meta = { 7 | title: 'Components/Nav/Nav Item', 8 | component: 'wcs-nav-item', 9 | argTypes: { 10 | ...getComponentArgs('wcs-nav-item'), 11 | active: { 12 | description: 'Marks the nav-item as active if this class is present' 13 | } 14 | } 15 | }; 16 | 17 | export default meta; 18 | 19 | export const Default: StoryObj = { 20 | render: (args: { text: string, href: string, active: boolean }) => { 21 | 22 | return html` 23 | 24 | 26 | 27 | 28 | ${args.text} 29 | 30 | 31 | 32 | ` 33 | }, 34 | args: { 35 | text: "Favorite", 36 | href: "/favorite", 37 | active: false, 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /stories/components/radio-group/radio.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryFn, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | import { getComponentArgs } from '../../utils/args-generation'; 4 | 5 | const meta: Meta = { 6 | title: 'Components/Radio-group/Radio', 7 | component: 'wcs-radio', 8 | argTypes: getComponentArgs('wcs-radio'), 9 | }; 10 | 11 | export default meta; 12 | 13 | const Template: StoryFn> = () => html``; 14 | export const Default: StoryObj = Template.bind({}); 15 | -------------------------------------------------------------------------------- /stories/components/skeleton/skeleton-circle.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryFn, StoryObj } from "@storybook/web-components"; 2 | import { getComponentArgs } from "../../utils/args-generation"; 3 | import { html } from "lit-html"; 4 | import { ifDefined } from "lit-html/directives/if-defined.js"; 5 | 6 | const meta: Meta = { 7 | title: 'Components/Skeleton/Skeleton Circle', 8 | component: 'wcs-skeleton-circle', 9 | argTypes: getComponentArgs('wcs-skeleton-circle') 10 | }; 11 | 12 | export default meta; 13 | 14 | type SkeletonCircleArgs = { 15 | animation: 'none' | 'glide' | 'pulse'; 16 | radius: number; 17 | } 18 | 19 | const Template: StoryFn> = (args: Partial) => html` 20 | 22 | `; 23 | 24 | /** 25 | * **Default skeleton circle example** 26 | * With an initial radius of 50px 27 | */ 28 | export const Default: StoryObj = { 29 | render: (args: SkeletonCircleArgs) => Template(args, this), 30 | args: { 31 | animation: 'glide', 32 | radius: 50, 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /stories/components/spinner/spinner.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryFn } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | import { WcsSpinnerMode } from '../../../src/components/spinner/spinner-interface'; 4 | import { getComponentArgs } from '../../utils/args-generation'; 5 | 6 | const meta: Meta = { 7 | title: 'Components/Spinner', 8 | component: 'wcs-spinner', 9 | argTypes: getComponentArgs('wcs-spinner'), 10 | }; 11 | export default meta; 12 | 13 | const Template: StoryFn> = (args) => html` 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | `; 23 | 24 | export const Default = Template.bind({}); 25 | Default.args = {mode: 'border'}; 26 | 27 | export const Growing = Template.bind({}); 28 | Growing.args = {mode: 'growing'}; 29 | -------------------------------------------------------------------------------- /stories/components/tabs/tab.stories.ts: -------------------------------------------------------------------------------- 1 | import { Meta, StoryFn, StoryObj } from '@storybook/web-components'; 2 | import { html } from 'lit-html'; 3 | import { getComponentArgs } from '../../utils/args-generation'; 4 | 5 | const meta: Meta = { 6 | title: 'Components/Tabs/Subcomponents/Tab', 7 | component: 'wcs-tab', 8 | argTypes: getComponentArgs('wcs-tab'), 9 | }; 10 | 11 | export default meta; 12 | 13 | interface TabStoryArgs { 14 | header: string, 15 | itemKey: string 16 | } 17 | 18 | const Template: StoryFn> = (args) => html` 19 | 20 | ${args.header} content 21 | 22 | `; 23 | 24 | /** 25 | * `wcs-tab` has to be child of `wcs-tabs` component 26 | */ 27 | export const Default: StoryObj = { 28 | render: (args: TabStoryArgs) => Template(args, this), 29 | args: { 30 | header: 'Tab', 31 | itemKey: 'tab' 32 | } 33 | }; 34 | -------------------------------------------------------------------------------- /stories/documentation/changelog.stories.mdx: -------------------------------------------------------------------------------- 1 | import { Meta, Markdown} from '@storybook/addon-docs'; 2 | import changelogMarkdown from '../../CHANGELOG.md' 3 | 4 | 5 | 6 | > **You can also find the changelog in the [Gitlab repository](https://gitlab.com/SNCF/wcs/-/blob/develop/CHANGELOG.md)** 7 | 8 | 9 | { changelogMarkdown } 10 | 11 | -------------------------------------------------------------------------------- /stories/documentation/migrations/v3-v4.stories.mdx: -------------------------------------------------------------------------------- 1 | import { Meta } from '@storybook/addon-docs'; 2 | 3 | 4 | 5 | # Migrate from v3 to v4 6 | 7 | WCS v4 contains breaking changes only in the following packages: 8 | - wcs-core 9 | 10 | ## wcs-core 11 | 12 | ### wcs-button 13 | 14 | - `shape="small"` doesn't exist anymore. Replace it with `size="s"` 15 | 16 | ### wcs-input 17 | 18 | - `size` property does not set the initial size of the control anymore, but the height size of the component (`s`, `m` or `l`) 19 | 20 | -------------------------------------------------------------------------------- /stories/documentation/testing.stories.mdx: -------------------------------------------------------------------------------- 1 | import { Meta } from '@storybook/addon-docs'; 2 | 3 | 4 | 5 | # Testing an application that uses WCS 6 | 7 | The main problem encountered when we want to test an application that uses WCS is the use of web components. For example 8 | SeleniumHQ still doesn't support this technology very well : https://github.com/SeleniumHQ/selenium-ide/issues/702 9 | 10 | Writing simple tests that break through the shadow dom is therefore not always easy. 11 | 12 | To solve this problem we recommend you to use the Playwright library (https://playwright.dev/) which really stood out 13 | during our tests. Especially on the following points: 14 | 15 | - Native support of the Web Components technology 16 | - Used in production by MS on Outlook / VSCode (you can feel it in the quality of the documentation and the tooling) 17 | - Used by other web component libraries 18 | - Code first approach but with a test generation tool that allows to write tests as code automatically (we combine the 19 | advantages of code and generation for the 80% of tests that can be generated with clicks) 20 | - High quality VSCode integration 21 | - Usable in the CI/CD with their docker image 22 | - Allows to run tests in parallel and on multiple browsers at the same time 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /stories/internal-documentation/Introduction.stories.mdx: -------------------------------------------------------------------------------- 1 | import { Meta } from '@storybook/addon-docs'; 2 | 3 | 4 | 5 | # Welcome to WCS developer's documentation ! 6 | 7 | This documentation is intended for internal wcs developers and maintainers. If you are a user of WCS (for example a developer using WCS in a project), this part of the storybook may not be relevant to you. 8 | 9 | This part of the doc is under construction. We are working on providing more detailed information about the internal workings of WCS. 10 | 11 | Many ressources can still be found in the CONTRIBUTING.md file of the repository. 12 | -------------------------------------------------------------------------------- /stories/internal-documentation/design-tokens/wcs-design-tokens-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/internal-documentation/design-tokens/wcs-design-tokens-diagram.png -------------------------------------------------------------------------------- /stories/internal-documentation/design-tokens/wcs-design-tokens-from-JSON-to-css.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SNCFdevelopers/wcs/766f480e1e644ea6aa3aba19af41d326c17ed01e/stories/internal-documentation/design-tokens/wcs-design-tokens-from-JSON-to-css.png -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "allowJs": true, 5 | "allowUnreachableCode": false, 6 | "declaration": false, 7 | "experimentalDecorators": true, 8 | "lib": [ 9 | "dom", 10 | "es2017" 11 | ], 12 | "moduleResolution": "node", 13 | "module": "esnext", 14 | "target": "es2017", 15 | "noUnusedLocals": true, 16 | "noUnusedParameters": true, 17 | "jsx": "react", 18 | "jsxFactory": "h" 19 | }, 20 | "include": [ 21 | "src", 22 | "types/jsx.d.ts" 23 | ], 24 | "exclude": [ 25 | "node_modules", 26 | "angular", 27 | "react", 28 | "example" 29 | ] 30 | } 31 | --------------------------------------------------------------------------------